@unhead/vue 2.0.0-alpha.16 → 2.0.0-alpha.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/client.d.mts CHANGED
@@ -1,7 +1,8 @@
1
- import { VueHeadClient } from '@unhead/vue';
2
1
  import { MergeHead, CreateClientHeadOptions } from 'unhead/types';
3
2
  export { V as VueHeadMixin } from './shared/vue.DnywREVF.mjs';
4
3
  export { renderDOMHead } from 'unhead/client';
4
+ import { V as VueHeadClient } from './shared/vue.C97gXjQS.mjs';
5
+ import 'vue';
5
6
 
6
7
  declare function createHead<T extends MergeHead>(options?: CreateClientHeadOptions): VueHeadClient<T>;
7
8
 
package/dist/client.d.ts CHANGED
@@ -1,7 +1,8 @@
1
- import { VueHeadClient } from '@unhead/vue';
2
1
  import { MergeHead, CreateClientHeadOptions } from 'unhead/types';
3
2
  export { V as VueHeadMixin } from './shared/vue.DnywREVF.js';
4
3
  export { renderDOMHead } from 'unhead/client';
4
+ import { V as VueHeadClient } from './shared/vue.C97gXjQS.js';
5
+ import 'vue';
5
6
 
6
7
  declare function createHead<T extends MergeHead>(options?: CreateClientHeadOptions): VueHeadClient<T>;
7
8
 
package/dist/client.mjs CHANGED
@@ -1,21 +1,18 @@
1
1
  import { createHead as createHead$1, createDebouncedFn, renderDOMHead } from 'unhead/client';
2
2
  export { renderDOMHead } from 'unhead/client';
3
3
  import { nextTick } from 'vue';
4
- import { v as vueInstall } from './shared/vue.pWToN6_t.mjs';
5
- export { V as VueHeadMixin } from './shared/vue.Ci2RuXYj.mjs';
4
+ import { v as vueInstall } from './shared/vue.j4SPrdI5.mjs';
5
+ export { V as VueHeadMixin } from './shared/vue.DBXhY4KI.mjs';
6
6
  import 'unhead/plugins';
7
7
  import 'unhead/utils';
8
- import './shared/vue.CkLIG7eN.mjs';
8
+ import './shared/vue.N9zWjxoK.mjs';
9
9
 
