@yannosay/sinth 1.11.4 → 1.12.0
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/bin/sinth.js +1 -4
- package/dist/browser/compile.js +62 -0
- package/dist/cli.js +469 -0
- package/dist/core/builtins.js +117 -0
- package/dist/core/cli-compiler.js +553 -0
- package/dist/core/compiler.js +1344 -0
- package/dist/core/expr.js +122 -0
- package/dist/core/head-builder.js +130 -0
- package/dist/core/lexer.js +414 -0
- package/dist/core/parser.js +1672 -0
- package/dist/core/runtime/custom-element.js +81 -0
- package/dist/core/runtime/functions.js +99 -0
- package/{src/core/runtime/helpers.ts → dist/core/runtime/helpers.js} +32 -35
- package/{src/core/runtime/render.ts → dist/core/runtime/render.js} +48 -63
- package/dist/core/style-processor.js +318 -0
- package/dist/core/types.js +93 -0
- package/dist/resolver.js +175 -0
- package/dist/server.js +168 -0
- package/dist/update-check.js +101 -0
- package/dist/utils.js +73 -0
- package/package.json +12 -8
- package/src/browser/compile.ts +0 -72
- package/src/cli.ts +0 -339
- package/src/core/builtins.ts +0 -117
- package/src/core/cli-compiler.ts +0 -481
- package/src/core/compiler.ts +0 -1293
- package/src/core/expr.ts +0 -94
- package/src/core/head-builder.ts +0 -86
- package/src/core/lexer.ts +0 -276
- package/src/core/parser.ts +0 -1524
- package/src/core/runtime/custom-element.ts +0 -135
- package/src/core/runtime/functions.ts +0 -47
- package/src/core/style-processor.ts +0 -299
- package/src/core/types.ts +0 -197
- package/src/resolver.ts +0 -150
- package/src/server.ts +0 -129
- package/src/utils.ts +0 -77
- package/tsconfig.json +0 -27
package/src/cli.ts
DELETED
|
@@ -1,339 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import * as fs from "fs";
|
|
3
|
-
import * as path from "path";
|
|
4
|
-
import { SinthWarning } from "./core/types.ts";
|
|
5
|
-
import { compileFile, CompileOptions, findSinthPages, copyDir } from "./core/cli-compiler.ts";
|
|
6
|
-
import { startDevServer } from "./server.ts";
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
function loadConfig(root: string): Record<string, unknown> {
|
|
11
|
-
const cfgPath = path.join(root, "sinth.config.json");
|
|
12
|
-
if (fs.existsSync(cfgPath)) {
|
|
13
|
-
try { return JSON.parse(fs.readFileSync(cfgPath, "utf-8")) as Record<string, unknown>; }
|
|
14
|
-
catch { SinthWarning.emit("Could not parse sinth.config.json"); }
|
|
15
|
-
}
|
|
16
|
-
return {};
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
async function main(): Promise<void> {
|
|
20
|
-
const [,, command, ...args] = process.argv;
|
|
21
|
-
const cwd = process.cwd();
|
|
22
|
-
const cfg = loadConfig(cwd);
|
|
23
|
-
|
|
24
|
-
const outDirIdx = args.indexOf("--out");
|
|
25
|
-
const outDir = outDirIdx !== -1 ? args[outDirIdx + 1] : (cfg.outDir as string | undefined) ?? path.join(cwd, "dist");
|
|
26
|
-
const portIdx = args.indexOf("--port");
|
|
27
|
-
const port = portIdx !== -1 ? parseInt(args[portIdx + 1], 10) : (cfg.port as number | undefined) ?? 3000;
|
|
28
|
-
const minify = args.includes("--prod") || Boolean(cfg.minify);
|
|
29
|
-
const sharedRuntime = args.includes("--shared-runtime") || Boolean(cfg.sharedRuntime);
|
|
30
|
-
const libraryPaths = (cfg.libraryPaths as string[] | undefined) ?? [path.join(cwd, "libraries")];
|
|
31
|
-
|
|
32
|
-
const flagValues = new Set<string>();
|
|
33
|
-
if (outDirIdx !== -1) flagValues.add(args[outDirIdx + 1]);
|
|
34
|
-
if (portIdx !== -1) flagValues.add(args[portIdx + 1]);
|
|
35
|
-
const cleanArgs = args.filter(a => !a.startsWith("--") && !flagValues.has(a));
|
|
36
|
-
|
|
37
|
-
const opts: CompileOptions = { projectRoot: cwd, outDir, libraryPaths, minify, checkOnly: false, sharedRuntime };
|
|
38
|
-
|
|
39
|
-
switch (command) {
|
|
40
|
-
case "build": {
|
|
41
|
-
const nonSinth = cleanArgs.filter(a => !a.endsWith(".sinth"));
|
|
42
|
-
if (nonSinth.length > 0) process.stdout.write(`\x1b[33mSkipping non-.sinth files:\x1b[0m ${nonSinth.join(", ")}\n`);
|
|
43
|
-
|
|
44
|
-
const fileArgs = cleanArgs.filter(a => a.endsWith(".sinth"));
|
|
45
|
-
const pages = fileArgs.length > 0
|
|
46
|
-
? fileArgs.map(f => path.resolve(cwd, f)).filter(f => fs.existsSync(f))
|
|
47
|
-
: findSinthPages(cwd, outDir);
|
|
48
|
-
|
|
49
|
-
if (pages.length === 0) { process.stdout.write("No .sinth files found.\n"); process.exit(0); }
|
|
50
|
-
|
|
51
|
-
let hadError = false, built = 0;
|
|
52
|
-
|
|
53
|
-
const sharedRuntimes: string[] = [];
|
|
54
|
-
for (const p of pages) {
|
|
55
|
-
try {
|
|
56
|
-
const result = compileFile(p, opts);
|
|
57
|
-
if (!result) continue;
|
|
58
|
-
const html = result.html;
|
|
59
|
-
if (result.shared) {
|
|
60
|
-
sharedRuntimes.push(result.shared);
|
|
61
|
-
}
|
|
62
|
-
const rel = path.relative(cwd, p).replace(/\.sinth$/, ".html");
|
|
63
|
-
const out = path.join(outDir, rel);
|
|
64
|
-
fs.mkdirSync(path.dirname(out), { recursive: true });
|
|
65
|
-
fs.writeFileSync(out, html);
|
|
66
|
-
process.stdout.write(` \x1b[32m✓\x1b[0m ${rel}\n`);
|
|
67
|
-
built++;
|
|
68
|
-
} catch (e: unknown) {
|
|
69
|
-
process.stderr.write(` \x1b[31m✗\x1b[0m ${path.relative(cwd, p)}\n${(e as Error).message}\n`);
|
|
70
|
-
hadError = true;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
if (sharedRuntimes.length > 0) {
|
|
75
|
-
const combined = sharedRuntimes.join("\n");
|
|
76
|
-
fs.writeFileSync(path.join(outDir, "sinth-runtime.js"), combined);
|
|
77
|
-
process.stdout.write(` \x1b[32m✓\x1b[0m sinth-runtime.js (shared)\n`);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
// copies to output
|
|
81
|
-
const assetsIn = path.join(cwd, "assets"), assetsOut = path.join(outDir, "assets");
|
|
82
|
-
if (fs.existsSync(assetsIn)) {
|
|
83
|
-
copyDir(assetsIn, assetsOut);
|
|
84
|
-
process.stdout.write(` \x1b[32m✓\x1b[0m assets/ → ${path.relative(cwd, assetsOut)}/\n`);
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
const libIn = path.join(cwd, "libraries"), libOut = path.join(outDir, "libraries");
|
|
88
|
-
if (fs.existsSync(libIn)) {
|
|
89
|
-
copyDir(libIn, libOut);
|
|
90
|
-
const libFiles = fs.readdirSync(libOut, { recursive: true }) as string[];
|
|
91
|
-
for (const f of libFiles) {
|
|
92
|
-
if (f.endsWith(".sinth") || f.endsWith(".html")) {
|
|
93
|
-
try { fs.unlinkSync(path.join(libOut, f)); } catch {}
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
process.stdout.write(` \x1b[32m✓\x1b[0m libraries/ → ${path.relative(cwd, libOut)}/\n`);
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
process.stdout.write(`\n\x1b[1mBuilt ${built} page(s)\x1b[0m${hadError ? " with errors" : ""}\n`);
|
|
100
|
-
process.exit(hadError ? 1 : 0);
|
|
101
|
-
break;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
case "dev": {
|
|
105
|
-
const fileArgs = cleanArgs.filter(a => a.endsWith(".sinth"));
|
|
106
|
-
const files = fileArgs.length > 0
|
|
107
|
-
? fileArgs.map(f => path.resolve(cwd, f)).filter(f => fs.existsSync(f))
|
|
108
|
-
: undefined;
|
|
109
|
-
await startDevServer({ ...opts, port, files });
|
|
110
|
-
break;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
case "check": {
|
|
114
|
-
opts.checkOnly = true;
|
|
115
|
-
const pages = findSinthPages(cwd, outDir);
|
|
116
|
-
let hadError = false;
|
|
117
|
-
for (const p of pages) {
|
|
118
|
-
try {
|
|
119
|
-
compileFile(p, opts);
|
|
120
|
-
process.stdout.write(` \x1b[32m✓\x1b[0m ${path.relative(cwd, p)}\n`);
|
|
121
|
-
} catch (e: unknown) {
|
|
122
|
-
process.stderr.write(` \x1b[31m✗\x1b[0m ${path.relative(cwd, p)}\n${(e as Error).message}\n`);
|
|
123
|
-
hadError = true;
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
process.exit(hadError ? 1 : 0);
|
|
127
|
-
break;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
case "version":
|
|
131
|
-
case "--version":
|
|
132
|
-
case "-v": {
|
|
133
|
-
const pkgPath = path.join(__dirname, "..", "package.json");
|
|
134
|
-
if (fs.existsSync(pkgPath)) {
|
|
135
|
-
const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf-8"));
|
|
136
|
-
process.stdout.write(`Sinth Compiler v${pkg.version}\n`);
|
|
137
|
-
} else {
|
|
138
|
-
process.stdout.write("Sinth Compiler v1.0.0\n");
|
|
139
|
-
}
|
|
140
|
-
break;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
case "init": {
|
|
144
|
-
const projectName = cleanArgs[0] || "my-sinth-project";
|
|
145
|
-
scaffoldProject(path.resolve(cwd, projectName));
|
|
146
|
-
break;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
default: {
|
|
150
|
-
let version = "1.0.0";
|
|
151
|
-
const paths = [
|
|
152
|
-
path.resolve(__dirname, "..", "package.json"),
|
|
153
|
-
path.resolve(__dirname, "package.json"),
|
|
154
|
-
path.resolve(process.cwd(), "package.json"),
|
|
155
|
-
path.resolve(process.cwd(), "..", "package.json"),
|
|
156
|
-
];
|
|
157
|
-
for (const p of paths) {
|
|
158
|
-
if (fs.existsSync(p)) {
|
|
159
|
-
try {
|
|
160
|
-
const pkg = JSON.parse(fs.readFileSync(p, "utf-8"));
|
|
161
|
-
version = pkg.version;
|
|
162
|
-
break;
|
|
163
|
-
} catch {}
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
process.stdout.write(`
|
|
167
|
-
\x1b[1mSinth Compiler v${version}\x1b[0m
|
|
168
|
-
|
|
169
|
-
\x1b[1mCommands:\x1b[0m
|
|
170
|
-
sinth build [files] [--out ./dist] [--prod] [--shared-runtime] Compile .sinth pages
|
|
171
|
-
sinth dev [files] [--port 3000] Live-reload dev server
|
|
172
|
-
sinth check Lint without emitting
|
|
173
|
-
sinth init [name] Scaffold a new project
|
|
174
|
-
sinth version Print version
|
|
175
|
-
`);
|
|
176
|
-
break;
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
// project scaffholding
|
|
182
|
-
|
|
183
|
-
function scaffoldProject(root: string): void {
|
|
184
|
-
for (const d of ["pages", "components", "styles", "libraries", "assets"]) {
|
|
185
|
-
fs.mkdirSync(path.join(root, d), { recursive: true });
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
fs.writeFileSync(path.join(root, "pages", "index.sinth"), `-- My Sinth Site
|
|
189
|
-
page
|
|
190
|
-
|
|
191
|
-
import "../components/Navbar.sinth"
|
|
192
|
-
import css "../styles/reset.css"
|
|
193
|
-
|
|
194
|
-
title = "My Site"
|
|
195
|
-
fav = "assets/favicon.ico"
|
|
196
|
-
descr = "Built with Sinth v1.0.0."
|
|
197
|
-
|
|
198
|
-
var int score = 0
|
|
199
|
-
var str message = "Click to begin"
|
|
200
|
-
|
|
201
|
-
Navbar
|
|
202
|
-
|
|
203
|
-
Hero {
|
|
204
|
-
Heading(level: 1) { "Welcome to Sinth" }
|
|
205
|
-
Paragraph { "A declarative, component-based web UI language." }
|
|
206
|
-
Button(onClick: "handleClick") { "Get Started" }
|
|
207
|
-
Paragraph(id: "score-display") { message }
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
Main {
|
|
211
|
-
Section {
|
|
212
|
-
Heading(level: 2) { "Features" }
|
|
213
|
-
CardGrid {
|
|
214
|
-
-- Add Card components here
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
style {
|
|
220
|
-
section.hero {
|
|
221
|
-
padding: "4rem 2rem"
|
|
222
|
-
textAlign: "center"
|
|
223
|
-
backgroundColor: "#f0f4ff"
|
|
224
|
-
}
|
|
225
|
-
main {
|
|
226
|
-
maxWidth: "1100px"
|
|
227
|
-
margin: "0 auto"
|
|
228
|
-
padding: "2rem"
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
script {
|
|
233
|
-
function handleClick() {
|
|
234
|
-
score += 1
|
|
235
|
-
message = "Score: " + score
|
|
236
|
-
sinthRender()
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
`);
|
|
240
|
-
|
|
241
|
-
fs.writeFileSync(path.join(root, "components", "Navbar.sinth"), `-- Navbar component
|
|
242
|
-
|
|
243
|
-
component Navbar {
|
|
244
|
-
Header {
|
|
245
|
-
Nav {
|
|
246
|
-
Link(href: "/", class: "logo") { "MySite" }
|
|
247
|
-
Div(class: "nav-links") {
|
|
248
|
-
NavLink(href: "/") { "Home" }
|
|
249
|
-
NavLink(href: "/about") { "About" }
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
style {
|
|
255
|
-
header {
|
|
256
|
-
display: "flex"
|
|
257
|
-
alignItems: "center"
|
|
258
|
-
padding: "1rem 2rem"
|
|
259
|
-
backgroundColor: "#1a1a2e"
|
|
260
|
-
color: "white"
|
|
261
|
-
}
|
|
262
|
-
.logo {
|
|
263
|
-
fontSize: "1.5rem"
|
|
264
|
-
fontWeight: "700"
|
|
265
|
-
color: "white"
|
|
266
|
-
textDecoration: "none"
|
|
267
|
-
}
|
|
268
|
-
.nav-links {
|
|
269
|
-
marginLeft: "auto"
|
|
270
|
-
display: "flex"
|
|
271
|
-
gap: "1.5rem"
|
|
272
|
-
}
|
|
273
|
-
.nav-links a {
|
|
274
|
-
color: "rgba(255,255,255,0.8)"
|
|
275
|
-
textDecoration: "none"
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
}
|
|
279
|
-
`);
|
|
280
|
-
|
|
281
|
-
fs.writeFileSync(path.join(root, "components", "Card.sinth"), `-- Card component
|
|
282
|
-
|
|
283
|
-
component Card(title, color = "blue") {
|
|
284
|
-
Div(class: "card") {
|
|
285
|
-
Heading(level: 3) { "$title" }
|
|
286
|
-
Div(class: "card-body") { "$slot" }
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
style {
|
|
290
|
-
.card {
|
|
291
|
-
backgroundColor: "#f7f7f7"
|
|
292
|
-
borderRadius: "1rem"
|
|
293
|
-
padding: "1.5rem"
|
|
294
|
-
marginBottom: "1rem"
|
|
295
|
-
}
|
|
296
|
-
.card:hover {
|
|
297
|
-
boxShadow: "0 4px 16px rgba(0,0,0,0.1)"
|
|
298
|
-
}
|
|
299
|
-
.card-body {
|
|
300
|
-
marginTop: "0.75rem"
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
`);
|
|
305
|
-
|
|
306
|
-
fs.writeFileSync(path.join(root, "styles", "reset.css"),
|
|
307
|
-
`*, *::before, *::after { box-sizing: border-box; }\nbody { margin: 0; font-family: system-ui, sans-serif; line-height: 1.6; }\nimg { max-width: 100%; display: block; }\n`
|
|
308
|
-
);
|
|
309
|
-
|
|
310
|
-
fs.writeFileSync(path.join(root, "sinth.config.json"),
|
|
311
|
-
JSON.stringify({ outDir: "./dist", libraryPaths: ["./libraries"], minify: false }, null, 2)
|
|
312
|
-
);
|
|
313
|
-
|
|
314
|
-
fs.writeFileSync(path.join(root, ".gitignore"), "dist/\nnode_modules/\n");
|
|
315
|
-
|
|
316
|
-
fs.writeFileSync(path.join(root, "package.json"), JSON.stringify({
|
|
317
|
-
name: path.basename(root).toLowerCase().replace(/\s+/g, "-"),
|
|
318
|
-
version: "1.0.0",
|
|
319
|
-
scripts: { build: "sinth build", dev: "sinth dev" },
|
|
320
|
-
dependencies: { "ts-node": "^10.0.0", "sass": "^1.70.0" },
|
|
321
|
-
}, null, 2));
|
|
322
|
-
|
|
323
|
-
process.stdout.write(`
|
|
324
|
-
\x1b[32m✓ Sinth project scaffolded at ${path.basename(root)}/\x1b[0m
|
|
325
|
-
|
|
326
|
-
\x1b[1mNext steps:\x1b[0m
|
|
327
|
-
cd ${path.basename(root)}
|
|
328
|
-
sinth dev
|
|
329
|
-
sinth build
|
|
330
|
-
`);
|
|
331
|
-
}
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
main().catch(e => {
|
|
337
|
-
process.stderr.write(`\x1b[31m${(e as Error).message}\x1b[0m\n`);
|
|
338
|
-
process.exit(1);
|
|
339
|
-
});
|
package/src/core/builtins.ts
DELETED
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
export interface BuiltinInfo { tag: string; defaultClass?: string; voidEl?: boolean }
|
|
2
|
-
|
|
3
|
-
export const BUILTIN_MAP: Record<string, BuiltinInfo> = {
|
|
4
|
-
// structural
|
|
5
|
-
Main: { tag: "main" },
|
|
6
|
-
Header: { tag: "header" },
|
|
7
|
-
Footer: { tag: "footer" },
|
|
8
|
-
Nav: { tag: "nav" },
|
|
9
|
-
Section: { tag: "section" },
|
|
10
|
-
Article: { tag: "article" },
|
|
11
|
-
Aside: { tag: "aside" },
|
|
12
|
-
Div: { tag: "div" },
|
|
13
|
-
Span: { tag: "span" },
|
|
14
|
-
Hero: { tag: "section", defaultClass: "hero" },
|
|
15
|
-
Container: { tag: "div", defaultClass: "container" },
|
|
16
|
-
Grid: { tag: "div", defaultClass: "grid" },
|
|
17
|
-
Flex: { tag: "div", defaultClass: "flex" },
|
|
18
|
-
Stack: { tag: "div", defaultClass: "stack" },
|
|
19
|
-
Row: { tag: "div", defaultClass: "row" },
|
|
20
|
-
Column: { tag: "div", defaultClass: "col" },
|
|
21
|
-
CardGrid: { tag: "div", defaultClass: "card-grid" },
|
|
22
|
-
// typography
|
|
23
|
-
Heading: { tag: "h1" },
|
|
24
|
-
SubHeading: { tag: "p", defaultClass: "subheading" },
|
|
25
|
-
Paragraph: { tag: "p" },
|
|
26
|
-
Lead: { tag: "p", defaultClass: "lead" },
|
|
27
|
-
Small: { tag: "small" },
|
|
28
|
-
Strong: { tag: "strong" },
|
|
29
|
-
Em: { tag: "em" },
|
|
30
|
-
Code: { tag: "code" },
|
|
31
|
-
Pre: { tag: "pre" },
|
|
32
|
-
Blockquote: { tag: "blockquote" },
|
|
33
|
-
Mark: { tag: "mark" },
|
|
34
|
-
Label: { tag: "label" },
|
|
35
|
-
Abbr: { tag: "abbr" },
|
|
36
|
-
Del: { tag: "del" },
|
|
37
|
-
Ins: { tag: "ins" },
|
|
38
|
-
Sub: { tag: "sub" },
|
|
39
|
-
Sup: { tag: "sup" },
|
|
40
|
-
Data: { tag: "data" },
|
|
41
|
-
Time: { tag: "time" },
|
|
42
|
-
Bdi: { tag: "bdi" },
|
|
43
|
-
Bdo: { tag: "bdo" },
|
|
44
|
-
Cite: { tag: "cite" },
|
|
45
|
-
Dfn: { tag: "dfn" },
|
|
46
|
-
Kbd: { tag: "kbd" },
|
|
47
|
-
Samp: { tag: "samp" },
|
|
48
|
-
Var: { tag: "var" },
|
|
49
|
-
Address: { tag: "address" },
|
|
50
|
-
Ruby: { tag: "ruby" },
|
|
51
|
-
Rt: { tag: "rt" },
|
|
52
|
-
Rp: { tag: "rp" },
|
|
53
|
-
// interactive
|
|
54
|
-
Button: { tag: "button" },
|
|
55
|
-
Link: { tag: "a" },
|
|
56
|
-
NavLink: { tag: "a" },
|
|
57
|
-
Select: { tag: "select" },
|
|
58
|
-
Form: { tag: "form" },
|
|
59
|
-
Fieldset: { tag: "fieldset" },
|
|
60
|
-
Legend: { tag: "legend" },
|
|
61
|
-
Details: { tag: "details" },
|
|
62
|
-
Summary: { tag: "summary" },
|
|
63
|
-
Dialog: { tag: "dialog" },
|
|
64
|
-
Textarea: { tag: "textarea" },
|
|
65
|
-
Datalist: { tag: "datalist" },
|
|
66
|
-
Optgroup: { tag: "optgroup" },
|
|
67
|
-
Option: { tag: "option" },
|
|
68
|
-
Progress: { tag: "progress" },
|
|
69
|
-
Meter: { tag: "meter" },
|
|
70
|
-
Output: { tag: "output" },
|
|
71
|
-
Map: { tag: "map" },
|
|
72
|
-
// media
|
|
73
|
-
Picture: { tag: "picture" },
|
|
74
|
-
Video: { tag: "video" },
|
|
75
|
-
Audio: { tag: "audio" },
|
|
76
|
-
Figure: { tag: "figure" },
|
|
77
|
-
Figcaption: { tag: "figcaption" },
|
|
78
|
-
Canvas: { tag: "canvas" },
|
|
79
|
-
Svg: { tag: "svg" },
|
|
80
|
-
IFrame: { tag: "iframe" },
|
|
81
|
-
Object: { tag: "object" },
|
|
82
|
-
// void elements
|
|
83
|
-
Img: { tag: "img", voidEl: true },
|
|
84
|
-
Logo: { tag: "img", voidEl: true },
|
|
85
|
-
Input: { tag: "input", voidEl: true },
|
|
86
|
-
Checkbox: { tag: "input", voidEl: true },
|
|
87
|
-
Hr: { tag: "hr", voidEl: true },
|
|
88
|
-
Br: { tag: "br", voidEl: true },
|
|
89
|
-
Wbr: { tag: "wbr", voidEl: true },
|
|
90
|
-
Source: { tag: "source", voidEl: true },
|
|
91
|
-
Embed: { tag: "embed", voidEl: true },
|
|
92
|
-
Col: { tag: "col", voidEl: true },
|
|
93
|
-
Area: { tag: "area", voidEl: true },
|
|
94
|
-
// lists
|
|
95
|
-
Ul: { tag: "ul" }, Ol: { tag: "ol" }, Li: { tag: "li" },
|
|
96
|
-
Dl: { tag: "dl" }, Dt: { tag: "dt" }, Dd: { tag: "dd" },
|
|
97
|
-
// tables
|
|
98
|
-
Table: { tag: "table" },
|
|
99
|
-
Caption: { tag: "caption" },
|
|
100
|
-
Thead: { tag: "thead" },
|
|
101
|
-
Tbody: { tag: "tbody" },
|
|
102
|
-
Tfoot: { tag: "tfoot" },
|
|
103
|
-
Tr: { tag: "tr" },
|
|
104
|
-
Th: { tag: "th" },
|
|
105
|
-
Td: { tag: "td" },
|
|
106
|
-
Colgroup: { tag: "colgroup" },
|
|
107
|
-
// utility
|
|
108
|
-
Template: { tag: "template" },
|
|
109
|
-
Slot: { tag: "slot" },
|
|
110
|
-
NoScript: { tag: "noscript" },
|
|
111
|
-
RawHTML: { tag: "__RAW__" },
|
|
112
|
-
};
|
|
113
|
-
|
|
114
|
-
export const VOID_TAGS = new Set([
|
|
115
|
-
"area","base","br","col","embed","hr","img","input",
|
|
116
|
-
"link","meta","param","source","track","wbr",
|
|
117
|
-
]);
|