@unhead/vue 1.8.0-beta.2 → 1.8.0-beta.5

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
@@ -59,17 +59,24 @@ function useHeadSafe(input, options = {}) {
59
59
  }
60
60
 
61
61
  function useSeoMeta(input, options) {
62
- const headInput = vue.ref({});
63
- vue.watchEffect(() => {
64
- const resolvedMeta = injectHead.resolveUnrefHeadInput(input);
65
- const { title, titleTemplate, ...meta } = resolvedMeta;
66
- headInput.value = {
67
- title,
68
- titleTemplate,
69
- meta: shared.unpackMeta(meta)
70
- };
62
+ const { title, titleTemplate, ...meta } = input;
63
+ return useHead.useHead({
64
+ title,
65
+ titleTemplate,
66
+ // @ts-expect-error runtime type
67
+ _flatMeta: meta
68
+ }, {
69
+ ...options,
70
+ transform(t) {
71
+ const meta2 = shared.unpackMeta({ ...t._flatMeta });
72
+ delete t._flatMeta;
73
+ return {
74
+ // @ts-expect-error runtime type
75
+ ...t,
76
+ meta: meta2
77
+ };
78
+ }
71
79
  });
72
- return useHead.useHead(headInput, options);
73
80
  }
74
81
 
75
82
  function useServerHead(input, options = {}) {
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, UseScriptStatus, UseScriptInput, UseScriptOptions } 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 UseSeoMetaInput } from './shared/vue.8eef6ffc.cjs';
6
- export { e as Base, B as BodyAttr, i as BodyAttributes, H as HtmlAttr, h as HtmlAttributes, L as Link, k as MaybeComputedRefOrPromise, j as MaybeReadonlyRef, f as Meta, N as Noscript, g as Script, S as Style, T as Title, d as TitleTemplate } from './shared/vue.8eef6ffc.cjs';
5
+ import { R as ReactiveHead, M as MaybeComputedRefEntries, a as MaybeComputedRef, V as VueHeadClient, U as UseHeadInput, b as UseHeadOptions, c as UseSeoMetaInput } from './shared/vue.44f175ba.cjs';
6
+ export { e as Base, B as BodyAttr, i as BodyAttributes, H as HtmlAttr, h as HtmlAttributes, L as Link, k as MaybeComputedRefOrPromise, j as MaybeReadonlyRef, f as Meta, N as Noscript, g as Script, S as Style, T as Title, d as TitleTemplate } from './shared/vue.44f175ba.cjs';
7
7
  import { Plugin, ComputedRef, Ref } 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, UseScriptStatus, UseScriptInput, UseScriptOptions } 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 UseSeoMetaInput } from './shared/vue.8eef6ffc.mjs';
6
- export { e as Base, B as BodyAttr, i as BodyAttributes, H as HtmlAttr, h as HtmlAttributes, L as Link, k as MaybeComputedRefOrPromise, j as MaybeReadonlyRef, f as Meta, N as Noscript, g as Script, S as Style, T as Title, d as TitleTemplate } from './shared/vue.8eef6ffc.mjs';
5
+ import { R as ReactiveHead, M as MaybeComputedRefEntries, a as MaybeComputedRef, V as VueHeadClient, U as UseHeadInput, b as UseHeadOptions, c as UseSeoMetaInput } from './shared/vue.44f175ba.mjs';
6
+ export { e as Base, B as BodyAttr, i as BodyAttributes, H as HtmlAttr, h as HtmlAttributes, L as Link, k as MaybeComputedRefOrPromise, j as MaybeReadonlyRef, f as Meta, N as Noscript, g as Script, S as Style, T as Title, d as TitleTemplate } from './shared/vue.44f175ba.mjs';
7
7
  import { Plugin, ComputedRef, Ref } 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, UseScriptStatus, UseScriptInput, UseScriptOptions } 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 UseSeoMetaInput } from './shared/vue.8eef6ffc.js';
6
- export { e as Base, B as BodyAttr, i as BodyAttributes, H as HtmlAttr, h as HtmlAttributes, L as Link, k as MaybeComputedRefOrPromise, j as MaybeReadonlyRef, f as Meta, N as Noscript, g as Script, S as Style, T as Title, d as TitleTemplate } from './shared/vue.8eef6ffc.js';
5
+ import { R as ReactiveHead, M as MaybeComputedRefEntries, a as MaybeComputedRef, V as VueHeadClient, U as UseHeadInput, b as UseHeadOptions, c as UseSeoMetaInput } from './shared/vue.44f175ba.js';
6
+ export { e as Base, B as BodyAttr, i as BodyAttributes, H as HtmlAttr, h as HtmlAttributes, L as Link, k as MaybeComputedRefOrPromise, j as MaybeReadonlyRef, f as Meta, N as Noscript, g as Script, S as Style, T as Title, d as TitleTemplate } from './shared/vue.44f175ba.js';
7
7
  import { Plugin, ComputedRef, Ref } from 'vue';
8
8
 
