unhead 3.0.0-beta.5 → 3.0.0-beta.7

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.
Files changed (58) hide show
  1. package/dist/client.d.mts +5 -5
  2. package/dist/client.d.ts +5 -5
  3. package/dist/client.mjs +19 -42
  4. package/dist/index.d.mts +4 -8
  5. package/dist/index.d.ts +4 -8
  6. package/dist/index.mjs +5 -5
  7. package/dist/parser.d.mts +1 -1
  8. package/dist/parser.d.ts +1 -1
  9. package/dist/plugins.d.mts +2 -2
  10. package/dist/plugins.d.ts +2 -2
  11. package/dist/plugins.mjs +4 -4
  12. package/dist/scripts.d.mts +4 -4
  13. package/dist/scripts.d.ts +4 -4
  14. package/dist/scripts.mjs +2 -2
  15. package/dist/server.d.mts +4 -4
  16. package/dist/server.d.ts +4 -4
  17. package/dist/server.mjs +10 -13
  18. package/dist/shared/{unhead.CpsjOPAu.mjs → unhead.2y8V0W4A.mjs} +1 -1
  19. package/dist/shared/{unhead.CEWerdEp.d.mts → unhead.5ph757u1.d.mts} +302 -95
  20. package/dist/shared/{unhead.CEWerdEp.d.ts → unhead.5ph757u1.d.ts} +302 -95
  21. package/dist/shared/{unhead.CZfNRJXC.d.mts → unhead.B9UFuLCK.d.mts} +2 -2
  22. package/dist/shared/{unhead.C872_DIi.mjs → unhead.BfbLkFkg.mjs} +3 -3
  23. package/dist/shared/{unhead.Dk69jLbN.mjs → unhead.Bkfgmqxw.mjs} +10 -6
  24. package/dist/shared/{unhead.DV1JgQq2.d.mts → unhead.BqsuEzgR.d.ts} +1 -1
  25. package/dist/shared/unhead.BqyO1IIn.mjs +153 -0
  26. package/dist/shared/{unhead.CYmogFtO.d.ts → unhead.C-4k1ONY.d.ts} +1 -1
  27. package/dist/shared/{unhead.jLixRfSR.mjs → unhead.C2yODEXq.mjs} +2 -19
  28. package/dist/shared/{unhead.BMNVj5kM.d.ts → unhead.Cfuv4vVm.d.ts} +1 -1
  29. package/dist/shared/{unhead.C8vIYPdy.d.ts → unhead.CmjOtSnf.d.ts} +26 -10
  30. package/dist/shared/{unhead.DWEsU3pU.d.ts → unhead.CuATeS8P.d.ts} +2 -2
  31. package/dist/shared/{unhead.CJepcqMm.mjs → unhead.CxhEb2IP.mjs} +1 -1
  32. package/dist/shared/{unhead.nIyuXWp0.d.mts → unhead.CzbvM4Ih.d.mts} +26 -10
  33. package/dist/shared/{unhead.DQrNWUd0.mjs → unhead.D2jdZ2BM.mjs} +15 -12
  34. package/dist/shared/{unhead.DvpX2SAn.d.mts → unhead.DECeL1s3.d.mts} +1 -1
  35. package/dist/shared/{unhead.CPLhZXQc.d.ts → unhead.OoU46jDW.d.mts} +1 -1
  36. package/dist/shared/unhead.XhzwfMDf.mjs +244 -0
  37. package/dist/shared/{unhead.BvMMF8wH.d.mts → unhead.sufKyII-.d.mts} +1 -1
  38. package/dist/stream/client.d.mts +3 -3
  39. package/dist/stream/client.d.ts +3 -3
  40. package/dist/stream/client.mjs +6 -12
  41. package/dist/stream/iife.d.mts +2 -2
  42. package/dist/stream/iife.d.ts +2 -2
  43. package/dist/stream/iife.global.js +1 -1
  44. package/dist/stream/iife.mjs +2 -2
  45. package/dist/stream/server.d.mts +2 -2
  46. package/dist/stream/server.d.ts +2 -2
  47. package/dist/stream/server.mjs +4 -4
  48. package/dist/stream/vite.d.mts +9 -2
  49. package/dist/stream/vite.d.ts +9 -2
  50. package/dist/stream/vite.mjs +4 -1
  51. package/dist/types.d.mts +6 -6
  52. package/dist/types.d.ts +6 -6
  53. package/dist/utils.d.mts +2 -15
  54. package/dist/utils.d.ts +2 -15
  55. package/dist/utils.mjs +3 -3
  56. package/package.json +13 -3
  57. package/dist/shared/unhead.BVkBe8OQ.mjs +0 -309
  58. package/dist/shared/unhead.WuuRWmDo.mjs +0 -159
