@unhead/vue 1.3.2 → 1.3.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  const unhead = require('unhead');
4
- const useHead = require('./shared/vue.4471084f.cjs');
4
+ const useHead = require('./shared/vue.1e06c522.cjs');
5
5
  const vue = require('vue');
6
6
  const shared = require('@unhead/shared');
7
7
 
@@ -65,7 +65,8 @@ function useSeoMeta(input, options) {
65
65
 
66
66
  function useServerHead(input, options = {}) {
67
67
  const head = useHead.injectHead();
68
- return head.push(input, { ...options, mode: "server" });
68
+ if (head)
69
+ return head.push(input, { ...options, mode: "server" });
69
70
  }
70
71
 
71
72
  function useServerHeadSafe(input, options = {}) {
package/dist/index.d.ts CHANGED
@@ -37,7 +37,7 @@ declare function useHeadSafe(input: UseHeadSafeInput, options?: HeadEntryOptions
37
37
 
38
38
  declare function useSeoMeta(input: UseSeoMetaInput, options?: HeadEntryOptions): ActiveHeadEntry<any> | void;
39
39
 
40
- declare function useServerHead<T extends MergeHead>(input: UseHeadInput<T>, options?: HeadEntryOptions): _unhead_schema.ActiveHeadEntry<MaybeComputedRef<ReactiveHead<MergeHead>>>;
40
+ declare function useServerHead<T extends MergeHead>(input: UseHeadInput<T>, options?: HeadEntryOptions): _unhead_schema.ActiveHeadEntry<MaybeComputedRef<ReactiveHead<MergeHead>>> | undefined;
41
41
 
42
42
  declare function useServerHeadSafe(input: UseHeadSafeInput, options?: HeadEntryOptions): void | _unhead_schema.ActiveHeadEntry<UseHeadSafeInput>;
43
43
 
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  export { CapoPlugin, HashHydrationPlugin, createHeadCore } from 'unhead';
2
- import { u as useHead, h as headSymbol, r as resolveUnrefHeadInput, i as injectHead } from './shared/vue.9fbebdf0.mjs';
3
- export { c as createHead, a as createServerHead } from './shared/vue.9fbebdf0.mjs';
2
+ import { u as useHead, h as headSymbol, r as resolveUnrefHeadInput, i as injectHead } from './shared/vue.e6972f28.mjs';
3
+ export { c as createHead, a as createServerHead } from './shared/vue.e6972f28.mjs';
4
4
  import { getCurrentInstance, ref, watchEffect } from 'vue';
5
5
  import { composableNames, whitelistSafeInput, unpackMeta } from '@unhead/shared';
6
6
 
@@ -64,7 +64,8 @@ function useSeoMeta(input, options) {
64
64
 
65
65
  function useServerHead(input, options = {}) {
66
66
  const head = injectHead();
67
- return head.push(input, { ...options, mode: "server" });
67
+ if (head)
68
+ return head.push(input, { ...options, mode: "server" });
68
69
  }
69
70
 
70
71
  function useServerHeadSafe(input, options = {}) {
package/dist/polyfill.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const useHead = require('./shared/vue.4471084f.cjs');
3
+ const useHead = require('./shared/vue.1e06c522.cjs');
4
4
  require('vue');
5
5
  require('unhead');
6
6
  require('@unhead/shared');
package/dist/polyfill.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { u as useHead } from './shared/vue.9fbebdf0.mjs';
1
+ import { u as useHead } from './shared/vue.e6972f28.mjs';
2
2
  import 'vue';
3
3
  import 'unhead';
4
4
  import '@unhead/shared';
@@ -71,9 +71,11 @@ function injectHead() {
71
71
 
72
72
  function useHead(input, options = {}) {
73
73
  const head = injectHead();
74
- if (!head.ssr)
75
- return clientUseHead(head, input, options);
76
- return head.push(input, options);
74
+ if (head) {
75
+ if (!head.ssr)
76
+ return clientUseHead(head, input, options);
77
+ return head.push(input, options);
78
+ }
77
79
  }
78
80
  function clientUseHead(head, input, options = {}) {
79
81
  const deactivated = vue.ref(false);
@@ -69,9 +69,11 @@ function injectHead() {
69
69
 
70
70
  function useHead(input, options = {}) {
71
71
  const head = injectHead();
72
- if (!head.ssr)
73
- return clientUseHead(head, input, options);
74
- return head.push(input, options);
72
+ if (head) {
73
+ if (!head.ssr)
74
+ return clientUseHead(head, input, options);
75
+ return head.push(input, options);
76
+ }
75
77
  }
76
78
  function clientUseHead(head, input, options = {}) {
77
79
  const deactivated = ref(false);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@unhead/vue",
3
3
  "type": "module",
4
- "version": "1.3.2",
4
+ "version": "1.3.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.3.2",
42
- "@unhead/shared": "1.3.2",
43
- "unhead": "1.3.2"
41
+ "@unhead/schema": "1.3.3",
42
+ "unhead": "1.3.3",
43
+ "@unhead/shared": "1.3.3"
44
44
  },
45
45
  "devDependencies": {
46
46
  "vue": "^3.3.4"