xmlui 0.10.19 → 0.10.21

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 (118) hide show
  1. package/dist/lib/{apiInterceptorWorker-DPgtUtdA.mjs → apiInterceptorWorker-QiltRtq1.mjs} +1 -1
  2. package/dist/lib/{index-cuh97e2e.mjs → index-BiS4wEuu.mjs} +1486 -1211
  3. package/dist/lib/index.css +1 -1
  4. package/dist/{metadata/initMock-C-cnv--V.mjs → lib/initMock-CB_cMi6U.mjs} +25 -15
  5. package/dist/lib/language-server-web-worker.mjs +1 -1
  6. package/dist/lib/language-server.mjs +1 -1
  7. package/dist/lib/{metadata-utils-CtY0QcvH.mjs → metadata-utils-BTIt1_wE.mjs} +1 -1
  8. package/dist/lib/{server-common-Cine5nRR.mjs → server-common-DYZtsdM7.mjs} +51 -14
  9. package/dist/lib/{transform-bHBjkKSL.mjs → transform-Tooy42EB.mjs} +16 -18
  10. package/dist/lib/xmlui-parser.mjs +2 -2
  11. package/dist/lib/{xmlui-serializer-DB6BLiXK.mjs → xmlui-serializer-uCYa8_tZ.mjs} +1 -1
  12. package/dist/lib/xmlui.d.ts +11 -3
  13. package/dist/lib/xmlui.mjs +2 -2
  14. package/dist/metadata/{apiInterceptorWorker-BmKP8bnq.mjs → apiInterceptorWorker-Dql7QGw2.mjs} +1 -1
  15. package/dist/metadata/{collectedComponentMetadata-Cp-9lpnG.mjs → collectedComponentMetadata-MFUg6aSX.mjs} +1655 -1390
  16. package/dist/{lib/initMock-BMxsanHc.mjs → metadata/initMock-Dw9wrVkQ.mjs} +25 -15
  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 +3 -6
  21. package/dist/scripts/src/components/Animation/AnimationNative.js +28 -28
  22. package/dist/scripts/src/components/App/App.js +4 -4
  23. package/dist/scripts/src/components/App/App.spec.js +17 -17
  24. package/dist/scripts/src/components/App/AppNative.js +1 -1
  25. package/dist/scripts/src/components/AppState/AppState.js +3 -2
  26. package/dist/scripts/src/components/AppState/AppState.spec.js +26 -2
  27. package/dist/scripts/src/components/AppState/AppStateNative.js +3 -4
  28. package/dist/scripts/src/components/AutoComplete/AutoComplete.js +15 -10
  29. package/dist/scripts/src/components/AutoComplete/AutoCompleteNative.js +4 -4
  30. package/dist/scripts/src/components/Carousel/Carousel.spec.js +214 -0
  31. package/dist/scripts/src/components/CodeBlock/CodeBlockNative.js +1 -1
  32. package/dist/scripts/src/components/ContentSeparator/ContentSeparator.js +2 -0
  33. package/dist/scripts/src/components/ContentSeparator/ContentSeparator.spec.js +193 -0
  34. package/dist/scripts/src/components/DateInput/DateInput.spec.js +6 -6
  35. package/dist/scripts/src/components/DateInput/DateInputNative.js +0 -1
  36. package/dist/scripts/src/components/DropdownMenu/DropdownMenu.spec.js +3 -3
  37. package/dist/scripts/src/components/FileUploadDropZone/FileUploadDropZoneNative.js +4 -13
  38. package/dist/scripts/src/components/Form/Form.spec.js +25 -9
  39. package/dist/scripts/src/components/Form/FormNative.js +7 -5
  40. package/dist/scripts/src/components/FormItem/FormItem.js +3 -1
  41. package/dist/scripts/src/components/FormItem/FormItem.spec.js +5 -14
  42. package/dist/scripts/src/components/FormItem/FormItemNative.js +12 -8
  43. package/dist/scripts/src/components/FormItem/Validations.js +2 -2
  44. package/dist/scripts/src/components/IFrame/IFrameNative.js +0 -2
  45. package/dist/scripts/src/components/IconRegistryContext.js +1 -1
  46. package/dist/scripts/src/components/List/ListNative.js +2 -2
  47. package/dist/scripts/src/components/ModalDialog/ConfirmationModalContextProvider.js +3 -12
  48. package/dist/scripts/src/components/ModalDialog/ModalDialog.js +2 -2
  49. package/dist/scripts/src/components/ModalDialog/ModalDialogNative.js +6 -3
  50. package/dist/scripts/src/components/NestedApp/AppWithCodeViewNative.js +1 -1
  51. package/dist/scripts/src/components/NestedApp/NestedAppNative.js +3 -3
  52. package/dist/scripts/src/components/NumberBox/NumberBox.spec.js +2 -2
  53. package/dist/scripts/src/components/Pagination/Pagination.spec.js +5 -0
  54. package/dist/scripts/src/components/Pagination/PaginationNative.js +1 -3
  55. package/dist/scripts/src/components/Queue/Queue.spec.js +45 -47
  56. package/dist/scripts/src/components/Queue/QueueNative.js +1 -1
  57. package/dist/scripts/src/components/RadioGroup/RadioGroup.spec.js +5 -5
  58. package/dist/scripts/src/components/RealTimeAdapter/RealTimeAdapterNative.js +1 -1
  59. package/dist/scripts/src/components/Select/MultiSelectOption.js +42 -0
  60. package/dist/scripts/src/components/Select/Select.js +3 -3
  61. package/dist/scripts/src/components/Select/SelectContext.js +8 -1
  62. package/dist/scripts/src/components/Select/SelectNative.js +134 -142
  63. package/dist/scripts/src/components/Select/SelectOption.js +34 -0
  64. package/dist/scripts/src/components/Select/SimpleSelect.js +57 -0
  65. package/dist/scripts/src/components/Spinner/Spinner.spec.js +1 -1
  66. package/dist/scripts/src/components/Table/useRowSelection.js +14 -23
  67. package/dist/scripts/src/components/Text/Text.js +5 -1
  68. package/dist/scripts/src/components/Text/Text.spec.js +317 -0
  69. package/dist/scripts/src/components/Text/TextNative.js +112 -1
  70. package/dist/scripts/src/components/TextArea/TextArea.spec.js +8 -8
  71. package/dist/scripts/src/components/Theme/Theme.js +2 -1
  72. package/dist/scripts/src/components/Theme/Theme.spec.js +266 -0
  73. package/dist/scripts/src/components/Theme/ThemeNative.js +8 -1
  74. package/dist/scripts/src/components/TimeInput/TimeInput.spec.js +3 -3
  75. package/dist/scripts/src/components/TimeInput/TimeInputNative.js +0 -1
  76. package/dist/scripts/src/components/Timer/TimerNative.js +0 -1
  77. package/dist/scripts/src/components/Tree/TreeNative.js +16 -23
  78. package/dist/scripts/src/components-core/InspectorContext.js +1 -1
  79. package/dist/scripts/src/components-core/StandaloneApp.js +6 -8
  80. package/dist/scripts/src/components-core/action/FileUploadAction.js +1 -1
  81. package/dist/scripts/src/components-core/behaviors/BehaviorContext.js +50 -0
  82. package/dist/scripts/src/components-core/behaviors/CoreBehaviors.js +6 -1
  83. package/dist/scripts/src/components-core/interception/ApiInterceptor.js +9 -11
  84. package/dist/scripts/src/components-core/interception/ApiInterceptorProvider.js +3 -3
  85. package/dist/scripts/src/components-core/interception/Backend.js +1 -1
  86. package/dist/scripts/src/components-core/interception/IndexedDb.js +64 -66
  87. package/dist/scripts/src/components-core/interception/apiInterceptorWorker.js +2 -2
  88. package/dist/scripts/src/components-core/loader/DataLoader.js +6 -14
  89. package/dist/scripts/src/components-core/loader/Loader.js +11 -11
  90. package/dist/scripts/src/components-core/loader/MockLoaderRenderer.js +4 -2
  91. package/dist/scripts/src/components-core/loader/PageableLoader.js +10 -9
  92. package/dist/scripts/src/components-core/rendering/AppContent.js +1 -7
  93. package/dist/scripts/src/components-core/rendering/ErrorBoundary.js +1 -1
  94. package/dist/scripts/src/components-core/script-runner/bannedFunctions.js +1 -1
  95. package/dist/scripts/src/components-core/script-runner/eval-tree-async.js +180 -186
  96. package/dist/scripts/src/components-core/script-runner/eval-tree-sync.js +6 -6
  97. package/dist/scripts/src/components-core/script-runner/process-statement-sync.js +2 -2
  98. package/dist/scripts/src/components-core/utils/actionUtils.js +1 -1
  99. package/dist/scripts/src/components-core/utils/hooks.js +1 -1
  100. package/dist/scripts/src/components-core/utils/misc.js +4 -4
  101. package/dist/scripts/src/components-core/xmlui-parser.js +47 -31
  102. package/dist/scripts/src/language-server/server-common.js +25 -24
  103. package/dist/scripts/src/language-server/services/common/lsp-utils.js +2 -2
  104. package/dist/scripts/src/language-server/services/completion.js +20 -2
  105. package/dist/scripts/src/language-server/services/diagnostic.js +1 -1
  106. package/dist/scripts/src/language-server/services/hover.js +2 -2
  107. package/dist/scripts/src/parsers/common/utils.js +2 -2
  108. package/dist/scripts/src/parsers/scripting/Lexer.js +21 -15
  109. package/dist/scripts/src/parsers/scripting/Parser.js +8 -9
  110. package/dist/scripts/src/parsers/style-parser/StyleLexer.js +22 -22
  111. package/dist/scripts/src/parsers/style-parser/StyleParser.js +70 -68
  112. package/dist/scripts/src/testing/ComponentDrivers.js +20 -39
  113. package/dist/scripts/src/testing/component-test-helpers.js +34 -50
  114. package/dist/scripts/src/testing/fixtures.js +114 -113
  115. package/dist/scripts/src/testing/themed-app-test-helpers.js +7 -13
  116. package/dist/standalone/xmlui-standalone.es.d.ts +11 -3
  117. package/dist/standalone/xmlui-standalone.umd.js +35 -35
  118. package/package.json +3 -6
