sibujs 3.1.0 → 3.2.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/README.md +6 -0
- package/dist/browser.cjs +16 -8
- package/dist/browser.js +6 -5
- package/dist/build.cjs +235 -147
- package/dist/build.js +35 -24
- package/dist/cdn.global.js +7 -7
- package/dist/{chunk-WYU7CYJ3.js → chunk-2C4E3HBM.js} +5 -5
- package/dist/{chunk-3DYB5B3S.js → chunk-4JCAUOLN.js} +45 -23
- package/dist/{chunk-2HAGQWDV.js → chunk-5N74TKLD.js} +1 -1
- package/dist/{chunk-SVVAUX7J.js → chunk-7XDYVJLE.js} +19 -9
- package/dist/{chunk-2N2UL7O4.js → chunk-BGNLPNGV.js} +20 -12
- package/dist/{chunk-RK4BQG25.js → chunk-C427DVQF.js} +1 -1
- package/dist/{chunk-ZIBE2SAT.js → chunk-FDY42FIU.js} +3 -2
- package/dist/{chunk-GQ7RRFPU.js → chunk-FOI23UJL.js} +11 -1
- package/dist/{chunk-2RA7SHDA.js → chunk-GOJMFRBL.js} +20 -4
- package/dist/{chunk-IVOUCSZL.js → chunk-GOUM4JCT.js} +6 -6
- package/dist/chunk-H3SRKIYX.js +17 -0
- package/dist/{chunk-3DJH25UO.js → chunk-H6PCHJZQ.js} +2 -2
- package/dist/{chunk-UCS6AMJ7.js → chunk-HMJFCBRR.js} +26 -3
- package/dist/{chunk-JYD2PWXH.js → chunk-HXMS4SNP.js} +22 -15
- package/dist/{chunk-SC437AMI.js → chunk-JYXOEYI4.js} +12 -18
- package/dist/{chunk-KB3BA2XK.js → chunk-NFYWLRUO.js} +11 -18
- package/dist/{chunk-QNQY5DUS.js → chunk-NPIEEKPT.js} +20 -11
- package/dist/{chunk-UYX2NDOH.js → chunk-OYLPZO4N.js} +33 -15
- package/dist/{chunk-LYTCUZ7H.js → chunk-RDRSWYNP.js} +1 -1
- package/dist/{chunk-2ZJ7TSW4.js → chunk-RLUJL2MV.js} +4 -8
- package/dist/{chunk-CR4MXPHB.js → chunk-V2MTG5FT.js} +99 -36
- package/dist/{chunk-CNZ35WI2.js → chunk-VJE6DDYM.js} +2 -2
- package/dist/{chunk-PMSDFTK3.js → chunk-VOCE4NNK.js} +157 -75
- package/dist/{chunk-WKUXSE7V.js → chunk-X67UYC74.js} +12 -11
- package/dist/{chunk-EFOAE5NC.js → chunk-YFDGQWDA.js} +1 -1
- package/dist/{chunk-3U4ZVXVD.js → chunk-Z2FWAE4B.js} +6 -2
- package/dist/data.cjs +190 -94
- package/dist/data.d.cts +7 -1
- package/dist/data.d.ts +7 -1
- package/dist/data.js +8 -8
- package/dist/devtools.cjs +38 -10
- package/dist/devtools.d.cts +1 -1
- package/dist/devtools.d.ts +1 -1
- package/dist/devtools.js +6 -6
- package/dist/ecosystem.cjs +123 -63
- package/dist/ecosystem.js +9 -9
- package/dist/extras.cjs +380 -196
- package/dist/extras.d.cts +2 -2
- package/dist/extras.d.ts +2 -2
- package/dist/extras.js +27 -24
- package/dist/index.cjs +214 -136
- package/dist/index.d.cts +15 -2
- package/dist/index.d.ts +15 -2
- package/dist/index.js +15 -13
- package/dist/{introspect-BZWKvQUZ.d.ts → introspect-DOZfmC-4.d.ts} +1 -1
- package/dist/{introspect-DsJlDD2T.d.cts → introspect-RjLfIFpL.d.cts} +1 -1
- package/dist/motion.cjs +10 -0
- package/dist/motion.js +3 -3
- package/dist/patterns.cjs +45 -40
- package/dist/patterns.js +8 -7
- package/dist/performance.cjs +101 -25
- package/dist/performance.d.cts +2 -2
- package/dist/performance.d.ts +2 -2
- package/dist/performance.js +8 -7
- package/dist/plugins.cjs +234 -160
- package/dist/plugins.d.cts +1 -1
- package/dist/plugins.d.ts +1 -1
- package/dist/plugins.js +127 -69
- package/dist/{ssr-FXD2PPMC.js → ssr-2QDQ27EV.js} +5 -3
- package/dist/{ssr-CrVNy6Pa.d.cts → ssr-D62yFwuw.d.cts} +8 -1
- package/dist/{ssr-CrVNy6Pa.d.ts → ssr-D62yFwuw.d.ts} +8 -1
- package/dist/ssr.cjs +145 -66
- package/dist/ssr.d.cts +1 -1
- package/dist/ssr.d.ts +1 -1
- package/dist/ssr.js +12 -10
- package/dist/testing.cjs +9 -4
- package/dist/testing.js +3 -3
- package/dist/ui.cjs +54 -38
- package/dist/ui.js +10 -9
- package/dist/widgets.cjs +40 -24
- package/dist/widgets.js +8 -8
- package/package.json +3 -1
package/dist/ui.cjs
CHANGED
|
@@ -251,7 +251,7 @@ function track(effectFn, subscriber) {
|
|
|
251
251
|
function reactiveBinding(commit) {
|
|
252
252
|
const run = () => {
|
|
253
253
|
const s = subscriber;
|
|
254
|
-
if (s._reentrant) return;
|
|
254
|
+
if (s._disposed || s._reentrant) return;
|
|
255
255
|
s._reentrant = true;
|
|
256
256
|
try {
|
|
257
257
|
retrack(commit, subscriber);
|
|
@@ -267,8 +267,12 @@ function reactiveBinding(commit) {
|
|
|
267
267
|
subscriber._runEpoch = 0;
|
|
268
268
|
subscriber._runs = 0;
|
|
269
269
|
subscriber._reentrant = false;
|
|
270
|
+
subscriber._disposed = false;
|
|
270
271
|
run();
|
|
271
|
-
return subscriber._dispose ?? (subscriber._dispose = () =>
|
|
272
|
+
return subscriber._dispose ?? (subscriber._dispose = () => {
|
|
273
|
+
subscriber._disposed = true;
|
|
274
|
+
cleanup(subscriber);
|
|
275
|
+
});
|
|
272
276
|
}
|
|
273
277
|
function recordDependency(signal2) {
|
|
274
278
|
if (!currentSubscriber) return;
|
|
@@ -428,6 +432,7 @@ function derived(getter, options) {
|
|
|
428
432
|
const equals = options?.equals;
|
|
429
433
|
const cs = {};
|
|
430
434
|
cs._d = false;
|
|
435
|
+
cs._init = false;
|
|
431
436
|
cs._g = getter;
|
|
432
437
|
cs.__v = 0;
|
|
433
438
|
const markDirty = () => {
|
|
@@ -436,11 +441,18 @@ function derived(getter, options) {
|
|
|
436
441
|
};
|
|
437
442
|
markDirty._c = 1;
|
|
438
443
|
markDirty._sig = cs;
|
|
444
|
+
const recompute = () => {
|
|
445
|
+
const next = getter();
|
|
446
|
+
cs._v = equals && cs._init ? equals(cs._v, next) ? cs._v : next : next;
|
|
447
|
+
cs._d = false;
|
|
448
|
+
cs._init = true;
|
|
449
|
+
};
|
|
439
450
|
track(() => {
|
|
440
451
|
let threw = true;
|
|
441
452
|
try {
|
|
442
453
|
cs._v = getter();
|
|
443
454
|
cs._d = false;
|
|
455
|
+
cs._init = true;
|
|
444
456
|
threw = false;
|
|
445
457
|
} finally {
|
|
446
458
|
if (threw) cs._d = true;
|
|
@@ -456,20 +468,13 @@ function derived(getter, options) {
|
|
|
456
468
|
}
|
|
457
469
|
if (trackingSuspended) {
|
|
458
470
|
if (cs._d) {
|
|
471
|
+
const prev = cs._v;
|
|
459
472
|
evaluating = true;
|
|
460
|
-
let threw = true;
|
|
461
473
|
try {
|
|
462
|
-
|
|
463
|
-
retrack(() => {
|
|
464
|
-
const next = getter();
|
|
465
|
-
cs._v = equals && cs._v !== void 0 ? equals(cs._v, next) ? cs._v : next : next;
|
|
466
|
-
cs._d = false;
|
|
467
|
-
threw = false;
|
|
468
|
-
}, markDirty);
|
|
474
|
+
retrack(recompute, markDirty);
|
|
469
475
|
if (!Object.is(prev, cs._v)) cs.__v++;
|
|
470
476
|
} finally {
|
|
471
477
|
evaluating = false;
|
|
472
|
-
if (threw) cs._d = true;
|
|
473
478
|
}
|
|
474
479
|
}
|
|
475
480
|
return cs._v;
|
|
@@ -478,18 +483,11 @@ function derived(getter, options) {
|
|
|
478
483
|
if (cs._d) {
|
|
479
484
|
const oldValue = cs._v;
|
|
480
485
|
evaluating = true;
|
|
481
|
-
let threw = true;
|
|
482
486
|
try {
|
|
483
|
-
retrack(
|
|
484
|
-
const next = getter();
|
|
485
|
-
cs._v = equals && cs._v !== void 0 ? equals(cs._v, next) ? cs._v : next : next;
|
|
486
|
-
cs._d = false;
|
|
487
|
-
threw = false;
|
|
488
|
-
}, markDirty);
|
|
487
|
+
retrack(recompute, markDirty);
|
|
489
488
|
if (!Object.is(oldValue, cs._v)) cs.__v++;
|
|
490
489
|
} finally {
|
|
491
490
|
evaluating = false;
|
|
492
|
-
if (threw) cs._d = true;
|
|
493
491
|
}
|
|
494
492
|
if (hook && oldValue !== cs._v) {
|
|
495
493
|
hook.emit("computed:update", { signal: cs, oldValue, newValue: cs._v });
|
|
@@ -883,11 +881,15 @@ function dispose(node) {
|
|
|
883
881
|
var als = null;
|
|
884
882
|
try {
|
|
885
883
|
if (typeof process !== "undefined" && process.versions && process.versions.node) {
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
884
|
+
let mod = null;
|
|
885
|
+
const getBuiltin = process.getBuiltinModule;
|
|
886
|
+
if (typeof getBuiltin === "function") {
|
|
887
|
+
mod = getBuiltin("node:async_hooks");
|
|
888
|
+
} else {
|
|
889
|
+
const req = Function("return typeof require==='function'?require:null")();
|
|
890
|
+
if (req) mod = req("node:async_hooks");
|
|
890
891
|
}
|
|
892
|
+
if (mod) als = new mod.AsyncLocalStorage();
|
|
891
893
|
}
|
|
892
894
|
} catch {
|
|
893
895
|
als = null;
|
|
@@ -989,6 +991,7 @@ function effect(effectFn, options) {
|
|
|
989
991
|
ctx.fn(ctx.onCleanup);
|
|
990
992
|
};
|
|
991
993
|
const sub = (() => {
|
|
994
|
+
if (ctx.disposed) return;
|
|
992
995
|
if (ctx.running) {
|
|
993
996
|
ctx.rerunPending = true;
|
|
994
997
|
return;
|
|
@@ -1053,7 +1056,10 @@ function VirtualList(props) {
|
|
|
1053
1056
|
const visibleCount = Math.ceil(props.containerHeight / props.itemHeight) + 2 * overscan;
|
|
1054
1057
|
const endIndex = Math.min(items.length, startIndex + visibleCount);
|
|
1055
1058
|
content.style.top = `${startIndex * props.itemHeight}px`;
|
|
1056
|
-
content.
|
|
1059
|
+
while (content.firstChild) {
|
|
1060
|
+
dispose(content.firstChild);
|
|
1061
|
+
content.removeChild(content.firstChild);
|
|
1062
|
+
}
|
|
1057
1063
|
for (let i = startIndex; i < endIndex; i++) {
|
|
1058
1064
|
const itemEl = props.renderItem(items[i], i);
|
|
1059
1065
|
itemEl.style.height = `${props.itemHeight}px`;
|
|
@@ -1061,7 +1067,7 @@ function VirtualList(props) {
|
|
|
1061
1067
|
content.appendChild(itemEl);
|
|
1062
1068
|
}
|
|
1063
1069
|
};
|
|
1064
|
-
effect(update);
|
|
1070
|
+
registerDisposer(container, effect(update));
|
|
1065
1071
|
return container;
|
|
1066
1072
|
}
|
|
1067
1073
|
|
|
@@ -1202,7 +1208,10 @@ function inputMask(options) {
|
|
|
1202
1208
|
}
|
|
1203
1209
|
}
|
|
1204
1210
|
}
|
|
1205
|
-
|
|
1211
|
+
try {
|
|
1212
|
+
input.setSelectionRange(newCursor, newCursor);
|
|
1213
|
+
} catch {
|
|
1214
|
+
}
|
|
1206
1215
|
};
|
|
1207
1216
|
const onFocus = () => {
|
|
1208
1217
|
if (!input.value) {
|
|
@@ -1244,9 +1253,12 @@ function aria(element, attrs) {
|
|
|
1244
1253
|
const ariaKey = key.startsWith("aria-") ? key : `aria-${key}`;
|
|
1245
1254
|
if (typeof value === "function") {
|
|
1246
1255
|
const getter = value;
|
|
1247
|
-
|
|
1248
|
-
element
|
|
1249
|
-
|
|
1256
|
+
registerDisposer(
|
|
1257
|
+
element,
|
|
1258
|
+
track(() => {
|
|
1259
|
+
element.setAttribute(ariaKey, String(getter()));
|
|
1260
|
+
})
|
|
1261
|
+
);
|
|
1250
1262
|
} else {
|
|
1251
1263
|
element.setAttribute(ariaKey, String(value));
|
|
1252
1264
|
}
|
|
@@ -1509,6 +1521,7 @@ function createListbox(container, options = {}) {
|
|
|
1509
1521
|
const opts = Array.from(container.querySelectorAll(optionSelector));
|
|
1510
1522
|
for (const opt of opts) {
|
|
1511
1523
|
if (!opt.id) opt.id = createId("listbox-option");
|
|
1524
|
+
if (!opt.hasAttribute("aria-selected")) opt.setAttribute("aria-selected", "false");
|
|
1512
1525
|
}
|
|
1513
1526
|
}
|
|
1514
1527
|
stampIds();
|
|
@@ -1699,9 +1712,17 @@ function removeScopedStyle(scopeId) {
|
|
|
1699
1712
|
}
|
|
1700
1713
|
|
|
1701
1714
|
// src/utils/sanitize.ts
|
|
1715
|
+
function stripControlChars(value) {
|
|
1716
|
+
return value.replace(/[\x00-\x20\x7f-\x9f]+/g, "");
|
|
1717
|
+
}
|
|
1718
|
+
function isEventHandlerAttr(name) {
|
|
1719
|
+
if (name.length < 3) return false;
|
|
1720
|
+
const lower = name.toLowerCase();
|
|
1721
|
+
return lower[0] === "o" && lower[1] === "n" && lower.charCodeAt(2) >= 97 && lower.charCodeAt(2) <= 122;
|
|
1722
|
+
}
|
|
1702
1723
|
var SAFE_URL_PROTOCOLS = ["http:", "https:", "mailto:", "tel:", "ftp:"];
|
|
1703
1724
|
function sanitizeUrl(url) {
|
|
1704
|
-
const trimmed = url
|
|
1725
|
+
const trimmed = stripControlChars(url).trim();
|
|
1705
1726
|
if (!trimmed) return "";
|
|
1706
1727
|
const lower = trimmed.toLowerCase();
|
|
1707
1728
|
let schemeEnd = -1;
|
|
@@ -1734,7 +1755,7 @@ var URL_ATTRIBUTES = /* @__PURE__ */ new Set([
|
|
|
1734
1755
|
"data"
|
|
1735
1756
|
]);
|
|
1736
1757
|
function isUrlAttribute(attr) {
|
|
1737
|
-
return URL_ATTRIBUTES.has(attr);
|
|
1758
|
+
return URL_ATTRIBUTES.has(attr.toLowerCase());
|
|
1738
1759
|
}
|
|
1739
1760
|
|
|
1740
1761
|
// src/reactivity/bindAttribute.ts
|
|
@@ -1742,11 +1763,6 @@ var _isDev5 = isDev();
|
|
|
1742
1763
|
function setProp(el, key, val) {
|
|
1743
1764
|
el[key] = val;
|
|
1744
1765
|
}
|
|
1745
|
-
function isEventHandlerAttr(name) {
|
|
1746
|
-
if (name.length < 3) return false;
|
|
1747
|
-
const lower = name.toLowerCase();
|
|
1748
|
-
return lower[0] === "o" && lower[1] === "n" && lower.charCodeAt(2) >= 97 && lower.charCodeAt(2) <= 122;
|
|
1749
|
-
}
|
|
1750
1766
|
function bindAttribute(el, attr, getter) {
|
|
1751
1767
|
if (isEventHandlerAttr(attr)) {
|
|
1752
1768
|
if (_isDev5)
|
|
@@ -2323,7 +2339,7 @@ function withBoundary(name, component) {
|
|
|
2323
2339
|
function createSlots(slots) {
|
|
2324
2340
|
return {
|
|
2325
2341
|
renderSlot(name, fallback) {
|
|
2326
|
-
const slotFn = slots[name];
|
|
2342
|
+
const slotFn = Object.hasOwn(slots, name) ? slots[name] : void 0;
|
|
2327
2343
|
if (slotFn) {
|
|
2328
2344
|
const result = slotFn();
|
|
2329
2345
|
if (Array.isArray(result)) {
|
|
@@ -2337,7 +2353,7 @@ function createSlots(slots) {
|
|
|
2337
2353
|
return fallback ? fallback() : null;
|
|
2338
2354
|
},
|
|
2339
2355
|
hasSlot(name) {
|
|
2340
|
-
return name
|
|
2356
|
+
return Object.hasOwn(slots, name);
|
|
2341
2357
|
}
|
|
2342
2358
|
};
|
|
2343
2359
|
}
|
package/dist/ui.js
CHANGED
|
@@ -38,7 +38,7 @@ import {
|
|
|
38
38
|
toast,
|
|
39
39
|
withScopedStyle,
|
|
40
40
|
zipMask
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-NPIEEKPT.js";
|
|
42
42
|
import {
|
|
43
43
|
RenderProp,
|
|
44
44
|
assertType,
|
|
@@ -54,24 +54,24 @@ import {
|
|
|
54
54
|
withDefaults,
|
|
55
55
|
withProps,
|
|
56
56
|
withWrapper
|
|
57
|
-
} from "./chunk-
|
|
57
|
+
} from "./chunk-VJE6DDYM.js";
|
|
58
58
|
import {
|
|
59
59
|
createId
|
|
60
60
|
} from "./chunk-YT6HQ6AM.js";
|
|
61
|
-
import "./chunk-
|
|
62
|
-
import "./chunk-
|
|
61
|
+
import "./chunk-RLUJL2MV.js";
|
|
62
|
+
import "./chunk-JYXOEYI4.js";
|
|
63
63
|
import {
|
|
64
64
|
registerDisposer
|
|
65
65
|
} from "./chunk-2UPRY23K.js";
|
|
66
|
-
import "./chunk-
|
|
66
|
+
import "./chunk-HMJFCBRR.js";
|
|
67
67
|
import {
|
|
68
68
|
effect
|
|
69
|
-
} from "./chunk-
|
|
70
|
-
import "./chunk-
|
|
69
|
+
} from "./chunk-FDY42FIU.js";
|
|
70
|
+
import "./chunk-GOJMFRBL.js";
|
|
71
71
|
import {
|
|
72
72
|
signal
|
|
73
|
-
} from "./chunk-
|
|
74
|
-
import "./chunk-
|
|
73
|
+
} from "./chunk-C427DVQF.js";
|
|
74
|
+
import "./chunk-Z2FWAE4B.js";
|
|
75
75
|
import "./chunk-LMLD24FC.js";
|
|
76
76
|
|
|
77
77
|
// src/ui/formAction.ts
|
|
@@ -170,6 +170,7 @@ function createListbox(container, options = {}) {
|
|
|
170
170
|
const opts = Array.from(container.querySelectorAll(optionSelector));
|
|
171
171
|
for (const opt of opts) {
|
|
172
172
|
if (!opt.id) opt.id = createId("listbox-option");
|
|
173
|
+
if (!opt.hasAttribute("aria-selected")) opt.setAttribute("aria-selected", "false");
|
|
173
174
|
}
|
|
174
175
|
}
|
|
175
176
|
stampIds();
|
package/dist/widgets.cjs
CHANGED
|
@@ -198,7 +198,7 @@ function track(effectFn, subscriber) {
|
|
|
198
198
|
function reactiveBinding(commit) {
|
|
199
199
|
const run = () => {
|
|
200
200
|
const s = subscriber;
|
|
201
|
-
if (s._reentrant) return;
|
|
201
|
+
if (s._disposed || s._reentrant) return;
|
|
202
202
|
s._reentrant = true;
|
|
203
203
|
try {
|
|
204
204
|
retrack(commit, subscriber);
|
|
@@ -214,8 +214,12 @@ function reactiveBinding(commit) {
|
|
|
214
214
|
subscriber._runEpoch = 0;
|
|
215
215
|
subscriber._runs = 0;
|
|
216
216
|
subscriber._reentrant = false;
|
|
217
|
+
subscriber._disposed = false;
|
|
217
218
|
run();
|
|
218
|
-
return subscriber._dispose ?? (subscriber._dispose = () =>
|
|
219
|
+
return subscriber._dispose ?? (subscriber._dispose = () => {
|
|
220
|
+
subscriber._disposed = true;
|
|
221
|
+
cleanup(subscriber);
|
|
222
|
+
});
|
|
219
223
|
}
|
|
220
224
|
function recordDependency(signal2) {
|
|
221
225
|
if (!currentSubscriber) return;
|
|
@@ -405,6 +409,7 @@ function derived(getter, options) {
|
|
|
405
409
|
const equals = options?.equals;
|
|
406
410
|
const cs = {};
|
|
407
411
|
cs._d = false;
|
|
412
|
+
cs._init = false;
|
|
408
413
|
cs._g = getter;
|
|
409
414
|
cs.__v = 0;
|
|
410
415
|
const markDirty = () => {
|
|
@@ -413,11 +418,18 @@ function derived(getter, options) {
|
|
|
413
418
|
};
|
|
414
419
|
markDirty._c = 1;
|
|
415
420
|
markDirty._sig = cs;
|
|
421
|
+
const recompute = () => {
|
|
422
|
+
const next = getter();
|
|
423
|
+
cs._v = equals && cs._init ? equals(cs._v, next) ? cs._v : next : next;
|
|
424
|
+
cs._d = false;
|
|
425
|
+
cs._init = true;
|
|
426
|
+
};
|
|
416
427
|
track(() => {
|
|
417
428
|
let threw = true;
|
|
418
429
|
try {
|
|
419
430
|
cs._v = getter();
|
|
420
431
|
cs._d = false;
|
|
432
|
+
cs._init = true;
|
|
421
433
|
threw = false;
|
|
422
434
|
} finally {
|
|
423
435
|
if (threw) cs._d = true;
|
|
@@ -433,20 +445,13 @@ function derived(getter, options) {
|
|
|
433
445
|
}
|
|
434
446
|
if (trackingSuspended) {
|
|
435
447
|
if (cs._d) {
|
|
448
|
+
const prev = cs._v;
|
|
436
449
|
evaluating = true;
|
|
437
|
-
let threw = true;
|
|
438
450
|
try {
|
|
439
|
-
|
|
440
|
-
retrack(() => {
|
|
441
|
-
const next = getter();
|
|
442
|
-
cs._v = equals && cs._v !== void 0 ? equals(cs._v, next) ? cs._v : next : next;
|
|
443
|
-
cs._d = false;
|
|
444
|
-
threw = false;
|
|
445
|
-
}, markDirty);
|
|
451
|
+
retrack(recompute, markDirty);
|
|
446
452
|
if (!Object.is(prev, cs._v)) cs.__v++;
|
|
447
453
|
} finally {
|
|
448
454
|
evaluating = false;
|
|
449
|
-
if (threw) cs._d = true;
|
|
450
455
|
}
|
|
451
456
|
}
|
|
452
457
|
return cs._v;
|
|
@@ -455,18 +460,11 @@ function derived(getter, options) {
|
|
|
455
460
|
if (cs._d) {
|
|
456
461
|
const oldValue = cs._v;
|
|
457
462
|
evaluating = true;
|
|
458
|
-
let threw = true;
|
|
459
463
|
try {
|
|
460
|
-
retrack(
|
|
461
|
-
const next = getter();
|
|
462
|
-
cs._v = equals && cs._v !== void 0 ? equals(cs._v, next) ? cs._v : next : next;
|
|
463
|
-
cs._d = false;
|
|
464
|
-
threw = false;
|
|
465
|
-
}, markDirty);
|
|
464
|
+
retrack(recompute, markDirty);
|
|
466
465
|
if (!Object.is(oldValue, cs._v)) cs.__v++;
|
|
467
466
|
} finally {
|
|
468
467
|
evaluating = false;
|
|
469
|
-
if (threw) cs._d = true;
|
|
470
468
|
}
|
|
471
469
|
if (hook && oldValue !== cs._v) {
|
|
472
470
|
hook.emit("computed:update", { signal: cs, oldValue, newValue: cs._v });
|
|
@@ -487,11 +485,15 @@ function derived(getter, options) {
|
|
|
487
485
|
var als = null;
|
|
488
486
|
try {
|
|
489
487
|
if (typeof process !== "undefined" && process.versions && process.versions.node) {
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
488
|
+
let mod = null;
|
|
489
|
+
const getBuiltin = process.getBuiltinModule;
|
|
490
|
+
if (typeof getBuiltin === "function") {
|
|
491
|
+
mod = getBuiltin("node:async_hooks");
|
|
492
|
+
} else {
|
|
493
|
+
const req = Function("return typeof require==='function'?require:null")();
|
|
494
|
+
if (req) mod = req("node:async_hooks");
|
|
494
495
|
}
|
|
496
|
+
if (mod) als = new mod.AsyncLocalStorage();
|
|
495
497
|
}
|
|
496
498
|
} catch {
|
|
497
499
|
als = null;
|
|
@@ -593,6 +595,7 @@ function effect(effectFn, options) {
|
|
|
593
595
|
ctx.fn(ctx.onCleanup);
|
|
594
596
|
};
|
|
595
597
|
const sub = (() => {
|
|
598
|
+
if (ctx.disposed) return;
|
|
596
599
|
if (ctx.running) {
|
|
597
600
|
ctx.rerunPending = true;
|
|
598
601
|
return;
|
|
@@ -1772,7 +1775,20 @@ function fileUpload(options) {
|
|
|
1772
1775
|
|
|
1773
1776
|
// src/utils/sanitize.ts
|
|
1774
1777
|
function stripHtml(html) {
|
|
1775
|
-
|
|
1778
|
+
const input = String(html);
|
|
1779
|
+
if (typeof DOMParser !== "undefined") {
|
|
1780
|
+
try {
|
|
1781
|
+
return new DOMParser().parseFromString(input, "text/html").body.textContent ?? "";
|
|
1782
|
+
} catch {
|
|
1783
|
+
}
|
|
1784
|
+
}
|
|
1785
|
+
let prev;
|
|
1786
|
+
let out = input;
|
|
1787
|
+
do {
|
|
1788
|
+
prev = out;
|
|
1789
|
+
out = out.replace(/<[^>]*>/g, "");
|
|
1790
|
+
} while (out !== prev);
|
|
1791
|
+
return out.replace(/<[^>]*$/, "");
|
|
1776
1792
|
}
|
|
1777
1793
|
|
|
1778
1794
|
// src/widgets/contentEditable.ts
|
package/dist/widgets.js
CHANGED
|
@@ -8,14 +8,14 @@ import {
|
|
|
8
8
|
select,
|
|
9
9
|
tabs,
|
|
10
10
|
tooltip
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
17
|
-
import "./chunk-
|
|
18
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-2C4E3HBM.js";
|
|
12
|
+
import "./chunk-H6PCHJZQ.js";
|
|
13
|
+
import "./chunk-JYXOEYI4.js";
|
|
14
|
+
import "./chunk-HMJFCBRR.js";
|
|
15
|
+
import "./chunk-FDY42FIU.js";
|
|
16
|
+
import "./chunk-GOJMFRBL.js";
|
|
17
|
+
import "./chunk-C427DVQF.js";
|
|
18
|
+
import "./chunk-Z2FWAE4B.js";
|
|
19
19
|
import "./chunk-LMLD24FC.js";
|
|
20
20
|
export {
|
|
21
21
|
accordion,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sibujs",
|
|
3
|
-
"version": "3.1
|
|
3
|
+
"version": "3.2.1",
|
|
4
4
|
"description": "A lightweight, function-based frontend framework that combines the best of React, Svelte, and Vue — with zero VDOM and maximum simplicity. Designed for developers who want fine-grained reactivity and full control without compilation or magic.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"frontend",
|
|
@@ -136,7 +136,9 @@
|
|
|
136
136
|
"devDependencies": {
|
|
137
137
|
"@biomejs/biome": "2.4.7",
|
|
138
138
|
"@types/node": "^25.5.0",
|
|
139
|
+
"@vitest/coverage-v8": "^3.1.3",
|
|
139
140
|
"@vitest/ui": "^3.1.3",
|
|
141
|
+
"fake-indexeddb": "^6.2.5",
|
|
140
142
|
"jsdom": "^26.1.0",
|
|
141
143
|
"tsup": "^8.5.1",
|
|
142
144
|
"typescript": "^5.8.3",
|