@unhead/vue 1.3.9 → 1.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  const unhead = require('unhead');
4
- const useHead = require('./shared/vue.3633f8ad.cjs');
4
+ const useHead = require('./shared/vue.b3743d94.cjs');
5
5
  const vue = require('vue');
6
6
  const shared = require('@unhead/shared');
7
7
 
@@ -0,0 +1,48 @@
1
+ export { CapoPlugin, HashHydrationPlugin, createHeadCore } from 'unhead';
2
+ import * as _unhead_schema from '@unhead/schema';
3
+ import { SafeMeta, SafeLink, SafeNoscript, SafeScript, SafeHtmlAttr, SafeBodyAttr, MergeHead, CreateHeadOptions, HeadEntryOptions, ActiveHeadEntry } from '@unhead/schema';
4
+ export { ActiveHeadEntry, Head, HeadEntryOptions, HeadTag, MergeHead, Unhead } from '@unhead/schema';
5
+ import { R as ReactiveHead, M as MaybeComputedRefEntries, a as MaybeComputedRef, V as VueHeadClient, U as UseHeadInput, b as UseSeoMetaInput } from './shared/vue.c0307a01.cjs';
6
+ export { d as Base, B as BodyAttr, h as BodyAttributes, H as HtmlAttr, g as HtmlAttributes, L as Link, j as MaybeComputedRefOrPromise, i as MaybeReadonlyRef, e as Meta, N as Noscript, f as Script, S as Style, T as Title, c as TitleTemplate } from './shared/vue.c0307a01.cjs';
7
+ import { Plugin } from 'vue';
8
+
9
+ interface HeadSafe extends Pick<ReactiveHead, 'title' | 'titleTemplate' | 'templateParams'> {
10
+ meta?: MaybeComputedRefEntries<SafeMeta>[];
11
+ link?: MaybeComputedRefEntries<SafeLink>[];
12
+ noscript?: MaybeComputedRefEntries<SafeNoscript>[];
13
+ script?: MaybeComputedRefEntries<SafeScript>[];
14
+ htmlAttrs?: MaybeComputedRefEntries<SafeHtmlAttr>;
15
+ bodyAttrs?: MaybeComputedRefEntries<SafeBodyAttr>;
16
+ }
17
+ type UseHeadSafeInput = MaybeComputedRef<HeadSafe>;
18
+
19
+ declare function createServerHead<T extends MergeHead>(options?: Omit<CreateHeadOptions, 'domDelayFn' | 'document'>): VueHeadClient<T>;
20
+ declare function createHead<T extends MergeHead>(options?: CreateHeadOptions): VueHeadClient<T>;
21
+
22
+ declare function resolveUnrefHeadInput(ref: any, lastKey?: string | number): any;
23
+
24
+ declare const VueHeadMixin: {
25
+ created(): void;
26
+ };
27
+
28
+ declare const Vue2ProvideUnheadPlugin: Plugin;
29
+
30
+ declare const unheadVueComposablesImports: {
31
+ '@unhead/vue': string[];
32
+ };
33
+
34
+ declare function injectHead<T extends MergeHead>(): VueHeadClient<T>;
35
+
36
+ declare function useHead<T extends MergeHead>(input: UseHeadInput<T>, options?: HeadEntryOptions): ActiveHeadEntry<UseHeadInput<T>> | void;
37
+
38
+ declare function useHeadSafe(input: UseHeadSafeInput, options?: HeadEntryOptions): ActiveHeadEntry<UseHeadSafeInput> | void;
39
+
40
+ declare function useSeoMeta(input: UseSeoMetaInput, options?: HeadEntryOptions): ActiveHeadEntry<any> | void;
41
+
42
+ declare function useServerHead<T extends MergeHead>(input: UseHeadInput<T>, options?: HeadEntryOptions): _unhead_schema.ActiveHeadEntry<MaybeComputedRef<ReactiveHead<MergeHead>>> | undefined;
43
+
44
+ declare function useServerHeadSafe(input: UseHeadSafeInput, options?: HeadEntryOptions): void | _unhead_schema.ActiveHeadEntry<UseHeadSafeInput>;
45
+
46
+ declare function useServerSeoMeta(input: UseSeoMetaInput, options?: HeadEntryOptions): ActiveHeadEntry<any> | void;
47
+
48
+ export { type HeadSafe, MaybeComputedRef, MaybeComputedRefEntries, ReactiveHead, UseHeadInput, type UseHeadSafeInput, UseSeoMetaInput, Vue2ProvideUnheadPlugin, VueHeadClient, VueHeadMixin, createHead, createServerHead, injectHead, resolveUnrefHeadInput, unheadVueComposablesImports, useHead, useHeadSafe, useSeoMeta, useServerHead, useServerHeadSafe, useServerSeoMeta };
@@ -0,0 +1,48 @@
1
+ export { CapoPlugin, HashHydrationPlugin, createHeadCore } from 'unhead';
2
+ import * as _unhead_schema from '@unhead/schema';
3
+ import { SafeMeta, SafeLink, SafeNoscript, SafeScript, SafeHtmlAttr, SafeBodyAttr, MergeHead, CreateHeadOptions, HeadEntryOptions, ActiveHeadEntry } from '@unhead/schema';
4
+ export { ActiveHeadEntry, Head, HeadEntryOptions, HeadTag, MergeHead, Unhead } from '@unhead/schema';
5
+ import { R as ReactiveHead, M as MaybeComputedRefEntries, a as MaybeComputedRef, V as VueHeadClient, U as UseHeadInput, b as UseSeoMetaInput } from './shared/vue.c0307a01.mjs';
6
+ export { d as Base, B as BodyAttr, h as BodyAttributes, H as HtmlAttr, g as HtmlAttributes, L as Link, j as MaybeComputedRefOrPromise, i as MaybeReadonlyRef, e as Meta, N as Noscript, f as Script, S as Style, T as Title, c as TitleTemplate } from './shared/vue.c0307a01.mjs';
7
+ import { Plugin } from 'vue';
8
+
9
+ interface HeadSafe extends Pick<ReactiveHead, 'title' | 'titleTemplate' | 'templateParams'> {
10
+ meta?: MaybeComputedRefEntries<SafeMeta>[];
11
+ link?: MaybeComputedRefEntries<SafeLink>[];
12
+ noscript?: MaybeComputedRefEntries<SafeNoscript>[];
13
+ script?: MaybeComputedRefEntries<SafeScript>[];
14
+ htmlAttrs?: MaybeComputedRefEntries<SafeHtmlAttr>;
15
+ bodyAttrs?: MaybeComputedRefEntries<SafeBodyAttr>;
16
+ }
17
+ type UseHeadSafeInput = MaybeComputedRef<HeadSafe>;
18
+
19
+ declare function createServerHead<T extends MergeHead>(options?: Omit<CreateHeadOptions, 'domDelayFn' | 'document'>): VueHeadClient<T>;
20
+ declare function createHead<T extends MergeHead>(options?: CreateHeadOptions): VueHeadClient<T>;
21
+
22
+ declare function resolveUnrefHeadInput(ref: any, lastKey?: string | number): any;
23
+
24
+ declare const VueHeadMixin: {
25
+ created(): void;
26
+ };
27
+
28
+ declare const Vue2ProvideUnheadPlugin: Plugin;
29
+
30
+ declare const unheadVueComposablesImports: {
31
+ '@unhead/vue': string[];
32
+ };
33
+
34
+ declare function injectHead<T extends MergeHead>(): VueHeadClient<T>;
35
+
36
+ declare function useHead<T extends MergeHead>(input: UseHeadInput<T>, options?: HeadEntryOptions): ActiveHeadEntry<UseHeadInput<T>> | void;
37
+
38
+ declare function useHeadSafe(input: UseHeadSafeInput, options?: HeadEntryOptions): ActiveHeadEntry<UseHeadSafeInput> | void;
39
+
40
+ declare function useSeoMeta(input: UseSeoMetaInput, options?: HeadEntryOptions): ActiveHeadEntry<any> | void;
41
+
42
+ declare function useServerHead<T extends MergeHead>(input: UseHeadInput<T>, options?: HeadEntryOptions): _unhead_schema.ActiveHeadEntry<MaybeComputedRef<ReactiveHead<MergeHead>>> | undefined;
43
+
44
+ declare function useServerHeadSafe(input: UseHeadSafeInput, options?: HeadEntryOptions): void | _unhead_schema.ActiveHeadEntry<UseHeadSafeInput>;
45
+
46
+ declare function useServerSeoMeta(input: UseSeoMetaInput, options?: HeadEntryOptions): ActiveHeadEntry<any> | void;
47
+
48
+ export { type HeadSafe, MaybeComputedRef, MaybeComputedRefEntries, ReactiveHead, UseHeadInput, type UseHeadSafeInput, UseSeoMetaInput, Vue2ProvideUnheadPlugin, VueHeadClient, VueHeadMixin, createHead, createServerHead, injectHead, resolveUnrefHeadInput, unheadVueComposablesImports, useHead, useHeadSafe, useSeoMeta, useServerHead, useServerHeadSafe, useServerSeoMeta };
package/dist/index.d.ts CHANGED
@@ -2,8 +2,8 @@ export { CapoPlugin, HashHydrationPlugin, createHeadCore } from 'unhead';
2
2
  import * as _unhead_schema from '@unhead/schema';
