xmlui 0.10.26 → 0.11.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/lib/{index-DHXWMb-6.mjs → index-CEq6OdjV.js} +263 -643
- package/dist/lib/index.css +1 -1
- package/dist/lib/{initMock-TxnkId6_.mjs → initMock-DhUnLKrR.js} +1 -1
- package/dist/lib/{language-server-web-worker.mjs → language-server-web-worker.js} +1 -1
- package/dist/lib/{language-server.mjs → language-server.js} +1 -1
- package/dist/lib/{metadata-utils-DXUdlyja.mjs → metadata-utils-D27cn-XB.js} +1 -1
- package/dist/lib/{server-common-CtpN0Z4h.mjs → server-common-2DaoOOL5.js} +625 -616
- package/dist/lib/testing.d.ts +2011 -0
- package/dist/lib/testing.js +2386 -0
- package/dist/lib/vite-xmlui-plugin/index.js +13968 -0
- package/dist/lib/vite-xmlui-plugin/package.json +3 -0
- package/dist/lib/xmlui-parser-BZZ430Wm.js +523 -0
- package/dist/lib/xmlui-parser.d.ts +2 -1
- package/dist/lib/{xmlui-parser.mjs → xmlui-parser.js} +2 -2
- package/dist/lib/{xmlui-serializer-uCYa8_tZ.mjs → xmlui-serializer-D9D2mQ8m.js} +1 -1
- package/dist/lib/xmlui.d.ts +1 -0
- package/dist/lib/{xmlui.mjs → xmlui.js} +24 -23
- package/dist/metadata/{collectedComponentMetadata-BgHIc2Iu.mjs → collectedComponentMetadata-BAI5eK2v.js} +698 -567
- package/dist/metadata/{initMock-B3UDa-rw.mjs → initMock-CekNG5Ax.js} +1 -1
- package/dist/metadata/style.css +1 -1
- package/dist/metadata/{xmlui-metadata.mjs → xmlui-metadata.js} +1 -1
- package/dist/metadata/xmlui-metadata.umd.cjs +207 -0
- package/dist/scripts/bin/bootstrap.cjs +4 -0
- package/dist/scripts/bin/index.js +85 -13
- package/dist/scripts/package.json +30 -22
- package/dist/scripts/src/components/App/App.spec.js +27 -15
- package/dist/scripts/src/components/Avatar/Avatar.spec.js +0 -29
- package/dist/scripts/src/components/Button/Button.spec.js +0 -29
- package/dist/scripts/src/components/Charts/BarChart/BarChartNative.js +2 -0
- package/dist/scripts/src/components/Charts/LineChart/LineChartNative.js +2 -2
- package/dist/scripts/src/components/Charts/Tooltip/TooltipContent.spec.js +8 -6
- package/dist/scripts/src/components/Form/Form.js +19 -0
- package/dist/scripts/src/components/Form/Form.spec.js +444 -0
- package/dist/scripts/src/components/Form/FormNative.js +46 -15
- package/dist/scripts/src/components/Form/formActions.js +3 -2
- package/dist/scripts/src/components/FormItem/FormItem.js +10 -2
- package/dist/scripts/src/components/FormItem/FormItem.spec.js +159 -0
- package/dist/scripts/src/components/FormItem/FormItemNative.js +6 -5
- package/dist/scripts/src/components/Heading/Heading.spec.js +34 -47
- package/dist/scripts/src/components/Queue/Queue.js +1 -16
- package/dist/scripts/src/components/Queue/QueueNative.js +60 -2
- package/dist/scripts/src/components/TableOfContents/TableOfContents.js +7 -5
- package/dist/scripts/src/components-core/appContext/misc-utils.js +2 -1
- package/dist/scripts/src/components-core/devtools/InspectorDialog.js +2 -2
- package/dist/scripts/src/components-core/script-runner/eval-tree-async.js +2 -0
- package/dist/scripts/src/components-core/utils/base64-utils.js +2 -0
- package/dist/scripts/src/components-core/utils/misc.js +44 -0
- package/dist/scripts/src/language-server/server-common.js +2 -2
- package/dist/scripts/src/language-server/{xmlui-metadata-generated.mjs → xmlui-metadata-generated.js} +625 -615
- package/dist/scripts/src/testing/drivers/index.js +9 -0
- package/dist/scripts/src/testing/index.js +69 -0
- package/dist/standalone/xmlui-standalone.es.d.ts +32 -16
- package/dist/standalone/xmlui-standalone.umd.js +36 -36
- package/package.json +45 -37
- package/dist/metadata/xmlui-metadata.umd.js +0 -207
- package/dist/scripts/bin/bootstrap.js +0 -11
- /package/dist/lib/{apiInterceptorWorker-QiltRtq1.mjs → apiInterceptorWorker-QiltRtq1.js} +0 -0
- /package/dist/lib/{syntax-monaco.mjs → syntax-monaco.js} +0 -0
- /package/dist/lib/{syntax-textmate.mjs → syntax-textmate.js} +0 -0
- /package/dist/lib/{transform-Tooy42EB.mjs → transform-Tooy42EB.js} +0 -0
- /package/dist/metadata/{apiInterceptorWorker-Dql7QGw2.mjs → apiInterceptorWorker-Dql7QGw2.js} +0 -0
|
@@ -0,0 +1,523 @@
|
|
|
1
|
+
import { h as createXmlUiParser, w as nodeToComponentDef, D as DiagnosticCategory, E as ErrCodes, S as SyntaxKind } from "./transform-Tooy42EB.js";
|
|
2
|
+
const PART_LABEL = "label";
|
|
3
|
+
const PART_LABELED_ITEM = "labeledItem";
|
|
4
|
+
const PART_INPUT = "input";
|
|
5
|
+
const PART_START_ADORNMENT = "startAdornment";
|
|
6
|
+
const PART_END_ADORNMENT = "endAdornment";
|
|
7
|
+
const COLOR_DANGER_100 = "hsl(356, 100%, 91%)";
|
|
8
|
+
const COLOR_DANGER_300 = "hsl(356, 100%, 70%)";
|
|
9
|
+
const COLOR_PRIMARY = "hsl(204, 30.3%, 13%)";
|
|
10
|
+
const COLOR_PRIMARY_LINE_NUMS = "#555b5e";
|
|
11
|
+
const RADIUS = "0.5rem";
|
|
12
|
+
function xmlUiMarkupToComponent(source, fileId = 0) {
|
|
13
|
+
const { parse, getText } = createXmlUiParser(source);
|
|
14
|
+
const { node, errors } = parse();
|
|
15
|
+
if (errors.length > 0) {
|
|
16
|
+
const errorsForDisplay = addDisplayFieldsToErrors(errors, source);
|
|
17
|
+
const erroneousCompoundComponentName = getCompoundCompName(node, getText);
|
|
18
|
+
return { component: null, errors: errorsForDisplay, erroneousCompoundComponentName };
|
|
19
|
+
}
|
|
20
|
+
try {
|
|
21
|
+
const component = nodeToComponentDef(node, getText, fileId);
|
|
22
|
+
const transformResult = { component, errors: [] };
|
|
23
|
+
return transformResult;
|
|
24
|
+
} catch (e) {
|
|
25
|
+
const erroneousCompoundComponentName = getCompoundCompName(node, getText);
|
|
26
|
+
const singleErr = {
|
|
27
|
+
message: e.message,
|
|
28
|
+
errPosCol: 0,
|
|
29
|
+
errPosLine: 0,
|
|
30
|
+
code: ErrCodes.expEq,
|
|
31
|
+
category: DiagnosticCategory.Error,
|
|
32
|
+
pos: 0,
|
|
33
|
+
end: 0,
|
|
34
|
+
contextPos: 0,
|
|
35
|
+
contextEnd: 0,
|
|
36
|
+
contextSource: "",
|
|
37
|
+
contextStartLine: 0
|
|
38
|
+
};
|
|
39
|
+
return {
|
|
40
|
+
component: null,
|
|
41
|
+
erroneousCompoundComponentName,
|
|
42
|
+
errors: [singleErr]
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
function createErrorMessageComponent(message) {
|
|
47
|
+
const comp = {
|
|
48
|
+
type: "VStack",
|
|
49
|
+
props: { padding: "$padding-normal", gap: 0 },
|
|
50
|
+
children: [
|
|
51
|
+
{
|
|
52
|
+
type: "H1",
|
|
53
|
+
props: {
|
|
54
|
+
value: message,
|
|
55
|
+
padding: "$padding-normal",
|
|
56
|
+
backgroundColor: "$color-error",
|
|
57
|
+
color: "white"
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
]
|
|
61
|
+
};
|
|
62
|
+
return comp;
|
|
63
|
+
}
|
|
64
|
+
function errReportMessage(message) {
|
|
65
|
+
const comp = createErrorMessageComponent(message);
|
|
66
|
+
comp.component = createErrorMessageComponent(message);
|
|
67
|
+
return comp;
|
|
68
|
+
}
|
|
69
|
+
function createErrorReportComponent(errors, fileName) {
|
|
70
|
+
const errList = errors.sort((a, b) => {
|
|
71
|
+
if (a.pos === void 0 && b.pos === void 0) {
|
|
72
|
+
return 0;
|
|
73
|
+
} else if (a.pos === void 0) {
|
|
74
|
+
return 1;
|
|
75
|
+
} else if (b.pos === void 0) {
|
|
76
|
+
return -1;
|
|
77
|
+
} else {
|
|
78
|
+
return a.pos - b.pos;
|
|
79
|
+
}
|
|
80
|
+
}).map((e, idx) => {
|
|
81
|
+
const errorStartInContext = e.pos - e.contextPos;
|
|
82
|
+
const errorEndInContext = e.end - e.contextPos;
|
|
83
|
+
const contextLines = e.contextSource.split("\n");
|
|
84
|
+
let currentPos = 0;
|
|
85
|
+
const lastLineNumber = e.contextStartLine + contextLines.length - 1;
|
|
86
|
+
const maxDigits = lastLineNumber.toString().length;
|
|
87
|
+
const contextChildren = [];
|
|
88
|
+
for (let lineIdx = 0; lineIdx < contextLines.length; lineIdx++) {
|
|
89
|
+
const line = contextLines[lineIdx];
|
|
90
|
+
const lineNumber = e.contextStartLine + lineIdx;
|
|
91
|
+
const paddedLineNumber = lineNumber.toString().padStart(maxDigits, "0");
|
|
92
|
+
const linePrefix = `${paddedLineNumber} | `;
|
|
93
|
+
const lineStart = currentPos;
|
|
94
|
+
const lineEnd = currentPos + line.length;
|
|
95
|
+
const lineChildren = [
|
|
96
|
+
{
|
|
97
|
+
type: "Theme",
|
|
98
|
+
props: {},
|
|
99
|
+
children: [
|
|
100
|
+
{
|
|
101
|
+
type: "Text",
|
|
102
|
+
props: {
|
|
103
|
+
value: linePrefix,
|
|
104
|
+
fontFamily: "monospace",
|
|
105
|
+
color: COLOR_PRIMARY_LINE_NUMS
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
]
|
|
109
|
+
},
|
|
110
|
+
,
|
|
111
|
+
];
|
|
112
|
+
if (errorStartInContext >= lineStart && errorStartInContext < lineEnd) {
|
|
113
|
+
const beforeError = line.substring(0, errorStartInContext - lineStart);
|
|
114
|
+
const errorInLine = line.substring(
|
|
115
|
+
errorStartInContext - lineStart,
|
|
116
|
+
Math.min(errorEndInContext - lineStart, line.length)
|
|
117
|
+
);
|
|
118
|
+
const afterError = line.substring(Math.min(errorEndInContext - lineStart, line.length));
|
|
119
|
+
if (beforeError) {
|
|
120
|
+
lineChildren.push({
|
|
121
|
+
type: "Text",
|
|
122
|
+
props: {
|
|
123
|
+
value: beforeError,
|
|
124
|
+
fontFamily: "monospace"
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
if (errorInLine) {
|
|
129
|
+
lineChildren.push({
|
|
130
|
+
type: "Text",
|
|
131
|
+
props: {
|
|
132
|
+
value: errorInLine,
|
|
133
|
+
fontFamily: "monospace",
|
|
134
|
+
textDecorationLine: "underline",
|
|
135
|
+
textDecorationColor: "$color-error",
|
|
136
|
+
backgroundColor: COLOR_DANGER_100
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
if (afterError) {
|
|
141
|
+
lineChildren.push({
|
|
142
|
+
type: "Text",
|
|
143
|
+
props: {
|
|
144
|
+
value: afterError,
|
|
145
|
+
fontFamily: "monospace"
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
} else if (errorStartInContext < lineStart && errorEndInContext > lineEnd) {
|
|
150
|
+
lineChildren.push({
|
|
151
|
+
type: "Text",
|
|
152
|
+
props: {
|
|
153
|
+
value: line,
|
|
154
|
+
fontFamily: "monospace",
|
|
155
|
+
textDecorationLine: "underline",
|
|
156
|
+
textDecorationColor: "$color-error",
|
|
157
|
+
backgroundColor: COLOR_DANGER_100
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
} else if (errorStartInContext < lineStart && errorEndInContext >= lineStart && errorEndInContext < lineEnd) {
|
|
161
|
+
const errorInLine = line.substring(0, errorEndInContext - lineStart);
|
|
162
|
+
const afterError = line.substring(errorEndInContext - lineStart);
|
|
163
|
+
if (errorInLine) {
|
|
164
|
+
lineChildren.push({
|
|
165
|
+
type: "Text",
|
|
166
|
+
props: {
|
|
167
|
+
value: errorInLine,
|
|
168
|
+
fontFamily: "monospace",
|
|
169
|
+
textDecorationLine: "underline",
|
|
170
|
+
textDecorationColor: "$color-error",
|
|
171
|
+
backgroundColor: COLOR_DANGER_100
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
if (afterError) {
|
|
176
|
+
lineChildren.push({
|
|
177
|
+
type: "Text",
|
|
178
|
+
props: {
|
|
179
|
+
value: afterError,
|
|
180
|
+
fontFamily: "monospace"
|
|
181
|
+
}
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
} else if (lineEnd === errorStartInContext && errorStartInContext === errorEndInContext) {
|
|
185
|
+
lineChildren.push({
|
|
186
|
+
type: "Text",
|
|
187
|
+
props: {
|
|
188
|
+
value: line,
|
|
189
|
+
fontFamily: "monospace"
|
|
190
|
+
}
|
|
191
|
+
});
|
|
192
|
+
lineChildren.push({
|
|
193
|
+
type: "Text",
|
|
194
|
+
props: {
|
|
195
|
+
value: " ",
|
|
196
|
+
preserveLinebreaks: true,
|
|
197
|
+
textDecorationLine: "underline",
|
|
198
|
+
fontFamily: "monospace",
|
|
199
|
+
fontWeight: "bold",
|
|
200
|
+
backgroundColor: COLOR_DANGER_100,
|
|
201
|
+
color: "$color-error"
|
|
202
|
+
}
|
|
203
|
+
});
|
|
204
|
+
} else {
|
|
205
|
+
lineChildren.push({
|
|
206
|
+
type: "Text",
|
|
207
|
+
props: {
|
|
208
|
+
value: line,
|
|
209
|
+
fontFamily: "monospace"
|
|
210
|
+
}
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
contextChildren.push({
|
|
214
|
+
type: "HStack",
|
|
215
|
+
props: { gap: "0" },
|
|
216
|
+
children: lineChildren
|
|
217
|
+
});
|
|
218
|
+
currentPos = lineEnd + 1;
|
|
219
|
+
}
|
|
220
|
+
const errMsgComponenet = {
|
|
221
|
+
type: "Text",
|
|
222
|
+
children: [
|
|
223
|
+
{
|
|
224
|
+
type: "Text",
|
|
225
|
+
props: {
|
|
226
|
+
value: `#${idx + 1}: ${fileName} (${e.errPosLine}:${e.errPosCol}):`
|
|
227
|
+
// color: "hsl(204, 30.3%, 27%)",
|
|
228
|
+
}
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
type: "Text",
|
|
232
|
+
props: {
|
|
233
|
+
value: ` ${e.message}`,
|
|
234
|
+
fontWeight: "bold"
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
]
|
|
238
|
+
};
|
|
239
|
+
const context = {
|
|
240
|
+
type: "HStack",
|
|
241
|
+
props: {
|
|
242
|
+
width: "100%"
|
|
243
|
+
},
|
|
244
|
+
children: [
|
|
245
|
+
{
|
|
246
|
+
type: "VStack",
|
|
247
|
+
props: {
|
|
248
|
+
gap: "0",
|
|
249
|
+
padding: "$padding-normal",
|
|
250
|
+
backgroundColor: "$color-surface-variant"
|
|
251
|
+
},
|
|
252
|
+
children: contextChildren
|
|
253
|
+
}
|
|
254
|
+
]
|
|
255
|
+
};
|
|
256
|
+
const errComponent = {
|
|
257
|
+
type: "VStack",
|
|
258
|
+
props: {
|
|
259
|
+
gap: "$gap-none",
|
|
260
|
+
padding: "16px",
|
|
261
|
+
backgroundColor: "white",
|
|
262
|
+
borderRadius: RADIUS
|
|
263
|
+
},
|
|
264
|
+
children: [errMsgComponenet]
|
|
265
|
+
};
|
|
266
|
+
if (!(e.contextSource === "" && e.pos === 0 && e.end === 0)) {
|
|
267
|
+
errComponent.children.push(context);
|
|
268
|
+
}
|
|
269
|
+
return errComponent;
|
|
270
|
+
});
|
|
271
|
+
const comp = {
|
|
272
|
+
type: "Theme",
|
|
273
|
+
props: {
|
|
274
|
+
"textColor-primary": COLOR_PRIMARY
|
|
275
|
+
},
|
|
276
|
+
children: [
|
|
277
|
+
{
|
|
278
|
+
type: "VStack",
|
|
279
|
+
props: {
|
|
280
|
+
padding: "16px 32px 16px 38px",
|
|
281
|
+
gap: 0,
|
|
282
|
+
backgroundColor: COLOR_DANGER_100,
|
|
283
|
+
margin: "10px",
|
|
284
|
+
border: "2px solid " + COLOR_DANGER_300,
|
|
285
|
+
borderRadius: RADIUS
|
|
286
|
+
},
|
|
287
|
+
children: [
|
|
288
|
+
{
|
|
289
|
+
type: "HStack",
|
|
290
|
+
props: {
|
|
291
|
+
verticalAlignment: "center",
|
|
292
|
+
marginLeft: "-34px",
|
|
293
|
+
padding: "0px 0px 15px 0px",
|
|
294
|
+
gap: "4px"
|
|
295
|
+
},
|
|
296
|
+
children: [
|
|
297
|
+
{
|
|
298
|
+
type: "Icon",
|
|
299
|
+
props: {
|
|
300
|
+
name: "error",
|
|
301
|
+
size: "30px",
|
|
302
|
+
color: "$color-error"
|
|
303
|
+
}
|
|
304
|
+
},
|
|
305
|
+
{
|
|
306
|
+
type: "H2",
|
|
307
|
+
props: {
|
|
308
|
+
value: `${errList.length} ${errList.length > 1 ? "errors" : "error"} while processing XMLUI markup`,
|
|
309
|
+
fontWeight: "bold",
|
|
310
|
+
showAnchor: false
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
]
|
|
314
|
+
},
|
|
315
|
+
{
|
|
316
|
+
type: "VStack",
|
|
317
|
+
props: {
|
|
318
|
+
padding: "$padding-none",
|
|
319
|
+
gap: "16px"
|
|
320
|
+
},
|
|
321
|
+
children: errList
|
|
322
|
+
}
|
|
323
|
+
]
|
|
324
|
+
}
|
|
325
|
+
]
|
|
326
|
+
};
|
|
327
|
+
return comp;
|
|
328
|
+
}
|
|
329
|
+
function errReportComponent(errors, fileName, compoundCompName) {
|
|
330
|
+
const comp = createErrorReportComponent(errors, fileName);
|
|
331
|
+
comp.name = compoundCompName;
|
|
332
|
+
comp.component = createErrorReportComponent(errors, fileName);
|
|
333
|
+
return comp;
|
|
334
|
+
}
|
|
335
|
+
function createScriptErrorComponent(error, fileName) {
|
|
336
|
+
const comp = {
|
|
337
|
+
type: "VStack",
|
|
338
|
+
props: { padding: "$padding-normal", gap: 0 },
|
|
339
|
+
children: [
|
|
340
|
+
{
|
|
341
|
+
type: "H1",
|
|
342
|
+
props: {
|
|
343
|
+
value: `An error found while processing XMLUI code-behind script`,
|
|
344
|
+
padding: "$padding-normal",
|
|
345
|
+
backgroundColor: "$color-error",
|
|
346
|
+
color: "white"
|
|
347
|
+
}
|
|
348
|
+
},
|
|
349
|
+
{
|
|
350
|
+
type: "VStack",
|
|
351
|
+
props: {
|
|
352
|
+
gap: "$gap-tight",
|
|
353
|
+
padding: "$padding-normal"
|
|
354
|
+
},
|
|
355
|
+
children: [
|
|
356
|
+
{
|
|
357
|
+
type: "HStack",
|
|
358
|
+
props: { gap: "0" },
|
|
359
|
+
children: [
|
|
360
|
+
{
|
|
361
|
+
type: "Text",
|
|
362
|
+
props: {
|
|
363
|
+
value: `${fileName} (${error.line}:${error.column}): `,
|
|
364
|
+
color: "$color-info"
|
|
365
|
+
}
|
|
366
|
+
},
|
|
367
|
+
{
|
|
368
|
+
type: "Text",
|
|
369
|
+
props: { value: ` ${error.text}`, fontWeight: "bold" }
|
|
370
|
+
}
|
|
371
|
+
]
|
|
372
|
+
}
|
|
373
|
+
]
|
|
374
|
+
}
|
|
375
|
+
]
|
|
376
|
+
};
|
|
377
|
+
return comp;
|
|
378
|
+
}
|
|
379
|
+
function errReportScriptError(error, fileName) {
|
|
380
|
+
const comp = createScriptErrorComponent(error, fileName);
|
|
381
|
+
comp.component = createScriptErrorComponent(error, fileName);
|
|
382
|
+
return comp;
|
|
383
|
+
}
|
|
384
|
+
function createModuleErrorsComponent(errors, fileName) {
|
|
385
|
+
const errList = [];
|
|
386
|
+
let idx = 1;
|
|
387
|
+
Object.keys(errors).map((key) => {
|
|
388
|
+
const e = errors[key];
|
|
389
|
+
for (let err of e) {
|
|
390
|
+
errList.push({
|
|
391
|
+
type: "VStack",
|
|
392
|
+
props: { gap: "0px" },
|
|
393
|
+
children: [
|
|
394
|
+
{
|
|
395
|
+
type: "HStack",
|
|
396
|
+
props: { gap: "0" },
|
|
397
|
+
children: [
|
|
398
|
+
{
|
|
399
|
+
type: "Text",
|
|
400
|
+
props: {
|
|
401
|
+
value: `#${idx++}: ${fileName} (${err.line}:${err.column}): `,
|
|
402
|
+
color: "$color-info"
|
|
403
|
+
}
|
|
404
|
+
},
|
|
405
|
+
{
|
|
406
|
+
type: "Text",
|
|
407
|
+
props: { value: ` ${err.text}`, fontWeight: "bold" }
|
|
408
|
+
}
|
|
409
|
+
]
|
|
410
|
+
}
|
|
411
|
+
]
|
|
412
|
+
});
|
|
413
|
+
}
|
|
414
|
+
});
|
|
415
|
+
const comp = {
|
|
416
|
+
type: "VStack",
|
|
417
|
+
props: { padding: "$padding-normal", gap: 0 },
|
|
418
|
+
children: [
|
|
419
|
+
{
|
|
420
|
+
type: "H1",
|
|
421
|
+
props: {
|
|
422
|
+
value: `${errList.length} ${errList.length > 1 ? "Errors" : "Error"} found while processing XMLUI code-behind script`,
|
|
423
|
+
padding: "$padding-normal",
|
|
424
|
+
backgroundColor: "$color-error",
|
|
425
|
+
color: "white"
|
|
426
|
+
}
|
|
427
|
+
},
|
|
428
|
+
{
|
|
429
|
+
type: "VStack",
|
|
430
|
+
props: {
|
|
431
|
+
gap: "$gap-tight",
|
|
432
|
+
padding: "$padding-normal"
|
|
433
|
+
},
|
|
434
|
+
children: errList
|
|
435
|
+
}
|
|
436
|
+
]
|
|
437
|
+
};
|
|
438
|
+
return comp;
|
|
439
|
+
}
|
|
440
|
+
function errReportModuleErrors(errors, fileName) {
|
|
441
|
+
const comp = createModuleErrorsComponent(errors, fileName);
|
|
442
|
+
comp.component = createModuleErrorsComponent(errors, fileName);
|
|
443
|
+
return comp;
|
|
444
|
+
}
|
|
445
|
+
function getCompoundCompName(node, getText) {
|
|
446
|
+
var _a, _b, _c, _d, _e, _f;
|
|
447
|
+
const rootTag = (_a = node == null ? void 0 : node.children) == null ? void 0 : _a[0];
|
|
448
|
+
const rootTagNameTokens = (_c = (_b = rootTag == null ? void 0 : rootTag.children) == null ? void 0 : _b.find(
|
|
449
|
+
(c) => c.kind === SyntaxKind.TagNameNode
|
|
450
|
+
)) == null ? void 0 : _c.children;
|
|
451
|
+
const rootTagName = rootTagNameTokens == null ? void 0 : rootTagNameTokens[rootTagNameTokens.length - 1];
|
|
452
|
+
if (rootTagName === void 0 || getText(rootTagName) !== "Component") {
|
|
453
|
+
return void 0;
|
|
454
|
+
}
|
|
455
|
+
const attrs = (_e = (_d = rootTag.children) == null ? void 0 : _d.find((c) => c.kind === SyntaxKind.AttributeListNode)) == null ? void 0 : _e.children;
|
|
456
|
+
const nameAttrTokens = (_f = attrs == null ? void 0 : attrs.find(
|
|
457
|
+
(c) => c.kind === SyntaxKind.AttributeNode && getText(c == null ? void 0 : c.children[0]) === "name"
|
|
458
|
+
)) == null ? void 0 : _f.children;
|
|
459
|
+
const nameValueToken = nameAttrTokens == null ? void 0 : nameAttrTokens[nameAttrTokens.length - 1];
|
|
460
|
+
if (nameValueToken !== void 0 && nameValueToken.kind === SyntaxKind.StringLiteral) {
|
|
461
|
+
const strLit = getText(nameValueToken);
|
|
462
|
+
return strLit.substring(1, strLit.length - 1);
|
|
463
|
+
}
|
|
464
|
+
return void 0;
|
|
465
|
+
}
|
|
466
|
+
function addDisplayFieldsToErrors(errors, source) {
|
|
467
|
+
const { offsetToPosForDisplay } = createDocumentCursor(source);
|
|
468
|
+
return errors.map((err) => {
|
|
469
|
+
const { line: errPosLine, character: errPosCol } = offsetToPosForDisplay(err.pos);
|
|
470
|
+
const { line: contextStartLine } = offsetToPosForDisplay(err.contextPos);
|
|
471
|
+
return {
|
|
472
|
+
...err,
|
|
473
|
+
errPosLine,
|
|
474
|
+
errPosCol,
|
|
475
|
+
contextStartLine,
|
|
476
|
+
contextSource: source.substring(err.contextPos, err.contextEnd)
|
|
477
|
+
};
|
|
478
|
+
});
|
|
479
|
+
}
|
|
480
|
+
function createDocumentCursor(text) {
|
|
481
|
+
const newlinePositions = [];
|
|
482
|
+
for (let i = 0; i < text.length; ++i) {
|
|
483
|
+
if (text[i] === "\n") {
|
|
484
|
+
newlinePositions.push(i);
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
return {
|
|
488
|
+
offsetToPos,
|
|
489
|
+
offsetToPosForDisplay
|
|
490
|
+
};
|
|
491
|
+
function offsetToPos(offset) {
|
|
492
|
+
let left = 0;
|
|
493
|
+
let right = newlinePositions.length;
|
|
494
|
+
while (left < right) {
|
|
495
|
+
const mid = Math.floor((left + right) / 2);
|
|
496
|
+
if (newlinePositions[mid] < offset) {
|
|
497
|
+
left = mid + 1;
|
|
498
|
+
} else {
|
|
499
|
+
right = mid;
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
let col = left === 0 ? offset : offset - newlinePositions[left - 1] - 1;
|
|
503
|
+
return { line: left, character: col };
|
|
504
|
+
}
|
|
505
|
+
function offsetToPosForDisplay(offset) {
|
|
506
|
+
let pos = offsetToPos(offset);
|
|
507
|
+
pos.line += 1;
|
|
508
|
+
pos.character += 1;
|
|
509
|
+
return pos;
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
export {
|
|
513
|
+
PART_START_ADORNMENT as P,
|
|
514
|
+
PART_END_ADORNMENT as a,
|
|
515
|
+
PART_INPUT as b,
|
|
516
|
+
PART_LABELED_ITEM as c,
|
|
517
|
+
PART_LABEL as d,
|
|
518
|
+
errReportComponent as e,
|
|
519
|
+
errReportMessage as f,
|
|
520
|
+
errReportScriptError as g,
|
|
521
|
+
errReportModuleErrors as h,
|
|
522
|
+
xmlUiMarkupToComponent as x
|
|
523
|
+
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { DelayMode } from 'msw';
|
|
2
|
+
import { FindTokenSuccess as FindTokenSuccess_2 } from './utils';
|
|
2
3
|
|
|
3
4
|
declare type ApiInterceptorDefinition = {
|
|
4
5
|
type?: string;
|
|
@@ -892,7 +893,7 @@ declare class Node_2 {
|
|
|
892
893
|
isContentListNode(): this is ContentListNode;
|
|
893
894
|
isAttributeListNode(): this is AttributeListNode;
|
|
894
895
|
isTagNameNode(): this is TagNameNode;
|
|
895
|
-
findTokenAtPos(position: number):
|
|
896
|
+
findTokenAtPos(position: number): FindTokenSuccess_2;
|
|
896
897
|
}
|
|
897
898
|
export { Node_2 as Node }
|
|
898
899
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { q, s, A, t, v, C, r, a, b, f, e, g, c, D, o, E, N, P, S, T, U, j, h, d, i, B, n, k, m, l, w, u, p, x, z, y } from "./transform-Tooy42EB.
|
|
2
|
-
import { b as b2, L, X, a as a2, c as c2, g as g2, e as e2, l as l2, d as d2, m as m2, p as p2 } from "./xmlui-serializer-
|
|
1
|
+
import { q, s, A, t, v, C, r, a, b, f, e, g, c, D, o, E, N, P, S, T, U, j, h, d, i, B, n, k, m, l, w, u, p, x, z, y } from "./transform-Tooy42EB.js";
|
|
2
|
+
import { b as b2, L, X, a as a2, c as c2, g as g2, e as e2, l as l2, d as d2, m as m2, p as p2 } from "./xmlui-serializer-D9D2mQ8m.js";
|
|
3
3
|
export {
|
|
4
4
|
q as AttributeKeyNode,
|
|
5
5
|
s as AttributeListNode,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { v as CORE_NAMESPACE_VALUE, t as COMPOUND_COMP_ID } from "./transform-Tooy42EB.
|
|
1
|
+
import { v as CORE_NAMESPACE_VALUE, t as COMPOUND_COMP_ID } from "./transform-Tooy42EB.js";
|
|
2
2
|
const componentFileExtension = "xmlui";
|
|
3
3
|
const codeBehindFileExtension = "xmlui.xs";
|
|
4
4
|
const moduleFileExtension = "xs";
|
package/dist/lib/xmlui.d.ts
CHANGED
|
@@ -136,6 +136,7 @@ declare type AppContextObject = {
|
|
|
136
136
|
capitalize: (s?: string) => string;
|
|
137
137
|
pluralize: (number: number, singular: string, plural: string) => string;
|
|
138
138
|
delay: (timeInMs: number, callback?: any) => Promise<void>;
|
|
139
|
+
debounce: <F extends (...args: any[]) => any>(delayMs: number, func: F, ...args: any[]) => void;
|
|
139
140
|
toHashObject: (arr: any[], keyProp: string, valueProp: string) => any;
|
|
140
141
|
findByField: (arr: any[], field: string, value: any) => any;
|
|
141
142
|
readonly embed: {
|
|
@@ -1,32 +1,33 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { aa, Z, al, a1, _, $, ai, ak, ag, ab, a2, a0, S, ar, b, ao, ap, a4, a5, ae, af, as, aj, ah, ad, c, f, e, h, j, k, l, i, n, p, q, s, u, v, x, w, t, y, z, A, B, C, D, E, F, G, H, I, J, K, L, M, P, N, O, Q, R, U, V, a3, W, X, a7, an, a6, a8, aq, a9, am, Y, ac } from "./index-CEq6OdjV.js";
|
|
2
|
+
import { e as e2, x as x2 } from "./xmlui-parser-BZZ430Wm.js";
|
|
3
|
+
import { X as X2 } from "./xmlui-serializer-D9D2mQ8m.js";
|
|
3
4
|
export {
|
|
4
|
-
|
|
5
|
+
aa as ApiInterceptorProvider,
|
|
5
6
|
Z as AppRoot,
|
|
6
|
-
|
|
7
|
+
al as Breakout,
|
|
7
8
|
a1 as Button,
|
|
8
9
|
_ as ErrorBoundary,
|
|
9
10
|
$ as Icon,
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
ai as LinkNative,
|
|
12
|
+
ak as Logo,
|
|
13
|
+
ag as NestedApp,
|
|
14
|
+
ab as Spinner,
|
|
14
15
|
a2 as Splitter,
|
|
15
16
|
a0 as Stack,
|
|
16
17
|
S as StandaloneApp,
|
|
17
|
-
|
|
18
|
+
ar as StandaloneComponent,
|
|
18
19
|
b as StandaloneExtensionManager,
|
|
19
|
-
|
|
20
|
-
|
|
20
|
+
ao as StyleProvider,
|
|
21
|
+
ap as StyleRegistry,
|
|
21
22
|
a4 as TabItem,
|
|
22
23
|
a5 as Tabs,
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
ae as Text,
|
|
25
|
+
af as TextBox,
|
|
26
|
+
as as Theme,
|
|
27
|
+
aj as ToneChangerButton,
|
|
28
|
+
ah as VisuallyHidden,
|
|
28
29
|
X2 as XmlUiHelper,
|
|
29
|
-
|
|
30
|
+
ad as builtInThemes,
|
|
30
31
|
c as createComponentRenderer,
|
|
31
32
|
f as createMetadata,
|
|
32
33
|
e as createUserDefinedComponentRenderer,
|
|
@@ -66,18 +67,18 @@ export {
|
|
|
66
67
|
R as dValidationStatus,
|
|
67
68
|
U as dValue,
|
|
68
69
|
V as dValueApi,
|
|
69
|
-
|
|
70
|
+
e2 as errReportComponent,
|
|
70
71
|
a3 as getColor,
|
|
71
72
|
W as parseScssVar,
|
|
72
73
|
X as startApp,
|
|
73
74
|
a7 as toCssVar,
|
|
74
|
-
|
|
75
|
+
an as useAppLayoutContext,
|
|
75
76
|
a6 as useColors,
|
|
76
77
|
a8 as useDevTools,
|
|
77
|
-
|
|
78
|
+
aq as useEvent,
|
|
78
79
|
a9 as useLogger,
|
|
79
|
-
|
|
80
|
+
am as useSearchContextContent,
|
|
80
81
|
Y as useTheme,
|
|
81
|
-
|
|
82
|
-
|
|
82
|
+
ac as useThemes,
|
|
83
|
+
x2 as xmlUiMarkupToComponent
|
|
83
84
|
};
|