@unhead/vue 0.2.5 → 0.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -22
- package/dist/index.d.ts +6 -13
- package/dist/index.mjs +3 -23
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -26,16 +26,6 @@ function asArray(value) {
|
|
|
26
26
|
return Array.isArray(value) ? value : [value];
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
const VueTriggerDomPatchingOnUpdatesPlugin = (options) => {
|
|
30
|
-
return unhead.defineHeadPlugin({
|
|
31
|
-
hooks: {
|
|
32
|
-
"entries:updated": function(head) {
|
|
33
|
-
dom.debouncedRenderDOMHead(vue.nextTick, head, { document: options?.document });
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
};
|
|
38
|
-
|
|
39
29
|
const VueReactiveInputPlugin = () => {
|
|
40
30
|
return unhead.defineHeadPlugin({
|
|
41
31
|
hooks: {
|
|
@@ -275,6 +265,7 @@ function createHead(options = {}) {
|
|
|
275
265
|
];
|
|
276
266
|
const head = unhead.createHead({
|
|
277
267
|
...options,
|
|
268
|
+
domDelayFn: vue.nextTick,
|
|
278
269
|
plugins
|
|
279
270
|
});
|
|
280
271
|
const vuePlugin = {
|
|
@@ -299,16 +290,6 @@ function createHead(options = {}) {
|
|
|
299
290
|
return { ...vuePlugin, ...head };
|
|
300
291
|
}
|
|
301
292
|
|
|
302
|
-
function createDomHead(options = {}) {
|
|
303
|
-
return createHead({
|
|
304
|
-
...options,
|
|
305
|
-
plugins: [
|
|
306
|
-
VueTriggerDomPatchingOnUpdatesPlugin({ document: options?.document }),
|
|
307
|
-
...options.plugins || []
|
|
308
|
-
]
|
|
309
|
-
});
|
|
310
|
-
}
|
|
311
|
-
|
|
312
293
|
const HeadVuePlugin = function(_Vue) {
|
|
313
294
|
_Vue.mixin({
|
|
314
295
|
beforeCreate() {
|
|
@@ -337,9 +318,7 @@ const HeadVuePlugin = function(_Vue) {
|
|
|
337
318
|
|
|
338
319
|
exports.HeadVuePlugin = HeadVuePlugin;
|
|
339
320
|
exports.VueReactiveInputPlugin = VueReactiveInputPlugin;
|
|
340
|
-
exports.VueTriggerDomPatchingOnUpdatesPlugin = VueTriggerDomPatchingOnUpdatesPlugin;
|
|
341
321
|
exports.asArray = asArray;
|
|
342
|
-
exports.createDomHead = createDomHead;
|
|
343
322
|
exports.createHead = createHead;
|
|
344
323
|
exports.headSymbol = headSymbol;
|
|
345
324
|
exports.injectHead = injectHead;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { MaybeComputedRef, MaybeRef } from '@vueuse/shared';
|
|
2
2
|
export { MaybeComputedRef } from '@vueuse/shared';
|
|
3
3
|
import * as _unhead_schema from '@unhead/schema';
|
|
4
|
-
import { Title as Title$1, TitleTemplate as TitleTemplate$1, EntryAugmentation, Base as Base$1, Link as Link$1, Meta as Meta$1, Style as Style$1, Script as Script$1, Noscript as Noscript$1, DataKeys, SchemaAugmentations, DefinedValueOrEmptyObject, MergeHead, BaseHtmlAttr, MaybeArray, BaseBodyAttr, HeadEntryOptions, MetaFlatInput,
|
|
5
|
-
export { ActiveHeadEntry, Head,
|
|
6
|
-
import { RenderDomHeadOptions } from '@unhead/dom';
|
|
7
|
-
export * from '@unhead/dom';
|
|
4
|
+
import { Title as Title$1, TitleTemplate as TitleTemplate$1, EntryAugmentation, Base as Base$1, Link as Link$1, Meta as Meta$1, Style as Style$1, Script as Script$1, Noscript as Noscript$1, DataKeys, SchemaAugmentations, DefinedValueOrEmptyObject, MergeHead, BaseHtmlAttr, MaybeArray, BaseBodyAttr, HeadEntryOptions, MetaFlatInput, Unhead, CreateHeadOptions } from '@unhead/schema';
|
|
5
|
+
export { ActiveHeadEntry, Head, HeadEntryOptions, HeadTag, MergeHead, Unhead } from '@unhead/schema';
|
|
8
6
|
import { Plugin } from 'vue';
|
|
7
|
+
export * from '@unhead/dom';
|
|
9
8
|
|
|
10
9
|
declare type MaybeComputedRefEntries<T> = MaybeComputedRef<T> | {
|
|
11
10
|
[key in keyof T]?: MaybeComputedRef<T[key]>;
|
|
@@ -109,8 +108,6 @@ declare type UseHeadInput<T extends MergeHead = {}> = MaybeComputedRef<ReactiveH
|
|
|
109
108
|
declare function resolveUnrefHeadInput(ref: any): any;
|
|
110
109
|
declare function asArray<T>(value: Arrayable<T>): T[];
|
|
111
110
|
|
|
112
|
-
declare const VueTriggerDomPatchingOnUpdatesPlugin: (options?: RenderDomHeadOptions) => _unhead_schema.HeadPlugin;
|
|
113
|
-
|
|
114
111
|
declare const VueReactiveInputPlugin: () => _unhead_schema.HeadPlugin;
|
|
115
112
|
|
|
116
113
|
declare function useServerHead<T extends MergeHead>(input: UseHeadInput<T>, options?: HeadEntryOptions): void;
|
|
@@ -139,15 +136,11 @@ declare const useTagBase: (base: ReactiveHead['base']) => void;
|
|
|
139
136
|
declare const useHtmlAttrs: (attrs: ReactiveHead['htmlAttrs']) => void;
|
|
140
137
|
declare const useBodyAttrs: (attrs: ReactiveHead['bodyAttrs']) => void;
|
|
141
138
|
|
|
142
|
-
declare type VueHeadClient<T extends MergeHead> =
|
|
139
|
+
declare type VueHeadClient<T extends MergeHead> = Unhead<MaybeComputedRef<ReactiveHead<T>>> & Plugin;
|
|
143
140
|
declare const headSymbol = "usehead";
|
|
144
141
|
declare function injectHead<T extends MergeHead>(): VueHeadClient<T>;
|
|
145
|
-
declare function createHead<T extends MergeHead>(options?: CreateHeadOptions): VueHeadClient<T>;
|
|
146
|
-
|
|
147
|
-
declare function createDomHead<T extends MergeHead>(options?: CreateHeadOptions & {
|
|
148
|
-
document?: Document;
|
|
149
|
-
}): VueHeadClient<T>;
|
|
142
|
+
declare function createHead<T extends MergeHead>(options?: Omit<CreateHeadOptions, 'domDelayFn'>): VueHeadClient<T>;
|
|
150
143
|
|
|
151
144
|
declare const HeadVuePlugin: Plugin;
|
|
152
145
|
|
|
153
|
-
export { Arrayable, Base, BodyAttributes, HeadVuePlugin, HtmlAttributes, Link, MaybeComputedRefEntries, Meta, Noscript, ReactiveHead, Script, Style, Title, TitleTemplate, UseHeadInput, VueHeadClient, VueReactiveInputPlugin,
|
|
146
|
+
export { Arrayable, Base, BodyAttributes, HeadVuePlugin, HtmlAttributes, Link, MaybeComputedRefEntries, Meta, Noscript, ReactiveHead, Script, Style, Title, TitleTemplate, UseHeadInput, VueHeadClient, VueReactiveInputPlugin, asArray, createHead, headSymbol, injectHead, resolveUnrefHeadInput, useBodyAttrs, useHead, useHtmlAttrs, useServerBodyAttrs, useServerHead, useServerHtmlAttrs, useServerTagBase, useServerTagLink, useServerTagMeta, useServerTagMetaFlat, useServerTagNoscript, useServerTagScript, useServerTagStyle, useServerTagTitle, useServerTitleTemplate, useTagBase, useTagLink, useTagMeta, useTagMetaFlat, useTagNoscript, useTagScript, useTagStyle, useTagTitle, useTitleTemplate };
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { resolveUnref } from '@vueuse/shared';
|
|
2
|
-
import { unref,
|
|
2
|
+
import { unref, version, getCurrentInstance, ref, watchEffect, watch, onBeforeUnmount, inject, nextTick } from 'vue';
|
|
3
3
|
import { defineHeadPlugin, getActiveHead, HydratesStatePlugin, createHead as createHead$1 } from 'unhead';
|
|
4
|
-
import { debouncedRenderDOMHead } from '@unhead/dom';
|
|
5
4
|
export * from '@unhead/dom';
|
|
6
5
|
|
|
7
6
|
function resolveUnrefHeadInput(ref) {
|
|
@@ -25,16 +24,6 @@ function asArray(value) {
|
|
|
25
24
|
return Array.isArray(value) ? value : [value];
|
|
26
25
|
}
|
|
27
26
|
|
|
28
|
-
const VueTriggerDomPatchingOnUpdatesPlugin = (options) => {
|
|
29
|
-
return defineHeadPlugin({
|
|
30
|
-
hooks: {
|
|
31
|
-
"entries:updated": function(head) {
|
|
32
|
-
debouncedRenderDOMHead(nextTick, head, { document: options?.document });
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
};
|
|
37
|
-
|
|
38
27
|
const VueReactiveInputPlugin = () => {
|
|
39
28
|
return defineHeadPlugin({
|
|
40
29
|
hooks: {
|
|
@@ -274,6 +263,7 @@ function createHead(options = {}) {
|
|
|
274
263
|
];
|
|
275
264
|
const head = createHead$1({
|
|
276
265
|
...options,
|
|
266
|
+
domDelayFn: nextTick,
|
|
277
267
|
plugins
|
|
278
268
|
});
|
|
279
269
|
const vuePlugin = {
|
|
@@ -298,16 +288,6 @@ function createHead(options = {}) {
|
|
|
298
288
|
return { ...vuePlugin, ...head };
|
|
299
289
|
}
|
|
300
290
|
|
|
301
|
-
function createDomHead(options = {}) {
|
|
302
|
-
return createHead({
|
|
303
|
-
...options,
|
|
304
|
-
plugins: [
|
|
305
|
-
VueTriggerDomPatchingOnUpdatesPlugin({ document: options?.document }),
|
|
306
|
-
...options.plugins || []
|
|
307
|
-
]
|
|
308
|
-
});
|
|
309
|
-
}
|
|
310
|
-
|
|
311
291
|
const HeadVuePlugin = function(_Vue) {
|
|
312
292
|
_Vue.mixin({
|
|
313
293
|
beforeCreate() {
|
|
@@ -334,4 +314,4 @@ const HeadVuePlugin = function(_Vue) {
|
|
|
334
314
|
});
|
|
335
315
|
};
|
|
336
316
|
|
|
337
|
-
export { HeadVuePlugin, VueReactiveInputPlugin,
|
|
317
|
+
export { HeadVuePlugin, VueReactiveInputPlugin, asArray, createHead, headSymbol, injectHead, resolveUnrefHeadInput, useBodyAttrs, useHead, useHtmlAttrs, useServerBodyAttrs, useServerHead, useServerHtmlAttrs, useServerTagBase, useServerTagLink, useServerTagMeta, useServerTagMetaFlat, useServerTagNoscript, useServerTagScript, useServerTagStyle, useServerTagTitle, useServerTitleTemplate, useTagBase, useTagLink, useTagMeta, useTagMetaFlat, useTagNoscript, useTagScript, useTagStyle, useTagTitle, useTitleTemplate };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unhead/vue",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.6",
|
|
5
5
|
"packageManager": "pnpm@7.14.0",
|
|
6
6
|
"author": "Harlan Wilton <harlan@harlanzw.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -33,10 +33,10 @@
|
|
|
33
33
|
"vue": ">=2.7 || >=3"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@unhead/dom": "0.2.
|
|
37
|
-
"@unhead/schema": "0.2.
|
|
36
|
+
"@unhead/dom": "0.2.6",
|
|
37
|
+
"@unhead/schema": "0.2.6",
|
|
38
38
|
"@vueuse/shared": "latest",
|
|
39
|
-
"unhead": "0.2.
|
|
39
|
+
"unhead": "0.2.6"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"vue": "latest"
|