9
9
  interface HeadSafe extends Pick<ReactiveHead, 'title' | 'titleTemplate' | 'templateParams'> {
package/dist/index.mjs CHANGED
@@ -1,8 +1,8 @@
1
1
  import { useScript as useScript$1 } from 'unhead';
2
2
  export { CapoPlugin, HashHydrationPlugin, createHeadCore } from 'unhead';
3
- import { V as Vue3, h as headSymbol, r as resolveUnrefHeadInput, i as injectHead } from './shared/vue.cf295fb1.mjs';
3
+ import { V as Vue3, h as headSymbol, i as injectHead, r as resolveUnrefHeadInput } from './shared/vue.cf295fb1.mjs';
4
4
  export { c as createHead, a as createServerHead, s as setHeadInjectionHandler } from './shared/vue.cf295fb1.mjs';
5
- import { getCurrentInstance, ref, watchEffect, computed } from 'vue';
5
+ import { getCurrentInstance, ref, computed } from 'vue';
6
6
  import { u as useHead } from './shared/vue.f36acd1f.mjs';
7
7
  import { composableNames, whitelistSafeInput, unpackMeta, NetworkEvents } from '@unhead/shared';
8
8
 
@@ -59,17 +59,24 @@ function useHeadSafe(input, options = {}) {
59
59
  }
60
60
 
61
61
  function useSeoMeta(input, options) {
62
- const headInput = ref({});
63
- watchEffect(() => {
64
- const resolvedMeta = resolveUnrefHeadInput(input);
65
- const { title, titleTemplate, ...meta } = resolvedMeta;
66
- headInput.value = {
67
- title,
68
- titleTemplate,
69
- meta: unpackMeta(meta)
70
- };
62
+ const { title, titleTemplate, ...meta } = input;
63
+ return useHead({
64
+ title,
65
+ titleTemplate,
66
+ // @ts-expect-error runtime type
67
+ _flatMeta: meta
68
+ }, {
69
+ ...options,
70
+ transform(t) {
71
+ const meta2 = unpackMeta({ ...t._flatMeta });
72
+ delete t._flatMeta;
73
+ return {
74
+ // @ts-expect-error runtime type
75
+ ...t,
76
+ meta: meta2
77
+ };
78
+ }
71
79
  });
72
- return useHead(headInput, options);
73
80
  }
74
81
 
75
82
  function useServerHead(input, options = {}) {
@@ -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.8eef6ffc.cjs';
2
+ import { V as VueHeadClient, U as UseHeadInput, b as UseHeadOptions } from './shared/vue.44f175ba.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.8eef6ffc.mjs';
2
+ import { V as VueHeadClient, U as UseHeadInput, b as UseHeadOptions } from './shared/vue.44f175ba.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.8eef6ffc.js';
2
+ import { V as VueHeadClient, U as UseHeadInput, b as UseHeadOptions } from './shared/vue.44f175ba.js';
3
3
  import 'vue';
4
4
 
5
5
  type VueHeadClientPollyFill<T extends MergeHead> = VueHeadClient<T> & {
@@ -49,7 +49,9 @@ interface ReactiveHead<E extends MergeHead = MergeHead> {
49
49
  /**
50
50
  * Variables used to substitute in the title and meta content.
51
51
  */
52
- templateParams?: MaybeComputedRefEntries<Record<string, null | string | MaybeComputedRefEntries<Record<string, null | string>>>>;
52
+ templateParams?: MaybeComputedRefEntries<{
53
+ separator?: '|' | '-' | '·' | string;
54
+ } & Record<string, null | string | MaybeComputedRefEntries<Record<string, null | string>>>>;
53
55
  /**
54
56
  * The `<base>` HTML element specifies the base URL to use for all relative URLs in a document.
55
57
  * There can be only one <base> element in a document.
@@ -49,7 +49,9 @@ interface ReactiveHead<E extends MergeHead = MergeHead> {
49
49
  /**
50
50
  * Variables used to substitute in the title and meta content.
51
51
  */
52
- templateParams?: MaybeComputedRefEntries<Record<string, null | string | MaybeComputedRefEntries<Record<string, null | string>>>>;
52
+ templateParams?: MaybeComputedRefEntries<{
53
+ separator?: '|' | '-' | '·' | string;
54
+ } & Record<string, null | string | MaybeComputedRefEntries<Record<string, null | string>>>>;
53
55
  /**
54
56
  * The `<base>` HTML element specifies the base URL to use for all relative URLs in a document.
55
57
  * There can be only one <base> element in a document.
@@ -49,7 +49,9 @@ interface ReactiveHead<E extends MergeHead = MergeHead> {
49
49
  /**
50
50
  * Variables used to substitute in the title and meta content.
51
51
  */
52
- templateParams?: MaybeComputedRefEntries<Record<string, null | string | MaybeComputedRefEntries<Record<string, null | string>>>>;
52
+ templateParams?: MaybeComputedRefEntries<{
53
+ separator?: '|' | '-' | '·' | string;
54
+ } & Record<string, null | string | MaybeComputedRefEntries<Record<string, null | string>>>>;
53
55
  /**
54
56
  * The `<base>` HTML element specifies the base URL to use for all relative URLs in a document.
55
57
  * There can be only one <base> element in a document.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@unhead/vue",
3
3
  "type": "module",
4
- "version": "1.8.0-beta.2",
4
+ "version": "1.8.0-beta.5",
5
5
  "author": "Harlan Wilton <harlan@harlanzw.com>",
6
6
  "license": "MIT",
7
7
  "funding": "https://github.com/sponsors/harlan-zw",
@@ -48,9 +48,9 @@
48
48
  },
49
49
  "dependencies": {
50
50
  "hookable": "^5.5.3",
51
- "@unhead/schema": "1.8.0-beta.2",
52
- "@unhead/shared": "1.8.0-beta.2",
53
- "unhead": "1.8.0-beta.2"
51
+ "@unhead/schema": "1.8.0-beta.5",
52
+ "@unhead/shared": "1.8.0-beta.5",
53
+ "unhead": "1.8.0-beta.5"
54
54
  },
55
55
  "devDependencies": {
56
56
  "vue": "^3.3.4"