@but212/atom-effect-jquery 0.24.0 → 0.24.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 +4 -1
- package/dist/atom-effect-jquery.min.js +1 -1
- package/dist/atom-effect-jquery.min.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +266 -229
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -95,47 +95,63 @@ var d = Object.freeze([]), f = class {
|
|
|
95
95
|
return this._count;
|
|
96
96
|
}
|
|
97
97
|
getAt(e) {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
98
|
+
switch (e) {
|
|
99
|
+
case 0: return this._s0;
|
|
100
|
+
case 1: return this._s1;
|
|
101
|
+
case 2: return this._s2;
|
|
102
|
+
case 3: return this._s3;
|
|
103
|
+
default: {
|
|
104
|
+
let t = this._overflow;
|
|
105
|
+
if (t !== null && e >= 4) {
|
|
106
|
+
let n = e - 4;
|
|
107
|
+
if (n < t.length) return t[n] ?? null;
|
|
108
|
+
}
|
|
109
|
+
return null;
|
|
110
|
+
}
|
|
106
111
|
}
|
|
107
|
-
return null;
|
|
108
112
|
}
|
|
109
113
|
setAt(e, t) {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
114
|
+
switch (e) {
|
|
115
|
+
case 0:
|
|
116
|
+
this._s0 = t;
|
|
117
|
+
break;
|
|
118
|
+
case 1:
|
|
119
|
+
this._s1 = t;
|
|
120
|
+
break;
|
|
121
|
+
case 2:
|
|
122
|
+
this._s2 = t;
|
|
123
|
+
break;
|
|
124
|
+
case 3:
|
|
125
|
+
this._s3 = t;
|
|
126
|
+
break;
|
|
127
|
+
default: {
|
|
128
|
+
this._overflow ??= [];
|
|
129
|
+
let n = this._overflow;
|
|
130
|
+
n[e - 4] = t;
|
|
131
|
+
}
|
|
118
132
|
}
|
|
119
133
|
e >= this._count && (this._count = e + 1);
|
|
120
134
|
}
|
|
121
135
|
truncateFrom(e) {
|
|
122
136
|
let t = this._count;
|
|
123
137
|
if (e >= t) return;
|
|
124
|
-
if (e <=
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
138
|
+
if (e <= 3) switch (e) {
|
|
139
|
+
case 0: {
|
|
140
|
+
let e = this._s0;
|
|
141
|
+
e != null && (this._onItemRemoved(e), this._s0 = null);
|
|
142
|
+
}
|
|
143
|
+
case 1: {
|
|
144
|
+
let e = this._s1;
|
|
145
|
+
e != null && (this._onItemRemoved(e), this._s1 = null);
|
|
146
|
+
}
|
|
147
|
+
case 2: {
|
|
148
|
+
let e = this._s2;
|
|
149
|
+
e != null && (this._onItemRemoved(e), this._s2 = null);
|
|
150
|
+
}
|
|
151
|
+
case 3: {
|
|
152
|
+
let e = this._s3;
|
|
153
|
+
e != null && (this._onItemRemoved(e), this._s3 = null);
|
|
154
|
+
}
|
|
139
155
|
}
|
|
140
156
|
let n = this._overflow;
|
|
141
157
|
if (n !== null && t > 4) {
|
|
@@ -276,7 +292,7 @@ function T(e, t, n) {
|
|
|
276
292
|
}
|
|
277
293
|
var te = class {
|
|
278
294
|
constructor() {
|
|
279
|
-
this.flags = 0, this.version = 0, this._lastSeenEpoch = c.UNINITIALIZED, this.
|
|
295
|
+
this.flags = 0, this.version = 0, this._lastSeenEpoch = c.UNINITIALIZED, this._notifying = 0, this._hotIndex = -1, this._slots = null, this._deps = null, this.id = ee() & l;
|
|
280
296
|
}
|
|
281
297
|
subscribe(e) {
|
|
282
298
|
let t = typeof e == "function";
|
|
@@ -382,9 +398,11 @@ var ue = () => {
|
|
|
382
398
|
_mergeBatchQueue() {
|
|
383
399
|
if (this._batchQueueSize === 0) return;
|
|
384
400
|
let e = ++this._epoch, t = this._batchQueue, n = this._queueBuffer[this._bufferIndex], r = this._size;
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
401
|
+
for (let i = 0; i < this._batchQueueSize; i++) {
|
|
402
|
+
let a = t[i];
|
|
403
|
+
a._nextEpoch !== e && (a._nextEpoch = e, n[r++] = a);
|
|
404
|
+
}
|
|
405
|
+
this._size = r, this._batchQueueSize = 0, t.length = 0;
|
|
388
406
|
}
|
|
389
407
|
_drainQueue() {
|
|
390
408
|
let e = 0;
|
|
@@ -447,7 +465,7 @@ function O(e) {
|
|
|
447
465
|
}
|
|
448
466
|
var _e = class extends te {
|
|
449
467
|
constructor(e, t) {
|
|
450
|
-
super(), this
|
|
468
|
+
super(), this[pe] = !0, this[ge] = !0, this._value = e, this._pendingOldValue = void 0, t && (this.flags |= i.SYNC), C.attachDebugInfo(this, "atom", this.id);
|
|
451
469
|
}
|
|
452
470
|
get value() {
|
|
453
471
|
return D.current?.addDependency(this), this._value;
|
|
@@ -507,22 +525,34 @@ var ye = class extends y {
|
|
|
507
525
|
if (t >= n) return !1;
|
|
508
526
|
let r = n - t;
|
|
509
527
|
if (this._map !== null || r > this._SCAN_THRESHOLD) return this._claimViaMap(e, t);
|
|
510
|
-
if (t < 4) {
|
|
511
|
-
|
|
528
|
+
if (t < 4) switch (t) {
|
|
529
|
+
case 0: {
|
|
512
530
|
let t = this._s0;
|
|
513
531
|
if (t && t.node === e && t.unsub) return t.version = e.version, !0;
|
|
514
532
|
}
|
|
515
|
-
|
|
533
|
+
case 1: if (n > 1) {
|
|
516
534
|
let n = this._s1;
|
|
517
535
|
if (n && n.node === e && n.unsub) return n.version = e.version, t !== 1 && (this._s1 = this._s0, this._s0 = n), !0;
|
|
518
536
|
}
|
|
519
|
-
|
|
537
|
+
case 2: if (n > 2) {
|
|
520
538
|
let n = this._s2;
|
|
521
|
-
if (n && n.node === e && n.unsub)
|
|
539
|
+
if (n && n.node === e && n.unsub) {
|
|
540
|
+
if (n.version = e.version, t !== 2) {
|
|
541
|
+
let e = t === 0 ? this._s0 : this._s1;
|
|
542
|
+
t === 0 ? this._s0 = n : this._s1 = n, this._s2 = e;
|
|
543
|
+
}
|
|
544
|
+
return !0;
|
|
545
|
+
}
|
|
522
546
|
}
|
|
523
|
-
|
|
547
|
+
case 3: if (n > 3) {
|
|
524
548
|
let n = this._s3;
|
|
525
|
-
if (n && n.node === e && n.unsub)
|
|
549
|
+
if (n && n.node === e && n.unsub) {
|
|
550
|
+
if (n.version = e.version, t !== 3) {
|
|
551
|
+
let e;
|
|
552
|
+
t === 0 ? (e = this._s0, this._s0 = n) : t === 1 ? (e = this._s1, this._s1 = n) : (e = this._s2, this._s2 = n), this._s3 = e;
|
|
553
|
+
}
|
|
554
|
+
return !0;
|
|
555
|
+
}
|
|
526
556
|
}
|
|
527
557
|
}
|
|
528
558
|
let i = t > 4 ? t : 4, a = this._overflow;
|
|
@@ -536,9 +566,14 @@ var ye = class extends y {
|
|
|
536
566
|
if (this._map === null) {
|
|
537
567
|
this._map = /* @__PURE__ */ new Map();
|
|
538
568
|
let e = this._count;
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
569
|
+
t < 4 && (t <= 0 && this._s0?.unsub && this._map.set(this._s0.node, 0), t <= 1 && this._s1?.unsub && this._map.set(this._s1.node, 1), t <= 2 && this._s2?.unsub && this._map.set(this._s2.node, 2), t <= 3 && this._s3?.unsub && this._map.set(this._s3.node, 3));
|
|
570
|
+
let n = this._overflow;
|
|
571
|
+
if (n && e > 4) {
|
|
572
|
+
let e = t > 4 ? t : 4;
|
|
573
|
+
for (let t = e - 4, r = n.length; t < r; t++) {
|
|
574
|
+
let e = n[t];
|
|
575
|
+
e?.unsub && this._map.set(e.node, t + 4);
|
|
576
|
+
}
|
|
542
577
|
}
|
|
543
578
|
}
|
|
544
579
|
let n = this._map.get(e);
|
|
@@ -558,7 +593,14 @@ var ye = class extends y {
|
|
|
558
593
|
_swapGeneral(e, t, n) {
|
|
559
594
|
if (e === t) return;
|
|
560
595
|
let r = this.getAt(t);
|
|
561
|
-
this.setAt(t, n), this.
|
|
596
|
+
if (this.setAt(t, n), e === 0) this._s0 = r;
|
|
597
|
+
else if (e === 1) this._s1 = r;
|
|
598
|
+
else if (e === 2) this._s2 = r;
|
|
599
|
+
else if (e === 3) this._s3 = r;
|
|
600
|
+
else {
|
|
601
|
+
let t = this._overflow;
|
|
602
|
+
t[e - 4] = r;
|
|
603
|
+
}
|
|
562
604
|
}
|
|
563
605
|
insertNew(e, t) {
|
|
564
606
|
let n = this._count;
|
|
@@ -566,98 +608,84 @@ var ye = class extends y {
|
|
|
566
608
|
let t = this.getAt(e);
|
|
567
609
|
t != null && (this.add(t), this._map !== null && t.unsub && this._map.set(t.node, this._count - 1));
|
|
568
610
|
}
|
|
569
|
-
e === 0
|
|
611
|
+
if (e === 0) this._s0 = t;
|
|
612
|
+
else if (e === 1) this._s1 = t;
|
|
613
|
+
else if (e === 2) this._s2 = t;
|
|
614
|
+
else if (e === 3) this._s3 = t;
|
|
615
|
+
else {
|
|
616
|
+
let n = this._overflow;
|
|
617
|
+
n || (n = [], this._overflow = n), n[e - 4] = t;
|
|
618
|
+
}
|
|
619
|
+
e >= n && (this._count = e + 1);
|
|
570
620
|
}
|
|
571
621
|
truncateFrom(e) {
|
|
572
622
|
e >= this._count || (super.truncateFrom(e), this._map !== null && (this._map.clear(), this._map = null));
|
|
573
623
|
}
|
|
574
624
|
seal() {
|
|
575
|
-
let e = this._count;
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
625
|
+
let e = this._count, t = u.VERSION_BITS, n = 0;
|
|
626
|
+
switch (e) {
|
|
627
|
+
case 0:
|
|
628
|
+
this._depsHash = 0;
|
|
629
|
+
return;
|
|
630
|
+
case 1: {
|
|
631
|
+
let e = this._s0;
|
|
632
|
+
n = n + (e.version << t) + e.node.id | 0;
|
|
633
|
+
break;
|
|
634
|
+
}
|
|
635
|
+
case 2: {
|
|
636
|
+
let e = this._s0, r = this._s1;
|
|
637
|
+
n = n + (e.version << t) + e.node.id | 0, n = n + (r.version << t) + r.node.id | 0;
|
|
638
|
+
break;
|
|
639
|
+
}
|
|
640
|
+
case 3: {
|
|
641
|
+
let e = this._s0, r = this._s1, i = this._s2;
|
|
642
|
+
n = n + (e.version << t) + e.node.id | 0, n = n + (r.version << t) + r.node.id | 0, n = n + (i.version << t) + i.node.id | 0;
|
|
643
|
+
break;
|
|
644
|
+
}
|
|
645
|
+
default: {
|
|
646
|
+
let r = this._s0, i = this._s1, a = this._s2, o = this._s3;
|
|
647
|
+
if (n = n + (r.version << t) + r.node.id | 0, n = n + (i.version << t) + i.node.id | 0, n = n + (a.version << t) + a.node.id | 0, n = n + (o.version << t) + o.node.id | 0, e > 4) {
|
|
648
|
+
let e = this._overflow;
|
|
649
|
+
for (let r = 0, i = e.length; r < i; r++) {
|
|
650
|
+
let i = e[r];
|
|
651
|
+
n = n + (i.version << t) + i.node.id | 0;
|
|
652
|
+
}
|
|
653
|
+
}
|
|
596
654
|
}
|
|
597
655
|
}
|
|
598
|
-
this._depsHash =
|
|
656
|
+
this._depsHash = n;
|
|
599
657
|
}
|
|
600
658
|
isDirtyFast() {
|
|
601
|
-
let e = this._count;
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
if (e > 1) {
|
|
609
|
-
let e = this._s1;
|
|
610
|
-
if (e) {
|
|
611
|
-
let r = e.node;
|
|
612
|
-
t = t + (r.version << n) + r.id | 0;
|
|
659
|
+
let e = this._count, t = u.VERSION_BITS, n = 0;
|
|
660
|
+
switch (e) {
|
|
661
|
+
case 0: return !1;
|
|
662
|
+
case 1: {
|
|
663
|
+
let e = this._s0.node;
|
|
664
|
+
n = n + (e.version << t) + e.id | 0;
|
|
665
|
+
break;
|
|
613
666
|
}
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
let r = e.node;
|
|
619
|
-
t = t + (r.version << n) + r.id | 0;
|
|
667
|
+
case 2: {
|
|
668
|
+
let e = this._s0.node, r = this._s1.node;
|
|
669
|
+
n = n + (e.version << t) + e.id | 0, n = n + (r.version << t) + r.id | 0;
|
|
670
|
+
break;
|
|
620
671
|
}
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
let r = e.node;
|
|
626
|
-
t = t + (r.version << n) + r.id | 0;
|
|
672
|
+
case 3: {
|
|
673
|
+
let e = this._s0.node, r = this._s1.node, i = this._s2.node;
|
|
674
|
+
n = n + (e.version << t) + e.id | 0, n = n + (r.version << t) + r.id | 0, n = n + (i.version << t) + i.id | 0;
|
|
675
|
+
break;
|
|
627
676
|
}
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
let
|
|
633
|
-
|
|
677
|
+
default: {
|
|
678
|
+
let r = this._s0.node, i = this._s1.node, a = this._s2.node, o = this._s3.node;
|
|
679
|
+
if (n = n + (r.version << t) + r.id | 0, n = n + (i.version << t) + i.id | 0, n = n + (a.version << t) + a.id | 0, n = n + (o.version << t) + o.id | 0, e > 4) {
|
|
680
|
+
let e = this._overflow;
|
|
681
|
+
for (let r = 0, i = e.length; r < i; r++) {
|
|
682
|
+
let i = e[r].node;
|
|
683
|
+
n = n + (i.version << t) + i.id | 0;
|
|
684
|
+
}
|
|
634
685
|
}
|
|
635
686
|
}
|
|
636
687
|
}
|
|
637
|
-
return
|
|
638
|
-
}
|
|
639
|
-
captureVersionSnapshot() {
|
|
640
|
-
let e = this._count;
|
|
641
|
-
if (e <= 0) return 0;
|
|
642
|
-
let t = 0, n = this._s0;
|
|
643
|
-
if (n && (t = (t << 5) - t + n.node.version | 0), e > 1) {
|
|
644
|
-
let e = this._s1;
|
|
645
|
-
e && (t = (t << 5) - t + e.node.version | 0);
|
|
646
|
-
}
|
|
647
|
-
if (e > 2) {
|
|
648
|
-
let e = this._s2;
|
|
649
|
-
e && (t = (t << 5) - t + e.node.version | 0);
|
|
650
|
-
}
|
|
651
|
-
if (e > 3) {
|
|
652
|
-
let e = this._s3;
|
|
653
|
-
e && (t = (t << 5) - t + e.node.version | 0);
|
|
654
|
-
let n = this._overflow;
|
|
655
|
-
if (n) for (let e = 0, r = n.length; e < r; e++) {
|
|
656
|
-
let r = n[e];
|
|
657
|
-
r && (t = (t << 5) - t + r.node.version | 0);
|
|
658
|
-
}
|
|
659
|
-
}
|
|
660
|
-
return t;
|
|
688
|
+
return n !== this._depsHash;
|
|
661
689
|
}
|
|
662
690
|
disposeAll() {
|
|
663
691
|
this._count > 0 && this.truncateFrom(0), this.hasComputeds = !1, this._map !== null && (this._map.clear(), this._map = null);
|
|
@@ -679,7 +707,7 @@ function xe(e) {
|
|
|
679
707
|
var { IDLE: A, DIRTY: j, PENDING: M, RESOLVED: N, REJECTED: P, HAS_ERROR: F, RECOMPUTING: I, DISPOSED: Se, IS_COMPUTED: Ce, FORCE_COMPUTE: we } = r, Te = class extends te {
|
|
680
708
|
constructor(e, t = {}) {
|
|
681
709
|
if (typeof e != "function") throw new h(v.COMPUTED_MUST_BE_FUNCTION);
|
|
682
|
-
if (super(), this[pe] = !0, this[me] = !0, this._error = null, this._promiseId = 0, this._deps = new ye(), this.
|
|
710
|
+
if (super(), this[pe] = !0, this[me] = !0, this._error = null, this._promiseId = 0, this._deps = new ye(), this._asyncRetryCount = 0, this._lastDriftEpoch = c.UNINITIALIZED, this._trackEpoch = c.UNINITIALIZED, this._trackCount = 0, this._value = void 0, this.flags = Ce | j | A, this._equal = t.equal ?? Object.is, this._fn = e, this._defaultValue = "defaultValue" in t ? t.defaultValue : S, this._onError = t.onError ?? null, this._maxAsyncRetries = (t.maxAsyncRetries ?? s.MAX_ASYNC_RETRIES) & l, C.attachDebugInfo(this, "computed", this.id), t.lazy === !1) try {
|
|
683
711
|
this._recompute();
|
|
684
712
|
} catch {}
|
|
685
713
|
}
|
|
@@ -717,7 +745,9 @@ var { IDLE: A, DIRTY: j, PENDING: M, RESOLVED: N, REJECTED: P, HAS_ERROR: F, REC
|
|
|
717
745
|
}
|
|
718
746
|
get hasError() {
|
|
719
747
|
if (this._track(), this.flags & (P | F)) return !0;
|
|
720
|
-
let e = this._deps
|
|
748
|
+
let e = this._deps;
|
|
749
|
+
if (!e.hasComputeds) return !1;
|
|
750
|
+
let t = e.size;
|
|
721
751
|
for (let n = 0; n < t; n++) {
|
|
722
752
|
let t = e.getAt(n);
|
|
723
753
|
if (t != null && t.node.flags & F) return !0;
|
|
@@ -731,7 +761,9 @@ var { IDLE: A, DIRTY: j, PENDING: M, RESOLVED: N, REJECTED: P, HAS_ERROR: F, REC
|
|
|
731
761
|
this._track();
|
|
732
762
|
let e = [];
|
|
733
763
|
this._error && e.push(this._error);
|
|
734
|
-
let t = this._deps
|
|
764
|
+
let t = this._deps;
|
|
765
|
+
if (!t.hasComputeds) return e.length === 0 ? d : Object.freeze(e);
|
|
766
|
+
let n = t.size;
|
|
735
767
|
for (let r = 0; r < n; r++) {
|
|
736
768
|
let n = t.getAt(r);
|
|
737
769
|
if (n == null) continue;
|
|
@@ -793,11 +825,11 @@ var { IDLE: A, DIRTY: j, PENDING: M, RESOLVED: N, REJECTED: P, HAS_ERROR: F, REC
|
|
|
793
825
|
}
|
|
794
826
|
}
|
|
795
827
|
_handleAsyncComputation(e) {
|
|
796
|
-
this.flags = (this.flags | M) & ~(A | j | N | P), this._notifySubscribers(void 0, void 0), this.
|
|
828
|
+
this.flags = (this.flags | M) & ~(A | j | N | P), this._notifySubscribers(void 0, void 0), this._asyncRetryCount = 0, this._promiseId = (this._promiseId + 1) % s.MAX_PROMISE_ID;
|
|
797
829
|
let t = this._promiseId;
|
|
798
830
|
e.then((e) => {
|
|
799
831
|
if (t === this._promiseId) {
|
|
800
|
-
if (this.
|
|
832
|
+
if (this._isDirty()) {
|
|
801
833
|
let e = ce();
|
|
802
834
|
return this._lastDriftEpoch !== e && (this._lastDriftEpoch = e, this._asyncRetryCount = 0), this._asyncRetryCount++ < this._maxAsyncRetries ? this._markDirty() : this._handleError(new h(`Async drift threshold exceeded after ${this._maxAsyncRetries} retries.`), v.COMPUTED_ASYNC_COMPUTATION_FAILED);
|
|
803
835
|
}
|
|
@@ -805,9 +837,6 @@ var { IDLE: A, DIRTY: j, PENDING: M, RESOLVED: N, REJECTED: P, HAS_ERROR: F, REC
|
|
|
805
837
|
}
|
|
806
838
|
}, (e) => t === this._promiseId && this._handleError(e, v.COMPUTED_ASYNC_COMPUTATION_FAILED));
|
|
807
839
|
}
|
|
808
|
-
_captureVersionSnapshot() {
|
|
809
|
-
return this._deps.captureVersionSnapshot();
|
|
810
|
-
}
|
|
811
840
|
_handleError(e, t, n = !1) {
|
|
812
841
|
let r = T(e, h, t);
|
|
813
842
|
if (!n && !(this.flags & P) && (this.version = ie(this.version)), this._error = r, this.flags = this.flags & ~(A | j | M | N) | P | F, this._onError) try {
|
|
@@ -827,6 +856,10 @@ var { IDLE: A, DIRTY: j, PENDING: M, RESOLVED: N, REJECTED: P, HAS_ERROR: F, REC
|
|
|
827
856
|
_markDirty() {
|
|
828
857
|
this.flags & (I | j) || (this.flags |= j, this._notifySubscribers(void 0, void 0));
|
|
829
858
|
}
|
|
859
|
+
_isDirty() {
|
|
860
|
+
let e = this._deps;
|
|
861
|
+
return e.hasComputeds ? this._deepDirtyCheck() : e.isDirtyFast();
|
|
862
|
+
}
|
|
830
863
|
_deepDirtyCheck() {
|
|
831
864
|
let e = this._deps, t = D.current;
|
|
832
865
|
D.current = null;
|
|
@@ -852,7 +885,7 @@ function L(e, t = {}) {
|
|
|
852
885
|
}
|
|
853
886
|
var Ee = class extends te {
|
|
854
887
|
constructor(e, t = {}) {
|
|
855
|
-
super(), this[he] = !0, this._cleanup = null, this._deps = new ye(), this._currentEpoch = c.UNINITIALIZED, this._lastFlushEpoch = c.UNINITIALIZED, this.
|
|
888
|
+
super(), this[he] = !0, this._cleanup = null, this._deps = new ye(), this._currentEpoch = c.UNINITIALIZED, this._lastFlushEpoch = c.UNINITIALIZED, this._fn = e, this._onError = t.onError ?? null, this._sync = t.sync ?? !1, this._maxExecutions = t.maxExecutionsPerSecond ?? a.MAX_EXECUTIONS_PER_SECOND, this._maxExecutionsPerFlush = t.maxExecutionsPerFlush ?? a.MAX_EXECUTIONS_PER_EFFECT, this._cleanup = null, this._deps = new ye(), this._currentEpoch = c.UNINITIALIZED, this._lastFlushEpoch = c.UNINITIALIZED, this._executionsInEpoch = 0, this._executionCount = 0, this._windowStart = 0, this._windowCount = 0, this._execId = 0, this._trackCount = 0, this._sync ? this._notifyCallback = () => this.execute() : this._notifyCallback = () => E.schedule(this), C.attachDebugInfo(this, "effect", this.id);
|
|
856
889
|
}
|
|
857
890
|
run() {
|
|
858
891
|
if (this.flags & n.DISPOSED) throw new g(v.EFFECT_DISPOSED);
|
|
@@ -869,8 +902,8 @@ var Ee = class extends te {
|
|
|
869
902
|
let t = this._currentEpoch;
|
|
870
903
|
if (e._lastSeenEpoch === t) return;
|
|
871
904
|
e._lastSeenEpoch = t;
|
|
872
|
-
let i = this._trackCount, a = this._deps, o
|
|
873
|
-
o != null && o.node === e ? o.version = e.version : a.claimExisting(e, i) || this._insertNewDependency(e, i), e.flags & r.IS_COMPUTED && (a.hasComputeds = !0), this._trackCount = i + 1;
|
|
905
|
+
let i = this._trackCount, a = this._deps, o;
|
|
906
|
+
o = i === 0 ? a._s0 : i === 1 ? a._s1 : i === 2 ? a._s2 : i === 3 ? a._s3 : a.getAt(i), o != null && o.node === e ? o.version = e.version : a.claimExisting(e, i) || this._insertNewDependency(e, i), e.flags & r.IS_COMPUTED && (a.hasComputeds = !0), this._trackCount = i + 1;
|
|
874
907
|
}
|
|
875
908
|
_insertNewDependency(e, t) {
|
|
876
909
|
let n;
|
|
@@ -904,6 +937,10 @@ var Ee = class extends te {
|
|
|
904
937
|
this.flags &= ~n.EXECUTING;
|
|
905
938
|
}
|
|
906
939
|
}
|
|
940
|
+
_isDirty() {
|
|
941
|
+
let e = this._deps;
|
|
942
|
+
return e.hasComputeds ? this._deepDirtyCheck() : e.isDirtyFast();
|
|
943
|
+
}
|
|
907
944
|
_handleAsyncResult(e) {
|
|
908
945
|
let t = ++this._execId;
|
|
909
946
|
e.then((e) => {
|
|
@@ -1004,10 +1041,10 @@ function De(e) {
|
|
|
1004
1041
|
}
|
|
1005
1042
|
//#endregion
|
|
1006
1043
|
//#region src/utils/index.ts
|
|
1007
|
-
function
|
|
1044
|
+
function z(e) {
|
|
1008
1045
|
return k(e);
|
|
1009
1046
|
}
|
|
1010
|
-
function
|
|
1047
|
+
function B(e) {
|
|
1011
1048
|
let t = e.tagName.toLowerCase();
|
|
1012
1049
|
if (e.id) return `${t}#${e.id}`;
|
|
1013
1050
|
let n = e.classList, r = n.length;
|
|
@@ -1016,8 +1053,8 @@ function z(e) {
|
|
|
1016
1053
|
for (let e = 0; e < r; e++) i += `.${n[e]}`;
|
|
1017
1054
|
return i;
|
|
1018
1055
|
}
|
|
1019
|
-
var
|
|
1020
|
-
function
|
|
1056
|
+
var V = Object.prototype.hasOwnProperty;
|
|
1057
|
+
function Oe(e, t) {
|
|
1021
1058
|
if (e === t) return !0;
|
|
1022
1059
|
if (e === null || t === null || typeof e != "object" || typeof t != "object") return !1;
|
|
1023
1060
|
let n = Object.keys(e), r = Object.keys(t);
|
|
@@ -1025,30 +1062,30 @@ function ke(e, t) {
|
|
|
1025
1062
|
let i = e, a = t;
|
|
1026
1063
|
for (let e = 0; e < n.length; e++) {
|
|
1027
1064
|
let t = n[e];
|
|
1028
|
-
if (!
|
|
1065
|
+
if (!V.call(a, t) || i[t] !== a[t]) return !1;
|
|
1029
1066
|
}
|
|
1030
1067
|
return !0;
|
|
1031
1068
|
}
|
|
1032
1069
|
//#endregion
|
|
1033
1070
|
//#region src/constants.ts
|
|
1034
|
-
var
|
|
1071
|
+
var H = {
|
|
1035
1072
|
ROUTE: "[atom-route]",
|
|
1036
1073
|
BINDING: "[atom-binding]",
|
|
1037
1074
|
LIST: "[atom-list]",
|
|
1038
1075
|
MOUNT: "[atom-mount]"
|
|
1039
|
-
},
|
|
1076
|
+
}, U = Object.freeze({
|
|
1040
1077
|
mode: "hash",
|
|
1041
1078
|
basePath: "",
|
|
1042
1079
|
autoBindLinks: !1,
|
|
1043
1080
|
activeClass: "active"
|
|
1044
|
-
}),
|
|
1081
|
+
}), ke = {
|
|
1045
1082
|
EVENT: "input",
|
|
1046
1083
|
DEBOUNCE: 0
|
|
1047
|
-
},
|
|
1084
|
+
}, Ae = { HIGHLIGHT_DURATION_MS: 500 }, je = new Set([
|
|
1048
1085
|
"input",
|
|
1049
1086
|
"select",
|
|
1050
1087
|
"textarea"
|
|
1051
|
-
]),
|
|
1088
|
+
]), Me = new Set([
|
|
1052
1089
|
"src",
|
|
1053
1090
|
"href",
|
|
1054
1091
|
"action",
|
|
@@ -1063,14 +1100,14 @@ var V = {
|
|
|
1063
1100
|
"classid",
|
|
1064
1101
|
"codebase",
|
|
1065
1102
|
"xlink:href"
|
|
1066
|
-
]),
|
|
1103
|
+
]), Ne = new Set([
|
|
1067
1104
|
"innerHTML",
|
|
1068
1105
|
"outerHTML",
|
|
1069
1106
|
"srcdoc",
|
|
1070
1107
|
"__proto__",
|
|
1071
1108
|
"constructor",
|
|
1072
1109
|
"prototype"
|
|
1073
|
-
]),
|
|
1110
|
+
]), W = {
|
|
1074
1111
|
ROUTE: {
|
|
1075
1112
|
NOT_FOUND: (e) => `Route "${e}" not found and no notFound route configured`,
|
|
1076
1113
|
TEMPLATE_NOT_FOUND: (e) => `Template "${e}" not found`,
|
|
@@ -1098,8 +1135,8 @@ var V = {
|
|
|
1098
1135
|
CLEANUP_ERROR: (e) => `Cleanup error${e ? ` in component <${e}>` : ""}`
|
|
1099
1136
|
},
|
|
1100
1137
|
CORE: { EFFECT_DISPOSE_ERROR: (e) => `Effect dispose error${e ? `: ${e}` : ""}` }
|
|
1101
|
-
},
|
|
1102
|
-
function
|
|
1138
|
+
}, Pe = `${Ae.HIGHLIGHT_DURATION_MS / 1e3}s`;
|
|
1139
|
+
function Fe() {
|
|
1103
1140
|
if (typeof window < "u") {
|
|
1104
1141
|
let e = window.__ATOM_DEBUG__;
|
|
1105
1142
|
if (typeof e == "boolean") return e;
|
|
@@ -1109,16 +1146,16 @@ function Ie() {
|
|
|
1109
1146
|
} catch {}
|
|
1110
1147
|
return !1;
|
|
1111
1148
|
}
|
|
1112
|
-
var
|
|
1149
|
+
var Ie = Fe(), G = {
|
|
1113
1150
|
get enabled() {
|
|
1114
1151
|
if (typeof window < "u") {
|
|
1115
1152
|
let e = window.__ATOM_DEBUG__;
|
|
1116
1153
|
if (typeof e == "boolean") return e;
|
|
1117
1154
|
}
|
|
1118
|
-
return
|
|
1155
|
+
return Ie;
|
|
1119
1156
|
},
|
|
1120
1157
|
set enabled(e) {
|
|
1121
|
-
|
|
1158
|
+
Ie = e;
|
|
1122
1159
|
},
|
|
1123
1160
|
log(e, ...t) {
|
|
1124
1161
|
this.enabled && console.log(`${e}`, ...t);
|
|
@@ -1129,7 +1166,7 @@ var Le = Ie(), W = {
|
|
|
1129
1166
|
domUpdated(e, t, n, r) {
|
|
1130
1167
|
if (!this.enabled) return;
|
|
1131
1168
|
let i = t instanceof Element ? t : t[0];
|
|
1132
|
-
i && (console.log(`${e} DOM updated: ${
|
|
1169
|
+
i && (console.log(`${e} DOM updated: ${B(i)}.${n} =`, r), Ue(i));
|
|
1133
1170
|
},
|
|
1134
1171
|
cleanup(e, t) {
|
|
1135
1172
|
this.enabled && console.log(`${e} Cleanup: ${t}`);
|
|
@@ -1140,24 +1177,24 @@ var Le = Ie(), W = {
|
|
|
1140
1177
|
error(e, t, n) {
|
|
1141
1178
|
console.error(`${e} ${t}`, n);
|
|
1142
1179
|
}
|
|
1143
|
-
},
|
|
1180
|
+
}, Le = "atom-debug-highlight", Re = "data-atom-debug", ze;
|
|
1144
1181
|
function Be() {
|
|
1145
|
-
if ((
|
|
1182
|
+
if ((ze instanceof HTMLStyleElement ? ze : ze?.deref())?.isConnected || document.querySelector(`style[${Re}]`)) return;
|
|
1146
1183
|
let e = document.createElement("style");
|
|
1147
|
-
e.setAttribute(
|
|
1184
|
+
e.setAttribute(Re, ""), e.textContent = `.${Le}{outline:2px solid rgba(255,68,68,0.8);outline-offset:1px;transition:outline ${Pe} ease-out}`, document.head.appendChild(e), ze = typeof WeakRef < "u" ? new WeakRef(e) : e;
|
|
1148
1185
|
}
|
|
1149
1186
|
var Ve = /* @__PURE__ */ new WeakMap(), He = /* @__PURE__ */ new WeakMap();
|
|
1150
1187
|
function Ue(e) {
|
|
1151
|
-
if (!
|
|
1188
|
+
if (!G.enabled || !e.isConnected) return;
|
|
1152
1189
|
Be();
|
|
1153
1190
|
let t = He.get(e);
|
|
1154
1191
|
t !== void 0 && cancelAnimationFrame(t);
|
|
1155
1192
|
let n = Ve.get(e);
|
|
1156
1193
|
n !== void 0 && clearTimeout(n);
|
|
1157
1194
|
let r = requestAnimationFrame(() => {
|
|
1158
|
-
He.delete(e), e.isConnected && (e.classList.add(
|
|
1159
|
-
e.isConnected && e.classList.remove(
|
|
1160
|
-
},
|
|
1195
|
+
He.delete(e), e.isConnected && (e.classList.add(Le), Ve.set(e, setTimeout(() => {
|
|
1196
|
+
e.isConnected && e.classList.remove(Le), Ve.delete(e);
|
|
1197
|
+
}, Ae.HIGHLIGHT_DURATION_MS)));
|
|
1161
1198
|
});
|
|
1162
1199
|
He.set(e, r);
|
|
1163
1200
|
}
|
|
@@ -1170,10 +1207,10 @@ Object.defineProperty(We, "debug", {
|
|
|
1170
1207
|
enumerable: !0,
|
|
1171
1208
|
configurable: !0,
|
|
1172
1209
|
get() {
|
|
1173
|
-
return
|
|
1210
|
+
return G.enabled;
|
|
1174
1211
|
},
|
|
1175
1212
|
set(e) {
|
|
1176
|
-
|
|
1213
|
+
G.enabled = e;
|
|
1177
1214
|
}
|
|
1178
1215
|
});
|
|
1179
1216
|
function Ge() {
|
|
@@ -1187,7 +1224,7 @@ var Ke = {
|
|
|
1187
1224
|
untracked: O,
|
|
1188
1225
|
isAtom: k,
|
|
1189
1226
|
isComputed: be,
|
|
1190
|
-
isReactive:
|
|
1227
|
+
isReactive: z,
|
|
1191
1228
|
nextTick: Ge
|
|
1192
1229
|
};
|
|
1193
1230
|
e.extend(Ke);
|
|
@@ -1269,23 +1306,23 @@ var qe = class {
|
|
|
1269
1306
|
e.nodeType === 1 && e.classList.remove(K), this.preservedNodes.delete(e), this.ignoredNodes.delete(e);
|
|
1270
1307
|
return;
|
|
1271
1308
|
}
|
|
1272
|
-
if (this.records.delete(e), this.preservedNodes.delete(e), this.ignoredNodes.delete(e), e.nodeType === 1 && e.classList.remove(K),
|
|
1273
|
-
let t = e.nodeType === 1 ?
|
|
1274
|
-
|
|
1309
|
+
if (this.records.delete(e), this.preservedNodes.delete(e), this.ignoredNodes.delete(e), e.nodeType === 1 && e.classList.remove(K), G.enabled) {
|
|
1310
|
+
let t = e.nodeType === 1 ? B(e) : e.nodeName || "Node";
|
|
1311
|
+
G.cleanup(H.BINDING, t);
|
|
1275
1312
|
}
|
|
1276
1313
|
if (t.componentCleanup) try {
|
|
1277
1314
|
t.componentCleanup();
|
|
1278
1315
|
} catch (t) {
|
|
1279
|
-
let n = e.nodeType === 1 ?
|
|
1280
|
-
|
|
1316
|
+
let n = e.nodeType === 1 ? B(e) : "Node";
|
|
1317
|
+
G.error(H.MOUNT, W.MOUNT.CLEANUP_ERROR(n), t);
|
|
1281
1318
|
}
|
|
1282
1319
|
if (t.effects) {
|
|
1283
1320
|
let n = t.effects;
|
|
1284
1321
|
for (let t = 0, r = n.length; t < r; t++) try {
|
|
1285
1322
|
n[t].dispose();
|
|
1286
1323
|
} catch (t) {
|
|
1287
|
-
let n = e.nodeType === 1 ?
|
|
1288
|
-
|
|
1324
|
+
let n = e.nodeType === 1 ? B(e) : "Node";
|
|
1325
|
+
G.error(H.BINDING, W.CORE.EFFECT_DISPOSE_ERROR(n), t);
|
|
1289
1326
|
}
|
|
1290
1327
|
Ye.release(n), t.effects = void 0;
|
|
1291
1328
|
}
|
|
@@ -1294,8 +1331,8 @@ var qe = class {
|
|
|
1294
1331
|
for (let t = 0, r = n.length; t < r; t++) try {
|
|
1295
1332
|
n[t]();
|
|
1296
1333
|
} catch (t) {
|
|
1297
|
-
let n = e.nodeType === 1 ?
|
|
1298
|
-
|
|
1334
|
+
let n = e.nodeType === 1 ? B(e) : "Node";
|
|
1335
|
+
G.error(H.BINDING, W.BINDING.CLEANUP_ERROR(n), t);
|
|
1299
1336
|
}
|
|
1300
1337
|
Xe.release(n), t.cleanups = void 0;
|
|
1301
1338
|
}
|
|
@@ -1305,7 +1342,7 @@ var qe = class {
|
|
|
1305
1342
|
let t = "getElementsByClassName" in e && typeof e.getElementsByClassName == "function" ? e.getElementsByClassName(K) : e.querySelectorAll(`.${K}`);
|
|
1306
1343
|
for (let e = t.length - 1; e >= 0; e--) {
|
|
1307
1344
|
let n = t[e];
|
|
1308
|
-
n && (this.records.has(n) ? this.cleanup(n) : (n.classList.remove(K),
|
|
1345
|
+
n && (this.records.has(n) ? this.cleanup(n) : (n.classList.remove(K), G.enabled && G.warn(H.BINDING, `${K} class found on unregistered element:`, n)));
|
|
1309
1346
|
}
|
|
1310
1347
|
}
|
|
1311
1348
|
cleanupTree(e) {
|
|
@@ -1457,7 +1494,7 @@ var lt = class {
|
|
|
1457
1494
|
this.el.value = t;
|
|
1458
1495
|
}
|
|
1459
1496
|
else this.el.value = t;
|
|
1460
|
-
|
|
1497
|
+
G.enabled && G.domUpdated(H.BINDING, this.$el, "val", t);
|
|
1461
1498
|
} finally {
|
|
1462
1499
|
this.flags &= ~Y.SyncingToDom;
|
|
1463
1500
|
}
|
|
@@ -1465,7 +1502,7 @@ var lt = class {
|
|
|
1465
1502
|
}, this.cleanup = () => {
|
|
1466
1503
|
this.$el.off(this.ns), clearTimeout(this.timeoutId), this.timeoutId = void 0;
|
|
1467
1504
|
}, this.$el = e, this.el = e[0], this.atom = t, this.isMultipleSelect = this.el.tagName === "SELECT" && this.el.multiple, this.ns = `.atomBind-${++ct}`;
|
|
1468
|
-
let r = n.debounce ?? 0, i = n.event ??
|
|
1505
|
+
let r = n.debounce ?? 0, i = n.event ?? ke.EVENT;
|
|
1469
1506
|
this.parse = n.parse ?? ((e) => e), this.format = n.format ?? ((e) => this.isMultipleSelect ? (Array.isArray(e) ? e : e ? [String(e)] : []).join(",") : String(e ?? ""));
|
|
1470
1507
|
let a = n.equal ?? Object.is;
|
|
1471
1508
|
this.equal = (e, t) => a(e, t) ? !0 : Array.isArray(e) && Array.isArray(t) ? e.length === t.length && e.every((e, n) => Object.is(e, t[n])) : !1, r > 0 ? this.handleInput = () => {
|
|
@@ -1493,7 +1530,7 @@ var lt = class {
|
|
|
1493
1530
|
let t = this.parse(e);
|
|
1494
1531
|
this.equal(this.atom.peek(), t) || (this.atom.value = t);
|
|
1495
1532
|
} catch (e) {
|
|
1496
|
-
|
|
1533
|
+
G.warn(H.BINDING, W.BINDING.PARSE_ERROR(e instanceof Error ? e.message : String(e)), e);
|
|
1497
1534
|
} finally {
|
|
1498
1535
|
this.flags &= ~Y.SyncingToAtom;
|
|
1499
1536
|
}
|
|
@@ -1514,7 +1551,7 @@ function ut(e, t, n) {
|
|
|
1514
1551
|
//#endregion
|
|
1515
1552
|
//#region src/core/effect-factory.ts
|
|
1516
1553
|
function dt(e, t, n, r) {
|
|
1517
|
-
if (
|
|
1554
|
+
if (z(t)) {
|
|
1518
1555
|
let i = t;
|
|
1519
1556
|
q.trackEffect(e, R(() => {
|
|
1520
1557
|
let t = i.value;
|
|
@@ -1522,27 +1559,27 @@ function dt(e, t, n, r) {
|
|
|
1522
1559
|
try {
|
|
1523
1560
|
n(t);
|
|
1524
1561
|
} catch (e) {
|
|
1525
|
-
|
|
1562
|
+
G.error(H.BINDING, W.BINDING.UPDATER_ERROR(r), e);
|
|
1526
1563
|
return;
|
|
1527
1564
|
}
|
|
1528
|
-
|
|
1565
|
+
G.enabled && G.domUpdated(H.BINDING, e, r, t);
|
|
1529
1566
|
});
|
|
1530
1567
|
}, { name: r }));
|
|
1531
1568
|
} else O(() => {
|
|
1532
1569
|
try {
|
|
1533
1570
|
n(t);
|
|
1534
1571
|
} catch (e) {
|
|
1535
|
-
|
|
1572
|
+
G.error(H.BINDING, W.BINDING.UPDATER_ERROR(r, !0), e);
|
|
1536
1573
|
return;
|
|
1537
1574
|
}
|
|
1538
|
-
|
|
1575
|
+
G.enabled && G.domUpdated(H.BINDING, e, r, t);
|
|
1539
1576
|
});
|
|
1540
1577
|
}
|
|
1541
1578
|
function ft(e, t, n, r) {
|
|
1542
1579
|
let i = Object.keys(t), a = [], o = {};
|
|
1543
1580
|
for (let e = 0; e < i.length; e++) {
|
|
1544
1581
|
let n = i[e], r = t[n];
|
|
1545
|
-
|
|
1582
|
+
z(r) ? a.push(n) : o[n] = r;
|
|
1546
1583
|
}
|
|
1547
1584
|
a.length > 0 ? q.trackEffect(e, R(() => {
|
|
1548
1585
|
let i = { ...o };
|
|
@@ -1554,19 +1591,19 @@ function ft(e, t, n, r) {
|
|
|
1554
1591
|
try {
|
|
1555
1592
|
n(i);
|
|
1556
1593
|
} catch (e) {
|
|
1557
|
-
|
|
1594
|
+
G.error(H.BINDING, W.BINDING.UPDATER_ERROR(r), e);
|
|
1558
1595
|
return;
|
|
1559
1596
|
}
|
|
1560
|
-
|
|
1597
|
+
G.enabled && G.domUpdated(H.BINDING, e, r, i);
|
|
1561
1598
|
});
|
|
1562
1599
|
}, { name: r })) : O(() => {
|
|
1563
1600
|
try {
|
|
1564
1601
|
n(o);
|
|
1565
1602
|
} catch (e) {
|
|
1566
|
-
|
|
1603
|
+
G.error(H.BINDING, W.BINDING.UPDATER_ERROR(r, !0), e);
|
|
1567
1604
|
return;
|
|
1568
1605
|
}
|
|
1569
|
-
|
|
1606
|
+
G.enabled && G.domUpdated(H.BINDING, e, r, o);
|
|
1570
1607
|
});
|
|
1571
1608
|
}
|
|
1572
1609
|
//#endregion
|
|
@@ -1649,7 +1686,7 @@ function Lt(e, t) {
|
|
|
1649
1686
|
function Rt(e, t) {
|
|
1650
1687
|
let n = e.el, r = n.style;
|
|
1651
1688
|
q.trackEffect(n, R(() => {
|
|
1652
|
-
for (let e in t) if (
|
|
1689
|
+
for (let e in t) if (V.call(t, e)) {
|
|
1653
1690
|
let n = t[e], i = jt(e), [a, o] = Array.isArray(n) ? n : [n, ""], s = k(a) ? a.value : a;
|
|
1654
1691
|
O(() => {
|
|
1655
1692
|
let e = o ? String(s) + o : String(s);
|
|
@@ -1660,9 +1697,9 @@ function Rt(e, t) {
|
|
|
1660
1697
|
}
|
|
1661
1698
|
function zt(e, t) {
|
|
1662
1699
|
let n = e.el, r = {};
|
|
1663
|
-
for (let e in t) if (
|
|
1700
|
+
for (let e in t) if (V.call(t, e)) {
|
|
1664
1701
|
if (e.toLowerCase().startsWith("on")) {
|
|
1665
|
-
console.warn(`${
|
|
1702
|
+
console.warn(`${H.BINDING} ${W.SECURITY.BLOCKED_EVENT_HANDLER(e)}`);
|
|
1666
1703
|
continue;
|
|
1667
1704
|
}
|
|
1668
1705
|
r[e] = t[e];
|
|
@@ -1676,7 +1713,7 @@ function zt(e, t) {
|
|
|
1676
1713
|
}
|
|
1677
1714
|
let a = r === !0 ? i ? "true" : t : String(r);
|
|
1678
1715
|
if (Ot(t, a)) {
|
|
1679
|
-
console.warn(`${
|
|
1716
|
+
console.warn(`${H.BINDING} ${W.SECURITY.BLOCKED_PROTOCOL(t)}`);
|
|
1680
1717
|
continue;
|
|
1681
1718
|
}
|
|
1682
1719
|
n.getAttribute(t) !== a && n.setAttribute(t, a);
|
|
@@ -1685,13 +1722,13 @@ function zt(e, t) {
|
|
|
1685
1722
|
}
|
|
1686
1723
|
function Bt(e, t) {
|
|
1687
1724
|
let n = e.el, r = {};
|
|
1688
|
-
for (let e in t) if (
|
|
1725
|
+
for (let e in t) if (V.call(t, e)) {
|
|
1689
1726
|
if (e.toLowerCase().startsWith("on")) {
|
|
1690
|
-
console.warn(`${
|
|
1727
|
+
console.warn(`${H.BINDING} ${W.SECURITY.BLOCKED_EVENT_HANDLER(e)}`);
|
|
1691
1728
|
continue;
|
|
1692
1729
|
}
|
|
1693
|
-
if (
|
|
1694
|
-
console.warn(`${
|
|
1730
|
+
if (Ne.has(e)) {
|
|
1731
|
+
console.warn(`${H.BINDING} ${W.SECURITY.BLOCKED_PROP(e)}`);
|
|
1695
1732
|
continue;
|
|
1696
1733
|
}
|
|
1697
1734
|
r[e] = t[e];
|
|
@@ -1699,8 +1736,8 @@ function Bt(e, t) {
|
|
|
1699
1736
|
ft(e.el, r, (e) => {
|
|
1700
1737
|
for (let t in e) {
|
|
1701
1738
|
let r = e[t], i = t.toLowerCase();
|
|
1702
|
-
if (
|
|
1703
|
-
console.warn(`${
|
|
1739
|
+
if (Me.has(i) && typeof r == "string" && Ot(t, r)) {
|
|
1740
|
+
console.warn(`${H.BINDING} ${W.SECURITY.BLOCKED_PROTOCOL(t)}`);
|
|
1704
1741
|
continue;
|
|
1705
1742
|
}
|
|
1706
1743
|
n[t] !== r && (n[t] = r);
|
|
@@ -1716,8 +1753,8 @@ function Vt(e, t, n) {
|
|
|
1716
1753
|
}
|
|
1717
1754
|
function Ht(t, n, r = {}) {
|
|
1718
1755
|
let i = t.el.tagName.toLowerCase();
|
|
1719
|
-
if (!
|
|
1720
|
-
console.warn(`${
|
|
1756
|
+
if (!je.has(i)) {
|
|
1757
|
+
console.warn(`${H.BINDING} ${W.BINDING.INVALID_INPUT_ELEMENT(i)}`);
|
|
1721
1758
|
return;
|
|
1722
1759
|
}
|
|
1723
1760
|
let { fx: a, cleanup: o } = ut(e(t.el), n, r);
|
|
@@ -1735,7 +1772,7 @@ function Ut(t, n) {
|
|
|
1735
1772
|
let s = R(() => {
|
|
1736
1773
|
let e = !!n.value;
|
|
1737
1774
|
O(() => {
|
|
1738
|
-
r.checked !== e && (r.checked = e,
|
|
1775
|
+
r.checked !== e && (r.checked = e, G.enabled && G.domUpdated(H.BINDING, r, "checked", e));
|
|
1739
1776
|
});
|
|
1740
1777
|
});
|
|
1741
1778
|
q.trackEffect(r, s);
|
|
@@ -1756,7 +1793,7 @@ function Kt(e) {
|
|
|
1756
1793
|
function Z(e, t) {
|
|
1757
1794
|
for (let n = 0, r = e.length; n < r; n++) {
|
|
1758
1795
|
let r = e[n];
|
|
1759
|
-
r.nodeType === 1 ? t(Pt(r), r) :
|
|
1796
|
+
r.nodeType === 1 ? t(Pt(r), r) : G.enabled && G.log(H.BINDING, `Skipping non-Element node (nodeType=${r.nodeType})`);
|
|
1760
1797
|
}
|
|
1761
1798
|
return e;
|
|
1762
1799
|
}
|
|
@@ -1765,19 +1802,19 @@ e.fn.atomText = function(e, t) {
|
|
|
1765
1802
|
}, e.fn.atomHtml = function(e) {
|
|
1766
1803
|
return Z(this, (t) => It(t, e));
|
|
1767
1804
|
}, e.fn.atomClass = function(e, t) {
|
|
1768
|
-
if (typeof e == "string" && t === void 0) return console.warn(`${
|
|
1805
|
+
if (typeof e == "string" && t === void 0) return console.warn(`${H.BINDING} ${W.BINDING.MISSING_CONDITION("atomClass")}`), this;
|
|
1769
1806
|
let n = typeof e == "string" ? { [e]: t } : e;
|
|
1770
1807
|
return Z(this, (e) => Lt(e, n));
|
|
1771
1808
|
}, e.fn.atomCss = function(e, t, n) {
|
|
1772
|
-
if (typeof e == "string" && t === void 0) return console.warn(`${
|
|
1809
|
+
if (typeof e == "string" && t === void 0) return console.warn(`${H.BINDING} ${W.BINDING.MISSING_SOURCE("atomCss")}`), this;
|
|
1773
1810
|
let r = typeof e == "string" ? { [e]: n ? [t, n] : t } : e;
|
|
1774
1811
|
return Z(this, (e) => Rt(e, r));
|
|
1775
1812
|
}, e.fn.atomAttr = function(e, t) {
|
|
1776
|
-
if (typeof e == "string" && t === void 0) return console.warn(`${
|
|
1813
|
+
if (typeof e == "string" && t === void 0) return console.warn(`${H.BINDING} ${W.BINDING.MISSING_SOURCE("atomAttr")}`), this;
|
|
1777
1814
|
let n = typeof e == "string" ? { [e]: t } : e;
|
|
1778
1815
|
return Z(this, (e) => zt(e, n));
|
|
1779
1816
|
}, e.fn.atomProp = function(e, t) {
|
|
1780
|
-
if (typeof e == "string" && t === void 0) return console.warn(`${
|
|
1817
|
+
if (typeof e == "string" && t === void 0) return console.warn(`${H.BINDING} ${W.BINDING.MISSING_SOURCE("atomProp")}`), this;
|
|
1781
1818
|
let n = typeof e == "string" ? { [e]: t } : e;
|
|
1782
1819
|
return Z(this, (e) => Bt(e, n));
|
|
1783
1820
|
}, e.fn.atomShow = function(e) {
|
|
@@ -1823,7 +1860,7 @@ var Qt = class {
|
|
|
1823
1860
|
}
|
|
1824
1861
|
scheduleRemoval(e, t) {
|
|
1825
1862
|
let n = () => {
|
|
1826
|
-
this.fx?.isDisposed || (t.remove(), this.removingKeys.delete(e),
|
|
1863
|
+
this.fx?.isDisposed || (t.remove(), this.removingKeys.delete(e), G.log(H.LIST, `${this.containerSelector} removed item:`, e));
|
|
1827
1864
|
};
|
|
1828
1865
|
if (!this.onRemove) {
|
|
1829
1866
|
n();
|
|
@@ -1867,14 +1904,14 @@ function en(e, t, n, r, i, a) {
|
|
|
1867
1904
|
let e = t[f], n = r(e, f);
|
|
1868
1905
|
if (o[f] !== n) break;
|
|
1869
1906
|
let i = s[f];
|
|
1870
|
-
if (!(a ? a(i, e) :
|
|
1907
|
+
if (!(a ? a(i, e) : Oe(i, e))) break;
|
|
1871
1908
|
u.set(n, f), f++;
|
|
1872
1909
|
}
|
|
1873
1910
|
for (; p >= f && m >= f;) {
|
|
1874
1911
|
let e = t[m], n = r(e, m);
|
|
1875
1912
|
if (o[p] !== n) break;
|
|
1876
1913
|
let i = s[p];
|
|
1877
|
-
if (!(a ? a(i, e) :
|
|
1914
|
+
if (!(a ? a(i, e) : Oe(i, e))) break;
|
|
1878
1915
|
u.set(n, m), p--, m--;
|
|
1879
1916
|
}
|
|
1880
1917
|
let h = Yt.acquire();
|
|
@@ -1893,7 +1930,7 @@ function en(e, t, n, r, i, a) {
|
|
|
1893
1930
|
for (let n = f; n <= m; n++) {
|
|
1894
1931
|
let o = t[n], d = r(o, n);
|
|
1895
1932
|
if (g[n] = d, v[n] = o, u.set(d, n), _.has(d)) {
|
|
1896
|
-
|
|
1933
|
+
G.warn(H.LIST, W.LIST.DUPLICATE_KEY(d, n, e.containerSelector)), x[n] = -1;
|
|
1897
1934
|
continue;
|
|
1898
1935
|
}
|
|
1899
1936
|
_.add(d);
|
|
@@ -1904,7 +1941,7 @@ function en(e, t, n, r, i, a) {
|
|
|
1904
1941
|
}
|
|
1905
1942
|
let p = s[f];
|
|
1906
1943
|
y[n] = c[f];
|
|
1907
|
-
let m = a ? a(p, o) :
|
|
1944
|
+
let m = a ? a(p, o) : Oe(p, o);
|
|
1908
1945
|
!i && p !== o && !m ? (S.push(d), C.push(o), w.push(n), b[n] = 2) : b[n] = 0, x[n] = l.has(d) ? -1 : f;
|
|
1909
1946
|
}
|
|
1910
1947
|
return Yt.release(h), {
|
|
@@ -1973,7 +2010,7 @@ function rn(t, n, r, i, a, o) {
|
|
|
1973
2010
|
let n = r.firstElementChild;
|
|
1974
2011
|
for (let r = 0; r < h && n; r++) {
|
|
1975
2012
|
let i = u[r];
|
|
1976
|
-
n.setAttribute("data-atom-key", String(i)), f[r] = n, p[r] = 0, t.removingKeys.delete(i),
|
|
2013
|
+
n.setAttribute("data-atom-key", String(i)), f[r] = n, p[r] = 0, t.removingKeys.delete(i), G.enabled && G.domUpdated(H.LIST, e(n), "list.add", d[r]), n = n.nextElementSibling;
|
|
1977
2014
|
}
|
|
1978
2015
|
return;
|
|
1979
2016
|
}
|
|
@@ -1999,7 +2036,7 @@ function rn(t, n, r, i, a, o) {
|
|
|
1999
2036
|
if (r === 0 ? c?.(i, a, e) : s?.(i, a, e), r === 1) {
|
|
2000
2037
|
l?.(i);
|
|
2001
2038
|
let n = u[e];
|
|
2002
|
-
t.removingKeys.delete(n),
|
|
2039
|
+
t.removingKeys.delete(n), G.enabled && G.domUpdated(H.LIST, i, "list.add", d[e]);
|
|
2003
2040
|
}
|
|
2004
2041
|
}
|
|
2005
2042
|
}
|
|
@@ -2017,11 +2054,11 @@ e.fn.atomList = function(t, n) {
|
|
|
2017
2054
|
o.off(".atomList");
|
|
2018
2055
|
let p = qt.get(i);
|
|
2019
2056
|
p && (p.fx.dispose(), p.ctx.dispose());
|
|
2020
|
-
let m =
|
|
2057
|
+
let m = B(i), h = new Qt(o, m, s), g = R(() => {
|
|
2021
2058
|
let e = t.value, r = e.length;
|
|
2022
2059
|
O(() => {
|
|
2023
2060
|
if ($t(h, r, o, c), r === 0) return;
|
|
2024
|
-
|
|
2061
|
+
G.log(H.LIST, `${m} updating with ${r} items`);
|
|
2025
2062
|
let t = en(h, e, r, d, a, u), s = tn(t, n, h.oldKeys.length === 0);
|
|
2026
2063
|
if (nn(h, t), rn(h, t, i, o, f, s), l) {
|
|
2027
2064
|
let { startIndex: e, oldEndIndex: n, newKeySet: r } = t;
|
|
@@ -2034,7 +2071,7 @@ e.fn.atomList = function(t, n) {
|
|
|
2034
2071
|
});
|
|
2035
2072
|
});
|
|
2036
2073
|
if (h.fx = g, l) for (let e in l) {
|
|
2037
|
-
if (!
|
|
2074
|
+
if (!V.call(l, e)) continue;
|
|
2038
2075
|
let t = l[e], n = e.indexOf(" "), r = n === -1 ? e : e.slice(0, n), i = (n === -1 ? null : e.slice(n + 1).trim()) || "> *";
|
|
2039
2076
|
o.on(`${r}.atomList`, i, function(e) {
|
|
2040
2077
|
let n = e.target.closest?.("[data-atom-key]");
|
|
@@ -2072,7 +2109,7 @@ e.fn.atomMount = function(t, n) {
|
|
|
2072
2109
|
try {
|
|
2073
2110
|
o = O(() => t(a, r));
|
|
2074
2111
|
} catch (e) {
|
|
2075
|
-
|
|
2112
|
+
G.error(H.MOUNT, W.MOUNT.ERROR(t.name), e);
|
|
2076
2113
|
continue;
|
|
2077
2114
|
}
|
|
2078
2115
|
typeof o == "function" && q.setComponentCleanup(i, o);
|
|
@@ -2091,18 +2128,18 @@ function on(e, t) {
|
|
|
2091
2128
|
try {
|
|
2092
2129
|
return history.pushState(e, "", t), !0;
|
|
2093
2130
|
} catch (e) {
|
|
2094
|
-
return
|
|
2131
|
+
return G.warn(H.ROUTE, "PushState failed (likely file:// protocol or security restriction). UI will update, but URL will not.", e), !1;
|
|
2095
2132
|
}
|
|
2096
2133
|
}
|
|
2097
2134
|
var sn = class {
|
|
2098
2135
|
constructor(t) {
|
|
2099
2136
|
this.isDestroyed = !1, this.previousRoute = "", this.cleanups = [], this.templateCache = /* @__PURE__ */ new Map(), this.routeCleanups = [], this.lastRawQuery = "", this.cachedParams = {}, this.config = {
|
|
2100
2137
|
...t,
|
|
2101
|
-
mode: t.mode ??
|
|
2102
|
-
basePath: t.basePath ??
|
|
2103
|
-
autoBindLinks: t.autoBindLinks ??
|
|
2104
|
-
activeClass: t.activeClass ??
|
|
2105
|
-
}, this.isHistoryMode = this.config.mode === "history", this.$target = e(this.config.target), this.normalizedBasePath = this.config.basePath?.replace(/\/$/, "") || "", this.activeClass = this.config.activeClass ??
|
|
2138
|
+
mode: t.mode ?? U.mode,
|
|
2139
|
+
basePath: t.basePath ?? U.basePath,
|
|
2140
|
+
autoBindLinks: t.autoBindLinks ?? U.autoBindLinks,
|
|
2141
|
+
activeClass: t.activeClass ?? U.activeClass
|
|
2142
|
+
}, this.isHistoryMode = this.config.mode === "history", this.$target = e(this.config.target), this.normalizedBasePath = this.config.basePath?.replace(/\/$/, "") || "", this.activeClass = this.config.activeClass ?? U.activeClass, this.previousUrl = this.isHistoryMode ? window.location.pathname + window.location.search : window.location.hash, this.currentRouteAtom = ve(this.getRouteName()), this.currentRoute = this.currentRouteAtom, this.queryParamsAtom = ve(this.getQueryParams()), this.queryParams = L(() => this.queryParamsAtom.value), this.handleUrlChange = this.handleUrlChange.bind(this), this.destroy = this.destroy.bind(this), this.init();
|
|
2106
2143
|
}
|
|
2107
2144
|
init() {
|
|
2108
2145
|
let e = this.isHistoryMode ? "popstate" : "hashchange";
|
|
@@ -2114,7 +2151,7 @@ var sn = class {
|
|
|
2114
2151
|
for (let t = 0, n = e.length; t < n; t++) try {
|
|
2115
2152
|
e[t]();
|
|
2116
2153
|
} catch (e) {
|
|
2117
|
-
|
|
2154
|
+
G.warn(H.ROUTE, "Cleanup error during route transition:", e);
|
|
2118
2155
|
}
|
|
2119
2156
|
e.length = 0;
|
|
2120
2157
|
}), this.renderRoute(e);
|
|
@@ -2172,13 +2209,13 @@ var sn = class {
|
|
|
2172
2209
|
}
|
|
2173
2210
|
getRouteConfig(e) {
|
|
2174
2211
|
let { routes: t, notFound: n } = this.config, r = t[e];
|
|
2175
|
-
return !r && n && (r = t[n]), r || (
|
|
2212
|
+
return !r && n && (r = t[n]), r || (G.warn(H.ROUTE, W.ROUTE.NOT_FOUND(e)), null);
|
|
2176
2213
|
}
|
|
2177
2214
|
renderTemplate(e) {
|
|
2178
2215
|
let t = this.templateCache.get(e);
|
|
2179
2216
|
if (!t) {
|
|
2180
2217
|
let n = document.querySelector(e);
|
|
2181
|
-
if (!n || !(n instanceof HTMLTemplateElement)) return
|
|
2218
|
+
if (!n || !(n instanceof HTMLTemplateElement)) return G.warn(H.ROUTE, W.ROUTE.TEMPLATE_NOT_FOUND(e)), !1;
|
|
2182
2219
|
t = n, this.templateCache.set(e, t);
|
|
2183
2220
|
}
|
|
2184
2221
|
let n = t.content.cloneNode(!0);
|
|
@@ -2188,7 +2225,7 @@ var sn = class {
|
|
|
2188
2225
|
if (this.isDestroyed) return;
|
|
2189
2226
|
let t = this.$target[0];
|
|
2190
2227
|
if (!t) {
|
|
2191
|
-
|
|
2228
|
+
G.warn(H.ROUTE, W.ROUTE.TARGET_NOT_FOUND(this.config.target));
|
|
2192
2229
|
return;
|
|
2193
2230
|
}
|
|
2194
2231
|
let n = this.getRouteConfig(e);
|
|
@@ -2260,7 +2297,7 @@ var sn = class {
|
|
|
2260
2297
|
if (n?.onLeave && n.onLeave(this) === !1) return;
|
|
2261
2298
|
let r = e || this.config.default;
|
|
2262
2299
|
if (!r) {
|
|
2263
|
-
|
|
2300
|
+
G.warn(H.ROUTE, "navigate() called with empty routeName and no default configured.");
|
|
2264
2301
|
return;
|
|
2265
2302
|
}
|
|
2266
2303
|
this.setUrl(r), this.queryParamsAtom.value = {}, this.currentRouteAtom.value = r;
|
|
@@ -2273,7 +2310,7 @@ var sn = class {
|
|
|
2273
2310
|
for (let t = 0, n = e.length; t < n; t++) try {
|
|
2274
2311
|
e[t]();
|
|
2275
2312
|
} catch (e) {
|
|
2276
|
-
|
|
2313
|
+
G.warn(H.ROUTE, "Cleanup error during destroy:", e);
|
|
2277
2314
|
}
|
|
2278
2315
|
this.templateCache.clear();
|
|
2279
2316
|
}
|
|
@@ -2347,6 +2384,6 @@ e.extend({ atomFetch(e, t) {
|
|
|
2347
2384
|
});
|
|
2348
2385
|
var un = e;
|
|
2349
2386
|
//#endregion
|
|
2350
|
-
export { ve as atom, De as batch, L as computed, un as default, et as disableAutoCleanup, st as disablejQueryOverrides, R as effect, $e as enableAutoCleanup, ot as enablejQueryOverrides, k as isAtom, be as isComputed,
|
|
2387
|
+
export { ve as atom, De as batch, L as computed, un as default, et as disableAutoCleanup, st as disablejQueryOverrides, R as effect, $e as enableAutoCleanup, ot as enablejQueryOverrides, k as isAtom, be as isComputed, z as isReactive, Ge as nextTick, q as registry, O as untracked };
|
|
2351
2388
|
|
|
2352
2389
|
//# sourceMappingURL=index.mjs.map
|