@unhead/vue 1.5.1 → 1.5.3
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 +2 -2
- package/dist/index.d.cts +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.mjs +2 -2
- package/dist/polyfill.cjs +1 -1
- package/dist/polyfill.mjs +1 -1
- package/dist/shared/{vue.16aedff8.cjs → vue.9cf7ea21.cjs} +9 -11
- package/dist/shared/{vue.fc184c2f.mjs → vue.b1b42453.mjs} +9 -11
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const unhead = require('unhead');
|
|
4
|
-
const useHead = require('./shared/vue.
|
|
4
|
+
const useHead = require('./shared/vue.9cf7ea21.cjs');
|
|
5
5
|
const vue = require('vue');
|
|
6
6
|
const shared = require('@unhead/shared');
|
|
7
7
|
|
|
@@ -93,7 +93,7 @@ exports.createHead = useHead.createHead;
|
|
|
93
93
|
exports.createServerHead = useHead.createServerHead;
|
|
94
94
|
exports.injectHead = useHead.injectHead;
|
|
95
95
|
exports.resolveUnrefHeadInput = useHead.resolveUnrefHeadInput;
|
|
96
|
-
exports.
|
|
96
|
+
exports.setHeadInjectionHandler = useHead.setHeadInjectionHandler;
|
|
97
97
|
exports.useHead = useHead.useHead;
|
|
98
98
|
exports.Vue2ProvideUnheadPlugin = Vue2ProvideUnheadPlugin;
|
|
99
99
|
exports.VueHeadMixin = VueHeadMixin;
|
package/dist/index.d.cts
CHANGED
|
@@ -31,7 +31,7 @@ declare const unheadVueComposablesImports: {
|
|
|
31
31
|
'@unhead/vue': string[];
|
|
32
32
|
};
|
|
33
33
|
|
|
34
|
-
declare function
|
|
34
|
+
declare function setHeadInjectionHandler(handler: () => VueHeadClient<any> | undefined): void;
|
|
35
35
|
declare function injectHead<T extends MergeHead>(): VueHeadClient<T>;
|
|
36
36
|
|
|
37
37
|
declare function useHead<T extends MergeHead>(input: UseHeadInput<T>, options?: UseHeadOptions): ActiveHeadEntry<UseHeadInput<T>> | void;
|
|
@@ -46,4 +46,4 @@ declare function useServerHeadSafe(input: UseHeadSafeInput, options?: UseHeadOpt
|
|
|
46
46
|
|
|
47
47
|
declare function useServerSeoMeta(input: UseSeoMetaInput, options?: UseHeadOptions): ActiveHeadEntry<any> | void;
|
|
48
48
|
|
|
49
|
-
export { type HeadSafe, MaybeComputedRef, MaybeComputedRefEntries, ReactiveHead, UseHeadInput, UseHeadOptions, type UseHeadSafeInput, UseSeoMetaInput, Vue2ProvideUnheadPlugin, VueHeadClient, VueHeadMixin, createHead, createServerHead, injectHead, resolveUnrefHeadInput,
|
|
49
|
+
export { type HeadSafe, MaybeComputedRef, MaybeComputedRefEntries, ReactiveHead, UseHeadInput, UseHeadOptions, type UseHeadSafeInput, UseSeoMetaInput, Vue2ProvideUnheadPlugin, VueHeadClient, VueHeadMixin, createHead, createServerHead, injectHead, resolveUnrefHeadInput, setHeadInjectionHandler, unheadVueComposablesImports, useHead, useHeadSafe, useSeoMeta, useServerHead, useServerHeadSafe, useServerSeoMeta };
|
package/dist/index.d.mts
CHANGED
|
@@ -31,7 +31,7 @@ declare const unheadVueComposablesImports: {
|
|
|
31
31
|
'@unhead/vue': string[];
|
|
32
32
|
};
|
|
33
33
|
|
|
34
|
-
declare function
|
|
34
|
+
declare function setHeadInjectionHandler(handler: () => VueHeadClient<any> | undefined): void;
|
|
35
35
|
declare function injectHead<T extends MergeHead>(): VueHeadClient<T>;
|
|
36
36
|
|
|
37
37
|
declare function useHead<T extends MergeHead>(input: UseHeadInput<T>, options?: UseHeadOptions): ActiveHeadEntry<UseHeadInput<T>> | void;
|
|
@@ -46,4 +46,4 @@ declare function useServerHeadSafe(input: UseHeadSafeInput, options?: UseHeadOpt
|
|
|
46
46
|
|
|
47
47
|
declare function useServerSeoMeta(input: UseSeoMetaInput, options?: UseHeadOptions): ActiveHeadEntry<any> | void;
|
|
48
48
|
|
|
49
|
-
export { type HeadSafe, MaybeComputedRef, MaybeComputedRefEntries, ReactiveHead, UseHeadInput, UseHeadOptions, type UseHeadSafeInput, UseSeoMetaInput, Vue2ProvideUnheadPlugin, VueHeadClient, VueHeadMixin, createHead, createServerHead, injectHead, resolveUnrefHeadInput,
|
|
49
|
+
export { type HeadSafe, MaybeComputedRef, MaybeComputedRefEntries, ReactiveHead, UseHeadInput, UseHeadOptions, type UseHeadSafeInput, UseSeoMetaInput, Vue2ProvideUnheadPlugin, VueHeadClient, VueHeadMixin, createHead, createServerHead, injectHead, resolveUnrefHeadInput, setHeadInjectionHandler, unheadVueComposablesImports, useHead, useHeadSafe, useSeoMeta, useServerHead, useServerHeadSafe, useServerSeoMeta };
|
package/dist/index.d.ts
CHANGED
|
@@ -31,7 +31,7 @@ declare const unheadVueComposablesImports: {
|
|
|
31
31
|
'@unhead/vue': string[];
|
|
32
32
|
};
|
|
33
33
|
|
|
34
|
-
declare function
|
|
34
|
+
declare function setHeadInjectionHandler(handler: () => VueHeadClient<any> | undefined): void;
|
|
35
35
|
declare function injectHead<T extends MergeHead>(): VueHeadClient<T>;
|
|
36
36
|
|
|
37
37
|
declare function useHead<T extends MergeHead>(input: UseHeadInput<T>, options?: UseHeadOptions): ActiveHeadEntry<UseHeadInput<T>> | void;
|
|
@@ -46,4 +46,4 @@ declare function useServerHeadSafe(input: UseHeadSafeInput, options?: UseHeadOpt
|
|
|
46
46
|
|
|
47
47
|
declare function useServerSeoMeta(input: UseSeoMetaInput, options?: UseHeadOptions): ActiveHeadEntry<any> | void;
|
|
48
48
|
|
|
49
|
-
export { type HeadSafe, MaybeComputedRef, MaybeComputedRefEntries, ReactiveHead, UseHeadInput, UseHeadOptions, type UseHeadSafeInput, UseSeoMetaInput, Vue2ProvideUnheadPlugin, VueHeadClient, VueHeadMixin, createHead, createServerHead, injectHead, resolveUnrefHeadInput,
|
|
49
|
+
export { type HeadSafe, MaybeComputedRef, MaybeComputedRefEntries, ReactiveHead, UseHeadInput, UseHeadOptions, type UseHeadSafeInput, UseSeoMetaInput, Vue2ProvideUnheadPlugin, VueHeadClient, VueHeadMixin, createHead, createServerHead, injectHead, resolveUnrefHeadInput, setHeadInjectionHandler, unheadVueComposablesImports, useHead, useHeadSafe, useSeoMeta, useServerHead, useServerHeadSafe, useServerSeoMeta };
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { CapoPlugin, HashHydrationPlugin, createHeadCore } from 'unhead';
|
|
2
|
-
import { V as Vue3, u as useHead, h as headSymbol, r as resolveUnrefHeadInput, i as injectHead } from './shared/vue.
|
|
3
|
-
export { c as createHead, a as createServerHead, s as
|
|
2
|
+
import { V as Vue3, u as useHead, h as headSymbol, r as resolveUnrefHeadInput, i as injectHead } from './shared/vue.b1b42453.mjs';
|
|
3
|
+
export { c as createHead, a as createServerHead, s as setHeadInjectionHandler } from './shared/vue.b1b42453.mjs';
|
|
4
4
|
import { getCurrentInstance, ref, watchEffect } from 'vue';
|
|
5
5
|
import { composableNames, whitelistSafeInput, unpackMeta } from '@unhead/shared';
|
|
6
6
|
|
package/dist/polyfill.cjs
CHANGED
package/dist/polyfill.mjs
CHANGED
|
@@ -66,20 +66,18 @@ function createHead(options = {}) {
|
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
const _global = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
69
|
-
const globalKey = "
|
|
70
|
-
function
|
|
69
|
+
const globalKey = "__unhead_injection_handler__";
|
|
70
|
+
function setHeadInjectionHandler(handler) {
|
|
71
71
|
_global[globalKey] = handler;
|
|
72
72
|
}
|
|
73
|
-
function
|
|
74
|
-
if (globalKey in _global)
|
|
73
|
+
function injectHead() {
|
|
74
|
+
if (globalKey in _global) {
|
|
75
75
|
return _global[globalKey]();
|
|
76
|
-
|
|
76
|
+
}
|
|
77
|
+
const head = vue.inject(headSymbol);
|
|
78
|
+
if (!head && process.env.NODE_ENV !== "production")
|
|
77
79
|
console.warn("Unhead is missing Vue context, falling back to shared context. This may have unexpected results.");
|
|
78
|
-
|
|
79
|
-
function injectHead() {
|
|
80
|
-
const injectedHead = vue.inject(headSymbol);
|
|
81
|
-
!injectedHead && callFailedInjectHandler();
|
|
82
|
-
return injectedHead || unhead.getActiveHead();
|
|
80
|
+
return head || unhead.getActiveHead();
|
|
83
81
|
}
|
|
84
82
|
|
|
85
83
|
function useHead(input, options = {}) {
|
|
@@ -121,5 +119,5 @@ exports.createServerHead = createServerHead;
|
|
|
121
119
|
exports.headSymbol = headSymbol;
|
|
122
120
|
exports.injectHead = injectHead;
|
|
123
121
|
exports.resolveUnrefHeadInput = resolveUnrefHeadInput;
|
|
124
|
-
exports.
|
|
122
|
+
exports.setHeadInjectionHandler = setHeadInjectionHandler;
|
|
125
123
|
exports.useHead = useHead;
|
|
@@ -64,20 +64,18 @@ function createHead(options = {}) {
|
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
const _global = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
67
|
-
const globalKey = "
|
|
68
|
-
function
|
|
67
|
+
const globalKey = "__unhead_injection_handler__";
|
|
68
|
+
function setHeadInjectionHandler(handler) {
|
|
69
69
|
_global[globalKey] = handler;
|
|
70
70
|
}
|
|
71
|
-
function
|
|
72
|
-
if (globalKey in _global)
|
|
71
|
+
function injectHead() {
|
|
72
|
+
if (globalKey in _global) {
|
|
73
73
|
return _global[globalKey]();
|
|
74
|
-
|
|
74
|
+
}
|
|
75
|
+
const head = inject(headSymbol);
|
|
76
|
+
if (!head && process.env.NODE_ENV !== "production")
|
|
75
77
|
console.warn("Unhead is missing Vue context, falling back to shared context. This may have unexpected results.");
|
|
76
|
-
|
|
77
|
-
function injectHead() {
|
|
78
|
-
const injectedHead = inject(headSymbol);
|
|
79
|
-
!injectedHead && callFailedInjectHandler();
|
|
80
|
-
return injectedHead || getActiveHead();
|
|
78
|
+
return head || getActiveHead();
|
|
81
79
|
}
|
|
82
80
|
|
|
83
81
|
function useHead(input, options = {}) {
|
|
@@ -113,4 +111,4 @@ function clientUseHead(head, input, options = {}) {
|
|
|
113
111
|
return entry;
|
|
114
112
|
}
|
|
115
113
|
|
|
116
|
-
export { Vue3 as V, createServerHead as a, createHead as c, headSymbol as h, injectHead as i, resolveUnrefHeadInput as r,
|
|
114
|
+
export { Vue3 as V, createServerHead as a, createHead as c, headSymbol as h, injectHead as i, resolveUnrefHeadInput as r, setHeadInjectionHandler as s, useHead as u };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unhead/vue",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.5.
|
|
4
|
+
"version": "1.5.3",
|
|
5
5
|
"author": "Harlan Wilton <harlan@harlanzw.com>",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"funding": "https://github.com/sponsors/harlan-zw",
|
|
@@ -38,9 +38,9 @@
|
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"hookable": "^5.5.3",
|
|
41
|
-
"@unhead/schema": "1.5.
|
|
42
|
-
"@unhead/shared": "1.5.
|
|
43
|
-
"unhead": "1.5.
|
|
41
|
+
"@unhead/schema": "1.5.3",
|
|
42
|
+
"@unhead/shared": "1.5.3",
|
|
43
|
+
"unhead": "1.5.3"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"vue": "^3.3.4"
|