@unhead/vue 1.11.14 → 1.11.15

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.
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  const vue = require('vue');
4
- const injectHead = require('./shared/vue.6b1572ee.cjs');
4
+ const injectHead = require('./shared/vue.DWlmwWrc.cjs');
5
5
  require('unhead');
6
6
  require('@unhead/shared');
7
7
 
@@ -1,5 +1,5 @@
1
1
  import { defineComponent, ref, onBeforeUnmount, watchEffect } from 'vue';
2
- import { i as injectHead, V as Vue3 } from './shared/vue.f49591ad.mjs';
2
+ import { i as injectHead, V as Vue3 } from './shared/vue.ziyDaVMR.mjs';
3
3
  import 'unhead';
4
4
  import '@unhead/shared';
5
5
 
package/dist/index.cjs CHANGED
@@ -1,9 +1,9 @@
1
1
  'use strict';
2
2
 
3
3
  const unhead = require('unhead');
4
- const injectHead = require('./shared/vue.6b1572ee.cjs');
4
+ const injectHead = require('./shared/vue.DWlmwWrc.cjs');
5
5
  const shared = require('@unhead/shared');
6
- const useHead = require('./shared/vue.104c41b5.cjs');
6
+ const useHead = require('./shared/vue.BmMjB48i.cjs');
7
7
  const vue = require('vue');
8
8
 
