@unhead/vue 2.0.0-alpha.0 → 2.0.0-alpha.2

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/README.md ADDED
@@ -0,0 +1,13 @@
1
+ # `@unhead/vue`
2
+
3
+ Visit the [documentation site](https://unhead.unjs.io/) for guides and API references.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm i @unhead/vue
9
+ ```
10
+
11
+ ## License
12
+
13
+ MIT License © 2022-PRESENT [Harlan Wilton](https://github.com/harlan-zw)
package/dist/client.cjs CHANGED
@@ -2,10 +2,9 @@
2
2
 
3
3
  const client = require('unhead/client');
4
4
  const vue = require('vue');
5
- const useHead = require('./shared/vue.BwEnMiRq.cjs');
6
- const VueReactivityPlugin = require('./shared/vue.DIPZN3-d.cjs');
7
- const VueHeadMixin = require('./shared/vue.3OjaFlxQ.cjs');
8
- require('unhead');
5
+ const useHead = require('./shared/vue.Adq3bKYb.cjs');
6
+ const VueReactivityPlugin = require('./shared/vue.BFi59n5j.cjs');
7
+ const VueHeadMixin = require('./shared/vue.DTOQraae.cjs');
9
8
  require('@unhead/shared');
10
9
 
11
10
  function createHead(options = {}) {
package/dist/client.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { MergeHead, CreateClientHeadOptions } from '@unhead/schema';
2
- import { d as distExports } from './shared/vue.DShwsPiO.cjs';
2
+ import { d as distExports } from './shared/vue.Bjx6RvLp.cjs';
3
3
  export { V as VueHeadMixin } from './shared/vue.DnywREVF.cjs';
4
4
  export * from 'unhead/client';
5
5
  import '@unhead/shared';
package/dist/client.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { MergeHead, CreateClientHeadOptions } from '@unhead/schema';
2
- import { d as distExports } from './shared/vue.DShwsPiO.mjs';
2
+ import { d as distExports } from './shared/vue.Bjx6RvLp.mjs';
3
3
  export { V as VueHeadMixin } from './shared/vue.DnywREVF.mjs';
4
4
  export * from 'unhead/client';
5
5
  import '@unhead/shared';
package/dist/client.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { MergeHead, CreateClientHeadOptions } from '@unhead/schema';
2
- import { d as distExports } from './shared/vue.DShwsPiO.js';
2
+ import { d as distExports } from './shared/vue.Bjx6RvLp.js';
3
3
  export { V as VueHeadMixin } from './shared/vue.DnywREVF.js';
4
4
  export * from 'unhead/client';
5
5
  import '@unhead/shared';
package/dist/client.mjs CHANGED
@@ -1,10 +1,9 @@
1
1
  import { createHead as createHead$1 } from 'unhead/client';
2
2
  export * from 'unhead/client';
3
3
  import { nextTick } from 'vue';
4
- import { v as vueInstall } from './shared/vue.Sg4YunmP.mjs';
5
- import { V as VueReactivityPlugin } from './shared/vue.B6jdKgLD.mjs';
6
- export { V as VueHeadMixin } from './shared/vue.O-w7-AFg.mjs';
7
- import 'unhead';
4
+ import { v as vueInstall } from './shared/vue.DUgB2y83.mjs';
5
+ import { V as VueReactivityPlugin } from './shared/vue.BmaKl8wu.mjs';
6
+ export { V as VueHeadMixin } from './shared/vue.BqrzivMs.mjs';
8
7
  import '@unhead/shared';
9
8
 
10
9
  function createHead(options = {}) {
@@ -1,8 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  const vue = require('vue');
4
- const useHead = require('./shared/vue.BwEnMiRq.cjs');
5
- require('unhead');
4
+ const useHead = require('./shared/vue.Adq3bKYb.cjs');
6
5
 
7
6
  function addVNodeToHeadObj(node, obj) {
8
7
  const nodeType = node.type;
@@ -1,6 +1,5 @@
1
1
  import { defineComponent, ref, onBeforeUnmount, watchEffect } from 'vue';
2
- import { u as useHead } from './shared/vue.Sg4YunmP.mjs';
3
- import 'unhead';
2
+ import { u as useHead } from './shared/vue.DUgB2y83.mjs';
4
3
 
5
4
  function addVNodeToHeadObj(node, obj) {
6
5
  const nodeType = node.type;
package/dist/index.cjs CHANGED
@@ -2,8 +2,8 @@
2
2
 
3
3
  const shared = require('@unhead/shared');
4
4
  const unhead = require('unhead');
5
- const useHead = require('./shared/vue.BwEnMiRq.cjs');
6
- const VueHeadMixin = require('./shared/vue.3OjaFlxQ.cjs');
5
+ const useHead = require('./shared/vue.Adq3bKYb.cjs');
6
+ const VueHeadMixin = require('./shared/vue.DTOQraae.cjs');
7
7
  require('vue');
8
8
 
9
9
  const coreComposableNames = [
@@ -53,7 +53,6 @@ function useServerSeoMeta(input, options) {
53
53
  const CapoPlugin = () => shared.defineHeadPlugin({});
54
54
 
55
55
  exports.createHeadCore = unhead.createHeadCore;
56
- exports.unheadCtx = unhead.unheadCtx;
57
56
  exports.injectHead = useHead.injectHead;
58
57
  exports.resolveUnrefHeadInput = useHead.resolveUnrefHeadInput;
59
58
  exports.useHead = useHead.useHead;
package/dist/index.d.cts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as _unhead_schema from '@unhead/schema';
2
2
  import { Unhead, MergeHead, ActiveHeadEntry } from '@unhead/schema';
3
3
  export { ActiveHeadEntry, Head, HeadEntryOptions, HeadTag, MergeHead, Unhead } from '@unhead/schema';
4
- export { createHeadCore, unheadCtx } from 'unhead';
4
+ export { createHeadCore } from 'unhead';
5
5
  import { U as UseHeadInput, a as UseHeadOptions, b as UseHeadSafeInput, c as UseSeoMetaInput } from './shared/vue.B8gXlHM7.cjs';
6
6
  export { f as Base, B as BodyAttr, i as BodyAttributes, H as HeadSafe, d as HtmlAttr, h as HtmlAttributes, L as Link, k as MaybeComputedRef, n as MaybeComputedRefEntries, o as MaybeComputedRefEntriesOnly, l as MaybeComputedRefOrFalsy, m as MaybeComputedRefOrPromise, j as MaybeReadonlyRef, M as Meta, N as Noscript, R as ReactiveHead, g as Script, S as Style, T as Title, e as TitleTemplate, V as VueHeadClient, r as resolveUnrefHeadInput } from './shared/vue.B8gXlHM7.cjs';
7
7
  export { V as VueHeadMixin } from './shared/vue.DnywREVF.cjs';
@@ -11,7 +11,7 @@ declare const unheadVueComposablesImports: {
11
11
  '@unhead/vue': string[];
12
12
  };
13
13
 
14
- declare function injectHead(): Unhead<_unhead_schema.Head<_unhead_schema.SchemaAugmentations>> | Unhead<_unhead_schema.Head<_unhead_schema.MergeHead>>;
14
+ declare function injectHead(): Unhead<_unhead_schema.Head<_unhead_schema.SchemaAugmentations>>;
15
15
 
16
16
  declare function useHead<T extends MergeHead>(input: UseHeadInput<T>, options?: UseHeadOptions): ActiveHeadEntry<UseHeadInput<T>>;
17
17
 
package/dist/index.d.mts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as _unhead_schema from '@unhead/schema';
2
2
  import { Unhead, MergeHead, ActiveHeadEntry } from '@unhead/schema';
3
3
  export { ActiveHeadEntry, Head, HeadEntryOptions, HeadTag, MergeHead, Unhead } from '@unhead/schema';
4
- export { createHeadCore, unheadCtx } from 'unhead';
4
+ export { createHeadCore } from 'unhead';
5
5
  import { U as UseHeadInput, a as UseHeadOptions, b as UseHeadSafeInput, c as UseSeoMetaInput } from './shared/vue.B8gXlHM7.mjs';
6
6
  export { f as Base, B as BodyAttr, i as BodyAttributes, H as HeadSafe, d as HtmlAttr, h as HtmlAttributes, L as Link, k as MaybeComputedRef, n as MaybeComputedRefEntries, o as MaybeComputedRefEntriesOnly, l as MaybeComputedRefOrFalsy, m as MaybeComputedRefOrPromise, j as MaybeReadonlyRef, M as Meta, N as Noscript, R as ReactiveHead, g as Script, S as Style, T as Title, e as TitleTemplate, V as VueHeadClient, r as resolveUnrefHeadInput } from './shared/vue.B8gXlHM7.mjs';
7
7
  export { V as VueHeadMixin } from './shared/vue.DnywREVF.mjs';
@@ -11,7 +11,7 @@ declare const unheadVueComposablesImports: {
11
11
  '@unhead/vue': string[];
12
12
  };
13
13
 
14
- declare function injectHead(): Unhead<_unhead_schema.Head<_unhead_schema.SchemaAugmentations>> | Unhead<_unhead_schema.Head<_unhead_schema.MergeHead>>;
14
+ declare function injectHead(): Unhead<_unhead_schema.Head<_unhead_schema.SchemaAugmentations>>;
15
15
 
16
16
  declare function useHead<T extends MergeHead>(input: UseHeadInput<T>, options?: UseHeadOptions): ActiveHeadEntry<UseHeadInput<T>>;
17
17
 
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as _unhead_schema from '@unhead/schema';
2
2
  import { Unhead, MergeHead, ActiveHeadEntry } from '@unhead/schema';
3
3
  export { ActiveHeadEntry, Head, HeadEntryOptions, HeadTag, MergeHead, Unhead } from '@unhead/schema';
4
- export { createHeadCore, unheadCtx } from 'unhead';
4
+ export { createHeadCore } from 'unhead';
5
5
  import { U as UseHeadInput, a as UseHeadOptions, b as UseHeadSafeInput, c as UseSeoMetaInput } from './shared/vue.B8gXlHM7.js';
6
6
  export { f as Base, B as BodyAttr, i as BodyAttributes, H as HeadSafe, d as HtmlAttr, h as HtmlAttributes, L as Link, k as MaybeComputedRef, n as MaybeComputedRefEntries, o as MaybeComputedRefEntriesOnly, l as MaybeComputedRefOrFalsy, m as MaybeComputedRefOrPromise, j as MaybeReadonlyRef, M as Meta, N as Noscript, R as ReactiveHead, g as Script, S as Style, T as Title, e as TitleTemplate, V as VueHeadClient, r as resolveUnrefHeadInput } from './shared/vue.B8gXlHM7.js';
7
7
  export { V as VueHeadMixin } from './shared/vue.DnywREVF.js';
@@ -11,7 +11,7 @@ declare const unheadVueComposablesImports: {
11
11
  '@unhead/vue': string[];
12
12
  };
13
13
 
14
- declare function injectHead(): Unhead<_unhead_schema.Head<_unhead_schema.SchemaAugmentations>> | Unhead<_unhead_schema.Head<_unhead_schema.MergeHead>>;
14
+ declare function injectHead(): Unhead<_unhead_schema.Head<_unhead_schema.SchemaAugmentations>>;
15
15
 
16
16
  declare function useHead<T extends MergeHead>(input: UseHeadInput<T>, options?: UseHeadOptions): ActiveHeadEntry<UseHeadInput<T>>;
17
17
 
package/dist/index.mjs CHANGED
@@ -1,8 +1,8 @@
1
1
  import { composableNames, whitelistSafeInput, unpackMeta, defineHeadPlugin } from '@unhead/shared';
2
- export { createHeadCore, unheadCtx } from 'unhead';
3
- import { u as useHead } from './shared/vue.Sg4YunmP.mjs';
4
- export { i as injectHead, r as resolveUnrefHeadInput } from './shared/vue.Sg4YunmP.mjs';
5
- export { V as VueHeadMixin } from './shared/vue.O-w7-AFg.mjs';
2
+ export { createHeadCore } from 'unhead';
3
+ import { u as useHead } from './shared/vue.DUgB2y83.mjs';
4
+ export { i as injectHead, r as resolveUnrefHeadInput } from './shared/vue.DUgB2y83.mjs';
5
+ export { V as VueHeadMixin } from './shared/vue.BqrzivMs.mjs';
6
6
  import 'vue';
7
7
 
8
8
  const coreComposableNames = [
package/dist/legacy.cjs CHANGED
@@ -4,12 +4,12 @@ const shared = require('@unhead/shared');
4
4
  const unhead = require('unhead');
5
5
  const vue = require('vue');
6
6
  const client = require('./client.cjs');
7
- const useHead$1 = require('./shared/vue.BwEnMiRq.cjs');
7
+ const useHead$1 = require('./shared/vue.Adq3bKYb.cjs');
8
8
  const server = require('./server.cjs');
9
9
  const legacy = require('unhead/legacy');
10
10
  require('unhead/client');
11
- require('./shared/vue.DIPZN3-d.cjs');
12
- require('./shared/vue.3OjaFlxQ.cjs');
11
+ require('./shared/vue.BFi59n5j.cjs');
12
+ require('./shared/vue.DTOQraae.cjs');
13
13
  require('unhead/server');
14
14
 
15
15
  function registerVueScopeHandlers(script, scope) {
@@ -79,13 +79,8 @@ function useScript(_input, _options) {
79
79
 
80
80
  const CapoPlugin = () => shared.defineHeadPlugin({});
81
81
  function setHeadInjectionHandler(handler) {
82
- unhead.unheadCtx.set(handler(), true);
83
82
  }
84
83
  function injectHead() {
85
- const ctx = unhead.tryUseUnhead();
86
- if (ctx) {
87
- return ctx;
88
- }
89
84
  return vue.inject(useHead$1.headSymbol);
90
85
  }
91
86
  function useHead(input, options = {}) {
package/dist/legacy.d.cts CHANGED
@@ -5,7 +5,7 @@ export { r as resolveUnrefHeadInput } from './shared/vue.B8gXlHM7.cjs';
5
5
  export { createHeadCore } from 'unhead';
6
6
  export { createHead } from './client.cjs';
7
7
  export { createHead as createServerHead } from './server.cjs';
8
- import { d as distExports } from './shared/vue.DShwsPiO.cjs';
8
+ import { d as distExports } from './shared/vue.Bjx6RvLp.cjs';
9
9
  import { ScriptInstance, UseScriptStatus, UseScriptOptions as UseScriptOptions$1, UseFunctionType } from 'unhead/legacy';
10
10
  export { UseFunctionType, resolveScriptKey } from 'unhead/legacy';
11
11
  import { Ref } from 'vue';
@@ -40,7 +40,7 @@ declare const CapoPlugin: () => _unhead_schema.HeadPluginInput;
40
40
  * @deprecated Please switch to non-legacy version
41
41
  */
42
42
  declare function setHeadInjectionHandler(handler: () => VueHeadClient<any> | undefined): void;
43
- declare function injectHead(): Unhead<_unhead_schema.Head<MergeHead>> | Unhead<_unhead_schema.Head<_unhead_schema.SchemaAugmentations>> | undefined;
43
+ declare function injectHead(): Unhead<_unhead_schema.Head<_unhead_schema.SchemaAugmentations>> | undefined;
44
44
  declare function useHead<T extends MergeHead>(input: UseHeadInput<T>, options?: UseHeadOptions): ActiveHeadEntry<UseHeadInput<T>> | void;
45
45
  declare function useHeadSafe(input: UseHeadSafeInput, options?: UseHeadOptions): ActiveHeadEntry<UseHeadSafeInput> | void;
46
46
  declare function useSeoMeta(input: UseSeoMetaInput, options?: UseHeadOptions): ActiveHeadEntry<any> | void;
package/dist/legacy.d.mts CHANGED
@@ -5,7 +5,7 @@ export { r as resolveUnrefHeadInput } from './shared/vue.B8gXlHM7.mjs';
5
5
  export { createHeadCore } from 'unhead';
6
6
  export { createHead } from './client.mjs';
7
7
  export { createHead as createServerHead } from './server.mjs';
8
- import { d as distExports } from './shared/vue.DShwsPiO.mjs';
8
+ import { d as distExports } from './shared/vue.Bjx6RvLp.mjs';
9
9
  import { ScriptInstance, UseScriptStatus, UseScriptOptions as UseScriptOptions$1, UseFunctionType } from 'unhead/legacy';
10
10
  export { UseFunctionType, resolveScriptKey } from 'unhead/legacy';
11
11
  import { Ref } from 'vue';
@@ -40,7 +40,7 @@ declare const CapoPlugin: () => _unhead_schema.HeadPluginInput;
40
40
  * @deprecated Please switch to non-legacy version
41
41
  */
42
42
  declare function setHeadInjectionHandler(handler: () => VueHeadClient<any> | undefined): void;
43
- declare function injectHead(): Unhead<_unhead_schema.Head<MergeHead>> | Unhead<_unhead_schema.Head<_unhead_schema.SchemaAugmentations>> | undefined;
43
+ declare function injectHead(): Unhead<_unhead_schema.Head<_unhead_schema.SchemaAugmentations>> | undefined;
44
44
  declare function useHead<T extends MergeHead>(input: UseHeadInput<T>, options?: UseHeadOptions): ActiveHeadEntry<UseHeadInput<T>> | void;
45
45
  declare function useHeadSafe(input: UseHeadSafeInput, options?: UseHeadOptions): ActiveHeadEntry<UseHeadSafeInput> | void;
46
46
  declare function useSeoMeta(input: UseSeoMetaInput, options?: UseHeadOptions): ActiveHeadEntry<any> | void;
package/dist/legacy.d.ts CHANGED
@@ -5,7 +5,7 @@ export { r as resolveUnrefHeadInput } from './shared/vue.B8gXlHM7.js';
5
5
  export { createHeadCore } from 'unhead';
6
6
  export { createHead } from './client.js';
7
7
  export { createHead as createServerHead } from './server.js';
8
- import { d as distExports } from './shared/vue.DShwsPiO.js';
8
+ import { d as distExports } from './shared/vue.Bjx6RvLp.js';
9
9
  import { ScriptInstance, UseScriptStatus, UseScriptOptions as UseScriptOptions$1, UseFunctionType } from 'unhead/legacy';
10
10
  export { UseFunctionType, resolveScriptKey } from 'unhead/legacy';
11
11
  import { Ref } from 'vue';
@@ -40,7 +40,7 @@ declare const CapoPlugin: () => _unhead_schema.HeadPluginInput;
40
40
  * @deprecated Please switch to non-legacy version
41
41
  */
42
42
  declare function setHeadInjectionHandler(handler: () => VueHeadClient<any> | undefined): void;
43
- declare function injectHead(): Unhead<_unhead_schema.Head<MergeHead>> | Unhead<_unhead_schema.Head<_unhead_schema.SchemaAugmentations>> | undefined;
43
+ declare function injectHead(): Unhead<_unhead_schema.Head<_unhead_schema.SchemaAugmentations>> | undefined;
44
44
  declare function useHead<T extends MergeHead>(input: UseHeadInput<T>, options?: UseHeadOptions): ActiveHeadEntry<UseHeadInput<T>> | void;
45
45
  declare function useHeadSafe(input: UseHeadSafeInput, options?: UseHeadOptions): ActiveHeadEntry<UseHeadSafeInput> | void;
46
46
  declare function useSeoMeta(input: UseSeoMetaInput, options?: UseHeadOptions): ActiveHeadEntry<any> | void;
package/dist/legacy.mjs CHANGED
@@ -1,15 +1,14 @@
1
1
  import { defineHeadPlugin, whitelistSafeInput, unpackMeta } from '@unhead/shared';
2
- import { unheadCtx, tryUseUnhead } from 'unhead';
3
2
  export { createHeadCore } from 'unhead';
4
3
  import { getCurrentInstance, onMounted, isRef, watch, onScopeDispose, ref, inject, watchEffect, onBeforeUnmount, onDeactivated, onActivated } from 'vue';
5
4
  export { createHead } from './client.mjs';
6
- import { h as headSymbol, r as resolveUnrefHeadInput } from './shared/vue.Sg4YunmP.mjs';
5
+ import { h as headSymbol, r as resolveUnrefHeadInput } from './shared/vue.DUgB2y83.mjs';
7
6
  export { createHead as createServerHead } from './server.mjs';
8
7
  import { useScript as useScript$1 } from 'unhead/legacy';
9
8
  export { resolveScriptKey } from 'unhead/legacy';
10
9
  import 'unhead/client';
11
- import './shared/vue.B6jdKgLD.mjs';
12
- import './shared/vue.O-w7-AFg.mjs';
10
+ import './shared/vue.BmaKl8wu.mjs';
11
+ import './shared/vue.BqrzivMs.mjs';
13
12
  import 'unhead/server';
14
13
 
15
14
  function registerVueScopeHandlers(script, scope) {
@@ -79,13 +78,8 @@ function useScript(_input, _options) {
79
78
 
80
79
  const CapoPlugin = () => defineHeadPlugin({});
81
80
  function setHeadInjectionHandler(handler) {
82
- unheadCtx.set(handler(), true);
83
81
  }
84
82
  function injectHead() {
85
- const ctx = tryUseUnhead();
86
- if (ctx) {
87
- return ctx;
88
- }
89
83
  return inject(headSymbol);
90
84
  }
91
85
  function useHead(input, options = {}) {
package/dist/server.cjs CHANGED
@@ -1,11 +1,10 @@
1
1
  'use strict';
2
2
 
3
3
  const server = require('unhead/server');
4
- const useHead = require('./shared/vue.BwEnMiRq.cjs');
5
- const VueReactivityPlugin = require('./shared/vue.DIPZN3-d.cjs');
6
- const VueHeadMixin = require('./shared/vue.3OjaFlxQ.cjs');
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
7
  require('vue');
8
- require('unhead');
9
8
  require('@unhead/shared');
10
9
 
11
10
  function createHead(options = {}) {
package/dist/server.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { MergeHead, CreateHeadOptions } from '@unhead/schema';
2
- import { d as distExports } from './shared/vue.DShwsPiO.cjs';
2
+ import { d as distExports } from './shared/vue.Bjx6RvLp.cjs';
3
3
  export { V as VueHeadMixin } from './shared/vue.DnywREVF.cjs';
4
4
  export * from 'unhead/server';
5
5
  import '@unhead/shared';
package/dist/server.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { MergeHead, CreateHeadOptions } from '@unhead/schema';
2
- import { d as distExports } from './shared/vue.DShwsPiO.mjs';
2
+ import { d as distExports } from './shared/vue.Bjx6RvLp.mjs';
3
3
  export { V as VueHeadMixin } from './shared/vue.DnywREVF.mjs';
4
4
  export * from 'unhead/server';
5
5
  import '@unhead/shared';
package/dist/server.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { MergeHead, CreateHeadOptions } from '@unhead/schema';
2
- import { d as distExports } from './shared/vue.DShwsPiO.js';
2
+ import { d as distExports } from './shared/vue.Bjx6RvLp.js';
3
3
  export { V as VueHeadMixin } from './shared/vue.DnywREVF.js';
4
4
  export * from 'unhead/server';
5
5
  import '@unhead/shared';
package/dist/server.mjs CHANGED
@@ -1,10 +1,9 @@
1
1
  import { createHead as createHead$1 } from 'unhead/server';
2
2
  export * from 'unhead/server';
3
- import { v as vueInstall } from './shared/vue.Sg4YunmP.mjs';
4
- import { V as VueReactivityPlugin } from './shared/vue.B6jdKgLD.mjs';
5
- export { V as VueHeadMixin } from './shared/vue.O-w7-AFg.mjs';
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
6
  import 'vue';
7
- import 'unhead';
8
7
  import '@unhead/shared';
9
8
 
10
9
  function createHead(options = {}) {
@@ -1,7 +1,6 @@
1
1
  'use strict';
2
2
 
3
3
  const vue = require('vue');
4
- const unhead = require('unhead');
5
4
 
6
5
  function resolveUnref(r) {
7
6
  return typeof r === "function" ? r() : vue.unref(r);
@@ -44,15 +43,14 @@ function vueInstall(head) {
44
43
  }
45
44
 
46
45
  function injectHead() {
47
- const ctx = unhead.tryUseUnhead();
48
- if (ctx) {
49
- return ctx;
50
- }
51
- const instance = vue.inject(headSymbol);
52
- if (!instance) {
53
- throw new Error("useHead() was called without provide context, ensure you call it through the setup() function.");
46
+ if (vue.hasInjectionContext()) {
47
+ const instance = vue.inject(headSymbol);
48
+ if (!instance) {
49
+ throw new Error("useHead() was called without provide context, ensure you call it through the setup() function.");
50
+ }
51
+ return instance;
54
52
  }
55
- return instance;
53
+ throw new Error("useHead() was called without provide context, ensure you call it through the setup() function.");
56
54
  }
57
55
 
58
56
  function useHead(input, options = {}) {
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  const shared = require('@unhead/shared');
4
- const useHead = require('./vue.BwEnMiRq.cjs');
4
+ const useHead = require('./vue.Adq3bKYb.cjs');
5
5
 
6
6
  const VueReactivityPlugin = shared.defineHeadPlugin({
7
7
  hooks: {
@@ -4,15 +4,14 @@ import require$$0 from 'vue';
4
4
 
5
5
  var dist = {};
6
6
 
7
- var vue_BwEnMiRq = {};
7
+ var vue_Adq3bKYb = {};
8
8
 
9
- var hasRequiredVue_BwEnMiRq;
9
+ var hasRequiredVue_Adq3bKYb;
10
10
 
11
- function requireVue_BwEnMiRq () {
12
- if (hasRequiredVue_BwEnMiRq) return vue_BwEnMiRq;
13
- hasRequiredVue_BwEnMiRq = 1;
11
+ function requireVue_Adq3bKYb () {
12
+ if (hasRequiredVue_Adq3bKYb) return vue_Adq3bKYb;
13
+ hasRequiredVue_Adq3bKYb = 1;
14
14
  const vue = require$$0;
15
- const unhead = require$$1;
16
15
  function resolveUnref(r) {
17
16
  return typeof r === "function" ? r() : vue.unref(r);
18
17
  }
@@ -52,15 +51,14 @@ function requireVue_BwEnMiRq () {
52
51
  return plugin.install;
53
52
  }
54
53
  function injectHead() {
55
- const ctx = unhead.tryUseUnhead();
56
- if (ctx) {
57
- return ctx;
58
- }
59
- const instance = vue.inject(headSymbol);
60
- if (!instance) {
61
- throw new Error("useHead() was called without provide context, ensure you call it through the setup() function.");
54
+ if (vue.hasInjectionContext()) {
55
+ const instance = vue.inject(headSymbol);
56
+ if (!instance) {
57
+ throw new Error("useHead() was called without provide context, ensure you call it through the setup() function.");
58
+ }
59
+ return instance;
62
60
  }
63
- return instance;
61
+ throw new Error("useHead() was called without provide context, ensure you call it through the setup() function.");
64
62
  }
65
63
  function useHead(input, options = {}) {
66
64
  const head = options.head || injectHead();
@@ -90,23 +88,23 @@ function requireVue_BwEnMiRq () {
90
88
  }
91
89
  return entry;
92
90
  }
93
- vue_BwEnMiRq.headSymbol = headSymbol;
94
- vue_BwEnMiRq.injectHead = injectHead;
95
- vue_BwEnMiRq.resolveUnrefHeadInput = resolveUnrefHeadInput;
96
- vue_BwEnMiRq.useHead = useHead;
97
- vue_BwEnMiRq.vueInstall = vueInstall;
98
- return vue_BwEnMiRq;
91
+ vue_Adq3bKYb.headSymbol = headSymbol;
92
+ vue_Adq3bKYb.injectHead = injectHead;
93
+ vue_Adq3bKYb.resolveUnrefHeadInput = resolveUnrefHeadInput;
94
+ vue_Adq3bKYb.useHead = useHead;
95
+ vue_Adq3bKYb.vueInstall = vueInstall;
96
+ return vue_Adq3bKYb;
99
97
  }
100
98
 
101
- var vue_3OjaFlxQ = {};
99
+ var vue_DTOQraae = {};
102
100
 
103
- var hasRequiredVue_3OjaFlxQ;
101
+ var hasRequiredVue_DTOQraae;
104
102
 
105
- function requireVue_3OjaFlxQ () {
106
- if (hasRequiredVue_3OjaFlxQ) return vue_3OjaFlxQ;
107
- hasRequiredVue_3OjaFlxQ = 1;
103
+ function requireVue_DTOQraae () {
104
+ if (hasRequiredVue_DTOQraae) return vue_DTOQraae;
105
+ hasRequiredVue_DTOQraae = 1;
108
106
  const vue = require$$0;
109
- const useHead = requireVue_BwEnMiRq();
107
+ const useHead = requireVue_Adq3bKYb();
110
108
  const VueHeadMixin = {
111
109
  created() {
112
110
  let source = false;
@@ -120,8 +118,8 @@ function requireVue_3OjaFlxQ () {
120
118
  source && useHead.useHead(source);
121
119
  }
122
120
  };
123
- vue_3OjaFlxQ.VueHeadMixin = VueHeadMixin;
124
- return vue_3OjaFlxQ;
121
+ vue_DTOQraae.VueHeadMixin = VueHeadMixin;
122
+ return vue_DTOQraae;
125
123
  }
126
124
 
127
125
  var hasRequiredDist;
@@ -131,8 +129,8 @@ function requireDist () {
131
129
  hasRequiredDist = 1;
132
130
  const shared = require$$0$1;
133
131
  const unhead = require$$1;
134
- const useHead = requireVue_BwEnMiRq();
135
- const VueHeadMixin = requireVue_3OjaFlxQ();
132
+ const useHead = requireVue_Adq3bKYb();
133
+ const VueHeadMixin = requireVue_DTOQraae();
136
134
 
137
135
  const coreComposableNames = [
138
136
  "injectHead"
@@ -174,7 +172,6 @@ function requireDist () {
174
172
  }
175
173
  const CapoPlugin = () => shared.defineHeadPlugin({});
176
174
  dist.createHeadCore = unhead.createHeadCore;
177
- dist.unheadCtx = unhead.unheadCtx;
178
175
  dist.injectHead = useHead.injectHead;
179
176
  dist.resolveUnrefHeadInput = useHead.resolveUnrefHeadInput;
180
177
  dist.useHead = useHead.useHead;
@@ -4,15 +4,14 @@ import require$$0 from 'vue';
4
4
 
5
5
  var dist = {};
6
6
 
7
- var vue_BwEnMiRq = {};
7
+ var vue_Adq3bKYb = {};
8
8
 
9
- var hasRequiredVue_BwEnMiRq;
9
+ var hasRequiredVue_Adq3bKYb;
10
10
 
11
- function requireVue_BwEnMiRq () {
12
- if (hasRequiredVue_BwEnMiRq) return vue_BwEnMiRq;
13
- hasRequiredVue_BwEnMiRq = 1;
11
+ function requireVue_Adq3bKYb () {
12
+ if (hasRequiredVue_Adq3bKYb) return vue_Adq3bKYb;
13
+ hasRequiredVue_Adq3bKYb = 1;
14
14
  const vue = require$$0;
15
- const unhead = require$$1;
16
15
  function resolveUnref(r) {
17
16
  return typeof r === "function" ? r() : vue.unref(r);
18
17
  }
@@ -52,15 +51,14 @@ function requireVue_BwEnMiRq () {
52
51
  return plugin.install;
53
52
  }
54
53
  function injectHead() {
55
- const ctx = unhead.tryUseUnhead();
56
- if (ctx) {
57
- return ctx;
58
- }
59
- const instance = vue.inject(headSymbol);
60
- if (!instance) {
61
- throw new Error("useHead() was called without provide context, ensure you call it through the setup() function.");
54
+ if (vue.hasInjectionContext()) {
55
+ const instance = vue.inject(headSymbol);
56
+ if (!instance) {
57
+ throw new Error("useHead() was called without provide context, ensure you call it through the setup() function.");
58
+ }
59
+ return instance;
62
60
  }
63
- return instance;
61
+ throw new Error("useHead() was called without provide context, ensure you call it through the setup() function.");
64
62
  }
65
63
  function useHead(input, options = {}) {
66
64
  const head = options.head || injectHead();
@@ -90,23 +88,23 @@ function requireVue_BwEnMiRq () {
90
88
  }
91
89
  return entry;
92
90
  }
93
- vue_BwEnMiRq.headSymbol = headSymbol;
94
- vue_BwEnMiRq.injectHead = injectHead;
95
- vue_BwEnMiRq.resolveUnrefHeadInput = resolveUnrefHeadInput;
96
- vue_BwEnMiRq.useHead = useHead;
97
- vue_BwEnMiRq.vueInstall = vueInstall;
98
- return vue_BwEnMiRq;
91
+ vue_Adq3bKYb.headSymbol = headSymbol;
92
+ vue_Adq3bKYb.injectHead = injectHead;
93
+ vue_Adq3bKYb.resolveUnrefHeadInput = resolveUnrefHeadInput;
94
+ vue_Adq3bKYb.useHead = useHead;
95
+ vue_Adq3bKYb.vueInstall = vueInstall;
96
+ return vue_Adq3bKYb;
99
97
  }
100
98
 
101
- var vue_3OjaFlxQ = {};
99
+ var vue_DTOQraae = {};
102
100
 
103
- var hasRequiredVue_3OjaFlxQ;
101
+ var hasRequiredVue_DTOQraae;
104
102
 
105
- function requireVue_3OjaFlxQ () {
106
- if (hasRequiredVue_3OjaFlxQ) return vue_3OjaFlxQ;
107
- hasRequiredVue_3OjaFlxQ = 1;
103
+ function requireVue_DTOQraae () {
104
+ if (hasRequiredVue_DTOQraae) return vue_DTOQraae;
105
+ hasRequiredVue_DTOQraae = 1;
108
106
  const vue = require$$0;
109
- const useHead = requireVue_BwEnMiRq();
107
+ const useHead = requireVue_Adq3bKYb();
110
108
  const VueHeadMixin = {
111
109
  created() {
112
110
  let source = false;
@@ -120,8 +118,8 @@ function requireVue_3OjaFlxQ () {
120
118
  source && useHead.useHead(source);
121
119
  }
122
120
  };
123
- vue_3OjaFlxQ.VueHeadMixin = VueHeadMixin;
124
- return vue_3OjaFlxQ;
121
+ vue_DTOQraae.VueHeadMixin = VueHeadMixin;
122
+ return vue_DTOQraae;
125
123
  }
126
124
 
127
125
  var hasRequiredDist;
@@ -131,8 +129,8 @@ function requireDist () {
131
129
  hasRequiredDist = 1;
132
130
  const shared = require$$0$1;
133
131
  const unhead = require$$1;
134
- const useHead = requireVue_BwEnMiRq();
135
- const VueHeadMixin = requireVue_3OjaFlxQ();
132
+ const useHead = requireVue_Adq3bKYb();
133
+ const VueHeadMixin = requireVue_DTOQraae();
136
134
 
137
135
  const coreComposableNames = [
138
136
  "injectHead"
@@ -174,7 +172,6 @@ function requireDist () {
174
172
  }
175
173
  const CapoPlugin = () => shared.defineHeadPlugin({});
176
174
  dist.createHeadCore = unhead.createHeadCore;
177
- dist.unheadCtx = unhead.unheadCtx;
178
175
  dist.injectHead = useHead.injectHead;
179
176
  dist.resolveUnrefHeadInput = useHead.resolveUnrefHeadInput;
180
177
  dist.useHead = useHead.useHead;
@@ -4,15 +4,14 @@ import require$$0 from 'vue';
4
4
 
5
5
  var dist = {};
6
6
 
7
- var vue_BwEnMiRq = {};
7
+ var vue_Adq3bKYb = {};
8
8
 
9
- var hasRequiredVue_BwEnMiRq;
9
+ var hasRequiredVue_Adq3bKYb;
10
10
 
11
- function requireVue_BwEnMiRq () {
12
- if (hasRequiredVue_BwEnMiRq) return vue_BwEnMiRq;
13
- hasRequiredVue_BwEnMiRq = 1;
11
+ function requireVue_Adq3bKYb () {
12
+ if (hasRequiredVue_Adq3bKYb) return vue_Adq3bKYb;
13
+ hasRequiredVue_Adq3bKYb = 1;
14
14
  const vue = require$$0;
15
- const unhead = require$$1;
16
15
  function resolveUnref(r) {
17
16
  return typeof r === "function" ? r() : vue.unref(r);
18
17
  }
@@ -52,15 +51,14 @@ function requireVue_BwEnMiRq () {
52
51
  return plugin.install;
53
52
  }
54
53
  function injectHead() {
55
- const ctx = unhead.tryUseUnhead();
56
- if (ctx) {
57
- return ctx;
58
- }
59
- const instance = vue.inject(headSymbol);
60
- if (!instance) {
61
- throw new Error("useHead() was called without provide context, ensure you call it through the setup() function.");
54
+ if (vue.hasInjectionContext()) {
55
+ const instance = vue.inject(headSymbol);
56
+ if (!instance) {
57
+ throw new Error("useHead() was called without provide context, ensure you call it through the setup() function.");
58
+ }
59
+ return instance;
62
60
  }
63
- return instance;
61
+ throw new Error("useHead() was called without provide context, ensure you call it through the setup() function.");
64
62
  }
65
63
  function useHead(input, options = {}) {
66
64
  const head = options.head || injectHead();
@@ -90,23 +88,23 @@ function requireVue_BwEnMiRq () {
90
88
  }
91
89
  return entry;
92
90
  }
93
- vue_BwEnMiRq.headSymbol = headSymbol;
94
- vue_BwEnMiRq.injectHead = injectHead;
95
- vue_BwEnMiRq.resolveUnrefHeadInput = resolveUnrefHeadInput;
96
- vue_BwEnMiRq.useHead = useHead;
97
- vue_BwEnMiRq.vueInstall = vueInstall;
98
- return vue_BwEnMiRq;
91
+ vue_Adq3bKYb.headSymbol = headSymbol;
92
+ vue_Adq3bKYb.injectHead = injectHead;
93
+ vue_Adq3bKYb.resolveUnrefHeadInput = resolveUnrefHeadInput;
94
+ vue_Adq3bKYb.useHead = useHead;
95
+ vue_Adq3bKYb.vueInstall = vueInstall;
96
+ return vue_Adq3bKYb;
99
97
  }
100
98
 
101
- var vue_3OjaFlxQ = {};
99
+ var vue_DTOQraae = {};
102
100
 
103
- var hasRequiredVue_3OjaFlxQ;
101
+ var hasRequiredVue_DTOQraae;
104
102
 
105
- function requireVue_3OjaFlxQ () {
106
- if (hasRequiredVue_3OjaFlxQ) return vue_3OjaFlxQ;
107
- hasRequiredVue_3OjaFlxQ = 1;
103
+ function requireVue_DTOQraae () {
104
+ if (hasRequiredVue_DTOQraae) return vue_DTOQraae;
105
+ hasRequiredVue_DTOQraae = 1;
108
106
  const vue = require$$0;
109
- const useHead = requireVue_BwEnMiRq();
107
+ const useHead = requireVue_Adq3bKYb();
110
108
  const VueHeadMixin = {
111
109
  created() {
112
110
  let source = false;
@@ -120,8 +118,8 @@ function requireVue_3OjaFlxQ () {
120
118
  source && useHead.useHead(source);
121
119
  }
122
120
  };
123
- vue_3OjaFlxQ.VueHeadMixin = VueHeadMixin;
124
- return vue_3OjaFlxQ;
121
+ vue_DTOQraae.VueHeadMixin = VueHeadMixin;
122
+ return vue_DTOQraae;
125
123
  }
126
124
 
127
125
  var hasRequiredDist;
@@ -131,8 +129,8 @@ function requireDist () {
131
129
  hasRequiredDist = 1;
132
130
  const shared = require$$0$1;
133
131
  const unhead = require$$1;
134
- const useHead = requireVue_BwEnMiRq();
135
- const VueHeadMixin = requireVue_3OjaFlxQ();
132
+ const useHead = requireVue_Adq3bKYb();
133
+ const VueHeadMixin = requireVue_DTOQraae();
136
134
 
137
135
  const coreComposableNames = [
138
136
  "injectHead"
@@ -174,7 +172,6 @@ function requireDist () {
174
172
  }
175
173
  const CapoPlugin = () => shared.defineHeadPlugin({});
176
174
  dist.createHeadCore = unhead.createHeadCore;
177
- dist.unheadCtx = unhead.unheadCtx;
178
175
  dist.injectHead = useHead.injectHead;
179
176
  dist.resolveUnrefHeadInput = useHead.resolveUnrefHeadInput;
180
177
  dist.useHead = useHead.useHead;
@@ -1,5 +1,5 @@
1
1
  import { defineHeadPlugin } from '@unhead/shared';
2
- import { r as resolveUnrefHeadInput } from './vue.Sg4YunmP.mjs';
2
+ import { r as resolveUnrefHeadInput } from './vue.DUgB2y83.mjs';
3
3
 
4
4
  const VueReactivityPlugin = defineHeadPlugin({
5
5
  hooks: {
@@ -1,5 +1,5 @@
1
1
  import { getCurrentInstance } from 'vue';
2
- import { u as useHead } from './vue.Sg4YunmP.mjs';
2
+ import { u as useHead } from './vue.DUgB2y83.mjs';
3
3
 
4
4
  const VueHeadMixin = {
5
5
  created() {
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  const vue = require('vue');
4
- const useHead = require('./vue.BwEnMiRq.cjs');
4
+ const useHead = require('./vue.Adq3bKYb.cjs');
5
5
 
6
6
  const VueHeadMixin = {
7
7
  created() {
@@ -1,5 +1,4 @@
1
- import { unref, inject, ref, watchEffect, watch, getCurrentInstance, onBeforeUnmount, onDeactivated, onActivated } from 'vue';
2
- import { tryUseUnhead } from 'unhead';
1
+ import { unref, hasInjectionContext, inject, ref, watchEffect, watch, getCurrentInstance, onBeforeUnmount, onDeactivated, onActivated } from 'vue';
3
2
 
4
3
  function resolveUnref(r) {
5
4
  return typeof r === "function" ? r() : unref(r);
@@ -42,15 +41,14 @@ function vueInstall(head) {
42
41
  }
43
42
 
44
43
  function injectHead() {
45
- const ctx = tryUseUnhead();
46
- if (ctx) {
47
- return ctx;
48
- }
49
- const instance = inject(headSymbol);
50
- if (!instance) {
51
- throw new Error("useHead() was called without provide context, ensure you call it through the setup() function.");
44
+ if (hasInjectionContext()) {
45
+ const instance = inject(headSymbol);
46
+ if (!instance) {
47
+ throw new Error("useHead() was called without provide context, ensure you call it through the setup() function.");
48
+ }
49
+ return instance;
52
50
  }
53
- return instance;
51
+ throw new Error("useHead() was called without provide context, ensure you call it through the setup() function.");
54
52
  }
55
53
 
56
54
  function useHead(input, options = {}) {
package/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "@unhead/vue",
3
3
  "type": "module",
4
- "version": "2.0.0-alpha.0",
4
+ "version": "2.0.0-alpha.2",
5
+ "description": "Full-stack <head> manager built for Vue.",
5
6
  "author": "Harlan Wilton <harlan@harlanzw.com>",
6
7
  "license": "MIT",
7
8
  "funding": "https://github.com/sponsors/harlan-zw",
@@ -11,6 +12,10 @@
11
12
  "url": "git+https://github.com/unjs/unhead.git",
12
13
  "directory": "packages/vue"
13
14
  },
15
+ "publishConfig": {
16
+ "access": "public",
17
+ "tag": "next"
18
+ },
14
19
  "bugs": {
15
20
  "url": "https://github.com/unjs/unhead/issues"
16
21
  },
@@ -68,9 +73,9 @@
68
73
  },
69
74
  "dependencies": {
70
75
  "hookable": "^5.5.3",
71
- "@unhead/schema": "2.0.0-alpha.0",
72
- "unhead": "2.0.0-alpha.0",
73
- "@unhead/shared": "2.0.0-alpha.0"
76
+ "@unhead/schema": "2.0.0-alpha.2",
77
+ "unhead": "2.0.0-alpha.2",
78
+ "@unhead/shared": "2.0.0-alpha.2"
74
79
  },
75
80
  "scripts": {
76
81
  "build": "unbuild .",