@unhead/vue 2.0.0-alpha.11 → 2.0.0-alpha.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/legacy.d.mts +1 -2
- package/dist/legacy.d.ts +1 -2
- package/dist/legacy.mjs +5 -30
- package/dist/plugins.d.mts +2 -0
- package/dist/plugins.d.ts +2 -0
- package/dist/plugins.mjs +1 -0
- package/dist/server.d.mts +1 -1
- package/dist/server.d.ts +1 -1
- package/dist/server.mjs +1 -1
- package/dist/types.d.mts +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/utils.d.mts +1 -0
- package/dist/utils.d.ts +1 -0
- package/dist/utils.mjs +1 -0
- package/package.json +19 -3
- package/plugins.d.ts +1 -0
- package/utils.d.ts +1 -0
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { createHeadCore } from 'unhead';
|
|
2
2
|
import { MergeHead, ActiveHeadEntry } from 'unhead/types';
|
|
3
|
-
export { ActiveHeadEntry, Head, HeadEntryOptions, HeadTag, MergeHead, ResolvedHead, Unhead } from 'unhead/types';
|
|
3
|
+
export { ActiveHeadEntry, Head, HeadEntryOptions, HeadTag, MergeHead, RenderSSRHeadOptions, ResolvedBase, ResolvedBodyAttributes, ResolvedHead, ResolvedHtmlAttributes, ResolvedLink, ResolvedMeta, ResolvedNoscript, ResolvedScript, ResolvedStyle, ResolvedTitle, ResolvedTitleTemplate, Unhead } from 'unhead/types';
|
|
4
4
|
import { VueHeadClient, UseHeadInput, UseHeadOptions, UseHeadSafeInput, UseSeoMetaInput } from './types.mjs';
|
|
5
5
|
export { Base, BodyAttr, BodyAttributes, HeadSafe, HtmlAttr, HtmlAttributes, Link, MaybeComputedRef, Meta, Noscript, ReactiveHead, ResolvableArray, ResolvableProperties, Script, Style, Title, TitleTemplate } from './types.mjs';
|
|
6
6
|
export { V as VueHeadMixin } from './shared/vue.DnywREVF.mjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { createHeadCore } from 'unhead';
|
|
2
2
|
import { MergeHead, ActiveHeadEntry } from 'unhead/types';
|
|
3
|
-
export { ActiveHeadEntry, Head, HeadEntryOptions, HeadTag, MergeHead, ResolvedHead, Unhead } from 'unhead/types';
|
|
3
|
+
export { ActiveHeadEntry, Head, HeadEntryOptions, HeadTag, MergeHead, RenderSSRHeadOptions, ResolvedBase, ResolvedBodyAttributes, ResolvedHead, ResolvedHtmlAttributes, ResolvedLink, ResolvedMeta, ResolvedNoscript, ResolvedScript, ResolvedStyle, ResolvedTitle, ResolvedTitleTemplate, Unhead } from 'unhead/types';
|
|
4
4
|
import { VueHeadClient, UseHeadInput, UseHeadOptions, UseHeadSafeInput, UseSeoMetaInput } from './types.js';
|
|
5
5
|
export { Base, BodyAttr, BodyAttributes, HeadSafe, HtmlAttr, HtmlAttributes, Link, MaybeComputedRef, Meta, Noscript, ReactiveHead, ResolvableArray, ResolvableProperties, Script, Style, Title, TitleTemplate } from './types.js';
|
|
6
6
|
export { V as VueHeadMixin } from './shared/vue.DnywREVF.js';
|
package/dist/legacy.d.mts
CHANGED
|
@@ -7,8 +7,6 @@ export { UseFunctionType, resolveScriptKey } from 'unhead/legacy';
|
|
|
7
7
|
import { Ref } from 'vue';
|
|
8
8
|
import { VueHeadClient, UseHeadInput, UseHeadOptions as UseHeadOptions$1, UseHeadSafeInput, UseSeoMetaInput } from './types.mjs';
|
|
9
9
|
|
|
10
|
-
declare function resolveUnrefHeadInput(ref: any): any;
|
|
11
|
-
|
|
12
10
|
interface VueScriptInstance<T extends Record<symbol | string, any>> extends Omit<ScriptInstance<T>, 'status'> {
|
|
13
11
|
status: Ref<UseScriptStatus>;
|
|
14
12
|
}
|
|
@@ -35,6 +33,7 @@ type UseScriptContext<T extends Record<symbol | string, any>> = Promise<T> & Vue
|
|
|
35
33
|
type UseScriptReturn<T extends Record<symbol | string, any>> = UseScriptContext<UseFunctionType<UseScriptOptions<T>, T>>;
|
|
36
34
|
declare function useScript<T extends Record<symbol | string, any> = Record<symbol | string, any>>(_input: UseScriptInput, _options?: UseScriptOptions<T>): UseScriptReturn<T>;
|
|
37
35
|
|
|
36
|
+
declare function resolveUnrefHeadInput(input: any): any;
|
|
38
37
|
declare function CapoPlugin(): unhead_types.HeadPluginInput;
|
|
39
38
|
declare function createHead<T extends MergeHead>(options?: CreateClientHeadOptions): VueHeadClient<T>;
|
|
40
39
|
declare function createServerHead<T extends MergeHead>(options?: CreateClientHeadOptions): VueHeadClient<T>;
|
package/dist/legacy.d.ts
CHANGED
|
@@ -7,8 +7,6 @@ export { UseFunctionType, resolveScriptKey } from 'unhead/legacy';
|
|
|
7
7
|
import { Ref } from 'vue';
|
|
8
8
|
import { VueHeadClient, UseHeadInput, UseHeadOptions as UseHeadOptions$1, UseHeadSafeInput, UseSeoMetaInput } from './types.js';
|
|
9
9
|
|
|
10
|
-
declare function resolveUnrefHeadInput(ref: any): any;
|
|
11
|
-
|
|
12
10
|
interface VueScriptInstance<T extends Record<symbol | string, any>> extends Omit<ScriptInstance<T>, 'status'> {
|
|
13
11
|
status: Ref<UseScriptStatus>;
|
|
14
12
|
}
|
|
@@ -35,6 +33,7 @@ type UseScriptContext<T extends Record<symbol | string, any>> = Promise<T> & Vue
|
|
|
35
33
|
type UseScriptReturn<T extends Record<symbol | string, any>> = UseScriptContext<UseFunctionType<UseScriptOptions<T>, T>>;
|
|
36
34
|
declare function useScript<T extends Record<symbol | string, any> = Record<symbol | string, any>>(_input: UseScriptInput, _options?: UseScriptOptions<T>): UseScriptReturn<T>;
|
|
37
35
|
|
|
36
|
+
declare function resolveUnrefHeadInput(input: any): any;
|
|
38
37
|
declare function CapoPlugin(): unhead_types.HeadPluginInput;
|
|
39
38
|
declare function createHead<T extends MergeHead>(options?: CreateClientHeadOptions): VueHeadClient<T>;
|
|
40
39
|
declare function createServerHead<T extends MergeHead>(options?: CreateClientHeadOptions): VueHeadClient<T>;
|
package/dist/legacy.mjs
CHANGED
|
@@ -2,9 +2,9 @@ export { createHeadCore } from 'unhead';
|
|
|
2
2
|
import { DeprecationsPlugin, PromisesPlugin, TemplateParamsPlugin, AliasSortingPlugin, SafeInputPlugin, FlatMetaPlugin } from 'unhead/plugins';
|
|
3
3
|
import { defineHeadPlugin } from 'unhead/utils';
|
|
4
4
|
import { walkResolver } from 'unhead/utils/walkResolver';
|
|
5
|
-
import {
|
|
5
|
+
import { getCurrentInstance, onMounted, isRef, watch, onScopeDispose, ref, inject, watchEffect, unref, onBeforeUnmount, onDeactivated, onActivated } from 'vue';
|
|
6
6
|
import { createHead as createHead$1 } from './client.mjs';
|
|
7
|
-
import { h as headSymbol } from './shared/vue.0vTsLwbU.mjs';
|
|
7
|
+
import { V as VueResolver, h as headSymbol } from './shared/vue.0vTsLwbU.mjs';
|
|
8
8
|
import { createHead as createHead$2 } from './server.mjs';
|
|
9
9
|
import { useScript as useScript$1 } from 'unhead/legacy';
|
|
10
10
|
export { resolveScriptKey } from 'unhead/legacy';
|
|
@@ -12,34 +12,6 @@ import 'unhead/client';
|
|
|
12
12
|
import './shared/vue.BOii_fac.mjs';
|
|
13
13
|
import 'unhead/server';
|
|
14
14
|
|
|
15
|
-
function resolveUnref(r) {
|
|
16
|
-
return typeof r === "function" ? r() : unref(r);
|
|
17
|
-
}
|
|
18
|
-
function resolveUnrefHeadInput(ref) {
|
|
19
|
-
if (ref instanceof Promise || ref instanceof Date || ref instanceof RegExp)
|
|
20
|
-
return ref;
|
|
21
|
-
const root = resolveUnref(ref);
|
|
22
|
-
if (!ref || !root)
|
|
23
|
-
return root;
|
|
24
|
-
if (Array.isArray(root))
|
|
25
|
-
return root.map((r) => resolveUnrefHeadInput(r));
|
|
26
|
-
if (typeof root === "object") {
|
|
27
|
-
const resolved = {};
|
|
28
|
-
for (const k in root) {
|
|
29
|
-
if (!Object.prototype.hasOwnProperty.call(root, k)) {
|
|
30
|
-
continue;
|
|
31
|
-
}
|
|
32
|
-
if (k === "titleTemplate" || k[0] === "o" && k[1] === "n") {
|
|
33
|
-
resolved[k] = unref(root[k]);
|
|
34
|
-
continue;
|
|
35
|
-
}
|
|
36
|
-
resolved[k] = resolveUnrefHeadInput(root[k]);
|
|
37
|
-
}
|
|
38
|
-
return resolved;
|
|
39
|
-
}
|
|
40
|
-
return root;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
15
|
function registerVueScopeHandlers(script, scope) {
|
|
44
16
|
if (!scope) {
|
|
45
17
|
return;
|
|
@@ -105,6 +77,9 @@ function useScript(_input, _options) {
|
|
|
105
77
|
});
|
|
106
78
|
}
|
|
107
79
|
|
|
80
|
+
function resolveUnrefHeadInput(input) {
|
|
81
|
+
return walkResolver(input, VueResolver);
|
|
82
|
+
}
|
|
108
83
|
function CapoPlugin() {
|
|
109
84
|
return defineHeadPlugin({
|
|
110
85
|
key: "capo"
|
package/dist/plugins.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from 'unhead/plugins';
|
package/dist/server.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { VueHeadClient } from '@unhead/vue';
|
|
2
2
|
import { MergeHead, CreateServerHeadOptions } from 'unhead/types';
|
|
3
3
|
export { V as VueHeadMixin } from './shared/vue.DnywREVF.mjs';
|
|
4
|
-
export { SSRHeadPayload, extractUnheadInputFromHtml, renderSSRHead, transformHtmlTemplate } from 'unhead/server';
|
|
4
|
+
export { SSRHeadPayload, extractUnheadInputFromHtml, propsToString, renderSSRHead, transformHtmlTemplate } from 'unhead/server';
|
|
5
5
|
|
|
6
6
|
declare function createHead<T extends MergeHead>(options?: Omit<CreateServerHeadOptions, 'propsResolver'>): VueHeadClient<T>;
|
|
7
7
|
|
package/dist/server.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { VueHeadClient } from '@unhead/vue';
|
|
2
2
|
import { MergeHead, CreateServerHeadOptions } from 'unhead/types';
|
|
3
3
|
export { V as VueHeadMixin } from './shared/vue.DnywREVF.js';
|
|
4
|
-
export { SSRHeadPayload, extractUnheadInputFromHtml, renderSSRHead, transformHtmlTemplate } from 'unhead/server';
|
|
4
|
+
export { SSRHeadPayload, extractUnheadInputFromHtml, propsToString, renderSSRHead, transformHtmlTemplate } from 'unhead/server';
|
|
5
5
|
|
|
6
6
|
declare function createHead<T extends MergeHead>(options?: Omit<CreateServerHeadOptions, 'propsResolver'>): VueHeadClient<T>;
|
|
7
7
|
|
package/dist/server.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createHead as createHead$1 } from 'unhead/server';
|
|
2
|
-
export { extractUnheadInputFromHtml, renderSSRHead, transformHtmlTemplate } from 'unhead/server';
|
|
2
|
+
export { extractUnheadInputFromHtml, propsToString, renderSSRHead, transformHtmlTemplate } from 'unhead/server';
|
|
3
3
|
import { V as VueResolver, v as vueInstall } from './shared/vue.0vTsLwbU.mjs';
|
|
4
4
|
export { V as VueHeadMixin } from './shared/vue.BOii_fac.mjs';
|
|
5
5
|
import 'unhead/plugins';
|
package/dist/types.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Falsey, BaseHtmlAttr, MaybeArray, BaseBodyAttr, MaybeFunction, ResolvableValues, 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, BodyEvents, MergeHead, HeadEntryOptions, MetaFlatInput, Unhead, SafeMeta, SafeLink, SafeNoscript, SafeScript, SafeHtmlAttr, SafeBodyAttr } from 'unhead/types';
|
|
2
|
-
export { ActiveHeadEntry, Head, HeadEntryOptions, HeadTag, MergeHead, ResolvedHead, Unhead } from 'unhead/types';
|
|
2
|
+
export { ActiveHeadEntry, Head, HeadEntryOptions, HeadTag, MergeHead, RenderSSRHeadOptions, ResolvedBase, ResolvedBodyAttributes, ResolvedHead, ResolvedHtmlAttributes, ResolvedLink, ResolvedMeta, ResolvedNoscript, ResolvedScript, ResolvedStyle, ResolvedTitle, ResolvedTitleTemplate, Unhead } from 'unhead/types';
|
|
3
3
|
import { ComputedRef, Ref, Plugin } from 'vue';
|
|
4
4
|
|
|
5
5
|
type MaybeComputedRef<T> = T | (() => T) | ComputedRef<T> | Ref<T>;
|
package/dist/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Falsey, BaseHtmlAttr, MaybeArray, BaseBodyAttr, MaybeFunction, ResolvableValues, 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, BodyEvents, MergeHead, HeadEntryOptions, MetaFlatInput, Unhead, SafeMeta, SafeLink, SafeNoscript, SafeScript, SafeHtmlAttr, SafeBodyAttr } from 'unhead/types';
|
|
2
|
-
export { ActiveHeadEntry, Head, HeadEntryOptions, HeadTag, MergeHead, ResolvedHead, Unhead } from 'unhead/types';
|
|
2
|
+
export { ActiveHeadEntry, Head, HeadEntryOptions, HeadTag, MergeHead, RenderSSRHeadOptions, ResolvedBase, ResolvedBodyAttributes, ResolvedHead, ResolvedHtmlAttributes, ResolvedLink, ResolvedMeta, ResolvedNoscript, ResolvedScript, ResolvedStyle, ResolvedTitle, ResolvedTitleTemplate, Unhead } from 'unhead/types';
|
|
3
3
|
import { ComputedRef, Ref, Plugin } from 'vue';
|
|
4
4
|
|
|
5
5
|
type MaybeComputedRef<T> = T | (() => T) | ComputedRef<T> | Ref<T>;
|
package/dist/utils.d.mts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from 'unhead/utils';
|
package/dist/utils.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from 'unhead/utils';
|
package/dist/utils.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from 'unhead/utils';
|
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.12",
|
|
5
5
|
"description": "Full-stack <head> manager built for Vue.",
|
|
6
6
|
"author": "Harlan Wilton <harlan@harlanzw.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -44,6 +44,14 @@
|
|
|
44
44
|
"./legacy": {
|
|
45
45
|
"types": "./dist/legacy.d.ts",
|
|
46
46
|
"import": "./dist/legacy.mjs"
|
|
47
|
+
},
|
|
48
|
+
"./plugins": {
|
|
49
|
+
"types": "./dist/plugins.d.ts",
|
|
50
|
+
"import": "./dist/plugins.mjs"
|
|
51
|
+
},
|
|
52
|
+
"./utils": {
|
|
53
|
+
"types": "./dist/utils.d.ts",
|
|
54
|
+
"import": "./dist/utils.mjs"
|
|
47
55
|
}
|
|
48
56
|
},
|
|
49
57
|
"main": "dist/index.mjs",
|
|
@@ -65,6 +73,12 @@
|
|
|
65
73
|
],
|
|
66
74
|
"legacy": [
|
|
67
75
|
"dist/legacy"
|
|
76
|
+
],
|
|
77
|
+
"plugins": [
|
|
78
|
+
"dist/plugins"
|
|
79
|
+
],
|
|
80
|
+
"utils": [
|
|
81
|
+
"dist/utils"
|
|
68
82
|
]
|
|
69
83
|
}
|
|
70
84
|
},
|
|
@@ -73,7 +87,9 @@
|
|
|
73
87
|
"dist",
|
|
74
88
|
"legacy.d.ts",
|
|
75
89
|
"server.d.ts",
|
|
76
|
-
"types.d.ts"
|
|
90
|
+
"types.d.ts",
|
|
91
|
+
"plugins.d.ts",
|
|
92
|
+
"utils.d.ts"
|
|
77
93
|
],
|
|
78
94
|
"peerDependencies": {
|
|
79
95
|
"vue": ">=3.5.13"
|
|
@@ -85,7 +101,7 @@
|
|
|
85
101
|
},
|
|
86
102
|
"dependencies": {
|
|
87
103
|
"hookable": "^5.5.3",
|
|
88
|
-
"unhead": "2.0.0-alpha.
|
|
104
|
+
"unhead": "2.0.0-alpha.12"
|
|
89
105
|
},
|
|
90
106
|
"scripts": {
|
|
91
107
|
"build": "unbuild .",
|
package/plugins.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './dist/plugins'
|
package/utils.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './dist/utils'
|