xmlui 0.10.25 → 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-CCEPGw_x.mjs → index-CEq6OdjV.js} +6186 -6523
- package/dist/lib/index.css +1 -1
- package/dist/lib/{initMock-DFcCR7ey.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-Dx-2qZBh.mjs → metadata-utils-D27cn-XB.js} +7 -7
- package/dist/lib/{server-common--BHVvP1o.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-mwkNkxN_.mjs → collectedComponentMetadata-BAI5eK2v.js} +13057 -12883
- package/dist/metadata/{initMock-BVxHA6wu.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 +127 -15
- package/dist/scripts/src/components/App/AppNative.js +13 -2
- package/dist/scripts/src/components/AppHeader/AppHeader.js +1 -6
- package/dist/scripts/src/components/AppHeader/AppHeaderNative.js +6 -7
- 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.js +45 -5
- package/dist/scripts/src/components/Heading/Heading.spec.js +116 -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/rendering/valueExtractor.js +9 -1
- 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/extractParam.js +2 -1
- 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
|
@@ -301,31 +301,29 @@ abstractions_1.headingLevels.forEach((level) => {
|
|
|
301
301
|
// BASIC FUNCTIONALITY TESTS
|
|
302
302
|
// =============================================================================
|
|
303
303
|
fixtures_1.test.describe("Basic Functionality", () => {
|
|
304
|
-
(0, fixtures_1.test)("component renders with basic props", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createHeadingDriver }) {
|
|
304
|
+
(0, fixtures_1.test)("component renders with basic props", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page, createHeadingDriver }) {
|
|
305
305
|
yield initTestBed(`<Heading>Test Heading</Heading>`);
|
|
306
306
|
const driver = yield createHeadingDriver();
|
|
307
307
|
yield (0, fixtures_1.expect)(driver.component).toBeVisible();
|
|
308
308
|
yield (0, fixtures_1.expect)(driver.component).toHaveText("Test Heading");
|
|
309
309
|
}));
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
yield initTestBed(`<Heading level="${level}">Level ${level}</Heading>`);
|
|
310
|
+
["h1", "h2", "h3", "h4", "h5", "h6"].forEach((lvl) => {
|
|
311
|
+
(0, fixtures_1.test)(`component renders with ${lvl} level`, (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createHeadingDriver }) {
|
|
312
|
+
yield initTestBed(`<Heading level="${lvl}">Level ${lvl}</Heading>`);
|
|
314
313
|
const driver = yield createHeadingDriver();
|
|
315
314
|
yield (0, fixtures_1.expect)(driver.component).toBeVisible();
|
|
316
315
|
const tagName = yield driver.getComponentTagName();
|
|
317
|
-
(0, fixtures_1.expect)(tagName.toLowerCase()).toBe(
|
|
318
|
-
}
|
|
319
|
-
})
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
yield initTestBed(`<${component}>Specialized ${component}</${component}>`);
|
|
316
|
+
(0, fixtures_1.expect)(tagName.toLowerCase()).toBe(lvl);
|
|
317
|
+
}));
|
|
318
|
+
});
|
|
319
|
+
["H1", "H2", "H3", "H4", "H5", "H6"].forEach((c) => {
|
|
320
|
+
(0, fixtures_1.test)(`specialized ${c} components renders content`, (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createHeadingDriver, }) {
|
|
321
|
+
yield initTestBed(`<${c}>Specialized ${c}</${c}>`);
|
|
324
322
|
const driver = yield createHeadingDriver();
|
|
325
323
|
yield (0, fixtures_1.expect)(driver.component).toBeVisible();
|
|
326
|
-
yield (0, fixtures_1.expect)(driver.component).toHaveText(`Specialized ${
|
|
327
|
-
}
|
|
328
|
-
})
|
|
324
|
+
yield (0, fixtures_1.expect)(driver.component).toHaveText(`Specialized ${c}`);
|
|
325
|
+
}));
|
|
326
|
+
});
|
|
329
327
|
(0, fixtures_1.test)("component handles value prop", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createHeadingDriver }) {
|
|
330
328
|
yield initTestBed(`<Heading value="Value prop text" />`);
|
|
331
329
|
const driver = yield createHeadingDriver();
|
|
@@ -336,6 +334,88 @@ fixtures_1.test.describe("Basic Functionality", () => {
|
|
|
336
334
|
const driver = yield createHeadingDriver();
|
|
337
335
|
yield (0, fixtures_1.expect)(driver.component).toHaveText("Child content text");
|
|
338
336
|
}));
|
|
337
|
+
fixtures_1.test.describe("level property accepts numeric values", () => {
|
|
338
|
+
[1, 2, 3, 4, 5, 6].forEach((level) => {
|
|
339
|
+
(0, fixtures_1.test)(`level="{${level}}" renders as h${level}`, (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createHeadingDriver }) {
|
|
340
|
+
yield initTestBed(`<Heading level="{${level}}">Numeric Level ${level}</Heading>`);
|
|
341
|
+
const driver = yield createHeadingDriver();
|
|
342
|
+
yield (0, fixtures_1.expect)(driver.component).toBeVisible();
|
|
343
|
+
const tagName = yield driver.getComponentTagName();
|
|
344
|
+
(0, fixtures_1.expect)(tagName.toLowerCase()).toBe(`h${level}`);
|
|
345
|
+
yield (0, fixtures_1.expect)(driver.component).toHaveText(`Numeric Level ${level}`);
|
|
346
|
+
}));
|
|
347
|
+
});
|
|
348
|
+
});
|
|
349
|
+
fixtures_1.test.describe("level property accepts string numeric values", () => {
|
|
350
|
+
["1", "2", "3", "4", "5", "6"].forEach((level) => {
|
|
351
|
+
(0, fixtures_1.test)(`level="${level}" renders as h${level}`, (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createHeadingDriver }) {
|
|
352
|
+
yield initTestBed(`<Heading level="${level}">String Level ${level}</Heading>`);
|
|
353
|
+
const driver = yield createHeadingDriver();
|
|
354
|
+
yield (0, fixtures_1.expect)(driver.component).toBeVisible();
|
|
355
|
+
const tagName = yield driver.getComponentTagName();
|
|
356
|
+
(0, fixtures_1.expect)(tagName.toLowerCase()).toBe(`h${level}`);
|
|
357
|
+
yield (0, fixtures_1.expect)(driver.component).toHaveText(`String Level ${level}`);
|
|
358
|
+
}));
|
|
359
|
+
});
|
|
360
|
+
});
|
|
361
|
+
fixtures_1.test.describe("level property accepts uppercase H format", () => {
|
|
362
|
+
["H1", "H2", "H3", "H4", "H5", "H6"].forEach((level) => {
|
|
363
|
+
(0, fixtures_1.test)(`level="${level}" renders as ${level.toLowerCase()}`, (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createHeadingDriver }) {
|
|
364
|
+
yield initTestBed(`<Heading level="${level}">Uppercase Level ${level}</Heading>`);
|
|
365
|
+
const driver = yield createHeadingDriver();
|
|
366
|
+
yield (0, fixtures_1.expect)(driver.component).toBeVisible();
|
|
367
|
+
const tagName = yield driver.getComponentTagName();
|
|
368
|
+
(0, fixtures_1.expect)(tagName.toLowerCase()).toBe(level.toLowerCase());
|
|
369
|
+
yield (0, fixtures_1.expect)(driver.component).toHaveText(`Uppercase Level ${level}`);
|
|
370
|
+
}));
|
|
371
|
+
});
|
|
372
|
+
});
|
|
373
|
+
fixtures_1.test.describe("level property handles invalid values", () => {
|
|
374
|
+
[
|
|
375
|
+
{ value: '"invalid"', label: "invalid string" },
|
|
376
|
+
{ value: '"{0}"', label: "zero" },
|
|
377
|
+
{ value: '"{7}"', label: "out of range number (7)" },
|
|
378
|
+
{ value: '"{-1}"', label: "negative number" },
|
|
379
|
+
{ value: '"{999}"', label: "large number" },
|
|
380
|
+
{ value: '"h7"', label: "invalid h-format (h7)" },
|
|
381
|
+
{ value: '"h0"', label: "invalid h-format (h0)" },
|
|
382
|
+
{ value: '"7"', label: "out of range string (7)" },
|
|
383
|
+
{ value: '"{null}"', label: "null" },
|
|
384
|
+
{ value: '"{undefined}"', label: "undefined" },
|
|
385
|
+
{ value: '"{{}}"', label: "empty object" },
|
|
386
|
+
{ value: '"{[]}"', label: "empty array" },
|
|
387
|
+
].forEach(({ value, label }) => {
|
|
388
|
+
(0, fixtures_1.test)(`level=${value} (${label}) defaults to h1`, (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createHeadingDriver }) {
|
|
389
|
+
yield initTestBed(`<Heading level=${value}>Invalid Level Fallback</Heading>`);
|
|
390
|
+
const driver = yield createHeadingDriver();
|
|
391
|
+
yield (0, fixtures_1.expect)(driver.component).toBeVisible();
|
|
392
|
+
const tagName = yield driver.getComponentTagName();
|
|
393
|
+
(0, fixtures_1.expect)(tagName.toLowerCase()).toBe("h1");
|
|
394
|
+
yield (0, fixtures_1.expect)(driver.component).toHaveText("Invalid Level Fallback");
|
|
395
|
+
}));
|
|
396
|
+
});
|
|
397
|
+
});
|
|
398
|
+
(0, fixtures_1.test)("level property with mixed case string formats", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createHeadingDriver }) {
|
|
399
|
+
const testCases = [
|
|
400
|
+
{ input: "H3", expected: "h3" },
|
|
401
|
+
{ input: "h3", expected: "h3" },
|
|
402
|
+
{ input: "h3", expected: "h3" },
|
|
403
|
+
];
|
|
404
|
+
for (const { input, expected } of testCases) {
|
|
405
|
+
yield initTestBed(`<Heading level="${input}">Mixed Case ${input}</Heading>`);
|
|
406
|
+
const driver = yield createHeadingDriver();
|
|
407
|
+
yield (0, fixtures_1.expect)(driver.component).toBeVisible();
|
|
408
|
+
const tagName = yield driver.getComponentTagName();
|
|
409
|
+
(0, fixtures_1.expect)(tagName.toLowerCase()).toBe(expected);
|
|
410
|
+
}
|
|
411
|
+
}));
|
|
412
|
+
(0, fixtures_1.test)("level property handles whitespace in string values", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createHeadingDriver }) {
|
|
413
|
+
yield initTestBed(`<Heading level=" h2 ">Whitespace Level</Heading>`);
|
|
414
|
+
const driver = yield createHeadingDriver();
|
|
415
|
+
yield (0, fixtures_1.expect)(driver.component).toBeVisible();
|
|
416
|
+
const tagName = yield driver.getComponentTagName();
|
|
417
|
+
(0, fixtures_1.expect)(tagName.toLowerCase()).toBe("h2");
|
|
418
|
+
}));
|
|
339
419
|
});
|
|
340
420
|
// =============================================================================
|
|
341
421
|
// ACCESSIBILITY TESTS (REQUIRED)
|
|
@@ -348,33 +428,22 @@ fixtures_1.test.describe("Accessibility", () => {
|
|
|
348
428
|
const tagName = yield driver.getComponentTagName();
|
|
349
429
|
(0, fixtures_1.expect)(tagName.toLowerCase()).toBe("h2");
|
|
350
430
|
}));
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
}
|
|
360
|
-
}));
|
|
361
|
-
(0, fixtures_1.test)("specialized components maintain semantic heading structure", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createHeadingDriver, }) {
|
|
362
|
-
const components = [
|
|
363
|
-
{ component: "H1", expectedTag: "h1" },
|
|
364
|
-
{ component: "H2", expectedTag: "h2" },
|
|
365
|
-
{ component: "H3", expectedTag: "h3" },
|
|
366
|
-
{ component: "H4", expectedTag: "h4" },
|
|
367
|
-
{ component: "H5", expectedTag: "h5" },
|
|
368
|
-
{ component: "H6", expectedTag: "h6" },
|
|
369
|
-
];
|
|
370
|
-
for (const { component, expectedTag } of components) {
|
|
431
|
+
[
|
|
432
|
+
{ component: "H1", expectedTag: "h1" },
|
|
433
|
+
{ component: "H2", expectedTag: "h2" },
|
|
434
|
+
{ component: "H3", expectedTag: "h3" },
|
|
435
|
+
{ component: "H4", expectedTag: "h4" },
|
|
436
|
+
{ component: "H5", expectedTag: "h5" },
|
|
437
|
+
{ component: "H6", expectedTag: "h6" },
|
|
438
|
+
].forEach(({ component, expectedTag }) => {
|
|
439
|
+
(0, fixtures_1.test)(`${component} renders as ${expectedTag} element`, (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createHeadingDriver, }) {
|
|
371
440
|
yield initTestBed(`<${component}>Heading Level ${expectedTag}</${component}>`);
|
|
372
441
|
const driver = yield createHeadingDriver();
|
|
373
442
|
yield (0, fixtures_1.expect)(driver.component).toHaveRole("heading");
|
|
374
443
|
const tagName = yield driver.getComponentTagName();
|
|
375
444
|
(0, fixtures_1.expect)(tagName.toLowerCase()).toBe(expectedTag);
|
|
376
|
-
}
|
|
377
|
-
})
|
|
445
|
+
}));
|
|
446
|
+
});
|
|
378
447
|
(0, fixtures_1.test)("component supports accessible text content", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createHeadingDriver, }) {
|
|
379
448
|
yield initTestBed(`<Heading>Accessible heading with proper content</Heading>`);
|
|
380
449
|
const driver = yield createHeadingDriver();
|
|
@@ -752,8 +821,8 @@ fixtures_1.test.describe("API", () => {
|
|
|
752
821
|
const { testStateDriver } = yield initTestBed(`
|
|
753
822
|
<Fragment>
|
|
754
823
|
<Stack width="200px">
|
|
755
|
-
<H1 id="overflowHeading" maxLines="{1}"
|
|
756
|
-
value="This is a very long heading text that should definitely overflow when constrained to a small width"
|
|
824
|
+
<H1 id="overflowHeading" maxLines="{1}"
|
|
825
|
+
value="This is a very long heading text that should definitely overflow when constrained to a small width"
|
|
757
826
|
/>
|
|
758
827
|
<Button onClick="testState = overflowHeading.hasOverflow()" />
|
|
759
828
|
</Stack>
|
|
@@ -818,13 +887,13 @@ fixtures_1.test.describe("API", () => {
|
|
|
818
887
|
<H4 id="h4Text" maxLines="{1}" value="This is a very long heading that should overflow" />
|
|
819
888
|
<H5 id="h5Text" maxLines="{1}" value="This is a very long heading that should overflow" />
|
|
820
889
|
<H6 id="h6Text" maxLines="{1}" value="This is a very long heading that should overflow" />
|
|
821
|
-
<Button onClick="testState = {
|
|
822
|
-
h1: h1Text.hasOverflow(),
|
|
823
|
-
h2: h2Text.hasOverflow(),
|
|
824
|
-
h3: h3Text.hasOverflow(),
|
|
825
|
-
h4: h4Text.hasOverflow(),
|
|
826
|
-
h5: h5Text.hasOverflow(),
|
|
827
|
-
h6: h6Text.hasOverflow()
|
|
890
|
+
<Button onClick="testState = {
|
|
891
|
+
h1: h1Text.hasOverflow(),
|
|
892
|
+
h2: h2Text.hasOverflow(),
|
|
893
|
+
h3: h3Text.hasOverflow(),
|
|
894
|
+
h4: h4Text.hasOverflow(),
|
|
895
|
+
h5: h5Text.hasOverflow(),
|
|
896
|
+
h6: h6Text.hasOverflow()
|
|
828
897
|
}" />
|
|
829
898
|
</Stack>
|
|
830
899
|
</Fragment>
|
|
@@ -880,7 +949,7 @@ fixtures_1.test.describe("API", () => {
|
|
|
880
949
|
yield page.getByRole("button").click();
|
|
881
950
|
yield fixtures_1.expect.poll(testStateDriver.testState).toBe(true);
|
|
882
951
|
}));
|
|
883
|
-
(0, fixtures_1.test)("hasOverflow works with nested content instead of value prop", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
|
|
952
|
+
(0, fixtures_1.test)("hasOverflow works with nested content instead of value prop", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page, }) {
|
|
884
953
|
const { testStateDriver } = yield initTestBed(`
|
|
885
954
|
<Fragment>
|
|
886
955
|
<Stack width="100px">
|
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.queueComponentRenderer = exports.QueueMd = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const renderers_1 = require("../../components-core/renderers");
|
|
6
|
-
const container_helpers_1 = require("../container-helpers");
|
|
7
6
|
const metadata_helpers_1 = require("../metadata-helpers");
|
|
8
7
|
const QueueNative_1 = require("./QueueNative");
|
|
9
8
|
const COMP = "Queue";
|
|
@@ -82,19 +81,5 @@ exports.QueueMd = (0, metadata_helpers_1.createMetadata)({
|
|
|
82
81
|
},
|
|
83
82
|
});
|
|
84
83
|
exports.queueComponentRenderer = (0, renderers_1.createComponentRenderer)(COMP, exports.QueueMd, ({ node, registerComponentApi, lookupEventHandler, renderChild, extractValue }) => {
|
|
85
|
-
return ((0, jsx_runtime_1.jsx)(QueueNative_1.
|
|
86
|
-
? (completedItems, queuedItems) => {
|
|
87
|
-
return ((0, jsx_runtime_1.jsx)(container_helpers_1.MemoizedItem, { node: node.props.resultFeedback, contextVars: {
|
|
88
|
-
$completedItems: completedItems,
|
|
89
|
-
$queuedItems: queuedItems,
|
|
90
|
-
}, renderChild: renderChild }));
|
|
91
|
-
}
|
|
92
|
-
: undefined, renderProgressFeedback: node.props.progressFeedback
|
|
93
|
-
? (completedItems, queuedItems) => {
|
|
94
|
-
return ((0, jsx_runtime_1.jsx)(container_helpers_1.MemoizedItem, { node: node.props.progressFeedback, contextVars: {
|
|
95
|
-
$completedItems: completedItems,
|
|
96
|
-
$queuedItems: queuedItems,
|
|
97
|
-
}, renderChild: renderChild }));
|
|
98
|
-
}
|
|
99
|
-
: undefined, willProcessItem: lookupEventHandler("willProcess"), processItem: lookupEventHandler("process", { signError: false }), didProcessItem: lookupEventHandler("didProcess"), processItemError: lookupEventHandler("processError"), onComplete: lookupEventHandler("complete"), clearAfterFinish: extractValue.asOptionalBoolean(node.props.clearAfterFinish) }));
|
|
84
|
+
return ((0, jsx_runtime_1.jsx)(QueueNative_1.QueueWithContextVar, { node: node, renderChild: renderChild, extractValue: extractValue, lookupEventHandler: lookupEventHandler, registerComponentApi: registerComponentApi }));
|
|
100
85
|
});
|
|
@@ -14,6 +14,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.defaultProps = void 0;
|
|
16
16
|
exports.Queue = Queue;
|
|
17
|
+
exports.QueueWithContextVar = QueueWithContextVar;
|
|
17
18
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
18
19
|
const react_1 = require("react");
|
|
19
20
|
const react_hot_toast_1 = __importDefault(require("react-hot-toast"));
|
|
@@ -22,6 +23,7 @@ const lodash_es_1 = require("lodash-es");
|
|
|
22
23
|
const hooks_1 = require("../../components-core/utils/hooks");
|
|
23
24
|
const misc_1 = require("../../components-core/utils/misc");
|
|
24
25
|
const AppContext_1 = require("../../components-core/AppContext");
|
|
26
|
+
const container_helpers_1 = require("../container-helpers");
|
|
25
27
|
const queueActions_1 = require("../Queue/queueActions");
|
|
26
28
|
// =====================================================================================================================
|
|
27
29
|
// React Queue component implementation
|
|
@@ -106,9 +108,12 @@ const INITIAL_STATE = {
|
|
|
106
108
|
};
|
|
107
109
|
function Queue({ registerComponentApi, willProcessItem, processItem, didProcessItem, processItemError, onComplete,
|
|
108
110
|
//progressFeedback,
|
|
109
|
-
renderProgressFeedback, renderResultFeedback, clearAfterFinish = exports.defaultProps.clearAfterFinish, }) {
|
|
111
|
+
renderProgressFeedback, renderResultFeedback, clearAfterFinish = exports.defaultProps.clearAfterFinish, queueState: externalQueueState, dispatch: externalDispatch, }) {
|
|
110
112
|
const runningActionItemRef = (0, react_1.useRef)(new Set());
|
|
111
|
-
const [
|
|
113
|
+
const [internalQueueState, internalDispatch] = (0, react_1.useReducer)(queueReducer, INITIAL_STATE);
|
|
114
|
+
// Use external state if provided, otherwise use internal state
|
|
115
|
+
const queueState = externalQueueState !== null && externalQueueState !== void 0 ? externalQueueState : internalQueueState;
|
|
116
|
+
const dispatch = externalDispatch !== null && externalDispatch !== void 0 ? externalDispatch : internalDispatch;
|
|
112
117
|
let appContext = (0, AppContext_1.useAppContext)();
|
|
113
118
|
// --- This Queue API adds a single item to the queue
|
|
114
119
|
const enqueueItem = (0, misc_1.useEvent)((item) => {
|
|
@@ -282,3 +287,56 @@ renderProgressFeedback, renderResultFeedback, clearAfterFinish = exports.default
|
|
|
282
287
|
}, [doComplete, doSingle, prevQueue, queue]);
|
|
283
288
|
return null;
|
|
284
289
|
}
|
|
290
|
+
function QueueWithContextVar({ node, renderChild, extractValue, lookupEventHandler, registerComponentApi, }) {
|
|
291
|
+
const [queueState, dispatch] = (0, react_1.useReducer)(queueReducer, INITIAL_STATE);
|
|
292
|
+
// Compute context variables from queue state
|
|
293
|
+
const completedItems = (0, react_1.useMemo)(() => {
|
|
294
|
+
return Object.values(queueState.queueState).filter((item) => item.status === "completed");
|
|
295
|
+
}, [queueState.queueState]);
|
|
296
|
+
const queuedItems = (0, react_1.useMemo)(() => {
|
|
297
|
+
return Object.values(queueState.queueState);
|
|
298
|
+
}, [queueState.queueState]);
|
|
299
|
+
const $completedItems = completedItems;
|
|
300
|
+
const $queuedItems = queuedItems;
|
|
301
|
+
return ((0, jsx_runtime_1.jsx)(Queue, { queueState: queueState, dispatch: dispatch, registerComponentApi: registerComponentApi, renderResultFeedback: node.props.resultFeedback
|
|
302
|
+
? (completedItems, queuedItems) => {
|
|
303
|
+
return ((0, jsx_runtime_1.jsx)(container_helpers_1.MemoizedItem, { node: node.props.resultFeedback, contextVars: {
|
|
304
|
+
$completedItems: completedItems,
|
|
305
|
+
$queuedItems: queuedItems,
|
|
306
|
+
}, renderChild: renderChild }));
|
|
307
|
+
}
|
|
308
|
+
: undefined, renderProgressFeedback: node.props.progressFeedback
|
|
309
|
+
? (completedItems, queuedItems) => {
|
|
310
|
+
return ((0, jsx_runtime_1.jsx)(container_helpers_1.MemoizedItem, { node: node.props.progressFeedback, contextVars: {
|
|
311
|
+
$completedItems: completedItems,
|
|
312
|
+
$queuedItems: queuedItems,
|
|
313
|
+
}, renderChild: renderChild }));
|
|
314
|
+
}
|
|
315
|
+
: undefined, willProcessItem: lookupEventHandler("willProcess", {
|
|
316
|
+
context: {
|
|
317
|
+
$completedItems,
|
|
318
|
+
$queuedItems,
|
|
319
|
+
},
|
|
320
|
+
}), processItem: lookupEventHandler("process", {
|
|
321
|
+
signError: false,
|
|
322
|
+
context: {
|
|
323
|
+
$completedItems,
|
|
324
|
+
$queuedItems,
|
|
325
|
+
},
|
|
326
|
+
}), didProcessItem: lookupEventHandler("didProcess", {
|
|
327
|
+
context: {
|
|
328
|
+
$completedItems,
|
|
329
|
+
$queuedItems,
|
|
330
|
+
},
|
|
331
|
+
}), processItemError: lookupEventHandler("processError", {
|
|
332
|
+
context: {
|
|
333
|
+
$completedItems,
|
|
334
|
+
$queuedItems,
|
|
335
|
+
},
|
|
336
|
+
}), onComplete: lookupEventHandler("complete", {
|
|
337
|
+
context: {
|
|
338
|
+
$completedItems,
|
|
339
|
+
$queuedItems,
|
|
340
|
+
},
|
|
341
|
+
}), clearAfterFinish: extractValue.asOptionalBoolean(node.props.clearAfterFinish) }));
|
|
342
|
+
}
|
|
@@ -53,12 +53,14 @@ exports.TableOfContentsMd = (0, metadata_helpers_1.createMetadata)({
|
|
|
53
53
|
[`paddingLeft-${COMP_CHILD}-level-5`]: "$space-6",
|
|
54
54
|
[`paddingLeft-${COMP_CHILD}-level-6`]: "$space-6",
|
|
55
55
|
[`fontWeight-${COMP_CHILD}`]: "$fontWeight-bold",
|
|
56
|
-
[`fontWeight-${COMP_CHILD}-level-
|
|
57
|
-
[`fontWeight-${COMP_CHILD}-level-
|
|
58
|
-
[`fontWeight-${COMP_CHILD}-level-
|
|
59
|
-
[`fontWeight-${COMP_CHILD}-level-
|
|
56
|
+
[`fontWeight-${COMP_CHILD}-level-2`]: "$fontWeight-medium",
|
|
57
|
+
[`fontWeight-${COMP_CHILD}-level-3`]: "$fontWeight-normal",
|
|
58
|
+
[`fontWeight-${COMP_CHILD}-level-4`]: "$fontWeight-normal",
|
|
59
|
+
[`fontWeight-${COMP_CHILD}-level-5`]: "$fontWeight-normal",
|
|
60
|
+
[`fontWeight-${COMP_CHILD}-level-6`]: "$fontWeight-normal",
|
|
60
61
|
[`fontStyle-${COMP_CHILD}-level-6`]: "italic",
|
|
61
|
-
[`
|
|
62
|
+
[`textColor-${COMP_CHILD}--active`]: "$color-primary-400",
|
|
63
|
+
[`fontWeight-${COMP_CHILD}--active`]: "$fontWeight-bold",
|
|
62
64
|
},
|
|
63
65
|
});
|
|
64
66
|
function IndexAwareTableOfContents(props) {
|
|
@@ -43,8 +43,8 @@ const react_compose_refs_1 = require("@radix-ui/react-compose-refs");
|
|
|
43
43
|
const classnames_1 = __importDefault(require("classnames"));
|
|
44
44
|
const Dialog = __importStar(require("@radix-ui/react-dialog"));
|
|
45
45
|
const InspectorDialog_module_scss_1 = __importDefault(require("./InspectorDialog.module.scss"));
|
|
46
|
-
const xmlui_1 = require("xmlui");
|
|
47
46
|
const framer_motion_1 = require("framer-motion");
|
|
47
|
+
const ThemeContext_1 = require("../theming/ThemeContext");
|
|
48
48
|
// =====================================================================================================================
|
|
49
49
|
// React component definition
|
|
50
50
|
const MotionContent = framer_motion_1.motion.create(Dialog.Content);
|
|
@@ -88,7 +88,7 @@ function durationToSeconds(durationString) {
|
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
90
|
exports.InspectorDialog = react_1.default.forwardRef(({ children, style, isOpen, setIsOpen, clickPosition }, ref) => {
|
|
91
|
-
const { root, getThemeVar } = (0,
|
|
91
|
+
const { root, getThemeVar } = (0, ThemeContext_1.useTheme)();
|
|
92
92
|
const modalRef = (0, react_1.useRef)(null);
|
|
93
93
|
const composedRef = ref ? (0, react_compose_refs_1.composeRefs)(ref, modalRef) : modalRef;
|
|
94
94
|
const [rendered, setRendered] = (0, react_1.useState)(true);
|
|
@@ -43,6 +43,14 @@ function collectParams(expression) {
|
|
|
43
43
|
function asOptionalBoolean(value, defValue) {
|
|
44
44
|
if (value === undefined || value === null)
|
|
45
45
|
return defValue;
|
|
46
|
+
// Empty array returns false
|
|
47
|
+
if (Array.isArray(value) && value.length === 0) {
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
50
|
+
// Empty object returns false
|
|
51
|
+
if (typeof value === "object" && value !== null && !Array.isArray(value) && Object.keys(value).length === 0) {
|
|
52
|
+
return false;
|
|
53
|
+
}
|
|
46
54
|
if (typeof value === "number") {
|
|
47
55
|
return value !== 0;
|
|
48
56
|
}
|
|
@@ -64,7 +72,7 @@ function asOptionalBoolean(value, defValue) {
|
|
|
64
72
|
if (typeof value === "boolean") {
|
|
65
73
|
return value;
|
|
66
74
|
}
|
|
67
|
-
|
|
75
|
+
return true;
|
|
68
76
|
}
|
|
69
77
|
// This function represents the extractor function we pass to extractValue
|
|
70
78
|
function createValueExtractor(state, appContext, referenceTrackedApi, memoedVarsRef) {
|
|
@@ -244,10 +244,12 @@ function evalBinaryAsync(evaluator, thisStack, expr, evalContext, thread) {
|
|
|
244
244
|
const l = yield completeExprValue(expr.left, thread);
|
|
245
245
|
if (expr.op === "&&" && !l) {
|
|
246
246
|
(0, eval_tree_common_1.setExprValue)(expr, { value: l }, thread);
|
|
247
|
+
thisStack.push(l);
|
|
247
248
|
return l;
|
|
248
249
|
}
|
|
249
250
|
if (expr.op === "||" && l) {
|
|
250
251
|
(0, eval_tree_common_1.setExprValue)(expr, { value: l }, thread);
|
|
252
|
+
thisStack.push(l);
|
|
251
253
|
return l;
|
|
252
254
|
}
|
|
253
255
|
yield evaluator(thisStack, expr.right, evalContext, thread);
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.uint8ArrayToBase64 = uint8ArrayToBase64;
|
|
4
4
|
exports.encodeToBase64 = encodeToBase64;
|
|
5
|
+
exports.base64ToUint8Array = base64ToUint8Array;
|
|
5
6
|
exports.decodeFromBase64 = decodeFromBase64;
|
|
6
7
|
/**
|
|
7
8
|
* Convert Uint8Array to base64 string without using btoa.
|
|
@@ -60,6 +61,7 @@ function encodeToBase64(value) {
|
|
|
60
61
|
}
|
|
61
62
|
/**
|
|
62
63
|
* Convert base64 string to Uint8Array without using atob.
|
|
64
|
+
* Use this for binary data (e.g., compressed data).
|
|
63
65
|
*/
|
|
64
66
|
function base64ToUint8Array(base64) {
|
|
65
67
|
const base64abc = [
|
|
@@ -15,6 +15,7 @@ const ParameterParser_1 = require("../script-runner/ParameterParser");
|
|
|
15
15
|
const eval_tree_sync_1 = require("../script-runner/eval-tree-sync");
|
|
16
16
|
const LruCache_1 = require("../utils/LruCache");
|
|
17
17
|
const descriptorHelper_1 = require("../descriptorHelper");
|
|
18
|
+
const valueExtractor_1 = require("../rendering/valueExtractor");
|
|
18
19
|
/**
|
|
19
20
|
* Extract the value of the specified parameter from the given view container state
|
|
20
21
|
* @param state The state of the view container
|
|
@@ -159,7 +160,7 @@ function shouldKeep(when, componentState, appContext) {
|
|
|
159
160
|
if (when === undefined) {
|
|
160
161
|
return true;
|
|
161
162
|
}
|
|
162
|
-
return extractParam(componentState, when, appContext, true);
|
|
163
|
+
return (0, valueExtractor_1.asOptionalBoolean)(extractParam(componentState, when, appContext, true));
|
|
163
164
|
}
|
|
164
165
|
/**
|
|
165
166
|
* Resolves props that can either be regular properties or URL resources.
|
|
@@ -37,6 +37,7 @@ exports.toHashObject = toHashObject;
|
|
|
37
37
|
exports.findByField = findByField;
|
|
38
38
|
exports.distinct = distinct;
|
|
39
39
|
exports.asyncThrottle = asyncThrottle;
|
|
40
|
+
exports.debounce = debounce;
|
|
40
41
|
const react_1 = require("react");
|
|
41
42
|
const lodash_es_1 = require("lodash-es");
|
|
42
43
|
const date_fns_1 = require("date-fns");
|
|
@@ -493,3 +494,46 @@ function asyncThrottle(func, wait, options) {
|
|
|
493
494
|
throttled(resolve, reject, args);
|
|
494
495
|
});
|
|
495
496
|
}
|
|
497
|
+
/**
|
|
498
|
+
* Registry to store debounced function timers and their captured arguments by key
|
|
499
|
+
*/
|
|
500
|
+
const debounceRegistry = new Map();
|
|
501
|
+
/**
|
|
502
|
+
* Creates a debounced function that delays invoking the provided function until after
|
|
503
|
+
* the specified delay in milliseconds has elapsed since the last time it was invoked.
|
|
504
|
+
*
|
|
505
|
+
* When called from XMLUI markup, it automatically generates a stable key based on the
|
|
506
|
+
* call site to ensure proper debouncing across multiple invocations.
|
|
507
|
+
*
|
|
508
|
+
* @param delayMs The number of milliseconds to delay execution
|
|
509
|
+
* @param func The function to debounce
|
|
510
|
+
* @param args Optional arguments to pass to the function when it executes
|
|
511
|
+
* @returns void (executes the function after the delay)
|
|
512
|
+
*
|
|
513
|
+
* @example
|
|
514
|
+
* // In XMLUI markup with value capture:
|
|
515
|
+
* <TextBox onDidChange="e => debounce(500, () => console.log('value:', e), e)" />
|
|
516
|
+
*
|
|
517
|
+
* @example
|
|
518
|
+
* // In XMLUI markup with inline function:
|
|
519
|
+
* <TextBox onDidChange="e => debounce(500, (val) => console.log('value:', val), e)" />
|
|
520
|
+
*/
|
|
521
|
+
function debounce(delayMs, func, ...args) {
|
|
522
|
+
// Generate a unique key for this debounce call based on the function source
|
|
523
|
+
// This ensures that the same event handler in markup reuses the same timer
|
|
524
|
+
const key = func.toString();
|
|
525
|
+
// Clear existing timeout for this key
|
|
526
|
+
const existing = debounceRegistry.get(key);
|
|
527
|
+
if (existing !== undefined) {
|
|
528
|
+
clearTimeout(existing.timeoutId);
|
|
529
|
+
}
|
|
530
|
+
// Set new timeout with captured arguments
|
|
531
|
+
const timeoutId = setTimeout(() => {
|
|
532
|
+
const entry = debounceRegistry.get(key);
|
|
533
|
+
if (entry) {
|
|
534
|
+
func(...entry.args);
|
|
535
|
+
debounceRegistry.delete(key);
|
|
536
|
+
}
|
|
537
|
+
}, delayMs);
|
|
538
|
+
debounceRegistry.set(key, { timeoutId, args });
|
|
539
|
+
}
|
|
@@ -6,14 +6,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.start = start;
|
|
7
7
|
const vscode_languageserver_1 = require("vscode-languageserver");
|
|
8
8
|
const vscode_languageserver_textdocument_1 = require("vscode-languageserver-textdocument");
|
|
9
|
-
const
|
|
9
|
+
const xmlui_metadata_generated_js_1 = __importDefault(require("./xmlui-metadata-generated.js"));
|
|
10
10
|
const completion_1 = require("./services/completion");
|
|
11
11
|
const hover_1 = require("./services/hover");
|
|
12
12
|
const format_1 = require("./services/format");
|
|
13
13
|
const parser_1 = require("../parsers/xmlui-parser/parser");
|
|
14
14
|
const metadata_utils_1 = require("./services/common/metadata-utils");
|
|
15
15
|
const diagnostic_1 = require("./services/diagnostic");
|
|
16
|
-
const metaByComp =
|
|
16
|
+
const metaByComp = xmlui_metadata_generated_js_1.default;
|
|
17
17
|
const metadataProvider = new metadata_utils_1.MetadataProvider(metaByComp);
|
|
18
18
|
function start(connection) {
|
|
19
19
|
// Also include all preview / proposed LSP features.
|