@unhead/vue 3.0.0-beta.1 → 3.0.0-beta.10

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.
Files changed (39) hide show
  1. package/dist/client.d.mts +1 -1
  2. package/dist/client.d.ts +1 -1
  3. package/dist/client.mjs +7 -9
  4. package/dist/components.mjs +1 -1
  5. package/dist/index.d.mts +8 -29
  6. package/dist/index.d.ts +8 -29
  7. package/dist/index.mjs +5 -9
  8. package/dist/scripts.d.mts +7 -6
  9. package/dist/scripts.d.ts +7 -6
  10. package/dist/scripts.mjs +3 -3
  11. package/dist/server.d.mts +2 -2
  12. package/dist/server.d.ts +2 -2
  13. package/dist/server.mjs +3 -3
  14. package/dist/shared/{vue.DoxLTFJk.d.mts → vue.9wC_EyGs.d.mts} +25 -17
  15. package/dist/shared/{vue.DoxLTFJk.d.ts → vue.9wC_EyGs.d.ts} +25 -17
  16. package/dist/shared/{vue.CeCEzk2b.mjs → vue.BUll6Wuy.mjs} +9 -6
  17. package/dist/shared/{vue.BVUAdATk.mjs → vue.CLCWY4Ey.mjs} +1 -1
  18. package/dist/shared/{vue.Bm-NbY4b.mjs → vue.DdPIVN-K.mjs} +3 -13
  19. package/dist/stream/client.d.mts +17 -0
  20. package/dist/stream/client.d.ts +17 -0
  21. package/dist/stream/client.mjs +27 -0
  22. package/dist/stream/server.d.mts +50 -0
  23. package/dist/stream/server.d.ts +50 -0
  24. package/dist/stream/server.mjs +43 -0
  25. package/dist/stream/vite.d.mts +27 -0
  26. package/dist/stream/vite.d.ts +27 -0
  27. package/dist/stream/vite.mjs +67 -0
  28. package/dist/types.d.mts +68 -5
  29. package/dist/types.d.ts +68 -5
  30. package/dist/utils.d.mts +1 -6
  31. package/dist/utils.d.ts +1 -6
  32. package/dist/utils.mjs +1 -9
  33. package/package.json +36 -12
  34. package/dist/legacy.d.mts +0 -34
  35. package/dist/legacy.d.ts +0 -34
  36. package/dist/legacy.mjs +0 -114
  37. package/dist/shared/vue.CzjZUNjB.d.ts +0 -63
  38. package/dist/shared/vue.DMlT7xkj.d.mts +0 -63
  39. 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.DoxLTFJk.mjs';
