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
package/dist/slexkit.js
CHANGED
|
@@ -396,19 +396,31 @@ function configureComponentScope(options) {
|
|
|
396
396
|
function createComponentAccessor(read) {
|
|
397
397
|
const subscribers = new Set;
|
|
398
398
|
let current = read();
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
399
|
+
let stopEffect;
|
|
400
|
+
const start = () => {
|
|
401
|
+
if (stopEffect)
|
|
402
|
+
return;
|
|
403
|
+
stopEffect = createEffect(() => {
|
|
404
404
|
current = read();
|
|
405
|
-
for (const subscriber of subscribers)
|
|
405
|
+
for (const subscriber of Array.from(subscribers))
|
|
406
406
|
subscriber(current);
|
|
407
407
|
flushDom?.();
|
|
408
408
|
});
|
|
409
|
+
};
|
|
410
|
+
const accessor = () => current;
|
|
411
|
+
accessor.subscribe = (run) => {
|
|
412
|
+
const wasIdle = subscribers.size === 0;
|
|
413
|
+
subscribers.add(run);
|
|
414
|
+
if (wasIdle)
|
|
415
|
+
start();
|
|
416
|
+
else
|
|
417
|
+
run(current);
|
|
409
418
|
return () => {
|
|
410
419
|
subscribers.delete(run);
|
|
411
|
-
|
|
420
|
+
if (subscribers.size === 0) {
|
|
421
|
+
stopEffect?.();
|
|
422
|
+
stopEffect = undefined;
|
|
423
|
+
}
|
|
412
424
|
};
|
|
413
425
|
};
|
|
414
426
|
return accessor;
|
|
@@ -689,6 +701,9 @@ function isWritableComponent(type) {
|
|
|
689
701
|
const mode = getComponentStateMode(type);
|
|
690
702
|
return mode === "value" || mode === "checked" || mode === "enabled";
|
|
691
703
|
}
|
|
704
|
+
function isReadableComponent(type) {
|
|
705
|
+
return getComponentStateMode(type) === "readable";
|
|
706
|
+
}
|
|
692
707
|
function isStatefulComponent(type) {
|
|
693
708
|
return getComponentStateMode(type) !== "none";
|
|
694
709
|
}
|
|
@@ -805,7 +820,10 @@ function createGProxy(g, components, componentTypes) {
|
|
|
805
820
|
function ensureComponentState(name, type, components, componentTypes) {
|
|
806
821
|
if (!components[name])
|
|
807
822
|
components[name] = {};
|
|
808
|
-
componentTypes[name]
|
|
823
|
+
const previousType = componentTypes[name] ?? "";
|
|
824
|
+
if (!(isWritableComponent(previousType) && isReadableComponent(type))) {
|
|
825
|
+
componentTypes[name] = type;
|
|
826
|
+
}
|
|
809
827
|
return components[name];
|
|
810
828
|
}
|
|
811
829
|
function syncReadableComponentProp(type, state, propName, value) {
|
|
@@ -833,6 +851,9 @@ function syncReadableComponentProp(type, state, propName, value) {
|
|
|
833
851
|
function syncComponentProps(type, name, props, components, componentTypes) {
|
|
834
852
|
if (!name || !isStatefulComponent(type))
|
|
835
853
|
return;
|
|
854
|
+
const previousType = componentTypes[name] ?? "";
|
|
855
|
+
if (isWritableComponent(previousType) && isReadableComponent(type))
|
|
856
|
+
return;
|
|
836
857
|
const state = ensureComponentState(name, type, components, componentTypes);
|
|
837
858
|
if (type === "input" && typeof props.type === "string") {
|
|
838
859
|
assignInputType(state, props.type);
|
|
@@ -897,7 +918,7 @@ function seedStaticComponentState(type, state, props) {
|
|
|
897
918
|
function warnDuplicateState(ns, name, currentType, currentPath, previous) {
|
|
898
919
|
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.`);
|
|
899
920
|
if (previous.type !== currentType) {
|
|
900
|
-
console.warn(`[SlexKit][${ns}] Component state '${name}' is used by multiple component types (${previous.type}, ${currentType});
|
|
921
|
+
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.`);
|
|
901
922
|
}
|
|
902
923
|
}
|
|
903
924
|
function dynamicStateBinding(type, props) {
|
|
@@ -909,6 +930,9 @@ function isMirroredValueControlPair(previousType, currentType) {
|
|
|
909
930
|
return previousType === "input" && currentType === "slider" || previousType === "slider" && currentType === "input";
|
|
910
931
|
}
|
|
911
932
|
function shouldWarnDuplicateState(currentType, currentBinding, previous) {
|
|
933
|
+
if (isReadableComponent(previous.type) && isReadableComponent(currentType)) {
|
|
934
|
+
return false;
|
|
935
|
+
}
|
|
912
936
|
if (currentBinding && previous.stateBinding === currentBinding && isMirroredValueControlPair(previous.type, currentType)) {
|
|
913
937
|
return false;
|
|
914
938
|
}
|
|
@@ -1247,9 +1271,10 @@ function renderForNode(fullKey, props, container, g, components, componentTypes,
|
|
|
1247
1271
|
const renderer = getRenderer(type);
|
|
1248
1272
|
if (!renderer)
|
|
1249
1273
|
return;
|
|
1250
|
-
const
|
|
1251
|
-
|
|
1252
|
-
|
|
1274
|
+
const doc = container.ownerDocument || document;
|
|
1275
|
+
const startAnchor = doc.createComment(`slexkit-for:${fullKey}:start`);
|
|
1276
|
+
const endAnchor = doc.createComment(`slexkit-for:${fullKey}:end`);
|
|
1277
|
+
container.append(startAnchor, endAnchor);
|
|
1253
1278
|
const evalCtx = buildComponentEvalContext(g, components, componentTypes, api, forCtx);
|
|
1254
1279
|
const items = createMemo(() => trackForCollection(evalRead(props.$for, evalCtx, ns, `${fullKey}:$for`)));
|
|
1255
1280
|
const $keyProp = props.$key;
|
|
@@ -1262,8 +1287,10 @@ function renderForNode(fullKey, props, container, g, components, componentTypes,
|
|
|
1262
1287
|
disposedSlots.add(slot);
|
|
1263
1288
|
leavingSlots.delete(slot);
|
|
1264
1289
|
callHook(g, name, "onUnmount");
|
|
1265
|
-
|
|
1266
|
-
|
|
1290
|
+
if (slot.el) {
|
|
1291
|
+
disposeComponent(slot.el);
|
|
1292
|
+
slot.el.remove();
|
|
1293
|
+
}
|
|
1267
1294
|
if (slot.dispose)
|
|
1268
1295
|
slot.dispose();
|
|
1269
1296
|
};
|
|
@@ -1288,12 +1315,16 @@ function renderForNode(fullKey, props, container, g, components, componentTypes,
|
|
|
1288
1315
|
}
|
|
1289
1316
|
}
|
|
1290
1317
|
for (const slot of deletedSlots) {
|
|
1291
|
-
container.appendChild(slot.el);
|
|
1292
1318
|
leavingSlots.add(slot);
|
|
1319
|
+
if (!slot.el) {
|
|
1320
|
+
disposeSlot(slot);
|
|
1321
|
+
continue;
|
|
1322
|
+
}
|
|
1293
1323
|
applyLeaveAnimation(slot.el, slot.props, () => {
|
|
1294
1324
|
disposeSlot(slot);
|
|
1295
1325
|
});
|
|
1296
1326
|
}
|
|
1327
|
+
let cursor = startAnchor;
|
|
1297
1328
|
arr.forEach((item, index) => {
|
|
1298
1329
|
item = asReactiveValue(item, g);
|
|
1299
1330
|
const keyVal = newKeys[index];
|
|
@@ -1321,20 +1352,22 @@ function renderForNode(fullKey, props, container, g, components, componentTypes,
|
|
|
1321
1352
|
const indexSignal = createSignal(index);
|
|
1322
1353
|
const revisionSignal = createSignal(0);
|
|
1323
1354
|
slot = renderAndMountSlot(item, index, keyVal, indexSignal, revisionSignal, renderer, type, name, props, container, g, components, componentTypes, api, forCtx, ns, fullKey, options);
|
|
1324
|
-
if (slot.el) {
|
|
1325
|
-
|
|
1326
|
-
|
|
1355
|
+
if (!slot.el) {
|
|
1356
|
+
disposeSlot(slot);
|
|
1357
|
+
return;
|
|
1327
1358
|
}
|
|
1359
|
+
applyEnterAnimation(slot.el, slot.props);
|
|
1360
|
+
callHook(g, name, "onMount");
|
|
1328
1361
|
slotMap.set(keyVal, slot);
|
|
1329
1362
|
}
|
|
1330
|
-
const
|
|
1331
|
-
if (slot.el &&
|
|
1332
|
-
|
|
1363
|
+
const nextChild = cursor.nextSibling;
|
|
1364
|
+
if (slot.el && nextChild !== slot.el) {
|
|
1365
|
+
container.insertBefore(slot.el, nextChild ?? endAnchor);
|
|
1366
|
+
}
|
|
1367
|
+
if (slot.el) {
|
|
1368
|
+
cursor = slot.el;
|
|
1333
1369
|
}
|
|
1334
1370
|
});
|
|
1335
|
-
while (forWrapper.children.length > arr.length) {
|
|
1336
|
-
forWrapper.lastChild.remove();
|
|
1337
|
-
}
|
|
1338
1371
|
});
|
|
1339
1372
|
onCleanup(() => {
|
|
1340
1373
|
for (const slot of Array.from(slotMap.values()))
|
|
@@ -1342,7 +1375,8 @@ function renderForNode(fullKey, props, container, g, components, componentTypes,
|
|
|
1342
1375
|
slotMap.clear();
|
|
1343
1376
|
for (const slot of Array.from(leavingSlots))
|
|
1344
1377
|
disposeSlot(slot);
|
|
1345
|
-
|
|
1378
|
+
startAnchor.remove();
|
|
1379
|
+
endAnchor.remove();
|
|
1346
1380
|
});
|
|
1347
1381
|
}
|
|
1348
1382
|
function renderNormalNode(fullKey, props, container, g, components, componentTypes, api, forCtx, ns, options) {
|
|
@@ -1719,7 +1753,7 @@ ${parseSource}
|
|
|
1719
1753
|
var parseSlexKitDsl = parseSlexSource;
|
|
1720
1754
|
|
|
1721
1755
|
// src/version.ts
|
|
1722
|
-
var SLEXKIT_VERSION = "0.3.
|
|
1756
|
+
var SLEXKIT_VERSION = "0.3.2";
|
|
1723
1757
|
var SLEX_PROTOCOL_VERSION = "0.1";
|
|
1724
1758
|
var SLEXKIT_COMPONENTS_VERSION = SLEXKIT_VERSION;
|
|
1725
1759
|
function getSlexKitInfo() {
|
|
@@ -2847,7 +2881,6 @@ var inputSpec = component({
|
|
|
2847
2881
|
min: { type: "string | number", dynamic: true, description: "Minimum value used by numeric input controls." },
|
|
2848
2882
|
max: { type: "string | number", dynamic: true, description: "Maximum value used by numeric input controls." },
|
|
2849
2883
|
step: { type: "string | number", dynamic: true, description: "Step size used by numeric input controls." },
|
|
2850
|
-
controls: { type: "boolean", default: true, dynamic: true, description: "Show decrement and increment buttons for numeric inputs." },
|
|
2851
2884
|
onchange: { type: "write-expression", description: "Write expression invoked when the value changes." }
|
|
2852
2885
|
},
|
|
2853
2886
|
children: noChildren,
|
|
@@ -3355,6 +3388,8 @@ var textSpec = component({
|
|
|
3355
3388
|
content: { type: "string", dynamic: true, description: "Alias for text." },
|
|
3356
3389
|
label: { type: "string", dynamic: true, description: "Alias for text." },
|
|
3357
3390
|
variant: { type: "string", values: ["default", "muted"], default: "default", description: "Text visual variant." },
|
|
3391
|
+
color: { type: "string", dynamic: true, description: "Optional CSS color for controlled previews." },
|
|
3392
|
+
size: { type: "string | number", dynamic: true, description: "Optional font size. Numbers are treated as px." },
|
|
3358
3393
|
class: { type: "string", description: "Additional host-controlled CSS class." }
|
|
3359
3394
|
},
|
|
3360
3395
|
children: noChildren,
|
|
@@ -3725,7 +3760,11 @@ function isRenderableSource(value) {
|
|
|
3725
3760
|
return Object.keys(value).some((key) => key.includes(":"));
|
|
3726
3761
|
}
|
|
3727
3762
|
function bareLayoutFromSource(value) {
|
|
3728
|
-
const
|
|
3763
|
+
const layout = { ...value };
|
|
3764
|
+
delete layout.slex;
|
|
3765
|
+
delete layout.namespace;
|
|
3766
|
+
delete layout.g;
|
|
3767
|
+
delete layout.layout;
|
|
3729
3768
|
return layout;
|
|
3730
3769
|
}
|
|
3731
3770
|
function isStateOnlySource(value) {
|
|
@@ -12496,6 +12535,7 @@ function Checkbox($$anchor, $$props) {
|
|
|
12496
12535
|
reset(label2);
|
|
12497
12536
|
reset(span);
|
|
12498
12537
|
template_effect(($0, $1) => {
|
|
12538
|
+
set_attribute2(label2, "data-disabled", get2(p).disabled ? "true" : undefined);
|
|
12499
12539
|
input.disabled = !!get2(p).disabled;
|
|
12500
12540
|
set_attribute2(input, "data-state", get2(checked) ? "checked" : "unchecked");
|
|
12501
12541
|
set_attribute2(input, "aria-label", $0);
|
|
@@ -12571,6 +12611,7 @@ function Switch($$anchor, $$props) {
|
|
|
12571
12611
|
reset(span);
|
|
12572
12612
|
template_effect(($0, $1) => {
|
|
12573
12613
|
set_attribute2(label2, "data-state", get2(enabled) ? "on" : "off");
|
|
12614
|
+
set_attribute2(label2, "data-disabled", get2(p).disabled ? "true" : undefined);
|
|
12574
12615
|
input.disabled = !!get2(p).disabled;
|
|
12575
12616
|
set_attribute2(input, "aria-label", $0);
|
|
12576
12617
|
set_text(text_1, $1);
|
|
@@ -12591,26 +12632,11 @@ delegate(["pointerdown", "click", "change"]);
|
|
|
12591
12632
|
var nextInputId = 0;
|
|
12592
12633
|
var root_14 = from_html(`<label class="slex-input-label"> </label>`);
|
|
12593
12634
|
var root_2 = from_html(`<span class="slex-input-unit" aria-hidden="true"> </span>`);
|
|
12594
|
-
var root_33 = from_html(`<
|
|
12595
|
-
var root_4 = from_html(`<div class="slex-input-
|
|
12596
|
-
var
|
|
12597
|
-
var root8 = from_html(`<div class="slex-input-field"><!> <div class="slex-input-control"><input class="slex-input"/> <!> <!></div> <!> <!></div>`);
|
|
12635
|
+
var root_33 = from_html(`<div class="slex-input-description"> </div>`);
|
|
12636
|
+
var root_4 = from_html(`<div class="slex-input-error" role="alert"> </div>`);
|
|
12637
|
+
var root8 = from_html(`<div class="slex-input-field"><!> <div class="slex-input-control"><input class="slex-input"/> <!></div> <!> <!></div>`);
|
|
12598
12638
|
function Input($$anchor, $$props) {
|
|
12599
12639
|
push($$props, true);
|
|
12600
|
-
const engineeringPrefixFactors = {
|
|
12601
|
-
p: 0.000000000001,
|
|
12602
|
-
n: 0.000000001,
|
|
12603
|
-
u: 0.000001,
|
|
12604
|
-
"µ": 0.000001,
|
|
12605
|
-
"碌": 0.000001,
|
|
12606
|
-
m: 0.001,
|
|
12607
|
-
k: 1000,
|
|
12608
|
-
K: 1000,
|
|
12609
|
-
M: 1e6,
|
|
12610
|
-
meg: 1e6,
|
|
12611
|
-
G: 1e9,
|
|
12612
|
-
T: 1000000000000
|
|
12613
|
-
};
|
|
12614
12640
|
let p = state(proxy({}));
|
|
12615
12641
|
let value = state("");
|
|
12616
12642
|
const fallbackId = `slex-input-${++nextInputId}`;
|
|
@@ -12622,8 +12648,6 @@ function Input($$anchor, $$props) {
|
|
|
12622
12648
|
const readonly = user_derived(() => bool(get2(p).readonly) || bool(get2(p).readOnly));
|
|
12623
12649
|
const required = user_derived(() => bool(get2(p).required));
|
|
12624
12650
|
const invalid2 = user_derived(() => bool(get2(p).invalid) || !!get2(errorText));
|
|
12625
|
-
const steppable = user_derived(isSteppableInput);
|
|
12626
|
-
const controls = user_derived(() => get2(steppable) && get2(p).controls !== false && get2(p).controls !== "false");
|
|
12627
12651
|
const componentId = user_derived(() => safeId($$props.componentName));
|
|
12628
12652
|
const inputId = user_derived(() => text2(get2(p).id) || (get2(componentId) ? `slex-input-${get2(componentId)}` : fallbackId));
|
|
12629
12653
|
const descriptionId = user_derived(() => `${get2(inputId)}-description`);
|
|
@@ -12634,10 +12658,6 @@ function Input($$anchor, $$props) {
|
|
|
12634
12658
|
get2(descriptionText) ? get2(descriptionId) : "",
|
|
12635
12659
|
get2(errorText) ? get2(errorId) : ""
|
|
12636
12660
|
].filter(Boolean).join(" "));
|
|
12637
|
-
const numericValue = user_derived(readNumericValue);
|
|
12638
|
-
const controlLabel = user_derived(() => get2(labelText) || text2(get2(p).placeholder) || $$props.componentName || "input");
|
|
12639
|
-
const decrementDisabled = user_derived(() => !canStep(-1));
|
|
12640
|
-
const incrementDisabled = user_derived(() => !canStep(1));
|
|
12641
12661
|
user_effect(() => bindPropStore($$props.props, (next2) => {
|
|
12642
12662
|
set(p, next2, true);
|
|
12643
12663
|
set(value, text2(next2.value), true);
|
|
@@ -12648,72 +12668,6 @@ function Input($$anchor, $$props) {
|
|
|
12648
12668
|
function inputType() {
|
|
12649
12669
|
return text2(get2(p).type, "text") === "engineering" ? "text" : text2(get2(p).type, "text");
|
|
12650
12670
|
}
|
|
12651
|
-
function isSteppableInput() {
|
|
12652
|
-
const kind = text2(get2(p).type, "text");
|
|
12653
|
-
return kind === "number" || kind === "engineering" || get2(p).min !== undefined || get2(p).max !== undefined || get2(p).step !== undefined;
|
|
12654
|
-
}
|
|
12655
|
-
function numericProp(input) {
|
|
12656
|
-
if (input === undefined || input === null || input === "")
|
|
12657
|
-
return;
|
|
12658
|
-
const next2 = Number(input);
|
|
12659
|
-
return Number.isFinite(next2) ? next2 : undefined;
|
|
12660
|
-
}
|
|
12661
|
-
function stepSize() {
|
|
12662
|
-
const next2 = numericProp(get2(p).step);
|
|
12663
|
-
if (next2 !== undefined && next2 > 0)
|
|
12664
|
-
return next2;
|
|
12665
|
-
if (text2(get2(p).type, "text") !== "engineering")
|
|
12666
|
-
return 1;
|
|
12667
|
-
const parsed = parseEngineeringNumber(get2(value));
|
|
12668
|
-
if (!parsed.valid || !parsed.prefix)
|
|
12669
|
-
return 1;
|
|
12670
|
-
return engineeringPrefixFactors[parsed.prefix] ?? 1;
|
|
12671
|
-
}
|
|
12672
|
-
function readNumericValue() {
|
|
12673
|
-
if (text2(get2(p).type, "text") === "engineering") {
|
|
12674
|
-
const parsed = parseEngineeringNumber(get2(value));
|
|
12675
|
-
return parsed.valid && parsed.number !== null ? parsed.number : null;
|
|
12676
|
-
}
|
|
12677
|
-
const next2 = Number(get2(value));
|
|
12678
|
-
return Number.isFinite(next2) ? next2 : null;
|
|
12679
|
-
}
|
|
12680
|
-
function clamp(next2) {
|
|
12681
|
-
const min = numericProp(get2(p).min);
|
|
12682
|
-
const max = numericProp(get2(p).max);
|
|
12683
|
-
let clamped = next2;
|
|
12684
|
-
if (min !== undefined)
|
|
12685
|
-
clamped = Math.max(min, clamped);
|
|
12686
|
-
if (max !== undefined)
|
|
12687
|
-
clamped = Math.min(max, clamped);
|
|
12688
|
-
return clamped;
|
|
12689
|
-
}
|
|
12690
|
-
function canStep(direction) {
|
|
12691
|
-
if (!get2(controls) || get2(disabled) || get2(readonly) || get2(numericValue) === null)
|
|
12692
|
-
return false;
|
|
12693
|
-
return clamp(get2(numericValue) + direction * stepSize()) !== get2(numericValue);
|
|
12694
|
-
}
|
|
12695
|
-
function formatSteppedValue(next2) {
|
|
12696
|
-
if (text2(get2(p).type, "text") !== "engineering")
|
|
12697
|
-
return text2(next2);
|
|
12698
|
-
const parsed = parseEngineeringNumber(get2(value));
|
|
12699
|
-
if (!parsed.valid)
|
|
12700
|
-
return text2(next2);
|
|
12701
|
-
const factor = parsed.prefix ? engineeringPrefixFactors[parsed.prefix] : undefined;
|
|
12702
|
-
const visibleNumber = factor ? next2 / factor : next2;
|
|
12703
|
-
return `${formatNumber2(visibleNumber)}${parsed.prefix}${parsed.unit}`;
|
|
12704
|
-
}
|
|
12705
|
-
function formatNumber2(next2) {
|
|
12706
|
-
return text2(Number(next2.toPrecision(12)));
|
|
12707
|
-
}
|
|
12708
|
-
function emitValue(nextValue) {
|
|
12709
|
-
set(value, nextValue, true);
|
|
12710
|
-
emit($$props.ctx, "change", text2(get2(p).type, "text") === "engineering" ? parseEngineeringNumber(get2(value)) : get2(value));
|
|
12711
|
-
}
|
|
12712
|
-
function stepBy(direction) {
|
|
12713
|
-
if (!canStep(direction) || get2(numericValue) === null)
|
|
12714
|
-
return;
|
|
12715
|
-
emitValue(formatSteppedValue(clamp(get2(numericValue) + direction * stepSize())));
|
|
12716
|
-
}
|
|
12717
12671
|
function update2(event2) {
|
|
12718
12672
|
if (get2(disabled) || get2(readonly))
|
|
12719
12673
|
return;
|
|
@@ -12739,9 +12693,9 @@ function Input($$anchor, $$props) {
|
|
|
12739
12693
|
});
|
|
12740
12694
|
}
|
|
12741
12695
|
var div_1 = sibling(node, 2);
|
|
12742
|
-
var
|
|
12743
|
-
remove_input_defaults(
|
|
12744
|
-
var node_1 = sibling(
|
|
12696
|
+
var input = child(div_1);
|
|
12697
|
+
remove_input_defaults(input);
|
|
12698
|
+
var node_1 = sibling(input, 2);
|
|
12745
12699
|
{
|
|
12746
12700
|
var consequent_1 = ($$anchor2) => {
|
|
12747
12701
|
var span = root_2();
|
|
@@ -12755,33 +12709,11 @@ function Input($$anchor, $$props) {
|
|
|
12755
12709
|
$$render(consequent_1);
|
|
12756
12710
|
});
|
|
12757
12711
|
}
|
|
12758
|
-
var node_2 = sibling(node_1, 2);
|
|
12759
|
-
{
|
|
12760
|
-
var consequent_2 = ($$anchor2) => {
|
|
12761
|
-
var span_1 = root_33();
|
|
12762
|
-
var button = child(span_1);
|
|
12763
|
-
var button_1 = sibling(button, 2);
|
|
12764
|
-
reset(span_1);
|
|
12765
|
-
template_effect(() => {
|
|
12766
|
-
set_attribute2(button, "aria-label", `Increase ${get2(controlLabel)}`);
|
|
12767
|
-
button.disabled = get2(incrementDisabled);
|
|
12768
|
-
set_attribute2(button_1, "aria-label", `Decrease ${get2(controlLabel)}`);
|
|
12769
|
-
button_1.disabled = get2(decrementDisabled);
|
|
12770
|
-
});
|
|
12771
|
-
delegated("click", button, () => stepBy(1));
|
|
12772
|
-
delegated("click", button_1, () => stepBy(-1));
|
|
12773
|
-
append($$anchor2, span_1);
|
|
12774
|
-
};
|
|
12775
|
-
if_block(node_2, ($$render) => {
|
|
12776
|
-
if (get2(controls))
|
|
12777
|
-
$$render(consequent_2);
|
|
12778
|
-
});
|
|
12779
|
-
}
|
|
12780
12712
|
reset(div_1);
|
|
12781
|
-
var
|
|
12713
|
+
var node_2 = sibling(div_1, 2);
|
|
12782
12714
|
{
|
|
12783
|
-
var
|
|
12784
|
-
var div_2 =
|
|
12715
|
+
var consequent_2 = ($$anchor2) => {
|
|
12716
|
+
var div_2 = root_33();
|
|
12785
12717
|
var text_3 = child(div_2, true);
|
|
12786
12718
|
reset(div_2);
|
|
12787
12719
|
template_effect(() => {
|
|
@@ -12790,15 +12722,15 @@ function Input($$anchor, $$props) {
|
|
|
12790
12722
|
});
|
|
12791
12723
|
append($$anchor2, div_2);
|
|
12792
12724
|
};
|
|
12793
|
-
if_block(
|
|
12725
|
+
if_block(node_2, ($$render) => {
|
|
12794
12726
|
if (get2(descriptionText))
|
|
12795
|
-
$$render(
|
|
12727
|
+
$$render(consequent_2);
|
|
12796
12728
|
});
|
|
12797
12729
|
}
|
|
12798
|
-
var
|
|
12730
|
+
var node_3 = sibling(node_2, 2);
|
|
12799
12731
|
{
|
|
12800
|
-
var
|
|
12801
|
-
var div_3 =
|
|
12732
|
+
var consequent_3 = ($$anchor2) => {
|
|
12733
|
+
var div_3 = root_4();
|
|
12802
12734
|
var text_4 = child(div_3, true);
|
|
12803
12735
|
reset(div_3);
|
|
12804
12736
|
template_effect(() => {
|
|
@@ -12807,9 +12739,9 @@ function Input($$anchor, $$props) {
|
|
|
12807
12739
|
});
|
|
12808
12740
|
append($$anchor2, div_3);
|
|
12809
12741
|
};
|
|
12810
|
-
if_block(
|
|
12742
|
+
if_block(node_3, ($$render) => {
|
|
12811
12743
|
if (get2(errorText))
|
|
12812
|
-
$$render(
|
|
12744
|
+
$$render(consequent_3);
|
|
12813
12745
|
});
|
|
12814
12746
|
}
|
|
12815
12747
|
reset(div);
|
|
@@ -12818,21 +12750,20 @@ function Input($$anchor, $$props) {
|
|
|
12818
12750
|
set_attribute2(div, "data-required", get2(required) ? "true" : undefined);
|
|
12819
12751
|
set_attribute2(div, "data-readonly", get2(readonly) ? "true" : undefined);
|
|
12820
12752
|
set_attribute2(div_1, "data-has-unit", get2(unitText) ? "true" : undefined);
|
|
12821
|
-
set_attribute2(
|
|
12822
|
-
set_attribute2(
|
|
12823
|
-
set_attribute2(
|
|
12824
|
-
set_attribute2(
|
|
12825
|
-
set_attribute2(
|
|
12826
|
-
|
|
12827
|
-
|
|
12828
|
-
|
|
12829
|
-
|
|
12830
|
-
set_attribute2(
|
|
12831
|
-
set_attribute2(
|
|
12832
|
-
set_attribute2(
|
|
12833
|
-
set_attribute2(
|
|
12834
|
-
set_attribute2(
|
|
12835
|
-
set_attribute2(input_1, "aria-invalid", get2(invalid2) ? "true" : undefined);
|
|
12753
|
+
set_attribute2(input, "id", get2(inputId));
|
|
12754
|
+
set_attribute2(input, "type", $0);
|
|
12755
|
+
set_attribute2(input, "inputmode", $1);
|
|
12756
|
+
set_attribute2(input, "name", $2);
|
|
12757
|
+
set_attribute2(input, "placeholder", $3);
|
|
12758
|
+
input.disabled = get2(disabled);
|
|
12759
|
+
input.readOnly = get2(readonly);
|
|
12760
|
+
input.required = get2(required);
|
|
12761
|
+
set_attribute2(input, "min", $4);
|
|
12762
|
+
set_attribute2(input, "max", $5);
|
|
12763
|
+
set_attribute2(input, "step", $6);
|
|
12764
|
+
set_attribute2(input, "aria-label", get2(computedAriaLabel) || undefined);
|
|
12765
|
+
set_attribute2(input, "aria-describedby", get2(describedBy) || undefined);
|
|
12766
|
+
set_attribute2(input, "aria-invalid", get2(invalid2) ? "true" : undefined);
|
|
12836
12767
|
}, [
|
|
12837
12768
|
() => inputType(),
|
|
12838
12769
|
() => text2(get2(p).type, "text") === "engineering" ? "decimal" : undefined,
|
|
@@ -12842,12 +12773,12 @@ function Input($$anchor, $$props) {
|
|
|
12842
12773
|
() => get2(p).max === undefined ? undefined : text2(get2(p).max),
|
|
12843
12774
|
() => get2(p).step === undefined ? undefined : text2(get2(p).step)
|
|
12844
12775
|
]);
|
|
12845
|
-
delegated("input",
|
|
12846
|
-
bind_value(
|
|
12776
|
+
delegated("input", input, update2);
|
|
12777
|
+
bind_value(input, () => get2(value), ($$value) => set(value, $$value));
|
|
12847
12778
|
append($$anchor, div);
|
|
12848
12779
|
pop();
|
|
12849
12780
|
}
|
|
12850
|
-
delegate(["input"
|
|
12781
|
+
delegate(["input"]);
|
|
12851
12782
|
|
|
12852
12783
|
// src/components/svelte/input/RadioGroup.svelte
|
|
12853
12784
|
var root_34 = from_html(`<span> </span>`);
|
|
@@ -12963,6 +12894,7 @@ function RadioGroup($$anchor, $$props) {
|
|
|
12963
12894
|
reset(label2);
|
|
12964
12895
|
reset(span_1);
|
|
12965
12896
|
template_effect(($0, $1, $2) => {
|
|
12897
|
+
set_attribute2(label2, "data-disabled", get2(disabled) ? "true" : undefined);
|
|
12966
12898
|
set_attribute2(input, "name", $0);
|
|
12967
12899
|
set_value(input, $1);
|
|
12968
12900
|
set_checked(input, get2(itemValue) === get2(value));
|
|
@@ -12998,7 +12930,7 @@ var root_35 = from_html(`<span> </span>`);
|
|
|
12998
12930
|
var root_16 = from_html(`<label class="slex-select-label"><!> <!></label>`);
|
|
12999
12931
|
var root_8 = from_html(`<span class="slex-select-check" aria-hidden="true"></span>`);
|
|
13000
12932
|
var root_6 = from_html(`<li role="option"><span class="slex-select-option-label"><!> <span> </span></span> <!></li>`);
|
|
13001
|
-
var
|
|
12933
|
+
var root_52 = from_html(`<ul class="slex-select-menu" role="listbox"></ul>`);
|
|
13002
12934
|
var root_9 = from_html(`<option> </option>`);
|
|
13003
12935
|
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>`);
|
|
13004
12936
|
function Select($$anchor, $$props) {
|
|
@@ -13202,7 +13134,7 @@ function Select($$anchor, $$props) {
|
|
|
13202
13134
|
var node_4 = sibling(button, 2);
|
|
13203
13135
|
{
|
|
13204
13136
|
var consequent_6 = ($$anchor2) => {
|
|
13205
|
-
var ul =
|
|
13137
|
+
var ul = root_52();
|
|
13206
13138
|
each(ul, 21, () => get2(options), index, ($$anchor3, item, index2) => {
|
|
13207
13139
|
const isSelected = user_derived(() => get2(item).value === text2(get2(value)));
|
|
13208
13140
|
const isActive = user_derived(() => index2 === get2(activeIndex));
|
|
@@ -16053,7 +15985,7 @@ function TabItem($$anchor, $$props) {
|
|
|
16053
15985
|
delegate(["click"]);
|
|
16054
15986
|
|
|
16055
15987
|
// src/components/svelte/input/Tabs.svelte
|
|
16056
|
-
var
|
|
15988
|
+
var root_53 = from_html(`<span class="slex-sr-only"> </span>`);
|
|
16057
15989
|
var root_36 = from_html(`<!> <!>`, 1);
|
|
16058
15990
|
var root_82 = from_html(`<div></div>`);
|
|
16059
15991
|
var root_18 = from_html(`<!> <span class="slex-tabs-selected-indicator" aria-hidden="true"></span>`, 1);
|
|
@@ -16231,7 +16163,7 @@ function Tabs2($$anchor, $$props) {
|
|
|
16231
16163
|
var node_4 = sibling(node_3, 2);
|
|
16232
16164
|
{
|
|
16233
16165
|
var consequent_1 = ($$anchor5) => {
|
|
16234
|
-
var span =
|
|
16166
|
+
var span = root_53();
|
|
16235
16167
|
var text_1 = child(span, true);
|
|
16236
16168
|
reset(span);
|
|
16237
16169
|
template_effect(() => set_text(text_1, get2(label2)));
|
|
@@ -16671,7 +16603,7 @@ var root_43 = from_svg(`<svg fill="currentColor" viewBox="0 0 20 20" xmlns="http
|
|
|
16671
16603
|
var root_111 = from_html(`<button><!> <!></button>`);
|
|
16672
16604
|
var root_62 = from_html(`<span class="sr-only"> </span>`);
|
|
16673
16605
|
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>`);
|
|
16674
|
-
var
|
|
16606
|
+
var root_54 = from_html(`<a><!> <!></a>`);
|
|
16675
16607
|
function CloseButton($$anchor, $$props) {
|
|
16676
16608
|
push($$props, true);
|
|
16677
16609
|
let color = prop($$props, "color", 3, "gray"), name = prop($$props, "name", 3, "Close"), size = prop($$props, "size", 3, "md"), restProps = rest_props($$props, [
|
|
@@ -16745,7 +16677,7 @@ function CloseButton($$anchor, $$props) {
|
|
|
16745
16677
|
append($$anchor2, button);
|
|
16746
16678
|
};
|
|
16747
16679
|
var alternate_2 = ($$anchor2) => {
|
|
16748
|
-
var a =
|
|
16680
|
+
var a = root_54();
|
|
16749
16681
|
attribute_effect(a, ($0) => ({
|
|
16750
16682
|
...restProps,
|
|
16751
16683
|
onclick,
|
|
@@ -17378,11 +17310,21 @@ function Text2($$anchor, $$props) {
|
|
|
17378
17310
|
push($$props, true);
|
|
17379
17311
|
let p = state(proxy({}));
|
|
17380
17312
|
user_effect(() => bindPropStore($$props.props, (next2) => set(p, next2, true)));
|
|
17313
|
+
const color = user_derived(() => get2(p).color == null || get2(p).color === "" ? undefined : text2(get2(p).color));
|
|
17314
|
+
const size = user_derived(() => cssLength(get2(p).size));
|
|
17315
|
+
function cssLength(value) {
|
|
17316
|
+
if (value == null || value === "")
|
|
17317
|
+
return;
|
|
17318
|
+
const rendered = text2(value);
|
|
17319
|
+
return /^-?\d+(\.\d+)?$/.test(rendered) ? `${rendered}px` : rendered;
|
|
17320
|
+
}
|
|
17381
17321
|
var div = root20();
|
|
17322
|
+
let styles;
|
|
17382
17323
|
var text_1 = child(div, true);
|
|
17383
17324
|
reset(div);
|
|
17384
17325
|
template_effect(($0, $1) => {
|
|
17385
17326
|
set_class(div, 1, $0);
|
|
17327
|
+
styles = set_style(div, "", styles, { color: get2(color), "font-size": get2(size) });
|
|
17386
17328
|
set_text(text_1, $1);
|
|
17387
17329
|
}, [
|
|
17388
17330
|
() => `slex-text${get2(p).variant ? ` slex-text--${text2(get2(p).variant)}` : ""}${get2(p).class ? ` ${text2(get2(p).class)}` : ""}`,
|
|
@@ -17554,7 +17496,7 @@ var root_311 = from_html(`<span> </span>`);
|
|
|
17554
17496
|
var root_45 = from_html(`<span class="slex-code-block-language"> </span>`);
|
|
17555
17497
|
var root_114 = from_html(`<figcaption class="slex-code-block-header"><span class="slex-code-block-title"><!> <!></span> <!></figcaption>`);
|
|
17556
17498
|
var root_72 = from_html(`<span> </span>`);
|
|
17557
|
-
var
|
|
17499
|
+
var root_55 = from_html(`<span class="slex-code-line"><span class="slex-code-line-content"></span></span>`);
|
|
17558
17500
|
var root22 = from_html(`<figure class="slex-code-block"><!> <pre class="slex-code-block-pre"><code></code></pre></figure>`);
|
|
17559
17501
|
function CodeBlock($$anchor, $$props) {
|
|
17560
17502
|
push($$props, true);
|
|
@@ -17723,7 +17665,7 @@ function CodeBlock($$anchor, $$props) {
|
|
|
17723
17665
|
var pre = sibling(node, 2);
|
|
17724
17666
|
var code_1 = child(pre);
|
|
17725
17667
|
each(code_1, 21, () => get2(lines), index, ($$anchor2, line) => {
|
|
17726
|
-
var span_3 =
|
|
17668
|
+
var span_3 = root_55();
|
|
17727
17669
|
var span_4 = child(span_3);
|
|
17728
17670
|
each(span_4, 21, () => get2(line), index, ($$anchor3, token) => {
|
|
17729
17671
|
var fragment_1 = comment();
|
|
@@ -31863,7 +31805,7 @@ function Table($$anchor, $$props) {
|
|
|
31863
31805
|
|
|
31864
31806
|
// src/components/svelte/content/Section.svelte
|
|
31865
31807
|
var root_28 = from_html(`<div class="slex-section-eyebrow"> </div>`);
|
|
31866
|
-
var
|
|
31808
|
+
var root_56 = from_html(`<span> </span>`);
|
|
31867
31809
|
var root_313 = from_html(`<h2 class="slex-section-title"><!><!></h2>`);
|
|
31868
31810
|
var root_65 = from_html(`<p class="slex-section-subtitle"> </p>`);
|
|
31869
31811
|
var root_73 = from_html(`<a class="slex-section-action"> </a>`);
|
|
@@ -31914,7 +31856,7 @@ function Section($$anchor, $$props) {
|
|
|
31914
31856
|
var node_4 = sibling(node_3);
|
|
31915
31857
|
{
|
|
31916
31858
|
var consequent_2 = ($$anchor4) => {
|
|
31917
|
-
var span =
|
|
31859
|
+
var span = root_56();
|
|
31918
31860
|
var text_2 = child(span, true);
|
|
31919
31861
|
reset(span);
|
|
31920
31862
|
template_effect(($0) => set_text(text_2, $0), [() => text2(get2(p).title)]);
|
package/dist/types/version.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export declare const SLEXKIT_VERSION = "0.3.
|
|
1
|
+
export declare const SLEXKIT_VERSION = "0.3.2";
|
|
2
2
|
export declare const SLEX_PROTOCOL_VERSION = "0.1";
|
|
3
|
-
export declare const SLEXKIT_COMPONENTS_VERSION = "0.3.
|
|
3
|
+
export declare const SLEXKIT_COMPONENTS_VERSION = "0.3.2";
|
|
4
4
|
export declare function getSlexKitInfo(): {
|
|
5
5
|
version: string;
|
|
6
6
|
protocolVersion: string;
|