xmlui 0.9.0 → 0.9.2
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/{apiInterceptorWorker-B1u6prJM.mjs → apiInterceptorWorker-DJ_oGB-F.mjs} +1 -1
- package/dist/{index-CVvazA5D.mjs → index-2qtmUAFJ.mjs} +37 -21
- package/dist/index.css +12 -14
- package/dist/scripts/bin/vite-xmlui-plugin.js +1 -1
- package/dist/scripts/src/abstractions/scripting/ScriptingSourceTree.js +48 -0
- package/dist/scripts/src/components/Markdown/MarkdownNative.js +2 -2
- package/dist/scripts/src/components-core/RestApiProxy.js +2 -2
- package/dist/scripts/src/components-core/rendering/Container.js +3 -3
- package/dist/scripts/src/components-core/rendering/StateContainer.js +3 -3
- package/dist/scripts/src/components-core/script-runner/ParameterParser.js +1 -1
- package/dist/scripts/src/components-core/script-runner/eval-tree-async.js +66 -47
- package/dist/scripts/src/components-core/script-runner/eval-tree-common.js +8 -8
- package/dist/scripts/src/components-core/script-runner/eval-tree-sync.js +37 -37
- package/dist/scripts/src/components-core/script-runner/process-statement-async.js +29 -29
- package/dist/scripts/src/components-core/script-runner/process-statement-common.js +5 -5
- package/dist/scripts/src/components-core/script-runner/process-statement-sync.js +29 -29
- package/dist/scripts/src/components-core/script-runner/visitors.js +47 -47
- package/dist/scripts/src/components-core/theming/ThemeProvider.js +2 -2
- package/dist/scripts/src/components-core/theming/themes/root.js +1 -1
- package/dist/scripts/src/components-core/utils/statementUtils.js +32 -32
- package/dist/scripts/src/parsers/scripting/Lexer.js +166 -178
- package/dist/scripts/src/parsers/scripting/Parser.js +555 -701
- package/dist/scripts/src/parsers/scripting/ParserError.js +3 -3
- package/dist/scripts/src/parsers/scripting/TokenTrait.js +103 -105
- package/dist/scripts/src/parsers/{scripting-exp → scripting}/code-behind-collect.js +4 -4
- package/dist/scripts/src/parsers/{scripting-exp → scripting}/modules.js +2 -2
- package/dist/scripts/src/parsers/{scripting-exp → scripting}/tree-visitor.js +45 -45
- package/dist/scripts/src/parsers/xmlui-parser/transform.js +2 -2
- package/dist/style.css +12 -14
- package/dist/xmlui-metadata.mjs +1 -1
- package/dist/xmlui-metadata.umd.js +1 -1
- package/dist/xmlui-parser.d.ts +1 -11
- package/dist/xmlui-standalone.umd.js +51 -37
- package/dist/xmlui.d.ts +2 -75
- package/dist/xmlui.mjs +1 -1
- package/package.json +3 -3
- package/dist/scripts/src/abstractions/scripting/ScriptingSourceTreeExp.js +0 -50
- package/dist/scripts/src/abstractions/scripting/Token.js +0 -112
- package/dist/scripts/src/components-core/theming/abstractions.js +0 -11
- package/dist/scripts/src/parsers/scripting-exp/Lexer.js +0 -1092
- package/dist/scripts/src/parsers/scripting-exp/Parser.js +0 -2635
- package/dist/scripts/src/parsers/scripting-exp/ParserError.js +0 -47
- package/dist/scripts/src/parsers/scripting-exp/TokenTrait.js +0 -109
- /package/dist/scripts/src/abstractions/scripting/{LogicalThreadExp.js → LogicalThread.js} +0 -0
- /package/dist/scripts/src/parsers/{scripting-exp → scripting}/TokenType.js +0 -0
|
@@ -12,7 +12,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
12
12
|
var _executor, _DeferredPromise_instances, decorate_fn, _a2;
|
|
13
13
|
import { delay as delay$1, HttpResponse, http } from "msw";
|
|
14
14
|
import { isArray, isObject as isObject$1, mapValues } from "lodash-es";
|
|
15
|
-
import { r as runEventHandlerCode, g as getDate, d as delay, m as miscellaneousUtils, a as dateFunctions, o as orderBy, T as ThrowStatementError } from "./index-
|
|
15
|
+
import { r as runEventHandlerCode, g as getDate, d as delay, m as miscellaneousUtils, a as dateFunctions, o as orderBy, T as ThrowStatementError } from "./index-2qtmUAFJ.mjs";
|
|
16
16
|
import Dexie from "dexie";
|
|
17
17
|
var POSITIONALS_EXP = /(%?)(%([sdijo]))/g;
|
|
18
18
|
function serializePositional(positional, flag) {
|
|
@@ -11541,14 +11541,14 @@ const progressBarComponentRenderer = createComponentRenderer(
|
|
|
11541
11541
|
}
|
|
11542
11542
|
);
|
|
11543
11543
|
const themeVars$p = `'{"boxShadow-Splitter": "var(--xmlui-boxShadow-Splitter)", "backgroundColor-Splitter": "var(--xmlui-backgroundColor-Splitter)", "borderRadius-Splitter": "var(--xmlui-borderRadius-Splitter)", "borderColor-Splitter": "var(--xmlui-borderColor-Splitter)", "borderWidth-Splitter": "var(--xmlui-borderWidth-Splitter)", "borderStyle-Splitter": "var(--xmlui-borderStyle-Splitter)", "border-Splitter": "var(--xmlui-border-Splitter)", "backgroundColor-resizer-Splitter": "var(--xmlui-backgroundColor-resizer-Splitter)", "thickness-resizer-Splitter": "var(--xmlui-thickness-resizer-Splitter)", "cursor-resizer-horizontal-Splitter": "var(--xmlui-cursor-resizer-horizontal-Splitter)", "cursor-resizer-vertical-Splitter": "var(--xmlui-cursor-resizer-vertical-Splitter)"}'`;
|
|
11544
|
-
const splitter = "
|
|
11545
|
-
const vertical$1 = "
|
|
11546
|
-
const horizontal = "
|
|
11547
|
-
const panel = "
|
|
11548
|
-
const primaryPanel = "
|
|
11549
|
-
const secondaryPanel = "
|
|
11550
|
-
const resizer = "
|
|
11551
|
-
const floatingResizer = "
|
|
11544
|
+
const splitter = "_splitter_12v45_13";
|
|
11545
|
+
const vertical$1 = "_vertical_12v45_26";
|
|
11546
|
+
const horizontal = "_horizontal_12v45_29";
|
|
11547
|
+
const panel = "_panel_12v45_33";
|
|
11548
|
+
const primaryPanel = "_primaryPanel_12v45_40";
|
|
11549
|
+
const secondaryPanel = "_secondaryPanel_12v45_47";
|
|
11550
|
+
const resizer = "_resizer_12v45_53";
|
|
11551
|
+
const floatingResizer = "_floatingResizer_12v45_67";
|
|
11552
11552
|
const styles$F = {
|
|
11553
11553
|
themeVars: themeVars$p,
|
|
11554
11554
|
splitter,
|
|
@@ -21677,7 +21677,6 @@ const styles$j = {
|
|
|
21677
21677
|
to,
|
|
21678
21678
|
baseRootComponent
|
|
21679
21679
|
};
|
|
21680
|
-
const ThemeToneKeys = ["light", "dark"];
|
|
21681
21680
|
const palette = {
|
|
21682
21681
|
$colorSurface0: "$color-surface-0",
|
|
21683
21682
|
$colorSurface50: "$color-surface-50",
|
|
@@ -22826,6 +22825,7 @@ const SolidThemeDefinition = {
|
|
|
22826
22825
|
"size-Icon": "1rem"
|
|
22827
22826
|
}
|
|
22828
22827
|
};
|
|
22828
|
+
const ThemeToneKeys = ["light", "dark"];
|
|
22829
22829
|
function useCompiledTheme(activeTheme, activeTone, themes = EMPTY_ARRAY, resources = EMPTY_OBJECT, resourceMap = EMPTY_OBJECT) {
|
|
22830
22830
|
const componentRegistry = useComponentRegistry();
|
|
22831
22831
|
const { componentThemeVars, componentDefaultThemeVars } = componentRegistry;
|
|
@@ -30808,7 +30808,7 @@ function IconProvider({ children }) {
|
|
|
30808
30808
|
/* @__PURE__ */ jsx("svg", { style: { display: "none" }, ref: spriteRootRef })
|
|
30809
30809
|
] });
|
|
30810
30810
|
}
|
|
30811
|
-
const version = "0.9.
|
|
30811
|
+
const version = "0.9.2";
|
|
30812
30812
|
const ApiInterceptorContext = createContext(null);
|
|
30813
30813
|
function useApiInterceptorContext() {
|
|
30814
30814
|
return useContext(ApiInterceptorContext);
|
|
@@ -31224,12 +31224,15 @@ async function evalBindingExpressionTreeAsync(thisStack, expr, evalContext, thre
|
|
|
31224
31224
|
}
|
|
31225
31225
|
async function evalMemberAccessAsync(evaluator, thisStack, expr, evalContext, thread) {
|
|
31226
31226
|
await evaluator(thisStack, expr.obj, evalContext, thread);
|
|
31227
|
+
await completeExprValue(expr.obj, thread);
|
|
31227
31228
|
return evalMemberAccessCore(thisStack, expr, evalContext, thread);
|
|
31228
31229
|
}
|
|
31229
31230
|
async function evalCalculatedMemberAccessAsync(evaluator, thisStack, expr, evalContext, thread) {
|
|
31230
31231
|
await evaluator(thisStack, expr.obj, evalContext, thread);
|
|
31232
|
+
await completeExprValue(expr.obj, thread);
|
|
31231
31233
|
await evaluator(thisStack, expr.member, evalContext, thread);
|
|
31232
31234
|
thisStack.pop();
|
|
31235
|
+
await completeExprValue(expr.member, thread);
|
|
31233
31236
|
return evalCalculatedMemberAccessCore(thisStack, expr, evalContext, thread);
|
|
31234
31237
|
}
|
|
31235
31238
|
async function evalSequenceAsync(evaluator, thisStack, expr, evalContext, thread) {
|
|
@@ -31305,14 +31308,13 @@ async function evalObjectLiteralAsync(evaluator, thisStack, expr, evalContext, t
|
|
|
31305
31308
|
async function evalUnaryAsync(evaluator, thisStack, expr, evalContext, thread) {
|
|
31306
31309
|
await evaluator(thisStack, expr.expr, evalContext, thread);
|
|
31307
31310
|
thisStack.pop();
|
|
31311
|
+
await completeExprValue(expr.expr, thread);
|
|
31308
31312
|
return evalUnaryCore(expr, thisStack, evalContext, thread);
|
|
31309
31313
|
}
|
|
31310
31314
|
async function evalBinaryAsync(evaluator, thisStack, expr, evalContext, thread) {
|
|
31311
|
-
var _a, _b;
|
|
31312
31315
|
await evaluator(thisStack, expr.left, evalContext, thread);
|
|
31313
31316
|
thisStack.pop();
|
|
31314
|
-
const l = await
|
|
31315
|
-
setExprValue(expr.left, { value: l }, thread);
|
|
31317
|
+
const l = await completeExprValue(expr.left, thread);
|
|
31316
31318
|
if (expr.op === "&&" && !l) {
|
|
31317
31319
|
setExprValue(expr, { value: l }, thread);
|
|
31318
31320
|
return l;
|
|
@@ -31323,13 +31325,13 @@ async function evalBinaryAsync(evaluator, thisStack, expr, evalContext, thread)
|
|
|
31323
31325
|
}
|
|
31324
31326
|
await evaluator(thisStack, expr.right, evalContext, thread);
|
|
31325
31327
|
thisStack.pop();
|
|
31326
|
-
|
|
31327
|
-
setExprValue(expr.right, { value: r }, thread);
|
|
31328
|
+
await completeExprValue(expr.right, thread);
|
|
31328
31329
|
return evalBinaryCore(expr, thisStack, evalContext, thread);
|
|
31329
31330
|
}
|
|
31330
31331
|
async function evalConditionalAsync(evaluator, thisStack, expr, evalContext, thread) {
|
|
31331
|
-
|
|
31332
|
+
await evaluator(thisStack, expr.cond, evalContext, thread);
|
|
31332
31333
|
thisStack.pop();
|
|
31334
|
+
const condition = await completeExprValue(expr.cond, thread);
|
|
31333
31335
|
const value = await evaluator(
|
|
31334
31336
|
thisStack,
|
|
31335
31337
|
condition ? expr.thenE : expr.elseE,
|
|
@@ -31348,8 +31350,10 @@ async function evalAssignmentAsync(evaluator, thisStack, expr, evalContext, thre
|
|
|
31348
31350
|
}
|
|
31349
31351
|
await evaluator(thisStack, leftValue, evalContext, thread);
|
|
31350
31352
|
thisStack.pop();
|
|
31353
|
+
await completeExprValue(leftValue, thread);
|
|
31351
31354
|
await evaluator(thisStack, expr.expr, evalContext, thread);
|
|
31352
31355
|
thisStack.pop();
|
|
31356
|
+
await completeExprValue(expr.expr, thread);
|
|
31353
31357
|
const value = evalAssignmentCore(thisStack, expr, evalContext, thread);
|
|
31354
31358
|
if (updatesState && evalContext.onDidUpdate) {
|
|
31355
31359
|
evalContext.onDidUpdate(rootScope, rootScope.name, "assignment");
|
|
@@ -31364,6 +31368,7 @@ async function evalPreOrPostAsync(evaluator, thisStack, expr, evalContext, threa
|
|
|
31364
31368
|
}
|
|
31365
31369
|
await evaluator(thisStack, expr.expr, evalContext, thread);
|
|
31366
31370
|
thisStack.pop();
|
|
31371
|
+
await completeExprValue(expr.expr, thread);
|
|
31367
31372
|
const value = evalPreOrPostCore(thisStack, expr, evalContext, thread);
|
|
31368
31373
|
if (updatesState && evalContext.onDidUpdate) {
|
|
31369
31374
|
evalContext.onDidUpdate(rootScope, rootScope.name, "pre-post");
|
|
@@ -31377,12 +31382,14 @@ async function evalFunctionInvocationAsync(evaluator, thisStack, expr, evalConte
|
|
|
31377
31382
|
let hostObject;
|
|
31378
31383
|
if (expr.obj.type === T_MEMBER_ACCESS_EXPRESSION) {
|
|
31379
31384
|
hostObject = await evaluator(thisStack, expr.obj.obj, evalContext, thread);
|
|
31385
|
+
await completeExprValue(expr.obj.obj, thread);
|
|
31380
31386
|
functionObj = evalMemberAccessCore(thisStack, expr.obj, evalContext, thread);
|
|
31381
31387
|
if (expr.obj.obj.type === T_IDENTIFIER && (hostObject == null ? void 0 : hostObject._SUPPORT_IMPLICIT_CONTEXT)) {
|
|
31382
31388
|
implicitContextObject = hostObject;
|
|
31383
31389
|
}
|
|
31384
31390
|
} else {
|
|
31385
|
-
|
|
31391
|
+
await evaluator(thisStack, expr.obj, evalContext, thread);
|
|
31392
|
+
functionObj = await completeExprValue(expr.obj, thread);
|
|
31386
31393
|
}
|
|
31387
31394
|
thisStack.pop();
|
|
31388
31395
|
const functionArgs = [];
|
|
@@ -31405,7 +31412,8 @@ async function evalFunctionInvocationAsync(evaluator, thisStack, expr, evalConte
|
|
|
31405
31412
|
for (let i = 0; i < expr.arguments.length; i++) {
|
|
31406
31413
|
const arg = expr.arguments[i];
|
|
31407
31414
|
if (arg.type === T_SPREAD_EXPRESSION) {
|
|
31408
|
-
|
|
31415
|
+
await evaluator([], arg.expr, evalContext, thread);
|
|
31416
|
+
const funcArg = await completeExprValue(arg.expr, thread);
|
|
31409
31417
|
if (!Array.isArray(funcArg)) {
|
|
31410
31418
|
throw new Error("Spread operator within a function invocation expects an array operand.");
|
|
31411
31419
|
}
|
|
@@ -31418,7 +31426,8 @@ async function evalFunctionInvocationAsync(evaluator, thisStack, expr, evalConte
|
|
|
31418
31426
|
};
|
|
31419
31427
|
functionArgs.push(wrappedFunc);
|
|
31420
31428
|
} else {
|
|
31421
|
-
|
|
31429
|
+
await evaluator([], arg, evalContext, thread);
|
|
31430
|
+
const funcArg = await completeExprValue(arg, thread);
|
|
31422
31431
|
if (funcArg == null ? void 0 : funcArg._ARROW_EXPR_) {
|
|
31423
31432
|
const wrappedFuncArg = await createArrowFunctionAsync(evaluator, funcArg);
|
|
31424
31433
|
const wrappedFunc = (...args) => wrappedFuncArg(funcArg.args, evalContext, thread, ...args);
|
|
@@ -31623,12 +31632,19 @@ async function completePromise(input2) {
|
|
|
31623
31632
|
async function evalTemplateLiteralAsync(evaluator, thisStack, expr, evalContext, thread) {
|
|
31624
31633
|
const segmentValues = new Array(expr.segments.length);
|
|
31625
31634
|
for (let i = 0; i < expr.segments.length; ++i) {
|
|
31626
|
-
|
|
31635
|
+
await evaluator(thisStack, expr.segments[i], evalContext, thread);
|
|
31627
31636
|
thisStack.pop();
|
|
31637
|
+
const evaledValue = await completeExprValue(expr.segments[i], thread);
|
|
31628
31638
|
segmentValues[i] = evaledValue;
|
|
31629
31639
|
}
|
|
31630
31640
|
return evalTemplateLiteralCore(segmentValues);
|
|
31631
31641
|
}
|
|
31642
|
+
async function completeExprValue(expr, thread) {
|
|
31643
|
+
const exprValue = getExprValue(expr, thread);
|
|
31644
|
+
const awaited = await completePromise(exprValue == null ? void 0 : exprValue.value);
|
|
31645
|
+
setExprValue(expr, { ...exprValue, value: awaited }, thread);
|
|
31646
|
+
return awaited;
|
|
31647
|
+
}
|
|
31632
31648
|
async function processStatementQueueAsync(statements, evalContext, thread) {
|
|
31633
31649
|
var _a, _b, _c;
|
|
31634
31650
|
if (!thread) {
|
|
@@ -34776,7 +34792,7 @@ function ApiInterceptorProvider({
|
|
|
34776
34792
|
let interceptorWorker;
|
|
34777
34793
|
(async () => {
|
|
34778
34794
|
if (process.env.VITE_MOCK_ENABLED) {
|
|
34779
|
-
const { createApiInterceptorWorker } = await import("./apiInterceptorWorker-
|
|
34795
|
+
const { createApiInterceptorWorker } = await import("./apiInterceptorWorker-DJ_oGB-F.mjs");
|
|
34780
34796
|
if (interceptor) {
|
|
34781
34797
|
interceptorWorker = await createApiInterceptorWorker(interceptor, apiWorker);
|
|
34782
34798
|
if (!apiWorker) {
|
package/dist/index.css
CHANGED
|
@@ -4050,7 +4050,7 @@ See this source for details: https://css-tricks.com/line-clampin/
|
|
|
4050
4050
|
* This function allows other CSS modules to get the value of the CSS variable specified in $componentVariable.
|
|
4051
4051
|
Optionally, you can provide a $fallbackValue to set the variable's value if that is not defined.
|
|
4052
4052
|
*/
|
|
4053
|
-
.
|
|
4053
|
+
._splitter_12v45_13 {
|
|
4054
4054
|
overflow: hidden;
|
|
4055
4055
|
position: relative;
|
|
4056
4056
|
flex-wrap: nowrap;
|
|
@@ -4063,50 +4063,48 @@ See this source for details: https://css-tricks.com/line-clampin/
|
|
|
4063
4063
|
border: var(--xmlui-border-Splitter) var(--xmlui-borderStyle-Splitter) var(--xmlui-borderColor-Splitter);
|
|
4064
4064
|
user-select: none;
|
|
4065
4065
|
}
|
|
4066
|
-
.
|
|
4066
|
+
._splitter_12v45_13._vertical_12v45_26 {
|
|
4067
4067
|
flex-direction: column;
|
|
4068
4068
|
}
|
|
4069
|
-
.
|
|
4069
|
+
._splitter_12v45_13._horizontal_12v45_29 {
|
|
4070
4070
|
flex-direction: row;
|
|
4071
4071
|
}
|
|
4072
4072
|
|
|
4073
|
-
.
|
|
4073
|
+
._panel_12v45_33 {
|
|
4074
4074
|
overflow: hidden;
|
|
4075
4075
|
display: flex;
|
|
4076
4076
|
flex-direction: column;
|
|
4077
4077
|
flex: 1;
|
|
4078
4078
|
}
|
|
4079
4079
|
|
|
4080
|
-
.
|
|
4080
|
+
._primaryPanel_12v45_40 {
|
|
4081
4081
|
flex-shrink: 0;
|
|
4082
4082
|
flex-grow: 0;
|
|
4083
4083
|
overflow: auto;
|
|
4084
4084
|
order: 1;
|
|
4085
4085
|
}
|
|
4086
4086
|
|
|
4087
|
-
.
|
|
4087
|
+
._secondaryPanel_12v45_47 {
|
|
4088
4088
|
flex: 1;
|
|
4089
4089
|
overflow: auto;
|
|
4090
4090
|
order: 3;
|
|
4091
4091
|
}
|
|
4092
4092
|
|
|
4093
|
-
.
|
|
4093
|
+
._resizer_12v45_53 {
|
|
4094
4094
|
order: 2;
|
|
4095
4095
|
overflow: hidden;
|
|
4096
4096
|
background-color: var(--xmlui-backgroundColor-resizer-Splitter, transparent);
|
|
4097
4097
|
}
|
|
4098
|
-
.
|
|
4098
|
+
._resizer_12v45_53._vertical_12v45_26 {
|
|
4099
4099
|
cursor: var(--xmlui-cursor-resizer-vertical-Splitter, ns-resize);
|
|
4100
|
-
width: 100%;
|
|
4101
4100
|
height: var(--xmlui-thickness-resizer-Splitter, 5px);
|
|
4102
4101
|
}
|
|
4103
|
-
.
|
|
4102
|
+
._resizer_12v45_53._horizontal_12v45_29 {
|
|
4104
4103
|
cursor: var(--xmlui-cursor-resizer-horizontal-Splitter, ew-resize);
|
|
4105
4104
|
width: var(--xmlui-thickness-resizer-Splitter, 5px);
|
|
4106
|
-
height: 100%;
|
|
4107
4105
|
}
|
|
4108
4106
|
|
|
4109
|
-
.
|
|
4107
|
+
._floatingResizer_12v45_67 {
|
|
4110
4108
|
position: absolute;
|
|
4111
4109
|
z-index: 1000;
|
|
4112
4110
|
opacity: 0;
|
|
@@ -4114,13 +4112,13 @@ See this source for details: https://css-tricks.com/line-clampin/
|
|
|
4114
4112
|
transition: opacity 0.2s;
|
|
4115
4113
|
background-color: var(--xmlui-backgroundColor-resizer-Splitter, transparent);
|
|
4116
4114
|
}
|
|
4117
|
-
.
|
|
4115
|
+
._floatingResizer_12v45_67._vertical_12v45_26 {
|
|
4118
4116
|
cursor: var(--xmlui-cursor-resizer-vertical-Splitter, ns-resize);
|
|
4119
4117
|
width: 100%;
|
|
4120
4118
|
height: var(--xmlui-thickness-resizer-Splitter, 5px);
|
|
4121
4119
|
transform: translateY(-50%);
|
|
4122
4120
|
}
|
|
4123
|
-
.
|
|
4121
|
+
._floatingResizer_12v45_67._horizontal_12v45_29 {
|
|
4124
4122
|
cursor: var(--xmlui-cursor-resizer-horizontal-Splitter, ew-resize);
|
|
4125
4123
|
width: var(--xmlui-thickness-resizer-Splitter, 5px);
|
|
4126
4124
|
height: 100%;
|
|
@@ -44,7 +44,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
44
44
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
45
45
|
exports.default = viteXmluiPlugin;
|
|
46
46
|
const pluginutils_1 = require("@rollup/pluginutils");
|
|
47
|
-
const code_behind_collect_1 = require("../src/parsers/scripting
|
|
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
50
|
const fs = __importStar(require("fs"));
|
|
@@ -1,2 +1,50 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.T_SWITCH_CASE = exports.T_OBJECT_DESTRUCTURE = exports.T_ARRAY_DESTRUCTURE = exports.T_DESTRUCTURE = exports.T_VAR_DECLARATION = exports.T_REACTIVE_VAR_DECLARATION = exports.T_POSTFIX_OP_EXPRESSION = exports.T_PREFIX_OP_EXPRESSION = exports.T_ARROW_EXPRESSION = exports.T_NO_ARG_EXPRESSION = exports.T_ASSIGNMENT_EXPRESSION = exports.T_SPREAD_EXPRESSION = exports.T_OBJECT_LITERAL = exports.T_ARRAY_LITERAL = exports.T_LITERAL = exports.T_TEMPLATE_LITERAL_EXPRESSION = exports.T_IDENTIFIER = exports.T_CALCULATED_MEMBER_ACCESS_EXPRESSION = exports.T_MEMBER_ACCESS_EXPRESSION = exports.T_FUNCTION_INVOCATION_EXPRESSION = exports.T_CONDITIONAL_EXPRESSION = exports.T_SEQUENCE_EXPRESSION = exports.T_BINARY_EXPRESSION = exports.T_UNARY_EXPRESSION = exports.T_FUNCTION_DECLARATION = exports.T_SWITCH_STATEMENT = exports.T_TRY_STATEMENT = exports.T_THROW_STATEMENT = exports.T_FOR_OF_STATEMENT = exports.T_FOR_IN_STATEMENT = exports.T_FOR_STATEMENT = exports.T_DO_WHILE_STATEMENT = exports.T_WHILE_STATEMENT = exports.T_CONTINUE_STATEMENT = exports.T_BREAK_STATEMENT = exports.T_RETURN_STATEMENT = exports.T_IF_STATEMENT = exports.T_VAR_STATEMENT = exports.T_CONST_STATEMENT = exports.T_LET_STATEMENT = exports.T_ARROW_EXPRESSION_STATEMENT = exports.T_EXPRESSION_STATEMENT = exports.T_EMPTY_STATEMENT = exports.T_BLOCK_STATEMENT = void 0;
|
|
4
|
+
// --- Statement node type values
|
|
5
|
+
exports.T_BLOCK_STATEMENT = 1;
|
|
6
|
+
exports.T_EMPTY_STATEMENT = 2;
|
|
7
|
+
exports.T_EXPRESSION_STATEMENT = 3;
|
|
8
|
+
exports.T_ARROW_EXPRESSION_STATEMENT = 4;
|
|
9
|
+
exports.T_LET_STATEMENT = 5;
|
|
10
|
+
exports.T_CONST_STATEMENT = 6;
|
|
11
|
+
exports.T_VAR_STATEMENT = 7;
|
|
12
|
+
exports.T_IF_STATEMENT = 8;
|
|
13
|
+
exports.T_RETURN_STATEMENT = 9;
|
|
14
|
+
exports.T_BREAK_STATEMENT = 10;
|
|
15
|
+
exports.T_CONTINUE_STATEMENT = 11;
|
|
16
|
+
exports.T_WHILE_STATEMENT = 12;
|
|
17
|
+
exports.T_DO_WHILE_STATEMENT = 13;
|
|
18
|
+
exports.T_FOR_STATEMENT = 14;
|
|
19
|
+
exports.T_FOR_IN_STATEMENT = 15;
|
|
20
|
+
exports.T_FOR_OF_STATEMENT = 16;
|
|
21
|
+
exports.T_THROW_STATEMENT = 17;
|
|
22
|
+
exports.T_TRY_STATEMENT = 18;
|
|
23
|
+
exports.T_SWITCH_STATEMENT = 19;
|
|
24
|
+
exports.T_FUNCTION_DECLARATION = 20;
|
|
25
|
+
// --- Expression node type values
|
|
26
|
+
exports.T_UNARY_EXPRESSION = 100;
|
|
27
|
+
exports.T_BINARY_EXPRESSION = 101;
|
|
28
|
+
exports.T_SEQUENCE_EXPRESSION = 102;
|
|
29
|
+
exports.T_CONDITIONAL_EXPRESSION = 103;
|
|
30
|
+
exports.T_FUNCTION_INVOCATION_EXPRESSION = 104;
|
|
31
|
+
exports.T_MEMBER_ACCESS_EXPRESSION = 105;
|
|
32
|
+
exports.T_CALCULATED_MEMBER_ACCESS_EXPRESSION = 106;
|
|
33
|
+
exports.T_IDENTIFIER = 107;
|
|
34
|
+
exports.T_TEMPLATE_LITERAL_EXPRESSION = 108;
|
|
35
|
+
exports.T_LITERAL = 109;
|
|
36
|
+
exports.T_ARRAY_LITERAL = 110;
|
|
37
|
+
exports.T_OBJECT_LITERAL = 111;
|
|
38
|
+
exports.T_SPREAD_EXPRESSION = 112;
|
|
39
|
+
exports.T_ASSIGNMENT_EXPRESSION = 113;
|
|
40
|
+
exports.T_NO_ARG_EXPRESSION = 114;
|
|
41
|
+
exports.T_ARROW_EXPRESSION = 115;
|
|
42
|
+
exports.T_PREFIX_OP_EXPRESSION = 116;
|
|
43
|
+
exports.T_POSTFIX_OP_EXPRESSION = 117;
|
|
44
|
+
exports.T_REACTIVE_VAR_DECLARATION = 118;
|
|
45
|
+
// --- Other node type values
|
|
46
|
+
exports.T_VAR_DECLARATION = 200;
|
|
47
|
+
exports.T_DESTRUCTURE = 201;
|
|
48
|
+
exports.T_ARRAY_DESTRUCTURE = 202;
|
|
49
|
+
exports.T_OBJECT_DESTRUCTURE = 203;
|
|
50
|
+
exports.T_SWITCH_CASE = 204;
|
|
@@ -16,7 +16,7 @@ const TextNative_1 = require("../Text/TextNative");
|
|
|
16
16
|
const LinkNative_1 = require("../Link/LinkNative");
|
|
17
17
|
const ImageNative_1 = require("../Image/ImageNative");
|
|
18
18
|
const Toggle_1 = require("../Toggle/Toggle");
|
|
19
|
-
const
|
|
19
|
+
const ScriptingSourceTree_1 = require("../../abstractions/scripting/ScriptingSourceTree");
|
|
20
20
|
exports.defaultProps = {
|
|
21
21
|
removeIndents: true,
|
|
22
22
|
};
|
|
@@ -253,7 +253,7 @@ function bindingExpression({ extractValue }) {
|
|
|
253
253
|
}
|
|
254
254
|
function parseArrowFunc(extracted) {
|
|
255
255
|
if (extracted.hasOwnProperty("type") &&
|
|
256
|
-
extracted.type ===
|
|
256
|
+
extracted.type === ScriptingSourceTree_1.T_ARROW_EXPRESSION &&
|
|
257
257
|
(extracted === null || extracted === void 0 ? void 0 : extracted._ARROW_EXPR_)) {
|
|
258
258
|
return "[xmlui function]";
|
|
259
259
|
}
|
|
@@ -43,7 +43,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
43
43
|
};
|
|
44
44
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
45
45
|
const lodash_es_1 = require("lodash-es");
|
|
46
|
-
const
|
|
46
|
+
const ScriptingSourceTree_1 = require("../abstractions/scripting/ScriptingSourceTree");
|
|
47
47
|
const extractParam_1 = require("./utils/extractParam");
|
|
48
48
|
const misc_1 = require("./utils/misc");
|
|
49
49
|
const EngineError_1 = require("./EngineError");
|
|
@@ -208,7 +208,7 @@ class RestApiProxy {
|
|
|
208
208
|
};
|
|
209
209
|
try {
|
|
210
210
|
const arrowStmt = {
|
|
211
|
-
type:
|
|
211
|
+
type: ScriptingSourceTree_1.T_ARROW_EXPRESSION_STATEMENT,
|
|
212
212
|
expr: value,
|
|
213
213
|
};
|
|
214
214
|
(0, process_statement_sync_1.processStatementQueue)([arrowStmt], evalContext);
|
|
@@ -52,7 +52,7 @@ const react_2 = require("@remix-run/react");
|
|
|
52
52
|
const lodash_es_1 = require("lodash-es");
|
|
53
53
|
const react_compose_refs_1 = require("@radix-ui/react-compose-refs");
|
|
54
54
|
const memoize_one_1 = __importDefault(require("memoize-one"));
|
|
55
|
-
const
|
|
55
|
+
const ScriptingSourceTree_1 = require("../../abstractions/scripting/ScriptingSourceTree");
|
|
56
56
|
const containers_1 = require("../abstractions/containers");
|
|
57
57
|
const AppContext_1 = require("../AppContext");
|
|
58
58
|
const buildProxy_1 = require("../rendering/buildProxy");
|
|
@@ -163,7 +163,7 @@ exports.Container = (0, react_1.memo)((0, react_1.forwardRef)(function Container
|
|
|
163
163
|
else {
|
|
164
164
|
statements = [
|
|
165
165
|
{
|
|
166
|
-
type:
|
|
166
|
+
type: ScriptingSourceTree_1.T_ARROW_EXPRESSION_STATEMENT,
|
|
167
167
|
expr: source, //TODO illesg (talk it through why we need to deep clone, it it's omitted, it gets slower every time we run it)
|
|
168
168
|
},
|
|
169
169
|
];
|
|
@@ -278,7 +278,7 @@ exports.Container = (0, react_1.memo)((0, react_1.forwardRef)(function Container
|
|
|
278
278
|
};
|
|
279
279
|
try {
|
|
280
280
|
const arrowStmt = {
|
|
281
|
-
type:
|
|
281
|
+
type: ScriptingSourceTree_1.T_ARROW_EXPRESSION_STATEMENT,
|
|
282
282
|
expr: arrowExpression,
|
|
283
283
|
};
|
|
284
284
|
(0, process_statement_sync_1.processStatementQueue)([arrowStmt], evalContext);
|
|
@@ -11,7 +11,7 @@ const lodash_es_1 = require("lodash-es");
|
|
|
11
11
|
const memoize_one_1 = __importDefault(require("memoize-one"));
|
|
12
12
|
const react_2 = require("@remix-run/react");
|
|
13
13
|
const containers_1 = require("../abstractions/containers");
|
|
14
|
-
const
|
|
14
|
+
const ScriptingSourceTree_1 = require("../../abstractions/scripting/ScriptingSourceTree");
|
|
15
15
|
const constants_1 = require("../constants");
|
|
16
16
|
const collectFnVarDeps_1 = require("../rendering/collectFnVarDeps");
|
|
17
17
|
const reducer_1 = require("../rendering/reducer");
|
|
@@ -20,7 +20,7 @@ const ErrorBoundary_1 = require("../rendering/ErrorBoundary");
|
|
|
20
20
|
const visitors_1 = require("../script-runner/visitors");
|
|
21
21
|
const hooks_1 = require("../utils/hooks");
|
|
22
22
|
const Container_1 = require("./Container");
|
|
23
|
-
const code_behind_collect_1 = require("../../parsers/scripting
|
|
23
|
+
const code_behind_collect_1 = require("../../parsers/scripting/code-behind-collect");
|
|
24
24
|
const AppContext_1 = require("../AppContext");
|
|
25
25
|
const ParameterParser_1 = require("../script-runner/ParameterParser");
|
|
26
26
|
const eval_tree_sync_1 = require("../script-runner/eval-tree-sync");
|
|
@@ -78,7 +78,7 @@ exports.StateContainer = (0, react_1.memo)((0, react_1.forwardRef)(function Stat
|
|
|
78
78
|
const functionDeps = (0, react_1.useMemo)(() => {
|
|
79
79
|
const fnDeps = {};
|
|
80
80
|
Object.entries(varDefinitions).forEach(([key, value]) => {
|
|
81
|
-
if (isParsedValue(value) && value.tree.type ===
|
|
81
|
+
if (isParsedValue(value) && value.tree.type === ScriptingSourceTree_1.T_ARROW_EXPRESSION) {
|
|
82
82
|
fnDeps[key] = (0, visitors_1.collectVariableDependencies)(value.tree, referenceTrackedApi);
|
|
83
83
|
}
|
|
84
84
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.parseParameterString = parseParameterString;
|
|
4
|
-
const Parser_1 = require("../../parsers/scripting
|
|
4
|
+
const Parser_1 = require("../../parsers/scripting/Parser");
|
|
5
5
|
/**
|
|
6
6
|
* This function parses a parameter string and splits them into string literal and binding expression sections
|
|
7
7
|
* @param source String to parse
|