@unhead/vue 1.9.2 → 1.9.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
@@ -101,12 +101,12 @@ function useScript(_input, _options) {
101
101
  options.head = head;
102
102
  options.eventContext = vue.getCurrentInstance();
103
103
  const status = vue.ref("awaitingLoad");
104
+ const stubOptions = options.stub;
104
105
  options.stub = ({ script, fn }) => {
105
- if (fn === "$script") {
106
- return Object.assign(script, {
107
- status
108
- });
109
- }
106
+ script.status = status;
107
+ if (fn === "$script")
108
+ return script;
109
+ return stubOptions?.({ script, fn });
110
110
  };
111
111
  let instance;
112
112
  const rmHook = head.hooks.hook("script:updated", ({ script }) => {
@@ -116,8 +116,7 @@ function useScript(_input, _options) {
116
116
  rmHook();
117
117
  }
118
118
  });
119
- instance = unhead.useScript(input, options);
120
- return instance;
119
+ return instance = unhead.useScript(input, options);
121
120
  }
122
121
 
123
122
  exports.CapoPlugin = unhead.CapoPlugin;
package/dist/index.mjs CHANGED
@@ -101,12 +101,12 @@ function useScript(_input, _options) {
101
101
  options.head = head;
102
102
  options.eventContext = getCurrentInstance();
103
103
  const status = ref("awaitingLoad");
104
+ const stubOptions = options.stub;
104
105
  options.stub = ({ script, fn }) => {
105
- if (fn === "$script") {
106
- return Object.assign(script, {
107
- status
108
- });
109
- }
106
+ script.status = status;
107
+ if (fn === "$script")
108
+ return script;
109
+ return stubOptions?.({ script, fn });
110
110
  };
111
111
  let instance;
112
112
  const rmHook = head.hooks.hook("script:updated", ({ script }) => {
@@ -116,8 +116,7 @@ function useScript(_input, _options) {
116
116
  rmHook();
117
117
  }
118
118
  });
119
- instance = useScript$1(input, options);
120
- return instance;
119
+ return instance = useScript$1(input, options);
121
120
  }
122
121
 
123
122
  export { Vue2ProvideUnheadPlugin, VueHeadMixin, injectHead, unheadVueComposablesImports, useHead, useHeadSafe, useScript, useSeoMeta, useServerHead, useServerHeadSafe, useServerSeoMeta };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@unhead/vue",
3
3
  "type": "module",
4
- "version": "1.9.2",
4
+ "version": "1.9.3",
5
5
  "author": "Harlan Wilton <harlan@harlanzw.com>",
6
6
  "license": "MIT",
7
7
  "funding": "https://github.com/sponsors/harlan-zw",
@@ -61,9 +61,9 @@
61
61
  },
62
62
  "dependencies": {
63
63
  "hookable": "^5.5.3",
64
- "@unhead/schema": "1.9.2",
65
- "unhead": "1.9.2",
66
- "@unhead/shared": "1.9.2"
64
+ "@unhead/shared": "1.9.3",
65
+ "@unhead/schema": "1.9.3",
66
+ "unhead": "1.9.3"
67
67
  },
68
68
  "devDependencies": {
69
69
  "vue": "^3.4.21"