Remove deprecated scripts for adding head-matter to wt_config.xml, including Python and Bash implementations, to streamline configuration management.

This commit is contained in:
Torsten Schulz (local)
2025-12-04 16:34:45 +01:00
parent 4b674c7c60
commit 6e9116e819
13187 changed files with 1493219 additions and 337 deletions

View File

@@ -0,0 +1,18 @@
import { getCurrentInstance } from 'vue';
import { u as useHead } from './vue.Bm-NbY4b.mjs';
const VueHeadMixin = {
created() {
let source = false;
const instance = getCurrentInstance();
if (!instance)
return;
const options = instance.type;
if (!options || !("head" in options))
return;
source = typeof options.head === "function" ? () => options.head.call(instance.proxy) : options.head;
source && useHead(source);
}
};
export { VueHeadMixin as V };

View File

@@ -0,0 +1,85 @@
import { SafeInputPlugin, FlatMetaPlugin } from 'unhead/plugins';
import { walkResolver } from 'unhead/utils';
import { hasInjectionContext, inject, ref, watchEffect, getCurrentInstance, onBeforeUnmount, onDeactivated, onActivated } from 'vue';
import { V as VueResolver } from './vue.N9zWjxoK.mjs';
const headSymbol = "usehead";
// @__NO_SIDE_EFFECTS__
function vueInstall(head) {
const plugin = {
install(app) {
app.config.globalProperties.$unhead = head;
app.config.globalProperties.$head = head;
app.provide(headSymbol, head);
}
};
return plugin.install;
}
// @__NO_SIDE_EFFECTS__
function injectHead() {
if (hasInjectionContext()) {
const instance = inject(headSymbol);
if (!instance) {
throw new Error("useHead() was called without provide context, ensure you call it through the setup() function.");
}
return instance;
}
throw new Error("useHead() was called without provide context, ensure you call it through the setup() function.");
}
function useHead(input, options = {}) {
const head = options.head || /* @__PURE__ */ injectHead();
return head.ssr ? head.push(input || {}, options) : clientUseHead(head, input, options);
}
function clientUseHead(head, input, options = {}) {
const deactivated = ref(false);
let entry;
watchEffect(() => {
const i = deactivated.value ? {} : walkResolver(input, VueResolver);
if (entry) {
entry.patch(i);
} else {
entry = head.push(i, options);
}
});
const vm = getCurrentInstance();
if (vm) {
onBeforeUnmount(() => {
entry.dispose();
});
onDeactivated(() => {
deactivated.value = true;
});
onActivated(() => {
deactivated.value = false;
});
}
return entry;
}
function useHeadSafe(input = {}, options = {}) {
const head = options.head || /* @__PURE__ */ injectHead();
head.use(SafeInputPlugin);
options._safe = true;
return useHead(input, options);
}
function useSeoMeta(input = {}, options = {}) {
const head = options.head || /* @__PURE__ */ injectHead();
head.use(FlatMetaPlugin);
const { title, titleTemplate, ...meta } = input;
return useHead({
title,
titleTemplate,
_flatMeta: meta
}, options);
}
function useServerHead(input, options = {}) {
return useHead(input, { ...options, mode: "server" });
}
function useServerHeadSafe(input, options = {}) {
return useHeadSafe(input, { ...options, mode: "server" });
}
function useServerSeoMeta(input, options = {}) {
return useSeoMeta(input, { ...options, mode: "server" });
}
export { useHeadSafe as a, useSeoMeta as b, useServerHead as c, useServerHeadSafe as d, useServerSeoMeta as e, headSymbol as h, injectHead as i, useHead as u, vueInstall as v };

View File