10
10
  function createHead(options = {}) {
11
11
  const head = createHead$1({
12
12
  domOptions: {
13
13
  render: createDebouncedFn(() => renderDOMHead(head), nextTick)
14
14
  },
15
- ...options,
16
- plugins: [
17
- ...options.plugins || []
18
- ]
15
+ ...options
19
16
  });
20
17
  head.install = vueInstall(head);
21
18
  return head;
@@ -1,8 +1,8 @@
1
1
  import { defineComponent, ref, onBeforeUnmount, watchEffect } from 'vue';
2
- import { u as useHead } from './shared/vue.pWToN6_t.mjs';
2
+ import { u as useHead } from './shared/vue.j4SPrdI5.mjs';
3
3
  import 'unhead/plugins';
4
4
  import 'unhead/utils';
5
- import './shared/vue.CkLIG7eN.mjs';
5
+ import './shared/vue.N9zWjxoK.mjs';
6
6
 
7
7
  function addVNodeToHeadObj(node, obj) {
8
8
  const nodeType = node.type;
@@ -23,10 +23,10 @@ function addVNodeToHeadObj(node, obj) {
23
23
  }
24
24
  function vnodesToHeadObj(nodes) {
25
25
  const obj = {
26
- title: undefined,
27
- htmlAttrs: undefined,
28
- bodyAttrs: undefined,
29
- base: undefined,
26
+ title: void 0,
27
+ htmlAttrs: void 0,
28
+ bodyAttrs: void 0,
29
+ base: void 0,
30
30
  meta: [],
31
31
  link: [],
32
32
  style: [],
package/dist/index.d.mts CHANGED
@@ -1,8 +1,10 @@
1
1
  export { createHeadCore } from 'unhead';
2
2
  import { MergeHead, ActiveHeadEntry } from 'unhead/types';
3
3
  export { ActiveHeadEntry, Head, HeadEntryOptions, HeadTag, MergeHead, RenderSSRHeadOptions, ResolvedBase, ResolvedBodyAttributes, ResolvedHead, ResolvedHtmlAttributes, ResolvedLink, ResolvedMeta, ResolvedNoscript, ResolvedScript, ResolvedStyle, ResolvedTitle, ResolvedTitleTemplate, Unhead } from 'unhead/types';
4
- import { VueHeadClient, UseHeadInput, UseHeadOptions, UseHeadSafeInput, UseSeoMetaInput } from './types.mjs';
5
- export { Base, BodyAttr, BodyAttributes, HeadSafe, HtmlAttr, HtmlAttributes, Link, MaybeFalsey, Meta, Noscript, ReactiveHead, ResolvableArray, ResolvableProperties, ResolvableValue, SafeBodyAttr, SafeHtmlAttr, SafeLink, SafeMeta, SafeNoscript, SafeScript, SafeStyle, Script, Style, Title, TitleTemplate } from './types.mjs';
4
+ import { V as VueHeadClient, U as UseHeadInput, a as UseHeadOptions, b as UseSeoMetaInput } from './shared/vue.C97gXjQS.mjs';
5
+ export { d as Base, B as BodyAttr, g as BodyAttributes, H as HtmlAttr, f as HtmlAttributes, L as Link, h as MaybeFalsey, M as Meta, N as Noscript, R as ReactiveHead, j as ResolvableArray, k as ResolvableProperties, i as ResolvableValue, e as Script, S as Style, T as Title, c as TitleTemplate } from './shared/vue.C97gXjQS.mjs';
6
+ import { UseHeadSafeInput } from './types.mjs';
7
+ export { HeadSafe, SafeBodyAttr, SafeHtmlAttr, SafeLink, SafeMeta, SafeNoscript, SafeScript, SafeStyle } from './types.mjs';
6
8
  export { resolveUnrefHeadInput } from './utils.mjs';
7
9
  export { V as VueHeadMixin } from './shared/vue.DnywREVF.mjs';
8
10
  import 'vue';
@@ -13,12 +15,12 @@ declare const unheadVueComposablesImports: {
13
15
  };
14
16
 
15
17
  declare function injectHead(): VueHeadClient<MergeHead>;
16
- declare function useHead<T extends MergeHead>(input: UseHeadInput<T>, options?: UseHeadOptions): ActiveHeadEntry<UseHeadInput<T>>;
17
- declare function useHeadSafe(input: UseHeadSafeInput, options?: UseHeadOptions): ActiveHeadEntry<any>;
18
- declare function useSeoMeta(input: UseSeoMetaInput, options?: UseHeadOptions): ActiveHeadEntry<any>;
19
- declare function useServerHead<T extends MergeHead>(input: UseHeadInput<T>, options?: UseHeadOptions): ActiveHeadEntry<any>;
20
- declare function useServerHeadSafe(input: UseHeadSafeInput, options?: UseHeadOptions): ActiveHeadEntry<any>;
21
- declare function useServerSeoMeta(input: UseSeoMetaInput, options?: UseHeadOptions): ActiveHeadEntry<UseSeoMetaInput>;
18
+ declare function useHead<T extends MergeHead>(input?: UseHeadInput<T>, options?: UseHeadOptions): ActiveHeadEntry<UseHeadInput<T>>;
19
+ declare function useHeadSafe(input?: UseHeadSafeInput, options?: UseHeadOptions): ActiveHeadEntry<any>;
20
+ declare function useSeoMeta(input?: UseSeoMetaInput, options?: UseHeadOptions): ActiveHeadEntry<any>;
21
+ declare function useServerHead<T extends MergeHead>(input?: UseHeadInput<T>, options?: UseHeadOptions): ActiveHeadEntry<any>;
22
+ declare function useServerHeadSafe(input?: UseHeadSafeInput, options?: UseHeadOptions): ActiveHeadEntry<any>;
23
+ declare function useServerSeoMeta(input?: UseSeoMetaInput, options?: UseHeadOptions): ActiveHeadEntry<UseSeoMetaInput>;
22
24
 
23
25
  declare const headSymbol = "usehead";
24
26
 
package/dist/index.d.ts CHANGED
@@ -1,8 +1,10 @@
1
1
  export { createHeadCore } from 'unhead';
2
2
  import { MergeHead, ActiveHeadEntry } from 'unhead/types';
3
3
  export { ActiveHeadEntry, Head, HeadEntryOptions, HeadTag, MergeHead, RenderSSRHeadOptions, ResolvedBase, ResolvedBodyAttributes, ResolvedHead, ResolvedHtmlAttributes, ResolvedLink, ResolvedMeta, ResolvedNoscript, ResolvedScript, ResolvedStyle, ResolvedTitle, ResolvedTitleTemplate, Unhead } from 'unhead/types';
4
- import { VueHeadClient, UseHeadInput, UseHeadOptions, UseHeadSafeInput, UseSeoMetaInput } from './types.js';
5
- export { Base, BodyAttr, BodyAttributes, HeadSafe, HtmlAttr, HtmlAttributes, Link, MaybeFalsey, Meta, Noscript, ReactiveHead, ResolvableArray, ResolvableProperties, ResolvableValue, SafeBodyAttr, SafeHtmlAttr, SafeLink, SafeMeta, SafeNoscript, SafeScript, SafeStyle, Script, Style, Title, TitleTemplate } from './types.js';
4
+ import { V as VueHeadClient, U as UseHeadInput, a as UseHeadOptions, b as UseSeoMetaInput } from './shared/vue.C97gXjQS.js';
5
+ export { d as Base, B as BodyAttr, g as BodyAttributes, H as HtmlAttr, f as HtmlAttributes, L as Link, h as MaybeFalsey, M as Meta, N as Noscript, R as ReactiveHead, j as ResolvableArray, k as ResolvableProperties, i as ResolvableValue, e as Script, S as Style, T as Title, c as TitleTemplate } from './shared/vue.C97gXjQS.js';
6
+ import { UseHeadSafeInput } from './types.js';
7
+ export { HeadSafe, SafeBodyAttr, SafeHtmlAttr, SafeLink, SafeMeta, SafeNoscript, SafeScript, SafeStyle } from './types.js';
6
8
  export { resolveUnrefHeadInput } from './utils.js';
7
9
  export { V as VueHeadMixin } from './shared/vue.DnywREVF.js';
8
10
  import 'vue';
@@ -13,12 +15,12 @@ declare const unheadVueComposablesImports: {
13
15
  };
14
16
 
15
17
  declare function injectHead(): VueHeadClient<MergeHead>;
16
- declare function useHead<T extends MergeHead>(input: UseHeadInput<T>, options?: UseHeadOptions): ActiveHeadEntry<UseHeadInput<T>>;
17
- declare function useHeadSafe(input: UseHeadSafeInput, options?: UseHeadOptions): ActiveHeadEntry<any>;
18
- declare function useSeoMeta(input: UseSeoMetaInput, options?: UseHeadOptions): ActiveHeadEntry<any>;
19
- declare function useServerHead<T extends MergeHead>(input: UseHeadInput<T>, options?: UseHeadOptions): ActiveHeadEntry<any>;
20
- declare function useServerHeadSafe(input: UseHeadSafeInput, options?: UseHeadOptions): ActiveHeadEntry<any>;
21
- declare function useServerSeoMeta(input: UseSeoMetaInput, options?: UseHeadOptions): ActiveHeadEntry<UseSeoMetaInput>;
18
+ declare function useHead<T extends MergeHead>(input?: UseHeadInput<T>, options?: UseHeadOptions): ActiveHeadEntry<UseHeadInput<T>>;
19
+ declare function useHeadSafe(input?: UseHeadSafeInput, options?: UseHeadOptions): ActiveHeadEntry<any>;
20
+ declare function useSeoMeta(input?: UseSeoMetaInput, options?: UseHeadOptions): ActiveHeadEntry<any>;
21
+ declare function useServerHead<T extends MergeHead>(input?: UseHeadInput<T>, options?: UseHeadOptions): ActiveHeadEntry<any>;
22
+ declare function useServerHeadSafe(input?: UseHeadSafeInput, options?: UseHeadOptions): ActiveHeadEntry<any>;
23
+ declare function useServerSeoMeta(input?: UseSeoMetaInput, options?: UseHeadOptions): ActiveHeadEntry<UseSeoMetaInput>;
22
24
 
23
25
  declare const headSymbol = "usehead";
24
26
 
package/dist/index.mjs CHANGED
@@ -1,11 +1,11 @@
1
1
  export { createHeadCore } from 'unhead';
2
- export { h as headSymbol, i as injectHead, u as useHead, a as useHeadSafe, b as useSeoMeta, c as useServerHead, d as useServerHeadSafe, e as useServerSeoMeta } from './shared/vue.pWToN6_t.mjs';
2
+ export { h as headSymbol, i as injectHead, u as useHead, a as useHeadSafe, b as useSeoMeta, c as useServerHead, d as useServerHeadSafe, e as useServerSeoMeta } from './shared/vue.j4SPrdI5.mjs';
3
3
  export { resolveUnrefHeadInput } from './utils.mjs';
4
- export { V as VueHeadMixin } from './shared/vue.Ci2RuXYj.mjs';
4
+ export { V as VueHeadMixin } from './shared/vue.DBXhY4KI.mjs';
5
5
  import 'unhead/plugins';
6
6
  import 'unhead/utils';
7
7
  import 'vue';
8
- import './shared/vue.CkLIG7eN.mjs';
8
+ import './shared/vue.N9zWjxoK.mjs';
9
9
 
10
10
  const unheadVueComposablesImports = {
11
11
  "@unhead/vue": ["injectHead", "useHead", "useSeoMeta", "useHeadSafe", "useServerHead", "useServerSeoMeta", "useServerHeadSafe"]
package/dist/legacy.d.mts CHANGED
@@ -1,37 +1,9 @@
1
1
  import * as unhead_types from 'unhead/types';
2
- import { ScriptBase, DataKeys, SchemaAugmentations, HeadEntryOptions, MergeHead, CreateClientHeadOptions, ActiveHeadEntry } from 'unhead/types';
2
+ import { MergeHead, CreateClientHeadOptions, ActiveHeadEntry } from 'unhead/types';
3
3
  export { createHeadCore } from 'unhead';
4
- import { ResolvableProperties, UseHeadOptions } from '@unhead/vue';
5
- import { ScriptInstance, UseScriptStatus, UseScriptOptions as UseScriptOptions$1, UseFunctionType } from 'unhead/legacy';
6
- export { UseFunctionType, resolveScriptKey } from 'unhead/legacy';
7
- import { Ref } from 'vue';
8
- import { VueHeadClient, UseHeadInput, UseHeadOptions as UseHeadOptions$1, UseHeadSafeInput, UseSeoMetaInput } from './types.mjs';
9
-
10
- interface VueScriptInstance<T extends Record<symbol | string, any>> extends Omit<ScriptInstance<T>, 'status'> {
11
- status: Ref<UseScriptStatus>;
12
- }
13
- type UseScriptInput = string | (ResolvableProperties<Omit<ScriptBase & DataKeys & SchemaAugmentations['script'], 'src'>> & {
14
- src: string;
15
- });
16
- interface UseScriptOptions<T extends Record<symbol | string, any> = Record<string, any>> extends Omit<HeadEntryOptions, 'head'>, Pick<UseScriptOptions$1<T>, 'use' | 'eventContext' | 'beforeInit'> {
17
- /**
18
- * The trigger to load the script:
19
- * - `undefined` | `client` - (Default) Load the script on the client when this js is loaded.
20
- * - `manual` - Load the script manually by calling `$script.load()`, exists only on the client.
21
- * - `Promise` - Load the script when the promise resolves, exists only on the client.
22
- * - `Function` - Register a callback function to load the script, exists only on the client.
23
- * - `server` - Have the script injected on the server.
24
- * - `ref` - Load the script when the ref is true.
25
- */
26
- trigger?: UseScriptOptions$1['trigger'] | Ref<boolean>;
27
- /**
28
- * The Unhead instance to use.
29
- */
30
- head?: UseHeadOptions['head'];
31
- }
32
- type UseScriptContext<T extends Record<symbol | string, any>> = Promise<T> & VueScriptInstance<T>;
33
- type UseScriptReturn<T extends Record<symbol | string, any>> = UseScriptContext<UseFunctionType<UseScriptOptions<T>, T>>;
34
- declare function useScript<T extends Record<symbol | string, any> = Record<symbol | string, any>>(_input: UseScriptInput, _options?: UseScriptOptions<T>): UseScriptReturn<T>;
4
+ import { V as VueHeadClient, U as UseHeadInput, a as UseHeadOptions, b as UseSeoMetaInput } from './shared/vue.C97gXjQS.mjs';
5
+ import { UseHeadSafeInput } from './types.mjs';
6
+ import 'vue';
35
7
 
36
8
  declare function resolveUnrefHeadInput(input: any): any;
37
9
  declare function CapoPlugin(): unhead_types.HeadPluginInput;
@@ -42,11 +14,11 @@ declare function createServerHead<T extends MergeHead>(options?: CreateClientHea
42
14
  */
43
15
  declare function setHeadInjectionHandler(handler: () => VueHeadClient<any> | undefined): void;
44
16
  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<any> | 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;
17
+ declare function useHead<T extends MergeHead>(input: UseHeadInput<T>, options?: UseHeadOptions): ActiveHeadEntry<UseHeadInput<T>> | void;
18
+ declare function useHeadSafe(input: UseHeadSafeInput, options?: UseHeadOptions): ActiveHeadEntry<any> | void;
19
+ declare function useSeoMeta(input: UseSeoMetaInput, options?: UseHeadOptions): ActiveHeadEntry<any> | void;
20
+ declare function useServerHead<T extends MergeHead>(input: UseHeadInput<T>, options?: UseHeadOptions): ActiveHeadEntry<any> | void;
21
+ declare function useServerHeadSafe(input: UseHeadSafeInput, options?: UseHeadOptions): ActiveHeadEntry<any> | void;
22
+ declare function useServerSeoMeta(input: UseSeoMetaInput, options?: UseHeadOptions): ActiveHeadEntry<any> | void;
51
23
 
52
- export { CapoPlugin, type UseScriptContext, type UseScriptInput, type UseScriptOptions, type UseScriptReturn, type VueScriptInstance, createHead, createServerHead, injectHead, resolveUnrefHeadInput, setHeadInjectionHandler, useHead, useHeadSafe, useScript, useSeoMeta, useServerHead, useServerHeadSafe, useServerSeoMeta };
24
+ export { CapoPlugin, createHead, createServerHead, injectHead, resolveUnrefHeadInput, setHeadInjectionHandler, useHead, useHeadSafe, useSeoMeta, useServerHead, useServerHeadSafe, useServerSeoMeta };
package/dist/legacy.d.ts CHANGED
@@ -1,37 +1,9 @@
1
1
  import * as unhead_types from 'unhead/types';
2
- import { ScriptBase, DataKeys, SchemaAugmentations, HeadEntryOptions, MergeHead, CreateClientHeadOptions, ActiveHeadEntry } from 'unhead/types';
2
+ import { MergeHead, CreateClientHeadOptions, ActiveHeadEntry } from 'unhead/types';
3
3
  export { createHeadCore } from 'unhead';
4
- import { ResolvableProperties, UseHeadOptions } from '@unhead/vue';
5
- import { ScriptInstance, UseScriptStatus, UseScriptOptions as UseScriptOptions$1, UseFunctionType } from 'unhead/legacy';
6
- export { UseFunctionType, resolveScriptKey } from 'unhead/legacy';
7
- import { Ref } from 'vue';
8
- import { VueHeadClient, UseHeadInput, UseHeadOptions as UseHeadOptions$1, UseHeadSafeInput, UseSeoMetaInput } from './types.js';
9
-
10
- interface VueScriptInstance<T extends Record<symbol | string, any>> extends Omit<ScriptInstance<T>, 'status'> {
11
- status: Ref<UseScriptStatus>;
12
- }
13
- type UseScriptInput = string | (ResolvableProperties<Omit<ScriptBase & DataKeys & SchemaAugmentations['script'], 'src'>> & {
14
- src: string;
15
- });
16
- interface UseScriptOptions<T extends Record<symbol | string, any> = Record<string, any>> extends Omit<HeadEntryOptions, 'head'>, Pick<UseScriptOptions$1<T>, 'use' | 'eventContext' | 'beforeInit'> {
17
- /**
18
- * The trigger to load the script:
19
- * - `undefined` | `client` - (Default) Load the script on the client when this js is loaded.
20
- * - `manual` - Load the script manually by calling `$script.load()`, exists only on the client.
21
- * - `Promise` - Load the script when the promise resolves, exists only on the client.
22
- * - `Function` - Register a callback function to load the script, exists only on the client.
23
- * - `server` - Have the script injected on the server.
24
- * - `ref` - Load the script when the ref is true.
25
- */
26
- trigger?: UseScriptOptions$1['trigger'] | Ref<boolean>;
27
- /**
28
- * The Unhead instance to use.
29
- */
30
- head?: UseHeadOptions['head'];
31
- }
32
- type UseScriptContext<T extends Record<symbol | string, any>> = Promise<T> & VueScriptInstance<T>;
33
- type UseScriptReturn<T extends Record<symbol | string, any>> = UseScriptContext<UseFunctionType<UseScriptOptions<T>, T>>;
34
- declare function useScript<T extends Record<symbol | string, any> = Record<symbol | string, any>>(_input: UseScriptInput, _options?: UseScriptOptions<T>): UseScriptReturn<T>;
4
+ import { V as VueHeadClient, U as UseHeadInput, a as UseHeadOptions, b as UseSeoMetaInput } from './shared/vue.C97gXjQS.js';
5
+ import { UseHeadSafeInput } from './types.js';
6
+ import 'vue';
35
7
 
36
8
  declare function resolveUnrefHeadInput(input: any): any;
37
9
  declare function CapoPlugin(): unhead_types.HeadPluginInput;
@@ -42,11 +14,11 @@ declare function createServerHead<T extends MergeHead>(options?: CreateClientHea
42
14
  */
43
15
  declare function setHeadInjectionHandler(handler: () => VueHeadClient<any> | undefined): void;
44
16
  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<any> | 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;
17
+ declare function useHead<T extends MergeHead>(input: UseHeadInput<T>, options?: UseHeadOptions): ActiveHeadEntry<UseHeadInput<T>> | void;
18
+ declare function useHeadSafe(input: UseHeadSafeInput, options?: UseHeadOptions): ActiveHeadEntry<any> | void;
19
+ declare function useSeoMeta(input: UseSeoMetaInput, options?: UseHeadOptions): ActiveHeadEntry<any> | void;
20
+ declare function useServerHead<T extends MergeHead>(input: UseHeadInput<T>, options?: UseHeadOptions): ActiveHeadEntry<any> | void;
21
+ declare function useServerHeadSafe(input: UseHeadSafeInput, options?: UseHeadOptions): ActiveHeadEntry<any> | void;
22
+ declare function useServerSeoMeta(input: UseSeoMetaInput, options?: UseHeadOptions): ActiveHeadEntry<any> | void;
51
23
 
52
- export { CapoPlugin, type UseScriptContext, type UseScriptInput, type UseScriptOptions, type UseScriptReturn, type VueScriptInstance, createHead, createServerHead, injectHead, resolveUnrefHeadInput, setHeadInjectionHandler, useHead, useHeadSafe, useScript, useSeoMeta, useServerHead, useServerHeadSafe, useServerSeoMeta };
24
+ export { CapoPlugin, createHead, createServerHead, injectHead, resolveUnrefHeadInput, setHeadInjectionHandler, useHead, useHeadSafe, useSeoMeta, useServerHead, useServerHeadSafe, useServerSeoMeta };
package/dist/legacy.mjs CHANGED
@@ -1,82 +1,15 @@
1
1
  export { createHeadCore } from 'unhead';
2
- import { getCurrentInstance, onMounted, isRef, watch, onScopeDispose, ref, inject, watchEffect, unref, onBeforeUnmount, onDeactivated, onActivated } from 'vue';
2
+ import { inject, ref, watchEffect, unref, watch, getCurrentInstance, onBeforeUnmount, onDeactivated, onActivated } from 'vue';
3
3
  import { createHead as createHead$1 } from './client.mjs';
4
- import { h as headSymbol } from './shared/vue.pWToN6_t.mjs';
5
- import { V as VueResolver } from './shared/vue.CkLIG7eN.mjs';
4
+ import { h as headSymbol } from './shared/vue.j4SPrdI5.mjs';
5
+ import { V as VueResolver } from './shared/vue.N9zWjxoK.mjs';
6
6
  import { createHead as createHead$2 } from './server.mjs';
7
- import { useScript as useScript$1 } from 'unhead/legacy';
8
- export { resolveScriptKey } from 'unhead/legacy';
9
- import { walkResolver, defineHeadPlugin } from 'unhead/utils';
10
- import { DeprecationsPlugin, PromisesPlugin, TemplateParamsPlugin, AliasSortingPlugin, SafeInputPlugin, FlatMetaPlugin } from 'unhead/plugins';
7
+ import { walkResolver } from 'unhead/utils';
8
+ import { defineHeadPlugin, DeprecationsPlugin, PromisesPlugin, TemplateParamsPlugin, AliasSortingPlugin, SafeInputPlugin, FlatMetaPlugin } from 'unhead/plugins';
11
9
  import 'unhead/client';
12
- import './shared/vue.Ci2RuXYj.mjs';
10
+ import './shared/vue.DBXhY4KI.mjs';
13
11
  import 'unhead/server';
14
12
 
15
- function registerVueScopeHandlers(script, scope) {
16
- if (!scope) {
17
- return;
18
- }
19
- const _registerCb = (key, cb) => {
20
- if (!script._cbs[key]) {
21
- cb(script.instance);
22
- return () => {
23
- };
24
- }
25
- let i = script._cbs[key].push(cb);
26
- const destroy = () => {
27
- if (i) {
28
- script._cbs[key]?.splice(i - 1, 1);
29
- i = null;
30
- }
31
- };
32
- onScopeDispose(destroy);
33
- return destroy;
34
- };
35
- script.onLoaded = (cb) => _registerCb("loaded", cb);
36
- script.onError = (cb) => _registerCb("error", cb);
37
- onScopeDispose(() => {
38
- script._triggerAbortController?.abort();
39
- });
40
- }
41
- function useScript(_input, _options) {
42
- const input = typeof _input === "string" ? { src: _input } : _input;
43
- const options = _options || {};
44
- const head = options?.head || injectHead();
45
- options.head = head;
46
- const scope = getCurrentInstance();
47
- options.eventContext = scope;
48
- if (scope && typeof options.trigger === "undefined") {
49
- options.trigger = onMounted;
50
- } else if (isRef(options.trigger)) {
51
- const refTrigger = options.trigger;
52
- let off;
53
- options.trigger = new Promise((resolve) => {
54
- off = watch(refTrigger, (val) => {
55
- if (val) {
56
- resolve(true);
57
- }
58
- }, {
59
- immediate: true
60
- });
61
- onScopeDispose(() => resolve(false), true);
62
- }).then((val) => {
63
- off?.();
64
- return val;
65
- });
66
- }
67
- head._scriptStatusWatcher = head._scriptStatusWatcher || head.hooks.hook("script:updated", ({ script: s }) => {
68
- s._statusRef.value = s.status;
69
- });
70
- const script = useScript$1(input, options);
71
- script._statusRef = script._statusRef || ref(script.status);
72
- registerVueScopeHandlers(script, scope);
73
- return new Proxy(script, {
74
- get(_, key, a) {
75
- return Reflect.get(_, key === "status" ? "_statusRef" : key, a);
76
- }
77
- });
78
- }
79
-
80
13
  function resolveUnrefHeadInput(input) {
81
14
  return walkResolver(input, VueResolver);
82
15
  }
@@ -177,4 +110,4 @@ function useServerSeoMeta(input, options) {
177
110
  return useSeoMeta(input, { ...options, mode: "server" });
178
111
  }
179
112
 
180
- export { CapoPlugin, createHead, createServerHead, injectHead, resolveUnrefHeadInput, setHeadInjectionHandler, useHead, useHeadSafe, useScript, useSeoMeta, useServerHead, useServerHeadSafe, useServerSeoMeta };
113
+ export { CapoPlugin, createHead, createServerHead, injectHead, resolveUnrefHeadInput, setHeadInjectionHandler, useHead, useHeadSafe, useSeoMeta, useServerHead, useServerHeadSafe, useServerSeoMeta };
package/dist/server.d.mts CHANGED
@@ -1,7 +1,8 @@
1
- import { VueHeadClient } from '@unhead/vue';
2
1
  import { MergeHead, CreateServerHeadOptions } from 'unhead/types';
3
2
  export { V as VueHeadMixin } from './shared/vue.DnywREVF.mjs';
4
3
  export { SSRHeadPayload, extractUnheadInputFromHtml, propsToString, renderSSRHead, transformHtmlTemplate } from 'unhead/server';
4
+ import { V as VueHeadClient } from './shared/vue.C97gXjQS.mjs';
5
+ import 'vue';
5
6
 
6
7
  declare function createHead<T extends MergeHead>(options?: Omit<CreateServerHeadOptions, 'propsResolver'>): VueHeadClient<T>;
7
8
 
package/dist/server.d.ts CHANGED
@@ -1,7 +1,8 @@
1
- import { VueHeadClient } from '@unhead/vue';
2
1
  import { MergeHead, CreateServerHeadOptions } from 'unhead/types';
3
2
  export { V as VueHeadMixin } from './shared/vue.DnywREVF.js';
4
3
  export { SSRHeadPayload, extractUnheadInputFromHtml, propsToString, renderSSRHead, transformHtmlTemplate } from 'unhead/server';
4
+ import { V as VueHeadClient } from './shared/vue.C97gXjQS.js';
5
+ import 'vue';
5
6
 
6
7
  declare function createHead<T extends MergeHead>(options?: Omit<CreateServerHeadOptions, 'propsResolver'>): VueHeadClient<T>;
7
8
 
package/dist/server.mjs CHANGED
@@ -1,8 +1,8 @@
1
1
  import { createHead as createHead$1 } from 'unhead/server';
2
2
  export { extractUnheadInputFromHtml, propsToString, renderSSRHead, transformHtmlTemplate } from 'unhead/server';
3
- import { v as vueInstall } from './shared/vue.pWToN6_t.mjs';
4
- import { V as VueResolver } from './shared/vue.CkLIG7eN.mjs';
5
- export { V as VueHeadMixin } from './shared/vue.Ci2RuXYj.mjs';
3
+ import { v as vueInstall } from './shared/vue.j4SPrdI5.mjs';
4
+ import { V as VueResolver } from './shared/vue.N9zWjxoK.mjs';
5
+ export { V as VueHeadMixin } from './shared/vue.DBXhY4KI.mjs';
6
6
  import 'unhead/plugins';
7
7
  import 'unhead/utils';
8
8
  import 'vue';
@@ -0,0 +1,133 @@
1
+ import { Falsey, MergeHead, Unhead, Stringable, SchemaAugmentations, TitleTemplate as TitleTemplate$1, EntryAugmentation, Base as Base$1, DefinedValueOrEmptyObject, LinkBase, DataKeys, MaybeEventFnHandlers, HttpEventAttributes, BaseMeta, Style as Style$1, ScriptBase, Noscript as Noscript$1, BaseHtmlAttr, MaybeArray, BaseBodyAttr, BodyEvents, HeadEntryOptions, MetaFlatInput } from 'unhead/types';
2
+ import { ComputedRef, Ref, CSSProperties, Plugin } from 'vue';
3
+
4
+ type MaybeFalsey<T> = T | Falsey;
5
+ type ResolvableValue<T> = MaybeFalsey<T> | (() => MaybeFalsey<T>) | ComputedRef<MaybeFalsey<T>> | Ref<MaybeFalsey<T>>;
6
+ type ResolvableArray<T> = ResolvableValue<ResolvableValue<T>[]>;
7
+ type ResolvableProperties<T> = {
8
+ [key in keyof T]?: ResolvableValue<T[key]>;
9
+ };
10
+
11
+ interface HtmlAttr extends Omit<BaseHtmlAttr, 'class' | 'style'> {
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<ResolvableValue<Falsey | Stringable> | Record<string, ResolvableValue<Falsey | Stringable>>>;
18
+ /**
19
+ * The class global attribute is a space-separated list of the case-sensitive classes of the element.
20
+ *
21
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/class
22
+ */
23
+ style?: MaybeArray<ResolvableValue<Falsey | Stringable> | ResolvableProperties<CSSProperties>>;
24
+ }
25
+ interface BodyAttr extends Omit<BaseBodyAttr, 'class' | 'style'> {
26
+ /**
27
+ * The class global attribute is a space-separated list of the case-sensitive classes of the element.
28
+ *
29
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/class
30
+ */
31
+ class?: MaybeArray<ResolvableValue<Falsey | Stringable>> | Record<string, ResolvableValue<Falsey | Stringable>>;
32
+ /**
33
+ * The class global attribute is a space-separated list of the case-sensitive classes of the element.
34
+ *
35
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/class
36
+ */
37
+ style?: MaybeArray<ResolvableValue<string>> | ResolvableProperties<CSSProperties>;
38
+ }
39
+ type Title = ResolvableValue<Stringable | Falsey> | ResolvableProperties<({
40
+ textContent: Stringable;
41
+ } & SchemaAugmentations['title'])>;
42
+ type TitleTemplate = TitleTemplate$1 | Ref<TitleTemplate$1> | ((title?: string) => TitleTemplate$1);
43
+ type Base<E extends EntryAugmentation = Record<string, any>> = ResolvableProperties<Base$1 & SchemaAugmentations['base']> & DefinedValueOrEmptyObject<E>;
44
+ type Link<E extends EntryAugmentation = Record<string, any>> = ResolvableProperties<LinkBase & DataKeys & SchemaAugmentations['link']> & MaybeEventFnHandlers<HttpEventAttributes> & DefinedValueOrEmptyObject<E>;
45
+ type Meta<E extends EntryAugmentation = Record<string, any>> = ResolvableProperties<BaseMeta & DataKeys & SchemaAugmentations['meta']> & DefinedValueOrEmptyObject<E>;
46
+ type Style<E extends EntryAugmentation = Record<string, any>> = ResolvableProperties<Style$1 & DataKeys & SchemaAugmentations['style']> & DefinedValueOrEmptyObject<E>;
47
+ type Script<E extends EntryAugmentation = Record<string, any>> = ResolvableProperties<ScriptBase & DataKeys & SchemaAugmentations['script']> & MaybeEventFnHandlers<HttpEventAttributes> & DefinedValueOrEmptyObject<E>;
48
+ type Noscript<E extends EntryAugmentation = Record<string, any>> = ResolvableProperties<Noscript$1 & DataKeys & SchemaAugmentations['noscript']> & DefinedValueOrEmptyObject<E>;
49
+ type HtmlAttributes<E extends EntryAugmentation = Record<string, any>> = ResolvableProperties<HtmlAttr & DataKeys & SchemaAugmentations['htmlAttrs']> & DefinedValueOrEmptyObject<E>;
50
+ type BodyAttributes<E extends EntryAugmentation = Record<string, any>> = ResolvableProperties<BodyAttr & DataKeys & SchemaAugmentations['bodyAttrs']> & MaybeEventFnHandlers<BodyEvents> & DefinedValueOrEmptyObject<E>;
51
+ interface ReactiveHead<E extends MergeHead = MergeHead> {
52
+ /**
53
+ * The `<title>` HTML element defines the document's title that is shown in a browser's title bar or a page's tab.
54
+ * It only contains text; tags within the element are ignored.
55
+ *
56
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/title
57
+ */
58
+ title?: Title;
59
+ /**
60
+ * Generate the title from a template.
61
+ */
62
+ titleTemplate?: TitleTemplate;
63
+ /**
64
+ * Variables used to substitute in the title and meta content.
65
+ */
66
+ templateParams?: ResolvableProperties<{
67
+ separator?: '|' | '-' | '·' | string;
68
+ } & Record<string, Stringable | Falsey | ResolvableProperties<Record<string, Stringable | Falsey>>>>;
69
+ /**
70
+ * The `<base>` HTML element specifies the base URL to use for all relative URLs in a document.
71
+ * There can be only one <base> element in a document.
72
+ *
73
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base
74
+ */
75
+ base?: Base<E['base']>;
76
+ /**
77
+ * The `<link>` HTML element specifies relationships between the current document and an external resource.
78
+ * This element is most commonly used to link to stylesheets, but is also used to establish site icons
79
+ * (both "favicon" style icons and icons for the home screen and apps on mobile devices) among other things.
80
+ *
81
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-as
82
+ */
83
+ link?: ResolvableArray<Link<E['link']>>;
84
+ /**
85
+ * The `<meta>` element represents metadata that cannot be expressed in other HTML elements, like `<link>` or `<script>`.
86
+ *
87
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta
88
+ */
89
+ meta?: ResolvableArray<Meta<E['meta']>>;
90
+ /**
91
+ * The `<style>` HTML element contains style information for a document, or part of a document.
92
+ * It contains CSS, which is applied to the contents of the document containing the `<style>` element.
93
+ *
94
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/style
95
+ */
96
+ style?: ResolvableArray<(Style<E['style']> | string)>;
97
+ /**
98
+ * The `<script>` HTML element is used to embed executable code or data; this is typically used to embed or refer to JavaScript code.
99
+ *
100
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script
101
+ */
102
+ script?: ResolvableArray<(Script<E['script']> | string)>;
103
+ /**
104
+ * The `<noscript>` HTML element defines a section of HTML to be inserted if a script type on the page is unsupported
105
+ * or if scripting is currently turned off in the browser.
106
+ *
107
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/noscript
108
+ */
109
+ noscript?: ResolvableArray<(Noscript<E['noscript']> | string)>;
110
+ /**
111
+ * Attributes for the `<html>` HTML element.
112
+ *
113
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/html
114
+ */
115
+ htmlAttrs?: HtmlAttributes<E['htmlAttrs']>;
116
+ /**
117
+ * Attributes for the `<body>` HTML element.
118
+ *
119
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/body
120
+ */
121
+ bodyAttrs?: BodyAttributes<E['bodyAttrs']>;
122
+ }
123
+ type UseHeadOptions = Omit<HeadEntryOptions, 'head'> & {
124
+ head?: VueHeadClient<any>;
125
+ };
126
+ type UseHeadInput<T extends MergeHead = Record<string, any>> = ResolvableValue<ReactiveHead<T>>;
127
+ type UseSeoMetaInput = ResolvableProperties<MetaFlatInput> & {
128
+ title?: ReactiveHead['title'];
129
+ titleTemplate?: ReactiveHead['titleTemplate'];
130
+ };
131
+ type VueHeadClient<T extends MergeHead> = Unhead<ResolvableValue<ReactiveHead<T>>> & Plugin;
132
+
133
+ export type { BodyAttr as B, HtmlAttr as H, Link as L, Meta as M, Noscript as N, ReactiveHead as R, Style as S, Title as T, UseHeadInput as U, VueHeadClient as V, UseHeadOptions as a, UseSeoMetaInput as b, TitleTemplate as c, Base as d, Script as e, HtmlAttributes as f, BodyAttributes as g, MaybeFalsey as h, ResolvableValue as i, ResolvableArray as j, ResolvableProperties as k };
@@ -0,0 +1,133 @@
1
+ import { Falsey, MergeHead, Unhead, Stringable, SchemaAugmentations, TitleTemplate as TitleTemplate$1, EntryAugmentation, Base as Base$1, DefinedValueOrEmptyObject, LinkBase, DataKeys, MaybeEventFnHandlers, HttpEventAttributes, BaseMeta, Style as Style$1, ScriptBase, Noscript as Noscript$1, BaseHtmlAttr, MaybeArray, BaseBodyAttr, BodyEvents, HeadEntryOptions, MetaFlatInput } from 'unhead/types';
2
+ import { ComputedRef, Ref, CSSProperties, Plugin } from 'vue';
3
+
4
+ type MaybeFalsey<T> = T | Falsey;
5
+ type ResolvableValue<T> = MaybeFalsey<T> | (() => MaybeFalsey<T>) | ComputedRef<MaybeFalsey<T>> | Ref<MaybeFalsey<T>>;
6
+ type ResolvableArray<T> = ResolvableValue<ResolvableValue<T>[]>;
7
+ type ResolvableProperties<T> = {
8
+ [key in keyof T]?: ResolvableValue<T[key]>;
9
+ };
10
+
11
+ interface HtmlAttr extends Omit<BaseHtmlAttr, 'class' | 'style'> {
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<ResolvableValue<Falsey | Stringable> | Record<string, ResolvableValue<Falsey | Stringable>>>;
18
+ /**
19
+ * The class global attribute is a space-separated list of the case-sensitive classes of the element.
20
+ *
21
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/class
22
+ */
23
+ style?: MaybeArray<ResolvableValue<Falsey | Stringable> | ResolvableProperties<CSSProperties>>;
24
+ }
25
+ interface BodyAttr extends Omit<BaseBodyAttr, 'class' | 'style'> {
26
+ /**
27
+ * The class global attribute is a space-separated list of the case-sensitive classes of the element.
28
+ *
29
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/class
30
+ */
31
+ class?: MaybeArray<ResolvableValue<Falsey | Stringable>> | Record<string, ResolvableValue<Falsey | Stringable>>;
32
+ /**
33
+ * The class global attribute is a space-separated list of the case-sensitive classes of the element.
34
+ *
35
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/class
36
+ */
37
+ style?: MaybeArray<ResolvableValue<string>> | ResolvableProperties<CSSProperties>;
38
+ }
39
+ type Title = ResolvableValue<Stringable | Falsey> | ResolvableProperties<({
40
+ textContent: Stringable;
41
+ } & SchemaAugmentations['title'])>;
42
+ type TitleTemplate = TitleTemplate$1 | Ref<TitleTemplate$1> | ((title?: string) => TitleTemplate$1);
43
+ type Base<E extends EntryAugmentation = Record<string, any>> = ResolvableProperties<Base$1 & SchemaAugmentations['base']> & DefinedValueOrEmptyObject<E>;
44
+ type Link<E extends EntryAugmentation = Record<string, any>> = ResolvableProperties<LinkBase & DataKeys & SchemaAugmentations['link']> & MaybeEventFnHandlers<HttpEventAttributes> & DefinedValueOrEmptyObject<E>;
45
+ type Meta<E extends EntryAugmentation = Record<string, any>> = ResolvableProperties<BaseMeta & DataKeys & SchemaAugmentations['meta']> & DefinedValueOrEmptyObject<E>;
46
+ type Style<E extends EntryAugmentation = Record<string, any>> = ResolvableProperties<Style$1 & DataKeys & SchemaAugmentations['style']> & DefinedValueOrEmptyObject<E>;
47
+ type Script<E extends EntryAugmentation = Record<string, any>> = ResolvableProperties<ScriptBase & DataKeys & SchemaAugmentations['script']> & MaybeEventFnHandlers<HttpEventAttributes> & DefinedValueOrEmptyObject<E>;
48
+ type Noscript<E extends EntryAugmentation = Record<string, any>> = ResolvableProperties<Noscript$1 & DataKeys & SchemaAugmentations['noscript']> & DefinedValueOrEmptyObject<E>;
49
+ type HtmlAttributes<E extends EntryAugmentation = Record<string, any>> = ResolvableProperties<HtmlAttr & DataKeys & SchemaAugmentations['htmlAttrs']> & DefinedValueOrEmptyObject<E>;
50
+ type BodyAttributes<E extends EntryAugmentation = Record<string, any>> = ResolvableProperties<BodyAttr & DataKeys & SchemaAugmentations['bodyAttrs']> & MaybeEventFnHandlers<BodyEvents> & DefinedValueOrEmptyObject<E>;
51
+ interface ReactiveHead<E extends MergeHead = MergeHead> {
52
+ /**
53
+ * The `<title>` HTML element defines the document's title that is shown in a browser's title bar or a page's tab.
54
+ * It only contains text; tags within the element are ignored.
55
+ *
56
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/title
57
+ */
58
+ title?: Title;
59
+ /**
60
+ * Generate the title from a template.
61
+ */
62
+ titleTemplate?: TitleTemplate;
63
+ /**
64
+ * Variables used to substitute in the title and meta content.
65
+ */
66
+ templateParams?: ResolvableProperties<{
67
+ separator?: '|' | '-' | '·' | string;
68
+ } & Record<string, Stringable | Falsey | ResolvableProperties<Record<string, Stringable | Falsey>>>>;
69
+ /**
70
+ * The `<base>` HTML element specifies the base URL to use for all relative URLs in a document.
71
+ * There can be only one <base> element in a document.
72
+ *
73
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base
74
+ */
75
+ base?: Base<E['base']>;
76
+ /**
77
+ * The `<link>` HTML element specifies relationships between the current document and an external resource.
78
+ * This element is most commonly used to link to stylesheets, but is also used to establish site icons
79
+ * (both "favicon" style icons and icons for the home screen and apps on mobile devices) among other things.
80
+ *
81
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-as
82
+ */
83
+ link?: ResolvableArray<Link<E['link']>>;
84
+ /**
85
+ * The `<meta>` element represents metadata that cannot be expressed in other HTML elements, like `<link>` or `<script>`.
86
+ *
87
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta
88
+ */
89
+ meta?: ResolvableArray<Meta<E['meta']>>;
90
+ /**
91
+ * The `<style>` HTML element contains style information for a document, or part of a document.
92
+ * It contains CSS, which is applied to the contents of the document containing the `<style>` element.
93
+ *
94
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/style
95
+ */
96
+ style?: ResolvableArray<(Style<E['style']> | string)>;
97
+ /**
98
+ * The `<script>` HTML element is used to embed executable code or data; this is typically used to embed or refer to JavaScript code.
99
+ *
100
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script
101
+ */
102
+ script?: ResolvableArray<(Script<E['script']> | string)>;
103
+ /**
104
+ * The `<noscript>` HTML element defines a section of HTML to be inserted if a script type on the page is unsupported
105
+ * or if scripting is currently turned off in the browser.
106
+ *
107
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/noscript
108
+ */
109
+ noscript?: ResolvableArray<(Noscript<E['noscript']> | string)>;
110
+ /**
111
+ * Attributes for the `<html>` HTML element.
112
+ *
113
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/html
114
+ */
115
+ htmlAttrs?: HtmlAttributes<E['htmlAttrs']>;
116
+ /**
117
+ * Attributes for the `<body>` HTML element.
118
+ *
119
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/body
120
+ */
121
+ bodyAttrs?: BodyAttributes<E['bodyAttrs']>;
122
+ }
123
+ type UseHeadOptions = Omit<HeadEntryOptions, 'head'> & {
124
+ head?: VueHeadClient<any>;
125
+ };
126
+ type UseHeadInput<T extends MergeHead = Record<string, any>> = ResolvableValue<ReactiveHead<T>>;
127
+ type UseSeoMetaInput = ResolvableProperties<MetaFlatInput> & {
128
+ title?: ReactiveHead['title'];
129
+ titleTemplate?: ReactiveHead['titleTemplate'];
130
+ };
131
+ type VueHeadClient<T extends MergeHead> = Unhead<ResolvableValue<ReactiveHead<T>>> & Plugin;
132
+
133
+ export type { BodyAttr as B, HtmlAttr as H, Link as L, Meta as M, Noscript as N, ReactiveHead as R, Style as S, Title as T, UseHeadInput as U, VueHeadClient as V, UseHeadOptions as a, UseSeoMetaInput as b, TitleTemplate as c, Base as d, Script as e, HtmlAttributes as f, BodyAttributes as g, MaybeFalsey as h, ResolvableValue as i, ResolvableArray as j, ResolvableProperties as k };
@@ -1,5 +1,5 @@
1
1
  import { getCurrentInstance } from 'vue';
2
- import { u as useHead } from './vue.pWToN6_t.mjs';
2
+ import { u as useHead } from './vue.j4SPrdI5.mjs';
3
3
 
4
4
  const VueHeadMixin = {
5
5
  created() {
@@ -1,4 +1,4 @@
1
- import { isRef, toValue } from 'vue';
1
+ import { toValue, isRef } from 'vue';
2
2
 
3
3
  const VueResolver = (_, value) => {
4
4
  return isRef(value) ? toValue(value) : value;
@@ -1,7 +1,7 @@
1
1
  import { SafeInputPlugin, FlatMetaPlugin } from 'unhead/plugins';
2
2
  import { walkResolver } from 'unhead/utils';
3
3
  import { hasInjectionContext, inject, ref, watchEffect, getCurrentInstance, onBeforeUnmount, onDeactivated, onActivated } from 'vue';
4
- import { V as VueResolver } from './vue.CkLIG7eN.mjs';
4
+ import { V as VueResolver } from './vue.N9zWjxoK.mjs';
5
5
 
6
6
  const headSymbol = "usehead";
7
7
  function vueInstall(head) {
@@ -25,7 +25,7 @@ function injectHead() {
25
25
  }
26
26
  throw new Error("useHead() was called without provide context, ensure you call it through the setup() function.");
27
27
  }
28
- function useHead(input, options = {}) {
28
+ function useHead(input = {}, options = {}) {
29
29
  const head = options.head || injectHead();
30
30
  return head.ssr ? head.push(input, options) : clientUseHead(head, input, options);
31
31
  }
@@ -54,13 +54,13 @@ function clientUseHead(head, input, options = {}) {
54
54
  }
55
55
  return entry;
56
56
  }
57
- function useHeadSafe(input, options = {}) {
57
+ function useHeadSafe(input = {}, options = {}) {
58
58
  const head = options.head || injectHead();
59
59
  head.use(SafeInputPlugin);
60
60
  options._safe = true;
61
61
  return useHead(input, options);
62
62
  }
63
- function useSeoMeta(input, options = {}) {
63
+ function useSeoMeta(input = {}, options = {}) {
64
64
  const head = options.head || injectHead();
65
65
  head.use(FlatMetaPlugin);
66
66
  const { title, titleTemplate, ...meta } = input;
@@ -71,13 +71,13 @@ function useSeoMeta(input, options = {}) {
71
71
  _flatMeta: meta
72
72
  }, options);
73
73
  }
74
- function useServerHead(input, options = {}) {
74
+ function useServerHead(input = {}, options = {}) {
75
75
  return useHead(input, { ...options, mode: "server" });
76
76
  }
77
- function useServerHeadSafe(input, options = {}) {
77
+ function useServerHeadSafe(input = {}, options = {}) {
78
78
  return useHeadSafe(input, { ...options, mode: "server" });
79
79
  }
80
- function useServerSeoMeta(input, options) {
80
+ function useServerSeoMeta(input = {}, options) {
81
81
  return useSeoMeta(input, { ...options, mode: "server" });
82
82
  }
83
83
 
package/dist/types.d.mts CHANGED
@@ -1,23 +1,18 @@
1
- import { Falsey, BodyAttributes as BodyAttributes$1, DataKeys, SchemaAugmentations, HtmlAttributes as HtmlAttributes$1, BaseMeta, LinkBase, ScriptBase, Noscript as Noscript$1, Style as Style$1, Head, BaseHtmlAttr, MaybeArray, Stringable, BaseBodyAttr, TitleTemplate as TitleTemplate$1, EntryAugmentation, Base as Base$1, DefinedValueOrEmptyObject, MaybeEventFnHandlers, HttpEventAttributes, BodyEvents, MergeHead, HeadEntryOptions, MetaFlatInput, Unhead } from 'unhead/types';
1
+ import { Head, LinkBase, DataKeys, SchemaAugmentations, BaseMeta, Style, ScriptBase, Noscript, HtmlAttributes, BodyAttributes } from 'unhead/types';
2
2
  export { ActiveHeadEntry, Head, HeadEntryOptions, HeadTag, MergeHead, RenderSSRHeadOptions, ResolvedBase, ResolvedBodyAttributes, ResolvedHead, ResolvedHtmlAttributes, ResolvedLink, ResolvedMeta, ResolvedNoscript, ResolvedScript, ResolvedStyle, ResolvedTitle, ResolvedTitleTemplate, Unhead } from 'unhead/types';
3
- import { ComputedRef, Ref, CSSProperties, Plugin } from 'vue';
3
+ import { i as ResolvableValue, k as ResolvableProperties } from './shared/vue.C97gXjQS.mjs';
4
+ export { d as Base, B as BodyAttr, g as BodyAttributes, H as HtmlAttr, f as HtmlAttributes, L as Link, h as MaybeFalsey, M as Meta, N as Noscript, R as ReactiveHead, j as ResolvableArray, e as Script, S as Style, T as Title, c as TitleTemplate, U as UseHeadInput, a as UseHeadOptions, b as UseSeoMetaInput, V as VueHeadClient } from './shared/vue.C97gXjQS.mjs';
5
+ import 'vue';
4
6
 
5
- type MaybeFalsey<T> = T | Falsey;
6
- type ResolvableValue<T> = MaybeFalsey<T> | (() => MaybeFalsey<T>) | ComputedRef<MaybeFalsey<T>> | Ref<MaybeFalsey<T>>;
7
- type ResolvableArray<T> = ResolvableValue<ResolvableValue<T>[]>;
8
- type ResolvableProperties<T> = {
9
- [key in keyof T]?: ResolvableValue<T[key]>;
10
- };
11
-
12
- type SafeBodyAttr = ResolvableProperties<Pick<BodyAttributes$1, 'id' | 'class' | 'style'> & DataKeys & SchemaAugmentations['bodyAttrs']>;
13
- type SafeHtmlAttr = ResolvableProperties<Pick<HtmlAttributes$1, 'id' | 'class' | 'style' | 'lang' | 'dir'> & DataKeys & SchemaAugmentations['htmlAttrs']>;
7
+ type SafeBodyAttr = ResolvableProperties<Pick<BodyAttributes, 'id' | 'class' | 'style'> & DataKeys & SchemaAugmentations['bodyAttrs']>;
8
+ type SafeHtmlAttr = ResolvableProperties<Pick<HtmlAttributes, 'id' | 'class' | 'style' | 'lang' | 'dir'> & DataKeys & SchemaAugmentations['htmlAttrs']>;
14
9
  type SafeMeta = ResolvableProperties<Pick<BaseMeta, 'id' | 'name' | 'property' | 'charset' | 'content' | 'media'> & DataKeys & SchemaAugmentations['meta']>;
15
10
  type SafeLink = ResolvableProperties<Pick<LinkBase, 'id' | 'color' | 'crossorigin' | 'fetchpriority' | 'href' | 'hreflang' | 'imagesrcset' | 'imagesizes' | 'integrity' | 'media' | 'referrerpolicy' | 'rel' | 'sizes' | 'type'> & DataKeys & SchemaAugmentations['link']>;
16
11
  type SafeScript = ResolvableProperties<Pick<ScriptBase, 'id' | 'type' | 'nonce' | 'blocking'> & DataKeys & {
17
12
  textContent?: string;
18
13
  } & SchemaAugmentations['script']>;
19
- type SafeNoscript = ResolvableProperties<Pick<Noscript$1, 'id' | 'textContent'> & DataKeys & SchemaAugmentations['noscript']>;
20
- type SafeStyle = ResolvableProperties<Pick<Style$1, 'id' | 'media' | 'textContent' | 'nonce' | 'title' | 'blocking'> & DataKeys & SchemaAugmentations['style']>;
14
+ type SafeNoscript = ResolvableProperties<Pick<Noscript, 'id' | 'textContent'> & DataKeys & SchemaAugmentations['noscript']>;
15
+ type SafeStyle = ResolvableProperties<Pick<Style, 'id' | 'media' | 'textContent' | 'nonce' | 'title' | 'blocking'> & DataKeys & SchemaAugmentations['style']>;
21
16
  interface HeadSafe extends Pick<Head, 'title' | 'titleTemplate' | 'templateParams'> {
22
17
  /**
23
18
  * The `<link>` HTML element specifies relationships between the current document and an external resource.
@@ -68,126 +63,4 @@ interface HeadSafe extends Pick<Head, 'title' | 'titleTemplate' | 'templateParam
68
63
  }
69
64
  type UseHeadSafeInput = ResolvableValue<HeadSafe>;
70
65
 
71
- interface HtmlAttr extends Omit<BaseHtmlAttr, 'class' | 'style'> {
72
- /**
73
- * The class global attribute is a space-separated list of the case-sensitive classes of the element.
74
- *
75
- * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/class
76
- */
77
- class?: MaybeArray<ResolvableValue<Falsey | Stringable> | Record<string, ResolvableValue<Falsey | Stringable>>>;
78
- /**
79
- * The class global attribute is a space-separated list of the case-sensitive classes of the element.
80
- *
81
- * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/class
82
- */
83
- style?: MaybeArray<ResolvableValue<Falsey | Stringable> | ResolvableProperties<CSSProperties>>;
84
- }
85
- interface BodyAttr extends Omit<BaseBodyAttr, 'class' | 'style'> {
86
- /**
87
- * The class global attribute is a space-separated list of the case-sensitive classes of the element.
88
- *
89
- * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/class
90
- */
91
- class?: MaybeArray<ResolvableValue<Falsey | Stringable>> | Record<string, ResolvableValue<Falsey | Stringable>>;
92
- /**
93
- * The class global attribute is a space-separated list of the case-sensitive classes of the element.
94
- *
95
- * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/class
96
- */
97
- style?: MaybeArray<ResolvableValue<string>> | ResolvableProperties<CSSProperties>;
98
- }
99
- type Title = ResolvableValue<Stringable | Falsey> | ResolvableProperties<({
100
- textContent: Stringable;
101
- } & SchemaAugmentations['title'])>;
102
- type TitleTemplate = TitleTemplate$1 | Ref<TitleTemplate$1> | ((title?: string) => TitleTemplate$1);
103
- type Base<E extends EntryAugmentation = Record<string, any>> = ResolvableProperties<Base$1 & SchemaAugmentations['base']> & DefinedValueOrEmptyObject<E>;
104
- type Link<E extends EntryAugmentation = Record<string, any>> = ResolvableProperties<LinkBase & DataKeys & SchemaAugmentations['link']> & MaybeEventFnHandlers<HttpEventAttributes> & DefinedValueOrEmptyObject<E>;
105
- type Meta<E extends EntryAugmentation = Record<string, any>> = ResolvableProperties<BaseMeta & DataKeys & SchemaAugmentations['meta']> & DefinedValueOrEmptyObject<E>;
106
- type Style<E extends EntryAugmentation = Record<string, any>> = ResolvableProperties<Style$1 & DataKeys & SchemaAugmentations['style']> & DefinedValueOrEmptyObject<E>;
107
- type Script<E extends EntryAugmentation = Record<string, any>> = ResolvableProperties<ScriptBase & DataKeys & SchemaAugmentations['script']> & MaybeEventFnHandlers<HttpEventAttributes> & DefinedValueOrEmptyObject<E>;
108
- type Noscript<E extends EntryAugmentation = Record<string, any>> = ResolvableProperties<Noscript$1 & DataKeys & SchemaAugmentations['noscript']> & DefinedValueOrEmptyObject<E>;
109
- type HtmlAttributes<E extends EntryAugmentation = Record<string, any>> = ResolvableProperties<HtmlAttr & DataKeys & SchemaAugmentations['htmlAttrs']> & DefinedValueOrEmptyObject<E>;
110
- type BodyAttributes<E extends EntryAugmentation = Record<string, any>> = ResolvableProperties<BodyAttr & DataKeys & SchemaAugmentations['bodyAttrs']> & MaybeEventFnHandlers<BodyEvents> & DefinedValueOrEmptyObject<E>;
111
- interface ReactiveHead<E extends MergeHead = MergeHead> {
112
- /**
113
- * The `<title>` HTML element defines the document's title that is shown in a browser's title bar or a page's tab.
114
- * It only contains text; tags within the element are ignored.
115
- *
116
- * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/title
117
- */
118
- title?: Title;
119
- /**
120
- * Generate the title from a template.
121
- */
122
- titleTemplate?: TitleTemplate;
123
- /**
124
- * Variables used to substitute in the title and meta content.
125
- */
126
- templateParams?: ResolvableProperties<{
127
- separator?: '|' | '-' | '·' | string;
128
- } & Record<string, Stringable | Falsey | ResolvableProperties<Record<string, Stringable | Falsey>>>>;
129
- /**
130
- * The `<base>` HTML element specifies the base URL to use for all relative URLs in a document.
131
- * There can be only one <base> element in a document.
132
- *
133
- * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base
134
- */
135
- base?: Base<E['base']>;
136
- /**
137
- * The `<link>` HTML element specifies relationships between the current document and an external resource.
138
- * This element is most commonly used to link to stylesheets, but is also used to establish site icons
139
- * (both "favicon" style icons and icons for the home screen and apps on mobile devices) among other things.
140
- *
141
- * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-as
142
- */
143
- link?: ResolvableArray<Link<E['link']>>;
144
- /**
145
- * The `<meta>` element represents metadata that cannot be expressed in other HTML elements, like `<link>` or `<script>`.
146
- *
147
- * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta
148
- */
149
- meta?: ResolvableArray<Meta<E['meta']>>;
150
- /**
151
- * The `<style>` HTML element contains style information for a document, or part of a document.
152
- * It contains CSS, which is applied to the contents of the document containing the `<style>` element.
153
- *
154
- * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/style
155
- */
156
- style?: ResolvableArray<(Style<E['style']> | string)>;
157
- /**
158
- * The `<script>` HTML element is used to embed executable code or data; this is typically used to embed or refer to JavaScript code.
159
- *
160
- * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script
161
- */
162
- script?: ResolvableArray<(Script<E['script']> | string)>;
163
- /**
164
- * The `<noscript>` HTML element defines a section of HTML to be inserted if a script type on the page is unsupported
165
- * or if scripting is currently turned off in the browser.
166
- *
167
- * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/noscript
168
- */
169
- noscript?: ResolvableArray<(Noscript<E['noscript']> | string)>;
170
- /**
171
- * Attributes for the `<html>` HTML element.
172
- *
173
- * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/html
174
- */
175
- htmlAttrs?: HtmlAttributes<E['htmlAttrs']>;
176
- /**
177
- * Attributes for the `<body>` HTML element.
178
- *
179
- * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/body
180
- */
181
- bodyAttrs?: BodyAttributes<E['bodyAttrs']>;
182
- }
183
- type UseHeadOptions = Omit<HeadEntryOptions, 'head'> & {
184
- head?: VueHeadClient<any>;
185
- };
186
- type UseHeadInput<T extends MergeHead = Record<string, any>> = ResolvableValue<ReactiveHead<T>>;
187
- type UseSeoMetaInput = ResolvableProperties<MetaFlatInput> & {
188
- title?: ReactiveHead['title'];
189
- titleTemplate?: ReactiveHead['titleTemplate'];
190
- };
191
- type VueHeadClient<T extends MergeHead> = Unhead<ResolvableValue<ReactiveHead<T>>> & Plugin;
192
-
193
- export type { Base, BodyAttr, BodyAttributes, HeadSafe, HtmlAttr, HtmlAttributes, Link, MaybeFalsey, Meta, Noscript, ReactiveHead, ResolvableArray, ResolvableProperties, ResolvableValue, SafeBodyAttr, SafeHtmlAttr, SafeLink, SafeMeta, SafeNoscript, SafeScript, SafeStyle, Script, Style, Title, TitleTemplate, UseHeadInput, UseHeadOptions, UseHeadSafeInput, UseSeoMetaInput, VueHeadClient };
66
+ export { type HeadSafe, ResolvableProperties, ResolvableValue, type SafeBodyAttr, type SafeHtmlAttr, type SafeLink, type SafeMeta, type SafeNoscript, type SafeScript, type SafeStyle, type UseHeadSafeInput };
package/dist/types.d.ts CHANGED
@@ -1,23 +1,18 @@
1
- import { Falsey, BodyAttributes as BodyAttributes$1, DataKeys, SchemaAugmentations, HtmlAttributes as HtmlAttributes$1, BaseMeta, LinkBase, ScriptBase, Noscript as Noscript$1, Style as Style$1, Head, BaseHtmlAttr, MaybeArray, Stringable, BaseBodyAttr, TitleTemplate as TitleTemplate$1, EntryAugmentation, Base as Base$1, DefinedValueOrEmptyObject, MaybeEventFnHandlers, HttpEventAttributes, BodyEvents, MergeHead, HeadEntryOptions, MetaFlatInput, Unhead } from 'unhead/types';
1
+ import { Head, LinkBase, DataKeys, SchemaAugmentations, BaseMeta, Style, ScriptBase, Noscript, HtmlAttributes, BodyAttributes } from 'unhead/types';
2
2
  export { ActiveHeadEntry, Head, HeadEntryOptions, HeadTag, MergeHead, RenderSSRHeadOptions, ResolvedBase, ResolvedBodyAttributes, ResolvedHead, ResolvedHtmlAttributes, ResolvedLink, ResolvedMeta, ResolvedNoscript, ResolvedScript, ResolvedStyle, ResolvedTitle, ResolvedTitleTemplate, Unhead } from 'unhead/types';
3
- import { ComputedRef, Ref, CSSProperties, Plugin } from 'vue';
3
+ import { i as ResolvableValue, k as ResolvableProperties } from './shared/vue.C97gXjQS.js';
4
+ export { d as Base, B as BodyAttr, g as BodyAttributes, H as HtmlAttr, f as HtmlAttributes, L as Link, h as MaybeFalsey, M as Meta, N as Noscript, R as ReactiveHead, j as ResolvableArray, e as Script, S as Style, T as Title, c as TitleTemplate, U as UseHeadInput, a as UseHeadOptions, b as UseSeoMetaInput, V as VueHeadClient } from './shared/vue.C97gXjQS.js';
5
+ import 'vue';
4
6
 
5
- type MaybeFalsey<T> = T | Falsey;
6
- type ResolvableValue<T> = MaybeFalsey<T> | (() => MaybeFalsey<T>) | ComputedRef<MaybeFalsey<T>> | Ref<MaybeFalsey<T>>;
7
- type ResolvableArray<T> = ResolvableValue<ResolvableValue<T>[]>;
8
- type ResolvableProperties<T> = {
9
- [key in keyof T]?: ResolvableValue<T[key]>;
10
- };
11
-
12
- type SafeBodyAttr = ResolvableProperties<Pick<BodyAttributes$1, 'id' | 'class' | 'style'> & DataKeys & SchemaAugmentations['bodyAttrs']>;
13
- type SafeHtmlAttr = ResolvableProperties<Pick<HtmlAttributes$1, 'id' | 'class' | 'style' | 'lang' | 'dir'> & DataKeys & SchemaAugmentations['htmlAttrs']>;
7
+ type SafeBodyAttr = ResolvableProperties<Pick<BodyAttributes, 'id' | 'class' | 'style'> & DataKeys & SchemaAugmentations['bodyAttrs']>;
8
+ type SafeHtmlAttr = ResolvableProperties<Pick<HtmlAttributes, 'id' | 'class' | 'style' | 'lang' | 'dir'> & DataKeys & SchemaAugmentations['htmlAttrs']>;
14
9
  type SafeMeta = ResolvableProperties<Pick<BaseMeta, 'id' | 'name' | 'property' | 'charset' | 'content' | 'media'> & DataKeys & SchemaAugmentations['meta']>;
15
10
  type SafeLink = ResolvableProperties<Pick<LinkBase, 'id' | 'color' | 'crossorigin' | 'fetchpriority' | 'href' | 'hreflang' | 'imagesrcset' | 'imagesizes' | 'integrity' | 'media' | 'referrerpolicy' | 'rel' | 'sizes' | 'type'> & DataKeys & SchemaAugmentations['link']>;
16
11
  type SafeScript = ResolvableProperties<Pick<ScriptBase, 'id' | 'type' | 'nonce' | 'blocking'> & DataKeys & {
17
12
  textContent?: string;
18
13
  } & SchemaAugmentations['script']>;
19
- type SafeNoscript = ResolvableProperties<Pick<Noscript$1, 'id' | 'textContent'> & DataKeys & SchemaAugmentations['noscript']>;
20
- type SafeStyle = ResolvableProperties<Pick<Style$1, 'id' | 'media' | 'textContent' | 'nonce' | 'title' | 'blocking'> & DataKeys & SchemaAugmentations['style']>;
14
+ type SafeNoscript = ResolvableProperties<Pick<Noscript, 'id' | 'textContent'> & DataKeys & SchemaAugmentations['noscript']>;
15
+ type SafeStyle = ResolvableProperties<Pick<Style, 'id' | 'media' | 'textContent' | 'nonce' | 'title' | 'blocking'> & DataKeys & SchemaAugmentations['style']>;
21
16
  interface HeadSafe extends Pick<Head, 'title' | 'titleTemplate' | 'templateParams'> {
22
17
  /**
23
18
  * The `<link>` HTML element specifies relationships between the current document and an external resource.
@@ -68,126 +63,4 @@ interface HeadSafe extends Pick<Head, 'title' | 'titleTemplate' | 'templateParam
68
63
  }
69
64
  type UseHeadSafeInput = ResolvableValue<HeadSafe>;
70
65
 
71
- interface HtmlAttr extends Omit<BaseHtmlAttr, 'class' | 'style'> {
72
- /**
73
- * The class global attribute is a space-separated list of the case-sensitive classes of the element.
74
- *
75
- * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/class
76
- */
77
- class?: MaybeArray<ResolvableValue<Falsey | Stringable> | Record<string, ResolvableValue<Falsey | Stringable>>>;
78
- /**
79
- * The class global attribute is a space-separated list of the case-sensitive classes of the element.
80
- *
81
- * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/class
82
- */
83
- style?: MaybeArray<ResolvableValue<Falsey | Stringable> | ResolvableProperties<CSSProperties>>;
84
- }
85
- interface BodyAttr extends Omit<BaseBodyAttr, 'class' | 'style'> {
86
- /**
87
- * The class global attribute is a space-separated list of the case-sensitive classes of the element.
88
- *
89
- * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/class
90
- */
91
- class?: MaybeArray<ResolvableValue<Falsey | Stringable>> | Record<string, ResolvableValue<Falsey | Stringable>>;
92
- /**
93
- * The class global attribute is a space-separated list of the case-sensitive classes of the element.
94
- *
95
- * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/class
96
- */
97
- style?: MaybeArray<ResolvableValue<string>> | ResolvableProperties<CSSProperties>;
98
- }
99
- type Title = ResolvableValue<Stringable | Falsey> | ResolvableProperties<({
100
- textContent: Stringable;
101
- } & SchemaAugmentations['title'])>;
102
- type TitleTemplate = TitleTemplate$1 | Ref<TitleTemplate$1> | ((title?: string) => TitleTemplate$1);
103
- type Base<E extends EntryAugmentation = Record<string, any>> = ResolvableProperties<Base$1 & SchemaAugmentations['base']> & DefinedValueOrEmptyObject<E>;
104
- type Link<E extends EntryAugmentation = Record<string, any>> = ResolvableProperties<LinkBase & DataKeys & SchemaAugmentations['link']> & MaybeEventFnHandlers<HttpEventAttributes> & DefinedValueOrEmptyObject<E>;
105
- type Meta<E extends EntryAugmentation = Record<string, any>> = ResolvableProperties<BaseMeta & DataKeys & SchemaAugmentations['meta']> & DefinedValueOrEmptyObject<E>;
106
- type Style<E extends EntryAugmentation = Record<string, any>> = ResolvableProperties<Style$1 & DataKeys & SchemaAugmentations['style']> & DefinedValueOrEmptyObject<E>;
107
- type Script<E extends EntryAugmentation = Record<string, any>> = ResolvableProperties<ScriptBase & DataKeys & SchemaAugmentations['script']> & MaybeEventFnHandlers<HttpEventAttributes> & DefinedValueOrEmptyObject<E>;
108
- type Noscript<E extends EntryAugmentation = Record<string, any>> = ResolvableProperties<Noscript$1 & DataKeys & SchemaAugmentations['noscript']> & DefinedValueOrEmptyObject<E>;
109
- type HtmlAttributes<E extends EntryAugmentation = Record<string, any>> = ResolvableProperties<HtmlAttr & DataKeys & SchemaAugmentations['htmlAttrs']> & DefinedValueOrEmptyObject<E>;
110
- type BodyAttributes<E extends EntryAugmentation = Record<string, any>> = ResolvableProperties<BodyAttr & DataKeys & SchemaAugmentations['bodyAttrs']> & MaybeEventFnHandlers<BodyEvents> & DefinedValueOrEmptyObject<E>;
111
- interface ReactiveHead<E extends MergeHead = MergeHead> {
112
- /**
113
- * The `<title>` HTML element defines the document's title that is shown in a browser's title bar or a page's tab.
114
- * It only contains text; tags within the element are ignored.
115
- *
116
- * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/title
117
- */
118
- title?: Title;
119
- /**
120
- * Generate the title from a template.
121
- */
122
- titleTemplate?: TitleTemplate;
123
- /**
124
- * Variables used to substitute in the title and meta content.
125
- */
126
- templateParams?: ResolvableProperties<{
127
- separator?: '|' | '-' | '·' | string;
128
- } & Record<string, Stringable | Falsey | ResolvableProperties<Record<string, Stringable | Falsey>>>>;
129
- /**
130
- * The `<base>` HTML element specifies the base URL to use for all relative URLs in a document.
131
- * There can be only one <base> element in a document.
132
- *
133
- * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base
134
- */
135
- base?: Base<E['base']>;
136
- /**
137
- * The `<link>` HTML element specifies relationships between the current document and an external resource.
138
- * This element is most commonly used to link to stylesheets, but is also used to establish site icons
139
- * (both "favicon" style icons and icons for the home screen and apps on mobile devices) among other things.
140
- *
141
- * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-as
142
- */
143
- link?: ResolvableArray<Link<E['link']>>;
144
- /**
145
- * The `<meta>` element represents metadata that cannot be expressed in other HTML elements, like `<link>` or `<script>`.
146
- *
147
- * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta
148
- */
149
- meta?: ResolvableArray<Meta<E['meta']>>;
150
- /**
151
- * The `<style>` HTML element contains style information for a document, or part of a document.
152
- * It contains CSS, which is applied to the contents of the document containing the `<style>` element.
153
- *
154
- * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/style
155
- */
156
- style?: ResolvableArray<(Style<E['style']> | string)>;
157
- /**
158
- * The `<script>` HTML element is used to embed executable code or data; this is typically used to embed or refer to JavaScript code.
159
- *
160
- * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script
161
- */
162
- script?: ResolvableArray<(Script<E['script']> | string)>;
163
- /**
164
- * The `<noscript>` HTML element defines a section of HTML to be inserted if a script type on the page is unsupported
165
- * or if scripting is currently turned off in the browser.
166
- *
167
- * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/noscript
168
- */
169
- noscript?: ResolvableArray<(Noscript<E['noscript']> | string)>;
170
- /**
171
- * Attributes for the `<html>` HTML element.
172
- *
173
- * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/html
174
- */
175
- htmlAttrs?: HtmlAttributes<E['htmlAttrs']>;
176
- /**
177
- * Attributes for the `<body>` HTML element.
178
- *
179
- * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/body
180
- */
181
- bodyAttrs?: BodyAttributes<E['bodyAttrs']>;
182
- }
183
- type UseHeadOptions = Omit<HeadEntryOptions, 'head'> & {
184
- head?: VueHeadClient<any>;
185
- };
186
- type UseHeadInput<T extends MergeHead = Record<string, any>> = ResolvableValue<ReactiveHead<T>>;
187
- type UseSeoMetaInput = ResolvableProperties<MetaFlatInput> & {
188
- title?: ReactiveHead['title'];
189
- titleTemplate?: ReactiveHead['titleTemplate'];
190
- };
191
- type VueHeadClient<T extends MergeHead> = Unhead<ResolvableValue<ReactiveHead<T>>> & Plugin;
192
-
193
- export type { Base, BodyAttr, BodyAttributes, HeadSafe, HtmlAttr, HtmlAttributes, Link, MaybeFalsey, Meta, Noscript, ReactiveHead, ResolvableArray, ResolvableProperties, ResolvableValue, SafeBodyAttr, SafeHtmlAttr, SafeLink, SafeMeta, SafeNoscript, SafeScript, SafeStyle, Script, Style, Title, TitleTemplate, UseHeadInput, UseHeadOptions, UseHeadSafeInput, UseSeoMetaInput, VueHeadClient };
66
+ export { type HeadSafe, ResolvableProperties, ResolvableValue, type SafeBodyAttr, type SafeHtmlAttr, type SafeLink, type SafeMeta, type SafeNoscript, type SafeScript, type SafeStyle, type UseHeadSafeInput };
package/dist/utils.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import { walkResolver } from 'unhead/utils';
2
2
  export * from 'unhead/utils';
3
- import { V as VueResolver } from './shared/vue.CkLIG7eN.mjs';
3
+ import { V as VueResolver } from './shared/vue.N9zWjxoK.mjs';
4
4
  import 'vue';
5
5
 
6
6
  function resolveUnrefHeadInput(input) {
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.16",
4
+ "version": "2.0.0-alpha.18",
5
5
  "description": "Full-stack <head> manager built for Vue.",
6
6
  "author": "Harlan Wilton <harlan@harlanzw.com>",
7
7
  "license": "MIT",
@@ -101,7 +101,7 @@
101
101
  },
102
102
  "dependencies": {
103
103
  "hookable": "^5.5.3",
104
- "unhead": "2.0.0-alpha.16"
104
+ "unhead": "2.0.0-alpha.18"
105
105
  },
106
106
  "scripts": {
107
107
  "build": "unbuild .",