@unhead/vue 3.0.0-beta.4 → 3.0.0-beta.6
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 +1 -1
- package/dist/client.d.ts +1 -1
- package/dist/client.mjs +7 -9
- package/dist/components.mjs +1 -1
- package/dist/index.d.mts +8 -29
- package/dist/index.d.ts +8 -29
- package/dist/index.mjs +5 -9
- package/dist/scripts.d.mts +5 -4
- package/dist/scripts.d.ts +5 -4
- package/dist/scripts.mjs +3 -3
- package/dist/server.d.mts +2 -2
- package/dist/server.d.ts +2 -2
- package/dist/server.mjs +3 -3
- package/dist/shared/{vue.DoxLTFJk.d.mts → vue.BW2vTlaC.d.mts} +3 -3
- package/dist/shared/{vue.DoxLTFJk.d.ts → vue.BW2vTlaC.d.ts} +3 -3
- package/dist/shared/{vue.BVUAdATk.mjs → vue.CLCWY4Ey.mjs} +1 -1
- package/dist/shared/{vue.Bm-NbY4b.mjs → vue.DdPIVN-K.mjs} +3 -13
- package/dist/shared/{vue.CeCEzk2b.mjs → vue.WuLQR0U8.mjs} +7 -5
- package/dist/stream/client.d.mts +17 -0
- package/dist/stream/client.d.ts +17 -0
- package/dist/stream/client.mjs +27 -0
- package/dist/stream/server.d.mts +50 -0
- package/dist/stream/server.d.ts +50 -0
- package/dist/stream/server.mjs +43 -0
- package/dist/stream/vite.d.mts +27 -0
- package/dist/stream/vite.d.ts +27 -0
- package/dist/stream/vite.mjs +51 -0
- package/dist/types.d.mts +68 -5
- package/dist/types.d.ts +68 -5
- package/dist/utils.d.mts +1 -6
- package/dist/utils.d.ts +1 -6
- package/dist/utils.mjs +1 -9
- package/package.json +35 -12
- package/dist/legacy.d.mts +0 -34
- package/dist/legacy.d.ts +0 -34
- package/dist/legacy.mjs +0 -114
- package/dist/shared/vue.CzjZUNjB.d.ts +0 -63
- package/dist/shared/vue.DMlT7xkj.d.mts +0 -63
- package/legacy.d.ts +0 -1
package/dist/client.d.mts
CHANGED
|
@@ -2,7 +2,7 @@ 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 } from './shared/vue.BW2vTlaC.mjs';
|
|
6
6
|
import 'vue';
|
|
7
7
|
|
|
8
8
|
declare function createHead(options?: CreateClientHeadOptions): VueHeadClient;
|
package/dist/client.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ 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 } from './shared/vue.BW2vTlaC.js';
|
|
6
6
|
import 'vue';
|
|
7
7
|
|
|
8
8
|
declare function createHead(options?: CreateClientHeadOptions): VueHeadClient;
|
package/dist/client.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { createHead as createHead$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.DdPIVN-K.mjs';
|
|
4
|
+
export { V as VueHeadMixin } from './shared/vue.CLCWY4Ey.mjs';
|
|
5
5
|
import 'unhead/plugins';
|
|
6
6
|
import 'unhead/utils';
|
|
7
7
|
import 'vue';
|
|
@@ -9,12 +9,10 @@ import './shared/vue.N9zWjxoK.mjs';
|
|
|
9
9
|
|
|
10
10
|
// @__NO_SIDE_EFFECTS__
|
|
11
11
|
function createHead(options = {}) {
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
...options
|
|
17
|
-
});
|
|
12
|
+
const domRenderer = createDomRenderer();
|
|
13
|
+
let head;
|
|
14
|
+
const debouncedRenderer = createDebouncedFn(() => domRenderer(head), (fn) => setTimeout(fn, 0));
|
|
15
|
+
head = createHead$1({ render: debouncedRenderer, ...options });
|
|
18
16
|
head.install = vueInstall(head);
|
|
19
17
|
return head;
|
|
20
18
|
}
|
package/dist/components.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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.DdPIVN-K.mjs';
|
|
3
3
|
import 'unhead/plugins';
|
|
4
4
|
import 'unhead/utils';
|
|
5
5
|
import './shared/vue.N9zWjxoK.mjs';
|
package/dist/index.d.mts
CHANGED
|
@@ -1,18 +1,14 @@
|
|
|
1
|
-
import { createUnhead } from 'unhead';
|
|
2
|
-
export { createUnhead } from 'unhead';
|
|
3
1
|
import { ActiveHeadEntry } from 'unhead/types';
|
|
4
|
-
export { ActiveHeadEntry, AriaAttributes, BodyAttributesWithoutEvents, BodyEvents, DataKeys, GlobalAttributes,
|
|
5
|
-
import { V as VueHeadClient,
|
|
6
|
-
export { B as BodyAttr, D as DeepResolvableProperties, H as HtmlAttr, M as MaybeFalsy,
|
|
7
|
-
import {
|
|
8
|
-
export {
|
|
9
|
-
export { AsVoidFunctions, EventHandlerOptions, RecordingEntry, ScriptInstance, UseFunctionType, UseScriptResolvedInput, UseScriptStatus, WarmupStrategy, createSpyProxy
|
|
2
|
+
export { ActiveHeadEntry, AriaAttributes, BodyAttributesWithoutEvents, BodyEvents, DataKeys, GlobalAttributes, HeadEntryOptions, HeadTag, HttpEventAttributes, LinkWithoutEvents, MetaFlat, MetaFlat as MetaFlatInput, RawInput, RenderSSRHeadOptions, ResolvableHead, ScriptWithoutEvents, SerializableHead, SpeculationRules, Unhead } from 'unhead/types';
|
|
3
|
+
import { V as VueHeadClient, m as UseHeadInput, U as UseHeadOptions, n as UseSeoMetaInput } from './shared/vue.BW2vTlaC.mjs';
|
|
4
|
+
export { B as BodyAttr, D as DeepResolvableProperties, b as Head, H as HtmlAttr, M as MaybeFalsy, b as ReactiveHead, o as ResolvableArray, e as ResolvableBase, l as ResolvableBodyAttributes, k as ResolvableHtmlAttributes, f as ResolvableLink, g as ResolvableMeta, j as ResolvableNoscript, a as ResolvableProperties, i as ResolvableScript, h as ResolvableStyle, c as ResolvableTitle, d as ResolvableTitleTemplate, p as ResolvableUnion, R as ResolvableValue } from './shared/vue.BW2vTlaC.mjs';
|
|
5
|
+
import { UseHeadSafeInput } from './types.mjs';
|
|
6
|
+
export { Base, BodyAttributes, HeadSafe, HtmlAttributes, Link, MergeHead, Meta, Noscript, SafeBodyAttr, SafeHtmlAttr, SafeLink, SafeMeta, SafeNoscript, SafeScript, SafeStyle, Script, Style } from './types.mjs';
|
|
7
|
+
export { AsVoidFunctions, EventHandlerOptions, RecordingEntry, ScriptInstance, UseFunctionType, UseScriptResolvedInput, UseScriptStatus, WarmupStrategy, createSpyProxy } from 'unhead/scripts';
|
|
10
8
|
export { UseScriptContext, UseScriptInput, UseScriptOptions, UseScriptReturn, VueScriptInstance, useScript } from './scripts.mjs';
|
|
11
|
-
export { Base, BodyAttributes, HtmlAttributes, Link, Meta, Noscript, Script, Style } from './types.mjs';
|
|
12
|
-
export { resolveUnrefHeadInput } from './utils.mjs';
|
|
13
9
|
export { V as VueHeadMixin } from './shared/vue.DnywREVF.mjs';
|
|
10
|
+
export { createUnhead } from 'unhead';
|
|
14
11
|
import 'vue';
|
|
15
|
-
import 'unhead/utils';
|
|
16
12
|
|
|
17
13
|
declare const unheadVueComposablesImports: {
|
|
18
14
|
'@unhead/vue': string[];
|
|
@@ -22,24 +18,7 @@ declare function injectHead(): VueHeadClient;
|
|
|
22
18
|
declare function useHead<I = UseHeadInput>(input?: UseHeadInput, options?: UseHeadOptions): ActiveHeadEntry<I>;
|
|
23
19
|
declare function useHeadSafe(input?: UseHeadSafeInput, options?: UseHeadOptions): ActiveHeadEntry<UseHeadSafeInput>;
|
|
24
20
|
declare function useSeoMeta(input?: UseSeoMetaInput, options?: UseHeadOptions): ActiveHeadEntry<UseSeoMetaInput>;
|
|
25
|
-
/**
|
|
26
|
-
* @deprecated use `useHead` instead.Advanced use cases should tree shake using import.meta.* if statements.
|
|
27
|
-
*/
|
|
28
|
-
declare function useServerHead<I = UseHeadInput>(input?: UseHeadInput, options?: UseHeadOptions): ActiveHeadEntry<I>;
|
|
29
|
-
/**
|
|
30
|
-
* @deprecated use `useHeadSafe` instead.Advanced use cases should tree shake using import.meta.* if statements.
|
|
31
|
-
*/
|
|
32
|
-
declare function useServerHeadSafe(input?: UseHeadSafeInput, options?: UseHeadOptions): ActiveHeadEntry<UseHeadSafeInput>;
|
|
33
|
-
/**
|
|
34
|
-
* @deprecated use `useSeoMeta` instead.Advanced use cases should tree shake using import.meta.* if statements.
|
|
35
|
-
*/
|
|
36
|
-
declare function useServerSeoMeta(input?: UseSeoMetaInput, options?: UseHeadOptions): ActiveHeadEntry<UseSeoMetaInput>;
|
|
37
21
|
|
|
38
22
|
declare const headSymbol = "usehead";
|
|
39
23
|
|
|
40
|
-
|
|
41
|
-
* @deprecated Use createUnhead
|
|
42
|
-
*/
|
|
43
|
-
declare const createHeadCore: typeof createUnhead;
|
|
44
|
-
|
|
45
|
-
export { UseHeadInput, UseHeadOptions, UseHeadSafeInput, UseSeoMetaInput, VueHeadClient, createHeadCore, headSymbol, injectHead, unheadVueComposablesImports, useHead, useHeadSafe, useSeoMeta, useServerHead, useServerHeadSafe, useServerSeoMeta };
|
|
24
|
+
export { UseHeadInput, UseHeadOptions, UseHeadSafeInput, UseSeoMetaInput, VueHeadClient, headSymbol, injectHead, unheadVueComposablesImports, useHead, useHeadSafe, useSeoMeta };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,18 +1,14 @@
|
|
|
1
|
-
import { createUnhead } from 'unhead';
|
|
2
|
-
export { createUnhead } from 'unhead';
|
|
3
1
|
import { ActiveHeadEntry } from 'unhead/types';
|
|
4
|
-
export { ActiveHeadEntry, AriaAttributes, BodyAttributesWithoutEvents, BodyEvents, DataKeys, GlobalAttributes,
|
|
5
|
-
import { V as VueHeadClient,
|
|
6
|
-
export { B as BodyAttr, D as DeepResolvableProperties, H as HtmlAttr, M as MaybeFalsy,
|
|
7
|
-
import {
|
|
8
|
-
export {
|
|
9
|
-
export { AsVoidFunctions, EventHandlerOptions, RecordingEntry, ScriptInstance, UseFunctionType, UseScriptResolvedInput, UseScriptStatus, WarmupStrategy, createSpyProxy
|
|
2
|
+
export { ActiveHeadEntry, AriaAttributes, BodyAttributesWithoutEvents, BodyEvents, DataKeys, GlobalAttributes, HeadEntryOptions, HeadTag, HttpEventAttributes, LinkWithoutEvents, MetaFlat, MetaFlat as MetaFlatInput, RawInput, RenderSSRHeadOptions, ResolvableHead, ScriptWithoutEvents, SerializableHead, SpeculationRules, Unhead } from 'unhead/types';
|
|
3
|
+
import { V as VueHeadClient, m as UseHeadInput, U as UseHeadOptions, n as UseSeoMetaInput } from './shared/vue.BW2vTlaC.js';
|
|
4
|
+
export { B as BodyAttr, D as DeepResolvableProperties, b as Head, H as HtmlAttr, M as MaybeFalsy, b as ReactiveHead, o as ResolvableArray, e as ResolvableBase, l as ResolvableBodyAttributes, k as ResolvableHtmlAttributes, f as ResolvableLink, g as ResolvableMeta, j as ResolvableNoscript, a as ResolvableProperties, i as ResolvableScript, h as ResolvableStyle, c as ResolvableTitle, d as ResolvableTitleTemplate, p as ResolvableUnion, R as ResolvableValue } from './shared/vue.BW2vTlaC.js';
|
|
5
|
+
import { UseHeadSafeInput } from './types.js';
|
|
6
|
+
export { Base, BodyAttributes, HeadSafe, HtmlAttributes, Link, MergeHead, Meta, Noscript, SafeBodyAttr, SafeHtmlAttr, SafeLink, SafeMeta, SafeNoscript, SafeScript, SafeStyle, Script, Style } from './types.js';
|
|
7
|
+
export { AsVoidFunctions, EventHandlerOptions, RecordingEntry, ScriptInstance, UseFunctionType, UseScriptResolvedInput, UseScriptStatus, WarmupStrategy, createSpyProxy } from 'unhead/scripts';
|
|
10
8
|
export { UseScriptContext, UseScriptInput, UseScriptOptions, UseScriptReturn, VueScriptInstance, useScript } from './scripts.js';
|
|
11
|
-
export { Base, BodyAttributes, HtmlAttributes, Link, Meta, Noscript, Script, Style } from './types.js';
|
|
12
|
-
export { resolveUnrefHeadInput } from './utils.js';
|
|
13
9
|
export { V as VueHeadMixin } from './shared/vue.DnywREVF.js';
|
|
10
|
+
export { createUnhead } from 'unhead';
|
|
14
11
|
import 'vue';
|
|
15
|
-
import 'unhead/utils';
|
|
16
12
|
|
|
17
13
|
declare const unheadVueComposablesImports: {
|
|
18
14
|
'@unhead/vue': string[];
|
|
@@ -22,24 +18,7 @@ declare function injectHead(): VueHeadClient;
|
|
|
22
18
|
declare function useHead<I = UseHeadInput>(input?: UseHeadInput, options?: UseHeadOptions): ActiveHeadEntry<I>;
|
|
23
19
|
declare function useHeadSafe(input?: UseHeadSafeInput, options?: UseHeadOptions): ActiveHeadEntry<UseHeadSafeInput>;
|
|
24
20
|
declare function useSeoMeta(input?: UseSeoMetaInput, options?: UseHeadOptions): ActiveHeadEntry<UseSeoMetaInput>;
|
|
25
|
-
/**
|
|
26
|
-
* @deprecated use `useHead` instead.Advanced use cases should tree shake using import.meta.* if statements.
|
|
27
|
-
*/
|
|
28
|
-
declare function useServerHead<I = UseHeadInput>(input?: UseHeadInput, options?: UseHeadOptions): ActiveHeadEntry<I>;
|
|
29
|
-
/**
|
|
30
|
-
* @deprecated use `useHeadSafe` instead.Advanced use cases should tree shake using import.meta.* if statements.
|
|
31
|
-
*/
|
|
32
|
-
declare function useServerHeadSafe(input?: UseHeadSafeInput, options?: UseHeadOptions): ActiveHeadEntry<UseHeadSafeInput>;
|
|
33
|
-
/**
|
|
34
|
-
* @deprecated use `useSeoMeta` instead.Advanced use cases should tree shake using import.meta.* if statements.
|
|
35
|
-
*/
|
|
36
|
-
declare function useServerSeoMeta(input?: UseSeoMetaInput, options?: UseHeadOptions): ActiveHeadEntry<UseSeoMetaInput>;
|
|
37
21
|
|
|
38
22
|
declare const headSymbol = "usehead";
|
|
39
23
|
|
|
40
|
-
|
|
41
|
-
* @deprecated Use createUnhead
|
|
42
|
-
*/
|
|
43
|
-
declare const createHeadCore: typeof createUnhead;
|
|
44
|
-
|
|
45
|
-
export { UseHeadInput, UseHeadOptions, UseHeadSafeInput, UseSeoMetaInput, VueHeadClient, createHeadCore, headSymbol, injectHead, unheadVueComposablesImports, useHead, useHeadSafe, useSeoMeta, useServerHead, useServerHeadSafe, useServerSeoMeta };
|
|
24
|
+
export { UseHeadInput, UseHeadOptions, UseHeadSafeInput, UseSeoMetaInput, VueHeadClient, headSymbol, injectHead, unheadVueComposablesImports, useHead, useHeadSafe, useSeoMeta };
|
package/dist/index.mjs
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
export { h as headSymbol, i as injectHead, u as useHead, a as useHeadSafe, b as useSeoMeta } from './shared/vue.DdPIVN-K.mjs';
|
|
2
|
+
export { V as VueHeadMixin } from './shared/vue.CLCWY4Ey.mjs';
|
|
2
3
|
export { createUnhead } from 'unhead';
|
|
3
|
-
export {
|
|
4
|
-
export { resolveUnrefHeadInput } from './utils.mjs';
|
|
5
|
-
export { V as VueHeadMixin } from './shared/vue.BVUAdATk.mjs';
|
|
6
|
-
export { u as useScript } from './shared/vue.CeCEzk2b.mjs';
|
|
4
|
+
export { u as useScript } from './shared/vue.WuLQR0U8.mjs';
|
|
7
5
|
import 'unhead/plugins';
|
|
8
6
|
import 'unhead/utils';
|
|
9
7
|
import 'vue';
|
|
@@ -11,9 +9,7 @@ import './shared/vue.N9zWjxoK.mjs';
|
|
|
11
9
|
import 'unhead/scripts';
|
|
12
10
|
|
|
13
11
|
const unheadVueComposablesImports = {
|
|
14
|
-
"@unhead/vue": ["injectHead", "useHead", "useSeoMeta", "useHeadSafe"
|
|
12
|
+
"@unhead/vue": ["injectHead", "useHead", "useSeoMeta", "useHeadSafe"]
|
|
15
13
|
};
|
|
16
14
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
export { createHeadCore, unheadVueComposablesImports };
|
|
15
|
+
export { unheadVueComposablesImports };
|
package/dist/scripts.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { UseScriptOptions as UseScriptOptions$1, ScriptInstance, UseScriptStatus, UseFunctionType } from 'unhead/scripts';
|
|
2
|
-
export { AsVoidFunctions, EventHandlerOptions, RecordingEntry, ScriptInstance, UseFunctionType, UseScriptResolvedInput, UseScriptStatus, WarmupStrategy, createSpyProxy
|
|
2
|
+
export { AsVoidFunctions, EventHandlerOptions, RecordingEntry, ScriptInstance, UseFunctionType, UseScriptResolvedInput, UseScriptStatus, WarmupStrategy, createSpyProxy } from 'unhead/scripts';
|
|
3
3
|
import { ScriptWithoutEvents, DataKeys, SchemaAugmentations, HeadEntryOptions } from 'unhead/types';
|
|
4
4
|
import { Ref } from 'vue';
|
|
5
|
-
import {
|
|
5
|
+
import { a as ResolvableProperties, V as VueHeadClient } from './shared/vue.BW2vTlaC.mjs';
|
|
6
6
|
|
|
7
7
|
interface VueScriptInstance<T extends Record<symbol | string, any>> extends Omit<ScriptInstance<T>, 'status'> {
|
|
8
8
|
status: Ref<UseScriptStatus>;
|
|
@@ -18,9 +18,10 @@ interface UseScriptOptions<T extends Record<symbol | string, any> = Record<strin
|
|
|
18
18
|
* - `Promise` - Load the script when the promise resolves, exists only on the client.
|
|
19
19
|
* - `Function` - Register a callback function to load the script, exists only on the client.
|
|
20
20
|
* - `server` - Have the script injected on the server.
|
|
21
|
-
* - `
|
|
21
|
+
* - `Ref<boolean>` - Load the script when the ref becomes true.
|
|
22
|
+
* - `() => boolean` - Getter function, load the script when return value becomes true.
|
|
22
23
|
*/
|
|
23
|
-
trigger?: UseScriptOptions$1['trigger'] | Ref<boolean
|
|
24
|
+
trigger?: UseScriptOptions$1['trigger'] | Ref<boolean> | (() => boolean);
|
|
24
25
|
/**
|
|
25
26
|
* Unhead instance.
|
|
26
27
|
*/
|
package/dist/scripts.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { UseScriptOptions as UseScriptOptions$1, ScriptInstance, UseScriptStatus, UseFunctionType } from 'unhead/scripts';
|
|
2
|
-
export { AsVoidFunctions, EventHandlerOptions, RecordingEntry, ScriptInstance, UseFunctionType, UseScriptResolvedInput, UseScriptStatus, WarmupStrategy, createSpyProxy
|
|
2
|
+
export { AsVoidFunctions, EventHandlerOptions, RecordingEntry, ScriptInstance, UseFunctionType, UseScriptResolvedInput, UseScriptStatus, WarmupStrategy, createSpyProxy } from 'unhead/scripts';
|
|
3
3
|
import { ScriptWithoutEvents, DataKeys, SchemaAugmentations, HeadEntryOptions } from 'unhead/types';
|
|
4
4
|
import { Ref } from 'vue';
|
|
5
|
-
import {
|
|
5
|
+
import { a as ResolvableProperties, V as VueHeadClient } from './shared/vue.BW2vTlaC.js';
|
|
6
6
|
|
|
7
7
|
interface VueScriptInstance<T extends Record<symbol | string, any>> extends Omit<ScriptInstance<T>, 'status'> {
|
|
8
8
|
status: Ref<UseScriptStatus>;
|
|
@@ -18,9 +18,10 @@ interface UseScriptOptions<T extends Record<symbol | string, any> = Record<strin
|
|
|
18
18
|
* - `Promise` - Load the script when the promise resolves, exists only on the client.
|
|
19
19
|
* - `Function` - Register a callback function to load the script, exists only on the client.
|
|
20
20
|
* - `server` - Have the script injected on the server.
|
|
21
|
-
* - `
|
|
21
|
+
* - `Ref<boolean>` - Load the script when the ref becomes true.
|
|
22
|
+
* - `() => boolean` - Getter function, load the script when return value becomes true.
|
|
22
23
|
*/
|
|
23
|
-
trigger?: UseScriptOptions$1['trigger'] | Ref<boolean
|
|
24
|
+
trigger?: UseScriptOptions$1['trigger'] | Ref<boolean> | (() => boolean);
|
|
24
25
|
/**
|
|
25
26
|
* Unhead instance.
|
|
26
27
|
*/
|
package/dist/scripts.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { createSpyProxy
|
|
2
|
-
export { u as useScript } from './shared/vue.
|
|
1
|
+
export { createSpyProxy } from 'unhead/scripts';
|
|
2
|
+
export { u as useScript } from './shared/vue.WuLQR0U8.mjs';
|
|
3
3
|
import 'vue';
|
|
4
|
-
import './shared/vue.
|
|
4
|
+
import './shared/vue.DdPIVN-K.mjs';
|
|
5
5
|
import 'unhead/plugins';
|
|
6
6
|
import 'unhead/utils';
|
|
7
7
|
import './shared/vue.N9zWjxoK.mjs';
|
package/dist/server.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { CreateServerHeadOptions } from 'unhead/types';
|
|
2
2
|
export { CreateServerHeadOptions } from 'unhead/types';
|
|
3
3
|
export { V as VueHeadMixin } from './shared/vue.DnywREVF.mjs';
|
|
4
|
-
export { SSRHeadPayload,
|
|
5
|
-
import { V as VueHeadClient } from './shared/vue.
|
|
4
|
+
export { SSRHeadPayload, propsToString, renderSSRHead, transformHtmlTemplate } from 'unhead/server';
|
|
5
|
+
import { V as VueHeadClient } from './shared/vue.BW2vTlaC.mjs';
|
|
6
6
|
import 'vue';
|
|
7
7
|
|
|
8
8
|
declare function createHead(options?: Omit<CreateServerHeadOptions, 'propsResolver'>): VueHeadClient;
|
package/dist/server.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { CreateServerHeadOptions } from 'unhead/types';
|
|
2
2
|
export { CreateServerHeadOptions } from 'unhead/types';
|
|
3
3
|
export { V as VueHeadMixin } from './shared/vue.DnywREVF.js';
|
|
4
|
-
export { SSRHeadPayload,
|
|
5
|
-
import { V as VueHeadClient } from './shared/vue.
|
|
4
|
+
export { SSRHeadPayload, propsToString, renderSSRHead, transformHtmlTemplate } from 'unhead/server';
|
|
5
|
+
import { V as VueHeadClient } from './shared/vue.BW2vTlaC.js';
|
|
6
6
|
import 'vue';
|
|
7
7
|
|
|
8
8
|
declare function createHead(options?: Omit<CreateServerHeadOptions, 'propsResolver'>): VueHeadClient;
|
package/dist/server.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { createHead as createHead$1 } from 'unhead/server';
|
|
2
|
-
export {
|
|
3
|
-
import { v as vueInstall } from './shared/vue.
|
|
2
|
+
export { propsToString, renderSSRHead, transformHtmlTemplate } from 'unhead/server';
|
|
3
|
+
import { v as vueInstall } from './shared/vue.DdPIVN-K.mjs';
|
|
4
4
|
import { V as VueResolver } from './shared/vue.N9zWjxoK.mjs';
|
|
5
|
-
export { V as VueHeadMixin } from './shared/vue.
|
|
5
|
+
export { V as VueHeadMixin } from './shared/vue.CLCWY4Ey.mjs';
|
|
6
6
|
import 'unhead/plugins';
|
|
7
7
|
import 'unhead/utils';
|
|
8
8
|
import 'vue';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Stringable, SchemaAugmentations, ResolvableTitleTemplate as ResolvableTitleTemplate$1, Base, LinkWithoutEvents, DataKeys, MaybeEventFnHandlers, HttpEventAttributes, UnheadMeta, Style, ScriptWithoutEvents, Noscript, HtmlAttributes, MaybeArray, BodyAttributesWithoutEvents, BodyEvents, Unhead, HeadEntryOptions,
|
|
1
|
+
import { Stringable, SchemaAugmentations, ResolvableTitleTemplate as ResolvableTitleTemplate$1, Base, LinkWithoutEvents, DataKeys, MaybeEventFnHandlers, HttpEventAttributes, UnheadMeta, Style, ScriptWithoutEvents, Noscript, HtmlAttributes, MaybeArray, BodyAttributesWithoutEvents, BodyEvents, Unhead, HeadEntryOptions, MetaFlat } from 'unhead/types';
|
|
2
2
|
import { ComputedRef, Ref, CSSProperties, Plugin } from 'vue';
|
|
3
3
|
|
|
4
4
|
type Falsy = false | null | undefined;
|
|
@@ -129,10 +129,10 @@ type UseHeadOptions = Omit<HeadEntryOptions, 'head'> & {
|
|
|
129
129
|
head?: VueHeadClient<any>;
|
|
130
130
|
};
|
|
131
131
|
type UseHeadInput<Deprecated = never> = ResolvableValue<ReactiveHead>;
|
|
132
|
-
type UseSeoMetaInput = ResolvableProperties<
|
|
132
|
+
type UseSeoMetaInput = ResolvableProperties<MetaFlat> & {
|
|
133
133
|
title?: ReactiveHead['title'];
|
|
134
134
|
titleTemplate?: ReactiveHead['titleTemplate'];
|
|
135
135
|
};
|
|
136
136
|
type VueHeadClient<I = UseHeadInput> = Unhead<I> & Plugin;
|
|
137
137
|
|
|
138
|
-
export type { BodyAttr as B, DeepResolvableProperties as D, HtmlAttr as H, MaybeFalsy as M,
|
|
138
|
+
export type { BodyAttr as B, DeepResolvableProperties as D, HtmlAttr as H, MaybeFalsy as M, ResolvableValue as R, UseHeadOptions as U, VueHeadClient as V, ResolvableProperties as a, ReactiveHead as b, ResolvableTitle as c, ResolvableTitleTemplate as d, ResolvableBase as e, ResolvableLink as f, ResolvableMeta as g, ResolvableStyle as h, ResolvableScript as i, ResolvableNoscript as j, ResolvableHtmlAttributes as k, ResolvableBodyAttributes as l, UseHeadInput as m, UseSeoMetaInput as n, ResolvableArray as o, ResolvableUnion as p };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Stringable, SchemaAugmentations, ResolvableTitleTemplate as ResolvableTitleTemplate$1, Base, LinkWithoutEvents, DataKeys, MaybeEventFnHandlers, HttpEventAttributes, UnheadMeta, Style, ScriptWithoutEvents, Noscript, HtmlAttributes, MaybeArray, BodyAttributesWithoutEvents, BodyEvents, Unhead, HeadEntryOptions,
|
|
1
|
+
import { Stringable, SchemaAugmentations, ResolvableTitleTemplate as ResolvableTitleTemplate$1, Base, LinkWithoutEvents, DataKeys, MaybeEventFnHandlers, HttpEventAttributes, UnheadMeta, Style, ScriptWithoutEvents, Noscript, HtmlAttributes, MaybeArray, BodyAttributesWithoutEvents, BodyEvents, Unhead, HeadEntryOptions, MetaFlat } from 'unhead/types';
|
|
2
2
|
import { ComputedRef, Ref, CSSProperties, Plugin } from 'vue';
|
|
3
3
|
|
|
4
4
|
type Falsy = false | null | undefined;
|
|
@@ -129,10 +129,10 @@ type UseHeadOptions = Omit<HeadEntryOptions, 'head'> & {
|
|
|
129
129
|
head?: VueHeadClient<any>;
|
|
130
130
|
};
|
|
131
131
|
type UseHeadInput<Deprecated = never> = ResolvableValue<ReactiveHead>;
|
|
132
|
-
type UseSeoMetaInput = ResolvableProperties<
|
|
132
|
+
type UseSeoMetaInput = ResolvableProperties<MetaFlat> & {
|
|
133
133
|
title?: ReactiveHead['title'];
|
|
134
134
|
titleTemplate?: ReactiveHead['titleTemplate'];
|
|
135
135
|
};
|
|
136
136
|
type VueHeadClient<I = UseHeadInput> = Unhead<I> & Plugin;
|
|
137
137
|
|
|
138
|
-
export type { BodyAttr as B, DeepResolvableProperties as D, HtmlAttr as H, MaybeFalsy as M,
|
|
138
|
+
export type { BodyAttr as B, DeepResolvableProperties as D, HtmlAttr as H, MaybeFalsy as M, ResolvableValue as R, UseHeadOptions as U, VueHeadClient as V, ResolvableProperties as a, ReactiveHead as b, ResolvableTitle as c, ResolvableTitleTemplate as d, ResolvableBase as e, ResolvableLink as f, ResolvableMeta as g, ResolvableStyle as h, ResolvableScript as i, ResolvableNoscript as j, ResolvableHtmlAttributes as k, ResolvableBodyAttributes as l, UseHeadInput as m, UseSeoMetaInput as n, ResolvableArray as o, ResolvableUnion as p };
|
|
@@ -20,10 +20,9 @@ function vueInstall(head) {
|
|
|
20
20
|
function injectHead() {
|
|
21
21
|
if (hasInjectionContext()) {
|
|
22
22
|
const instance = inject(headSymbol);
|
|
23
|
-
if (
|
|
24
|
-
|
|
23
|
+
if (instance) {
|
|
24
|
+
return instance;
|
|
25
25
|
}
|
|
26
|
-
return instance;
|
|
27
26
|
}
|
|
28
27
|
throw new Error("useHead() was called without provide context, ensure you call it through the setup() function.");
|
|
29
28
|
}
|
|
@@ -72,14 +71,5 @@ function useSeoMeta(input = {}, options = {}) {
|
|
|
72
71
|
_flatMeta: meta
|
|
73
72
|
}, options);
|
|
74
73
|
}
|
|
75
|
-
function useServerHead(input, options = {}) {
|
|
76
|
-
return useHead(input, { ...options, mode: "server" });
|
|
77
|
-
}
|
|
78
|
-
function useServerHeadSafe(input, options = {}) {
|
|
79
|
-
return useHeadSafe(input, { ...options, mode: "server" });
|
|
80
|
-
}
|
|
81
|
-
function useServerSeoMeta(input, options = {}) {
|
|
82
|
-
return useSeoMeta(input, { ...options, mode: "server" });
|
|
83
|
-
}
|
|
84
74
|
|
|
85
|
-
export { useHeadSafe as a, useSeoMeta as b,
|
|
75
|
+
export { useHeadSafe as a, useSeoMeta as b, headSymbol as h, injectHead as i, useHead as u, vueInstall as v };
|
|
@@ -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.DdPIVN-K.mjs';
|
|
4
4
|
|
|
5
5
|
function registerVueScopeHandlers(script, scope) {
|
|
6
6
|
if (!scope) {
|
|
@@ -37,11 +37,11 @@ function useScript(_input, _options) {
|
|
|
37
37
|
options.eventContext = scope;
|
|
38
38
|
if (scope && typeof options.trigger === "undefined") {
|
|
39
39
|
options.trigger = onMounted;
|
|
40
|
-
} else if (isRef(options.trigger)) {
|
|
41
|
-
const
|
|
40
|
+
} else if (isRef(options.trigger) || typeof options.trigger === "function" && options.trigger.length === 0) {
|
|
41
|
+
const trigger = options.trigger;
|
|
42
42
|
let off;
|
|
43
43
|
options.trigger = new Promise((resolve) => {
|
|
44
|
-
off = watch(
|
|
44
|
+
off = watch(trigger, (val) => {
|
|
45
45
|
if (val) {
|
|
46
46
|
resolve(true);
|
|
47
47
|
}
|
|
@@ -55,7 +55,9 @@ function useScript(_input, _options) {
|
|
|
55
55
|
});
|
|
56
56
|
}
|
|
57
57
|
head._scriptStatusWatcher = head._scriptStatusWatcher || head.hooks.hook("script:updated", ({ script: s }) => {
|
|
58
|
-
s._statusRef
|
|
58
|
+
if (s._statusRef) {
|
|
59
|
+
s._statusRef.value = s.status;
|
|
60
|
+
}
|
|
59
61
|
});
|
|
60
62
|
const script = useScript$1(head, input, options);
|
|
61
63
|
script._statusRef = script._statusRef || ref(script.status);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as vue from 'vue';
|
|
2
|
+
import { CreateStreamableClientHeadOptions } from 'unhead/stream/client';
|
|
3
|
+
export { CreateStreamableClientHeadOptions, UnheadStreamQueue } from 'unhead/stream/client';
|
|
4
|
+
export { V as VueHeadMixin } from '../shared/vue.DnywREVF.mjs';
|
|
5
|
+
import { V as VueHeadClient } from '../shared/vue.BW2vTlaC.mjs';
|
|
6
|
+
import 'unhead/types';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Client-side HeadStream - renders nothing (script already executed during SSR streaming)
|
|
10
|
+
*/
|
|
11
|
+
declare const HeadStream: vue.DefineComponent<{}, () => null, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
12
|
+
/**
|
|
13
|
+
* Creates a client head by wrapping the core instance from the iife script.
|
|
14
|
+
*/
|
|
15
|
+
declare function createStreamableHead(options?: CreateStreamableClientHeadOptions): VueHeadClient | undefined;
|
|
16
|
+
|
|
17
|
+
export { HeadStream, VueHeadClient, createStreamableHead };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as vue from 'vue';
|
|
2
|
+
import { CreateStreamableClientHeadOptions } from 'unhead/stream/client';
|
|
3
|
+
export { CreateStreamableClientHeadOptions, UnheadStreamQueue } from 'unhead/stream/client';
|
|
4
|
+
export { V as VueHeadMixin } from '../shared/vue.DnywREVF.js';
|
|
5
|
+
import { V as VueHeadClient } from '../shared/vue.BW2vTlaC.js';
|
|
6
|
+
import 'unhead/types';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Client-side HeadStream - renders nothing (script already executed during SSR streaming)
|
|
10
|
+
*/
|
|
11
|
+
declare const HeadStream: vue.DefineComponent<{}, () => null, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
12
|
+
/**
|
|
13
|
+
* Creates a client head by wrapping the core instance from the iife script.
|
|
14
|
+
*/
|
|
15
|
+
declare function createStreamableHead(options?: CreateStreamableClientHeadOptions): VueHeadClient | undefined;
|
|
16
|
+
|
|
17
|
+
export { HeadStream, VueHeadClient, createStreamableHead };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { createStreamableHead as createStreamableHead$1 } from 'unhead/stream/client';
|
|
2
|
+
import { defineComponent } from 'vue';
|
|
3
|
+
import { v as vueInstall } from '../shared/vue.DdPIVN-K.mjs';
|
|
4
|
+
import { V as VueResolver } from '../shared/vue.N9zWjxoK.mjs';
|
|
5
|
+
export { V as VueHeadMixin } from '../shared/vue.CLCWY4Ey.mjs';
|
|
6
|
+
import 'unhead/plugins';
|
|
7
|
+
import 'unhead/utils';
|
|
8
|
+
|
|
9
|
+
const HeadStream = defineComponent({
|
|
10
|
+
name: "HeadStream",
|
|
11
|
+
setup() {
|
|
12
|
+
return () => null;
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
// @__NO_SIDE_EFFECTS__
|
|
16
|
+
function createStreamableHead(options = {}) {
|
|
17
|
+
const head = createStreamableHead$1({
|
|
18
|
+
...options,
|
|
19
|
+
propResolvers: [VueResolver, ...options.propResolvers || []]
|
|
20
|
+
});
|
|
21
|
+
if (head) {
|
|
22
|
+
head.install = vueInstall(head);
|
|
23
|
+
}
|
|
24
|
+
return head;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export { HeadStream, createStreamableHead };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import * as vue from 'vue';
|
|
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.BW2vTlaC.mjs';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Streaming script component - outputs inline script with current head state.
|
|
9
|
+
* The Vite plugin with streaming: true auto-injects this.
|
|
10
|
+
*/
|
|
11
|
+
declare const HeadStream: vue.DefineComponent<{}, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
12
|
+
[key: string]: any;
|
|
13
|
+
}> | null, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
14
|
+
/**
|
|
15
|
+
* Vue-specific context returned by createStreamableHead.
|
|
16
|
+
* Extends WebStreamableHeadContext with Vue-specific head type.
|
|
17
|
+
*/
|
|
18
|
+
interface VueStreamableHeadContext extends Omit<WebStreamableHeadContext<ResolvableHead>, 'head'> {
|
|
19
|
+
/**
|
|
20
|
+
* The Vue head instance to use with app.use(head)
|
|
21
|
+
*/
|
|
22
|
+
head: VueHeadClient;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Creates a head instance configured for Vue streaming SSR.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```ts
|
|
29
|
+
* export async function render(url: string, template: string) {
|
|
30
|
+
* const { app, router } = createApp()
|
|
31
|
+
* const { head, wrapStream } = createStreamableHead()
|
|
32
|
+
*
|
|
33
|
+
* app.use(head)
|
|
34
|
+
* app.mixin(VueHeadMixin)
|
|
35
|
+
* router.push(url)
|
|
36
|
+
*
|
|
37
|
+
* // Create stream first - Vue starts rendering synchronously
|
|
38
|
+
* const vueStream = renderToWebStream(app)
|
|
39
|
+
*
|
|
40
|
+
* // Wait for router - by now Vue's sync render has pushed head entries
|
|
41
|
+
* await router.isReady()
|
|
42
|
+
*
|
|
43
|
+
* return wrapStream(vueStream, template)
|
|
44
|
+
* }
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
declare function createStreamableHead(options?: Omit<CreateStreamableServerHeadOptions, 'propsResolver'>): VueStreamableHeadContext;
|
|
48
|
+
|
|
49
|
+
export { HeadStream, VueHeadClient, createStreamableHead };
|
|
50
|
+
export type { VueStreamableHeadContext };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import * as vue from 'vue';
|
|
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.BW2vTlaC.js';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Streaming script component - outputs inline script with current head state.
|
|
9
|
+
* The Vite plugin with streaming: true auto-injects this.
|
|
10
|
+
*/
|
|
11
|
+
declare const HeadStream: vue.DefineComponent<{}, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
12
|
+
[key: string]: any;
|
|
13
|
+
}> | null, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
14
|
+
/**
|
|
15
|
+
* Vue-specific context returned by createStreamableHead.
|
|
16
|
+
* Extends WebStreamableHeadContext with Vue-specific head type.
|
|
17
|
+
*/
|
|
18
|
+
interface VueStreamableHeadContext extends Omit<WebStreamableHeadContext<ResolvableHead>, 'head'> {
|
|
19
|
+
/**
|
|
20
|
+
* The Vue head instance to use with app.use(head)
|
|
21
|
+
*/
|
|
22
|
+
head: VueHeadClient;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Creates a head instance configured for Vue streaming SSR.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```ts
|
|
29
|
+
* export async function render(url: string, template: string) {
|
|
30
|
+
* const { app, router } = createApp()
|
|
31
|
+
* const { head, wrapStream } = createStreamableHead()
|
|
32
|
+
*
|
|
33
|
+
* app.use(head)
|
|
34
|
+
* app.mixin(VueHeadMixin)
|
|
35
|
+
* router.push(url)
|
|
36
|
+
*
|
|
37
|
+
* // Create stream first - Vue starts rendering synchronously
|
|
38
|
+
* const vueStream = renderToWebStream(app)
|
|
39
|
+
*
|
|
40
|
+
* // Wait for router - by now Vue's sync render has pushed head entries
|
|
41
|
+
* await router.isReady()
|
|
42
|
+
*
|
|
43
|
+
* return wrapStream(vueStream, template)
|
|
44
|
+
* }
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
declare function createStreamableHead(options?: Omit<CreateStreamableServerHeadOptions, 'propsResolver'>): VueStreamableHeadContext;
|
|
48
|
+
|
|
49
|
+
export { HeadStream, VueHeadClient, createStreamableHead };
|
|
50
|
+
export type { VueStreamableHeadContext };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { renderSSRHeadSuspenseChunk, createStreamableHead as createStreamableHead$1, wrapStream } from 'unhead/stream/server';
|
|
2
|
+
export { prepareStreamingTemplate, renderSSRHeadShell, renderSSRHeadSuspenseChunk, wrapStream } from 'unhead/stream/server';
|
|
3
|
+
import { defineComponent, h } from 'vue';
|
|
4
|
+
import { i as injectHead, v as vueInstall } from '../shared/vue.DdPIVN-K.mjs';
|
|
5
|
+
import { V as VueResolver } from '../shared/vue.N9zWjxoK.mjs';
|
|
6
|
+
import 'unhead/plugins';
|
|
7
|
+
import 'unhead/utils';
|
|
8
|
+
|
|
9
|
+
const HeadStream = defineComponent({
|
|
10
|
+
name: "HeadStream",
|
|
11
|
+
setup() {
|
|
12
|
+
const head = injectHead();
|
|
13
|
+
return () => {
|
|
14
|
+
if (!head._shellRendered?.())
|
|
15
|
+
return null;
|
|
16
|
+
const update = renderSSRHeadSuspenseChunk(head);
|
|
17
|
+
if (!update)
|
|
18
|
+
return null;
|
|
19
|
+
return h("script", { innerHTML: update });
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
function createStreamableHead(options = {}) {
|
|
24
|
+
const { head } = createStreamableHead$1({
|
|
25
|
+
...options,
|
|
26
|
+
propResolvers: [VueResolver]
|
|
27
|
+
});
|
|
28
|
+
const vueHead = head;
|
|
29
|
+
vueHead.install = vueInstall(vueHead);
|
|
30
|
+
let shellRendered = false;
|
|
31
|
+
vueHead._shellRendered = () => shellRendered;
|
|
32
|
+
return {
|
|
33
|
+
head: vueHead,
|
|
34
|
+
wrapStream: (stream, template) => {
|
|
35
|
+
const preRenderedState = vueHead.render();
|
|
36
|
+
vueHead.entries.clear();
|
|
37
|
+
shellRendered = true;
|
|
38
|
+
return wrapStream(vueHead, stream, template, preRenderedState);
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export { HeadStream, createStreamableHead };
|