xmlui 0.9.58 → 0.9.60
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-uyd3MlHU.mjs → apiInterceptorWorker-CNiXy9XE.mjs} +1 -1
- package/dist/lib/{index-BqBDeBdn.mjs → index-B1V2vJWh.mjs} +10933 -11210
- package/dist/lib/index.css +1 -1
- package/dist/lib/language-server-web-worker.mjs +1 -1
- package/dist/lib/language-server.mjs +1 -1
- package/dist/lib/{metadata-utils-BXdiMJQN.mjs → metadata-utils-4EQ6kQIM.mjs} +31 -40
- package/dist/lib/{server-common-CN44QquQ.mjs → server-common-SNl_47nE.mjs} +4958 -5507
- package/dist/lib/{transform-BboeJCuA.mjs → transform-CgRMkbb0.mjs} +733 -798
- package/dist/lib/xmlui-parser.d.ts +6 -31
- package/dist/lib/xmlui-parser.mjs +42 -49
- package/dist/lib/{xmlui-serializer-D0p6Hyum.mjs → xmlui-serializer-EDw51UFN.mjs} +1 -1
- package/dist/lib/xmlui.d.ts +3 -4
- package/dist/lib/xmlui.mjs +2 -2
- package/dist/metadata/{apiInterceptorWorker-B4dqtAX9.mjs → apiInterceptorWorker-DsjW46f_.mjs} +1 -1
- package/dist/metadata/{collectedComponentMetadata-DFcuGgT_.mjs → collectedComponentMetadata-CBiI_eDf.mjs} +11510 -11875
- package/dist/metadata/style.css +1 -1
- package/dist/metadata/xmlui-metadata.mjs +1 -1
- package/dist/metadata/xmlui-metadata.umd.js +110 -110
- package/dist/scripts/package.json +5 -5
- package/dist/scripts/src/components/Accordion/Accordion.js +1 -1
- package/dist/scripts/src/components/Card/Card.js +1 -1
- package/dist/scripts/src/components/Card/CardNative.js +1 -2
- package/dist/scripts/src/components/Charts/DonutChart/DonutChart.js +5 -6
- package/dist/scripts/src/components/Charts/PieChart/PieChart.js +7 -11
- package/dist/scripts/src/components/Charts/PieChart/PieChartNative.js +4 -9
- package/dist/scripts/src/components/CodeBlock/CodeBlockNative.js +1 -1
- package/dist/scripts/src/components/ColorPicker/ColorPickerNative.js +2 -2
- package/dist/scripts/src/components/ComponentProvider.js +0 -4
- package/dist/scripts/src/components/ExpandableItem/ExpandableItem.js +3 -3
- package/dist/scripts/src/components/FlowLayout/FlowLayoutNative.js +6 -35
- package/dist/scripts/src/components/Footer/Footer.js +1 -1
- package/dist/scripts/src/components/Form/Form.js +0 -4
- package/dist/scripts/src/components/Form/FormNative.js +4 -12
- package/dist/scripts/src/components/Link/LinkNative.js +1 -46
- package/dist/scripts/src/components/Markdown/Markdown.js +3 -3
- package/dist/scripts/src/components/NestedApp/NestedApp.js +2 -2
- package/dist/scripts/src/components/NestedApp/NestedAppNative.js +4 -3
- package/dist/scripts/src/components/Select/SelectNative.js +1 -1
- package/dist/scripts/src/components/StickyBox/StickyBoxNative.js +0 -2
- package/dist/scripts/src/components/Tabs/Tabs.js +2 -5
- package/dist/scripts/src/components/Text/Text.js +2 -2
- package/dist/scripts/src/components/Theme/NotificationToast.js +0 -11
- package/dist/scripts/src/components/Theme/ThemeNative.js +4 -4
- package/dist/scripts/src/components-core/Fragment.js +2 -2
- package/dist/scripts/src/components-core/RestApiProxy.js +7 -10
- package/dist/scripts/src/components-core/descriptorHelper.js +0 -9
- package/dist/scripts/src/components-core/rendering/AppContent.js +2 -6
- package/dist/scripts/src/components-core/theming/layout-resolver.js +0 -18
- package/dist/scripts/src/parsers/xmlui-parser/parser.js +39 -42
- package/dist/scripts/src/parsers/xmlui-parser/syntax-node.js +0 -65
- package/dist/scripts/src/parsers/xmlui-parser/transform.js +8 -10
- package/dist/scripts/src/parsers/xmlui-parser/utils.js +2 -1
- package/dist/standalone/xmlui-standalone.es.d.ts +3 -4
- package/dist/standalone/xmlui-standalone.umd.js +228 -228
- package/package.json +5 -5
- package/dist/scripts/src/components/HelloWorld/HelloWorld.js +0 -103
- package/dist/scripts/src/components/HelloWorld/HelloWorldNative.js +0 -92
|
@@ -7,8 +7,8 @@ const ComponentDefs_1 = require("../abstractions/ComponentDefs");
|
|
|
7
7
|
const renderers_1 = require("./renderers");
|
|
8
8
|
const COMP = "Fragment";
|
|
9
9
|
exports.FragmentMd = (0, ComponentDefs_1.createMetadata)({
|
|
10
|
-
description: "`Fragment` provides conditional rendering
|
|
11
|
-
"
|
|
10
|
+
description: "`Fragment` provides conditional rendering and grouping of components. It's often " +
|
|
11
|
+
"used to hide components until their dependent variables are available.",
|
|
12
12
|
opaque: true,
|
|
13
13
|
});
|
|
14
14
|
exports.fragmentComponentRenderer = (0, renderers_1.createComponentRenderer)(COMP, exports.FragmentMd, ({ node, extractValue, renderChild, layoutContext }) => {
|
|
@@ -51,8 +51,8 @@ const process_statement_sync_1 = require("./script-runner/process-statement-sync
|
|
|
51
51
|
function isAxiosResponse(response) {
|
|
52
52
|
return "data" in response;
|
|
53
53
|
}
|
|
54
|
-
function parseResponseJson(
|
|
55
|
-
return __awaiter(this,
|
|
54
|
+
function parseResponseJson(response) {
|
|
55
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
56
56
|
let resp;
|
|
57
57
|
if (isAxiosResponse(response)) {
|
|
58
58
|
resp = response.data;
|
|
@@ -66,9 +66,7 @@ function parseResponseJson(response_1) {
|
|
|
66
66
|
resp = yield response.clone().text();
|
|
67
67
|
}
|
|
68
68
|
catch (e) {
|
|
69
|
-
|
|
70
|
-
console.error("Failed to parse response as text or JSON", response.body);
|
|
71
|
-
}
|
|
69
|
+
console.error("Failed to parse response as text or JSON", response.body);
|
|
72
70
|
}
|
|
73
71
|
}
|
|
74
72
|
}
|
|
@@ -232,7 +230,6 @@ class RestApiProxy {
|
|
|
232
230
|
return value;
|
|
233
231
|
};
|
|
234
232
|
this.executeOperation = (_a) => __awaiter(this, [_a], void 0, function* ({ operation, contextParams, abortSignal, resolveBindingExpressions, relativePath = this.extractParam(resolveBindingExpressions, operation.url, contextParams), method = this.extractParam(resolveBindingExpressions, operation.method, contextParams), queryParams = this.extractParam(resolveBindingExpressions, operation.queryParams, contextParams), body = this.extractParam(resolveBindingExpressions, operation.body, contextParams, true), rawBody = this.extractParam(resolveBindingExpressions, operation.rawBody, contextParams), headers = this.extractParam(resolveBindingExpressions, operation.headers, contextParams), payloadType = this.extractParam(resolveBindingExpressions, operation.payloadType, contextParams) || "json", onUploadProgress, parseResponse = this.tryParseResponse, transactionId, }) {
|
|
235
|
-
var _b, _c, _d, _e, _f, _g;
|
|
236
233
|
const includeClientTxId = method && method !== "get" && !!transactionId;
|
|
237
234
|
const headersWithoutContentType = Object.assign(Object.assign({}, this.getHeaders()), { ["Content-Type"]: undefined });
|
|
238
235
|
const aggregatedHeaders = (0, lodash_es_1.omitBy)(Object.assign(Object.assign({}, (body ? this.getHeaders() : headersWithoutContentType)), headers), lodash_es_1.isUndefined);
|
|
@@ -281,7 +278,7 @@ class RestApiProxy {
|
|
|
281
278
|
data: options.body,
|
|
282
279
|
onUploadProgress,
|
|
283
280
|
});
|
|
284
|
-
return yield parseResponse(response
|
|
281
|
+
return yield parseResponse(response);
|
|
285
282
|
}
|
|
286
283
|
catch (error) {
|
|
287
284
|
if (axios.isAxiosError(error) && error.response) {
|
|
@@ -297,12 +294,12 @@ class RestApiProxy {
|
|
|
297
294
|
if (!response.clone().ok) {
|
|
298
295
|
throw yield this.raiseError(response);
|
|
299
296
|
}
|
|
300
|
-
const parsedResponse = yield parseResponse(response.clone()
|
|
297
|
+
const parsedResponse = yield parseResponse(response.clone());
|
|
301
298
|
return parsedResponse;
|
|
302
299
|
}
|
|
303
300
|
});
|
|
304
|
-
this.tryParseResponse = (
|
|
305
|
-
return yield parseResponseJson(response
|
|
301
|
+
this.tryParseResponse = (response) => __awaiter(this, void 0, void 0, function* () {
|
|
302
|
+
return yield parseResponseJson(response);
|
|
306
303
|
});
|
|
307
304
|
this.raiseError = (response) => __awaiter(this, void 0, void 0, function* () {
|
|
308
305
|
if ("config" in response) {
|
|
@@ -130,8 +130,8 @@ function AppContent({ rootContainer, routerBaseName, globalProps, standalone, tr
|
|
|
130
130
|
const isViewportTablet = (0, hooks_1.useMediaQuery)(`(min-width: ${maxWidthLandscapePhone}) and (max-width: ${maxWidthTabletLower})`);
|
|
131
131
|
const isViewportDesktop = (0, hooks_1.useMediaQuery)(`(min-width: ${maxWidthTablet}) and (max-width: ${maxWidthDesktopLower})`);
|
|
132
132
|
const isViewportLargeDesktop = (0, hooks_1.useMediaQuery)(`(min-width: ${maxWidthDesktop}) and (max-width: ${maxWidthLargeDesktopLower})`);
|
|
133
|
-
let vpSize;
|
|
134
|
-
let vpSizeIndex;
|
|
133
|
+
let vpSize = "xs";
|
|
134
|
+
let vpSizeIndex = 0;
|
|
135
135
|
const isViewportXlDesktop = (0, hooks_1.useMediaQuery)(`(min-width: ${maxWidthLargeDesktop})`);
|
|
136
136
|
if (isViewportXlDesktop) {
|
|
137
137
|
vpSize = "xxl";
|
|
@@ -153,10 +153,6 @@ function AppContent({ rootContainer, routerBaseName, globalProps, standalone, tr
|
|
|
153
153
|
vpSize = "sm";
|
|
154
154
|
vpSizeIndex = 1;
|
|
155
155
|
}
|
|
156
|
-
else if (isViewportPhone) {
|
|
157
|
-
vpSize = "xs";
|
|
158
|
-
vpSizeIndex = 0;
|
|
159
|
-
}
|
|
160
156
|
// --- Collect information about the current environment
|
|
161
157
|
const isInIFrame = (0, hooks_1.useIsInIFrame)();
|
|
162
158
|
const isWindowFocused = (0, hooks_1.useIsWindowFocused)();
|
|
@@ -111,15 +111,11 @@ function resolveLayoutProps(layoutProps = constants_1.EMPTY_OBJECT, layoutContex
|
|
|
111
111
|
collectCss("fontSize");
|
|
112
112
|
collectCss("fontWeight");
|
|
113
113
|
collectCss("fontStyle");
|
|
114
|
-
collectCss("fontVariant");
|
|
115
|
-
collectCss("lineBreak");
|
|
116
114
|
collectCss("textDecoration");
|
|
117
115
|
collectCss("textDecorationLine");
|
|
118
116
|
collectCss("textDecorationColor");
|
|
119
117
|
collectCss("textDecorationStyle");
|
|
120
118
|
collectCss("textDecorationThickness");
|
|
121
|
-
collectCss("textIndent");
|
|
122
|
-
collectCss("textShadow");
|
|
123
119
|
collectCss("textUnderlineOffset");
|
|
124
120
|
collectCss("userSelect");
|
|
125
121
|
collectCss("letterSpacing");
|
|
@@ -128,10 +124,6 @@ function resolveLayoutProps(layoutProps = constants_1.EMPTY_OBJECT, layoutContex
|
|
|
128
124
|
collectCss("textAlign");
|
|
129
125
|
collectCss("textAlignLast");
|
|
130
126
|
collectCss("textWrap");
|
|
131
|
-
collectCss("wordBreak");
|
|
132
|
-
collectCss("wordSpacing");
|
|
133
|
-
collectCss("wordWrap");
|
|
134
|
-
collectCss("writingMode");
|
|
135
127
|
// --- Other
|
|
136
128
|
collectCss("backgroundColor");
|
|
137
129
|
collectCss("background");
|
|
@@ -347,8 +339,6 @@ const layoutPatterns = {
|
|
|
347
339
|
fontSize: [],
|
|
348
340
|
fontWeight: [],
|
|
349
341
|
fontStyle: [booleanRegex],
|
|
350
|
-
fontVariant: [],
|
|
351
|
-
lineBreak: [],
|
|
352
342
|
textDecoration: [],
|
|
353
343
|
userSelect: [],
|
|
354
344
|
letterSpacing: [],
|
|
@@ -357,12 +347,6 @@ const layoutPatterns = {
|
|
|
357
347
|
textAlign: [],
|
|
358
348
|
textWrap: [],
|
|
359
349
|
textAlignLast: [],
|
|
360
|
-
textIndent: [],
|
|
361
|
-
textShadow: [],
|
|
362
|
-
wordBreak: [],
|
|
363
|
-
wordSpacing: [],
|
|
364
|
-
wordWrap: [],
|
|
365
|
-
writingMode: [],
|
|
366
350
|
// --- Content rendering
|
|
367
351
|
wrapContent: [],
|
|
368
352
|
canShrink: [],
|
|
@@ -381,6 +365,4 @@ const layoutPatterns = {
|
|
|
381
365
|
outlineColor: [],
|
|
382
366
|
outlineStyle: [],
|
|
383
367
|
outlineOffset: [],
|
|
384
|
-
// --- Animation
|
|
385
|
-
transition: [],
|
|
386
368
|
};
|
|
@@ -2,37 +2,16 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createXmlUiParser = createXmlUiParser;
|
|
4
4
|
exports.parseXmlUiMarkup = parseXmlUiMarkup;
|
|
5
|
-
const syntax_node_1 = require("./syntax-node");
|
|
6
5
|
const CharacterCodes_1 = require("./CharacterCodes");
|
|
7
6
|
const scanner_1 = require("./scanner");
|
|
8
7
|
const syntax_kind_1 = require("./syntax-kind");
|
|
9
8
|
const utils_1 = require("./utils");
|
|
10
9
|
const diagnostics_1 = require("./diagnostics");
|
|
11
10
|
const RECOVER_FILE = [syntax_kind_1.SyntaxKind.CData, syntax_kind_1.SyntaxKind.Script, syntax_kind_1.SyntaxKind.OpenNodeStart];
|
|
12
|
-
const RECOVER_OPEN_TAG = [
|
|
13
|
-
syntax_kind_1.SyntaxKind.OpenNodeStart,
|
|
14
|
-
syntax_kind_1.SyntaxKind.NodeEnd,
|
|
15
|
-
syntax_kind_1.SyntaxKind.NodeClose,
|
|
16
|
-
syntax_kind_1.SyntaxKind.CloseNodeStart,
|
|
17
|
-
syntax_kind_1.SyntaxKind.CData,
|
|
18
|
-
syntax_kind_1.SyntaxKind.Script,
|
|
19
|
-
];
|
|
11
|
+
const RECOVER_OPEN_TAG = [syntax_kind_1.SyntaxKind.OpenNodeStart, syntax_kind_1.SyntaxKind.NodeEnd, syntax_kind_1.SyntaxKind.NodeClose, syntax_kind_1.SyntaxKind.CloseNodeStart, syntax_kind_1.SyntaxKind.CData, syntax_kind_1.SyntaxKind.Script];
|
|
20
12
|
const RECOVER_ATTR = [syntax_kind_1.SyntaxKind.Identifier, ...RECOVER_OPEN_TAG];
|
|
21
|
-
const RECOVER_CONTENT_LIST = [
|
|
22
|
-
|
|
23
|
-
syntax_kind_1.SyntaxKind.StringLiteral,
|
|
24
|
-
syntax_kind_1.SyntaxKind.CData,
|
|
25
|
-
syntax_kind_1.SyntaxKind.Script,
|
|
26
|
-
syntax_kind_1.SyntaxKind.OpenNodeStart,
|
|
27
|
-
syntax_kind_1.SyntaxKind.CloseNodeStart,
|
|
28
|
-
];
|
|
29
|
-
const RECOVER_CLOSE_TAG = [
|
|
30
|
-
syntax_kind_1.SyntaxKind.NodeEnd,
|
|
31
|
-
syntax_kind_1.SyntaxKind.OpenNodeStart,
|
|
32
|
-
syntax_kind_1.SyntaxKind.CloseNodeStart,
|
|
33
|
-
syntax_kind_1.SyntaxKind.CData,
|
|
34
|
-
syntax_kind_1.SyntaxKind.Script,
|
|
35
|
-
];
|
|
13
|
+
const RECOVER_CONTENT_LIST = [syntax_kind_1.SyntaxKind.TextNode, syntax_kind_1.SyntaxKind.StringLiteral, syntax_kind_1.SyntaxKind.CData, syntax_kind_1.SyntaxKind.Script, syntax_kind_1.SyntaxKind.OpenNodeStart, syntax_kind_1.SyntaxKind.CloseNodeStart];
|
|
14
|
+
const RECOVER_CLOSE_TAG = [syntax_kind_1.SyntaxKind.NodeEnd, syntax_kind_1.SyntaxKind.OpenNodeStart, syntax_kind_1.SyntaxKind.CloseNodeStart, syntax_kind_1.SyntaxKind.CData, syntax_kind_1.SyntaxKind.Script];
|
|
36
15
|
function createXmlUiParser(source) {
|
|
37
16
|
return {
|
|
38
17
|
parse: () => parseXmlUiMarkup(source),
|
|
@@ -229,11 +208,7 @@ function parseXmlUiMarkup(text) {
|
|
|
229
208
|
nameIdent = bump(syntax_kind_1.SyntaxKind.Identifier);
|
|
230
209
|
}
|
|
231
210
|
else {
|
|
232
|
-
const errNode = errNodeUntil([
|
|
233
|
-
syntax_kind_1.SyntaxKind.Equal,
|
|
234
|
-
syntax_kind_1.SyntaxKind.Identifier,
|
|
235
|
-
...RECOVER_OPEN_TAG,
|
|
236
|
-
]);
|
|
211
|
+
const errNode = errNodeUntil([syntax_kind_1.SyntaxKind.Equal, syntax_kind_1.SyntaxKind.Identifier, ...RECOVER_OPEN_TAG]);
|
|
237
212
|
if (errNode) {
|
|
238
213
|
errorAt(diagnostics_1.DIAGS.expAttrNameAfterNamespace, errNode.pos, errNode.end);
|
|
239
214
|
}
|
|
@@ -250,8 +225,7 @@ function parseXmlUiMarkup(text) {
|
|
|
250
225
|
if (at(syntax_kind_1.SyntaxKind.Identifier)) {
|
|
251
226
|
const closeTagName = parseClosingTagName();
|
|
252
227
|
if (!skipNameMatching) {
|
|
253
|
-
const namesMismatch = openTagName !== null &&
|
|
254
|
-
!(0, utils_1.tagNameNodesWithoutErrorsMatch)(openTagName, closeTagName, getText);
|
|
228
|
+
const namesMismatch = openTagName !== null && !(0, utils_1.tagNameNodesWithoutErrorsMatch)(openTagName, closeTagName, getText);
|
|
255
229
|
if (namesMismatch) {
|
|
256
230
|
const msg = diagnostics_1.DIAGS.tagNameMismatch(getText(openTagName), getText(closeTagName));
|
|
257
231
|
errorAt(msg, closeTagName.pos, closeTagName.end);
|
|
@@ -332,10 +306,10 @@ function parseXmlUiMarkup(text) {
|
|
|
332
306
|
});
|
|
333
307
|
}
|
|
334
308
|
/**
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
309
|
+
*
|
|
310
|
+
* @param tokens that won't be consumed
|
|
311
|
+
* @returns the error node with the consumed tokens, or null if there were no tokens consumed
|
|
312
|
+
*/
|
|
339
313
|
function errNodeUntil(tokens) {
|
|
340
314
|
startNode();
|
|
341
315
|
advance(tokens);
|
|
@@ -448,7 +422,7 @@ function parseXmlUiMarkup(text) {
|
|
|
448
422
|
}
|
|
449
423
|
end = scanner.getTokenEnd();
|
|
450
424
|
}
|
|
451
|
-
peekedToken =
|
|
425
|
+
peekedToken = { kind, start, pos, end, triviaBefore };
|
|
452
426
|
return peekedToken;
|
|
453
427
|
}
|
|
454
428
|
/** Same as bumpAny, but with an assertion of the token that was bumped over.
|
|
@@ -505,14 +479,20 @@ function parseXmlUiMarkup(text) {
|
|
|
505
479
|
err = errFromScanner.message;
|
|
506
480
|
}
|
|
507
481
|
const pos = scanner.getTokenStart();
|
|
508
|
-
const
|
|
482
|
+
const token = {
|
|
483
|
+
kind,
|
|
484
|
+
start,
|
|
485
|
+
pos,
|
|
486
|
+
end: scanner.getTokenEnd(),
|
|
487
|
+
triviaBefore: triviaCollected.length > 0 ? triviaCollected : undefined,
|
|
488
|
+
};
|
|
509
489
|
triviaCollected = [];
|
|
510
490
|
if (inContent && err.code === diagnostics_1.ErrCodes.invalidChar) {
|
|
511
491
|
errFromScanner = undefined;
|
|
512
|
-
return
|
|
492
|
+
return token;
|
|
513
493
|
}
|
|
514
494
|
const badPrefixEnd = pos + errFromScanner.prefixLength;
|
|
515
|
-
|
|
495
|
+
token.end = badPrefixEnd;
|
|
516
496
|
scanner.resetTokenState(badPrefixEnd);
|
|
517
497
|
startNode();
|
|
518
498
|
node.children.push(token);
|
|
@@ -525,10 +505,21 @@ function parseXmlUiMarkup(text) {
|
|
|
525
505
|
case syntax_kind_1.SyntaxKind.CommentTrivia:
|
|
526
506
|
case syntax_kind_1.SyntaxKind.NewLineTrivia:
|
|
527
507
|
case syntax_kind_1.SyntaxKind.WhitespaceTrivia:
|
|
528
|
-
triviaCollected.push(
|
|
508
|
+
triviaCollected.push({
|
|
509
|
+
kind,
|
|
510
|
+
start,
|
|
511
|
+
pos: scanner.getTokenStart(),
|
|
512
|
+
end: scanner.getTokenEnd(),
|
|
513
|
+
});
|
|
529
514
|
break;
|
|
530
515
|
default:
|
|
531
|
-
return
|
|
516
|
+
return {
|
|
517
|
+
kind,
|
|
518
|
+
start,
|
|
519
|
+
pos: scanner.getTokenStart(),
|
|
520
|
+
end: scanner.getTokenEnd(),
|
|
521
|
+
triviaBefore: triviaCollected.length > 0 ? triviaCollected : undefined,
|
|
522
|
+
};
|
|
532
523
|
}
|
|
533
524
|
}
|
|
534
525
|
}
|
|
@@ -542,5 +533,11 @@ function parseXmlUiMarkup(text) {
|
|
|
542
533
|
function createNode(kind, children) {
|
|
543
534
|
const firstChild = children[0];
|
|
544
535
|
const lastChild = children[children.length - 1];
|
|
545
|
-
return
|
|
536
|
+
return {
|
|
537
|
+
kind,
|
|
538
|
+
start: firstChild.start,
|
|
539
|
+
pos: firstChild.pos,
|
|
540
|
+
end: lastChild.end,
|
|
541
|
+
children,
|
|
542
|
+
};
|
|
546
543
|
}
|
|
@@ -1,67 +1,2 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TagNameNode = exports.AttributeListNode = exports.ContentListNode = exports.AttributeKeyNode = exports.AttributeNode = exports.ElementNode = exports.Node = void 0;
|
|
4
|
-
const syntax_kind_1 = require("./syntax-kind");
|
|
5
|
-
const utils_1 = require("./utils");
|
|
6
|
-
class Node {
|
|
7
|
-
constructor(kind, pos, end, triviaBefore, children) {
|
|
8
|
-
var _a, _b, _c, _d;
|
|
9
|
-
this.kind = kind;
|
|
10
|
-
this.pos = pos;
|
|
11
|
-
this.end = end;
|
|
12
|
-
this.triviaBefore = triviaBefore;
|
|
13
|
-
this.children = children;
|
|
14
|
-
if (triviaBefore) {
|
|
15
|
-
this.start = (_b = (_a = triviaBefore[0]) === null || _a === void 0 ? void 0 : _a.start) !== null && _b !== void 0 ? _b : pos;
|
|
16
|
-
}
|
|
17
|
-
else if (children) {
|
|
18
|
-
this.start = (_d = (_c = children[0]) === null || _c === void 0 ? void 0 : _c.start) !== null && _d !== void 0 ? _d : pos;
|
|
19
|
-
}
|
|
20
|
-
else {
|
|
21
|
-
this.start = pos;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
isElementNode() {
|
|
25
|
-
return this.kind === syntax_kind_1.SyntaxKind.ElementNode;
|
|
26
|
-
}
|
|
27
|
-
isAttributeNode() {
|
|
28
|
-
return this.kind === syntax_kind_1.SyntaxKind.AttributeNode;
|
|
29
|
-
}
|
|
30
|
-
isAttributeKeyNode() {
|
|
31
|
-
return this.kind === syntax_kind_1.SyntaxKind.AttributeKeyNode;
|
|
32
|
-
}
|
|
33
|
-
isContentListNode() {
|
|
34
|
-
return this.kind === syntax_kind_1.SyntaxKind.ContentListNode;
|
|
35
|
-
}
|
|
36
|
-
isAttributeListNode() {
|
|
37
|
-
return this.kind === syntax_kind_1.SyntaxKind.AttributeListNode;
|
|
38
|
-
}
|
|
39
|
-
isTagNameNode() {
|
|
40
|
-
return this.kind === syntax_kind_1.SyntaxKind.TagNameNode;
|
|
41
|
-
}
|
|
42
|
-
findTokenAtPos(position) {
|
|
43
|
-
return (0, utils_1.findTokenAtPos)(this, position);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
exports.Node = Node;
|
|
47
|
-
class ElementNode extends Node {
|
|
48
|
-
getAttributeListNode() {
|
|
49
|
-
return this.children.find((c) => c.isContentListNode());
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
exports.ElementNode = ElementNode;
|
|
53
|
-
class AttributeNode extends Node {
|
|
54
|
-
}
|
|
55
|
-
exports.AttributeNode = AttributeNode;
|
|
56
|
-
class AttributeKeyNode extends Node {
|
|
57
|
-
}
|
|
58
|
-
exports.AttributeKeyNode = AttributeKeyNode;
|
|
59
|
-
class ContentListNode extends Node {
|
|
60
|
-
}
|
|
61
|
-
exports.ContentListNode = ContentListNode;
|
|
62
|
-
class AttributeListNode extends Node {
|
|
63
|
-
}
|
|
64
|
-
exports.AttributeListNode = AttributeListNode;
|
|
65
|
-
class TagNameNode extends Node {
|
|
66
|
-
}
|
|
67
|
-
exports.TagNameNode = TagNameNode;
|
|
@@ -4,7 +4,6 @@ exports.CORE_NAMESPACE_VALUE = exports.onPrefixRegex = exports.UCRegex = exports
|
|
|
4
4
|
exports.nodeToComponentDef = nodeToComponentDef;
|
|
5
5
|
exports.stripOnPrefix = stripOnPrefix;
|
|
6
6
|
const code_behind_collect_1 = require("../scripting/code-behind-collect");
|
|
7
|
-
const syntax_node_1 = require("./syntax-node");
|
|
8
7
|
const syntax_kind_1 = require("./syntax-kind");
|
|
9
8
|
const ParserError_1 = require("./ParserError");
|
|
10
9
|
const Parser_1 = require("../scripting/Parser");
|
|
@@ -1013,17 +1012,16 @@ function getChildNodes(node) {
|
|
|
1013
1012
|
return (_c = (_b = (_a = node.children) === null || _a === void 0 ? void 0 : _a.find((c) => c.kind === syntax_kind_1.SyntaxKind.ContentListNode)) === null || _b === void 0 ? void 0 : _b.children) !== null && _c !== void 0 ? _c : [];
|
|
1014
1013
|
}
|
|
1015
1014
|
function withNewChildNodes(node, newChildren) {
|
|
1016
|
-
var _a
|
|
1015
|
+
var _a;
|
|
1017
1016
|
const childrenListIdx = (_a = node.children) === null || _a === void 0 ? void 0 : _a.findIndex((c) => c.kind === syntax_kind_1.SyntaxKind.ContentListNode);
|
|
1018
1017
|
if (childrenListIdx === undefined || childrenListIdx === -1) {
|
|
1019
1018
|
return node;
|
|
1020
1019
|
}
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
]);
|
|
1020
|
+
return Object.assign(Object.assign({}, node), { children: [
|
|
1021
|
+
...node.children.slice(0, childrenListIdx),
|
|
1022
|
+
Object.assign(Object.assign({}, node.children[childrenListIdx]), { children: newChildren }),
|
|
1023
|
+
...node.children.slice(childrenListIdx),
|
|
1024
|
+
] });
|
|
1027
1025
|
}
|
|
1028
1026
|
function desugarKeyOnlyAttrs(attrs) {
|
|
1029
1027
|
var _a;
|
|
@@ -1115,8 +1113,8 @@ function getNamespaceResolvedComponentName(node, getText, namespaceStack) {
|
|
|
1115
1113
|
return resolvedNamespace + "." + name;
|
|
1116
1114
|
}
|
|
1117
1115
|
/**
|
|
1118
|
-
|
|
1119
|
-
|
|
1116
|
+
* @param name - The name of the event in camelCase, with "on" prefix.
|
|
1117
|
+
*/
|
|
1120
1118
|
function stripOnPrefix(name) {
|
|
1121
1119
|
return name[2].toLowerCase() + name.substring(3);
|
|
1122
1120
|
}
|
|
@@ -37,6 +37,7 @@ function tagNameNodesWithoutErrorsMatch(name1, name2, getText) {
|
|
|
37
37
|
}
|
|
38
38
|
function findTokenAtPos(node, position) {
|
|
39
39
|
const chain = [node];
|
|
40
|
+
let chainBeforePos;
|
|
40
41
|
let sharedParents;
|
|
41
42
|
if (node.start > position || position > node.end) {
|
|
42
43
|
return undefined;
|
|
@@ -44,7 +45,7 @@ function findTokenAtPos(node, position) {
|
|
|
44
45
|
const res = {
|
|
45
46
|
chainAtPos: chain,
|
|
46
47
|
chainBeforePos: undefined,
|
|
47
|
-
sharedParents: undefined
|
|
48
|
+
sharedParents: undefined
|
|
48
49
|
};
|
|
49
50
|
while (node.children !== undefined && node.children.length > 0) {
|
|
50
51
|
//todo: make it a binary search before finding a fork
|
|
@@ -1303,7 +1303,7 @@ declare type Message = ValueOrFunction<Renderable, Toast>;
|
|
|
1303
1303
|
*/
|
|
1304
1304
|
declare type ModuleErrors = Record<string, ScriptParserErrorMessage[]>;
|
|
1305
1305
|
|
|
1306
|
-
declare function NestedApp({ api, app, components, config, activeTheme, activeTone, title, height, allowPlaygroundPopup, withFrame,
|
|
1306
|
+
declare function NestedApp({ api, app, components, config, activeTheme, activeTone, title, height, allowPlaygroundPopup, withFrame, }: NestedAppProps): JSX_2.Element;
|
|
1307
1307
|
|
|
1308
1308
|
declare type NestedAppProps = {
|
|
1309
1309
|
api?: any;
|
|
@@ -1316,7 +1316,6 @@ declare type NestedAppProps = {
|
|
|
1316
1316
|
height?: string | number;
|
|
1317
1317
|
allowPlaygroundPopup?: boolean;
|
|
1318
1318
|
withFrame?: boolean;
|
|
1319
|
-
style?: CSSProperties;
|
|
1320
1319
|
};
|
|
1321
1320
|
|
|
1322
1321
|
declare type NO_ARG_EXPRESSION = typeof T_NO_ARG_EXPRESSION;
|
|
@@ -2082,13 +2081,13 @@ declare type ThemeScope = {
|
|
|
2082
2081
|
activeTheme: ThemeDefinition;
|
|
2083
2082
|
/**
|
|
2084
2083
|
* This hash object stores the CSS theme variable names with their CSS values definition,
|
|
2085
|
-
* like "--xmlui-
|
|
2084
|
+
* like "--xmlui-verticalAlign-Text-sub": "sub";
|
|
2086
2085
|
* "--xmlui-backgroundColor": "var(--xmlui-color-surface-50)"
|
|
2087
2086
|
*/
|
|
2088
2087
|
themeStyles: Record<string, string>;
|
|
2089
2088
|
/**
|
|
2090
2089
|
* This hash object stores the theme variable names with their CSS values definition, like
|
|
2091
|
-
* "
|
|
2090
|
+
* "verticalAlign-Text-sub": "sub"; "backgroundColor": "var(--xmlui-color-surface-50)".
|
|
2092
2091
|
*/
|
|
2093
2092
|
themeVars: Record<string, string>;
|
|
2094
2093
|
/**
|