3
3
  import { SafeMeta, SafeLink, SafeNoscript, SafeScript, SafeHtmlAttr, SafeBodyAttr, MergeHead, CreateHeadOptions, HeadEntryOptions, ActiveHeadEntry } from '@unhead/schema';
4
4
  export { ActiveHeadEntry, Head, HeadEntryOptions, HeadTag, MergeHead, Unhead } from '@unhead/schema';
5
- import { R as ReactiveHead, M as MaybeComputedRefEntries, a as MaybeComputedRef, V as VueHeadClient, U as UseHeadInput, b as UseSeoMetaInput } from './schema-84920ead.js';
6
- export { d as Base, B as BodyAttr, h as BodyAttributes, H as HtmlAttr, g as HtmlAttributes, L as Link, j as MaybeComputedRefOrPromise, i as MaybeReadonlyRef, e as Meta, N as Noscript, f as Script, S as Style, T as Title, c as TitleTemplate } from './schema-84920ead.js';
5
+ import { R as ReactiveHead, M as MaybeComputedRefEntries, a as MaybeComputedRef, V as VueHeadClient, U as UseHeadInput, b as UseSeoMetaInput } from './shared/vue.c0307a01.js';
6
+ export { d as Base, B as BodyAttr, h as BodyAttributes, H as HtmlAttr, g as HtmlAttributes, L as Link, j as MaybeComputedRefOrPromise, i as MaybeReadonlyRef, e as Meta, N as Noscript, f as Script, S as Style, T as Title, c as TitleTemplate } from './shared/vue.c0307a01.js';
7
7
  import { Plugin } from 'vue';