package/dist/client.d.mts CHANGED
@@ -1,9 +1,9 @@
1
- export { C as ClientUnhead, c as createHead } from './shared/unhead.CZfNRJXC.mjs';
2
- import { R as RenderDomHeadOptions } from './shared/unhead.DvpX2SAn.mjs';
3
- import { p as HeadRenderer, q as Unhead } from './shared/unhead.nIyuXWp0.mjs';
4
- export { n as CreateClientHeadOptions } from './shared/unhead.nIyuXWp0.mjs';
1
+ export { C as ClientUnhead, c as createHead } from './shared/unhead.B9UFuLCK.mjs';
2
+ import { R as RenderDomHeadOptions } from './shared/unhead.DECeL1s3.mjs';
3
+ import { p as HeadRenderer, q as Unhead } from './shared/unhead.CzbvM4Ih.mjs';
4
+ export { n as CreateClientHeadOptions } from './shared/unhead.CzbvM4Ih.mjs';
5
5
  import 'hookable';
6
- import './shared/unhead.CEWerdEp.mjs';
6
+ import './shared/unhead.5ph757u1.mjs';
7
7
 
8
8
  declare function createDomRenderer(options?: RenderDomHeadOptions): HeadRenderer<boolean>;
9
9
 
package/dist/client.d.ts CHANGED
@@ -1,9 +1,9 @@
1
- export { C as ClientUnhead, c as createHead } from './shared/unhead.DWEsU3pU.js';
2
- import { R as RenderDomHeadOptions } from './shared/unhead.CYmogFtO.js';
3
- import { p as HeadRenderer, q as Unhead } from './shared/unhead.C8vIYPdy.js';
4
- export { n as CreateClientHeadOptions } from './shared/unhead.C8vIYPdy.js';
1
+ export { C as ClientUnhead, c as createHead } from './shared/unhead.CuATeS8P.js';
2
+ import { R as RenderDomHeadOptions } from './shared/unhead.C-4k1ONY.js';
3
+ import { p as HeadRenderer, q as Unhead } from './shared/unhead.CmjOtSnf.js';
4
+ export { n as CreateClientHeadOptions } from './shared/unhead.CmjOtSnf.js';
5
5
  import 'hookable';
6
- import './shared/unhead.CEWerdEp.js';
6
+ import './shared/unhead.5ph757u1.js';
7
7
 
8
8
  declare function createDomRenderer(options?: RenderDomHeadOptions): HeadRenderer<boolean>;
9
9
 
package/dist/client.mjs CHANGED
@@ -1,28 +1,22 @@
1
- import { c as createDomRenderer, r as renderDOMHead$1 } from './shared/unhead.WuuRWmDo.mjs';
2
- import { c as createUnhead, r as registerPlugin } from './shared/unhead.Dk69jLbN.mjs';
3
- import { d as TagPriorityAliases } from './shared/unhead.jLixRfSR.mjs';
1
+ import { c as createDomRenderer, r as renderDOMHead$1 } from './shared/unhead.BqyO1IIn.mjs';
2
+ import { c as createUnhead, r as registerPlugin } from './shared/unhead.Bkfgmqxw.mjs';
4
3
  import { c as createHooks } from './shared/unhead.DvIxXxuO.mjs';
