sibujs 3.3.0 → 3.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser.cjs +210 -26
- package/dist/browser.js +4 -4
- package/dist/build.cjs +193 -89
- package/dist/build.js +10 -10
- package/dist/cdn.global.js +7 -7
- package/dist/{chunk-24DBWDTK.js → chunk-37BUKSLH.js} +1 -1
- package/dist/{chunk-IHBVTURX.js → chunk-4UUMSLSL.js} +4 -4
- package/dist/{chunk-USDR2GFV.js → chunk-6LTFHJQG.js} +3 -3
- package/dist/{chunk-MWZFOIBG.js → chunk-AMIKDMLP.js} +4 -4
- package/dist/{chunk-JBXNCZSC.js → chunk-F7FXQ3QS.js} +1 -1
- package/dist/{chunk-BEIKESVL.js → chunk-IKLYI3RF.js} +9 -9
- package/dist/{chunk-NUWKIEHE.js → chunk-LU2MQXQQ.js} +2 -2
- package/dist/{chunk-WVJJUFPC.js → chunk-M5KBNOSJ.js} +2 -2
- package/dist/{chunk-7JHWAGRQ.js → chunk-MHBCEJQO.js} +1 -1
- package/dist/{chunk-Q2ERM6NT.js → chunk-NHKQKKZU.js} +1 -1
- package/dist/{chunk-6G6UNHZI.js → chunk-RYMOSG5B.js} +5 -5
- package/dist/{chunk-F4UM7QBJ.js → chunk-SLMFA3ZZ.js} +1 -1
- package/dist/{chunk-X3NHE2DK.js → chunk-TEFZT5PJ.js} +83 -17
- package/dist/{chunk-SLCUP2EK.js → chunk-ULLTNDRA.js} +3 -3
- package/dist/{chunk-M6WSIGYW.js → chunk-VOVVTOEA.js} +2 -2
- package/dist/{chunk-XQ7XSGYP.js → chunk-WL7BIR6O.js} +1 -1
- package/dist/{chunk-CVMMULHO.js → chunk-WW6DAGGR.js} +4 -4
- package/dist/{chunk-5K72I3UQ.js → chunk-WZG2SZOT.js} +21 -4
- package/dist/{chunk-S4FHR5ZZ.js → chunk-XH2RTYEQ.js} +3 -3
- package/dist/{chunk-4WXWJ4SW.js → chunk-Z37APKBV.js} +4 -4
- package/dist/data.cjs +161 -23
- package/dist/data.js +6 -6
- package/dist/devtools.cjs +245 -31
- package/dist/devtools.js +4 -4
- package/dist/ecosystem.cjs +183 -45
- package/dist/ecosystem.js +7 -7
- package/dist/extras.cjs +185 -86
- package/dist/extras.js +19 -19
- package/dist/index.cjs +193 -89
- package/dist/index.d.cts +59 -8
- package/dist/index.d.ts +59 -8
- package/dist/index.js +10 -10
- package/dist/motion.cjs +329 -13
- package/dist/motion.js +3 -3
- package/dist/patterns.cjs +161 -23
- package/dist/patterns.js +5 -5
- package/dist/performance.cjs +258 -23
- package/dist/performance.js +4 -4
- package/dist/plugins.cjs +244 -51
- package/dist/plugins.js +6 -6
- package/dist/ssr.cjs +183 -44
- package/dist/ssr.js +7 -7
- package/dist/testing.cjs +396 -5
- package/dist/testing.js +2 -2
- package/dist/ui.cjs +221 -32
- package/dist/ui.js +6 -6
- package/dist/widgets.cjs +146 -26
- package/dist/widgets.js +6 -6
- package/package.json +1 -1
package/dist/ecosystem.cjs
CHANGED
|
@@ -53,7 +53,7 @@ function devWarn(message) {
|
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
// src/reactivity/track.ts
|
|
56
|
+
// src/reactivity/track-core.ts
|
|
57
57
|
var _isDev2 = isDev();
|
|
58
58
|
var POOL_MAX = 4096;
|
|
59
59
|
var nodePool = [];
|
|
@@ -137,6 +137,7 @@ function unlinkSub(node) {
|
|
|
137
137
|
else sub.depsTail = prev;
|
|
138
138
|
}
|
|
139
139
|
var currentSubscriber = null;
|
|
140
|
+
var suspendSavedSub = null;
|
|
140
141
|
var notifyDepth = 0;
|
|
141
142
|
var pendingQueue = [];
|
|
142
143
|
var pendingSet = /* @__PURE__ */ new Set();
|
|
@@ -148,7 +149,35 @@ function safeInvoke(sub) {
|
|
|
148
149
|
if (_isDev2) devWarn(`Subscriber threw during notification: ${err instanceof Error ? err.message : String(err)}`);
|
|
149
150
|
}
|
|
150
151
|
}
|
|
152
|
+
var suspendDepth = 0;
|
|
151
153
|
var trackingSuspended = false;
|
|
154
|
+
function suspendTracking() {
|
|
155
|
+
if (suspendDepth === 0) {
|
|
156
|
+
suspendSavedSub = currentSubscriber;
|
|
157
|
+
currentSubscriber = null;
|
|
158
|
+
trackingSuspended = true;
|
|
159
|
+
}
|
|
160
|
+
suspendDepth++;
|
|
161
|
+
}
|
|
162
|
+
function resumeTracking() {
|
|
163
|
+
suspendDepth--;
|
|
164
|
+
if (suspendDepth === 0) {
|
|
165
|
+
currentSubscriber = suspendSavedSub;
|
|
166
|
+
suspendSavedSub = null;
|
|
167
|
+
trackingSuspended = false;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
function isTrackingSuspended() {
|
|
171
|
+
return trackingSuspended;
|
|
172
|
+
}
|
|
173
|
+
function untracked(fn) {
|
|
174
|
+
suspendTracking();
|
|
175
|
+
try {
|
|
176
|
+
return fn();
|
|
177
|
+
} finally {
|
|
178
|
+
resumeTracking();
|
|
179
|
+
}
|
|
180
|
+
}
|
|
152
181
|
var subscriberEpochCounter = 0;
|
|
153
182
|
function retrack(effectFn, subscriber) {
|
|
154
183
|
const prev = currentSubscriber;
|
|
@@ -258,6 +287,16 @@ function cleanup(subscriber) {
|
|
|
258
287
|
var maxSubscriberRepeats = 50;
|
|
259
288
|
var maxDrainIterations = 1e6;
|
|
260
289
|
var drainEpoch = 0;
|
|
290
|
+
function setMaxSubscriberRepeats(n) {
|
|
291
|
+
const prev = maxSubscriberRepeats;
|
|
292
|
+
if (Number.isFinite(n) && n > 0) maxSubscriberRepeats = Math.floor(n);
|
|
293
|
+
return prev;
|
|
294
|
+
}
|
|
295
|
+
function setMaxDrainIterations(n) {
|
|
296
|
+
const prev = maxDrainIterations;
|
|
297
|
+
if (Number.isFinite(n) && n > 0) maxDrainIterations = Math.floor(n);
|
|
298
|
+
return prev;
|
|
299
|
+
}
|
|
261
300
|
function tickRepeat(sub) {
|
|
262
301
|
const s = sub;
|
|
263
302
|
if (s._runEpoch !== drainEpoch) {
|
|
@@ -406,6 +445,85 @@ function notifySubscribers(signal2) {
|
|
|
406
445
|
}
|
|
407
446
|
}
|
|
408
447
|
}
|
|
448
|
+
function getSubscriberCount(signal2) {
|
|
449
|
+
return signal2.__sc ?? 0;
|
|
450
|
+
}
|
|
451
|
+
function getSubscriberDeps(subscriber) {
|
|
452
|
+
const sub = subscriber;
|
|
453
|
+
const out = [];
|
|
454
|
+
let node = sub.depsHead ?? null;
|
|
455
|
+
while (node) {
|
|
456
|
+
if (node.sig) out.push(node.sig);
|
|
457
|
+
node = node.subNext;
|
|
458
|
+
}
|
|
459
|
+
return out;
|
|
460
|
+
}
|
|
461
|
+
function forEachSubscriber(signal2, visit) {
|
|
462
|
+
let node = signal2.subsHead ?? null;
|
|
463
|
+
while (node) {
|
|
464
|
+
const s = node.sub;
|
|
465
|
+
if (s) visit(s);
|
|
466
|
+
node = node.sigNext;
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
// src/reactivity/track.ts
|
|
471
|
+
var _isDev3 = isDev();
|
|
472
|
+
var _runtimeVersion = typeof __SIBU_VERSION__ !== "undefined" ? __SIBU_VERSION__ : "dev";
|
|
473
|
+
var REGISTRY_KEY = /* @__PURE__ */ Symbol.for("sibujs.reactive.v1");
|
|
474
|
+
function resolveReactiveApi() {
|
|
475
|
+
const g = globalThis;
|
|
476
|
+
const existing = g[REGISTRY_KEY];
|
|
477
|
+
if (existing) {
|
|
478
|
+
if (_isDev3 && !existing.__dupWarned) {
|
|
479
|
+
existing.__dupWarned = true;
|
|
480
|
+
devWarn(
|
|
481
|
+
`Multiple instances of the reactive runtime detected on this page (active: ${existing.version}, duplicate: ${_runtimeVersion}). Reactivity still works \u2014 all copies share the first one \u2014 but de-duplicate sibujs in your bundler (e.g. Vite optimizeDeps.exclude: ['sibujs'] or resolve.dedupe: ['sibujs']).`
|
|
482
|
+
);
|
|
483
|
+
}
|
|
484
|
+
return existing;
|
|
485
|
+
}
|
|
486
|
+
const local = {
|
|
487
|
+
suspendTracking,
|
|
488
|
+
resumeTracking,
|
|
489
|
+
isTrackingSuspended,
|
|
490
|
+
untracked,
|
|
491
|
+
retrack,
|
|
492
|
+
track,
|
|
493
|
+
reactiveBinding,
|
|
494
|
+
recordDependency,
|
|
495
|
+
cleanup,
|
|
496
|
+
setMaxSubscriberRepeats,
|
|
497
|
+
setMaxDrainIterations,
|
|
498
|
+
drainNotificationQueue,
|
|
499
|
+
queueSignalNotification,
|
|
500
|
+
notifySubscribers,
|
|
501
|
+
getSubscriberCount,
|
|
502
|
+
getSubscriberDeps,
|
|
503
|
+
forEachSubscriber,
|
|
504
|
+
version: _runtimeVersion
|
|
505
|
+
};
|
|
506
|
+
g[REGISTRY_KEY] = local;
|
|
507
|
+
return local;
|
|
508
|
+
}
|
|
509
|
+
var API = resolveReactiveApi();
|
|
510
|
+
var suspendTracking2 = API.suspendTracking;
|
|
511
|
+
var resumeTracking2 = API.resumeTracking;
|
|
512
|
+
var isTrackingSuspended2 = API.isTrackingSuspended;
|
|
513
|
+
var untracked2 = API.untracked;
|
|
514
|
+
var retrack2 = API.retrack;
|
|
515
|
+
var track2 = API.track;
|
|
516
|
+
var reactiveBinding2 = API.reactiveBinding;
|
|
517
|
+
var recordDependency2 = API.recordDependency;
|
|
518
|
+
var cleanup2 = API.cleanup;
|
|
519
|
+
var setMaxSubscriberRepeats2 = API.setMaxSubscriberRepeats;
|
|
520
|
+
var setMaxDrainIterations2 = API.setMaxDrainIterations;
|
|
521
|
+
var drainNotificationQueue2 = API.drainNotificationQueue;
|
|
522
|
+
var queueSignalNotification2 = API.queueSignalNotification;
|
|
523
|
+
var notifySubscribers2 = API.notifySubscribers;
|
|
524
|
+
var getSubscriberCount2 = API.getSubscriberCount;
|
|
525
|
+
var getSubscriberDeps2 = API.getSubscriberDeps;
|
|
526
|
+
var forEachSubscriber2 = API.forEachSubscriber;
|
|
409
527
|
|
|
410
528
|
// src/core/ssr-context.ts
|
|
411
529
|
var als = null;
|
|
@@ -456,7 +574,7 @@ function drainReruns(ctx) {
|
|
|
456
574
|
do {
|
|
457
575
|
ctx.rerunPending = false;
|
|
458
576
|
if (ctx.userCleanups.length > 0) flushUserCleanups(ctx);
|
|
459
|
-
|
|
577
|
+
retrack2(ctx.bodyFn, ctx.subscriber);
|
|
460
578
|
} while (ctx.rerunPending && ++reruns <= MAX_RERUNS);
|
|
461
579
|
if (ctx.rerunPending) {
|
|
462
580
|
ctx.rerunPending = false;
|
|
@@ -485,7 +603,7 @@ function disposeEffect(ctx) {
|
|
|
485
603
|
}
|
|
486
604
|
}
|
|
487
605
|
try {
|
|
488
|
-
|
|
606
|
+
cleanup2(ctx.subscriber);
|
|
489
607
|
} catch (err) {
|
|
490
608
|
if (typeof console !== "undefined") {
|
|
491
609
|
console.warn("[SibuJS effect] dispose threw:", err);
|
|
@@ -530,7 +648,7 @@ function effect(effectFn, options) {
|
|
|
530
648
|
try {
|
|
531
649
|
ctx.rerunPending = false;
|
|
532
650
|
if (ctx.userCleanups.length > 0) flushUserCleanups(ctx);
|
|
533
|
-
|
|
651
|
+
retrack2(ctx.bodyFn, sub);
|
|
534
652
|
if (ctx.rerunPending) drainReruns(ctx);
|
|
535
653
|
} finally {
|
|
536
654
|
ctx.running = false;
|
|
@@ -546,7 +664,7 @@ function effect(effectFn, options) {
|
|
|
546
664
|
ctx.subscriber = sub;
|
|
547
665
|
ctx.running = true;
|
|
548
666
|
try {
|
|
549
|
-
|
|
667
|
+
retrack2(ctx.bodyFn, ctx.subscriber);
|
|
550
668
|
if (ctx.rerunPending) drainReruns(ctx);
|
|
551
669
|
} finally {
|
|
552
670
|
ctx.running = false;
|
|
@@ -560,7 +678,7 @@ function effect(effectFn, options) {
|
|
|
560
678
|
// src/reactivity/batch.ts
|
|
561
679
|
var batchDepth = 0;
|
|
562
680
|
var pendingSignals = /* @__PURE__ */ new Set();
|
|
563
|
-
function
|
|
681
|
+
function batchImpl(fn) {
|
|
564
682
|
batchDepth++;
|
|
565
683
|
try {
|
|
566
684
|
return fn();
|
|
@@ -571,25 +689,45 @@ function batch(fn) {
|
|
|
571
689
|
}
|
|
572
690
|
}
|
|
573
691
|
}
|
|
574
|
-
function
|
|
692
|
+
function enqueueBatchedSignalImpl(signal2) {
|
|
575
693
|
if (batchDepth === 0) return false;
|
|
576
694
|
pendingSignals.add(signal2);
|
|
577
695
|
return true;
|
|
578
696
|
}
|
|
697
|
+
function isBatchingImpl() {
|
|
698
|
+
return batchDepth > 0;
|
|
699
|
+
}
|
|
579
700
|
function flushBatch() {
|
|
580
701
|
try {
|
|
581
702
|
for (const signal2 of pendingSignals) {
|
|
582
|
-
|
|
703
|
+
queueSignalNotification2(signal2);
|
|
583
704
|
}
|
|
584
705
|
} finally {
|
|
585
706
|
pendingSignals.clear();
|
|
586
707
|
}
|
|
587
|
-
|
|
708
|
+
drainNotificationQueue2();
|
|
588
709
|
}
|
|
710
|
+
var BATCH_REGISTRY_KEY = /* @__PURE__ */ Symbol.for("sibujs.reactive.batch.v1");
|
|
711
|
+
function resolveBatchApi() {
|
|
712
|
+
const g = globalThis;
|
|
713
|
+
const existing = g[BATCH_REGISTRY_KEY];
|
|
714
|
+
if (existing) return existing;
|
|
715
|
+
const local = {
|
|
716
|
+
batch: batchImpl,
|
|
717
|
+
enqueueBatchedSignal: enqueueBatchedSignalImpl,
|
|
718
|
+
isBatching: isBatchingImpl
|
|
719
|
+
};
|
|
720
|
+
g[BATCH_REGISTRY_KEY] = local;
|
|
721
|
+
return local;
|
|
722
|
+
}
|
|
723
|
+
var API2 = resolveBatchApi();
|
|
724
|
+
var batch = API2.batch;
|
|
725
|
+
var enqueueBatchedSignal = API2.enqueueBatchedSignal;
|
|
726
|
+
var isBatching = API2.isBatching;
|
|
589
727
|
|
|
590
728
|
// src/core/signals/signal.ts
|
|
591
729
|
var _g2 = globalThis;
|
|
592
|
-
var
|
|
730
|
+
var _isDev4 = isDev();
|
|
593
731
|
function signal(initial, options) {
|
|
594
732
|
const state = {
|
|
595
733
|
value: initial,
|
|
@@ -600,11 +738,11 @@ function signal(initial, options) {
|
|
|
600
738
|
__activeNode: null,
|
|
601
739
|
__name: void 0
|
|
602
740
|
};
|
|
603
|
-
const debugName =
|
|
741
|
+
const debugName = _isDev4 ? options?.name : void 0;
|
|
604
742
|
const equalsFn = options?.equals;
|
|
605
743
|
if (debugName) state.__name = debugName;
|
|
606
744
|
function get() {
|
|
607
|
-
|
|
745
|
+
recordDependency2(state);
|
|
608
746
|
return state.value;
|
|
609
747
|
}
|
|
610
748
|
get.__signal = state;
|
|
@@ -617,15 +755,15 @@ function signal(initial, options) {
|
|
|
617
755
|
if (equalsFn(prev, newValue)) return;
|
|
618
756
|
state.value = newValue;
|
|
619
757
|
state.__v++;
|
|
620
|
-
if (
|
|
758
|
+
if (_isDev4) {
|
|
621
759
|
const hook = _g2.__SIBU_DEVTOOLS_GLOBAL_HOOK__;
|
|
622
760
|
if (hook) hook.emit("signal:update", { signal: state, name: debugName, oldValue: prev, newValue });
|
|
623
761
|
}
|
|
624
762
|
if (!enqueueBatchedSignal(state)) {
|
|
625
|
-
|
|
763
|
+
notifySubscribers2(state);
|
|
626
764
|
}
|
|
627
765
|
};
|
|
628
|
-
} else if (
|
|
766
|
+
} else if (_isDev4) {
|
|
629
767
|
set = (next) => {
|
|
630
768
|
const prev = state.value;
|
|
631
769
|
const newValue = typeof next === "function" ? next(prev) : next;
|
|
@@ -635,7 +773,7 @@ function signal(initial, options) {
|
|
|
635
773
|
const hook = _g2.__SIBU_DEVTOOLS_GLOBAL_HOOK__;
|
|
636
774
|
if (hook) hook.emit("signal:update", { signal: state, name: debugName, oldValue: prev, newValue });
|
|
637
775
|
if (!enqueueBatchedSignal(state)) {
|
|
638
|
-
|
|
776
|
+
notifySubscribers2(state);
|
|
639
777
|
}
|
|
640
778
|
};
|
|
641
779
|
} else {
|
|
@@ -646,11 +784,11 @@ function signal(initial, options) {
|
|
|
646
784
|
state.value = newValue;
|
|
647
785
|
state.__v++;
|
|
648
786
|
if (!enqueueBatchedSignal(state)) {
|
|
649
|
-
|
|
787
|
+
notifySubscribers2(state);
|
|
650
788
|
}
|
|
651
789
|
};
|
|
652
790
|
}
|
|
653
|
-
if (
|
|
791
|
+
if (_isDev4) {
|
|
654
792
|
const hook = _g2.__SIBU_DEVTOOLS_GLOBAL_HOOK__;
|
|
655
793
|
if (hook) hook.emit("signal:create", { signal: state, name: debugName, getter: get, initial });
|
|
656
794
|
}
|
|
@@ -809,7 +947,7 @@ function derived(getter, options) {
|
|
|
809
947
|
cs._d = false;
|
|
810
948
|
cs._init = true;
|
|
811
949
|
};
|
|
812
|
-
|
|
950
|
+
track2(() => {
|
|
813
951
|
let threw = true;
|
|
814
952
|
try {
|
|
815
953
|
cs._v = getter();
|
|
@@ -828,12 +966,12 @@ function derived(getter, options) {
|
|
|
828
966
|
`[SibuJS] Circular dependency detected in derived${debugName ? ` "${debugName}"` : ""}. A derived signal cannot read itself (directly or through a chain).`
|
|
829
967
|
);
|
|
830
968
|
}
|
|
831
|
-
if (
|
|
969
|
+
if (isTrackingSuspended2()) {
|
|
832
970
|
if (cs._d) {
|
|
833
971
|
const prev = cs._v;
|
|
834
972
|
evaluating = true;
|
|
835
973
|
try {
|
|
836
|
-
|
|
974
|
+
retrack2(recompute, markDirty);
|
|
837
975
|
if (!Object.is(prev, cs._v)) cs.__v++;
|
|
838
976
|
} finally {
|
|
839
977
|
evaluating = false;
|
|
@@ -841,12 +979,12 @@ function derived(getter, options) {
|
|
|
841
979
|
}
|
|
842
980
|
return cs._v;
|
|
843
981
|
}
|
|
844
|
-
|
|
982
|
+
recordDependency2(cs);
|
|
845
983
|
if (cs._d) {
|
|
846
984
|
const oldValue = cs._v;
|
|
847
985
|
evaluating = true;
|
|
848
986
|
try {
|
|
849
|
-
|
|
987
|
+
retrack2(recompute, markDirty);
|
|
850
988
|
if (!Object.is(oldValue, cs._v)) cs.__v++;
|
|
851
989
|
} finally {
|
|
852
990
|
evaluating = false;
|
|
@@ -998,13 +1136,13 @@ function sanitizeAttributeString(attr, value) {
|
|
|
998
1136
|
}
|
|
999
1137
|
|
|
1000
1138
|
// src/reactivity/bindAttribute.ts
|
|
1001
|
-
var
|
|
1139
|
+
var _isDev5 = isDev();
|
|
1002
1140
|
function setProp(el, key, val) {
|
|
1003
1141
|
el[key] = val;
|
|
1004
1142
|
}
|
|
1005
1143
|
function bindAttribute(el, attr, getter) {
|
|
1006
1144
|
if (isEventHandlerAttr(attr)) {
|
|
1007
|
-
if (
|
|
1145
|
+
if (_isDev5)
|
|
1008
1146
|
devWarn(
|
|
1009
1147
|
`bindAttribute: refusing to bind event-handler attribute "${attr}". Use on:{ ${attr.slice(2)}: fn } instead.`
|
|
1010
1148
|
);
|
|
@@ -1016,7 +1154,7 @@ function bindAttribute(el, attr, getter) {
|
|
|
1016
1154
|
try {
|
|
1017
1155
|
value = getter();
|
|
1018
1156
|
} catch (err) {
|
|
1019
|
-
if (
|
|
1157
|
+
if (_isDev5)
|
|
1020
1158
|
devWarn(`bindAttribute: getter for "${attr}" threw: ${err instanceof Error ? err.message : String(err)}`);
|
|
1021
1159
|
return;
|
|
1022
1160
|
}
|
|
@@ -1037,12 +1175,12 @@ function bindAttribute(el, attr, getter) {
|
|
|
1037
1175
|
el.setAttribute(attr, sanitizeAttributeString(attr, str));
|
|
1038
1176
|
}
|
|
1039
1177
|
}
|
|
1040
|
-
return
|
|
1178
|
+
return reactiveBinding2(commit);
|
|
1041
1179
|
}
|
|
1042
1180
|
|
|
1043
1181
|
// src/core/rendering/dispose.ts
|
|
1044
1182
|
var elementDisposers = /* @__PURE__ */ new WeakMap();
|
|
1045
|
-
var
|
|
1183
|
+
var _isDev6 = isDev();
|
|
1046
1184
|
var activeBindingCount = 0;
|
|
1047
1185
|
function registerDisposer(node, teardown) {
|
|
1048
1186
|
let disposers = elementDisposers.get(node);
|
|
@@ -1051,7 +1189,7 @@ function registerDisposer(node, teardown) {
|
|
|
1051
1189
|
elementDisposers.set(node, disposers);
|
|
1052
1190
|
}
|
|
1053
1191
|
disposers.push(teardown);
|
|
1054
|
-
if (
|
|
1192
|
+
if (_isDev6) activeBindingCount++;
|
|
1055
1193
|
}
|
|
1056
1194
|
function dispose(node) {
|
|
1057
1195
|
const stack = [node];
|
|
@@ -1070,12 +1208,12 @@ function dispose(node) {
|
|
|
1070
1208
|
if (disposers) {
|
|
1071
1209
|
const snapshot = disposers.slice();
|
|
1072
1210
|
elementDisposers.delete(current);
|
|
1073
|
-
if (
|
|
1211
|
+
if (_isDev6) activeBindingCount -= snapshot.length;
|
|
1074
1212
|
for (const d of snapshot) {
|
|
1075
1213
|
try {
|
|
1076
1214
|
d();
|
|
1077
1215
|
} catch (err) {
|
|
1078
|
-
if (
|
|
1216
|
+
if (_isDev6 && typeof console !== "undefined") {
|
|
1079
1217
|
console.warn("[SibuJS] Disposer threw during cleanup:", err);
|
|
1080
1218
|
}
|
|
1081
1219
|
}
|
|
@@ -1086,12 +1224,12 @@ function dispose(node) {
|
|
|
1086
1224
|
if (!added || added.length === 0) break;
|
|
1087
1225
|
const moreSnapshot = added.slice();
|
|
1088
1226
|
elementDisposers.delete(current);
|
|
1089
|
-
if (
|
|
1227
|
+
if (_isDev6) activeBindingCount -= moreSnapshot.length;
|
|
1090
1228
|
for (const d of moreSnapshot) {
|
|
1091
1229
|
try {
|
|
1092
1230
|
d();
|
|
1093
1231
|
} catch (err) {
|
|
1094
|
-
if (
|
|
1232
|
+
if (_isDev6 && typeof console !== "undefined") {
|
|
1095
1233
|
console.warn("[SibuJS] Disposer threw during cleanup:", err);
|
|
1096
1234
|
}
|
|
1097
1235
|
}
|
|
@@ -1102,7 +1240,7 @@ function dispose(node) {
|
|
|
1102
1240
|
}
|
|
1103
1241
|
|
|
1104
1242
|
// src/reactivity/bindChildNode.ts
|
|
1105
|
-
var
|
|
1243
|
+
var _isDev7 = isDev();
|
|
1106
1244
|
function bindChildNode(placeholder, getter) {
|
|
1107
1245
|
let lastNodes = [];
|
|
1108
1246
|
function commit() {
|
|
@@ -1110,7 +1248,7 @@ function bindChildNode(placeholder, getter) {
|
|
|
1110
1248
|
try {
|
|
1111
1249
|
result = getter();
|
|
1112
1250
|
} catch (err) {
|
|
1113
|
-
if (
|
|
1251
|
+
if (_isDev7) devWarn(`bindChildNode: getter threw: ${err instanceof Error ? err.message : String(err)}`);
|
|
1114
1252
|
return;
|
|
1115
1253
|
}
|
|
1116
1254
|
if (result == null || typeof result === "boolean") {
|
|
@@ -1136,7 +1274,7 @@ function bindChildNode(placeholder, getter) {
|
|
|
1136
1274
|
if (item == null || typeof item === "boolean") continue;
|
|
1137
1275
|
const node = item instanceof Node ? item : document.createTextNode(String(item));
|
|
1138
1276
|
if (seen.has(node)) {
|
|
1139
|
-
if (
|
|
1277
|
+
if (_isDev7)
|
|
1140
1278
|
devWarn("bindChildNode: duplicate node reference in array \u2014 only the first occurrence is rendered.");
|
|
1141
1279
|
continue;
|
|
1142
1280
|
}
|
|
@@ -1171,11 +1309,11 @@ function bindChildNode(placeholder, getter) {
|
|
|
1171
1309
|
}
|
|
1172
1310
|
lastNodes = newNodes;
|
|
1173
1311
|
}
|
|
1174
|
-
return
|
|
1312
|
+
return reactiveBinding2(commit);
|
|
1175
1313
|
}
|
|
1176
1314
|
|
|
1177
1315
|
// src/core/rendering/tagFactory.ts
|
|
1178
|
-
var
|
|
1316
|
+
var _isDev8 = isDev();
|
|
1179
1317
|
var BLOCKED_TAGS = /* @__PURE__ */ new Set(["script", "iframe", "object", "embed", "frame", "frameset"]);
|
|
1180
1318
|
function isBlockedTag(tag) {
|
|
1181
1319
|
return BLOCKED_TAGS.has(tag.toLowerCase());
|
|
@@ -1218,7 +1356,7 @@ function toKebab(prop) {
|
|
|
1218
1356
|
}
|
|
1219
1357
|
function applyStyle(el, style) {
|
|
1220
1358
|
if (typeof style === "function") {
|
|
1221
|
-
const teardown =
|
|
1359
|
+
const teardown = track2(() => {
|
|
1222
1360
|
el.setAttribute("style", style());
|
|
1223
1361
|
});
|
|
1224
1362
|
registerDisposer(el, teardown);
|
|
@@ -1234,7 +1372,7 @@ function applyStyle(el, style) {
|
|
|
1234
1372
|
const name = toKebab(prop);
|
|
1235
1373
|
if (typeof val === "function") {
|
|
1236
1374
|
const getter = val;
|
|
1237
|
-
const teardown =
|
|
1375
|
+
const teardown = track2(() => {
|
|
1238
1376
|
htmlEl.style.setProperty(name, sanitizeCSSValue(String(getter())));
|
|
1239
1377
|
});
|
|
1240
1378
|
registerDisposer(el, teardown);
|
|
@@ -1249,7 +1387,7 @@ function applyClass(el, cls) {
|
|
|
1249
1387
|
return;
|
|
1250
1388
|
}
|
|
1251
1389
|
if (typeof cls === "function") {
|
|
1252
|
-
const teardown =
|
|
1390
|
+
const teardown = track2(() => {
|
|
1253
1391
|
el.setAttribute("class", cls());
|
|
1254
1392
|
});
|
|
1255
1393
|
registerDisposer(el, teardown);
|
|
@@ -1276,7 +1414,7 @@ function applyClass(el, cls) {
|
|
|
1276
1414
|
}
|
|
1277
1415
|
el.setAttribute("class", r);
|
|
1278
1416
|
};
|
|
1279
|
-
const teardown =
|
|
1417
|
+
const teardown = track2(update);
|
|
1280
1418
|
registerDisposer(el, teardown);
|
|
1281
1419
|
} else {
|
|
1282
1420
|
el.setAttribute("class", result);
|
|
@@ -1346,7 +1484,7 @@ var tagFactory = (tag, ns) => {
|
|
|
1346
1484
|
appendChildren(el, second);
|
|
1347
1485
|
return el;
|
|
1348
1486
|
}
|
|
1349
|
-
if (
|
|
1487
|
+
if (_isDev8 && looksLikeClassList(first)) {
|
|
1350
1488
|
devWarn(
|
|
1351
1489
|
`tagFactory: lone string "${first}" looks like a class list but is being rendered as TEXT. For a class, use ${tag}({ class: "${first}" }) \u2014 or ${tag}("${first}", children) to set the class AND add children.`
|
|
1352
1490
|
);
|
|
@@ -1367,7 +1505,7 @@ var tagFactory = (tag, ns) => {
|
|
|
1367
1505
|
if (pClass != null) applyClass(el, pClass);
|
|
1368
1506
|
const pId = props.id;
|
|
1369
1507
|
if (pId != null) {
|
|
1370
|
-
if (
|
|
1508
|
+
if (_isDev8 && typeof pId === "string" && CLOBBER_RISKY_IDS.has(pId.toLowerCase())) {
|
|
1371
1509
|
devWarn(
|
|
1372
1510
|
`tagFactory: element id="${pId}" matches a common global and may cause DOM clobbering. Avoid setting ids from untrusted input.`
|
|
1373
1511
|
);
|
|
@@ -1382,7 +1520,7 @@ var tagFactory = (tag, ns) => {
|
|
|
1382
1520
|
const handler = pOn[ev];
|
|
1383
1521
|
if (typeof handler === "function") {
|
|
1384
1522
|
el.addEventListener(ev, handler);
|
|
1385
|
-
} else if (
|
|
1523
|
+
} else if (_isDev8) {
|
|
1386
1524
|
devWarn(
|
|
1387
1525
|
`tagFactory: on.${ev} handler is not a function (got ${typeof handler}). Event listener was not attached.`
|
|
1388
1526
|
);
|
package/dist/ecosystem.js
CHANGED
|
@@ -7,17 +7,17 @@ import {
|
|
|
7
7
|
mobXAdapter,
|
|
8
8
|
reduxAdapter,
|
|
9
9
|
zustandAdapter
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-4UUMSLSL.js";
|
|
11
11
|
import "./chunk-3JHCYHWN.js";
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-LU2MQXQQ.js";
|
|
13
|
+
import "./chunk-NHKQKKZU.js";
|
|
14
|
+
import "./chunk-WW6DAGGR.js";
|
|
15
15
|
import "./chunk-5VGSK6D2.js";
|
|
16
16
|
import "./chunk-L3GAGWCC.js";
|
|
17
|
-
import "./chunk-
|
|
17
|
+
import "./chunk-MHBCEJQO.js";
|
|
18
18
|
import "./chunk-GOJMFRBL.js";
|
|
19
|
-
import "./chunk-
|
|
20
|
-
import "./chunk-
|
|
19
|
+
import "./chunk-WZG2SZOT.js";
|
|
20
|
+
import "./chunk-TEFZT5PJ.js";
|
|
21
21
|
import "./chunk-COY6PUD2.js";
|
|
22
22
|
export {
|
|
23
23
|
antdAdapter,
|