@unhead/vue 2.0.0-alpha.2 → 2.0.0-alpha.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.
Files changed (42) hide show
  1. package/dist/client.cjs +4 -4
  2. package/dist/client.d.cts +2 -5
  3. package/dist/client.d.mts +2 -5
  4. package/dist/client.d.ts +2 -5
  5. package/dist/client.mjs +3 -3
  6. package/dist/components.cjs +3 -2
  7. package/dist/components.mjs +2 -1
  8. package/dist/index.cjs +11 -51
  9. package/dist/index.d.cts +6 -11
  10. package/dist/index.d.mts +6 -11
  11. package/dist/index.d.ts +6 -11
  12. package/dist/index.mjs +5 -46
  13. package/dist/legacy.cjs +31 -8
  14. package/dist/legacy.d.cts +22 -21
  15. package/dist/legacy.d.mts +22 -21
  16. package/dist/legacy.d.ts +22 -21
  17. package/dist/legacy.mjs +29 -6
  18. package/dist/server.cjs +5 -5
  19. package/dist/server.d.cts +2 -5
  20. package/dist/server.d.mts +2 -5
  21. package/dist/server.d.ts +2 -5
  22. package/dist/server.mjs +4 -4
  23. package/dist/shared/{vue.BmaKl8wu.mjs → vue.51u-UkLG.mjs} +1 -1
  24. package/dist/shared/vue.BF-HCrO8.d.cts +3 -0
  25. package/dist/shared/vue.BF-HCrO8.d.mts +3 -0
  26. package/dist/shared/vue.BF-HCrO8.d.ts +3 -0
  27. package/dist/shared/{vue.Adq3bKYb.cjs → vue.Btxz9wTa.cjs} +38 -1
  28. package/dist/shared/{vue.BqrzivMs.mjs → vue.CNiRntV8.mjs} +1 -1
  29. package/dist/shared/{vue.DUgB2y83.mjs → vue.D2UzSD_b.mjs} +34 -2
  30. package/dist/shared/{vue.DTOQraae.cjs → vue.DFf1FJKf.cjs} +2 -2
  31. package/dist/shared/{vue.BFi59n5j.cjs → vue.rzkVHzqg.cjs} +2 -2
  32. package/dist/types.cjs +2 -0
  33. package/dist/{shared/vue.B8gXlHM7.d.cts → types.d.cts} +1 -3
  34. package/dist/{shared/vue.B8gXlHM7.d.mts → types.d.mts} +1 -3
  35. package/dist/{shared/vue.B8gXlHM7.d.ts → types.d.ts} +1 -3
  36. package/dist/types.mjs +1 -0
  37. package/legacy.d.ts +1 -0
  38. package/package.json +24 -6
  39. package/types.d.ts +1 -0
  40. package/dist/shared/vue.Bjx6RvLp.d.cts +0 -191
  41. package/dist/shared/vue.Bjx6RvLp.d.mts +0 -191
  42. package/dist/shared/vue.Bjx6RvLp.d.ts +0 -191
package/dist/legacy.d.ts CHANGED
@@ -1,26 +1,20 @@
1
1
  import * as _unhead_schema from '@unhead/schema';
2
- import { ScriptBase, DataKeys, SchemaAugmentations, HeadEntryOptions, Unhead, MergeHead, ActiveHeadEntry } from '@unhead/schema';
3
- import { V as VueHeadClient, U as UseHeadInput, a as UseHeadOptions, b as UseHeadSafeInput, c as UseSeoMetaInput } from './shared/vue.B8gXlHM7.js';
4
- export { r as resolveUnrefHeadInput } from './shared/vue.B8gXlHM7.js';
2
+ import { ScriptBase, DataKeys, SchemaAugmentations, HeadEntryOptions, MergeHead, CreateClientHeadOptions, ActiveHeadEntry } from '@unhead/schema';
3
+ import { VueHeadClient, UseHeadInput, UseHeadOptions as UseHeadOptions$1, UseHeadSafeInput, UseSeoMetaInput } from './types.js';
5
4
  export { createHeadCore } from 'unhead';
6
- export { createHead } from './client.js';
7
- export { createHead as createServerHead } from './server.js';
8
- import { d as distExports } from './shared/vue.Bjx6RvLp.js';
5
+ export { r as resolveUnrefHeadInput } from './shared/vue.BF-HCrO8.js';
6
+ import { MaybeComputedRefEntriesOnly, UseHeadOptions } from '@unhead/vue';
9
7
  import { ScriptInstance, UseScriptStatus, UseScriptOptions as UseScriptOptions$1, UseFunctionType } from 'unhead/legacy';
10
8
  export { UseFunctionType, resolveScriptKey } from 'unhead/legacy';
