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.
- package/dist/lib/{apiInterceptorWorker-DPgtUtdA.mjs → apiInterceptorWorker-QiltRtq1.mjs} +1 -1
- package/dist/lib/{index-cuh97e2e.mjs → index-BiS4wEuu.mjs} +1486 -1211
- package/dist/lib/index.css +1 -1
- package/dist/{metadata/initMock-C-cnv--V.mjs → lib/initMock-CB_cMi6U.mjs} +25 -15
- package/dist/lib/language-server-web-worker.mjs +1 -1
- package/dist/lib/language-server.mjs +1 -1
- package/dist/lib/{metadata-utils-CtY0QcvH.mjs → metadata-utils-BTIt1_wE.mjs} +1 -1
- package/dist/lib/{server-common-Cine5nRR.mjs → server-common-DYZtsdM7.mjs} +51 -14
- package/dist/lib/{transform-bHBjkKSL.mjs → transform-Tooy42EB.mjs} +16 -18
- package/dist/lib/xmlui-parser.mjs +2 -2
- package/dist/lib/{xmlui-serializer-DB6BLiXK.mjs → xmlui-serializer-uCYa8_tZ.mjs} +1 -1
- package/dist/lib/xmlui.d.ts +11 -3
- package/dist/lib/xmlui.mjs +2 -2
- package/dist/metadata/{apiInterceptorWorker-BmKP8bnq.mjs → apiInterceptorWorker-Dql7QGw2.mjs} +1 -1
- package/dist/metadata/{collectedComponentMetadata-Cp-9lpnG.mjs → collectedComponentMetadata-MFUg6aSX.mjs} +1655 -1390
- package/dist/{lib/initMock-BMxsanHc.mjs → metadata/initMock-Dw9wrVkQ.mjs} +25 -15
- package/dist/metadata/style.css +1 -1
- package/dist/metadata/xmlui-metadata.mjs +1 -1
- package/dist/metadata/xmlui-metadata.umd.js +3 -3
- package/dist/scripts/package.json +3 -6
- package/dist/scripts/src/components/Animation/AnimationNative.js +28 -28
- package/dist/scripts/src/components/App/App.js +4 -4
- package/dist/scripts/src/components/App/App.spec.js +17 -17
- package/dist/scripts/src/components/App/AppNative.js +1 -1
- package/dist/scripts/src/components/AppState/AppState.js +3 -2
- package/dist/scripts/src/components/AppState/AppState.spec.js +26 -2
- package/dist/scripts/src/components/AppState/AppStateNative.js +3 -4
- package/dist/scripts/src/components/AutoComplete/AutoComplete.js +15 -10
- package/dist/scripts/src/components/AutoComplete/AutoCompleteNative.js +4 -4
- package/dist/scripts/src/components/Carousel/Carousel.spec.js +214 -0
- package/dist/scripts/src/components/CodeBlock/CodeBlockNative.js +1 -1
- package/dist/scripts/src/components/ContentSeparator/ContentSeparator.js +2 -0
- package/dist/scripts/src/components/ContentSeparator/ContentSeparator.spec.js +193 -0
- package/dist/scripts/src/components/DateInput/DateInput.spec.js +6 -6
- package/dist/scripts/src/components/DateInput/DateInputNative.js +0 -1
- package/dist/scripts/src/components/DropdownMenu/DropdownMenu.spec.js +3 -3
- package/dist/scripts/src/components/FileUploadDropZone/FileUploadDropZoneNative.js +4 -13
- package/dist/scripts/src/components/Form/Form.spec.js +25 -9
- package/dist/scripts/src/components/Form/FormNative.js +7 -5
- package/dist/scripts/src/components/FormItem/FormItem.js +3 -1
- package/dist/scripts/src/components/FormItem/FormItem.spec.js +5 -14
- package/dist/scripts/src/components/FormItem/FormItemNative.js +12 -8
- package/dist/scripts/src/components/FormItem/Validations.js +2 -2
- package/dist/scripts/src/components/IFrame/IFrameNative.js +0 -2
- package/dist/scripts/src/components/IconRegistryContext.js +1 -1
- package/dist/scripts/src/components/List/ListNative.js +2 -2
- package/dist/scripts/src/components/ModalDialog/ConfirmationModalContextProvider.js +3 -12
- package/dist/scripts/src/components/ModalDialog/ModalDialog.js +2 -2
- package/dist/scripts/src/components/ModalDialog/ModalDialogNative.js +6 -3
- package/dist/scripts/src/components/NestedApp/AppWithCodeViewNative.js +1 -1
- package/dist/scripts/src/components/NestedApp/NestedAppNative.js +3 -3
- package/dist/scripts/src/components/NumberBox/NumberBox.spec.js +2 -2
- package/dist/scripts/src/components/Pagination/Pagination.spec.js +5 -0
- package/dist/scripts/src/components/Pagination/PaginationNative.js +1 -3
- package/dist/scripts/src/components/Queue/Queue.spec.js +45 -47
- package/dist/scripts/src/components/Queue/QueueNative.js +1 -1
- package/dist/scripts/src/components/RadioGroup/RadioGroup.spec.js +5 -5
- package/dist/scripts/src/components/RealTimeAdapter/RealTimeAdapterNative.js +1 -1
- package/dist/scripts/src/components/Select/MultiSelectOption.js +42 -0
- package/dist/scripts/src/components/Select/Select.js +3 -3
- package/dist/scripts/src/components/Select/SelectContext.js +8 -1
- package/dist/scripts/src/components/Select/SelectNative.js +134 -142
- package/dist/scripts/src/components/Select/SelectOption.js +34 -0
- package/dist/scripts/src/components/Select/SimpleSelect.js +57 -0
- package/dist/scripts/src/components/Spinner/Spinner.spec.js +1 -1
- package/dist/scripts/src/components/Table/useRowSelection.js +14 -23
- package/dist/scripts/src/components/Text/Text.js +5 -1
- package/dist/scripts/src/components/Text/Text.spec.js +317 -0
- package/dist/scripts/src/components/Text/TextNative.js +112 -1
- package/dist/scripts/src/components/TextArea/TextArea.spec.js +8 -8
- package/dist/scripts/src/components/Theme/Theme.js +2 -1
- package/dist/scripts/src/components/Theme/Theme.spec.js +266 -0
- package/dist/scripts/src/components/Theme/ThemeNative.js +8 -1
- package/dist/scripts/src/components/TimeInput/TimeInput.spec.js +3 -3
- package/dist/scripts/src/components/TimeInput/TimeInputNative.js +0 -1
- package/dist/scripts/src/components/Timer/TimerNative.js +0 -1
- package/dist/scripts/src/components/Tree/TreeNative.js +16 -23
- package/dist/scripts/src/components-core/InspectorContext.js +1 -1
- package/dist/scripts/src/components-core/StandaloneApp.js +6 -8
- package/dist/scripts/src/components-core/action/FileUploadAction.js +1 -1
- package/dist/scripts/src/components-core/behaviors/BehaviorContext.js +50 -0
- package/dist/scripts/src/components-core/behaviors/CoreBehaviors.js +6 -1
- package/dist/scripts/src/components-core/interception/ApiInterceptor.js +9 -11
- package/dist/scripts/src/components-core/interception/ApiInterceptorProvider.js +3 -3
- package/dist/scripts/src/components-core/interception/Backend.js +1 -1
- package/dist/scripts/src/components-core/interception/IndexedDb.js +64 -66
- package/dist/scripts/src/components-core/interception/apiInterceptorWorker.js +2 -2
- package/dist/scripts/src/components-core/loader/DataLoader.js +6 -14
- package/dist/scripts/src/components-core/loader/Loader.js +11 -11
- package/dist/scripts/src/components-core/loader/MockLoaderRenderer.js +4 -2
- package/dist/scripts/src/components-core/loader/PageableLoader.js +10 -9
- package/dist/scripts/src/components-core/rendering/AppContent.js +1 -7
- package/dist/scripts/src/components-core/rendering/ErrorBoundary.js +1 -1
- package/dist/scripts/src/components-core/script-runner/bannedFunctions.js +1 -1
- package/dist/scripts/src/components-core/script-runner/eval-tree-async.js +180 -186
- package/dist/scripts/src/components-core/script-runner/eval-tree-sync.js +6 -6
- package/dist/scripts/src/components-core/script-runner/process-statement-sync.js +2 -2
- package/dist/scripts/src/components-core/utils/actionUtils.js +1 -1
- package/dist/scripts/src/components-core/utils/hooks.js +1 -1
- package/dist/scripts/src/components-core/utils/misc.js +4 -4
- package/dist/scripts/src/components-core/xmlui-parser.js +47 -31
- package/dist/scripts/src/language-server/server-common.js +25 -24
- package/dist/scripts/src/language-server/services/common/lsp-utils.js +2 -2
- package/dist/scripts/src/language-server/services/completion.js +20 -2
- package/dist/scripts/src/language-server/services/diagnostic.js +1 -1
- package/dist/scripts/src/language-server/services/hover.js +2 -2
- package/dist/scripts/src/parsers/common/utils.js +2 -2
- package/dist/scripts/src/parsers/scripting/Lexer.js +21 -15
- package/dist/scripts/src/parsers/scripting/Parser.js +8 -9
- package/dist/scripts/src/parsers/style-parser/StyleLexer.js +22 -22
- package/dist/scripts/src/parsers/style-parser/StyleParser.js +70 -68
- package/dist/scripts/src/testing/ComponentDrivers.js +20 -39
- package/dist/scripts/src/testing/component-test-helpers.js +34 -50
- package/dist/scripts/src/testing/fixtures.js +114 -113
- package/dist/scripts/src/testing/themed-app-test-helpers.js +7 -13
- package/dist/standalone/xmlui-standalone.es.d.ts +11 -3
- package/dist/standalone/xmlui-standalone.umd.js +35 -35
- 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
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
const
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
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 =
|
|
356
|
-
const wrappedFunc = (...args) =>
|
|
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 =
|
|
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
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
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
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
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
|
-
|
|
522
|
-
|
|
523
|
-
|
|
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(
|
|
475
|
+
throw new Error("Unexpected arrow argument specification");
|
|
527
476
|
}
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
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
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
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
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
function
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
if (
|
|
572
|
-
|
|
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
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
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
|
|
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);
|