xmlui 0.10.11 → 0.10.13

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 (66) hide show
  1. package/dist/lib/{index-BuIblMfO.mjs → index-Db5iQkFp.mjs} +1918 -2312
  2. package/dist/lib/index.css +1 -1
  3. package/dist/lib/{initMock-CV-9AUzP.mjs → initMock-B9LtmFJG.mjs} +1 -1
  4. package/dist/lib/language-server-web-worker.mjs +1 -1
  5. package/dist/lib/language-server.mjs +1 -1
  6. package/dist/lib/{metadata-utils-DzONZF-e.mjs → metadata-utils-D90qqMGc.mjs} +1 -1
  7. package/dist/lib/scss/components-core/theming/_themes.scss +1 -1
  8. package/dist/lib/{server-common-Dsyp3-Ro.mjs → server-common-lmBDLpUh.mjs} +2595 -2571
  9. package/dist/lib/{transform-CBz7TQJh.mjs → transform-bHBjkKSL.mjs} +2 -1
  10. package/dist/lib/xmlui-parser.d.ts +17 -8
  11. package/dist/lib/xmlui-parser.mjs +2 -2
  12. package/dist/lib/{xmlui-serializer-Bf9bdvlV.mjs → xmlui-serializer-DB6BLiXK.mjs} +1 -1
  13. package/dist/lib/xmlui.d.ts +3 -1
  14. package/dist/lib/xmlui.mjs +2 -2
  15. package/dist/metadata/{collectedComponentMetadata-Cdi6AFD3.mjs → collectedComponentMetadata-BN8eg9Gr.mjs} +1903 -2296
  16. package/dist/metadata/{initMock-B7OlSKKb.mjs → initMock-J7pN8owj.mjs} +1 -1
  17. package/dist/metadata/style.css +1 -1
  18. package/dist/metadata/xmlui-metadata.mjs +1 -1
  19. package/dist/metadata/xmlui-metadata.umd.js +3 -3
  20. package/dist/scripts/package.json +1 -1
  21. package/dist/scripts/src/components/AppHeader/AppHeaderNative.js +1 -1
  22. package/dist/scripts/src/components/AutoComplete/AutoComplete.js +5 -1
  23. package/dist/scripts/src/components/AutoComplete/AutoCompleteNative.js +7 -4
  24. package/dist/scripts/src/components/Avatar/Avatar.js +1 -1
  25. package/dist/scripts/src/components/Charts/BarChart/BarChart.js +6 -6
  26. package/dist/scripts/src/components/Charts/BarChart/BarChartNative.js +25 -15
  27. package/dist/scripts/src/components/Charts/LineChart/LineChart.js +5 -5
  28. package/dist/scripts/src/components/Charts/LineChart/LineChartNative.js +14 -4
  29. package/dist/scripts/src/components/ColorPicker/ColorPicker.js +3 -3
  30. package/dist/scripts/src/components/ColorPicker/ColorPickerNative.js +33 -5
  31. package/dist/scripts/src/components/ComponentProvider.js +0 -6
  32. package/dist/scripts/src/components/DropdownMenu/DropdownMenuNative.js +1 -1
  33. package/dist/scripts/src/components/FileInput/FileInputNative.js +14 -10
  34. package/dist/scripts/src/components/FileUploadDropZone/FileUploadDropZoneNative.js +1 -1
  35. package/dist/scripts/src/components/Footer/FooterNative.js +1 -1
  36. package/dist/scripts/src/components/Form/Form.js +6 -0
  37. package/dist/scripts/src/components/Form/FormNative.js +18 -6
  38. package/dist/scripts/src/components/FormItem/FormItemNative.js +0 -9
  39. package/dist/scripts/src/components/FormItem/ItemWithLabel.js +5 -5
  40. package/dist/scripts/src/components/Fragment/Fragment.js +5 -1
  41. package/dist/scripts/src/components/Heading/Heading.js +0 -12
  42. package/dist/scripts/src/components/Icon/IconNative.js +24 -6
  43. package/dist/scripts/src/components/ModalDialog/ModalDialog.js +9 -1
  44. package/dist/scripts/src/components/ModalDialog/ModalDialogNative.js +6 -4
  45. package/dist/scripts/src/components/NumberBox/NumberBoxNative.js +208 -78
  46. package/dist/scripts/src/components/RadioGroup/RadioGroupNative.js +17 -1
  47. package/dist/scripts/src/components/Spinner/SpinnerNative.js +3 -2
  48. package/dist/scripts/src/components/Table/Table.js +8 -5
  49. package/dist/scripts/src/components/Table/TableNative.js +1 -1
  50. package/dist/scripts/src/components/Text/Text.js +0 -13
  51. package/dist/scripts/src/components/TextArea/TextAreaNative.js +8 -1
  52. package/dist/scripts/src/components/Theme/NotificationToast.js +4 -1
  53. package/dist/scripts/src/components-core/CompoundComponent.js +4 -4
  54. package/dist/scripts/src/components-core/RestApiProxy.js +4 -3
  55. package/dist/scripts/src/components-core/rendering/ComponentAdapter.js +1 -1
  56. package/dist/scripts/src/components-core/rendering/Container.js +19 -8
  57. package/dist/scripts/src/components-core/rendering/reducer.js +1 -1
  58. package/dist/scripts/src/components-core/theming/themes/root.js +13 -20
  59. package/dist/scripts/src/parsers/xmlui-parser/syntax-kind.js +9 -0
  60. package/dist/scripts/src/parsers/xmlui-parser/transform.js +2 -1
  61. package/dist/standalone/xmlui-standalone.es.d.ts +3 -1
  62. package/dist/standalone/xmlui-standalone.umd.js +36 -36
  63. package/package.json +1 -1
  64. package/dist/scripts/src/components/NumberBox/NumberBox2.js +0 -99
  65. package/dist/scripts/src/components/NumberBox/NumberBox2Native.js +0 -420
  66. package/dist/scripts/src/components/RadioGroup/RadioItem.js +0 -28