5
- import './shared/unhead.BVkBe8OQ.mjs';
4
+ import './shared/unhead.C2yODEXq.mjs';
5
+ import './shared/unhead.XhzwfMDf.mjs';
6
6
  import 'hookable';
7
7
 
8
- function tagWeight(tag) {
9
- return typeof tag.tagPriority === "number" ? tag.tagPriority : 100 + (TagPriorityAliases[tag.tagPriority] || 0);
10
- }
8
+ const P = { critical: -8, high: -1, low: 2 };
9
+ const tagWeight = (tag) => typeof tag.tagPriority === "number" ? tag.tagPriority : 100 + (P[tag.tagPriority] || 0);
11
10
  function createHead(options = {}) {
12
11
  options.document = options.document || (typeof window !== "undefined" ? document : void 0);
13
12
  const renderer = options.render || createDomRenderer({ document: options.document });
14
13
  const initialPayload = options.document?.head.querySelector('script[id="unhead:payload"]')?.innerHTML || false;
15
- const core = createUnhead(renderer, {
16
- document: options.document,
17
- propResolvers: options.propResolvers,
18
- _tagWeight: tagWeight,
19
- init: []
20
- // push on wrapped head instead
21
- });
14
+ const core = createUnhead(renderer, { document: options.document, propResolvers: options.propResolvers, _tagWeight: tagWeight, init: [] });
22
15
  const hooks = createHooks(options.hooks);
23
16
  let dirty = false;
24
17
  const head = {
25
18
  ...core,
19
+ ssr: false,
26
20
  hooks,
27
21
  use: (p) => registerPlugin(head, p),
28
22
  get dirty() {
@@ -31,56 +25,39 @@ function createHead(options = {}) {
31
25
  set dirty(v) {
32
26
  dirty = v;
33
27
  },
34
- render() {
35
- return renderer(head);
36
- },
28
+ render: () => renderer(head),
37
29
  invalidate() {
38
- for (const entry of core.entries.values()) {
39
- entry._dirty = true;
40
- }
30
+ for (const e of core.entries.values()) delete e._tags;
41
31
  dirty = true;
42
32
  hooks.callHook("entries:updated", head);
43
33
  },
44
34
  push(input, _options) {
45
35
  const active = core.push(input, _options);
46
- const entry = core.entries.get(active._i);
47
- entry._dirty = true;
36
+ core.entries.get(active._i)._o = input;
48
37
  dirty = true;
49
38
  hooks.callHook("entries:updated", head);
50
- const corePatch = active.patch;
51
- const coreDispose = active.dispose;
52
- const clientActive = {
39
+ return {
53
40
  _i: active._i,
54
41
  patch(input2) {
55
- corePatch(input2);
56
- entry._dirty = true;
42
+ active.patch(input2);
57
43
  dirty = true;
58
44
  hooks.callHook("entries:updated", head);
59
45
  },
60
46
  dispose() {
61
47
  if (core.entries.has(active._i)) {
62
- coreDispose();
48
+ active.dispose();
63
49
  head.invalidate();
64
50
  }
65
51
  }
66
52
  };
67
- return clientActive;
68
53
  }
69
54
  };
70
- (options.plugins || []).forEach((p) => registerPlugin(head, p));
71
- registerPlugin(head, {
72
- key: "client",
73
- hooks: {
74
- "entries:updated": () => {
75
- head.render();
76
- }
77
- }
55
+ hooks.hook("entries:updated", () => {
56
+ renderer(head);
78
57
  });
79
- const initEntries = [
80
- initialPayload ? JSON.parse(initialPayload) : false,
81
- ...options.init || []
82
- ];
83
- initEntries.forEach((e) => e && head.push(e));
58
+ options.plugins?.forEach((p) => registerPlugin(head, p));
59
+ initialPayload && head.push(JSON.parse(initialPayload));
60
+ options.init?.forEach((e) => e && head.push(e));
84
61
  return head;
85
62
  }
86
63
 
package/dist/index.d.mts CHANGED
@@ -1,17 +1,13 @@
1
- import { H as HeadSafe } from './shared/unhead.DV1JgQq2.mjs';
2
- import { ad as ResolvableHead, ag as UseSeoMetaInput } from './shared/unhead.CEWerdEp.mjs';
3
- import { q as Unhead, o as HeadEntryOptions, k as ActiveHeadEntry, p as HeadRenderer, C as CreateHeadOptions } from './shared/unhead.nIyuXWp0.mjs';
4
- export { u as useScript } from './shared/unhead.BvMMF8wH.mjs';
1
+ import { H as HeadSafe } from './shared/unhead.OoU46jDW.mjs';
2
+ import { aj as ResolvableHead, am as UseSeoMetaInput } from './shared/unhead.5ph757u1.mjs';
3
+ import { q as Unhead, o as HeadEntryOptions, k as ActiveHeadEntry, p as HeadRenderer, C as CreateHeadOptions } from './shared/unhead.CzbvM4Ih.mjs';
4
+ export { u as useScript } from './shared/unhead.sufKyII-.mjs';
5
5
  import 'hookable';
6
6
 
7
7
  declare function useHead<T extends Unhead<any>, I = ResolvableHead>(unhead: T, input?: ResolvableHead, options?: HeadEntryOptions): ActiveHeadEntry<I>;
8
8
  declare function useHeadSafe<T extends Unhead<any>>(unhead: T, input?: HeadSafe, options?: HeadEntryOptions): ActiveHeadEntry<HeadSafe>;
9
9
  declare function useSeoMeta<T extends Unhead<any>>(unhead: T, input?: UseSeoMetaInput, options?: HeadEntryOptions): ActiveHeadEntry<UseSeoMetaInput>;
10
10
 
11
- /**
12
- * Creates a core instance of unhead. Does not provide a global ctx for composables to work
13
- * and does not register DOM plugins.
14
- */
15
11
  declare function createUnhead<T = ResolvableHead, R = unknown>(renderer: HeadRenderer<R>, resolvedOptions?: CreateHeadOptions): Unhead<T, R>;
16
12
 
17
13
  export { createUnhead, useHead, useHeadSafe, useSeoMeta };
package/dist/index.d.ts CHANGED
@@ -1,17 +1,13 @@
1
- import { H as HeadSafe } from './shared/unhead.CPLhZXQc.js';
2
- import { ad as ResolvableHead, ag as UseSeoMetaInput } from './shared/unhead.CEWerdEp.js';
3
- import { q as Unhead, o as HeadEntryOptions, k as ActiveHeadEntry, p as HeadRenderer, C as CreateHeadOptions } from './shared/unhead.C8vIYPdy.js';
4
- export { u as useScript } from './shared/unhead.BMNVj5kM.js';
1
+ import { H as HeadSafe } from './shared/unhead.BqsuEzgR.js';
2
+ import { aj as ResolvableHead, am as UseSeoMetaInput } from './shared/unhead.5ph757u1.js';
3
+ import { q as Unhead, o as HeadEntryOptions, k as ActiveHeadEntry, p as HeadRenderer, C as CreateHeadOptions } from './shared/unhead.CmjOtSnf.js';
4
+ export { u as useScript } from './shared/unhead.Cfuv4vVm.js';
5
5
  import 'hookable';
6
6
 
7
7
  declare function useHead<T extends Unhead<any>, I = ResolvableHead>(unhead: T, input?: ResolvableHead, options?: HeadEntryOptions): ActiveHeadEntry<I>;
8
8
  declare function useHeadSafe<T extends Unhead<any>>(unhead: T, input?: HeadSafe, options?: HeadEntryOptions): ActiveHeadEntry<HeadSafe>;
9
9
  declare function useSeoMeta<T extends Unhead<any>>(unhead: T, input?: UseSeoMetaInput, options?: HeadEntryOptions): ActiveHeadEntry<UseSeoMetaInput>;
10
10
 
11
- /**
12
- * Creates a core instance of unhead. Does not provide a global ctx for composables to work
13
- * and does not register DOM plugins.
14
- */
15
11
  declare function createUnhead<T = ResolvableHead, R = unknown>(renderer: HeadRenderer<R>, resolvedOptions?: CreateHeadOptions): Unhead<T, R>;
16
12
 
17
13
  export { createUnhead, useHead, useHeadSafe, useSeoMeta };
package/dist/index.mjs CHANGED
@@ -1,8 +1,8 @@
1
- import { S as SafeInputPlugin, F as FlatMetaPlugin } from './shared/unhead.CpsjOPAu.mjs';
2
- export { c as createUnhead } from './shared/unhead.Dk69jLbN.mjs';
3
- export { u as useScript } from './shared/unhead.DQrNWUd0.mjs';
4
- import './shared/unhead.CJepcqMm.mjs';
5
- import './shared/unhead.jLixRfSR.mjs';
1
+ import { S as SafeInputPlugin, F as FlatMetaPlugin } from './shared/unhead.2y8V0W4A.mjs';
2
+ export { c as createUnhead } from './shared/unhead.Bkfgmqxw.mjs';
3
+ export { u as useScript } from './shared/unhead.D2jdZ2BM.mjs';
4
+ import './shared/unhead.CxhEb2IP.mjs';
5
+ import './shared/unhead.C2yODEXq.mjs';
6
6
  import './shared/unhead.DvIxXxuO.mjs';
7
7
  import 'hookable';
8
8
 
package/dist/parser.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { ae as SerializableHead } from './shared/unhead.CEWerdEp.mjs';
1
+ import { ak as SerializableHead } from './shared/unhead.5ph757u1.mjs';
2
2
 
3
3
  declare const TagIdMap: {
4
4
  readonly html: 0;
package/dist/parser.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { ae as SerializableHead } from './shared/unhead.CEWerdEp.js';
1
+ import { ak as SerializableHead } from './shared/unhead.5ph757u1.js';
2
2
 
3
3
  declare const TagIdMap: {
4
4
  readonly html: 0;
@@ -1,6 +1,6 @@
1
- import { i as HeadPluginInput, q as Unhead, h as HeadPluginOptions } from './shared/unhead.nIyuXWp0.mjs';
1
+ import { i as HeadPluginInput, q as Unhead, h as HeadPluginOptions } from './shared/unhead.CzbvM4Ih.mjs';
2
2
  import 'hookable';
3
- import './shared/unhead.CEWerdEp.mjs';
3
+ import './shared/unhead.5ph757u1.mjs';
4
4
 
5
5
  declare const AliasSortingPlugin: HeadPluginInput;
6
6
 
package/dist/plugins.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { i as HeadPluginInput, q as Unhead, h as HeadPluginOptions } from './shared/unhead.C8vIYPdy.js';
1
+ import { i as HeadPluginInput, q as Unhead, h as HeadPluginOptions } from './shared/unhead.CmjOtSnf.js';
2
2
  import 'hookable';
3
- import './shared/unhead.CEWerdEp.js';
3
+ import './shared/unhead.5ph757u1.js';
4
4
 
5
5
  declare const AliasSortingPlugin: HeadPluginInput;
6
6
 
package/dist/plugins.mjs CHANGED
@@ -1,8 +1,8 @@
1
- import { d as defineHeadPlugin } from './shared/unhead.CpsjOPAu.mjs';
2
- export { F as FlatMetaPlugin, S as SafeInputPlugin } from './shared/unhead.CpsjOPAu.mjs';
1
+ import { d as defineHeadPlugin } from './shared/unhead.2y8V0W4A.mjs';
2
+ export { F as FlatMetaPlugin, S as SafeInputPlugin } from './shared/unhead.2y8V0W4A.mjs';
3
3
  import { p as processTemplateParams } from './shared/unhead.BYvz9V1x.mjs';
4
- import './shared/unhead.CJepcqMm.mjs';
5
- import './shared/unhead.jLixRfSR.mjs';
4
+ import './shared/unhead.CxhEb2IP.mjs';
5
+ import './shared/unhead.C2yODEXq.mjs';
6
6
 
7
7
  const sortTags = (a, b) => a._w === b._w ? a._p - b._p : a._w - b._w;
8
8
  const formatKey = (k) => !k.includes(":key") ? k.split(":").join(":key:") : k;
@@ -1,8 +1,8 @@
1
- import { R as RecordingEntry } from './shared/unhead.nIyuXWp0.mjs';
2
- export { A as AsVoidFunctions, E as EventHandlerOptions, S as ScriptInstance, d as UseFunctionType, a as UseScriptContext, c as UseScriptInput, e as UseScriptOptions, b as UseScriptResolvedInput, f as UseScriptReturn, U as UseScriptStatus, W as WarmupStrategy } from './shared/unhead.nIyuXWp0.mjs';
3
- export { u as useScript } from './shared/unhead.BvMMF8wH.mjs';
1
+ import { R as RecordingEntry } from './shared/unhead.CzbvM4Ih.mjs';
2
+ export { A as AsVoidFunctions, E as EventHandlerOptions, S as ScriptInstance, d as UseFunctionType, a as UseScriptContext, c as UseScriptInput, e as UseScriptOptions, b as UseScriptResolvedInput, f as UseScriptReturn, U as UseScriptStatus, W as WarmupStrategy } from './shared/unhead.CzbvM4Ih.mjs';
3
+ export { u as useScript } from './shared/unhead.sufKyII-.mjs';
4
4
  import 'hookable';
5
- import './shared/unhead.CEWerdEp.mjs';
5
+ import './shared/unhead.5ph757u1.mjs';
6
6
 
7
7
  declare function createSpyProxy<T extends Record<string, any> | any[]>(target: T, onApply: (stack: RecordingEntry[][]) => void): T;
8
8
 
package/dist/scripts.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- import { R as RecordingEntry } from './shared/unhead.C8vIYPdy.js';
2
- export { A as AsVoidFunctions, E as EventHandlerOptions, S as ScriptInstance, d as UseFunctionType, a as UseScriptContext, c as UseScriptInput, e as UseScriptOptions, b as UseScriptResolvedInput, f as UseScriptReturn, U as UseScriptStatus, W as WarmupStrategy } from './shared/unhead.C8vIYPdy.js';
3
- export { u as useScript } from './shared/unhead.BMNVj5kM.js';
1
+ import { R as RecordingEntry } from './shared/unhead.CmjOtSnf.js';
2
+ export { A as AsVoidFunctions, E as EventHandlerOptions, S as ScriptInstance, d as UseFunctionType, a as UseScriptContext, c as UseScriptInput, e as UseScriptOptions, b as UseScriptResolvedInput, f as UseScriptReturn, U as UseScriptStatus, W as WarmupStrategy } from './shared/unhead.CmjOtSnf.js';
3
+ export { u as useScript } from './shared/unhead.Cfuv4vVm.js';
4
4
  import 'hookable';
5
- import './shared/unhead.CEWerdEp.js';
5
+ import './shared/unhead.5ph757u1.js';
6
6
 
7
7
  declare function createSpyProxy<T extends Record<string, any> | any[]>(target: T, onApply: (stack: RecordingEntry[][]) => void): T;
8
8
 
package/dist/scripts.mjs CHANGED
@@ -1,7 +1,7 @@
1
- export { u as useScript } from './shared/unhead.DQrNWUd0.mjs';
1
+ export { u as useScript } from './shared/unhead.D2jdZ2BM.mjs';
2
2
  import './shared/unhead.DvIxXxuO.mjs';
3
3
  import 'hookable';
4
- import './shared/unhead.jLixRfSR.mjs';
4
+ import './shared/unhead.C2yODEXq.mjs';
5
5
 
6
6
  function createSpyProxy(target, onApply) {
7
7
  const stack = [];
package/dist/server.d.mts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { HookableCore } from 'hookable';
2
- import { l as CreateServerHeadOptions, q as Unhead, t as SSRHeadPayload, J as ServerHeadHooks, u as RenderSSRHeadOptions, p as HeadRenderer } from './shared/unhead.nIyuXWp0.mjs';
3
- import { ad as ResolvableHead, aC as HeadTag } from './shared/unhead.CEWerdEp.mjs';
2
+ import { l as CreateServerHeadOptions, q as Unhead, t as SSRHeadPayload, J as ServerHeadHooks, u as RenderSSRHeadOptions, p as HeadRenderer } from './shared/unhead.CzbvM4Ih.mjs';
3
+ import { aj as ResolvableHead, aJ as HeadTag } from './shared/unhead.5ph757u1.mjs';
4
4
 
5
5
  interface ServerUnhead<T = ResolvableHead> extends Unhead<T, SSRHeadPayload> {
6
6
  hooks: HookableCore<ServerHeadHooks>;
@@ -16,7 +16,7 @@ declare function capoTagWeight(tag: HeadTag): number;
16
16
  * and injecting the resulting head tags back into the HTML.
17
17
  * Uses optimized parsing and index-based HTML construction for best performance.
18
18
  */
19
- declare function transformHtmlTemplate(head: Unhead<any>, html: string, options?: RenderSSRHeadOptions): Promise<string>;
19
+ declare function transformHtmlTemplate(head: Unhead<any, SSRHeadPayload>, html: string): string;
20
20
  /**
21
21
  * Transform an HTML template string by injecting head tags managed by Unhead.
22
22
  *
@@ -26,7 +26,7 @@ declare function transformHtmlTemplate(head: Unhead<any>, html: string, options?
26
26
  * However, this also means that any head tags or attributes already present in the HTML may be duplicated or
27
27
  * ordered incorrectly, so use with caution.
28
28
  */
29
- declare function transformHtmlTemplateRaw(head: Unhead<any>, html: string, options?: RenderSSRHeadOptions): Promise<string>;
29
+ declare function transformHtmlTemplateRaw(head: Unhead<any, SSRHeadPayload>, html: string): string;
30
30
 
31
31
  declare function propsToString(props: Record<string, any>): string;
32
32
 
package/dist/server.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { HookableCore } from 'hookable';
2
- import { l as CreateServerHeadOptions, q as Unhead, t as SSRHeadPayload, J as ServerHeadHooks, u as RenderSSRHeadOptions, p as HeadRenderer } from './shared/unhead.C8vIYPdy.js';
3
- import { ad as ResolvableHead, aC as HeadTag } from './shared/unhead.CEWerdEp.js';
2
+ import { l as CreateServerHeadOptions, q as Unhead, t as SSRHeadPayload, J as ServerHeadHooks, u as RenderSSRHeadOptions, p as HeadRenderer } from './shared/unhead.CmjOtSnf.js';
3
+ import { aj as ResolvableHead, aJ as HeadTag } from './shared/unhead.5ph757u1.js';
4
4
 
5
5
  interface ServerUnhead<T = ResolvableHead> extends Unhead<T, SSRHeadPayload> {
6
6
  hooks: HookableCore<ServerHeadHooks>;
@@ -16,7 +16,7 @@ declare function capoTagWeight(tag: HeadTag): number;
16
16
  * and injecting the resulting head tags back into the HTML.
17
17
  * Uses optimized parsing and index-based HTML construction for best performance.
18
18
  */
19
- declare function transformHtmlTemplate(head: Unhead<any>, html: string, options?: RenderSSRHeadOptions): Promise<string>;
19
+ declare function transformHtmlTemplate(head: Unhead<any, SSRHeadPayload>, html: string): string;
20
20
  /**
21
21
  * Transform an HTML template string by injecting head tags managed by Unhead.
22
22
  *
@@ -26,7 +26,7 @@ declare function transformHtmlTemplate(head: Unhead<any>, html: string, options?
26
26
  * However, this also means that any head tags or attributes already present in the HTML may be duplicated or
27
27
  * ordered incorrectly, so use with caution.
28
28
  */
29
- declare function transformHtmlTemplateRaw(head: Unhead<any>, html: string, options?: RenderSSRHeadOptions): Promise<string>;
29
+ declare function transformHtmlTemplateRaw(head: Unhead<any, SSRHeadPayload>, html: string): string;
30
30
 
31
31
  declare function propsToString(props: Record<string, any>): string;
32
32
 
package/dist/server.mjs CHANGED
@@ -1,25 +1,22 @@
1
- import { r as renderSSRHead$1 } from './shared/unhead.C872_DIi.mjs';
2
- export { b as capoTagWeight, c as createHead, a as createServerRenderer, e as escapeHtml, p as propsToString, s as ssrRenderTags, t as tagToString } from './shared/unhead.C872_DIi.mjs';
3
- import './shared/unhead.Dk69jLbN.mjs';
1
+ import { r as renderSSRHead$1 } from './shared/unhead.BfbLkFkg.mjs';
2
+ export { b as capoTagWeight, c as createHead, a as createServerRenderer, e as escapeHtml, p as propsToString, s as ssrRenderTags, t as tagToString } from './shared/unhead.BfbLkFkg.mjs';
3
+ import { parseHtmlForUnheadExtraction, applyHeadToHtml, parseHtmlForIndexes } from './parser.mjs';
4
+ import './shared/unhead.Bkfgmqxw.mjs';
4
5
  import './shared/unhead.DvIxXxuO.mjs';
5
6
  import 'hookable';
6
- import './shared/unhead.BVkBe8OQ.mjs';
7
- import './shared/unhead.jLixRfSR.mjs';
7
+ import './shared/unhead.XhzwfMDf.mjs';
8
+ import './shared/unhead.C2yODEXq.mjs';
8
9
 
9
10
  // @__NO_SIDE_EFFECTS__
10
- async function transformHtmlTemplate(head, html, options) {
11
- const { parseHtmlForUnheadExtraction, applyHeadToHtml } = await import('./parser.mjs');
11
+ function transformHtmlTemplate(head, html) {
12
12
  const template = parseHtmlForUnheadExtraction(html);
13
13
  head.push(template.input, { _index: 0 });
14
- const headHtml = renderSSRHead$1(head, options);
15
- return applyHeadToHtml(template, headHtml);
14
+ return applyHeadToHtml(template, head.render());
16
15
  }
17
16
  // @__NO_SIDE_EFFECTS__
18
- async function transformHtmlTemplateRaw(head, html, options) {
19
- const { parseHtmlForIndexes, applyHeadToHtml } = await import('./parser.mjs');
20
- const headHtml = renderSSRHead$1(head, options);
17
+ function transformHtmlTemplateRaw(head, html) {
21
18
  const template = parseHtmlForIndexes(html);
22
- return applyHeadToHtml(template, headHtml);
19
+ return applyHeadToHtml(template, head.render());
23
20
  }
24
21
 
25
22
  function renderSSRHead(head, options) {
@@ -1,4 +1,4 @@
1
- import { u as unpackMeta } from './unhead.CJepcqMm.mjs';
1
+ import { u as unpackMeta } from './unhead.CxhEb2IP.mjs';
2
2
 
3
3
  function defineHeadPlugin(plugin) {
4
4
  return plugin;