@@ -147,20 +147,18 @@ function evalCalculatedMemberAccessAsync(evaluator, thisStack, expr, evalContext
147
147
  });
148
148
  }
149
149
  function evalSequenceAsync(evaluator, thisStack, expr, evalContext, thread) {
150
- return __awaiter(this, void 0, void 0, function* () {
151
- if (!expr.exprs || expr.exprs.length === 0) {
152
- throw new Error(`Missing expression sequence`);
153
- }
154
- const result = expr.exprs.map((e) => __awaiter(this, void 0, void 0, function* () {
155
- const value = yield evaluator(thisStack, e, evalContext, thread);
156
- (0, eval_tree_common_1.setExprValue)(e, { value }, thread);
157
- thisStack.pop();
158
- return value;
159
- }));
160
- const lastObj = result[result.length - 1];
161
- thisStack.push(lastObj);
162
- return lastObj;
163
- });
150
+ if (!expr.exprs || expr.exprs.length === 0) {
151
+ throw new Error(`Missing expression sequence`);
152
+ }
153
+ const result = expr.exprs.map((e) => __awaiter(this, void 0, void 0, function* () {
154
+ const value = yield evaluator(thisStack, e, evalContext, thread);
155
+ (0, eval_tree_common_1.setExprValue)(e, { value }, thread);
156
+ thisStack.pop();
157
+ return value;
158
+ }));
159
+ const lastObj = result[result.length - 1];
160
+ thisStack.push(lastObj);
161
+ return lastObj;
164
162
  }
