@unhead/vue 2.0.18 → 2.1.0

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 CHANGED
@@ -1,8 +1,11 @@
1
1
  import { createHead as createHead$1, createDebouncedFn, renderDOMHead } from 'unhead/client';
2
2
  export { renderDOMHead } from 'unhead/client';
3
- import { v as vueInstall } from './shared/vue.Kp0sxz0n.mjs';
4
- export { V as VueHeadMixin } from './shared/vue.CgTRvX2j.mjs';
3
+ import { v as vueInstall } from './shared/vue.Bm-NbY4b.mjs';
4
+ export { V as VueHeadMixin } from './shared/vue.BVUAdATk.mjs';
5
+ import 'unhead/plugins';
6
+ import 'unhead/utils';
5
7
  import 'vue';
8
+ import './shared/vue.N9zWjxoK.mjs';
6
9
 
7
10
  // @__NO_SIDE_EFFECTS__
8
11
  function createHead(options = {}) {
@@ -1,8 +1,7 @@
1
1
  import { defineComponent, ref, onBeforeUnmount, watchEffect } from 'vue';
2
- import { u as useHead } from './shared/vue.BROZw4iv.mjs';
2
+ import { u as useHead } from './shared/vue.Bm-NbY4b.mjs';
3
3
  import 'unhead/plugins';
4
4
  import 'unhead/utils';
5
- import './shared/vue.Kp0sxz0n.mjs';
6
5
  import './shared/vue.N9zWjxoK.mjs';
7
6
 
8
7
  function addVNodeToHeadObj(node, obj) {
package/dist/index.mjs CHANGED
@@ -1,10 +1,9 @@
1
1
  import { createUnhead } from 'unhead';
2
2
  export { createUnhead } from 'unhead';
3
- export { i as injectHead, u as useHead, a as useHeadSafe, b as useSeoMeta, c as useServerHead, d as useServerHeadSafe, e as useServerSeoMeta } from './shared/vue.BROZw4iv.mjs';
4
- export { h as headSymbol } from './shared/vue.Kp0sxz0n.mjs';
3
+ export { h as headSymbol, i as injectHead, u as useHead, a as useHeadSafe, b as useSeoMeta, c as useServerHead, d as useServerHeadSafe, e as useServerSeoMeta } from './shared/vue.Bm-NbY4b.mjs';
5
4
  export { resolveUnrefHeadInput } from './utils.mjs';
6
- export { V as VueHeadMixin } from './shared/vue.CgTRvX2j.mjs';
7
- export { u as useScript } from './shared/vue.HGGopy_V.mjs';
5
+ export { V as VueHeadMixin } from './shared/vue.BVUAdATk.mjs';
6
+ export { u as useScript } from './shared/vue.CeCEzk2b.mjs';
8
7
  import 'unhead/plugins';
9
8
  import 'unhead/utils';
10
9
  import 'vue';
package/dist/legacy.mjs CHANGED
@@ -1,13 +1,13 @@
1
1
  import { createUnhead } from 'unhead';
2
2
  import { inject, ref, watchEffect, unref, watch, getCurrentInstance, onBeforeUnmount, onDeactivated, onActivated } from 'vue';
3
3
  import { createHead as createHead$1 } from './client.mjs';
4
- import { h as headSymbol } from './shared/vue.Kp0sxz0n.mjs';
4
+ import { h as headSymbol } from './shared/vue.Bm-NbY4b.mjs';
5
5
  import { V as VueResolver } from './shared/vue.N9zWjxoK.mjs';
6
6
  import { createHead as createHead$2 } from './server.mjs';
7
7
  import { walkResolver } from 'unhead/utils';
8
8
  import { defineHeadPlugin, DeprecationsPlugin, PromisesPlugin, TemplateParamsPlugin, AliasSortingPlugin, SafeInputPlugin, FlatMetaPlugin } from 'unhead/plugins';
9
9
  import 'unhead/client';
10
- import './shared/vue.CgTRvX2j.mjs';
10
+ import './shared/vue.BVUAdATk.mjs';
11
11
  import 'unhead/server';
12
12
 
13
13
  const createHeadCore = createUnhead;
package/dist/scripts.mjs CHANGED
@@ -1,8 +1,7 @@
1
1
  export { createSpyProxy, resolveScriptKey } from 'unhead/scripts';
2
- export { u as useScript } from './shared/vue.HGGopy_V.mjs';
2
+ export { u as useScript } from './shared/vue.CeCEzk2b.mjs';
3
3
  import 'vue';
4
- import './shared/vue.BROZw4iv.mjs';
4
+ import './shared/vue.Bm-NbY4b.mjs';
5
5
  import 'unhead/plugins';
6
6
  import 'unhead/utils';
7
- import './shared/vue.Kp0sxz0n.mjs';
8
7
  import './shared/vue.N9zWjxoK.mjs';
package/dist/server.mjs CHANGED
@@ -1,8 +1,10 @@
1
1
  import { createHead as createHead$1 } from 'unhead/server';
2
2
  export { extractUnheadInputFromHtml, propsToString, renderSSRHead, transformHtmlTemplate } from 'unhead/server';
3
- import { v as vueInstall } from './shared/vue.Kp0sxz0n.mjs';
3
+ import { v as vueInstall } from './shared/vue.Bm-NbY4b.mjs';
4
4
  import { V as VueResolver } from './shared/vue.N9zWjxoK.mjs';
5
- export { V as VueHeadMixin } from './shared/vue.CgTRvX2j.mjs';
5
+ export { V as VueHeadMixin } from './shared/vue.BVUAdATk.mjs';
6
+ import 'unhead/plugins';
7
+ import 'unhead/utils';
6
8
  import 'vue';
7
9
 
8
10
  // @__NO_SIDE_EFFECTS__
@@ -1,14 +1,17 @@
1
1
  import { getCurrentInstance } from 'vue';
2
+ import { u as useHead } from './vue.Bm-NbY4b.mjs';
2
3
 
3
4
  const VueHeadMixin = {
4
5
  created() {
6
+ let source = false;
5
7
  const instance = getCurrentInstance();
6
8
  if (!instance)
7
9
  return;
8
10
  const options = instance.type;
9
11
  if (!options || !("head" in options))
10
12
  return;
11
- typeof options.head === "function" ? () => options.head.call(instance.proxy) : options.head;
13
+ source = typeof options.head === "function" ? () => options.head.call(instance.proxy) : options.head;
14
+ source && useHead(source);
12
15
  }
13
16
  };
14
17
 
@@ -1,9 +1,21 @@
1
1
  import { SafeInputPlugin, FlatMetaPlugin } from 'unhead/plugins';
2
2
  import { walkResolver } from 'unhead/utils';
3
3
  import { hasInjectionContext, inject, ref, watchEffect, getCurrentInstance, onBeforeUnmount, onDeactivated, onActivated } from 'vue';
4
- import { h as headSymbol } from './vue.Kp0sxz0n.mjs';
5
4
  import { V as VueResolver } from './vue.N9zWjxoK.mjs';
6
5
 
6
+ const headSymbol = "usehead";
7
+ // @__NO_SIDE_EFFECTS__
8
+ function vueInstall(head) {
9
+ const plugin = {
10
+ install(app) {
11
+ app.config.globalProperties.$unhead = head;
12
+ app.config.globalProperties.$head = head;
13
+ app.provide(headSymbol, head);
14
+ }
15
+ };
16
+ return plugin.install;
17
+ }
18
+
7
19
  // @__NO_SIDE_EFFECTS__
8
20
  function injectHead() {
9
21
  if (hasInjectionContext()) {
@@ -15,12 +27,10 @@ function injectHead() {
15
27
  }
16
28
  throw new Error("useHead() was called without provide context, ensure you call it through the setup() function.");
17
29
  }
18
- // @__NO_SIDE_EFFECTS__
19
30
  function useHead(input, options = {}) {
20
31
  const head = options.head || /* @__PURE__ */ injectHead();
21
- return head.ssr ? head.push(input || {}, options) : /* @__PURE__ */ clientUseHead(head, input, options);
32
+ return head.ssr ? head.push(input || {}, options) : clientUseHead(head, input, options);
22
33
  }
23
- // @__NO_SIDE_EFFECTS__
24
34
  function clientUseHead(head, input, options = {}) {
25
35
  const deactivated = ref(false);
26
36
  let entry;
@@ -46,35 +56,30 @@ function clientUseHead(head, input, options = {}) {
46
56
  }
47
57
  return entry;
48
58
  }
49
- // @__NO_SIDE_EFFECTS__
50
59
  function useHeadSafe(input = {}, options = {}) {
51
60
  const head = options.head || /* @__PURE__ */ injectHead();
52
61
  head.use(SafeInputPlugin);
53
62
  options._safe = true;
54
- return /* @__PURE__ */ useHead(input, options);
63
+ return useHead(input, options);
55
64
  }
56
- // @__NO_SIDE_EFFECTS__
57
65
  function useSeoMeta(input = {}, options = {}) {
58
66
  const head = options.head || /* @__PURE__ */ injectHead();
59
67
  head.use(FlatMetaPlugin);
60
68
  const { title, titleTemplate, ...meta } = input;
61
- return /* @__PURE__ */ useHead({
69
+ return useHead({
62
70
  title,
63
71
  titleTemplate,
64
72
  _flatMeta: meta
65
73
  }, options);
66
74
  }
67
- // @__NO_SIDE_EFFECTS__
68
75
  function useServerHead(input, options = {}) {
69
- return /* @__PURE__ */ useHead(input, { ...options, mode: "server" });
76
+ return useHead(input, { ...options, mode: "server" });
70
77
  }
71
- // @__NO_SIDE_EFFECTS__
72
78
  function useServerHeadSafe(input, options = {}) {
73
- return /* @__PURE__ */ useHeadSafe(input, { ...options, mode: "server" });
79
+ return useHeadSafe(input, { ...options, mode: "server" });
74
80
  }
75
- // @__NO_SIDE_EFFECTS__
76
81
  function useServerSeoMeta(input, options = {}) {
77
- return /* @__PURE__ */ useSeoMeta(input, { ...options, mode: "server" });
82
+ return useSeoMeta(input, { ...options, mode: "server" });
78
83
  }
79
84
 
80
- export { useHeadSafe as a, useSeoMeta as b, useServerHead as c, useServerHeadSafe as d, useServerSeoMeta as e, injectHead as i, useHead as u };
85
+ export { useHeadSafe as a, useSeoMeta as b, useServerHead as c, useServerHeadSafe as d, useServerSeoMeta as e, headSymbol as h, injectHead as i, useHead as u, vueInstall as v };
@@ -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.BROZw4iv.mjs';
3
+ import { i as injectHead } from './vue.Bm-NbY4b.mjs';
4
4
 
5
5
  function registerVueScopeHandlers(script, scope) {
6
6
  if (!scope) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@unhead/vue",
3
3
  "type": "module",
4
- "version": "2.0.18",
4
+ "version": "2.1.0",
5
5
  "description": "Full-stack <head> manager built for Vue.",
6
6
  "author": "Harlan Wilton <harlan@harlanzw.com>",
7
7
  "license": "MIT",
@@ -103,10 +103,11 @@
103
103
  },
104
104
  "dependencies": {
105
105
  "hookable": "^5.5.3",
106
- "unhead": "2.0.18"
106
+ "unhead": "2.1.0"
107
107
  },
108
108
  "devDependencies": {
109
- "vue": "^3.5.21"
109
+ "@vue/server-renderer": "^3.5.25",
110
+ "vue": "^3.5.25"
110
111
  },
111
112
  "scripts": {
112
113
  "build": "unbuild",
@@ -1,14 +0,0 @@
1
- const headSymbol = "usehead";
2
- // @__NO_SIDE_EFFECTS__
3
- function vueInstall(head) {
4
- const plugin = {
5
- install(app) {
6
- app.config.globalProperties.$unhead = head;
7
- app.config.globalProperties.$head = head;
8
- app.provide(headSymbol, head);
9
- }
10
- };
11
- return plugin.install;
12
- }
13
-
14
- export { headSymbol as h, vueInstall as v };