@@ -0,0 +1,70 @@
import { useScript as useScript$1 } from 'unhead/scripts';
import { getCurrentInstance, onMounted, isRef, watch, onScopeDispose, ref } from 'vue';
import { i as injectHead } from './vue.Bm-NbY4b.mjs';
function registerVueScopeHandlers(script, scope) {
if (!scope) {
return;
}
const _registerCb = (key, cb) => {
if (!script._cbs[key]) {
cb(script.instance);
return () => {
};
}
let i = script._cbs[key].push(cb);
const destroy = () => {
if (i) {
script._cbs[key]?.splice(i - 1, 1);
i = null;
}
};
onScopeDispose(destroy);
return destroy;
};
script.onLoaded = (cb) => _registerCb("loaded", cb);
script.onError = (cb) => _registerCb("error", cb);
onScopeDispose(() => {
script._triggerAbortController?.abort();
});
}
function useScript(_input, _options) {
const input = typeof _input === "string" ? { src: _input } : _input;
const options = _options || {};
const head = options?.head || injectHead();
options.head = head;
const scope = getCurrentInstance();
options.eventContext = scope;
if (scope && typeof options.trigger === "undefined") {
options.trigger = onMounted;
} else if (isRef(options.trigger)) {
const refTrigger = options.trigger;
let off;
options.trigger = new Promise((resolve) => {
off = watch(refTrigger, (val) => {
if (val) {
resolve(true);
}
}, {
immediate: true
});
onScopeDispose(() => resolve(false), true);
}).then((val) => {
off?.();
return val;
});
}
head._scriptStatusWatcher = head._scriptStatusWatcher || head.hooks.hook("script:updated", ({ script: s }) => {
s._statusRef.value = s.status;
});
const script = useScript$1(head, input, options);
script._statusRef = script._statusRef || ref(script.status);
registerVueScopeHandlers(script, scope);
return new Proxy(script, {
get(_, key, a) {
return Reflect.get(_, key === "status" ? "_statusRef" : key, a);
}
});
}
export { useScript as u };

View File

@@ -0,0 +1,63 @@
import { ResolvableHead, LinkWithoutEvents, DataKeys, SchemaAugmentations, UnheadMeta, Style, ScriptWithoutEvents, TagPriority, TagPosition, ResolvesDuplicates, ProcessesTemplateParams, Noscript, HtmlAttributes, BodyAttributesWithoutEvents } from 'unhead/types';
import { m as ResolvableValue, o as ResolvableProperties } from './vue.DoxLTFJk.js';
type SafeBodyAttr = ResolvableProperties<Pick<BodyAttributesWithoutEvents, 'id' | 'class' | 'style'> & DataKeys & SchemaAugmentations['bodyAttrs']>;
type SafeHtmlAttr = ResolvableProperties<Pick<HtmlAttributes, 'id' | 'class' | 'style' | 'lang' | 'dir'> & DataKeys & SchemaAugmentations['htmlAttrs']>;
type SafeMeta = ResolvableProperties<Pick<UnheadMeta, 'id' | 'name' | 'property' | 'charset' | 'content' | 'media'> & DataKeys & SchemaAugmentations['meta']>;
type SafeLink = ResolvableProperties<Pick<LinkWithoutEvents, 'id' | 'color' | 'crossorigin' | 'fetchpriority' | 'href' | 'hreflang' | 'imagesrcset' | 'imagesizes' | 'integrity' | 'media' | 'referrerpolicy' | 'rel' | 'sizes' | 'type'> & DataKeys & SchemaAugmentations['link']>;
type SafeScript = ResolvableProperties<Pick<ScriptWithoutEvents, 'id' | 'type' | 'nonce' | 'blocking'> & DataKeys & {
textContent?: string;
} & TagPriority & TagPosition & ResolvesDuplicates & ProcessesTemplateParams>;
type SafeNoscript = ResolvableProperties<Pick<Noscript, 'id'> & DataKeys & Omit<SchemaAugmentations['noscript'], 'innerHTML'>>;
type SafeStyle = ResolvableProperties<Pick<Style, 'id' | 'media' | 'nonce' | 'title' | 'blocking'> & DataKeys & Omit<SchemaAugmentations['style'], 'innerHTML'>>;
interface HeadSafe extends Pick<ResolvableHead, 'title' | 'titleTemplate' | 'templateParams'> {
/**
* The `<link>` HTML element specifies relationships between the current document and an external resource.
* This element is most commonly used to link to stylesheets, but is also used to establish site icons
* (both "favicon" style icons and icons for the home screen and apps on mobile devices) among other things.
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-as
*/
link?: ResolvableValue<ResolvableValue<SafeLink[]>>;
/**
* The `<meta>` element represents metadata that cannot be expressed in other HTML elements, like `<link>` or `<script>`.
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta
*/
meta?: ResolvableValue<ResolvableValue<SafeMeta>[]>;
/**
* The `<style>` HTML element contains style information for a document, or part of a document.
* It contains CSS, which is applied to the contents of the document containing the `<style>` element.
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/style
*/
style?: ResolvableValue<ResolvableValue<(SafeStyle | string)>[]>;
/**
* The `<script>` HTML element is used to embed executable code or data; this is typically used to embed or refer to JavaScript code.
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script
*/
script?: ResolvableValue<ResolvableValue<(SafeScript | string)>[]>;
/**
* The `<noscript>` HTML element defines a section of HTML to be inserted if a script type on the page is unsupported
* or if scripting is currently turned off in the browser.
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/noscript
*/
noscript?: ResolvableValue<ResolvableValue<(SafeNoscript | string)>[]>;
/**
* Attributes for the `<html>` HTML element.
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/html
*/
htmlAttrs?: ResolvableValue<SafeHtmlAttr>;
/**
* Attributes for the `<body>` HTML element.
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/body
*/
bodyAttrs?: ResolvableValue<SafeBodyAttr>;
}
type UseHeadSafeInput = ResolvableValue<HeadSafe>;
export type { HeadSafe as H, SafeBodyAttr as S, UseHeadSafeInput as U, SafeHtmlAttr as a, SafeMeta as b, SafeLink as c, SafeScript as d, SafeNoscript as e, SafeStyle as f };

