xmlui 0.4.2-beta.1 → 0.4.3

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.
Files changed (67) hide show
  1. package/dist/{Pdf-DY3dYAig.mjs → Pdf-DTuZ_aBK.mjs} +1 -1
  2. package/dist/{Pdf-DYj6pOR4.mjs → Pdf-GNhynVZK.mjs} +1 -1
  3. package/dist/{apiInterceptorWorker-CSMfMHnG.mjs → apiInterceptorWorker-BsYA33M3.mjs} +1 -1
  4. package/dist/{apiInterceptorWorker-B_8SyVm7.mjs → apiInterceptorWorker-jZ0ZDQqP.mjs} +1 -1
  5. package/dist/{grammar.tmLanguage-Bgs-wS_O.mjs → grammar.tmLanguage-7HXwRarI.mjs} +39 -55
  6. package/dist/{index-DFmApFOY.mjs → index-CsOjUQnK.mjs} +8384 -7979
  7. package/dist/{index-standalone-UVkKZMvh.mjs → index-standalone-Cn89JdlG.mjs} +26315 -25887
  8. package/dist/index-standalone.css +1 -1
  9. package/dist/index.css +1 -1
  10. package/dist/{nivo-bar.es-tnCyX0Yr.mjs → nivo-bar.es-Bxk3Dn8A.mjs} +2 -2
  11. package/dist/{nivo-geo.es-BQ3VnkfD.mjs → nivo-geo.es-CpGxXa45.mjs} +2 -2
  12. package/dist/{nivo-legends.es-D-P_F-6G.mjs → nivo-legends.es-Dx4X21-T.mjs} +1 -1
  13. package/dist/{nivo-pie.es-Z4Ty7kQd.mjs → nivo-pie.es-BQqtQwEz.mjs} +2 -2
  14. package/dist/{react-apexcharts.min-DgtmaDk9.mjs → react-apexcharts.min-CDn4NFvp.mjs} +1 -1
  15. package/dist/scripts/docs/syntax/grammar.tmLanguage.json +29 -76
  16. package/dist/scripts/docs/syntax/textMate/xmlui.json +8 -0
  17. package/dist/scripts/xmlui/src/components/Accordion/Accordion.js +57 -0
  18. package/dist/scripts/xmlui/src/components/Alert/Alert.js +31 -0
  19. package/dist/scripts/xmlui/src/components/App/App.js +24 -19
  20. package/dist/scripts/xmlui/src/components/AppHeader/AppHeader.js +1 -3
  21. package/dist/scripts/xmlui/src/components/Badge/Badge.js +1 -1
  22. package/dist/scripts/xmlui/src/components/Bookmark/Bookmark.js +22 -2
  23. package/dist/scripts/xmlui/src/components/Button/Button.js +1 -1
  24. package/dist/scripts/xmlui/src/components/Card/Card.js +1 -1
  25. package/dist/scripts/xmlui/src/components/ComponentProvider.js +11 -2
  26. package/dist/scripts/xmlui/src/components/DatePicker/DatePicker.js +1 -1
  27. package/dist/scripts/xmlui/src/components/Footer/Footer.js +2 -2
  28. package/dist/scripts/xmlui/src/components/FormItem/FormItem.js +1 -1
  29. package/dist/scripts/xmlui/src/components/FormSection/FormSection.js +1 -1
  30. package/dist/scripts/xmlui/src/components/Heading/Heading.js +27 -2
  31. package/dist/scripts/xmlui/src/components/IconInfoCard/IconInfoCard.js +1 -1
  32. package/dist/scripts/xmlui/src/components/ModalDialog/ModalDialog.js +8 -5
  33. package/dist/scripts/xmlui/src/components/MultiSelect/MultiSelect.js +3 -3
  34. package/dist/scripts/xmlui/src/components/NavPanel/NavPanel.js +4 -0
  35. package/dist/scripts/xmlui/src/components/OffCanvas/OffCanvas.js +34 -0
  36. package/dist/scripts/xmlui/src/components/PageHeader/PageHeader.js +1 -1
  37. package/dist/scripts/xmlui/src/components/Pages/Pages.js +2 -1
  38. package/dist/scripts/xmlui/src/components/RadioGroup/RadioGroup.js +2 -1
  39. package/dist/scripts/xmlui/src/components/Select/Select.js +6 -3
  40. package/dist/scripts/xmlui/src/components/Spinner/Spinner.js +5 -1
  41. package/dist/scripts/xmlui/src/components/StickyBox/StickyBox.js +1 -1
  42. package/dist/scripts/xmlui/src/components/Table/Table.js +29 -10
  43. package/dist/scripts/xmlui/src/components/TableOfContents/TableOfContents.js +93 -0
  44. package/dist/scripts/xmlui/src/components/Toolbar/Toolbar.js +1 -1
  45. package/dist/scripts/xmlui/src/components/ToolbarButton/ToolbarButton.js +2 -2
  46. package/dist/scripts/xmlui/src/components-core/Component.js +13 -9
  47. package/dist/scripts/xmlui/src/components-core/CompoundComponent.js +19 -21
  48. package/dist/scripts/xmlui/src/components-core/RootComponent.js +74 -11
  49. package/dist/scripts/xmlui/src/components-core/{ChildrenSlot.js → Slot.js} +3 -3
  50. package/dist/scripts/xmlui/src/components-core/TableOfContentsContext.js +77 -0
  51. package/dist/scripts/xmlui/src/components-core/container/Container.js +16 -16
  52. package/dist/scripts/xmlui/src/components-core/theming/themes/root.js +5 -2
  53. package/dist/scripts/xmlui/src/components-core/theming/themes/theme-colors.js +336 -336
  54. package/dist/scripts/xmlui/src/components-core/theming/themes/xmlui.js +20 -2
  55. package/dist/scripts/xmlui/src/components-core/utils/misc.js +7 -28
  56. package/dist/scripts/xmlui/src/parsers/style-parser/style-compiler.js +169 -142
  57. package/dist/scripts/xmlui/src/parsers/xmlui-parser/ParserError.js +1 -0
  58. package/dist/scripts/xmlui/src/parsers/xmlui-parser/diagnostics.js +1 -1
  59. package/dist/scripts/xmlui/src/parsers/xmlui-parser/parser.js +24 -27
  60. package/dist/scripts/xmlui/src/parsers/xmlui-parser/transform.js +56 -41
  61. package/dist/{xmlui-C8fXVsN3.mjs → xmlui-BYWyXi2x.mjs} +8 -0
  62. package/dist/xmlui-standalone.es.js +1 -1
  63. package/dist/xmlui-standalone.umd.js +105 -106
  64. package/dist/xmlui.es.d.ts +25 -10
  65. package/dist/xmlui.es.js +1 -1
  66. package/dist/xmlui.umd.js +99 -100
  67. package/package.json +7 -2