8
8
 
9
9
  interface HeadSafe extends Pick<ReactiveHead, 'title' | 'titleTemplate' | 'templateParams'> {
@@ -45,4 +45,4 @@ declare function useServerHeadSafe(input: UseHeadSafeInput, options?: HeadEntryO
45
45
 
46
46
  declare function useServerSeoMeta(input: UseSeoMetaInput, options?: HeadEntryOptions): ActiveHeadEntry<any> | void;
47
47
 
48
- export { HeadSafe, MaybeComputedRef, MaybeComputedRefEntries, ReactiveHead, UseHeadInput, UseHeadSafeInput, UseSeoMetaInput, Vue2ProvideUnheadPlugin, VueHeadClient, VueHeadMixin, createHead, createServerHead, injectHead, resolveUnrefHeadInput, unheadVueComposablesImports, useHead, useHeadSafe, useSeoMeta, useServerHead, useServerHeadSafe, useServerSeoMeta };
48
+ export { type HeadSafe, MaybeComputedRef, MaybeComputedRefEntries, ReactiveHead, UseHeadInput, type UseHeadSafeInput, UseSeoMetaInput, Vue2ProvideUnheadPlugin, VueHeadClient, VueHeadMixin, createHead, createServerHead, injectHead, resolveUnrefHeadInput, unheadVueComposablesImports, useHead, useHeadSafe, useSeoMeta, useServerHead, useServerHeadSafe, useServerSeoMeta };
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  export { CapoPlugin, HashHydrationPlugin, createHeadCore } from 'unhead';
2
- import { V as Vue3, u as useHead, h as headSymbol, r as resolveUnrefHeadInput, i as injectHead } from './shared/vue.cf073917.mjs';
3
- export { c as createHead, a as createServerHead } from './shared/vue.cf073917.mjs';
2
+ import { V as Vue3, u as useHead, h as headSymbol, r as resolveUnrefHeadInput, i as injectHead } from './shared/vue.e88efe84.mjs';
3
+ export { c as createHead, a as createServerHead } from './shared/vue.e88efe84.mjs';
4
4
  import { getCurrentInstance, ref, watchEffect } from 'vue';
5
5
  import { composableNames, whitelistSafeInput, unpackMeta } from '@unhead/shared';
6
6
 
package/dist/polyfill.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const useHead = require('./shared/vue.3633f8ad.cjs');
3
+ const useHead = require('./shared/vue.b3743d94.cjs');
4
4
  require('vue');
5
5
  require('unhead');
6
6
  require('@unhead/shared');
@@ -0,0 +1,37 @@
1
+ import { MergeHead, HeadEntryOptions } from '@unhead/schema';
2
+ import { V as VueHeadClient, U as UseHeadInput } from './shared/vue.c0307a01.cjs';
3
+ import 'vue';
4
+
5
+ type VueHeadClientPollyFill<T extends MergeHead> = VueHeadClient<T> & {
6
+ /**
7
+ * @deprecated use `resolveTags`
8
+ */
9
+ headTags: VueHeadClient<T>['resolveTags'];
10
+ /**
11
+ * @deprecated use `push`
12
+ */
13
+ addEntry: VueHeadClient<T>['push'];
14
+ /**
15
+ * @deprecated use `push`
16
+ */
17
+ addHeadObjs: VueHeadClient<T>['push'];
18
+ /**
19
+ * @deprecated use `useHead`
20
+ */
21
+ addReactiveEntry: (input: UseHeadInput<T>, options?: HeadEntryOptions) => (() => void);
22
+ /**
23
+ * @deprecated Use useHead API.
24
+ */
25
+ removeHeadObjs: () => void;
26
+ /**
27
+ * @deprecated Call hook `entries:resolve` or update an entry
28
+ */
29
+ updateDOM: () => void;
30
+ /**
31
+ * @deprecated Access unhead properties directly.
32
+ */
33
+ unhead: VueHeadClient<T>;
34
+ };
35
+ declare function polyfillAsVueUseHead<T extends MergeHead>(head: VueHeadClient<T>): VueHeadClientPollyFill<T>;
36
+
37
+ export { type VueHeadClientPollyFill, polyfillAsVueUseHead };
@@ -0,0 +1,37 @@
1
+ import { MergeHead, HeadEntryOptions } from '@unhead/schema';
2
+ import { V as VueHeadClient, U as UseHeadInput } from './shared/vue.c0307a01.mjs';
3
+ import 'vue';
4
+
5
+ type VueHeadClientPollyFill<T extends MergeHead> = VueHeadClient<T> & {
6
+ /**
7
+ * @deprecated use `resolveTags`
8
+ */
9
+ headTags: VueHeadClient<T>['resolveTags'];
10
+ /**
11
+ * @deprecated use `push`
12
+ */
13
+ addEntry: VueHeadClient<T>['push'];
14
+ /**
15
+ * @deprecated use `push`
16
+ */
17
+ addHeadObjs: VueHeadClient<T>['push'];
18
+ /**
19
+ * @deprecated use `useHead`
20
+ */
21
+ addReactiveEntry: (input: UseHeadInput<T>, options?: HeadEntryOptions) => (() => void);
22
+ /**
23
+ * @deprecated Use useHead API.
24
+ */
25
+ removeHeadObjs: () => void;
26
+ /**
27
+ * @deprecated Call hook `entries:resolve` or update an entry
28
+ */
29
+ updateDOM: () => void;
30
+ /**
31
+ * @deprecated Access unhead properties directly.
32
+ */
33
+ unhead: VueHeadClient<T>;
34
+ };
35
+ declare function polyfillAsVueUseHead<T extends MergeHead>(head: VueHeadClient<T>): VueHeadClientPollyFill<T>;
36
+
37
+ export { type VueHeadClientPollyFill, polyfillAsVueUseHead };
@@ -1,5 +1,5 @@
1
1
  import { MergeHead, HeadEntryOptions } from '@unhead/schema';
2
- import { V as VueHeadClient, U as UseHeadInput } from './schema-84920ead.js';
2
+ import { V as VueHeadClient, U as UseHeadInput } from './shared/vue.c0307a01.js';
3
3
  import 'vue';
4
4
 
5
5
  type VueHeadClientPollyFill<T extends MergeHead> = VueHeadClient<T> & {
@@ -34,4 +34,4 @@ type VueHeadClientPollyFill<T extends MergeHead> = VueHeadClient<T> & {
34
34
  };
35
35
  declare function polyfillAsVueUseHead<T extends MergeHead>(head: VueHeadClient<T>): VueHeadClientPollyFill<T>;
36
36
 
37
- export { VueHeadClientPollyFill, polyfillAsVueUseHead };
37
+ export { type VueHeadClientPollyFill, polyfillAsVueUseHead };
package/dist/polyfill.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { u as useHead } from './shared/vue.cf073917.mjs';
1
+ import { u as useHead } from './shared/vue.e88efe84.mjs';
2
2
  import 'vue';
3
3
  import 'unhead';
4
4
  import '@unhead/shared';
@@ -66,7 +66,7 @@ function createHead(options = {}) {
66
66
  }
67
67
 
68
68
  function injectHead() {
69
- return vue.getCurrentInstance() && vue.inject(headSymbol) || unhead.getActiveHead();
69
+ return vue.hasInjectionContext() && vue.inject(headSymbol) || unhead.getActiveHead();
70
70
  }
71
71
 
72
72
  function useHead(input, options = {}) {
@@ -111,4 +111,4 @@ type UseSeoMetaInput = MaybeComputedRefEntries<MetaFlatInput> & {
111
111
  };
112
112
  type VueHeadClient<T extends MergeHead> = Unhead<MaybeComputedRef<ReactiveHead<T>>> & Plugin;
113
113
 
114
- export { BodyAttr as B, HtmlAttr as H, Link as L, MaybeComputedRefEntries as M, Noscript as N, ReactiveHead as R, Style as S, Title as T, UseHeadInput as U, VueHeadClient as V, MaybeComputedRef as a, UseSeoMetaInput as b, TitleTemplate as c, Base as d, Meta as e, Script as f, HtmlAttributes as g, BodyAttributes as h, MaybeReadonlyRef as i, MaybeComputedRefOrPromise as j };
114
+ export type { BodyAttr as B, HtmlAttr as H, Link as L, MaybeComputedRefEntries as M, Noscript as N, ReactiveHead as R, Style as S, Title as T, UseHeadInput as U, VueHeadClient as V, MaybeComputedRef as a, UseSeoMetaInput as b, TitleTemplate as c, Base as d, Meta as e, Script as f, HtmlAttributes as g, BodyAttributes as h, MaybeReadonlyRef as i, MaybeComputedRefOrPromise as j };
@@ -0,0 +1,114 @@
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, MaybeFunctionEntries, BodyEvents, MergeHead, MetaFlatInput, Unhead } from '@unhead/schema';
2
+ import { ComputedRef, Ref, Plugin } from 'vue';
3
+
4
+ type MaybeReadonlyRef<T> = (() => T) | ComputedRef<T>;
5
+ type MaybeComputedRef<T> = T | MaybeReadonlyRef<T> | Ref<T>;
6
+ type MaybeComputedRefOrPromise<T> = T | MaybeReadonlyRef<T> | Ref<T> | Promise<T>;
7
+ type MaybeComputedRefEntries<T> = MaybeComputedRef<T> | {
8
+ [key in keyof T]?: MaybeComputedRefOrPromise<T[key]>;
9
+ };
10
+
11
+ interface HtmlAttr extends Omit<BaseHtmlAttr, 'class'> {
12
+ /**
13
+ * The class global attribute is a space-separated list of the case-sensitive classes of the element.
14
+ *
15
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/class
16
+ */
17
+ class?: MaybeArray<MaybeComputedRef<string>> | Record<string, MaybeComputedRef<boolean>>;
18
+ }
19
+ interface BodyAttr extends Omit<BaseBodyAttr, 'class'> {
20
+ /**
21
+ * The class global attribute is a space-separated list of the case-sensitive classes of the element.
22
+ *
23
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/class
24
+ */
25
+ class?: MaybeArray<MaybeComputedRef<string>> | Record<string, MaybeComputedRef<boolean>>;
26
+ }
27
+ type Title = MaybeComputedRef<Title$1>;
28
+ type TitleTemplate = TitleTemplate$1 | Ref<TitleTemplate$1> | ((title?: string) => TitleTemplate$1);
29
+ type Base<E extends EntryAugmentation = {}> = MaybeComputedRef<MaybeComputedRefEntries<Base$1<E>>>;
30
+ type Link<E extends EntryAugmentation = {}> = MaybeComputedRefEntries<Link$1<E>>;
31
+ type Meta<E extends EntryAugmentation = {}> = MaybeComputedRefEntries<Meta$1<E>>;
32
+ type Style<E extends EntryAugmentation = {}> = MaybeComputedRefEntries<Style$1<E>>;
33
+ type Script<E extends EntryAugmentation = {}> = MaybeComputedRefEntries<Script$1<E>>;
34
+ type Noscript<E extends EntryAugmentation = {}> = MaybeComputedRefEntries<Noscript$1<E>>;
35
+ type HtmlAttributes<E extends EntryAugmentation = {}> = MaybeComputedRef<MaybeComputedRefEntries<HtmlAttr & DataKeys & SchemaAugmentations['htmlAttrs'] & DefinedValueOrEmptyObject<E>>>;
36
+ type BodyAttributes<E extends EntryAugmentation = {}> = MaybeComputedRef<MaybeComputedRefEntries<BodyAttr & DataKeys & SchemaAugmentations['bodyAttrs'] & DefinedValueOrEmptyObject<E>> & MaybeFunctionEntries<BodyEvents>>;
37
+ interface ReactiveHead<E extends MergeHead = MergeHead> {
38
+ /**
39
+ * The `<title>` HTML element defines the document's title that is shown in a browser's title bar or a page's tab.
40
+ * It only contains text; tags within the element are ignored.
41
+ *
42
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/title
43
+ */
44
+ title?: Title | Promise<Title>;
45
+ /**
46
+ * Generate the title from a template.
47
+ */
48
+ titleTemplate?: TitleTemplate;
49
+ /**
50
+ * Variables used to substitute in the title and meta content.
51
+ */
52
+ templateParams?: MaybeComputedRefEntries<Record<string, null | string | MaybeComputedRefEntries<Record<string, null | string>>>>;
53
+ /**
54
+ * The `<base>` HTML element specifies the base URL to use for all relative URLs in a document.
55
+ * There can be only one <base> element in a document.
56
+ *
57
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base
58
+ */
59
+ base?: Base<E['base']>;
60
+ /**
61
+ * The `<link>` HTML element specifies relationships between the current document and an external resource.
62
+ * This element is most commonly used to link to stylesheets, but is also used to establish site icons
63
+ * (both "favicon" style icons and icons for the home screen and apps on mobile devices) among other things.
64
+ *
65
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-as
66
+ */
67
+ link?: MaybeComputedRef<Link<E['link']>[]>;
68
+ /**
69
+ * The `<meta>` element represents metadata that cannot be expressed in other HTML elements, like `<link>` or `<script>`.
70
+ *
71
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta
72
+ */
73
+ meta?: MaybeComputedRef<Meta<E['meta']>[]>;
74
+ /**
75
+ * The `<style>` HTML element contains style information for a document, or part of a document.
76
+ * It contains CSS, which is applied to the contents of the document containing the `<style>` element.
77
+ *
78
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/style
79
+ */
80
+ style?: MaybeComputedRef<(Style<E['style']> | string)[]>;
81
+ /**
82
+ * The `<script>` HTML element is used to embed executable code or data; this is typically used to embed or refer to JavaScript code.
83
+ *
84
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script
85
+ */
86
+ script?: MaybeComputedRef<(Script<E['script']> | string)[]>;
87
+ /**
88
+ * The `<noscript>` HTML element defines a section of HTML to be inserted if a script type on the page is unsupported
89
+ * or if scripting is currently turned off in the browser.
90
+ *
91
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/noscript
92
+ */
93
+ noscript?: MaybeComputedRef<(Noscript<E['noscript']> | string)[]>;
94
+ /**
95
+ * Attributes for the `<html>` HTML element.
96
+ *
97
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/html
98
+ */
99
+ htmlAttrs?: HtmlAttributes<E['htmlAttrs']>;
100
+ /**
101
+ * Attributes for the `<body>` HTML element.
102
+ *
103
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/body
104
+ */
105
+ bodyAttrs?: BodyAttributes<E['bodyAttrs']>;
106
+ }
107
+ type UseHeadInput<T extends MergeHead = {}> = MaybeComputedRef<ReactiveHead<T>>;
108
+ type UseSeoMetaInput = MaybeComputedRefEntries<MetaFlatInput> & {
109
+ title?: ReactiveHead['title'];
110
+ titleTemplate?: ReactiveHead['titleTemplate'];
111
+ };
112
+ type VueHeadClient<T extends MergeHead> = Unhead<MaybeComputedRef<ReactiveHead<T>>> & Plugin;
113
+
114
+ export type { BodyAttr as B, HtmlAttr as H, Link as L, MaybeComputedRefEntries as M, Noscript as N, ReactiveHead as R, Style as S, Title as T, UseHeadInput as U, VueHeadClient as V, MaybeComputedRef as a, UseSeoMetaInput as b, TitleTemplate as c, Base as d, Meta as e, Script as f, HtmlAttributes as g, BodyAttributes as h, MaybeReadonlyRef as i, MaybeComputedRefOrPromise as j };
@@ -0,0 +1,114 @@
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, MaybeFunctionEntries, BodyEvents, MergeHead, MetaFlatInput, Unhead } from '@unhead/schema';
2
+ import { ComputedRef, Ref, Plugin } from 'vue';
3
+
4
+ type MaybeReadonlyRef<T> = (() => T) | ComputedRef<T>;
5
+ type MaybeComputedRef<T> = T | MaybeReadonlyRef<T> | Ref<T>;
6
+ type MaybeComputedRefOrPromise<T> = T | MaybeReadonlyRef<T> | Ref<T> | Promise<T>;
7
+ type MaybeComputedRefEntries<T> = MaybeComputedRef<T> | {
8
+ [key in keyof T]?: MaybeComputedRefOrPromise<T[key]>;
9
+ };
10
+
11
+ interface HtmlAttr extends Omit<BaseHtmlAttr, 'class'> {
12
+ /**
13
+ * The class global attribute is a space-separated list of the case-sensitive classes of the element.
14
+ *
15
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/class
16
+ */
17
+ class?: MaybeArray<MaybeComputedRef<string>> | Record<string, MaybeComputedRef<boolean>>;
18
+ }
19
+ interface BodyAttr extends Omit<BaseBodyAttr, 'class'> {
20
+ /**
21
+ * The class global attribute is a space-separated list of the case-sensitive classes of the element.
22
+ *
23
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/class
24
+ */
25
+ class?: MaybeArray<MaybeComputedRef<string>> | Record<string, MaybeComputedRef<boolean>>;
26
+ }
27
+ type Title = MaybeComputedRef<Title$1>;
28
+ type TitleTemplate = TitleTemplate$1 | Ref<TitleTemplate$1> | ((title?: string) => TitleTemplate$1);
29
+ type Base<E extends EntryAugmentation = {}> = MaybeComputedRef<MaybeComputedRefEntries<Base$1<E>>>;
30
+ type Link<E extends EntryAugmentation = {}> = MaybeComputedRefEntries<Link$1<E>>;
31
+ type Meta<E extends EntryAugmentation = {}> = MaybeComputedRefEntries<Meta$1<E>>;
32
+ type Style<E extends EntryAugmentation = {}> = MaybeComputedRefEntries<Style$1<E>>;
33
+ type Script<E extends EntryAugmentation = {}> = MaybeComputedRefEntries<Script$1<E>>;
34
+ type Noscript<E extends EntryAugmentation = {}> = MaybeComputedRefEntries<Noscript$1<E>>;
35
+ type HtmlAttributes<E extends EntryAugmentation = {}> = MaybeComputedRef<MaybeComputedRefEntries<HtmlAttr & DataKeys & SchemaAugmentations['htmlAttrs'] & DefinedValueOrEmptyObject<E>>>;
36
+ type BodyAttributes<E extends EntryAugmentation = {}> = MaybeComputedRef<MaybeComputedRefEntries<BodyAttr & DataKeys & SchemaAugmentations['bodyAttrs'] & DefinedValueOrEmptyObject<E>> & MaybeFunctionEntries<BodyEvents>>;
37
+ interface ReactiveHead<E extends MergeHead = MergeHead> {
38
+ /**
39
+ * The `<title>` HTML element defines the document's title that is shown in a browser's title bar or a page's tab.
40
+ * It only contains text; tags within the element are ignored.
41
+ *
42
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/title
43
+ */
44
+ title?: Title | Promise<Title>;
45
+ /**
46
+ * Generate the title from a template.
47
+ */
48
+ titleTemplate?: TitleTemplate;
49
+ /**
50
+ * Variables used to substitute in the title and meta content.
51
+ */
52
+ templateParams?: MaybeComputedRefEntries<Record<string, null | string | MaybeComputedRefEntries<Record<string, null | string>>>>;
53
+ /**
54
+ * The `<base>` HTML element specifies the base URL to use for all relative URLs in a document.
55
+ * There can be only one <base> element in a document.
56
+ *
57
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base
58
+ */
59
+ base?: Base<E['base']>;
60
+ /**
61
+ * The `<link>` HTML element specifies relationships between the current document and an external resource.
62
+ * This element is most commonly used to link to stylesheets, but is also used to establish site icons
63
+ * (both "favicon" style icons and icons for the home screen and apps on mobile devices) among other things.
64
+ *
65
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-as
66
+ */
67
+ link?: MaybeComputedRef<Link<E['link']>[]>;
68
+ /**
69
+ * The `<meta>` element represents metadata that cannot be expressed in other HTML elements, like `<link>` or `<script>`.
70
+ *
71
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta
72
+ */
73
+ meta?: MaybeComputedRef<Meta<E['meta']>[]>;
74
+ /**
75
+ * The `<style>` HTML element contains style information for a document, or part of a document.
76
+ * It contains CSS, which is applied to the contents of the document containing the `<style>` element.
77
+ *
78
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/style
79
+ */
80
+ style?: MaybeComputedRef<(Style<E['style']> | string)[]>;
81
+ /**
82
+ * The `<script>` HTML element is used to embed executable code or data; this is typically used to embed or refer to JavaScript code.
83
+ *
84
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script
85
+ */
86
+ script?: MaybeComputedRef<(Script<E['script']> | string)[]>;
87
+ /**
88
+ * The `<noscript>` HTML element defines a section of HTML to be inserted if a script type on the page is unsupported
89
+ * or if scripting is currently turned off in the browser.
90
+ *
91
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/noscript
92
+ */
93
+ noscript?: MaybeComputedRef<(Noscript<E['noscript']> | string)[]>;
94
+ /**
95
+ * Attributes for the `<html>` HTML element.
96
+ *
97
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/html
98
+ */
99
+ htmlAttrs?: HtmlAttributes<E['htmlAttrs']>;
100
+ /**
101
+ * Attributes for the `<body>` HTML element.
102
+ *
103
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/body
104
+ */
105
+ bodyAttrs?: BodyAttributes<E['bodyAttrs']>;
106
+ }
107
+ type UseHeadInput<T extends MergeHead = {}> = MaybeComputedRef<ReactiveHead<T>>;
108
+ type UseSeoMetaInput = MaybeComputedRefEntries<MetaFlatInput> & {
109
+ title?: ReactiveHead['title'];
110
+ titleTemplate?: ReactiveHead['titleTemplate'];
111
+ };
112
+ type VueHeadClient<T extends MergeHead> = Unhead<MaybeComputedRef<ReactiveHead<T>>> & Plugin;
113
+
114
+ export type { BodyAttr as B, HtmlAttr as H, Link as L, MaybeComputedRefEntries as M, Noscript as N, ReactiveHead as R, Style as S, Title as T, UseHeadInput as U, VueHeadClient as V, MaybeComputedRef as a, UseSeoMetaInput as b, TitleTemplate as c, Base as d, Meta as e, Script as f, HtmlAttributes as g, BodyAttributes as h, MaybeReadonlyRef as i, MaybeComputedRefOrPromise as j };
@@ -1,4 +1,4 @@
1
- import { version, unref, nextTick, getCurrentInstance, inject, ref, watchEffect, watch, onBeforeUnmount, onDeactivated, onActivated } from 'vue';
1
+ import { version, unref, nextTick, hasInjectionContext, inject, ref, watchEffect, watch, getCurrentInstance, onBeforeUnmount, onDeactivated, onActivated } from 'vue';
2
2
  import { createServerHead as createServerHead$1, createHead as createHead$1, getActiveHead } from 'unhead';
3
3
  import { defineHeadPlugin } from '@unhead/shared';
4
4
 
@@ -64,7 +64,7 @@ function createHead(options = {}) {
64
64
  }
65
65
 
66
66
  function injectHead() {
67
- return getCurrentInstance() && inject(headSymbol) || getActiveHead();
67
+ return hasInjectionContext() && inject(headSymbol) || getActiveHead();
68
68
  }
69
69
 
70
70
  function useHead(input, options = {}) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@unhead/vue",
3
3
  "type": "module",
4
- "version": "1.3.9",
4
+ "version": "1.4.1",
5
5
  "author": "Harlan Wilton <harlan@harlanzw.com>",
6
6
  "license": "MIT",
7
7
  "funding": "https://github.com/sponsors/harlan-zw",
@@ -38,9 +38,9 @@
38
38
  },
39
39
  "dependencies": {
40
40
  "hookable": "^5.5.3",
41
- "@unhead/schema": "1.3.9",
42
- "@unhead/shared": "1.3.9",
43
- "unhead": "1.3.9"
41
+ "@unhead/schema": "1.4.1",
42
+ "@unhead/shared": "1.4.1",
43
+ "unhead": "1.4.1"
44
44
  },
45
45
  "devDependencies": {
46
46
  "vue": "^3.3.4"