@unhead/vue 3.0.0-beta.9 → 3.0.0-rc.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client.d.mts +2 -2
- package/dist/client.d.ts +2 -2
- package/dist/client.mjs +3 -3
- package/dist/components.mjs +26 -6
- package/dist/index.d.mts +12 -3
- package/dist/index.d.ts +12 -3
- package/dist/index.mjs +5 -4
- package/dist/legacy.d.mts +6 -0
- package/dist/legacy.d.ts +6 -0
- package/dist/legacy.mjs +10 -0
- package/dist/plugins.d.mts +1 -0
- package/dist/plugins.d.ts +1 -0
- package/dist/scripts.d.mts +2 -2
- package/dist/scripts.d.ts +2 -2
- package/dist/scripts.mjs +3 -3
- package/dist/server.d.mts +3 -3
- package/dist/server.d.ts +3 -3
- package/dist/server.mjs +3 -3
- package/dist/shared/{vue.CLCWY4Ey.mjs → vue.C54fV9ES.mjs} +1 -1
- package/dist/shared/{vue.BUll6Wuy.mjs → vue.CC8Cvdls.mjs} +1 -1
- package/dist/shared/{vue.9wC_EyGs.d.mts → vue.CajUUuy2.d.mts} +4 -6
- package/dist/shared/{vue.9wC_EyGs.d.ts → vue.CajUUuy2.d.ts} +4 -6
- package/dist/shared/{vue.N9zWjxoK.mjs → vue.CkLIG7eN.mjs} +1 -1
- package/dist/shared/{vue.DdPIVN-K.mjs → vue.D51lypTh.mjs} +13 -3
- package/dist/stream/client.d.mts +2 -2
- package/dist/stream/client.d.ts +2 -2
- package/dist/stream/client.mjs +3 -3
- package/dist/stream/iife.d.mts +1 -0
- package/dist/stream/iife.d.ts +1 -0
- package/dist/stream/iife.mjs +1 -0
- package/dist/stream/server.d.mts +4 -4
- package/dist/stream/server.d.ts +4 -4
- package/dist/stream/server.mjs +3 -3
- package/dist/stream/vite.mjs +6 -3
- package/dist/types.d.mts +2 -2
- package/dist/types.d.ts +2 -2
- package/dist/utils.d.mts +7 -2
- package/dist/utils.d.ts +7 -2
- package/dist/utils.mjs +8 -1
- package/dist/vite.d.mts +33 -0
- package/dist/vite.d.ts +33 -0
- package/dist/vite.mjs +16 -0
- package/package.json +30 -8
package/dist/client.d.mts
CHANGED
|
@@ -2,9 +2,9 @@ import { CreateClientHeadOptions } from 'unhead/types';
|
|
|
2
2
|
export { CreateClientHeadOptions } from 'unhead/types';
|
|
3
3
|
export { V as VueHeadMixin } from './shared/vue.DnywREVF.mjs';
|
|
4
4
|
export { renderDOMHead } from 'unhead/client';
|
|
5
|
-
import { V as VueHeadClient } from './shared/vue.
|
|
5
|
+
import { V as VueHeadClient, U as UseHeadInput } from './shared/vue.CajUUuy2.mjs';
|
|
6
6
|
import 'vue';
|
|
7
7
|
|
|
8
|
-
declare function createHead(options?: CreateClientHeadOptions): VueHeadClient
|
|
8
|
+
declare function createHead(options?: CreateClientHeadOptions): VueHeadClient<UseHeadInput, boolean>;
|
|
9
9
|
|
|
10
10
|
export { VueHeadClient, createHead };
|
package/dist/client.d.ts
CHANGED
|
@@ -2,9 +2,9 @@ import { CreateClientHeadOptions } from 'unhead/types';
|
|
|
2
2
|
export { CreateClientHeadOptions } from 'unhead/types';
|
|
3
3
|
export { V as VueHeadMixin } from './shared/vue.DnywREVF.js';
|
|
4
4
|
export { renderDOMHead } from 'unhead/client';
|
|
5
|
-
import { V as VueHeadClient } from './shared/vue.
|
|
5
|
+
import { V as VueHeadClient, U as UseHeadInput } from './shared/vue.CajUUuy2.js';
|
|
6
6
|
import 'vue';
|
|
7
7
|
|
|
8
|
-
declare function createHead(options?: CreateClientHeadOptions): VueHeadClient
|
|
8
|
+
declare function createHead(options?: CreateClientHeadOptions): VueHeadClient<UseHeadInput, boolean>;
|
|
9
9
|
|
|
10
10
|
export { VueHeadClient, createHead };
|
package/dist/client.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { createDomRenderer, createDebouncedFn, createHead as createHead$1 } from 'unhead/client';
|
|
2
2
|
export { renderDOMHead } from 'unhead/client';
|
|
3
|
-
import { v as vueInstall } from './shared/vue.
|
|
4
|
-
export { V as VueHeadMixin } from './shared/vue.
|
|
3
|
+
import { v as vueInstall } from './shared/vue.D51lypTh.mjs';
|
|
4
|
+
export { V as VueHeadMixin } from './shared/vue.C54fV9ES.mjs';
|
|
5
5
|
import 'unhead/plugins';
|
|
6
6
|
import 'unhead/utils';
|
|
7
7
|
import 'vue';
|
|
8
|
-
import './shared/vue.
|
|
8
|
+
import './shared/vue.CkLIG7eN.mjs';
|
|
9
9
|
|
|
10
10
|
// @__NO_SIDE_EFFECTS__
|
|
11
11
|
function createHead(options = {}) {
|
package/dist/components.mjs
CHANGED
|
@@ -1,23 +1,43 @@
|
|
|
1
1
|
import { defineComponent, ref, onBeforeUnmount, watchEffect } from 'vue';
|
|
2
|
-
import { u as useHead } from './shared/vue.
|
|
2
|
+
import { u as useHead } from './shared/vue.D51lypTh.mjs';
|
|
3
3
|
import 'unhead/plugins';
|
|
4
4
|
import 'unhead/utils';
|
|
5
|
-
import './shared/vue.
|
|
5
|
+
import './shared/vue.CkLIG7eN.mjs';
|
|
6
6
|
|
|
7
|
+
function extractTextContent(children) {
|
|
8
|
+
if (!children)
|
|
9
|
+
return void 0;
|
|
10
|
+
if (typeof children === "string")
|
|
11
|
+
return children;
|
|
12
|
+
if (Array.isArray(children)) {
|
|
13
|
+
const first = children[0];
|
|
14
|
+
if (typeof first === "string")
|
|
15
|
+
return first;
|
|
16
|
+
if (first && typeof first === "object" && "children" in first)
|
|
17
|
+
return extractTextContent(first.children);
|
|
18
|
+
}
|
|
19
|
+
return void 0;
|
|
20
|
+
}
|
|
7
21
|
function addVNodeToHeadObj(node, obj) {
|
|
8
22
|
const nodeType = node.type;
|
|
9
23
|
const type = nodeType === "html" ? "htmlAttrs" : nodeType === "body" ? "bodyAttrs" : nodeType;
|
|
10
24
|
if (typeof type !== "string" || !(type in obj))
|
|
11
25
|
return;
|
|
12
|
-
const props = node.props || {};
|
|
26
|
+
const props = { ...node.props || {} };
|
|
27
|
+
const innerKey = type === "script" ? "innerHTML" : "textContent";
|
|
28
|
+
if (props.children !== void 0) {
|
|
29
|
+
props[innerKey] = props.children;
|
|
30
|
+
delete props.children;
|
|
31
|
+
}
|
|
13
32
|
if (node.children) {
|
|
14
|
-
const
|
|
15
|
-
|
|
33
|
+
const textContent = extractTextContent(node.children);
|
|
34
|
+
if (textContent !== void 0)
|
|
35
|
+
props[innerKey] = textContent;
|
|
16
36
|
}
|
|
17
37
|
if (Array.isArray(obj[type]))
|
|
18
38
|
obj[type].push(props);
|
|
19
39
|
else if (type === "title")
|
|
20
|
-
obj.title = props.
|
|
40
|
+
obj.title = props.textContent ?? props.innerHTML;
|
|
21
41
|
else
|
|
22
42
|
obj[type] = props;
|
|
23
43
|
}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import { ActiveHeadEntry } from 'unhead/types';
|
|
2
2
|
export { ActiveHeadEntry, AriaAttributes, BodyAttributesWithoutEvents, BodyEvents, DataKeys, GenericLink, GenericScript, GlobalAttributes, HeadEntryOptions, HeadTag, HttpEventAttributes, MetaFlat, MetaFlat as MetaFlatInput, RawInput, RenderSSRHeadOptions, ResolvableHead, SerializableHead, SpeculationRules, Unhead } from 'unhead/types';
|
|
3
|
-
import { V as VueHeadClient,
|
|
4
|
-
export { B as BodyAttr, D as DeepResolvableProperties, b as Head, H as HtmlAttr, M as MaybeFalsy, b as ReactiveHead,
|
|
3
|
+
import { V as VueHeadClient, U as UseHeadInput, o as UseHeadOptions, p as UseSeoMetaInput } from './shared/vue.CajUUuy2.mjs';
|
|
4
|
+
export { B as BodyAttr, D as DeepResolvableProperties, b as Head, H as HtmlAttr, M as MaybeFalsy, b as ReactiveHead, c as ResolvableArray, d as ResolvableBase, e as ResolvableBodyAttributes, f as ResolvableHtmlAttributes, g as ResolvableLink, h as ResolvableMeta, i as ResolvableNoscript, a as ResolvableProperties, j as ResolvableScript, k as ResolvableStyle, l as ResolvableTitle, m as ResolvableTitleTemplate, n as ResolvableUnion, R as ResolvableValue } from './shared/vue.CajUUuy2.mjs';
|
|
5
5
|
import { UseHeadSafeInput } from './types.mjs';
|
|
6
6
|
export { Base, BodyAttributes, HeadSafe, HtmlAttributes, Link, MergeHead, Meta, Noscript, SafeBodyAttr, SafeHtmlAttr, SafeLink, SafeMeta, SafeNoscript, SafeScript, SafeStyle, Script, Style } from './types.mjs';
|
|
7
7
|
export { AsVoidFunctions, EventHandlerOptions, RecordingEntry, ScriptInstance, UseFunctionType, UseScriptResolvedInput, UseScriptStatus, WarmupStrategy, createSpyProxy } from 'unhead/scripts';
|
|
8
8
|
export { UseScriptContext, UseScriptInput, UseScriptOptions, UseScriptReturn, VueScriptInstance, useScript } from './scripts.mjs';
|
|
9
|
+
export { resolveUnrefHeadInput } from './utils.mjs';
|
|
9
10
|
export { V as VueHeadMixin } from './shared/vue.DnywREVF.mjs';
|
|
10
11
|
export { createUnhead } from 'unhead';
|
|
11
12
|
import 'vue';
|
|
13
|
+
import 'unhead/utils';
|
|
12
14
|
|
|
13
15
|
declare const unheadVueComposablesImports: {
|
|
14
16
|
'@unhead/vue': string[];
|
|
@@ -19,6 +21,13 @@ declare function useHead<I = UseHeadInput>(input?: UseHeadInput, options?: UseHe
|
|
|
19
21
|
declare function useHeadSafe(input?: UseHeadSafeInput, options?: UseHeadOptions): ActiveHeadEntry<UseHeadSafeInput>;
|
|
20
22
|
declare function useSeoMeta(input?: UseSeoMetaInput, options?: UseHeadOptions): ActiveHeadEntry<UseSeoMetaInput>;
|
|
21
23
|
|
|
24
|
+
/** @deprecated Use `useHead` instead. */
|
|
25
|
+
declare const useServerHead: typeof useHead;
|
|
26
|
+
/** @deprecated Use `useHeadSafe` instead. */
|
|
27
|
+
declare const useServerHeadSafe: typeof useHeadSafe;
|
|
28
|
+
/** @deprecated Use `useSeoMeta` instead. */
|
|
29
|
+
declare const useServerSeoMeta: typeof useSeoMeta;
|
|
30
|
+
|
|
22
31
|
declare const headSymbol = "usehead";
|
|
23
32
|
|
|
24
|
-
export { UseHeadInput, UseHeadOptions, UseHeadSafeInput, UseSeoMetaInput, VueHeadClient, headSymbol, injectHead, unheadVueComposablesImports, useHead, useHeadSafe, useSeoMeta };
|
|
33
|
+
export { UseHeadInput, UseHeadOptions, UseHeadSafeInput, UseSeoMetaInput, VueHeadClient, headSymbol, injectHead, unheadVueComposablesImports, useHead, useHeadSafe, useSeoMeta, useServerHead, useServerHeadSafe, useServerSeoMeta };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import { ActiveHeadEntry } from 'unhead/types';
|
|
2
2
|
export { ActiveHeadEntry, AriaAttributes, BodyAttributesWithoutEvents, BodyEvents, DataKeys, GenericLink, GenericScript, GlobalAttributes, HeadEntryOptions, HeadTag, HttpEventAttributes, MetaFlat, MetaFlat as MetaFlatInput, RawInput, RenderSSRHeadOptions, ResolvableHead, SerializableHead, SpeculationRules, Unhead } from 'unhead/types';
|
|
3
|
-
import { V as VueHeadClient,
|
|
4
|
-
export { B as BodyAttr, D as DeepResolvableProperties, b as Head, H as HtmlAttr, M as MaybeFalsy, b as ReactiveHead,
|
|
3
|
+
import { V as VueHeadClient, U as UseHeadInput, o as UseHeadOptions, p as UseSeoMetaInput } from './shared/vue.CajUUuy2.js';
|
|
4
|
+
export { B as BodyAttr, D as DeepResolvableProperties, b as Head, H as HtmlAttr, M as MaybeFalsy, b as ReactiveHead, c as ResolvableArray, d as ResolvableBase, e as ResolvableBodyAttributes, f as ResolvableHtmlAttributes, g as ResolvableLink, h as ResolvableMeta, i as ResolvableNoscript, a as ResolvableProperties, j as ResolvableScript, k as ResolvableStyle, l as ResolvableTitle, m as ResolvableTitleTemplate, n as ResolvableUnion, R as ResolvableValue } from './shared/vue.CajUUuy2.js';
|
|
5
5
|
import { UseHeadSafeInput } from './types.js';
|
|
6
6
|
export { Base, BodyAttributes, HeadSafe, HtmlAttributes, Link, MergeHead, Meta, Noscript, SafeBodyAttr, SafeHtmlAttr, SafeLink, SafeMeta, SafeNoscript, SafeScript, SafeStyle, Script, Style } from './types.js';
|
|
7
7
|
export { AsVoidFunctions, EventHandlerOptions, RecordingEntry, ScriptInstance, UseFunctionType, UseScriptResolvedInput, UseScriptStatus, WarmupStrategy, createSpyProxy } from 'unhead/scripts';
|
|
8
8
|
export { UseScriptContext, UseScriptInput, UseScriptOptions, UseScriptReturn, VueScriptInstance, useScript } from './scripts.js';
|
|
9
|
+
export { resolveUnrefHeadInput } from './utils.js';
|
|
9
10
|
export { V as VueHeadMixin } from './shared/vue.DnywREVF.js';
|
|
10
11
|
export { createUnhead } from 'unhead';
|
|
11
12
|
import 'vue';
|
|
13
|
+
import 'unhead/utils';
|
|
12
14
|
|
|
13
15
|
declare const unheadVueComposablesImports: {
|
|
14
16
|
'@unhead/vue': string[];
|
|
@@ -19,6 +21,13 @@ declare function useHead<I = UseHeadInput>(input?: UseHeadInput, options?: UseHe
|
|
|
19
21
|
declare function useHeadSafe(input?: UseHeadSafeInput, options?: UseHeadOptions): ActiveHeadEntry<UseHeadSafeInput>;
|
|
20
22
|
declare function useSeoMeta(input?: UseSeoMetaInput, options?: UseHeadOptions): ActiveHeadEntry<UseSeoMetaInput>;
|
|
21
23
|
|
|
24
|
+
/** @deprecated Use `useHead` instead. */
|
|
25
|
+
declare const useServerHead: typeof useHead;
|
|
26
|
+
/** @deprecated Use `useHeadSafe` instead. */
|
|
27
|
+
declare const useServerHeadSafe: typeof useHeadSafe;
|
|
28
|
+
/** @deprecated Use `useSeoMeta` instead. */
|
|
29
|
+
declare const useServerSeoMeta: typeof useSeoMeta;
|
|
30
|
+
|
|
22
31
|
declare const headSymbol = "usehead";
|
|
23
32
|
|
|
24
|
-
export { UseHeadInput, UseHeadOptions, UseHeadSafeInput, UseSeoMetaInput, VueHeadClient, headSymbol, injectHead, unheadVueComposablesImports, useHead, useHeadSafe, useSeoMeta };
|
|
33
|
+
export { UseHeadInput, UseHeadOptions, UseHeadSafeInput, UseSeoMetaInput, VueHeadClient, headSymbol, injectHead, unheadVueComposablesImports, useHead, useHeadSafe, useSeoMeta, useServerHead, useServerHeadSafe, useServerSeoMeta };
|
package/dist/index.mjs
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
export { h as headSymbol, i as injectHead, u as useHead, a as useHeadSafe, b as useSeoMeta } from './shared/vue.
|
|
2
|
-
export {
|
|
1
|
+
export { h as headSymbol, i as injectHead, u as useHead, a as useHeadSafe, b as useSeoMeta, c as useServerHead, d as useServerHeadSafe, e as useServerSeoMeta } from './shared/vue.D51lypTh.mjs';
|
|
2
|
+
export { resolveUnrefHeadInput } from './utils.mjs';
|
|
3
|
+
export { V as VueHeadMixin } from './shared/vue.C54fV9ES.mjs';
|
|
3
4
|
export { createUnhead } from 'unhead';
|
|
4
|
-
export { u as useScript } from './shared/vue.
|
|
5
|
+
export { u as useScript } from './shared/vue.CC8Cvdls.mjs';
|
|
5
6
|
import 'unhead/plugins';
|
|
6
7
|
import 'unhead/utils';
|
|
7
8
|
import 'vue';
|
|
8
|
-
import './shared/vue.
|
|
9
|
+
import './shared/vue.CkLIG7eN.mjs';
|
|
9
10
|
import 'unhead/scripts';
|
|
10
11
|
|
|
11
12
|
const unheadVueComposablesImports = {
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { createHead } from './client.mjs';
|
|
2
|
+
export { CreateClientHeadOptions } from 'unhead/types';
|
|
3
|
+
export { V as VueHeadClient } from './shared/vue.CajUUuy2.mjs';
|
|
4
|
+
export { V as VueHeadMixin } from './shared/vue.DnywREVF.mjs';
|
|
5
|
+
export { renderDOMHead } from 'unhead/client';
|
|
6
|
+
import 'vue';
|
package/dist/legacy.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { createHead } from './client.js';
|
|
2
|
+
export { CreateClientHeadOptions } from 'unhead/types';
|
|
3
|
+
export { V as VueHeadClient } from './shared/vue.CajUUuy2.js';
|
|
4
|
+
export { V as VueHeadMixin } from './shared/vue.DnywREVF.js';
|
|
5
|
+
export { renderDOMHead } from 'unhead/client';
|
|
6
|
+
import 'vue';
|
package/dist/legacy.mjs
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { createHead } from './client.mjs';
|
|
2
|
+
export { V as VueHeadMixin } from './shared/vue.C54fV9ES.mjs';
|
|
3
|
+
export { renderDOMHead } from 'unhead/client';
|
|
4
|
+
import './shared/vue.D51lypTh.mjs';
|
|
5
|
+
import 'unhead/plugins';
|
|
6
|
+
import 'unhead/utils';
|
|
7
|
+
import 'vue';
|
|
8
|
+
import './shared/vue.CkLIG7eN.mjs';
|
|
9
|
+
|
|
10
|
+
console.warn("[unhead] `@unhead/vue/legacy` is deprecated. Import from `@unhead/vue/client` or `@unhead/vue/server` instead.");
|
package/dist/plugins.d.mts
CHANGED
package/dist/plugins.d.ts
CHANGED
package/dist/scripts.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { UseScriptOptions as UseScriptOptions$1,
|
|
1
|
+
import { ScriptInstance, UseScriptStatus, UseScriptOptions as UseScriptOptions$1, UseFunctionType } from 'unhead/scripts';
|
|
2
2
|
export { AsVoidFunctions, EventHandlerOptions, RecordingEntry, ScriptInstance, UseFunctionType, UseScriptResolvedInput, UseScriptStatus, WarmupStrategy, createSpyProxy } from 'unhead/scripts';
|
|
3
3
|
import { GenericScript, DataKeys, SchemaAugmentations, HeadEntryOptions } from 'unhead/types';
|
|
4
4
|
import { Ref } from 'vue';
|
|
5
|
-
import { a as ResolvableProperties, V as VueHeadClient } from './shared/vue.
|
|
5
|
+
import { a as ResolvableProperties, V as VueHeadClient } from './shared/vue.CajUUuy2.mjs';
|
|
6
6
|
|
|
7
7
|
interface VueScriptInstance<T extends Record<symbol | string, any>> extends Omit<ScriptInstance<T>, 'status'> {
|
|
8
8
|
status: Ref<UseScriptStatus>;
|
package/dist/scripts.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { UseScriptOptions as UseScriptOptions$1,
|
|
1
|
+
import { ScriptInstance, UseScriptStatus, UseScriptOptions as UseScriptOptions$1, UseFunctionType } from 'unhead/scripts';
|
|
2
2
|
export { AsVoidFunctions, EventHandlerOptions, RecordingEntry, ScriptInstance, UseFunctionType, UseScriptResolvedInput, UseScriptStatus, WarmupStrategy, createSpyProxy } from 'unhead/scripts';
|
|
3
3
|
import { GenericScript, DataKeys, SchemaAugmentations, HeadEntryOptions } from 'unhead/types';
|
|
4
4
|
import { Ref } from 'vue';
|
|
5
|
-
import { a as ResolvableProperties, V as VueHeadClient } from './shared/vue.
|
|
5
|
+
import { a as ResolvableProperties, V as VueHeadClient } from './shared/vue.CajUUuy2.js';
|
|
6
6
|
|
|
7
7
|
interface VueScriptInstance<T extends Record<symbol | string, any>> extends Omit<ScriptInstance<T>, 'status'> {
|
|
8
8
|
status: Ref<UseScriptStatus>;
|
package/dist/scripts.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { createSpyProxy } from 'unhead/scripts';
|
|
2
|
-
export { u as useScript } from './shared/vue.
|
|
2
|
+
export { u as useScript } from './shared/vue.CC8Cvdls.mjs';
|
|
3
3
|
import 'vue';
|
|
4
|
-
import './shared/vue.
|
|
4
|
+
import './shared/vue.D51lypTh.mjs';
|
|
5
5
|
import 'unhead/plugins';
|
|
6
6
|
import 'unhead/utils';
|
|
7
|
-
import './shared/vue.
|
|
7
|
+
import './shared/vue.CkLIG7eN.mjs';
|
package/dist/server.d.mts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { CreateServerHeadOptions } from 'unhead/types';
|
|
1
|
+
import { CreateServerHeadOptions, SSRHeadPayload } from 'unhead/types';
|
|
2
2
|
export { CreateServerHeadOptions } from 'unhead/types';
|
|
3
3
|
export { V as VueHeadMixin } from './shared/vue.DnywREVF.mjs';
|
|
4
4
|
export { SSRHeadPayload, propsToString, renderSSRHead, transformHtmlTemplate } from 'unhead/server';
|
|
5
|
-
import { V as VueHeadClient } from './shared/vue.
|
|
5
|
+
import { V as VueHeadClient, U as UseHeadInput } from './shared/vue.CajUUuy2.mjs';
|
|
6
6
|
import 'vue';
|
|
7
7
|
|
|
8
|
-
declare function createHead(options?: Omit<CreateServerHeadOptions, 'propsResolver'>): VueHeadClient
|
|
8
|
+
declare function createHead(options?: Omit<CreateServerHeadOptions, 'propsResolver'>): VueHeadClient<UseHeadInput, SSRHeadPayload>;
|
|
9
9
|
|
|
10
10
|
export { VueHeadClient, createHead };
|
package/dist/server.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { CreateServerHeadOptions } from 'unhead/types';
|
|
1
|
+
import { CreateServerHeadOptions, SSRHeadPayload } from 'unhead/types';
|
|
2
2
|
export { CreateServerHeadOptions } from 'unhead/types';
|
|
3
3
|
export { V as VueHeadMixin } from './shared/vue.DnywREVF.js';
|
|
4
4
|
export { SSRHeadPayload, propsToString, renderSSRHead, transformHtmlTemplate } from 'unhead/server';
|
|
5
|
-
import { V as VueHeadClient } from './shared/vue.
|
|
5
|
+
import { V as VueHeadClient, U as UseHeadInput } from './shared/vue.CajUUuy2.js';
|
|
6
6
|
import 'vue';
|
|
7
7
|
|
|
8
|
-
declare function createHead(options?: Omit<CreateServerHeadOptions, 'propsResolver'>): VueHeadClient
|
|
8
|
+
declare function createHead(options?: Omit<CreateServerHeadOptions, 'propsResolver'>): VueHeadClient<UseHeadInput, SSRHeadPayload>;
|
|
9
9
|
|
|
10
10
|
export { VueHeadClient, createHead };
|
package/dist/server.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { createHead as createHead$1 } from 'unhead/server';
|
|
2
2
|
export { propsToString, renderSSRHead, transformHtmlTemplate } from 'unhead/server';
|
|
3
|
-
import { v as vueInstall } from './shared/vue.
|
|
4
|
-
import { V as VueResolver } from './shared/vue.
|
|
5
|
-
export { V as VueHeadMixin } from './shared/vue.
|
|
3
|
+
import { v as vueInstall } from './shared/vue.D51lypTh.mjs';
|
|
4
|
+
import { V as VueResolver } from './shared/vue.CkLIG7eN.mjs';
|
|
5
|
+
export { V as VueHeadMixin } from './shared/vue.C54fV9ES.mjs';
|
|
6
6
|
import 'unhead/plugins';
|
|
7
7
|
import 'unhead/utils';
|
|
8
8
|
import 'vue';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useScript as useScript$1 } from 'unhead/scripts';
|
|
2
2
|
import { getCurrentInstance, onMounted, isRef, watch, onScopeDispose, ref } from 'vue';
|
|
3
|
-
import { i as injectHead } from './vue.
|
|
3
|
+
import { i as injectHead } from './vue.D51lypTh.mjs';
|
|
4
4
|
|
|
5
5
|
function registerVueScopeHandlers(script, scope) {
|
|
6
6
|
if (!scope) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Stringable, SchemaAugmentations, ResolvableTitleTemplate as ResolvableTitleTemplate$1, Base, MaybeEventFnHandlers, Link, LinkHttpEvents, UnheadMeta, Style, DataKeys, Script, ScriptHttpEvents, Noscript, HtmlAttributes,
|
|
1
|
+
import { BodyAttributesWithoutEvents, MaybeArray, Stringable, SchemaAugmentations, ResolvableTitleTemplate as ResolvableTitleTemplate$1, ResolvableTemplateParams, Base, MaybeEventFnHandlers, Link, LinkHttpEvents, UnheadMeta, Style, DataKeys, Script, ScriptHttpEvents, Noscript, HtmlAttributes, BodyEvents, HeadEntryOptions, Unhead, MetaFlat } from 'unhead/types';
|
|
2
2
|
import { ComputedRef, Ref, CSSProperties, Plugin } from 'vue';
|
|
3
3
|
|
|
4
4
|
type Falsy = false | null | undefined;
|
|
@@ -76,9 +76,7 @@ interface ReactiveHead {
|
|
|
76
76
|
/**
|
|
77
77
|
* Variables used to substitute in the title and meta content.
|
|
78
78
|
*/
|
|
79
|
-
templateParams?: ResolvableProperties<
|
|
80
|
-
separator?: '|' | '-' | '·' | string;
|
|
81
|
-
} & Record<string, Stringable | ResolvableProperties<Record<string, Stringable>>>>;
|
|
79
|
+
templateParams?: ResolvableProperties<ResolvableTemplateParams>;
|
|
82
80
|
/**
|
|
83
81
|
* The `<base>` HTML element specifies the base URL to use for all relative URLs in a document.
|
|
84
82
|
* There can be only one <base> element in a document.
|
|
@@ -141,6 +139,6 @@ type UseSeoMetaInput = ResolvableProperties<MetaFlat> & {
|
|
|
141
139
|
title?: ReactiveHead['title'];
|
|
142
140
|
titleTemplate?: ReactiveHead['titleTemplate'];
|
|
143
141
|
};
|
|
144
|
-
type VueHeadClient<I = UseHeadInput> = Unhead<I> & Plugin;
|
|
142
|
+
type VueHeadClient<I = UseHeadInput, R = unknown> = Unhead<I, R> & Plugin;
|
|
145
143
|
|
|
146
|
-
export type { BodyAttr as B, DeepResolvableProperties as D, HtmlAttr as H, MaybeFalsy as M, ResolvableValue as R,
|
|
144
|
+
export type { BodyAttr as B, DeepResolvableProperties as D, HtmlAttr as H, MaybeFalsy as M, ResolvableValue as R, UseHeadInput as U, VueHeadClient as V, ResolvableProperties as a, ReactiveHead as b, ResolvableArray as c, ResolvableBase as d, ResolvableBodyAttributes as e, ResolvableHtmlAttributes as f, ResolvableLink as g, ResolvableMeta as h, ResolvableNoscript as i, ResolvableScript as j, ResolvableStyle as k, ResolvableTitle as l, ResolvableTitleTemplate as m, ResolvableUnion as n, UseHeadOptions as o, UseSeoMetaInput as p };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Stringable, SchemaAugmentations, ResolvableTitleTemplate as ResolvableTitleTemplate$1, Base, MaybeEventFnHandlers, Link, LinkHttpEvents, UnheadMeta, Style, DataKeys, Script, ScriptHttpEvents, Noscript, HtmlAttributes,
|
|
1
|
+
import { BodyAttributesWithoutEvents, MaybeArray, Stringable, SchemaAugmentations, ResolvableTitleTemplate as ResolvableTitleTemplate$1, ResolvableTemplateParams, Base, MaybeEventFnHandlers, Link, LinkHttpEvents, UnheadMeta, Style, DataKeys, Script, ScriptHttpEvents, Noscript, HtmlAttributes, BodyEvents, HeadEntryOptions, Unhead, MetaFlat } from 'unhead/types';
|
|
2
2
|
import { ComputedRef, Ref, CSSProperties, Plugin } from 'vue';
|
|
3
3
|
|
|
4
4
|
type Falsy = false | null | undefined;
|
|
@@ -76,9 +76,7 @@ interface ReactiveHead {
|
|
|
76
76
|
/**
|
|
77
77
|
* Variables used to substitute in the title and meta content.
|
|
78
78
|
*/
|
|
79
|
-
templateParams?: ResolvableProperties<
|
|
80
|
-
separator?: '|' | '-' | '·' | string;
|
|
81
|
-
} & Record<string, Stringable | ResolvableProperties<Record<string, Stringable>>>>;
|
|
79
|
+
templateParams?: ResolvableProperties<ResolvableTemplateParams>;
|
|
82
80
|
/**
|
|
83
81
|
* The `<base>` HTML element specifies the base URL to use for all relative URLs in a document.
|
|
84
82
|
* There can be only one <base> element in a document.
|
|
@@ -141,6 +139,6 @@ type UseSeoMetaInput = ResolvableProperties<MetaFlat> & {
|
|
|
141
139
|
title?: ReactiveHead['title'];
|
|
142
140
|
titleTemplate?: ReactiveHead['titleTemplate'];
|
|
143
141
|
};
|
|
144
|
-
type VueHeadClient<I = UseHeadInput> = Unhead<I> & Plugin;
|
|
142
|
+
type VueHeadClient<I = UseHeadInput, R = unknown> = Unhead<I, R> & Plugin;
|
|
145
143
|
|
|
146
|
-
export type { BodyAttr as B, DeepResolvableProperties as D, HtmlAttr as H, MaybeFalsy as M, ResolvableValue as R,
|
|
144
|
+
export type { BodyAttr as B, DeepResolvableProperties as D, HtmlAttr as H, MaybeFalsy as M, ResolvableValue as R, UseHeadInput as U, VueHeadClient as V, ResolvableProperties as a, ReactiveHead as b, ResolvableArray as c, ResolvableBase as d, ResolvableBodyAttributes as e, ResolvableHtmlAttributes as f, ResolvableLink as g, ResolvableMeta as h, ResolvableNoscript as i, ResolvableScript as j, ResolvableStyle as k, ResolvableTitle as l, ResolvableTitleTemplate as m, ResolvableUnion as n, UseHeadOptions as o, UseSeoMetaInput as p };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SafeInputPlugin, FlatMetaPlugin } from 'unhead/plugins';
|
|
2
2
|
import { walkResolver } from 'unhead/utils';
|
|
3
|
-
import { hasInjectionContext, inject, ref, watchEffect, getCurrentInstance, onBeforeUnmount, onDeactivated, onActivated } from 'vue';
|
|
4
|
-
import { V as VueResolver } from './vue.
|
|
3
|
+
import { hasInjectionContext, inject, ref, getCurrentScope, watchEffect, getCurrentInstance, onBeforeUnmount, onDeactivated, onActivated } from 'vue';
|
|
4
|
+
import { V as VueResolver } from './vue.CkLIG7eN.mjs';
|
|
5
5
|
|
|
6
6
|
const headSymbol = "usehead";
|
|
7
7
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -32,6 +32,13 @@ function useHead(input, options = {}) {
|
|
|
32
32
|
}
|
|
33
33
|
function clientUseHead(head, input, options = {}) {
|
|
34
34
|
const deactivated = ref(false);
|
|
35
|
+
if (options.onRendered) {
|
|
36
|
+
const scope = getCurrentScope();
|
|
37
|
+
if (scope) {
|
|
38
|
+
const _onRendered = options.onRendered;
|
|
39
|
+
options = { ...options, onRendered: (ctx) => scope.run(() => _onRendered(ctx)) };
|
|
40
|
+
}
|
|
41
|
+
}
|
|
35
42
|
let entry;
|
|
36
43
|
watchEffect(() => {
|
|
37
44
|
const i = deactivated.value ? {} : walkResolver(input, VueResolver);
|
|
@@ -71,5 +78,8 @@ function useSeoMeta(input = {}, options = {}) {
|
|
|
71
78
|
_flatMeta: meta
|
|
72
79
|
}, options);
|
|
73
80
|
}
|
|
81
|
+
const useServerHead = useHead;
|
|
82
|
+
const useServerHeadSafe = useHeadSafe;
|
|
83
|
+
const useServerSeoMeta = useSeoMeta;
|
|
74
84
|
|
|
75
|
-
export { useHeadSafe as a, useSeoMeta as b, headSymbol as h, injectHead as i, useHead as u, vueInstall as v };
|
|
85
|
+
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 };
|
package/dist/stream/client.d.mts
CHANGED
|
@@ -2,7 +2,7 @@ import * as vue from 'vue';
|
|
|
2
2
|
import { CreateStreamableClientHeadOptions } from 'unhead/stream/client';
|
|
3
3
|
export { CreateStreamableClientHeadOptions, UnheadStreamQueue } from 'unhead/stream/client';
|
|
4
4
|
export { V as VueHeadMixin } from '../shared/vue.DnywREVF.mjs';
|
|
5
|
-
import { V as VueHeadClient } from '../shared/vue.
|
|
5
|
+
import { V as VueHeadClient, U as UseHeadInput } from '../shared/vue.CajUUuy2.mjs';
|
|
6
6
|
import 'unhead/types';
|
|
7
7
|
|
|
8
8
|
/**
|
|
@@ -12,6 +12,6 @@ declare const HeadStream: vue.DefineComponent<{}, () => null, {}, {}, {}, vue.Co
|
|
|
12
12
|
/**
|
|
13
13
|
* Creates a client head by wrapping the core instance from the iife script.
|
|
14
14
|
*/
|
|
15
|
-
declare function createStreamableHead(options?: CreateStreamableClientHeadOptions): VueHeadClient | undefined;
|
|
15
|
+
declare function createStreamableHead(options?: CreateStreamableClientHeadOptions): VueHeadClient<UseHeadInput, boolean> | undefined;
|
|
16
16
|
|
|
17
17
|
export { HeadStream, VueHeadClient, createStreamableHead };
|
package/dist/stream/client.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import * as vue from 'vue';
|
|
|
2
2
|
import { CreateStreamableClientHeadOptions } from 'unhead/stream/client';
|
|
3
3
|
export { CreateStreamableClientHeadOptions, UnheadStreamQueue } from 'unhead/stream/client';
|
|
4
4
|
export { V as VueHeadMixin } from '../shared/vue.DnywREVF.js';
|
|
5
|
-
import { V as VueHeadClient } from '../shared/vue.
|
|
5
|
+
import { V as VueHeadClient, U as UseHeadInput } from '../shared/vue.CajUUuy2.js';
|
|
6
6
|
import 'unhead/types';
|
|
7
7
|
|
|
8
8
|
/**
|
|
@@ -12,6 +12,6 @@ declare const HeadStream: vue.DefineComponent<{}, () => null, {}, {}, {}, vue.Co
|
|
|
12
12
|
/**
|
|
13
13
|
* Creates a client head by wrapping the core instance from the iife script.
|
|
14
14
|
*/
|
|
15
|
-
declare function createStreamableHead(options?: CreateStreamableClientHeadOptions): VueHeadClient | undefined;
|
|
15
|
+
declare function createStreamableHead(options?: CreateStreamableClientHeadOptions): VueHeadClient<UseHeadInput, boolean> | undefined;
|
|
16
16
|
|
|
17
17
|
export { HeadStream, VueHeadClient, createStreamableHead };
|
package/dist/stream/client.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { createStreamableHead as createStreamableHead$1 } from 'unhead/stream/client';
|
|
2
2
|
import { defineComponent } from 'vue';
|
|
3
|
-
import { v as vueInstall } from '../shared/vue.
|
|
4
|
-
import { V as VueResolver } from '../shared/vue.
|
|
5
|
-
export { V as VueHeadMixin } from '../shared/vue.
|
|
3
|
+
import { v as vueInstall } from '../shared/vue.D51lypTh.mjs';
|
|
4
|
+
import { V as VueResolver } from '../shared/vue.CkLIG7eN.mjs';
|
|
5
|
+
export { V as VueHeadMixin } from '../shared/vue.C54fV9ES.mjs';
|
|
6
6
|
import 'unhead/plugins';
|
|
7
7
|
import 'unhead/utils';
|
|
8
8
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { streamingIifeCode, streamingIifeSize } from 'unhead/stream/iife';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { streamingIifeCode, streamingIifeSize } from 'unhead/stream/iife';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { streamingIifeCode, streamingIifeSize } from 'unhead/stream/iife';
|
package/dist/stream/server.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as vue from 'vue';
|
|
2
2
|
import { WebStreamableHeadContext } from 'unhead/stream/server';
|
|
3
|
-
export { CreateStreamableServerHeadOptions, StreamingTemplateParts, prepareStreamingTemplate, renderSSRHeadShell, renderSSRHeadSuspenseChunk, wrapStream } from 'unhead/stream/server';
|
|
4
|
-
import { ResolvableHead, CreateStreamableServerHeadOptions } from 'unhead/types';
|
|
5
|
-
import { V as VueHeadClient } from '../shared/vue.
|
|
3
|
+
export { CreateStreamableServerHeadOptions, StreamingTemplateParts, createBootstrapScript, prepareStreamingTemplate, renderSSRHeadShell, renderSSRHeadSuspenseChunk, renderShell, wrapStream } from 'unhead/stream/server';
|
|
4
|
+
import { ResolvableHead, SSRHeadPayload, CreateStreamableServerHeadOptions } from 'unhead/types';
|
|
5
|
+
import { V as VueHeadClient } from '../shared/vue.CajUUuy2.mjs';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Streaming script component - outputs inline script with current head state.
|
|
@@ -19,7 +19,7 @@ interface VueStreamableHeadContext extends Omit<WebStreamableHeadContext<Resolva
|
|
|
19
19
|
/**
|
|
20
20
|
* The Vue head instance to use with app.use(head)
|
|
21
21
|
*/
|
|
22
|
-
head: VueHeadClient
|
|
22
|
+
head: VueHeadClient<any, SSRHeadPayload>;
|
|
23
23
|
}
|
|
24
24
|
/**
|
|
25
25
|
* Creates a head instance configured for Vue streaming SSR.
|
package/dist/stream/server.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as vue from 'vue';
|
|
2
2
|
import { WebStreamableHeadContext } from 'unhead/stream/server';
|
|
3
|
-
export { CreateStreamableServerHeadOptions, StreamingTemplateParts, prepareStreamingTemplate, renderSSRHeadShell, renderSSRHeadSuspenseChunk, wrapStream } from 'unhead/stream/server';
|
|
4
|
-
import { ResolvableHead, CreateStreamableServerHeadOptions } from 'unhead/types';
|
|
5
|
-
import { V as VueHeadClient } from '../shared/vue.
|
|
3
|
+
export { CreateStreamableServerHeadOptions, StreamingTemplateParts, createBootstrapScript, prepareStreamingTemplate, renderSSRHeadShell, renderSSRHeadSuspenseChunk, renderShell, wrapStream } from 'unhead/stream/server';
|
|
4
|
+
import { ResolvableHead, SSRHeadPayload, CreateStreamableServerHeadOptions } from 'unhead/types';
|
|
5
|
+
import { V as VueHeadClient } from '../shared/vue.CajUUuy2.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Streaming script component - outputs inline script with current head state.
|
|
@@ -19,7 +19,7 @@ interface VueStreamableHeadContext extends Omit<WebStreamableHeadContext<Resolva
|
|
|
19
19
|
/**
|
|
20
20
|
* The Vue head instance to use with app.use(head)
|
|
21
21
|
*/
|
|
22
|
-
head: VueHeadClient
|
|
22
|
+
head: VueHeadClient<any, SSRHeadPayload>;
|
|
23
23
|
}
|
|
24
24
|
/**
|
|
25
25
|
* Creates a head instance configured for Vue streaming SSR.
|
package/dist/stream/server.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { renderSSRHeadSuspenseChunk, createStreamableHead as createStreamableHead$1, wrapStream } from 'unhead/stream/server';
|
|
2
|
-
export { prepareStreamingTemplate, renderSSRHeadShell, renderSSRHeadSuspenseChunk, wrapStream } from 'unhead/stream/server';
|
|
2
|
+
export { createBootstrapScript, prepareStreamingTemplate, renderSSRHeadShell, renderSSRHeadSuspenseChunk, renderShell, wrapStream } from 'unhead/stream/server';
|
|
3
3
|
import { defineComponent, h } from 'vue';
|
|
4
|
-
import { i as injectHead, v as vueInstall } from '../shared/vue.
|
|
5
|
-
import { V as VueResolver } from '../shared/vue.
|
|
4
|
+
import { i as injectHead, v as vueInstall } from '../shared/vue.D51lypTh.mjs';
|
|
5
|
+
import { V as VueResolver } from '../shared/vue.CkLIG7eN.mjs';
|
|
6
6
|
import 'unhead/plugins';
|
|
7
7
|
import 'unhead/utils';
|
|
8
8
|
|
package/dist/stream/vite.mjs
CHANGED
|
@@ -2,16 +2,19 @@ import MagicString from 'magic-string';
|
|
|
2
2
|
import { parseAndWalk } from 'oxc-walker';
|
|
3
3
|
import { createStreamingPlugin } from 'unhead/stream/vite';
|
|
4
4
|
|
|
5
|
+
const TEMPLATE_RE = /<template[^>]*>/;
|
|
6
|
+
const SCRIPT_RE = /<script[^>]*>/i;
|
|
7
|
+
const FILTER_RE = /\.vue$/;
|
|
5
8
|
function transform(code, id, isSSR, s) {
|
|
6
9
|
if (!code.includes("useHead") && !code.includes("useSeoMeta") && !code.includes("useHeadSafe"))
|
|
7
10
|
return false;
|
|
8
|
-
const templateMatch = code.match(
|
|
11
|
+
const templateMatch = code.match(TEMPLATE_RE);
|
|
9
12
|
if (!templateMatch)
|
|
10
13
|
return false;
|
|
11
14
|
const templateStart = templateMatch.index + templateMatch[0].length;
|
|
12
15
|
s.appendRight(templateStart, "<HeadStream />");
|
|
13
16
|
const importPath = `@unhead/vue/stream/${isSSR ? "server" : "client"}`;
|
|
14
|
-
const scriptMatch = code.match(
|
|
17
|
+
const scriptMatch = code.match(SCRIPT_RE);
|
|
15
18
|
if (!scriptMatch)
|
|
16
19
|
return true;
|
|
17
20
|
const scriptEnd = scriptMatch.index + scriptMatch[0].length;
|
|
@@ -50,7 +53,7 @@ import { HeadStream } from '${importPath}'`);
|
|
|
50
53
|
function unheadVuePlugin(options) {
|
|
51
54
|
return createStreamingPlugin({
|
|
52
55
|
framework: "@unhead/vue",
|
|
53
|
-
filter:
|
|
56
|
+
filter: FILTER_RE,
|
|
54
57
|
mode: options?.mode,
|
|
55
58
|
transform(code, id, opts) {
|
|
56
59
|
const s = new MagicString(code);
|
package/dist/types.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ResolvableHead, GenericLink, DataKeys, SchemaAugmentations, MetaGeneric, Style as Style$1, GenericScript, TagPriority, TagPosition, ResolvesDuplicates, ProcessesTemplateParams, Noscript as Noscript$1, HtmlAttributes as HtmlAttributes$1, BodyAttributesWithoutEvents, RawInput } from 'unhead/types';
|
|
2
2
|
export { ActiveHeadEntry, AriaAttributes, BodyAttributesWithoutEvents, BodyEvents, DataKeys, GenericLink, GenericScript, GlobalAttributes, HeadEntryOptions, HeadTag, HttpEventAttributes, MetaFlat, MetaFlat as MetaFlatInput, RawInput, RenderSSRHeadOptions, ResolvableHead, SerializableHead, SpeculationRules, Unhead } from 'unhead/types';
|
|
3
|
-
import { R as ResolvableValue, a as ResolvableProperties } from './shared/vue.
|
|
4
|
-
export { B as BodyAttr, D as DeepResolvableProperties, b as Head, H as HtmlAttr, M as MaybeFalsy, b as ReactiveHead,
|
|
3
|
+
import { R as ResolvableValue, a as ResolvableProperties } from './shared/vue.CajUUuy2.mjs';
|
|
4
|
+
export { B as BodyAttr, D as DeepResolvableProperties, b as Head, H as HtmlAttr, M as MaybeFalsy, b as ReactiveHead, c as ResolvableArray, d as ResolvableBase, e as ResolvableBodyAttributes, f as ResolvableHtmlAttributes, g as ResolvableLink, h as ResolvableMeta, i as ResolvableNoscript, j as ResolvableScript, k as ResolvableStyle, l as ResolvableTitle, m as ResolvableTitleTemplate, n as ResolvableUnion, U as UseHeadInput, o as UseHeadOptions, p as UseSeoMetaInput, V as VueHeadClient } from './shared/vue.CajUUuy2.mjs';
|
|
5
5
|
import 'vue';
|
|
6
6
|
|
|
7
7
|
type SafeBodyAttr = ResolvableProperties<Pick<BodyAttributesWithoutEvents, 'id' | 'class' | 'style'> & DataKeys & SchemaAugmentations['bodyAttrs']>;
|
package/dist/types.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ResolvableHead, GenericLink, DataKeys, SchemaAugmentations, MetaGeneric, Style as Style$1, GenericScript, TagPriority, TagPosition, ResolvesDuplicates, ProcessesTemplateParams, Noscript as Noscript$1, HtmlAttributes as HtmlAttributes$1, BodyAttributesWithoutEvents, RawInput } from 'unhead/types';
|
|
2
2
|
export { ActiveHeadEntry, AriaAttributes, BodyAttributesWithoutEvents, BodyEvents, DataKeys, GenericLink, GenericScript, GlobalAttributes, HeadEntryOptions, HeadTag, HttpEventAttributes, MetaFlat, MetaFlat as MetaFlatInput, RawInput, RenderSSRHeadOptions, ResolvableHead, SerializableHead, SpeculationRules, Unhead } from 'unhead/types';
|
|
3
|
-
import { R as ResolvableValue, a as ResolvableProperties } from './shared/vue.
|
|
4
|
-
export { B as BodyAttr, D as DeepResolvableProperties, b as Head, H as HtmlAttr, M as MaybeFalsy, b as ReactiveHead,
|
|
3
|
+
import { R as ResolvableValue, a as ResolvableProperties } from './shared/vue.CajUUuy2.js';
|
|
4
|
+
export { B as BodyAttr, D as DeepResolvableProperties, b as Head, H as HtmlAttr, M as MaybeFalsy, b as ReactiveHead, c as ResolvableArray, d as ResolvableBase, e as ResolvableBodyAttributes, f as ResolvableHtmlAttributes, g as ResolvableLink, h as ResolvableMeta, i as ResolvableNoscript, j as ResolvableScript, k as ResolvableStyle, l as ResolvableTitle, m as ResolvableTitleTemplate, n as ResolvableUnion, U as UseHeadInput, o as UseHeadOptions, p as UseSeoMetaInput, V as VueHeadClient } from './shared/vue.CajUUuy2.js';
|
|
5
5
|
import 'vue';
|
|
6
6
|
|
|
7
7
|
type SafeBodyAttr = ResolvableProperties<Pick<BodyAttributesWithoutEvents, 'id' | 'class' | 'style'> & DataKeys & SchemaAugmentations['bodyAttrs']>;
|
package/dist/utils.d.mts
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
import { PropResolver } from 'unhead/types';
|
|
1
|
+
import { PropResolver, ResolvableHead } from 'unhead/types';
|
|
2
2
|
export * from 'unhead/utils';
|
|
3
3
|
|
|
4
4
|
declare const VueResolver: PropResolver;
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
/**
|
|
7
|
+
* @deprecated Use head.resolveTags() instead.
|
|
8
|
+
*/
|
|
9
|
+
declare function resolveUnrefHeadInput(input: any): ResolvableHead;
|
|
10
|
+
|
|
11
|
+
export { VueResolver, resolveUnrefHeadInput };
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
import { PropResolver } from 'unhead/types';
|
|
1
|
+
import { PropResolver, ResolvableHead } from 'unhead/types';
|
|
2
2
|
export * from 'unhead/utils';
|
|
3
3
|
|
|
4
4
|
declare const VueResolver: PropResolver;
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
/**
|
|
7
|
+
* @deprecated Use head.resolveTags() instead.
|
|
8
|
+
*/
|
|
9
|
+
declare function resolveUnrefHeadInput(input: any): ResolvableHead;
|
|
10
|
+
|
|
11
|
+
export { VueResolver, resolveUnrefHeadInput };
|
package/dist/utils.mjs
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
import { walkResolver } from 'unhead/utils';
|
|
2
2
|
export * from 'unhead/utils';
|
|
3
|
+
import { V as VueResolver } from './shared/vue.CkLIG7eN.mjs';
|
|
3
4
|
import 'vue';
|
|
5
|
+
|
|
6
|
+
function resolveUnrefHeadInput(input) {
|
|
7
|
+
return walkResolver(input, VueResolver);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export { VueResolver, resolveUnrefHeadInput };
|
package/dist/vite.d.mts
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { VitePluginOptions } from '@unhead/bundler/vite';
|
|
2
|
+
import { StreamingPluginOptions } from 'unhead/stream/vite';
|
|
3
|
+
import { Plugin } from 'vite';
|
|
4
|
+
|
|
5
|
+
interface UnheadVueViteOptions extends VitePluginOptions {
|
|
6
|
+
/**
|
|
7
|
+
* Enable streaming SSR support.
|
|
8
|
+
* Set to `true` or a config object to enable.
|
|
9
|
+
* @default false
|
|
10
|
+
*/
|
|
11
|
+
streaming?: true | Pick<StreamingPluginOptions, 'mode'> | false;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Unified Vite plugin for `@unhead/vue`.
|
|
15
|
+
*
|
|
16
|
+
* Combines build optimizations (tree-shaking, useSeoMeta transform, minification)
|
|
17
|
+
* with streaming SSR support into a single plugin.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```ts
|
|
21
|
+
* // vite.config.ts
|
|
22
|
+
* import vue from '@vitejs/plugin-vue'
|
|
23
|
+
* import { Unhead } from '@unhead/vue/vite'
|
|
24
|
+
*
|
|
25
|
+
* export default defineConfig({
|
|
26
|
+
* plugins: [vue(), Unhead()],
|
|
27
|
+
* })
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
declare function Unhead(options?: UnheadVueViteOptions): Plugin[];
|
|
31
|
+
|
|
32
|
+
export { Unhead };
|
|
33
|
+
export type { UnheadVueViteOptions };
|
package/dist/vite.d.ts
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { VitePluginOptions } from '@unhead/bundler/vite';
|
|
2
|
+
import { StreamingPluginOptions } from 'unhead/stream/vite';
|
|
3
|
+
import { Plugin } from 'vite';
|
|
4
|
+
|
|
5
|
+
interface UnheadVueViteOptions extends VitePluginOptions {
|
|
6
|
+
/**
|
|
7
|
+
* Enable streaming SSR support.
|
|
8
|
+
* Set to `true` or a config object to enable.
|
|
9
|
+
* @default false
|
|
10
|
+
*/
|
|
11
|
+
streaming?: true | Pick<StreamingPluginOptions, 'mode'> | false;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Unified Vite plugin for `@unhead/vue`.
|
|
15
|
+
*
|
|
16
|
+
* Combines build optimizations (tree-shaking, useSeoMeta transform, minification)
|
|
17
|
+
* with streaming SSR support into a single plugin.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```ts
|
|
21
|
+
* // vite.config.ts
|
|
22
|
+
* import vue from '@vitejs/plugin-vue'
|
|
23
|
+
* import { Unhead } from '@unhead/vue/vite'
|
|
24
|
+
*
|
|
25
|
+
* export default defineConfig({
|
|
26
|
+
* plugins: [vue(), Unhead()],
|
|
27
|
+
* })
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
declare function Unhead(options?: UnheadVueViteOptions): Plugin[];
|
|
31
|
+
|
|
32
|
+
export { Unhead };
|
|
33
|
+
export type { UnheadVueViteOptions };
|
package/dist/vite.mjs
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Unhead as Unhead$1 } from '@unhead/bundler/vite';
|
|
2
|
+
import unheadVuePlugin from './stream/vite.mjs';
|
|
3
|
+
import 'magic-string';
|
|
4
|
+
import 'oxc-walker';
|
|
5
|
+
import 'unhead/stream/vite';
|
|
6
|
+
|
|
7
|
+
function Unhead(options = {}) {
|
|
8
|
+
const plugins = [...Unhead$1({ ...options, _framework: "@unhead/vue" })];
|
|
9
|
+
if (options.streaming) {
|
|
10
|
+
const streamingOpts = typeof options.streaming === "object" ? options.streaming : void 0;
|
|
11
|
+
plugins.push(unheadVuePlugin(streamingOpts));
|
|
12
|
+
}
|
|
13
|
+
return plugins;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export { Unhead };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unhead/vue",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "3.0.0-
|
|
4
|
+
"version": "3.0.0-rc.3",
|
|
5
5
|
"description": "Full-stack <head> manager built for Vue.",
|
|
6
6
|
"author": "Harlan Wilton <harlan@harlanzw.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -61,9 +61,21 @@
|
|
|
61
61
|
"types": "./dist/scripts.d.ts",
|
|
62
62
|
"default": "./dist/scripts.mjs"
|
|
63
63
|
},
|
|
64
|
+
"./vite": {
|
|
65
|
+
"types": "./dist/vite.d.ts",
|
|
66
|
+
"default": "./dist/vite.mjs"
|
|
67
|
+
},
|
|
64
68
|
"./stream/vite": {
|
|
65
69
|
"types": "./dist/stream/vite.d.ts",
|
|
66
70
|
"default": "./dist/stream/vite.mjs"
|
|
71
|
+
},
|
|
72
|
+
"./stream/iife": {
|
|
73
|
+
"types": "./dist/stream/iife.d.ts",
|
|
74
|
+
"default": "./dist/stream/iife.mjs"
|
|
75
|
+
},
|
|
76
|
+
"./legacy": {
|
|
77
|
+
"types": "./dist/legacy.d.ts",
|
|
78
|
+
"default": "./dist/legacy.mjs"
|
|
67
79
|
}
|
|
68
80
|
},
|
|
69
81
|
"main": "dist/index.mjs",
|
|
@@ -98,8 +110,17 @@
|
|
|
98
110
|
"scripts": [
|
|
99
111
|
"dist/scripts"
|
|
100
112
|
],
|
|
113
|
+
"vite": [
|
|
114
|
+
"dist/vite"
|
|
115
|
+
],
|
|
101
116
|
"stream/vite": [
|
|
102
117
|
"dist/stream/vite"
|
|
118
|
+
],
|
|
119
|
+
"stream/iife": [
|
|
120
|
+
"dist/stream/iife"
|
|
121
|
+
],
|
|
122
|
+
"legacy": [
|
|
123
|
+
"dist/legacy"
|
|
103
124
|
]
|
|
104
125
|
}
|
|
105
126
|
},
|
|
@@ -108,7 +129,7 @@
|
|
|
108
129
|
"dist"
|
|
109
130
|
],
|
|
110
131
|
"peerDependencies": {
|
|
111
|
-
"vite": ">=6",
|
|
132
|
+
"vite": ">=6.4.2",
|
|
112
133
|
"vue": ">=3.5.18"
|
|
113
134
|
},
|
|
114
135
|
"peerDependenciesMeta": {
|
|
@@ -122,16 +143,17 @@
|
|
|
122
143
|
]
|
|
123
144
|
},
|
|
124
145
|
"dependencies": {
|
|
125
|
-
"hookable": "^6.0
|
|
146
|
+
"hookable": "^6.1.0",
|
|
126
147
|
"magic-string": "^0.30.21",
|
|
127
|
-
"oxc-parser": "^0.
|
|
148
|
+
"oxc-parser": "^0.124.0",
|
|
128
149
|
"oxc-walker": "^0.7.0",
|
|
129
|
-
"unhead": "3.0.0-
|
|
150
|
+
"@unhead/bundler": "3.0.0-rc.3",
|
|
151
|
+
"unhead": "3.0.0-rc.3"
|
|
130
152
|
},
|
|
131
153
|
"devDependencies": {
|
|
132
|
-
"@vue/server-renderer": "^3.5.
|
|
133
|
-
"vite": "^
|
|
134
|
-
"vue": "^3.5.
|
|
154
|
+
"@vue/server-renderer": "^3.5.32",
|
|
155
|
+
"vite": "^8.0.8",
|
|
156
|
+
"vue": "^3.5.32"
|
|
135
157
|
},
|
|
136
158
|
"scripts": {
|
|
137
159
|
"build": "unbuild",
|