atom.io 0.6.1 → 0.6.3
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 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +7 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7 -2
- package/dist/index.mjs.map +1 -1
- package/json/dist/index.js.map +1 -1
- package/json/dist/index.mjs.map +1 -1
- package/package.json +13 -3
- package/react/dist/index.js.map +1 -1
- package/react/dist/index.mjs.map +1 -1
- package/react-devtools/dist/index.js +32 -18
- package/react-devtools/dist/index.js.map +1 -1
- package/react-devtools/dist/index.mjs +32 -18
- package/react-devtools/dist/index.mjs.map +1 -1
- package/realtime/dist/index.js.map +1 -1
- package/realtime/dist/index.mjs.map +1 -1
- package/realtime-react/dist/index.js.map +1 -1
- package/realtime-react/dist/index.mjs.map +1 -1
- package/realtime-testing/dist/index.d.mts +49 -0
- package/realtime-testing/dist/index.d.ts +49 -0
- package/realtime-testing/dist/index.js +153 -0
- package/realtime-testing/dist/index.js.map +1 -0
- package/realtime-testing/dist/index.mjs +117 -0
- package/realtime-testing/dist/index.mjs.map +1 -0
- package/realtime-testing/package.json +15 -0
- package/src/atom.ts +15 -15
- package/src/index.ts +59 -59
- package/src/internal/atom-internal.ts +36 -36
- package/src/internal/families-internal.ts +114 -114
- package/src/internal/get.ts +83 -83
- package/src/internal/is-default.ts +17 -17
- package/src/internal/meta/attach-meta.ts +7 -7
- package/src/internal/meta/meta-state.ts +115 -115
- package/src/internal/operation.ts +93 -93
- package/src/internal/selector/create-read-write-selector.ts +46 -46
- package/src/internal/selector/create-readonly-selector.ts +37 -37
- package/src/internal/selector/lookup-selector-sources.ts +9 -9
- package/src/internal/selector/register-selector.ts +44 -44
- package/src/internal/selector/trace-selector-atoms.ts +30 -30
- package/src/internal/selector/update-selector-atoms.ts +25 -25
- package/src/internal/selector-internal.ts +37 -37
- package/src/internal/set.ts +78 -78
- package/src/internal/store.ts +118 -118
- package/src/internal/subscribe-internal.ts +62 -62
- package/src/internal/time-travel-internal.ts +76 -76
- package/src/internal/timeline/add-atom-to-timeline.ts +158 -153
- package/src/internal/timeline-internal.ts +80 -80
- package/src/internal/transaction/abort-transaction.ts +8 -8
- package/src/internal/transaction/apply-transaction.ts +41 -41
- package/src/internal/transaction/build-transaction.ts +28 -28
- package/src/internal/transaction/index.ts +7 -7
- package/src/internal/transaction/redo-transaction.ts +13 -13
- package/src/internal/transaction/undo-transaction.ts +13 -13
- package/src/internal/transaction-internal.ts +48 -48
- package/src/json/select-json.ts +12 -12
- package/src/logger.ts +30 -30
- package/src/react/store-context.tsx +4 -4
- package/src/react/store-hooks.ts +18 -18
- package/src/react-devtools/AtomIODevtools.tsx +83 -82
- package/src/react-devtools/StateEditor.tsx +53 -53
- package/src/react-devtools/TokenList.tsx +47 -42
- package/src/react-explorer/AtomIOExplorer.tsx +197 -185
- package/src/react-explorer/explorer-effects.ts +11 -11
- package/src/react-explorer/explorer-states.ts +186 -193
- package/src/react-explorer/index.ts +11 -11
- package/src/react-explorer/space-states.ts +48 -50
- package/src/react-explorer/view-states.ts +25 -25
- package/src/realtime/hook-composition/expose-family.ts +81 -81
- package/src/realtime/hook-composition/expose-single.ts +26 -26
- package/src/realtime/hook-composition/expose-timeline.ts +60 -0
- package/src/realtime/hook-composition/index.ts +2 -2
- package/src/realtime/hook-composition/receive-state.ts +18 -18
- package/src/realtime/hook-composition/receive-transaction.ts +8 -8
- package/src/realtime-react/realtime-context.tsx +17 -17
- package/src/realtime-react/realtime-hooks.ts +17 -17
- package/src/realtime-react/realtime-state.ts +4 -4
- package/src/realtime-react/use-pull-family-member.ts +15 -15
- package/src/realtime-react/use-pull-family.ts +13 -13
- package/src/realtime-react/use-pull.ts +12 -12
- package/src/realtime-react/use-push.ts +15 -15
- package/src/realtime-react/use-server-action.ts +21 -21
- package/src/realtime-testing/index.ts +1 -0
- package/src/realtime-testing/setup-realtime-test.tsx +160 -0
- package/src/selector.ts +25 -25
- package/src/silo.ts +38 -38
- package/src/subscribe.ts +68 -68
- package/src/timeline.ts +13 -13
- package/src/transaction.ts +28 -28
- package/src/web-effects/storage.ts +17 -17
package/dist/index.d.mts
CHANGED
|
@@ -22,7 +22,7 @@ type Identified = {
|
|
|
22
22
|
};
|
|
23
23
|
|
|
24
24
|
declare const RELATION_TYPES: readonly ["1:1", "1:n", "n:n"];
|
|
25
|
-
type RelationType =
|
|
25
|
+
type RelationType = typeof RELATION_TYPES[number];
|
|
26
26
|
type RelationData<CONTENT extends JsonObj | null = null, A extends string = `from`, B extends string = `to`> = {
|
|
27
27
|
contents: JsonObj<string, CONTENT>;
|
|
28
28
|
relations: JsonObj<string, string[]>;
|
|
@@ -349,7 +349,7 @@ declare const redoTransactionUpdate: <ƒ extends ƒn>(update: TransactionUpdate<
|
|
|
349
349
|
declare const undoTransactionUpdate: <ƒ extends ƒn>(update: TransactionUpdate<ƒ>, store: Store) => void;
|
|
350
350
|
|
|
351
351
|
declare const TRANSACTION_PHASES: readonly ["idle", "building", "applying"];
|
|
352
|
-
type TransactionPhase =
|
|
352
|
+
type TransactionPhase = typeof TRANSACTION_PHASES[number];
|
|
353
353
|
type TransactionUpdateInProgress<ƒ extends ƒn> = TransactionUpdate<ƒ> & {
|
|
354
354
|
phase: `applying` | `building`;
|
|
355
355
|
time: number;
|
|
@@ -577,7 +577,7 @@ type TimelineToken = {
|
|
|
577
577
|
};
|
|
578
578
|
type TimelineOptions = {
|
|
579
579
|
key: string;
|
|
580
|
-
atoms: (AtomFamily<any> | AtomToken<any>)[];
|
|
580
|
+
atoms: (AtomFamily<any, any> | AtomToken<any>)[];
|
|
581
581
|
};
|
|
582
582
|
type TimelineUpdate = TimelineAtomUpdate | TimelineSelectorUpdate | TimelineTransactionUpdate;
|
|
583
583
|
declare const timeline: (options: TimelineOptions) => TimelineToken;
|
package/dist/index.d.ts
CHANGED
|
@@ -22,7 +22,7 @@ type Identified = {
|
|
|
22
22
|
};
|
|
23
23
|
|
|
24
24
|
declare const RELATION_TYPES: readonly ["1:1", "1:n", "n:n"];
|
|
25
|
-
type RelationType =
|
|
25
|
+
type RelationType = typeof RELATION_TYPES[number];
|
|
26
26
|
type RelationData<CONTENT extends JsonObj | null = null, A extends string = `from`, B extends string = `to`> = {
|
|
27
27
|
contents: JsonObj<string, CONTENT>;
|
|
28
28
|
relations: JsonObj<string, string[]>;
|
|
@@ -349,7 +349,7 @@ declare const redoTransactionUpdate: <ƒ extends ƒn>(update: TransactionUpdate<
|
|
|
349
349
|
declare const undoTransactionUpdate: <ƒ extends ƒn>(update: TransactionUpdate<ƒ>, store: Store) => void;
|
|
350
350
|
|
|
351
351
|
declare const TRANSACTION_PHASES: readonly ["idle", "building", "applying"];
|
|
352
|
-
type TransactionPhase =
|
|
352
|
+
type TransactionPhase = typeof TRANSACTION_PHASES[number];
|
|
353
353
|
type TransactionUpdateInProgress<ƒ extends ƒn> = TransactionUpdate<ƒ> & {
|
|
354
354
|
phase: `applying` | `building`;
|
|
355
355
|
time: number;
|
|
@@ -577,7 +577,7 @@ type TimelineToken = {
|
|
|
577
577
|
};
|
|
578
578
|
type TimelineOptions = {
|
|
579
579
|
key: string;
|
|
580
|
-
atoms: (AtomFamily<any> | AtomToken<any>)[];
|
|
580
|
+
atoms: (AtomFamily<any, any> | AtomToken<any>)[];
|
|
581
581
|
};
|
|
582
582
|
type TimelineUpdate = TimelineAtomUpdate | TimelineSelectorUpdate | TimelineTransactionUpdate;
|
|
583
583
|
declare const timeline: (options: TimelineOptions) => TimelineToken;
|
package/dist/index.js
CHANGED
|
@@ -1535,6 +1535,11 @@ var addAtomToTimeline = (atomToken, atoms, tl, store = IMPLICIT.STORE) => {
|
|
|
1535
1535
|
if (tl.timeTraveling === false) {
|
|
1536
1536
|
if (tl.selectorTime && tl.selectorTime !== currentSelectorTime) {
|
|
1537
1537
|
const mostRecentUpdate = tl.history.at(-1);
|
|
1538
|
+
if (mostRecentUpdate === void 0) {
|
|
1539
|
+
throw new Error(
|
|
1540
|
+
`Timeline "${tl.key}" has a selectorTime, but no history. This is most likely a bug in AtomIO.`
|
|
1541
|
+
);
|
|
1542
|
+
}
|
|
1538
1543
|
if (mostRecentUpdate.type === `selector_update`) {
|
|
1539
1544
|
tl.subject.next(mostRecentUpdate);
|
|
1540
1545
|
}
|
|
@@ -1956,10 +1961,10 @@ var timeline = (options) => {
|
|
|
1956
1961
|
return timeline__INTERNAL(options);
|
|
1957
1962
|
};
|
|
1958
1963
|
var redo = (token) => {
|
|
1959
|
-
|
|
1964
|
+
redo__INTERNAL(token, IMPLICIT.STORE);
|
|
1960
1965
|
};
|
|
1961
1966
|
var undo = (token) => {
|
|
1962
|
-
|
|
1967
|
+
undo__INTERNAL(token, IMPLICIT.STORE);
|
|
1963
1968
|
};
|
|
1964
1969
|
|
|
1965
1970
|
// src/transaction.ts
|