@@ -10,22 +10,22 @@ const defaultCompResult = {
10
10
  };
11
11
  // Compile style properties into an object that can be directly used as the "style" attribute of elements
12
12
  function compileLayout(layoutProps = constants_1.EMPTY_OBJECT, themeVars, layoutContext) {
13
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41;
13
+ var _a, _b, _c, _d, _e;
14
14
  const result = {
15
15
  cssProps: {},
16
16
  nonCssProps: {},
17
17
  };
18
18
  const css = result.cssProps;
19
19
  // --- Compile alignment
20
- const horizontalAlignment = compileAlignment("horizontalAlignment", (_a = layoutProps === null || layoutProps === void 0 ? void 0 : layoutProps.horizontalAlignment) === null || _a === void 0 ? void 0 : _a.toString());
20
+ const horizontalAlignment = compileAlignment("horizontalAlignment", layoutProps);
21
21
  if (horizontalAlignment) {
22
22
  result.nonCssProps.horizontalAlignment = horizontalAlignment;
23
23
  }
24
- const verticalAlignment = compileAlignment("verticalAlignment", (_b = layoutProps === null || layoutProps === void 0 ? void 0 : layoutProps.verticalAlignment) === null || _b === void 0 ? void 0 : _b.toString());
24
+ const verticalAlignment = compileAlignment("verticalAlignment", layoutProps);
25
25
  if (verticalAlignment) {
26
26
  result.nonCssProps.verticalAlignment = verticalAlignment;
27
27
  }
28
- const orientation = compileOrientation("orientation", (_c = layoutProps === null || layoutProps === void 0 ? void 0 : layoutProps.orientation) === null || _c === void 0 ? void 0 : _c.toString());
28
+ const orientation = compileOrientation("orientation", layoutProps);
29
29
  if (orientation) {
30
30
  result.nonCssProps.orientation = orientation;
31
31
  }
@@ -34,7 +34,7 @@ function compileLayout(layoutProps = constants_1.EMPTY_OBJECT, themeVars, layout
34
34
  // --- In a container, we always use "flex-shrink: 0"
35
35
  css.flexShrink = 0;
36
36
  }
37
- const widthResult = compileSize("width", (_d = layoutProps.width) === null || _d === void 0 ? void 0 : _d.toString());
37
+ const widthResult = compileSize("width", layoutProps);
38
38
  if (widthResult.value)
39
39
  css.width = widthResult.value;
40
40
  if (isHorizontalAndStartSize(widthResult, layoutContext)) {
@@ -42,13 +42,13 @@ function compileLayout(layoutProps = constants_1.EMPTY_OBJECT, themeVars, layout
42
42
  css.flex = widthResult.ratio;
43
43
  css.flexShrink = 1; //if it's star sizing, we allow shrinking
44
44
  }
45
- const minWidthResult = compileSize("minWidth", (_e = layoutProps.minWidth) === null || _e === void 0 ? void 0 : _e.toString());
45
+ const minWidthResult = compileSize("minWidth", layoutProps);
46
46
  if (minWidthResult.value)
47
47
  css.minWidth = minWidthResult.value;
48
- const maxWidthResult = compileSize("maxWidth", (_f = layoutProps.maxWidth) === null || _f === void 0 ? void 0 : _f.toString());
48
+ const maxWidthResult = compileSize("maxWidth", layoutProps);
49
49
  if (maxWidthResult.value)
50
50
  css.maxWidth = maxWidthResult.value;
51
- const heightResult = compileSize("height", (_g = layoutProps.height) === null || _g === void 0 ? void 0 : _g.toString());
51
+ const heightResult = compileSize("height", layoutProps);
52
52
  if (heightResult.value)
53
53
  css.height = heightResult.value;
54
54
  if (isVerticalAndStarSize(heightResult, layoutContext)) {
@@ -56,173 +56,172 @@ function compileLayout(layoutProps = constants_1.EMPTY_OBJECT, themeVars, layout
56
56
  css.flex = heightResult.ratio;
57
57
  css.flexShrink = 1;
58
58
  }
59
- const minHeightResult = compileSize("minHeight", (_h = layoutProps.minHeight) === null || _h === void 0 ? void 0 : _h.toString());
59
+ const minHeightResult = compileSize("minHeight", layoutProps);
60
60
  if (minHeightResult.value)
61
61
  css.minHeight = minHeightResult.value;
62
- const maxHeightResult = compileSize("maxHeight", (_j = layoutProps.maxHeight) === null || _j === void 0 ? void 0 : _j.toString());
62
+ const maxHeightResult = compileSize("maxHeight", layoutProps);
63
63
  if (maxHeightResult.value)
64
64
  css.maxHeight = maxHeightResult.value;
65
65
  // --- Compile positions
66
- const top = compileSize("top", (_k = layoutProps.top) === null || _k === void 0 ? void 0 : _k.toString());
66
+ const top = compileSize("top", layoutProps);
67
67
  if (top.value)
68
68
  css.top = top.value;
69
- const right = compileSize("right", (_l = layoutProps.right) === null || _l === void 0 ? void 0 : _l.toString());
69
+ const right = compileSize("right", layoutProps);
70
70
  if (right.value)
71
71
  css.right = right.value;
72
- const bottom = compileSize("bottom", (_m = layoutProps.bottom) === null || _m === void 0 ? void 0 : _m.toString());
72
+ const bottom = compileSize("bottom", layoutProps);
73
73
  if (bottom.value)
74
74
  css.bottom = bottom.value;
75
- const left = compileSize("left", (_o = layoutProps.left) === null || _o === void 0 ? void 0 : _o.toString());
75
+ const left = compileSize("left", layoutProps);
76
76
  if (left.value)
77
77
  css.left = left.value;
78
78
  // --- Compile gap
79
- const gap = compileSize("gap", (_p = layoutProps.gap) === null || _p === void 0 ? void 0 : _p.toString());
79
+ const gap = compileSize("gap", layoutProps);
80
80
  if (gap.value)
81
81
  css.gap = gap.value;
82
82
  // --- Compile border
83
- const border = compileBorder("border", (_q = layoutProps.border) === null || _q === void 0 ? void 0 : _q.toString());
83
+ const border = compileBorder("border", layoutProps);
84
84
  if (border)
85
85
  css.border = border;
86
- const borderTop = compileBorder("borderTop", (_r = layoutProps.borderTop) === null || _r === void 0 ? void 0 : _r.toString());
86
+ const borderTop = compileBorder("borderTop", layoutProps);
87
87
  if (borderTop)
88
88
  css.borderTop = borderTop;
89
- const borderRight = compileBorder("borderRight", (_s = layoutProps.borderRight) === null || _s === void 0 ? void 0 : _s.toString());
89
+ const borderRight = compileBorder("borderRight", layoutProps);
90
90
  if (borderRight)
91
91
  css.borderRight = borderRight;
92
- const borderBottom = compileBorder("borderBottom", (_t = layoutProps.borderBottom) === null || _t === void 0 ? void 0 : _t.toString());
92
+ const borderBottom = compileBorder("borderBottom", layoutProps);
93
93
  if (borderBottom)
94
94
  css.borderBottom = borderBottom;
95
- const borderLeft = compileBorder("borderLeft", (_u = layoutProps.borderLeft) === null || _u === void 0 ? void 0 : _u.toString());
95
+ const borderLeft = compileBorder("borderLeft", layoutProps);
96
96
  if (borderLeft)
97
97
  css.borderLeft = borderLeft;
98
98
  // --- Compile radius
99
- const radius = compileRadius("radius", (_v = layoutProps.radius) === null || _v === void 0 ? void 0 : _v.toString());
99
+ const radius = compileRadius("radius", layoutProps);
100
100
  if (radius)
101
101
  css.borderRadius = radius;
102
- const radiusTopLeft = compileRadius("radiusTopLeft", (_w = layoutProps.radiusTopLeft) === null || _w === void 0 ? void 0 : _w.toString());
102
+ const radiusTopLeft = compileRadius("radiusTopLeft", layoutProps);
103
103
  if (radiusTopLeft)
104
104
  css.borderTopLeftRadius = radiusTopLeft;
105
- const radiusTopRight = compileRadius("radiusTopRight", (_x = layoutProps.radiusTopRight) === null || _x === void 0 ? void 0 : _x.toString());
105
+ const radiusTopRight = compileRadius("radiusTopRight", layoutProps);
106
106
  if (radiusTopRight)
107
107
  css.borderTopRightRadius = radiusTopRight;
108
- const radiusBottomLeft = compileRadius("radiusBottomLeft", (_y = layoutProps.radiusBottomLeft) === null || _y === void 0 ? void 0 : _y.toString());
108
+ const radiusBottomLeft = compileRadius("radiusBottomLeft", layoutProps);
109
109
  if (radiusBottomLeft)
110
110
  css.borderBottomLeftRadius = radiusBottomLeft;
111
- const radiusBottomRight = compileRadius("radiusBottomRight", (_z = layoutProps.radiusBottomRight) === null || _z === void 0 ? void 0 : _z.toString());
111
+ const radiusBottomRight = compileRadius("radiusBottomRight", layoutProps);
112
112
  if (radiusBottomRight)
113
113
  css.borderBottomRightRadius = radiusBottomRight;
114
114
  // --- Compile padding
115
- const padding = compileSize("padding", (_0 = layoutProps.padding) === null || _0 === void 0 ? void 0 : _0.toString());
115
+ const padding = compileSize("padding", layoutProps);
116
116
  if (padding.value)
117
117
  css.padding = padding.value;
118
- const horizontalPadding = compileSize("horizontalPadding", (_1 = layoutProps.horizontalPadding) === null || _1 === void 0 ? void 0 : _1.toString());
119
- const verticalPadding = compileSize("verticalPadding", (_2 = layoutProps.verticalPadding) === null || _2 === void 0 ? void 0 : _2.toString());
120
- const paddingLeft = mergeSizes(compileSize("leftPadding", (_3 = layoutProps.paddingLeft) === null || _3 === void 0 ? void 0 : _3.toString()), horizontalPadding);
118
+ const horizontalPadding = compileSize("horizontalPadding", layoutProps);
119
+ const verticalPadding = compileSize("verticalPadding", layoutProps);
120
+ const paddingLeft = mergeSizes(compileSize("paddingLeft", layoutProps), horizontalPadding);
121
121
  if (paddingLeft.value)
122
122
  css.paddingLeft = paddingLeft.value;
123
- const paddingRight = mergeSizes(compileSize("rightPadding", (_4 = layoutProps.paddingRight) === null || _4 === void 0 ? void 0 : _4.toString()), horizontalPadding);
123
+ const paddingRight = mergeSizes(compileSize("paddingRight", layoutProps), horizontalPadding);
124
124
  if (paddingRight.value)
125
125
  css.paddingRight = paddingRight.value;
126
- const paddingTop = mergeSizes(compileSize("topPadding", (_5 = layoutProps.paddingTop) === null || _5 === void 0 ? void 0 : _5.toString()), verticalPadding);
126
+ const paddingTop = mergeSizes(compileSize("paddingTop", layoutProps), verticalPadding);
127
127
  if (paddingTop.value)
128
128
  css.paddingTop = paddingTop.value;
129
- const paddingBottom = mergeSizes(compileSize("bottomPadding", (_6 = layoutProps.paddingBottom) === null || _6 === void 0 ? void 0 : _6.toString()), verticalPadding);
129
+ const paddingBottom = mergeSizes(compileSize("paddingBottom", layoutProps), verticalPadding);
130
130
  if (paddingBottom.value)
131
131
  css.paddingBottom = paddingBottom.value;
132
132
  // --- Compile margin
133
- const margin = compileMargin("margin", (_7 = layoutProps.margin) === null || _7 === void 0 ? void 0 : _7.toString());
133
+ const margin = compileMargin("margin", layoutProps);
134
134
  if (margin)
135
135
  css.margin = margin;
136
- const horizontalMargin = compileMargin("horizontalMargin", (_8 = layoutProps.horizontalMargin) === null || _8 === void 0 ? void 0 : _8.toString());
137
- const verticalMargin = compileMargin("verticalMargin", (_9 = layoutProps.verticalMargin) === null || _9 === void 0 ? void 0 : _9.toString());
138
- const marginLeft = (_11 = compileMargin("leftMargin", (_10 = layoutProps.marginLeft) === null || _10 === void 0 ? void 0 : _10.toString())) !== null && _11 !== void 0 ? _11 : horizontalMargin;
136
+ const horizontalMargin = compileMargin("horizontalMargin", layoutProps);
137
+ const verticalMargin = compileMargin("verticalMargin", layoutProps);
138
+ const marginLeft = (_a = compileMargin("marginLeft", layoutProps)) !== null && _a !== void 0 ? _a : horizontalMargin;
139
139
  if (marginLeft)
140
140
  css.marginLeft = marginLeft;
141
- const marginRight = (_13 = compileMargin("rightMargin", (_12 = layoutProps.marginRight) === null || _12 === void 0 ? void 0 : _12.toString())) !== null && _13 !== void 0 ? _13 : horizontalMargin;
141
+ const marginRight = (_b = compileMargin("marginRight", layoutProps)) !== null && _b !== void 0 ? _b : horizontalMargin;
142
142
  if (marginRight)
143
143
  css.marginRight = marginRight;
144
- const marginTop = (_15 = compileMargin("topMargin", (_14 = layoutProps.marginTop) === null || _14 === void 0 ? void 0 : _14.toString())) !== null && _15 !== void 0 ? _15 : verticalMargin;
144
+ const marginTop = (_c = compileMargin("marginTop", layoutProps)) !== null && _c !== void 0 ? _c : verticalMargin;
145
145
  if (marginTop)
146
146
  css.marginTop = marginTop;
147
- const marginBottom = (_17 = compileMargin("bottomMargin", (_16 = layoutProps.marginBottom) === null || _16 === void 0 ? void 0 : _16.toString())) !== null && _17 !== void 0 ? _17 : verticalMargin;
147
+ const marginBottom = (_d = compileMargin("marginBottom", layoutProps)) !== null && _d !== void 0 ? _d : verticalMargin;
148
148
  if (marginBottom)
149
149
  css.marginBottom = marginBottom;
150
150
  // --- Compile other
151
- const backgroundColor = compileColor("backgroundColor", (_18 = layoutProps.backgroundColor) === null || _18 === void 0 ? void 0 : _18.toString());
151
+ const backgroundColor = compileColor("backgroundColor", layoutProps);
152
152
  if (backgroundColor)
153
153
  css.backgroundColor = backgroundColor;
154
154
  //TODO illesg
155
- const background = compileBackground("background", (_19 = layoutProps.background) === null || _19 === void 0 ? void 0 : _19.toString());
155
+ const background = compileBackground("background", layoutProps);
156
156
  if (background)
157
157
  css.background = background;
158
- const boxShadow = compileShadow("shadow", (_20 = layoutProps.shadow) === null || _20 === void 0 ? void 0 : _20.toString());
158
+ const boxShadow = compileShadow("shadow", layoutProps);
159
159
  if (boxShadow)
160
160
  css.boxShadow = boxShadow;
161
- const direction = compileDirection("direction", (_21 = layoutProps.direction) === null || _21 === void 0 ? void 0 : _21.toString());
161
+ const direction = compileDirection("direction", layoutProps);
162
162
  if (direction)
163
163
  css.direction = direction;
164
- const overflowX = compileScrolling("horizontalOverflow", (_22 = layoutProps.horizontalOverflow) === null || _22 === void 0 ? void 0 : _22.toString());
164
+ const overflowX = compileScrolling("horizontalOverflow", layoutProps);
165
165
  if (overflowX)
166
166
  css.overflowX = overflowX;
167
- const overflowY = compileScrolling("verticalOverflow", (_23 = layoutProps.verticalOverflow) === null || _23 === void 0 ? void 0 : _23.toString());
167
+ const overflowY = compileScrolling("verticalOverflow", layoutProps);
168
168
  if (overflowY)
169
169
  css.overflowY = overflowY;
170
- const zIndex = compileZIndex("zIndex", (_24 = layoutProps.zIndex) === null || _24 === void 0 ? void 0 : _24.toString());
170
+ const zIndex = compileZIndex("zIndex", layoutProps);
171
171
  if (zIndex)
172
172
  css.zIndex = zIndex;
173
- const opacity = compileOpacity("zIndex", (_25 = layoutProps === null || layoutProps === void 0 ? void 0 : layoutProps.opacity) === null || _25 === void 0 ? void 0 : _25.toString());
173
+ const opacity = compileOpacity("opacity", layoutProps);
174
174
  if (opacity)
175
175
  css.opacity = opacity;
176
176
  // --- Compile typography
177
- const color = compileColor("color", (_26 = layoutProps.color) === null || _26 === void 0 ? void 0 : _26.toString());
177
+ const color = compileColor("color", layoutProps);
178
178
  if (color)
179
179
  css.color = color;
180
- const fontFamily = compileFontFamily("fontFamily", (_27 = layoutProps.fontFamily) === null || _27 === void 0 ? void 0 : _27.toString());
180
+ const fontFamily = compileFontFamily("fontFamily", layoutProps);
181
181
  if (fontFamily)
182
182
  css.fontFamily = fontFamily;
183
- const fontSize = compileSize("fontSize", (_28 = layoutProps.fontSize) === null || _28 === void 0 ? void 0 : _28.toString());
183
+ const fontSize = compileSize("fontSize", layoutProps);
184
184
  if (fontSize.value)
185
185
  css.fontSize = fontSize.value;
186
- const fontWeight = compileFontWeight("fontWeight", (_29 = layoutProps.fontWeight) === null || _29 === void 0 ? void 0 : _29.toString());
186
+ const fontWeight = compileFontWeight("fontWeight", layoutProps);
187
187
  if (fontWeight)
188
188
  css.fontWeight = fontWeight;
189
- const fontStyle = compileItalic("italic", (_30 = layoutProps.italic) === null || _30 === void 0 ? void 0 : _30.toString());
189
+ const fontStyle = compileItalic("italic", layoutProps);
190
190
  if (fontStyle)
191
191
  css.fontStyle = fontStyle;
192
- const textDecoration = compileTextDecoration("textDecoration", (_31 = layoutProps.textDecoration) === null || _31 === void 0 ? void 0 : _31.toString());
192
+ const textDecoration = compileTextDecoration("textDecoration", layoutProps);
193
193
  if (textDecoration)
194
194
  css.textDecoration = textDecoration;
195
- const userSelect = compileUserSelect("userSelect", (_32 = layoutProps === null || layoutProps === void 0 ? void 0 : layoutProps.userSelect) === null || _32 === void 0 ? void 0 : _32.toString());
195
+ const userSelect = compileUserSelect("userSelect", layoutProps);
196
196
  if (userSelect)
197
197
  css.userSelect = userSelect;
198
- const letterSpacing = compileSize("letterSpacing", (_33 = layoutProps === null || layoutProps === void 0 ? void 0 : layoutProps.letterSpacing) === null || _33 === void 0 ? void 0 : _33.toString());
198
+ const letterSpacing = compileSize("letterSpacing", layoutProps);
199
199
  if (letterSpacing.value)
200
200
  css.letterSpacing = letterSpacing.value;
201
- const textTransform = compileTextTransform("textTransform", (_34 = layoutProps === null || layoutProps === void 0 ? void 0 : layoutProps.textTransform) === null || _34 === void 0 ? void 0 : _34.toString());
201
+ const textTransform = compileTextTransform("textTransform", layoutProps);
202
202
  if (textTransform)
203
203
  css.textTransform = textTransform;
204
- const lineHeight = compileLineHeight("lineHeight", (_35 = layoutProps === null || layoutProps === void 0 ? void 0 : layoutProps.lineHeight) === null || _35 === void 0 ? void 0 : _35.toString());
204
+ const lineHeight = compileLineHeight("lineHeight", layoutProps);
205
205
  if (lineHeight)
206
206
  css.lineHeight = lineHeight;
207
- const textAlign = compileTextAlign("textAlign", (_36 = layoutProps === null || layoutProps === void 0 ? void 0 : layoutProps.textAlign) === null || _36 === void 0 ? void 0 : _36.toString());
207
+ const textAlign = compileTextAlign("textAlign", layoutProps);
208
208
  if (textAlign)
209
209
  css.textAlign = textAlign;
210
- const textAlignLast = compileTextAlign("textAlignLast", (_37 = layoutProps === null || layoutProps === void 0 ? void 0 : layoutProps.textAlignLast) === null || _37 === void 0 ? void 0 : _37.toString());
210
+ const textAlignLast = compileTextAlign("textAlignLast", layoutProps);
211
211
  if (textAlignLast)
212
212
  css.textAlignLast = textAlignLast;
213
- //TODO illesg
214
- const textWrap = (_38 = layoutProps === null || layoutProps === void 0 ? void 0 : layoutProps.textWrap) === null || _38 === void 0 ? void 0 : _38.toString();
213
+ const textWrap = (_e = layoutProps === null || layoutProps === void 0 ? void 0 : layoutProps.textWrap) === null || _e === void 0 ? void 0 : _e.toString();
215
214
  if (textWrap)
216
215
  css.textWrap = textWrap;
217
216
  // --- Compile content rendering
218
- const wrapContent = compileWrapContent("wrapContent", (_39 = layoutProps === null || layoutProps === void 0 ? void 0 : layoutProps.wrapContent) === null || _39 === void 0 ? void 0 : _39.toString());
217
+ const wrapContent = compileWrapContent("wrapContent", layoutProps);
219
218
  if (wrapContent)
220
219
  css.flexWrap = wrapContent;
221
- const canShrink = compileCanShrink("canShrink", (_40 = layoutProps === null || layoutProps === void 0 ? void 0 : layoutProps.canShrink) === null || _40 === void 0 ? void 0 : _40.toString());
220
+ const canShrink = compileCanShrink("canShrink", layoutProps);
222
221
  if (canShrink)
223
222
  css.flexShrink = canShrink;
224
223
  // --- Other
225
- const cursor = compileCursor("cursor", (_41 = layoutProps === null || layoutProps === void 0 ? void 0 : layoutProps.cursor) === null || _41 === void 0 ? void 0 : _41.toString());
224
+ const cursor = compileCursor("cursor", layoutProps);
226
225
  if (cursor)
227
226
  css.cursor = cursor;
228
227
  // --- Done
@@ -244,68 +243,100 @@ function compileLayout(layoutProps = constants_1.EMPTY_OBJECT, themeVars, layout
244
243
  }
245
244
  return true;
246
245
  }
247
- function compile(propName, source, parseFn, convertFn) {
248
- var _a, _b;
249
- if (!source)
250
- return undefined;
251
- const parser = new StyleParser_1.StyleParser(source);
252
- try {
253
- const node = parseFn(parser);
254
- if (!node)
255
- return source;
256
- if (!parser.testCompleted()) {
257
- (_a = result.issues) !== null && _a !== void 0 ? _a : (result.issues = {});
258
- result.issues[propName] = `Unexpected tail after the ${propName}`;
259
- return source;
246
+ function compile(propName, layoutProps, parseFn, convertFn) {
247
+ var _a, _b, _c, _d;
248
+ const defValue = compileSingleProperty();
249
+ if (((_a = layoutContext === null || layoutContext === void 0 ? void 0 : layoutContext.mediaSize) === null || _a === void 0 ? void 0 : _a.sizeIndex) !== undefined) {
250
+ const sizeIndex = (_b = layoutContext.mediaSize) === null || _b === void 0 ? void 0 : _b.sizeIndex;
251
+ const xsValue = compileSingleProperty("xs");
252
+ const smValue = compileSingleProperty("sm");
253
+ const mdValue = compileSingleProperty("md");
254
+ const lgValue = compileSingleProperty("lg");
255
+ const xlValue = compileSingleProperty("xl");
256
+ const xxlValue = compileSingleProperty("xxl");
257
+ let mergedValue;
258
+ switch (sizeIndex) {
259
+ case 0: // xs
260
+ mergedValue = (_c = xsValue !== null && xsValue !== void 0 ? xsValue : smValue) !== null && _c !== void 0 ? _c : mdValue;
261
+ break;
262
+ case 1: // sm
263
+ mergedValue = smValue !== null && smValue !== void 0 ? smValue : mdValue;
264
+ break;
265
+ case 2: // md
266
+ mergedValue = mdValue;
267
+ break;
268
+ case 3: // lg
269
+ mergedValue = lgValue;
270
+ break;
271
+ case 4: // xl
272
+ mergedValue = xlValue !== null && xlValue !== void 0 ? xlValue : lgValue;
273
+ break;
274
+ case 5: // xxl
275
+ mergedValue = (_d = xxlValue !== null && xxlValue !== void 0 ? xxlValue : xlValue) !== null && _d !== void 0 ? _d : lgValue;
276
+ break;
260
277
  }
261
- //TODO illesg
262
- // if (hasOnlyUnresolvedVars(node.themeId)) {
263
- // return undefined;
264
- // }
265
- if (node.themeId) {
266
- return (0, StyleParser_1.toCssVar)(node.themeId);
267
- }
268
- return convertFn(node);
278
+ return mergedValue !== null && mergedValue !== void 0 ? mergedValue : defValue;
269
279
  }
270
- catch (err) {
271
- (_b = result.issues) !== null && _b !== void 0 ? _b : (result.issues = {});
272
- result.issues[propName] = err === null || err === void 0 ? void 0 : err.toString();
273
- //TODO illesg
274
- return source;
280
+ return defValue;
281
+ function compileSingleProperty(sizeSpec) {
282
+ var _a, _b, _c;
283
+ const source = (_a = layoutProps === null || layoutProps === void 0 ? void 0 : layoutProps[propName + (sizeSpec ? `-${sizeSpec}` : "")]) === null || _a === void 0 ? void 0 : _a.toString();
284
+ if (!source)
285
+ return undefined;
286
+ const parser = new StyleParser_1.StyleParser(source);
287
+ try {
288
+ const node = parseFn(parser);
289
+ if (!node)
290
+ return source;
291
+ if (!parser.testCompleted()) {
292
+ (_b = result.issues) !== null && _b !== void 0 ? _b : (result.issues = {});
293
+ result.issues[propName] = `Unexpected tail after the ${propName}`;
294
+ return source;
295
+ }
296
+ if (node.themeId) {
297
+ return (0, StyleParser_1.toCssVar)(node.themeId);
298
+ }
299
+ return convertFn(node);
300
+ }
301
+ catch (err) {
302
+ (_c = result.issues) !== null && _c !== void 0 ? _c : (result.issues = {});
303
+ result.issues[propName] = err === null || err === void 0 ? void 0 : err.toString();
304
+ return source;
305
+ }
275
306
  }
276
307
  }
277
308
  // --- Compiles an alignment definition into a CSS size property
278
- function compileAlignment(propName, source) {
279
- return compile(propName, source, (p) => p.parseAlignment(), (n) => n.value);
309
+ function compileAlignment(propName, layoutProps) {
310
+ return compile(propName, layoutProps, (p) => p.parseAlignment(), (n) => n.value);
280
311
  }
281
312
  // --- Compiles an alignment definition into a CSS size property
282
- function compileTextAlign(propName, source) {
283
- return compile(propName, source, (p) => p.parseTextAlign(), (n) => n.value);
313
+ function compileTextAlign(propName, layoutProps) {
314
+ return compile(propName, layoutProps, (p) => p.parseTextAlign(), (n) => n.value);
284
315
  }
285
316
  // --- Compiles a user select definition into a CSS size property
286
- function compileUserSelect(propName, source) {
287
- return compile(propName, source, (p) => p.parseUserSelect(), (n) => n.value);
317
+ function compileUserSelect(propName, layoutProps) {
318
+ return compile(propName, layoutProps, (p) => p.parseUserSelect(), (n) => n.value);
288
319
  }
289
320
  // --- Compiles a text transform definition into a CSS size property
290
- function compileTextTransform(propName, source) {
291
- return compile(propName, source, (p) => p.parseTextTransform(), (n) => n.value);
321
+ function compileTextTransform(propName, layoutProps) {
322
+ return compile(propName, layoutProps, (p) => p.parseTextTransform(), (n) => n.value);
292
323
  }
293
- function compileOrientation(propName, source) {
294
- return compile(propName, source, (p) => p.parseOrientation(), (n) => n.value);
324
+ function compileOrientation(propName, layoutProps) {
325
+ return compile(propName, layoutProps, (p) => p.parseOrientation(), (n) => n.value);
295
326
  }
296
327
  // --- Compiles a size definition into a CSS size property
297
- function compileLineHeight(propName, source) {
298
- return compile(propName, source, (p) => p.parseLineHeight(), (n) => `${n.value}${n.unit}`);
328
+ function compileLineHeight(propName, layoutProps) {
329
+ return compile(propName, layoutProps, (p) => p.parseLineHeight(), (n) => `${n.value}${n.unit}`);
299
330
  }
300
331
  // --- Compiles a size definition into a CSS size property
301
- function compileOpacity(propName, source) {
302
- return compile(propName, source, (p) => p.parseOpacity(), (n) => `${n.value}${n.unit}`);
332
+ function compileOpacity(propName, layoutProps) {
333
+ return compile(propName, layoutProps, (p) => p.parseOpacity(), (n) => `${n.value}${n.unit}`);
303
334
  }
304
335
  // --- Compiles a size definition into a CSS size property
305
- function compileSize(propName, source) {
336
+ function compileSize(propName, layoutProps) {
306
337
  let isStarSize = false;
307
338
  let ratio;
308
- let value = compile(propName, source, (p) => {
339
+ let value = compile(propName, layoutProps, (p) => {
309
340
  var _a;
310
341
  const sizeNode = p.parseSize();
311
342
  isStarSize = (sizeNode === null || sizeNode === void 0 ? void 0 : sizeNode.unit) === "*";
@@ -321,37 +352,37 @@ function compileLayout(layoutProps = constants_1.EMPTY_OBJECT, themeVars, layout
321
352
  };
322
353
  }
323
354
  // --- Compiles a size definition into a CSS size property
324
- function compileMargin(propName, source) {
325
- return compile(propName, source, (p) => p.parseMargin(), (n) => { var _a; return (_a = n.extSize) !== null && _a !== void 0 ? _a : `${n.value}${n.unit}`; });
355
+ function compileMargin(propName, layoutProps) {
356
+ return compile(propName, layoutProps, (p) => p.parseMargin(), (n) => { var _a; return (_a = n.extSize) !== null && _a !== void 0 ? _a : `${n.value}${n.unit}`; });
326
357
  }
327
358
  // --- Compiles a zIndex definition into a CSS zIndex property
328
- function compileZIndex(propName, source) {
329
- return compile(propName, source, (p) => p.parseZIndex(), (n) => n.value.toString());
359
+ function compileZIndex(propName, layoutProps) {
360
+ return compile(propName, layoutProps, (p) => p.parseZIndex(), (n) => n.value.toString());
330
361
  }
331
- function compileScrolling(propName, source) {
332
- return compile(propName, source, (p) => p.parseScrolling(), (n) => n.value);
362
+ function compileScrolling(propName, layoutProps) {
363
+ return compile(propName, layoutProps, (p) => p.parseScrolling(), (n) => n.value);
333
364
  }
334
- function compileDirection(propName, source) {
335
- return compile(propName, source, (p) => p.parseDirection(), (n) => n.value);
365
+ function compileDirection(propName, layoutProps) {
366
+ return compile(propName, layoutProps, (p) => p.parseDirection(), (n) => n.value);
336
367
  }
337
- function compileCursor(propName, source) {
338
- return compile(propName, source, (p) => p.parseCursor(), (n) => n.value);
368
+ function compileCursor(propName, layoutProps) {
369
+ return compile(propName, layoutProps, (p) => p.parseCursor(), (n) => n.value);
339
370
  }
340
- function compileFontWeight(propName, source) {
341
- return compile(propName, source, (p) => p.parseFontWeight(), (n) => { var _a; return (_a = n.value) === null || _a === void 0 ? void 0 : _a.toString(); });
371
+ function compileFontWeight(propName, layoutProps) {
372
+ return compile(propName, layoutProps, (p) => p.parseFontWeight(), (n) => { var _a; return (_a = n.value) === null || _a === void 0 ? void 0 : _a.toString(); });
342
373
  }
343
- function compileFontFamily(propName, source) {
344
- return compile(propName, source, (p) => p.parseFontFamily(), (n) => n.value);
374
+ function compileFontFamily(propName, layoutProps) {
375
+ return compile(propName, layoutProps, (p) => p.parseFontFamily(), (n) => n.value);
345
376
  }
346
- function compileColor(propName, source) {
347
- return compile(propName, source, (p) => p.parseColor(), (n) => n.value !== undefined
377
+ function compileColor(propName, layoutProps) {
378
+ return compile(propName, layoutProps, (p) => p.parseColor(), (n) => n.value !== undefined
348
379
  ? typeof n.value === "number"
349
380
  ? `#${n.value.toString(16).padStart(8, "0")}`
350
381
  : n.value
351
382
  : undefined);
352
383
  }
353
- function compileBackground(propName, source) {
354
- return compile(propName, source, (p) => p.parseColor(), (n) => n.value !== undefined
384
+ function compileBackground(propName, layoutProps) {
385
+ return compile(propName, layoutProps, (p) => p.parseColor(), (n) => n.value !== undefined
355
386
  ? typeof n.value === "number"
356
387
  ? `#${n.value.toString(16).padStart(8, "0")}`
357
388
  : n.value
@@ -380,8 +411,8 @@ function compileLayout(layoutProps = constants_1.EMPTY_OBJECT, themeVars, layout
380
411
  }
381
412
  return true;
382
413
  }
383
- function compileBorder(propName, source) {
384
- return compile(propName, source, (p) => p.parseBorder(), (n) => {
414
+ function compileBorder(propName, layoutProps) {
415
+ return compile(propName, layoutProps, (p) => p.parseBorder(), (n) => {
385
416
  var _a, _b, _c;
386
417
  if (hasOnlyUnresolvedVars(n.themeId1, n.themeId2, n.themeId3)) {
387
418
  return undefined;
@@ -401,8 +432,8 @@ function compileLayout(layoutProps = constants_1.EMPTY_OBJECT, themeVars, layout
401
432
  : ""}`).trim();
402
433
  });
403
434
  }
404
- function compileTextDecoration(propName, source) {
405
- return compile(propName, source, (p) => p.parseTextDecoration(), (n) => {
435
+ function compileTextDecoration(propName, layoutProps) {
436
+ return compile(propName, layoutProps, (p) => p.parseTextDecoration(), (n) => {
406
437
  var _a, _b, _c;
407
438
  if (n.none) {
408
439
  return "none";
@@ -421,8 +452,8 @@ function compileLayout(layoutProps = constants_1.EMPTY_OBJECT, themeVars, layout
421
452
  `${(_c = n.color) !== null && _c !== void 0 ? _c : ""}`).trim();
422
453
  });
423
454
  }
424
- function compileRadius(propName, source) {
425
- return compile(propName, source, (p) => p.parseRadius(), (n) => {
455
+ function compileRadius(propName, layoutProps) {
456
+ return compile(propName, layoutProps, (p) => p.parseRadius(), (n) => {
426
457
  var _a, _b, _c, _d;
427
458
  if (hasOnlyUnresolvedVars(n.themeId1, n.themeId2)) {
428
459
  return undefined;
@@ -437,8 +468,8 @@ function compileLayout(layoutProps = constants_1.EMPTY_OBJECT, themeVars, layout
437
468
  return part.trim();
438
469
  });
439
470
  }
440
- function compileShadow(propName, source) {
441
- return compile(propName, source, (p) => p.parseShadow(), (n) => {
471
+ function compileShadow(propName, layoutProps) {
472
+ return compile(propName, layoutProps, (p) => p.parseShadow(), (n) => {
442
473
  var _a;
443
474
  let css = "";
444
475
  for (const sg of (_a = n.segments) !== null && _a !== void 0 ? _a : []) {
@@ -461,20 +492,16 @@ function compileLayout(layoutProps = constants_1.EMPTY_OBJECT, themeVars, layout
461
492
  });
462
493
  }
463
494
  // --- Compiles a Boolean definition into a CSS font-style size property
464
- function compileItalic(propName, source) {
465
- return compile(propName, source, (p) => p.parseBoolean(), (n) => (n.value ? "italic" : "normal"));
495
+ function compileItalic(propName, layoutProps) {
496
+ return compile(propName, layoutProps, (p) => p.parseBoolean(), (n) => (n.value ? "italic" : "normal"));
466
497
  }
467
498
  // --- Compiles a Boolean definition into a CSS flex-wrap property
468
- function compileWrapContent(propName, source) {
469
- return compile(propName, source, (p) => p.parseBoolean(), (n) => (n.value ? "wrap" : "nowrap"));
499
+ function compileWrapContent(propName, layoutProps) {
500
+ return compile(propName, layoutProps, (p) => p.parseBoolean(), (n) => (n.value ? "wrap" : "nowrap"));
470
501
  }
471
502
  // --- Compiles a Boolean definition into a CSS flex-shrink property
472
- function compileCanShrink(propName, source) {
473
- return compile(propName, source, (p) => p.parseBoolean(), (n) => (n.value ? "1" : "0"));
474
- }
475
- function compileBoolean(propName, defValue, source) {
476
- const compiledValue = compile(propName, source, (p) => (source ? p.parseBoolean() : null), (n) => (n.value ? "true" : "false"));
477
- return compiledValue === undefined ? defValue : (compiledValue === null || compiledValue === void 0 ? void 0 : compiledValue.toString()) === "true";
503
+ function compileCanShrink(propName, layoutProps) {
504
+ return compile(propName, layoutProps, (p) => p.parseBoolean(), (n) => (n.value ? "1" : "0"));
478
505
  }
479
506
  function isHorizontalAndStartSize(size, layoutContext) {
480
507
  if (!size.value)
@@ -51,4 +51,5 @@ exports.errorMessages = {
51
51
  T021: "Invalid reusable component attribute '{0}'",
52
52
  T022: "The 'script' tag must not have any attribute",
53
53
  T023: "A 'script' tag cannot nest other child nodes, only text",
54
+ T024: "Cannot put a reusable component definitions into a slot",
54
55
  };
@@ -76,7 +76,7 @@ exports.Diag_Tag_Identifier_Expected = {
76
76
  exports.Diag_Attr_Value_Expected = {
77
77
  category: DiagnosticCategory.Error,
78
78
  code: ErrCodes.expAttrValue,
79
- message: "An attribute value expected between quotes.",
79
+ message: "An attribute value expected.",
80
80
  };
81
81
  exports.Diag_Eq_Token_Expected = {
82
82
  category: DiagnosticCategory.Error,