slexkit 0.3.0 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +30 -0
- package/README.md +4 -3
- package/README.zh-CN.md +4 -3
- package/dist/ai/llms-components.txt +2 -1
- package/dist/ai/llms-full.txt +85 -42
- package/dist/ai/llms-runtime.txt +11 -12
- package/dist/ai/llms.txt +1 -1
- package/dist/ai/slexkit-ai-manifest.json +77 -73
- package/dist/base.css +0 -46
- package/dist/components/checkbox.js +1 -0
- package/dist/components/choice.css +2 -2
- package/dist/components/display.css +1 -1
- package/dist/components/index.js +56 -153
- package/dist/components/input.css +53 -119
- package/dist/components/input.js +33 -143
- package/dist/components/radio-group.js +1 -0
- package/dist/components/select.css +0 -6
- package/dist/components/slider.css +27 -18
- package/dist/components/specs.js +2 -1
- package/dist/components/switch.css +3 -3
- package/dist/components/switch.js +1 -0
- package/dist/components/text-input.css +21 -90
- package/dist/components/text.js +12 -0
- package/dist/components/tooling.css +0 -1
- package/dist/runtime.cjs +67 -28
- package/dist/runtime.js +67 -28
- package/dist/slexkit.cjs +123 -181
- package/dist/slexkit.css +54 -167
- package/dist/slexkit.js +123 -181
- package/dist/types/engine/types.d.ts +1 -1
- package/dist/types/version.d.ts +2 -2
- package/dist/umd/slexkit.tooling.umd.js +122 -181
- package/dist/umd/slexkit.umd.js +123 -181
- package/package.json +3 -2
- package/skills/slexkit-host-integration/SKILL.md +1 -1
- package/src/components/svelte/display/Text.svelte +14 -1
- package/src/components/svelte/input/Checkbox.svelte +1 -1
- package/src/components/svelte/input/Input.svelte +0 -110
- package/src/components/svelte/input/RadioGroup.svelte +1 -1
- package/src/components/svelte/input/Switch.svelte +1 -1
- package/src/styles/components/choice.css +2 -2
- package/src/styles/components/select.css +0 -6
- package/src/styles/components/slider.css +27 -18
- package/src/styles/components/switch.css +3 -3
- package/src/styles/components/text-input.css +21 -90
- package/src/styles/display.css +1 -1
- package/src/styles/layout.css +0 -46
- package/src/styles/tooling.css +0 -1
|
@@ -493,19 +493,31 @@
|
|
|
493
493
|
function createComponentAccessor(read) {
|
|
494
494
|
const subscribers = new Set;
|
|
495
495
|
let current = read();
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
496
|
+
let stopEffect;
|
|
497
|
+
const start = () => {
|
|
498
|
+
if (stopEffect)
|
|
499
|
+
return;
|
|
500
|
+
stopEffect = createEffect(() => {
|
|
501
501
|
current = read();
|
|
502
|
-
for (const subscriber of subscribers)
|
|
502
|
+
for (const subscriber of Array.from(subscribers))
|
|
503
503
|
subscriber(current);
|
|
504
504
|
flushDom?.();
|
|
505
505
|
});
|
|
506
|
+
};
|
|
507
|
+
const accessor = () => current;
|
|
508
|
+
accessor.subscribe = (run) => {
|
|
509
|
+
const wasIdle = subscribers.size === 0;
|
|
510
|
+
subscribers.add(run);
|
|
511
|
+
if (wasIdle)
|
|
512
|
+
start();
|
|
513
|
+
else
|
|
514
|
+
run(current);
|
|
506
515
|
return () => {
|
|
507
516
|
subscribers.delete(run);
|
|
508
|
-
|
|
517
|
+
if (subscribers.size === 0) {
|
|
518
|
+
stopEffect?.();
|
|
519
|
+
stopEffect = undefined;
|
|
520
|
+
}
|
|
509
521
|
};
|
|
510
522
|
};
|
|
511
523
|
return accessor;
|
|
@@ -786,6 +798,9 @@
|
|
|
786
798
|
const mode = getComponentStateMode(type);
|
|
787
799
|
return mode === "value" || mode === "checked" || mode === "enabled";
|
|
788
800
|
}
|
|
801
|
+
function isReadableComponent(type) {
|
|
802
|
+
return getComponentStateMode(type) === "readable";
|
|
803
|
+
}
|
|
789
804
|
function isStatefulComponent(type) {
|
|
790
805
|
return getComponentStateMode(type) !== "none";
|
|
791
806
|
}
|
|
@@ -902,7 +917,10 @@
|
|
|
902
917
|
function ensureComponentState(name, type, components, componentTypes) {
|
|
903
918
|
if (!components[name])
|
|
904
919
|
components[name] = {};
|
|
905
|
-
componentTypes[name]
|
|
920
|
+
const previousType = componentTypes[name] ?? "";
|
|
921
|
+
if (!(isWritableComponent(previousType) && isReadableComponent(type))) {
|
|
922
|
+
componentTypes[name] = type;
|
|
923
|
+
}
|
|
906
924
|
return components[name];
|
|
907
925
|
}
|
|
908
926
|
function syncReadableComponentProp(type, state, propName, value) {
|
|
@@ -930,6 +948,9 @@
|
|
|
930
948
|
function syncComponentProps(type, name, props, components, componentTypes) {
|
|
931
949
|
if (!name || !isStatefulComponent(type))
|
|
932
950
|
return;
|
|
951
|
+
const previousType = componentTypes[name] ?? "";
|
|
952
|
+
if (isWritableComponent(previousType) && isReadableComponent(type))
|
|
953
|
+
return;
|
|
933
954
|
const state = ensureComponentState(name, type, components, componentTypes);
|
|
934
955
|
if (type === "input" && typeof props.type === "string") {
|
|
935
956
|
assignInputType(state, props.type);
|
|
@@ -994,7 +1015,7 @@
|
|
|
994
1015
|
function warnDuplicateState(ns, name, currentType, currentPath, previous) {
|
|
995
1016
|
console.warn(`[SlexKit][${ns}] Component state '${name}' is declared more than once at ${previous.path} and ${currentPath}; state is shared by namespace and component name.`);
|
|
996
1017
|
if (previous.type !== currentType) {
|
|
997
|
-
console.warn(`[SlexKit][${ns}] Component state '${name}' is used by multiple component types (${previous.type}, ${currentType});
|
|
1018
|
+
console.warn(`[SlexKit][${ns}] Component state '${name}' is used by multiple component types (${previous.type}, ${currentType}); use distinct names when components should not share state.`);
|
|
998
1019
|
}
|
|
999
1020
|
}
|
|
1000
1021
|
function dynamicStateBinding(type, props) {
|
|
@@ -1006,6 +1027,9 @@
|
|
|
1006
1027
|
return previousType === "input" && currentType === "slider" || previousType === "slider" && currentType === "input";
|
|
1007
1028
|
}
|
|
1008
1029
|
function shouldWarnDuplicateState(currentType, currentBinding, previous) {
|
|
1030
|
+
if (isReadableComponent(previous.type) && isReadableComponent(currentType)) {
|
|
1031
|
+
return false;
|
|
1032
|
+
}
|
|
1009
1033
|
if (currentBinding && previous.stateBinding === currentBinding && isMirroredValueControlPair(previous.type, currentType)) {
|
|
1010
1034
|
return false;
|
|
1011
1035
|
}
|
|
@@ -1344,9 +1368,10 @@
|
|
|
1344
1368
|
const renderer = getRenderer(type);
|
|
1345
1369
|
if (!renderer)
|
|
1346
1370
|
return;
|
|
1347
|
-
const
|
|
1348
|
-
|
|
1349
|
-
|
|
1371
|
+
const doc = container.ownerDocument || document;
|
|
1372
|
+
const startAnchor = doc.createComment(`slexkit-for:${fullKey}:start`);
|
|
1373
|
+
const endAnchor = doc.createComment(`slexkit-for:${fullKey}:end`);
|
|
1374
|
+
container.append(startAnchor, endAnchor);
|
|
1350
1375
|
const evalCtx = buildComponentEvalContext(g, components, componentTypes, api, forCtx);
|
|
1351
1376
|
const items = createMemo(() => trackForCollection(evalRead(props.$for, evalCtx, ns, `${fullKey}:$for`)));
|
|
1352
1377
|
const $keyProp = props.$key;
|
|
@@ -1359,8 +1384,10 @@
|
|
|
1359
1384
|
disposedSlots.add(slot);
|
|
1360
1385
|
leavingSlots.delete(slot);
|
|
1361
1386
|
callHook(g, name, "onUnmount");
|
|
1362
|
-
|
|
1363
|
-
|
|
1387
|
+
if (slot.el) {
|
|
1388
|
+
disposeComponent(slot.el);
|
|
1389
|
+
slot.el.remove();
|
|
1390
|
+
}
|
|
1364
1391
|
if (slot.dispose)
|
|
1365
1392
|
slot.dispose();
|
|
1366
1393
|
};
|
|
@@ -1385,12 +1412,16 @@
|
|
|
1385
1412
|
}
|
|
1386
1413
|
}
|
|
1387
1414
|
for (const slot of deletedSlots) {
|
|
1388
|
-
container.appendChild(slot.el);
|
|
1389
1415
|
leavingSlots.add(slot);
|
|
1416
|
+
if (!slot.el) {
|
|
1417
|
+
disposeSlot(slot);
|
|
1418
|
+
continue;
|
|
1419
|
+
}
|
|
1390
1420
|
applyLeaveAnimation(slot.el, slot.props, () => {
|
|
1391
1421
|
disposeSlot(slot);
|
|
1392
1422
|
});
|
|
1393
1423
|
}
|
|
1424
|
+
let cursor = startAnchor;
|
|
1394
1425
|
arr.forEach((item, index) => {
|
|
1395
1426
|
item = asReactiveValue(item, g);
|
|
1396
1427
|
const keyVal = newKeys[index];
|
|
@@ -1418,20 +1449,22 @@
|
|
|
1418
1449
|
const indexSignal = createSignal(index);
|
|
1419
1450
|
const revisionSignal = createSignal(0);
|
|
1420
1451
|
slot = renderAndMountSlot(item, index, keyVal, indexSignal, revisionSignal, renderer, type, name, props, container, g, components, componentTypes, api, forCtx, ns, fullKey, options);
|
|
1421
|
-
if (slot.el) {
|
|
1422
|
-
|
|
1423
|
-
|
|
1452
|
+
if (!slot.el) {
|
|
1453
|
+
disposeSlot(slot);
|
|
1454
|
+
return;
|
|
1424
1455
|
}
|
|
1456
|
+
applyEnterAnimation(slot.el, slot.props);
|
|
1457
|
+
callHook(g, name, "onMount");
|
|
1425
1458
|
slotMap.set(keyVal, slot);
|
|
1426
1459
|
}
|
|
1427
|
-
const
|
|
1428
|
-
if (slot.el &&
|
|
1429
|
-
|
|
1460
|
+
const nextChild = cursor.nextSibling;
|
|
1461
|
+
if (slot.el && nextChild !== slot.el) {
|
|
1462
|
+
container.insertBefore(slot.el, nextChild ?? endAnchor);
|
|
1463
|
+
}
|
|
1464
|
+
if (slot.el) {
|
|
1465
|
+
cursor = slot.el;
|
|
1430
1466
|
}
|
|
1431
1467
|
});
|
|
1432
|
-
while (forWrapper.children.length > arr.length) {
|
|
1433
|
-
forWrapper.lastChild.remove();
|
|
1434
|
-
}
|
|
1435
1468
|
});
|
|
1436
1469
|
onCleanup(() => {
|
|
1437
1470
|
for (const slot of Array.from(slotMap.values()))
|
|
@@ -1439,7 +1472,8 @@
|
|
|
1439
1472
|
slotMap.clear();
|
|
1440
1473
|
for (const slot of Array.from(leavingSlots))
|
|
1441
1474
|
disposeSlot(slot);
|
|
1442
|
-
|
|
1475
|
+
startAnchor.remove();
|
|
1476
|
+
endAnchor.remove();
|
|
1443
1477
|
});
|
|
1444
1478
|
}
|
|
1445
1479
|
function renderNormalNode(fullKey, props, container, g, components, componentTypes, api, forCtx, ns, options) {
|
|
@@ -2425,7 +2459,11 @@ ${parseSource}
|
|
|
2425
2459
|
return Object.keys(value).some((key) => key.includes(":"));
|
|
2426
2460
|
}
|
|
2427
2461
|
function bareLayoutFromSource(value) {
|
|
2428
|
-
const
|
|
2462
|
+
const layout = { ...value };
|
|
2463
|
+
delete layout.slex;
|
|
2464
|
+
delete layout.namespace;
|
|
2465
|
+
delete layout.g;
|
|
2466
|
+
delete layout.layout;
|
|
2429
2467
|
return layout;
|
|
2430
2468
|
}
|
|
2431
2469
|
function isStateOnlySource(value) {
|
|
@@ -11493,6 +11531,7 @@ ${pad}}`;
|
|
|
11493
11531
|
reset(label2);
|
|
11494
11532
|
reset(span);
|
|
11495
11533
|
template_effect(($0, $1) => {
|
|
11534
|
+
set_attribute2(label2, "data-disabled", get2(p).disabled ? "true" : undefined);
|
|
11496
11535
|
input.disabled = !!get2(p).disabled;
|
|
11497
11536
|
set_attribute2(input, "data-state", get2(checked) ? "checked" : "unchecked");
|
|
11498
11537
|
set_attribute2(input, "aria-label", $0);
|
|
@@ -11568,6 +11607,7 @@ ${pad}}`;
|
|
|
11568
11607
|
reset(span);
|
|
11569
11608
|
template_effect(($0, $1) => {
|
|
11570
11609
|
set_attribute2(label2, "data-state", get2(enabled) ? "on" : "off");
|
|
11610
|
+
set_attribute2(label2, "data-disabled", get2(p).disabled ? "true" : undefined);
|
|
11571
11611
|
input.disabled = !!get2(p).disabled;
|
|
11572
11612
|
set_attribute2(input, "aria-label", $0);
|
|
11573
11613
|
set_text(text_1, $1);
|
|
@@ -11588,26 +11628,11 @@ ${pad}}`;
|
|
|
11588
11628
|
var nextInputId = 0;
|
|
11589
11629
|
var root_14 = from_html(`<label class="slex-input-label"> </label>`);
|
|
11590
11630
|
var root_2 = from_html(`<span class="slex-input-unit" aria-hidden="true"> </span>`);
|
|
11591
|
-
var root_33 = from_html(`<
|
|
11592
|
-
var root_4 = from_html(`<div class="slex-input-
|
|
11593
|
-
var
|
|
11594
|
-
var root8 = from_html(`<div class="slex-input-field"><!> <div class="slex-input-control"><input class="slex-input"/> <!> <!></div> <!> <!></div>`);
|
|
11631
|
+
var root_33 = from_html(`<div class="slex-input-description"> </div>`);
|
|
11632
|
+
var root_4 = from_html(`<div class="slex-input-error" role="alert"> </div>`);
|
|
11633
|
+
var root8 = from_html(`<div class="slex-input-field"><!> <div class="slex-input-control"><input class="slex-input"/> <!></div> <!> <!></div>`);
|
|
11595
11634
|
function Input($$anchor, $$props) {
|
|
11596
11635
|
push($$props, true);
|
|
11597
|
-
const engineeringPrefixFactors = {
|
|
11598
|
-
p: 0.000000000001,
|
|
11599
|
-
n: 0.000000001,
|
|
11600
|
-
u: 0.000001,
|
|
11601
|
-
"µ": 0.000001,
|
|
11602
|
-
"碌": 0.000001,
|
|
11603
|
-
m: 0.001,
|
|
11604
|
-
k: 1000,
|
|
11605
|
-
K: 1000,
|
|
11606
|
-
M: 1e6,
|
|
11607
|
-
meg: 1e6,
|
|
11608
|
-
G: 1e9,
|
|
11609
|
-
T: 1000000000000
|
|
11610
|
-
};
|
|
11611
11636
|
let p = state(proxy({}));
|
|
11612
11637
|
let value = state("");
|
|
11613
11638
|
const fallbackId = `slex-input-${++nextInputId}`;
|
|
@@ -11619,8 +11644,6 @@ ${pad}}`;
|
|
|
11619
11644
|
const readonly = user_derived(() => bool(get2(p).readonly) || bool(get2(p).readOnly));
|
|
11620
11645
|
const required = user_derived(() => bool(get2(p).required));
|
|
11621
11646
|
const invalid2 = user_derived(() => bool(get2(p).invalid) || !!get2(errorText));
|
|
11622
|
-
const steppable = user_derived(isSteppableInput);
|
|
11623
|
-
const controls = user_derived(() => get2(steppable) && get2(p).controls !== false && get2(p).controls !== "false");
|
|
11624
11647
|
const componentId = user_derived(() => safeId($$props.componentName));
|
|
11625
11648
|
const inputId = user_derived(() => text2(get2(p).id) || (get2(componentId) ? `slex-input-${get2(componentId)}` : fallbackId));
|
|
11626
11649
|
const descriptionId = user_derived(() => `${get2(inputId)}-description`);
|
|
@@ -11631,10 +11654,6 @@ ${pad}}`;
|
|
|
11631
11654
|
get2(descriptionText) ? get2(descriptionId) : "",
|
|
11632
11655
|
get2(errorText) ? get2(errorId) : ""
|
|
11633
11656
|
].filter(Boolean).join(" "));
|
|
11634
|
-
const numericValue = user_derived(readNumericValue);
|
|
11635
|
-
const controlLabel = user_derived(() => get2(labelText) || text2(get2(p).placeholder) || $$props.componentName || "input");
|
|
11636
|
-
const decrementDisabled = user_derived(() => !canStep(-1));
|
|
11637
|
-
const incrementDisabled = user_derived(() => !canStep(1));
|
|
11638
11657
|
user_effect(() => bindPropStore($$props.props, (next2) => {
|
|
11639
11658
|
set(p, next2, true);
|
|
11640
11659
|
set(value, text2(next2.value), true);
|
|
@@ -11645,72 +11664,6 @@ ${pad}}`;
|
|
|
11645
11664
|
function inputType() {
|
|
11646
11665
|
return text2(get2(p).type, "text") === "engineering" ? "text" : text2(get2(p).type, "text");
|
|
11647
11666
|
}
|
|
11648
|
-
function isSteppableInput() {
|
|
11649
|
-
const kind = text2(get2(p).type, "text");
|
|
11650
|
-
return kind === "number" || kind === "engineering" || get2(p).min !== undefined || get2(p).max !== undefined || get2(p).step !== undefined;
|
|
11651
|
-
}
|
|
11652
|
-
function numericProp(input) {
|
|
11653
|
-
if (input === undefined || input === null || input === "")
|
|
11654
|
-
return;
|
|
11655
|
-
const next2 = Number(input);
|
|
11656
|
-
return Number.isFinite(next2) ? next2 : undefined;
|
|
11657
|
-
}
|
|
11658
|
-
function stepSize() {
|
|
11659
|
-
const next2 = numericProp(get2(p).step);
|
|
11660
|
-
if (next2 !== undefined && next2 > 0)
|
|
11661
|
-
return next2;
|
|
11662
|
-
if (text2(get2(p).type, "text") !== "engineering")
|
|
11663
|
-
return 1;
|
|
11664
|
-
const parsed = parseEngineeringNumber(get2(value));
|
|
11665
|
-
if (!parsed.valid || !parsed.prefix)
|
|
11666
|
-
return 1;
|
|
11667
|
-
return engineeringPrefixFactors[parsed.prefix] ?? 1;
|
|
11668
|
-
}
|
|
11669
|
-
function readNumericValue() {
|
|
11670
|
-
if (text2(get2(p).type, "text") === "engineering") {
|
|
11671
|
-
const parsed = parseEngineeringNumber(get2(value));
|
|
11672
|
-
return parsed.valid && parsed.number !== null ? parsed.number : null;
|
|
11673
|
-
}
|
|
11674
|
-
const next2 = Number(get2(value));
|
|
11675
|
-
return Number.isFinite(next2) ? next2 : null;
|
|
11676
|
-
}
|
|
11677
|
-
function clamp(next2) {
|
|
11678
|
-
const min = numericProp(get2(p).min);
|
|
11679
|
-
const max = numericProp(get2(p).max);
|
|
11680
|
-
let clamped = next2;
|
|
11681
|
-
if (min !== undefined)
|
|
11682
|
-
clamped = Math.max(min, clamped);
|
|
11683
|
-
if (max !== undefined)
|
|
11684
|
-
clamped = Math.min(max, clamped);
|
|
11685
|
-
return clamped;
|
|
11686
|
-
}
|
|
11687
|
-
function canStep(direction) {
|
|
11688
|
-
if (!get2(controls) || get2(disabled) || get2(readonly) || get2(numericValue) === null)
|
|
11689
|
-
return false;
|
|
11690
|
-
return clamp(get2(numericValue) + direction * stepSize()) !== get2(numericValue);
|
|
11691
|
-
}
|
|
11692
|
-
function formatSteppedValue(next2) {
|
|
11693
|
-
if (text2(get2(p).type, "text") !== "engineering")
|
|
11694
|
-
return text2(next2);
|
|
11695
|
-
const parsed = parseEngineeringNumber(get2(value));
|
|
11696
|
-
if (!parsed.valid)
|
|
11697
|
-
return text2(next2);
|
|
11698
|
-
const factor = parsed.prefix ? engineeringPrefixFactors[parsed.prefix] : undefined;
|
|
11699
|
-
const visibleNumber = factor ? next2 / factor : next2;
|
|
11700
|
-
return `${formatNumber2(visibleNumber)}${parsed.prefix}${parsed.unit}`;
|
|
11701
|
-
}
|
|
11702
|
-
function formatNumber2(next2) {
|
|
11703
|
-
return text2(Number(next2.toPrecision(12)));
|
|
11704
|
-
}
|
|
11705
|
-
function emitValue(nextValue) {
|
|
11706
|
-
set(value, nextValue, true);
|
|
11707
|
-
emit($$props.ctx, "change", text2(get2(p).type, "text") === "engineering" ? parseEngineeringNumber(get2(value)) : get2(value));
|
|
11708
|
-
}
|
|
11709
|
-
function stepBy(direction) {
|
|
11710
|
-
if (!canStep(direction) || get2(numericValue) === null)
|
|
11711
|
-
return;
|
|
11712
|
-
emitValue(formatSteppedValue(clamp(get2(numericValue) + direction * stepSize())));
|
|
11713
|
-
}
|
|
11714
11667
|
function update2(event2) {
|
|
11715
11668
|
if (get2(disabled) || get2(readonly))
|
|
11716
11669
|
return;
|
|
@@ -11736,9 +11689,9 @@ ${pad}}`;
|
|
|
11736
11689
|
});
|
|
11737
11690
|
}
|
|
11738
11691
|
var div_1 = sibling(node, 2);
|
|
11739
|
-
var
|
|
11740
|
-
remove_input_defaults(
|
|
11741
|
-
var node_1 = sibling(
|
|
11692
|
+
var input = child(div_1);
|
|
11693
|
+
remove_input_defaults(input);
|
|
11694
|
+
var node_1 = sibling(input, 2);
|
|
11742
11695
|
{
|
|
11743
11696
|
var consequent_1 = ($$anchor2) => {
|
|
11744
11697
|
var span = root_2();
|
|
@@ -11752,33 +11705,11 @@ ${pad}}`;
|
|
|
11752
11705
|
$$render(consequent_1);
|
|
11753
11706
|
});
|
|
11754
11707
|
}
|
|
11755
|
-
var node_2 = sibling(node_1, 2);
|
|
11756
|
-
{
|
|
11757
|
-
var consequent_2 = ($$anchor2) => {
|
|
11758
|
-
var span_1 = root_33();
|
|
11759
|
-
var button = child(span_1);
|
|
11760
|
-
var button_1 = sibling(button, 2);
|
|
11761
|
-
reset(span_1);
|
|
11762
|
-
template_effect(() => {
|
|
11763
|
-
set_attribute2(button, "aria-label", `Increase ${get2(controlLabel)}`);
|
|
11764
|
-
button.disabled = get2(incrementDisabled);
|
|
11765
|
-
set_attribute2(button_1, "aria-label", `Decrease ${get2(controlLabel)}`);
|
|
11766
|
-
button_1.disabled = get2(decrementDisabled);
|
|
11767
|
-
});
|
|
11768
|
-
delegated("click", button, () => stepBy(1));
|
|
11769
|
-
delegated("click", button_1, () => stepBy(-1));
|
|
11770
|
-
append($$anchor2, span_1);
|
|
11771
|
-
};
|
|
11772
|
-
if_block(node_2, ($$render) => {
|
|
11773
|
-
if (get2(controls))
|
|
11774
|
-
$$render(consequent_2);
|
|
11775
|
-
});
|
|
11776
|
-
}
|
|
11777
11708
|
reset(div_1);
|
|
11778
|
-
var
|
|
11709
|
+
var node_2 = sibling(div_1, 2);
|
|
11779
11710
|
{
|
|
11780
|
-
var
|
|
11781
|
-
var div_2 =
|
|
11711
|
+
var consequent_2 = ($$anchor2) => {
|
|
11712
|
+
var div_2 = root_33();
|
|
11782
11713
|
var text_3 = child(div_2, true);
|
|
11783
11714
|
reset(div_2);
|
|
11784
11715
|
template_effect(() => {
|
|
@@ -11787,15 +11718,15 @@ ${pad}}`;
|
|
|
11787
11718
|
});
|
|
11788
11719
|
append($$anchor2, div_2);
|
|
11789
11720
|
};
|
|
11790
|
-
if_block(
|
|
11721
|
+
if_block(node_2, ($$render) => {
|
|
11791
11722
|
if (get2(descriptionText))
|
|
11792
|
-
$$render(
|
|
11723
|
+
$$render(consequent_2);
|
|
11793
11724
|
});
|
|
11794
11725
|
}
|
|
11795
|
-
var
|
|
11726
|
+
var node_3 = sibling(node_2, 2);
|
|
11796
11727
|
{
|
|
11797
|
-
var
|
|
11798
|
-
var div_3 =
|
|
11728
|
+
var consequent_3 = ($$anchor2) => {
|
|
11729
|
+
var div_3 = root_4();
|
|
11799
11730
|
var text_4 = child(div_3, true);
|
|
11800
11731
|
reset(div_3);
|
|
11801
11732
|
template_effect(() => {
|
|
@@ -11804,9 +11735,9 @@ ${pad}}`;
|
|
|
11804
11735
|
});
|
|
11805
11736
|
append($$anchor2, div_3);
|
|
11806
11737
|
};
|
|
11807
|
-
if_block(
|
|
11738
|
+
if_block(node_3, ($$render) => {
|
|
11808
11739
|
if (get2(errorText))
|
|
11809
|
-
$$render(
|
|
11740
|
+
$$render(consequent_3);
|
|
11810
11741
|
});
|
|
11811
11742
|
}
|
|
11812
11743
|
reset(div);
|
|
@@ -11815,21 +11746,20 @@ ${pad}}`;
|
|
|
11815
11746
|
set_attribute2(div, "data-required", get2(required) ? "true" : undefined);
|
|
11816
11747
|
set_attribute2(div, "data-readonly", get2(readonly) ? "true" : undefined);
|
|
11817
11748
|
set_attribute2(div_1, "data-has-unit", get2(unitText) ? "true" : undefined);
|
|
11818
|
-
set_attribute2(
|
|
11819
|
-
set_attribute2(
|
|
11820
|
-
set_attribute2(
|
|
11821
|
-
set_attribute2(
|
|
11822
|
-
set_attribute2(
|
|
11823
|
-
|
|
11824
|
-
|
|
11825
|
-
|
|
11826
|
-
|
|
11827
|
-
set_attribute2(
|
|
11828
|
-
set_attribute2(
|
|
11829
|
-
set_attribute2(
|
|
11830
|
-
set_attribute2(
|
|
11831
|
-
set_attribute2(
|
|
11832
|
-
set_attribute2(input_1, "aria-invalid", get2(invalid2) ? "true" : undefined);
|
|
11749
|
+
set_attribute2(input, "id", get2(inputId));
|
|
11750
|
+
set_attribute2(input, "type", $0);
|
|
11751
|
+
set_attribute2(input, "inputmode", $1);
|
|
11752
|
+
set_attribute2(input, "name", $2);
|
|
11753
|
+
set_attribute2(input, "placeholder", $3);
|
|
11754
|
+
input.disabled = get2(disabled);
|
|
11755
|
+
input.readOnly = get2(readonly);
|
|
11756
|
+
input.required = get2(required);
|
|
11757
|
+
set_attribute2(input, "min", $4);
|
|
11758
|
+
set_attribute2(input, "max", $5);
|
|
11759
|
+
set_attribute2(input, "step", $6);
|
|
11760
|
+
set_attribute2(input, "aria-label", get2(computedAriaLabel) || undefined);
|
|
11761
|
+
set_attribute2(input, "aria-describedby", get2(describedBy) || undefined);
|
|
11762
|
+
set_attribute2(input, "aria-invalid", get2(invalid2) ? "true" : undefined);
|
|
11833
11763
|
}, [
|
|
11834
11764
|
() => inputType(),
|
|
11835
11765
|
() => text2(get2(p).type, "text") === "engineering" ? "decimal" : undefined,
|
|
@@ -11839,12 +11769,12 @@ ${pad}}`;
|
|
|
11839
11769
|
() => get2(p).max === undefined ? undefined : text2(get2(p).max),
|
|
11840
11770
|
() => get2(p).step === undefined ? undefined : text2(get2(p).step)
|
|
11841
11771
|
]);
|
|
11842
|
-
delegated("input",
|
|
11843
|
-
bind_value(
|
|
11772
|
+
delegated("input", input, update2);
|
|
11773
|
+
bind_value(input, () => get2(value), ($$value) => set(value, $$value));
|
|
11844
11774
|
append($$anchor, div);
|
|
11845
11775
|
pop();
|
|
11846
11776
|
}
|
|
11847
|
-
delegate(["input"
|
|
11777
|
+
delegate(["input"]);
|
|
11848
11778
|
|
|
11849
11779
|
// src/components/svelte/input/RadioGroup.svelte
|
|
11850
11780
|
var root_34 = from_html(`<span> </span>`);
|
|
@@ -11960,6 +11890,7 @@ ${pad}}`;
|
|
|
11960
11890
|
reset(label2);
|
|
11961
11891
|
reset(span_1);
|
|
11962
11892
|
template_effect(($0, $1, $2) => {
|
|
11893
|
+
set_attribute2(label2, "data-disabled", get2(disabled) ? "true" : undefined);
|
|
11963
11894
|
set_attribute2(input, "name", $0);
|
|
11964
11895
|
set_value(input, $1);
|
|
11965
11896
|
set_checked(input, get2(itemValue) === get2(value));
|
|
@@ -11995,7 +11926,7 @@ ${pad}}`;
|
|
|
11995
11926
|
var root_16 = from_html(`<label class="slex-select-label"><!> <!></label>`);
|
|
11996
11927
|
var root_8 = from_html(`<span class="slex-select-check" aria-hidden="true"></span>`);
|
|
11997
11928
|
var root_6 = from_html(`<li role="option"><span class="slex-select-option-label"><!> <span> </span></span> <!></li>`);
|
|
11998
|
-
var
|
|
11929
|
+
var root_52 = from_html(`<ul class="slex-select-menu" role="listbox"></ul>`);
|
|
11999
11930
|
var root_9 = from_html(`<option> </option>`);
|
|
12000
11931
|
var root10 = from_html(`<div class="slex-select"><!> <button type="button" class="slex-select-trigger" aria-haspopup="listbox"><span class="slex-select-value"><!> <span> </span></span> <span class="slex-select-icon" aria-hidden="true"></span></button> <!> <select class="slex-select-native" tabindex="-1" aria-hidden="true"><option> </option><!></select></div>`);
|
|
12001
11932
|
function Select($$anchor, $$props) {
|
|
@@ -12199,7 +12130,7 @@ ${pad}}`;
|
|
|
12199
12130
|
var node_4 = sibling(button, 2);
|
|
12200
12131
|
{
|
|
12201
12132
|
var consequent_6 = ($$anchor2) => {
|
|
12202
|
-
var ul =
|
|
12133
|
+
var ul = root_52();
|
|
12203
12134
|
each(ul, 21, () => get2(options), index, ($$anchor3, item, index2) => {
|
|
12204
12135
|
const isSelected = user_derived(() => get2(item).value === text2(get2(value)));
|
|
12205
12136
|
const isActive = user_derived(() => index2 === get2(activeIndex));
|
|
@@ -15050,7 +14981,7 @@ Migration example: ${hintLines.join(" ")}`;
|
|
|
15050
14981
|
delegate(["click"]);
|
|
15051
14982
|
|
|
15052
14983
|
// src/components/svelte/input/Tabs.svelte
|
|
15053
|
-
var
|
|
14984
|
+
var root_53 = from_html(`<span class="slex-sr-only"> </span>`);
|
|
15054
14985
|
var root_36 = from_html(`<!> <!>`, 1);
|
|
15055
14986
|
var root_82 = from_html(`<div></div>`);
|
|
15056
14987
|
var root_18 = from_html(`<!> <span class="slex-tabs-selected-indicator" aria-hidden="true"></span>`, 1);
|
|
@@ -15228,7 +15159,7 @@ Migration example: ${hintLines.join(" ")}`;
|
|
|
15228
15159
|
var node_4 = sibling(node_3, 2);
|
|
15229
15160
|
{
|
|
15230
15161
|
var consequent_1 = ($$anchor5) => {
|
|
15231
|
-
var span =
|
|
15162
|
+
var span = root_53();
|
|
15232
15163
|
var text_1 = child(span, true);
|
|
15233
15164
|
reset(span);
|
|
15234
15165
|
template_effect(() => set_text(text_1, get2(label2)));
|
|
@@ -15668,7 +15599,7 @@ Migration example: ${hintLines.join(" ")}`;
|
|
|
15668
15599
|
var root_111 = from_html(`<button><!> <!></button>`);
|
|
15669
15600
|
var root_62 = from_html(`<span class="sr-only"> </span>`);
|
|
15670
15601
|
var root_83 = from_svg(`<svg fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z" clip-rule="evenodd"></path></svg>`);
|
|
15671
|
-
var
|
|
15602
|
+
var root_54 = from_html(`<a><!> <!></a>`);
|
|
15672
15603
|
function CloseButton($$anchor, $$props) {
|
|
15673
15604
|
push($$props, true);
|
|
15674
15605
|
let color = prop($$props, "color", 3, "gray"), name = prop($$props, "name", 3, "Close"), size = prop($$props, "size", 3, "md"), restProps = rest_props($$props, [
|
|
@@ -15742,7 +15673,7 @@ Migration example: ${hintLines.join(" ")}`;
|
|
|
15742
15673
|
append($$anchor2, button);
|
|
15743
15674
|
};
|
|
15744
15675
|
var alternate_2 = ($$anchor2) => {
|
|
15745
|
-
var a =
|
|
15676
|
+
var a = root_54();
|
|
15746
15677
|
attribute_effect(a, ($0) => ({
|
|
15747
15678
|
...restProps,
|
|
15748
15679
|
onclick,
|
|
@@ -16375,11 +16306,21 @@ Migration example: ${hintLines.join(" ")}`;
|
|
|
16375
16306
|
push($$props, true);
|
|
16376
16307
|
let p = state(proxy({}));
|
|
16377
16308
|
user_effect(() => bindPropStore($$props.props, (next2) => set(p, next2, true)));
|
|
16309
|
+
const color = user_derived(() => get2(p).color == null || get2(p).color === "" ? undefined : text2(get2(p).color));
|
|
16310
|
+
const size = user_derived(() => cssLength(get2(p).size));
|
|
16311
|
+
function cssLength(value) {
|
|
16312
|
+
if (value == null || value === "")
|
|
16313
|
+
return;
|
|
16314
|
+
const rendered = text2(value);
|
|
16315
|
+
return /^-?\d+(\.\d+)?$/.test(rendered) ? `${rendered}px` : rendered;
|
|
16316
|
+
}
|
|
16378
16317
|
var div = root20();
|
|
16318
|
+
let styles;
|
|
16379
16319
|
var text_1 = child(div, true);
|
|
16380
16320
|
reset(div);
|
|
16381
16321
|
template_effect(($0, $1) => {
|
|
16382
16322
|
set_class(div, 1, $0);
|
|
16323
|
+
styles = set_style(div, "", styles, { color: get2(color), "font-size": get2(size) });
|
|
16383
16324
|
set_text(text_1, $1);
|
|
16384
16325
|
}, [
|
|
16385
16326
|
() => `slex-text${get2(p).variant ? ` slex-text--${text2(get2(p).variant)}` : ""}${get2(p).class ? ` ${text2(get2(p).class)}` : ""}`,
|
|
@@ -16551,7 +16492,7 @@ Migration example: ${hintLines.join(" ")}`;
|
|
|
16551
16492
|
var root_45 = from_html(`<span class="slex-code-block-language"> </span>`);
|
|
16552
16493
|
var root_114 = from_html(`<figcaption class="slex-code-block-header"><span class="slex-code-block-title"><!> <!></span> <!></figcaption>`);
|
|
16553
16494
|
var root_72 = from_html(`<span> </span>`);
|
|
16554
|
-
var
|
|
16495
|
+
var root_55 = from_html(`<span class="slex-code-line"><span class="slex-code-line-content"></span></span>`);
|
|
16555
16496
|
var root22 = from_html(`<figure class="slex-code-block"><!> <pre class="slex-code-block-pre"><code></code></pre></figure>`);
|
|
16556
16497
|
function CodeBlock($$anchor, $$props) {
|
|
16557
16498
|
push($$props, true);
|
|
@@ -16720,7 +16661,7 @@ Migration example: ${hintLines.join(" ")}`;
|
|
|
16720
16661
|
var pre = sibling(node, 2);
|
|
16721
16662
|
var code_1 = child(pre);
|
|
16722
16663
|
each(code_1, 21, () => get2(lines), index, ($$anchor2, line) => {
|
|
16723
|
-
var span_3 =
|
|
16664
|
+
var span_3 = root_55();
|
|
16724
16665
|
var span_4 = child(span_3);
|
|
16725
16666
|
each(span_4, 21, () => get2(line), index, ($$anchor3, token) => {
|
|
16726
16667
|
var fragment_1 = comment();
|
|
@@ -30860,7 +30801,7 @@ l0,-` + (midHeight + 144) + `c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949
|
|
|
30860
30801
|
|
|
30861
30802
|
// src/components/svelte/content/Section.svelte
|
|
30862
30803
|
var root_28 = from_html(`<div class="slex-section-eyebrow"> </div>`);
|
|
30863
|
-
var
|
|
30804
|
+
var root_56 = from_html(`<span> </span>`);
|
|
30864
30805
|
var root_313 = from_html(`<h2 class="slex-section-title"><!><!></h2>`);
|
|
30865
30806
|
var root_65 = from_html(`<p class="slex-section-subtitle"> </p>`);
|
|
30866
30807
|
var root_73 = from_html(`<a class="slex-section-action"> </a>`);
|
|
@@ -30911,7 +30852,7 @@ l0,-` + (midHeight + 144) + `c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949
|
|
|
30911
30852
|
var node_4 = sibling(node_3);
|
|
30912
30853
|
{
|
|
30913
30854
|
var consequent_2 = ($$anchor4) => {
|
|
30914
|
-
var span =
|
|
30855
|
+
var span = root_56();
|
|
30915
30856
|
var text_2 = child(span, true);
|
|
30916
30857
|
reset(span);
|
|
30917
30858
|
template_effect(($0) => set_text(text_2, $0), [() => text2(get2(p).title)]);
|
|
@@ -61020,7 +60961,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
61020
60961
|
var root_29 = from_html(`<h2><!></h2>`);
|
|
61021
60962
|
var root_314 = from_html(`<h3><!></h3>`);
|
|
61022
60963
|
var root_48 = from_html(`<h4><!></h4>`);
|
|
61023
|
-
var
|
|
60964
|
+
var root_57 = from_html(`<h5><!></h5>`);
|
|
61024
60965
|
var root_66 = from_html(`<h6><!></h6>`);
|
|
61025
60966
|
function Heading($$anchor, $$props) {
|
|
61026
60967
|
push($$props, true);
|
|
@@ -61061,7 +61002,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
61061
61002
|
append($$anchor2, h4);
|
|
61062
61003
|
};
|
|
61063
61004
|
var consequent_4 = ($$anchor2) => {
|
|
61064
|
-
var h5 =
|
|
61005
|
+
var h5 = root_57();
|
|
61065
61006
|
var node_5 = child(h5);
|
|
61066
61007
|
snippet(node_5, () => $$props.children ?? noop);
|
|
61067
61008
|
reset(h5);
|