5
+ import { V as VueHeadClient } from './shared/vue.9wC_EyGs.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.DoxLTFJk.js';
5
+ import { V as VueHeadClient } from './shared/vue.9wC_EyGs.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, createDebouncedFn, renderDOMHead } from 'unhead/client';
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.Bm-NbY4b.mjs';
4
- export { V as VueHeadMixin } from './shared/vue.BVUAdATk.mjs';
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 head = createHead$1({
13
- domOptions: {
14
- render: createDebouncedFn(() => renderDOMHead(head), (fn) => setTimeout(fn, 0))
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
  }
@@ -1,5 +1,5 @@
1
1
  import { defineComponent, ref, onBeforeUnmount, watchEffect } from 'vue';
2
- import { u as useHead } from './shared/vue.Bm-NbY4b.mjs';
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, Head, HeadEntryOptions, HeadTag, HttpEventAttributes, LinkWithoutEvents, MergeHead, MetaFlat, MetaFlatInput, RawInput, RenderSSRHeadOptions, ResolvableHead, ScriptWithoutEvents, SerializableHead, SpeculationRules, Unhead } from 'unhead/types';
5
- import { V as VueHeadClient, U as UseHeadInput, a as UseHeadOptions, b as UseSeoMetaInput } from './shared/vue.DoxLTFJk.mjs';
6
- export { B as BodyAttr, D as DeepResolvableProperties, H as HtmlAttr, M as MaybeFalsy, l as ReactiveHead, n as ResolvableArray, d as ResolvableBase, k as ResolvableBodyAttributes, j as ResolvableHtmlAttributes, e as ResolvableLink, f as ResolvableMeta, i as ResolvableNoscript, o as ResolvableProperties, h as ResolvableScript, g as ResolvableStyle, R as ResolvableTitle, c as ResolvableTitleTemplate, p as ResolvableUnion, m as ResolvableValue } from './shared/vue.DoxLTFJk.mjs';
7
- import { U as UseHeadSafeInput } from './shared/vue.DMlT7xkj.mjs';
8
- export { H as HeadSafe, S as SafeBodyAttr, a as SafeHtmlAttr, c as SafeLink, b as SafeMeta, e as SafeNoscript, d as SafeScript, f as SafeStyle } from './shared/vue.DMlT7xkj.mjs';
9
- export { AsVoidFunctions, EventHandlerOptions, RecordingEntry, ScriptInstance, UseFunctionType, UseScriptResolvedInput, UseScriptStatus, WarmupStrategy, createSpyProxy, resolveScriptKey } from 'unhead/scripts';
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, m as UseHeadInput, U as UseHeadOptions, n as UseSeoMetaInput } from './shared/vue.9wC_EyGs.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.9wC_EyGs.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, Head, HeadEntryOptions, HeadTag, HttpEventAttributes, LinkWithoutEvents, MergeHead, MetaFlat, MetaFlatInput, RawInput, RenderSSRHeadOptions, ResolvableHead, ScriptWithoutEvents, SerializableHead, SpeculationRules, Unhead } from 'unhead/types';
5
- import { V as VueHeadClient, U as UseHeadInput, a as UseHeadOptions, b as UseSeoMetaInput } from './shared/vue.DoxLTFJk.js';
6
- export { B as BodyAttr, D as DeepResolvableProperties, H as HtmlAttr, M as MaybeFalsy, l as ReactiveHead, n as ResolvableArray, d as ResolvableBase, k as ResolvableBodyAttributes, j as ResolvableHtmlAttributes, e as ResolvableLink, f as ResolvableMeta, i as ResolvableNoscript, o as ResolvableProperties, h as ResolvableScript, g as ResolvableStyle, R as ResolvableTitle, c as ResolvableTitleTemplate, p as ResolvableUnion, m as ResolvableValue } from './shared/vue.DoxLTFJk.js';
7
- import { U as UseHeadSafeInput } from './shared/vue.CzjZUNjB.js';
8
- export { H as HeadSafe, S as SafeBodyAttr, a as SafeHtmlAttr, c as SafeLink, b as SafeMeta, e as SafeNoscript, d as SafeScript, f as SafeStyle } from './shared/vue.CzjZUNjB.js';
9
- export { AsVoidFunctions, EventHandlerOptions, RecordingEntry, ScriptInstance, UseFunctionType, UseScriptResolvedInput, UseScriptStatus, WarmupStrategy, createSpyProxy, resolveScriptKey } from 'unhead/scripts';
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, m as UseHeadInput, U as UseHeadOptions, n as UseSeoMetaInput } from './shared/vue.9wC_EyGs.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.9wC_EyGs.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
- import { createUnhead } from 'unhead';
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 { 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.Bm-NbY4b.mjs';
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.BUll6Wuy.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", "useServerHead", "useServerSeoMeta", "useServerHeadSafe"]
12
+ "@unhead/vue": ["injectHead", "useHead", "useSeoMeta", "useHeadSafe"]
15
13
  };
16
14
 
17
- const createHeadCore = createUnhead;
18
-
19
- export { createHeadCore, unheadVueComposablesImports };
15
+ export { unheadVueComposablesImports };
@@ -1,13 +1,13 @@
1
1
  import { UseScriptOptions as UseScriptOptions$1, ScriptInstance, UseScriptStatus, UseFunctionType } from 'unhead/scripts';
2
- export { AsVoidFunctions, EventHandlerOptions, RecordingEntry, ScriptInstance, UseFunctionType, UseScriptResolvedInput, UseScriptStatus, WarmupStrategy, createSpyProxy, resolveScriptKey } from 'unhead/scripts';
3
- import { ScriptWithoutEvents, DataKeys, SchemaAugmentations, HeadEntryOptions } from 'unhead/types';
2
+ export { AsVoidFunctions, EventHandlerOptions, RecordingEntry, ScriptInstance, UseFunctionType, UseScriptResolvedInput, UseScriptStatus, WarmupStrategy, createSpyProxy } from 'unhead/scripts';
3
+ import { GenericScript, DataKeys, SchemaAugmentations, HeadEntryOptions } from 'unhead/types';
4
4
  import { Ref } from 'vue';
