atom.io 0.6.5 → 0.6.6
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 +32 -78
- package/dist/index.d.mts +4 -35
- package/dist/index.d.ts +4 -35
- package/dist/index.js +45 -198
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +42 -195
- package/dist/index.mjs.map +1 -1
- package/introspection/dist/index.js +312 -0
- package/introspection/dist/index.js.map +1 -0
- package/introspection/dist/index.mjs +289 -0
- package/introspection/dist/index.mjs.map +1 -0
- package/introspection/package.json +15 -0
- package/package.json +16 -6
- package/react-devtools/dist/index.css +22 -5
- package/react-devtools/dist/index.css.map +1 -1
- package/react-devtools/dist/index.d.mts +347 -8
- package/react-devtools/dist/index.d.ts +347 -8
- package/react-devtools/dist/index.js +2722 -674
- package/react-devtools/dist/index.js.map +1 -1
- package/react-devtools/dist/index.mjs +2669 -630
- package/react-devtools/dist/index.mjs.map +1 -1
- package/src/internal/index.ts +0 -1
- package/src/internal/operation.ts +1 -0
- package/src/internal/store.ts +3 -2
- package/src/internal/time-travel-internal.ts +2 -0
- package/src/internal/timeline/add-atom-to-timeline.ts +11 -12
- package/src/internal/timeline-internal.ts +5 -1
- package/src/introspection/attach-atom-index.ts +73 -0
- package/src/introspection/attach-introspection-states.ts +42 -0
- package/src/introspection/attach-selector-index.ts +77 -0
- package/src/introspection/attach-timeline-family.ts +49 -0
- package/src/introspection/attach-timeline-index.ts +36 -0
- package/src/introspection/attach-transaction-index.ts +38 -0
- package/src/introspection/attach-transaction-logs.ts +40 -0
- package/src/introspection/index.ts +20 -0
- package/src/react-devtools/AtomIODevtools.tsx +97 -96
- package/src/react-devtools/Button.tsx +24 -0
- package/src/react-devtools/StateEditor.tsx +14 -16
- package/src/react-devtools/StateIndex.tsx +153 -0
- package/src/react-devtools/TimelineIndex.tsx +92 -0
- package/src/react-devtools/TransactionIndex.tsx +70 -0
- package/src/react-devtools/Updates.tsx +145 -0
- package/src/react-devtools/devtools.scss +196 -15
- package/src/react-devtools/index.ts +71 -0
- package/src/react-explorer/AtomIOExplorer.tsx +0 -1
- package/src/react-explorer/explorer-states.ts +1 -1
- package/src/react-explorer/space-states.ts +3 -1
- package/src/react-explorer/view-states.ts +0 -2
- package/realtime-testing/dist/index.d.mts +0 -49
- package/realtime-testing/dist/index.d.ts +0 -49
- package/realtime-testing/dist/index.js +0 -165
- package/realtime-testing/dist/index.js.map +0 -1
- package/realtime-testing/dist/index.mjs +0 -129
- package/realtime-testing/dist/index.mjs.map +0 -1
- package/src/internal/meta/attach-meta.ts +0 -17
- package/src/internal/meta/index.ts +0 -4
- package/src/internal/meta/meta-state.ts +0 -135
- package/src/internal/meta/meta-timelines.ts +0 -1
- package/src/internal/meta/meta-transactions.ts +0 -1
- package/src/react-devtools/TokenList.tsx +0 -61
package/README.md
CHANGED
|
@@ -1,78 +1,32 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
- [x] subscribe to creation of atom tokens
|
|
34
|
-
- [x] subscribe to creation of selector tokens
|
|
35
|
-
- [x] subscribe to creation of readonly selector tokens
|
|
36
|
-
- [ ] reimplement state indices as selectors
|
|
37
|
-
- [ ] subscribe to creation of transaction tokens
|
|
38
|
-
- [ ] subscribe to creation of timeline tokens
|
|
39
|
-
- [ ] subscribe to changes in store configuration
|
|
40
|
-
|
|
41
|
-
# /react-devtools
|
|
42
|
-
- [ ]
|
|
43
|
-
|
|
44
|
-
# /react
|
|
45
|
-
## features
|
|
46
|
-
- [x] useStore
|
|
47
|
-
- [x] useI, useO, useIO
|
|
48
|
-
- [ ] useTimeline
|
|
49
|
-
- [ ] useStoreIndex
|
|
50
|
-
- [ ] useTransactionIO
|
|
51
|
-
|
|
52
|
-
# /realtime
|
|
53
|
-
- [x] expose single atom and selector
|
|
54
|
-
- [x] expose atom family and selector family
|
|
55
|
-
- [ ] receive single atom and selector
|
|
56
|
-
- [ ] receive atom family and selector family
|
|
57
|
-
- [x] receive transaction params, run transaction
|
|
58
|
-
- [ ] assess transaction impact (active subscriptions influenced by transaction)
|
|
59
|
-
- [ ] return transaction impact as timeline event
|
|
60
|
-
- [ ] identity-based exposure and receipt
|
|
61
|
-
- [ ] expose selector as atom
|
|
62
|
-
|
|
63
|
-
# /react-realtime
|
|
64
|
-
example: what's in the box? (options: green apple, green banana, red apple, red banana)
|
|
65
|
-
- no player gets to see what's in the box
|
|
66
|
-
- player 1 can see the color of the item in the box
|
|
67
|
-
- a register must be kept allocating "subscription permissions" per player
|
|
68
|
-
- sometimes permissions may refer to "true" or "global" state; sometimes to state that is "virtual" or "local" to the player
|
|
69
|
-
- player 2 can see the type of the item in the box
|
|
70
|
-
- atom<`${string}____${string}`> boxItem
|
|
71
|
-
- selector boxItemColor
|
|
72
|
-
- selector boxItemType
|
|
73
|
-
-
|
|
74
|
-
-
|
|
75
|
-
|
|
76
|
-
# /web-fx
|
|
77
|
-
## features
|
|
78
|
-
- [ ] localStorage and sessionStorage effects
|
|
1
|
+
<hr>
|
|
2
|
+
|
|
3
|
+
<div align="center">
|
|
4
|
+
<img alt="corners logo" src="https://raw.githubusercontent.com/jeremybanka/wayforge/main/packages/atom.io/assets/logo.png"/>
|
|
5
|
+
</div>
|
|
6
|
+
|
|
7
|
+
<br>
|
|
8
|
+
|
|
9
|
+
<p align="center">
|
|
10
|
+
<a href="https://bundlephobia.com/result?p=atom.io">
|
|
11
|
+
<img alt="Bundlephobia" src="https://img.shields.io/bundlephobia/minzip/atom.io?style=for-the-badge&labelColor=333">
|
|
12
|
+
</a>
|
|
13
|
+
<a aria-label="Types" href="https://www.npmjs.com/package/atom.io">
|
|
14
|
+
<img alt="Types" src="https://img.shields.io/npm/types/atom.io?style=for-the-badge&labelColor=333">
|
|
15
|
+
</a>
|
|
16
|
+
<a aria-label="Build status" href="https://github.com/jeremybanka/wayforge/actions/workflows/integration.yml">
|
|
17
|
+
<img alt="Build status" src="https://img.shields.io/github/actions/workflow/status/jeremybanka/wayforge/integration.yml?branch=main&style=for-the-badge&labelColor=333">
|
|
18
|
+
</a>
|
|
19
|
+
<a aria-label="NPM version" href="https://www.npmjs.com/package/atom.io">
|
|
20
|
+
<img alt="NPM Version" src="https://img.shields.io/npm/v/atom.io?style=for-the-badge&labelColor=333">
|
|
21
|
+
</a>
|
|
22
|
+
</p>
|
|
23
|
+
|
|
24
|
+
```shell
|
|
25
|
+
npm i atom.io
|
|
26
|
+
```
|
|
27
|
+
```shell
|
|
28
|
+
pnpm add atom.io
|
|
29
|
+
```
|
|
30
|
+
<hr>
|
|
31
|
+
|
|
32
|
+
Reactive state graph for node and the browser inspired by [Recoil](https://recoiljs.org/).
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Hamt } from 'hamt_plus';
|
|
2
|
-
import { Refinement } from 'fp-ts/
|
|
2
|
+
import { Refinement } from 'fp-ts/Refinement';
|
|
3
3
|
|
|
4
4
|
type ƒn = (...parameters: any[]) => any;
|
|
5
5
|
|
|
@@ -86,8 +86,9 @@ interface Store {
|
|
|
86
86
|
subject: {
|
|
87
87
|
atomCreation: Subject<AtomToken<unknown>>;
|
|
88
88
|
selectorCreation: Subject<ReadonlySelectorToken<unknown> | SelectorToken<unknown>>;
|
|
89
|
-
transactionCreation: Subject<TransactionToken
|
|
89
|
+
transactionCreation: Subject<TransactionToken<ƒn>>;
|
|
90
90
|
timelineCreation: Subject<TimelineToken>;
|
|
91
|
+
operationStatus: Subject<OperationProgress>;
|
|
91
92
|
};
|
|
92
93
|
operation: OperationProgress;
|
|
93
94
|
transactionStatus: TransactionStatus<ƒn>;
|
|
@@ -169,37 +170,6 @@ declare const markAtomAsDefault: (key: string, store?: Store) => void;
|
|
|
169
170
|
declare const markAtomAsNotDefault: (key: string, store?: Store) => void;
|
|
170
171
|
declare const isSelectorDefault: (key: string, store?: Store) => boolean;
|
|
171
172
|
|
|
172
|
-
type StateTokenIndex<Token extends AtomToken<unknown> | ReadonlySelectorToken<unknown> | SelectorToken<unknown>> = Record<string, Token | {
|
|
173
|
-
key: string;
|
|
174
|
-
familyMembers: Record<string, Token>;
|
|
175
|
-
}>;
|
|
176
|
-
type AtomTokenIndex = StateTokenIndex<AtomToken<unknown>>;
|
|
177
|
-
type SelectorTokenIndex = StateTokenIndex<ReadonlySelectorToken<unknown> | SelectorToken<unknown>>;
|
|
178
|
-
declare const attachMetaAtoms: (store?: Store) => ReadonlySelectorToken<AtomTokenIndex>;
|
|
179
|
-
declare const attachMetaSelectors: (store?: Store) => ReadonlySelectorToken<SelectorTokenIndex>;
|
|
180
|
-
|
|
181
|
-
declare const attachMetaState: (store?: Store) => {
|
|
182
|
-
atomTokenIndexState: ReadonlySelectorToken<AtomTokenIndex>;
|
|
183
|
-
selectorTokenIndexState: ReadonlySelectorToken<SelectorTokenIndex>;
|
|
184
|
-
};
|
|
185
|
-
|
|
186
|
-
type index$1_AtomTokenIndex = AtomTokenIndex;
|
|
187
|
-
type index$1_SelectorTokenIndex = SelectorTokenIndex;
|
|
188
|
-
type index$1_StateTokenIndex<Token extends AtomToken<unknown> | ReadonlySelectorToken<unknown> | SelectorToken<unknown>> = StateTokenIndex<Token>;
|
|
189
|
-
declare const index$1_attachMetaAtoms: typeof attachMetaAtoms;
|
|
190
|
-
declare const index$1_attachMetaSelectors: typeof attachMetaSelectors;
|
|
191
|
-
declare const index$1_attachMetaState: typeof attachMetaState;
|
|
192
|
-
declare namespace index$1 {
|
|
193
|
-
export {
|
|
194
|
-
index$1_AtomTokenIndex as AtomTokenIndex,
|
|
195
|
-
index$1_SelectorTokenIndex as SelectorTokenIndex,
|
|
196
|
-
index$1_StateTokenIndex as StateTokenIndex,
|
|
197
|
-
index$1_attachMetaAtoms as attachMetaAtoms,
|
|
198
|
-
index$1_attachMetaSelectors as attachMetaSelectors,
|
|
199
|
-
index$1_attachMetaState as attachMetaState,
|
|
200
|
-
};
|
|
201
|
-
}
|
|
202
|
-
|
|
203
173
|
type OperationProgress = {
|
|
204
174
|
open: false;
|
|
205
175
|
} | {
|
|
@@ -333,7 +303,7 @@ type Timeline = {
|
|
|
333
303
|
selectorTime: number | null;
|
|
334
304
|
transactionKey: string | null;
|
|
335
305
|
install: (store: Store) => void;
|
|
336
|
-
subject: Subject<TimelineAtomUpdate | TimelineSelectorUpdate | TimelineTransactionUpdate
|
|
306
|
+
subject: Subject<TimelineAtomUpdate | TimelineSelectorUpdate | TimelineTransactionUpdate | `redo` | `undo`>;
|
|
337
307
|
};
|
|
338
308
|
declare function timeline__INTERNAL(options: TimelineOptions, store?: Store, data?: Timeline | null): TimelineToken;
|
|
339
309
|
|
|
@@ -444,7 +414,6 @@ declare namespace index {
|
|
|
444
414
|
export {
|
|
445
415
|
index_Atom as Atom,
|
|
446
416
|
index_IMPLICIT as IMPLICIT,
|
|
447
|
-
index$1 as META,
|
|
448
417
|
index_OperationProgress as OperationProgress,
|
|
449
418
|
index_ReadonlySelector as ReadonlySelector,
|
|
450
419
|
index_Selector as Selector,
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Hamt } from 'hamt_plus';
|
|
2
|
-
import { Refinement } from 'fp-ts/
|
|
2
|
+
import { Refinement } from 'fp-ts/Refinement';
|
|
3
3
|
|
|
4
4
|
type ƒn = (...parameters: any[]) => any;
|
|
5
5
|
|
|
@@ -86,8 +86,9 @@ interface Store {
|
|
|
86
86
|
subject: {
|
|
87
87
|
atomCreation: Subject<AtomToken<unknown>>;
|
|
88
88
|
selectorCreation: Subject<ReadonlySelectorToken<unknown> | SelectorToken<unknown>>;
|
|
89
|
-
transactionCreation: Subject<TransactionToken
|
|
89
|
+
transactionCreation: Subject<TransactionToken<ƒn>>;
|
|
90
90
|
timelineCreation: Subject<TimelineToken>;
|
|
91
|
+
operationStatus: Subject<OperationProgress>;
|
|
91
92
|
};
|
|
92
93
|
operation: OperationProgress;
|
|
93
94
|
transactionStatus: TransactionStatus<ƒn>;
|
|
@@ -169,37 +170,6 @@ declare const markAtomAsDefault: (key: string, store?: Store) => void;
|
|
|
169
170
|
declare const markAtomAsNotDefault: (key: string, store?: Store) => void;
|
|
170
171
|
declare const isSelectorDefault: (key: string, store?: Store) => boolean;
|
|
171
172
|
|
|
172
|
-
type StateTokenIndex<Token extends AtomToken<unknown> | ReadonlySelectorToken<unknown> | SelectorToken<unknown>> = Record<string, Token | {
|
|
173
|
-
key: string;
|
|
174
|
-
familyMembers: Record<string, Token>;
|
|
175
|
-
}>;
|
|
176
|
-
type AtomTokenIndex = StateTokenIndex<AtomToken<unknown>>;
|
|
177
|
-
type SelectorTokenIndex = StateTokenIndex<ReadonlySelectorToken<unknown> | SelectorToken<unknown>>;
|
|
178
|
-
declare const attachMetaAtoms: (store?: Store) => ReadonlySelectorToken<AtomTokenIndex>;
|
|
179
|
-
declare const attachMetaSelectors: (store?: Store) => ReadonlySelectorToken<SelectorTokenIndex>;
|
|
180
|
-
|
|
181
|
-
declare const attachMetaState: (store?: Store) => {
|
|
182
|
-
atomTokenIndexState: ReadonlySelectorToken<AtomTokenIndex>;
|
|
183
|
-
selectorTokenIndexState: ReadonlySelectorToken<SelectorTokenIndex>;
|
|
184
|
-
};
|
|
185
|
-
|
|
186
|
-
type index$1_AtomTokenIndex = AtomTokenIndex;
|
|
187
|
-
type index$1_SelectorTokenIndex = SelectorTokenIndex;
|
|
188
|
-
type index$1_StateTokenIndex<Token extends AtomToken<unknown> | ReadonlySelectorToken<unknown> | SelectorToken<unknown>> = StateTokenIndex<Token>;
|
|
189
|
-
declare const index$1_attachMetaAtoms: typeof attachMetaAtoms;
|
|
190
|
-
declare const index$1_attachMetaSelectors: typeof attachMetaSelectors;
|
|
191
|
-
declare const index$1_attachMetaState: typeof attachMetaState;
|
|
192
|
-
declare namespace index$1 {
|
|
193
|
-
export {
|
|
194
|
-
index$1_AtomTokenIndex as AtomTokenIndex,
|
|
195
|
-
index$1_SelectorTokenIndex as SelectorTokenIndex,
|
|
196
|
-
index$1_StateTokenIndex as StateTokenIndex,
|
|
197
|
-
index$1_attachMetaAtoms as attachMetaAtoms,
|
|
198
|
-
index$1_attachMetaSelectors as attachMetaSelectors,
|
|
199
|
-
index$1_attachMetaState as attachMetaState,
|
|
200
|
-
};
|
|
201
|
-
}
|
|
202
|
-
|
|
203
173
|
type OperationProgress = {
|
|
204
174
|
open: false;
|
|
205
175
|
} | {
|
|
@@ -333,7 +303,7 @@ type Timeline = {
|
|
|
333
303
|
selectorTime: number | null;
|
|
334
304
|
transactionKey: string | null;
|
|
335
305
|
install: (store: Store) => void;
|
|
336
|
-
subject: Subject<TimelineAtomUpdate | TimelineSelectorUpdate | TimelineTransactionUpdate
|
|
306
|
+
subject: Subject<TimelineAtomUpdate | TimelineSelectorUpdate | TimelineTransactionUpdate | `redo` | `undo`>;
|
|
337
307
|
};
|
|
338
308
|
declare function timeline__INTERNAL(options: TimelineOptions, store?: Store, data?: Timeline | null): TimelineToken;
|
|
339
309
|
|
|
@@ -444,7 +414,6 @@ declare namespace index {
|
|
|
444
414
|
export {
|
|
445
415
|
index_Atom as Atom,
|
|
446
416
|
index_IMPLICIT as IMPLICIT,
|
|
447
|
-
index$1 as META,
|
|
448
417
|
index_OperationProgress as OperationProgress,
|
|
449
418
|
index_ReadonlySelector as ReadonlySelector,
|
|
450
419
|
index_Selector as Selector,
|