unhead 3.1.1 → 3.1.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/client.d.mts +3 -3
- package/dist/client.d.ts +3 -3
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/legacy.d.mts +2 -2
- package/dist/legacy.d.ts +2 -2
- package/dist/legacy.mjs +1 -1
- package/dist/plugins.d.mts +10 -1
- package/dist/plugins.d.ts +10 -1
- package/dist/plugins.mjs +5 -2
- package/dist/scripts.d.mts +3 -3
- package/dist/scripts.d.ts +3 -3
- package/dist/server.d.mts +3 -3
- package/dist/server.d.ts +3 -3
- package/dist/server.mjs +2 -2
- package/dist/shared/{unhead.Bu5O0NaA.mjs → unhead.B3gLwi_2.mjs} +6 -3
- package/dist/shared/{unhead.DwiUIw06.d.ts → unhead.BHr5MNkJ.d.ts} +1 -1
- package/dist/shared/{unhead.BodZ6XwK.d.mts → unhead.BNptCUyv.d.mts} +12 -0
- package/dist/shared/{unhead.CuuHFiTB.d.mts → unhead.BnlR_jz2.d.mts} +1 -1
- package/dist/shared/{unhead.CwE6ye0n.d.mts → unhead.ByB97_5N.d.mts} +1 -1
- package/dist/shared/{unhead.DbMowiUH.d.ts → unhead.CKu1VBXp.d.ts} +1 -1
- package/dist/shared/{unhead.BWNOp3cv.d.ts → unhead.CnNMu1HU.d.ts} +12 -0
- package/dist/shared/{unhead.CHwJVuR_.d.ts → unhead.Dc4-12pQ.d.ts} +1 -1
- package/dist/shared/{unhead.BjPIONVY.d.mts → unhead.DjnbVGfW.d.mts} +1 -1
- package/dist/shared/{unhead.CwvlUXnx.d.mts → unhead.ekDpYRjs.d.mts} +1 -1
- package/dist/shared/{unhead.B92-AP20.d.ts → unhead.jqONLOUN.d.ts} +1 -1
- package/dist/stream/client.d.mts +2 -2
- package/dist/stream/client.d.ts +2 -2
- package/dist/stream/server.d.mts +2 -2
- package/dist/stream/server.d.ts +2 -2
- package/dist/stream/server.mjs +1 -1
- package/dist/types.d.mts +2 -2
- package/dist/types.d.ts +2 -2
- package/dist/utils.d.mts +1 -1
- package/dist/utils.d.ts +1 -1
- package/package.json +3 -3
package/dist/client.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { C as ClientUnhead, c as createHead } from './shared/unhead.
|
|
1
|
+
export { C as ClientUnhead, c as createHead } from './shared/unhead.DjnbVGfW.mjs';
|
|
2
2
|
import { R as RenderDomHeadOptions } from './shared/unhead.Brajh4vg.mjs';
|
|
3
|
-
import { p as HeadRenderer, U as Unhead } from './shared/unhead.
|
|
4
|
-
export { c as CreateClientHeadOptions } from './shared/unhead.
|
|
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
6
|
import './shared/unhead.Bz11580x.mjs';
|
|
7
7
|
|
package/dist/client.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { C as ClientUnhead, c as createHead } from './shared/unhead.
|
|
1
|
+
export { C as ClientUnhead, c as createHead } from './shared/unhead.jqONLOUN.js';
|
|
2
2
|
import { R as RenderDomHeadOptions } from './shared/unhead.CJ5MDR84.js';
|
|
3
|
-
import { p as HeadRenderer, U as Unhead } from './shared/unhead.
|
|
4
|
-
export { c as CreateClientHeadOptions } from './shared/unhead.
|
|
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
6
|
import './shared/unhead.Bz11580x.js';
|
|
7
7
|
|
package/dist/index.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { U as Unhead, k as HeadEntryOptions, A as ActiveHeadEntry } from './shared/unhead.
|
|
1
|
+
import { U as Unhead, k as HeadEntryOptions, A as ActiveHeadEntry } from './shared/unhead.BNptCUyv.mjs';
|
|
2
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
3
|
import { H as HeadSafe } from './shared/unhead.CG80LYNi.mjs';
|
|
4
|
-
export { c as createUnhead } from './shared/unhead.
|
|
5
|
-
export { u as useScript } from './shared/unhead.
|
|
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.
|
|
1
|
+
import { U as Unhead, k as HeadEntryOptions, A as ActiveHeadEntry } from './shared/unhead.CnNMu1HU.js';
|
|
2
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
3
|
import { H as HeadSafe } from './shared/unhead.f0Z4Ygga.js';
|
|
4
|
-
export { c as createUnhead } from './shared/unhead.
|
|
5
|
-
export { u as useScript } from './shared/unhead.
|
|
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/legacy.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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.
|
|
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
3
|
import { aw as ResolvableHead } from './shared/unhead.Bz11580x.mjs';
|
|
4
4
|
import 'hookable';
|
|
5
5
|
|
package/dist/legacy.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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.
|
|
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
3
|
import { aw as ResolvableHead } from './shared/unhead.Bz11580x.js';
|
|
4
4
|
import 'hookable';
|
|
5
5
|
|
package/dist/legacy.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import { P as PromisesPlugin, T as TemplateParamsPlugin, A as AliasSortingPlugin
|
|
|
2
2
|
import { d as defineHeadPlugin } from './shared/unhead.CUXLLRtV.mjs';
|
|
3
3
|
import { c as createUnhead } from './shared/unhead.CfgPMHXt.mjs';
|
|
4
4
|
import { c as createHead$1 } from './shared/unhead.CJY-UeEt.mjs';
|
|
5
|
-
import { a as createHead$2 } from './shared/unhead.
|
|
5
|
+
import { a as createHead$2 } from './shared/unhead.B3gLwi_2.mjs';
|
|
6
6
|
import './shared/unhead.BGFxPGPQ.mjs';
|
|
7
7
|
import './shared/unhead.mB5lMBMV.mjs';
|
|
8
8
|
import 'hookable';
|
package/dist/plugins.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as HeadPluginInput, U as Unhead, o as HeadPluginOptions } from './shared/unhead.
|
|
1
|
+
import { n as HeadPluginInput, U as Unhead, o as HeadPluginOptions } from './shared/unhead.BNptCUyv.mjs';
|
|
2
2
|
import { c as ValidationRuleId, b as RulesConfig } from './shared/unhead.DsqXiUvy.mjs';
|
|
3
3
|
export { R as RuleConfig, a as RuleSeverity, d as ValidationRuleOptions } from './shared/unhead.DsqXiUvy.mjs';
|
|
4
4
|
import { v as HeadTag } from './shared/unhead.Bz11580x.mjs';
|
|
@@ -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,4 +1,4 @@
|
|
|
1
|
-
import { n as HeadPluginInput, U as Unhead, o as HeadPluginOptions } from './shared/unhead.
|
|
1
|
+
import { n as HeadPluginInput, U as Unhead, o as HeadPluginOptions } from './shared/unhead.CnNMu1HU.js';
|
|
2
2
|
import { c as ValidationRuleId, b as RulesConfig } from './shared/unhead.DsqXiUvy.js';
|
|
3
3
|
export { R as RuleConfig, a as RuleSeverity, d as ValidationRuleOptions } from './shared/unhead.DsqXiUvy.js';
|
|
4
4
|
import { v as HeadTag } from './shared/unhead.Bz11580x.js';
|
|
@@ -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,6 +1,6 @@
|
|
|
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
5
|
import './shared/unhead.Bz11580x.mjs';
|
|
6
6
|
|
package/dist/scripts.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
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
5
|
import './shared/unhead.Bz11580x.js';
|
|
6
6
|
|
package/dist/server.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
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.
|
|
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
4
|
import { v as HeadTag } from './shared/unhead.Bz11580x.mjs';
|
|
5
5
|
import 'hookable';
|
|
6
6
|
|
package/dist/server.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
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.
|
|
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
4
|
import { v as HeadTag } from './shared/unhead.Bz11580x.js';
|
|
5
5
|
import 'hookable';
|
|
6
6
|
|
package/dist/server.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as renderSSRHead$1 } from './shared/unhead.
|
|
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.
|
|
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
5
|
import './shared/unhead.mB5lMBMV.mjs';
|
|
@@ -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
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { p as HeadRenderer, d as CreateHeadOptions, U as Unhead } from './unhead.
|
|
1
|
+
import { p as HeadRenderer, d as CreateHeadOptions, U as Unhead } from './unhead.CnNMu1HU.js';
|
|
2
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>;
|
|
@@ -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,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,4 +1,4 @@
|
|
|
1
|
-
import { p as HeadRenderer, d as CreateHeadOptions, U as Unhead } from './unhead.
|
|
1
|
+
import { p as HeadRenderer, d as CreateHeadOptions, U as Unhead } from './unhead.BNptCUyv.mjs';
|
|
2
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>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HookableCore } from 'hookable';
|
|
2
|
-
import { U as Unhead, s as SSRHeadPayload, v as ServerHeadHooks, e as CreateServerHeadOptions } from './unhead.
|
|
2
|
+
import { U as Unhead, s as SSRHeadPayload, v as ServerHeadHooks, e as CreateServerHeadOptions } from './unhead.CnNMu1HU.js';
|
|
3
3
|
import { aw as ResolvableHead } from './unhead.Bz11580x.js';
|
|
4
4
|
|
|
5
5
|
interface ServerUnhead<T = ResolvableHead> extends Unhead<T, SSRHeadPayload> {
|
|
@@ -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,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.CnNMu1HU.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Load third-party scripts with SSR support and a proxied API.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HookableCore } from 'hookable';
|
|
2
|
-
import { U as Unhead, C as ClientHeadHooks, c as CreateClientHeadOptions } from './unhead.
|
|
2
|
+
import { U as Unhead, C as ClientHeadHooks, c as CreateClientHeadOptions } from './unhead.BNptCUyv.mjs';
|
|
3
3
|
import { aw as ResolvableHead } from './unhead.Bz11580x.mjs';
|
|
4
4
|
|
|
5
5
|
interface ClientUnhead<T = ResolvableHead> extends Unhead<T, boolean> {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HookableCore } from 'hookable';
|
|
2
|
-
import { U as Unhead, s as SSRHeadPayload, v as ServerHeadHooks, e as CreateServerHeadOptions } from './unhead.
|
|
2
|
+
import { U as Unhead, s as SSRHeadPayload, v as ServerHeadHooks, e as CreateServerHeadOptions } from './unhead.BNptCUyv.mjs';
|
|
3
3
|
import { aw as ResolvableHead } from './unhead.Bz11580x.mjs';
|
|
4
4
|
|
|
5
5
|
interface ServerUnhead<T = ResolvableHead> extends Unhead<T, SSRHeadPayload> {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HookableCore } from 'hookable';
|
|
2
|
-
import { U as Unhead, C as ClientHeadHooks, c as CreateClientHeadOptions } from './unhead.
|
|
2
|
+
import { U as Unhead, C as ClientHeadHooks, c as CreateClientHeadOptions } from './unhead.CnNMu1HU.js';
|
|
3
3
|
import { aw as ResolvableHead } from './unhead.Bz11580x.js';
|
|
4
4
|
|
|
5
5
|
interface ClientUnhead<T = ResolvableHead> extends Unhead<T, boolean> {
|
package/dist/stream/client.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { C as ClientUnhead } from '../shared/unhead.
|
|
1
|
+
import { C as ClientUnhead } from '../shared/unhead.DjnbVGfW.mjs';
|
|
2
2
|
import { aP as SerializableHead, aw as ResolvableHead } from '../shared/unhead.Bz11580x.mjs';
|
|
3
|
-
import { U as Unhead, c as CreateClientHeadOptions } from '../shared/unhead.
|
|
3
|
+
import { U as Unhead, c as CreateClientHeadOptions } from '../shared/unhead.BNptCUyv.mjs';
|
|
4
4
|
import 'hookable';
|
|
5
5
|
|
|
6
6
|
/**
|
package/dist/stream/client.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { C as ClientUnhead } from '../shared/unhead.
|
|
1
|
+
import { C as ClientUnhead } from '../shared/unhead.jqONLOUN.js';
|
|
2
2
|
import { aP as SerializableHead, aw as ResolvableHead } from '../shared/unhead.Bz11580x.js';
|
|
3
|
-
import { U as Unhead, c as CreateClientHeadOptions } from '../shared/unhead.
|
|
3
|
+
import { U as Unhead, c as CreateClientHeadOptions } from '../shared/unhead.CnNMu1HU.js';
|
|
4
4
|
import 'hookable';
|
|
5
5
|
|
|
6
6
|
/**
|
package/dist/stream/server.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { S as ServerUnhead } from '../shared/unhead.
|
|
2
|
-
import { f as CreateStreamableServerHeadOptions, U as Unhead, s as SSRHeadPayload } from '../shared/unhead.
|
|
1
|
+
import { S as ServerUnhead } from '../shared/unhead.ekDpYRjs.mjs';
|
|
2
|
+
import { f as CreateStreamableServerHeadOptions, U as Unhead, s as SSRHeadPayload } from '../shared/unhead.BNptCUyv.mjs';
|
|
3
3
|
import { aw as ResolvableHead } from '../shared/unhead.Bz11580x.mjs';
|
|
4
4
|
import 'hookable';
|
|
5
5
|
|
package/dist/stream/server.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { S as ServerUnhead } from '../shared/unhead.
|
|
2
|
-
import { f as CreateStreamableServerHeadOptions, U as Unhead, s as SSRHeadPayload } from '../shared/unhead.
|
|
1
|
+
import { S as ServerUnhead } from '../shared/unhead.CKu1VBXp.js';
|
|
2
|
+
import { f as CreateStreamableServerHeadOptions, U as Unhead, s as SSRHeadPayload } from '../shared/unhead.CnNMu1HU.js';
|
|
3
3
|
import { aw as ResolvableHead } from '../shared/unhead.Bz11580x.js';
|
|
4
4
|
import 'hookable';
|
|
5
5
|
|
package/dist/stream/server.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { parseHtmlForIndexes, applyHeadToHtml } from '../parser.mjs';
|
|
2
|
-
import { a as createHead } from '../shared/unhead.
|
|
2
|
+
import { a as createHead } from '../shared/unhead.B3gLwi_2.mjs';
|
|
3
3
|
import { DEFAULT_STREAM_KEY } from './client.mjs';
|
|
4
4
|
import '../shared/unhead.CfgPMHXt.mjs';
|
|
5
5
|
import '../shared/unhead.mB5lMBMV.mjs';
|
package/dist/types.d.mts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export { A as ActiveHeadEntry, a as AsVoidFunctions, C as ClientHeadHooks, b as CoreHeadHooks, c as CreateClientHeadOptions, d as CreateHeadOptions, e as CreateServerHeadOptions, f as CreateStreamableServerHeadOptions, D as DOMHeadHooks, g as DomBeforeRenderCtx, h as DomRenderTagContext, i as DomState, E as EntryResolveCtx, j as EventHandlerOptions, H as HeadEntry, k as HeadEntryOptions, l as HeadHooks, m as HeadPlugin, n as HeadPluginInput, o as HeadPluginOptions, p as HeadRenderer, q as HookResult, P as PropResolver, R as RecordingEntry, r as RenderSSRHeadOptions, S as SSRHeadHooks, s as SSRHeadPayload, t as SSRRenderContext, u as ScriptInstance, v as ServerHeadHooks, w as ShouldRenderContext, x as SideEffectsRecord, y as SyncHookResult, U as Unhead, 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.
|
|
1
|
+
export { A as ActiveHeadEntry, a as AsVoidFunctions, C as ClientHeadHooks, b as CoreHeadHooks, c as CreateClientHeadOptions, d as CreateHeadOptions, e as CreateServerHeadOptions, f as CreateStreamableServerHeadOptions, D as DOMHeadHooks, g as DomBeforeRenderCtx, h as DomRenderTagContext, i as DomState, E as EntryResolveCtx, j as EventHandlerOptions, H as HeadEntry, k as HeadEntryOptions, l as HeadHooks, m as HeadPlugin, n as HeadPluginInput, o as HeadPluginOptions, p as HeadRenderer, q as HookResult, P as PropResolver, R as RecordingEntry, r as RenderSSRHeadOptions, S as SSRHeadHooks, s as SSRHeadPayload, t as SSRRenderContext, u as ScriptInstance, v as ServerHeadHooks, w as ShouldRenderContext, x as SideEffectsRecord, y as SyncHookResult, U as Unhead, 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';
|
|
2
2
|
export { R as RenderDomHeadOptions } from './shared/unhead.Brajh4vg.mjs';
|
|
3
3
|
export { B as Base, a as BodyAttributes, H as HeadSafe, b as HtmlAttributes, N as Noscript, S as SafeBodyAttr, c as SafeHtmlAttr, d as SafeLink, e as SafeMeta, f as SafeNoscript, g as SafeScript, h as SafeStyle, i as Style } from './shared/unhead.CG80LYNi.mjs';
|
|
4
4
|
import { m as Booleanable } from './shared/unhead.Bz11580x.mjs';
|
|
5
5
|
export { A as AlternateFeedLink, a as AlternateLanguageLink, b as AlternateLink, c as AlternateMediaLink, d as AlternateStylesheetLink, e as AmpHtmlLink, f as AppleTouchIconLink, g as AppleTouchStartupImageLink, h as ApplicationJsonScript, i as Arrayable, j as AuthorLink, B as BareAlternateLink, k as BodyAttributesWithoutEvents, l as BodyEvents, C as CanonicalLink, n as CharsetMeta, o as CompressionDictionaryLink, D as DataKeys, p as DeepReadonly, q as DeepResolvableProperties, r as DnsPrefetchLink, E as ExpectLink, s as ExternalScript, F as FaviconLink, G as GenericLink, t as GenericScript, u as GlobalAttributes, H as HasTemplateParams, v as HeadTag, w as HeadTagKeys, x as HelpLink, y as HttpEquivMeta, z as HttpEventAttributes, I as HubLink, J as IconLink, K as ImportMapConfig, L as ImportMapScript, M as InferLink, N as InferScript, O as InlineModuleScript, P as InlineScript, Q as InnerContent, R as InnerContentVal, S as InternalTagKey, T as JsonLdScript, U as KnownLinkRel, V as KnownScriptType, W as LicenseLink, X as Link, Y as LinkBase, Z as LinkHttpEvents, _ as ManifestLink, $ as MaskIconLink, a0 as MaybeArray, a1 as MaybeEventFnHandlers, a2 as MeLink, a3 as Meta, a4 as MetaBase, a5 as MetaFlat, a6 as MetaGeneric, a7 as MetaNames, a8 as MetaProperties, a9 as ModuleScript, aa as ModulepreloadLink, ab as NameMeta, ac as Never, ad as NextLink, ae as PingbackLink, af as PreconnectLink, ag as PrefetchLink, ah as PreloadFontLink, ai as PreloadImageLink, aj as PreloadLink, ak as PreloadLinkBase, al as PreloadOtherLink, am as PreloadScriptLink, an as PreloadStyleLink, ao as PrerenderLink, ap as PrevLink, aq as PrivacyPolicyLink, ar as ProcessesTemplateParams, as as PropertyMeta, at as RawInput, au as ResolvableBase, av as ResolvableBodyAttributes, aw as ResolvableHead, ax as ResolvableHtmlAttributes, ay as ResolvableLink, az as ResolvableMeta, aA as ResolvableNoscript, aB as ResolvableProperties, aC as ResolvableScript, aD as ResolvableStyle, aE as ResolvableTemplateParams, aF as ResolvableTitle, aG as ResolvableTitleTemplate, aH as ResolvableUnion, aI as ResolvableValue, aJ as ResolvesDuplicates, aK as SchemaAugmentations, aL as Script, aM as ScriptBase, aN as ScriptHttpEvents, aO as SearchLink, aP as SerializableHead, aQ as SitemapLink, aR as SpeculationRules, aS as SpeculationRulesScript, aT as StringInnerContent, aU as Stringable, aV as StylesheetLink, aW as TagKey, aX as TagPosition, aY as TagPriority, aZ as TagUserProperties, a_ as TemplateParams, a$ as TemplateParamsAugmentations, b0 as TermsOfServiceLink, b1 as UnheadBodyAttributesWithoutEvents, b2 as UnheadHtmlAttributes, b3 as UnheadMeta, b4 as UseHeadInput, b5 as UseSeoMetaInput, b6 as ValidTagPositions, b7 as WebmentionLink } from './shared/unhead.Bz11580x.mjs';
|
|
6
6
|
export { createSpyProxy } from './scripts.mjs';
|
|
7
|
-
export { u as useScript } from './shared/unhead.
|
|
7
|
+
export { u as useScript } from './shared/unhead.BnlR_jz2.mjs';
|
|
8
8
|
import 'hookable';
|
|
9
9
|
|
|
10
10
|
interface AriaAttributes {
|
package/dist/types.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export { A as ActiveHeadEntry, a as AsVoidFunctions, C as ClientHeadHooks, b as CoreHeadHooks, c as CreateClientHeadOptions, d as CreateHeadOptions, e as CreateServerHeadOptions, f as CreateStreamableServerHeadOptions, D as DOMHeadHooks, g as DomBeforeRenderCtx, h as DomRenderTagContext, i as DomState, E as EntryResolveCtx, j as EventHandlerOptions, H as HeadEntry, k as HeadEntryOptions, l as HeadHooks, m as HeadPlugin, n as HeadPluginInput, o as HeadPluginOptions, p as HeadRenderer, q as HookResult, P as PropResolver, R as RecordingEntry, r as RenderSSRHeadOptions, S as SSRHeadHooks, s as SSRHeadPayload, t as SSRRenderContext, u as ScriptInstance, v as ServerHeadHooks, w as ShouldRenderContext, x as SideEffectsRecord, y as SyncHookResult, U as Unhead, 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.
|
|
1
|
+
export { A as ActiveHeadEntry, a as AsVoidFunctions, C as ClientHeadHooks, b as CoreHeadHooks, c as CreateClientHeadOptions, d as CreateHeadOptions, e as CreateServerHeadOptions, f as CreateStreamableServerHeadOptions, D as DOMHeadHooks, g as DomBeforeRenderCtx, h as DomRenderTagContext, i as DomState, E as EntryResolveCtx, j as EventHandlerOptions, H as HeadEntry, k as HeadEntryOptions, l as HeadHooks, m as HeadPlugin, n as HeadPluginInput, o as HeadPluginOptions, p as HeadRenderer, q as HookResult, P as PropResolver, R as RecordingEntry, r as RenderSSRHeadOptions, S as SSRHeadHooks, s as SSRHeadPayload, t as SSRRenderContext, u as ScriptInstance, v as ServerHeadHooks, w as ShouldRenderContext, x as SideEffectsRecord, y as SyncHookResult, U as Unhead, 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';
|
|
2
2
|
export { R as RenderDomHeadOptions } from './shared/unhead.CJ5MDR84.js';
|
|
3
3
|
export { B as Base, a as BodyAttributes, H as HeadSafe, b as HtmlAttributes, N as Noscript, S as SafeBodyAttr, c as SafeHtmlAttr, d as SafeLink, e as SafeMeta, f as SafeNoscript, g as SafeScript, h as SafeStyle, i as Style } from './shared/unhead.f0Z4Ygga.js';
|
|
4
4
|
import { m as Booleanable } from './shared/unhead.Bz11580x.js';
|
|
5
5
|
export { A as AlternateFeedLink, a as AlternateLanguageLink, b as AlternateLink, c as AlternateMediaLink, d as AlternateStylesheetLink, e as AmpHtmlLink, f as AppleTouchIconLink, g as AppleTouchStartupImageLink, h as ApplicationJsonScript, i as Arrayable, j as AuthorLink, B as BareAlternateLink, k as BodyAttributesWithoutEvents, l as BodyEvents, C as CanonicalLink, n as CharsetMeta, o as CompressionDictionaryLink, D as DataKeys, p as DeepReadonly, q as DeepResolvableProperties, r as DnsPrefetchLink, E as ExpectLink, s as ExternalScript, F as FaviconLink, G as GenericLink, t as GenericScript, u as GlobalAttributes, H as HasTemplateParams, v as HeadTag, w as HeadTagKeys, x as HelpLink, y as HttpEquivMeta, z as HttpEventAttributes, I as HubLink, J as IconLink, K as ImportMapConfig, L as ImportMapScript, M as InferLink, N as InferScript, O as InlineModuleScript, P as InlineScript, Q as InnerContent, R as InnerContentVal, S as InternalTagKey, T as JsonLdScript, U as KnownLinkRel, V as KnownScriptType, W as LicenseLink, X as Link, Y as LinkBase, Z as LinkHttpEvents, _ as ManifestLink, $ as MaskIconLink, a0 as MaybeArray, a1 as MaybeEventFnHandlers, a2 as MeLink, a3 as Meta, a4 as MetaBase, a5 as MetaFlat, a6 as MetaGeneric, a7 as MetaNames, a8 as MetaProperties, a9 as ModuleScript, aa as ModulepreloadLink, ab as NameMeta, ac as Never, ad as NextLink, ae as PingbackLink, af as PreconnectLink, ag as PrefetchLink, ah as PreloadFontLink, ai as PreloadImageLink, aj as PreloadLink, ak as PreloadLinkBase, al as PreloadOtherLink, am as PreloadScriptLink, an as PreloadStyleLink, ao as PrerenderLink, ap as PrevLink, aq as PrivacyPolicyLink, ar as ProcessesTemplateParams, as as PropertyMeta, at as RawInput, au as ResolvableBase, av as ResolvableBodyAttributes, aw as ResolvableHead, ax as ResolvableHtmlAttributes, ay as ResolvableLink, az as ResolvableMeta, aA as ResolvableNoscript, aB as ResolvableProperties, aC as ResolvableScript, aD as ResolvableStyle, aE as ResolvableTemplateParams, aF as ResolvableTitle, aG as ResolvableTitleTemplate, aH as ResolvableUnion, aI as ResolvableValue, aJ as ResolvesDuplicates, aK as SchemaAugmentations, aL as Script, aM as ScriptBase, aN as ScriptHttpEvents, aO as SearchLink, aP as SerializableHead, aQ as SitemapLink, aR as SpeculationRules, aS as SpeculationRulesScript, aT as StringInnerContent, aU as Stringable, aV as StylesheetLink, aW as TagKey, aX as TagPosition, aY as TagPriority, aZ as TagUserProperties, a_ as TemplateParams, a$ as TemplateParamsAugmentations, b0 as TermsOfServiceLink, b1 as UnheadBodyAttributesWithoutEvents, b2 as UnheadHtmlAttributes, b3 as UnheadMeta, b4 as UseHeadInput, b5 as UseSeoMetaInput, b6 as ValidTagPositions, b7 as WebmentionLink } from './shared/unhead.Bz11580x.js';
|
|
6
6
|
export { createSpyProxy } from './scripts.js';
|
|
7
|
-
export { u as useScript } from './shared/unhead.
|
|
7
|
+
export { u as useScript } from './shared/unhead.Dc4-12pQ.js';
|
|
8
8
|
import 'hookable';
|
|
9
9
|
|
|
10
10
|
interface AriaAttributes {
|
package/dist/utils.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { v as HeadTag, a5 as MetaFlat, aw as ResolvableHead, a_ as TemplateParams } from './shared/unhead.Bz11580x.mjs';
|
|
2
|
-
import { P as PropResolver, U as Unhead } from './shared/unhead.
|
|
2
|
+
import { P as PropResolver, U as Unhead } from './shared/unhead.BNptCUyv.mjs';
|
|
3
3
|
import 'hookable';
|
|
4
4
|
|
|
5
5
|
declare const SelfClosingTags: Set<string>;
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { v as HeadTag, a5 as MetaFlat, aw as ResolvableHead, a_ as TemplateParams } from './shared/unhead.Bz11580x.js';
|
|
2
|
-
import { P as PropResolver, U as Unhead } from './shared/unhead.
|
|
2
|
+
import { P as PropResolver, U as Unhead } from './shared/unhead.CnNMu1HU.js';
|
|
3
3
|
import 'hookable';
|
|
4
4
|
|
|
5
5
|
declare const SelfClosingTags: Set<string>;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "unhead",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "3.1.
|
|
4
|
+
"version": "3.1.3",
|
|
5
5
|
"description": "Full-stack <head> manager built for any framework.",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Harlan Wilton",
|
|
@@ -182,8 +182,8 @@
|
|
|
182
182
|
},
|
|
183
183
|
"devDependencies": {
|
|
184
184
|
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
185
|
-
"rollup": "^4.
|
|
186
|
-
"vite": "^8.0.
|
|
185
|
+
"rollup": "^4.61.0",
|
|
186
|
+
"vite": "^8.0.16"
|
|
187
187
|
},
|
|
188
188
|
"scripts": {
|
|
189
189
|
"build": "unbuild",
|