@yannosay/sinth 1.8.1 → 1.8.2
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/LICENSE +660 -660
- package/README.md +548 -548
- package/package.json +45 -45
- package/src/cli.ts +338 -338
- package/src/core/builtins.ts +116 -116
- package/src/core/compiler.ts +1706 -1706
- package/src/core/expr.ts +88 -88
- package/src/core/head-builder.ts +86 -86
- package/src/core/lexer.ts +275 -275
- package/src/core/parser.ts +1523 -1523
- package/src/core/runtime/custom-element.ts +134 -134
- package/src/core/runtime/functions.ts +46 -46
- package/src/core/runtime/helpers.ts +332 -332
- package/src/core/runtime/render.ts +136 -136
- package/src/core/style-processor.ts +299 -299
- package/src/core/types.ts +192 -192
- package/src/resolver.ts +149 -149
- package/src/server.ts +128 -128
- package/src/utils.ts +76 -76
- package/tsconfig.json +26 -26
package/src/core/builtins.ts
CHANGED
|
@@ -1,117 +1,117 @@
|
|
|
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",
|
|
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
117
|
]);
|