@takazudo/zfb 4.4.0 → 4.5.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/README.md +14 -0
- package/dist/css.d.ts +45 -0
- package/dist/css.js +137 -0
- package/dist/css.js.map +1 -0
- package/dist/zudo-react/dom-bindings.js +11 -5
- package/dist/zudo-react/dom-bindings.js.map +1 -1
- package/dist/zudo-react/error-boundary-client.d.ts +3 -0
- package/dist/zudo-react/error-boundary-client.js +232 -0
- package/dist/zudo-react/error-boundary-client.js.map +1 -0
- package/dist/zudo-react/error-boundary-type.d.ts +8 -0
- package/dist/zudo-react/error-boundary-type.js +25 -0
- package/dist/zudo-react/error-boundary-type.js.map +1 -0
- package/dist/zudo-react/error-boundary.d.ts +8 -0
- package/dist/zudo-react/error-boundary.js +13 -0
- package/dist/zudo-react/error-boundary.js.map +1 -0
- package/dist/zudo-react/form-recovery.d.ts +2 -0
- package/dist/zudo-react/form-recovery.js +116 -0
- package/dist/zudo-react/form-recovery.js.map +1 -0
- package/dist/zudo-react/forms.d.ts +38 -4
- package/dist/zudo-react/forms.js +143 -172
- package/dist/zudo-react/forms.js.map +1 -1
- package/dist/zudo-react/hydrate.d.ts +68 -0
- package/dist/zudo-react/hydrate.js +177 -89
- package/dist/zudo-react/hydrate.js.map +1 -1
- package/dist/zudo-react/index.d.ts +1 -0
- package/dist/zudo-react/index.js +1 -0
- package/dist/zudo-react/index.js.map +1 -1
- package/dist/zudo-react/render-html.js +55 -10
- package/dist/zudo-react/render-html.js.map +1 -1
- package/dist/zudo-react/scope.d.ts +21 -13
- package/dist/zudo-react/scope.js +141 -113
- package/dist/zudo-react/scope.js.map +1 -1
- package/dist/zudo-react/style.d.ts +0 -1
- package/dist/zudo-react/style.js +11 -503
- package/dist/zudo-react/style.js.map +1 -1
- package/dist/zudo-react/vocabulary.js +12 -49
- package/dist/zudo-react/vocabulary.js.map +1 -1
- package/package.json +11 -7
|
@@ -25,11 +25,7 @@ export function attributeError(name, value, custom) {
|
|
|
25
25
|
return undefined; // style has its own object validator.
|
|
26
26
|
if (booleanAttrs.has(name))
|
|
27
27
|
return typeof value === "boolean" ? undefined : "requires a boolean";
|
|
28
|
-
if (overloadedBooleanAttrs.has(name))
|
|
29
|
-
return typeof value === "string" || typeof value === "boolean"
|
|
30
|
-
? undefined
|
|
31
|
-
: "requires a string or boolean";
|
|
32
|
-
if (enumeratedBooleanAttrs.has(name))
|
|
28
|
+
if (overloadedBooleanAttrs.has(name) || enumeratedBooleanAttrs.has(name))
|
|
33
29
|
return typeof value === "string" || typeof value === "boolean"
|
|
34
30
|
? undefined
|
|
35
31
|
: "requires a string or boolean";
|
|
@@ -37,9 +33,7 @@ export function attributeError(name, value, custom) {
|
|
|
37
33
|
return typeof value === "string" || (typeof value === "number" && Number.isFinite(value))
|
|
38
34
|
? undefined
|
|
39
35
|
: "requires a string or finite number";
|
|
40
|
-
if (stringAttrs.has(name))
|
|
41
|
-
return typeof value === "string" ? undefined : "requires a string";
|
|
42
|
-
if (/^on[a-z]/.test(name))
|
|
36
|
+
if (stringAttrs.has(name) || /^on[a-z]/.test(name))
|
|
43
37
|
return typeof value === "string" ? undefined : "requires a string";
|
|
44
38
|
if (typeof value === "string" ||
|
|
45
39
|
(typeof value === "number" && Number.isFinite(value)) ||
|
|
@@ -65,43 +59,15 @@ export function attributeNamespace(name) {
|
|
|
65
59
|
return "http://www.w3.org/2000/xmlns/";
|
|
66
60
|
return null;
|
|
67
61
|
}
|
|
68
|
-
const propAliases =
|
|
69
|
-
className
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
maxLength: { spelling: "maxlength" },
|
|
78
|
-
minLength: { spelling: "minlength" },
|
|
79
|
-
crossOrigin: { spelling: "crossorigin" },
|
|
80
|
-
srcSet: { spelling: "srcset" },
|
|
81
|
-
acceptCharset: { spelling: "accept-charset" },
|
|
82
|
-
httpEquiv: { spelling: "http-equiv" },
|
|
83
|
-
encType: { spelling: "enctype" },
|
|
84
|
-
noValidate: { spelling: "novalidate" },
|
|
85
|
-
formNoValidate: { spelling: "formnovalidate" },
|
|
86
|
-
colSpan: { spelling: "colspan" },
|
|
87
|
-
rowSpan: { spelling: "rowspan" },
|
|
88
|
-
referrerPolicy: { spelling: "referrerpolicy" },
|
|
89
|
-
allowFullScreen: { spelling: "allowfullscreen" },
|
|
90
|
-
autoPlay: { spelling: "autoplay" },
|
|
91
|
-
contentEditable: { spelling: "contenteditable" },
|
|
92
|
-
spellCheck: { spelling: "spellcheck" },
|
|
93
|
-
accessKey: { spelling: "accesskey" },
|
|
94
|
-
dangerouslySetInnerHTML: { spelling: "rawHtml" },
|
|
95
|
-
strokeWidth: { spelling: "stroke-width", namespace: "svg" },
|
|
96
|
-
fillRule: { spelling: "fill-rule", namespace: "svg" },
|
|
97
|
-
clipRule: { spelling: "clip-rule", namespace: "svg" },
|
|
98
|
-
strokeLinecap: { spelling: "stroke-linecap", namespace: "svg" },
|
|
99
|
-
strokeLinejoin: { spelling: "stroke-linejoin", namespace: "svg" },
|
|
100
|
-
stopColor: { spelling: "stop-color", namespace: "svg" },
|
|
101
|
-
stopOpacity: { spelling: "stop-opacity", namespace: "svg" },
|
|
102
|
-
xlinkHref: { spelling: "xlink:href", namespace: "svg" },
|
|
103
|
-
xmlLang: { spelling: "xml:lang", namespace: "svg" },
|
|
104
|
-
};
|
|
62
|
+
const propAliases = Object.fromEntries([
|
|
63
|
+
"className=class htmlFor=for charSet dateTime tabIndex readOnly autoComplete autoFocus maxLength minLength crossOrigin srcSet acceptCharset=accept-charset httpEquiv=http-equiv encType noValidate formNoValidate colSpan rowSpan referrerPolicy allowFullScreen autoPlay contentEditable spellCheck accessKey dangerouslySetInnerHTML=rawHtml",
|
|
64
|
+
"stroke-width fill-rule clip-rule stroke-linecap stroke-linejoin stop-color stop-opacity xlink:href xml:lang",
|
|
65
|
+
].flatMap((entries, index) => entries.split(" ").map((entry) => {
|
|
66
|
+
const [name, spelling = entry.toLowerCase()] = index
|
|
67
|
+
? [entry.replace(/[-:]([a-z])/g, (_, letter) => letter.toUpperCase()), entry]
|
|
68
|
+
: entry.split("=");
|
|
69
|
+
return [name, { spelling, namespace: index ? "svg" : undefined }];
|
|
70
|
+
})));
|
|
105
71
|
const legacyDialect = words("className htmlFor charSet dateTime tabIndex readOnly strokeWidth dangerouslySetInnerHTML");
|
|
106
72
|
function allowedAliasTarget(spelling, namespace) {
|
|
107
73
|
if (spelling === "rawHtml")
|
|
@@ -118,10 +84,7 @@ export function isDialectProp(name, namespace, custom) {
|
|
|
118
84
|
return true;
|
|
119
85
|
if (custom)
|
|
120
86
|
return false;
|
|
121
|
-
|
|
122
|
-
return (alias !== undefined &&
|
|
123
|
-
(!alias.namespace || alias.namespace === namespace) &&
|
|
124
|
-
allowedAliasTarget(alias.spelling, namespace));
|
|
87
|
+
return dialectSuggestion(name, namespace, custom) !== undefined;
|
|
125
88
|
}
|
|
126
89
|
export function dialectSuggestion(name, namespace, custom) {
|
|
127
90
|
if (/^on[A-Z]/.test(name))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vocabulary.js","sourceRoot":"","sources":["../../src/zudo-react/vocabulary.ts"],"names":[],"mappings":"AAAA,MAAM,KAAK,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,IAAI,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;AAE3D,MAAM,CAAC,MAAM,QAAQ,GAAG,KAAK,CAC3B,sEAAsE,CACvE,CAAC;AACF,MAAM,CAAC,MAAM,YAAY,GAAG,KAAK,CAC/B,0LAA0L,CAC3L,CAAC;AACF,MAAM,CAAC,MAAM,sBAAsB,GAAG,KAAK,CAAC,sCAAsC,CAAC,CAAC;AACpF,MAAM,CAAC,MAAM,sBAAsB,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC;AACxD,MAAM,CAAC,MAAM,YAA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AM,UAAU,kBAAkB,CAAC,GAAW,EAAE,KAAwC;IACtF,OAAO,CACL,CAAC,GAAG,KAAK,UAAU;QACjB,CAAC,GAAG,KAAK,OAAO;YACd,CAAC,KAAK,CAAC,IAAI,KAAK,SAAS;gBACvB,CAAC,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAc,CAAC,CAAC,CAAC,CAAC;QAC7F,CAAC,KAAK,CAAC,QAAQ,KAAK,IAAI,IAAI,KAAK,CAAC,QAAQ,KAAK,IAAI,CAAC,CACrD,CAAC;AACJ,CAAC;AACD,MAAM,CAAC,MAAM,SAAS,GAAG,KAAK,CAAC,qDAAqD,CAAC,CAAC","sourcesContent":["const words = (value: string) => new Set(value.split(\" \"));\n\nexport const voidTags = words(\n \"area base br col embed hr img input link meta param source track wbr\",\n);\nexport const booleanAttrs = words(\n \"hidden inert readonly autofocus required disabled checked selected multiple open controls muted loop autoplay novalidate formnovalidate allowfullscreen reversed async defer playsinline\",\n);\nexport const enumeratedBooleanAttrs = words(\"spellcheck contenteditable draggable\");\nexport const overloadedBooleanAttrs = words(\"download\");\nexport const numericAttrs = words(\"start\");\nconst stringAttrs = words(\n \"property itemprop hreflang as integrity nonce popover popovertarget popovertargetaction srcdoc fetchpriority inputmode autocapitalize form label preload wrap closedby xmlns xmlns:xlink href focusable stroke-dasharray text-anchor\",\n);\nexport const commonAttrs = words(\n \"id class title lang dir slot role style hidden inert contenteditable draggable spellcheck tabindex accesskey translate onclick onload onerror\",\n);\nexport const htmlAttrs = words(\n \"href target rel download src alt width height type name value placeholder for charset datetime readonly autofocus required disabled checked selected multiple open controls muted loop autoplay novalidate formnovalidate maxlength minlength min max step pattern autocomplete accept accept-charset http-equiv content media method action enctype rows cols colspan rowspan scope cite poster loading decoding sizes srcset crossorigin referrerpolicy sandbox allow allowfullscreen start reversed property itemprop hreflang as integrity async defer nonce popover popovertarget popovertargetaction srcdoc fetchpriority inputmode autocapitalize form label preload playsinline wrap closedby\",\n);\nexport const svgAttrs = words(\n \"width height viewBox preserveAspectRatio gradientUnits gradientTransform markerWidth markerHeight refX refY xlink:href xml:lang xmlns xmlns:xlink href focusable stroke-width fill-rule clip-rule stroke-linecap stroke-linejoin stop-color stop-opacity fill-opacity stroke-dasharray text-anchor fill stroke d x y x1 x2 y1 y2 cx cy r rx ry points transform opacity offset\",\n);\nexport const svgTags = words(\n \"svg g path circle ellipse rect line polyline polygon text tspan defs symbol use clipPath mask linearGradient radialGradient stop title desc foreignObject pattern filter marker image\",\n);\nexport const htmlTags = words(\n \"html head body title base link meta style script div span p a br hr main header footer nav section article aside search hgroup menu h1 h2 h3 h4 h5 h6 ul ol li dl dt dd blockquote pre code strong em b i small mark time figure figcaption img picture source video audio track canvas form label input button textarea select option optgroup fieldset legend output progress meter datalist table caption thead tbody tfoot tr th td col colgroup details summary dialog template slot iframe noscript address abbr bdi bdo cite data del dfn ins kbd map area object param q rp rb rt ruby s samp sub sup u var wbr embed xmp noembed noframes plaintext\",\n);\nexport type Namespace = \"html\" | \"svg\";\n\n// An iframe is an owned element shell. Its fallback and foreign document are never owned children.\nexport function emptyIframeChildren(value: unknown): boolean {\n if (value == null || typeof value === \"boolean\" || value === \"\") return true;\n return Array.isArray(value) && value.every(emptyIframeChildren);\n}\n\nexport function attributeError(name: string, value: unknown, custom: boolean): string | undefined {\n if (value == null) return undefined;\n if (custom) return typeof value === \"string\" ? undefined : \"requires a string\";\n if (name === \"style\") return undefined; // style has its own object validator.\n if (booleanAttrs.has(name)) return typeof value === \"boolean\" ? undefined : \"requires a boolean\";\n if (overloadedBooleanAttrs.has(name))\n return typeof value === \"string\" || typeof value === \"boolean\"\n ? undefined\n : \"requires a string or boolean\";\n if (enumeratedBooleanAttrs.has(name))\n return typeof value === \"string\" || typeof value === \"boolean\"\n ? undefined\n : \"requires a string or boolean\";\n if (numericAttrs.has(name))\n return typeof value === \"string\" || (typeof value === \"number\" && Number.isFinite(value))\n ? undefined\n : \"requires a string or finite number\";\n if (stringAttrs.has(name)) return typeof value === \"string\" ? undefined : \"requires a string\";\n if (/^on[a-z]/.test(name)) return typeof value === \"string\" ? undefined : \"requires a string\";\n if (\n typeof value === \"string\" ||\n (typeof value === \"number\" && Number.isFinite(value)) ||\n (typeof value === \"boolean\" && /^(data-|aria-)/.test(name))\n )\n return undefined;\n return \"requires a string or finite number\";\n}\n\nexport function attributeText(name: string, value: unknown): string | null {\n if (\n value == null ||\n (booleanAttrs.has(name) && value === false) ||\n (overloadedBooleanAttrs.has(name) && value === false)\n )\n return null;\n if ((booleanAttrs.has(name) || overloadedBooleanAttrs.has(name)) && value === true) return \"\";\n return String(value);\n}\n\nexport function attributeNamespace(name: string): string | null {\n if (name === \"xlink:href\") return \"http://www.w3.org/1999/xlink\";\n if (name === \"xml:lang\") return \"http://www.w3.org/XML/1998/namespace\";\n if (name === \"xmlns\" || name === \"xmlns:xlink\") return \"http://www.w3.org/2000/xmlns/\";\n return null;\n}\n\ntype PropAlias = {\n readonly spelling: string;\n readonly namespace?: Namespace;\n};\n\nconst propAliases: Readonly<Record<string, PropAlias>> = {\n className: { spelling: \"class\" },\n htmlFor: { spelling: \"for\" },\n charSet: { spelling: \"charset\" },\n dateTime: { spelling: \"datetime\" },\n tabIndex: { spelling: \"tabindex\" },\n readOnly: { spelling: \"readonly\" },\n autoComplete: { spelling: \"autocomplete\" },\n autoFocus: { spelling: \"autofocus\" },\n maxLength: { spelling: \"maxlength\" },\n minLength: { spelling: \"minlength\" },\n crossOrigin: { spelling: \"crossorigin\" },\n srcSet: { spelling: \"srcset\" },\n acceptCharset: { spelling: \"accept-charset\" },\n httpEquiv: { spelling: \"http-equiv\" },\n encType: { spelling: \"enctype\" },\n noValidate: { spelling: \"novalidate\" },\n formNoValidate: { spelling: \"formnovalidate\" },\n colSpan: { spelling: \"colspan\" },\n rowSpan: { spelling: \"rowspan\" },\n referrerPolicy: { spelling: \"referrerpolicy\" },\n allowFullScreen: { spelling: \"allowfullscreen\" },\n autoPlay: { spelling: \"autoplay\" },\n contentEditable: { spelling: \"contenteditable\" },\n spellCheck: { spelling: \"spellcheck\" },\n accessKey: { spelling: \"accesskey\" },\n dangerouslySetInnerHTML: { spelling: \"rawHtml\" },\n strokeWidth: { spelling: \"stroke-width\", namespace: \"svg\" },\n fillRule: { spelling: \"fill-rule\", namespace: \"svg\" },\n clipRule: { spelling: \"clip-rule\", namespace: \"svg\" },\n strokeLinecap: { spelling: \"stroke-linecap\", namespace: \"svg\" },\n strokeLinejoin: { spelling: \"stroke-linejoin\", namespace: \"svg\" },\n stopColor: { spelling: \"stop-color\", namespace: \"svg\" },\n stopOpacity: { spelling: \"stop-opacity\", namespace: \"svg\" },\n xlinkHref: { spelling: \"xlink:href\", namespace: \"svg\" },\n xmlLang: { spelling: \"xml:lang\", namespace: \"svg\" },\n};\n\nconst legacyDialect = words(\n \"className htmlFor charSet dateTime tabIndex readOnly strokeWidth dangerouslySetInnerHTML\",\n);\n\nfunction allowedAliasTarget(spelling: string, namespace: Namespace): boolean {\n if (spelling === \"rawHtml\") return namespace === \"html\";\n return (\n commonAttrs.has(spelling) ||\n (namespace === \"svg\" ? svgAttrs.has(spelling) : htmlAttrs.has(spelling))\n );\n}\n\nfunction eventSuggestion(name: string): string {\n const event = name.slice(2);\n return `on:${event === \"DoubleClick\" ? \"dblclick\" : event.toLowerCase()}`;\n}\n\nexport function isDialectProp(name: string, namespace: Namespace, custom: boolean): boolean {\n if (/^on[A-Z]/.test(name) || legacyDialect.has(name)) return true;\n if (custom) return false;\n const alias = propAliases[name];\n return (\n alias !== undefined &&\n (!alias.namespace || alias.namespace === namespace) &&\n allowedAliasTarget(alias.spelling, namespace)\n );\n}\n\nexport function dialectSuggestion(\n name: string,\n namespace: Namespace,\n custom: boolean,\n): string | undefined {\n if (/^on[A-Z]/.test(name)) return eventSuggestion(name);\n if (custom && !legacyDialect.has(name)) return undefined;\n const alias = propAliases[name];\n if (!alias || (alias.namespace && alias.namespace !== namespace)) return undefined;\n return allowedAliasTarget(alias.spelling, namespace) ? alias.spelling : undefined;\n}\n\nexport function reactiveModelSuggestion(\n tag: string,\n name: string,\n inputType: string,\n custom: boolean,\n):\n | \"modelValue\"\n | \"modelChecked\"\n | \"modelValue (or a static readonly/disabled attribute for a display-only binding)\"\n | undefined {\n if (custom) return undefined;\n if (name === \"checked\" && tag === \"input\") {\n if (inputType === \"radio\") return \"modelValue\";\n if (inputType === \"checkbox\") return \"modelChecked\";\n }\n if (name === \"value\") {\n if (tag === \"textarea\")\n return \"modelValue (or a static readonly/disabled attribute for a display-only binding)\";\n if (tag === \"select\") return \"modelValue\";\n if (\n tag === \"input\" &&\n [\"text\", \"search\", \"email\", \"url\", \"tel\", \"password\"].includes(inputType)\n )\n return \"modelValue (or a static readonly/disabled attribute for a display-only binding)\";\n }\n return undefined;\n}\nexport function displayOnlyControl(tag: string, props: Readonly<Record<string, unknown>>): boolean {\n return (\n (tag === \"textarea\" ||\n (tag === \"input\" &&\n (props.type === undefined ||\n [\"text\", \"search\", \"email\", \"url\", \"tel\", \"password\"].includes(props.type as string)))) &&\n (props.readonly === true || props.disabled === true)\n );\n}\nexport const formProps = words(\"modelValue modelChecked defaultValue defaultChecked\");\n"]}
|
|
1
|
+
{"version":3,"file":"vocabulary.js","sourceRoot":"","sources":["../../src/zudo-react/vocabulary.ts"],"names":[],"mappings":"AAAA,MAAM,KAAK,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,IAAI,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;AAE3D,MAAM,CAAC,MAAM,QAAQ,GAAG,KAAK,CAC3B,sEAAsE,CACvE,CAAC;AACF,MAAM,CAAC,MAAM,YAAY,GAAG,KAAK,CAC/B,0LAA0L,CAC3L,CAAC;AACF,MAAM,CAAC,MAAM,sBAAsB,GAAG,KAAK,CAAC,sCAAsC,CAAC,CAAC;AACpF,MAAM,CAAC,MAA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C;AACD,MAAM,CAAC,MAAM,SAAS,GAAG,KAAK,CAAC,qDAAqD,CAAC,CAAC","sourcesContent":["const words = (value: string) => new Set(value.split(\" \"));\n\nexport const voidTags = words(\n \"area base br col embed hr img input link meta param source track wbr\",\n);\nexport const booleanAttrs = words(\n \"hidden inert readonly autofocus required disabled checked selected multiple open controls muted loop autoplay novalidate formnovalidate allowfullscreen reversed async defer playsinline\",\n);\nexport const enumeratedBooleanAttrs = words(\"spellcheck contenteditable draggable\");\nexport const overloadedBooleanAttrs = words(\"download\");\nexport const numericAttrs = words(\"start\");\nconst stringAttrs = words(\n \"property itemprop hreflang as integrity nonce popover popovertarget popovertargetaction srcdoc fetchpriority inputmode autocapitalize form label preload wrap closedby xmlns xmlns:xlink href focusable stroke-dasharray text-anchor\",\n);\nexport const commonAttrs = words(\n \"id class title lang dir slot role style hidden inert contenteditable draggable spellcheck tabindex accesskey translate onclick onload onerror\",\n);\nexport const htmlAttrs = words(\n \"href target rel download src alt width height type name value placeholder for charset datetime readonly autofocus required disabled checked selected multiple open controls muted loop autoplay novalidate formnovalidate maxlength minlength min max step pattern autocomplete accept accept-charset http-equiv content media method action enctype rows cols colspan rowspan scope cite poster loading decoding sizes srcset crossorigin referrerpolicy sandbox allow allowfullscreen start reversed property itemprop hreflang as integrity async defer nonce popover popovertarget popovertargetaction srcdoc fetchpriority inputmode autocapitalize form label preload playsinline wrap closedby\",\n);\nexport const svgAttrs = words(\n \"width height viewBox preserveAspectRatio gradientUnits gradientTransform markerWidth markerHeight refX refY xlink:href xml:lang xmlns xmlns:xlink href focusable stroke-width fill-rule clip-rule stroke-linecap stroke-linejoin stop-color stop-opacity fill-opacity stroke-dasharray text-anchor fill stroke d x y x1 x2 y1 y2 cx cy r rx ry points transform opacity offset\",\n);\nexport const svgTags = words(\n \"svg g path circle ellipse rect line polyline polygon text tspan defs symbol use clipPath mask linearGradient radialGradient stop title desc foreignObject pattern filter marker image\",\n);\nexport const htmlTags = words(\n \"html head body title base link meta style script div span p a br hr main header footer nav section article aside search hgroup menu h1 h2 h3 h4 h5 h6 ul ol li dl dt dd blockquote pre code strong em b i small mark time figure figcaption img picture source video audio track canvas form label input button textarea select option optgroup fieldset legend output progress meter datalist table caption thead tbody tfoot tr th td col colgroup details summary dialog template slot iframe noscript address abbr bdi bdo cite data del dfn ins kbd map area object param q rp rb rt ruby s samp sub sup u var wbr embed xmp noembed noframes plaintext\",\n);\nexport type Namespace = \"html\" | \"svg\";\n\n// An iframe is an owned element shell. Its fallback and foreign document are never owned children.\nexport function emptyIframeChildren(value: unknown): boolean {\n if (value == null || typeof value === \"boolean\" || value === \"\") return true;\n return Array.isArray(value) && value.every(emptyIframeChildren);\n}\n\nexport function attributeError(name: string, value: unknown, custom: boolean): string | undefined {\n if (value == null) return undefined;\n if (custom) return typeof value === \"string\" ? undefined : \"requires a string\";\n if (name === \"style\") return undefined; // style has its own object validator.\n if (booleanAttrs.has(name)) return typeof value === \"boolean\" ? undefined : \"requires a boolean\";\n if (overloadedBooleanAttrs.has(name) || enumeratedBooleanAttrs.has(name))\n return typeof value === \"string\" || typeof value === \"boolean\"\n ? undefined\n : \"requires a string or boolean\";\n if (numericAttrs.has(name))\n return typeof value === \"string\" || (typeof value === \"number\" && Number.isFinite(value))\n ? undefined\n : \"requires a string or finite number\";\n if (stringAttrs.has(name) || /^on[a-z]/.test(name))\n return typeof value === \"string\" ? undefined : \"requires a string\";\n if (\n typeof value === \"string\" ||\n (typeof value === \"number\" && Number.isFinite(value)) ||\n (typeof value === \"boolean\" && /^(data-|aria-)/.test(name))\n )\n return undefined;\n return \"requires a string or finite number\";\n}\n\nexport function attributeText(name: string, value: unknown): string | null {\n if (\n value == null ||\n (booleanAttrs.has(name) && value === false) ||\n (overloadedBooleanAttrs.has(name) && value === false)\n )\n return null;\n if ((booleanAttrs.has(name) || overloadedBooleanAttrs.has(name)) && value === true) return \"\";\n return String(value);\n}\n\nexport function attributeNamespace(name: string): string | null {\n if (name === \"xlink:href\") return \"http://www.w3.org/1999/xlink\";\n if (name === \"xml:lang\") return \"http://www.w3.org/XML/1998/namespace\";\n if (name === \"xmlns\" || name === \"xmlns:xlink\") return \"http://www.w3.org/2000/xmlns/\";\n return null;\n}\n\ntype PropAlias = {\n readonly spelling: string;\n readonly namespace?: Namespace | undefined;\n};\n\nconst propAliases: Readonly<Record<string, PropAlias>> = Object.fromEntries(\n [\n \"className=class htmlFor=for charSet dateTime tabIndex readOnly autoComplete autoFocus maxLength minLength crossOrigin srcSet acceptCharset=accept-charset httpEquiv=http-equiv encType noValidate formNoValidate colSpan rowSpan referrerPolicy allowFullScreen autoPlay contentEditable spellCheck accessKey dangerouslySetInnerHTML=rawHtml\",\n \"stroke-width fill-rule clip-rule stroke-linecap stroke-linejoin stop-color stop-opacity xlink:href xml:lang\",\n ].flatMap((entries, index) =>\n entries.split(\" \").map((entry) => {\n const [name, spelling = entry.toLowerCase()] = index\n ? [entry.replace(/[-:]([a-z])/g, (_, letter: string) => letter.toUpperCase()), entry]\n : entry.split(\"=\");\n return [name!, { spelling, namespace: index ? \"svg\" : undefined }];\n }),\n ),\n);\n\nconst legacyDialect = words(\n \"className htmlFor charSet dateTime tabIndex readOnly strokeWidth dangerouslySetInnerHTML\",\n);\n\nfunction allowedAliasTarget(spelling: string, namespace: Namespace): boolean {\n if (spelling === \"rawHtml\") return namespace === \"html\";\n return (\n commonAttrs.has(spelling) ||\n (namespace === \"svg\" ? svgAttrs.has(spelling) : htmlAttrs.has(spelling))\n );\n}\n\nfunction eventSuggestion(name: string): string {\n const event = name.slice(2);\n return `on:${event === \"DoubleClick\" ? \"dblclick\" : event.toLowerCase()}`;\n}\n\nexport function isDialectProp(name: string, namespace: Namespace, custom: boolean): boolean {\n if (/^on[A-Z]/.test(name) || legacyDialect.has(name)) return true;\n if (custom) return false;\n return dialectSuggestion(name, namespace, custom) !== undefined;\n}\n\nexport function dialectSuggestion(\n name: string,\n namespace: Namespace,\n custom: boolean,\n): string | undefined {\n if (/^on[A-Z]/.test(name)) return eventSuggestion(name);\n if (custom && !legacyDialect.has(name)) return undefined;\n const alias = propAliases[name];\n if (!alias || (alias.namespace && alias.namespace !== namespace)) return undefined;\n return allowedAliasTarget(alias.spelling, namespace) ? alias.spelling : undefined;\n}\n\nexport function reactiveModelSuggestion(\n tag: string,\n name: string,\n inputType: string,\n custom: boolean,\n):\n | \"modelValue\"\n | \"modelChecked\"\n | \"modelValue (or a static readonly/disabled attribute for a display-only binding)\"\n | undefined {\n if (custom) return undefined;\n if (name === \"checked\" && tag === \"input\") {\n if (inputType === \"radio\") return \"modelValue\";\n if (inputType === \"checkbox\") return \"modelChecked\";\n }\n if (name === \"value\") {\n if (tag === \"textarea\")\n return \"modelValue (or a static readonly/disabled attribute for a display-only binding)\";\n if (tag === \"select\") return \"modelValue\";\n if (\n tag === \"input\" &&\n [\"text\", \"search\", \"email\", \"url\", \"tel\", \"password\"].includes(inputType)\n )\n return \"modelValue (or a static readonly/disabled attribute for a display-only binding)\";\n }\n return undefined;\n}\nexport function displayOnlyControl(tag: string, props: Readonly<Record<string, unknown>>): boolean {\n return (\n (tag === \"textarea\" ||\n (tag === \"input\" &&\n (props.type === undefined ||\n [\"text\", \"search\", \"email\", \"url\", \"tel\", \"password\"].includes(props.type as string)))) &&\n (props.readonly === true || props.disabled === true)\n );\n}\nexport const formProps = words(\"modelValue modelChecked defaultValue defaultChecked\");\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@takazudo/zfb",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.5.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Content-site engine on the web's Request/Response model — prerender to static HTML, serve on Cloudflare Workers, or run as a local content server inside your app. One Rust binary. SDK with islands, content collections, pagination, and config helpers.",
|
|
@@ -83,6 +83,10 @@
|
|
|
83
83
|
"./zudo-react/testing": {
|
|
84
84
|
"types": "./dist/zudo-react/testing.d.ts",
|
|
85
85
|
"default": "./dist/zudo-react/testing.js"
|
|
86
|
+
},
|
|
87
|
+
"./css": {
|
|
88
|
+
"types": "./dist/css.d.ts",
|
|
89
|
+
"default": "./dist/css.js"
|
|
86
90
|
}
|
|
87
91
|
},
|
|
88
92
|
"bin": {
|
|
@@ -96,14 +100,14 @@
|
|
|
96
100
|
"LICENSE"
|
|
97
101
|
],
|
|
98
102
|
"dependencies": {
|
|
99
|
-
"@takazudo/zfb-slugify": "4.
|
|
103
|
+
"@takazudo/zfb-slugify": "4.5.1"
|
|
100
104
|
},
|
|
101
105
|
"optionalDependencies": {
|
|
102
|
-
"@takazudo/zfb-darwin-arm64": "4.
|
|
103
|
-
"@takazudo/zfb-darwin-x64": "4.
|
|
104
|
-
"@takazudo/zfb-linux-arm64-gnu": "4.
|
|
105
|
-
"@takazudo/zfb-linux-x64-gnu": "4.
|
|
106
|
-
"@takazudo/zfb-win32-x64-msvc": "4.
|
|
106
|
+
"@takazudo/zfb-darwin-arm64": "4.5.1",
|
|
107
|
+
"@takazudo/zfb-darwin-x64": "4.5.1",
|
|
108
|
+
"@takazudo/zfb-linux-arm64-gnu": "4.5.1",
|
|
109
|
+
"@takazudo/zfb-linux-x64-gnu": "4.5.1",
|
|
110
|
+
"@takazudo/zfb-win32-x64-msvc": "4.5.1"
|
|
107
111
|
},
|
|
108
112
|
"publishConfig": {
|
|
109
113
|
"access": "public"
|