@solidjs/signals 0.13.12 → 0.13.13
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/dev.js +98 -41
- package/dist/node.cjs +366 -330
- package/dist/prod.js +263 -227
- package/package.json +1 -1
package/dist/prod.js
CHANGED
|
@@ -103,12 +103,12 @@ function markNode(e, t = REACTIVE_DIRTY) {
|
|
|
103
103
|
const n = e.O;
|
|
104
104
|
if ((n & (REACTIVE_CHECK | REACTIVE_DIRTY)) >= t) return;
|
|
105
105
|
e.O = (n & -4) | t;
|
|
106
|
-
for (let t = e.
|
|
106
|
+
for (let t = e.I; t !== null; t = t.h) {
|
|
107
107
|
markNode(t.p, REACTIVE_CHECK);
|
|
108
108
|
}
|
|
109
109
|
if (e.A !== null) {
|
|
110
110
|
for (let t = e.A; t !== null; t = t.N) {
|
|
111
|
-
for (let e = t.
|
|
111
|
+
for (let e = t.I; e !== null; e = e.h) {
|
|
112
112
|
markNode(e.p, REACTIVE_CHECK);
|
|
113
113
|
}
|
|
114
114
|
}
|
|
@@ -136,7 +136,7 @@ function adjustHeight(e, t) {
|
|
|
136
136
|
}
|
|
137
137
|
if (e.o !== n) {
|
|
138
138
|
e.o = n;
|
|
139
|
-
for (let n = e.
|
|
139
|
+
for (let n = e.I; n !== null; n = n.h) {
|
|
140
140
|
insertIntoHeapHeight(n.p, t);
|
|
141
141
|
}
|
|
142
142
|
}
|
|
@@ -165,7 +165,7 @@ function runLaneEffects(e) {
|
|
|
165
165
|
}
|
|
166
166
|
}
|
|
167
167
|
function queueStashedOptimisticEffects(e) {
|
|
168
|
-
for (let t = e.
|
|
168
|
+
for (let t = e.I; t !== null; t = t.h) {
|
|
169
169
|
const e = t.p;
|
|
170
170
|
if (!e.W) continue;
|
|
171
171
|
if (e.W === EFFECT_TRACKED) {
|
|
@@ -184,14 +184,14 @@ function setProjectionWriteActive(e) {
|
|
|
184
184
|
projectionWriteActive = e;
|
|
185
185
|
}
|
|
186
186
|
function mergeTransitionState(e, t) {
|
|
187
|
-
t
|
|
188
|
-
e
|
|
187
|
+
t.j = e;
|
|
188
|
+
e.$.push(...t.$);
|
|
189
189
|
for (const n of activeLanes) if (n.K === t) n.K = e;
|
|
190
190
|
e.Y.push(...t.Y);
|
|
191
|
-
for (const n of t.
|
|
192
|
-
for (const [n, i] of t.
|
|
193
|
-
let t = e.
|
|
194
|
-
if (!t) e.
|
|
191
|
+
for (const n of t.Z) e.Z.add(n);
|
|
192
|
+
for (const [n, i] of t.B) {
|
|
193
|
+
let t = e.B.get(n);
|
|
194
|
+
if (!t) e.B.set(n, (t = new Set()));
|
|
195
195
|
for (const e of i) t.add(e);
|
|
196
196
|
}
|
|
197
197
|
}
|
|
@@ -298,7 +298,7 @@ class GlobalQueue extends Queue {
|
|
|
298
298
|
ne = false;
|
|
299
299
|
se = [];
|
|
300
300
|
Y = [];
|
|
301
|
-
|
|
301
|
+
Z = new Set();
|
|
302
302
|
static oe;
|
|
303
303
|
static ue;
|
|
304
304
|
static ce = null;
|
|
@@ -314,7 +314,7 @@ class GlobalQueue extends Queue {
|
|
|
314
314
|
runHeap(zombieQueue, GlobalQueue.oe);
|
|
315
315
|
this.se = [];
|
|
316
316
|
this.Y = [];
|
|
317
|
-
this.
|
|
317
|
+
this.Z = new Set();
|
|
318
318
|
runLaneEffects(EFFECT_RENDER);
|
|
319
319
|
runLaneEffects(EFFECT_USER);
|
|
320
320
|
this.stashQueues(e.ae);
|
|
@@ -322,7 +322,7 @@ class GlobalQueue extends Queue {
|
|
|
322
322
|
scheduled = dirtyQueue.R >= dirtyQueue.P;
|
|
323
323
|
reassignPendingTransition(e.se);
|
|
324
324
|
activeTransition = null;
|
|
325
|
-
if (!e
|
|
325
|
+
if (!e.$.length && e.Y.length) {
|
|
326
326
|
stashedOptimisticReads = new Set();
|
|
327
327
|
for (let t = 0; t < e.Y.length; t++) {
|
|
328
328
|
const n = e.Y[t];
|
|
@@ -366,8 +366,8 @@ class GlobalQueue extends Queue {
|
|
|
366
366
|
const t = i !== undefined ? i : e.fe;
|
|
367
367
|
if (activeTransition && t) {
|
|
368
368
|
const n = t.source;
|
|
369
|
-
let i = activeTransition.
|
|
370
|
-
if (!i) activeTransition.
|
|
369
|
+
let i = activeTransition.B.get(n);
|
|
370
|
+
if (!i) activeTransition.B.set(n, (i = new Set()));
|
|
371
371
|
const r = i.size;
|
|
372
372
|
i.add(e);
|
|
373
373
|
if (i.size !== r) schedule();
|
|
@@ -385,12 +385,12 @@ class GlobalQueue extends Queue {
|
|
|
385
385
|
activeTransition = e ?? {
|
|
386
386
|
Ee: clock,
|
|
387
387
|
se: [],
|
|
388
|
-
|
|
388
|
+
B: new Map(),
|
|
389
389
|
Y: [],
|
|
390
|
-
|
|
391
|
-
|
|
390
|
+
Z: new Set(),
|
|
391
|
+
$: [],
|
|
392
392
|
ae: { ie: [[], []], re: [] },
|
|
393
|
-
|
|
393
|
+
j: false
|
|
394
394
|
};
|
|
395
395
|
} else if (e) {
|
|
396
396
|
const t = activeTransition;
|
|
@@ -419,16 +419,16 @@ class GlobalQueue extends Queue {
|
|
|
419
419
|
for (const e of activeLanes) {
|
|
420
420
|
if (!e.K) e.K = activeTransition;
|
|
421
421
|
}
|
|
422
|
-
if (this.
|
|
423
|
-
for (const e of this.
|
|
424
|
-
this.
|
|
422
|
+
if (this.Z !== activeTransition.Z) {
|
|
423
|
+
for (const e of this.Z) activeTransition.Z.add(e);
|
|
424
|
+
this.Z = activeTransition.Z;
|
|
425
425
|
}
|
|
426
426
|
}
|
|
427
427
|
}
|
|
428
428
|
function insertSubs(e, t = false) {
|
|
429
429
|
const n = e.q || currentOptimisticLane;
|
|
430
430
|
const i = e.de !== undefined;
|
|
431
|
-
for (let r = e.
|
|
431
|
+
for (let r = e.I; r !== null; r = r.h) {
|
|
432
432
|
if (i && r.p.Te) {
|
|
433
433
|
r.p.O |= REACTIVE_SNAPSHOT_STALE;
|
|
434
434
|
continue;
|
|
@@ -475,7 +475,7 @@ function finalizePureQueue(e = null, t = false) {
|
|
|
475
475
|
if (n) {
|
|
476
476
|
commitPendingNodes();
|
|
477
477
|
resolveOptimisticNodes(e ? e.Y : globalQueue.Y);
|
|
478
|
-
const t = e ? e.
|
|
478
|
+
const t = e ? e.Z : globalQueue.Z;
|
|
479
479
|
if (GlobalQueue.ce && t.size) {
|
|
480
480
|
for (const e of t) {
|
|
481
481
|
GlobalQueue.ce(e);
|
|
@@ -493,7 +493,7 @@ function checkBoundaryChildren(e) {
|
|
|
493
493
|
}
|
|
494
494
|
}
|
|
495
495
|
function trackOptimisticStore(e) {
|
|
496
|
-
globalQueue.
|
|
496
|
+
globalQueue.Z.add(e);
|
|
497
497
|
schedule();
|
|
498
498
|
}
|
|
499
499
|
function reassignPendingTransition(e) {
|
|
@@ -526,10 +526,10 @@ function reporterBlocksSource(e, t) {
|
|
|
526
526
|
return !!(e.Se & STATUS_PENDING && e.fe instanceof NotReadyError && e.fe.source === t);
|
|
527
527
|
}
|
|
528
528
|
function transitionComplete(e) {
|
|
529
|
-
if (e
|
|
530
|
-
if (e
|
|
529
|
+
if (e.j) return true;
|
|
530
|
+
if (e.$.length) return false;
|
|
531
531
|
let t = true;
|
|
532
|
-
for (const [n, i] of e.
|
|
532
|
+
for (const [n, i] of e.B) {
|
|
533
533
|
let r = false;
|
|
534
534
|
for (const e of i) {
|
|
535
535
|
if (reporterBlocksSource(e, n)) {
|
|
@@ -538,7 +538,7 @@ function transitionComplete(e) {
|
|
|
538
538
|
}
|
|
539
539
|
i.delete(e);
|
|
540
540
|
}
|
|
541
|
-
if (!r) e.
|
|
541
|
+
if (!r) e.B.delete(n);
|
|
542
542
|
else if (n.Se & STATUS_PENDING && n.fe?.source === n) {
|
|
543
543
|
t = false;
|
|
544
544
|
break;
|
|
@@ -559,11 +559,11 @@ function transitionComplete(e) {
|
|
|
559
559
|
}
|
|
560
560
|
}
|
|
561
561
|
}
|
|
562
|
-
t && (e
|
|
562
|
+
t && (e.j = true);
|
|
563
563
|
return t;
|
|
564
564
|
}
|
|
565
565
|
function currentTransition(e) {
|
|
566
|
-
while (e
|
|
566
|
+
while (e.j && typeof e.j === "object") e = e.j;
|
|
567
567
|
return e;
|
|
568
568
|
}
|
|
569
569
|
function setActiveTransition(e) {
|
|
@@ -587,10 +587,10 @@ function getOrCreateLane(e) {
|
|
|
587
587
|
}
|
|
588
588
|
const n = e._e;
|
|
589
589
|
const i = n?.q ? findLane(n.q) : null;
|
|
590
|
-
t = { te: e, k: new Set(), G: [[], []], U: null, K: activeTransition,
|
|
590
|
+
t = { te: e, k: new Set(), G: [[], []], U: null, K: activeTransition, Ie: i };
|
|
591
591
|
signalLanes.set(e, t);
|
|
592
592
|
activeLanes.add(t);
|
|
593
|
-
e.
|
|
593
|
+
e.he = false;
|
|
594
594
|
return t;
|
|
595
595
|
}
|
|
596
596
|
function findLane(e) {
|
|
@@ -632,9 +632,9 @@ function assignOrMergeLane(e, t) {
|
|
|
632
632
|
const r = findLane(i);
|
|
633
633
|
if (activeLanes.has(r)) {
|
|
634
634
|
if (r !== n && !hasActiveOverride(e)) {
|
|
635
|
-
if (n.
|
|
635
|
+
if (n.Ie && findLane(n.Ie) === r) {
|
|
636
636
|
e.q = t;
|
|
637
|
-
} else if (r.
|
|
637
|
+
} else if (r.Ie && findLane(r.Ie) === n);
|
|
638
638
|
else mergeLanes(n, r);
|
|
639
639
|
}
|
|
640
640
|
return;
|
|
@@ -645,16 +645,16 @@ function assignOrMergeLane(e, t) {
|
|
|
645
645
|
function unlinkSubs(e) {
|
|
646
646
|
const t = e.m;
|
|
647
647
|
const n = e.D;
|
|
648
|
-
const i = e.
|
|
648
|
+
const i = e.h;
|
|
649
649
|
const r = e.pe;
|
|
650
650
|
if (i !== null) i.pe = r;
|
|
651
651
|
else t.Ae = r;
|
|
652
|
-
if (r !== null) r.
|
|
652
|
+
if (r !== null) r.h = i;
|
|
653
653
|
else {
|
|
654
|
-
t.
|
|
654
|
+
t.I = i;
|
|
655
655
|
if (i === null) {
|
|
656
656
|
t.Ne?.();
|
|
657
|
-
t.L && !t.
|
|
657
|
+
t.L && !t.Pe && !(t.O & REACTIVE_ZOMBIE) && unobserved(t);
|
|
658
658
|
}
|
|
659
659
|
}
|
|
660
660
|
return n;
|
|
@@ -669,27 +669,27 @@ function unobserved(e) {
|
|
|
669
669
|
disposeChildren(e, true);
|
|
670
670
|
}
|
|
671
671
|
function link(e, t) {
|
|
672
|
-
const n = t.
|
|
672
|
+
const n = t.ge;
|
|
673
673
|
if (n !== null && n.m === e) return;
|
|
674
674
|
let i = null;
|
|
675
675
|
const r = t.O & REACTIVE_RECOMPUTING_DEPS;
|
|
676
676
|
if (r) {
|
|
677
677
|
i = n !== null ? n.D : t.C;
|
|
678
678
|
if (i !== null && i.m === e) {
|
|
679
|
-
t.
|
|
679
|
+
t.ge = i;
|
|
680
680
|
return;
|
|
681
681
|
}
|
|
682
682
|
}
|
|
683
683
|
const s = e.Ae;
|
|
684
684
|
if (s !== null && s.p === t && (!r || isValidLink(s, t))) return;
|
|
685
|
-
const o = (t.
|
|
685
|
+
const o = (t.ge = e.Ae = { m: e, p: t, D: i, pe: s, h: null });
|
|
686
686
|
if (n !== null) n.D = o;
|
|
687
687
|
else t.C = o;
|
|
688
|
-
if (s !== null) s.
|
|
689
|
-
else e.
|
|
688
|
+
if (s !== null) s.h = o;
|
|
689
|
+
else e.I = o;
|
|
690
690
|
}
|
|
691
691
|
function isValidLink(e, t) {
|
|
692
|
-
const n = t.
|
|
692
|
+
const n = t.ge;
|
|
693
693
|
if (n !== null) {
|
|
694
694
|
let i = t.C;
|
|
695
695
|
do {
|
|
@@ -719,7 +719,7 @@ function dispose(e) {
|
|
|
719
719
|
t = unlinkSubs(t);
|
|
720
720
|
} while (t !== null);
|
|
721
721
|
e.C = null;
|
|
722
|
-
e.
|
|
722
|
+
e.ge = null;
|
|
723
723
|
disposeChildren(e, true);
|
|
724
724
|
}
|
|
725
725
|
function disposeChildren(e, t = false, n) {
|
|
@@ -737,7 +737,7 @@ function disposeChildren(e, t = false, n) {
|
|
|
737
737
|
t = unlinkSubs(t);
|
|
738
738
|
} while (t !== null);
|
|
739
739
|
e.C = null;
|
|
740
|
-
e.
|
|
740
|
+
e.ge = null;
|
|
741
741
|
}
|
|
742
742
|
disposeChildren(i, true);
|
|
743
743
|
i = e;
|
|
@@ -882,9 +882,9 @@ function setPendingError(e, t, n) {
|
|
|
882
882
|
}
|
|
883
883
|
}
|
|
884
884
|
function forEachDependent(e, t) {
|
|
885
|
-
for (let n = e.
|
|
885
|
+
for (let n = e.I; n !== null; n = n.h) t(n.p);
|
|
886
886
|
for (let n = e.A; n !== null; n = n.N) {
|
|
887
|
-
for (let e = n.
|
|
887
|
+
for (let e = n.I; e !== null; e = e.h) t(e.p);
|
|
888
888
|
}
|
|
889
889
|
}
|
|
890
890
|
function settlePendingSource(e) {
|
|
@@ -943,9 +943,10 @@ function handleAsync(e, t, n) {
|
|
|
943
943
|
if (e.ye !== t) return;
|
|
944
944
|
if (e.O & (REACTIVE_DIRTY | REACTIVE_OPTIMISTIC_DIRTY)) return;
|
|
945
945
|
globalQueue.initTransition(resolveTransition(e));
|
|
946
|
+
const s = !!(e.Se & STATUS_UNINITIALIZED);
|
|
946
947
|
clearStatus(e);
|
|
947
|
-
const
|
|
948
|
-
if (
|
|
948
|
+
const o = resolveLane(e);
|
|
949
|
+
if (o) o.k.delete(e);
|
|
949
950
|
if (n) n(i);
|
|
950
951
|
else if (e.ee !== undefined) {
|
|
951
952
|
if (e.ee !== undefined && e.ee !== NOT_PENDING) e.X = i;
|
|
@@ -954,10 +955,11 @@ function handleAsync(e, t, n) {
|
|
|
954
955
|
insertSubs(e);
|
|
955
956
|
}
|
|
956
957
|
e.Ee = clock;
|
|
957
|
-
} else if (
|
|
958
|
-
const t = e.
|
|
959
|
-
const n = e.
|
|
960
|
-
|
|
958
|
+
} else if (o) {
|
|
959
|
+
const t = e.W;
|
|
960
|
+
const n = e.J;
|
|
961
|
+
const r = e.ke;
|
|
962
|
+
if ((!t && s) || !r || !r(i, n)) {
|
|
961
963
|
e.J = i;
|
|
962
964
|
e.Ee = clock;
|
|
963
965
|
if (e.xe) {
|
|
@@ -1208,22 +1210,23 @@ function recompute(e, t = false) {
|
|
|
1208
1210
|
const i = !!(e.O & REACTIVE_OPTIMISTIC_DIRTY);
|
|
1209
1211
|
const r = e.ee !== undefined && e.ee !== NOT_PENDING;
|
|
1210
1212
|
const s = !!(e.Se & STATUS_PENDING);
|
|
1211
|
-
const o =
|
|
1213
|
+
const o = !!(e.Se & STATUS_UNINITIALIZED);
|
|
1214
|
+
const u = context;
|
|
1212
1215
|
context = e;
|
|
1213
|
-
e.
|
|
1216
|
+
e.ge = null;
|
|
1214
1217
|
e.O = REACTIVE_RECOMPUTING_DEPS;
|
|
1215
1218
|
e.Ee = clock;
|
|
1216
|
-
let
|
|
1217
|
-
let
|
|
1218
|
-
let
|
|
1219
|
-
let
|
|
1219
|
+
let c = e.X === NOT_PENDING ? e.J : e.X;
|
|
1220
|
+
let a = e.o;
|
|
1221
|
+
let l = tracking;
|
|
1222
|
+
let f = currentOptimisticLane;
|
|
1220
1223
|
tracking = true;
|
|
1221
1224
|
if (i) {
|
|
1222
1225
|
const t = resolveLane(e);
|
|
1223
1226
|
if (t) currentOptimisticLane = t;
|
|
1224
1227
|
}
|
|
1225
1228
|
try {
|
|
1226
|
-
|
|
1229
|
+
c = handleAsync(e, e.L(c));
|
|
1227
1230
|
clearStatus(e, t);
|
|
1228
1231
|
const n = resolveLane(e);
|
|
1229
1232
|
if (n) {
|
|
@@ -1248,42 +1251,42 @@ function recompute(e, t = false) {
|
|
|
1248
1251
|
t instanceof NotReadyError ? e.q : undefined
|
|
1249
1252
|
);
|
|
1250
1253
|
} finally {
|
|
1251
|
-
tracking =
|
|
1254
|
+
tracking = l;
|
|
1252
1255
|
e.O = REACTIVE_NONE | (t ? e.O & REACTIVE_SNAPSHOT_STALE : 0);
|
|
1253
|
-
context =
|
|
1256
|
+
context = u;
|
|
1254
1257
|
}
|
|
1255
1258
|
if (!e.fe) {
|
|
1256
|
-
const
|
|
1257
|
-
let
|
|
1258
|
-
if (
|
|
1259
|
+
const u = e.ge;
|
|
1260
|
+
let l = u !== null ? u.D : e.C;
|
|
1261
|
+
if (l !== null) {
|
|
1259
1262
|
do {
|
|
1260
|
-
|
|
1261
|
-
} while (
|
|
1262
|
-
if (
|
|
1263
|
+
l = unlinkSubs(l);
|
|
1264
|
+
} while (l !== null);
|
|
1265
|
+
if (u !== null) u.D = null;
|
|
1263
1266
|
else e.C = null;
|
|
1264
1267
|
}
|
|
1265
|
-
const
|
|
1266
|
-
const
|
|
1267
|
-
if (
|
|
1268
|
+
const f = r ? e.ee : e.X === NOT_PENDING ? e.J : e.X;
|
|
1269
|
+
const E = (!n && o) || !e.ke || !e.ke(f, c);
|
|
1270
|
+
if (E) {
|
|
1268
1271
|
const o = r ? e.ee : undefined;
|
|
1269
1272
|
if (t || (n && activeTransition !== e.K) || i) {
|
|
1270
|
-
e.J =
|
|
1273
|
+
e.J = c;
|
|
1271
1274
|
if (r && i) {
|
|
1272
|
-
e.ee =
|
|
1273
|
-
e.X =
|
|
1275
|
+
e.ee = c;
|
|
1276
|
+
e.X = c;
|
|
1274
1277
|
}
|
|
1275
|
-
} else e.X =
|
|
1276
|
-
if (r && !i && s && !e.
|
|
1278
|
+
} else e.X = c;
|
|
1279
|
+
if (r && !i && s && !e.he) e.ee = c;
|
|
1277
1280
|
if (!r || i || e.ee !== o) insertSubs(e, i || r);
|
|
1278
1281
|
} else if (r) {
|
|
1279
|
-
e.X =
|
|
1280
|
-
} else if (e.o !=
|
|
1281
|
-
for (let t = e.
|
|
1282
|
+
e.X = c;
|
|
1283
|
+
} else if (e.o != a) {
|
|
1284
|
+
for (let t = e.I; t !== null; t = t.h) {
|
|
1282
1285
|
insertIntoHeapHeight(t.p, t.p.O & REACTIVE_ZOMBIE ? zombieQueue : dirtyQueue);
|
|
1283
1286
|
}
|
|
1284
1287
|
}
|
|
1285
1288
|
}
|
|
1286
|
-
currentOptimisticLane =
|
|
1289
|
+
currentOptimisticLane = f;
|
|
1287
1290
|
(!t || e.Se & STATUS_PENDING) && !e.K && !(activeTransition && r) && globalQueue.se.push(e);
|
|
1288
1291
|
e.K && n && activeTransition !== e.K && runInTransition(e.K, () => recompute(e));
|
|
1289
1292
|
}
|
|
@@ -1324,8 +1327,8 @@ function computed(e, t, n) {
|
|
|
1324
1327
|
S: undefined,
|
|
1325
1328
|
T: null,
|
|
1326
1329
|
C: null,
|
|
1327
|
-
|
|
1328
|
-
|
|
1330
|
+
ge: null,
|
|
1331
|
+
I: null,
|
|
1329
1332
|
Ae: null,
|
|
1330
1333
|
i: context,
|
|
1331
1334
|
De: null,
|
|
@@ -1379,7 +1382,7 @@ function signal(e, t, n = null) {
|
|
|
1379
1382
|
He: !!t?.He,
|
|
1380
1383
|
Ne: t?.unobserved,
|
|
1381
1384
|
J: e,
|
|
1382
|
-
|
|
1385
|
+
I: null,
|
|
1383
1386
|
Ae: null,
|
|
1384
1387
|
Ee: clock,
|
|
1385
1388
|
V: n,
|
|
@@ -1554,7 +1557,7 @@ function setSignal(e, t) {
|
|
|
1554
1557
|
e.X = e.J;
|
|
1555
1558
|
globalQueue.Y.push(e);
|
|
1556
1559
|
}
|
|
1557
|
-
e.
|
|
1560
|
+
e.he = true;
|
|
1558
1561
|
const i = getOrCreateLane(e);
|
|
1559
1562
|
e.q = i;
|
|
1560
1563
|
e.ee = t;
|
|
@@ -1737,8 +1740,8 @@ function effect(e, t, n, i, r) {
|
|
|
1737
1740
|
});
|
|
1738
1741
|
o.Qe = i;
|
|
1739
1742
|
o.Me = t;
|
|
1740
|
-
o
|
|
1741
|
-
o
|
|
1743
|
+
o.je = n;
|
|
1744
|
+
o.$e = undefined;
|
|
1742
1745
|
o.W = r?.render ? EFFECT_RENDER : EFFECT_USER;
|
|
1743
1746
|
o.Ge = (e, t) => {
|
|
1744
1747
|
const n = e !== undefined ? e : o.Se;
|
|
@@ -1748,10 +1751,10 @@ function effect(e, t, n, i, r) {
|
|
|
1748
1751
|
o.F.notify(o, STATUS_PENDING, 0);
|
|
1749
1752
|
if (o.W === EFFECT_USER) {
|
|
1750
1753
|
try {
|
|
1751
|
-
return o
|
|
1752
|
-
? o
|
|
1753
|
-
o
|
|
1754
|
-
o
|
|
1754
|
+
return o.je
|
|
1755
|
+
? o.je(e, () => {
|
|
1756
|
+
o.$e?.();
|
|
1757
|
+
o.$e = undefined;
|
|
1755
1758
|
})
|
|
1756
1759
|
: console.error(e);
|
|
1757
1760
|
} catch (t) {
|
|
@@ -1766,16 +1769,16 @@ function effect(e, t, n, i, r) {
|
|
|
1766
1769
|
recompute(o, true);
|
|
1767
1770
|
!r?.defer && (o.W === EFFECT_USER ? o.F.enqueue(o.W, runEffect.bind(o)) : runEffect.call(o));
|
|
1768
1771
|
s = true;
|
|
1769
|
-
cleanup(() => o
|
|
1772
|
+
cleanup(() => o.$e?.());
|
|
1770
1773
|
}
|
|
1771
1774
|
function runEffect() {
|
|
1772
1775
|
if (!this.H || this.O & REACTIVE_DISPOSED) return;
|
|
1773
|
-
this
|
|
1774
|
-
this
|
|
1776
|
+
this.$e?.();
|
|
1777
|
+
this.$e = undefined;
|
|
1775
1778
|
try {
|
|
1776
1779
|
const e = this.Me(this.J, this.Qe);
|
|
1777
1780
|
if (false && e !== undefined && typeof e !== "function");
|
|
1778
|
-
this
|
|
1781
|
+
this.$e = e;
|
|
1779
1782
|
} catch (e) {
|
|
1780
1783
|
this.fe = new StatusError(this, e);
|
|
1781
1784
|
this.Se |= STATUS_ERROR;
|
|
@@ -1796,15 +1799,15 @@ function trackedEffect(e, t) {
|
|
|
1796
1799
|
};
|
|
1797
1800
|
const n = computed(
|
|
1798
1801
|
() => {
|
|
1799
|
-
n
|
|
1800
|
-
n
|
|
1802
|
+
n.$e?.();
|
|
1803
|
+
n.$e = undefined;
|
|
1801
1804
|
const t = staleValues(e);
|
|
1802
|
-
n
|
|
1805
|
+
n.$e = t;
|
|
1803
1806
|
},
|
|
1804
1807
|
undefined,
|
|
1805
1808
|
{ ...t, lazy: true }
|
|
1806
1809
|
);
|
|
1807
|
-
n
|
|
1810
|
+
n.$e = undefined;
|
|
1808
1811
|
n.Ke = true;
|
|
1809
1812
|
n.H = true;
|
|
1810
1813
|
n.W = EFFECT_TRACKED;
|
|
@@ -1818,7 +1821,7 @@ function trackedEffect(e, t) {
|
|
|
1818
1821
|
};
|
|
1819
1822
|
n.M = run;
|
|
1820
1823
|
n.F.enqueue(EFFECT_USER, run);
|
|
1821
|
-
cleanup(() => n
|
|
1824
|
+
cleanup(() => n.$e?.());
|
|
1822
1825
|
}
|
|
1823
1826
|
function restoreTransition(e, t) {
|
|
1824
1827
|
globalQueue.initTransition(e);
|
|
@@ -1832,11 +1835,11 @@ function action(e) {
|
|
|
1832
1835
|
const r = e(...t);
|
|
1833
1836
|
globalQueue.initTransition();
|
|
1834
1837
|
let s = activeTransition;
|
|
1835
|
-
s
|
|
1838
|
+
s.$.push(r);
|
|
1836
1839
|
const done = (e, t) => {
|
|
1837
1840
|
s = currentTransition(s);
|
|
1838
|
-
const o = s
|
|
1839
|
-
if (o >= 0) s
|
|
1841
|
+
const o = s.$.indexOf(r);
|
|
1842
|
+
if (o >= 0) s.$.splice(o, 1);
|
|
1840
1843
|
setActiveTransition(s);
|
|
1841
1844
|
schedule();
|
|
1842
1845
|
t ? i(t) : n(e);
|
|
@@ -2121,7 +2124,7 @@ function createProjectionInternal(e, t = {}, n) {
|
|
|
2121
2124
|
u !== o && u !== undefined && reconcile(u, n?.key || "id")(s);
|
|
2122
2125
|
});
|
|
2123
2126
|
});
|
|
2124
|
-
i.
|
|
2127
|
+
i.Pe = true;
|
|
2125
2128
|
return { store: s, node: i };
|
|
2126
2129
|
}
|
|
2127
2130
|
function createProjection(e, t = {}, n) {
|
|
@@ -2269,12 +2272,54 @@ function getKeys(e, t, n = true) {
|
|
|
2269
2272
|
return Array.from(r);
|
|
2270
2273
|
}
|
|
2271
2274
|
function getPropertyDescriptor(e, t, n) {
|
|
2272
|
-
let i = e;
|
|
2273
2275
|
if (t && n in t) {
|
|
2274
|
-
if (
|
|
2275
|
-
|
|
2276
|
+
if (t[n] === $DELETED) return void 0;
|
|
2277
|
+
const i = Reflect.getOwnPropertyDescriptor(t, n);
|
|
2278
|
+
if (i?.get || i?.set || !(n in e)) return i;
|
|
2279
|
+
}
|
|
2280
|
+
return Reflect.getOwnPropertyDescriptor(e, n);
|
|
2281
|
+
}
|
|
2282
|
+
function prepareStoreWrite(e, t, n) {
|
|
2283
|
+
if (e[STORE_OPTIMISTIC]) {
|
|
2284
|
+
const t = e[STORE_FIREWALL];
|
|
2285
|
+
if (t?.K) {
|
|
2286
|
+
globalQueue.initTransition(t.K);
|
|
2287
|
+
}
|
|
2288
|
+
}
|
|
2289
|
+
const i = e[STORE_VALUE];
|
|
2290
|
+
const r = i[n];
|
|
2291
|
+
if (
|
|
2292
|
+
snapshotCaptureActive &&
|
|
2293
|
+
typeof n !== "symbol" &&
|
|
2294
|
+
!((e[STORE_FIREWALL]?.Se ?? 0) & STATUS_PENDING)
|
|
2295
|
+
) {
|
|
2296
|
+
if (!e[STORE_SNAPSHOT_PROPS]) {
|
|
2297
|
+
e[STORE_SNAPSHOT_PROPS] = Object.create(null);
|
|
2298
|
+
snapshotSources?.add(e);
|
|
2299
|
+
}
|
|
2300
|
+
if (!(n in e[STORE_SNAPSHOT_PROPS])) {
|
|
2301
|
+
e[STORE_SNAPSHOT_PROPS][n] = r;
|
|
2302
|
+
}
|
|
2303
|
+
}
|
|
2304
|
+
const s = e[STORE_OPTIMISTIC] && !projectionWriteActive;
|
|
2305
|
+
const o = s ? STORE_OPTIMISTIC_OVERRIDE : STORE_OVERRIDE;
|
|
2306
|
+
if (s) trackOptimisticStore(t);
|
|
2307
|
+
return { base: r, overrideKey: o, state: i };
|
|
2308
|
+
}
|
|
2309
|
+
function notifyStoreProperty(e, t, n, i) {
|
|
2310
|
+
if (e[STORE_HAS]?.[t]) setSignal(e[STORE_HAS][t], n !== "delete");
|
|
2311
|
+
const r = getNodes(e, STORE_NODE);
|
|
2312
|
+
if (n === "set") {
|
|
2313
|
+
r[t] && setSignal(r[t], () => (isWrappable(i) ? wrap(i, e) : i));
|
|
2314
|
+
} else if (n === "invalidate") {
|
|
2315
|
+
if (r[t]) {
|
|
2316
|
+
setSignal(r[t], {});
|
|
2317
|
+
delete r[t];
|
|
2318
|
+
}
|
|
2319
|
+
} else {
|
|
2320
|
+
r[t] && setSignal(r[t], undefined);
|
|
2276
2321
|
}
|
|
2277
|
-
|
|
2322
|
+
r[$TRACK] && setSignal(r[$TRACK], undefined);
|
|
2278
2323
|
}
|
|
2279
2324
|
let Writing = null;
|
|
2280
2325
|
const storeTraps = {
|
|
@@ -2360,64 +2405,51 @@ const storeTraps = {
|
|
|
2360
2405
|
set(e, t, n) {
|
|
2361
2406
|
const i = e[$PROXY];
|
|
2362
2407
|
if (writeOnly(i)) {
|
|
2363
|
-
if (e[STORE_OPTIMISTIC]) {
|
|
2364
|
-
const t = e[STORE_FIREWALL];
|
|
2365
|
-
if (t?.K) {
|
|
2366
|
-
globalQueue.initTransition(t.K);
|
|
2367
|
-
}
|
|
2368
|
-
}
|
|
2369
2408
|
untrack(() => {
|
|
2370
|
-
const r = e
|
|
2371
|
-
const
|
|
2372
|
-
if (
|
|
2373
|
-
snapshotCaptureActive &&
|
|
2374
|
-
typeof t !== "symbol" &&
|
|
2375
|
-
!((e[STORE_FIREWALL]?.Se ?? 0) & STATUS_PENDING)
|
|
2376
|
-
) {
|
|
2377
|
-
if (!e[STORE_SNAPSHOT_PROPS]) {
|
|
2378
|
-
e[STORE_SNAPSHOT_PROPS] = Object.create(null);
|
|
2379
|
-
snapshotSources?.add(e);
|
|
2380
|
-
}
|
|
2381
|
-
if (!(t in e[STORE_SNAPSHOT_PROPS])) {
|
|
2382
|
-
e[STORE_SNAPSHOT_PROPS][t] = s;
|
|
2383
|
-
}
|
|
2384
|
-
}
|
|
2385
|
-
const o = e[STORE_OPTIMISTIC] && !projectionWriteActive;
|
|
2386
|
-
const u = o ? STORE_OPTIMISTIC_OVERRIDE : STORE_OVERRIDE;
|
|
2387
|
-
if (o) trackOptimisticStore(i);
|
|
2388
|
-
const c =
|
|
2409
|
+
const { base: r, overrideKey: s, state: o } = prepareStoreWrite(e, i, t);
|
|
2410
|
+
const u =
|
|
2389
2411
|
e[STORE_OPTIMISTIC_OVERRIDE] && t in e[STORE_OPTIMISTIC_OVERRIDE]
|
|
2390
2412
|
? e[STORE_OPTIMISTIC_OVERRIDE][t]
|
|
2391
2413
|
: e[STORE_OVERRIDE] && t in e[STORE_OVERRIDE]
|
|
2392
2414
|
? e[STORE_OVERRIDE][t]
|
|
2393
|
-
:
|
|
2394
|
-
const
|
|
2395
|
-
const
|
|
2396
|
-
const
|
|
2397
|
-
const
|
|
2398
|
-
|
|
2415
|
+
: r;
|
|
2416
|
+
const c = n?.[$TARGET]?.[STORE_VALUE] ?? n;
|
|
2417
|
+
const a = Array.isArray(o) && t !== "length";
|
|
2418
|
+
const l = a ? parseInt(t) + 1 : 0;
|
|
2419
|
+
const f =
|
|
2420
|
+
a &&
|
|
2399
2421
|
(e[STORE_OPTIMISTIC_OVERRIDE] && "length" in e[STORE_OPTIMISTIC_OVERRIDE]
|
|
2400
2422
|
? e[STORE_OPTIMISTIC_OVERRIDE].length
|
|
2401
2423
|
: e[STORE_OVERRIDE] && "length" in e[STORE_OVERRIDE]
|
|
2402
2424
|
? e[STORE_OVERRIDE].length
|
|
2403
|
-
:
|
|
2404
|
-
const
|
|
2405
|
-
if (
|
|
2406
|
-
if (
|
|
2425
|
+
: o.length);
|
|
2426
|
+
const E = a && l > f ? l : undefined;
|
|
2427
|
+
if (u === c && E === undefined) return true;
|
|
2428
|
+
if (c !== undefined && c === r && E === undefined) delete e[s]?.[t];
|
|
2407
2429
|
else {
|
|
2408
|
-
const n = e[
|
|
2409
|
-
n[t] =
|
|
2410
|
-
if (
|
|
2430
|
+
const n = e[s] || (e[s] = Object.create(null));
|
|
2431
|
+
n[t] = c;
|
|
2432
|
+
if (E !== undefined) n.length = E;
|
|
2411
2433
|
}
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
const e = t === "length" ? a : d;
|
|
2418
|
-
e !== undefined && S.length && setSignal(S.length, e);
|
|
2434
|
+
notifyStoreProperty(e, t, "set", c);
|
|
2435
|
+
if (Array.isArray(o)) {
|
|
2436
|
+
const n = getNodes(e, STORE_NODE);
|
|
2437
|
+
const i = t === "length" ? c : E;
|
|
2438
|
+
i !== undefined && n.length && setSignal(n.length, i);
|
|
2419
2439
|
}
|
|
2420
|
-
|
|
2440
|
+
if (false);
|
|
2441
|
+
});
|
|
2442
|
+
}
|
|
2443
|
+
return true;
|
|
2444
|
+
},
|
|
2445
|
+
defineProperty(e, t, n) {
|
|
2446
|
+
const i = e[$PROXY];
|
|
2447
|
+
if (writeOnly(i)) {
|
|
2448
|
+
untrack(() => {
|
|
2449
|
+
const { base: r, overrideKey: s } = prepareStoreWrite(e, i, t);
|
|
2450
|
+
const o = "value" in n ? { ...n, value: n.value?.[$TARGET]?.[STORE_VALUE] ?? n.value } : n;
|
|
2451
|
+
Object.defineProperty(e[s] || (e[s] = Object.create(null)), t, o);
|
|
2452
|
+
notifyStoreProperty(e, t, "invalidate");
|
|
2421
2453
|
if (false);
|
|
2422
2454
|
});
|
|
2423
2455
|
}
|
|
@@ -2442,10 +2474,7 @@ const storeTraps = {
|
|
|
2442
2474
|
} else if (e[i] && t in e[i]) {
|
|
2443
2475
|
delete e[i][t];
|
|
2444
2476
|
} else return true;
|
|
2445
|
-
|
|
2446
|
-
const s = getNodes(e, STORE_NODE);
|
|
2447
|
-
s[t] && setSignal(s[t], undefined);
|
|
2448
|
-
s[$TRACK] && setSignal(s[$TRACK], undefined);
|
|
2477
|
+
notifyStoreProperty(e, t, "delete");
|
|
2449
2478
|
});
|
|
2450
2479
|
}
|
|
2451
2480
|
return true;
|
|
@@ -2467,9 +2496,11 @@ const storeTraps = {
|
|
|
2467
2496
|
if (t === $PROXY) return { value: e[$PROXY], writable: true, configurable: true };
|
|
2468
2497
|
if (e[STORE_OPTIMISTIC_OVERRIDE] && t in e[STORE_OPTIMISTIC_OVERRIDE]) {
|
|
2469
2498
|
if (e[STORE_OPTIMISTIC_OVERRIDE][t] === $DELETED) return undefined;
|
|
2470
|
-
const n =
|
|
2471
|
-
if (n)
|
|
2472
|
-
|
|
2499
|
+
const n = Reflect.getOwnPropertyDescriptor(e[STORE_OPTIMISTIC_OVERRIDE], t);
|
|
2500
|
+
if (n?.get || n?.set || !(t in e[STORE_VALUE])) return n;
|
|
2501
|
+
const i = getPropertyDescriptor(e[STORE_VALUE], e[STORE_OVERRIDE], t);
|
|
2502
|
+
if (i) {
|
|
2503
|
+
return { ...i, value: e[STORE_OPTIMISTIC_OVERRIDE][t] };
|
|
2473
2504
|
}
|
|
2474
2505
|
return {
|
|
2475
2506
|
value: e[STORE_OPTIMISTIC_OVERRIDE][t],
|
|
@@ -2597,7 +2628,7 @@ function createOptimisticProjectionInternal(e, t = {}, n) {
|
|
|
2597
2628
|
setProjectionWriteActive(false);
|
|
2598
2629
|
}
|
|
2599
2630
|
});
|
|
2600
|
-
i.
|
|
2631
|
+
i.Pe = true;
|
|
2601
2632
|
}
|
|
2602
2633
|
return { store: s, node: i };
|
|
2603
2634
|
}
|
|
@@ -2650,7 +2681,12 @@ function updatePath(e, t, n = 0) {
|
|
|
2650
2681
|
} else if (i === undefined || (isWrappable(r) && isWrappable(s) && !Array.isArray(s))) {
|
|
2651
2682
|
const t = i !== undefined ? e[i] : e;
|
|
2652
2683
|
const n = Object.keys(s);
|
|
2653
|
-
for (let e = 0; e < n.length; e++)
|
|
2684
|
+
for (let e = 0; e < n.length; e++) {
|
|
2685
|
+
const i = n[e];
|
|
2686
|
+
const r = Object.getOwnPropertyDescriptor(s, i);
|
|
2687
|
+
if (r.get || r.set) Object.defineProperty(t, i, r);
|
|
2688
|
+
else t[i] = r.value;
|
|
2689
|
+
}
|
|
2654
2690
|
} else {
|
|
2655
2691
|
e[i] = s;
|
|
2656
2692
|
}
|
|
@@ -2855,11 +2891,11 @@ function mapArray(e, t, n) {
|
|
|
2855
2891
|
return createMemo(
|
|
2856
2892
|
updateKeyedMap.bind({
|
|
2857
2893
|
Ye: createOwner(),
|
|
2858
|
-
|
|
2859
|
-
|
|
2894
|
+
Ze: 0,
|
|
2895
|
+
Be: e,
|
|
2860
2896
|
qe: [],
|
|
2861
|
-
|
|
2862
|
-
|
|
2897
|
+
Xe: s,
|
|
2898
|
+
ze: [],
|
|
2863
2899
|
Je: [],
|
|
2864
2900
|
et: i,
|
|
2865
2901
|
tt: i || n?.keyed === false ? [] : undefined,
|
|
@@ -2870,7 +2906,7 @@ function mapArray(e, t, n) {
|
|
|
2870
2906
|
}
|
|
2871
2907
|
const pureOptions = { pureWrite: true };
|
|
2872
2908
|
function updateKeyedMap() {
|
|
2873
|
-
const e = this.
|
|
2909
|
+
const e = this.Be() || [],
|
|
2874
2910
|
t = e.length;
|
|
2875
2911
|
e[$TRACK];
|
|
2876
2912
|
runWithOwner(this.Ye, () => {
|
|
@@ -2880,39 +2916,39 @@ function updateKeyedMap() {
|
|
|
2880
2916
|
? () => {
|
|
2881
2917
|
this.tt[i] = signal(e[i], pureOptions);
|
|
2882
2918
|
this.nt && (this.nt[i] = signal(i, pureOptions));
|
|
2883
|
-
return this.
|
|
2919
|
+
return this.Xe(accessor(this.tt[i]), this.nt ? accessor(this.nt[i]) : undefined);
|
|
2884
2920
|
}
|
|
2885
2921
|
: this.nt
|
|
2886
2922
|
? () => {
|
|
2887
2923
|
const t = e[i];
|
|
2888
2924
|
this.nt[i] = signal(i, pureOptions);
|
|
2889
|
-
return this.
|
|
2925
|
+
return this.Xe(() => t, accessor(this.nt[i]));
|
|
2890
2926
|
}
|
|
2891
2927
|
: () => {
|
|
2892
2928
|
const t = e[i];
|
|
2893
|
-
return this.
|
|
2929
|
+
return this.Xe(() => t);
|
|
2894
2930
|
};
|
|
2895
2931
|
if (t === 0) {
|
|
2896
|
-
if (this.
|
|
2932
|
+
if (this.Ze !== 0) {
|
|
2897
2933
|
this.Ye.dispose(false);
|
|
2898
2934
|
this.Je = [];
|
|
2899
2935
|
this.qe = [];
|
|
2900
|
-
this.
|
|
2901
|
-
this.
|
|
2936
|
+
this.ze = [];
|
|
2937
|
+
this.Ze = 0;
|
|
2902
2938
|
this.tt && (this.tt = []);
|
|
2903
2939
|
this.nt && (this.nt = []);
|
|
2904
2940
|
}
|
|
2905
|
-
if (this.it && !this.
|
|
2906
|
-
this.
|
|
2941
|
+
if (this.it && !this.ze[0]) {
|
|
2942
|
+
this.ze[0] = runWithOwner((this.Je[0] = createOwner()), this.it);
|
|
2907
2943
|
}
|
|
2908
|
-
} else if (this.
|
|
2944
|
+
} else if (this.Ze === 0) {
|
|
2909
2945
|
if (this.Je[0]) this.Je[0].dispose();
|
|
2910
|
-
this.
|
|
2946
|
+
this.ze = new Array(t);
|
|
2911
2947
|
for (i = 0; i < t; i++) {
|
|
2912
2948
|
this.qe[i] = e[i];
|
|
2913
|
-
this.
|
|
2949
|
+
this.ze[i] = runWithOwner((this.Je[i] = createOwner()), r);
|
|
2914
2950
|
}
|
|
2915
|
-
this.
|
|
2951
|
+
this.Ze = t;
|
|
2916
2952
|
} else {
|
|
2917
2953
|
let s,
|
|
2918
2954
|
o,
|
|
@@ -2926,20 +2962,20 @@ function updateKeyedMap() {
|
|
|
2926
2962
|
T = this.tt ? new Array(t) : undefined,
|
|
2927
2963
|
S = this.nt ? new Array(t) : undefined;
|
|
2928
2964
|
for (
|
|
2929
|
-
s = 0, o = Math.min(this.
|
|
2965
|
+
s = 0, o = Math.min(this.Ze, t);
|
|
2930
2966
|
s < o && (this.qe[s] === e[s] || (this.tt && compare(this.et, this.qe[s], e[s])));
|
|
2931
2967
|
s++
|
|
2932
2968
|
) {
|
|
2933
2969
|
if (this.tt) setSignal(this.tt[s], e[s]);
|
|
2934
2970
|
}
|
|
2935
2971
|
for (
|
|
2936
|
-
o = this.
|
|
2972
|
+
o = this.Ze - 1, u = t - 1;
|
|
2937
2973
|
o >= s &&
|
|
2938
2974
|
u >= s &&
|
|
2939
2975
|
(this.qe[o] === e[u] || (this.tt && compare(this.et, this.qe[o], e[u])));
|
|
2940
2976
|
o--, u--
|
|
2941
2977
|
) {
|
|
2942
|
-
E[u] = this.
|
|
2978
|
+
E[u] = this.ze[o];
|
|
2943
2979
|
d[u] = this.Je[o];
|
|
2944
2980
|
T && (T[u] = this.tt[o]);
|
|
2945
2981
|
S && (S[u] = this.nt[o]);
|
|
@@ -2958,7 +2994,7 @@ function updateKeyedMap() {
|
|
|
2958
2994
|
a = this.et ? this.et(c) : c;
|
|
2959
2995
|
i = l.get(a);
|
|
2960
2996
|
if (i !== undefined && i !== -1) {
|
|
2961
|
-
E[i] = this.
|
|
2997
|
+
E[i] = this.ze[n];
|
|
2962
2998
|
d[i] = this.Je[n];
|
|
2963
2999
|
T && (T[i] = this.tt[n]);
|
|
2964
3000
|
S && (S[i] = this.nt[n]);
|
|
@@ -2968,7 +3004,7 @@ function updateKeyedMap() {
|
|
|
2968
3004
|
}
|
|
2969
3005
|
for (i = s; i < t; i++) {
|
|
2970
3006
|
if (i in E) {
|
|
2971
|
-
this.
|
|
3007
|
+
this.ze[i] = E[i];
|
|
2972
3008
|
this.Je[i] = d[i];
|
|
2973
3009
|
if (T) {
|
|
2974
3010
|
this.tt[i] = T[i];
|
|
@@ -2979,25 +3015,25 @@ function updateKeyedMap() {
|
|
|
2979
3015
|
setSignal(this.nt[i], i);
|
|
2980
3016
|
}
|
|
2981
3017
|
} else {
|
|
2982
|
-
this.
|
|
3018
|
+
this.ze[i] = runWithOwner((this.Je[i] = createOwner()), r);
|
|
2983
3019
|
}
|
|
2984
3020
|
}
|
|
2985
|
-
this.
|
|
3021
|
+
this.ze = this.ze.slice(0, (this.Ze = t));
|
|
2986
3022
|
this.qe = e.slice(0);
|
|
2987
3023
|
}
|
|
2988
3024
|
});
|
|
2989
|
-
return this.
|
|
3025
|
+
return this.ze;
|
|
2990
3026
|
}
|
|
2991
3027
|
function repeat(e, t, n) {
|
|
2992
3028
|
const i = t;
|
|
2993
3029
|
return updateRepeat.bind({
|
|
2994
3030
|
Ye: createOwner(),
|
|
2995
|
-
|
|
3031
|
+
Ze: 0,
|
|
2996
3032
|
rt: 0,
|
|
2997
3033
|
st: e,
|
|
2998
|
-
|
|
3034
|
+
Xe: i,
|
|
2999
3035
|
Je: [],
|
|
3000
|
-
|
|
3036
|
+
ze: [],
|
|
3001
3037
|
ot: n?.from,
|
|
3002
3038
|
it: n?.fallback
|
|
3003
3039
|
});
|
|
@@ -3007,47 +3043,47 @@ function updateRepeat() {
|
|
|
3007
3043
|
const t = this.ot?.() || 0;
|
|
3008
3044
|
runWithOwner(this.Ye, () => {
|
|
3009
3045
|
if (e === 0) {
|
|
3010
|
-
if (this.
|
|
3046
|
+
if (this.Ze !== 0) {
|
|
3011
3047
|
this.Ye.dispose(false);
|
|
3012
3048
|
this.Je = [];
|
|
3013
|
-
this.
|
|
3014
|
-
this.
|
|
3049
|
+
this.ze = [];
|
|
3050
|
+
this.Ze = 0;
|
|
3015
3051
|
}
|
|
3016
|
-
if (this.it && !this.
|
|
3017
|
-
this.
|
|
3052
|
+
if (this.it && !this.ze[0]) {
|
|
3053
|
+
this.ze[0] = runWithOwner((this.Je[0] = createOwner()), this.it);
|
|
3018
3054
|
}
|
|
3019
3055
|
return;
|
|
3020
3056
|
}
|
|
3021
3057
|
const n = t + e;
|
|
3022
|
-
const i = this.rt + this.
|
|
3023
|
-
if (this.
|
|
3058
|
+
const i = this.rt + this.Ze;
|
|
3059
|
+
if (this.Ze === 0 && this.Je[0]) this.Je[0].dispose();
|
|
3024
3060
|
for (let e = n; e < i; e++) this.Je[e - this.rt].dispose();
|
|
3025
3061
|
if (this.rt < t) {
|
|
3026
3062
|
let e = this.rt;
|
|
3027
|
-
while (e < t && e < this.
|
|
3063
|
+
while (e < t && e < this.Ze) this.Je[e++].dispose();
|
|
3028
3064
|
this.Je.splice(0, t - this.rt);
|
|
3029
|
-
this.
|
|
3065
|
+
this.ze.splice(0, t - this.rt);
|
|
3030
3066
|
} else if (this.rt > t) {
|
|
3031
3067
|
let n = i - this.rt - 1;
|
|
3032
3068
|
let r = this.rt - t;
|
|
3033
|
-
this.Je.length = this.
|
|
3069
|
+
this.Je.length = this.ze.length = e;
|
|
3034
3070
|
while (n >= r) {
|
|
3035
3071
|
this.Je[n] = this.Je[n - r];
|
|
3036
|
-
this.
|
|
3072
|
+
this.ze[n] = this.ze[n - r];
|
|
3037
3073
|
n--;
|
|
3038
3074
|
}
|
|
3039
3075
|
for (let e = 0; e < r; e++) {
|
|
3040
|
-
this.
|
|
3076
|
+
this.ze[e] = runWithOwner((this.Je[e] = createOwner()), () => this.Xe(e + t));
|
|
3041
3077
|
}
|
|
3042
3078
|
}
|
|
3043
3079
|
for (let e = i; e < n; e++) {
|
|
3044
|
-
this.
|
|
3080
|
+
this.ze[e - t] = runWithOwner((this.Je[e - t] = createOwner()), () => this.Xe(e));
|
|
3045
3081
|
}
|
|
3046
|
-
this.
|
|
3082
|
+
this.ze = this.ze.slice(0, e);
|
|
3047
3083
|
this.rt = t;
|
|
3048
|
-
this.
|
|
3084
|
+
this.Ze = e;
|
|
3049
3085
|
});
|
|
3050
|
-
return this.
|
|
3086
|
+
return this.ze;
|
|
3051
3087
|
}
|
|
3052
3088
|
function compare(e, t, n) {
|
|
3053
3089
|
return e ? e(t) === e(n) : true;
|
|
@@ -3061,7 +3097,7 @@ function boundaryComputed(e, t) {
|
|
|
3061
3097
|
n.F.notify(n, n.ut, i, r);
|
|
3062
3098
|
};
|
|
3063
3099
|
n.ut = t;
|
|
3064
|
-
n.
|
|
3100
|
+
n.Pe = true;
|
|
3065
3101
|
recompute(n, true);
|
|
3066
3102
|
return n;
|
|
3067
3103
|
}
|
|
@@ -3100,8 +3136,8 @@ class RevealController {
|
|
|
3100
3136
|
dt;
|
|
3101
3137
|
ft = signal(false, { pureWrite: true, He: true });
|
|
3102
3138
|
Et = signal(false, { pureWrite: true, He: true });
|
|
3103
|
-
|
|
3104
|
-
|
|
3139
|
+
It = true;
|
|
3140
|
+
ht = false;
|
|
3105
3141
|
constructor(e, t) {
|
|
3106
3142
|
this.Rt = e;
|
|
3107
3143
|
this.Ot = t;
|
|
@@ -3130,9 +3166,9 @@ class RevealController {
|
|
|
3130
3166
|
untrack(() => this.evaluate());
|
|
3131
3167
|
}
|
|
3132
3168
|
evaluate(e, t) {
|
|
3133
|
-
if (this.
|
|
3134
|
-
this.
|
|
3135
|
-
const n = this.
|
|
3169
|
+
if (this.ht) return;
|
|
3170
|
+
this.ht = true;
|
|
3171
|
+
const n = this.It;
|
|
3136
3172
|
try {
|
|
3137
3173
|
const n = e ?? read(this.ft),
|
|
3138
3174
|
i = !!untrack(this.Ot),
|
|
@@ -3151,22 +3187,22 @@ class RevealController {
|
|
|
3151
3187
|
});
|
|
3152
3188
|
}
|
|
3153
3189
|
} finally {
|
|
3154
|
-
this.
|
|
3155
|
-
this.
|
|
3190
|
+
this.It = this.isReady();
|
|
3191
|
+
this.ht = false;
|
|
3156
3192
|
}
|
|
3157
|
-
if (this.dt && n !== this.
|
|
3193
|
+
if (this.dt && n !== this.It) this.dt.evaluate();
|
|
3158
3194
|
}
|
|
3159
3195
|
}
|
|
3160
3196
|
class CollectionQueue extends Queue {
|
|
3161
3197
|
Nt;
|
|
3162
3198
|
ct = new Set();
|
|
3163
|
-
|
|
3199
|
+
Pt;
|
|
3164
3200
|
lt = true;
|
|
3165
3201
|
ft = signal(false, { pureWrite: true, He: true });
|
|
3166
3202
|
Et = signal(false, { pureWrite: true, He: true });
|
|
3167
3203
|
Tt;
|
|
3168
3204
|
St = false;
|
|
3169
|
-
|
|
3205
|
+
gt;
|
|
3170
3206
|
Ct = ON_INIT;
|
|
3171
3207
|
constructor(e) {
|
|
3172
3208
|
super();
|
|
@@ -3178,10 +3214,10 @@ class CollectionQueue extends Queue {
|
|
|
3178
3214
|
}
|
|
3179
3215
|
notify(e, t, n, i) {
|
|
3180
3216
|
if (!(t & this.Nt)) return super.notify(e, t, n, i);
|
|
3181
|
-
if (this.St && this.
|
|
3217
|
+
if (this.St && this.gt) {
|
|
3182
3218
|
const e = untrack(() => {
|
|
3183
3219
|
try {
|
|
3184
|
-
return this.
|
|
3220
|
+
return this.gt();
|
|
3185
3221
|
} catch {
|
|
3186
3222
|
return ON_INIT;
|
|
3187
3223
|
}
|
|
@@ -3217,16 +3253,16 @@ class CollectionQueue extends Queue {
|
|
|
3217
3253
|
this.ct.delete(e);
|
|
3218
3254
|
}
|
|
3219
3255
|
if (!this.ct.size) {
|
|
3220
|
-
if (this.Nt & STATUS_PENDING && this.lt && !this.St && this.
|
|
3221
|
-
this.lt = !!(this.
|
|
3256
|
+
if (this.Nt & STATUS_PENDING && this.lt && !this.St && this.Pt) {
|
|
3257
|
+
this.lt = !!(this.Pt.Se & this.Nt);
|
|
3222
3258
|
} else {
|
|
3223
3259
|
this.lt = false;
|
|
3224
3260
|
}
|
|
3225
3261
|
if (!this.lt) {
|
|
3226
3262
|
setSignal(this.ft, false);
|
|
3227
|
-
if (this.
|
|
3263
|
+
if (this.gt) {
|
|
3228
3264
|
try {
|
|
3229
|
-
this.Ct = untrack(() => this.
|
|
3265
|
+
this.Ct = untrack(() => this.gt());
|
|
3230
3266
|
} catch {}
|
|
3231
3267
|
}
|
|
3232
3268
|
}
|
|
@@ -3238,8 +3274,8 @@ function createCollectionBoundary(e, t, n, i) {
|
|
|
3238
3274
|
const r = createOwner();
|
|
3239
3275
|
if (_revealUsed) setContext(RevealControllerContext, null, r);
|
|
3240
3276
|
const s = new CollectionQueue(e);
|
|
3241
|
-
if (i) s.
|
|
3242
|
-
const o = (s.
|
|
3277
|
+
if (i) s.gt = i;
|
|
3278
|
+
const o = (s.Pt = createBoundChildren(r, t, s, e));
|
|
3243
3279
|
untrack(() => {
|
|
3244
3280
|
let t = false;
|
|
3245
3281
|
try {
|