@unhead/vue 2.0.0-alpha.2 → 2.0.0-alpha.4
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.cjs +4 -4
- package/dist/client.d.cts +2 -5
- package/dist/client.d.mts +2 -5
- package/dist/client.d.ts +2 -5
- package/dist/client.mjs +3 -3
- package/dist/components.cjs +3 -2
- package/dist/components.mjs +2 -1
- package/dist/index.cjs +13 -55
- package/dist/index.d.cts +8 -17
- package/dist/index.d.mts +8 -17
- package/dist/index.d.ts +8 -17
- package/dist/index.mjs +5 -48
- package/dist/legacy.cjs +31 -8
- package/dist/legacy.d.cts +22 -21
- package/dist/legacy.d.mts +22 -21
- package/dist/legacy.d.ts +22 -21
- package/dist/legacy.mjs +29 -6
- package/dist/server.cjs +5 -5
- package/dist/server.d.cts +2 -5
- package/dist/server.d.mts +2 -5
- package/dist/server.d.ts +2 -5
- package/dist/server.mjs +4 -4
- package/dist/shared/{vue.BmaKl8wu.mjs → vue.51u-UkLG.mjs} +1 -1
- package/dist/shared/vue.BF-HCrO8.d.cts +3 -0
- package/dist/shared/vue.BF-HCrO8.d.mts +3 -0
- package/dist/shared/vue.BF-HCrO8.d.ts +3 -0
- package/dist/shared/{vue.Adq3bKYb.cjs → vue.Btxz9wTa.cjs} +38 -1
- package/dist/shared/{vue.BqrzivMs.mjs → vue.CNiRntV8.mjs} +1 -1
- package/dist/shared/{vue.DUgB2y83.mjs → vue.D2UzSD_b.mjs} +34 -2
- package/dist/shared/{vue.DTOQraae.cjs → vue.DFf1FJKf.cjs} +2 -2
- package/dist/shared/{vue.BFi59n5j.cjs → vue.rzkVHzqg.cjs} +2 -2
- package/dist/types.cjs +2 -0
- package/dist/{shared/vue.B8gXlHM7.d.cts → types.d.cts} +2 -3
- package/dist/{shared/vue.B8gXlHM7.d.mts → types.d.mts} +2 -3
- package/dist/{shared/vue.B8gXlHM7.d.ts → types.d.ts} +2 -3
- package/dist/types.mjs +1 -0
- package/legacy.d.ts +1 -0
- package/package.json +24 -6
- package/types.d.ts +1 -0
- package/dist/shared/vue.Bjx6RvLp.d.cts +0 -191
- package/dist/shared/vue.Bjx6RvLp.d.mts +0 -191
- package/dist/shared/vue.Bjx6RvLp.d.ts +0 -191
package/dist/client.cjs
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
const client = require('unhead/client');
|
|
4
4
|
const vue = require('vue');
|
|
5
|
-
const
|
|
6
|
-
const VueReactivityPlugin = require('./shared/vue.
|
|
7
|
-
const VueHeadMixin = require('./shared/vue.
|
|
5
|
+
const composables = require('./shared/vue.Btxz9wTa.cjs');
|
|
6
|
+
const VueReactivityPlugin = require('./shared/vue.rzkVHzqg.cjs');
|
|
7
|
+
const VueHeadMixin = require('./shared/vue.DFf1FJKf.cjs');
|
|
8
8
|
require('@unhead/shared');
|
|
9
9
|
|
|
10
10
|
function createHead(options = {}) {
|
|
@@ -18,7 +18,7 @@ function createHead(options = {}) {
|
|
|
18
18
|
VueReactivityPlugin.VueReactivityPlugin
|
|
19
19
|
]
|
|
20
20
|
});
|
|
21
|
-
head.install =
|
|
21
|
+
head.install = composables.vueInstall(head);
|
|
22
22
|
return head;
|
|
23
23
|
}
|
|
24
24
|
|
package/dist/client.d.cts
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import { MergeHead, CreateClientHeadOptions } from '@unhead/schema';
|
|
2
|
-
import {
|
|
2
|
+
import { VueHeadClient } from '@unhead/vue';
|
|
3
3
|
export { V as VueHeadMixin } from './shared/vue.DnywREVF.cjs';
|
|
4
4
|
export * from 'unhead/client';
|
|
5
|
-
import '@unhead/shared';
|
|
6
|
-
import 'unhead';
|
|
7
|
-
import 'vue';
|
|
8
5
|
|
|
9
|
-
declare function createHead<T extends MergeHead>(options?: CreateClientHeadOptions):
|
|
6
|
+
declare function createHead<T extends MergeHead>(options?: CreateClientHeadOptions): VueHeadClient<T>;
|
|
10
7
|
|
|
11
8
|
export { createHead };
|
package/dist/client.d.mts
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import { MergeHead, CreateClientHeadOptions } from '@unhead/schema';
|
|
2
|
-
import {
|
|
2
|
+
import { VueHeadClient } from '@unhead/vue';
|
|
3
3
|
export { V as VueHeadMixin } from './shared/vue.DnywREVF.mjs';
|
|
4
4
|
export * from 'unhead/client';
|
|
5
|
-
import '@unhead/shared';
|
|
6
|
-
import 'unhead';
|
|
7
|
-
import 'vue';
|
|
8
5
|
|
|
9
|
-
declare function createHead<T extends MergeHead>(options?: CreateClientHeadOptions):
|
|
6
|
+
declare function createHead<T extends MergeHead>(options?: CreateClientHeadOptions): VueHeadClient<T>;
|
|
10
7
|
|
|
11
8
|
export { createHead };
|
package/dist/client.d.ts
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import { MergeHead, CreateClientHeadOptions } from '@unhead/schema';
|
|
2
|
-
import {
|
|
2
|
+
import { VueHeadClient } from '@unhead/vue';
|
|
3
3
|
export { V as VueHeadMixin } from './shared/vue.DnywREVF.js';
|
|
4
4
|
export * from 'unhead/client';
|
|
5
|
-
import '@unhead/shared';
|
|
6
|
-
import 'unhead';
|
|
7
|
-
import 'vue';
|
|
8
5
|
|
|
9
|
-
declare function createHead<T extends MergeHead>(options?: CreateClientHeadOptions):
|
|
6
|
+
declare function createHead<T extends MergeHead>(options?: CreateClientHeadOptions): VueHeadClient<T>;
|
|
10
7
|
|
|
11
8
|
export { createHead };
|
package/dist/client.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { createHead as createHead$1 } from 'unhead/client';
|
|
2
2
|
export * from 'unhead/client';
|
|
3
3
|
import { nextTick } from 'vue';
|
|
4
|
-
import { v as vueInstall } from './shared/vue.
|
|
5
|
-
import { V as VueReactivityPlugin } from './shared/vue.
|
|
6
|
-
export { V as VueHeadMixin } from './shared/vue.
|
|
4
|
+
import { v as vueInstall } from './shared/vue.D2UzSD_b.mjs';
|
|
5
|
+
import { V as VueReactivityPlugin } from './shared/vue.51u-UkLG.mjs';
|
|
6
|
+
export { V as VueHeadMixin } from './shared/vue.CNiRntV8.mjs';
|
|
7
7
|
import '@unhead/shared';
|
|
8
8
|
|
|
9
9
|
function createHead(options = {}) {
|
package/dist/components.cjs
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const vue = require('vue');
|
|
4
|
-
const
|
|
4
|
+
const composables = require('./shared/vue.Btxz9wTa.cjs');
|
|
5
|
+
require('@unhead/shared');
|
|
5
6
|
|
|
6
7
|
function addVNodeToHeadObj(node, obj) {
|
|
7
8
|
const nodeType = node.type;
|
|
@@ -46,7 +47,7 @@ const Head = /* @__PURE__ */ vue.defineComponent({
|
|
|
46
47
|
name: "Head",
|
|
47
48
|
setup(_, { slots }) {
|
|
48
49
|
const obj = vue.ref({});
|
|
49
|
-
const entry =
|
|
50
|
+
const entry = composables.useHead(obj);
|
|
50
51
|
vue.onBeforeUnmount(() => {
|
|
51
52
|
entry.dispose();
|
|
52
53
|
});
|
package/dist/components.mjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
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.D2UzSD_b.mjs';
|
|
3
|
+
import '@unhead/shared';
|
|
3
4
|
|
|
4
5
|
function addVNodeToHeadObj(node, obj) {
|
|
5
6
|
const nodeType = node.type;
|
package/dist/index.cjs
CHANGED
|
@@ -1,66 +1,24 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const shared = require('@unhead/shared');
|
|
4
3
|
const unhead = require('unhead');
|
|
5
|
-
const
|
|
6
|
-
const
|
|
4
|
+
const composables = require('./shared/vue.Btxz9wTa.cjs');
|
|
5
|
+
const shared = require('@unhead/shared');
|
|
6
|
+
const VueHeadMixin = require('./shared/vue.DFf1FJKf.cjs');
|
|
7
7
|
require('vue');
|
|
8
8
|
|
|
9
|
-
const coreComposableNames = [
|
|
10
|
-
"injectHead"
|
|
11
|
-
];
|
|
12
9
|
const unheadVueComposablesImports = {
|
|
13
|
-
"@unhead/vue": [
|
|
10
|
+
"@unhead/vue": ["injectHead", ...shared.composableNames]
|
|
14
11
|
};
|
|
15
12
|
|
|
16
|
-
function useHeadSafe(input, options = {}) {
|
|
17
|
-
return useHead.useHead(input, { ...options, transform: shared.whitelistSafeInput });
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
function useSeoMeta(input, options) {
|
|
21
|
-
const { title, titleTemplate, ...meta } = input;
|
|
22
|
-
return useHead.useHead({
|
|
23
|
-
title,
|
|
24
|
-
titleTemplate,
|
|
25
|
-
// @ts-expect-error runtime type
|
|
26
|
-
_flatMeta: meta
|
|
27
|
-
}, {
|
|
28
|
-
...options,
|
|
29
|
-
transform(t) {
|
|
30
|
-
const meta2 = shared.unpackMeta({ ...t._flatMeta });
|
|
31
|
-
delete t._flatMeta;
|
|
32
|
-
return {
|
|
33
|
-
// @ts-expect-error runtime type
|
|
34
|
-
...t,
|
|
35
|
-
meta: meta2
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
function useServerHead(input, options = {}) {
|
|
42
|
-
return useHead.useHead(input, { ...options, mode: "server" });
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
function useServerHeadSafe(input, options = {}) {
|
|
46
|
-
return useHeadSafe(input, { ...options, mode: "server" });
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
function useServerSeoMeta(input, options) {
|
|
50
|
-
return useSeoMeta(input, { ...options, mode: "server" });
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
const CapoPlugin = () => shared.defineHeadPlugin({});
|
|
54
|
-
|
|
55
13
|
exports.createHeadCore = unhead.createHeadCore;
|
|
56
|
-
exports.
|
|
57
|
-
exports.
|
|
58
|
-
exports.
|
|
14
|
+
exports.headSymbol = composables.headSymbol;
|
|
15
|
+
exports.injectHead = composables.injectHead;
|
|
16
|
+
exports.resolveUnrefHeadInput = composables.resolveUnrefHeadInput;
|
|
17
|
+
exports.useHead = composables.useHead;
|
|
18
|
+
exports.useHeadSafe = composables.useHeadSafe;
|
|
19
|
+
exports.useSeoMeta = composables.useSeoMeta;
|
|
20
|
+
exports.useServerHead = composables.useServerHead;
|
|
21
|
+
exports.useServerHeadSafe = composables.useServerHeadSafe;
|
|
22
|
+
exports.useServerSeoMeta = composables.useServerSeoMeta;
|
|
59
23
|
exports.VueHeadMixin = VueHeadMixin.VueHeadMixin;
|
|
60
|
-
exports.CapoPlugin = CapoPlugin;
|
|
61
24
|
exports.unheadVueComposablesImports = unheadVueComposablesImports;
|
|
62
|
-
exports.useHeadSafe = useHeadSafe;
|
|
63
|
-
exports.useSeoMeta = useSeoMeta;
|
|
64
|
-
exports.useServerHead = useServerHead;
|
|
65
|
-
exports.useServerHeadSafe = useServerHeadSafe;
|
|
66
|
-
exports.useServerSeoMeta = useServerSeoMeta;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import * as _unhead_schema from '@unhead/schema';
|
|
2
|
-
import { Unhead, MergeHead, ActiveHeadEntry } from '@unhead/schema';
|
|
3
|
-
export { ActiveHeadEntry, Head, HeadEntryOptions, HeadTag, MergeHead, Unhead } from '@unhead/schema';
|
|
4
1
|
export { createHeadCore } from 'unhead';
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
export { r as resolveUnrefHeadInput } from './shared/vue.BF-HCrO8.cjs';
|
|
3
|
+
import { MergeHead, ActiveHeadEntry } from '@unhead/schema';
|
|
4
|
+
export { ActiveHeadEntry, Head, HeadEntryOptions, HeadTag, MergeHead, ResolvedHead, Unhead } from '@unhead/schema';
|
|
5
|
+
import { VueHeadClient, UseHeadInput, UseHeadOptions, UseHeadSafeInput, UseSeoMetaInput } from './types.cjs';
|
|
6
|
+
export { Base, BodyAttr, BodyAttributes, HeadSafe, HtmlAttr, HtmlAttributes, Link, MaybeComputedRef, MaybeComputedRefEntries, MaybeComputedRefEntriesOnly, MaybeComputedRefOrFalsy, MaybeComputedRefOrPromise, MaybeReadonlyRef, Meta, Noscript, ReactiveHead, Script, Style, Title, TitleTemplate } from './types.cjs';
|
|
7
7
|
export { V as VueHeadMixin } from './shared/vue.DnywREVF.cjs';
|
|
8
8
|
import 'vue';
|
|
9
9
|
|
|
@@ -11,23 +11,14 @@ declare const unheadVueComposablesImports: {
|
|
|
11
11
|
'@unhead/vue': string[];
|
|
12
12
|
};
|
|
13
13
|
|
|
14
|
-
declare function injectHead():
|
|
15
|
-
|
|
14
|
+
declare function injectHead(): VueHeadClient<MergeHead>;
|
|
16
15
|
declare function useHead<T extends MergeHead>(input: UseHeadInput<T>, options?: UseHeadOptions): ActiveHeadEntry<UseHeadInput<T>>;
|
|
17
|
-
|
|
18
16
|
declare function useHeadSafe(input: UseHeadSafeInput, options?: UseHeadOptions): ActiveHeadEntry<any>;
|
|
19
|
-
|
|
20
17
|
declare function useSeoMeta(input: UseSeoMetaInput, options?: UseHeadOptions): ActiveHeadEntry<any>;
|
|
21
|
-
|
|
22
18
|
declare function useServerHead<T extends MergeHead>(input: UseHeadInput<T>, options?: UseHeadOptions): ActiveHeadEntry<any>;
|
|
23
|
-
|
|
24
19
|
declare function useServerHeadSafe(input: UseHeadSafeInput, options?: UseHeadOptions): ActiveHeadEntry<any>;
|
|
25
|
-
|
|
26
20
|
declare function useServerSeoMeta(input: UseSeoMetaInput, options?: UseHeadOptions): ActiveHeadEntry<UseSeoMetaInput>;
|
|
27
21
|
|
|
28
|
-
|
|
29
|
-
* @deprecated TODO remove
|
|
30
|
-
*/
|
|
31
|
-
declare const CapoPlugin: () => _unhead_schema.HeadPluginInput;
|
|
22
|
+
declare const headSymbol = "usehead";
|
|
32
23
|
|
|
33
|
-
export {
|
|
24
|
+
export { UseHeadInput, UseHeadOptions, UseHeadSafeInput, UseSeoMetaInput, VueHeadClient, headSymbol, injectHead, unheadVueComposablesImports, useHead, useHeadSafe, useSeoMeta, useServerHead, useServerHeadSafe, useServerSeoMeta };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import * as _unhead_schema from '@unhead/schema';
|
|
2
|
-
import { Unhead, MergeHead, ActiveHeadEntry } from '@unhead/schema';
|
|
3
|
-
export { ActiveHeadEntry, Head, HeadEntryOptions, HeadTag, MergeHead, Unhead } from '@unhead/schema';
|
|
4
1
|
export { createHeadCore } from 'unhead';
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
export { r as resolveUnrefHeadInput } from './shared/vue.BF-HCrO8.mjs';
|
|
3
|
+
import { MergeHead, ActiveHeadEntry } from '@unhead/schema';
|
|
4
|
+
export { ActiveHeadEntry, Head, HeadEntryOptions, HeadTag, MergeHead, ResolvedHead, Unhead } from '@unhead/schema';
|
|
5
|
+
import { VueHeadClient, UseHeadInput, UseHeadOptions, UseHeadSafeInput, UseSeoMetaInput } from './types.mjs';
|
|
6
|
+
export { Base, BodyAttr, BodyAttributes, HeadSafe, HtmlAttr, HtmlAttributes, Link, MaybeComputedRef, MaybeComputedRefEntries, MaybeComputedRefEntriesOnly, MaybeComputedRefOrFalsy, MaybeComputedRefOrPromise, MaybeReadonlyRef, Meta, Noscript, ReactiveHead, Script, Style, Title, TitleTemplate } from './types.mjs';
|
|
7
7
|
export { V as VueHeadMixin } from './shared/vue.DnywREVF.mjs';
|
|
8
8
|
import 'vue';
|
|
9
9
|
|
|
@@ -11,23 +11,14 @@ declare const unheadVueComposablesImports: {
|
|
|
11
11
|
'@unhead/vue': string[];
|
|
12
12
|
};
|
|
13
13
|
|
|
14
|
-
declare function injectHead():
|
|
15
|
-
|
|
14
|
+
declare function injectHead(): VueHeadClient<MergeHead>;
|
|
16
15
|
declare function useHead<T extends MergeHead>(input: UseHeadInput<T>, options?: UseHeadOptions): ActiveHeadEntry<UseHeadInput<T>>;
|
|
17
|
-
|
|
18
16
|
declare function useHeadSafe(input: UseHeadSafeInput, options?: UseHeadOptions): ActiveHeadEntry<any>;
|
|
19
|
-
|
|
20
17
|
declare function useSeoMeta(input: UseSeoMetaInput, options?: UseHeadOptions): ActiveHeadEntry<any>;
|
|
21
|
-
|
|
22
18
|
declare function useServerHead<T extends MergeHead>(input: UseHeadInput<T>, options?: UseHeadOptions): ActiveHeadEntry<any>;
|
|
23
|
-
|
|
24
19
|
declare function useServerHeadSafe(input: UseHeadSafeInput, options?: UseHeadOptions): ActiveHeadEntry<any>;
|
|
25
|
-
|
|
26
20
|
declare function useServerSeoMeta(input: UseSeoMetaInput, options?: UseHeadOptions): ActiveHeadEntry<UseSeoMetaInput>;
|
|
27
21
|
|
|
28
|
-
|
|
29
|
-
* @deprecated TODO remove
|
|
30
|
-
*/
|
|
31
|
-
declare const CapoPlugin: () => _unhead_schema.HeadPluginInput;
|
|
22
|
+
declare const headSymbol = "usehead";
|
|
32
23
|
|
|
33
|
-
export {
|
|
24
|
+
export { UseHeadInput, UseHeadOptions, UseHeadSafeInput, UseSeoMetaInput, VueHeadClient, headSymbol, injectHead, unheadVueComposablesImports, useHead, useHeadSafe, useSeoMeta, useServerHead, useServerHeadSafe, useServerSeoMeta };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import * as _unhead_schema from '@unhead/schema';
|
|
2
|
-
import { Unhead, MergeHead, ActiveHeadEntry } from '@unhead/schema';
|
|
3
|
-
export { ActiveHeadEntry, Head, HeadEntryOptions, HeadTag, MergeHead, Unhead } from '@unhead/schema';
|
|
4
1
|
export { createHeadCore } from 'unhead';
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
export { r as resolveUnrefHeadInput } from './shared/vue.BF-HCrO8.js';
|
|
3
|
+
import { MergeHead, ActiveHeadEntry } from '@unhead/schema';
|
|
4
|
+
export { ActiveHeadEntry, Head, HeadEntryOptions, HeadTag, MergeHead, ResolvedHead, Unhead } from '@unhead/schema';
|
|
5
|
+
import { VueHeadClient, UseHeadInput, UseHeadOptions, UseHeadSafeInput, UseSeoMetaInput } from './types.js';
|
|
6
|
+
export { Base, BodyAttr, BodyAttributes, HeadSafe, HtmlAttr, HtmlAttributes, Link, MaybeComputedRef, MaybeComputedRefEntries, MaybeComputedRefEntriesOnly, MaybeComputedRefOrFalsy, MaybeComputedRefOrPromise, MaybeReadonlyRef, Meta, Noscript, ReactiveHead, Script, Style, Title, TitleTemplate } from './types.js';
|
|
7
7
|
export { V as VueHeadMixin } from './shared/vue.DnywREVF.js';
|
|
8
8
|
import 'vue';
|
|
9
9
|
|
|
@@ -11,23 +11,14 @@ declare const unheadVueComposablesImports: {
|
|
|
11
11
|
'@unhead/vue': string[];
|
|
12
12
|
};
|
|
13
13
|
|
|
14
|
-
declare function injectHead():
|
|
15
|
-
|
|
14
|
+
declare function injectHead(): VueHeadClient<MergeHead>;
|
|
16
15
|
declare function useHead<T extends MergeHead>(input: UseHeadInput<T>, options?: UseHeadOptions): ActiveHeadEntry<UseHeadInput<T>>;
|
|
17
|
-
|
|
18
16
|
declare function useHeadSafe(input: UseHeadSafeInput, options?: UseHeadOptions): ActiveHeadEntry<any>;
|
|
19
|
-
|
|
20
17
|
declare function useSeoMeta(input: UseSeoMetaInput, options?: UseHeadOptions): ActiveHeadEntry<any>;
|
|
21
|
-
|
|
22
18
|
declare function useServerHead<T extends MergeHead>(input: UseHeadInput<T>, options?: UseHeadOptions): ActiveHeadEntry<any>;
|
|
23
|
-
|
|
24
19
|
declare function useServerHeadSafe(input: UseHeadSafeInput, options?: UseHeadOptions): ActiveHeadEntry<any>;
|
|
25
|
-
|
|
26
20
|
declare function useServerSeoMeta(input: UseSeoMetaInput, options?: UseHeadOptions): ActiveHeadEntry<UseSeoMetaInput>;
|
|
27
21
|
|
|
28
|
-
|
|
29
|
-
* @deprecated TODO remove
|
|
30
|
-
*/
|
|
31
|
-
declare const CapoPlugin: () => _unhead_schema.HeadPluginInput;
|
|
22
|
+
declare const headSymbol = "usehead";
|
|
32
23
|
|
|
33
|
-
export {
|
|
24
|
+
export { UseHeadInput, UseHeadOptions, UseHeadSafeInput, UseSeoMetaInput, VueHeadClient, headSymbol, injectHead, unheadVueComposablesImports, useHead, useHeadSafe, useSeoMeta, useServerHead, useServerHeadSafe, useServerSeoMeta };
|
package/dist/index.mjs
CHANGED
|
@@ -1,54 +1,11 @@
|
|
|
1
|
-
import { composableNames, whitelistSafeInput, unpackMeta, defineHeadPlugin } from '@unhead/shared';
|
|
2
1
|
export { createHeadCore } from 'unhead';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export { V as VueHeadMixin } from './shared/vue.
|
|
2
|
+
export { h as headSymbol, i as injectHead, r as resolveUnrefHeadInput, u as useHead, a as useHeadSafe, b as useSeoMeta, c as useServerHead, d as useServerHeadSafe, e as useServerSeoMeta } from './shared/vue.D2UzSD_b.mjs';
|
|
3
|
+
import { composableNames } from '@unhead/shared';
|
|
4
|
+
export { V as VueHeadMixin } from './shared/vue.CNiRntV8.mjs';
|
|
6
5
|
import 'vue';
|
|
7
6
|
|
|
8
|
-
const coreComposableNames = [
|
|
9
|
-
"injectHead"
|
|
10
|
-
];
|
|
11
7
|
const unheadVueComposablesImports = {
|
|
12
|
-
"@unhead/vue": [
|
|
8
|
+
"@unhead/vue": ["injectHead", ...composableNames]
|
|
13
9
|
};
|
|
14
10
|
|
|
15
|
-
|
|
16
|
-
return useHead(input, { ...options, transform: whitelistSafeInput });
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
function useSeoMeta(input, options) {
|
|
20
|
-
const { title, titleTemplate, ...meta } = input;
|
|
21
|
-
return useHead({
|
|
22
|
-
title,
|
|
23
|
-
titleTemplate,
|
|
24
|
-
// @ts-expect-error runtime type
|
|
25
|
-
_flatMeta: meta
|
|
26
|
-
}, {
|
|
27
|
-
...options,
|
|
28
|
-
transform(t) {
|
|
29
|
-
const meta2 = unpackMeta({ ...t._flatMeta });
|
|
30
|
-
delete t._flatMeta;
|
|
31
|
-
return {
|
|
32
|
-
// @ts-expect-error runtime type
|
|
33
|
-
...t,
|
|
34
|
-
meta: meta2
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
function useServerHead(input, options = {}) {
|
|
41
|
-
return useHead(input, { ...options, mode: "server" });
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
function useServerHeadSafe(input, options = {}) {
|
|
45
|
-
return useHeadSafe(input, { ...options, mode: "server" });
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
function useServerSeoMeta(input, options) {
|
|
49
|
-
return useSeoMeta(input, { ...options, mode: "server" });
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
const CapoPlugin = () => defineHeadPlugin({});
|
|
53
|
-
|
|
54
|
-
export { CapoPlugin, unheadVueComposablesImports, useHead, useHeadSafe, useSeoMeta, useServerHead, useServerHeadSafe, useServerSeoMeta };
|
|
11
|
+
export { unheadVueComposablesImports };
|
package/dist/legacy.cjs
CHANGED
|
@@ -2,14 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
const shared = require('@unhead/shared');
|
|
4
4
|
const unhead = require('unhead');
|
|
5
|
+
const plugins = require('unhead/plugins');
|
|
5
6
|
const vue = require('vue');
|
|
6
7
|
const client = require('./client.cjs');
|
|
7
|
-
const
|
|
8
|
+
const composables = require('./shared/vue.Btxz9wTa.cjs');
|
|
8
9
|
const server = require('./server.cjs');
|
|
9
10
|
const legacy = require('unhead/legacy');
|
|
10
11
|
require('unhead/client');
|
|
11
|
-
require('./shared/vue.
|
|
12
|
-
require('./shared/vue.
|
|
12
|
+
require('./shared/vue.rzkVHzqg.cjs');
|
|
13
|
+
require('./shared/vue.DFf1FJKf.cjs');
|
|
13
14
|
require('unhead/server');
|
|
14
15
|
|
|
15
16
|
function registerVueScopeHandlers(script, scope) {
|
|
@@ -78,10 +79,32 @@ function useScript(_input, _options) {
|
|
|
78
79
|
}
|
|
79
80
|
|
|
80
81
|
const CapoPlugin = () => shared.defineHeadPlugin({});
|
|
82
|
+
function createHead(options = {}) {
|
|
83
|
+
return client.createHead({
|
|
84
|
+
disableCapoSorting: true,
|
|
85
|
+
...options,
|
|
86
|
+
plugins: [
|
|
87
|
+
plugins.DeprecationsPlugin,
|
|
88
|
+
plugins.PromisesPlugin,
|
|
89
|
+
...options.plugins || []
|
|
90
|
+
]
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
function createServerHead(options = {}) {
|
|
94
|
+
return server.createHead({
|
|
95
|
+
disableCapoSorting: true,
|
|
96
|
+
...options,
|
|
97
|
+
plugins: [
|
|
98
|
+
plugins.DeprecationsPlugin,
|
|
99
|
+
plugins.PromisesPlugin,
|
|
100
|
+
...options.plugins || []
|
|
101
|
+
]
|
|
102
|
+
});
|
|
103
|
+
}
|
|
81
104
|
function setHeadInjectionHandler(handler) {
|
|
82
105
|
}
|
|
83
106
|
function injectHead() {
|
|
84
|
-
return vue.inject(
|
|
107
|
+
return vue.inject(composables.headSymbol);
|
|
85
108
|
}
|
|
86
109
|
function useHead(input, options = {}) {
|
|
87
110
|
const head = options.head || injectHead();
|
|
@@ -93,7 +116,7 @@ function clientUseHead(head, input, options = {}) {
|
|
|
93
116
|
const deactivated = vue.ref(false);
|
|
94
117
|
const resolvedInput = vue.ref({});
|
|
95
118
|
vue.watchEffect(() => {
|
|
96
|
-
resolvedInput.value = deactivated.value ? {} :
|
|
119
|
+
resolvedInput.value = deactivated.value ? {} : composables.resolveUnrefHeadInput(input);
|
|
97
120
|
});
|
|
98
121
|
const entry = head.push(resolvedInput.value, options);
|
|
99
122
|
vue.watch(resolvedInput, (e) => {
|
|
@@ -147,11 +170,11 @@ function useServerSeoMeta(input, options) {
|
|
|
147
170
|
}
|
|
148
171
|
|
|
149
172
|
exports.createHeadCore = unhead.createHeadCore;
|
|
150
|
-
exports.
|
|
151
|
-
exports.resolveUnrefHeadInput = useHead$1.resolveUnrefHeadInput;
|
|
152
|
-
exports.createServerHead = server.createHead;
|
|
173
|
+
exports.resolveUnrefHeadInput = composables.resolveUnrefHeadInput;
|
|
153
174
|
exports.resolveScriptKey = legacy.resolveScriptKey;
|
|
154
175
|
exports.CapoPlugin = CapoPlugin;
|
|
176
|
+
exports.createHead = createHead;
|
|
177
|
+
exports.createServerHead = createServerHead;
|
|
155
178
|
exports.injectHead = injectHead;
|
|
156
179
|
exports.setHeadInjectionHandler = setHeadInjectionHandler;
|
|
157
180
|
exports.useHead = useHead;
|
package/dist/legacy.d.cts
CHANGED
|
@@ -1,26 +1,20 @@
|
|
|
1
1
|
import * as _unhead_schema from '@unhead/schema';
|
|
2
|
-
import { ScriptBase, DataKeys, SchemaAugmentations, HeadEntryOptions,
|
|
3
|
-
import { V as VueHeadClient, U as UseHeadInput, a as UseHeadOptions, b as UseHeadSafeInput, c as UseSeoMetaInput } from './shared/vue.B8gXlHM7.cjs';
|
|
4
|
-
export { r as resolveUnrefHeadInput } from './shared/vue.B8gXlHM7.cjs';
|
|
2
|
+
import { ScriptBase, DataKeys, SchemaAugmentations, HeadEntryOptions, MergeHead, CreateClientHeadOptions, ActiveHeadEntry } from '@unhead/schema';
|
|
5
3
|
export { createHeadCore } from 'unhead';
|
|
6
|
-
export {
|
|
7
|
-
|
|
8
|
-
import { d as distExports } from './shared/vue.Bjx6RvLp.cjs';
|
|
4
|
+
export { r as resolveUnrefHeadInput } from './shared/vue.BF-HCrO8.cjs';
|
|
5
|
+
import { MaybeComputedRefEntriesOnly, UseHeadOptions } from '@unhead/vue';
|
|
9
6
|
import { ScriptInstance, UseScriptStatus, UseScriptOptions as UseScriptOptions$1, UseFunctionType } from 'unhead/legacy';
|
|
10
7
|
export { UseFunctionType, resolveScriptKey } from 'unhead/legacy';
|
|
11
8
|
import { Ref } from 'vue';
|
|
12
|
-
import './
|
|
13
|
-
import 'unhead/client';
|
|
14
|
-
import 'unhead/server';
|
|
15
|
-
import '@unhead/shared';
|
|
9
|
+
import { VueHeadClient, UseHeadInput, UseHeadOptions as UseHeadOptions$1, UseHeadSafeInput, UseSeoMetaInput } from './types.cjs';
|
|
16
10
|
|
|
17
11
|
interface VueScriptInstance<T extends Record<symbol | string, any>> extends Omit<ScriptInstance<T>, 'status'> {
|
|
18
12
|
status: Ref<UseScriptStatus>;
|
|
19
13
|
}
|
|
20
|
-
type UseScriptInput = string | (
|
|
14
|
+
type UseScriptInput = string | (MaybeComputedRefEntriesOnly<Omit<ScriptBase & DataKeys & SchemaAugmentations['script'], 'src'>> & {
|
|
21
15
|
src: string;
|
|
22
16
|
});
|
|
23
|
-
interface UseScriptOptions<T extends Record<symbol | string, any> = Record<string, any>> extends HeadEntryOptions, Pick<UseScriptOptions$1<T>, 'use' | 'eventContext' | 'beforeInit'> {
|
|
17
|
+
interface UseScriptOptions<T extends Record<symbol | string, any> = Record<string, any>> extends Omit<HeadEntryOptions, 'head'>, Pick<UseScriptOptions$1<T>, 'use' | 'eventContext' | 'beforeInit'> {
|
|
24
18
|
/**
|
|
25
19
|
* The trigger to load the script:
|
|
26
20
|
* - `undefined` | `client` - (Default) Load the script on the client when this js is loaded.
|
|
@@ -31,21 +25,28 @@ interface UseScriptOptions<T extends Record<symbol | string, any> = Record<strin
|
|
|
31
25
|
* - `ref` - Load the script when the ref is true.
|
|
32
26
|
*/
|
|
33
27
|
trigger?: UseScriptOptions$1['trigger'] | Ref<boolean>;
|
|
28
|
+
/**
|
|
29
|
+
* The Unhead instance to use.
|
|
30
|
+
*/
|
|
31
|
+
head?: UseHeadOptions['head'];
|
|
34
32
|
}
|
|
35
33
|
type UseScriptContext<T extends Record<symbol | string, any>> = Promise<T> & VueScriptInstance<T>;
|
|
36
|
-
|
|
34
|
+
type UseScriptReturn<T extends Record<symbol | string, any>> = UseScriptContext<UseFunctionType<UseScriptOptions<T>, T>>;
|
|
35
|
+
declare function useScript<T extends Record<symbol | string, any> = Record<symbol | string, any>>(_input: UseScriptInput, _options?: UseScriptOptions<T>): UseScriptReturn<T>;
|
|
37
36
|
|
|
38
37
|
declare const CapoPlugin: () => _unhead_schema.HeadPluginInput;
|
|
38
|
+
declare function createHead<T extends MergeHead>(options?: CreateClientHeadOptions): VueHeadClient<T>;
|
|
39
|
+
declare function createServerHead<T extends MergeHead>(options?: CreateClientHeadOptions): VueHeadClient<T>;
|
|
39
40
|
/**
|
|
40
41
|
* @deprecated Please switch to non-legacy version
|
|
41
42
|
*/
|
|
42
43
|
declare function setHeadInjectionHandler(handler: () => VueHeadClient<any> | undefined): void;
|
|
43
|
-
declare function injectHead():
|
|
44
|
-
declare function useHead<T extends MergeHead>(input: UseHeadInput<T>, options?: UseHeadOptions): ActiveHeadEntry<UseHeadInput<T>> | void;
|
|
45
|
-
declare function useHeadSafe(input: UseHeadSafeInput, options?: UseHeadOptions): ActiveHeadEntry<UseHeadSafeInput> | void;
|
|
46
|
-
declare function useSeoMeta(input: UseSeoMetaInput, options?: UseHeadOptions): ActiveHeadEntry<any> | void;
|
|
47
|
-
declare function useServerHead<T extends MergeHead>(input: UseHeadInput<T>, options?: UseHeadOptions): ActiveHeadEntry<any> | void;
|
|
48
|
-
declare function useServerHeadSafe(input: UseHeadSafeInput, options?: UseHeadOptions): ActiveHeadEntry<any> | void;
|
|
49
|
-
declare function useServerSeoMeta(input: UseSeoMetaInput, options?: UseHeadOptions): ActiveHeadEntry<any> | void;
|
|
44
|
+
declare function injectHead(): VueHeadClient<any> | undefined;
|
|
45
|
+
declare function useHead<T extends MergeHead>(input: UseHeadInput<T>, options?: UseHeadOptions$1): ActiveHeadEntry<UseHeadInput<T>> | void;
|
|
46
|
+
declare function useHeadSafe(input: UseHeadSafeInput, options?: UseHeadOptions$1): ActiveHeadEntry<UseHeadSafeInput> | void;
|
|
47
|
+
declare function useSeoMeta(input: UseSeoMetaInput, options?: UseHeadOptions$1): ActiveHeadEntry<any> | void;
|
|
48
|
+
declare function useServerHead<T extends MergeHead>(input: UseHeadInput<T>, options?: UseHeadOptions$1): ActiveHeadEntry<any> | void;
|
|
49
|
+
declare function useServerHeadSafe(input: UseHeadSafeInput, options?: UseHeadOptions$1): ActiveHeadEntry<any> | void;
|
|
50
|
+
declare function useServerSeoMeta(input: UseSeoMetaInput, options?: UseHeadOptions$1): ActiveHeadEntry<any> | void;
|
|
50
51
|
|
|
51
|
-
export { CapoPlugin, type UseScriptContext, type UseScriptInput, type UseScriptOptions, type VueScriptInstance, injectHead, setHeadInjectionHandler, useHead, useHeadSafe, useScript, useSeoMeta, useServerHead, useServerHeadSafe, useServerSeoMeta };
|
|
52
|
+
export { CapoPlugin, type UseScriptContext, type UseScriptInput, type UseScriptOptions, type UseScriptReturn, type VueScriptInstance, createHead, createServerHead, injectHead, setHeadInjectionHandler, useHead, useHeadSafe, useScript, useSeoMeta, useServerHead, useServerHeadSafe, useServerSeoMeta };
|
package/dist/legacy.d.mts
CHANGED
|
@@ -1,26 +1,20 @@
|
|
|
1
1
|
import * as _unhead_schema from '@unhead/schema';
|
|
2
|
-
import { ScriptBase, DataKeys, SchemaAugmentations, HeadEntryOptions,
|
|
3
|
-
import { V as VueHeadClient, U as UseHeadInput, a as UseHeadOptions, b as UseHeadSafeInput, c as UseSeoMetaInput } from './shared/vue.B8gXlHM7.mjs';
|
|
4
|
-
export { r as resolveUnrefHeadInput } from './shared/vue.B8gXlHM7.mjs';
|
|
2
|
+
import { ScriptBase, DataKeys, SchemaAugmentations, HeadEntryOptions, MergeHead, CreateClientHeadOptions, ActiveHeadEntry } from '@unhead/schema';
|
|
5
3
|
export { createHeadCore } from 'unhead';
|
|
6
|
-
export {
|
|
7
|
-
|
|
8
|
-
import { d as distExports } from './shared/vue.Bjx6RvLp.mjs';
|
|
4
|
+
export { r as resolveUnrefHeadInput } from './shared/vue.BF-HCrO8.mjs';
|
|
5
|
+
import { MaybeComputedRefEntriesOnly, UseHeadOptions } from '@unhead/vue';
|
|
9
6
|
import { ScriptInstance, UseScriptStatus, UseScriptOptions as UseScriptOptions$1, UseFunctionType } from 'unhead/legacy';
|
|
10
7
|
export { UseFunctionType, resolveScriptKey } from 'unhead/legacy';
|
|
11
8
|
import { Ref } from 'vue';
|
|
12
|
-
import './
|
|
13
|
-
import 'unhead/client';
|
|
14
|
-
import 'unhead/server';
|
|
15
|
-
import '@unhead/shared';
|
|
9
|
+
import { VueHeadClient, UseHeadInput, UseHeadOptions as UseHeadOptions$1, UseHeadSafeInput, UseSeoMetaInput } from './types.mjs';
|
|
16
10
|
|
|
17
11
|
interface VueScriptInstance<T extends Record<symbol | string, any>> extends Omit<ScriptInstance<T>, 'status'> {
|
|
18
12
|
status: Ref<UseScriptStatus>;
|
|
19
13
|
}
|
|
20
|
-
type UseScriptInput = string | (
|
|
14
|
+
type UseScriptInput = string | (MaybeComputedRefEntriesOnly<Omit<ScriptBase & DataKeys & SchemaAugmentations['script'], 'src'>> & {
|
|
21
15
|
src: string;
|
|
22
16
|
});
|
|
23
|
-
interface UseScriptOptions<T extends Record<symbol | string, any> = Record<string, any>> extends HeadEntryOptions, Pick<UseScriptOptions$1<T>, 'use' | 'eventContext' | 'beforeInit'> {
|
|
17
|
+
interface UseScriptOptions<T extends Record<symbol | string, any> = Record<string, any>> extends Omit<HeadEntryOptions, 'head'>, Pick<UseScriptOptions$1<T>, 'use' | 'eventContext' | 'beforeInit'> {
|
|
24
18
|
/**
|
|
25
19
|
* The trigger to load the script:
|
|
26
20
|
* - `undefined` | `client` - (Default) Load the script on the client when this js is loaded.
|
|
@@ -31,21 +25,28 @@ interface UseScriptOptions<T extends Record<symbol | string, any> = Record<strin
|
|
|
31
25
|
* - `ref` - Load the script when the ref is true.
|
|
32
26
|
*/
|
|
33
27
|
trigger?: UseScriptOptions$1['trigger'] | Ref<boolean>;
|
|
28
|
+
/**
|
|
29
|
+
* The Unhead instance to use.
|
|
30
|
+
*/
|
|
31
|
+
head?: UseHeadOptions['head'];
|
|
34
32
|
}
|
|
35
33
|
type UseScriptContext<T extends Record<symbol | string, any>> = Promise<T> & VueScriptInstance<T>;
|
|
36
|
-
|
|
34
|
+
type UseScriptReturn<T extends Record<symbol | string, any>> = UseScriptContext<UseFunctionType<UseScriptOptions<T>, T>>;
|
|
35
|
+
declare function useScript<T extends Record<symbol | string, any> = Record<symbol | string, any>>(_input: UseScriptInput, _options?: UseScriptOptions<T>): UseScriptReturn<T>;
|
|
37
36
|
|
|
38
37
|
declare const CapoPlugin: () => _unhead_schema.HeadPluginInput;
|
|
38
|
+
declare function createHead<T extends MergeHead>(options?: CreateClientHeadOptions): VueHeadClient<T>;
|
|
39
|
+
declare function createServerHead<T extends MergeHead>(options?: CreateClientHeadOptions): VueHeadClient<T>;
|
|
39
40
|
/**
|
|
40
41
|
* @deprecated Please switch to non-legacy version
|
|
41
42
|
*/
|
|
42
43
|
declare function setHeadInjectionHandler(handler: () => VueHeadClient<any> | undefined): void;
|
|
43
|
-
declare function injectHead():
|
|
44
|
-
declare function useHead<T extends MergeHead>(input: UseHeadInput<T>, options?: UseHeadOptions): ActiveHeadEntry<UseHeadInput<T>> | void;
|
|
45
|
-
declare function useHeadSafe(input: UseHeadSafeInput, options?: UseHeadOptions): ActiveHeadEntry<UseHeadSafeInput> | void;
|
|
46
|
-
declare function useSeoMeta(input: UseSeoMetaInput, options?: UseHeadOptions): ActiveHeadEntry<any> | void;
|
|
47
|
-
declare function useServerHead<T extends MergeHead>(input: UseHeadInput<T>, options?: UseHeadOptions): ActiveHeadEntry<any> | void;
|
|
48
|
-
declare function useServerHeadSafe(input: UseHeadSafeInput, options?: UseHeadOptions): ActiveHeadEntry<any> | void;
|
|
49
|
-
declare function useServerSeoMeta(input: UseSeoMetaInput, options?: UseHeadOptions): ActiveHeadEntry<any> | void;
|
|
44
|
+
declare function injectHead(): VueHeadClient<any> | undefined;
|
|
45
|
+
declare function useHead<T extends MergeHead>(input: UseHeadInput<T>, options?: UseHeadOptions$1): ActiveHeadEntry<UseHeadInput<T>> | void;
|
|
46
|
+
declare function useHeadSafe(input: UseHeadSafeInput, options?: UseHeadOptions$1): ActiveHeadEntry<UseHeadSafeInput> | void;
|
|
47
|
+
declare function useSeoMeta(input: UseSeoMetaInput, options?: UseHeadOptions$1): ActiveHeadEntry<any> | void;
|
|
48
|
+
declare function useServerHead<T extends MergeHead>(input: UseHeadInput<T>, options?: UseHeadOptions$1): ActiveHeadEntry<any> | void;
|
|
49
|
+
declare function useServerHeadSafe(input: UseHeadSafeInput, options?: UseHeadOptions$1): ActiveHeadEntry<any> | void;
|
|
50
|
+
declare function useServerSeoMeta(input: UseSeoMetaInput, options?: UseHeadOptions$1): ActiveHeadEntry<any> | void;
|
|
50
51
|
|
|
51
|
-
export { CapoPlugin, type UseScriptContext, type UseScriptInput, type UseScriptOptions, type VueScriptInstance, injectHead, setHeadInjectionHandler, useHead, useHeadSafe, useScript, useSeoMeta, useServerHead, useServerHeadSafe, useServerSeoMeta };
|
|
52
|
+
export { CapoPlugin, type UseScriptContext, type UseScriptInput, type UseScriptOptions, type UseScriptReturn, type VueScriptInstance, createHead, createServerHead, injectHead, setHeadInjectionHandler, useHead, useHeadSafe, useScript, useSeoMeta, useServerHead, useServerHeadSafe, useServerSeoMeta };
|