xmlui 0.9.11 → 0.9.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 (62) hide show
  1. package/dist/{apiInterceptorWorker-BZP06llg.mjs → apiInterceptorWorker-BUaYCWe6.mjs} +1 -1
  2. package/dist/core-XLM8cuFP.mjs +7491 -0
  3. package/dist/{index-CFJ5_K_a.mjs → index-DiCe0Ajo.mjs} +1848 -872
  4. package/dist/index.css +150 -130
  5. package/dist/language-server-web-worker.mjs +1 -1
  6. package/dist/language-server.mjs +1 -1
  7. package/dist/{lint-CiMcsEWf.mjs → lint-Cd70ckJ6.mjs} +84 -94
  8. package/dist/{parser-mzWvH7dz.mjs → parser-CBXS8ft2.mjs} +19 -17
  9. package/dist/scripts/bin/build-lib.js +42 -1
  10. package/dist/scripts/bin/vite-xmlui-plugin.js +2 -22
  11. package/dist/scripts/bin/viteConfig.js +3 -1
  12. package/dist/scripts/src/abstractions/ComponentDefs.js +2 -20
  13. package/dist/scripts/src/components/App/App.js +61 -21
  14. package/dist/scripts/src/components/Button/Button.js +5 -1
  15. package/dist/scripts/src/components/Button/ButtonNative.js +9 -2
  16. package/dist/scripts/src/components/Checkbox/Checkbox.js +2 -2
  17. package/dist/scripts/src/components/ComponentProvider.js +2 -0
  18. package/dist/scripts/src/components/Footer/Footer.js +1 -1
  19. package/dist/scripts/src/components/Form/FormContext.js +2 -0
  20. package/dist/scripts/src/components/Form/FormNative.js +8 -2
  21. package/dist/scripts/src/components/Form/formActions.js +5 -4
  22. package/dist/scripts/src/components/FormItem/FormItemNative.js +25 -12
  23. package/dist/scripts/src/components/Items/Items.js +2 -1
  24. package/dist/scripts/src/components/List/List.js +2 -1
  25. package/dist/scripts/src/components/Markdown/Markdown.js +3 -0
  26. package/dist/scripts/src/components/Markdown/MarkdownNative.js +13 -10
  27. package/dist/scripts/src/components/NavPanel/NavPanel.js +2 -2
  28. package/dist/scripts/src/components/NumberBox/NumberBox2.js +85 -0
  29. package/dist/scripts/src/components/NumberBox/NumberBox2Native.js +395 -0
  30. package/dist/scripts/src/components/NumberBox/numberbox-abstractions.js +35 -0
  31. package/dist/scripts/src/components/Option/Option.js +2 -1
  32. package/dist/scripts/src/components/Select/Select.js +8 -0
  33. package/dist/scripts/src/components/Select/SelectNative.js +24 -10
  34. package/dist/scripts/src/components/SelectionStore/SelectionStore.js +1 -1
  35. package/dist/scripts/src/components/SelectionStore/SelectionStoreNative.js +10 -7
  36. package/dist/scripts/src/components/Theme/ThemeNative.js +1 -0
  37. package/dist/scripts/src/components/VisuallyHidden.js +21 -0
  38. package/dist/scripts/src/components-core/loader/DataLoader.js +110 -3
  39. package/dist/scripts/src/components-core/loader/Loader.js +29 -7
  40. package/dist/scripts/src/components-core/rendering/ComponentAdapter.js +4 -1
  41. package/dist/scripts/src/components-core/rendering/ComponentWrapper.js +23 -5
  42. package/dist/scripts/src/components-core/rendering/Container.js +23 -26
  43. package/dist/scripts/src/components-core/rendering/StateContainer.js +2 -4
  44. package/dist/scripts/src/components-core/rendering/reducer.js +6 -5
  45. package/dist/scripts/src/components-core/script-runner/eval-tree-async.js +2 -2
  46. package/dist/scripts/src/components-core/script-runner/eval-tree-sync.js +10 -2
  47. package/dist/scripts/src/components-core/utils/extractParam.js +24 -7
  48. package/dist/scripts/src/components-core/xmlui-parser.js +1 -1
  49. package/dist/scripts/src/parsers/xmlui-parser/parser.js +1 -1
  50. package/dist/scripts/src/parsers/xmlui-parser/transform.js +0 -10
  51. package/dist/scripts/src/parsers/xmlui-parser/utils.js +6 -9
  52. package/dist/{server-common-DxRVCeIE.mjs → server-common-DW5h7Q34.mjs} +122 -64
  53. package/dist/style.css +150 -130
  54. package/dist/xmlui-metadata.mjs +901 -316
  55. package/dist/xmlui-metadata.umd.js +901 -318
  56. package/dist/xmlui-parser.d.ts +14 -9
  57. package/dist/xmlui-parser.mjs +34 -34
  58. package/dist/xmlui-standalone.umd.js +7473 -5421
  59. package/dist/xmlui.d.ts +15 -1
  60. package/dist/xmlui.mjs +2 -1
  61. package/package.json +5 -5
  62. package/dist/core-C-osEDc2.mjs +0 -2
@@ -1,4 +1,4 @@
1
- import { m as main, s as start } from "./server-common-DxRVCeIE.mjs";
1
+ import { m as main, s as start } from "./server-common-DW5h7Q34.mjs";
2
2
  var browser = main;
3
3
  const messageReader = new browser.BrowserMessageReader(self);
