atom.io 0.9.7 → 0.9.9
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/index.d.mts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs.map +1 -1
- package/internal/dist/index.d.mts +4 -3
- package/internal/dist/index.d.ts +4 -3
- package/internal/dist/index.js +35 -15
- package/internal/dist/index.js.map +1 -1
- package/internal/dist/index.mjs +35 -15
- package/internal/dist/index.mjs.map +1 -1
- package/internal/src/selector/trace-selector-atoms.ts +5 -0
- package/internal/src/timeline/add-atom-to-timeline.ts +24 -7
- package/internal/src/timeline/timeline-internal.ts +7 -3
- package/introspection/dist/index.d.mts +1 -1
- package/introspection/dist/index.d.ts +1 -1
- package/json/dist/index.d.mts +2 -6
- package/json/dist/index.d.ts +2 -6
- package/package.json +4 -4
- package/react-devtools/dist/index.css +281 -3
- package/react-devtools/dist/index.css.map +1 -1
- package/react-devtools/dist/index.d.mts +2 -1
- package/react-devtools/dist/index.d.ts +2 -1
- package/realtime-server/dist/index.d.mts +1 -1
- package/realtime-server/dist/index.d.ts +1 -1
- package/realtime-testing/dist/index.d.mts +1 -1
- package/realtime-testing/dist/index.d.ts +1 -1
- package/src/timeline.ts +2 -0
- package/transceivers/set-rtx/dist/index.d.mts +1 -1
- package/transceivers/set-rtx/dist/index.d.ts +1 -1
package/internal/dist/index.mjs
CHANGED
|
@@ -551,7 +551,7 @@ var addAtomToTimeline = (atomToken, tl, store = IMPLICIT.STORE) => {
|
|
|
551
551
|
);
|
|
552
552
|
}
|
|
553
553
|
atom.subject.subscribe(`timeline`, (update) => {
|
|
554
|
-
var _a, _b, _c, _d, _e;
|
|
554
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
555
555
|
const currentSelectorKey = store.operation.open && store.operation.token.type === `selector` ? store.operation.token.key : null;
|
|
556
556
|
const currentSelectorTime = store.operation.open && store.operation.token.type === `selector` ? store.operation.time : null;
|
|
557
557
|
const currentTransactionKey = store.transactionStatus.phase === `applying` ? store.transactionStatus.key : null;
|
|
@@ -592,7 +592,7 @@ var addAtomToTimeline = (atomToken, tl, store = IMPLICIT.STORE) => {
|
|
|
592
592
|
const unsubscribe = currentTransaction.subject.subscribe(
|
|
593
593
|
`timeline:${tl.key}`,
|
|
594
594
|
(update2) => {
|
|
595
|
-
var _a2;
|
|
595
|
+
var _a2, _b2, _c2;
|
|
596
596
|
unsubscribe();
|
|
597
597
|
if (tl.timeTraveling === null && currentTransactionTime) {
|
|
598
598
|
if (tl.at !== tl.history.length) {
|
|
@@ -616,12 +616,15 @@ var addAtomToTimeline = (atomToken, tl, store = IMPLICIT.STORE) => {
|
|
|
616
616
|
}, update2), {
|
|
617
617
|
atomUpdates
|
|
618
618
|
});
|
|
619
|
-
tl.
|
|
620
|
-
|
|
621
|
-
|
|
619
|
+
const willCapture = (_b2 = (_a2 = tl.shouldCapture) == null ? void 0 : _a2.call(tl, timelineTransactionUpdate, tl)) != null ? _b2 : true;
|
|
620
|
+
if (willCapture) {
|
|
621
|
+
tl.history.push(timelineTransactionUpdate);
|
|
622
|
+
tl.at = tl.history.length;
|
|
623
|
+
tl.subject.next(timelineTransactionUpdate);
|
|
624
|
+
}
|
|
622
625
|
}
|
|
623
626
|
tl.transactionKey = null;
|
|
624
|
-
(
|
|
627
|
+
(_c2 = store.config.logger) == null ? void 0 : _c2.info(
|
|
625
628
|
`\u231B timeline "${tl.key}" got a transaction_update "${update2.key}"`
|
|
626
629
|
);
|
|
627
630
|
}
|
|
@@ -662,8 +665,15 @@ var addAtomToTimeline = (atomToken, tl, store = IMPLICIT.STORE) => {
|
|
|
662
665
|
);
|
|
663
666
|
}
|
|
664
667
|
}
|
|
665
|
-
if (latestUpdate)
|
|
666
|
-
tl.
|
|
668
|
+
if (latestUpdate) {
|
|
669
|
+
const willCaptureSelectorUpdate = (_f = (_e = tl.shouldCapture) == null ? void 0 : _e.call(tl, latestUpdate, tl)) != null ? _f : true;
|
|
670
|
+
if (willCaptureSelectorUpdate) {
|
|
671
|
+
tl.subject.next(latestUpdate);
|
|
672
|
+
} else {
|
|
673
|
+
tl.history.pop();
|
|
674
|
+
tl.at = tl.history.length;
|
|
675
|
+
}
|
|
676
|
+
}
|
|
667
677
|
} else {
|
|
668
678
|
const timestamp = Date.now();
|
|
669
679
|
tl.selectorTime = null;
|
|
@@ -680,12 +690,15 @@ var addAtomToTimeline = (atomToken, tl, store = IMPLICIT.STORE) => {
|
|
|
680
690
|
if (atom.family) {
|
|
681
691
|
atomUpdate.family = atom.family;
|
|
682
692
|
}
|
|
683
|
-
tl.
|
|
684
|
-
|
|
685
|
-
(_e = store.config.logger) == null ? void 0 : _e.info(
|
|
693
|
+
const willCapture = (_h = (_g = tl.shouldCapture) == null ? void 0 : _g.call(tl, atomUpdate, tl)) != null ? _h : true;
|
|
694
|
+
(_i = store.config.logger) == null ? void 0 : _i.info(
|
|
686
695
|
`\u231B timeline "${tl.key}" got an atom_update to "${atom.key}"`
|
|
687
696
|
);
|
|
688
|
-
|
|
697
|
+
if (willCapture) {
|
|
698
|
+
tl.history.push(atomUpdate);
|
|
699
|
+
tl.at = tl.history.length;
|
|
700
|
+
tl.subject.next(atomUpdate);
|
|
701
|
+
}
|
|
689
702
|
}
|
|
690
703
|
}
|
|
691
704
|
});
|
|
@@ -786,6 +799,9 @@ function timeline__INTERNAL(options, store = IMPLICIT.STORE, data = null) {
|
|
|
786
799
|
install: (store2) => timeline__INTERNAL(options, store2, tl),
|
|
787
800
|
subject: new Subject()
|
|
788
801
|
});
|
|
802
|
+
if (options.shouldCapture) {
|
|
803
|
+
tl.shouldCapture = options.shouldCapture;
|
|
804
|
+
}
|
|
789
805
|
const core = target(store);
|
|
790
806
|
for (const tokenOrFamily of options.atoms) {
|
|
791
807
|
const timelineKey = core.timelineAtoms.getRelatedKey(tokenOrFamily.key);
|
|
@@ -798,9 +814,7 @@ function timeline__INTERNAL(options, store = IMPLICIT.STORE, data = null) {
|
|
|
798
814
|
if (tokenOrFamily.type === `atom_family`) {
|
|
799
815
|
const family = tokenOrFamily;
|
|
800
816
|
family.subject.subscribe(`timeline:${options.key}`, (token2) => {
|
|
801
|
-
|
|
802
|
-
addAtomToTimeline(token2, tl, store);
|
|
803
|
-
}
|
|
817
|
+
addAtomToTimeline(token2, tl, store);
|
|
804
818
|
});
|
|
805
819
|
for (const atom of core.atoms.values()) {
|
|
806
820
|
if (((_c = atom.family) == null ? void 0 : _c.key) === family.key) {
|
|
@@ -1366,6 +1380,7 @@ var setState__INTERNAL = (state, value, store = IMPLICIT.STORE) => {
|
|
|
1366
1380
|
|
|
1367
1381
|
// src/selector/trace-selector-atoms.ts
|
|
1368
1382
|
var traceSelectorAtoms = (selectorKey, dependency, store) => {
|
|
1383
|
+
var _a;
|
|
1369
1384
|
const roots = [];
|
|
1370
1385
|
const sources = lookupSelectorSources(dependency.key, store);
|
|
1371
1386
|
let depth = 0;
|
|
@@ -1373,6 +1388,11 @@ var traceSelectorAtoms = (selectorKey, dependency, store) => {
|
|
|
1373
1388
|
const source = sources.shift();
|
|
1374
1389
|
++depth;
|
|
1375
1390
|
if (depth > 999) {
|
|
1391
|
+
(_a = store.config.logger) == null ? void 0 : _a.warn(
|
|
1392
|
+
`Maximum selector dependency depth exceeded 999 in selector "${selectorKey}".`
|
|
1393
|
+
);
|
|
1394
|
+
}
|
|
1395
|
+
if (depth > 99999) {
|
|
1376
1396
|
throw new Error(
|
|
1377
1397
|
`Maximum selector dependency depth exceeded in selector "${selectorKey}".`
|
|
1378
1398
|
);
|