View File

@@ -0,0 +1,63 @@
import { ResolvableHead, LinkWithoutEvents, DataKeys, SchemaAugmentations, UnheadMeta, Style, ScriptWithoutEvents, TagPriority, TagPosition, ResolvesDuplicates, ProcessesTemplateParams, Noscript, HtmlAttributes, BodyAttributesWithoutEvents } from 'unhead/types';
import { m as ResolvableValue, o as ResolvableProperties } from './vue.DoxLTFJk.mjs';
type SafeBodyAttr = ResolvableProperties<Pick<BodyAttributesWithoutEvents, 'id' | 'class' | 'style'> & DataKeys & SchemaAugmentations['bodyAttrs']>;
type SafeHtmlAttr = ResolvableProperties<Pick<HtmlAttributes, 'id' | 'class' | 'style' | 'lang' | 'dir'> & DataKeys & SchemaAugmentations['htmlAttrs']>;
type SafeMeta = ResolvableProperties<Pick<UnheadMeta, 'id' | 'name' | 'property' | 'charset' | 'content' | 'media'> & DataKeys & SchemaAugmentations['meta']>;
type SafeLink = ResolvableProperties<Pick<LinkWithoutEvents, 'id' | 'color' | 'crossorigin' | 'fetchpriority' | 'href' | 'hreflang' | 'imagesrcset' | 'imagesizes' | 'integrity' | 'media' | 'referrerpolicy' | 'rel' | 'sizes' | 'type'> & DataKeys & SchemaAugmentations['link']>;
type SafeScript = ResolvableProperties<Pick<ScriptWithoutEvents, 'id' | 'type' | 'nonce' | 'blocking'> & DataKeys & {
textContent?: string;
} & TagPriority & TagPosition & ResolvesDuplicates & ProcessesTemplateParams>;
type SafeNoscript = ResolvableProperties<Pick<Noscript, 'id'> & DataKeys & Omit<SchemaAugmentations['noscript'], 'innerHTML'>>;
type SafeStyle = ResolvableProperties<Pick<Style, 'id' | 'media' | 'nonce' | 'title' | 'blocking'> & DataKeys & Omit<SchemaAugmentations['style'], 'innerHTML'>>;
interface HeadSafe extends Pick<ResolvableHead, 'title' | 'titleTemplate' | 'templateParams'> {
/**
* The `<link>` HTML element specifies relationships between the current document and an external resource.
* This element is most commonly used to link to stylesheets, but is also used to establish site icons
* (both "favicon" style icons and icons for the home screen and apps on mobile devices) among other things.
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-as
*/
link?: ResolvableValue<ResolvableValue<SafeLink[]>>;
/**
* The `<meta>` element represents metadata that cannot be expressed in other HTML elements, like `<link>` or `<script>`.
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta
*/
meta?: ResolvableValue<ResolvableValue<SafeMeta>[]>;
/**
* The `<style>` HTML element contains style information for a document, or part of a document.
* It contains CSS, which is applied to the contents of the document containing the `<style>` element.
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/style
*/
style?: ResolvableValue<ResolvableValue<(SafeStyle | string)>[]>;
/**
* The `<script>` HTML element is used to embed executable code or data; this is typically used to embed or refer to JavaScript code.
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script
*/
script?: ResolvableValue<ResolvableValue<(SafeScript | string)>[]>;
/**
* The `<noscript>` HTML element defines a section of HTML to be inserted if a script type on the page is unsupported
* or if scripting is currently turned off in the browser.
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/noscript
*/
noscript?: ResolvableValue<ResolvableValue<(SafeNoscript | string)>[]>;
/**
* Attributes for the `<html>` HTML element.
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/html
*/
htmlAttrs?: ResolvableValue<SafeHtmlAttr>;
/**
* Attributes for the `<body>` HTML element.
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/body
*/
bodyAttrs?: ResolvableValue<SafeBodyAttr>;
}
type UseHeadSafeInput = ResolvableValue<HeadSafe>;
export type { HeadSafe as H, SafeBodyAttr as S, UseHeadSafeInput as U, SafeHtmlAttr as a, SafeMeta as b, SafeLink as c, SafeScript as d, SafeNoscript as e, SafeStyle as f };