4
4
  messageReader.listen((message) => {
@@ -1,4 +1,4 @@
1
- import { m as main, s as start$1 } from "./server-common-DxRVCeIE.mjs";
1
+ import { m as main, s as start$1 } from "./server-common-DW5h7Q34.mjs";
2
2
  var node = main;
3
3
  function start() {
4
4
  const connection = node.createConnection(node.ProposedFeatures.all);
@@ -1,5 +1,5 @@
1
1
  import { parseRegExpLiteral } from "@eslint-community/regexpp";
2
- import { S as SyntaxKind, C as CharacterCodes } from "./parser-mzWvH7dz.mjs";
2
+ import { S as SyntaxKind, C as CharacterCodes } from "./parser-CBXS8ft2.mjs";
3
3
  const LinkTargetMd = [
4
4
  {
5
5
  value: "_self",
@@ -5541,7 +5541,6 @@ function nodeToComponentDef(node, originalGetText, fileId) {
5541
5541
  const shouldCollapseWhitespace = tagName !== "event" && tagName !== "method";
5542
5542
  const attrs = getAttributes(node2);
5543
5543
  desugarKeyOnlyAttrs(attrs);
5544
- desugarQuotelessAttrs(attrs, getText);
5545
5544
  parseEscapeCharactersInAttrValues(attrs);
5546
5545
  parseEscapeCharactersInContent(childNodes);
5547
5546
  mergeConsecutiveTexts(childNodes, shouldCollapseWhitespace);
@@ -5910,15 +5909,6 @@ function desugarKeyOnlyAttrs(attrs) {
5910
5909
  }
5911
5910
  }
5912
5911
  }
5913
- function desugarQuotelessAttrs(attrs, getText) {
5914
- var _a, _b, _c;
5915
- for (let attr of attrs) {
5916
- const attrValue = (_a = attr.children) == null ? void 0 : _a[2];
5917
- if (((_c = (_b = attr.children) == null ? void 0 : _b[2]) == null ? void 0 : _c.kind) === SyntaxKind.Identifier) {
5918
- attrValue.text = '"' + getText(attrValue) + '"';
5919
- }
5920
- }
5921
- }
5922
5912
  function addToNamespaces(namespaceStack, comp, nsKey, value) {
5923
5913
  let nsCommaSeparated = value.split(":");
5924
5914
  if (nsCommaSeparated.length > 2) {
@@ -6239,89 +6229,89 @@ function implicitProp(name) {
6239
6229
  return implicitPropNames.includes(name);
6240
6230
  }
6241
6231
  export {
6242
- T_BLOCK_STATEMENT as $,
6243
- T_IDENTIFIER as A,
6244
- T_PREFIX_OP_EXPRESSION as B,
6245
- COMPOUND_COMP_ID as C,
6246
- T_FUNCTION_DECLARATION as D,
6247
- T_ARROW_EXPRESSION as E,
6248
- createXmlUiTreeNodeId as F,
6249
- T_EMPTY_STATEMENT as G,
6250
- T_SWITCH_STATEMENT as H,
6251
- T_TRY_STATEMENT as I,
6252
- T_THROW_STATEMENT as J,
6253
- T_FOR_OF_STATEMENT as K,
6254
- LintSeverity as L,
6255
- T_FOR_IN_STATEMENT as M,
6256
- T_FOR_STATEMENT as N,
6257
- T_EXPRESSION_STATEMENT as O,
6258
- ParserError2 as P,
6259
- T_BREAK_STATEMENT as Q,
6260
- T_CONTINUE_STATEMENT as R,
6261
- T_DO_WHILE_STATEMENT as S,
6232
+ VariantPropsKeys as $,
6233
+ T_DO_WHILE_STATEMENT as A,
6234
+ T_WHILE_STATEMENT as B,
6235
+ T_RETURN_STATEMENT as C,
6236
+ T_IF_STATEMENT as D,
6237
+ T_CONST_STATEMENT as E,
6238
+ T_LET_STATEMENT as F,
6239
+ T_ARROW_EXPRESSION_STATEMENT as G,
6240
+ T_BLOCK_STATEMENT as H,
6241
+ T_VAR_STATEMENT as I,
6242
+ T_ASSIGNMENT_EXPRESSION as J,
6243
+ T_LITERAL as K,
6244
+ LinkTargetMd as L,
6245
+ T_SPREAD_EXPRESSION as M,
6246
+ T_FUNCTION_INVOCATION_EXPRESSION as N,
6247
+ T_POSTFIX_OP_EXPRESSION as O,
6248
+ Parser as P,
6249
+ T_CONDITIONAL_EXPRESSION as Q,
6250
+ T_BINARY_EXPRESSION as R,
6251
+ T_UNARY_EXPRESSION as S,
6262
6252
  T_CALCULATED_MEMBER_ACCESS_EXPRESSION as T,
6263
- UCRegex as U,
6264
- T_WHILE_STATEMENT as V,
6265
- T_RETURN_STATEMENT as W,
6266
- T_IF_STATEMENT as X,
6267
- T_CONST_STATEMENT as Y,
6268
- T_LET_STATEMENT as Z,
6269
- T_ARROW_EXPRESSION_STATEMENT as _,
6270
- codeBehindFileExtension as a,
6271
- T_VAR_STATEMENT as a0,
6272
- T_ASSIGNMENT_EXPRESSION as a1,
6273
- T_LITERAL as a2,
6274
- T_SPREAD_EXPRESSION as a3,
6275
- T_FUNCTION_INVOCATION_EXPRESSION as a4,
6276
- T_POSTFIX_OP_EXPRESSION as a5,
6277
- T_CONDITIONAL_EXPRESSION as a6,
6278
- T_BINARY_EXPRESSION as a7,
6279
- T_UNARY_EXPRESSION as a8,
6280
- T_OBJECT_LITERAL as a9,
6281
- T_ARRAY_LITERAL as aa,
6282
- T_SEQUENCE_EXPRESSION as ab,
6283
- T_TEMPLATE_LITERAL_EXPRESSION as ac,
6284
- T_VAR_DECLARATION as ad,
6285
- T_DESTRUCTURE as ae,
6286
- TextVariantElement as af,
6287
- VariantPropsKeys as ag,
6288
- variantOptionsMd as ah,
6289
- scrollAnchoringValues as ai,
6290
- buttonThemeNames as aj,
6291
- iconPositionNames as ak,
6292
- buttonVariantNames as al,
6293
- triggerPositionNames as am,
6294
- statusColorMd as an,
6295
- placementMd as ao,
6296
- httpMethodNames as ap,
6297
- PARSED_MARK_PROP as aq,
6298
- layoutOptionKeys as ar,
6299
- viewportSizeNames as as,
6300
- collectCodeBehindFromSource as at,
6301
- removeCodeBehindTokensFromTree as au,
6302
- LintDiagKind as b,
6303
- componentFileExtension as c,
6304
- lintErrorsComponent as d,
6305
- lint as e,
6306
- errorMessages as f,
6307
- getLintSeverity as g,
6308
- CORE_NAMESPACE_VALUE as h,
6309
- labelPositionMd as i,
6310
- orientationOptionMd as j,
6311
- alignmentOptionValues as k,
6312
- lintApp as l,
6313
- moduleFileExtension as m,
6314
- nodeToComponentDef as n,
6315
- onPrefixRegex as o,
6316
- printComponentLints as p,
6317
- LinkTargetMd as q,
6318
- alignmentOptionMd as r,
6319
- iconPositionMd as s,
6320
- buttonTypesMd as t,
6321
- sizeMd as u,
6253
+ T_OBJECT_LITERAL as U,
6254
+ T_ARRAY_LITERAL as V,
6255
+ T_SEQUENCE_EXPRESSION as W,
6256
+ T_TEMPLATE_LITERAL_EXPRESSION as X,
6257
+ T_VAR_DECLARATION as Y,
6258
+ T_DESTRUCTURE as Z,
6259
+ TextVariantElement as _,
6260
+ alignmentOptionValues as a,
6261
+ variantOptionsMd as a0,
6262
+ scrollAnchoringValues as a1,
6263
+ buttonThemeNames as a2,
6264
+ iconPositionNames as a3,
6265
+ buttonVariantNames as a4,
6266
+ nodeToComponentDef as a5,
6267
+ triggerPositionNames as a6,
6268
+ statusColorMd as a7,
6269
+ placementMd as a8,
6270
+ httpMethodNames as a9,
6271
+ PARSED_MARK_PROP as aa,
6272
+ layoutOptionKeys as ab,
6273
+ viewportSizeNames as ac,
6274
+ componentFileExtension as ad,
6275
+ codeBehindFileExtension as ae,
6276
+ getLintSeverity as af,
6277
+ LintSeverity as ag,
6278
+ lintApp as ah,
6279
+ printComponentLints as ai,
6280
+ lintErrorsComponent as aj,
6281
+ collectCodeBehindFromSource as ak,
6282
+ removeCodeBehindTokensFromTree as al,
6283
+ COMPOUND_COMP_ID as am,
6284
+ moduleFileExtension as an,
6285
+ LintDiagKind as ao,
6286
+ lint as ap,
6287
+ ParserError2 as aq,
6288
+ errorMessages as ar,
6289
+ UCRegex as as,
6290
+ onPrefixRegex as at,
6291
+ CORE_NAMESPACE_VALUE as au,
6292
+ alignmentOptionMd as b,
6293
+ buttonTypesMd as c,
6294
+ buttonThemeMd as d,
6295
+ buttonVariantMd as e,
6296
+ T_MEMBER_ACCESS_EXPRESSION as f,
6297
+ T_IDENTIFIER as g,
6298
+ T_PREFIX_OP_EXPRESSION as h,
6299
+ iconPositionMd as i,
6300
+ T_FUNCTION_DECLARATION as j,
6301
+ T_ARROW_EXPRESSION as k,
6302
+ labelPositionMd as l,
6303
+ createXmlUiTreeNodeId as m,
6304
+ T_EMPTY_STATEMENT as n,
6305
+ orientationOptionMd as o,
6306
+ T_SWITCH_STATEMENT as p,
6307
+ T_TRY_STATEMENT as q,
6308
+ T_THROW_STATEMENT as r,
6309
+ sizeMd as s,
6310
+ T_FOR_OF_STATEMENT as t,
6311
+ T_FOR_IN_STATEMENT as u,
6322
6312
  validationStatusMd as v,
6323
- buttonThemeMd as w,
6324
- buttonVariantMd as x,
6325
- Parser as y,
6326
- T_MEMBER_ACCESS_EXPRESSION as z
6313
+ T_FOR_STATEMENT as w,
6314
+ T_EXPRESSION_STATEMENT as x,
6315
+ T_BREAK_STATEMENT as y,
6316
+ T_CONTINUE_STATEMENT as z
6327
6317
  };
@@ -671,12 +671,15 @@ function tagNameNodesWithoutErrorsMatch(name1, name2, getText) {
671
671
  }
672
672
  function findTokenAtPos(node, position) {
673
673
  const chain = [node];
674
- let chainBeforePos;
675
674
  let sharedParents;
676
675
  if (node.start > position || position > node.end) {
677
676
  return void 0;
678
677
  }
679
- const res = { chainAtPos: chain };
678
+ const res = {
679
+ chainAtPos: chain,
680
+ chainBeforePos: void 0,
681
+ sharedParents: void 0
682
+ };
680
683
  while (node.children !== void 0 && node.children.length > 0) {
681
684
  const nodeAtPosIdx = node.children.findIndex(
682
685
  (n) => n.start <= position && (position < n.end || n.kind === SyntaxKind.EndOfFileToken && n.start <= n.end)
@@ -685,9 +688,8 @@ function findTokenAtPos(node, position) {
685
688
  const nodeBeforePos = node.children[nodeAtPosIdx - 1];
686
689
  if (nodeBeforePos !== void 0 && position <= nodeAtPos.pos) {
687
690
  sharedParents = chain.length;
688
- chainBeforePos = findLastToken(nodeBeforePos);
689
691
  return {
690
- chainBeforePos,
692
+ chainBeforePos: chain.concat(findLastToken(nodeBeforePos)),
691
693
  sharedParents,
692
694
  chainAtPos: chain.concat(findFirstToken(nodeAtPos))
693
695
  };
@@ -881,7 +883,7 @@ function parseXmlUiMarkup(text) {
881
883
  }
882
884
  }
883
885
  if (eat(SyntaxKind.Equal)) {
884
- if (!eat(SyntaxKind.StringLiteral) && !eat(SyntaxKind.Identifier)) {
886
+ if (!eat(SyntaxKind.StringLiteral)) {
885
887
  const attrFollowWithoutIdent = [SyntaxKind.NodeEnd, SyntaxKind.NodeClose];
886
888
  errRecover(Diag_Attr_Value_Expected, attrFollowWithoutIdent);
887
889
  }
@@ -1169,19 +1171,19 @@ export {
1169
1171
  SyntaxKind as S,
1170
1172
  Diag_Invalid_Character as a,
1171
1173
  Diag_Unterminated_String_Literal as b,
1172
- Diag_Unterminated_Comment as c,
1174
+ createXmlUiParser as c,
1173
1175
  diagnosticCategoryName as d,
1174
- Diag_Unterminated_CData as e,
1175
- Diag_Unterminated_Script as f,
1176
- Diag_End_Token_Expected as g,
1177
- Diag_CloseNodeStart_Token_Expected as h,
1178
- Diag_Tag_Identifier_Expected as i,
1179
- Diag_Attr_Value_Expected as j,
1180
- Diag_Eq_Token_Expected as k,
1181
- Diag_OpenNodeStart_Token_Expected as l,
1182
- Diag_End_Or_Close_Token_Expected as m,
1183
- Diag_Attr_Identifier_Expected as n,
1184
- createXmlUiParser as o,
1176
+ Diag_Unterminated_Comment as e,
1177
+ Diag_Unterminated_CData as f,
1178
+ Diag_Unterminated_Script as g,
1179
+ Diag_End_Token_Expected as h,
1180
+ Diag_CloseNodeStart_Token_Expected as i,
1181
+ Diag_Tag_Identifier_Expected as j,
1182
+ Diag_Attr_Value_Expected as k,
1183
+ Diag_Eq_Token_Expected as l,
1184
+ Diag_OpenNodeStart_Token_Expected as m,
1185
+ Diag_End_Or_Close_Token_Expected as n,
1186
+ Diag_Attr_Identifier_Expected as o,
1185
1187
  parseXmlUiMarkup as p,
1186
1188
  createScanner as q,
1187
1189
  isIdentifierStart as r,
@@ -1,5 +1,38 @@
1
1
  #!/usr/bin/env node
2
2
  "use strict";
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
16
+ }) : function(o, v) {
17
+ o["default"] = v;
18
+ });
19
+ var __importStar = (this && this.__importStar) || (function () {
20
+ var ownKeys = function(o) {
21
+ ownKeys = Object.getOwnPropertyNames || function (o) {
22
+ var ar = [];
23
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
24
+ return ar;
25
+ };
26
+ return ownKeys(o);
27
+ };
28
+ return function (mod) {
29
+ if (mod && mod.__esModule) return mod;
30
+ var result = {};
31
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
32
+ __setModuleDefault(result, mod);
33
+ return result;
34
+ };
35
+ })();
3
36
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
4
37
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
5
38
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -23,6 +56,14 @@ const buildLib = (_a) => __awaiter(void 0, [_a], void 0, function* ({ watchMode,
23
56
  const env = (0, vite_1.loadEnv)(mode, process.cwd(), "");
24
57
  const umdFileName = `${env.npm_package_name}.js`;
25
58
  const esFileName = `${env.npm_package_name}.mjs`;
59
+ let overrides = {};
60
+ try {
61
+ const configOverrides = yield Promise.resolve(`${process.cwd() + `/vite.config-overrides`}`).then(s => __importStar(require(s)));
62
+ overrides = configOverrides.default || {};
63
+ }
64
+ catch (e) {
65
+ // console.error(e);
66
+ }
26
67
  const config = {
27
68
  esbuild: {
28
69
  target: "es2020",
@@ -70,7 +111,7 @@ const buildLib = (_a) => __awaiter(void 0, [_a], void 0, function* ({ watchMode,
70
111
  },
71
112
  },
72
113
  },
73
- plugins: mode === "metadata" ? [] : [(0, plugin_react_1.default)(), (0, vite_plugin_lib_inject_css_1.libInjectCss)()],
114
+ plugins: mode === "metadata" ? [] : [(0, plugin_react_1.default)(), (0, vite_plugin_lib_inject_css_1.libInjectCss)(), ...(overrides.plugins || [])],
74
115
  };
75
116
  yield (0, vite_1.build)((0, vite_1.defineConfig)(config));
76
117
  });
@@ -47,7 +47,6 @@ const pluginutils_1 = require("@rollup/pluginutils");
47
47
  const code_behind_collect_1 = require("../src/parsers/scripting/code-behind-collect");
48
48
  const fileExtensions_1 = require("../src/parsers/xmlui-parser/fileExtensions");
49
49
  const Parser_1 = require("../src/parsers/scripting/Parser");
50
- const fs = __importStar(require("fs"));
51
50
  const path = __importStar(require("path"));
52
51
  const xmlui_parser_1 = require("../src/components-core/xmlui-parser");
53
52
  const xmluiExtension = new RegExp(`.${fileExtensions_1.componentFileExtension}$`);
@@ -65,28 +64,9 @@ function viteXmluiPlugin(pluginOptions = {}) {
65
64
  const moduleNameResolver = (moduleName) => {
66
65
  return path.resolve(path.dirname(id), moduleName);
67
66
  };
68
- const moduleResolver = (parentModule, moduleName) => {
69
- // --- Try with .xmlui.xs extension, and then with .xs.
70
- try {
71
- const modulePath = path.resolve(path.dirname(id), `${moduleName}.${fileExtensions_1.codeBehindFileExtension}`);
72
- return fs.readFileSync(modulePath, {
73
- encoding: "utf8",
74
- });
75
- }
76
- catch (_a) {
77
- try {
78
- return fs.readFileSync(path.resolve(path.dirname(id), `${moduleName}.${fileExtensions_1.moduleFileExtension}`), {
79
- encoding: "utf8",
80
- });
81
- }
82
- catch (err) {
83
- throw err;
84
- }
85
- }
86
- };
87
67
  if (xmluiExtension.test(id)) {
88
68
  const fileId = "" + itemIndex++;
89
- let { component, errors, erroneousCompoundComponentName } = (0, xmlui_parser_1.xmlUiMarkupToComponent)(code, fileId, moduleResolver);
69
+ let { component, errors, erroneousCompoundComponentName } = (0, xmlui_parser_1.xmlUiMarkupToComponent)(code, fileId);
90
70
  if (errors.length > 0) {
91
71
  component = (0, xmlui_parser_1.errReportComponent)(errors, id, erroneousCompoundComponentName);
92
72
  }
@@ -115,7 +95,7 @@ function viteXmluiPlugin(pluginOptions = {}) {
115
95
  // Check, if codeBehind.moduleErrors is not empty (Record<string, ModuleErrors[]>); each module
116
96
  // should be checked for errors and warnings. If there are errors, throw an error.
117
97
  return {
118
- code: (0, pluginutils_1.dataToEsm)(codeBehind),
98
+ code: (0, pluginutils_1.dataToEsm)(Object.assign(Object.assign({}, codeBehind), { src: code })),
119
99
  map: { mappings: "" },
120
100
  };
121
101
  }
@@ -61,7 +61,9 @@ function getViteConfig() {
61
61
  const configOverrides = yield Promise.resolve(`${process.cwd() + `/vite.config-overrides`}`).then(s => __importStar(require(s)));
62
62
  overrides = configOverrides.default || {};
63
63
  }
64
- catch (e) { }
64
+ catch (e) {
65
+ // console.error(e);
66
+ }
65
67
  return (0, vite_1.defineConfig)({
66
68
  plugins: [(0, plugin_react_1.default)(), (0, vite_plugin_svgr_1.default)(), (0, vite_plugin_yaml_1.default)(), (0, vite_xmlui_plugin_1.default)({}), ...(overrides.plugins || [])],
67
69
  base: withRelativeRoot ? "" : undefined,
@@ -2,26 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createMetadata = createMetadata;
4
4
  exports.d = d;
5
- function createMetadata({ description, shortDescription, specializedFrom, status, props, events, contextVars, apis, nonVisual, opaque, themeVars, themeVarDescriptions, defaultThemeVars, toneSpecificThemeVars, allowArbitraryProps, docFolder, isHtmlTag, }) {
6
- return {
7
- description,
8
- shortDescription,
9
- specializedFrom,
10
- status,
11
- props,
12
- events,
13
- contextVars,
14
- apis,
15
- nonVisual,
16
- opaque,
17
- themeVars,
18
- defaultThemeVars,
19
- themeVarDescriptions,
20
- toneSpecificThemeVars,
21
- allowArbitraryProps,
22
- docFolder,
23
- isHtmlTag,
24
- };
5
+ function createMetadata(metadata) {
6
+ return metadata;
25
7
  }
26
8
  function d(description, availableValues, valueType, defaultValue, isValid, isRequired) {
27
9
  return { description, isRequired, availableValues, valueType, defaultValue, isValid };
@@ -12,6 +12,7 @@ const themeVars_1 = require("../../components-core/theming/themeVars");
12
12
  const metadata_helpers_1 = require("../../components/metadata-helpers");
13
13
  const AppLayoutContext_1 = require("./AppLayoutContext");
14
14
  const AppNative_1 = require("./AppNative");
15
+ const react_1 = require("react");
15
16
  const COMP = "App";
16
17
  exports.AppMd = (0, ComponentDefs_1.createMetadata)({
17
18
  status: "stable",
@@ -97,26 +98,65 @@ exports.AppMd = (0, ComponentDefs_1.createMetadata)({
97
98
  },
98
99
  },
99
100
  });
100
- exports.appRenderer = (0, renderers_1.createComponentRenderer)(COMP, exports.AppMd, ({ node, extractValue, renderChild, layoutCss, lookupEventHandler }) => {
101
- var _a;
102
- let AppHeader;
103
- let Footer;
104
- let NavPanel;
105
- const restChildren = [];
106
- (_a = node.children) === null || _a === void 0 ? void 0 : _a.forEach((child) => {
107
- if (child.type === "AppHeader") {
108
- AppHeader = child;
109
- }
110
- else if (child.type === "Footer") {
111
- Footer = child;
112
- }
113
- else if (child.type === "NavPanel") {
114
- NavPanel = child;
115
- }
116
- else {
117
- restChildren.push(child);
118
- }
119
- });
101
+ function AppNode({ node, extractValue, renderChild, style, lookupEventHandler }) {
102
+ const { AppHeader, Footer, NavPanel, restChildren } = (0, react_1.useMemo)(() => {
103
+ var _a;
104
+ let AppHeader;
105
+ let Footer;
106
+ let NavPanel;
107
+ const restChildren = [];
108
+ (_a = node.children) === null || _a === void 0 ? void 0 : _a.forEach((rootChild) => {
109
+ var _a;
110
+ let transformedChild = Object.assign({}, rootChild);
111
+ if (rootChild.type === "Theme") {
112
+ transformedChild.children = (_a = rootChild.children) === null || _a === void 0 ? void 0 : _a.filter((child) => {
113
+ if (child.type === "AppHeader") {
114
+ AppHeader = Object.assign(Object.assign({}, rootChild), { children: [
115
+ child
116
+ ] });
117
+ return false;
118
+ }
119
+ else if (child.type === "Footer") {
120
+ Footer = Object.assign(Object.assign({}, rootChild), { children: [
121
+ child
122
+ ] });
123
+ return false;
124
+ }
125
+ else if (child.type === "NavPanel") {
126
+ NavPanel = Object.assign(Object.assign({}, rootChild), { children: [
127
+ child
128
+ ] });
129
+ return false;
130
+ }
131
+ return true;
132
+ });
133
+ if (!transformedChild.children.length) {
134
+ transformedChild = null;
135
+ }
136
+ }
137
+ if (rootChild.type === "AppHeader") {
138
+ AppHeader = rootChild;
139
+ }
140
+ else if (rootChild.type === "Footer") {
141
+ Footer = rootChild;
142
+ }
143
+ else if (rootChild.type === "NavPanel") {
144
+ NavPanel = rootChild;
145
+ }
146
+ else if (transformedChild !== null) {
147
+ restChildren.push(transformedChild);
148
+ }
149
+ });
150
+ return {
151
+ AppHeader,
152
+ Footer,
153
+ NavPanel,
154
+ restChildren
155
+ };
156
+ }, [node.children]);
120
157
  const layoutType = extractValue(node.props.layout);
121
- return ((0, jsx_runtime_1.jsx)(AppNative_1.App, { scrollWholePage: extractValue.asOptionalBoolean(node.props.scrollWholePage, true), noScrollbarGutters: extractValue.asOptionalBoolean(node.props.noScrollbarGutters, false), style: layoutCss, layout: layoutType, loggedInUser: extractValue(node.props.loggedInUser), onReady: lookupEventHandler("ready"), header: renderChild(AppHeader), footer: renderChild(Footer), navPanel: renderChild(NavPanel), navPanelDef: NavPanel, logoContentDef: node.props.logoTemplate, renderChild: renderChild, name: extractValue(node.props.name), logo: extractValue(node.props.logo), logoDark: extractValue(node.props["logo-dark"]), logoLight: extractValue(node.props["logo-light"]), defaultTone: extractValue(node.props.defaultTone), defaultTheme: extractValue(node.props.defaultTheme), children: renderChild(restChildren) }));
158
+ return ((0, jsx_runtime_1.jsx)(AppNative_1.App, { scrollWholePage: extractValue.asOptionalBoolean(node.props.scrollWholePage, true), noScrollbarGutters: extractValue.asOptionalBoolean(node.props.noScrollbarGutters, false), style: style, layout: layoutType, loggedInUser: extractValue(node.props.loggedInUser), onReady: lookupEventHandler("ready"), header: renderChild(AppHeader), footer: renderChild(Footer), navPanel: renderChild(NavPanel), navPanelDef: NavPanel, logoContentDef: node.props.logoTemplate, renderChild: renderChild, name: extractValue(node.props.name), logo: extractValue(node.props.logo), logoDark: extractValue(node.props["logo-dark"]), logoLight: extractValue(node.props["logo-light"]), defaultTone: extractValue(node.props.defaultTone), defaultTheme: extractValue(node.props.defaultTheme), children: renderChild(restChildren) }));
159
+ }
160
+ exports.appRenderer = (0, renderers_1.createComponentRenderer)(COMP, exports.AppMd, ({ node, extractValue, renderChild, layoutCss, lookupEventHandler }) => {
161
+ return ((0, jsx_runtime_1.jsx)(AppNode, { node: node, renderChild: renderChild, extractValue: extractValue, style: layoutCss, lookupEventHandler: lookupEventHandler }));
122
162
  });
@@ -85,6 +85,10 @@ exports.ButtonMd = (0, ComponentDefs_1.createMetadata)({
85
85
  type: "string",
86
86
  defaultValue: ButtonNative_1.defaultProps.contentPosition,
87
87
  },
88
+ contextualLabel: {
89
+ description: `This optional value is used to provide an accessible name for the ${COMP} in the context of its usage.`,
90
+ type: "string",
91
+ },
88
92
  },
89
93
  events: {
90
94
  click: (0, metadata_helpers_1.dClick)(COMP),
@@ -151,5 +155,5 @@ exports.ButtonMd = (0, ComponentDefs_1.createMetadata)({
151
155
  exports.buttonComponentRenderer = (0, renderers_1.createComponentRenderer)("Button", exports.ButtonMd, ({ node, extractValue, renderChild, lookupEventHandler, layoutCss }) => {
152
156
  const iconName = extractValue.asString(node.props.icon);
153
157
  const label = extractValue.asDisplayText(node.props.label);
154
- return ((0, jsx_runtime_1.jsx)(ButtonNative_1.Button, { type: extractValue.asOptionalString(node.props.type), variant: extractValue.asOptionalString(node.props.variant), themeColor: extractValue.asOptionalString(node.props.themeColor), autoFocus: extractValue.asOptionalBoolean(node.props.autoFocus), size: extractValue.asOptionalString(node.props.size), icon: iconName && (0, jsx_runtime_1.jsx)(IconNative_1.Icon, { name: iconName }), iconPosition: extractValue.asOptionalString(node.props.iconPosition), orientation: extractValue.asOptionalString(node.props.orientation), contentPosition: extractValue.asOptionalString(node.props.contentPosition), disabled: !extractValue.asOptionalBoolean(node.props.enabled, true), onClick: lookupEventHandler("click"), onFocus: lookupEventHandler("gotFocus"), onBlur: lookupEventHandler("lostFocus"), style: layoutCss, children: renderChild(node.children, { type: "Stack", orientation: "horizontal" }) || label }));
158
+ return ((0, jsx_runtime_1.jsx)(ButtonNative_1.Button, { type: extractValue.asOptionalString(node.props.type), variant: extractValue.asOptionalString(node.props.variant), themeColor: extractValue.asOptionalString(node.props.themeColor), autoFocus: extractValue.asOptionalBoolean(node.props.autoFocus), size: extractValue.asOptionalString(node.props.size), icon: iconName && (0, jsx_runtime_1.jsx)(IconNative_1.Icon, { name: iconName, "aria-hidden": true }), iconPosition: extractValue.asOptionalString(node.props.iconPosition), orientation: extractValue.asOptionalString(node.props.orientation), contentPosition: extractValue.asOptionalString(node.props.contentPosition), disabled: !extractValue.asOptionalBoolean(node.props.enabled, true), onClick: lookupEventHandler("click"), onFocus: lookupEventHandler("gotFocus"), onBlur: lookupEventHandler("lostFocus"), style: layoutCss, contextualLabel: extractValue.asOptionalString(node.props.contextualLabel), children: renderChild(node.children, { type: "Stack", orientation: "horizontal" }) || label }));
155
159
  });
@@ -53,6 +53,7 @@ const react_1 = __importStar(require("react"));
53
53
  const classnames_1 = __importDefault(require("classnames"));
54
54
  const Button_module_scss_1 = __importDefault(require("./Button.module.scss"));
55
55
  const react_compose_refs_1 = require("@radix-ui/react-compose-refs");
56
+ const VisuallyHidden_1 = require("../VisuallyHidden");
56
57
  exports.defaultProps = {
57
58
  type: "button",
58
59
  iconPosition: "start",
@@ -64,7 +65,7 @@ exports.defaultProps = {
64
65
  autoFocus: false,
65
66
  };
66
67
  exports.Button = react_1.default.forwardRef(function Button(_a, ref) {
67
- var { id, type = exports.defaultProps.type, icon, iconPosition = exports.defaultProps.iconPosition, contentPosition = exports.defaultProps.contentPosition, orientation = exports.defaultProps.orientation, variant = exports.defaultProps.variant, themeColor = exports.defaultProps.themeColor, size = exports.defaultProps.size, disabled, children, formId, onClick, onFocus, onBlur, style, gap, className, autoFocus = exports.defaultProps.autoFocus } = _a, rest = __rest(_a, ["id", "type", "icon", "iconPosition", "contentPosition", "orientation", "variant", "themeColor", "size", "disabled", "children", "formId", "onClick", "onFocus", "onBlur", "style", "gap", "className", "autoFocus"]);
68
+ var { id, type = exports.defaultProps.type, icon, iconPosition = exports.defaultProps.iconPosition, contentPosition = exports.defaultProps.contentPosition, orientation = exports.defaultProps.orientation, variant = exports.defaultProps.variant, themeColor = exports.defaultProps.themeColor, size = exports.defaultProps.size, disabled, children, formId, onClick, onFocus, onBlur, style, gap, className, autoFocus = exports.defaultProps.autoFocus, contextualLabel } = _a, rest = __rest(_a, ["id", "type", "icon", "iconPosition", "contentPosition", "orientation", "variant", "themeColor", "size", "disabled", "children", "formId", "onClick", "onFocus", "onBlur", "style", "gap", "className", "autoFocus", "contextualLabel"]);
68
69
  const innerRef = (0, react_1.useRef)(null);
69
70
  const composedRef = ref ? (0, react_compose_refs_1.composeRefs)(ref, innerRef) : innerRef;
70
71
  (0, react_1.useEffect)(() => {
@@ -94,5 +95,11 @@ exports.Button = react_1.default.forwardRef(function Button(_a, ref) {
94
95
  [Button_module_scss_1.default.ghostAttention]: variant === "ghost" && themeColor === "attention",
95
96
  [Button_module_scss_1.default.alignStart]: contentPosition === "start",
96
97
  [Button_module_scss_1.default.alignEnd]: contentPosition === "end",
97
- }), autoFocus: autoFocus, disabled: disabled, form: formId, style: style, onClick: onClick, onFocus: onFocus, onBlur: onBlur, children: [iconToLeft && icon, children, !iconToLeft && icon] })));
98
+ }), autoFocus: autoFocus, disabled: disabled, form: formId, style: style, onClick: onClick, onFocus: onFocus, onBlur: onBlur, children: [icon && iconToLeft && (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: icon }), children, icon && !children && (0, jsx_runtime_1.jsx)(IconLabel, { icon: icon, accessibleName: contextualLabel }), icon && !iconToLeft && (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: icon })] })));
98
99
  });
100
+ const IconLabel = ({ icon, accessibleName = "" }) => {
101
+ // NOTE: the icon object provided is a React object with accessible props attribute.
102
+ // Typing might be off, because TS thinks props is not accessible.
103
+ const iconProps = icon.props;
104
+ return ((0, jsx_runtime_1.jsx)(VisuallyHidden_1.VisuallyHidden, { children: (0, jsx_runtime_1.jsx)("span", { children: accessibleName || (iconProps === null || iconProps === void 0 ? void 0 : iconProps.name) || (iconProps === null || iconProps === void 0 ? void 0 : iconProps.alt) }) }));
105
+ };
@@ -35,6 +35,7 @@ exports.CheckboxMd = (0, ComponentDefs_1.createMetadata)({
35
35
  description: "This property is used to define a custom checkbox input template",
36
36
  },
37
37
  },
38
+ childrenAsTemplate: "inputTemplate",
38
39
  events: {
39
40
  gotFocus: (0, metadata_helpers_1.dGotFocus)(COMP),
40
41
  lostFocus: (0, metadata_helpers_1.dLostFocus)(COMP),
@@ -59,8 +60,7 @@ exports.CheckboxMd = (0, ComponentDefs_1.createMetadata)({
59
60
  },
60
61
  });
61
62
  exports.checkboxComponentRenderer = (0, renderers_1.createComponentRenderer)(COMP, exports.CheckboxMd, ({ node, extractValue, layoutCss, updateState, lookupEventHandler, state, registerComponentApi, renderChild, layoutContext, }) => {
62
- var _a;
63
- const inputTemplate = node.children || ((_a = node.props) === null || _a === void 0 ? void 0 : _a.inputTemplate);
63
+ const inputTemplate = node.props.inputTemplate;
64
64
  return ((0, jsx_runtime_1.jsx)(Toggle_1.Toggle, { inputRenderer: inputTemplate
65
65
  ? (contextVars) => ((0, jsx_runtime_1.jsx)(container_helpers_1.MemoizedItem, { contextVars: contextVars, node: inputTemplate, renderChild: renderChild, layoutContext: layoutContext }))
66
66
  : undefined, enabled: extractValue.asOptionalBoolean(node.props.enabled), style: layoutCss, initialValue: extractValue.asOptionalBoolean(node.props.initialValue, Toggle_1.defaultProps.initialValue), value: state === null || state === void 0 ? void 0 : state.value, readOnly: extractValue.asOptionalBoolean(node.props.readOnly), validationStatus: extractValue(node.props.validationStatus), updateState: updateState, onDidChange: lookupEventHandler("didChange"), onFocus: lookupEventHandler("gotFocus"), onBlur: lookupEventHandler("lostFocus"), label: extractValue(node.props.label), labelPosition: extractValue(node.props.labelPosition), labelWidth: extractValue(node.props.labelWidth), labelBreak: extractValue.asOptionalBoolean(node.props.labelBreak), required: extractValue.asOptionalBoolean(node.props.required), indeterminate: extractValue.asOptionalBoolean(node.props.indeterminate), registerComponentApi: registerComponentApi }));
@@ -42,6 +42,7 @@ const RealTimeAdapter_1 = require("./RealTimeAdapter/RealTimeAdapter");
42
42
  const Form_1 = require("./Form/Form");
43
43
  const EmojiSelector_1 = require("./EmojiSelector/EmojiSelector");
44
44
  const NumberBox_1 = require("./NumberBox/NumberBox");
45
+ const NumberBox2_1 = require("./NumberBox/NumberBox2");
45
46
  const HoverCard_1 = require("./HoverCard/HoverCard");
46
47
  const App_1 = require("./App/App");
47
48
  const NavPanel_1 = require("./NavPanel/NavPanel");
@@ -361,6 +362,7 @@ class ComponentRegistry {
361
362
  this.registerCoreComponent(TextBox_1.passwordInputComponentRenderer);
362
363
  this.registerCoreComponent(EmojiSelector_1.emojiSelectorRenderer);
363
364
  this.registerCoreComponent(NumberBox_1.numberBoxComponentRenderer);
365
+ this.registerCoreComponent(NumberBox2_1.numberBox2ComponentRenderer);
364
366
  this.registerCoreComponent(HoverCard_1.hoverCardComponentRenderer);
365
367
  this.registerCoreComponent(RadioGroup_1.radioGroupRenderer);
366
368
  this.registerCoreComponent(FileInput_1.fileInputRenderer);
@@ -20,7 +20,7 @@ exports.FooterMd = (0, ComponentDefs_1.createMetadata)({
20
20
  [`fontSize-${COMP}`]: "$fontSize-small",
21
21
  [`textColor-${COMP}`]: "$textColor-secondary",
22
22
  [`maxWidth-content-${COMP}`]: "$maxWidth-content",
23
- [`border-${COMP}`]: `1px solid $borderColor`,
23
+ [`borderTop-${COMP}`]: `1px solid $borderColor`,
24
24
  [`padding-${COMP}`]: "$space-2 $space-4",
25
25
  light: {
26
26
  // --- No light-specific theme vars
@@ -37,6 +37,8 @@ exports.formControlTypes = [
37
37
  "checkbox",
38
38
  "number",
39
39
  "integer",
40
+ "number2",
41
+ "integer2",
40
42
  "file",
41
43
  "select",
42
44
  "autocomplete",