11
9
  import { Ref } from 'vue';
12
- import './shared/vue.DnywREVF.js';
13
- import 'unhead/client';
14
- import 'unhead/server';
15
- import '@unhead/shared';
16
10
 
17
11
  interface VueScriptInstance<T extends Record<symbol | string, any>> extends Omit<ScriptInstance<T>, 'status'> {
18
12
  status: Ref<UseScriptStatus>;
19
13
  }
20
- type UseScriptInput = string | (distExports.MaybeComputedRefEntriesOnly<Omit<ScriptBase & DataKeys & SchemaAugmentations['script'], 'src'>> & {
14
+ type UseScriptInput = string | (MaybeComputedRefEntriesOnly<Omit<ScriptBase & DataKeys & SchemaAugmentations['script'], 'src'>> & {
21
15
  src: string;
22
16
  });
23
- interface UseScriptOptions<T extends Record<symbol | string, any> = Record<string, any>> extends HeadEntryOptions, Pick<UseScriptOptions$1<T>, 'use' | 'eventContext' | 'beforeInit'> {
17
+ interface UseScriptOptions<T extends Record<symbol | string, any> = Record<string, any>> extends Omit<HeadEntryOptions, 'head'>, Pick<UseScriptOptions$1<T>, 'use' | 'eventContext' | 'beforeInit'> {
24
18
  /**
25
19
  * The trigger to load the script:
26
20
  * - `undefined` | `client` - (Default) Load the script on the client when this js is loaded.
@@ -31,21 +25,28 @@ interface UseScriptOptions<T extends Record<symbol | string, any> = Record<strin
31
25
  * - `ref` - Load the script when the ref is true.
32
26
  */
33
27
  trigger?: UseScriptOptions$1['trigger'] | Ref<boolean>;
28
+ /**
29
+ * The Unhead instance to use.
30
+ */
31
+ head?: UseHeadOptions['head'];
34
32
  }
35
33
  type UseScriptContext<T extends Record<symbol | string, any>> = Promise<T> & VueScriptInstance<T>;
36
- declare function useScript<T extends Record<symbol | string, any> = Record<symbol | string, any>>(_input: UseScriptInput, _options?: UseScriptOptions<T>): UseScriptContext<UseFunctionType<UseScriptOptions<T>, T>>;
34
+ type UseScriptReturn<T extends Record<symbol | string, any>> = UseScriptContext<UseFunctionType<UseScriptOptions<T>, T>>;
35
+ declare function useScript<T extends Record<symbol | string, any> = Record<symbol | string, any>>(_input: UseScriptInput, _options?: UseScriptOptions<T>): UseScriptReturn<T>;
37
36
 
38
37
  declare const CapoPlugin: () => _unhead_schema.HeadPluginInput;
38
+ declare function createHead<T extends MergeHead>(options?: CreateClientHeadOptions): VueHeadClient<T>;
39
+ declare function createServerHead<T extends MergeHead>(options?: CreateClientHeadOptions): VueHeadClient<T>;
39
40
  /**
40
41
  * @deprecated Please switch to non-legacy version
41
42
  */
42
43
  declare function setHeadInjectionHandler(handler: () => VueHeadClient<any> | undefined): void;
43
- declare function injectHead(): Unhead<_unhead_schema.Head<_unhead_schema.SchemaAugmentations>> | undefined;
44
- declare function useHead<T extends MergeHead>(input: UseHeadInput<T>, options?: UseHeadOptions): ActiveHeadEntry<UseHeadInput<T>> | void;
45
- declare function useHeadSafe(input: UseHeadSafeInput, options?: UseHeadOptions): ActiveHeadEntry<UseHeadSafeInput> | void;
46
- declare function useSeoMeta(input: UseSeoMetaInput, options?: UseHeadOptions): ActiveHeadEntry<any> | void;
47
- declare function useServerHead<T extends MergeHead>(input: UseHeadInput<T>, options?: UseHeadOptions): ActiveHeadEntry<any> | void;
48
- declare function useServerHeadSafe(input: UseHeadSafeInput, options?: UseHeadOptions): ActiveHeadEntry<any> | void;
49
- declare function useServerSeoMeta(input: UseSeoMetaInput, options?: UseHeadOptions): ActiveHeadEntry<any> | void;
44
+ declare function injectHead(): VueHeadClient<any> | undefined;
45
+ declare function useHead<T extends MergeHead>(input: UseHeadInput<T>, options?: UseHeadOptions$1): ActiveHeadEntry<UseHeadInput<T>> | void;
46
+ declare function useHeadSafe(input: UseHeadSafeInput, options?: UseHeadOptions$1): ActiveHeadEntry<UseHeadSafeInput> | void;
47
+ declare function useSeoMeta(input: UseSeoMetaInput, options?: UseHeadOptions$1): ActiveHeadEntry<any> | void;
48
+ declare function useServerHead<T extends MergeHead>(input: UseHeadInput<T>, options?: UseHeadOptions$1): ActiveHeadEntry<any> | void;
49
+ declare function useServerHeadSafe(input: UseHeadSafeInput, options?: UseHeadOptions$1): ActiveHeadEntry<any> | void;
50
+ declare function useServerSeoMeta(input: UseSeoMetaInput, options?: UseHeadOptions$1): ActiveHeadEntry<any> | void;
50
51
 
51
- export { CapoPlugin, type UseScriptContext, type UseScriptInput, type UseScriptOptions, type VueScriptInstance, injectHead, setHeadInjectionHandler, useHead, useHeadSafe, useScript, useSeoMeta, useServerHead, useServerHeadSafe, useServerSeoMeta };
52
+ export { CapoPlugin, type UseScriptContext, type UseScriptInput, type UseScriptOptions, type UseScriptReturn, type VueScriptInstance, createHead, createServerHead, injectHead, setHeadInjectionHandler, useHead, useHeadSafe, useScript, useSeoMeta, useServerHead, useServerHeadSafe, useServerSeoMeta };
package/dist/legacy.mjs CHANGED
@@ -1,14 +1,15 @@
1
1
  import { defineHeadPlugin, whitelistSafeInput, unpackMeta } from '@unhead/shared';
2
2
  export { createHeadCore } from 'unhead';
3
+ import { DeprecationsPlugin, PromisesPlugin } from 'unhead/plugins';
3
4
  import { getCurrentInstance, onMounted, isRef, watch, onScopeDispose, ref, inject, watchEffect, onBeforeUnmount, onDeactivated, onActivated } from 'vue';
4
- export { createHead } from './client.mjs';
5
- import { h as headSymbol, r as resolveUnrefHeadInput } from './shared/vue.DUgB2y83.mjs';
6
- export { createHead as createServerHead } from './server.mjs';
5
+ import { createHead as createHead$1 } from './client.mjs';
6
+ import { h as headSymbol, r as resolveUnrefHeadInput } from './shared/vue.D2UzSD_b.mjs';
7
+ import { createHead as createHead$2 } from './server.mjs';
7
8
  import { useScript as useScript$1 } from 'unhead/legacy';
8
9
  export { resolveScriptKey } from 'unhead/legacy';
9
10
  import 'unhead/client';
10
- import './shared/vue.BmaKl8wu.mjs';
11
- import './shared/vue.BqrzivMs.mjs';
11
+ import './shared/vue.51u-UkLG.mjs';
12
+ import './shared/vue.CNiRntV8.mjs';
12
13
  import 'unhead/server';
13
14
 
14
15
  function registerVueScopeHandlers(script, scope) {
@@ -77,6 +78,28 @@ function useScript(_input, _options) {
77
78
  }
78
79
 
79
80
  const CapoPlugin = () => defineHeadPlugin({});
81
+ function createHead(options = {}) {
82
+ return createHead$1({
83
+ disableCapoSorting: true,
84
+ ...options,
85
+ plugins: [
86
+ DeprecationsPlugin,
87
+ PromisesPlugin,
88
+ ...options.plugins || []
89
+ ]
90
+ });
91
+ }
92
+ function createServerHead(options = {}) {
93
+ return createHead$2({
94
+ disableCapoSorting: true,
95
+ ...options,
96
+ plugins: [
97
+ DeprecationsPlugin,
98
+ PromisesPlugin,
99
+ ...options.plugins || []
100
+ ]
101
+ });
102
+ }
80
103
  function setHeadInjectionHandler(handler) {
81
104
  }
82
105
  function injectHead() {
@@ -145,4 +168,4 @@ function useServerSeoMeta(input, options) {
145
168
  return useSeoMeta(input, { ...options, mode: "server" });
146
169
  }
147
170
 
148
- export { CapoPlugin, injectHead, resolveUnrefHeadInput, setHeadInjectionHandler, useHead, useHeadSafe, useScript, useSeoMeta, useServerHead, useServerHeadSafe, useServerSeoMeta };
171
+ export { CapoPlugin, createHead, createServerHead, injectHead, resolveUnrefHeadInput, setHeadInjectionHandler, useHead, useHeadSafe, useScript, useSeoMeta, useServerHead, useServerHeadSafe, useServerSeoMeta };
package/dist/server.cjs CHANGED
@@ -1,11 +1,11 @@
1
1
  'use strict';
2
2
 
3
3
  const server = require('unhead/server');
4
- const useHead = require('./shared/vue.Adq3bKYb.cjs');
5
- const VueReactivityPlugin = require('./shared/vue.BFi59n5j.cjs');
6
- const VueHeadMixin = require('./shared/vue.DTOQraae.cjs');
7
- require('vue');
4
+ const composables = require('./shared/vue.Btxz9wTa.cjs');
5
+ const VueReactivityPlugin = require('./shared/vue.rzkVHzqg.cjs');
6
+ const VueHeadMixin = require('./shared/vue.DFf1FJKf.cjs');
8
7
  require('@unhead/shared');
8
+ require('vue');
9
9
 
10
10
  function createHead(options = {}) {
11
11
  const head = server.createHead({
@@ -15,7 +15,7 @@ function createHead(options = {}) {
15
15
  VueReactivityPlugin.VueReactivityPlugin
16
16
  ]
17
17
  });
18
- head.install = useHead.vueInstall(head);
18
+ head.install = composables.vueInstall(head);
19
19
  return head;
20
20
  }
21
21
 
package/dist/server.d.cts CHANGED
@@ -1,11 +1,8 @@
1
1
  import { MergeHead, CreateHeadOptions } from '@unhead/schema';
2
- import { d as distExports } from './shared/vue.Bjx6RvLp.cjs';
2
+ import { VueHeadClient } from '@unhead/vue';
3
3
  export { V as VueHeadMixin } from './shared/vue.DnywREVF.cjs';
4
4
  export * from 'unhead/server';
5
- import '@unhead/shared';
6
- import 'unhead';
7
- import 'vue';
8
5
 
9
- declare function createHead<T extends MergeHead>(options?: Omit<CreateHeadOptions, 'domDelayFn' | 'document'>): distExports.VueHeadClient<T>;
6
+ declare function createHead<T extends MergeHead>(options?: Omit<CreateHeadOptions, 'domDelayFn' | 'document'>): VueHeadClient<T>;
10
7
 
11
8
  export { createHead };
package/dist/server.d.mts CHANGED
@@ -1,11 +1,8 @@
1
1
  import { MergeHead, CreateHeadOptions } from '@unhead/schema';
2
- import { d as distExports } from './shared/vue.Bjx6RvLp.mjs';
2
+ import { VueHeadClient } from '@unhead/vue';
3
3
  export { V as VueHeadMixin } from './shared/vue.DnywREVF.mjs';
4
4
  export * from 'unhead/server';
5
- import '@unhead/shared';
6
- import 'unhead';
7
- import 'vue';
8
5
 
9
- declare function createHead<T extends MergeHead>(options?: Omit<CreateHeadOptions, 'domDelayFn' | 'document'>): distExports.VueHeadClient<T>;
6
+ declare function createHead<T extends MergeHead>(options?: Omit<CreateHeadOptions, 'domDelayFn' | 'document'>): VueHeadClient<T>;
10
7
 
11
8
  export { createHead };
package/dist/server.d.ts CHANGED
@@ -1,11 +1,8 @@
1
1
  import { MergeHead, CreateHeadOptions } from '@unhead/schema';
2
- import { d as distExports } from './shared/vue.Bjx6RvLp.js';
2
+ import { VueHeadClient } from '@unhead/vue';
3
3
  export { V as VueHeadMixin } from './shared/vue.DnywREVF.js';
4
4
  export * from 'unhead/server';
5
- import '@unhead/shared';
6
- import 'unhead';
7
- import 'vue';
8
5
 
9
- declare function createHead<T extends MergeHead>(options?: Omit<CreateHeadOptions, 'domDelayFn' | 'document'>): distExports.VueHeadClient<T>;
6
+ declare function createHead<T extends MergeHead>(options?: Omit<CreateHeadOptions, 'domDelayFn' | 'document'>): VueHeadClient<T>;
10
7
 
11
8
  export { createHead };
package/dist/server.mjs CHANGED
@@ -1,10 +1,10 @@
1
1
  import { createHead as createHead$1 } from 'unhead/server';
2
2
  export * from 'unhead/server';
3
- import { v as vueInstall } from './shared/vue.DUgB2y83.mjs';
4
- import { V as VueReactivityPlugin } from './shared/vue.BmaKl8wu.mjs';
5
- export { V as VueHeadMixin } from './shared/vue.BqrzivMs.mjs';
6
- import 'vue';
3
+ import { v as vueInstall } from './shared/vue.D2UzSD_b.mjs';
4
+ import { V as VueReactivityPlugin } from './shared/vue.51u-UkLG.mjs';
5
+ export { V as VueHeadMixin } from './shared/vue.CNiRntV8.mjs';
7
6
  import '@unhead/shared';
7
+ import 'vue';
8
8
 
9
9
  function createHead(options = {}) {
10
10
  const head = createHead$1({
@@ -1,5 +1,5 @@
1
1
  import { defineHeadPlugin } from '@unhead/shared';
2
- import { r as resolveUnrefHeadInput } from './vue.DUgB2y83.mjs';
2
+ import { r as resolveUnrefHeadInput } from './vue.D2UzSD_b.mjs';
3
3
 
4
4
  const VueReactivityPlugin = defineHeadPlugin({
5
5
  hooks: {
@@ -0,0 +1,3 @@
1
+ declare function resolveUnrefHeadInput(ref: any): any;
2
+
3
+ export { resolveUnrefHeadInput as r };
@@ -0,0 +1,3 @@
1
+ declare function resolveUnrefHeadInput(ref: any): any;
2
+
3
+ export { resolveUnrefHeadInput as r };
@@ -0,0 +1,3 @@
1
+ declare function resolveUnrefHeadInput(ref: any): any;
2
+
3
+ export { resolveUnrefHeadInput as r };
@@ -1,5 +1,6 @@
1
1
  'use strict';
2
2
 
3
+ const shared = require('@unhead/shared');
3
4
  const vue = require('vue');
4
5
 
5
6
  function resolveUnref(r) {
@@ -52,7 +53,6 @@ function injectHead() {
52
53
  }
53
54
  throw new Error("useHead() was called without provide context, ensure you call it through the setup() function.");
54
55
  }
55
-
56
56
  function useHead(input, options = {}) {
57
57
  const head = options.head || injectHead();
58
58
  return head.ssr ? head.push(input, options) : clientUseHead(head, input, options);
@@ -81,9 +81,46 @@ function clientUseHead(head, input, options = {}) {
81
81
  }
82
82
  return entry;
83
83
  }
84
+ function useHeadSafe(input, options = {}) {
85
+ return useHead(input, { ...options, transform: shared.whitelistSafeInput });
86
+ }
87
+ function useSeoMeta(input, options) {
88
+ const { title, titleTemplate, ...meta } = input;
89
+ return useHead({
90
+ title,
91
+ titleTemplate,
92
+ // @ts-expect-error runtime type
93
+ _flatMeta: meta
94
+ }, {
95
+ ...options,
96
+ transform(t) {
97
+ const meta2 = shared.unpackMeta({ ...t._flatMeta });
98
+ delete t._flatMeta;
99
+ return {
100
+ // @ts-expect-error runtime type
101
+ ...t,
102
+ meta: meta2
103
+ };
104
+ }
105
+ });
106
+ }
107
+ function useServerHead(input, options = {}) {
108
+ return useHead(input, { ...options, mode: "server" });
109
+ }
110
+ function useServerHeadSafe(input, options = {}) {
111
+ return useHeadSafe(input, { ...options, mode: "server" });
112
+ }
113
+ function useServerSeoMeta(input, options) {
114
+ return useSeoMeta(input, { ...options, mode: "server" });
115
+ }
84
116
 
85
117
  exports.headSymbol = headSymbol;
86
118
  exports.injectHead = injectHead;
87
119
  exports.resolveUnrefHeadInput = resolveUnrefHeadInput;
88
120
  exports.useHead = useHead;
121
+ exports.useHeadSafe = useHeadSafe;
122
+ exports.useSeoMeta = useSeoMeta;
123
+ exports.useServerHead = useServerHead;
124
+ exports.useServerHeadSafe = useServerHeadSafe;
125
+ exports.useServerSeoMeta = useServerSeoMeta;
89
126
  exports.vueInstall = vueInstall;
@@ -1,5 +1,5 @@
1
1
  import { getCurrentInstance } from 'vue';
2
- import { u as useHead } from './vue.DUgB2y83.mjs';
2
+ import { u as useHead } from './vue.D2UzSD_b.mjs';
3
3
 
4
4
  const VueHeadMixin = {
5
5
  created() {
@@ -1,3 +1,4 @@
1
+ import { whitelistSafeInput, unpackMeta } from '@unhead/shared';
1
2
  import { unref, hasInjectionContext, inject, ref, watchEffect, watch, getCurrentInstance, onBeforeUnmount, onDeactivated, onActivated } from 'vue';
2
3
 
3
4
  function resolveUnref(r) {
@@ -50,7 +51,6 @@ function injectHead() {
50
51
  }
51
52
  throw new Error("useHead() was called without provide context, ensure you call it through the setup() function.");
52
53
  }
53
-
54
54
  function useHead(input, options = {}) {
55
55
  const head = options.head || injectHead();
56
56
  return head.ssr ? head.push(input, options) : clientUseHead(head, input, options);
@@ -79,5 +79,37 @@ function clientUseHead(head, input, options = {}) {
79
79
  }
80
80
  return entry;
81
81
  }
82
+ function useHeadSafe(input, options = {}) {
83
+ return useHead(input, { ...options, transform: whitelistSafeInput });
84
+ }
85
+ function useSeoMeta(input, options) {
86
+ const { title, titleTemplate, ...meta } = input;
87
+ return useHead({
88
+ title,
89
+ titleTemplate,
90
+ // @ts-expect-error runtime type
91
+ _flatMeta: meta
92
+ }, {
93
+ ...options,
94
+ transform(t) {
95
+ const meta2 = unpackMeta({ ...t._flatMeta });
96
+ delete t._flatMeta;
97
+ return {
98
+ // @ts-expect-error runtime type
99
+ ...t,
100
+ meta: meta2
101
+ };
102
+ }
103
+ });
104
+ }
105
+ function useServerHead(input, options = {}) {
106
+ return useHead(input, { ...options, mode: "server" });
107
+ }
108
+ function useServerHeadSafe(input, options = {}) {
109
+ return useHeadSafe(input, { ...options, mode: "server" });
110
+ }
111
+ function useServerSeoMeta(input, options) {
112
+ return useSeoMeta(input, { ...options, mode: "server" });
113
+ }
82
114
 
83
- export { headSymbol as h, injectHead as i, resolveUnrefHeadInput as r, useHead as u, vueInstall as v };
115
+ export { useHeadSafe as a, useSeoMeta as b, useServerHead as c, useServerHeadSafe as d, useServerSeoMeta as e, headSymbol as h, injectHead as i, resolveUnrefHeadInput as r, useHead as u, vueInstall as v };
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  const vue = require('vue');
4
- const useHead = require('./vue.Adq3bKYb.cjs');
4
+ const composables = require('./vue.Btxz9wTa.cjs');
5
5
 
6
6
  const VueHeadMixin = {
7
7
  created() {
@@ -13,7 +13,7 @@ const VueHeadMixin = {
13
13
  if (!options || !("head" in options))
14
14
  return;
15
15
  source = typeof options.head === "function" ? () => options.head.call(instance.proxy) : options.head;
16
- source && useHead.useHead(source);
16
+ source && composables.useHead(source);
17
17
  }
18
18
  };
19
19
 
@@ -1,13 +1,13 @@
1
1
  'use strict';
2
2
 
3
3
  const shared = require('@unhead/shared');
4
- const useHead = require('./vue.Adq3bKYb.cjs');
4
+ const composables = require('./vue.Btxz9wTa.cjs');
5
5
 
6
6
  const VueReactivityPlugin = shared.defineHeadPlugin({
7
7
  hooks: {
8
8
  "entries:resolve": (ctx) => {
9
9
  for (const entry of ctx.entries)
10
- entry.resolvedInput = useHead.resolveUnrefHeadInput(entry.input);
10
+ entry.resolvedInput = composables.resolveUnrefHeadInput(entry.input);
11
11
  }
12
12
  }
13
13
  });
package/dist/types.cjs ADDED
@@ -0,0 +1,2 @@
1
+ 'use strict';
2
+
@@ -1,8 +1,6 @@
1
1
  import { BaseHtmlAttr, MaybeArray, BaseBodyAttr, Title as Title$1, TitleTemplate as TitleTemplate$1, EntryAugmentation, Base as Base$1, Link as Link$1, Meta as Meta$1, Style as Style$1, Script as Script$1, Noscript as Noscript$1, DataKeys, SchemaAugmentations, DefinedValueOrEmptyObject, MaybeEventFnHandlers, BodyEvents, MergeHead, HeadEntryOptions, MetaFlatInput, Unhead, SafeMeta, SafeLink, SafeNoscript, SafeScript, SafeHtmlAttr, SafeBodyAttr } from '@unhead/schema';
2
2
  import { ComputedRef, Ref, Plugin } from 'vue';
3
3
 
4
- declare function resolveUnrefHeadInput(ref: any): any;
5
-
6
4
  type MaybeReadonlyRef<T> = ComputedRef<T>;
7
5
  type MaybeComputedRef<T> = T | MaybeReadonlyRef<T> | Ref<T>;
8
6
  type MaybeComputedRefOrFalsy<T> = T | MaybeReadonlyRef<T> | Ref<T>;
@@ -141,4 +139,4 @@ interface HeadSafe extends Pick<ReactiveHead, 'title' | 'titleTemplate' | 'templ
141
139
  }
142
140
  type UseHeadSafeInput = MaybeComputedRef<HeadSafe>;
143
141
 
144
- export { type BodyAttr as B, type HeadSafe as H, type Link as L, type Meta as M, type Noscript as N, type ReactiveHead as R, type Style as S, type Title as T, type UseHeadInput as U, type VueHeadClient as V, type UseHeadOptions as a, type UseHeadSafeInput as b, type UseSeoMetaInput as c, type HtmlAttr as d, type TitleTemplate as e, type Base as f, type Script as g, type HtmlAttributes as h, type BodyAttributes as i, type MaybeReadonlyRef as j, type MaybeComputedRef as k, type MaybeComputedRefOrFalsy as l, type MaybeComputedRefOrPromise as m, type MaybeComputedRefEntries as n, type MaybeComputedRefEntriesOnly as o, resolveUnrefHeadInput as r };
142
+ export type { Base, BodyAttr, BodyAttributes, HeadSafe, HtmlAttr, HtmlAttributes, Link, MaybeComputedRef, MaybeComputedRefEntries, MaybeComputedRefEntriesOnly, MaybeComputedRefOrFalsy, MaybeComputedRefOrPromise, MaybeReadonlyRef, Meta, Noscript, ReactiveHead, Script, Style, Title, TitleTemplate, UseHeadInput, UseHeadOptions, UseHeadSafeInput, UseSeoMetaInput, VueHeadClient };
@@ -1,8 +1,6 @@
1
1
  import { BaseHtmlAttr, MaybeArray, BaseBodyAttr, Title as Title$1, TitleTemplate as TitleTemplate$1, EntryAugmentation, Base as Base$1, Link as Link$1, Meta as Meta$1, Style as Style$1, Script as Script$1, Noscript as Noscript$1, DataKeys, SchemaAugmentations, DefinedValueOrEmptyObject, MaybeEventFnHandlers, BodyEvents, MergeHead, HeadEntryOptions, MetaFlatInput, Unhead, SafeMeta, SafeLink, SafeNoscript, SafeScript, SafeHtmlAttr, SafeBodyAttr } from '@unhead/schema';
2
2
  import { ComputedRef, Ref, Plugin } from 'vue';
3
3
 
4
- declare function resolveUnrefHeadInput(ref: any): any;
5
-
6
4
  type MaybeReadonlyRef<T> = ComputedRef<T>;
7
5
  type MaybeComputedRef<T> = T | MaybeReadonlyRef<T> | Ref<T>;
8
6
  type MaybeComputedRefOrFalsy<T> = T | MaybeReadonlyRef<T> | Ref<T>;
@@ -141,4 +139,4 @@ interface HeadSafe extends Pick<ReactiveHead, 'title' | 'titleTemplate' | 'templ
141
139
  }
142
140
  type UseHeadSafeInput = MaybeComputedRef<HeadSafe>;
143
141
 
144
- export { type BodyAttr as B, type HeadSafe as H, type Link as L, type Meta as M, type Noscript as N, type ReactiveHead as R, type Style as S, type Title as T, type UseHeadInput as U, type VueHeadClient as V, type UseHeadOptions as a, type UseHeadSafeInput as b, type UseSeoMetaInput as c, type HtmlAttr as d, type TitleTemplate as e, type Base as f, type Script as g, type HtmlAttributes as h, type BodyAttributes as i, type MaybeReadonlyRef as j, type MaybeComputedRef as k, type MaybeComputedRefOrFalsy as l, type MaybeComputedRefOrPromise as m, type MaybeComputedRefEntries as n, type MaybeComputedRefEntriesOnly as o, resolveUnrefHeadInput as r };
142
+ export type { Base, BodyAttr, BodyAttributes, HeadSafe, HtmlAttr, HtmlAttributes, Link, MaybeComputedRef, MaybeComputedRefEntries, MaybeComputedRefEntriesOnly, MaybeComputedRefOrFalsy, MaybeComputedRefOrPromise, MaybeReadonlyRef, Meta, Noscript, ReactiveHead, Script, Style, Title, TitleTemplate, UseHeadInput, UseHeadOptions, UseHeadSafeInput, UseSeoMetaInput, VueHeadClient };
@@ -1,8 +1,6 @@
1
1
  import { BaseHtmlAttr, MaybeArray, BaseBodyAttr, Title as Title$1, TitleTemplate as TitleTemplate$1, EntryAugmentation, Base as Base$1, Link as Link$1, Meta as Meta$1, Style as Style$1, Script as Script$1, Noscript as Noscript$1, DataKeys, SchemaAugmentations, DefinedValueOrEmptyObject, MaybeEventFnHandlers, BodyEvents, MergeHead, HeadEntryOptions, MetaFlatInput, Unhead, SafeMeta, SafeLink, SafeNoscript, SafeScript, SafeHtmlAttr, SafeBodyAttr } from '@unhead/schema';
2
2
  import { ComputedRef, Ref, Plugin } from 'vue';
3
3
 
4
- declare function resolveUnrefHeadInput(ref: any): any;
5
-
6
4
  type MaybeReadonlyRef<T> = ComputedRef<T>;
7
5
  type MaybeComputedRef<T> = T | MaybeReadonlyRef<T> | Ref<T>;
8
6
  type MaybeComputedRefOrFalsy<T> = T | MaybeReadonlyRef<T> | Ref<T>;
@@ -141,4 +139,4 @@ interface HeadSafe extends Pick<ReactiveHead, 'title' | 'titleTemplate' | 'templ
141
139
  }
142
140
  type UseHeadSafeInput = MaybeComputedRef<HeadSafe>;
143
141
 
144
- export { type BodyAttr as B, type HeadSafe as H, type Link as L, type Meta as M, type Noscript as N, type ReactiveHead as R, type Style as S, type Title as T, type UseHeadInput as U, type VueHeadClient as V, type UseHeadOptions as a, type UseHeadSafeInput as b, type UseSeoMetaInput as c, type HtmlAttr as d, type TitleTemplate as e, type Base as f, type Script as g, type HtmlAttributes as h, type BodyAttributes as i, type MaybeReadonlyRef as j, type MaybeComputedRef as k, type MaybeComputedRefOrFalsy as l, type MaybeComputedRefOrPromise as m, type MaybeComputedRefEntries as n, type MaybeComputedRefEntriesOnly as o, resolveUnrefHeadInput as r };
142
+ export type { Base, BodyAttr, BodyAttributes, HeadSafe, HtmlAttr, HtmlAttributes, Link, MaybeComputedRef, MaybeComputedRefEntries, MaybeComputedRefEntriesOnly, MaybeComputedRefOrFalsy, MaybeComputedRefOrPromise, MaybeReadonlyRef, Meta, Noscript, ReactiveHead, Script, Style, Title, TitleTemplate, UseHeadInput, UseHeadOptions, UseHeadSafeInput, UseSeoMetaInput, VueHeadClient };
package/dist/types.mjs ADDED
@@ -0,0 +1 @@
1
+
package/legacy.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './dist/legacy'
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@unhead/vue",
3
3
  "type": "module",
4
- "version": "2.0.0-alpha.2",
4
+ "version": "2.0.0-alpha.3",
5
5
  "description": "Full-stack <head> manager built for Vue.",
6
6
  "author": "Harlan Wilton <harlan@harlanzw.com>",
7
7
  "license": "MIT",
@@ -40,6 +40,16 @@
40
40
  "types": "./dist/client.d.ts",
41
41
  "import": "./dist/client.mjs",
42
42
  "require": "./dist/client.cjs"
43
+ },
44
+ "./types": {
45
+ "types": "./dist/types.d.ts",
46
+ "import": "./dist/types.mjs",
47
+ "require": "./dist/types.cjs"
48
+ },
49
+ "./legacy": {
50
+ "types": "./dist/legacy.d.ts",
51
+ "import": "./dist/legacy.mjs",
52
+ "require": "./dist/legacy.cjs"
43
53
  }
44
54
  },
45
55
  "main": "dist/index.cjs",
@@ -55,16 +65,24 @@
55
65
  ],
56
66
  "client": [
57
67
  "dist/client"
68
+ ],
69
+ "types": [
70
+ "dist/types"
71
+ ],
72
+ "legacy": [
73
+ "dist/legacy"
58
74
  ]
59
75
  }
60
76
  },
61
77
  "files": [
62
78
  "client.d.ts",
63
79
  "dist",
64
- "server.d.ts"
80
+ "server.d.ts",
81
+ "types.d.ts",
82
+ "legacy.d.ts"
65
83
  ],
66
84
  "peerDependencies": {
67
- "vue": ">=3"
85
+ "vue": ">=3.5.13"
68
86
  },
69
87
  "build": {
70
88
  "external": [
@@ -73,9 +91,9 @@
73
91
  },
74
92
  "dependencies": {
75
93
  "hookable": "^5.5.3",
76
- "@unhead/schema": "2.0.0-alpha.2",
77
- "unhead": "2.0.0-alpha.2",
78
- "@unhead/shared": "2.0.0-alpha.2"
94
+ "@unhead/schema": "2.0.0-alpha.3",
95
+ "@unhead/shared": "2.0.0-alpha.3",
96
+ "unhead": "2.0.0-alpha.3"
79
97
  },
80
98
  "scripts": {
81
99
  "build": "unbuild .",
package/types.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './dist/legacy'