View File

@@ -0,0 +1,5 @@
declare const VueHeadMixin: {
created(): void;
};
export { VueHeadMixin as V };

View File

@@ -0,0 +1,5 @@
declare const VueHeadMixin: {
created(): void;
};
export { VueHeadMixin as V };

View File

@@ -0,0 +1,138 @@
import { Stringable, SchemaAugmentations, ResolvableTitleTemplate as ResolvableTitleTemplate$1, Base, LinkWithoutEvents, DataKeys, MaybeEventFnHandlers, HttpEventAttributes, UnheadMeta, Style, ScriptWithoutEvents, Noscript, HtmlAttributes, MaybeArray, BodyAttributesWithoutEvents, BodyEvents, Unhead, HeadEntryOptions, MetaFlatInput } from 'unhead/types';
import { ComputedRef, Ref, CSSProperties, Plugin } from 'vue';
type Falsy = false | null | undefined;
type MaybeFalsy<T> = T | Falsy;
type ResolvableValue<T> = MaybeFalsy<T> | (() => MaybeFalsy<T>) | ComputedRef<MaybeFalsy<T>> | Ref<MaybeFalsy<T>>;
type ResolvableArray<T> = ResolvableValue<ResolvableValue<T>[]>;
type ResolvableProperties<T> = {
[key in keyof T]?: ResolvableValue<T[key]>;
};
type ResolvableUnion<T> = T extends string | number | boolean ? ResolvableValue<T> : T extends object ? DeepResolvableProperties<T> : ResolvableValue<T>;
type DeepResolvableProperties<T> = {
[K in keyof T]?: T[K] extends string | object ? T[K] extends string ? ResolvableUnion<T[K]> : T[K] extends object ? DeepResolvableProperties<T[K]> : ResolvableUnion<T[K]> : ResolvableUnion<T[K]>;
};
interface HtmlAttr extends Omit<HtmlAttributes, 'class' | 'style'> {
/**
* The class global attribute is a space-separated list of the case-sensitive classes of the element.
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/class
*/
class?: MaybeArray<ResolvableValue<Stringable> | Record<string, ResolvableValue<Stringable>>>;
/**
* The class global attribute is a space-separated list of the case-sensitive classes of the element.
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/class
*/
style?: MaybeArray<ResolvableValue<Stringable> | ResolvableProperties<CSSProperties>>;
}
interface BodyAttr extends Omit<BodyAttributesWithoutEvents, 'class' | 'style'> {
/**
* The class global attribute is a space-separated list of the case-sensitive classes of the element.
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/class
*/
class?: MaybeArray<ResolvableValue<Stringable>> | Record<string, ResolvableValue<Stringable>>;
/**
* The class global attribute is a space-separated list of the case-sensitive classes of the element.
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/class
*/
style?: MaybeArray<ResolvableValue<string>> | ResolvableProperties<CSSProperties>;
}
type ResolvableTitle = ResolvableValue<Stringable> | ResolvableProperties<({
textContent: Stringable;
} & SchemaAugmentations['title'])>;
type ResolvableTitleTemplate = ResolvableTitleTemplate$1 | Ref<string>;
type ResolvableBase = ResolvableProperties<Base & SchemaAugmentations['base']>;
type ResolvableLink = ResolvableProperties<LinkWithoutEvents & DataKeys & SchemaAugmentations['link']> & MaybeEventFnHandlers<HttpEventAttributes>;
type ResolvableMeta = ResolvableProperties<UnheadMeta & DataKeys & SchemaAugmentations['meta']>;
type ResolvableStyle = ResolvableProperties<Style & DataKeys & SchemaAugmentations['style']>;
type ResolvableScript = ResolvableProperties<ScriptWithoutEvents & DataKeys & SchemaAugmentations['script']> & MaybeEventFnHandlers<HttpEventAttributes>;
type ResolvableNoscript = ResolvableProperties<Noscript & DataKeys & SchemaAugmentations['noscript']>;
type ResolvableHtmlAttributes = ResolvableProperties<HtmlAttr & DataKeys & SchemaAugmentations['htmlAttrs']>;
type ResolvableBodyAttributes = ResolvableProperties<BodyAttr & DataKeys & SchemaAugmentations['bodyAttrs']> & MaybeEventFnHandlers<BodyEvents>;
interface ReactiveHead {
/**
* The `<title>` HTML element defines the document's title that is shown in a browser's title bar or a page's tab.
* It only contains text; tags within the element are ignored.
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/title
*/
title?: ResolvableTitle;
/**
* Generate the title from a template.
*/
titleTemplate?: ResolvableTitleTemplate;
/**
* Variables used to substitute in the title and meta content.
*/
templateParams?: ResolvableProperties<{
separator?: '|' | '-' | '·' | string;
} & Record<string, Stringable | ResolvableProperties<Record<string, Stringable>>>>;
/**
* The `<base>` HTML element specifies the base URL to use for all relative URLs in a document.
* There can be only one <base> element in a document.
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base
*/
base?: ResolvableBase;
/**
* The `<link>` HTML element specifies relationships between the current document and an external resource.
* This element is most commonly used to link to stylesheets, but is also used to establish site icons
* (both "favicon" style icons and icons for the home screen and apps on mobile devices) among other things.
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-as
*/
link?: ResolvableArray<ResolvableLink>;
/**
* The `<meta>` element represents metadata that cannot be expressed in other HTML elements, like `<link>` or `<script>`.
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta
*/
meta?: ResolvableArray<ResolvableMeta>;
/**
* The `<style>` HTML element contains style information for a document, or part of a document.
* It contains CSS, which is applied to the contents of the document containing the `<style>` element.
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/style
*/
style?: ResolvableArray<(ResolvableStyle | string)>;
/**
* The `<script>` HTML element is used to embed executable code or data; this is typically used to embed or refer to JavaScript code.
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script
*/
script?: ResolvableArray<(ResolvableScript | string)>;
/**
* The `<noscript>` HTML element defines a section of HTML to be inserted if a script type on the page is unsupported
* or if scripting is currently turned off in the browser.
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/noscript
*/
noscript?: ResolvableArray<(ResolvableNoscript | string)>;
/**
* Attributes for the `<html>` HTML element.
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/html
*/
htmlAttrs?: ResolvableHtmlAttributes;
/**
* Attributes for the `<body>` HTML element.
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/body
*/
bodyAttrs?: ResolvableBodyAttributes;
}
type UseHeadOptions = Omit<HeadEntryOptions, 'head'> & {
head?: VueHeadClient<any>;
};
type UseHeadInput<Deprecated = never> = ResolvableValue<ReactiveHead>;
type UseSeoMetaInput = ResolvableProperties<MetaFlatInput> & {
title?: ReactiveHead['title'];
titleTemplate?: ReactiveHead['titleTemplate'];
};
type VueHeadClient<I = UseHeadInput> = Unhead<I> & Plugin;
export type { BodyAttr as B, DeepResolvableProperties as D, HtmlAttr as H, MaybeFalsy as M, ResolvableTitle as R, UseHeadInput as U, VueHeadClient as V, UseHeadOptions as a, UseSeoMetaInput as b, ResolvableTitleTemplate as c, ResolvableBase as d, ResolvableLink as e, ResolvableMeta as f, ResolvableStyle as g, ResolvableScript as h, ResolvableNoscript as i, ResolvableHtmlAttributes as j, ResolvableBodyAttributes as k, ReactiveHead as l, ResolvableValue as m, ResolvableArray as n, ResolvableProperties as o, ResolvableUnion as p };

