xmlui 0.8.6 → 0.9.1
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-fLBfPj2T.mjs → apiInterceptorWorker-230V_-Ds.mjs} +1 -1
- package/dist/{index-wd8FRzuM.mjs → index-DUwwx3L4.mjs} +5864 -6108
- package/dist/index.css +274 -301
- package/dist/language-server.mjs +25 -1
- package/dist/{lint-B18Ko6Sy.mjs → lint-gX2osbkz.mjs} +920 -1120
- package/dist/scripts/bin/build.js +2 -2
- package/dist/scripts/bin/start.js +3 -9
- package/dist/scripts/bin/vite-xmlui-plugin.js +2 -2
- package/dist/scripts/bin/viteConfig.js +89 -63
- package/dist/scripts/src/abstractions/scripting/ScriptingSourceTreeExp.js +1 -2
- package/dist/scripts/src/components/Accordion/Accordion.js +6 -16
- package/dist/scripts/src/components/App/AppNative.js +8 -0
- package/dist/scripts/src/components/AppHeader/AppHeader.js +1 -5
- package/dist/scripts/src/components/AppHeader/AppHeaderNative.js +10 -4
- package/dist/scripts/src/components/AutoComplete/AutoComplete.js +13 -19
- package/dist/scripts/src/components/AutoComplete/AutoCompleteContext.js +2 -0
- package/dist/scripts/src/components/AutoComplete/AutoCompleteNative.js +7 -3
- package/dist/scripts/src/components/Avatar/Avatar.js +2 -9
- package/dist/scripts/src/components/Badge/Badge.js +2 -8
- package/dist/scripts/src/components/Button/Button.js +28 -60
- package/dist/scripts/src/components/Card/Card.js +1 -6
- package/dist/scripts/src/components/Checkbox/Checkbox.js +4 -12
- package/dist/scripts/src/components/ComponentProvider.js +4 -0
- package/dist/scripts/src/components/DatePicker/DatePicker.js +3 -10
- package/dist/scripts/src/components/DropdownMenu/DropdownMenu.js +1 -1
- package/dist/scripts/src/components/Form/Form.js +12 -28
- package/dist/scripts/src/components/Form/FormNative.js +9 -0
- package/dist/scripts/src/components/FormItem/HelperText.js +1 -1
- package/dist/scripts/src/components/FormItem/ItemWithLabel.js +2 -2
- package/dist/scripts/src/components/Heading/HeadingNative.js +0 -1
- package/dist/scripts/src/components/HtmlTags/HtmlTags.js +4 -19
- package/dist/scripts/src/components/IconProvider.js +2 -2
- package/dist/scripts/src/components/Link/Link.js +2 -8
- package/dist/scripts/src/components/Markdown/MarkdownNative.js +4 -4
- package/dist/scripts/src/components/ModalDialog/ModalDialog.js +1 -3
- package/dist/scripts/src/components/NavGroup/NavGroup.js +34 -3
- package/dist/scripts/src/components/NavGroup/NavGroupNative.js +24 -12
- package/dist/scripts/src/components/NavLink/NavLink.js +4 -11
- package/dist/scripts/src/components/NavPanel/NavPanel.js +1 -6
- package/dist/scripts/src/components/ProgressBar/ProgressBar.js +2 -8
- package/dist/scripts/src/components/RadioGroup/RadioGroup.js +4 -12
- package/dist/scripts/src/components/Select/Select.js +5 -13
- package/dist/scripts/src/components/Select/SelectNative.js +7 -3
- package/dist/scripts/src/components/Slider/Slider.js +2 -8
- package/dist/scripts/src/components/Spinner/Spinner.js +1 -6
- package/dist/scripts/src/components/SubNavPanel/SubNavPanel.js +22 -0
- package/dist/scripts/src/components/SubNavPanel/SubNavPanelNative.js +9 -0
- package/dist/scripts/src/components/Switch/Switch.js +6 -16
- package/dist/scripts/src/components/Table/Table.js +8 -17
- package/dist/scripts/src/components/TableOfContents/TableOfContents.js +4 -12
- package/dist/scripts/src/components/Tabs/Tabs.js +3 -10
- package/dist/scripts/src/components/Text/Text.js +10 -24
- package/dist/scripts/src/components/TextBox/TextBoxNative.js +1 -1
- package/dist/scripts/src/components/Theme/ThemeNative.js +1 -1
- package/dist/scripts/src/components/ValidationSummary/ValidationSummary.js +3 -3
- package/dist/scripts/src/components-core/DevTools.js +5 -4
- package/dist/scripts/src/components-core/RestApiProxy.js +7 -3
- package/dist/scripts/src/components-core/action/APICall.js +2 -1
- package/dist/scripts/src/components-core/rendering/Container.js +15 -11
- package/dist/scripts/src/components-core/rendering/StateContainer.js +3 -2
- package/dist/scripts/src/components-core/script-runner/BindingTreeEvaluationContext.js +0 -2
- package/dist/scripts/src/components-core/script-runner/ParameterParser.js +1 -1
- package/dist/scripts/src/components-core/script-runner/asyncProxy.js +11 -64
- package/dist/scripts/src/components-core/script-runner/eval-tree-async.js +196 -175
- package/dist/scripts/src/components-core/script-runner/eval-tree-common.js +173 -231
- package/dist/scripts/src/components-core/script-runner/eval-tree-sync.js +129 -100
- package/dist/scripts/src/components-core/script-runner/process-statement-async.js +170 -175
- package/dist/scripts/src/components-core/script-runner/process-statement-common.js +48 -33
- package/dist/scripts/src/components-core/script-runner/process-statement-sync.js +164 -170
- package/dist/scripts/src/components-core/script-runner/statement-queue.js +5 -4
- package/dist/scripts/src/components-core/script-runner/visitors.js +124 -116
- package/dist/scripts/src/components-core/theming/themes/palette.js +1 -0
- package/dist/scripts/src/components-core/theming/themes/root.js +300 -154
- package/dist/scripts/src/components-core/theming/themes/theme-colors.js +510 -510
- package/dist/scripts/src/components-core/theming/themes/xmlui.js +0 -1
- package/dist/scripts/src/components-core/theming/transformThemeVars.js +11 -11
- package/dist/scripts/src/components-core/utils/misc.js +13 -0
- package/dist/scripts/src/components-core/utils/statementUtils.js +56 -53
- package/dist/scripts/src/components-core/xmlui-parser.js +1 -1
- package/dist/scripts/src/parsers/scripting-exp/Lexer.js +1092 -0
- package/dist/scripts/src/parsers/scripting-exp/Parser.js +2635 -0
- package/dist/scripts/src/parsers/scripting-exp/ParserError.js +47 -0
- package/dist/scripts/src/parsers/scripting-exp/TokenTrait.js +109 -0
- package/dist/scripts/src/parsers/scripting-exp/TokenType.js +2 -4
- package/dist/scripts/src/parsers/scripting-exp/code-behind-collect.js +101 -0
- package/dist/scripts/src/parsers/scripting-exp/modules.js +107 -0
- package/dist/scripts/src/parsers/{scripting → scripting-exp}/tree-visitor.js +103 -107
- package/dist/scripts/src/parsers/xmlui-parser/transform.js +12 -12
- package/dist/style.css +245 -286
- package/dist/xmlui-metadata.mjs +2741 -2211
- package/dist/xmlui-metadata.umd.js +2740 -2212
- package/dist/xmlui-parser.d.ts +320 -232
- package/dist/xmlui-parser.mjs +19 -19
- package/dist/xmlui-standalone.umd.js +6770 -7220
- package/dist/xmlui.d.ts +322 -230
- package/dist/xmlui.mjs +1 -1
- package/package.json +10 -6
- package/dist/_commonjsHelpers-CcAunmGO.mjs +0 -33
- package/dist/scripts/src/components-core/script-runner/ICustomOperations.js +0 -34
- package/dist/scripts/src/components-core/script-runner/custom-operations-registry.js +0 -40
- package/dist/scripts/src/components-core/script-runner/custom-ui-data.js +0 -40
- package/dist/scripts/src/components-core/script-runner/syncProxy.js +0 -31
- package/dist/scripts/src/parsers/scripting/code-behind-collect.js +0 -153
- package/dist/scripts/src/parsers/scripting/modules.js +0 -284
- /package/dist/scripts/src/abstractions/scripting/{LogicalThread.js → LogicalThreadExp.js} +0 -0
- /package/dist/scripts/src/abstractions/scripting/{TryScope.js → TryScopeExp.js} +0 -0
|
@@ -45,15 +45,16 @@ function mapToItem(statement) {
|
|
|
45
45
|
return [
|
|
46
46
|
{
|
|
47
47
|
label: nextLabelValue++,
|
|
48
|
-
statement: Object.assign({}, statement)
|
|
49
|
-
}
|
|
48
|
+
statement: Object.assign({}, statement),
|
|
49
|
+
},
|
|
50
50
|
];
|
|
51
51
|
}
|
|
52
52
|
// --- Map a single statement into a queue item
|
|
53
|
-
function mapStatementToQueueItem(
|
|
53
|
+
function mapStatementToQueueItem(stmt) {
|
|
54
54
|
return {
|
|
55
55
|
label: nextLabelValue++,
|
|
56
|
-
statement:
|
|
56
|
+
statement: stmt.statement,
|
|
57
|
+
execInfo: Object.assign({}, stmt.execInfo),
|
|
57
58
|
};
|
|
58
59
|
}
|
|
59
60
|
// --- Map a list of statements into queue items
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.collectVariableDependencies = collectVariableDependencies;
|
|
4
4
|
const lodash_es_1 = require("lodash-es");
|
|
5
5
|
const eval_tree_common_1 = require("./eval-tree-common");
|
|
6
|
+
const ScriptingSourceTreeExp_1 = require("../../abstractions/scripting/ScriptingSourceTreeExp");
|
|
6
7
|
const process_statement_common_1 = require("./process-statement-common");
|
|
7
8
|
/**
|
|
8
9
|
* Collects the name of local context variables the specified program depends on
|
|
@@ -25,108 +26,108 @@ function collectVariableDependencies(program, referenceTrackedApis = {}) {
|
|
|
25
26
|
program.forEach((stmt) => {
|
|
26
27
|
let stmtDeps = [];
|
|
27
28
|
switch (stmt.type) {
|
|
28
|
-
case
|
|
29
|
+
case ScriptingSourceTreeExp_1.T_BLOCK_STATEMENT:
|
|
29
30
|
thread.blocks.push({ vars: {} });
|
|
30
|
-
stmtDeps = collectDependencies(stmt.
|
|
31
|
+
stmtDeps = collectDependencies(stmt.stmts, stmt, "block");
|
|
31
32
|
thread.blocks.pop();
|
|
32
33
|
break;
|
|
33
|
-
case
|
|
34
|
-
stmtDeps = collectDependencies(stmt.
|
|
34
|
+
case ScriptingSourceTreeExp_1.T_EXPRESSION_STATEMENT:
|
|
35
|
+
stmtDeps = collectDependencies(stmt.expr, stmt, "expression");
|
|
35
36
|
break;
|
|
36
|
-
case
|
|
37
|
+
case ScriptingSourceTreeExp_1.T_ARROW_EXPRESSION_STATEMENT:
|
|
37
38
|
thread.blocks.push({ vars: {} });
|
|
38
|
-
stmtDeps = collectDependencies(stmt.
|
|
39
|
+
stmtDeps = collectDependencies(stmt.expr, stmt, "arrow");
|
|
39
40
|
thread.blocks.pop();
|
|
40
41
|
break;
|
|
41
|
-
case
|
|
42
|
-
case
|
|
43
|
-
processDeclarations((0, process_statement_common_1.innermostBlockScope)(thread), stmt.
|
|
44
|
-
stmt.
|
|
45
|
-
if (decl.
|
|
46
|
-
stmtDeps = stmtDeps.concat(collectDependencies(decl.
|
|
42
|
+
case ScriptingSourceTreeExp_1.T_LET_STATEMENT:
|
|
43
|
+
case ScriptingSourceTreeExp_1.T_CONST_STATEMENT:
|
|
44
|
+
processDeclarations((0, process_statement_common_1.innermostBlockScope)(thread), stmt.decls);
|
|
45
|
+
stmt.decls.forEach((decl) => {
|
|
46
|
+
if (decl.expr) {
|
|
47
|
+
stmtDeps = stmtDeps.concat(collectDependencies(decl.expr, stmt, "letOrConst"));
|
|
47
48
|
}
|
|
48
49
|
});
|
|
49
50
|
break;
|
|
50
|
-
case
|
|
51
|
-
stmtDeps = collectDependencies(stmt.
|
|
52
|
-
stmtDeps = stmtDeps.concat(collectDependencies([stmt.
|
|
53
|
-
if (stmt.
|
|
54
|
-
stmtDeps = stmtDeps.concat(collectDependencies([stmt.
|
|
51
|
+
case ScriptingSourceTreeExp_1.T_IF_STATEMENT:
|
|
52
|
+
stmtDeps = collectDependencies(stmt.cond, stmt, "if");
|
|
53
|
+
stmtDeps = stmtDeps.concat(collectDependencies([stmt.thenB], stmt, "if"));
|
|
54
|
+
if (stmt.elseB) {
|
|
55
|
+
stmtDeps = stmtDeps.concat(collectDependencies([stmt.elseB], stmt, "if"));
|
|
55
56
|
}
|
|
56
57
|
break;
|
|
57
|
-
case
|
|
58
|
-
if (stmt.
|
|
59
|
-
stmtDeps = collectDependencies(stmt.
|
|
58
|
+
case ScriptingSourceTreeExp_1.T_RETURN_STATEMENT:
|
|
59
|
+
if (stmt.expr) {
|
|
60
|
+
stmtDeps = collectDependencies(stmt.expr, stmt, "return");
|
|
60
61
|
}
|
|
61
62
|
break;
|
|
62
|
-
case
|
|
63
|
-
stmtDeps = collectDependencies(stmt.
|
|
63
|
+
case ScriptingSourceTreeExp_1.T_WHILE_STATEMENT:
|
|
64
|
+
stmtDeps = collectDependencies(stmt.cond, stmt, "while");
|
|
64
65
|
stmtDeps = stmtDeps.concat(collectDependencies([stmt.body], stmt, "while"));
|
|
65
66
|
break;
|
|
66
|
-
case
|
|
67
|
-
stmtDeps = collectDependencies(stmt.
|
|
67
|
+
case ScriptingSourceTreeExp_1.T_DO_WHILE_STATEMENT:
|
|
68
|
+
stmtDeps = collectDependencies(stmt.cond, stmt, "doWhile");
|
|
68
69
|
stmtDeps = stmtDeps.concat(collectDependencies([stmt.body], stmt, "doWhile"));
|
|
69
70
|
break;
|
|
70
|
-
case
|
|
71
|
+
case ScriptingSourceTreeExp_1.T_FOR_STATEMENT:
|
|
71
72
|
thread.blocks.push({ vars: {} });
|
|
72
73
|
if (stmt.init) {
|
|
73
74
|
stmtDeps.concat(collectDependencies([stmt.init], stmt, "for"));
|
|
74
75
|
}
|
|
75
|
-
if (stmt.
|
|
76
|
-
stmtDeps = stmtDeps.concat(collectDependencies(stmt.
|
|
76
|
+
if (stmt.cond) {
|
|
77
|
+
stmtDeps = stmtDeps.concat(collectDependencies(stmt.cond, stmt, "for"));
|
|
77
78
|
}
|
|
78
|
-
if (stmt.
|
|
79
|
-
stmtDeps = stmtDeps.concat(collectDependencies(stmt.
|
|
79
|
+
if (stmt.upd) {
|
|
80
|
+
stmtDeps = stmtDeps.concat(collectDependencies(stmt.upd, stmt, "for"));
|
|
80
81
|
}
|
|
81
82
|
stmtDeps = stmtDeps.concat(collectDependencies([stmt.body], stmt, "for"));
|
|
82
83
|
thread.blocks.pop();
|
|
83
84
|
break;
|
|
84
|
-
case
|
|
85
|
+
case ScriptingSourceTreeExp_1.T_FOR_IN_STATEMENT:
|
|
85
86
|
thread.blocks.push({ vars: {} });
|
|
86
|
-
if (stmt.
|
|
87
|
+
if (stmt.varB !== "none") {
|
|
87
88
|
const block = (0, process_statement_common_1.innermostBlockScope)(thread);
|
|
88
|
-
block.vars[stmt.id] = true;
|
|
89
|
+
block.vars[stmt.id.name] = true;
|
|
89
90
|
}
|
|
90
|
-
stmtDeps = stmtDeps.concat(collectDependencies(stmt.
|
|
91
|
+
stmtDeps = stmtDeps.concat(collectDependencies(stmt.expr, stmt, "forIn"));
|
|
91
92
|
stmtDeps = stmtDeps.concat(collectDependencies([stmt.body], stmt, "forIn"));
|
|
92
93
|
thread.blocks.pop();
|
|
93
94
|
break;
|
|
94
|
-
case
|
|
95
|
+
case ScriptingSourceTreeExp_1.T_FOR_OF_STATEMENT:
|
|
95
96
|
thread.blocks.push({ vars: {} });
|
|
96
|
-
if (stmt.
|
|
97
|
+
if (stmt.varB !== "none") {
|
|
97
98
|
const block = (0, process_statement_common_1.innermostBlockScope)(thread);
|
|
98
|
-
block.vars[stmt.id] = true;
|
|
99
|
+
block.vars[stmt.id.name] = true;
|
|
99
100
|
}
|
|
100
|
-
stmtDeps = stmtDeps.concat(collectDependencies(stmt.
|
|
101
|
+
stmtDeps = stmtDeps.concat(collectDependencies(stmt.expr, stmt, "forOf"));
|
|
101
102
|
stmtDeps = stmtDeps.concat(collectDependencies([stmt.body], stmt, "forOf"));
|
|
102
103
|
thread.blocks.pop();
|
|
103
104
|
break;
|
|
104
|
-
case
|
|
105
|
-
stmtDeps = collectDependencies(stmt.
|
|
105
|
+
case ScriptingSourceTreeExp_1.T_THROW_STATEMENT:
|
|
106
|
+
stmtDeps = collectDependencies(stmt.expr, stmt, "throw");
|
|
106
107
|
break;
|
|
107
|
-
case
|
|
108
|
-
stmtDeps = collectDependencies([stmt.
|
|
109
|
-
if (stmt.
|
|
108
|
+
case ScriptingSourceTreeExp_1.T_TRY_STATEMENT:
|
|
109
|
+
stmtDeps = collectDependencies([stmt.tryB], stmt, "try");
|
|
110
|
+
if (stmt.catchB) {
|
|
110
111
|
thread.blocks.push({ vars: {} });
|
|
111
|
-
if (stmt.
|
|
112
|
+
if (stmt.catchV) {
|
|
112
113
|
const block = (0, process_statement_common_1.innermostBlockScope)(thread);
|
|
113
|
-
block.vars[stmt.
|
|
114
|
+
block.vars[stmt.catchV.name] = true;
|
|
114
115
|
}
|
|
115
|
-
stmtDeps = stmtDeps.concat(collectDependencies([stmt.
|
|
116
|
+
stmtDeps = stmtDeps.concat(collectDependencies([stmt.catchB], stmt, "catchBlock"));
|
|
116
117
|
thread.blocks.pop();
|
|
117
118
|
}
|
|
118
|
-
if (stmt.
|
|
119
|
-
stmtDeps = stmtDeps.concat(collectDependencies([stmt.
|
|
119
|
+
if (stmt.finallyB) {
|
|
120
|
+
stmtDeps = stmtDeps.concat(collectDependencies([stmt.finallyB], stmt, "finallyBlock"));
|
|
120
121
|
}
|
|
121
122
|
break;
|
|
122
|
-
case
|
|
123
|
-
stmtDeps = collectDependencies(stmt.
|
|
123
|
+
case ScriptingSourceTreeExp_1.T_SWITCH_STATEMENT:
|
|
124
|
+
stmtDeps = collectDependencies(stmt.expr, stmt, "switch");
|
|
124
125
|
stmt.cases.forEach((c) => {
|
|
125
|
-
if (c.
|
|
126
|
-
stmtDeps = stmtDeps.concat(collectDependencies(c.
|
|
126
|
+
if (c.caseE) {
|
|
127
|
+
stmtDeps = stmtDeps.concat(collectDependencies(c.caseE, stmt, "switch"));
|
|
127
128
|
}
|
|
128
|
-
if (c.
|
|
129
|
-
stmtDeps = stmtDeps.concat(collectDependencies(c.
|
|
129
|
+
if (c.stmts) {
|
|
130
|
+
stmtDeps = stmtDeps.concat(collectDependencies(c.stmts, stmt, "switch"));
|
|
130
131
|
}
|
|
131
132
|
});
|
|
132
133
|
break;
|
|
@@ -138,55 +139,59 @@ function collectVariableDependencies(program, referenceTrackedApis = {}) {
|
|
|
138
139
|
else {
|
|
139
140
|
// --- Visit expression
|
|
140
141
|
switch (program.type) {
|
|
141
|
-
case
|
|
142
|
+
case ScriptingSourceTreeExp_1.T_IDENTIFIER:
|
|
142
143
|
// --- Any non-block-scoped variable is a dependency to return
|
|
143
144
|
const scope = (0, eval_tree_common_1.getIdentifierScope)(program, evalContext, thread);
|
|
144
145
|
return scope.type !== "block" ? [program.name] : [];
|
|
145
|
-
case
|
|
146
|
+
case ScriptingSourceTreeExp_1.T_MEMBER_ACCESS_EXPRESSION:
|
|
146
147
|
// --- Check for a simple member-access chain. If it exist, add the member to the chain with the "." syntax
|
|
147
148
|
const memberChain = traverseMemberAccessChain(program);
|
|
148
|
-
return memberChain
|
|
149
|
-
|
|
149
|
+
return memberChain
|
|
150
|
+
? [memberChain]
|
|
151
|
+
: collectDependencies(program.obj, program, "memberAccess");
|
|
152
|
+
case ScriptingSourceTreeExp_1.T_CALCULATED_MEMBER_ACCESS_EXPRESSION:
|
|
150
153
|
// --- Check for a simple member-access chain. If it exist, add the member to the chain with the "[]" syntax
|
|
151
154
|
const calcMemberChain = traverseMemberAccessChain(program);
|
|
152
155
|
if (calcMemberChain) {
|
|
153
156
|
return [calcMemberChain];
|
|
154
157
|
}
|
|
155
|
-
let calcDeps = collectDependencies(program.
|
|
158
|
+
let calcDeps = collectDependencies(program.obj, program, "calculatedMember");
|
|
156
159
|
return calcDeps.concat(collectDependencies(program.member, program, "calculatedMember"));
|
|
157
|
-
case
|
|
160
|
+
case ScriptingSourceTreeExp_1.T_SEQUENCE_EXPRESSION:
|
|
158
161
|
let sequenceDeps = [];
|
|
159
|
-
program.
|
|
162
|
+
program.exprs.forEach((expr) => {
|
|
160
163
|
sequenceDeps = sequenceDeps.concat(collectDependencies(expr, program, "sequence"));
|
|
161
164
|
});
|
|
162
165
|
return sequenceDeps;
|
|
163
|
-
case
|
|
166
|
+
case ScriptingSourceTreeExp_1.T_FUNCTION_INVOCATION_EXPRESSION:
|
|
164
167
|
let uncDeps = [];
|
|
165
168
|
(_a = program.arguments) === null || _a === void 0 ? void 0 : _a.forEach((arg) => {
|
|
166
169
|
uncDeps = uncDeps.concat(collectDependencies(arg, program, "functionInvocation"));
|
|
167
170
|
});
|
|
168
|
-
if (program.
|
|
169
|
-
const caller = program.
|
|
170
|
-
if (caller.
|
|
171
|
-
if (typeof (0, lodash_es_1.get)(referenceTrackedApis, `${caller.
|
|
172
|
-
|
|
171
|
+
if (program.obj.type === ScriptingSourceTreeExp_1.T_MEMBER_ACCESS_EXPRESSION) {
|
|
172
|
+
const caller = program.obj;
|
|
173
|
+
if (caller.obj.type === ScriptingSourceTreeExp_1.T_IDENTIFIER) {
|
|
174
|
+
if (typeof (0, lodash_es_1.get)(referenceTrackedApis, `${caller.obj.name}.${caller.member}`) ===
|
|
175
|
+
"function") {
|
|
176
|
+
uncDeps.push(`${caller.obj.name}.${caller.member}`);
|
|
173
177
|
}
|
|
174
178
|
else {
|
|
175
|
-
uncDeps.push(`${caller.
|
|
179
|
+
uncDeps.push(`${caller.obj.name}`);
|
|
176
180
|
}
|
|
177
181
|
}
|
|
178
|
-
else if (caller.
|
|
179
|
-
|
|
182
|
+
else if (caller.obj.type === ScriptingSourceTreeExp_1.T_MEMBER_ACCESS_EXPRESSION ||
|
|
183
|
+
caller.obj.type === ScriptingSourceTreeExp_1.T_CALCULATED_MEMBER_ACCESS_EXPRESSION) {
|
|
184
|
+
uncDeps = uncDeps.concat(collectDependencies(caller.obj, caller, "functionInvocation"));
|
|
180
185
|
}
|
|
181
186
|
else {
|
|
182
187
|
uncDeps = uncDeps.concat(collectDependencies(caller, program, "functionInvocation"));
|
|
183
188
|
}
|
|
184
189
|
}
|
|
185
190
|
else {
|
|
186
|
-
uncDeps = uncDeps.concat(collectDependencies(program.
|
|
191
|
+
uncDeps = uncDeps.concat(collectDependencies(program.obj, program, "functionInvocation"));
|
|
187
192
|
}
|
|
188
193
|
return uncDeps;
|
|
189
|
-
case
|
|
194
|
+
case ScriptingSourceTreeExp_1.T_ARROW_EXPRESSION:
|
|
190
195
|
// --- Process the current arguments
|
|
191
196
|
thread.blocks.push({ vars: {} });
|
|
192
197
|
const block = (0, process_statement_common_1.innermostBlockScope)(thread);
|
|
@@ -197,27 +202,30 @@ function collectVariableDependencies(program, referenceTrackedApis = {}) {
|
|
|
197
202
|
const argSpec = argSpecs[i];
|
|
198
203
|
let decl;
|
|
199
204
|
switch (argSpec.type) {
|
|
200
|
-
case
|
|
205
|
+
case ScriptingSourceTreeExp_1.T_IDENTIFIER: {
|
|
201
206
|
decl = {
|
|
202
|
-
type:
|
|
207
|
+
type: ScriptingSourceTreeExp_1.T_VAR_DECLARATION,
|
|
208
|
+
nodeId: argSpec.nodeId,
|
|
203
209
|
id: argSpec.name,
|
|
204
210
|
};
|
|
205
211
|
break;
|
|
206
212
|
}
|
|
207
|
-
case
|
|
213
|
+
case ScriptingSourceTreeExp_1.T_DESTRUCTURE: {
|
|
208
214
|
decl = {
|
|
209
|
-
type:
|
|
215
|
+
type: ScriptingSourceTreeExp_1.T_VAR_DECLARATION,
|
|
216
|
+
nodeId: argSpec.nodeId,
|
|
210
217
|
id: argSpec.id,
|
|
211
|
-
|
|
212
|
-
|
|
218
|
+
aDestr: argSpec.aDestr,
|
|
219
|
+
oDestr: argSpec.oDestr,
|
|
213
220
|
};
|
|
214
221
|
break;
|
|
215
222
|
}
|
|
216
|
-
case
|
|
223
|
+
case ScriptingSourceTreeExp_1.T_SPREAD_EXPRESSION: {
|
|
217
224
|
restFound = true;
|
|
218
225
|
decl = {
|
|
219
|
-
type:
|
|
220
|
-
|
|
226
|
+
type: ScriptingSourceTreeExp_1.T_VAR_DECLARATION,
|
|
227
|
+
nodeId: argSpec.nodeId,
|
|
228
|
+
id: argSpec.expr.name,
|
|
221
229
|
};
|
|
222
230
|
break;
|
|
223
231
|
}
|
|
@@ -233,7 +241,7 @@ function collectVariableDependencies(program, referenceTrackedApis = {}) {
|
|
|
233
241
|
thread.blocks.pop();
|
|
234
242
|
// --- Done
|
|
235
243
|
return arrowDeps;
|
|
236
|
-
case
|
|
244
|
+
case ScriptingSourceTreeExp_1.T_OBJECT_LITERAL:
|
|
237
245
|
let objectDeps = [];
|
|
238
246
|
program.props.forEach((prop) => {
|
|
239
247
|
if (Array.isArray(prop)) {
|
|
@@ -244,7 +252,7 @@ function collectVariableDependencies(program, referenceTrackedApis = {}) {
|
|
|
244
252
|
}
|
|
245
253
|
});
|
|
246
254
|
return objectDeps;
|
|
247
|
-
case
|
|
255
|
+
case ScriptingSourceTreeExp_1.T_ARRAY_LITERAL:
|
|
248
256
|
let arrayDeps = [];
|
|
249
257
|
program.items.forEach((expr) => {
|
|
250
258
|
if (expr) {
|
|
@@ -252,22 +260,22 @@ function collectVariableDependencies(program, referenceTrackedApis = {}) {
|
|
|
252
260
|
}
|
|
253
261
|
});
|
|
254
262
|
return arrayDeps;
|
|
255
|
-
case
|
|
256
|
-
return collectDependencies(program.
|
|
257
|
-
case
|
|
258
|
-
return collectDependencies(program.
|
|
259
|
-
case
|
|
260
|
-
return collectDependencies(program.
|
|
261
|
-
case
|
|
263
|
+
case ScriptingSourceTreeExp_1.T_UNARY_EXPRESSION:
|
|
264
|
+
return collectDependencies(program.expr, program, "unary");
|
|
265
|
+
case ScriptingSourceTreeExp_1.T_PREFIX_OP_EXPRESSION:
|
|
266
|
+
return collectDependencies(program.expr, program, "prefix");
|
|
267
|
+
case ScriptingSourceTreeExp_1.T_POSTFIX_OP_EXPRESSION:
|
|
268
|
+
return collectDependencies(program.expr, program, "postfix");
|
|
269
|
+
case ScriptingSourceTreeExp_1.T_BINARY_EXPRESSION:
|
|
262
270
|
return collectDependencies(program.left, program, "left").concat(collectDependencies(program.right, program, "right"));
|
|
263
|
-
case
|
|
264
|
-
return collectDependencies(program.
|
|
265
|
-
case
|
|
266
|
-
return collectDependencies(program.
|
|
267
|
-
case
|
|
268
|
-
return collectDependencies(program.
|
|
269
|
-
case
|
|
270
|
-
return collectDependencies(program.
|
|
271
|
+
case ScriptingSourceTreeExp_1.T_ASSIGNMENT_EXPRESSION:
|
|
272
|
+
return collectDependencies(program.expr, program, "right");
|
|
273
|
+
case ScriptingSourceTreeExp_1.T_CONDITIONAL_EXPRESSION:
|
|
274
|
+
return collectDependencies(program.cond, program, "condition").concat(collectDependencies(program.thenE, program, "trueExpr"), collectDependencies(program.elseE, program, "falseExpr"));
|
|
275
|
+
case ScriptingSourceTreeExp_1.T_VAR_DECLARATION:
|
|
276
|
+
return collectDependencies(program.expr, program, "varDeclaration");
|
|
277
|
+
case ScriptingSourceTreeExp_1.T_SPREAD_EXPRESSION:
|
|
278
|
+
return collectDependencies(program.expr, program, "spread");
|
|
271
279
|
}
|
|
272
280
|
}
|
|
273
281
|
return [];
|
|
@@ -277,22 +285,22 @@ function collectVariableDependencies(program, referenceTrackedApis = {}) {
|
|
|
277
285
|
function traverseMemberAccessChain(expr) {
|
|
278
286
|
var _a, _b;
|
|
279
287
|
switch (expr.type) {
|
|
280
|
-
case
|
|
281
|
-
const memberChain = traverseMemberAccessChain(expr.
|
|
288
|
+
case ScriptingSourceTreeExp_1.T_MEMBER_ACCESS_EXPRESSION:
|
|
289
|
+
const memberChain = traverseMemberAccessChain(expr.obj);
|
|
282
290
|
return memberChain ? `${memberChain}.${expr.member}` : null;
|
|
283
|
-
case
|
|
291
|
+
case ScriptingSourceTreeExp_1.T_CALCULATED_MEMBER_ACCESS_EXPRESSION:
|
|
284
292
|
let value = null;
|
|
285
|
-
if (expr.member.type ===
|
|
293
|
+
if (expr.member.type === ScriptingSourceTreeExp_1.T_LITERAL) {
|
|
286
294
|
value = `'${(_b = (_a = expr.member.value) === null || _a === void 0 ? void 0 : _a.toString()) !== null && _b !== void 0 ? _b : null}'`;
|
|
287
295
|
}
|
|
288
|
-
else if (expr.member.type ===
|
|
296
|
+
else if (expr.member.type === ScriptingSourceTreeExp_1.T_IDENTIFIER) {
|
|
289
297
|
value = expr.member.name;
|
|
290
298
|
}
|
|
291
299
|
if (!value)
|
|
292
300
|
break;
|
|
293
|
-
const calcMemberChain = traverseMemberAccessChain(expr.
|
|
301
|
+
const calcMemberChain = traverseMemberAccessChain(expr.obj);
|
|
294
302
|
return calcMemberChain ? `${calcMemberChain}[${value}]` : null;
|
|
295
|
-
case
|
|
303
|
+
case ScriptingSourceTreeExp_1.T_IDENTIFIER:
|
|
296
304
|
const scope = (0, eval_tree_common_1.getIdentifierScope)(expr, evalContext, thread);
|
|
297
305
|
return scope.type !== "block" ? expr.name : null;
|
|
298
306
|
}
|
|
@@ -310,11 +318,11 @@ function processDeclarations(block, declarations) {
|
|
|
310
318
|
if (decl.id) {
|
|
311
319
|
visitIdDeclaration(block, decl.id);
|
|
312
320
|
}
|
|
313
|
-
else if (decl.
|
|
314
|
-
visitArrayDestruct(block, decl.
|
|
321
|
+
else if (decl.aDestr) {
|
|
322
|
+
visitArrayDestruct(block, decl.aDestr);
|
|
315
323
|
}
|
|
316
|
-
else if (decl.
|
|
317
|
-
visitObjectDestruct(block, decl.
|
|
324
|
+
else if (decl.oDestr) {
|
|
325
|
+
visitObjectDestruct(block, decl.oDestr);
|
|
318
326
|
}
|
|
319
327
|
else {
|
|
320
328
|
throw new Error("Unknown declaration specifier");
|
|
@@ -334,11 +342,11 @@ function processDeclarations(block, declarations) {
|
|
|
334
342
|
if (arrDecl.id) {
|
|
335
343
|
visitIdDeclaration(block, arrDecl.id);
|
|
336
344
|
}
|
|
337
|
-
else if (arrDecl.
|
|
338
|
-
visitArrayDestruct(block, arrDecl.
|
|
345
|
+
else if (arrDecl.aDestr) {
|
|
346
|
+
visitArrayDestruct(block, arrDecl.aDestr);
|
|
339
347
|
}
|
|
340
|
-
else if (arrDecl.
|
|
341
|
-
visitObjectDestruct(block, arrDecl.
|
|
348
|
+
else if (arrDecl.oDestr) {
|
|
349
|
+
visitObjectDestruct(block, arrDecl.oDestr);
|
|
342
350
|
}
|
|
343
351
|
}
|
|
344
352
|
}
|
|
@@ -347,11 +355,11 @@ function processDeclarations(block, declarations) {
|
|
|
347
355
|
var _a;
|
|
348
356
|
for (let i = 0; i < objectD.length; i++) {
|
|
349
357
|
const objDecl = objectD[i];
|
|
350
|
-
if (objDecl.
|
|
351
|
-
visitArrayDestruct(block, objDecl.
|
|
358
|
+
if (objDecl.aDestr) {
|
|
359
|
+
visitArrayDestruct(block, objDecl.aDestr);
|
|
352
360
|
}
|
|
353
|
-
else if (objDecl.
|
|
354
|
-
visitObjectDestruct(block, objDecl.
|
|
361
|
+
else if (objDecl.oDestr) {
|
|
362
|
+
visitObjectDestruct(block, objDecl.oDestr);
|
|
355
363
|
}
|
|
356
364
|
else {
|
|
357
365
|
visitIdDeclaration(block, (_a = objDecl.alias) !== null && _a !== void 0 ? _a : objDecl.id);
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.palette = void 0;
|
|
4
4
|
exports.palette = {
|
|
5
|
+
$colorSurface0: "$color-surface-0",
|
|
5
6
|
$colorSurface50: "$color-surface-50",
|
|
6
7
|
$colorSurface100: "$color-surface-100",
|
|
7
8
|
$colorSurface200: "$color-surface-200",
|