9
9
  const coreComposableNames = [
package/dist/index.d.cts CHANGED
@@ -2,8 +2,8 @@ export { CapoPlugin, HashHydrationPlugin, createHeadCore } from 'unhead';
2
2
  import * as _unhead_schema from '@unhead/schema';
3
3
  import { SafeMeta, SafeLink, SafeNoscript, SafeScript, SafeHtmlAttr, SafeBodyAttr, MergeHead, CreateHeadOptions, ActiveHeadEntry, ScriptInstance, UseScriptStatus, ScriptBase, DataKeys, SchemaAugmentations, HeadEntryOptions, UseScriptOptions as UseScriptOptions$1, AsAsyncFunctionValues, UseFunctionType } from '@unhead/schema';
4
4
  export { ActiveHeadEntry, Head, HeadEntryOptions, HeadTag, MergeHead, Unhead } from '@unhead/schema';
5
- import { R as ReactiveHead, M as MaybeComputedRefEntries, a as MaybeComputedRef, V as VueHeadClient, U as UseHeadInput, b as UseHeadOptions, c as MaybeComputedRefEntriesOnly, d as UseSeoMetaInput } from './shared/vue.71760da0.cjs';
6
- export { f as Base, B as BodyAttr, j as BodyAttributes, H as HtmlAttr, i as HtmlAttributes, L as Link, l as MaybeComputedRefOrFalsy, m as MaybeComputedRefOrPromise, k as MaybeReadonlyRef, g as Meta, N as Noscript, h as Script, S as Style, T as Title, e as TitleTemplate } from './shared/vue.71760da0.cjs';
5
+ import { R as ReactiveHead, M as MaybeComputedRefEntries, a as MaybeComputedRef, V as VueHeadClient, U as UseHeadInput, b as UseHeadOptions, c as MaybeComputedRefEntriesOnly, d as UseSeoMetaInput } from './shared/vue.fwis0K4Q.cjs';
6
+ export { f as Base, B as BodyAttr, j as BodyAttributes, H as HtmlAttr, i as HtmlAttributes, L as Link, l as MaybeComputedRefOrFalsy, m as MaybeComputedRefOrPromise, k as MaybeReadonlyRef, g as Meta, N as Noscript, h as Script, S as Style, T as Title, e as TitleTemplate } from './shared/vue.fwis0K4Q.cjs';
7
7
  import { Ref, Plugin } from 'vue';
8
8
 
9
9
  interface HeadSafe extends Pick<ReactiveHead, 'title' | 'titleTemplate' | 'templateParams'> {
package/dist/index.d.mts CHANGED
@@ -2,8 +2,8 @@ export { CapoPlugin, HashHydrationPlugin, createHeadCore } from 'unhead';
2
2
  import * as _unhead_schema from '@unhead/schema';
3
3
  import { SafeMeta, SafeLink, SafeNoscript, SafeScript, SafeHtmlAttr, SafeBodyAttr, MergeHead, CreateHeadOptions, ActiveHeadEntry, ScriptInstance, UseScriptStatus, ScriptBase, DataKeys, SchemaAugmentations, HeadEntryOptions, UseScriptOptions as UseScriptOptions$1, AsAsyncFunctionValues, UseFunctionType } from '@unhead/schema';
4
4
  export { ActiveHeadEntry, Head, HeadEntryOptions, HeadTag, MergeHead, Unhead } from '@unhead/schema';
5
- import { R as ReactiveHead, M as MaybeComputedRefEntries, a as MaybeComputedRef, V as VueHeadClient, U as UseHeadInput, b as UseHeadOptions, c as MaybeComputedRefEntriesOnly, d as UseSeoMetaInput } from './shared/vue.71760da0.mjs';
6
- export { f as Base, B as BodyAttr, j as BodyAttributes, H as HtmlAttr, i as HtmlAttributes, L as Link, l as MaybeComputedRefOrFalsy, m as MaybeComputedRefOrPromise, k as MaybeReadonlyRef, g as Meta, N as Noscript, h as Script, S as Style, T as Title, e as TitleTemplate } from './shared/vue.71760da0.mjs';
5
+ import { R as ReactiveHead, M as MaybeComputedRefEntries, a as MaybeComputedRef, V as VueHeadClient, U as UseHeadInput, b as UseHeadOptions, c as MaybeComputedRefEntriesOnly, d as UseSeoMetaInput } from './shared/vue.fwis0K4Q.mjs';
6
+ export { f as Base, B as BodyAttr, j as BodyAttributes, H as HtmlAttr, i as HtmlAttributes, L as Link, l as MaybeComputedRefOrFalsy, m as MaybeComputedRefOrPromise, k as MaybeReadonlyRef, g as Meta, N as Noscript, h as Script, S as Style, T as Title, e as TitleTemplate } from './shared/vue.fwis0K4Q.mjs';
7
7
  import { Ref, Plugin } from 'vue';
8
8
 
9
9
  interface HeadSafe extends Pick<ReactiveHead, 'title' | 'titleTemplate' | 'templateParams'> {
package/dist/index.d.ts CHANGED
@@ -2,8 +2,8 @@ export { CapoPlugin, HashHydrationPlugin, createHeadCore } from 'unhead';
2
2
  import * as _unhead_schema from '@unhead/schema';
3
3
  import { SafeMeta, SafeLink, SafeNoscript, SafeScript, SafeHtmlAttr, SafeBodyAttr, MergeHead, CreateHeadOptions, ActiveHeadEntry, ScriptInstance, UseScriptStatus, ScriptBase, DataKeys, SchemaAugmentations, HeadEntryOptions, UseScriptOptions as UseScriptOptions$1, AsAsyncFunctionValues, UseFunctionType } from '@unhead/schema';
4
4
  export { ActiveHeadEntry, Head, HeadEntryOptions, HeadTag, MergeHead, Unhead } from '@unhead/schema';
5
- import { R as ReactiveHead, M as MaybeComputedRefEntries, a as MaybeComputedRef, V as VueHeadClient, U as UseHeadInput, b as UseHeadOptions, c as MaybeComputedRefEntriesOnly, d as UseSeoMetaInput } from './shared/vue.71760da0.js';
6
- export { f as Base, B as BodyAttr, j as BodyAttributes, H as HtmlAttr, i as HtmlAttributes, L as Link, l as MaybeComputedRefOrFalsy, m as MaybeComputedRefOrPromise, k as MaybeReadonlyRef, g as Meta, N as Noscript, h as Script, S as Style, T as Title, e as TitleTemplate } from './shared/vue.71760da0.js';
5
+ import { R as ReactiveHead, M as MaybeComputedRefEntries, a as MaybeComputedRef, V as VueHeadClient, U as UseHeadInput, b as UseHeadOptions, c as MaybeComputedRefEntriesOnly, d as UseSeoMetaInput } from './shared/vue.fwis0K4Q.js';
6
+ export { f as Base, B as BodyAttr, j as BodyAttributes, H as HtmlAttr, i as HtmlAttributes, L as Link, l as MaybeComputedRefOrFalsy, m as MaybeComputedRefOrPromise, k as MaybeReadonlyRef, g as Meta, N as Noscript, h as Script, S as Style, T as Title, e as TitleTemplate } from './shared/vue.fwis0K4Q.js';
7
7
  import { Ref, Plugin } from 'vue';
8
8
 
9
9
  interface HeadSafe extends Pick<ReactiveHead, 'title' | 'titleTemplate' | 'templateParams'> {
package/dist/index.mjs CHANGED
@@ -1,9 +1,9 @@
1
1
  import { useScript as useScript$1 } from 'unhead';
2
2
  export { CapoPlugin, HashHydrationPlugin, createHeadCore } from 'unhead';
3
- import { i as injectHead, h as headSymbol, V as Vue3 } from './shared/vue.f49591ad.mjs';
4
- export { c as createHead, a as createServerHead, r as resolveUnrefHeadInput, s as setHeadInjectionHandler } from './shared/vue.f49591ad.mjs';
3
+ import { i as injectHead, h as headSymbol, V as Vue3 } from './shared/vue.ziyDaVMR.mjs';
4
+ export { c as createHead, a as createServerHead, r as resolveUnrefHeadInput, s as setHeadInjectionHandler } from './shared/vue.ziyDaVMR.mjs';
5
5
  import { composableNames, whitelistSafeInput, unpackMeta } from '@unhead/shared';
6
- import { u as useHead } from './shared/vue.8fc199ce.mjs';
6
+ import { u as useHead } from './shared/vue.-sixQ7xP.mjs';
7
7
  import { getCurrentInstance, onMounted, isRef, watch, onScopeDispose, ref } from 'vue';
8
8
 
9
9
  const coreComposableNames = [
package/dist/polyfill.cjs CHANGED
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
- const useHead = require('./shared/vue.104c41b5.cjs');
3
+ const useHead = require('./shared/vue.BmMjB48i.cjs');
4
4
  require('vue');
5
- require('./shared/vue.6b1572ee.cjs');
5
+ require('./shared/vue.DWlmwWrc.cjs');
6
6
  require('unhead');
7
7
  require('@unhead/shared');
8
8
 
@@ -1,5 +1,5 @@
1
1
  import { MergeHead } from '@unhead/schema';
2
- import { V as VueHeadClient, U as UseHeadInput, b as UseHeadOptions } from './shared/vue.71760da0.cjs';
2
+ import { V as VueHeadClient, U as UseHeadInput, b as UseHeadOptions } from './shared/vue.fwis0K4Q.cjs';
3
3
  import 'vue';
4
4
 
5
5
  type VueHeadClientPollyFill<T extends MergeHead> = VueHeadClient<T> & {
@@ -1,5 +1,5 @@
1
1
  import { MergeHead } from '@unhead/schema';
2
- import { V as VueHeadClient, U as UseHeadInput, b as UseHeadOptions } from './shared/vue.71760da0.mjs';
2
+ import { V as VueHeadClient, U as UseHeadInput, b as UseHeadOptions } from './shared/vue.fwis0K4Q.mjs';
3
3
  import 'vue';
4
4
 
5
5
  type VueHeadClientPollyFill<T extends MergeHead> = VueHeadClient<T> & {
@@ -1,5 +1,5 @@
1
1
  import { MergeHead } from '@unhead/schema';
2
- import { V as VueHeadClient, U as UseHeadInput, b as UseHeadOptions } from './shared/vue.71760da0.js';
2
+ import { V as VueHeadClient, U as UseHeadInput, b as UseHeadOptions } from './shared/vue.fwis0K4Q.js';
3
3
  import 'vue';
4
4
 
5
5
  type VueHeadClientPollyFill<T extends MergeHead> = VueHeadClient<T> & {
package/dist/polyfill.mjs CHANGED
@@ -1,6 +1,6 @@
1
- import { u as useHead } from './shared/vue.8fc199ce.mjs';
1
+ import { u as useHead } from './shared/vue.-sixQ7xP.mjs';
2
2
  import 'vue';
3
- import './shared/vue.f49591ad.mjs';
3
+ import './shared/vue.ziyDaVMR.mjs';
4
4
  import 'unhead';
5
5
  import '@unhead/shared';
6
6
 
@@ -1,5 +1,5 @@
1
1
  import { ref, watchEffect, watch, getCurrentInstance, onBeforeUnmount, onDeactivated, onActivated } from 'vue';
2
- import { i as injectHead, r as resolveUnrefHeadInput } from './vue.f49591ad.mjs';
2
+ import { i as injectHead, r as resolveUnrefHeadInput } from './vue.ziyDaVMR.mjs';
3
3
 
4
4
  function useHead(input, options = {}) {
5
5
  const head = options.head || injectHead();
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  const vue = require('vue');
4
- const injectHead = require('./vue.6b1572ee.cjs');
4
+ const injectHead = require('./vue.DWlmwWrc.cjs');
5
5
 
6
6
  function useHead(input, options = {}) {
7
7
  const head = options.head || injectHead.injectHead();
package/dist/vue2.cjs CHANGED
@@ -1,42 +1,27 @@
1
1
  'use strict';
2
2
 
3
- const defu = require('defu');
4
- const vue = require('vue');
5
- const useHead = require('./shared/vue.104c41b5.cjs');
6
- const injectHead = require('./shared/vue.6b1572ee.cjs');
3
+ const useHead = require('./shared/vue.BmMjB48i.cjs');
4
+ const injectHead = require('./shared/vue.DWlmwWrc.cjs');
5
+ require('vue');
7
6
  require('unhead');
8
7
  require('@unhead/shared');
9
8
 
10
9
  const UnheadPlugin = (_Vue) => {
11
- _Vue.config.optionMergeStrategies.head = function(toVal, fromVal, vm) {
12
- if (typeof toVal === "function") {
13
- toVal = toVal.call(vm || this || _Vue);
14
- }
15
- if (typeof fromVal === "function") {
16
- fromVal = fromVal.call(vm || this || _Vue);
17
- }
18
- return defu.defu(toVal, fromVal);
10
+ _Vue.config.optionMergeStrategies.head = function(toVal, fromVal) {
11
+ return [toVal, fromVal].flat().filter(Boolean);
19
12
  };
20
13
  _Vue.mixin({
21
14
  created() {
22
- let source = false;
23
- if (injectHead.Vue3) {
24
- const instance = vue.getCurrentInstance();
25
- if (!instance)
26
- return;
27
- const options = instance.type;
28
- if (!options || !("head" in options))
29
- return;
30
- source = typeof options.head === "function" ? () => options.head.call(instance.proxy) : options.head;
31
- } else {
32
- const head = this.$options.head;
33
- if (head) {
34
- source = typeof head === "function" ? () => head.call(this) : head;
15
+ const head = this.$options.head;
16
+ if (head) {
17
+ if (Array.isArray(head)) {
18
+ head.forEach((h) => {
19
+ useHead.useHead(typeof h === "function" ? h.call(this) : h);
20
+ });
21
+ } else {
22
+ useHead.useHead(typeof head === "function" ? head.call(this) : head);
35
23
  }
36
24
  }
37
- if (source) {
38
- useHead.useHead(source);
39
- }
40
25
  },
41
26
  beforeCreate() {
42
27
  const options = this.$options;
package/dist/vue2.mjs CHANGED
@@ -1,40 +1,25 @@
1
- import { defu } from 'defu';
2
- import { getCurrentInstance } from 'vue';
3
- import { u as useHead } from './shared/vue.8fc199ce.mjs';
4
- import { V as Vue3, h as headSymbol } from './shared/vue.f49591ad.mjs';
1
+ import { u as useHead } from './shared/vue.-sixQ7xP.mjs';
2
+ import { h as headSymbol } from './shared/vue.ziyDaVMR.mjs';
3
+ import 'vue';
5
4
  import 'unhead';
6
5
  import '@unhead/shared';
7
6
 
8
7
  const UnheadPlugin = (_Vue) => {
9
- _Vue.config.optionMergeStrategies.head = function(toVal, fromVal, vm) {
10
- if (typeof toVal === "function") {
11
- toVal = toVal.call(vm || this || _Vue);
12
- }
13
- if (typeof fromVal === "function") {
14
- fromVal = fromVal.call(vm || this || _Vue);
15
- }
16
- return defu(toVal, fromVal);
8
+ _Vue.config.optionMergeStrategies.head = function(toVal, fromVal) {
9
+ return [toVal, fromVal].flat().filter(Boolean);
17
10
  };
18
11
  _Vue.mixin({
19
12
  created() {
20
- let source = false;
21
- if (Vue3) {
22
- const instance = getCurrentInstance();
23
- if (!instance)
24
- return;
25
- const options = instance.type;
26
- if (!options || !("head" in options))
27
- return;
28
- source = typeof options.head === "function" ? () => options.head.call(instance.proxy) : options.head;
29
- } else {
30
- const head = this.$options.head;
31
- if (head) {
32
- source = typeof head === "function" ? () => head.call(this) : head;
13
+ const head = this.$options.head;
14
+ if (head) {
15
+ if (Array.isArray(head)) {
16
+ head.forEach((h) => {
17
+ useHead(typeof h === "function" ? h.call(this) : h);
18
+ });
19
+ } else {
20
+ useHead(typeof head === "function" ? head.call(this) : head);
33
21
  }
34
22
  }
35
- if (source) {
36
- useHead(source);
37
- }
38
23
  },
39
24
  beforeCreate() {
40
25
  const options = this.$options;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@unhead/vue",
3
3
  "type": "module",
4
- "version": "1.11.14",
4
+ "version": "1.11.15",
5
5
  "author": "Harlan Wilton <harlan@harlanzw.com>",
6
6
  "license": "MIT",
7
7
  "funding": "https://github.com/sponsors/harlan-zw",
@@ -65,11 +65,10 @@
65
65
  ]
66
66
  },
67
67
  "dependencies": {
68
- "defu": "^6.1.4",
69
68
  "hookable": "^5.5.3",
70
- "@unhead/shared": "1.11.14",
71
- "@unhead/schema": "1.11.14",
72
- "unhead": "1.11.14"
69
+ "@unhead/schema": "1.11.15",
70
+ "unhead": "1.11.15",
71
+ "@unhead/shared": "1.11.15"
73
72
  },
74
73
  "scripts": {
75
74
  "build": "unbuild .",