@@ -245,7 +245,8 @@ class RestApiProxy {
245
245
  const includeClientTxId = method && method !== "get" && !!transactionId;
246
246
  const headersWithoutContentType = Object.assign(Object.assign({}, this.getHeaders()), { ["Content-Type"]: undefined });
247
247
  let url = this.generateFullApiUrl(relativePath, queryParams);
248
- const aggregatedHeaders = (0, lodash_es_1.omitBy)(Object.assign(Object.assign({}, (body ? this.getHeaders() : headersWithoutContentType)), headers), lodash_es_1.isUndefined);
248
+ const hasBody = body !== undefined;
249
+ const aggregatedHeaders = (0, lodash_es_1.omitBy)(Object.assign(Object.assign({}, (hasBody ? this.getHeaders() : headersWithoutContentType)), headers), lodash_es_1.isUndefined);
249
250
  if (includeClientTxId) {
250
251
  aggregatedHeaders["x-ue-client-tx-id"] = transactionId;
251
252
  }
@@ -256,7 +257,7 @@ class RestApiProxy {
256
257
  }
257
258
  }
258
259
  let requestBody;
259
- if (rawBody) {
260
+ if (rawBody !== undefined) {
260
261
  requestBody = rawBody;
261
262
  }
262
263
  else {
@@ -277,7 +278,7 @@ class RestApiProxy {
277
278
  }
278
279
  }
279
280
  else {
280
- requestBody = body ? JSON.stringify(body) : undefined;
281
+ requestBody = hasBody ? JSON.stringify(body) : undefined;
281
282
  }
282
283
  }
283
284
  const options = {
@@ -146,7 +146,7 @@ const ComponentAdapter = (0, react_1.forwardRef)(function ComponentAdapter(_a, r
146
146
  return lookupAction(action, uid, Object.assign({ eventName }, actionOptions));
147
147
  }, [lookupAction, safeNode.events, uid]);
148
148
  // --- Set up the mouse event handlers for the component
149
- const mouseEventHandlers = (0, event_handlers_1.useMouseEventHandlers)(memoedLookupEventHandler, (descriptor === null || descriptor === void 0 ? void 0 : descriptor.nonVisual) || isApiBound);
149
+ const mouseEventHandlers = (0, event_handlers_1.useMouseEventHandlers)(memoedLookupEventHandler, (descriptor === null || descriptor === void 0 ? void 0 : descriptor.nonVisual) || isApiBound || isCompoundComponent);
150
150
  // --- Use the current theme to obtain resources and collect theme variables
151
151
  const { getResourceUrl } = (0, ThemeContext_1.useTheme)();
152
152
  // --- Obtain a function that can extract a resource URL from a logical URL
@@ -41,6 +41,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
41
41
  step((generator = generator.apply(thisArg, _arguments || [])).next());
42
42
  });
43
43
  };
44
+ var __rest = (this && this.__rest) || function (s, e) {
45
+ var t = {};
46
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
47
+ t[p] = s[p];
48
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
49
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
50
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
51
+ t[p[i]] = s[p[i]];
52
+ }
53
+ return t;
54
+ };
44
55
  var __importDefault = (this && this.__importDefault) || function (mod) {
45
56
  return (mod && mod.__esModule) ? mod : { "default": mod };
46
57
  };
