@unhead/vue 3.0.0-beta.5 → 3.0.0-beta.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/client.mjs +2 -2
- package/dist/components.mjs +1 -1
- package/dist/index.mjs +3 -3
- package/dist/scripts.d.mts +3 -2
- package/dist/scripts.d.ts +3 -2
- package/dist/scripts.mjs +2 -2
- package/dist/server.mjs +2 -2
- package/dist/shared/{vue.C-c0vimW.mjs → vue.CLCWY4Ey.mjs} +1 -1
- package/dist/shared/{vue.BAVPDCHt.mjs → vue.DdPIVN-K.mjs} +2 -3
- package/dist/shared/{vue.CQPP9sR4.mjs → vue.WuLQR0U8.mjs} +7 -5
- package/dist/stream/client.mjs +2 -2
- package/dist/stream/server.mjs +1 -1
- package/package.json +2 -2
package/dist/client.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createDomRenderer, createDebouncedFn, createHead as createHead$1 } from 'unhead/client';
|
|
2
2
|
export { renderDOMHead } from 'unhead/client';
|
|
3
|
-
import { v as vueInstall } from './shared/vue.
|
|
4
|
-
export { V as VueHeadMixin } from './shared/vue.
|
|
3
|
+
import { v as vueInstall } from './shared/vue.DdPIVN-K.mjs';
|
|
4
|
+
export { V as VueHeadMixin } from './shared/vue.CLCWY4Ey.mjs';
|
|
5
5
|
import 'unhead/plugins';
|
|
6
6
|
import 'unhead/utils';
|
|
7
7
|
import 'vue';
|
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.DdPIVN-K.mjs';
|
|
3
3
|
import 'unhead/plugins';
|
|
4
4
|
import 'unhead/utils';
|
|
5
5
|
import './shared/vue.N9zWjxoK.mjs';
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { h as headSymbol, i as injectHead, u as useHead, a as useHeadSafe, b as useSeoMeta } from './shared/vue.
|
|
2
|
-
export { V as VueHeadMixin } from './shared/vue.
|
|
1
|
+
export { h as headSymbol, i as injectHead, u as useHead, a as useHeadSafe, b as useSeoMeta } from './shared/vue.DdPIVN-K.mjs';
|
|
2
|
+
export { V as VueHeadMixin } from './shared/vue.CLCWY4Ey.mjs';
|
|
3
3
|
export { createUnhead } from 'unhead';
|
|
4
|
-
export { u as useScript } from './shared/vue.
|
|
4
|
+
export { u as useScript } from './shared/vue.WuLQR0U8.mjs';
|
|
5
5
|
import 'unhead/plugins';
|
|
6
6
|
import 'unhead/utils';
|
|
7
7
|
import 'vue';
|
package/dist/scripts.d.mts
CHANGED
|
@@ -18,9 +18,10 @@ interface UseScriptOptions<T extends Record<symbol | string, any> = Record<strin
|
|
|
18
18
|
* - `Promise` - Load the script when the promise resolves, exists only on the client.
|
|
19
19
|
* - `Function` - Register a callback function to load the script, exists only on the client.
|
|
20
20
|
* - `server` - Have the script injected on the server.
|
|
21
|
-
* - `
|
|
21
|
+
* - `Ref<boolean>` - Load the script when the ref becomes true.
|
|
22
|
+
* - `() => boolean` - Getter function, load the script when return value becomes true.
|
|
22
23
|
*/
|
|
23
|
-
trigger?: UseScriptOptions$1['trigger'] | Ref<boolean
|
|
24
|
+
trigger?: UseScriptOptions$1['trigger'] | Ref<boolean> | (() => boolean);
|
|
24
25
|
/**
|
|
25
26
|
* Unhead instance.
|
|
26
27
|
*/
|
package/dist/scripts.d.ts
CHANGED
|
@@ -18,9 +18,10 @@ interface UseScriptOptions<T extends Record<symbol | string, any> = Record<strin
|
|
|
18
18
|
* - `Promise` - Load the script when the promise resolves, exists only on the client.
|
|
19
19
|
* - `Function` - Register a callback function to load the script, exists only on the client.
|
|
20
20
|
* - `server` - Have the script injected on the server.
|
|
21
|
-
* - `
|
|
21
|
+
* - `Ref<boolean>` - Load the script when the ref becomes true.
|
|
22
|
+
* - `() => boolean` - Getter function, load the script when return value becomes true.
|
|
22
23
|
*/
|
|
23
|
-
trigger?: UseScriptOptions$1['trigger'] | Ref<boolean
|
|
24
|
+
trigger?: UseScriptOptions$1['trigger'] | Ref<boolean> | (() => boolean);
|
|
24
25
|
/**
|
|
25
26
|
* Unhead instance.
|
|
26
27
|
*/
|
package/dist/scripts.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { createSpyProxy } from 'unhead/scripts';
|
|
2
|
-
export { u as useScript } from './shared/vue.
|
|
2
|
+
export { u as useScript } from './shared/vue.WuLQR0U8.mjs';
|
|
3
3
|
import 'vue';
|
|
4
|
-
import './shared/vue.
|
|
4
|
+
import './shared/vue.DdPIVN-K.mjs';
|
|
5
5
|
import 'unhead/plugins';
|
|
6
6
|
import 'unhead/utils';
|
|
7
7
|
import './shared/vue.N9zWjxoK.mjs';
|
package/dist/server.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { createHead as createHead$1 } from 'unhead/server';
|
|
2
2
|
export { propsToString, renderSSRHead, transformHtmlTemplate } from 'unhead/server';
|
|
3
|
-
import { v as vueInstall } from './shared/vue.
|
|
3
|
+
import { v as vueInstall } from './shared/vue.DdPIVN-K.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.CLCWY4Ey.mjs';
|
|
6
6
|
import 'unhead/plugins';
|
|
7
7
|
import 'unhead/utils';
|
|
8
8
|
import 'vue';
|
|
@@ -20,10 +20,9 @@ function vueInstall(head) {
|
|
|
20
20
|
function injectHead() {
|
|
21
21
|
if (hasInjectionContext()) {
|
|
22
22
|
const instance = inject(headSymbol);
|
|
23
|
-
if (
|
|
24
|
-
|
|
23
|
+
if (instance) {
|
|
24
|
+
return instance;
|
|
25
25
|
}
|
|
26
|
-
return instance;
|
|
27
26
|
}
|
|
28
27
|
throw new Error("useHead() was called without provide context, ensure you call it through the setup() function.");
|
|
29
28
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useScript as useScript$1 } from 'unhead/scripts';
|
|
2
2
|
import { getCurrentInstance, onMounted, isRef, watch, onScopeDispose, ref } from 'vue';
|
|
3
|
-
import { i as injectHead } from './vue.
|
|
3
|
+
import { i as injectHead } from './vue.DdPIVN-K.mjs';
|
|
4
4
|
|
|
5
5
|
function registerVueScopeHandlers(script, scope) {
|
|
6
6
|
if (!scope) {
|
|
@@ -37,11 +37,11 @@ function useScript(_input, _options) {
|
|
|
37
37
|
options.eventContext = scope;
|
|
38
38
|
if (scope && typeof options.trigger === "undefined") {
|
|
39
39
|
options.trigger = onMounted;
|
|
40
|
-
} else if (isRef(options.trigger)) {
|
|
41
|
-
const
|
|
40
|
+
} else if (isRef(options.trigger) || typeof options.trigger === "function" && options.trigger.length === 0) {
|
|
41
|
+
const trigger = options.trigger;
|
|
42
42
|
let off;
|
|
43
43
|
options.trigger = new Promise((resolve) => {
|
|
44
|
-
off = watch(
|
|
44
|
+
off = watch(trigger, (val) => {
|
|
45
45
|
if (val) {
|
|
46
46
|
resolve(true);
|
|
47
47
|
}
|
|
@@ -55,7 +55,9 @@ function useScript(_input, _options) {
|
|
|
55
55
|
});
|
|
56
56
|
}
|
|
57
57
|
head._scriptStatusWatcher = head._scriptStatusWatcher || head.hooks.hook("script:updated", ({ script: s }) => {
|
|
58
|
-
s._statusRef
|
|
58
|
+
if (s._statusRef) {
|
|
59
|
+
s._statusRef.value = s.status;
|
|
60
|
+
}
|
|
59
61
|
});
|
|
60
62
|
const script = useScript$1(head, input, options);
|
|
61
63
|
script._statusRef = script._statusRef || ref(script.status);
|
package/dist/stream/client.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { createStreamableHead as createStreamableHead$1 } from 'unhead/stream/client';
|
|
2
2
|
import { defineComponent } from 'vue';
|
|
3
|
-
import { v as vueInstall } from '../shared/vue.
|
|
3
|
+
import { v as vueInstall } from '../shared/vue.DdPIVN-K.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.CLCWY4Ey.mjs';
|
|
6
6
|
import 'unhead/plugins';
|
|
7
7
|
import 'unhead/utils';
|
|
8
8
|
|
package/dist/stream/server.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { renderSSRHeadSuspenseChunk, createStreamableHead as createStreamableHead$1, wrapStream } from 'unhead/stream/server';
|
|
2
2
|
export { prepareStreamingTemplate, renderSSRHeadShell, renderSSRHeadSuspenseChunk, wrapStream } from 'unhead/stream/server';
|
|
3
3
|
import { defineComponent, h } from 'vue';
|
|
4
|
-
import { i as injectHead, v as vueInstall } from '../shared/vue.
|
|
4
|
+
import { i as injectHead, v as vueInstall } from '../shared/vue.DdPIVN-K.mjs';
|
|
5
5
|
import { V as VueResolver } from '../shared/vue.N9zWjxoK.mjs';
|
|
6
6
|
import 'unhead/plugins';
|
|
7
7
|
import 'unhead/utils';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unhead/vue",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "3.0.0-beta.
|
|
4
|
+
"version": "3.0.0-beta.6",
|
|
5
5
|
"description": "Full-stack <head> manager built for Vue.",
|
|
6
6
|
"author": "Harlan Wilton <harlan@harlanzw.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -125,7 +125,7 @@
|
|
|
125
125
|
"hookable": "^6.0.1",
|
|
126
126
|
"magic-string": "^0.30.21",
|
|
127
127
|
"mlly": "^1.8.0",
|
|
128
|
-
"unhead": "3.0.0-beta.
|
|
128
|
+
"unhead": "3.0.0-beta.6"
|
|
129
129
|
},
|
|
130
130
|
"devDependencies": {
|
|
131
131
|
"@vue/server-renderer": "^3.5.26",
|