View File

@@ -0,0 +1,138 @@
import { Stringable, SchemaAugmentations, ResolvableTitleTemplate as ResolvableTitleTemplate$1, Base, LinkWithoutEvents, DataKeys, MaybeEventFnHandlers, HttpEventAttributes, UnheadMeta, Style, ScriptWithoutEvents, Noscript, HtmlAttributes, MaybeArray, BodyAttributesWithoutEvents, BodyEvents, Unhead, HeadEntryOptions, MetaFlatInput } from 'unhead/types';
import { ComputedRef, Ref, CSSProperties, Plugin } from 'vue';
type Falsy = false | null | undefined;
type MaybeFalsy<T> = T | Falsy;
type ResolvableValue<T> = MaybeFalsy<T> | (() => MaybeFalsy<T>) | ComputedRef<MaybeFalsy<T>> | Ref<MaybeFalsy<T>>;
type ResolvableArray<T> = ResolvableValue<ResolvableValue<T>[]>;
type ResolvableProperties<T> = {
[key in keyof T]?: ResolvableValue<T[key]>;
};
type ResolvableUnion<T> = T extends string | number | boolean ? ResolvableValue<T> : T extends object ? DeepResolvableProperties<T> : ResolvableValue<T>;
type DeepResolvableProperties<T> = {
[K in keyof T]?: T[K] extends string | object ? T[K] extends string ? ResolvableUnion<T[K]> : T[K] extends object ? DeepResolvableProperties<T[K]> : ResolvableUnion<T[K]> : ResolvableUnion<T[K]>;
};
interface HtmlAttr extends Omit<HtmlAttributes, 'class' | 'style'> {
/**
* The class global attribute is a space-separated list of the case-sensitive classes of the element.
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/class
*/
class?: MaybeArray<ResolvableValue<Stringable> | Record<string, ResolvableValue<Stringable>>>;
/**
* The class global attribute is a space-separated list of the case-sensitive classes of the element.
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/class
*/
style?: MaybeArray<ResolvableValue<Stringable> | ResolvableProperties<CSSProperties>>;
}
interface BodyAttr extends Omit<BodyAttributesWithoutEvents, 'class' | 'style'> {
/**
* The class global attribute is a space-separated list of the case-sensitive classes of the element.
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/class
*/
class?: MaybeArray<ResolvableValue<Stringable>> | Record<string, ResolvableValue<Stringable>>;
/**
* The class global attribute is a space-separated list of the case-sensitive classes of the element.
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/class
*/
style?: MaybeArray<ResolvableValue<string>> | ResolvableProperties<CSSProperties>;
}
type ResolvableTitle = ResolvableValue<Stringable> | ResolvableProperties<({
textContent: Stringable;
} & SchemaAugmentations['title'])>;
type ResolvableTitleTemplate = ResolvableTitleTemplate$1 | Ref<string>;
type ResolvableBase = ResolvableProperties<Base & SchemaAugmentations['base']>;
type ResolvableLink = ResolvableProperties<LinkWithoutEvents & DataKeys & SchemaAugmentations['link']> & MaybeEventFnHandlers<HttpEventAttributes>;
type ResolvableMeta = ResolvableProperties<UnheadMeta & DataKeys & SchemaAugmentations['meta']>;
type ResolvableStyle = ResolvableProperties<Style & DataKeys & SchemaAugmentations['style']>;
type ResolvableScript = ResolvableProperties<ScriptWithoutEvents & DataKeys & SchemaAugmentations['script']> & MaybeEventFnHandlers<HttpEventAttributes>;
type ResolvableNoscript = ResolvableProperties<Noscript & DataKeys & SchemaAugmentations['noscript']>;
type ResolvableHtmlAttributes = ResolvableProperties<HtmlAttr & DataKeys & SchemaAugmentations['htmlAttrs']>;
type ResolvableBodyAttributes = ResolvableProperties<BodyAttr & DataKeys & SchemaAugmentations['bodyAttrs']> & MaybeEventFnHandlers<BodyEvents>;
interface ReactiveHead {
/**
* The `<title>` HTML element defines the document's title that is shown in a browser's title bar or a page's tab.
* It only contains text; tags within the element are ignored.
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/title
*/
title?: ResolvableTitle;
/**
* Generate the title from a template.
*/
titleTemplate?: ResolvableTitleTemplate;
/**
* Variables used to substitute in the title and meta content.
*/
templateParams?: ResolvableProperties<{
separator?: '|' | '-' | '·' | string;
} & Record<string, Stringable | ResolvableProperties<Record<string, Stringable>>>>;
/**
* The `<base>` HTML element specifies the base URL to use for all relative URLs in a document.
* There can be only one <base> element in a document.
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base
*/
base?: ResolvableBase;
/**
* The `<link>` HTML element specifies relationships between the current document and an external resource.
* This element is most commonly used to link to stylesheets, but is also used to establish site icons
* (both "favicon" style icons and icons for the home screen and apps on mobile devices) among other things.
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-as
*/
link?: ResolvableArray<ResolvableLink>;
/**
* The `<meta>` element represents metadata that cannot be expressed in other HTML elements, like `<link>` or `<script>`.
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta
*/
meta?: ResolvableArray<ResolvableMeta>;
/**
* The `<style>` HTML element contains style information for a document, or part of a document.
* It contains CSS, which is applied to the contents of the document containing the `<style>` element.
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/style
*/
style?: ResolvableArray<(ResolvableStyle | string)>;
/**
* The `<script>` HTML element is used to embed executable code or data; this is typically used to embed or refer to JavaScript code.
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script
*/
script?: ResolvableArray<(ResolvableScript | string)>;
/**
* The `<noscript>` HTML element defines a section of HTML to be inserted if a script type on the page is unsupported
* or if scripting is currently turned off in the browser.
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/noscript
*/
noscript?: ResolvableArray<(ResolvableNoscript | string)>;
/**
* Attributes for the `<html>` HTML element.
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/html
*/
htmlAttrs?: ResolvableHtmlAttributes;
/**
* Attributes for the `<body>` HTML element.
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/body
*/
bodyAttrs?: ResolvableBodyAttributes;
}
type UseHeadOptions = Omit<HeadEntryOptions, 'head'> & {
head?: VueHeadClient<any>;
};
type UseHeadInput<Deprecated = never> = ResolvableValue<ReactiveHead>;
type UseSeoMetaInput = ResolvableProperties<MetaFlatInput> & {
title?: ReactiveHead['title'];
titleTemplate?: ReactiveHead['titleTemplate'];
};
type VueHeadClient<I = UseHeadInput> = Unhead<I> & Plugin;
export type { BodyAttr as B, DeepResolvableProperties as D, HtmlAttr as H, MaybeFalsy as M, ResolvableTitle as R, UseHeadInput as U, VueHeadClient as V, UseHeadOptions as a, UseSeoMetaInput as b, ResolvableTitleTemplate as c, ResolvableBase as d, ResolvableLink as e, ResolvableMeta as f, ResolvableStyle as g, ResolvableScript as h, ResolvableNoscript as i, ResolvableHtmlAttributes as j, ResolvableBodyAttributes as k, ReactiveHead as l, ResolvableValue as m, ResolvableArray as n, ResolvableProperties as o, ResolvableUnion as p };

View File

@@ -0,0 +1,7 @@
import { toValue, isRef } from 'vue';
const VueResolver = (_, value) => {
return isRef(value) ? toValue(value) : value;
};
export { VueResolver as V };