5
- import { o as ResolvableProperties, V as VueHeadClient } from './shared/vue.DoxLTFJk.mjs';
5
+ import { a as ResolvableProperties, V as VueHeadClient } from './shared/vue.9wC_EyGs.mjs';
6
6
 
7
7
  interface VueScriptInstance<T extends Record<symbol | string, any>> extends Omit<ScriptInstance<T>, 'status'> {
8
8
  status: Ref<UseScriptStatus>;
9
9
  }
10
- type UseScriptInput = string | (ResolvableProperties<Omit<ScriptWithoutEvents & DataKeys & SchemaAugmentations['script'], 'src'>> & {
10
+ type UseScriptInput = string | (ResolvableProperties<Omit<GenericScript & DataKeys & SchemaAugmentations['script'], 'src'>> & {
11
11
  src: string;
12
12
  });
13
13
  interface UseScriptOptions<T extends Record<symbol | string, any> = Record<string, any>> extends Omit<HeadEntryOptions, 'head'>, Pick<UseScriptOptions$1<T>, 'use' | 'eventContext' | 'beforeInit'> {
@@ -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
- * - `ref` - Load the script when the ref is true.
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,13 +1,13 @@
1
1
  import { UseScriptOptions as UseScriptOptions$1, ScriptInstance, UseScriptStatus, UseFunctionType } from 'unhead/scripts';
2
- export { AsVoidFunctions, EventHandlerOptions, RecordingEntry, ScriptInstance, UseFunctionType, UseScriptResolvedInput, UseScriptStatus, WarmupStrategy, createSpyProxy, resolveScriptKey } from 'unhead/scripts';
3
- import { ScriptWithoutEvents, DataKeys, SchemaAugmentations, HeadEntryOptions } from 'unhead/types';
2
+ export { AsVoidFunctions, EventHandlerOptions, RecordingEntry, ScriptInstance, UseFunctionType, UseScriptResolvedInput, UseScriptStatus, WarmupStrategy, createSpyProxy } from 'unhead/scripts';
3
+ import { GenericScript, DataKeys, SchemaAugmentations, HeadEntryOptions } from 'unhead/types';
4
4
  import { Ref } from 'vue';
5
- import { o as ResolvableProperties, V as VueHeadClient } from './shared/vue.DoxLTFJk.js';
5
+ import { a as ResolvableProperties, V as VueHeadClient } from './shared/vue.9wC_EyGs.js';
6
6
 
7
7
  interface VueScriptInstance<T extends Record<symbol | string, any>> extends Omit<ScriptInstance<T>, 'status'> {
8
8
  status: Ref<UseScriptStatus>;
9
9
  }
10
- type UseScriptInput = string | (ResolvableProperties<Omit<ScriptWithoutEvents & DataKeys & SchemaAugmentations['script'], 'src'>> & {
10
+ type UseScriptInput = string | (ResolvableProperties<Omit<GenericScript & DataKeys & SchemaAugmentations['script'], 'src'>> & {
11
11
  src: string;
12
12
  });
13
13
  interface UseScriptOptions<T extends Record<symbol | string, any> = Record<string, any>> extends Omit<HeadEntryOptions, 'head'>, Pick<UseScriptOptions$1<T>, 'use' | 'eventContext' | 'beforeInit'> {
@@ -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
- * - `ref` - Load the script when the ref is true.
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, resolveScriptKey } from 'unhead/scripts';
2
- export { u as useScript } from './shared/vue.CeCEzk2b.mjs';
1
+ export { createSpyProxy } from 'unhead/scripts';
2
+ export { u as useScript } from './shared/vue.BUll6Wuy.mjs';
3
3
  import 'vue';
4
- import './shared/vue.Bm-NbY4b.mjs';
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, extractUnheadInputFromHtml, propsToString, renderSSRHead, transformHtmlTemplate } from 'unhead/server';
5
- import { V as VueHeadClient } from './shared/vue.DoxLTFJk.mjs';
4
+ export { SSRHeadPayload, propsToString, renderSSRHead, transformHtmlTemplate } from 'unhead/server';
5
+ import { V as VueHeadClient } from './shared/vue.9wC_EyGs.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, extractUnheadInputFromHtml, propsToString, renderSSRHead, transformHtmlTemplate } from 'unhead/server';
5
- import { V as VueHeadClient } from './shared/vue.DoxLTFJk.js';
4
+ export { SSRHeadPayload, propsToString, renderSSRHead, transformHtmlTemplate } from 'unhead/server';
5
+ import { V as VueHeadClient } from './shared/vue.9wC_EyGs.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 { extractUnheadInputFromHtml, propsToString, renderSSRHead, transformHtmlTemplate } from 'unhead/server';
3
- import { v as vueInstall } from './shared/vue.Bm-NbY4b.mjs';
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.BVUAdATk.mjs';
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,13 +1,19 @@
1
- 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';
1
+ import { Stringable, SchemaAugmentations, ResolvableTitleTemplate as ResolvableTitleTemplate$1, Base, MaybeEventFnHandlers, Link, LinkHttpEvents, UnheadMeta, Style, DataKeys, Script, ScriptHttpEvents, 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;
5
5
  type MaybeFalsy<T> = T | Falsy;
6
6
  type ResolvableValue<T> = MaybeFalsy<T> | (() => MaybeFalsy<T>) | ComputedRef<MaybeFalsy<T>> | Ref<MaybeFalsy<T>>;
7
7
  type ResolvableArray<T> = ResolvableValue<ResolvableValue<T>[]>;
8
- type ResolvableProperties<T> = {
9
- [key in keyof T]?: ResolvableValue<T[key]>;
8
+ type Prettify<T> = {
9
+ [K in keyof T]: T[K];
10
+ } & {};
11
+ type _ResolvablePropertiesRaw<T> = {
12
+ [K in keyof T as {} extends Pick<T, K> ? never : K]: ResolvableValue<T[K]>;
13
+ } & {
14
+ [K in keyof T as {} extends Pick<T, K> ? K : never]?: ResolvableValue<T[K]>;
10
15
  };
16
+ type ResolvableProperties<T> = Prettify<_ResolvablePropertiesRaw<T>>;
11
17
  type ResolvableUnion<T> = T extends string | number | boolean ? ResolvableValue<T> : T extends object ? DeepResolvableProperties<T> : ResolvableValue<T>;
12
18
  type DeepResolvableProperties<T> = {
13
19
  [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]>;
@@ -19,11 +25,11 @@ interface HtmlAttr extends Omit<HtmlAttributes, 'class' | 'style'> {
19
25
  *
20
26
  * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/class
21
27
  */
22
- class?: MaybeArray<ResolvableValue<Stringable> | Record<string, ResolvableValue<Stringable>>>;
28
+ class?: MaybeArray<ResolvableValue<Stringable> | Record<string, ResolvableValue<boolean>>>;
23
29
  /**
24
- * The class global attribute is a space-separated list of the case-sensitive classes of the element.
30
+ * The style attribute contains CSS styling declarations to be applied to the element.
25
31
  *
26
- * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/class
32
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/style
27
33
  */
28
34
  style?: MaybeArray<ResolvableValue<Stringable> | ResolvableProperties<CSSProperties>>;
29
35
  }
@@ -33,23 +39,25 @@ interface BodyAttr extends Omit<BodyAttributesWithoutEvents, 'class' | 'style'>
33
39
  *
34
40
  * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/class
35
41
  */
36
- class?: MaybeArray<ResolvableValue<Stringable>> | Record<string, ResolvableValue<Stringable>>;
42
+ class?: MaybeArray<ResolvableValue<Stringable> | Record<string, ResolvableValue<boolean>>>;
37
43
  /**
38
- * The class global attribute is a space-separated list of the case-sensitive classes of the element.
44
+ * The style attribute contains CSS styling declarations to be applied to the element.
39
45
  *
40
- * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/class
46
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/style
41
47
  */
42
- style?: MaybeArray<ResolvableValue<string>> | ResolvableProperties<CSSProperties>;
48
+ style?: MaybeArray<ResolvableValue<Stringable> | ResolvableProperties<CSSProperties>>;
43
49
  }
44
50
  type ResolvableTitle = ResolvableValue<Stringable> | ResolvableProperties<({
45
51
  textContent: Stringable;
46
52
  } & SchemaAugmentations['title'])>;
47
53
  type ResolvableTitleTemplate = ResolvableTitleTemplate$1 | Ref<string>;
48
- type ResolvableBase = ResolvableProperties<Base & SchemaAugmentations['base']>;
49
- type ResolvableLink = ResolvableProperties<LinkWithoutEvents & DataKeys & SchemaAugmentations['link']> & MaybeEventFnHandlers<HttpEventAttributes>;
50
- type ResolvableMeta = ResolvableProperties<UnheadMeta & DataKeys & SchemaAugmentations['meta']>;
54
+ type ResolvableBase = DistributeResolvable<Base, SchemaAugmentations['base']>;
55
+ type DistributeResolvable<T, Aug> = T extends any ? ResolvableProperties<T & Aug> : never;
56
+ type DistributeResolvableWithEvents<T, Aug, Events> = T extends any ? T extends Events ? ResolvableProperties<Omit<T, keyof Events> & Aug> & MaybeEventFnHandlers<Events> : ResolvableProperties<T & Aug> : never;
57
+ type ResolvableLink = DistributeResolvableWithEvents<Link, SchemaAugmentations['link'], LinkHttpEvents>;
58
+ type ResolvableMeta = DistributeResolvable<UnheadMeta, SchemaAugmentations['meta']>;
51
59
  type ResolvableStyle = ResolvableProperties<Style & DataKeys & SchemaAugmentations['style']>;
52
- type ResolvableScript = ResolvableProperties<ScriptWithoutEvents & DataKeys & SchemaAugmentations['script']> & MaybeEventFnHandlers<HttpEventAttributes>;
60
+ type ResolvableScript = DistributeResolvableWithEvents<Script, SchemaAugmentations['script'], ScriptHttpEvents>;
53
61
  type ResolvableNoscript = ResolvableProperties<Noscript & DataKeys & SchemaAugmentations['noscript']>;
54
62
  type ResolvableHtmlAttributes = ResolvableProperties<HtmlAttr & DataKeys & SchemaAugmentations['htmlAttrs']>;
55
63
  type ResolvableBodyAttributes = ResolvableProperties<BodyAttr & DataKeys & SchemaAugmentations['bodyAttrs']> & MaybeEventFnHandlers<BodyEvents>;
@@ -128,11 +136,11 @@ interface ReactiveHead {
128
136
  type UseHeadOptions = Omit<HeadEntryOptions, 'head'> & {
129
137
  head?: VueHeadClient<any>;
130
138
  };
131
- type UseHeadInput<Deprecated = never> = ResolvableValue<ReactiveHead>;
132
- type UseSeoMetaInput = ResolvableProperties<MetaFlatInput> & {
139
+ type UseHeadInput<_Deprecated = never> = ResolvableValue<ReactiveHead>;
140
+ type UseSeoMetaInput = ResolvableProperties<MetaFlat> & {
133
141
  title?: ReactiveHead['title'];
134
142
  titleTemplate?: ReactiveHead['titleTemplate'];
135
143
  };
136
144
  type VueHeadClient<I = UseHeadInput> = Unhead<I> & Plugin;
137
145
 
138
- 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 };
146
+ 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,13 +1,19 @@
1
- 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';
1
+ import { Stringable, SchemaAugmentations, ResolvableTitleTemplate as ResolvableTitleTemplate$1, Base, MaybeEventFnHandlers, Link, LinkHttpEvents, UnheadMeta, Style, DataKeys, Script, ScriptHttpEvents, 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;
5
5
  type MaybeFalsy<T> = T | Falsy;
6
6
  type ResolvableValue<T> = MaybeFalsy<T> | (() => MaybeFalsy<T>) | ComputedRef<MaybeFalsy<T>> | Ref<MaybeFalsy<T>>;
7
7
  type ResolvableArray<T> = ResolvableValue<ResolvableValue<T>[]>;
8
- type ResolvableProperties<T> = {
9
- [key in keyof T]?: ResolvableValue<T[key]>;
8
+ type Prettify<T> = {
9
+ [K in keyof T]: T[K];
10
+ } & {};
11
+ type _ResolvablePropertiesRaw<T> = {
12
+ [K in keyof T as {} extends Pick<T, K> ? never : K]: ResolvableValue<T[K]>;
13
+ } & {
14
+ [K in keyof T as {} extends Pick<T, K> ? K : never]?: ResolvableValue<T[K]>;
10
15
  };
16
+ type ResolvableProperties<T> = Prettify<_ResolvablePropertiesRaw<T>>;
11
17
  type ResolvableUnion<T> = T extends string | number | boolean ? ResolvableValue<T> : T extends object ? DeepResolvableProperties<T> : ResolvableValue<T>;
12
18
  type DeepResolvableProperties<T> = {
13
19
  [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]>;
@@ -19,11 +25,11 @@ interface HtmlAttr extends Omit<HtmlAttributes, 'class' | 'style'> {
19
25
  *
20
26
  * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/class
21
27
  */
22
- class?: MaybeArray<ResolvableValue<Stringable> | Record<string, ResolvableValue<Stringable>>>;
28
+ class?: MaybeArray<ResolvableValue<Stringable> | Record<string, ResolvableValue<boolean>>>;
23
29
  /**
24
- * The class global attribute is a space-separated list of the case-sensitive classes of the element.
30
+ * The style attribute contains CSS styling declarations to be applied to the element.
25
31
  *
26
- * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/class
32
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/style
27
33
  */
28
34
  style?: MaybeArray<ResolvableValue<Stringable> | ResolvableProperties<CSSProperties>>;
29
35
  }
@@ -33,23 +39,25 @@ interface BodyAttr extends Omit<BodyAttributesWithoutEvents, 'class' | 'style'>
33
39
  *
34
40
  * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/class
35
41
  */
36
- class?: MaybeArray<ResolvableValue<Stringable>> | Record<string, ResolvableValue<Stringable>>;
42
+ class?: MaybeArray<ResolvableValue<Stringable> | Record<string, ResolvableValue<boolean>>>;
37
43
  /**
38
- * The class global attribute is a space-separated list of the case-sensitive classes of the element.
44
+ * The style attribute contains CSS styling declarations to be applied to the element.
39
45
  *
40
- * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/class
46
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/style
41
47
  */
42
- style?: MaybeArray<ResolvableValue<string>> | ResolvableProperties<CSSProperties>;
48
+ style?: MaybeArray<ResolvableValue<Stringable> | ResolvableProperties<CSSProperties>>;
43
49
  }
44
50
  type ResolvableTitle = ResolvableValue<Stringable> | ResolvableProperties<({
45
51
  textContent: Stringable;
46
52
  } & SchemaAugmentations['title'])>;
47
53
  type ResolvableTitleTemplate = ResolvableTitleTemplate$1 | Ref<string>;
48
- type ResolvableBase = ResolvableProperties<Base & SchemaAugmentations['base']>;
49
- type ResolvableLink = ResolvableProperties<LinkWithoutEvents & DataKeys & SchemaAugmentations['link']> & MaybeEventFnHandlers<HttpEventAttributes>;
50
- type ResolvableMeta = ResolvableProperties<UnheadMeta & DataKeys & SchemaAugmentations['meta']>;
54
+ type ResolvableBase = DistributeResolvable<Base, SchemaAugmentations['base']>;
55
+ type DistributeResolvable<T, Aug> = T extends any ? ResolvableProperties<T & Aug> : never;
56
+ type DistributeResolvableWithEvents<T, Aug, Events> = T extends any ? T extends Events ? ResolvableProperties<Omit<T, keyof Events> & Aug> & MaybeEventFnHandlers<Events> : ResolvableProperties<T & Aug> : never;
57
+ type ResolvableLink = DistributeResolvableWithEvents<Link, SchemaAugmentations['link'], LinkHttpEvents>;
58
+ type ResolvableMeta = DistributeResolvable<UnheadMeta, SchemaAugmentations['meta']>;
51
59
  type ResolvableStyle = ResolvableProperties<Style & DataKeys & SchemaAugmentations['style']>;
52
- type ResolvableScript = ResolvableProperties<ScriptWithoutEvents & DataKeys & SchemaAugmentations['script']> & MaybeEventFnHandlers<HttpEventAttributes>;
60
+ type ResolvableScript = DistributeResolvableWithEvents<Script, SchemaAugmentations['script'], ScriptHttpEvents>;
53
61
  type ResolvableNoscript = ResolvableProperties<Noscript & DataKeys & SchemaAugmentations['noscript']>;
54
62
  type ResolvableHtmlAttributes = ResolvableProperties<HtmlAttr & DataKeys & SchemaAugmentations['htmlAttrs']>;
55
63
  type ResolvableBodyAttributes = ResolvableProperties<BodyAttr & DataKeys & SchemaAugmentations['bodyAttrs']> & MaybeEventFnHandlers<BodyEvents>;
@@ -128,11 +136,11 @@ interface ReactiveHead {
128
136
  type UseHeadOptions = Omit<HeadEntryOptions, 'head'> & {
129
137
  head?: VueHeadClient<any>;
130
138
  };
131
- type UseHeadInput<Deprecated = never> = ResolvableValue<ReactiveHead>;
132
- type UseSeoMetaInput = ResolvableProperties<MetaFlatInput> & {
139
+ type UseHeadInput<_Deprecated = never> = ResolvableValue<ReactiveHead>;
140
+ type UseSeoMetaInput = ResolvableProperties<MetaFlat> & {
133
141
  title?: ReactiveHead['title'];
134
142
  titleTemplate?: ReactiveHead['titleTemplate'];
135
143
  };
136
144
  type VueHeadClient<I = UseHeadInput> = Unhead<I> & Plugin;
137
145
 
138
- 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 };
146
+ 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,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.Bm-NbY4b.mjs';
3
+ import { i as injectHead } from './vue.DdPIVN-K.mjs';
4
4
 
5
5
  function registerVueScopeHandlers(script, scope) {
6
6
  if (!scope) {
@@ -24,8 +24,9 @@ function registerVueScopeHandlers(script, scope) {
24
24
  };
25
25
  script.onLoaded = (cb) => _registerCb("loaded", cb);
26
26
  script.onError = (cb) => _registerCb("error", cb);
27
+ const triggerAbortController = script._triggerAbortController;
27
28
  onScopeDispose(() => {
28
- script._triggerAbortController?.abort();
29
+ triggerAbortController?.abort();
29
30
  });
30
31
  }
31
32
  function useScript(_input, _options) {
@@ -37,11 +38,11 @@ function useScript(_input, _options) {
37
38
  options.eventContext = scope;
38
39
  if (scope && typeof options.trigger === "undefined") {
39
40
  options.trigger = onMounted;
40
- } else if (isRef(options.trigger)) {
41
- const refTrigger = options.trigger;
41
+ } else if (isRef(options.trigger) || typeof options.trigger === "function" && options.trigger.length === 0) {
42
+ const trigger = options.trigger;
42
43
  let off;
43
44
  options.trigger = new Promise((resolve) => {
44
- off = watch(refTrigger, (val) => {
45
+ off = watch(trigger, (val) => {
45
46
  if (val) {
46
47
  resolve(true);
47
48
  }
@@ -55,7 +56,9 @@ function useScript(_input, _options) {
55
56
  });
56
57
  }
57
58
  head._scriptStatusWatcher = head._scriptStatusWatcher || head.hooks.hook("script:updated", ({ script: s }) => {
58
- s._statusRef.value = s.status;
59
+ if (s._statusRef) {
60
+ s._statusRef.value = s.status;
61
+ }
59
62
  });
60
63
  const script = useScript$1(head, input, options);
61
64
  script._statusRef = script._statusRef || ref(script.status);
@@ -1,5 +1,5 @@
1
1
  import { getCurrentInstance } from 'vue';
2
- import { u as useHead } from './vue.Bm-NbY4b.mjs';
2
+ import { u as useHead } from './vue.DdPIVN-K.mjs';
3
3
 
4
4
  const VueHeadMixin = {
5
5
  created() {
@@ -20,10 +20,9 @@ function vueInstall(head) {
20
20
  function injectHead() {
21
21
  if (hasInjectionContext()) {
22
22
  const instance = inject(headSymbol);
23
- if (!instance) {
24
- throw new Error("useHead() was called without provide context, ensure you call it through the setup() function.");
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, useServerHead as c, useServerHeadSafe as d, useServerSeoMeta as e, headSymbol as h, injectHead as i, useHead as u, vueInstall as v };
75
+ export { useHeadSafe as a, useSeoMeta as b, headSymbol as h, injectHead as i, useHead as u, vueInstall as v };
@@ -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.9wC_EyGs.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.9wC_EyGs.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 };