@unhead/vue 2.0.0-alpha.25 → 2.0.0-alpha.27
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 +3 -3
- package/dist/client.d.ts +3 -3
- package/dist/client.mjs +2 -2
- package/dist/components.mjs +1 -1
- package/dist/index.d.mts +14 -14
- package/dist/index.d.ts +14 -14
- package/dist/index.mjs +6 -6
- package/dist/legacy.d.mts +9 -8
- package/dist/legacy.d.ts +9 -8
- package/dist/legacy.mjs +5 -4
- package/dist/scripts.d.mts +1 -1
- package/dist/scripts.d.ts +1 -1
- package/dist/scripts.mjs +4 -70
- package/dist/server.d.mts +3 -3
- package/dist/server.d.ts +3 -3
- package/dist/server.mjs +2 -2
- package/dist/shared/{vue.j4SPrdI5.mjs → vue.BYLJNEcq.mjs} +5 -6
- package/dist/shared/{vue.CZ-wp2QU.d.mts → vue.BkDIgqrM.d.mts} +29 -28
- package/dist/shared/{vue.CZ-wp2QU.d.ts → vue.BkDIgqrM.d.ts} +29 -28
- package/dist/shared/vue.cHBs6zvy.mjs +70 -0
- package/dist/shared/{vue.DBXhY4KI.mjs → vue.nvpYXC6D.mjs} +1 -1
- package/dist/types.d.mts +3 -3
- package/dist/types.d.ts +3 -3
- package/dist/utils.d.mts +2 -2
- package/dist/utils.d.ts +2 -2
- package/package.json +2 -2
package/dist/client.d.mts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CreateClientHeadOptions } from 'unhead/types';
|
|
2
2
|
export { V as VueHeadMixin } from './shared/vue.DnywREVF.mjs';
|
|
3
3
|
export { renderDOMHead } from 'unhead/client';
|
|
4
|
-
import { V as VueHeadClient } from './shared/vue.
|
|
4
|
+
import { V as VueHeadClient } from './shared/vue.BkDIgqrM.mjs';
|
|
5
5
|
import 'vue';
|
|
6
6
|
|
|
7
|
-
declare function createHead
|
|
7
|
+
declare function createHead(options?: CreateClientHeadOptions): VueHeadClient;
|
|
8
8
|
|
|
9
9
|
export { createHead };
|
package/dist/client.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CreateClientHeadOptions } from 'unhead/types';
|
|
2
2
|
export { V as VueHeadMixin } from './shared/vue.DnywREVF.js';
|
|
3
3
|
export { renderDOMHead } from 'unhead/client';
|
|
4
|
-
import { V as VueHeadClient } from './shared/vue.
|
|
4
|
+
import { V as VueHeadClient } from './shared/vue.BkDIgqrM.js';
|
|
5
5
|
import 'vue';
|
|
6
6
|
|
|
7
|
-
declare function createHead
|
|
7
|
+
declare function createHead(options?: CreateClientHeadOptions): VueHeadClient;
|
|
8
8
|
|
|
9
9
|
export { createHead };
|
package/dist/client.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
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.
|
|
5
|
-
export { V as VueHeadMixin } from './shared/vue.
|
|
4
|
+
import { v as vueInstall } from './shared/vue.BYLJNEcq.mjs';
|
|
5
|
+
export { V as VueHeadMixin } from './shared/vue.nvpYXC6D.mjs';
|
|
6
6
|
import 'unhead/plugins';
|
|
7
7
|
import 'unhead/utils';
|
|
8
8
|
import './shared/vue.N9zWjxoK.mjs';
|
package/dist/components.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent, ref, onBeforeUnmount, watchEffect } from 'vue';
|
|
2
|
-
import { u as useHead } from './shared/vue.
|
|
2
|
+
import { u as useHead } from './shared/vue.BYLJNEcq.mjs';
|
|
3
3
|
import 'unhead/plugins';
|
|
4
4
|
import 'unhead/utils';
|
|
5
5
|
import './shared/vue.N9zWjxoK.mjs';
|
package/dist/index.d.mts
CHANGED
|
@@ -1,31 +1,33 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export { d as Base, B as BodyAttr, g as BodyAttributes, H as HtmlAttr, f as HtmlAttributes, L as Link, i as MaybeFalsey, M as Meta, N as Noscript, h as ReactiveHead, k as ResolvableArray, R as ResolvableProperties, j as ResolvableValue, e as Script, S as Style, T as Title, c as TitleTemplate } from './shared/vue.CZ-wp2QU.mjs';
|
|
1
|
+
import { ActiveHeadEntry } from 'unhead/types';
|
|
2
|
+
export { ActiveHeadEntry, Head, HeadEntryOptions, HeadTag, NormalizedHead, RenderSSRHeadOptions, ResolvableHead, ResolvedBase, ResolvedBodyAttributes, ResolvedHtmlAttributes, ResolvedLink, ResolvedMeta, ResolvedNoscript, ResolvedScript, ResolvedStyle, ResolvedTitle, ResolvedTitleTemplate, SerializableHead, Unhead } from 'unhead/types';
|
|
3
|
+
import { V as VueHeadClient, U as UseHeadInput, a as UseHeadOptions, b as UseSeoMetaInput } from './shared/vue.BkDIgqrM.mjs';
|
|
4
|
+
export { d as Base, B as BodyAttr, g as BodyAttributes, H as HtmlAttr, f as HtmlAttributes, L as Link, h as MaybeFalsy, 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.BkDIgqrM.mjs';
|
|
6
5
|
import { UseHeadSafeInput } from './types.mjs';
|
|
7
6
|
export { HeadSafe, SafeBodyAttr, SafeHtmlAttr, SafeLink, SafeMeta, SafeNoscript, SafeScript, SafeStyle } from './types.mjs';
|
|
8
7
|
export { resolveUnrefHeadInput } from './utils.mjs';
|
|
9
8
|
export { V as VueHeadMixin } from './shared/vue.DnywREVF.mjs';
|
|
9
|
+
export { createUnhead } from 'unhead';
|
|
10
|
+
export { useScript } from './scripts.mjs';
|
|
10
11
|
import 'vue';
|
|
11
12
|
import 'unhead/utils';
|
|
13
|
+
import 'unhead/scripts';
|
|
12
14
|
|
|
13
15
|
declare const unheadVueComposablesImports: {
|
|
14
16
|
'@unhead/vue': string[];
|
|
15
17
|
};
|
|
16
18
|
|
|
17
|
-
declare function injectHead(): VueHeadClient
|
|
18
|
-
declare function useHead<
|
|
19
|
-
declare function useHeadSafe(input?: UseHeadSafeInput, options?: UseHeadOptions): ActiveHeadEntry<
|
|
20
|
-
declare function useSeoMeta(input?: UseSeoMetaInput, options?: UseHeadOptions): ActiveHeadEntry<
|
|
19
|
+
declare function injectHead(): VueHeadClient;
|
|
20
|
+
declare function useHead<I = UseHeadInput>(input?: I, options?: UseHeadOptions): ActiveHeadEntry<I>;
|
|
21
|
+
declare function useHeadSafe(input?: UseHeadSafeInput, options?: UseHeadOptions): ActiveHeadEntry<UseHeadSafeInput>;
|
|
22
|
+
declare function useSeoMeta(input?: UseSeoMetaInput, options?: UseHeadOptions): ActiveHeadEntry<UseSeoMetaInput>;
|
|
21
23
|
/**
|
|
22
24
|
* @deprecated use `useHead` instead.Advanced use cases should tree shake using import.meta.* if statements.
|
|
23
25
|
*/
|
|
24
|
-
declare function useServerHead<
|
|
26
|
+
declare function useServerHead<I = UseHeadInput>(input?: I, options?: UseHeadOptions): ActiveHeadEntry<I>;
|
|
25
27
|
/**
|
|
26
28
|
* @deprecated use `useHeadSafe` instead.Advanced use cases should tree shake using import.meta.* if statements.
|
|
27
29
|
*/
|
|
28
|
-
declare function useServerHeadSafe(input?: UseHeadSafeInput, options?: UseHeadOptions): ActiveHeadEntry<
|
|
30
|
+
declare function useServerHeadSafe(input?: UseHeadSafeInput, options?: UseHeadOptions): ActiveHeadEntry<UseHeadSafeInput>;
|
|
29
31
|
/**
|
|
30
32
|
* @deprecated use `useSeoMeta` instead.Advanced use cases should tree shake using import.meta.* if statements.
|
|
31
33
|
*/
|
|
@@ -33,6 +35,4 @@ declare function useServerSeoMeta(input?: UseSeoMetaInput, options?: UseHeadOpti
|
|
|
33
35
|
|
|
34
36
|
declare const headSymbol = "usehead";
|
|
35
37
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
export { CapoPlugin, UseHeadInput, UseHeadOptions, UseHeadSafeInput, UseSeoMetaInput, VueHeadClient, headSymbol, injectHead, unheadVueComposablesImports, useHead, useHeadSafe, useSeoMeta, useServerHead, useServerHeadSafe, useServerSeoMeta };
|
|
38
|
+
export { UseHeadInput, UseHeadOptions, UseHeadSafeInput, UseSeoMetaInput, VueHeadClient, headSymbol, injectHead, unheadVueComposablesImports, useHead, useHeadSafe, useSeoMeta, useServerHead, useServerHeadSafe, useServerSeoMeta };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,31 +1,33 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export { d as Base, B as BodyAttr, g as BodyAttributes, H as HtmlAttr, f as HtmlAttributes, L as Link, i as MaybeFalsey, M as Meta, N as Noscript, h as ReactiveHead, k as ResolvableArray, R as ResolvableProperties, j as ResolvableValue, e as Script, S as Style, T as Title, c as TitleTemplate } from './shared/vue.CZ-wp2QU.js';
|
|
1
|
+
import { ActiveHeadEntry } from 'unhead/types';
|
|
2
|
+
export { ActiveHeadEntry, Head, HeadEntryOptions, HeadTag, NormalizedHead, RenderSSRHeadOptions, ResolvableHead, ResolvedBase, ResolvedBodyAttributes, ResolvedHtmlAttributes, ResolvedLink, ResolvedMeta, ResolvedNoscript, ResolvedScript, ResolvedStyle, ResolvedTitle, ResolvedTitleTemplate, SerializableHead, Unhead } from 'unhead/types';
|
|
3
|
+
import { V as VueHeadClient, U as UseHeadInput, a as UseHeadOptions, b as UseSeoMetaInput } from './shared/vue.BkDIgqrM.js';
|
|
4
|
+
export { d as Base, B as BodyAttr, g as BodyAttributes, H as HtmlAttr, f as HtmlAttributes, L as Link, h as MaybeFalsy, 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.BkDIgqrM.js';
|
|
6
5
|
import { UseHeadSafeInput } from './types.js';
|
|
7
6
|
export { HeadSafe, SafeBodyAttr, SafeHtmlAttr, SafeLink, SafeMeta, SafeNoscript, SafeScript, SafeStyle } from './types.js';
|
|
8
7
|
export { resolveUnrefHeadInput } from './utils.js';
|
|
9
8
|
export { V as VueHeadMixin } from './shared/vue.DnywREVF.js';
|
|
9
|
+
export { createUnhead } from 'unhead';
|
|
10
|
+
export { useScript } from './scripts.js';
|
|
10
11
|
import 'vue';
|
|
11
12
|
import 'unhead/utils';
|
|
13
|
+
import 'unhead/scripts';
|
|
12
14
|
|
|
13
15
|
declare const unheadVueComposablesImports: {
|
|
14
16
|
'@unhead/vue': string[];
|
|
15
17
|
};
|
|
16
18
|
|
|
17
|
-
declare function injectHead(): VueHeadClient
|
|
18
|
-
declare function useHead<
|
|
19
|
-
declare function useHeadSafe(input?: UseHeadSafeInput, options?: UseHeadOptions): ActiveHeadEntry<
|
|
20
|
-
declare function useSeoMeta(input?: UseSeoMetaInput, options?: UseHeadOptions): ActiveHeadEntry<
|
|
19
|
+
declare function injectHead(): VueHeadClient;
|
|
20
|
+
declare function useHead<I = UseHeadInput>(input?: I, options?: UseHeadOptions): ActiveHeadEntry<I>;
|
|
21
|
+
declare function useHeadSafe(input?: UseHeadSafeInput, options?: UseHeadOptions): ActiveHeadEntry<UseHeadSafeInput>;
|
|
22
|
+
declare function useSeoMeta(input?: UseSeoMetaInput, options?: UseHeadOptions): ActiveHeadEntry<UseSeoMetaInput>;
|
|
21
23
|
/**
|
|
22
24
|
* @deprecated use `useHead` instead.Advanced use cases should tree shake using import.meta.* if statements.
|
|
23
25
|
*/
|
|
24
|
-
declare function useServerHead<
|
|
26
|
+
declare function useServerHead<I = UseHeadInput>(input?: I, options?: UseHeadOptions): ActiveHeadEntry<I>;
|
|
25
27
|
/**
|
|
26
28
|
* @deprecated use `useHeadSafe` instead.Advanced use cases should tree shake using import.meta.* if statements.
|
|
27
29
|
*/
|
|
28
|
-
declare function useServerHeadSafe(input?: UseHeadSafeInput, options?: UseHeadOptions): ActiveHeadEntry<
|
|
30
|
+
declare function useServerHeadSafe(input?: UseHeadSafeInput, options?: UseHeadOptions): ActiveHeadEntry<UseHeadSafeInput>;
|
|
29
31
|
/**
|
|
30
32
|
* @deprecated use `useSeoMeta` instead.Advanced use cases should tree shake using import.meta.* if statements.
|
|
31
33
|
*/
|
|
@@ -33,6 +35,4 @@ declare function useServerSeoMeta(input?: UseSeoMetaInput, options?: UseHeadOpti
|
|
|
33
35
|
|
|
34
36
|
declare const headSymbol = "usehead";
|
|
35
37
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
export { CapoPlugin, UseHeadInput, UseHeadOptions, UseHeadSafeInput, UseSeoMetaInput, VueHeadClient, headSymbol, injectHead, unheadVueComposablesImports, useHead, useHeadSafe, useSeoMeta, useServerHead, useServerHeadSafe, useServerSeoMeta };
|
|
38
|
+
export { UseHeadInput, UseHeadOptions, UseHeadSafeInput, UseSeoMetaInput, VueHeadClient, headSymbol, injectHead, unheadVueComposablesImports, useHead, useHeadSafe, useSeoMeta, useServerHead, useServerHeadSafe, useServerSeoMeta };
|
package/dist/index.mjs
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
export {
|
|
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';
|
|
1
|
+
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.BYLJNEcq.mjs';
|
|
3
2
|
export { resolveUnrefHeadInput } from './utils.mjs';
|
|
4
|
-
export { V as VueHeadMixin } from './shared/vue.
|
|
3
|
+
export { V as VueHeadMixin } from './shared/vue.nvpYXC6D.mjs';
|
|
4
|
+
export { createUnhead } from 'unhead';
|
|
5
|
+
export { u as useScript } from './shared/vue.cHBs6zvy.mjs';
|
|
5
6
|
import 'unhead/plugins';
|
|
6
7
|
import 'unhead/utils';
|
|
7
8
|
import 'vue';
|
|
8
9
|
import './shared/vue.N9zWjxoK.mjs';
|
|
10
|
+
import 'unhead/scripts';
|
|
9
11
|
|
|
10
12
|
const unheadVueComposablesImports = {
|
|
11
13
|
"@unhead/vue": ["injectHead", "useHead", "useSeoMeta", "useHeadSafe", "useServerHead", "useServerSeoMeta", "useServerHeadSafe"]
|
|
12
14
|
};
|
|
13
15
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
export { CapoPlugin, unheadVueComposablesImports };
|
|
16
|
+
export { unheadVueComposablesImports };
|
package/dist/legacy.d.mts
CHANGED
|
@@ -1,26 +1,27 @@
|
|
|
1
1
|
import * as unhead_types from 'unhead/types';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
import { V as VueHeadClient, U as UseHeadInput, a as UseHeadOptions, b as UseSeoMetaInput } from './shared/vue.
|
|
2
|
+
import { CreateClientHeadOptions, ActiveHeadEntry } from 'unhead/types';
|
|
3
|
+
import { createUnhead } from 'unhead';
|
|
4
|
+
import { V as VueHeadClient, U as UseHeadInput, a as UseHeadOptions, b as UseSeoMetaInput } from './shared/vue.BkDIgqrM.mjs';
|
|
5
5
|
import { UseHeadSafeInput } from './types.mjs';
|
|
6
6
|
import 'vue';
|
|
7
7
|
|
|
8
|
+
declare const createHeadCore: typeof createUnhead;
|
|
8
9
|
declare function resolveUnrefHeadInput(input: any): any;
|
|
9
10
|
declare function CapoPlugin(): unhead_types.HeadPluginInput;
|
|
10
|
-
declare function createHead
|
|
11
|
-
declare function createServerHead
|
|
11
|
+
declare function createHead(options?: CreateClientHeadOptions): VueHeadClient;
|
|
12
|
+
declare function createServerHead(options?: CreateClientHeadOptions): VueHeadClient;
|
|
12
13
|
/**
|
|
13
14
|
* @deprecated Please switch to non-legacy version
|
|
14
15
|
*/
|
|
15
16
|
declare function setHeadInjectionHandler(handler: () => VueHeadClient<any> | undefined): void;
|
|
16
17
|
declare function injectHead(): VueHeadClient<any> | undefined;
|
|
17
|
-
declare function useHead
|
|
18
|
+
declare function useHead(input: UseHeadInput, options?: UseHeadOptions): ActiveHeadEntry<UseHeadInput> | void;
|
|
18
19
|
declare function useHeadSafe(input: UseHeadSafeInput, options?: UseHeadOptions): ActiveHeadEntry<any> | void;
|
|
19
20
|
declare function useSeoMeta(input: UseSeoMetaInput, options?: UseHeadOptions): ActiveHeadEntry<any> | void;
|
|
20
21
|
/**
|
|
21
22
|
* @deprecated use `useHead` instead. Advanced use cases should tree shake using import.meta.* if statements.
|
|
22
23
|
*/
|
|
23
|
-
declare function useServerHead
|
|
24
|
+
declare function useServerHead(input: UseHeadInput, options?: UseHeadOptions): ActiveHeadEntry<any> | void;
|
|
24
25
|
/**
|
|
25
26
|
* @deprecated use `useHeadSafe` instead. Advanced use cases should tree shake using import.meta.* if statements.
|
|
26
27
|
*/
|
|
@@ -30,4 +31,4 @@ declare function useServerHeadSafe(input: UseHeadSafeInput, options?: UseHeadOpt
|
|
|
30
31
|
*/
|
|
31
32
|
declare function useServerSeoMeta(input: UseSeoMetaInput, options?: UseHeadOptions): ActiveHeadEntry<any> | void;
|
|
32
33
|
|
|
33
|
-
export { CapoPlugin, createHead, createServerHead, injectHead, resolveUnrefHeadInput, setHeadInjectionHandler, useHead, useHeadSafe, useSeoMeta, useServerHead, useServerHeadSafe, useServerSeoMeta };
|
|
34
|
+
export { CapoPlugin, createHead, createHeadCore, createServerHead, injectHead, resolveUnrefHeadInput, setHeadInjectionHandler, useHead, useHeadSafe, useSeoMeta, useServerHead, useServerHeadSafe, useServerSeoMeta };
|
package/dist/legacy.d.ts
CHANGED
|
@@ -1,26 +1,27 @@
|
|
|
1
1
|
import * as unhead_types from 'unhead/types';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
import { V as VueHeadClient, U as UseHeadInput, a as UseHeadOptions, b as UseSeoMetaInput } from './shared/vue.
|
|
2
|
+
import { CreateClientHeadOptions, ActiveHeadEntry } from 'unhead/types';
|
|
3
|
+
import { createUnhead } from 'unhead';
|
|
4
|
+
import { V as VueHeadClient, U as UseHeadInput, a as UseHeadOptions, b as UseSeoMetaInput } from './shared/vue.BkDIgqrM.js';
|
|
5
5
|
import { UseHeadSafeInput } from './types.js';
|
|
6
6
|
import 'vue';
|
|
7
7
|
|
|
8
|
+
declare const createHeadCore: typeof createUnhead;
|
|
8
9
|
declare function resolveUnrefHeadInput(input: any): any;
|
|
9
10
|
declare function CapoPlugin(): unhead_types.HeadPluginInput;
|
|
10
|
-
declare function createHead
|
|
11
|
-
declare function createServerHead
|
|
11
|
+
declare function createHead(options?: CreateClientHeadOptions): VueHeadClient;
|
|
12
|
+
declare function createServerHead(options?: CreateClientHeadOptions): VueHeadClient;
|
|
12
13
|
/**
|
|
13
14
|
* @deprecated Please switch to non-legacy version
|
|
14
15
|
*/
|
|
15
16
|
declare function setHeadInjectionHandler(handler: () => VueHeadClient<any> | undefined): void;
|
|
16
17
|
declare function injectHead(): VueHeadClient<any> | undefined;
|
|
17
|
-
declare function useHead
|
|
18
|
+
declare function useHead(input: UseHeadInput, options?: UseHeadOptions): ActiveHeadEntry<UseHeadInput> | void;
|
|
18
19
|
declare function useHeadSafe(input: UseHeadSafeInput, options?: UseHeadOptions): ActiveHeadEntry<any> | void;
|
|
19
20
|
declare function useSeoMeta(input: UseSeoMetaInput, options?: UseHeadOptions): ActiveHeadEntry<any> | void;
|
|
20
21
|
/**
|
|
21
22
|
* @deprecated use `useHead` instead. Advanced use cases should tree shake using import.meta.* if statements.
|
|
22
23
|
*/
|
|
23
|
-
declare function useServerHead
|
|
24
|
+
declare function useServerHead(input: UseHeadInput, options?: UseHeadOptions): ActiveHeadEntry<any> | void;
|
|
24
25
|
/**
|
|
25
26
|
* @deprecated use `useHeadSafe` instead. Advanced use cases should tree shake using import.meta.* if statements.
|
|
26
27
|
*/
|
|
@@ -30,4 +31,4 @@ declare function useServerHeadSafe(input: UseHeadSafeInput, options?: UseHeadOpt
|
|
|
30
31
|
*/
|
|
31
32
|
declare function useServerSeoMeta(input: UseSeoMetaInput, options?: UseHeadOptions): ActiveHeadEntry<any> | void;
|
|
32
33
|
|
|
33
|
-
export { CapoPlugin, createHead, createServerHead, injectHead, resolveUnrefHeadInput, setHeadInjectionHandler, useHead, useHeadSafe, useSeoMeta, useServerHead, useServerHeadSafe, useServerSeoMeta };
|
|
34
|
+
export { CapoPlugin, createHead, createHeadCore, createServerHead, injectHead, resolveUnrefHeadInput, setHeadInjectionHandler, useHead, useHeadSafe, useSeoMeta, useServerHead, useServerHeadSafe, useServerSeoMeta };
|
package/dist/legacy.mjs
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
import { createUnhead } from 'unhead';
|
|
2
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.
|
|
4
|
+
import { h as headSymbol } from './shared/vue.BYLJNEcq.mjs';
|
|
5
5
|
import { V as VueResolver } from './shared/vue.N9zWjxoK.mjs';
|
|
6
6
|
import { createHead as createHead$2 } from './server.mjs';
|
|
7
7
|
import { walkResolver } from 'unhead/utils';
|
|
8
8
|
import { defineHeadPlugin, DeprecationsPlugin, PromisesPlugin, TemplateParamsPlugin, AliasSortingPlugin, SafeInputPlugin, FlatMetaPlugin } from 'unhead/plugins';
|
|
9
9
|
import 'unhead/client';
|
|
10
|
-
import './shared/vue.
|
|
10
|
+
import './shared/vue.nvpYXC6D.mjs';
|
|
11
11
|
import 'unhead/server';
|
|
12
12
|
|
|
13
|
+
const createHeadCore = createUnhead;
|
|
13
14
|
function resolveUnrefHeadInput(input) {
|
|
14
15
|
return walkResolver(input, VueResolver);
|
|
15
16
|
}
|
|
@@ -110,4 +111,4 @@ function useServerSeoMeta(input, options) {
|
|
|
110
111
|
return useSeoMeta(input, { ...options, mode: "server" });
|
|
111
112
|
}
|
|
112
113
|
|
|
113
|
-
export { CapoPlugin, createHead, createServerHead, injectHead, resolveUnrefHeadInput, setHeadInjectionHandler, useHead, useHeadSafe, useSeoMeta, useServerHead, useServerHeadSafe, useServerSeoMeta };
|
|
114
|
+
export { CapoPlugin, createHead, createHeadCore, createServerHead, injectHead, resolveUnrefHeadInput, setHeadInjectionHandler, useHead, useHeadSafe, useSeoMeta, useServerHead, useServerHeadSafe, useServerSeoMeta };
|
package/dist/scripts.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { UseScriptOptions as UseScriptOptions$1, ScriptInstance, UseScriptStatus, UseFunctionType } from 'unhead/scripts';
|
|
2
2
|
import { ScriptBase, DataKeys, SchemaAugmentations, HeadEntryOptions } from 'unhead/types';
|
|
3
3
|
import { Ref } from 'vue';
|
|
4
|
-
import {
|
|
4
|
+
import { k as ResolvableProperties, V as VueHeadClient } from './shared/vue.BkDIgqrM.mjs';
|
|
5
5
|
|
|
6
6
|
interface VueScriptInstance<T extends Record<symbol | string, any>> extends Omit<ScriptInstance<T>, 'status'> {
|
|
7
7
|
status: Ref<UseScriptStatus>;
|
package/dist/scripts.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { UseScriptOptions as UseScriptOptions$1, ScriptInstance, UseScriptStatus, UseFunctionType } from 'unhead/scripts';
|
|
2
2
|
import { ScriptBase, DataKeys, SchemaAugmentations, HeadEntryOptions } from 'unhead/types';
|
|
3
3
|
import { Ref } from 'vue';
|
|
4
|
-
import {
|
|
4
|
+
import { k as ResolvableProperties, V as VueHeadClient } from './shared/vue.BkDIgqrM.js';
|
|
5
5
|
|
|
6
6
|
interface VueScriptInstance<T extends Record<symbol | string, any>> extends Omit<ScriptInstance<T>, 'status'> {
|
|
7
7
|
status: Ref<UseScriptStatus>;
|
package/dist/scripts.mjs
CHANGED
|
@@ -1,73 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
export { u as useScript } from './shared/vue.cHBs6zvy.mjs';
|
|
2
|
+
import 'unhead/scripts';
|
|
3
|
+
import 'vue';
|
|
4
|
+
import './shared/vue.BYLJNEcq.mjs';
|
|
4
5
|
import 'unhead/plugins';
|
|
5
6
|
import 'unhead/utils';
|
|
6
7
|
import './shared/vue.N9zWjxoK.mjs';
|
|
7
|
-
|
|
8
|
-
function registerVueScopeHandlers(script, scope) {
|
|
9
|
-
if (!scope) {
|
|
10
|
-
return;
|
|
11
|
-
}
|
|
12
|
-
const _registerCb = (key, cb) => {
|
|
13
|
-
if (!script._cbs[key]) {
|
|
14
|
-
cb(script.instance);
|
|
15
|
-
return () => {
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
let i = script._cbs[key].push(cb);
|
|
19
|
-
const destroy = () => {
|
|
20
|
-
if (i) {
|
|
21
|
-
script._cbs[key]?.splice(i - 1, 1);
|
|
22
|
-
i = null;
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
onScopeDispose(destroy);
|
|
26
|
-
return destroy;
|
|
27
|
-
};
|
|
28
|
-
script.onLoaded = (cb) => _registerCb("loaded", cb);
|
|
29
|
-
script.onError = (cb) => _registerCb("error", cb);
|
|
30
|
-
onScopeDispose(() => {
|
|
31
|
-
script._triggerAbortController?.abort();
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
function useScript(_input, _options) {
|
|
35
|
-
const input = typeof _input === "string" ? { src: _input } : _input;
|
|
36
|
-
const options = _options || {};
|
|
37
|
-
const head = options?.head || injectHead();
|
|
38
|
-
options.head = head;
|
|
39
|
-
const scope = getCurrentInstance();
|
|
40
|
-
options.eventContext = scope;
|
|
41
|
-
if (scope && typeof options.trigger === "undefined") {
|
|
42
|
-
options.trigger = onMounted;
|
|
43
|
-
} else if (isRef(options.trigger)) {
|
|
44
|
-
const refTrigger = options.trigger;
|
|
45
|
-
let off;
|
|
46
|
-
options.trigger = new Promise((resolve) => {
|
|
47
|
-
off = watch(refTrigger, (val) => {
|
|
48
|
-
if (val) {
|
|
49
|
-
resolve(true);
|
|
50
|
-
}
|
|
51
|
-
}, {
|
|
52
|
-
immediate: true
|
|
53
|
-
});
|
|
54
|
-
onScopeDispose(() => resolve(false), true);
|
|
55
|
-
}).then((val) => {
|
|
56
|
-
off?.();
|
|
57
|
-
return val;
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
head._scriptStatusWatcher = head._scriptStatusWatcher || head.hooks.hook("script:updated", ({ script: s }) => {
|
|
61
|
-
s._statusRef.value = s.status;
|
|
62
|
-
});
|
|
63
|
-
const script = useScript$1(head, input, options);
|
|
64
|
-
script._statusRef = script._statusRef || ref(script.status);
|
|
65
|
-
registerVueScopeHandlers(script, scope);
|
|
66
|
-
return new Proxy(script, {
|
|
67
|
-
get(_, key, a) {
|
|
68
|
-
return Reflect.get(_, key === "status" ? "_statusRef" : key, a);
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
export { useScript };
|
package/dist/server.d.mts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CreateServerHeadOptions } from 'unhead/types';
|
|
2
2
|
export { V as VueHeadMixin } from './shared/vue.DnywREVF.mjs';
|
|
3
3
|
export { SSRHeadPayload, extractUnheadInputFromHtml, propsToString, renderSSRHead, transformHtmlTemplate } from 'unhead/server';
|
|
4
|
-
import { V as VueHeadClient } from './shared/vue.
|
|
4
|
+
import { V as VueHeadClient } from './shared/vue.BkDIgqrM.mjs';
|
|
5
5
|
import 'vue';
|
|
6
6
|
|
|
7
|
-
declare function createHead
|
|
7
|
+
declare function createHead(options?: Omit<CreateServerHeadOptions, 'propsResolver'>): VueHeadClient;
|
|
8
8
|
|
|
9
9
|
export { createHead };
|
package/dist/server.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CreateServerHeadOptions } from 'unhead/types';
|
|
2
2
|
export { V as VueHeadMixin } from './shared/vue.DnywREVF.js';
|
|
3
3
|
export { SSRHeadPayload, extractUnheadInputFromHtml, propsToString, renderSSRHead, transformHtmlTemplate } from 'unhead/server';
|
|
4
|
-
import { V as VueHeadClient } from './shared/vue.
|
|
4
|
+
import { V as VueHeadClient } from './shared/vue.BkDIgqrM.js';
|
|
5
5
|
import 'vue';
|
|
6
6
|
|
|
7
|
-
declare function createHead
|
|
7
|
+
declare function createHead(options?: Omit<CreateServerHeadOptions, 'propsResolver'>): VueHeadClient;
|
|
8
8
|
|
|
9
9
|
export { createHead };
|
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.
|
|
3
|
+
import { v as vueInstall } from './shared/vue.BYLJNEcq.mjs';
|
|
4
4
|
import { V as VueResolver } from './shared/vue.N9zWjxoK.mjs';
|
|
5
|
-
export { V as VueHeadMixin } from './shared/vue.
|
|
5
|
+
export { V as VueHeadMixin } from './shared/vue.nvpYXC6D.mjs';
|
|
6
6
|
import 'unhead/plugins';
|
|
7
7
|
import 'unhead/utils';
|
|
8
8
|
import 'vue';
|
|
@@ -25,9 +25,9 @@ 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
|
|
28
|
+
function useHead(input, options = {}) {
|
|
29
29
|
const head = options.head || injectHead();
|
|
30
|
-
return head.ssr ? head.push(input, options) : clientUseHead(head, input, options);
|
|
30
|
+
return head.ssr ? head.push(input || {}, options) : clientUseHead(head, input, options);
|
|
31
31
|
}
|
|
32
32
|
function clientUseHead(head, input, options = {}) {
|
|
33
33
|
const deactivated = ref(false);
|
|
@@ -67,17 +67,16 @@ function useSeoMeta(input = {}, options = {}) {
|
|
|
67
67
|
return useHead({
|
|
68
68
|
title,
|
|
69
69
|
titleTemplate,
|
|
70
|
-
// @ts-expect-error runtime type
|
|
71
70
|
_flatMeta: meta
|
|
72
71
|
}, options);
|
|
73
72
|
}
|
|
74
|
-
function useServerHead(input
|
|
73
|
+
function useServerHead(input, options = {}) {
|
|
75
74
|
return useHead(input, { ...options, mode: "server" });
|
|
76
75
|
}
|
|
77
|
-
function useServerHeadSafe(input
|
|
76
|
+
function useServerHeadSafe(input, options = {}) {
|
|
78
77
|
return useHeadSafe(input, { ...options, mode: "server" });
|
|
79
78
|
}
|
|
80
|
-
function useServerSeoMeta(input = {}
|
|
79
|
+
function useServerSeoMeta(input, options = {}) {
|
|
81
80
|
return useSeoMeta(input, { ...options, mode: "server" });
|
|
82
81
|
}
|
|
83
82
|
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Stringable, SchemaAugmentations, TitleTemplate as TitleTemplate$1, Base as Base$1, LinkBase, DataKeys, MaybeEventFnHandlers, HttpEventAttributes, BaseMeta, Style as Style$1, ScriptBase, Noscript as Noscript$1, BaseHtmlAttr, MaybeArray, BaseBodyAttr, BodyEvents, Unhead, HeadEntryOptions, MetaFlatInput } from 'unhead/types';
|
|
2
2
|
import { ComputedRef, Ref, CSSProperties, Plugin } from 'vue';
|
|
3
3
|
|
|
4
|
-
type
|
|
5
|
-
type
|
|
4
|
+
type Falsy = false | null | undefined;
|
|
5
|
+
type MaybeFalsy<T> = T | Falsy;
|
|
6
|
+
type ResolvableValue<T> = MaybeFalsy<T> | (() => MaybeFalsy<T>) | ComputedRef<MaybeFalsy<T>> | Ref<MaybeFalsy<T>>;
|
|
6
7
|
type ResolvableArray<T> = ResolvableValue<ResolvableValue<T>[]>;
|
|
7
8
|
type ResolvableProperties<T> = {
|
|
8
9
|
[key in keyof T]?: ResolvableValue<T[key]>;
|
|
@@ -14,13 +15,13 @@ interface HtmlAttr extends Omit<BaseHtmlAttr, 'class' | 'style'> {
|
|
|
14
15
|
*
|
|
15
16
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/class
|
|
16
17
|
*/
|
|
17
|
-
class?: MaybeArray<ResolvableValue<
|
|
18
|
+
class?: MaybeArray<ResolvableValue<Stringable> | Record<string, ResolvableValue<Stringable>>>;
|
|
18
19
|
/**
|
|
19
20
|
* The class global attribute is a space-separated list of the case-sensitive classes of the element.
|
|
20
21
|
*
|
|
21
22
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/class
|
|
22
23
|
*/
|
|
23
|
-
style?: MaybeArray<ResolvableValue<
|
|
24
|
+
style?: MaybeArray<ResolvableValue<Stringable> | ResolvableProperties<CSSProperties>>;
|
|
24
25
|
}
|
|
25
26
|
interface BodyAttr extends Omit<BaseBodyAttr, 'class' | 'style'> {
|
|
26
27
|
/**
|
|
@@ -28,7 +29,7 @@ interface BodyAttr extends Omit<BaseBodyAttr, 'class' | 'style'> {
|
|
|
28
29
|
*
|
|
29
30
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/class
|
|
30
31
|
*/
|
|
31
|
-
class?: MaybeArray<ResolvableValue<
|
|
32
|
+
class?: MaybeArray<ResolvableValue<Stringable>> | Record<string, ResolvableValue<Stringable>>;
|
|
32
33
|
/**
|
|
33
34
|
* The class global attribute is a space-separated list of the case-sensitive classes of the element.
|
|
34
35
|
*
|
|
@@ -36,19 +37,19 @@ interface BodyAttr extends Omit<BaseBodyAttr, 'class' | 'style'> {
|
|
|
36
37
|
*/
|
|
37
38
|
style?: MaybeArray<ResolvableValue<string>> | ResolvableProperties<CSSProperties>;
|
|
38
39
|
}
|
|
39
|
-
type Title = ResolvableValue<Stringable
|
|
40
|
+
type Title = ResolvableValue<Stringable> | ResolvableProperties<({
|
|
40
41
|
textContent: Stringable;
|
|
41
42
|
} & SchemaAugmentations['title'])>;
|
|
42
43
|
type TitleTemplate = TitleTemplate$1 | Ref<TitleTemplate$1> | ((title?: string) => TitleTemplate$1);
|
|
43
|
-
type Base
|
|
44
|
-
type Link
|
|
45
|
-
type Meta
|
|
46
|
-
type Style
|
|
47
|
-
type Script
|
|
48
|
-
type Noscript
|
|
49
|
-
type HtmlAttributes
|
|
50
|
-
type BodyAttributes
|
|
51
|
-
interface ReactiveHead
|
|
44
|
+
type Base = ResolvableProperties<Base$1 & SchemaAugmentations['base']>;
|
|
45
|
+
type Link = ResolvableProperties<LinkBase & DataKeys & SchemaAugmentations['link']> & MaybeEventFnHandlers<HttpEventAttributes>;
|
|
46
|
+
type Meta = ResolvableProperties<BaseMeta & DataKeys & SchemaAugmentations['meta']>;
|
|
47
|
+
type Style = ResolvableProperties<Style$1 & DataKeys & SchemaAugmentations['style']>;
|
|
48
|
+
type Script = ResolvableProperties<ScriptBase & DataKeys & SchemaAugmentations['script']> & MaybeEventFnHandlers<HttpEventAttributes>;
|
|
49
|
+
type Noscript = ResolvableProperties<Noscript$1 & DataKeys & SchemaAugmentations['noscript']>;
|
|
50
|
+
type HtmlAttributes = ResolvableProperties<HtmlAttr & DataKeys & SchemaAugmentations['htmlAttrs']>;
|
|
51
|
+
type BodyAttributes = ResolvableProperties<BodyAttr & DataKeys & SchemaAugmentations['bodyAttrs']> & MaybeEventFnHandlers<BodyEvents>;
|
|
52
|
+
interface ReactiveHead {
|
|
52
53
|
/**
|
|
53
54
|
* The `<title>` HTML element defines the document's title that is shown in a browser's title bar or a page's tab.
|
|
54
55
|
* It only contains text; tags within the element are ignored.
|
|
@@ -65,14 +66,14 @@ interface ReactiveHead<E extends MergeHead = MergeHead> {
|
|
|
65
66
|
*/
|
|
66
67
|
templateParams?: ResolvableProperties<{
|
|
67
68
|
separator?: '|' | '-' | '·' | string;
|
|
68
|
-
} & Record<string, Stringable |
|
|
69
|
+
} & Record<string, Stringable | ResolvableProperties<Record<string, Stringable>>>>;
|
|
69
70
|
/**
|
|
70
71
|
* The `<base>` HTML element specifies the base URL to use for all relative URLs in a document.
|
|
71
72
|
* There can be only one <base> element in a document.
|
|
72
73
|
*
|
|
73
74
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base
|
|
74
75
|
*/
|
|
75
|
-
base?: Base
|
|
76
|
+
base?: Base;
|
|
76
77
|
/**
|
|
77
78
|
* The `<link>` HTML element specifies relationships between the current document and an external resource.
|
|
78
79
|
* This element is most commonly used to link to stylesheets, but is also used to establish site icons
|
|
@@ -80,54 +81,54 @@ interface ReactiveHead<E extends MergeHead = MergeHead> {
|
|
|
80
81
|
*
|
|
81
82
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-as
|
|
82
83
|
*/
|
|
83
|
-
link?: ResolvableArray<Link
|
|
84
|
+
link?: ResolvableArray<Link>;
|
|
84
85
|
/**
|
|
85
86
|
* The `<meta>` element represents metadata that cannot be expressed in other HTML elements, like `<link>` or `<script>`.
|
|
86
87
|
*
|
|
87
88
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta
|
|
88
89
|
*/
|
|
89
|
-
meta?: ResolvableArray<Meta
|
|
90
|
+
meta?: ResolvableArray<Meta>;
|
|
90
91
|
/**
|
|
91
92
|
* The `<style>` HTML element contains style information for a document, or part of a document.
|
|
92
93
|
* It contains CSS, which is applied to the contents of the document containing the `<style>` element.
|
|
93
94
|
*
|
|
94
95
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/style
|
|
95
96
|
*/
|
|
96
|
-
style?: ResolvableArray<(Style
|
|
97
|
+
style?: ResolvableArray<(Style | string)>;
|
|
97
98
|
/**
|
|
98
99
|
* 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
|
*
|
|
100
101
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script
|
|
101
102
|
*/
|
|
102
|
-
script?: ResolvableArray<(Script
|
|
103
|
+
script?: ResolvableArray<(Script | string)>;
|
|
103
104
|
/**
|
|
104
105
|
* The `<noscript>` HTML element defines a section of HTML to be inserted if a script type on the page is unsupported
|
|
105
106
|
* or if scripting is currently turned off in the browser.
|
|
106
107
|
*
|
|
107
108
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/noscript
|
|
108
109
|
*/
|
|
109
|
-
noscript?: ResolvableArray<(Noscript
|
|
110
|
+
noscript?: ResolvableArray<(Noscript | string)>;
|
|
110
111
|
/**
|
|
111
112
|
* Attributes for the `<html>` HTML element.
|
|
112
113
|
*
|
|
113
114
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/html
|
|
114
115
|
*/
|
|
115
|
-
htmlAttrs?: HtmlAttributes
|
|
116
|
+
htmlAttrs?: HtmlAttributes;
|
|
116
117
|
/**
|
|
117
118
|
* Attributes for the `<body>` HTML element.
|
|
118
119
|
*
|
|
119
120
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/body
|
|
120
121
|
*/
|
|
121
|
-
bodyAttrs?: BodyAttributes
|
|
122
|
+
bodyAttrs?: BodyAttributes;
|
|
122
123
|
}
|
|
123
124
|
type UseHeadOptions = Omit<HeadEntryOptions, 'head'> & {
|
|
124
125
|
head?: VueHeadClient<any>;
|
|
125
126
|
};
|
|
126
|
-
type UseHeadInput
|
|
127
|
+
type UseHeadInput = ResolvableValue<ReactiveHead>;
|
|
127
128
|
type UseSeoMetaInput = ResolvableProperties<MetaFlatInput> & {
|
|
128
129
|
title?: ReactiveHead['title'];
|
|
129
130
|
titleTemplate?: ReactiveHead['titleTemplate'];
|
|
130
131
|
};
|
|
131
|
-
type VueHeadClient<
|
|
132
|
+
type VueHeadClient<I = UseHeadInput> = Unhead<I> & Plugin;
|
|
132
133
|
|
|
133
|
-
export type { BodyAttr as B, HtmlAttr as H, Link as L, Meta as M, Noscript as N,
|
|
134
|
+
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, MaybeFalsy as h, ResolvableValue as i, ResolvableArray as j, ResolvableProperties as k };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Stringable, SchemaAugmentations, TitleTemplate as TitleTemplate$1, Base as Base$1, LinkBase, DataKeys, MaybeEventFnHandlers, HttpEventAttributes, BaseMeta, Style as Style$1, ScriptBase, Noscript as Noscript$1, BaseHtmlAttr, MaybeArray, BaseBodyAttr, BodyEvents, Unhead, HeadEntryOptions, MetaFlatInput } from 'unhead/types';
|
|
2
2
|
import { ComputedRef, Ref, CSSProperties, Plugin } from 'vue';
|
|
3
3
|
|
|
4
|
-
type
|
|
5
|
-
type
|
|
4
|
+
type Falsy = false | null | undefined;
|
|
5
|
+
type MaybeFalsy<T> = T | Falsy;
|
|
6
|
+
type ResolvableValue<T> = MaybeFalsy<T> | (() => MaybeFalsy<T>) | ComputedRef<MaybeFalsy<T>> | Ref<MaybeFalsy<T>>;
|
|
6
7
|
type ResolvableArray<T> = ResolvableValue<ResolvableValue<T>[]>;
|
|
7
8
|
type ResolvableProperties<T> = {
|
|
8
9
|
[key in keyof T]?: ResolvableValue<T[key]>;
|
|
@@ -14,13 +15,13 @@ interface HtmlAttr extends Omit<BaseHtmlAttr, 'class' | 'style'> {
|
|
|
14
15
|
*
|
|
15
16
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/class
|
|
16
17
|
*/
|
|
17
|
-
class?: MaybeArray<ResolvableValue<
|
|
18
|
+
class?: MaybeArray<ResolvableValue<Stringable> | Record<string, ResolvableValue<Stringable>>>;
|
|
18
19
|
/**
|
|
19
20
|
* The class global attribute is a space-separated list of the case-sensitive classes of the element.
|
|
20
21
|
*
|
|
21
22
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/class
|
|
22
23
|
*/
|
|
23
|
-
style?: MaybeArray<ResolvableValue<
|
|
24
|
+
style?: MaybeArray<ResolvableValue<Stringable> | ResolvableProperties<CSSProperties>>;
|
|
24
25
|
}
|
|
25
26
|
interface BodyAttr extends Omit<BaseBodyAttr, 'class' | 'style'> {
|
|
26
27
|
/**
|
|
@@ -28,7 +29,7 @@ interface BodyAttr extends Omit<BaseBodyAttr, 'class' | 'style'> {
|
|
|
28
29
|
*
|
|
29
30
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/class
|
|
30
31
|
*/
|
|
31
|
-
class?: MaybeArray<ResolvableValue<
|
|
32
|
+
class?: MaybeArray<ResolvableValue<Stringable>> | Record<string, ResolvableValue<Stringable>>;
|
|
32
33
|
/**
|
|
33
34
|
* The class global attribute is a space-separated list of the case-sensitive classes of the element.
|
|
34
35
|
*
|
|
@@ -36,19 +37,19 @@ interface BodyAttr extends Omit<BaseBodyAttr, 'class' | 'style'> {
|
|
|
36
37
|
*/
|
|
37
38
|
style?: MaybeArray<ResolvableValue<string>> | ResolvableProperties<CSSProperties>;
|
|
38
39
|
}
|
|
39
|
-
type Title = ResolvableValue<Stringable
|
|
40
|
+
type Title = ResolvableValue<Stringable> | ResolvableProperties<({
|
|
40
41
|
textContent: Stringable;
|
|
41
42
|
} & SchemaAugmentations['title'])>;
|
|
42
43
|
type TitleTemplate = TitleTemplate$1 | Ref<TitleTemplate$1> | ((title?: string) => TitleTemplate$1);
|
|
43
|
-
type Base
|
|
44
|
-
type Link
|
|
45
|
-
type Meta
|
|
46
|
-
type Style
|
|
47
|
-
type Script
|
|
48
|
-
type Noscript
|
|
49
|
-
type HtmlAttributes
|
|
50
|
-
type BodyAttributes
|
|
51
|
-
interface ReactiveHead
|
|
44
|
+
type Base = ResolvableProperties<Base$1 & SchemaAugmentations['base']>;
|
|
45
|
+
type Link = ResolvableProperties<LinkBase & DataKeys & SchemaAugmentations['link']> & MaybeEventFnHandlers<HttpEventAttributes>;
|
|
46
|
+
type Meta = ResolvableProperties<BaseMeta & DataKeys & SchemaAugmentations['meta']>;
|
|
47
|
+
type Style = ResolvableProperties<Style$1 & DataKeys & SchemaAugmentations['style']>;
|
|
48
|
+
type Script = ResolvableProperties<ScriptBase & DataKeys & SchemaAugmentations['script']> & MaybeEventFnHandlers<HttpEventAttributes>;
|
|
49
|
+
type Noscript = ResolvableProperties<Noscript$1 & DataKeys & SchemaAugmentations['noscript']>;
|
|
50
|
+
type HtmlAttributes = ResolvableProperties<HtmlAttr & DataKeys & SchemaAugmentations['htmlAttrs']>;
|
|
51
|
+
type BodyAttributes = ResolvableProperties<BodyAttr & DataKeys & SchemaAugmentations['bodyAttrs']> & MaybeEventFnHandlers<BodyEvents>;
|
|
52
|
+
interface ReactiveHead {
|
|
52
53
|
/**
|
|
53
54
|
* The `<title>` HTML element defines the document's title that is shown in a browser's title bar or a page's tab.
|
|
54
55
|
* It only contains text; tags within the element are ignored.
|
|
@@ -65,14 +66,14 @@ interface ReactiveHead<E extends MergeHead = MergeHead> {
|
|
|
65
66
|
*/
|
|
66
67
|
templateParams?: ResolvableProperties<{
|
|
67
68
|
separator?: '|' | '-' | '·' | string;
|
|
68
|
-
} & Record<string, Stringable |
|
|
69
|
+
} & Record<string, Stringable | ResolvableProperties<Record<string, Stringable>>>>;
|
|
69
70
|
/**
|
|
70
71
|
* The `<base>` HTML element specifies the base URL to use for all relative URLs in a document.
|
|
71
72
|
* There can be only one <base> element in a document.
|
|
72
73
|
*
|
|
73
74
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base
|
|
74
75
|
*/
|
|
75
|
-
base?: Base
|
|
76
|
+
base?: Base;
|
|
76
77
|
/**
|
|
77
78
|
* The `<link>` HTML element specifies relationships between the current document and an external resource.
|
|
78
79
|
* This element is most commonly used to link to stylesheets, but is also used to establish site icons
|
|
@@ -80,54 +81,54 @@ interface ReactiveHead<E extends MergeHead = MergeHead> {
|
|
|
80
81
|
*
|
|
81
82
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-as
|
|
82
83
|
*/
|
|
83
|
-
link?: ResolvableArray<Link
|
|
84
|
+
link?: ResolvableArray<Link>;
|
|
84
85
|
/**
|
|
85
86
|
* The `<meta>` element represents metadata that cannot be expressed in other HTML elements, like `<link>` or `<script>`.
|
|
86
87
|
*
|
|
87
88
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta
|
|
88
89
|
*/
|
|
89
|
-
meta?: ResolvableArray<Meta
|
|
90
|
+
meta?: ResolvableArray<Meta>;
|
|
90
91
|
/**
|
|
91
92
|
* The `<style>` HTML element contains style information for a document, or part of a document.
|
|
92
93
|
* It contains CSS, which is applied to the contents of the document containing the `<style>` element.
|
|
93
94
|
*
|
|
94
95
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/style
|
|
95
96
|
*/
|
|
96
|
-
style?: ResolvableArray<(Style
|
|
97
|
+
style?: ResolvableArray<(Style | string)>;
|
|
97
98
|
/**
|
|
98
99
|
* 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
|
*
|
|
100
101
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script
|
|
101
102
|
*/
|
|
102
|
-
script?: ResolvableArray<(Script
|
|
103
|
+
script?: ResolvableArray<(Script | string)>;
|
|
103
104
|
/**
|
|
104
105
|
* The `<noscript>` HTML element defines a section of HTML to be inserted if a script type on the page is unsupported
|
|
105
106
|
* or if scripting is currently turned off in the browser.
|
|
106
107
|
*
|
|
107
108
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/noscript
|
|
108
109
|
*/
|
|
109
|
-
noscript?: ResolvableArray<(Noscript
|
|
110
|
+
noscript?: ResolvableArray<(Noscript | string)>;
|
|
110
111
|
/**
|
|
111
112
|
* Attributes for the `<html>` HTML element.
|
|
112
113
|
*
|
|
113
114
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/html
|
|
114
115
|
*/
|
|
115
|
-
htmlAttrs?: HtmlAttributes
|
|
116
|
+
htmlAttrs?: HtmlAttributes;
|
|
116
117
|
/**
|
|
117
118
|
* Attributes for the `<body>` HTML element.
|
|
118
119
|
*
|
|
119
120
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/body
|
|
120
121
|
*/
|
|
121
|
-
bodyAttrs?: BodyAttributes
|
|
122
|
+
bodyAttrs?: BodyAttributes;
|
|
122
123
|
}
|
|
123
124
|
type UseHeadOptions = Omit<HeadEntryOptions, 'head'> & {
|
|
124
125
|
head?: VueHeadClient<any>;
|
|
125
126
|
};
|
|
126
|
-
type UseHeadInput
|
|
127
|
+
type UseHeadInput = ResolvableValue<ReactiveHead>;
|
|
127
128
|
type UseSeoMetaInput = ResolvableProperties<MetaFlatInput> & {
|
|
128
129
|
title?: ReactiveHead['title'];
|
|
129
130
|
titleTemplate?: ReactiveHead['titleTemplate'];
|
|
130
131
|
};
|
|
131
|
-
type VueHeadClient<
|
|
132
|
+
type VueHeadClient<I = UseHeadInput> = Unhead<I> & Plugin;
|
|
132
133
|
|
|
133
|
-
export type { BodyAttr as B, HtmlAttr as H, Link as L, Meta as M, Noscript as N,
|
|
134
|
+
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, MaybeFalsy as h, ResolvableValue as i, ResolvableArray as j, ResolvableProperties as k };
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { useScript as useScript$1 } from 'unhead/scripts';
|
|
2
|
+
import { getCurrentInstance, onMounted, isRef, watch, onScopeDispose, ref } from 'vue';
|
|
3
|
+
import { i as injectHead } from './vue.BYLJNEcq.mjs';
|
|
4
|
+
|
|
5
|
+
function registerVueScopeHandlers(script, scope) {
|
|
6
|
+
if (!scope) {
|
|
7
|
+
return;
|
|
8
|
+
}
|
|
9
|
+
const _registerCb = (key, cb) => {
|
|
10
|
+
if (!script._cbs[key]) {
|
|
11
|
+
cb(script.instance);
|
|
12
|
+
return () => {
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
let i = script._cbs[key].push(cb);
|
|
16
|
+
const destroy = () => {
|
|
17
|
+
if (i) {
|
|
18
|
+
script._cbs[key]?.splice(i - 1, 1);
|
|
19
|
+
i = null;
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
onScopeDispose(destroy);
|
|
23
|
+
return destroy;
|
|
24
|
+
};
|
|
25
|
+
script.onLoaded = (cb) => _registerCb("loaded", cb);
|
|
26
|
+
script.onError = (cb) => _registerCb("error", cb);
|
|
27
|
+
onScopeDispose(() => {
|
|
28
|
+
script._triggerAbortController?.abort();
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
function useScript(_input, _options) {
|
|
32
|
+
const input = typeof _input === "string" ? { src: _input } : _input;
|
|
33
|
+
const options = _options || {};
|
|
34
|
+
const head = options?.head || injectHead();
|
|
35
|
+
options.head = head;
|
|
36
|
+
const scope = getCurrentInstance();
|
|
37
|
+
options.eventContext = scope;
|
|
38
|
+
if (scope && typeof options.trigger === "undefined") {
|
|
39
|
+
options.trigger = onMounted;
|
|
40
|
+
} else if (isRef(options.trigger)) {
|
|
41
|
+
const refTrigger = options.trigger;
|
|
42
|
+
let off;
|
|
43
|
+
options.trigger = new Promise((resolve) => {
|
|
44
|
+
off = watch(refTrigger, (val) => {
|
|
45
|
+
if (val) {
|
|
46
|
+
resolve(true);
|
|
47
|
+
}
|
|
48
|
+
}, {
|
|
49
|
+
immediate: true
|
|
50
|
+
});
|
|
51
|
+
onScopeDispose(() => resolve(false), true);
|
|
52
|
+
}).then((val) => {
|
|
53
|
+
off?.();
|
|
54
|
+
return val;
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
head._scriptStatusWatcher = head._scriptStatusWatcher || head.hooks.hook("script:updated", ({ script: s }) => {
|
|
58
|
+
s._statusRef.value = s.status;
|
|
59
|
+
});
|
|
60
|
+
const script = useScript$1(head, input, options);
|
|
61
|
+
script._statusRef = script._statusRef || ref(script.status);
|
|
62
|
+
registerVueScopeHandlers(script, scope);
|
|
63
|
+
return new Proxy(script, {
|
|
64
|
+
get(_, key, a) {
|
|
65
|
+
return Reflect.get(_, key === "status" ? "_statusRef" : key, a);
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export { useScript as u };
|
package/dist/types.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ResolvableHead, LinkBase, DataKeys, SchemaAugmentations, BaseMeta, Style, ScriptBase, Noscript, HtmlAttributes, BodyAttributes } from 'unhead/types';
|
|
2
|
-
export { ActiveHeadEntry, Head, HeadEntryOptions, HeadTag,
|
|
3
|
-
import {
|
|
4
|
-
export { d as Base, B as BodyAttr, g as BodyAttributes, H as HtmlAttr, f as HtmlAttributes, L as Link,
|
|
2
|
+
export { ActiveHeadEntry, Head, HeadEntryOptions, HeadTag, NormalizedHead, RenderSSRHeadOptions, ResolvableHead, ResolvedBase, ResolvedBodyAttributes, ResolvedHtmlAttributes, ResolvedLink, ResolvedMeta, ResolvedNoscript, ResolvedScript, ResolvedStyle, ResolvedTitle, ResolvedTitleTemplate, SerializableHead, Unhead } from 'unhead/types';
|
|
3
|
+
import { i as ResolvableValue, k as ResolvableProperties } from './shared/vue.BkDIgqrM.mjs';
|
|
4
|
+
export { d as Base, B as BodyAttr, g as BodyAttributes, H as HtmlAttr, f as HtmlAttributes, L as Link, h as MaybeFalsy, 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.BkDIgqrM.mjs';
|
|
5
5
|
import 'vue';
|
|
6
6
|
|
|
7
7
|
type SafeBodyAttr = ResolvableProperties<Pick<BodyAttributes, 'id' | 'class' | 'style'> & DataKeys & SchemaAugmentations['bodyAttrs']>;
|
package/dist/types.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ResolvableHead, LinkBase, DataKeys, SchemaAugmentations, BaseMeta, Style, ScriptBase, Noscript, HtmlAttributes, BodyAttributes } from 'unhead/types';
|
|
2
|
-
export { ActiveHeadEntry, Head, HeadEntryOptions, HeadTag,
|
|
3
|
-
import {
|
|
4
|
-
export { d as Base, B as BodyAttr, g as BodyAttributes, H as HtmlAttr, f as HtmlAttributes, L as Link,
|
|
2
|
+
export { ActiveHeadEntry, Head, HeadEntryOptions, HeadTag, NormalizedHead, RenderSSRHeadOptions, ResolvableHead, ResolvedBase, ResolvedBodyAttributes, ResolvedHtmlAttributes, ResolvedLink, ResolvedMeta, ResolvedNoscript, ResolvedScript, ResolvedStyle, ResolvedTitle, ResolvedTitleTemplate, SerializableHead, Unhead } from 'unhead/types';
|
|
3
|
+
import { i as ResolvableValue, k as ResolvableProperties } from './shared/vue.BkDIgqrM.js';
|
|
4
|
+
export { d as Base, B as BodyAttr, g as BodyAttributes, H as HtmlAttr, f as HtmlAttributes, L as Link, h as MaybeFalsy, 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.BkDIgqrM.js';
|
|
5
5
|
import 'vue';
|
|
6
6
|
|
|
7
7
|
type SafeBodyAttr = ResolvableProperties<Pick<BodyAttributes, 'id' | 'class' | 'style'> & DataKeys & SchemaAugmentations['bodyAttrs']>;
|
package/dist/utils.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PropResolver
|
|
1
|
+
import { PropResolver } from 'unhead/types';
|
|
2
2
|
export * from 'unhead/utils';
|
|
3
3
|
|
|
4
4
|
declare const VueResolver: PropResolver;
|
|
@@ -6,6 +6,6 @@ declare const VueResolver: PropResolver;
|
|
|
6
6
|
/**
|
|
7
7
|
* @deprecated Use head.resolveTags() instead
|
|
8
8
|
*/
|
|
9
|
-
declare function resolveUnrefHeadInput(input:
|
|
9
|
+
declare function resolveUnrefHeadInput<T extends Record<string, any>>(input: T): T;
|
|
10
10
|
|
|
11
11
|
export { VueResolver, resolveUnrefHeadInput };
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PropResolver
|
|
1
|
+
import { PropResolver } from 'unhead/types';
|
|
2
2
|
export * from 'unhead/utils';
|
|
3
3
|
|
|
4
4
|
declare const VueResolver: PropResolver;
|
|
@@ -6,6 +6,6 @@ declare const VueResolver: PropResolver;
|
|
|
6
6
|
/**
|
|
7
7
|
* @deprecated Use head.resolveTags() instead
|
|
8
8
|
*/
|
|
9
|
-
declare function resolveUnrefHeadInput(input:
|
|
9
|
+
declare function resolveUnrefHeadInput<T extends Record<string, any>>(input: T): T;
|
|
10
10
|
|
|
11
11
|
export { VueResolver, resolveUnrefHeadInput };
|
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.
|
|
4
|
+
"version": "2.0.0-alpha.27",
|
|
5
5
|
"description": "Full-stack <head> manager built for Vue.",
|
|
6
6
|
"author": "Harlan Wilton <harlan@harlanzw.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -109,7 +109,7 @@
|
|
|
109
109
|
},
|
|
110
110
|
"dependencies": {
|
|
111
111
|
"hookable": "^5.5.3",
|
|
112
|
-
"unhead": "2.0.0-alpha.
|
|
112
|
+
"unhead": "2.0.0-alpha.27"
|
|
113
113
|
},
|
|
114
114
|
"scripts": {
|
|
115
115
|
"build": "unbuild .",
|