unhead 3.0.5 → 3.1.1
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 +6 -33
- package/dist/plugins.d.ts +6 -33
- package/dist/plugins.mjs +35 -199
- 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.-D8hRpkn.d.ts → unhead.B92-AP20.d.ts} +2 -2
- package/dist/shared/{unhead.gui9LmZS.d.ts → unhead.BWNOp3cv.d.ts} +1 -1
- package/dist/shared/{unhead.Cv5yrrUd.d.mts → unhead.BjPIONVY.d.mts} +2 -2
- package/dist/shared/{unhead.pv34ME7O.mjs → unhead.BjuLn3hu.mjs} +2 -2
- package/dist/shared/{unhead.BoZ-Ul8T.d.mts → unhead.BodZ6XwK.d.mts} +1 -1
- package/dist/shared/{unhead.B7bBMqva.d.mts → unhead.Brajh4vg.d.mts} +1 -1
- package/dist/shared/{unhead.C5ypJnIO.mjs → unhead.Bu5O0NaA.mjs} +3 -3
- 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.CqVawd25.d.ts → unhead.CHwJVuR_.d.ts} +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.ClE7lB2Z.d.mts → unhead.CuuHFiTB.d.mts} +1 -1
- package/dist/shared/{unhead.Dc5Pn4qI.d.mts → unhead.CwE6ye0n.d.mts} +2 -2
- package/dist/shared/{unhead.B2jfOxG1.d.mts → unhead.CwvlUXnx.d.mts} +2 -2
- package/dist/shared/{unhead.DdarjSpi.d.ts → unhead.DbMowiUH.d.ts} +2 -2
- package/dist/shared/unhead.DsqXiUvy.d.mts +38 -0
- package/dist/shared/unhead.DsqXiUvy.d.ts +38 -0
- package/dist/shared/{unhead.BRwJvCZb.d.ts → unhead.DwiUIw06.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.ebqUBTt1.mjs +513 -0
- package/dist/shared/{unhead.q49lHHFN.d.ts → unhead.f0Z4Ygga.d.ts} +1 -1
- package/dist/shared/{unhead.DvIxXxuO.mjs → unhead.mB5lMBMV.mjs} +1 -1
- package/dist/stream/client.d.mts +24 -5
- package/dist/stream/client.d.ts +24 -5
- 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 +9 -6
- package/dist/stream/server.d.ts +9 -6
- package/dist/stream/server.mjs +18 -7
- package/dist/stream/unplugin.d.mts +81 -0
- package/dist/stream/unplugin.d.ts +81 -0
- package/dist/stream/unplugin.mjs +166 -0
- package/dist/stream/vite.d.mts +19 -27
- package/dist/stream/vite.d.ts +19 -27
- package/dist/stream/vite.mjs +6 -78
- 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 +236 -0
- package/dist/validate.d.ts +236 -0
- package/dist/validate.mjs +49 -0
- package/package.json +19 -4
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HookableCore } from 'hookable';
|
|
2
|
-
import { U as Unhead, C as ClientHeadHooks, c as CreateClientHeadOptions } from './unhead.
|
|
3
|
-
import { aw as ResolvableHead } from './unhead.
|
|
2
|
+
import { U as Unhead, C as ClientHeadHooks, c as CreateClientHeadOptions } from './unhead.BWNOp3cv.js';
|
|
3
|
+
import { aw as ResolvableHead } from './unhead.Bz11580x.js';
|
|
4
4
|
|
|
5
5
|
interface ClientUnhead<T = ResolvableHead> extends Unhead<T, boolean> {
|
|
6
6
|
hooks: HookableCore<ClientHeadHooks>;
|
|
@@ -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.js';
|
|
3
3
|
|
|
4
4
|
type UseScriptStatus = 'awaitingLoad' | 'loading' | 'loaded' | 'error' | 'removed';
|
|
5
5
|
type UseScriptContext<T extends Record<symbol | string, any>> = ScriptInstance<T>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HookableCore } from 'hookable';
|
|
2
|
-
import { U as Unhead, C as ClientHeadHooks, c as CreateClientHeadOptions } from './unhead.
|
|
3
|
-
import { aw as ResolvableHead } from './unhead.
|
|
2
|
+
import { U as Unhead, C as ClientHeadHooks, c as CreateClientHeadOptions } from './unhead.BodZ6XwK.mjs';
|
|
3
|
+
import { aw as ResolvableHead } from './unhead.Bz11580x.mjs';
|
|
4
4
|
|
|
5
5
|
interface ClientUnhead<T = ResolvableHead> extends Unhead<T, boolean> {
|
|
6
6
|
hooks: HookableCore<ClientHeadHooks>;
|
|
@@ -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,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>;
|
|
@@ -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 };
|
|
@@ -201,4 +201,4 @@ function createHead(options = {}) {
|
|
|
201
201
|
return head;
|
|
202
202
|
}
|
|
203
203
|
|
|
204
|
-
export {
|
|
204
|
+
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 };
|
|
@@ -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 };
|
|
@@ -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 };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { at as RawInput, aw as ResolvableHead, aI as ResolvableValue, aB as ResolvableProperties, G as GenericLink, D as DataKeys, aK as SchemaAugmentations, a6 as MetaGeneric, t as GenericScript, b2 as UnheadHtmlAttributes, b1 as UnheadBodyAttributesWithoutEvents } from './unhead.
|
|
1
|
+
import { at as RawInput, aw as ResolvableHead, aI as ResolvableValue, aB as ResolvableProperties, G as GenericLink, D as DataKeys, aK as SchemaAugmentations, a6 as MetaGeneric, t as GenericScript, b2 as UnheadHtmlAttributes, b1 as UnheadBodyAttributesWithoutEvents } from './unhead.Bz11580x.mjs';
|
|
2
2
|
|
|
3
3
|
type Base = RawInput<'base'>;
|
|
4
4
|
type HtmlAttributes = RawInput<'htmlAttrs'>;
|
|
@@ -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.BWNOp3cv.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Load third-party scripts with SSR support and a proxied API.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { c as createUnhead, r as registerPlugin } from './unhead.CfgPMHXt.mjs';
|
|
2
|
-
import {
|
|
3
|
-
import { c as createDomRenderer } from './unhead.
|
|
2
|
+
import { a as createHooks } from './unhead.mB5lMBMV.mjs';
|
|
3
|
+
import { c as createDomRenderer } from './unhead.BjuLn3hu.mjs';
|
|
4
4
|
|
|
5
5
|
const P = { critical: -8, high: -1, low: 2 };
|
|
6
6
|
const tagWeight = (tag) => typeof tag.tagPriority === "number" ? tag.tagPriority : 100 + (P[tag.tagPriority] || 0);
|
|
@@ -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.BodZ6XwK.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.BodZ6XwK.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
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HookableCore } from 'hookable';
|
|
2
|
-
import { U as Unhead, s as SSRHeadPayload, v as ServerHeadHooks, e as CreateServerHeadOptions } from './unhead.
|
|
3
|
-
import { aw as ResolvableHead } from './unhead.
|
|
2
|
+
import { U as Unhead, s as SSRHeadPayload, v as ServerHeadHooks, e as CreateServerHeadOptions } from './unhead.BodZ6XwK.mjs';
|
|
3
|
+
import { aw as ResolvableHead } from './unhead.Bz11580x.mjs';
|
|
4
4
|
|
|
5
5
|
interface ServerUnhead<T = ResolvableHead> extends Unhead<T, SSRHeadPayload> {
|
|
6
6
|
hooks: HookableCore<ServerHeadHooks>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HookableCore } from 'hookable';
|
|
2
|
-
import { U as Unhead, s as SSRHeadPayload, v as ServerHeadHooks, e as CreateServerHeadOptions } from './unhead.
|
|
3
|
-
import { aw as ResolvableHead } from './unhead.
|
|
2
|
+
import { U as Unhead, s as SSRHeadPayload, v as ServerHeadHooks, e as CreateServerHeadOptions } from './unhead.BWNOp3cv.js';
|
|
3
|
+
import { aw as ResolvableHead } from './unhead.Bz11580x.js';
|
|
4
4
|
|
|
5
5
|
interface ServerUnhead<T = ResolvableHead> extends Unhead<T, SSRHeadPayload> {
|
|
6
6
|
hooks: HookableCore<ServerHeadHooks>;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
type RuleSeverity = 'warn' | 'info' | 'off';
|
|
2
|
+
/**
|
|
3
|
+
* Canonical list of every validation rule ID. Mirrored by the `ValidationRuleId`
|
|
4
|
+
* union below; both are kept in sync by hand. Consumers (devtools UI, eslint
|
|
5
|
+
* plugin docs) can iterate this array to enumerate all rules at runtime.
|
|
6
|
+
*/
|
|
7
|
+
declare const VALIDATION_RULE_IDS: readonly ["canonical-og-url-mismatch", "charset-not-early", "defer-on-module-script", "deprecated-option-mode", "deprecated-prop-body", "deprecated-prop-children", "deprecated-prop-hid-vmid", "duplicate-resource-hint", "empty-meta-content", "empty-title", "html-in-title", "inline-script-size", "inline-style-size", "meta-beyond-1mb", "missing-alias-sorting-plugin", "missing-description", "missing-template-params-plugin", "missing-title", "non-absolute-canonical", "non-absolute-og-url", "numeric-tag-priority", "og-image-missing-dimensions", "og-missing-description", "og-missing-title", "possible-typo", "preconnect-missing-crossorigin", "prefer-define-helpers", "prefetch-preload-conflict", "preload-async-defer-conflict", "preload-fetchpriority-conflict", "preload-font-crossorigin", "preload-missing-as", "preload-not-modulepreload", "redundant-dns-prefetch", "render-blocking-script", "robots-conflict", "script-src-with-content", "too-many-fetchpriority-high", "too-many-preconnects", "too-many-preloads", "twitter-handle-missing-at", "unresolved-template-param", "viewport-user-scalable"];
|
|
8
|
+
type ValidationRuleId = typeof VALIDATION_RULE_IDS[number];
|
|
9
|
+
interface ValidationRuleOptions {
|
|
10
|
+
'charset-not-early': {
|
|
11
|
+
maxPosition: number;
|
|
12
|
+
};
|
|
13
|
+
'inline-script-size': {
|
|
14
|
+
maxKB: number;
|
|
15
|
+
};
|
|
16
|
+
'inline-style-size': {
|
|
17
|
+
maxKB: number;
|
|
18
|
+
};
|
|
19
|
+
'meta-beyond-1mb': {
|
|
20
|
+
maxBytes: number;
|
|
21
|
+
};
|
|
22
|
+
'too-many-fetchpriority-high': {
|
|
23
|
+
max: number;
|
|
24
|
+
};
|
|
25
|
+
'too-many-preloads': {
|
|
26
|
+
max: number;
|
|
27
|
+
};
|
|
28
|
+
'too-many-preconnects': {
|
|
29
|
+
max: number;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
type RuleConfig<Id extends ValidationRuleId> = Id extends keyof ValidationRuleOptions ? RuleSeverity | [severity: RuleSeverity, options: ValidationRuleOptions[Id]] : RuleSeverity;
|
|
33
|
+
type RulesConfig = {
|
|
34
|
+
[K in ValidationRuleId]?: RuleConfig<K>;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export { VALIDATION_RULE_IDS as V };
|
|
38
|
+
export type { RuleConfig as R, RuleSeverity as a, RulesConfig as b, ValidationRuleId as c, ValidationRuleOptions as d };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
type RuleSeverity = 'warn' | 'info' | 'off';
|
|
2
|
+
/**
|
|
3
|
+
* Canonical list of every validation rule ID. Mirrored by the `ValidationRuleId`
|
|
4
|
+
* union below; both are kept in sync by hand. Consumers (devtools UI, eslint
|
|
5
|
+
* plugin docs) can iterate this array to enumerate all rules at runtime.
|
|
6
|
+
*/
|
|
7
|
+
declare const VALIDATION_RULE_IDS: readonly ["canonical-og-url-mismatch", "charset-not-early", "defer-on-module-script", "deprecated-option-mode", "deprecated-prop-body", "deprecated-prop-children", "deprecated-prop-hid-vmid", "duplicate-resource-hint", "empty-meta-content", "empty-title", "html-in-title", "inline-script-size", "inline-style-size", "meta-beyond-1mb", "missing-alias-sorting-plugin", "missing-description", "missing-template-params-plugin", "missing-title", "non-absolute-canonical", "non-absolute-og-url", "numeric-tag-priority", "og-image-missing-dimensions", "og-missing-description", "og-missing-title", "possible-typo", "preconnect-missing-crossorigin", "prefer-define-helpers", "prefetch-preload-conflict", "preload-async-defer-conflict", "preload-fetchpriority-conflict", "preload-font-crossorigin", "preload-missing-as", "preload-not-modulepreload", "redundant-dns-prefetch", "render-blocking-script", "robots-conflict", "script-src-with-content", "too-many-fetchpriority-high", "too-many-preconnects", "too-many-preloads", "twitter-handle-missing-at", "unresolved-template-param", "viewport-user-scalable"];
|
|
8
|
+
type ValidationRuleId = typeof VALIDATION_RULE_IDS[number];
|
|
9
|
+
interface ValidationRuleOptions {
|
|
10
|
+
'charset-not-early': {
|
|
11
|
+
maxPosition: number;
|
|
12
|
+
};
|
|
13
|
+
'inline-script-size': {
|
|
14
|
+
maxKB: number;
|
|
15
|
+
};
|
|
16
|
+
'inline-style-size': {
|
|
17
|
+
maxKB: number;
|
|
18
|
+
};
|
|
19
|
+
'meta-beyond-1mb': {
|
|
20
|
+
maxBytes: number;
|
|
21
|
+
};
|
|
22
|
+
'too-many-fetchpriority-high': {
|
|
23
|
+
max: number;
|
|
24
|
+
};
|
|
25
|
+
'too-many-preloads': {
|
|
26
|
+
max: number;
|
|
27
|
+
};
|
|
28
|
+
'too-many-preconnects': {
|
|
29
|
+
max: number;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
type RuleConfig<Id extends ValidationRuleId> = Id extends keyof ValidationRuleOptions ? RuleSeverity | [severity: RuleSeverity, options: ValidationRuleOptions[Id]] : RuleSeverity;
|
|
33
|
+
type RulesConfig = {
|
|
34
|
+
[K in ValidationRuleId]?: RuleConfig<K>;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export { VALIDATION_RULE_IDS as V };
|
|
38
|
+
export type { RuleConfig as R, RuleSeverity as a, RulesConfig as b, ValidationRuleId as c, ValidationRuleOptions as d };
|
|
@@ -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.BWNOp3cv.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 { U as UniqueTags, c as TagsWithInnerContent, M as MetaTagsArrayable, H as HasElementTags, T as TagConfigKeys, D as DupeableTags, d as UsesMergeStrategy, V as ValidHeadTags } from './unhead.fg-0ge_u.mjs';
|
|
2
|
-
import {
|
|
2
|
+
import { c as callHook } from './unhead.mB5lMBMV.mjs';
|
|
3
3
|
|
|
4
4
|
const META_NOREWRITE_RE = /^(?:viewport|description|keywords|robots)$/;
|
|
5
5
|
function isMetaArrayDupeKey(v) {
|
|
@@ -12,9 +12,10 @@ function dedupeKey(tag) {
|
|
|
12
12
|
if (t === "link" && props.rel === "canonical")
|
|
13
13
|
return "canonical";
|
|
14
14
|
if (t === "link" && props.rel === "alternate") {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
if (props.hreflang)
|
|
16
|
+
return `alternate:${props.hreflang}`;
|
|
17
|
+
if (props.type)
|
|
18
|
+
return `alternate:${props.type}:${props.href || ""}`;
|
|
18
19
|
}
|
|
19
20
|
if (props.charset)
|
|
20
21
|
return "charset";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c as callHook } from './unhead.mB5lMBMV.mjs';
|
|
2
2
|
import { S as ScriptNetworkEvents } from './unhead.fg-0ge_u.mjs';
|
|
3
3
|
|
|
4
4
|
function createNoopedRecordingProxy(instance = {}) {
|
|
@@ -231,7 +231,7 @@ function useScript(head, _input, _options) {
|
|
|
231
231
|
const idx = script._triggerPromises.push(Promise.race([
|
|
232
232
|
trigger.then((v) => typeof v === "undefined" || v ? script.load : void 0),
|
|
233
233
|
abortPromise
|
|
234
|
-
]).catch(() => {
|
|
234
|
+
]).catch((error) => {
|
|
235
235
|
}).then((res) => {
|
|
236
236
|
res?.();
|
|
237
237
|
}).finally(() => {
|