unhead 2.0.0-alpha.17 → 2.0.0-alpha.18

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.mjs CHANGED
@@ -1,6 +1,6 @@
1
- export { u as useHead, a as useHeadSafe, b as useSeoMeta } from './shared/unhead.BVS0y1aX.mjs';
1
+ export { u as useHead, a as useHeadSafe, b as useSeoMeta } from './shared/unhead.C2emW6l4.mjs';
2
2
  export { c as createHeadCore } from './shared/unhead.x5NJGkxU.mjs';
3
- export { u as useScript } from './shared/unhead.DDt21GmC.mjs';
3
+ export { u as useScript } from './shared/unhead.CG0hxuzW.mjs';
4
4
  import './shared/unhead.z5bPaiJg.mjs';
5
5
  import './shared/unhead.DFwCX-QT.mjs';
6
6
  import './shared/unhead.yem5I2v_.mjs';
package/dist/legacy.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import { c as createHeadCore } from './shared/unhead.x5NJGkxU.mjs';
2
2
  import { D as DeprecationsPlugin, P as PromisesPlugin, T as TemplateParamsPlugin, A as AliasSortingPlugin } from './shared/unhead.9Qw6eOEM.mjs';
3
- export { u as useHead, a as useHeadSafe, b as useSeoMeta } from './shared/unhead.BVS0y1aX.mjs';
4
- export { u as useScript } from './shared/unhead.DDt21GmC.mjs';
3
+ export { u as useHead, a as useHeadSafe, b as useSeoMeta } from './shared/unhead.C2emW6l4.mjs';
4
+ export { u as useScript } from './shared/unhead.CG0hxuzW.mjs';
5
5
  import 'hookable';
6
6
  import './shared/unhead.xsi8MZXD.mjs';
7
7
  import './shared/unhead.yem5I2v_.mjs';
package/dist/scripts.mjs CHANGED
@@ -1,4 +1,4 @@
1
- export { u as useScript } from './shared/unhead.DDt21GmC.mjs';
1
+ export { u as useScript } from './shared/unhead.CG0hxuzW.mjs';
2
2
  import './shared/unhead.yem5I2v_.mjs';
3
3
 
4
4
  function createSpyProxy(target, onApply) {
@@ -10,6 +10,9 @@ function useHeadSafe(unhead, input = {}, options = {}) {
10
10
  function useSeoMeta(unhead, input = {}, options) {
11
11
  unhead.use(FlatMetaPlugin);
12
12
  function normalize(input2) {
13
+ if (input2._flatMeta) {
14
+ return input2;
15
+ }
13
16
  const { title, titleTemplate, ...meta } = input2 || {};
14
17
  return {
15
18
  title,
@@ -19,7 +22,10 @@ function useSeoMeta(unhead, input = {}, options) {
19
22
  }
20
23
  const entry = unhead.push(normalize(input), options);
21
24
  const corePatch = entry.patch;
22
- entry.patch = (input2) => corePatch(normalize(input2));
25
+ if (!entry.__patched) {
26
+ entry.patch = (input2) => corePatch(normalize(input2));
27
+ entry.__patched = true;
28
+ }
23
29
  return entry;
24
30
  }
25
31
 
@@ -86,6 +86,9 @@ function useScript(head, _input, _options) {
86
86
  const _cbs = { loaded: [], error: [] };
87
87
  const _uniqueCbs = /* @__PURE__ */ new Set();
88
88
  const _registerCb = (key, cb, options2) => {
89
+ if (head.ssr) {
90
+ return;
91
+ }
89
92
  if (options2?.key) {
90
93
  const key2 = `${options2?.key}:${options2.key}`;
91
94
  if (_uniqueCbs.has(key2)) {
@@ -242,7 +245,7 @@ function useScript(head, _input, _options) {
242
245
  const hookCtx = { script };
243
246
  script.setupTriggerHandler(options.trigger);
244
247
  if (options.use) {
245
- const { proxy, stack } = createNoopedRecordingProxy(options.use() || {});
248
+ const { proxy, stack } = createNoopedRecordingProxy(head.ssr ? {} : options.use() || {});
246
249
  script.proxy = proxy;
247
250
  script.onLoaded((instance) => {
248
251
  replayProxyRecordings(instance, stack);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "unhead",
3
3
  "type": "module",
4
- "version": "2.0.0-alpha.17",
4
+ "version": "2.0.0-alpha.18",
5
5
  "description": "Full-stack <head> manager built for any framework.",
6
6
  "author": {
7
7
  "name": "Harlan Wilton",