atom.io 0.12.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -3
- package/dist/index.d.ts +6 -3
- package/dist/index.js.map +1 -1
- package/dist/metafile-cjs.json +1 -1
- package/dist/metafile-esm.json +1 -1
- package/internal/dist/index.cjs +1579 -1498
- package/internal/dist/index.cjs.map +1 -1
- package/internal/dist/index.d.cts +34 -14
- package/internal/dist/index.d.ts +34 -14
- package/internal/dist/index.js +1577 -1499
- package/internal/dist/index.js.map +1 -1
- package/internal/dist/metafile-cjs.json +1 -1
- package/internal/dist/metafile-esm.json +1 -1
- package/internal/src/atom/create-atom.ts +4 -4
- package/internal/src/atom/delete-atom.ts +11 -11
- package/internal/src/atom/is-default.ts +5 -5
- package/internal/src/caching.ts +12 -10
- package/internal/src/families/create-atom-family.ts +3 -3
- package/internal/src/families/create-readonly-selector-family.ts +3 -3
- package/internal/src/families/create-selector-family.ts +4 -4
- package/internal/src/index.ts +4 -2
- package/internal/src/keys.ts +4 -4
- package/internal/src/lazy-map.ts +37 -0
- package/internal/src/lineage.ts +18 -0
- package/internal/src/mutable/create-mutable-atom.ts +5 -4
- package/internal/src/mutable/get-json-family.ts +3 -3
- package/internal/src/mutable/tracker.ts +13 -10
- package/internal/src/operation.ts +19 -19
- package/internal/src/selector/create-read-write-selector.ts +5 -4
- package/internal/src/selector/create-readonly-selector.ts +4 -3
- package/internal/src/selector/create-selector.ts +6 -6
- package/internal/src/selector/delete-selector.ts +10 -10
- package/internal/src/selector/get-selector-dependency-keys.ts +2 -2
- package/internal/src/selector/register-selector.ts +4 -4
- package/internal/src/selector/update-selector-atoms.ts +2 -2
- package/internal/src/set-state/copy-mutable-if-needed.ts +4 -3
- package/internal/src/set-state/copy-mutable-in-transaction.ts +10 -16
- package/internal/src/set-state/copy-mutable-into-new-store.ts +1 -1
- package/internal/src/set-state/evict-downstream.ts +5 -5
- package/internal/src/set-state/set-atom.ts +6 -1
- package/internal/src/set-state/stow-update.ts +7 -2
- package/internal/src/store/store.ts +31 -24
- package/internal/src/store/withdraw-new-family-member.ts +3 -4
- package/internal/src/store/withdraw.ts +58 -59
- package/internal/src/subject.ts +14 -0
- package/internal/src/subscribe/recall-state.ts +5 -5
- package/internal/src/timeline/add-atom-to-timeline.ts +37 -27
- package/internal/src/timeline/create-timeline.ts +6 -8
- package/internal/src/timeline/time-travel.ts +22 -4
- package/internal/src/transaction/abort-transaction.ts +5 -3
- package/internal/src/transaction/apply-transaction.ts +80 -58
- package/internal/src/transaction/build-transaction.ts +34 -23
- package/internal/src/transaction/create-transaction.ts +6 -9
- package/internal/src/transaction/index.ts +2 -10
- package/internal/src/transaction/redo-transaction.ts +15 -10
- package/internal/src/transaction/undo-transaction.ts +15 -16
- package/introspection/dist/index.cjs +2 -2
- package/introspection/dist/index.cjs.map +1 -1
- package/introspection/dist/index.js +3 -3
- package/introspection/dist/index.js.map +1 -1
- package/introspection/src/attach-atom-index.ts +2 -2
- package/introspection/src/attach-selector-index.ts +2 -2
- package/package.json +3 -3
- package/react-devtools/dist/index.cjs +22 -8
- package/react-devtools/dist/index.cjs.map +1 -1
- package/react-devtools/dist/index.d.cts +17 -9
- package/react-devtools/dist/index.d.ts +17 -9
- package/react-devtools/dist/index.js +22 -8
- package/react-devtools/dist/index.js.map +1 -1
- package/react-devtools/dist/metafile-cjs.json +1 -1
- package/react-devtools/dist/metafile-esm.json +1 -1
- package/react-devtools/src/Updates.tsx +22 -10
- package/src/transaction.ts +7 -2
- package/transceivers/set-rtx/dist/index.cjs.map +1 -1
- package/transceivers/set-rtx/dist/index.d.cts +2 -2
- package/transceivers/set-rtx/dist/index.d.ts +2 -2
- package/transceivers/set-rtx/dist/index.js.map +1 -1
- package/transceivers/set-rtx/dist/metafile-cjs.json +1 -1
- package/transceivers/set-rtx/dist/metafile-esm.json +1 -1
- package/transceivers/set-rtx/src/set-rtx.ts +3 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AtomToken, ReadonlySelectorToken } from "atom.io"
|
|
2
2
|
import type { Store } from "atom.io/internal"
|
|
3
|
-
import { IMPLICIT, createAtom, createSelector,
|
|
3
|
+
import { IMPLICIT, createAtom, createSelector, newest } from "atom.io/internal"
|
|
4
4
|
|
|
5
5
|
import type { StateTokenIndex } from "."
|
|
6
6
|
|
|
@@ -55,7 +55,7 @@ export const attachAtomIndex = (
|
|
|
55
55
|
[key]: atomToken,
|
|
56
56
|
}
|
|
57
57
|
})
|
|
58
|
-
if (
|
|
58
|
+
if (newest(store).operation.open) {
|
|
59
59
|
const unsubscribe = store.subject.operationStatus.subscribe(
|
|
60
60
|
`introspection: waiting to update atom index`,
|
|
61
61
|
() => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ReadonlySelectorToken, SelectorToken } from "atom.io"
|
|
2
2
|
import type { Store } from "atom.io/internal"
|
|
3
|
-
import { IMPLICIT, createAtom, createSelector,
|
|
3
|
+
import { IMPLICIT, createAtom, createSelector, newest } from "atom.io/internal"
|
|
4
4
|
|
|
5
5
|
import type { StateTokenIndex } from "."
|
|
6
6
|
|
|
@@ -64,7 +64,7 @@ export const attachSelectorIndex = (
|
|
|
64
64
|
[key]: selectorToken,
|
|
65
65
|
}
|
|
66
66
|
})
|
|
67
|
-
if (
|
|
67
|
+
if (newest(store).operation.open) {
|
|
68
68
|
const unsubscribe = store.subject.operationStatus.subscribe(
|
|
69
69
|
`introspection: waiting to update selector index`,
|
|
70
70
|
() => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "atom.io",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.0",
|
|
4
4
|
"description": "Composable and testable reactive data library.",
|
|
5
5
|
"homepage": "https://atom.io.fyi",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"drizzle-kit": "0.20.6",
|
|
60
60
|
"drizzle-orm": "0.29.1",
|
|
61
61
|
"eslint": "8.55.0",
|
|
62
|
-
"framer-motion": "10.16.
|
|
62
|
+
"framer-motion": "10.16.14",
|
|
63
63
|
"happy-dom": "12.10.3",
|
|
64
64
|
"http-proxy": "1.18.1",
|
|
65
65
|
"npmlog": "7.0.1",
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"tmp": "0.2.1",
|
|
74
74
|
"tsup": "8.0.1",
|
|
75
75
|
"typescript": "5.3.2",
|
|
76
|
-
"vite": "5.0.
|
|
76
|
+
"vite": "5.0.6",
|
|
77
77
|
"vite-tsconfig-paths": "4.2.1",
|
|
78
78
|
"vitest": "1.0.1"
|
|
79
79
|
},
|
|
@@ -2549,14 +2549,21 @@ var TransactionUpdateFC = ({ serialNumber, transactionUpdate }) => {
|
|
|
2549
2549
|
] }),
|
|
2550
2550
|
/* @__PURE__ */ jsxRuntime.jsxs("section", { className: "transaction_impact", children: [
|
|
2551
2551
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "detail", children: "impact: " }),
|
|
2552
|
-
transactionUpdate.
|
|
2553
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2552
|
+
transactionUpdate.updates.filter((token) => !token.key.startsWith(`\u{1F441}\u200D\u{1F5E8}`)).map((update, index) => {
|
|
2553
|
+
return `newValue` in update ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2554
2554
|
article.AtomUpdate,
|
|
2555
2555
|
{
|
|
2556
2556
|
serialNumber: index,
|
|
2557
|
-
atomUpdate
|
|
2557
|
+
atomUpdate: update
|
|
2558
2558
|
},
|
|
2559
|
-
`${transactionUpdate.key}:${index}:${
|
|
2559
|
+
`${transactionUpdate.key}:${index}:${update.key}`
|
|
2560
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
2561
|
+
TransactionUpdateFC,
|
|
2562
|
+
{
|
|
2563
|
+
serialNumber: index,
|
|
2564
|
+
transactionUpdate: update
|
|
2565
|
+
},
|
|
2566
|
+
`${transactionUpdate.key}:${index}:${update.key}`
|
|
2560
2567
|
);
|
|
2561
2568
|
})
|
|
2562
2569
|
] })
|
|
@@ -2573,14 +2580,21 @@ var TimelineUpdateFC = ({ timelineUpdate }) => {
|
|
|
2573
2580
|
timelineUpdate.key,
|
|
2574
2581
|
")"
|
|
2575
2582
|
] }) }),
|
|
2576
|
-
/* @__PURE__ */ jsxRuntime.jsx("main", { children: timelineUpdate.type === `transaction_update` ? timelineUpdate.
|
|
2577
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2583
|
+
/* @__PURE__ */ jsxRuntime.jsx("main", { children: timelineUpdate.type === `transaction_update` ? timelineUpdate.updates.filter((token) => !token.key.startsWith(`\u{1F441}\u200D\u{1F5E8}`)).map((update, index) => {
|
|
2584
|
+
return `newValue` in update ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2578
2585
|
article.AtomUpdate,
|
|
2579
2586
|
{
|
|
2580
2587
|
serialNumber: index,
|
|
2581
|
-
atomUpdate
|
|
2588
|
+
atomUpdate: update
|
|
2582
2589
|
},
|
|
2583
|
-
`${timelineUpdate.key}:${index}:${
|
|
2590
|
+
`${timelineUpdate.key}:${index}:${update.key}`
|
|
2591
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
2592
|
+
TransactionUpdateFC,
|
|
2593
|
+
{
|
|
2594
|
+
serialNumber: index,
|
|
2595
|
+
transactionUpdate: update
|
|
2596
|
+
},
|
|
2597
|
+
`${timelineUpdate.key}:${index}:${update.key}`
|
|
2584
2598
|
);
|
|
2585
2599
|
}) : timelineUpdate.type === `selector_update` ? timelineUpdate.atomUpdates.filter((token) => !token.key.startsWith(`\u{1F441}\u200D\u{1F5E8}`)).map((atomUpdate, index) => {
|
|
2586
2600
|
return /* @__PURE__ */ jsxRuntime.jsx(
|