165
163
  function evalArrayLiteralAsync(evaluator, thisStack, expr, evalContext, thread) {
166
164
  return __awaiter(this, void 0, void 0, function* () {
@@ -274,7 +272,7 @@ function evalAssignmentAsync(evaluator, thisStack, expr, evalContext, thread) {
274
272
  const rootScope = (0, eval_tree_common_1.getRootIdScope)(leftValue, evalContext, thread);
275
273
  const updatesState = rootScope && rootScope.type !== "block";
276
274
  if (updatesState && evalContext.onWillUpdate) {
277
- evalContext.onWillUpdate(rootScope, rootScope.name, "assignment");
275
+ void evalContext.onWillUpdate(rootScope, rootScope.name, "assignment");
278
276
  }
279
277
  yield evaluator(thisStack, leftValue, evalContext, thread);
280
278
  thisStack.pop();
@@ -284,7 +282,7 @@ function evalAssignmentAsync(evaluator, thisStack, expr, evalContext, thread) {
284
282
  yield completeExprValue(expr.expr, thread);
285
283
  const value = (0, eval_tree_common_1.evalAssignmentCore)(thisStack, expr, evalContext, thread);
286
284
  if (updatesState && evalContext.onDidUpdate) {
287
- evalContext.onDidUpdate(rootScope, rootScope.name, "assignment");
285
+ void evalContext.onDidUpdate(rootScope, rootScope.name, "assignment");
288
286
  }
289
287
  return value;
290
288
  });
@@ -294,14 +292,14 @@ function evalPreOrPostAsync(evaluator, thisStack, expr, evalContext, thread) {
294
292
  const rootScope = (0, eval_tree_common_1.getRootIdScope)(expr.expr, evalContext, thread);
295
293
  const updatesState = rootScope && rootScope.type !== "block";
296
294
  if (updatesState && evalContext.onWillUpdate) {
297
- evalContext.onWillUpdate(rootScope, rootScope.name, "pre-post");
295
+ void evalContext.onWillUpdate(rootScope, rootScope.name, "pre-post");
298
296
  }
299
297
  yield evaluator(thisStack, expr.expr, evalContext, thread);
300
298
  thisStack.pop();
301
299
  yield completeExprValue(expr.expr, thread);
302
300
  const value = (0, eval_tree_common_1.evalPreOrPostCore)(thisStack, expr, evalContext, thread);
303
301
  if (updatesState && evalContext.onDidUpdate) {
304
- evalContext.onDidUpdate(rootScope, rootScope.name, "pre-post");
302
+ void evalContext.onDidUpdate(rootScope, rootScope.name, "pre-post");
305
303
  }
306
304
  return value;
307
305
  });
@@ -352,17 +350,17 @@ function evalFunctionInvocationAsync(evaluator, thisStack, expr, evalContext, th
352
350
  }
353
351
  else {
354
352
  if (arg.type === ScriptingSourceTree_1.T_ARROW_EXPRESSION) {
355
- const funcArg = yield createArrowFunctionAsync(evaluator, arg);
356
- const wrappedFunc = (...args) => __awaiter(this, void 0, void 0, function* () {
353
+ const funcArg = createArrowFunctionAsync(evaluator, arg);
354
+ const wrappedFunc = (...args) => {
357
355
  return funcArg(arg.args, evalContext, thread, ...args);
358
- });
356
+ };
359
357
  functionArgs.push(wrappedFunc);
360
358
  }
361
359
  else {
362
360
  yield evaluator([], arg, evalContext, thread);
363
361
  const funcArg = yield completeExprValue(arg, thread);
364
362
  if (funcArg === null || funcArg === void 0 ? void 0 : funcArg._ARROW_EXPR_) {
365
- const wrappedFuncArg = yield createArrowFunctionAsync(evaluator, funcArg);
363
+ const wrappedFuncArg = createArrowFunctionAsync(evaluator, funcArg);
366
364
  const wrappedFunc = (...args) => wrappedFuncArg(funcArg.args, evalContext, thread, ...args);
367
365
  functionArgs.push(wrappedFunc);
368
366
  }
@@ -398,14 +396,14 @@ function evalFunctionInvocationAsync(evaluator, thisStack, expr, evalContext, th
398
396
  const rootScope = (0, eval_tree_common_1.getRootIdScope)(expr.obj, evalContext, thread);
399
397
  const updatesState = rootScope && rootScope.type !== "block";
400
398
  if (updatesState && evalContext.onWillUpdate) {
401
- evalContext.onWillUpdate(rootScope, rootScope.name, "function-call");
399
+ void evalContext.onWillUpdate(rootScope, rootScope.name, "function-call");
402
400
  }
403
401
  const value = ((_d = evalContext.options) === null || _d === void 0 ? void 0 : _d.defaultToOptionalMemberAccess)
404
402
  ? functionObj === null || functionObj === void 0 ? void 0 : functionObj.call(currentContext, ...functionArgs)
405
403
  : functionObj.call(currentContext, ...functionArgs);
406
404
  let returnValue = yield completePromise(value);
407
405
  if (updatesState && evalContext.onDidUpdate) {
408
- evalContext.onDidUpdate(rootScope, rootScope.name, "function-call");
406
+ void evalContext.onDidUpdate(rootScope, rootScope.name, "function-call");
409
407
  }
410
408
  // --- Done.
411
409
  (0, eval_tree_common_1.setExprValue)(expr, { value: returnValue }, thread);
@@ -414,183 +412,179 @@ function evalFunctionInvocationAsync(evaluator, thisStack, expr, evalContext, th
414
412
  });
415
413
  }
416
414
  function createArrowFunctionAsync(evaluator, expr) {
417
- return __awaiter(this, void 0, void 0, function* () {
418
- // --- Use this function, it evaluates the arrow function
419
- return (...args) => __awaiter(this, void 0, void 0, function* () {
420
- var _a, _b;
421
- // --- Prepare the variables to pass
422
- const runTimeEvalContext = args[1];
423
- const runtimeThread = args[2];
424
- // --- Create the thread that runs the arrow function
425
- const workingThread = {
426
- parent: runtimeThread,
427
- childThreads: [],
428
- blocks: [{ vars: {} }],
429
- loops: [],
430
- breakLabelValue: -1,
431
- closures: expr.closureContext,
432
- };
433
- runtimeThread.childThreads.push(workingThread);
434
- // --- Create a block for a named arrow function
435
- if (expr.name) {
436
- const functionBlock = { vars: {} };
437
- (_a = workingThread.blocks) !== null && _a !== void 0 ? _a : (workingThread.blocks = []);
438
- workingThread.blocks.push(functionBlock);
439
- functionBlock.vars[expr.name] = expr;
440
- functionBlock.constVars = new Set([expr.name]);
441
- }
442
- // --- Assign argument values to names
443
- const arrowBlock = { vars: {} };
444
- (_b = workingThread.blocks) !== null && _b !== void 0 ? _b : (workingThread.blocks = []);
445
- workingThread.blocks.push(arrowBlock);
446
- const argSpecs = args[0];
447
- let restFound = false;
448
- for (let i = 0; i < argSpecs.length; i++) {
449
- // --- Turn argument specification into processable variable declarations
450
- const argSpec = argSpecs[i];
451
- let decl;
452
- switch (argSpec.type) {
453
- case ScriptingSourceTree_1.T_IDENTIFIER: {
454
- decl = {
455
- type: ScriptingSourceTree_1.T_VAR_DECLARATION,
456
- id: argSpec.name,
457
- };
458
- break;
459
- }
460
- case ScriptingSourceTree_1.T_DESTRUCTURE: {
461
- decl = {
462
- type: ScriptingSourceTree_1.T_VAR_DECLARATION,
463
- id: argSpec.id,
464
- aDestr: argSpec.aDestr,
465
- oDestr: argSpec.oDestr,
466
- };
467
- break;
468
- }
469
- case ScriptingSourceTree_1.T_SPREAD_EXPRESSION: {
470
- restFound = true;
471
- decl = {
472
- type: ScriptingSourceTree_1.T_VAR_DECLARATION,
473
- id: argSpec.expr.name,
474
- };
475
- break;
476
- }
477
- default:
478
- throw new Error("Unexpected arrow argument specification");
479
- }
480
- if (decl) {
481
- if (restFound) {
482
- // --- Get the rest of the arguments
483
- const restArgs = args.slice(i + 3);
484
- let argVals = [];
485
- for (const arg of restArgs) {
486
- if (arg === null || arg === void 0 ? void 0 : arg._EXPRESSION_) {
487
- argVals.push(yield evaluator([], arg, runTimeEvalContext, runtimeThread));
488
- }
489
- else {
490
- argVals.push(arg);
491
- }
492
- }
493
- yield (0, process_statement_async_1.processDeclarationsAsync)(arrowBlock, runTimeEvalContext, runtimeThread, [decl], false, true, argVals);
494
- }
495
- else {
496
- // --- Get the actual value to work with
497
- let argVal = args[i + 3];
498
- if (argVal === null || argVal === void 0 ? void 0 : argVal._EXPRESSION_) {
499
- argVal = yield evaluator([], argVal, runTimeEvalContext, runtimeThread);
500
- }
501
- yield (0, process_statement_async_1.processDeclarationsAsync)(arrowBlock, runTimeEvalContext, runtimeThread, [decl], false, true, argVal);
502
- }
503
- }
504
- }
505
- // --- Evaluate the arrow expression body
506
- let returnValue;
507
- let statements;
508
- switch (expr.statement.type) {
509
- case ScriptingSourceTree_1.T_EMPTY_STATEMENT:
510
- statements = [];
415
+ // --- Use this function, it evaluates the arrow function
416
+ return (...args) => __awaiter(this, void 0, void 0, function* () {
417
+ var _a, _b;
418
+ // --- Prepare the variables to pass
419
+ const runTimeEvalContext = args[1];
420
+ const runtimeThread = args[2];
421
+ // --- Create the thread that runs the arrow function
422
+ const workingThread = {
423
+ parent: runtimeThread,
424
+ childThreads: [],
425
+ blocks: [{ vars: {} }],
426
+ loops: [],
427
+ breakLabelValue: -1,
428
+ closures: expr.closureContext,
429
+ };
430
+ runtimeThread.childThreads.push(workingThread);
431
+ // --- Create a block for a named arrow function
432
+ if (expr.name) {
433
+ const functionBlock = { vars: {} };
434
+ (_a = workingThread.blocks) !== null && _a !== void 0 ? _a : (workingThread.blocks = []);
435
+ workingThread.blocks.push(functionBlock);
436
+ functionBlock.vars[expr.name] = expr;
437
+ functionBlock.constVars = new Set([expr.name]);
438
+ }
439
+ // --- Assign argument values to names
440
+ const arrowBlock = { vars: {} };
441
+ (_b = workingThread.blocks) !== null && _b !== void 0 ? _b : (workingThread.blocks = []);
442
+ workingThread.blocks.push(arrowBlock);
443
+ const argSpecs = args[0];
444
+ let restFound = false;
445
+ for (let i = 0; i < argSpecs.length; i++) {
446
+ // --- Turn argument specification into processable variable declarations
447
+ const argSpec = argSpecs[i];
448
+ let decl;
449
+ switch (argSpec.type) {
450
+ case ScriptingSourceTree_1.T_IDENTIFIER: {
451
+ decl = {
452
+ type: ScriptingSourceTree_1.T_VAR_DECLARATION,
453
+ id: argSpec.name,
454
+ };
511
455
  break;
512
- case ScriptingSourceTree_1.T_EXPRESSION_STATEMENT:
513
- // --- Create a new thread for the call
514
- statements = [
515
- {
516
- type: ScriptingSourceTree_1.T_RETURN_STATEMENT,
517
- expr: expr.statement.expr,
518
- },
519
- ];
456
+ }
457
+ case ScriptingSourceTree_1.T_DESTRUCTURE: {
458
+ decl = {
459
+ type: ScriptingSourceTree_1.T_VAR_DECLARATION,
460
+ id: argSpec.id,
461
+ aDestr: argSpec.aDestr,
462
+ oDestr: argSpec.oDestr,
463
+ };
520
464
  break;
521
- case ScriptingSourceTree_1.T_BLOCK_STATEMENT:
522
- // --- Create a new thread for the call
523
- statements = expr.statement.stmts;
465
+ }
466
+ case ScriptingSourceTree_1.T_SPREAD_EXPRESSION: {
467
+ restFound = true;
468
+ decl = {
469
+ type: ScriptingSourceTree_1.T_VAR_DECLARATION,
470
+ id: argSpec.expr.name,
471
+ };
524
472
  break;
473
+ }
525
474
  default:
526
- throw new Error(`Arrow expression with a body of '${expr.statement.type}' is not supported yet.`);
475
+ throw new Error("Unexpected arrow argument specification");
527
476
  }
528
- // --- Process the statement with a new processor
529
- yield (0, process_statement_async_1.processStatementQueueAsync)(statements, runTimeEvalContext, workingThread);
530
- // --- Return value is in a return value slot
531
- returnValue = workingThread.returnValue;
532
- // --- Remove the current working thread
533
- const workingIndex = runtimeThread.childThreads.indexOf(workingThread);
534
- if (workingIndex < 0) {
535
- throw new Error("Cannot find thread to remove.");
477
+ if (decl) {
478
+ if (restFound) {
479
+ // --- Get the rest of the arguments
480
+ const restArgs = args.slice(i + 3);
481
+ let argVals = [];
482
+ for (const arg of restArgs) {
483
+ if (arg === null || arg === void 0 ? void 0 : arg._EXPRESSION_) {
484
+ argVals.push(yield evaluator([], arg, runTimeEvalContext, runtimeThread));
485
+ }
486
+ else {
487
+ argVals.push(arg);
488
+ }
489
+ }
490
+ yield (0, process_statement_async_1.processDeclarationsAsync)(arrowBlock, runTimeEvalContext, runtimeThread, [decl], false, true, argVals);
491
+ }
492
+ else {
493
+ // --- Get the actual value to work with
494
+ let argVal = args[i + 3];
495
+ if (argVal === null || argVal === void 0 ? void 0 : argVal._EXPRESSION_) {
496
+ argVal = yield evaluator([], argVal, runTimeEvalContext, runtimeThread);
497
+ }
498
+ yield (0, process_statement_async_1.processDeclarationsAsync)(arrowBlock, runTimeEvalContext, runtimeThread, [decl], false, true, argVal);
499
+ }
536
500
  }
537
- runtimeThread.childThreads.splice(workingIndex, 1);
538
- // --- Remove the function level block
539
- workingThread.blocks.pop();
540
- // --- Return the function value
541
- return returnValue;
542
- });
501
+ }
502
+ // --- Evaluate the arrow expression body
503
+ let returnValue;
504
+ let statements;
505
+ switch (expr.statement.type) {
506
+ case ScriptingSourceTree_1.T_EMPTY_STATEMENT:
507
+ statements = [];
508
+ break;
509
+ case ScriptingSourceTree_1.T_EXPRESSION_STATEMENT:
510
+ // --- Create a new thread for the call
511
+ statements = [
512
+ {
513
+ type: ScriptingSourceTree_1.T_RETURN_STATEMENT,
514
+ expr: expr.statement.expr,
515
+ },
516
+ ];
517
+ break;
518
+ case ScriptingSourceTree_1.T_BLOCK_STATEMENT:
519
+ // --- Create a new thread for the call
520
+ statements = expr.statement.stmts;
521
+ break;
522
+ default:
523
+ throw new Error(`Arrow expression with a body of '${expr.statement.type}' is not supported yet.`);
524
+ }
525
+ // --- Process the statement with a new processor
526
+ yield (0, process_statement_async_1.processStatementQueueAsync)(statements, runTimeEvalContext, workingThread);
527
+ // --- Return value is in a return value slot
528
+ returnValue = workingThread.returnValue;
529
+ // --- Remove the current working thread
530
+ const workingIndex = runtimeThread.childThreads.indexOf(workingThread);
531
+ if (workingIndex < 0) {
532
+ throw new Error("Cannot find thread to remove.");
533
+ }
534
+ runtimeThread.childThreads.splice(workingIndex, 1);
535
+ // --- Remove the function level block
536
+ workingThread.blocks.pop();
537
+ // --- Return the function value
538
+ return returnValue;
543
539
  });
544
540
  }
545
541
  // --- Completes all promises within the input
546
542
  function completePromise(input) {
547
- return __awaiter(this, void 0, void 0, function* () {
548
- const visited = new Map();
549
- return completePromiseInternal(input);
550
- function completePromiseInternal(input) {
551
- return __awaiter(this, void 0, void 0, function* () {
552
- // --- No need to resolve undefined or null
553
- if (input === undefined || input === null)
554
- return input;
555
- // --- Already visited?
556
- const resolved = visited.get(input);
557
- if (resolved)
558
- return resolved;
559
- // --- Resolve the chain of promises
560
- if ((0, eval_tree_common_1.isPromise)(input)) {
561
- const awaited = yield input;
562
- visited.set(input, awaited);
563
- return completePromiseInternal(awaited);
564
- }
565
- // --- In any other cases, we keep the input reference
566
- visited.set(input, input);
567
- // --- Resolve promises within an array
568
- if (Array.isArray(input)) {
569
- for (let i = 0; i < input.length; i++) {
570
- const completedPromise = yield completePromiseInternal(input[i]);
571
- if (input[i] !== completedPromise) {
572
- //prevent write if it's the same reference (can cause problems in frozen objects)
573
- input.splice(i, 1, completedPromise);
574
- }
543
+ const visited = new Map();
544
+ return completePromiseInternal(input);
545
+ function completePromiseInternal(input) {
546
+ return __awaiter(this, void 0, void 0, function* () {
547
+ // --- No need to resolve undefined or null
548
+ if (input === undefined || input === null)
549
+ return input;
550
+ // --- Already visited?
551
+ const resolved = visited.get(input);
552
+ if (resolved)
553
+ return resolved;
554
+ // --- Resolve the chain of promises
555
+ if ((0, eval_tree_common_1.isPromise)(input)) {
556
+ const awaited = yield input;
557
+ visited.set(input, awaited);
558
+ return completePromiseInternal(awaited);
559
+ }
560
+ // --- In any other cases, we keep the input reference
561
+ visited.set(input, input);
562
+ // --- Resolve promises within an array
563
+ if (Array.isArray(input)) {
564
+ for (let i = 0; i < input.length; i++) {
565
+ const completedPromise = yield completePromiseInternal(input[i]);
566
+ if (input[i] !== completedPromise) {
567
+ //prevent write if it's the same reference (can cause problems in frozen objects)
568
+ input.splice(i, 1, completedPromise);
575
569
  }
576
- return input;
577
570
  }
578
- // --- Resolve promises in object properties
579
- if ((0, lodash_es_1.isPlainObject)(input)) {
580
- for (const key of Object.keys(input)) {
581
- let completedPromise = yield completePromiseInternal(input[key]);
582
- if (input[key] !== completedPromise) {
583
- //prevent write if it's the same reference (can cause problems in frozen objects)
584
- input[key] = completedPromise;
585
- }
571
+ return input;
572
+ }
573
+ // --- Resolve promises in object properties
574
+ if ((0, lodash_es_1.isPlainObject)(input)) {
575
+ for (const key of Object.keys(input)) {
576
+ let completedPromise = yield completePromiseInternal(input[key]);
577
+ if (input[key] !== completedPromise) {
578
+ //prevent write if it's the same reference (can cause problems in frozen objects)
579
+ input[key] = completedPromise;
586
580
  }
587
- return input;
588
581
  }
589
- // --- Done.
590
582
  return input;
591
- });
592
- }
593
- });
583
+ }
584
+ // --- Done.
585
+ return input;
586
+ });
587
+ }
594
588
  }
595
589
  function evalTemplateLiteralAsync(evaluator, thisStack, expr, evalContext, thread) {
596
590
  return __awaiter(this, void 0, void 0, function* () {
@@ -272,7 +272,7 @@ function evalAssignment(evaluator, thisStack, expr, evalContext, thread) {
272
272
  const rootScope = (0, eval_tree_common_1.getRootIdScope)(leftValue, evalContext, thread);
273
273
  const updatesState = rootScope && rootScope.type !== "block";
274
274
  if (updatesState && evalContext.onWillUpdate) {
275
- evalContext.onWillUpdate(rootScope, rootScope.name, "assignment");
275
+ void evalContext.onWillUpdate(rootScope, rootScope.name, "assignment");
276
276
  }
277
277
  evaluator(thisStack, leftValue, evalContext, thread);
278
278
  thisStack.pop();
@@ -280,7 +280,7 @@ function evalAssignment(evaluator, thisStack, expr, evalContext, thread) {
280
280
  thisStack.pop();
281
281
  const value = (0, eval_tree_common_1.evalAssignmentCore)(thisStack, expr, evalContext, thread);
282
282
  if (updatesState && evalContext.onDidUpdate) {
283
- evalContext.onDidUpdate(rootScope, rootScope.name, "assignment");
283
+ void evalContext.onDidUpdate(rootScope, rootScope.name, "assignment");
284
284
  }
285
285
  return value;
286
286
  }
@@ -288,13 +288,13 @@ function evalPreOrPost(evaluator, thisStack, expr, evalContext, thread) {
288
288
  const rootScope = (0, eval_tree_common_1.getRootIdScope)(expr.expr, evalContext, thread);
289
289
  const updatesState = rootScope && rootScope.type !== "block";
290
290
  if (updatesState && evalContext.onWillUpdate) {
291
- evalContext.onWillUpdate(rootScope, rootScope.name, "pre-post");
291
+ void evalContext.onWillUpdate(rootScope, rootScope.name, "pre-post");
292
292
  }
293
293
  evaluator(thisStack, expr.expr, evalContext, thread);
294
294
  thisStack.pop();
295
295
  const value = (0, eval_tree_common_1.evalPreOrPostCore)(thisStack, expr, evalContext, thread);
296
296
  if (updatesState && evalContext.onDidUpdate) {
297
- evalContext.onDidUpdate(rootScope, rootScope.name, "pre-post");
297
+ void evalContext.onDidUpdate(rootScope, rootScope.name, "pre-post");
298
298
  }
299
299
  return value;
300
300
  }
@@ -380,13 +380,13 @@ function evalFunctionInvocation(evaluator, thisStack, expr, evalContext, thread)
380
380
  const rootScope = (0, eval_tree_common_1.getRootIdScope)(expr.obj, evalContext, thread);
381
381
  const updatesState = rootScope && rootScope.type !== "block";
382
382
  if (updatesState && evalContext.onWillUpdate) {
383
- evalContext.onWillUpdate(rootScope, rootScope.name, "function-call");
383
+ void evalContext.onWillUpdate(rootScope, rootScope.name, "function-call");
384
384
  }
385
385
  const value = ((_d = evalContext.options) === null || _d === void 0 ? void 0 : _d.defaultToOptionalMemberAccess)
386
386
  ? functionObj === null || functionObj === void 0 ? void 0 : functionObj.call(currentContext, ...functionArgs)
387
387
  : functionObj.call(currentContext, ...functionArgs);
388
388
  if (updatesState && evalContext.onDidUpdate) {
389
- evalContext.onDidUpdate(rootScope, rootScope.name, "function-call");
389
+ void evalContext.onDidUpdate(rootScope, rootScope.name, "function-call");
390
390
  }
391
391
  (0, eval_tree_common_1.setExprValue)(expr, { value }, thread);
392
392
  thisStack.push(value);
@@ -46,7 +46,7 @@ function processStatementQueue(statements, evalContext, thread) {
46
46
  let outcome;
47
47
  try {
48
48
  // --- Sign that the statement is about to start
49
- (_a = evalContext === null || evalContext === void 0 ? void 0 : evalContext.onStatementStarted) === null || _a === void 0 ? void 0 : _a.call(evalContext, evalContext, queueItem.statement);
49
+ void ((_a = evalContext === null || evalContext === void 0 ? void 0 : evalContext.onStatementStarted) === null || _a === void 0 ? void 0 : _a.call(evalContext, evalContext, queueItem.statement));
50
50
  // --- Execute the statement
51
51
  outcome = processStatement(queueItem.statement, (_b = queueItem.execInfo) !== null && _b !== void 0 ? _b : {}, evalContext, thread);
52
52
  }
@@ -85,7 +85,7 @@ function processStatementQueue(statements, evalContext, thread) {
85
85
  }
86
86
  }
87
87
  // --- Sign that the statement has been completed
88
- (_c = evalContext === null || evalContext === void 0 ? void 0 : evalContext.onStatementCompleted) === null || _c === void 0 ? void 0 : _c.call(evalContext, evalContext, queueItem.statement);
88
+ void ((_c = evalContext === null || evalContext === void 0 ? void 0 : evalContext.onStatementCompleted) === null || _c === void 0 ? void 0 : _c.call(evalContext, evalContext, queueItem.statement));
89
89
  // --- Provide diagnostics
90
90
  if (queue.length > diagInfo.maxQueueLength) {
91
91
  diagInfo.maxQueueLength = queue.length;
@@ -22,7 +22,7 @@ function invalidateQueries(invalidates, appContext, state) {
22
22
  }
23
23
  arrayToInvalidate.forEach((invalidate) => {
24
24
  var _a;
25
- (_a = appContext.queryClient) === null || _a === void 0 ? void 0 : _a.invalidateQueries(new DataLoaderQueryKeyGenerator_1.DataLoaderQueryKeyGenerator((0, extractParam_1.extractParam)(state, invalidate, appContext), undefined, appContext === null || appContext === void 0 ? void 0 : appContext.appGlobals.apiUrl, undefined, undefined).asPredicate());
25
+ void ((_a = appContext.queryClient) === null || _a === void 0 ? void 0 : _a.invalidateQueries(new DataLoaderQueryKeyGenerator_1.DataLoaderQueryKeyGenerator((0, extractParam_1.extractParam)(state, invalidate, appContext), undefined, appContext === null || appContext === void 0 ? void 0 : appContext.appGlobals.apiUrl, undefined, undefined).asPredicate()));
26
26
  });
27
27
  }
28
28
  else {
@@ -320,7 +320,7 @@ const useRealBackground = (element) => {
320
320
  (0, react_1.useEffect)(() => {
321
321
  return setCounter((prev) => prev + 1);
322
322
  }, [activeThemeTone, activeThemeId]);
323
- return (0, react_1.useMemo)(() => (element ? realBackgroundColor(element) : "transparent"), [element, counter]);
323
+ return (0, react_1.useMemo)(() => (element ? realBackgroundColor(element) : "transparent"), [element]);
324
324
  };
325
325
  exports.useRealBackground = useRealBackground;
326
326
  // export const useIsInViewport = (ref, observerOptions) => {
@@ -70,10 +70,10 @@ function randomUUID() {
70
70
  }
71
71
  function readCookie(name) {
72
72
  const nameEQ = name + "=";
73
- const ca = document.cookie.split(';');
73
+ const ca = document.cookie.split(";");
74
74
  for (let i = 0; i < ca.length; i++) {
75
75
  let c = ca[i];
76
- while (c.charAt(0) === ' ')
76
+ while (c.charAt(0) === " ")
77
77
  c = c.substring(1, c.length);
78
78
  if (c.indexOf(nameEQ) === 0)
79
79
  return c.substring(nameEQ.length, c.length);
@@ -466,7 +466,7 @@ function toHashObject(arr, keyProp, valueProp) {
466
466
  }, {});
467
467
  }
468
468
  function findByField(arr, field, value) {
469
- return (arr !== null && arr !== void 0 ? arr : []).find(item => item[field || ""] === value);
469
+ return (arr !== null && arr !== void 0 ? arr : []).find((item) => item[field || ""] === value);
470
470
  }
471
471
  function distinct(arr) {
472
472
  if (!Array.isArray(arr) || !arr || !arr.length) {
@@ -485,7 +485,7 @@ function distinct(arr) {
485
485
  */
486
486
  function asyncThrottle(func, wait, options) {
487
487
  const throttled = (0, lodash_es_1.throttle)((resolve, reject, args) => {
488
- func(...args)
488
+ void func(...args)
489
489
  .then(resolve)
490
490
  .catch(reject);
491
491
  }, wait, options);