sibujs 4.14.0 → 4.15.0
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/browser.cjs +297 -45
- package/dist/browser.js +6 -7
- package/dist/build.cjs +2189 -573
- package/dist/build.js +16 -15
- package/dist/cdn.dev.global.js +13 -12
- package/dist/cdn.full.dev.global.js +14 -13
- package/dist/cdn.full.global.js +12 -12
- package/dist/cdn.global.js +12 -12
- package/dist/{chunk-RVR5NPFL.js → chunk-2VKTFA7C.js} +1 -1
- package/dist/{chunk-7ILEHTVX.js → chunk-4AEFGRYW.js} +1 -1
- package/dist/{chunk-4TQDTWWN.js → chunk-6IV5ZRG6.js} +5 -7
- package/dist/{chunk-GVAMIU6K.js → chunk-75EAQH3U.js} +2 -2
- package/dist/{chunk-TLS4NVIB.js → chunk-7JO7DPSS.js} +4 -4
- package/dist/{chunk-SVULV7O4.js → chunk-AQH7WDSE.js} +6 -8
- package/dist/{chunk-S37PZD6I.js → chunk-BF3WBJJQ.js} +60 -10
- package/dist/{chunk-LJMX4SQ7.js → chunk-BG4BP44S.js} +3 -3
- package/dist/{chunk-N7A6FKWW.js → chunk-D44TAGCT.js} +2 -2
- package/dist/{chunk-CCKUNHVU.js → chunk-DAEXQJQA.js} +1 -1
- package/dist/chunk-DNCQDFJJ.js +22 -0
- package/dist/{chunk-BKZ5N6NK.js → chunk-DNCT2UXB.js} +4 -4
- package/dist/{chunk-BOYKGGVD.js → chunk-DRWOD7RZ.js} +4 -4
- package/dist/chunk-DS5V2PRE.js +64 -0
- package/dist/{chunk-VM2U5LEL.js → chunk-EHSJESRN.js} +595 -123
- package/dist/{chunk-MIRKTVH4.js → chunk-GFM5WWPU.js} +252 -5
- package/dist/{chunk-52XFPGSN.js → chunk-HTPOIAAL.js} +1 -1
- package/dist/{chunk-3HEX6QJQ.js → chunk-I2R5QALY.js} +2 -4
- package/dist/{chunk-4FJSAUKB.js → chunk-IUBV5WO5.js} +1 -1
- package/dist/{chunk-A454RAEK.js → chunk-KIDETDMU.js} +5 -7
- package/dist/{chunk-JTFQ7IL4.js → chunk-KPAXG5IR.js} +7 -9
- package/dist/{chunk-AE32RGWX.js → chunk-LGUXYHTZ.js} +3 -3
- package/dist/{chunk-Y4LUM2XS.js → chunk-LQWLPQOK.js} +6 -8
- package/dist/{chunk-CNPT6NKV.js → chunk-MINLMJUY.js} +48 -9
- package/dist/{chunk-BNXRWZZV.js → chunk-OURTGOJT.js} +8 -10
- package/dist/{chunk-F67F77IA.js → chunk-TQ24Y3IV.js} +2 -2
- package/dist/{chunk-2TTRW2TE.js → chunk-UM3M5PXS.js} +8 -8
- package/dist/{chunk-CJ7KS3DF.js → chunk-VSTX3XSX.js} +205 -15
- package/dist/{chunk-HQIAL7F2.js → chunk-XPDZ2LDR.js} +2 -2
- package/dist/{chunk-UUIKJJIK.js → chunk-Y7JM7GY2.js} +5 -7
- package/dist/{chunk-QS6GMWDD.js → chunk-YAFITBOK.js} +1269 -162
- package/dist/data.cjs +285 -33
- package/dist/data.js +6 -7
- package/dist/devtools.cjs +289 -39
- package/dist/devtools.js +5 -6
- package/dist/{dispose-EIHHHDC7.js → dispose-3WDBYJMH.js} +3 -1
- package/dist/ecosystem.cjs +345 -61
- package/dist/ecosystem.d.cts +1 -1
- package/dist/ecosystem.d.ts +1 -1
- package/dist/ecosystem.js +10 -10
- package/dist/extras.cjs +568 -248
- package/dist/extras.d.cts +1 -1
- package/dist/extras.d.ts +1 -1
- package/dist/extras.js +27 -27
- package/dist/index.cjs +2134 -515
- package/dist/index.d.cts +628 -211
- package/dist/index.d.ts +628 -211
- package/dist/index.js +22 -15
- package/dist/motion.cjs +286 -30
- package/dist/motion.js +4 -4
- package/dist/patterns.cjs +301 -43
- package/dist/patterns.js +6 -6
- package/dist/performance.cjs +286 -36
- package/dist/performance.js +9 -9
- package/dist/plugins.cjs +1237 -291
- package/dist/plugins.d.cts +3 -1
- package/dist/plugins.d.ts +3 -1
- package/dist/plugins.js +20 -19
- package/dist/{renderRoute-fxgsm2Ir.d.ts → renderRoute-B84MONaO.d.cts} +2 -2
- package/dist/{renderRoute-DP20XwMS.d.cts → renderRoute-_yxPuEQY.d.ts} +2 -2
- package/dist/{routeHead-CE9SV-cH.d.cts → routeHead-DLxlq15W.d.cts} +94 -0
- package/dist/{routeHead-DzVxPviY.d.ts → routeHead-w8nANZ3M.d.ts} +94 -0
- package/dist/{ssr-NECEU4X4.js → ssr-EF3IUHTE.js} +6 -6
- package/dist/ssr-dom.cjs +64 -9
- package/dist/ssr-dom.d.cts +2 -0
- package/dist/ssr-dom.d.ts +2 -0
- package/dist/ssr-dom.js +2 -1
- package/dist/ssr.cjs +850 -170
- package/dist/ssr.d.cts +5 -3
- package/dist/ssr.d.ts +5 -3
- package/dist/ssr.js +16 -15
- package/dist/{tagFactory-DkytnJws.d.cts → tagFactory-BfEh69VF.d.cts} +7 -0
- package/dist/{tagFactory-Bnd_Nph9.d.ts → tagFactory-pSYiLYyh.d.ts} +7 -0
- package/dist/testing.cjs +817 -132
- package/dist/testing.d.cts +4 -2
- package/dist/testing.d.ts +4 -2
- package/dist/testing.js +18 -17
- package/dist/track-core-0edROAF5.d.ts +187 -0
- package/dist/track-core-DN5fYLWi.d.cts +187 -0
- package/dist/ui.cjs +293 -43
- package/dist/ui.js +10 -12
- package/dist/widgets.cjs +285 -27
- package/dist/widgets.js +7 -7
- package/package.json +1 -1
- package/dist/chunk-7ZHH77QA.js +0 -9
package/dist/ui.cjs
CHANGED
|
@@ -187,6 +187,12 @@ function reportError(error, context) {
|
|
|
187
187
|
});
|
|
188
188
|
}
|
|
189
189
|
|
|
190
|
+
// src/utils/globalSingleton.ts
|
|
191
|
+
function globalSingleton(key, create) {
|
|
192
|
+
const g = globalThis;
|
|
193
|
+
return g[key] ?? (g[key] = create());
|
|
194
|
+
}
|
|
195
|
+
|
|
190
196
|
// src/core/dev.ts
|
|
191
197
|
var DEV = typeof __SIBU_DEV__ !== "undefined" ? !!__SIBU_DEV__ : typeof globalThis.__SIBU_DEV__ !== "undefined" ? !!globalThis.__SIBU_DEV__ : (
|
|
192
198
|
// safe default: off in browser, on in test/dev Node
|
|
@@ -217,7 +223,12 @@ function isHydrating() {
|
|
|
217
223
|
}
|
|
218
224
|
|
|
219
225
|
// src/core/rendering/dispose.ts
|
|
220
|
-
var
|
|
226
|
+
var state2 = globalSingleton(/* @__PURE__ */ Symbol.for("sibujs.disposers.v1"), () => ({
|
|
227
|
+
disposers: /* @__PURE__ */ new WeakMap(),
|
|
228
|
+
captures: [],
|
|
229
|
+
bindings: { count: 0 }
|
|
230
|
+
}));
|
|
231
|
+
var elementDisposers = state2.disposers;
|
|
221
232
|
var MAX_DRAIN_TEARDOWNS = 1e4;
|
|
222
233
|
function reportDrainRunaway(label, executed, remaining) {
|
|
223
234
|
if (typeof console === "undefined") return;
|
|
@@ -226,13 +237,13 @@ function reportDrainRunaway(label, executed, remaining) {
|
|
|
226
237
|
{ executed, remaining }
|
|
227
238
|
);
|
|
228
239
|
}
|
|
229
|
-
var
|
|
240
|
+
var bindings = state2.bindings;
|
|
230
241
|
function resolveCapture(capture) {
|
|
231
242
|
let frame = capture;
|
|
232
243
|
while (frame?.closed) frame = frame.forwardTo;
|
|
233
244
|
return frame ?? null;
|
|
234
245
|
}
|
|
235
|
-
var registrationCaptures =
|
|
246
|
+
var registrationCaptures = state2.captures;
|
|
236
247
|
function currentDisposerCapture() {
|
|
237
248
|
return resolveCapture(registrationCaptures[registrationCaptures.length - 1]);
|
|
238
249
|
}
|
|
@@ -251,7 +262,7 @@ function registerDisposer(node, teardown) {
|
|
|
251
262
|
elementDisposers.set(node, disposers);
|
|
252
263
|
}
|
|
253
264
|
disposers.push(teardown);
|
|
254
|
-
if (DEV)
|
|
265
|
+
if (DEV) bindings.count++;
|
|
255
266
|
const capture = resolveCapture(registrationCaptures[registrationCaptures.length - 1]);
|
|
256
267
|
if (capture) capture.entries.push([node, teardown]);
|
|
257
268
|
}
|
|
@@ -304,7 +315,7 @@ function unregisterDisposer(node, teardown) {
|
|
|
304
315
|
const index = disposers.indexOf(teardown);
|
|
305
316
|
if (index === -1) return false;
|
|
306
317
|
disposers.splice(index, 1);
|
|
307
|
-
if (DEV)
|
|
318
|
+
if (DEV) bindings.count--;
|
|
308
319
|
if (disposers.length === 0) elementDisposers.delete(node);
|
|
309
320
|
return true;
|
|
310
321
|
}
|
|
@@ -332,13 +343,13 @@ function disposeNodeOwn(node) {
|
|
|
332
343
|
if (!pending || pending.length === 0) break;
|
|
333
344
|
const snapshot = pending.slice();
|
|
334
345
|
elementDisposers.delete(node);
|
|
335
|
-
if (DEV)
|
|
346
|
+
if (DEV) bindings.count -= snapshot.length;
|
|
336
347
|
for (let i = 0; i < snapshot.length; i++) {
|
|
337
348
|
if (executed >= MAX_DRAIN_TEARDOWNS) {
|
|
338
349
|
const rest = snapshot.slice(i);
|
|
339
350
|
const added = elementDisposers.get(node);
|
|
340
351
|
elementDisposers.set(node, added ? rest.concat(added) : rest);
|
|
341
|
-
if (DEV)
|
|
352
|
+
if (DEV) bindings.count += rest.length;
|
|
342
353
|
reportDrainRunaway("dispose", executed, rest.length + (added?.length ?? 0));
|
|
343
354
|
runaway = true;
|
|
344
355
|
break;
|
|
@@ -541,6 +552,201 @@ function bindOwnerScope(fn) {
|
|
|
541
552
|
return (...args) => runWithOwnerScope(scope, () => fn(...args));
|
|
542
553
|
}
|
|
543
554
|
var currentStructOwner = null;
|
|
555
|
+
var frozenOwners = 0;
|
|
556
|
+
var ACTIVE = 0;
|
|
557
|
+
var PAUSED = 1;
|
|
558
|
+
var ENDED = 2;
|
|
559
|
+
var NOOP = () => {
|
|
560
|
+
};
|
|
561
|
+
var skippedWhileHeld = /* @__PURE__ */ new Set();
|
|
562
|
+
var waiters = /* @__PURE__ */ new Set();
|
|
563
|
+
var heldRoots = /* @__PURE__ */ new Set();
|
|
564
|
+
function ownerState(tok) {
|
|
565
|
+
let state4 = ACTIVE;
|
|
566
|
+
for (let t = tok; t !== null; ) {
|
|
567
|
+
const o = t.sub;
|
|
568
|
+
if (o === null) return ENDED;
|
|
569
|
+
if (o._frozen === true) state4 = PAUSED;
|
|
570
|
+
t = o._owner ?? null;
|
|
571
|
+
}
|
|
572
|
+
return state4;
|
|
573
|
+
}
|
|
574
|
+
var endWatchers = /* @__PURE__ */ new Set();
|
|
575
|
+
var stateWatchers = /* @__PURE__ */ new Set();
|
|
576
|
+
var stateCheckQueued = false;
|
|
577
|
+
function queueStateCheck() {
|
|
578
|
+
if (stateCheckQueued || stateWatchers.size === 0) return;
|
|
579
|
+
stateCheckQueued = true;
|
|
580
|
+
queueMicrotask(() => {
|
|
581
|
+
stateCheckQueued = false;
|
|
582
|
+
for (const watcher of [...stateWatchers]) {
|
|
583
|
+
if (!stateWatchers.has(watcher)) continue;
|
|
584
|
+
const state4 = watcher.check.state();
|
|
585
|
+
if (state4 === ENDED) stateWatchers.delete(watcher);
|
|
586
|
+
if (state4 === ENDED || state4 === watcher.last) continue;
|
|
587
|
+
watcher.last = state4;
|
|
588
|
+
try {
|
|
589
|
+
watcher.listener(state4);
|
|
590
|
+
} catch (err) {
|
|
591
|
+
reportError(err, { phase: "effect" });
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
});
|
|
595
|
+
}
|
|
596
|
+
var ALWAYS_ACTIVE = Object.assign(() => false, {
|
|
597
|
+
state: () => ACTIVE,
|
|
598
|
+
wait: (onActive) => {
|
|
599
|
+
onActive();
|
|
600
|
+
return NOOP;
|
|
601
|
+
},
|
|
602
|
+
onEnd: () => NOOP,
|
|
603
|
+
run: (fn) => fn(),
|
|
604
|
+
onChange: () => NOOP,
|
|
605
|
+
within: () => false
|
|
606
|
+
});
|
|
607
|
+
function captureFrozen() {
|
|
608
|
+
const tok = currentStructOwner;
|
|
609
|
+
if (tok === null) return ALWAYS_ACTIVE;
|
|
610
|
+
const state4 = () => ownerState(tok);
|
|
611
|
+
const check = Object.assign(() => state4() !== ACTIVE, {
|
|
612
|
+
state: state4,
|
|
613
|
+
wait: (onActive, onEnd) => {
|
|
614
|
+
const now = state4();
|
|
615
|
+
if (now !== PAUSED) {
|
|
616
|
+
(now === ACTIVE ? onActive : onEnd)();
|
|
617
|
+
return NOOP;
|
|
618
|
+
}
|
|
619
|
+
const waiter = { check, onActive, onEnd };
|
|
620
|
+
waiters.add(waiter);
|
|
621
|
+
return () => {
|
|
622
|
+
waiters.delete(waiter);
|
|
623
|
+
};
|
|
624
|
+
},
|
|
625
|
+
onEnd: (onEnd) => {
|
|
626
|
+
if (state4() === ENDED) {
|
|
627
|
+
onEnd();
|
|
628
|
+
return NOOP;
|
|
629
|
+
}
|
|
630
|
+
const watcher = { check, onActive: NOOP, onEnd };
|
|
631
|
+
endWatchers.add(watcher);
|
|
632
|
+
return () => {
|
|
633
|
+
endWatchers.delete(watcher);
|
|
634
|
+
};
|
|
635
|
+
},
|
|
636
|
+
run: (fn) => {
|
|
637
|
+
const prev = currentStructOwner;
|
|
638
|
+
currentStructOwner = tok.sub === null ? null : tok;
|
|
639
|
+
try {
|
|
640
|
+
return fn();
|
|
641
|
+
} finally {
|
|
642
|
+
currentStructOwner = prev;
|
|
643
|
+
}
|
|
644
|
+
},
|
|
645
|
+
onChange: (listener) => {
|
|
646
|
+
const last = state4();
|
|
647
|
+
if (last === ENDED) return NOOP;
|
|
648
|
+
const watcher = { check, last, listener };
|
|
649
|
+
stateWatchers.add(watcher);
|
|
650
|
+
return () => {
|
|
651
|
+
stateWatchers.delete(watcher);
|
|
652
|
+
};
|
|
653
|
+
},
|
|
654
|
+
within: (owner) => {
|
|
655
|
+
const target = owner.run(() => currentStructOwner);
|
|
656
|
+
if (target === null) return false;
|
|
657
|
+
for (let t = tok; t !== null; ) {
|
|
658
|
+
if (t === target) return true;
|
|
659
|
+
const o = t.sub;
|
|
660
|
+
if (o === null) return false;
|
|
661
|
+
t = o._owner ?? null;
|
|
662
|
+
}
|
|
663
|
+
return false;
|
|
664
|
+
}
|
|
665
|
+
});
|
|
666
|
+
return check;
|
|
667
|
+
}
|
|
668
|
+
function holdSubtree(root) {
|
|
669
|
+
heldRoots.add(root);
|
|
670
|
+
return () => {
|
|
671
|
+
if (heldRoots.delete(root)) settleHeld();
|
|
672
|
+
};
|
|
673
|
+
}
|
|
674
|
+
function isHeld(sub) {
|
|
675
|
+
if (frozenOwners !== 0 && hasFrozenOwner(sub)) return true;
|
|
676
|
+
if (heldRoots.size !== 0) {
|
|
677
|
+
const node = sub._errorNode;
|
|
678
|
+
if (node != null) {
|
|
679
|
+
for (const root of heldRoots) if (root.contains(node)) return true;
|
|
680
|
+
}
|
|
681
|
+
}
|
|
682
|
+
return false;
|
|
683
|
+
}
|
|
684
|
+
function notifyEnded() {
|
|
685
|
+
for (const watcher of stateWatchers) if (watcher.check.state() === ENDED) stateWatchers.delete(watcher);
|
|
686
|
+
let ended = null;
|
|
687
|
+
for (const watcher of endWatchers) {
|
|
688
|
+
if (watcher.check.state() !== ENDED) continue;
|
|
689
|
+
endWatchers.delete(watcher);
|
|
690
|
+
(ended ?? (ended = [])).push(watcher);
|
|
691
|
+
}
|
|
692
|
+
if (ended === null) return;
|
|
693
|
+
for (const watcher of ended) {
|
|
694
|
+
try {
|
|
695
|
+
watcher.onEnd();
|
|
696
|
+
} catch (err) {
|
|
697
|
+
reportError(err, { phase: "cleanup" });
|
|
698
|
+
}
|
|
699
|
+
}
|
|
700
|
+
}
|
|
701
|
+
function dropReleasedSkipped() {
|
|
702
|
+
for (const sub of skippedWhileHeld) {
|
|
703
|
+
if (sub._disposed === true || sub.depsHead == null) skippedWhileHeld.delete(sub);
|
|
704
|
+
}
|
|
705
|
+
}
|
|
706
|
+
function settleHeld() {
|
|
707
|
+
for (const sub of skippedWhileHeld) {
|
|
708
|
+
if (sub._disposed === true) skippedWhileHeld.delete(sub);
|
|
709
|
+
else if (!isHeld(sub)) {
|
|
710
|
+
skippedWhileHeld.delete(sub);
|
|
711
|
+
if (!pendingSet.has(sub)) {
|
|
712
|
+
pendingSet.add(sub);
|
|
713
|
+
pendingQueue.push(sub);
|
|
714
|
+
}
|
|
715
|
+
}
|
|
716
|
+
}
|
|
717
|
+
if (frozenOwners === 0 && heldRoots.size === 0) skippedWhileHeld.clear();
|
|
718
|
+
let ready = null;
|
|
719
|
+
for (const waiter of waiters) {
|
|
720
|
+
if (waiter.check.state() === PAUSED) continue;
|
|
721
|
+
waiters.delete(waiter);
|
|
722
|
+
(ready ?? (ready = [])).push(waiter);
|
|
723
|
+
}
|
|
724
|
+
if (ready !== null) {
|
|
725
|
+
const settle = ready;
|
|
726
|
+
queueMicrotask(() => {
|
|
727
|
+
for (const waiter of settle) {
|
|
728
|
+
const state4 = waiter.check.state();
|
|
729
|
+
if (state4 === PAUSED) waiters.add(waiter);
|
|
730
|
+
else
|
|
731
|
+
try {
|
|
732
|
+
(state4 === ACTIVE ? waiter.onActive : waiter.onEnd)();
|
|
733
|
+
} catch (err) {
|
|
734
|
+
reportError(err, { phase: "effect" });
|
|
735
|
+
}
|
|
736
|
+
}
|
|
737
|
+
});
|
|
738
|
+
}
|
|
739
|
+
if (pendingQueue.length > 0) drainNotificationQueue();
|
|
740
|
+
}
|
|
741
|
+
function hasFrozenOwner(sub) {
|
|
742
|
+
for (let t = sub._owner ?? null; t !== null; ) {
|
|
743
|
+
const o = t.sub;
|
|
744
|
+
if (o === null) return false;
|
|
745
|
+
if (o._frozen === true) return true;
|
|
746
|
+
t = o._owner ?? null;
|
|
747
|
+
}
|
|
748
|
+
return false;
|
|
749
|
+
}
|
|
544
750
|
var subscriberEpochCounter = 0;
|
|
545
751
|
function retrack(effectFn, subscriber) {
|
|
546
752
|
const prev = currentSubscriber;
|
|
@@ -648,6 +854,20 @@ function structuralBinding(commit, ownerNode) {
|
|
|
648
854
|
} finally {
|
|
649
855
|
currentStructOwner = prev;
|
|
650
856
|
}
|
|
857
|
+
},
|
|
858
|
+
freeze: () => {
|
|
859
|
+
const s = sub;
|
|
860
|
+
if (s._disposed || s._frozen) return;
|
|
861
|
+
s._frozen = true;
|
|
862
|
+
frozenOwners++;
|
|
863
|
+
queueStateCheck();
|
|
864
|
+
},
|
|
865
|
+
thaw: () => {
|
|
866
|
+
if (!sub._frozen) return;
|
|
867
|
+
sub._frozen = false;
|
|
868
|
+
frozenOwners--;
|
|
869
|
+
queueStateCheck();
|
|
870
|
+
settleHeld();
|
|
651
871
|
}
|
|
652
872
|
};
|
|
653
873
|
}
|
|
@@ -676,20 +896,34 @@ function createBinding(commit, ownerNode, structural) {
|
|
|
676
896
|
subscriber._errorNode = ownerNode;
|
|
677
897
|
subscriber._tok = null;
|
|
678
898
|
subscriber._owner = null;
|
|
899
|
+
subscriber._frozen = false;
|
|
679
900
|
if (structural) subscriber._tok = { sub: subscriber };
|
|
680
901
|
try {
|
|
681
902
|
run();
|
|
682
903
|
} catch (err) {
|
|
683
904
|
subscriber._disposed = true;
|
|
684
905
|
subscriber._errorNode = void 0;
|
|
685
|
-
if (subscriber._tok != null)
|
|
906
|
+
if (subscriber._tok != null) {
|
|
907
|
+
subscriber._tok.sub = null;
|
|
908
|
+
if (endWatchers.size !== 0 || stateWatchers.size !== 0) notifyEnded();
|
|
909
|
+
}
|
|
686
910
|
cleanup(subscriber);
|
|
687
911
|
throw err;
|
|
688
912
|
}
|
|
689
913
|
subscriber._dispose = () => {
|
|
690
914
|
subscriber._disposed = true;
|
|
915
|
+
const wasFrozen = subscriber._frozen === true;
|
|
916
|
+
if (wasFrozen) {
|
|
917
|
+
subscriber._frozen = false;
|
|
918
|
+
frozenOwners--;
|
|
919
|
+
}
|
|
691
920
|
subscriber._errorNode = void 0;
|
|
692
|
-
if (subscriber._tok != null)
|
|
921
|
+
if (subscriber._tok != null) {
|
|
922
|
+
subscriber._tok.sub = null;
|
|
923
|
+
if (endWatchers.size !== 0 || stateWatchers.size !== 0) notifyEnded();
|
|
924
|
+
if (skippedWhileHeld.size !== 0) dropReleasedSkipped();
|
|
925
|
+
if (wasFrozen || waiters.size !== 0) settleHeld();
|
|
926
|
+
}
|
|
693
927
|
cleanup(subscriber);
|
|
694
928
|
};
|
|
695
929
|
return subscriber;
|
|
@@ -799,6 +1033,10 @@ function runPendingOwners(sub) {
|
|
|
799
1033
|
}
|
|
800
1034
|
}
|
|
801
1035
|
function runQueued(sub) {
|
|
1036
|
+
if ((frozenOwners !== 0 || heldRoots.size !== 0) && isHeld(sub)) {
|
|
1037
|
+
skippedWhileHeld.add(sub);
|
|
1038
|
+
return;
|
|
1039
|
+
}
|
|
802
1040
|
if (quarantined.size > 0 && quarantined.has(sub)) return;
|
|
803
1041
|
if (sub._hasComputedDep === true && !depsChanged(sub)) return;
|
|
804
1042
|
if (tickRepeat(sub)) {
|
|
@@ -946,7 +1184,7 @@ function forEachSubscriber(signal2, visit) {
|
|
|
946
1184
|
}
|
|
947
1185
|
|
|
948
1186
|
// src/reactivity/track.ts
|
|
949
|
-
var _runtimeVersion = true ? "4.
|
|
1187
|
+
var _runtimeVersion = true ? "4.15.0" : "dev";
|
|
950
1188
|
var REGISTRY_KEY = /* @__PURE__ */ Symbol.for("sibujs.reactive.v1");
|
|
951
1189
|
function resolveReactiveApi() {
|
|
952
1190
|
const g = globalThis;
|
|
@@ -982,6 +1220,8 @@ function resolveReactiveApi() {
|
|
|
982
1220
|
runWithOwnerScope,
|
|
983
1221
|
bindOwnerScope,
|
|
984
1222
|
structuralBinding,
|
|
1223
|
+
captureFrozen,
|
|
1224
|
+
holdSubtree,
|
|
985
1225
|
version: _runtimeVersion
|
|
986
1226
|
};
|
|
987
1227
|
g[REGISTRY_KEY] = local;
|
|
@@ -1009,6 +1249,22 @@ var getOwnerScope2 = API.getOwnerScope ?? getOwnerScope;
|
|
|
1009
1249
|
var runWithOwnerScope2 = API.runWithOwnerScope ?? runWithOwnerScope;
|
|
1010
1250
|
var bindOwnerScope2 = API.bindOwnerScope ?? bindOwnerScope;
|
|
1011
1251
|
var structuralBinding2 = API.structuralBinding ?? ((commit, ownerNode) => ({ stop: API.reactiveBinding(commit, ownerNode), run: (fn) => fn() }));
|
|
1252
|
+
var captureFrozen2 = API.captureFrozen ?? (() => Object.assign(() => false, {
|
|
1253
|
+
state: () => 0,
|
|
1254
|
+
wait: (onActive) => {
|
|
1255
|
+
onActive();
|
|
1256
|
+
return () => {
|
|
1257
|
+
};
|
|
1258
|
+
},
|
|
1259
|
+
onEnd: () => () => {
|
|
1260
|
+
},
|
|
1261
|
+
run: (fn) => fn(),
|
|
1262
|
+
onChange: () => () => {
|
|
1263
|
+
},
|
|
1264
|
+
within: () => false
|
|
1265
|
+
}));
|
|
1266
|
+
var holdSubtree2 = API.holdSubtree ?? (() => () => {
|
|
1267
|
+
});
|
|
1012
1268
|
|
|
1013
1269
|
// src/core/devtoolsHook.ts
|
|
1014
1270
|
function emitDevtools(hook, event, payload) {
|
|
@@ -1181,7 +1437,7 @@ var isBatching = API2.isBatching;
|
|
|
1181
1437
|
// src/core/signals/signal.ts
|
|
1182
1438
|
var _g = globalThis;
|
|
1183
1439
|
function signal(initial, options) {
|
|
1184
|
-
const
|
|
1440
|
+
const state4 = {
|
|
1185
1441
|
value: initial,
|
|
1186
1442
|
__v: 0,
|
|
1187
1443
|
__sc: 0,
|
|
@@ -1194,57 +1450,57 @@ function signal(initial, options) {
|
|
|
1194
1450
|
};
|
|
1195
1451
|
const debugName = DEV ? options?.name : void 0;
|
|
1196
1452
|
const equalsFn = options?.equals;
|
|
1197
|
-
if (debugName)
|
|
1453
|
+
if (debugName) state4.__name = debugName;
|
|
1198
1454
|
function get() {
|
|
1199
|
-
recordDependency2(
|
|
1200
|
-
return
|
|
1455
|
+
recordDependency2(state4);
|
|
1456
|
+
return state4.value;
|
|
1201
1457
|
}
|
|
1202
|
-
get.__signal =
|
|
1458
|
+
get.__signal = state4;
|
|
1203
1459
|
if (debugName) get.__name = debugName;
|
|
1204
1460
|
let set;
|
|
1205
1461
|
if (equalsFn) {
|
|
1206
1462
|
set = (next) => {
|
|
1207
|
-
const prev =
|
|
1463
|
+
const prev = state4.value;
|
|
1208
1464
|
const newValue = typeof next === "function" ? next(prev) : next;
|
|
1209
1465
|
if (equalsFn(prev, newValue)) return;
|
|
1210
|
-
|
|
1211
|
-
|
|
1466
|
+
state4.value = newValue;
|
|
1467
|
+
state4.__v++;
|
|
1212
1468
|
if (DEV) {
|
|
1213
1469
|
const hook = _g.__SIBU_DEVTOOLS_GLOBAL_HOOK__;
|
|
1214
|
-
if (hook) emitDevtools(hook, "signal:update", { signal:
|
|
1470
|
+
if (hook) emitDevtools(hook, "signal:update", { signal: state4, name: debugName, oldValue: prev, newValue });
|
|
1215
1471
|
}
|
|
1216
|
-
if (!enqueueBatchedSignal(
|
|
1217
|
-
notifySubscribers2(
|
|
1472
|
+
if (!enqueueBatchedSignal(state4)) {
|
|
1473
|
+
notifySubscribers2(state4);
|
|
1218
1474
|
}
|
|
1219
1475
|
};
|
|
1220
1476
|
} else if (DEV) {
|
|
1221
1477
|
set = (next) => {
|
|
1222
|
-
const prev =
|
|
1478
|
+
const prev = state4.value;
|
|
1223
1479
|
const newValue = typeof next === "function" ? next(prev) : next;
|
|
1224
1480
|
if (Object.is(newValue, prev)) return;
|
|
1225
|
-
|
|
1226
|
-
|
|
1481
|
+
state4.value = newValue;
|
|
1482
|
+
state4.__v++;
|
|
1227
1483
|
const hook = _g.__SIBU_DEVTOOLS_GLOBAL_HOOK__;
|
|
1228
|
-
if (hook) emitDevtools(hook, "signal:update", { signal:
|
|
1229
|
-
if (!enqueueBatchedSignal(
|
|
1230
|
-
notifySubscribers2(
|
|
1484
|
+
if (hook) emitDevtools(hook, "signal:update", { signal: state4, name: debugName, oldValue: prev, newValue });
|
|
1485
|
+
if (!enqueueBatchedSignal(state4)) {
|
|
1486
|
+
notifySubscribers2(state4);
|
|
1231
1487
|
}
|
|
1232
1488
|
};
|
|
1233
1489
|
} else {
|
|
1234
1490
|
set = (next) => {
|
|
1235
|
-
const prev =
|
|
1491
|
+
const prev = state4.value;
|
|
1236
1492
|
const newValue = typeof next === "function" ? next(prev) : next;
|
|
1237
1493
|
if (Object.is(newValue, prev)) return;
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
if (!enqueueBatchedSignal(
|
|
1241
|
-
notifySubscribers2(
|
|
1494
|
+
state4.value = newValue;
|
|
1495
|
+
state4.__v++;
|
|
1496
|
+
if (!enqueueBatchedSignal(state4)) {
|
|
1497
|
+
notifySubscribers2(state4);
|
|
1242
1498
|
}
|
|
1243
1499
|
};
|
|
1244
1500
|
}
|
|
1245
1501
|
if (DEV) {
|
|
1246
1502
|
const hook = _g.__SIBU_DEVTOOLS_GLOBAL_HOOK__;
|
|
1247
|
-
if (hook) emitDevtools(hook, "signal:create", { signal:
|
|
1503
|
+
if (hook) emitDevtools(hook, "signal:create", { signal: state4, name: debugName, getter: get, initial });
|
|
1248
1504
|
}
|
|
1249
1505
|
return [get, set];
|
|
1250
1506
|
}
|
|
@@ -1840,12 +2096,6 @@ function zipMask() {
|
|
|
1840
2096
|
return { pattern: "99999" };
|
|
1841
2097
|
}
|
|
1842
2098
|
|
|
1843
|
-
// src/utils/globalSingleton.ts
|
|
1844
|
-
function globalSingleton(key, create) {
|
|
1845
|
-
const g = globalThis;
|
|
1846
|
-
return g[key] ?? (g[key] = create());
|
|
1847
|
-
}
|
|
1848
|
-
|
|
1849
2099
|
// src/ui/a11y.ts
|
|
1850
2100
|
function aria(element, attrs) {
|
|
1851
2101
|
for (const [key, value] of Object.entries(attrs)) {
|
|
@@ -3331,14 +3581,14 @@ function noDocument() {
|
|
|
3331
3581
|
}
|
|
3332
3582
|
|
|
3333
3583
|
// src/utils/embedPolicy.ts
|
|
3334
|
-
var
|
|
3584
|
+
var state3 = globalSingleton(/* @__PURE__ */ Symbol.for("sibujs.embed.v2"), () => ({
|
|
3335
3585
|
allowed: [],
|
|
3336
3586
|
frames: /* @__PURE__ */ new WeakMap()
|
|
3337
3587
|
}));
|
|
3338
3588
|
var REQUEST_CACHE = "embed";
|
|
3339
3589
|
function currentEmbedAllowlist() {
|
|
3340
3590
|
const scoped = getRequestStore()?.caches?.get(REQUEST_CACHE)?.get("allowed");
|
|
3341
|
-
return scoped ??
|
|
3591
|
+
return scoped ?? state3.allowed;
|
|
3342
3592
|
}
|
|
3343
3593
|
function setEmbedPolicy(policy) {
|
|
3344
3594
|
const allowed = [];
|
|
@@ -3366,7 +3616,7 @@ function setEmbedPolicy(policy) {
|
|
|
3366
3616
|
}
|
|
3367
3617
|
scoped.set("allowed", allowed);
|
|
3368
3618
|
} else {
|
|
3369
|
-
|
|
3619
|
+
state3.allowed = allowed;
|
|
3370
3620
|
}
|
|
3371
3621
|
}
|
|
3372
3622
|
function resolveEmbedSrc(value, allowed = currentEmbedAllowlist()) {
|
|
@@ -3438,7 +3688,7 @@ function narrowEmbedReferrerPolicy(value) {
|
|
|
3438
3688
|
return EMBED_REFERRER_POLICIES.has(lower) ? lower : DEFAULT_EMBED_REFERRER_POLICY;
|
|
3439
3689
|
}
|
|
3440
3690
|
function recordEmbedFrame(frame, record) {
|
|
3441
|
-
|
|
3691
|
+
state3.frames.set(frame, record);
|
|
3442
3692
|
}
|
|
3443
3693
|
|
|
3444
3694
|
// src/ui/embed.ts
|
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-KPAXG5IR.js";
|
|
42
42
|
import {
|
|
43
43
|
RenderProp,
|
|
44
44
|
assertType,
|
|
@@ -66,35 +66,33 @@ import {
|
|
|
66
66
|
recordEmbedFrame,
|
|
67
67
|
resolveEmbedSrc,
|
|
68
68
|
setEmbedPolicy
|
|
69
|
-
} from "./chunk-
|
|
69
|
+
} from "./chunk-BG4BP44S.js";
|
|
70
70
|
import {
|
|
71
71
|
createId
|
|
72
|
-
} from "./chunk-
|
|
72
|
+
} from "./chunk-DAEXQJQA.js";
|
|
73
73
|
import {
|
|
74
74
|
noDocument
|
|
75
|
-
} from "./chunk-
|
|
75
|
+
} from "./chunk-XPDZ2LDR.js";
|
|
76
76
|
import "./chunk-RVWJGWCL.js";
|
|
77
|
-
import "./chunk-
|
|
78
|
-
import {
|
|
79
|
-
globalSingleton
|
|
80
|
-
} from "./chunk-7ZHH77QA.js";
|
|
77
|
+
import "./chunk-D44TAGCT.js";
|
|
81
78
|
import {
|
|
82
79
|
effect
|
|
83
|
-
} from "./chunk-
|
|
80
|
+
} from "./chunk-LGUXYHTZ.js";
|
|
84
81
|
import "./chunk-B3HOT4TK.js";
|
|
85
82
|
import "./chunk-UYTYNCMZ.js";
|
|
86
83
|
import "./chunk-5HZXGZ6T.js";
|
|
87
84
|
import {
|
|
88
85
|
batch,
|
|
89
86
|
signal
|
|
90
|
-
} from "./chunk-
|
|
87
|
+
} from "./chunk-IUBV5WO5.js";
|
|
91
88
|
import {
|
|
92
89
|
reactiveBinding
|
|
93
|
-
} from "./chunk-
|
|
90
|
+
} from "./chunk-GFM5WWPU.js";
|
|
94
91
|
import {
|
|
92
|
+
globalSingleton,
|
|
95
93
|
registerDisposer,
|
|
96
94
|
unregisterDisposer
|
|
97
|
-
} from "./chunk-
|
|
95
|
+
} from "./chunk-BF3WBJJQ.js";
|
|
98
96
|
import {
|
|
99
97
|
devWarnLazy
|
|
100
98
|
} from "./chunk-NT3ZYB5S.js";
|