@@ -67,9 +78,11 @@ const ThemeContext_1 = require("../theming/ThemeContext");
67
78
  const LoaderComponent_1 = require("../LoaderComponent");
68
79
  const constants_1 = require("../constants");
69
80
  const useApiInterceptorContext_1 = require("../interception/useApiInterceptorContext");
81
+ const mergeProps_1 = require("../utils/mergeProps");
70
82
  // React component to display a view container and implement its behavior
71
- exports.Container = (0, react_1.memo)((0, react_1.forwardRef)(function Container({ node, componentState, dispatch: containerDispatch, parentDispatch, resolvedKey, version, setVersion, statePartChanged, registerComponentApi: containerRegisterComponentApi, parentRegisterComponentApi, layoutContextRef, parentRenderContext, memoedVarsRef, isImplicit, uidInfoRef: parentUidInfoRef, children, }, ref) {
72
- var _a;
83
+ exports.Container = (0, react_1.memo)((0, react_1.forwardRef)(function Container(_a, ref) {
84
+ var _b;
85
+ var { node, componentState, dispatch: containerDispatch, parentDispatch, resolvedKey, version, setVersion, statePartChanged, registerComponentApi: containerRegisterComponentApi, parentRegisterComponentApi, layoutContextRef, parentRenderContext, memoedVarsRef, isImplicit, uidInfoRef: parentUidInfoRef, children } = _a, rest = __rest(_a, ["node", "componentState", "dispatch", "parentDispatch", "resolvedKey", "version", "setVersion", "statePartChanged", "registerComponentApi", "parentRegisterComponentApi", "layoutContextRef", "parentRenderContext", "memoedVarsRef", "isImplicit", "uidInfoRef", "children"]);
73
86
  const { apiBoundContainer } = node;
74
87
  const dispatch = isImplicit ? parentDispatch : containerDispatch;
75
88
  const registerComponentApi = isImplicit
@@ -434,7 +447,7 @@ exports.Container = (0, react_1.memo)((0, react_1.forwardRef)(function Container
434
447
  delete fnsRef.current[uid];
435
448
  });
436
449
  // --- The container wraps the `renderChild` function to provide that to the child components
437
- const stableRenderChild = (0, react_1.useCallback)((childNode, lc, pRenderContext, uidInfoRef, ref) => {
450
+ const stableRenderChild = (0, react_1.useCallback)((childNode, lc, pRenderContext, uidInfoRef, ref, rest) => {
438
451
  // TODO: Check if this is a valid use case
439
452
  if (typeof childNode === "string") {
440
453
  throw Error("should be resolved for now");
@@ -499,9 +512,7 @@ exports.Container = (0, react_1.memo)((0, react_1.forwardRef)(function Container
499
512
  // --- `ref` with the parent's `ref`. This allows the parent to access the child's
500
513
  // --- DOM node. Otherwise, we use the child as is.
501
514
  return ref && renderedChildren[0] && (0, react_1.isValidElement)(renderedChildren[0])
502
- ? react_1.default.cloneElement(renderedChildren[0], {
503
- ref: (0, react_compose_refs_1.composeRefs)(ref, renderedChildren[0].ref),
504
- })
515
+ ? react_1.default.cloneElement(renderedChildren[0], Object.assign({ ref: (0, react_compose_refs_1.composeRefs)(ref, renderedChildren[0].ref) }, (0, mergeProps_1.mergeProps)(renderedChildren[0].props, rest)))
505
516
  : renderedChildren[0];
506
517
  }
507
518
  // --- Done.
@@ -518,7 +529,7 @@ exports.Container = (0, react_1.memo)((0, react_1.forwardRef)(function Container
518
529
  cleanup,
519
530
  ]);
520
531
  // --- Log the component state if you need it for debugging
521
- if ((_a = node.props) === null || _a === void 0 ? void 0 : _a.debug) {
532
+ if ((_b = node.props) === null || _b === void 0 ? void 0 : _b.debug) {
522
533
  console.log(`Container: ${resolvedKey}`, {
523
534
  componentState,
524
535
  node,
@@ -530,7 +541,7 @@ exports.Container = (0, react_1.memo)((0, react_1.forwardRef)(function Container
530
541
  const uidInfo = {};
531
542
  const thisUidInfoRef = (0, react_1.useRef)({});
532
543
  const uidInfoRef = node.uses === undefined ? parentUidInfoRef : thisUidInfoRef;
533
- const renderedChildren = stableRenderChild(node.children, layoutContextRef === null || layoutContextRef === void 0 ? void 0 : layoutContextRef.current, parentRenderContext, uidInfoRef, ref);
544
+ const renderedChildren = stableRenderChild(node.children, layoutContextRef === null || layoutContextRef === void 0 ? void 0 : layoutContextRef.current, parentRenderContext, uidInfoRef, ref, rest);
534
545
  const renderedLoaders = renderLoaders({
535
546
  uidInfo,
536
547
  uidInfoRef,
@@ -104,7 +104,7 @@ function createContainerReducer(debugView) {
104
104
  (0, lodash_es_1.setWith)(state, path, value, (nsValue, key, nsObject) => {
105
105
  tempValueInLocalVars = tempValueInLocalVars === null || tempValueInLocalVars === void 0 ? void 0 : tempValueInLocalVars[key];
106
106
  if (nsValue === undefined &&
107
- tempValueInLocalVars === undefined &&
107
+ (0, lodash_es_1.isPlainObject)(tempValueInLocalVars) &&
108
108
  (0, lodash_es_1.isPlainObject)(target)) {
109
109
  // if we are setting a new object's key, lodash defaults it to an array, if the key is a number.
110
110
  // This way we can force it to be an object.
@@ -145,7 +145,7 @@ exports.RootThemeDefinition = {
145
145
  "outlineStyle--focus": "solid",
146
146
  "outlineOffset--focus": "0",
147
147
  // --- The app's default font family
148
- "fontFamily": "$fontFamily-sans-serif",
148
+ fontFamily: "$fontFamily-sans-serif",
149
149
  // --- Various font sizes (relative to the current context)
150
150
  "fontSize-tiny": "0.625rem",
151
151
  "fontSize-xs": "0.75rem",
@@ -162,23 +162,16 @@ exports.RootThemeDefinition = {
162
162
  "fontSize-7xl": "4.5rem",
163
163
  "fontSize-8xl": "6rem",
164
164
  "fontSize-9xl": "8rem",
165
- // --- Various line height values
166
- "lineHeight-tiny": "calc(0.85 / 0.625)", // 1.36
167
- "lineHeight-xs": "calc(1 / 0.75)", // 1.33
168
- "lineHeight-sm": "calc(1.25 / 0.875)", // 1.43
169
- "lineHeight-base": "calc(1.5 / 1)", // 1.5
170
- "lineHeight-lg": "calc(1.75 / 1.125)", // 1.56
171
- "lineHeight-xl": "calc(1.75 / 1.25)", // 1.4
172
- "lineHeight-2xl": "calc(2 / 1.5)", // 1.33
173
- "lineHeight-3xl": "calc(2.25 / 1.875)", // 1.2
174
- "lineHeight-4xl": "calc(2.5 / 2.25)", // 1.11
175
- "lineHeight-5xl": "1",
176
- "lineHeight-6xl": "1",
177
- "lineHeight-7xl": "1",
178
- "lineHeight-8xl": "1",
179
- "lineHeight-9xl": "1",
180
165
  // --- The default font size
181
- "fontSize": "$fontSize-base",
166
+ fontSize: "$fontSize-base",
167
+ // --- Various line height values
168
+ // --- Default line height values (relative to the base unit, "space-base")
169
+ "lineHeight-none": "1",
170
+ "lineHeight-tight": "1.25",
171
+ "lineHeight-snug": "1.375",
172
+ "lineHeight-normal": "1.5",
173
+ "lineHeight-relaxed": "1.625",
174
+ "lineHeight-loose": "2",
182
175
  // --- Predefined gap sizes
183
176
  "gap-none": "$space-0",
184
177
  "gap-tight": "$space-2",
@@ -195,7 +188,7 @@ exports.RootThemeDefinition = {
195
188
  "space-normal": "$space-4",
196
189
  "space-loose": "$space-8",
197
190
  // --- Font used for body
198
- "fontWeight": "$fontWeight-normal",
191
+ fontWeight: "$fontWeight-normal",
199
192
  // --- Various default values (review them)
200
193
  "borderColor-dropdown-item": "$borderColor",
201
194
  // --- Various predefined shadow values
@@ -209,14 +202,14 @@ exports.RootThemeDefinition = {
209
202
  // --- The default maximum content width
210
203
  "maxWidth-content": "1320px",
211
204
  // --- Background colors
212
- "backgroundColor": "$color-surface-subtle",
205
+ backgroundColor: "$color-surface-subtle",
213
206
  "backgroundColor-overlay": "rgba(0, 0, 0, 0.2)",
214
207
  "backgroundColor-dropdown-item--hover": $colorSurface50,
215
208
  "backgroundColor-dropdown-item--active": $colorSurface100,
216
209
  "backgroundColor-dropdown-item--active-hover": $colorSurface50,
217
210
  "backgroundColor-tree-row--selected--before": $colorPrimary50,
218
211
  // --- Border colors
219
- "borderColor": "rgb(from $color-surface-900 r g b / 0.1)",
212
+ borderColor: "rgb(from $color-surface-900 r g b / 0.1)",
220
213
  "borderColor--disabled": $colorSurface100,
221
214
  // --- Text colors
222
215
  "textColor-secondary": $colorSurface600,
@@ -15,14 +15,23 @@ var SyntaxKind;
15
15
  SyntaxKind[SyntaxKind["WhitespaceTrivia"] = 4] = "WhitespaceTrivia";
16
16
  // Effective tokens
17
17
  SyntaxKind[SyntaxKind["Identifier"] = 5] = "Identifier";
18
+ /** < */
18
19
  SyntaxKind[SyntaxKind["OpenNodeStart"] = 6] = "OpenNodeStart";
20
+ /** </ */
19
21
  SyntaxKind[SyntaxKind["CloseNodeStart"] = 7] = "CloseNodeStart";
22
+ /** > */
20
23
  SyntaxKind[SyntaxKind["NodeEnd"] = 8] = "NodeEnd";
24
+ /** /> */
21
25
  SyntaxKind[SyntaxKind["NodeClose"] = 9] = "NodeClose";
26
+ /** : */
22
27
  SyntaxKind[SyntaxKind["Colon"] = 10] = "Colon";
28
+ /** = */
23
29
  SyntaxKind[SyntaxKind["Equal"] = 11] = "Equal";
30
+ /** string literal */
24
31
  SyntaxKind[SyntaxKind["StringLiteral"] = 12] = "StringLiteral";
32
+ /** <![CDATA[ ... ]]> */
25
33
  SyntaxKind[SyntaxKind["CData"] = 13] = "CData";
34
+ /** <script>...</script> */
26
35
  SyntaxKind[SyntaxKind["Script"] = 14] = "Script";
27
36
  // A token created by the parser which contains arbitrary text, but not the '<' character
28
37
  SyntaxKind[SyntaxKind["TextNode"] = 15] = "TextNode";
@@ -304,7 +304,8 @@ function nodeToComponentDef(node, originalGetText, fileId) {
304
304
  }
305
305
  catch (err) {
306
306
  if (parser.errors && parser.errors.length > 0) {
307
- comp.scriptError = parser.errors;
307
+ const errMsg = parser.errors[0];
308
+ throw new ParserError_1.ParserError(`${errMsg.text} [${errMsg.line}: ${errMsg.column}]`, errMsg.code);
308
309
  }
309
310
  else {
310
311
  comp.scriptError = err;
@@ -828,6 +828,8 @@ declare interface IconBaseProps extends default_2.SVGAttributes<SVGElement> {
828
828
  fallback?: string;
829
829
  style?: CSSProperties;
830
830
  className?: string;
831
+ tabIndex?: number;
832
+ onKeyDown?: default_2.KeyboardEventHandler<any>;
831
833
  }
832
834
 
833
835
  declare type IconPosition = (typeof iconPositionValues)[number];
@@ -1190,7 +1192,7 @@ declare interface ReactiveVarDeclaration extends ExpressionBase {
1190
1192
 
1191
1193
  declare type RegisterComponentApiFn = (componentApi: ComponentApi) => void;
1192
1194
 
1193
- declare type RenderChildFn<L extends ComponentDef = ComponentDef> = (children?: ComponentDef | ComponentDef[] | DynamicChildComponentDef | DynamicChildComponentDef[] | string, layoutContext?: LayoutContext<L>, parentRenderContext?: ParentRenderContext, uidInfoRef?: RefObject<Record<string, any>>, ref?: ForwardedRef<any>) => ReactNode | ReactNode[];
1195
+ declare type RenderChildFn<L extends ComponentDef = ComponentDef> = (children?: ComponentDef | ComponentDef[] | DynamicChildComponentDef | DynamicChildComponentDef[] | string, layoutContext?: LayoutContext<L>, parentRenderContext?: ParentRenderContext, uidInfoRef?: RefObject<Record<string, any>>, ref?: ForwardedRef<any>, rest?: Record<string, any>) => ReactNode | ReactNode[];
1194
1196
 
1195
1197
  declare interface RendererContext<TMd extends ComponentMetadata = ComponentMetadata> extends ComponentRendererContextBase<TMd> {
1196
1198
  uid: symbol;