unhead 3.1.0 → 3.1.2
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.d.mts +5 -5
- package/dist/client.d.ts +5 -5
- package/dist/client.mjs +5 -5
- package/dist/index.d.mts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.mjs +2 -2
- package/dist/legacy.d.mts +3 -3
- package/dist/legacy.d.ts +3 -3
- package/dist/legacy.mjs +5 -5
- package/dist/parser.d.mts +1 -1
- package/dist/parser.d.ts +1 -1
- package/dist/plugins.d.mts +13 -4
- package/dist/plugins.d.ts +13 -4
- package/dist/plugins.mjs +5 -2
- package/dist/scripts.d.mts +4 -4
- package/dist/scripts.d.ts +4 -4
- package/dist/scripts.mjs +2 -2
- package/dist/server.d.mts +4 -4
- package/dist/server.d.ts +4 -4
- package/dist/server.mjs +4 -4
- package/dist/shared/{unhead.C5ypJnIO.mjs → unhead.B3gLwi_2.mjs} +9 -6
- package/dist/shared/{unhead.BRwJvCZb.d.ts → unhead.BHr5MNkJ.d.ts} +2 -2
- package/dist/shared/{unhead.gui9LmZS.d.ts → unhead.BNptCUyv.d.mts} +13 -1
- package/dist/shared/{unhead.pv34ME7O.mjs → unhead.BjuLn3hu.mjs} +2 -2
- package/dist/shared/{unhead.ClE7lB2Z.d.mts → unhead.BnlR_jz2.d.mts} +1 -1
- package/dist/shared/{unhead.B7bBMqva.d.mts → unhead.Brajh4vg.d.mts} +1 -1
- package/dist/shared/{unhead.Dc5Pn4qI.d.mts → unhead.ByB97_5N.d.mts} +2 -2
- package/dist/shared/{unhead.DeoGMp34.d.mts → unhead.Bz11580x.d.mts} +43 -9
- package/dist/shared/{unhead.DeoGMp34.d.ts → unhead.Bz11580x.d.ts} +43 -9
- package/dist/shared/{unhead.BX9134DF.d.mts → unhead.CG80LYNi.d.mts} +1 -1
- package/dist/shared/{unhead.cXt2Dgt5.d.ts → unhead.CJ5MDR84.d.ts} +1 -1
- package/dist/shared/{unhead.YnmwhfIN.mjs → unhead.CJY-UeEt.mjs} +2 -2
- package/dist/shared/{unhead.DdarjSpi.d.ts → unhead.CKu1VBXp.d.ts} +2 -2
- package/dist/shared/{unhead.BoZ-Ul8T.d.mts → unhead.CnNMu1HU.d.ts} +13 -1
- package/dist/shared/{unhead.CqVawd25.d.ts → unhead.Dc4-12pQ.d.ts} +1 -1
- package/dist/shared/{unhead.Cv5yrrUd.d.mts → unhead.DjnbVGfW.d.mts} +2 -2
- package/dist/shared/{unhead.Dl_lRDXb.d.mts → unhead.DsqXiUvy.d.mts} +2 -2
- package/dist/shared/{unhead.Dl_lRDXb.d.ts → unhead.DsqXiUvy.d.ts} +2 -2
- package/dist/shared/{unhead.DiRbsb3I.mjs → unhead.DzSj5qjO.mjs} +5 -4
- package/dist/shared/{unhead.DctB-0lW.mjs → unhead.eQfSuvE2.mjs} +2 -2
- package/dist/shared/{unhead.B2jfOxG1.d.mts → unhead.ekDpYRjs.d.mts} +2 -2
- package/dist/shared/{unhead.q49lHHFN.d.ts → unhead.f0Z4Ygga.d.ts} +1 -1
- package/dist/shared/{unhead.-D8hRpkn.d.ts → unhead.jqONLOUN.d.ts} +2 -2
- package/dist/shared/{unhead.DvIxXxuO.mjs → unhead.mB5lMBMV.mjs} +1 -1
- package/dist/stream/client.d.mts +3 -3
- package/dist/stream/client.d.ts +3 -3
- package/dist/stream/client.mjs +1 -1
- package/dist/stream/iife.global.js +1 -1
- package/dist/stream/iife.mjs +2 -2
- package/dist/stream/server.d.mts +3 -3
- package/dist/stream/server.d.ts +3 -3
- package/dist/stream/server.mjs +3 -3
- package/dist/types.d.mts +6 -6
- package/dist/types.d.ts +6 -6
- package/dist/utils.d.mts +2 -2
- package/dist/utils.d.ts +2 -2
- package/dist/utils.mjs +2 -2
- package/dist/validate.d.mts +2 -2
- package/dist/validate.d.ts +2 -2
- package/package.json +3 -3
package/dist/client.d.mts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export { C as ClientUnhead, c as createHead } from './shared/unhead.
|
|
2
|
-
import { R as RenderDomHeadOptions } from './shared/unhead.
|
|
3
|
-
import { p as HeadRenderer, U as Unhead } from './shared/unhead.
|
|
4
|
-
export { c as CreateClientHeadOptions } from './shared/unhead.
|
|
1
|
+
export { C as ClientUnhead, c as createHead } from './shared/unhead.DjnbVGfW.mjs';
|
|
2
|
+
import { R as RenderDomHeadOptions } from './shared/unhead.Brajh4vg.mjs';
|
|
3
|
+
import { p as HeadRenderer, U as Unhead } from './shared/unhead.BNptCUyv.mjs';
|
|
4
|
+
export { c as CreateClientHeadOptions } from './shared/unhead.BNptCUyv.mjs';
|
|
5
5
|
import 'hookable';
|
|
6
|
-
import './shared/unhead.
|
|
6
|
+
import './shared/unhead.Bz11580x.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
|
|
2
|
-
import { R as RenderDomHeadOptions } from './shared/unhead.
|
|
3
|
-
import { p as HeadRenderer, U as Unhead } from './shared/unhead.
|
|
4
|
-
export { c as CreateClientHeadOptions } from './shared/unhead.
|
|
1
|
+
export { C as ClientUnhead, c as createHead } from './shared/unhead.jqONLOUN.js';
|
|
2
|
+
import { R as RenderDomHeadOptions } from './shared/unhead.CJ5MDR84.js';
|
|
3
|
+
import { p as HeadRenderer, U as Unhead } from './shared/unhead.CnNMu1HU.js';
|
|
4
|
+
export { c as CreateClientHeadOptions } from './shared/unhead.CnNMu1HU.js';
|
|
5
5
|
import 'hookable';
|
|
6
|
-
import './shared/unhead.
|
|
6
|
+
import './shared/unhead.Bz11580x.js';
|
|
7
7
|
|
|
8
8
|
declare function createDomRenderer(options?: RenderDomHeadOptions): HeadRenderer<boolean>;
|
|
9
9
|
|
package/dist/client.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { r as renderDOMHead$1 } from './shared/unhead.
|
|
2
|
-
export { c as createDomRenderer } from './shared/unhead.
|
|
3
|
-
export { c as createHead } from './shared/unhead.
|
|
1
|
+
import { r as renderDOMHead$1 } from './shared/unhead.BjuLn3hu.mjs';
|
|
2
|
+
export { c as createDomRenderer } from './shared/unhead.BjuLn3hu.mjs';
|
|
3
|
+
export { c as createHead } from './shared/unhead.CJY-UeEt.mjs';
|
|
4
4
|
import './shared/unhead.fg-0ge_u.mjs';
|
|
5
|
-
import './shared/unhead.
|
|
6
|
-
import './shared/unhead.
|
|
5
|
+
import './shared/unhead.DzSj5qjO.mjs';
|
|
6
|
+
import './shared/unhead.mB5lMBMV.mjs';
|
|
7
7
|
import 'hookable';
|
|
8
8
|
import './shared/unhead.CfgPMHXt.mjs';
|
|
9
9
|
|
package/dist/index.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { U as Unhead, k as HeadEntryOptions, A as ActiveHeadEntry } from './shared/unhead.
|
|
2
|
-
import { aw as ResolvableHead, b5 as UseSeoMetaInput, M as InferLink, X as Link, N as InferScript, aL as Script } from './shared/unhead.
|
|
3
|
-
import { H as HeadSafe } from './shared/unhead.
|
|
4
|
-
export { c as createUnhead } from './shared/unhead.
|
|
5
|
-
export { u as useScript } from './shared/unhead.
|
|
1
|
+
import { U as Unhead, k as HeadEntryOptions, A as ActiveHeadEntry } from './shared/unhead.BNptCUyv.mjs';
|
|
2
|
+
import { aw as ResolvableHead, b5 as UseSeoMetaInput, M as InferLink, X as Link, N as InferScript, aL as Script } from './shared/unhead.Bz11580x.mjs';
|
|
3
|
+
import { H as HeadSafe } from './shared/unhead.CG80LYNi.mjs';
|
|
4
|
+
export { c as createUnhead } from './shared/unhead.ByB97_5N.mjs';
|
|
5
|
+
export { u as useScript } from './shared/unhead.BnlR_jz2.mjs';
|
|
6
6
|
import 'hookable';
|
|
7
7
|
|
|
8
8
|
declare function useHead<T extends Unhead<any>, I = ResolvableHead>(unhead: T, input?: ResolvableHead, options?: HeadEntryOptions): ActiveHeadEntry<I>;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { U as Unhead, k as HeadEntryOptions, A as ActiveHeadEntry } from './shared/unhead.
|
|
2
|
-
import { aw as ResolvableHead, b5 as UseSeoMetaInput, M as InferLink, X as Link, N as InferScript, aL as Script } from './shared/unhead.
|
|
3
|
-
import { H as HeadSafe } from './shared/unhead.
|
|
4
|
-
export { c as createUnhead } from './shared/unhead.
|
|
5
|
-
export { u as useScript } from './shared/unhead.
|
|
1
|
+
import { U as Unhead, k as HeadEntryOptions, A as ActiveHeadEntry } from './shared/unhead.CnNMu1HU.js';
|
|
2
|
+
import { aw as ResolvableHead, b5 as UseSeoMetaInput, M as InferLink, X as Link, N as InferScript, aL as Script } from './shared/unhead.Bz11580x.js';
|
|
3
|
+
import { H as HeadSafe } from './shared/unhead.f0Z4Ygga.js';
|
|
4
|
+
export { c as createUnhead } from './shared/unhead.BHr5MNkJ.js';
|
|
5
|
+
export { u as useScript } from './shared/unhead.Dc4-12pQ.js';
|
|
6
6
|
import 'hookable';
|
|
7
7
|
|
|
8
8
|
declare function useHead<T extends Unhead<any>, I = ResolvableHead>(unhead: T, input?: ResolvableHead, options?: HeadEntryOptions): ActiveHeadEntry<I>;
|
package/dist/index.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { S as SafeInputPlugin, F as FlatMetaPlugin } from './shared/unhead.A4ndrqqe.mjs';
|
|
2
2
|
export { c as createUnhead } from './shared/unhead.CfgPMHXt.mjs';
|
|
3
|
-
export { u as useScript } from './shared/unhead.
|
|
3
|
+
export { u as useScript } from './shared/unhead.eQfSuvE2.mjs';
|
|
4
4
|
import './shared/unhead.JWUDzlIs.mjs';
|
|
5
5
|
import './shared/unhead.fg-0ge_u.mjs';
|
|
6
6
|
import './shared/unhead.CUXLLRtV.mjs';
|
|
7
|
-
import './shared/unhead.
|
|
7
|
+
import './shared/unhead.mB5lMBMV.mjs';
|
|
8
8
|
import 'hookable';
|
|
9
9
|
|
|
10
10
|
function useHead(unhead, input, options = {}) {
|
package/dist/legacy.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { c as createUnhead } from './shared/unhead.
|
|
2
|
-
import { n as HeadPluginInput, U as Unhead, c as CreateClientHeadOptions, e as CreateServerHeadOptions } from './shared/unhead.
|
|
3
|
-
import { aw as ResolvableHead } from './shared/unhead.
|
|
1
|
+
import { c as createUnhead } from './shared/unhead.ByB97_5N.mjs';
|
|
2
|
+
import { n as HeadPluginInput, U as Unhead, c as CreateClientHeadOptions, e as CreateServerHeadOptions } from './shared/unhead.BNptCUyv.mjs';
|
|
3
|
+
import { aw as ResolvableHead } from './shared/unhead.Bz11580x.mjs';
|
|
4
4
|
import 'hookable';
|
|
5
5
|
|
|
6
6
|
/**
|
package/dist/legacy.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { c as createUnhead } from './shared/unhead.
|
|
2
|
-
import { n as HeadPluginInput, U as Unhead, c as CreateClientHeadOptions, e as CreateServerHeadOptions } from './shared/unhead.
|
|
3
|
-
import { aw as ResolvableHead } from './shared/unhead.
|
|
1
|
+
import { c as createUnhead } from './shared/unhead.BHr5MNkJ.js';
|
|
2
|
+
import { n as HeadPluginInput, U as Unhead, c as CreateClientHeadOptions, e as CreateServerHeadOptions } from './shared/unhead.CnNMu1HU.js';
|
|
3
|
+
import { aw as ResolvableHead } from './shared/unhead.Bz11580x.js';
|
|
4
4
|
import 'hookable';
|
|
5
5
|
|
|
6
6
|
/**
|
package/dist/legacy.mjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { P as PromisesPlugin, T as TemplateParamsPlugin, A as AliasSortingPlugin } from './shared/unhead.CH30252c.mjs';
|
|
2
2
|
import { d as defineHeadPlugin } from './shared/unhead.CUXLLRtV.mjs';
|
|
3
3
|
import { c as createUnhead } from './shared/unhead.CfgPMHXt.mjs';
|
|
4
|
-
import { c as createHead$1 } from './shared/unhead.
|
|
5
|
-
import {
|
|
4
|
+
import { c as createHead$1 } from './shared/unhead.CJY-UeEt.mjs';
|
|
5
|
+
import { a as createHead$2 } from './shared/unhead.B3gLwi_2.mjs';
|
|
6
6
|
import './shared/unhead.BGFxPGPQ.mjs';
|
|
7
|
-
import './shared/unhead.
|
|
7
|
+
import './shared/unhead.mB5lMBMV.mjs';
|
|
8
8
|
import 'hookable';
|
|
9
|
-
import './shared/unhead.
|
|
9
|
+
import './shared/unhead.BjuLn3hu.mjs';
|
|
10
10
|
import './shared/unhead.fg-0ge_u.mjs';
|
|
11
|
-
import './shared/unhead.
|
|
11
|
+
import './shared/unhead.DzSj5qjO.mjs';
|
|
12
12
|
|
|
13
13
|
const DeprecationsPlugin = /* @__PURE__ */ defineHeadPlugin({
|
|
14
14
|
key: "deprecations",
|
package/dist/parser.d.mts
CHANGED
package/dist/parser.d.ts
CHANGED
package/dist/plugins.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { n as HeadPluginInput, U as Unhead, o as HeadPluginOptions } from './shared/unhead.
|
|
2
|
-
import {
|
|
3
|
-
export {
|
|
4
|
-
import { v as HeadTag } from './shared/unhead.
|
|
1
|
+
import { n as HeadPluginInput, U as Unhead, o as HeadPluginOptions } from './shared/unhead.BNptCUyv.mjs';
|
|
2
|
+
import { c as ValidationRuleId, b as RulesConfig } from './shared/unhead.DsqXiUvy.mjs';
|
|
3
|
+
export { R as RuleConfig, a as RuleSeverity, d as ValidationRuleOptions } from './shared/unhead.DsqXiUvy.mjs';
|
|
4
|
+
import { v as HeadTag } from './shared/unhead.Bz11580x.mjs';
|
|
5
5
|
import 'hookable';
|
|
6
6
|
|
|
7
7
|
declare const AliasSortingPlugin: HeadPluginInput;
|
|
@@ -91,6 +91,15 @@ interface MinifyPluginOptions {
|
|
|
91
91
|
* @default true
|
|
92
92
|
*/
|
|
93
93
|
json?: boolean;
|
|
94
|
+
/**
|
|
95
|
+
* Omit line breaks between rendered tags, producing a single line of output.
|
|
96
|
+
*
|
|
97
|
+
* Applied surgically by the renderer (separators only); newlines inside
|
|
98
|
+
* inline content are still handled by the minifiers above, so this is safe.
|
|
99
|
+
*
|
|
100
|
+
* @default false
|
|
101
|
+
*/
|
|
102
|
+
omitLineBreaks?: boolean;
|
|
94
103
|
}
|
|
95
104
|
/**
|
|
96
105
|
* Minifies inline script and style tag content during SSR rendering.
|
package/dist/plugins.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { n as HeadPluginInput, U as Unhead, o as HeadPluginOptions } from './shared/unhead.
|
|
2
|
-
import {
|
|
3
|
-
export {
|
|
4
|
-
import { v as HeadTag } from './shared/unhead.
|
|
1
|
+
import { n as HeadPluginInput, U as Unhead, o as HeadPluginOptions } from './shared/unhead.CnNMu1HU.js';
|
|
2
|
+
import { c as ValidationRuleId, b as RulesConfig } from './shared/unhead.DsqXiUvy.js';
|
|
3
|
+
export { R as RuleConfig, a as RuleSeverity, d as ValidationRuleOptions } from './shared/unhead.DsqXiUvy.js';
|
|
4
|
+
import { v as HeadTag } from './shared/unhead.Bz11580x.js';
|
|
5
5
|
import 'hookable';
|
|
6
6
|
|
|
7
7
|
declare const AliasSortingPlugin: HeadPluginInput;
|
|
@@ -91,6 +91,15 @@ interface MinifyPluginOptions {
|
|
|
91
91
|
* @default true
|
|
92
92
|
*/
|
|
93
93
|
json?: boolean;
|
|
94
|
+
/**
|
|
95
|
+
* Omit line breaks between rendered tags, producing a single line of output.
|
|
96
|
+
*
|
|
97
|
+
* Applied surgically by the renderer (separators only); newlines inside
|
|
98
|
+
* inline content are still handled by the minifiers above, so this is safe.
|
|
99
|
+
*
|
|
100
|
+
* @default false
|
|
101
|
+
*/
|
|
102
|
+
omitLineBreaks?: boolean;
|
|
94
103
|
}
|
|
95
104
|
/**
|
|
96
105
|
* Minifies inline script and style tag content during SSR rendering.
|
package/dist/plugins.mjs
CHANGED
|
@@ -166,11 +166,14 @@ function MinifyPlugin(options) {
|
|
|
166
166
|
const jsMinify = options?.js === false ? false : options?.js || minifyJS;
|
|
167
167
|
const cssMinify = options?.css === false ? false : options?.css || minifyCSS;
|
|
168
168
|
const jsonMinify = options?.json !== false;
|
|
169
|
+
const omitLineBreaks = options?.omitLineBreaks === true;
|
|
169
170
|
return {
|
|
170
171
|
key: "minify",
|
|
171
172
|
hooks: {
|
|
172
|
-
"ssr:render": (
|
|
173
|
-
|
|
173
|
+
"ssr:render": (ctx) => {
|
|
174
|
+
if (omitLineBreaks)
|
|
175
|
+
ctx.options.omitLineBreaks = true;
|
|
176
|
+
for (const tag of ctx.tags) {
|
|
174
177
|
const content = tag.innerHTML;
|
|
175
178
|
if (!content || content.length < 20)
|
|
176
179
|
continue;
|
package/dist/scripts.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { R as RecordingEntry } from './shared/unhead.
|
|
2
|
-
export { a as AsVoidFunctions, j as EventHandlerOptions, u as ScriptInstance, z as UseFunctionType, B as UseScriptContext, F as UseScriptInput, G as UseScriptOptions, I as UseScriptResolvedInput, J as UseScriptReturn, K as UseScriptStatus, W as WarmupStrategy } from './shared/unhead.
|
|
3
|
-
export { u as useScript } from './shared/unhead.
|
|
1
|
+
import { R as RecordingEntry } from './shared/unhead.BNptCUyv.mjs';
|
|
2
|
+
export { a as AsVoidFunctions, j as EventHandlerOptions, u as ScriptInstance, z as UseFunctionType, B as UseScriptContext, F as UseScriptInput, G as UseScriptOptions, I as UseScriptResolvedInput, J as UseScriptReturn, K as UseScriptStatus, W as WarmupStrategy } from './shared/unhead.BNptCUyv.mjs';
|
|
3
|
+
export { u as useScript } from './shared/unhead.BnlR_jz2.mjs';
|
|
4
4
|
import 'hookable';
|
|
5
|
-
import './shared/unhead.
|
|
5
|
+
import './shared/unhead.Bz11580x.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.
|
|
2
|
-
export { a as AsVoidFunctions, j as EventHandlerOptions, u as ScriptInstance, z as UseFunctionType, B as UseScriptContext, F as UseScriptInput, G as UseScriptOptions, I as UseScriptResolvedInput, J as UseScriptReturn, K as UseScriptStatus, W as WarmupStrategy } from './shared/unhead.
|
|
3
|
-
export { u as useScript } from './shared/unhead.
|
|
1
|
+
import { R as RecordingEntry } from './shared/unhead.CnNMu1HU.js';
|
|
2
|
+
export { a as AsVoidFunctions, j as EventHandlerOptions, u as ScriptInstance, z as UseFunctionType, B as UseScriptContext, F as UseScriptInput, G as UseScriptOptions, I as UseScriptResolvedInput, J as UseScriptReturn, K as UseScriptStatus, W as WarmupStrategy } from './shared/unhead.CnNMu1HU.js';
|
|
3
|
+
export { u as useScript } from './shared/unhead.Dc4-12pQ.js';
|
|
4
4
|
import 'hookable';
|
|
5
|
-
import './shared/unhead.
|
|
5
|
+
import './shared/unhead.Bz11580x.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,5 +1,5 @@
|
|
|
1
|
-
export { u as useScript } from './shared/unhead.
|
|
2
|
-
import './shared/unhead.
|
|
1
|
+
export { u as useScript } from './shared/unhead.eQfSuvE2.mjs';
|
|
2
|
+
import './shared/unhead.mB5lMBMV.mjs';
|
|
3
3
|
import 'hookable';
|
|
4
4
|
import './shared/unhead.fg-0ge_u.mjs';
|
|
5
5
|
|
package/dist/server.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { S as ServerUnhead, c as createHead } from './shared/unhead.
|
|
2
|
-
import { r as RenderSSRHeadOptions, p as HeadRenderer, s as SSRHeadPayload, U as Unhead } from './shared/unhead.
|
|
3
|
-
export { e as CreateServerHeadOptions } from './shared/unhead.
|
|
4
|
-
import { v as HeadTag } from './shared/unhead.
|
|
1
|
+
export { S as ServerUnhead, c as createHead } from './shared/unhead.ekDpYRjs.mjs';
|
|
2
|
+
import { r as RenderSSRHeadOptions, p as HeadRenderer, s as SSRHeadPayload, U as Unhead } from './shared/unhead.BNptCUyv.mjs';
|
|
3
|
+
export { e as CreateServerHeadOptions } from './shared/unhead.BNptCUyv.mjs';
|
|
4
|
+
import { v as HeadTag } from './shared/unhead.Bz11580x.mjs';
|
|
5
5
|
import 'hookable';
|
|
6
6
|
|
|
7
7
|
declare function createServerRenderer(options?: RenderSSRHeadOptions): HeadRenderer<SSRHeadPayload>;
|
package/dist/server.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { S as ServerUnhead, c as createHead } from './shared/unhead.
|
|
2
|
-
import { r as RenderSSRHeadOptions, p as HeadRenderer, s as SSRHeadPayload, U as Unhead } from './shared/unhead.
|
|
3
|
-
export { e as CreateServerHeadOptions } from './shared/unhead.
|
|
4
|
-
import { v as HeadTag } from './shared/unhead.
|
|
1
|
+
export { S as ServerUnhead, c as createHead } from './shared/unhead.CKu1VBXp.js';
|
|
2
|
+
import { r as RenderSSRHeadOptions, p as HeadRenderer, s as SSRHeadPayload, U as Unhead } from './shared/unhead.CnNMu1HU.js';
|
|
3
|
+
export { e as CreateServerHeadOptions } from './shared/unhead.CnNMu1HU.js';
|
|
4
|
+
import { v as HeadTag } from './shared/unhead.Bz11580x.js';
|
|
5
5
|
import 'hookable';
|
|
6
6
|
|
|
7
7
|
declare function createServerRenderer(options?: RenderSSRHeadOptions): HeadRenderer<SSRHeadPayload>;
|
package/dist/server.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { r as renderSSRHead$1 } from './shared/unhead.
|
|
2
|
-
export {
|
|
1
|
+
import { r as renderSSRHead$1 } from './shared/unhead.B3gLwi_2.mjs';
|
|
2
|
+
export { c as capoTagWeight, a as createHead, b as createServerRenderer, e as escapeHtml, p as propsToString, s as ssrRenderTags, t as tagToString } from './shared/unhead.B3gLwi_2.mjs';
|
|
3
3
|
import { parseHtmlForUnheadExtraction, applyHeadToHtml, parseHtmlForIndexes } from './parser.mjs';
|
|
4
4
|
import './shared/unhead.CfgPMHXt.mjs';
|
|
5
|
-
import './shared/unhead.
|
|
5
|
+
import './shared/unhead.mB5lMBMV.mjs';
|
|
6
6
|
import 'hookable';
|
|
7
|
-
import './shared/unhead.
|
|
7
|
+
import './shared/unhead.DzSj5qjO.mjs';
|
|
8
8
|
import './shared/unhead.fg-0ge_u.mjs';
|
|
9
9
|
|
|
10
10
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { c as createUnhead, r as registerPlugin } from './unhead.CfgPMHXt.mjs';
|
|
2
|
-
import {
|
|
3
|
-
import { r as resolveTags } from './unhead.
|
|
2
|
+
import { c as callHook, a as createHooks } from './unhead.mB5lMBMV.mjs';
|
|
3
|
+
import { r as resolveTags } from './unhead.DzSj5qjO.mjs';
|
|
4
4
|
import { b as TagPriorityAliases, c as TagsWithInnerContent, a as SelfClosingTags } from './unhead.fg-0ge_u.mjs';
|
|
5
5
|
|
|
6
6
|
const TAG_WEIGHTS = { base: -10, title: 10 };
|
|
@@ -122,9 +122,12 @@ function createServerRenderer(options = {}) {
|
|
|
122
122
|
callHook(head, "ssr:beforeRender", beforeRenderCtx);
|
|
123
123
|
if (!beforeRenderCtx.shouldRender)
|
|
124
124
|
return ssrRenderTags([]);
|
|
125
|
-
const ctx = {
|
|
125
|
+
const ctx = {
|
|
126
|
+
tags: options.resolvedTags || resolveTags(head, { tagWeight: options.tagWeight ?? capoTagWeight }),
|
|
127
|
+
options: { ...options }
|
|
128
|
+
};
|
|
126
129
|
callHook(head, "ssr:render", ctx);
|
|
127
|
-
const html = ssrRenderTags(ctx.tags, options);
|
|
130
|
+
const html = ssrRenderTags(ctx.tags, ctx.options);
|
|
128
131
|
const renderCtx = { tags: ctx.tags, html };
|
|
129
132
|
callHook(head, "ssr:rendered", renderCtx);
|
|
130
133
|
return renderCtx.html;
|
|
@@ -138,7 +141,7 @@ function renderSSRHead(head, options) {
|
|
|
138
141
|
// @__NO_SIDE_EFFECTS__
|
|
139
142
|
function createHead(options = {}) {
|
|
140
143
|
const tagWeight = options.tagWeight || capoTagWeight;
|
|
141
|
-
const render = createServerRenderer({ tagWeight });
|
|
144
|
+
const render = createServerRenderer({ tagWeight, omitLineBreaks: options.omitLineBreaks });
|
|
142
145
|
const core = createUnhead(render, {
|
|
143
146
|
_tagWeight: tagWeight,
|
|
144
147
|
// @ts-expect-error untyped
|
|
@@ -201,4 +204,4 @@ function createHead(options = {}) {
|
|
|
201
204
|
return head;
|
|
202
205
|
}
|
|
203
206
|
|
|
204
|
-
export {
|
|
207
|
+
export { createHead as a, createServerRenderer as b, capoTagWeight as c, escapeHtml as e, propsToString as p, renderSSRHead as r, ssrRenderTags as s, tagToString as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { p as HeadRenderer, d as CreateHeadOptions, U as Unhead } from './unhead.
|
|
2
|
-
import { aw as ResolvableHead } from './unhead.
|
|
1
|
+
import { p as HeadRenderer, d as CreateHeadOptions, U as Unhead } from './unhead.CnNMu1HU.js';
|
|
2
|
+
import { aw as ResolvableHead } from './unhead.Bz11580x.js';
|
|
3
3
|
|
|
4
4
|
declare function createUnhead<T = ResolvableHead, R = unknown>(renderer: HeadRenderer<R>, resolvedOptions?: CreateHeadOptions): Unhead<T, R>;
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HookableCore } from 'hookable';
|
|
2
|
-
import { t as GenericScript, aN as ScriptHttpEvents, D as DataKeys, a1 as MaybeEventFnHandlers, z as HttpEventAttributes, aK as SchemaAugmentations, v as HeadTag, aw as ResolvableHead, aX as TagPosition, aY as TagPriority, ar as ProcessesTemplateParams, aJ as ResolvesDuplicates, a_ as TemplateParams } from './unhead.
|
|
2
|
+
import { t as GenericScript, aN as ScriptHttpEvents, D as DataKeys, a1 as MaybeEventFnHandlers, z as HttpEventAttributes, aK as SchemaAugmentations, v as HeadTag, aw as ResolvableHead, aX as TagPosition, aY as TagPriority, ar as ProcessesTemplateParams, aJ as ResolvesDuplicates, a_ as TemplateParams } from './unhead.Bz11580x.mjs';
|
|
3
3
|
|
|
4
4
|
type UseScriptStatus = 'awaitingLoad' | 'loading' | 'loaded' | 'error' | 'removed';
|
|
5
5
|
type UseScriptContext<T extends Record<symbol | string, any>> = ScriptInstance<T>;
|
|
@@ -189,6 +189,7 @@ interface SSRHeadHooks {
|
|
|
189
189
|
'ssr:beforeRender': (ctx: ShouldRenderContext) => HookResult;
|
|
190
190
|
'ssr:render': (ctx: {
|
|
191
191
|
tags: HeadTag[];
|
|
192
|
+
options: RenderSSRHeadOptions;
|
|
192
193
|
}) => HookResult;
|
|
193
194
|
'ssr:rendered': (ctx: SSRRenderContext) => HookResult;
|
|
194
195
|
}
|
|
@@ -347,6 +348,17 @@ interface CreateServerHeadOptions extends CreateHeadOptions {
|
|
|
347
348
|
* - <meta name="viewport" content="width=device-width, initial-scale=1">
|
|
348
349
|
*/
|
|
349
350
|
disableDefaults?: boolean;
|
|
351
|
+
/**
|
|
352
|
+
* Omit line breaks between rendered tags, producing a single line of output.
|
|
353
|
+
*
|
|
354
|
+
* Only removes the separators *between* tags; newlines inside inline
|
|
355
|
+
* `<script>`/`<style>`/JSON-LD content are preserved.
|
|
356
|
+
*
|
|
357
|
+
* @deprecated Prefer `MinifyPlugin` from `unhead/plugins`, which minifies the
|
|
358
|
+
* inline content itself (where the real bytes are) rather than only dropping
|
|
359
|
+
* separators.
|
|
360
|
+
*/
|
|
361
|
+
omitLineBreaks?: boolean;
|
|
350
362
|
}
|
|
351
363
|
interface CreateStreamableServerHeadOptions extends Omit<CreateServerHeadOptions, 'experimentalStreamKey'> {
|
|
352
364
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { H as HasElementTags } from './unhead.fg-0ge_u.mjs';
|
|
2
|
-
import { b as normalizeProps, d as dedupeKey, h as hashTag, r as resolveTags, i as isMetaArrayDupeKey } from './unhead.
|
|
3
|
-
import {
|
|
2
|
+
import { b as normalizeProps, d as dedupeKey, h as hashTag, r as resolveTags, i as isMetaArrayDupeKey } from './unhead.DzSj5qjO.mjs';
|
|
3
|
+
import { c as callHook } from './unhead.mB5lMBMV.mjs';
|
|
4
4
|
|
|
5
5
|
const WHITESPACE_RE = /\s+/;
|
|
6
6
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { U as Unhead, F as UseScriptInput, G as UseScriptOptions, J as UseScriptReturn } from './unhead.
|
|
1
|
+
import { U as Unhead, F as UseScriptInput, G as UseScriptOptions, J as UseScriptReturn } from './unhead.BNptCUyv.mjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Load third-party scripts with SSR support and a proxied API.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { p as HeadRenderer, d as CreateHeadOptions, U as Unhead } from './unhead.
|
|
2
|
-
import { aw as ResolvableHead } from './unhead.
|
|
1
|
+
import { p as HeadRenderer, d as CreateHeadOptions, U as Unhead } from './unhead.BNptCUyv.mjs';
|
|
2
|
+
import { aw as ResolvableHead } from './unhead.Bz11580x.mjs';
|
|
3
3
|
|
|
4
4
|
declare function createUnhead<T = ResolvableHead, R = unknown>(renderer: HeadRenderer<R>, resolvedOptions?: CreateHeadOptions): Unhead<T, R>;
|
|
5
5
|
|
|
@@ -1053,21 +1053,38 @@ interface GenericLink extends LinkBase {
|
|
|
1053
1053
|
*/
|
|
1054
1054
|
type Link = StylesheetLink | AlternateStylesheetLink | PreloadLink | ModulepreloadLink | PrefetchLink | FaviconLink | AppleTouchIconLink | MaskIconLink | ManifestLink | CanonicalLink | DnsPrefetchLink | PreconnectLink | PrerenderLink | AlternateLanguageLink | AlternateFeedLink | AlternateMediaLink | BareAlternateLink | AuthorLink | LicenseLink | HelpLink | SearchLink | PrevLink | NextLink | PingbackLink | MeLink | WebmentionLink | PrivacyPolicyLink | TermsOfServiceLink | ExpectLink | CompressionDictionaryLink | SitemapLink | AppleTouchStartupImageLink | AmpHtmlLink | HubLink;
|
|
1055
1055
|
/**
|
|
1056
|
-
* Pick {@link Link} union members whose `rel` accepts `R`.
|
|
1056
|
+
* Pick {@link Link} union members whose `rel` accepts `R`. Distributes over `R`,
|
|
1057
|
+
* so a union rel like `'preconnect' | 'dns-prefetch'` returns the union of all
|
|
1058
|
+
* matching variants.
|
|
1057
1059
|
*
|
|
1058
1060
|
* Unlike `Extract<Link, { rel: R }>`, this handles members whose `rel` is itself
|
|
1059
1061
|
* a union (e.g. {@link FaviconLink}'s `'icon' | 'shortcut icon'`).
|
|
1060
1062
|
*/
|
|
1061
|
-
type MatchLinkByRel<R> = Link extends infer M ? M extends {
|
|
1063
|
+
type MatchLinkByRel<R> = R extends any ? Link extends infer M ? M extends {
|
|
1062
1064
|
rel: infer MR;
|
|
1063
|
-
} ? R extends MR ? M : never : never : never;
|
|
1065
|
+
} ? R extends MR ? M : never : never : never : never;
|
|
1066
|
+
type UnionToIntersection$1<U> = (U extends any ? (k: U) => void : never) extends ((k: infer I) => void) ? I : never;
|
|
1067
|
+
type IsUnion$1<T, U extends T = T> = T extends T ? ([U] extends [T] ? false : true) : never;
|
|
1068
|
+
/**
|
|
1069
|
+
* For a union rel input, the structural intersection of matching variants
|
|
1070
|
+
* (minus their `rel` discriminator) plus the original rel union. Lets
|
|
1071
|
+
* {@link defineLink} accept a runtime-determined rel like
|
|
1072
|
+
* `cond ? 'preconnect' : 'dns-prefetch'` without losing field validation.
|
|
1073
|
+
*/
|
|
1074
|
+
type InferLinkUnion<R> = UnionToIntersection$1<MatchLinkByRel<R> extends infer M ? (M extends any ? Omit<M, 'rel'> : never) : never> & {
|
|
1075
|
+
rel: R;
|
|
1076
|
+
};
|
|
1064
1077
|
/**
|
|
1065
1078
|
* Resolve a single link input to either its strict {@link Link} variant (when
|
|
1066
1079
|
* `rel` is a {@link KnownLinkRel}) or {@link GenericLink} (for custom rels).
|
|
1080
|
+
*
|
|
1081
|
+
* Union `rel` inputs (e.g. `'preconnect' | 'dns-prefetch'`) resolve to the
|
|
1082
|
+
* structural intersection of matching variants, so runtime-determined rels are
|
|
1083
|
+
* accepted without casts.
|
|
1067
1084
|
*/
|
|
1068
1085
|
type InferLink<T> = T extends {
|
|
1069
1086
|
rel: infer R;
|
|
1070
|
-
} ? R extends KnownLinkRel ? DeepReadonly<MatchLinkByRel<R>> : R extends string ? DeepReadonly<GenericLink> & {
|
|
1087
|
+
} ? R extends KnownLinkRel ? IsUnion$1<R> extends true ? DeepReadonly<InferLinkUnion<R>> : DeepReadonly<MatchLinkByRel<R>> : R extends string ? DeepReadonly<GenericLink> & {
|
|
1071
1088
|
rel: R;
|
|
1072
1089
|
} : never : never;
|
|
1073
1090
|
|
|
@@ -2604,24 +2621,41 @@ type Script = ExternalScript | ModuleScript | InlineScript | InlineModuleScript
|
|
|
2604
2621
|
*/
|
|
2605
2622
|
type KnownScriptType = '' | 'text/javascript' | 'module' | 'application/ld+json' | 'speculationrules' | 'importmap' | 'application/json';
|
|
2606
2623
|
/**
|
|
2607
|
-
* Pick {@link Script} union members whose `type` accepts `U`.
|
|
2624
|
+
* Pick {@link Script} union members whose `type` accepts `U`. Distributes over
|
|
2625
|
+
* `U`, so a union type like `'text/javascript' | 'module'` returns the union of
|
|
2626
|
+
* all matching variants.
|
|
2608
2627
|
*
|
|
2609
2628
|
* Handles members whose `type` is itself a union (e.g. {@link ExternalScript}'s
|
|
2610
2629
|
* `'' | 'text/javascript'`), and members where `type` is optional.
|
|
2611
2630
|
*/
|
|
2612
|
-
type MatchScriptByType<U> = Script extends infer M ? M extends {
|
|
2631
|
+
type MatchScriptByType<U> = U extends any ? Script extends infer M ? M extends {
|
|
2613
2632
|
type?: infer MT;
|
|
2614
|
-
} ? U extends MT ? M : never : never : never;
|
|
2633
|
+
} ? U extends MT ? M : never : never : never : never;
|
|
2634
|
+
type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends ((k: infer I) => void) ? I : never;
|
|
2635
|
+
type IsUnion<T, U extends T = T> = T extends T ? ([U] extends [T] ? false : true) : never;
|
|
2636
|
+
/**
|
|
2637
|
+
* For a union `type` input, the structural intersection of matching variants
|
|
2638
|
+
* (minus their `type` discriminator) plus the original type union. Lets
|
|
2639
|
+
* {@link defineScript} accept a runtime-determined type like
|
|
2640
|
+
* `cond ? 'text/javascript' : 'module'` without losing field validation.
|
|
2641
|
+
*/
|
|
2642
|
+
type InferScriptUnion<U> = UnionToIntersection<MatchScriptByType<U> extends infer M ? (M extends any ? Omit<M, 'type'> : never) : never> & {
|
|
2643
|
+
type: U;
|
|
2644
|
+
};
|
|
2615
2645
|
/**
|
|
2616
2646
|
* Resolve a single script input to either its strict {@link Script} variant (when
|
|
2617
2647
|
* `type` is a {@link KnownScriptType}) or {@link GenericScript} (for custom types).
|
|
2618
2648
|
*
|
|
2649
|
+
* Union `type` inputs (e.g. `'text/javascript' | 'module'`) resolve to the
|
|
2650
|
+
* structural intersection of matching variants, so runtime-determined types are
|
|
2651
|
+
* accepted without casts.
|
|
2652
|
+
*
|
|
2619
2653
|
* When no `type` field is present, or `type` is non-string, the full {@link Script}
|
|
2620
2654
|
* union is returned so discriminators like `src` vs `textContent` still apply.
|
|
2621
2655
|
*/
|
|
2622
2656
|
type InferScript<T> = T extends {
|
|
2623
2657
|
type: infer U;
|
|
2624
|
-
} ? U extends string ? U extends KnownScriptType ? DeepReadonly<MatchScriptByType<U>> : DeepReadonly<GenericScript> & {
|
|
2658
|
+
} ? U extends string ? U extends KnownScriptType ? IsUnion<U> extends true ? DeepReadonly<InferScriptUnion<U>> : DeepReadonly<MatchScriptByType<U>> : DeepReadonly<GenericScript> & {
|
|
2625
2659
|
type: U;
|
|
2626
2660
|
} : DeepReadonly<Script> : DeepReadonly<Script>;
|
|
2627
2661
|
|
|
@@ -2942,4 +2976,4 @@ interface HeadTag extends TagPriority, TagPosition, ResolvesDuplicates, HasTempl
|
|
|
2942
2976
|
}
|
|
2943
2977
|
type HeadTagKeys = (keyof HeadTag)[];
|
|
2944
2978
|
|
|
2945
|
-
export type { MaskIconLink as $, AlternateFeedLink as A,
|
|
2979
|
+
export type { MaskIconLink as $, AlternateFeedLink as A, BareAlternateLink as B, CanonicalLink as C, DataKeys as D, ExpectLink as E, FaviconLink as F, GenericLink as G, HasTemplateParams as H, HubLink as I, IconLink as J, ImportMapConfig as K, ImportMapScript as L, InferLink as M, InferScript as N, InlineModuleScript as O, InlineScript as P, InnerContent as Q, InnerContentVal as R, InternalTagKey as S, JsonLdScript as T, KnownLinkRel as U, KnownScriptType as V, LicenseLink as W, Link as X, LinkBase as Y, LinkHttpEvents as Z, ManifestLink as _, AlternateLanguageLink as a, TemplateParamsAugmentations as a$, MaybeArray as a0, MaybeEventFnHandlers as a1, MeLink as a2, Meta as a3, MetaBase as a4, MetaFlat as a5, MetaGeneric as a6, MetaNames as a7, MetaProperties as a8, ModuleScript as a9, ResolvableNoscript as aA, ResolvableProperties as aB, ResolvableScript as aC, ResolvableStyle as aD, ResolvableTemplateParams as aE, ResolvableTitle as aF, ResolvableTitleTemplate as aG, ResolvableUnion as aH, ResolvableValue as aI, ResolvesDuplicates as aJ, SchemaAugmentations as aK, Script as aL, ScriptBase as aM, ScriptHttpEvents as aN, SearchLink as aO, SerializableHead as aP, SitemapLink as aQ, SpeculationRules as aR, SpeculationRulesScript as aS, StringInnerContent as aT, Stringable as aU, StylesheetLink as aV, TagKey as aW, TagPosition as aX, TagPriority as aY, TagUserProperties as aZ, TemplateParams as a_, ModulepreloadLink as aa, NameMeta as ab, Never as ac, NextLink as ad, PingbackLink as ae, PreconnectLink as af, PrefetchLink as ag, PreloadFontLink as ah, PreloadImageLink as ai, PreloadLink as aj, PreloadLinkBase as ak, PreloadOtherLink as al, PreloadScriptLink as am, PreloadStyleLink as an, PrerenderLink as ao, PrevLink as ap, PrivacyPolicyLink as aq, ProcessesTemplateParams as ar, PropertyMeta as as, RawInput as at, ResolvableBase as au, ResolvableBodyAttributes as av, ResolvableHead as aw, ResolvableHtmlAttributes as ax, ResolvableLink as ay, ResolvableMeta as az, AlternateLink as b, TermsOfServiceLink as b0, UnheadBodyAttributesWithoutEvents as b1, UnheadHtmlAttributes as b2, UnheadMeta as b3, UseHeadInput as b4, UseSeoMetaInput as b5, ValidTagPositions as b6, WebmentionLink as b7, AlternateMediaLink as c, AlternateStylesheetLink as d, AmpHtmlLink as e, AppleTouchIconLink as f, AppleTouchStartupImageLink as g, ApplicationJsonScript as h, Arrayable as i, AuthorLink as j, BodyAttributesWithoutEvents as k, BodyEvents as l, Booleanable as m, CharsetMeta as n, CompressionDictionaryLink as o, DeepReadonly as p, DeepResolvableProperties as q, DnsPrefetchLink as r, ExternalScript as s, GenericScript as t, GlobalAttributes as u, HeadTag as v, HeadTagKeys as w, HelpLink as x, HttpEquivMeta as y, HttpEventAttributes as z };
|