@b9g/crank 0.6.1 → 0.7.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 +203 -138
- package/_css.cjs +80 -0
- package/_css.cjs.map +1 -0
- package/_css.d.ts +21 -0
- package/_css.js +76 -0
- package/_css.js.map +1 -0
- package/_utils.cjs +106 -0
- package/_utils.cjs.map +1 -0
- package/_utils.d.ts +14 -0
- package/_utils.js +99 -0
- package/_utils.js.map +1 -0
- package/async.cjs +236 -0
- package/async.cjs.map +1 -0
- package/async.d.ts +104 -0
- package/async.js +233 -0
- package/async.js.map +1 -0
- package/crank.cjs +1609 -1345
- package/crank.cjs.map +1 -1
- package/crank.d.ts +461 -228
- package/crank.js +1602 -1339
- package/crank.js.map +1 -1
- package/dom.cjs +365 -231
- package/dom.cjs.map +1 -1
- package/dom.d.ts +5 -5
- package/dom.js +365 -231
- package/dom.js.map +1 -1
- package/event-target.cjs +254 -0
- package/event-target.cjs.map +1 -0
- package/event-target.d.ts +26 -0
- package/event-target.js +249 -0
- package/event-target.js.map +1 -0
- package/html.cjs +11 -25
- package/html.cjs.map +1 -1
- package/html.d.ts +3 -3
- package/html.js +11 -25
- package/html.js.map +1 -1
- package/jsx-tag.cjs +2 -2
- package/jsx-tag.cjs.map +1 -1
- package/jsx-tag.js +2 -2
- package/jsx-tag.js.map +1 -1
- package/package.json +18 -2
- package/standalone.cjs +1 -0
- package/standalone.cjs.map +1 -1
- package/standalone.js +1 -1
- package/umd.js +2361 -1569
- package/umd.js.map +1 -1
package/html.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/// <reference types="html.d.ts" />
|
|
2
2
|
import { Renderer, Portal } from './crank.js';
|
|
3
|
+
import { camelToKebabCase, formatStyleValue } from './_css.js';
|
|
3
4
|
|
|
4
5
|
const voidTags = new Set([
|
|
5
6
|
"area",
|
|
@@ -41,7 +42,9 @@ function printStyleObject(style) {
|
|
|
41
42
|
const cssStrings = [];
|
|
42
43
|
for (const [name, value] of Object.entries(style)) {
|
|
43
44
|
if (value != null) {
|
|
44
|
-
|
|
45
|
+
const cssName = camelToKebabCase(name);
|
|
46
|
+
const cssValue = formatStyleValue(cssName, value);
|
|
47
|
+
cssStrings.push(`${cssName}:${cssValue};`);
|
|
45
48
|
}
|
|
46
49
|
}
|
|
47
50
|
return cssStrings.join("");
|
|
@@ -49,31 +52,14 @@ function printStyleObject(style) {
|
|
|
49
52
|
function printAttrs(props) {
|
|
50
53
|
const attrs = [];
|
|
51
54
|
for (let [name, value] of Object.entries(props)) {
|
|
52
|
-
|
|
53
|
-
// This should be handled by the core library.
|
|
54
|
-
if (name === "children" ||
|
|
55
|
-
name === "innerHTML" ||
|
|
56
|
-
name === "key" ||
|
|
57
|
-
name === "ref" ||
|
|
58
|
-
name === "copy" ||
|
|
59
|
-
name.startsWith("prop:") ||
|
|
60
|
-
// TODO: Remove deprecated special props
|
|
61
|
-
name === "crank-key" ||
|
|
62
|
-
name === "crank-ref" ||
|
|
63
|
-
name === "crank-static" ||
|
|
64
|
-
name === "c-key" ||
|
|
65
|
-
name === "c-ref" ||
|
|
66
|
-
name === "c-static" ||
|
|
67
|
-
name === "$key" ||
|
|
68
|
-
name === "$ref" ||
|
|
69
|
-
name === "$static") {
|
|
55
|
+
if (name === "innerHTML" || name.startsWith("prop:")) {
|
|
70
56
|
continue;
|
|
71
57
|
}
|
|
72
58
|
else if (name === "style") {
|
|
73
59
|
if (typeof value === "string") {
|
|
74
60
|
attrs.push(`style="${escape(value)}"`);
|
|
75
61
|
}
|
|
76
|
-
else if (typeof value === "object") {
|
|
62
|
+
else if (typeof value === "object" && value !== null) {
|
|
77
63
|
attrs.push(`style="${escape(printStyleObject(value))}"`);
|
|
78
64
|
}
|
|
79
65
|
}
|
|
@@ -112,8 +98,8 @@ const impl = {
|
|
|
112
98
|
create() {
|
|
113
99
|
return { value: "" };
|
|
114
100
|
},
|
|
115
|
-
text(
|
|
116
|
-
return escape(
|
|
101
|
+
text({ value }) {
|
|
102
|
+
return { value: escape(value) };
|
|
117
103
|
},
|
|
118
104
|
read(value) {
|
|
119
105
|
if (Array.isArray(value)) {
|
|
@@ -126,15 +112,15 @@ const impl = {
|
|
|
126
112
|
return value;
|
|
127
113
|
}
|
|
128
114
|
else {
|
|
129
|
-
return value.value;
|
|
115
|
+
return value.value || "";
|
|
130
116
|
}
|
|
131
117
|
},
|
|
132
|
-
arrange(tag, node, props, children) {
|
|
118
|
+
arrange({ tag, tagName, node, props, children, }) {
|
|
133
119
|
if (tag === Portal) {
|
|
134
120
|
return;
|
|
135
121
|
}
|
|
136
122
|
else if (typeof tag !== "string") {
|
|
137
|
-
throw new Error(`Unknown tag: ${
|
|
123
|
+
throw new Error(`Unknown tag: ${tagName}`);
|
|
138
124
|
}
|
|
139
125
|
const attrs = printAttrs(props);
|
|
140
126
|
const open = `<${tag}${attrs.length ? " " : ""}${attrs}>`;
|
package/html.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"html.js","sources":["../src/html.ts"],"sourcesContent":["import {Portal, Renderer} from \"./crank.js\";\nimport type {ElementValue, RendererImpl} from \"./crank.js\";\n\nconst voidTags = new Set([\n\t\"area\",\n\t\"base\",\n\t\"br\",\n\t\"col\",\n\t\"command\",\n\t\"embed\",\n\t\"hr\",\n\t\"img\",\n\t\"input\",\n\t\"keygen\",\n\t\"link\",\n\t\"meta\",\n\t\"param\",\n\t\"source\",\n\t\"track\",\n\t\"wbr\",\n]);\n\nfunction escape(text: string): string {\n\treturn text.replace(/[&<>\"']/g, (match) => {\n\t\tswitch (match) {\n\t\t\tcase \"&\":\n\t\t\t\treturn \"&\";\n\t\t\tcase \"<\":\n\t\t\t\treturn \"<\";\n\t\t\tcase \">\":\n\t\t\t\treturn \">\";\n\t\t\tcase '\"':\n\t\t\t\treturn \""\";\n\t\t\tcase \"'\":\n\t\t\t\treturn \"'\";\n\t\t\tdefault:\n\t\t\t\treturn \"\";\n\t\t}\n\t});\n}\n\nfunction printStyleObject(style: Record<string, any>): string {\n\tconst cssStrings = [];\n\tfor (const [name, value] of Object.entries(style)) {\n\t\tif (value != null) {\n\t\t\tcssStrings.push(`${name}:${value};`);\n\t\t}\n\t}\n\n\treturn cssStrings.join(\"\");\n}\n\nfunction printAttrs(props: Record<string, any>): string {\n\tconst attrs: string[] = [];\n\tfor (let [name, value] of Object.entries(props)) {\n\t\t// TODO: Because printAttrs is called in arrange, special props are not filtered out.\n\t\t// This should be handled by the core library.\n\t\tif (\n\t\t\tname === \"children\" ||\n\t\t\tname === \"innerHTML\" ||\n\t\t\tname === \"key\" ||\n\t\t\tname === \"ref\" ||\n\t\t\tname === \"copy\" ||\n\t\t\tname.startsWith(\"prop:\") ||\n\t\t\t// TODO: Remove deprecated special props\n\t\t\tname === \"crank-key\" ||\n\t\t\tname === \"crank-ref\" ||\n\t\t\tname === \"crank-static\" ||\n\t\t\tname === \"c-key\" ||\n\t\t\tname === \"c-ref\" ||\n\t\t\tname === \"c-static\" ||\n\t\t\tname === \"$key\" ||\n\t\t\tname === \"$ref\" ||\n\t\t\tname === \"$static\"\n\t\t) {\n\t\t\tcontinue;\n\t\t} else if (name === \"style\") {\n\t\t\tif (typeof value === \"string\") {\n\t\t\t\tattrs.push(`style=\"${escape(value)}\"`);\n\t\t\t} else if (typeof value === \"object\") {\n\t\t\t\tattrs.push(`style=\"${escape(printStyleObject(value))}\"`);\n\t\t\t}\n\t\t} else if (name === \"className\") {\n\t\t\tif (\"class\" in props || typeof value !== \"string\") {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tattrs.push(`class=\"${escape(value)}\"`);\n\t\t} else {\n\t\t\tif (name.startsWith(\"attr:\")) {\n\t\t\t\tname = name.slice(\"attr:\".length);\n\t\t\t}\n\t\t\tif (typeof value === \"string\") {\n\t\t\t\tattrs.push(`${escape(name)}=\"${escape(value)}\"`);\n\t\t\t} else if (typeof value === \"number\") {\n\t\t\t\tattrs.push(`${escape(name)}=\"${value}\"`);\n\t\t\t} else if (value === true) {\n\t\t\t\tattrs.push(`${escape(name)}`);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn attrs.join(\" \");\n}\n\ninterface Node {\n\tvalue: string;\n}\n\nfunction join(children: Array<Node | string>): string {\n\tlet result = \"\";\n\tfor (let i = 0; i < children.length; i++) {\n\t\tconst child = children[i];\n\t\tresult += typeof child === \"string\" ? child : child.value;\n\t}\n\n\treturn result;\n}\n\nexport const impl: Partial<RendererImpl<Node, undefined, any, string>> = {\n\tcreate(): Node {\n\t\treturn {value: \"\"};\n\t},\n\n\ttext(text: string): string {\n\t\treturn escape(text);\n\t},\n\n\tread(value: ElementValue<Node>): string {\n\t\tif (Array.isArray(value)) {\n\t\t\treturn join(value);\n\t\t} else if (typeof value === \"undefined\") {\n\t\t\treturn \"\";\n\t\t} else if (typeof value === \"string\") {\n\t\t\treturn value;\n\t\t} else {\n\t\t\treturn value.value;\n\t\t}\n\t},\n\n\tarrange(\n\t\ttag: string | symbol,\n\t\tnode: Node,\n\t\tprops: Record<string, any>,\n\t\tchildren: Array<Node | string>,\n\t): void {\n\t\tif (tag === Portal) {\n\t\t\treturn;\n\t\t} else if (typeof tag !== \"string\") {\n\t\t\tthrow new Error(`Unknown tag: ${tag.toString()}`);\n\t\t}\n\n\t\tconst attrs = printAttrs(props);\n\t\tconst open = `<${tag}${attrs.length ? \" \" : \"\"}${attrs}>`;\n\t\tlet result: string;\n\t\tif (voidTags.has(tag)) {\n\t\t\tresult = open;\n\t\t} else {\n\t\t\tconst close = `</${tag}>`;\n\t\t\tconst contents =\n\t\t\t\t\"innerHTML\" in props ? props[\"innerHTML\"] : join(children);\n\t\t\tresult = `${open}${contents}${close}`;\n\t\t}\n\n\t\tnode.value = result;\n\t},\n};\n\nexport class HTMLRenderer extends Renderer<Node, undefined, any, string> {\n\tconstructor() {\n\t\tsuper(impl);\n\t}\n}\n\nexport const renderer = new HTMLRenderer();\n\ndeclare global {\n\tmodule Crank {\n\t\t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CAAA,WAAA,CAAA,CAAA,CAAA;CACC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,CAAC,CAAA,CAAA,CAAA,CAAI,CAAC;;AAEZ;AAEY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;;"}
|
|
1
|
+
{"version":3,"file":"html.js","sources":["../src/html.ts"],"sourcesContent":["import {Portal, Renderer} from \"./crank.js\";\nimport type {ElementValue, RenderAdapter} from \"./crank.js\";\nimport {camelToKebabCase, formatStyleValue} from \"./_css.js\";\n\nconst voidTags = new Set([\n\t\"area\",\n\t\"base\",\n\t\"br\",\n\t\"col\",\n\t\"command\",\n\t\"embed\",\n\t\"hr\",\n\t\"img\",\n\t\"input\",\n\t\"keygen\",\n\t\"link\",\n\t\"meta\",\n\t\"param\",\n\t\"source\",\n\t\"track\",\n\t\"wbr\",\n]);\n\nfunction escape(text: string): string {\n\treturn text.replace(/[&<>\"']/g, (match) => {\n\t\tswitch (match) {\n\t\t\tcase \"&\":\n\t\t\t\treturn \"&\";\n\t\t\tcase \"<\":\n\t\t\t\treturn \"<\";\n\t\t\tcase \">\":\n\t\t\t\treturn \">\";\n\t\t\tcase '\"':\n\t\t\t\treturn \""\";\n\t\t\tcase \"'\":\n\t\t\t\treturn \"'\";\n\t\t\tdefault:\n\t\t\t\treturn \"\";\n\t\t}\n\t});\n}\n\nfunction printStyleObject(style: Record<string, any>): string {\n\tconst cssStrings = [];\n\tfor (const [name, value] of Object.entries(style)) {\n\t\tif (value != null) {\n\t\t\tconst cssName = camelToKebabCase(name);\n\t\t\tconst cssValue = formatStyleValue(cssName, value);\n\t\t\tcssStrings.push(`${cssName}:${cssValue};`);\n\t\t}\n\t}\n\n\treturn cssStrings.join(\"\");\n}\n\nfunction printAttrs(props: Record<string, any>): string {\n\tconst attrs: string[] = [];\n\tfor (let [name, value] of Object.entries(props)) {\n\t\tif (name === \"innerHTML\" || name.startsWith(\"prop:\")) {\n\t\t\tcontinue;\n\t\t} else if (name === \"style\") {\n\t\t\tif (typeof value === \"string\") {\n\t\t\t\tattrs.push(`style=\"${escape(value)}\"`);\n\t\t\t} else if (typeof value === \"object\" && value !== null) {\n\t\t\t\tattrs.push(`style=\"${escape(printStyleObject(value))}\"`);\n\t\t\t}\n\t\t} else if (name === \"className\") {\n\t\t\tif (\"class\" in props || typeof value !== \"string\") {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tattrs.push(`class=\"${escape(value)}\"`);\n\t\t} else {\n\t\t\tif (name.startsWith(\"attr:\")) {\n\t\t\t\tname = name.slice(\"attr:\".length);\n\t\t\t}\n\t\t\tif (typeof value === \"string\") {\n\t\t\t\tattrs.push(`${escape(name)}=\"${escape(value)}\"`);\n\t\t\t} else if (typeof value === \"number\") {\n\t\t\t\tattrs.push(`${escape(name)}=\"${value}\"`);\n\t\t\t} else if (value === true) {\n\t\t\t\tattrs.push(`${escape(name)}`);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn attrs.join(\" \");\n}\n\ninterface Node {\n\tvalue?: string;\n}\n\nfunction join(children: Array<Node | string>): string {\n\tlet result = \"\";\n\tfor (let i = 0; i < children.length; i++) {\n\t\tconst child = children[i];\n\t\tresult += typeof child === \"string\" ? child : child.value;\n\t}\n\n\treturn result;\n}\n\nexport const impl: Partial<RenderAdapter<Node, undefined, Node, string>> = {\n\tcreate(): Node {\n\t\treturn {value: \"\"};\n\t},\n\n\ttext({value}: {value: string}): Node {\n\t\treturn {value: escape(value)};\n\t},\n\n\tread(value: ElementValue<Node>): string {\n\t\tif (Array.isArray(value)) {\n\t\t\treturn join(value);\n\t\t} else if (typeof value === \"undefined\") {\n\t\t\treturn \"\";\n\t\t} else if (typeof value === \"string\") {\n\t\t\treturn value;\n\t\t} else {\n\t\t\treturn value.value || \"\";\n\t\t}\n\t},\n\n\tarrange({\n\t\ttag,\n\t\ttagName,\n\t\tnode,\n\t\tprops,\n\t\tchildren,\n\t}: {\n\t\ttag: string | symbol;\n\t\ttagName: string;\n\t\tnode: Node;\n\t\tprops: Record<string, any>;\n\t\tchildren: Array<Node | string>;\n\t}): void {\n\t\tif (tag === Portal) {\n\t\t\treturn;\n\t\t} else if (typeof tag !== \"string\") {\n\t\t\tthrow new Error(`Unknown tag: ${tagName}`);\n\t\t}\n\n\t\tconst attrs = printAttrs(props);\n\t\tconst open = `<${tag}${attrs.length ? \" \" : \"\"}${attrs}>`;\n\t\tlet result: string;\n\t\tif (voidTags.has(tag)) {\n\t\t\tresult = open;\n\t\t} else {\n\t\t\tconst close = `</${tag}>`;\n\t\t\tconst contents =\n\t\t\t\t\"innerHTML\" in props ? props[\"innerHTML\"] : join(children);\n\t\t\tresult = `${open}${contents}${close}`;\n\t\t}\n\n\t\tnode.value = result;\n\t},\n};\n\nexport class HTMLRenderer extends Renderer<Node, undefined, any, string> {\n\tconstructor() {\n\t\tsuper(impl);\n\t}\n}\n\nexport const renderer = new HTMLRenderer();\n\ndeclare global {\n\tmodule Crank {\n\t\tinterface EventMap extends GlobalEventHandlersEventMap {}\n\t}\n}\n"],"names":[],"mappings":";;;;AAIA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAQ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,CAAI,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,CAAC;IACxB,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA;IACN,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA;IACN,CAAI,CAAA,CAAA,CAAA;IACJ,CAAK,CAAA,CAAA,CAAA,CAAA;IACL,CAAS,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;IACT,CAAO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,CAAG,CAAA,CAAA,CAAK,CAAA,CAAA,CAAA,CAAA,EAAE;;AAGtC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAA,CAAA,CAAA,CAAC,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA;CACnB,CAAA,CAAA,CAAA,CAAA;;AAGI,CAAO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAa,CAAQ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAsC,CAAA;AACvE,CAAA,CAAA,CAAA,CAAA,WAAA,CAAA,CAAA,CAAA;CACC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,CAAC,CAAA,CAAA,CAAA,CAAI,CAAC;;AAEZ;AAEY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;;"}
|
package/jsx-tag.cjs
CHANGED
|
@@ -35,7 +35,7 @@ const html = jsx;
|
|
|
35
35
|
* Group 5: tag name
|
|
36
36
|
*
|
|
37
37
|
* The comment group must appear first because the tag group can potentially
|
|
38
|
-
* match a comment, so that we can handle tag expressions where we
|
|
38
|
+
* match a comment, so that we can handle tag expressions where we've reached
|
|
39
39
|
* the end of a span.
|
|
40
40
|
*/
|
|
41
41
|
const CHILDREN_RE = /((?:\r|\n|\r\n)\s*)|(<!--[\S\s]*?(?:-->|$))|(<\s*(\/{0,2})\s*([-_$\w]*))/g;
|
|
@@ -252,7 +252,7 @@ function parse(spans) {
|
|
|
252
252
|
break;
|
|
253
253
|
}
|
|
254
254
|
case CLOSING_BRACKET_RE: {
|
|
255
|
-
// We
|
|
255
|
+
// We're in a closing tag and looking for the >.
|
|
256
256
|
if (match) {
|
|
257
257
|
if (i < match.index) {
|
|
258
258
|
throw new SyntaxError(`Unexpected text \`${span.slice(i, match.index).trim()}\``);
|
package/jsx-tag.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jsx-tag.cjs","sources":["../src/jsx-tag.ts"],"sourcesContent":["import {createElement} from \"./crank.js\";\nimport type {Element} from \"./crank.js\";\n\nconst cache = new Map<string, ParseResult>();\nexport function jsx(\n\tspans: TemplateStringsArray,\n\t...expressions: Array<unknown>\n): Element {\n\tconst key = JSON.stringify(spans.raw);\n\tlet parseResult = cache.get(key);\n\tif (parseResult == null) {\n\t\tparseResult = parse(spans.raw);\n\t\tcache.set(key, parseResult);\n\t}\n\n\tconst {element, targets} = parseResult;\n\tfor (let i = 0; i < expressions.length; i++) {\n\t\tconst exp = expressions[i];\n\t\tconst target = targets[i];\n\t\tif (target) {\n\t\t\tif (target.type === \"error\") {\n\t\t\t\tthrow new SyntaxError(\n\t\t\t\t\ttarget.message.replace(\"${}\", formatTagForError(exp)),\n\t\t\t\t);\n\t\t\t}\n\n\t\t\ttarget.value = exp;\n\t\t}\n\t}\n\n\treturn build(element);\n}\n\n/** Alias for `jsx` template tag. */\nexport const html = jsx;\n\n// Type definitions for a bare-bones AST\ninterface ParseElement {\n\ttype: \"element\";\n\topen: ParseTag;\n\tclose: ParseTag | null;\n\t// ParseValue is used to represent spread props.\n\tprops: Array<ParseProp | ParseValue>;\n\tchildren: Array<ParseElement | ParseValue>;\n}\n\ninterface ParseValue {\n\ttype: \"value\";\n\tvalue: any;\n}\n\ninterface ParseTag {\n\ttype: \"tag\";\n\tslash: string;\n\tvalue: any;\n}\n\ninterface ParseProp {\n\ttype: \"prop\";\n\tname: string;\n\tvalue: ParseValue | ParsePropString;\n}\n\ninterface ParsePropString {\n\ttype: \"propString\";\n\tparts: Array<string | ParseValue>;\n}\n\ninterface ParseError {\n\ttype: \"error\";\n\tmessage: string;\n\tvalue: any;\n}\n\n// The parse result includes an array of targets, references to objects in the\n// parse tree whose `value` property is overwritten with expressions when the\n// template function is called. By separating the logic of parsing static\n// template spans from the handling of dynamic expressions, we can cache parse\n// results for successive calls.\ntype ExpressionTarget = ParseValue | ParseTag | ParseProp | ParseError;\n\ninterface ParseResult {\n\telement: ParseElement;\n\ttargets: Array<ExpressionTarget | null>;\n}\n\n/**\n * Matches first significant character in children mode.\n *\n * Group 1: newline\n * Group 2: comment\n * Group 3: tag\n * Group 4: closing slash\n * Group 5: tag name\n *\n * The comment group must appear first because the tag group can potentially\n * match a comment, so that we can handle tag expressions where we’ve reached\n * the end of a span.\n */\nconst CHILDREN_RE =\n\t/((?:\\r|\\n|\\r\\n)\\s*)|(<!--[\\S\\s]*?(?:-->|$))|(<\\s*(\\/{0,2})\\s*([-_$\\w]*))/g;\n\n/**\n * Matches props after element tags.\n *\n * Group 1: tag end\n * Group 2: spread props\n * Group 3: prop name\n * Group 4: equals\n * Group 5: prop value string\n */\nconst PROPS_RE =\n\t/\\s*(?:(\\/?\\s*>)|(\\.\\.\\.\\s*)|(?:([-_$\\w]+)\\s*(=)?\\s*(?:(\"(\\\\\"|[\\S\\s])*?(?:\"|$)|'(?:\\\\'|[\\S\\s])*?(?:'|$)))?))/g;\n\nconst CLOSING_BRACKET_RE = />/g;\n\nconst CLOSING_SINGLE_QUOTE_RE = /[^\\\\]?'/g;\n\nconst CLOSING_DOUBLE_QUOTE_RE = /[^\\\\]?\"/g;\n\nconst CLOSING_COMMENT_RE = /-->/g;\n\nfunction parse(spans: ArrayLike<string>): ParseResult {\n\tlet matcher = CHILDREN_RE;\n\tconst stack: Array<ParseElement> = [];\n\tlet element: ParseElement = {\n\t\ttype: \"element\",\n\t\topen: {type: \"tag\", slash: \"\", value: \"\"},\n\t\tclose: null,\n\t\tprops: [],\n\t\tchildren: [],\n\t};\n\n\tconst targets: Array<ExpressionTarget | null> = [];\n\tlet lineStart = true;\n\tfor (let s = 0; s < spans.length; s++) {\n\t\tconst span = spans[s];\n\t\t// Whether or not an expression is upcoming. Used to provide better errors.\n\t\tconst expressing = s < spans.length - 1;\n\t\tlet expressionTarget: ExpressionTarget | null = null;\n\t\tfor (let i = 0, end = i; i < span.length; i = end) {\n\t\t\tmatcher.lastIndex = i;\n\t\t\tconst match = matcher.exec(span);\n\t\t\tend = match ? match.index + match[0].length : span.length;\n\t\t\tswitch (matcher) {\n\t\t\t\tcase CHILDREN_RE: {\n\t\t\t\t\tif (match) {\n\t\t\t\t\t\tconst [, newline, comment, tag, closingSlash, tagName] = match;\n\t\t\t\t\t\tif (i < match.index) {\n\t\t\t\t\t\t\tlet before = span.slice(i, match.index);\n\t\t\t\t\t\t\tif (lineStart) {\n\t\t\t\t\t\t\t\tbefore = before.replace(/^\\s*/, \"\");\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (newline) {\n\t\t\t\t\t\t\t\tif (span[Math.max(0, match.index - 1)] === \"\\\\\") {\n\t\t\t\t\t\t\t\t\t// We preserve whitespace before escaped newlines and have to\n\t\t\t\t\t\t\t\t\t// remove the backslash.\n\t\t\t\t\t\t\t\t\t// jsx` \\\n\t\t\t\t\t\t\t\t\t// `\n\t\t\t\t\t\t\t\t\tbefore = before.slice(0, -1);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tbefore = before.replace(/\\s*$/, \"\");\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (before) {\n\t\t\t\t\t\t\t\telement.children.push({type: \"value\", value: before});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tlineStart = !!newline;\n\t\t\t\t\t\tif (comment) {\n\t\t\t\t\t\t\tif (end === span.length) {\n\t\t\t\t\t\t\t\t// Expression in a comment:\n\t\t\t\t\t\t\t\t// jsx`<!-- ${exp} -->`\n\t\t\t\t\t\t\t\tmatcher = CLOSING_COMMENT_RE;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if (tag) {\n\t\t\t\t\t\t\tif (closingSlash) {\n\t\t\t\t\t\t\t\telement.close = {\n\t\t\t\t\t\t\t\t\ttype: \"tag\",\n\t\t\t\t\t\t\t\t\tslash: closingSlash,\n\t\t\t\t\t\t\t\t\tvalue: tagName,\n\t\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\t\tif (!stack.length) {\n\t\t\t\t\t\t\t\t\tif (end !== span.length) {\n\t\t\t\t\t\t\t\t\t\tthrow new SyntaxError(`Unmatched closing tag \"${tagName}\"`);\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t// ERROR EXPRESSION\n\t\t\t\t\t\t\t\t\texpressionTarget = {\n\t\t\t\t\t\t\t\t\t\ttype: \"error\",\n\t\t\t\t\t\t\t\t\t\tmessage: \"Unmatched closing tag ${}\",\n\t\t\t\t\t\t\t\t\t\tvalue: null,\n\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tif (end === span.length) {\n\t\t\t\t\t\t\t\t\t\t// TAG EXPRESSION\n\t\t\t\t\t\t\t\t\t\texpressionTarget = element.close;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\telement = stack.pop()!;\n\t\t\t\t\t\t\t\t\tmatcher = CLOSING_BRACKET_RE;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tconst next: ParseElement = {\n\t\t\t\t\t\t\t\t\ttype: \"element\",\n\t\t\t\t\t\t\t\t\topen: {\n\t\t\t\t\t\t\t\t\t\ttype: \"tag\",\n\t\t\t\t\t\t\t\t\t\tslash: \"\",\n\t\t\t\t\t\t\t\t\t\tvalue: tagName,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tclose: null,\n\t\t\t\t\t\t\t\t\tprops: [],\n\t\t\t\t\t\t\t\t\tchildren: [],\n\t\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\t\telement.children.push(next);\n\t\t\t\t\t\t\t\tstack.push(element);\n\t\t\t\t\t\t\t\telement = next;\n\t\t\t\t\t\t\t\tmatcher = PROPS_RE;\n\t\t\t\t\t\t\t\tif (end === span.length) {\n\t\t\t\t\t\t\t\t\t// TAG EXPRESSION\n\t\t\t\t\t\t\t\t\texpressionTarget = element.open;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (i < span.length) {\n\t\t\t\t\t\t\tlet after = span.slice(i);\n\t\t\t\t\t\t\tif (!expressing) {\n\t\t\t\t\t\t\t\t// trim trailing whitespace\n\t\t\t\t\t\t\t\tafter = after.replace(/\\s*$/, \"\");\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (after) {\n\t\t\t\t\t\t\t\telement.children.push({type: \"value\", value: after});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase PROPS_RE: {\n\t\t\t\t\tif (match) {\n\t\t\t\t\t\tconst [, tagEnd, spread, name, equals, string] = match;\n\t\t\t\t\t\tif (i < match.index) {\n\t\t\t\t\t\t\tthrow new SyntaxError(\n\t\t\t\t\t\t\t\t`Unexpected text \\`${span.slice(i, match.index).trim()}\\``,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (tagEnd) {\n\t\t\t\t\t\t\tif (tagEnd[0] === \"/\") {\n\t\t\t\t\t\t\t\t// This is a self-closing element, so there will always be a\n\t\t\t\t\t\t\t\t// result on the stack.\n\t\t\t\t\t\t\t\telement = stack.pop()!;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tmatcher = CHILDREN_RE;\n\t\t\t\t\t\t} else if (spread) {\n\t\t\t\t\t\t\tconst value = {\n\t\t\t\t\t\t\t\ttype: \"value\" as const,\n\t\t\t\t\t\t\t\tvalue: null,\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\telement.props.push(value);\n\t\t\t\t\t\t\t// SPREAD PROP EXPRESSION\n\t\t\t\t\t\t\texpressionTarget = value;\n\t\t\t\t\t\t\tif (!(expressing && end === span.length)) {\n\t\t\t\t\t\t\t\tthrow new SyntaxError('Expression expected after \"...\"');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if (name) {\n\t\t\t\t\t\t\tlet value: ParseValue | ParsePropString;\n\t\t\t\t\t\t\tif (string == null) {\n\t\t\t\t\t\t\t\tif (!equals) {\n\t\t\t\t\t\t\t\t\tvalue = {type: \"value\", value: true};\n\t\t\t\t\t\t\t\t} else if (end < span.length) {\n\t\t\t\t\t\t\t\t\tthrow new SyntaxError(\n\t\t\t\t\t\t\t\t\t\t`Unexpected text \\`${span.slice(end, end + 20)}\\``,\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tvalue = {type: \"value\" as const, value: null};\n\t\t\t\t\t\t\t\t\t// PROP EXPRESSION\n\t\t\t\t\t\t\t\t\texpressionTarget = value;\n\t\t\t\t\t\t\t\t\tif (!(expressing && end === span.length)) {\n\t\t\t\t\t\t\t\t\t\tthrow new SyntaxError(\n\t\t\t\t\t\t\t\t\t\t\t`Expression expected for prop \"${name}\"`,\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tconst quote = string[0];\n\t\t\t\t\t\t\t\tvalue = {type: \"propString\", parts: []};\n\t\t\t\t\t\t\t\tvalue.parts.push(string);\n\t\t\t\t\t\t\t\tif (end === span.length) {\n\t\t\t\t\t\t\t\t\tmatcher =\n\t\t\t\t\t\t\t\t\t\tquote === \"'\"\n\t\t\t\t\t\t\t\t\t\t\t? CLOSING_SINGLE_QUOTE_RE\n\t\t\t\t\t\t\t\t\t\t\t: CLOSING_DOUBLE_QUOTE_RE;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tconst prop = {\n\t\t\t\t\t\t\t\ttype: \"prop\" as const,\n\t\t\t\t\t\t\t\tname,\n\t\t\t\t\t\t\t\tvalue,\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\telement.props.push(prop);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (!expressing) {\n\t\t\t\t\t\t\tif (i === span.length) {\n\t\t\t\t\t\t\t\tthrow new SyntaxError(\n\t\t\t\t\t\t\t\t\t`Expected props but reached end of document`,\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tthrow new SyntaxError(\n\t\t\t\t\t\t\t\t\t`Unexpected text \\`${span.slice(i, i + 20).trim()}\\``,\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Unexpected expression errors are handled in the outer loop.\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// This would most likely be the starting point for the logic of\n\t\t\t\t\t\t// prop name expressions.\n\t\t\t\t\t\t// jsx`<p ${name}=${value}>`\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase CLOSING_BRACKET_RE: {\n\t\t\t\t\t// We’re in a closing tag and looking for the >.\n\t\t\t\t\tif (match) {\n\t\t\t\t\t\tif (i < match.index) {\n\t\t\t\t\t\t\tthrow new SyntaxError(\n\t\t\t\t\t\t\t\t`Unexpected text \\`${span.slice(i, match.index).trim()}\\``,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tmatcher = CHILDREN_RE;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (!expressing) {\n\t\t\t\t\t\t\tthrow new SyntaxError(\n\t\t\t\t\t\t\t\t`Unexpected text \\`${span.slice(i, i + 20).trim()}\\``,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase CLOSING_SINGLE_QUOTE_RE:\n\t\t\t\tcase CLOSING_DOUBLE_QUOTE_RE: {\n\t\t\t\t\tconst string = span.slice(i, end);\n\t\t\t\t\tconst prop = element.props[element.props.length - 1] as ParseProp;\n\t\t\t\t\tconst propString = prop.value as ParsePropString;\n\t\t\t\t\tpropString.parts.push(string);\n\t\t\t\t\tif (match) {\n\t\t\t\t\t\tmatcher = PROPS_RE;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (!expressing) {\n\t\t\t\t\t\t\tthrow new SyntaxError(\n\t\t\t\t\t\t\t\t`Missing \\`${\n\t\t\t\t\t\t\t\t\tmatcher === CLOSING_SINGLE_QUOTE_RE ? \"'\" : '\"'\n\t\t\t\t\t\t\t\t}\\``,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase CLOSING_COMMENT_RE: {\n\t\t\t\t\tif (match) {\n\t\t\t\t\t\tmatcher = CHILDREN_RE;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (!expressing) {\n\t\t\t\t\t\t\tthrow new SyntaxError(\n\t\t\t\t\t\t\t\t\"Expected `-->` but reached end of template\",\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (expressing) {\n\t\t\tif (expressionTarget) {\n\t\t\t\ttargets.push(expressionTarget);\n\t\t\t\tif (expressionTarget.type === \"error\") {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tswitch (matcher) {\n\t\t\t\tcase CHILDREN_RE: {\n\t\t\t\t\tconst target = {type: \"value\" as const, value: null};\n\t\t\t\t\telement.children.push(target);\n\t\t\t\t\ttargets.push(target);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase CLOSING_SINGLE_QUOTE_RE:\n\t\t\t\tcase CLOSING_DOUBLE_QUOTE_RE: {\n\t\t\t\t\tconst prop = element.props[element.props.length - 1] as ParseProp;\n\t\t\t\t\tconst target = {type: \"value\" as const, value: null};\n\t\t\t\t\t(prop.value as ParsePropString).parts.push(target);\n\t\t\t\t\ttargets.push(target);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase CLOSING_COMMENT_RE:\n\t\t\t\t\ttargets.push(null);\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new SyntaxError(\"Unexpected expression\");\n\t\t\t}\n\t\t} else if (expressionTarget) {\n\t\t\tthrow new SyntaxError(\"Expression expected\");\n\t\t}\n\n\t\tlineStart = false;\n\t}\n\n\tif (stack.length) {\n\t\tconst ti = targets.indexOf(element.open);\n\t\tif (ti === -1) {\n\t\t\tthrow new SyntaxError(`Unmatched opening tag \"${element.open.value}\"`);\n\t\t}\n\n\t\ttargets[ti] = {\n\t\t\ttype: \"error\",\n\t\t\tmessage: \"Unmatched opening tag ${}\",\n\t\t\tvalue: null,\n\t\t};\n\t}\n\n\tif (element.children.length === 1 && element.children[0].type === \"element\") {\n\t\telement = element.children[0];\n\t}\n\n\treturn {element, targets};\n}\n\nfunction build(parsed: ParseElement): Element {\n\tif (\n\t\tparsed.close !== null &&\n\t\tparsed.close.slash !== \"//\" &&\n\t\tparsed.open.value !== parsed.close.value\n\t) {\n\t\tthrow new SyntaxError(\n\t\t\t`Unmatched closing tag ${formatTagForError(\n\t\t\t\tparsed.close.value,\n\t\t\t)}, expected ${formatTagForError(parsed.open.value)}`,\n\t\t);\n\t}\n\n\tconst children: Array<unknown> = [];\n\tfor (let i = 0; i < parsed.children.length; i++) {\n\t\tconst child = parsed.children[i];\n\t\tchildren.push(child.type === \"element\" ? build(child) : child.value);\n\t}\n\n\tlet props = parsed.props.length ? ({} as Record<string, unknown>) : null;\n\tfor (let i = 0; i < parsed.props.length; i++) {\n\t\tconst prop = parsed.props[i];\n\t\tif (prop.type === \"prop\") {\n\t\t\tlet value: any;\n\t\t\tif (prop.value.type === \"value\") {\n\t\t\t\tvalue = prop.value.value;\n\t\t\t} else {\n\t\t\t\tlet string = \"\";\n\t\t\t\tfor (let i = 0; i < prop.value.parts.length; i++) {\n\t\t\t\t\tconst part = prop.value.parts[i];\n\t\t\t\t\tif (typeof part === \"string\") {\n\t\t\t\t\t\tstring += part;\n\t\t\t\t\t} else if (typeof part.value !== \"boolean\" && part.value != null) {\n\t\t\t\t\t\tstring +=\n\t\t\t\t\t\t\ttypeof part.value === \"string\" ? part.value : String(part.value);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tvalue = string\n\t\t\t\t\t// remove quotes\n\t\t\t\t\t.slice(1, -1)\n\t\t\t\t\t// unescape things\n\t\t\t\t\t// adapted from https://stackoverflow.com/a/57330383/1825413\n\t\t\t\t\t.replace(\n\t\t\t\t\t\t/\\\\x[0-9a-f]{2}|\\\\u[0-9a-f]{4}|\\\\u\\{[0-9a-f]+\\}|\\\\./gi,\n\t\t\t\t\t\t(match) => {\n\t\t\t\t\t\t\tswitch (match[1]) {\n\t\t\t\t\t\t\t\tcase \"b\":\n\t\t\t\t\t\t\t\t\treturn \"\\b\";\n\t\t\t\t\t\t\t\tcase \"f\":\n\t\t\t\t\t\t\t\t\treturn \"\\f\";\n\t\t\t\t\t\t\t\tcase \"n\":\n\t\t\t\t\t\t\t\t\treturn \"\\n\";\n\t\t\t\t\t\t\t\tcase \"r\":\n\t\t\t\t\t\t\t\t\treturn \"\\r\";\n\t\t\t\t\t\t\t\tcase \"t\":\n\t\t\t\t\t\t\t\t\treturn \"\\t\";\n\t\t\t\t\t\t\t\tcase \"v\":\n\t\t\t\t\t\t\t\t\treturn \"\\v\";\n\t\t\t\t\t\t\t\tcase \"x\":\n\t\t\t\t\t\t\t\t\treturn String.fromCharCode(parseInt(match.slice(2), 16));\n\t\t\t\t\t\t\t\tcase \"u\":\n\t\t\t\t\t\t\t\t\tif (match[2] === \"{\") {\n\t\t\t\t\t\t\t\t\t\treturn String.fromCodePoint(\n\t\t\t\t\t\t\t\t\t\t\tparseInt(match.slice(3, -1), 16),\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\treturn String.fromCharCode(parseInt(match.slice(2), 16));\n\t\t\t\t\t\t\t\tcase \"0\":\n\t\t\t\t\t\t\t\t\treturn \"\\0\";\n\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\treturn match.slice(1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t);\n\t\t\t}\n\n\t\t\tprops![prop.name] = value;\n\t\t} else {\n\t\t\t// spread prop\n\t\t\tprops = {...props, ...(prop.value as any)};\n\t\t}\n\t}\n\n\treturn createElement(parsed.open.value, props, ...children);\n}\n\nfunction formatTagForError(tag: unknown): string {\n\treturn typeof tag === \"function\"\n\t\t? tag.name + \"()\"\n\t\t: typeof tag === \"string\"\n\t\t\t? `\"${tag}\"`\n\t\t\t: JSON.stringify(tag);\n}\n"],"names":["createElement"],"mappings":";;;;AAGA,MAAM,KAAK,GAAG,IAAI,GAAG,EAAuB;SAC5B,GAAG,CAClB,KAA2B,EAC3B,GAAG,WAA2B,EAAA;IAE9B,MAAM,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC;IACrC,IAAI,WAAW,GAAG,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC;AAChC,IAAA,IAAI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C,KAAK,GAAG,EAAE;AACrB,gCAAA,OAAO,MAAM,CAAC,aAAa,CAC1B,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAChC;;AAGF,4BAAA,OAAO,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AACzD,wBAAA,KAAK,GAAG;AACP,4BAAA,OAAO,IAAI;AACZ,wBAAA;AACC,4BAAA,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;;AAExB,iBAAC,CACD;;AAGH,YAAA,KAAM,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,KAAK;;aACnB;;YAEN,KAAK,GAAG,EAAC,GAAG,KAAK,EAAE,GAAI,IAAI,CAAC,KAAa,EAAC;;;AAI5C,IAAA,OAAOA,mBAAa,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,QAAQ,CAAC;AAC5D;AAEA,SAAS,iBAAiB,CAAC,GAAY,EAAA;IACtC,OAAO,OAAO,GAAG,KAAK;AACrB,UAAE,GAAG,CAAC,IAAI,GAAG;AACb,UAAE,OAAO,GAAG,KAAK;cACd,CAAI,CAAA,EAAA,GAAG,CAAG,CAAA;AACZ,cAAE,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC;AACxB;;;;;"}
|
|
1
|
+
{"version":3,"file":"jsx-tag.cjs","sources":["../src/jsx-tag.ts"],"sourcesContent":["import {createElement} from \"./crank.js\";\nimport type {Element} from \"./crank.js\";\n\nconst cache = new Map<string, ParseResult>();\nexport function jsx(\n\tspans: TemplateStringsArray,\n\t...expressions: Array<unknown>\n): Element {\n\tconst key = JSON.stringify(spans.raw);\n\tlet parseResult = cache.get(key);\n\tif (parseResult == null) {\n\t\tparseResult = parse(spans.raw);\n\t\tcache.set(key, parseResult);\n\t}\n\n\tconst {element, targets} = parseResult;\n\tfor (let i = 0; i < expressions.length; i++) {\n\t\tconst exp = expressions[i];\n\t\tconst target = targets[i];\n\t\tif (target) {\n\t\t\tif (target.type === \"error\") {\n\t\t\t\tthrow new SyntaxError(\n\t\t\t\t\ttarget.message.replace(\"${}\", formatTagForError(exp)),\n\t\t\t\t);\n\t\t\t}\n\n\t\t\ttarget.value = exp;\n\t\t}\n\t}\n\n\treturn build(element);\n}\n\n/** Alias for `jsx` template tag. */\nexport const html = jsx;\n\n// Type definitions for a bare-bones AST\ninterface ParseElement {\n\ttype: \"element\";\n\topen: ParseTag;\n\tclose: ParseTag | null;\n\t// ParseValue is used to represent spread props.\n\tprops: Array<ParseProp | ParseValue>;\n\tchildren: Array<ParseElement | ParseValue>;\n}\n\ninterface ParseValue {\n\ttype: \"value\";\n\tvalue: any;\n}\n\ninterface ParseTag {\n\ttype: \"tag\";\n\tslash: string;\n\tvalue: any;\n}\n\ninterface ParseProp {\n\ttype: \"prop\";\n\tname: string;\n\tvalue: ParseValue | ParsePropString;\n}\n\ninterface ParsePropString {\n\ttype: \"propString\";\n\tparts: Array<string | ParseValue>;\n}\n\ninterface ParseError {\n\ttype: \"error\";\n\tmessage: string;\n\tvalue: any;\n}\n\n// The parse result includes an array of targets, references to objects in the\n// parse tree whose `value` property is overwritten with expressions when the\n// template function is called. By separating the logic of parsing static\n// template spans from the handling of dynamic expressions, we can cache parse\n// results for successive calls.\ntype ExpressionTarget = ParseValue | ParseTag | ParseProp | ParseError;\n\ninterface ParseResult {\n\telement: ParseElement;\n\ttargets: Array<ExpressionTarget | null>;\n}\n\n/**\n * Matches first significant character in children mode.\n *\n * Group 1: newline\n * Group 2: comment\n * Group 3: tag\n * Group 4: closing slash\n * Group 5: tag name\n *\n * The comment group must appear first because the tag group can potentially\n * match a comment, so that we can handle tag expressions where we've reached\n * the end of a span.\n */\nconst CHILDREN_RE =\n\t/((?:\\r|\\n|\\r\\n)\\s*)|(<!--[\\S\\s]*?(?:-->|$))|(<\\s*(\\/{0,2})\\s*([-_$\\w]*))/g;\n\n/**\n * Matches props after element tags.\n *\n * Group 1: tag end\n * Group 2: spread props\n * Group 3: prop name\n * Group 4: equals\n * Group 5: prop value string\n */\nconst PROPS_RE =\n\t/\\s*(?:(\\/?\\s*>)|(\\.\\.\\.\\s*)|(?:([-_$\\w]+)\\s*(=)?\\s*(?:(\"(\\\\\"|[\\S\\s])*?(?:\"|$)|'(?:\\\\'|[\\S\\s])*?(?:'|$)))?))/g;\n\nconst CLOSING_BRACKET_RE = />/g;\n\nconst CLOSING_SINGLE_QUOTE_RE = /[^\\\\]?'/g;\n\nconst CLOSING_DOUBLE_QUOTE_RE = /[^\\\\]?\"/g;\n\nconst CLOSING_COMMENT_RE = /-->/g;\n\nfunction parse(spans: ArrayLike<string>): ParseResult {\n\tlet matcher = CHILDREN_RE;\n\tconst stack: Array<ParseElement> = [];\n\tlet element: ParseElement = {\n\t\ttype: \"element\",\n\t\topen: {type: \"tag\", slash: \"\", value: \"\"},\n\t\tclose: null,\n\t\tprops: [],\n\t\tchildren: [],\n\t};\n\n\tconst targets: Array<ExpressionTarget | null> = [];\n\tlet lineStart = true;\n\tfor (let s = 0; s < spans.length; s++) {\n\t\tconst span = spans[s];\n\t\t// Whether or not an expression is upcoming. Used to provide better errors.\n\t\tconst expressing = s < spans.length - 1;\n\t\tlet expressionTarget: ExpressionTarget | null = null;\n\t\tfor (let i = 0, end = i; i < span.length; i = end) {\n\t\t\tmatcher.lastIndex = i;\n\t\t\tconst match = matcher.exec(span);\n\t\t\tend = match ? match.index + match[0].length : span.length;\n\t\t\tswitch (matcher) {\n\t\t\t\tcase CHILDREN_RE: {\n\t\t\t\t\tif (match) {\n\t\t\t\t\t\tconst [, newline, comment, tag, closingSlash, tagName] = match;\n\t\t\t\t\t\tif (i < match.index) {\n\t\t\t\t\t\t\tlet before = span.slice(i, match.index);\n\t\t\t\t\t\t\tif (lineStart) {\n\t\t\t\t\t\t\t\tbefore = before.replace(/^\\s*/, \"\");\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (newline) {\n\t\t\t\t\t\t\t\tif (span[Math.max(0, match.index - 1)] === \"\\\\\") {\n\t\t\t\t\t\t\t\t\t// We preserve whitespace before escaped newlines and have to\n\t\t\t\t\t\t\t\t\t// remove the backslash.\n\t\t\t\t\t\t\t\t\t// jsx` \\\n\t\t\t\t\t\t\t\t\t// `\n\t\t\t\t\t\t\t\t\tbefore = before.slice(0, -1);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tbefore = before.replace(/\\s*$/, \"\");\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (before) {\n\t\t\t\t\t\t\t\telement.children.push({type: \"value\", value: before});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tlineStart = !!newline;\n\t\t\t\t\t\tif (comment) {\n\t\t\t\t\t\t\tif (end === span.length) {\n\t\t\t\t\t\t\t\t// Expression in a comment:\n\t\t\t\t\t\t\t\t// jsx`<!-- ${exp} -->`\n\t\t\t\t\t\t\t\tmatcher = CLOSING_COMMENT_RE;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if (tag) {\n\t\t\t\t\t\t\tif (closingSlash) {\n\t\t\t\t\t\t\t\telement.close = {\n\t\t\t\t\t\t\t\t\ttype: \"tag\",\n\t\t\t\t\t\t\t\t\tslash: closingSlash,\n\t\t\t\t\t\t\t\t\tvalue: tagName,\n\t\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\t\tif (!stack.length) {\n\t\t\t\t\t\t\t\t\tif (end !== span.length) {\n\t\t\t\t\t\t\t\t\t\tthrow new SyntaxError(`Unmatched closing tag \"${tagName}\"`);\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t// ERROR EXPRESSION\n\t\t\t\t\t\t\t\t\texpressionTarget = {\n\t\t\t\t\t\t\t\t\t\ttype: \"error\",\n\t\t\t\t\t\t\t\t\t\tmessage: \"Unmatched closing tag ${}\",\n\t\t\t\t\t\t\t\t\t\tvalue: null,\n\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tif (end === span.length) {\n\t\t\t\t\t\t\t\t\t\t// TAG EXPRESSION\n\t\t\t\t\t\t\t\t\t\texpressionTarget = element.close;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\telement = stack.pop()!;\n\t\t\t\t\t\t\t\t\tmatcher = CLOSING_BRACKET_RE;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tconst next: ParseElement = {\n\t\t\t\t\t\t\t\t\ttype: \"element\",\n\t\t\t\t\t\t\t\t\topen: {\n\t\t\t\t\t\t\t\t\t\ttype: \"tag\",\n\t\t\t\t\t\t\t\t\t\tslash: \"\",\n\t\t\t\t\t\t\t\t\t\tvalue: tagName,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tclose: null,\n\t\t\t\t\t\t\t\t\tprops: [],\n\t\t\t\t\t\t\t\t\tchildren: [],\n\t\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\t\telement.children.push(next);\n\t\t\t\t\t\t\t\tstack.push(element);\n\t\t\t\t\t\t\t\telement = next;\n\t\t\t\t\t\t\t\tmatcher = PROPS_RE;\n\t\t\t\t\t\t\t\tif (end === span.length) {\n\t\t\t\t\t\t\t\t\t// TAG EXPRESSION\n\t\t\t\t\t\t\t\t\texpressionTarget = element.open;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (i < span.length) {\n\t\t\t\t\t\t\tlet after = span.slice(i);\n\t\t\t\t\t\t\tif (!expressing) {\n\t\t\t\t\t\t\t\t// trim trailing whitespace\n\t\t\t\t\t\t\t\tafter = after.replace(/\\s*$/, \"\");\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (after) {\n\t\t\t\t\t\t\t\telement.children.push({type: \"value\", value: after});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase PROPS_RE: {\n\t\t\t\t\tif (match) {\n\t\t\t\t\t\tconst [, tagEnd, spread, name, equals, string] = match;\n\t\t\t\t\t\tif (i < match.index) {\n\t\t\t\t\t\t\tthrow new SyntaxError(\n\t\t\t\t\t\t\t\t`Unexpected text \\`${span.slice(i, match.index).trim()}\\``,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (tagEnd) {\n\t\t\t\t\t\t\tif (tagEnd[0] === \"/\") {\n\t\t\t\t\t\t\t\t// This is a self-closing element, so there will always be a\n\t\t\t\t\t\t\t\t// result on the stack.\n\t\t\t\t\t\t\t\telement = stack.pop()!;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tmatcher = CHILDREN_RE;\n\t\t\t\t\t\t} else if (spread) {\n\t\t\t\t\t\t\tconst value = {\n\t\t\t\t\t\t\t\ttype: \"value\" as const,\n\t\t\t\t\t\t\t\tvalue: null,\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\telement.props.push(value);\n\t\t\t\t\t\t\t// SPREAD PROP EXPRESSION\n\t\t\t\t\t\t\texpressionTarget = value;\n\t\t\t\t\t\t\tif (!(expressing && end === span.length)) {\n\t\t\t\t\t\t\t\tthrow new SyntaxError('Expression expected after \"...\"');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if (name) {\n\t\t\t\t\t\t\tlet value: ParseValue | ParsePropString;\n\t\t\t\t\t\t\tif (string == null) {\n\t\t\t\t\t\t\t\tif (!equals) {\n\t\t\t\t\t\t\t\t\tvalue = {type: \"value\", value: true};\n\t\t\t\t\t\t\t\t} else if (end < span.length) {\n\t\t\t\t\t\t\t\t\tthrow new SyntaxError(\n\t\t\t\t\t\t\t\t\t\t`Unexpected text \\`${span.slice(end, end + 20)}\\``,\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tvalue = {type: \"value\" as const, value: null};\n\t\t\t\t\t\t\t\t\t// PROP EXPRESSION\n\t\t\t\t\t\t\t\t\texpressionTarget = value;\n\t\t\t\t\t\t\t\t\tif (!(expressing && end === span.length)) {\n\t\t\t\t\t\t\t\t\t\tthrow new SyntaxError(\n\t\t\t\t\t\t\t\t\t\t\t`Expression expected for prop \"${name}\"`,\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tconst quote = string[0];\n\t\t\t\t\t\t\t\tvalue = {type: \"propString\", parts: []};\n\t\t\t\t\t\t\t\tvalue.parts.push(string);\n\t\t\t\t\t\t\t\tif (end === span.length) {\n\t\t\t\t\t\t\t\t\tmatcher =\n\t\t\t\t\t\t\t\t\t\tquote === \"'\"\n\t\t\t\t\t\t\t\t\t\t\t? CLOSING_SINGLE_QUOTE_RE\n\t\t\t\t\t\t\t\t\t\t\t: CLOSING_DOUBLE_QUOTE_RE;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tconst prop = {\n\t\t\t\t\t\t\t\ttype: \"prop\" as const,\n\t\t\t\t\t\t\t\tname,\n\t\t\t\t\t\t\t\tvalue,\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\telement.props.push(prop);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (!expressing) {\n\t\t\t\t\t\t\tif (i === span.length) {\n\t\t\t\t\t\t\t\tthrow new SyntaxError(\n\t\t\t\t\t\t\t\t\t`Expected props but reached end of document`,\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tthrow new SyntaxError(\n\t\t\t\t\t\t\t\t\t`Unexpected text \\`${span.slice(i, i + 20).trim()}\\``,\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Unexpected expression errors are handled in the outer loop.\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// This would most likely be the starting point for the logic of\n\t\t\t\t\t\t// prop name expressions.\n\t\t\t\t\t\t// jsx`<p ${name}=${value}>`\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase CLOSING_BRACKET_RE: {\n\t\t\t\t\t// We're in a closing tag and looking for the >.\n\t\t\t\t\tif (match) {\n\t\t\t\t\t\tif (i < match.index) {\n\t\t\t\t\t\t\tthrow new SyntaxError(\n\t\t\t\t\t\t\t\t`Unexpected text \\`${span.slice(i, match.index).trim()}\\``,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tmatcher = CHILDREN_RE;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (!expressing) {\n\t\t\t\t\t\t\tthrow new SyntaxError(\n\t\t\t\t\t\t\t\t`Unexpected text \\`${span.slice(i, i + 20).trim()}\\``,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase CLOSING_SINGLE_QUOTE_RE:\n\t\t\t\tcase CLOSING_DOUBLE_QUOTE_RE: {\n\t\t\t\t\tconst string = span.slice(i, end);\n\t\t\t\t\tconst prop = element.props[element.props.length - 1] as ParseProp;\n\t\t\t\t\tconst propString = prop.value as ParsePropString;\n\t\t\t\t\tpropString.parts.push(string);\n\t\t\t\t\tif (match) {\n\t\t\t\t\t\tmatcher = PROPS_RE;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (!expressing) {\n\t\t\t\t\t\t\tthrow new SyntaxError(\n\t\t\t\t\t\t\t\t`Missing \\`${\n\t\t\t\t\t\t\t\t\tmatcher === CLOSING_SINGLE_QUOTE_RE ? \"'\" : '\"'\n\t\t\t\t\t\t\t\t}\\``,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase CLOSING_COMMENT_RE: {\n\t\t\t\t\tif (match) {\n\t\t\t\t\t\tmatcher = CHILDREN_RE;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (!expressing) {\n\t\t\t\t\t\t\tthrow new SyntaxError(\n\t\t\t\t\t\t\t\t\"Expected `-->` but reached end of template\",\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (expressing) {\n\t\t\tif (expressionTarget) {\n\t\t\t\ttargets.push(expressionTarget);\n\t\t\t\tif (expressionTarget.type === \"error\") {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tswitch (matcher) {\n\t\t\t\tcase CHILDREN_RE: {\n\t\t\t\t\tconst target = {type: \"value\" as const, value: null};\n\t\t\t\t\telement.children.push(target);\n\t\t\t\t\ttargets.push(target);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase CLOSING_SINGLE_QUOTE_RE:\n\t\t\t\tcase CLOSING_DOUBLE_QUOTE_RE: {\n\t\t\t\t\tconst prop = element.props[element.props.length - 1] as ParseProp;\n\t\t\t\t\tconst target = {type: \"value\" as const, value: null};\n\t\t\t\t\t(prop.value as ParsePropString).parts.push(target);\n\t\t\t\t\ttargets.push(target);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase CLOSING_COMMENT_RE:\n\t\t\t\t\ttargets.push(null);\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new SyntaxError(\"Unexpected expression\");\n\t\t\t}\n\t\t} else if (expressionTarget) {\n\t\t\tthrow new SyntaxError(\"Expression expected\");\n\t\t}\n\n\t\tlineStart = false;\n\t}\n\n\tif (stack.length) {\n\t\tconst ti = targets.indexOf(element.open);\n\t\tif (ti === -1) {\n\t\t\tthrow new SyntaxError(`Unmatched opening tag \"${element.open.value}\"`);\n\t\t}\n\n\t\ttargets[ti] = {\n\t\t\ttype: \"error\",\n\t\t\tmessage: \"Unmatched opening tag ${}\",\n\t\t\tvalue: null,\n\t\t};\n\t}\n\n\tif (element.children.length === 1 && element.children[0].type === \"element\") {\n\t\telement = element.children[0];\n\t}\n\n\treturn {element, targets};\n}\n\nfunction build(parsed: ParseElement): Element {\n\tif (\n\t\tparsed.close !== null &&\n\t\tparsed.close.slash !== \"//\" &&\n\t\tparsed.open.value !== parsed.close.value\n\t) {\n\t\tthrow new SyntaxError(\n\t\t\t`Unmatched closing tag ${formatTagForError(\n\t\t\t\tparsed.close.value,\n\t\t\t)}, expected ${formatTagForError(parsed.open.value)}`,\n\t\t);\n\t}\n\n\tconst children: Array<unknown> = [];\n\tfor (let i = 0; i < parsed.children.length; i++) {\n\t\tconst child = parsed.children[i];\n\t\tchildren.push(child.type === \"element\" ? build(child) : child.value);\n\t}\n\n\tlet props = parsed.props.length ? ({} as Record<string, unknown>) : null;\n\tfor (let i = 0; i < parsed.props.length; i++) {\n\t\tconst prop = parsed.props[i];\n\t\tif (prop.type === \"prop\") {\n\t\t\tlet value: any;\n\t\t\tif (prop.value.type === \"value\") {\n\t\t\t\tvalue = prop.value.value;\n\t\t\t} else {\n\t\t\t\tlet string = \"\";\n\t\t\t\tfor (let i = 0; i < prop.value.parts.length; i++) {\n\t\t\t\t\tconst part = prop.value.parts[i];\n\t\t\t\t\tif (typeof part === \"string\") {\n\t\t\t\t\t\tstring += part;\n\t\t\t\t\t} else if (typeof part.value !== \"boolean\" && part.value != null) {\n\t\t\t\t\t\tstring +=\n\t\t\t\t\t\t\ttypeof part.value === \"string\" ? part.value : String(part.value);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tvalue = string\n\t\t\t\t\t// remove quotes\n\t\t\t\t\t.slice(1, -1)\n\t\t\t\t\t// unescape things\n\t\t\t\t\t// adapted from https://stackoverflow.com/a/57330383/1825413\n\t\t\t\t\t.replace(\n\t\t\t\t\t\t/\\\\x[0-9a-f]{2}|\\\\u[0-9a-f]{4}|\\\\u\\{[0-9a-f]+\\}|\\\\./gi,\n\t\t\t\t\t\t(match) => {\n\t\t\t\t\t\t\tswitch (match[1]) {\n\t\t\t\t\t\t\t\tcase \"b\":\n\t\t\t\t\t\t\t\t\treturn \"\\b\";\n\t\t\t\t\t\t\t\tcase \"f\":\n\t\t\t\t\t\t\t\t\treturn \"\\f\";\n\t\t\t\t\t\t\t\tcase \"n\":\n\t\t\t\t\t\t\t\t\treturn \"\\n\";\n\t\t\t\t\t\t\t\tcase \"r\":\n\t\t\t\t\t\t\t\t\treturn \"\\r\";\n\t\t\t\t\t\t\t\tcase \"t\":\n\t\t\t\t\t\t\t\t\treturn \"\\t\";\n\t\t\t\t\t\t\t\tcase \"v\":\n\t\t\t\t\t\t\t\t\treturn \"\\v\";\n\t\t\t\t\t\t\t\tcase \"x\":\n\t\t\t\t\t\t\t\t\treturn String.fromCharCode(parseInt(match.slice(2), 16));\n\t\t\t\t\t\t\t\tcase \"u\":\n\t\t\t\t\t\t\t\t\tif (match[2] === \"{\") {\n\t\t\t\t\t\t\t\t\t\treturn String.fromCodePoint(\n\t\t\t\t\t\t\t\t\t\t\tparseInt(match.slice(3, -1), 16),\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\treturn String.fromCharCode(parseInt(match.slice(2), 16));\n\t\t\t\t\t\t\t\tcase \"0\":\n\t\t\t\t\t\t\t\t\treturn \"\\0\";\n\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\treturn match.slice(1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t);\n\t\t\t}\n\n\t\t\tprops![prop.name] = value;\n\t\t} else {\n\t\t\t// spread prop\n\t\t\tprops = {...props, ...(prop.value as any)};\n\t\t}\n\t}\n\n\treturn createElement(parsed.open.value, props, ...children);\n}\n\nfunction formatTagForError(tag: unknown): string {\n\treturn typeof tag === \"function\"\n\t\t? tag.name + \"()\"\n\t\t: typeof tag === \"string\"\n\t\t\t? `\"${tag}\"`\n\t\t\t: JSON.stringify(tag);\n}\n"],"names":["createElement"],"mappings":";;;;AAGA,MAAM,KAAK,GAAG,IAAI,GAAG,EAAuB;SAC5B,GAAG,CAClB,KAA2B,EAC3B,GAAG,WAA2B,EAAA;IAE9B,MAAM,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC;IACrC,IAAI,WAAW,GAAG,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC;AAChC,IAAA,IAAI,WAAW,IAAI,IAAI,EAAE;AACxB,QAAA,WAAW,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC;AAC9B,QAAA,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,WAAW,CAAC;;AAG5B,IAAA,MAAM,EAAC,OAAO,EAAE,OAAO,EAAC,GAAG,WAAW;AACtC,IAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,WAAW,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AAC5C,QAAA,MAAM,GAAG,GAAG,WAAW,CAAC,CAAC,CAAC;AAC1B,QAAA,MAAM,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC;QACzB,IAAI,MAAM,EAAE;AACX,YAAA,IAAI,MAAM,CAAC,IAAI,KAAK,OAAO,EAAE;AAC5B,gBAAA,MAAM,IAAI,WAAW,CACpB,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,iBAAiB,CAAC,GAAG,CAAC,CAAC,CACrD;;AAGF,YAAA,MAAM,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CAAC;AAC5D;AAEA,SAAS,iBAAiB,CAAC,GAAY,EAAA;IACtC,OAAO,OAAO,GAAG,KAAK;AACrB,UAAE,GAAG,CAAC,IAAI,GAAG;AACb,UAAE,OAAO,GAAG,KAAK;cACd,CAAI,CAAA,EAAA,GAAG,CAAG,CAAA;AACZ,cAAE,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC;AACxB;;;;;"}
|
package/jsx-tag.js
CHANGED
|
@@ -34,7 +34,7 @@ const html = jsx;
|
|
|
34
34
|
* Group 5: tag name
|
|
35
35
|
*
|
|
36
36
|
* The comment group must appear first because the tag group can potentially
|
|
37
|
-
* match a comment, so that we can handle tag expressions where we
|
|
37
|
+
* match a comment, so that we can handle tag expressions where we've reached
|
|
38
38
|
* the end of a span.
|
|
39
39
|
*/
|
|
40
40
|
const CHILDREN_RE = /((?:\r|\n|\r\n)\s*)|(<!--[\S\s]*?(?:-->|$))|(<\s*(\/{0,2})\s*([-_$\w]*))/g;
|
|
@@ -251,7 +251,7 @@ function parse(spans) {
|
|
|
251
251
|
break;
|
|
252
252
|
}
|
|
253
253
|
case CLOSING_BRACKET_RE: {
|
|
254
|
-
// We
|
|
254
|
+
// We're in a closing tag and looking for the >.
|
|
255
255
|
if (match) {
|
|
256
256
|
if (i < match.index) {
|
|
257
257
|
throw new SyntaxError(`Unexpected text \`${span.slice(i, match.index).trim()}\``);
|