atom.io 0.32.0 → 0.32.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.
Files changed (53) hide show
  1. package/data/dist/index.d.ts +8 -925
  2. package/data/dist/index.js +2 -2
  3. package/dist/{chunk-5F2V7S3B.js → chunk-3PQTWLQQ.js} +1 -1
  4. package/dist/{chunk-Z2UJW4NQ.js → chunk-3ZFTRSNG.js} +3 -3
  5. package/dist/{chunk-354XQWHH.js → chunk-KVI5OBF2.js} +5 -5
  6. package/dist/{chunk-GY2XQYZY.js → chunk-UQEYZ3OI.js} +45 -40
  7. package/dist/{chunk-R3ZUK5EH.js → chunk-UYYKOGZQ.js} +16 -6
  8. package/dist/{chunk-ECOMOMUN.js → chunk-VRJP2PCU.js} +10 -10
  9. package/dist/{chunk-NF7FJKJD.js → chunk-X7SD2NXU.js} +2 -1
  10. package/dist/index.d.ts +43 -514
  11. package/dist/index.js +1 -1
  12. package/eslint-plugin/dist/index.js +3 -3
  13. package/eslint-plugin/src/rules/explicit-state-types.ts +1 -0
  14. package/eslint-plugin/src/rules/synchronous-selector-dependencies.ts +1 -0
  15. package/eslint-plugin/src/walk.ts +1 -0
  16. package/internal/dist/index.d.ts +8 -656
  17. package/internal/dist/index.js +1 -1
  18. package/internal/src/join/join-internal.ts +1 -1
  19. package/internal/src/junction.ts +7 -4
  20. package/internal/src/set-state/emit-update.ts +3 -1
  21. package/internal/src/timeline/create-timeline.ts +2 -1
  22. package/internal/src/timeline/time-travel.ts +2 -1
  23. package/introspection/dist/index.d.ts +6 -922
  24. package/introspection/dist/index.js +2 -2
  25. package/json/dist/index.d.ts +5 -899
  26. package/json/dist/index.js +1 -1
  27. package/package.json +8 -8
  28. package/react/dist/index.d.ts +3 -921
  29. package/react/dist/index.js +2 -2
  30. package/react-devtools/dist/index.d.ts +1 -26
  31. package/react-devtools/dist/index.js +28 -15
  32. package/react-devtools/src/Updates.tsx +12 -0
  33. package/react-devtools/src/json-editor/editors-by-type/utilities/cast-to-json.ts +2 -1
  34. package/realtime/dist/index.d.ts +7 -202
  35. package/realtime/dist/index.js +2 -2
  36. package/realtime/src/realtime-continuity.ts +1 -0
  37. package/realtime-client/dist/index.d.ts +21 -959
  38. package/realtime-client/dist/index.js +2 -2
  39. package/realtime-react/dist/index.d.ts +12 -166
  40. package/realtime-react/dist/index.js +4 -4
  41. package/realtime-server/dist/index.d.ts +26 -971
  42. package/realtime-server/dist/index.js +3 -3
  43. package/realtime-server/src/ipc-sockets/child-socket.ts +2 -0
  44. package/realtime-server/src/realtime-server-stores/server-sync-store.ts +10 -2
  45. package/realtime-testing/dist/index.d.ts +3 -1091
  46. package/realtime-testing/dist/index.js +7 -7
  47. package/transceivers/set-rtx/dist/index.d.ts +6 -40
  48. package/transceivers/set-rtx/dist/index.js +1 -1
  49. package/transceivers/set-rtx/src/set-rtx.ts +4 -7
  50. package/web/dist/index.d.ts +1 -30
  51. package/react-devtools/src/json-editor/assets/Untitled-1.ai +2 -1436
  52. package/react-devtools/src/json-editor/assets/data-vis.ai +1 -1548
  53. package/react-devtools/src/json-editor/comp/json-editor-sketches.ai +5 -1449
@@ -1,4 +1,4 @@
1
- export { confirmedUpdateQueue, myIdState, myIdState__INTERNAL, myUsernameState, optimisticUpdateQueue, pullAtom, pullAtomFamilyMember, pullMutableAtom, pullMutableAtomFamilyMember, pullSelector, pullSelectorFamilyMember, pushState, serverAction, syncContinuity, useConcealState, useRegisterAndAttemptConfirmedUpdate, useRevealState } from '../../dist/chunk-Z2UJW4NQ.js';
1
+ export { confirmedUpdateQueue, myIdState, myIdState__INTERNAL, myUsernameState, optimisticUpdateQueue, pullAtom, pullAtomFamilyMember, pullMutableAtom, pullMutableAtomFamilyMember, pullSelector, pullSelectorFamilyMember, pushState, serverAction, syncContinuity, useConcealState, useRegisterAndAttemptConfirmedUpdate, useRevealState } from '../../dist/chunk-3ZFTRSNG.js';
2
2
  import '../../dist/chunk-4LWKCEW3.js';
3
- import '../../dist/chunk-GY2XQYZY.js';
3
+ import '../../dist/chunk-UQEYZ3OI.js';
4
4
  import '../../dist/chunk-XWL6SNVU.js';
@@ -1,5 +1,9 @@
1
1
  import * as React from 'react';
2
2
  import { Socket } from 'socket.io-client';
3
+ import * as AtomIO from 'atom.io';
4
+ import { Json, Canonical } from 'atom.io/json';
5
+ import { Transceiver, Func } from 'atom.io/internal';
6
+ import { ContinuityToken } from 'atom.io/realtime';
3
7
 
4
8
  type RealtimeReactStore = {
5
9
  socket: Socket | null;
@@ -14,179 +18,21 @@ declare const RealtimeProvider: React.FC<{
14
18
  socket: Socket | null;
15
19
  }>;
16
20
 
17
- type primitive = boolean | number | string | null;
18
- declare namespace Json {
19
- namespace Tree {
20
- type Array<Element = unknown> = ReadonlyArray<Element>;
21
- type Object<K extends string = string, V = unknown> = Record<K, V>;
22
- type Fork = Array | Object;
23
- type Leaf = primitive;
24
- type Node = Fork | Leaf;
25
- }
26
- type Serializable = primitive | Readonly<{
27
- [key: string]: Serializable;
28
- }> | ReadonlyArray<Serializable>;
29
- type Object<Key extends string = string, Value extends Serializable = Serializable> = Record<Key, Value>;
30
- type Array<Element extends Serializable = Serializable> = ReadonlyArray<Element>;
31
- }
32
- type stringified<J extends Json.Serializable> = J extends string ? `"${J}"` : J extends number ? `${J}` : J extends true ? `true` : J extends false ? `false` : J extends boolean ? `false` | `true` : J extends null ? `null` : string & {
33
- __json?: J;
34
- };
35
- type Canonical = primitive | ReadonlyArray<Canonical>;
36
-
37
- type Func = (...parameters: any[]) => any;
21
+ declare function usePullAtom<J extends Json.Serializable>(token: AtomIO.RegularAtomToken<J>): J;
38
22
 
39
- interface Transceiver<S extends Json.Serializable> {
40
- do: (update: S) => number | `OUT_OF_RANGE` | null;
41
- undo: (update: S) => void;
42
- subscribe: (key: string, fn: (update: S) => void) => () => void;
43
- cacheUpdateNumber: number;
44
- getUpdateNumber: (update: S) => number;
45
- }
23
+ declare function usePullAtomFamilyMember<J extends Json.Serializable, K extends Canonical, Key extends K>(family: AtomIO.RegularAtomFamilyToken<J, K>, subKey: Key): J;
46
24
 
47
- type RegularAtomFamilyToken<T, K extends Canonical> = {
48
- key: string;
49
- type: `atom_family`;
50
- __T?: T;
51
- __K?: K;
52
- };
53
- type MutableAtomFamilyToken<T extends Transceiver<any>, J extends Json.Serializable, K extends Canonical> = {
54
- key: string;
55
- type: `mutable_atom_family`;
56
- __T?: T;
57
- __J?: J;
58
- __K?: K;
59
- };
60
- type AtomFamilyToken<T, K extends Canonical = Canonical> = MutableAtomFamilyToken<T extends Transceiver<any> ? T : never, any, K> | RegularAtomFamilyToken<T, K>;
25
+ declare function usePullMutable<T extends Transceiver<any>, J extends Json.Serializable>(token: AtomIO.MutableAtomToken<T, J>): T;
61
26
 
62
- type TransactionToken<F extends Func> = {
63
- key: string;
64
- type: `transaction`;
65
- __F?: F;
66
- };
27
+ declare function usePullMutableAtomFamilyMember<T extends Transceiver<any>, J extends Json.Serializable, K extends Canonical, Key extends K>(familyToken: AtomIO.MutableAtomFamilyToken<T, J, K>, key: Key): T;
67
28
 
68
- type WritableSelectorFamilyToken<T, K extends Canonical> = {
69
- key: string;
70
- type: `selector_family`;
71
- __T?: T;
72
- __K?: K;
73
- };
74
- type ReadonlySelectorFamilyToken<T, K extends Canonical> = {
75
- key: string;
76
- type: `readonly_selector_family`;
77
- __T?: T;
78
- __K?: K;
79
- };
80
- type SelectorFamilyToken<T, K extends Canonical> = ReadonlySelectorFamilyToken<T, K> | WritableSelectorFamilyToken<T, K>;
29
+ declare function usePullSelector<J extends Json.Serializable>(token: AtomIO.SelectorToken<J>): J;
81
30
 
82
- type TokenType<Comparison extends ReadableFamilyToken<any, any> | ReadableToken<any>> = Comparison extends ReadableToken<infer RepresentedValue> ? RepresentedValue : Comparison extends ReadableFamilyToken<infer RepresentedValue, any> ? RepresentedValue : never;
31
+ declare function usePullSelectorFamilyMember<T, K extends Canonical, Key extends K>(familyToken: AtomIO.SelectorFamilyToken<T, K>, key: Key): T;
83
32
 
84
- /** @public */
85
- type RegularAtomToken<T, K extends Canonical = any> = {
86
- /** The unique identifier of the atom. */
87
- key: string;
88
- /** Discriminator. */
89
- type: `atom`;
90
- /** Present if the atom belongs to a family. */
91
- family?: FamilyMetadata<K>;
92
- /** Never present. This is a marker that preserves the type of the atom's value. */
93
- __T?: T;
94
- };
95
- /** @public */
96
- type MutableAtomToken<T extends Transceiver<any>, J extends Json.Serializable, K extends Canonical = any> = {
97
- /** The unique identifier of the atom. */
98
- key: string;
99
- /** Discriminator. */
100
- type: `mutable_atom`;
101
- /** Present if the atom belongs to a family. */
102
- family?: FamilyMetadata<K>;
103
- /** Never present. This is a marker that preserves the JSON form of the atom's transceiver value. */
104
- __J?: J;
105
- /** Never present. This is a marker that preserves the type of the atom's transceiver value. */
106
- __U?: T extends Transceiver<infer Update> ? Update : never;
107
- };
108
- /** @public */
109
- type AtomToken<T, K extends Canonical = any> = MutableAtomToken<T extends Transceiver<any> ? T : never, any, K> | RegularAtomToken<T, K>;
110
- /** @public */
111
- type WritableSelectorToken<T, K extends Canonical = any> = {
112
- /** The unique identifier of the selector. */
113
- key: string;
114
- /** Discriminator. */
115
- type: `selector`;
116
- /** Present if the selector belongs to a family. */
117
- family?: FamilyMetadata<K>;
118
- /** Never present. This is a marker that preserves the type of the selector's value. */
119
- __T?: T;
120
- };
121
- /** @public */
122
- type ReadonlySelectorToken<T, K extends Canonical = any> = {
123
- /** The unique identifier of the selector. */
124
- key: string;
125
- /** Discriminator. */
126
- type: `readonly_selector`;
127
- /** Present if the selector belongs to a family. */
128
- family?: FamilyMetadata<K>;
129
- /** Never present. This is a marker that preserves the type of the selector's value. */
130
- __T?: T;
131
- };
132
- /** @public */
133
- type SelectorToken<T, K extends Canonical = any> = ReadonlySelectorToken<T, K> | WritableSelectorToken<T, K>;
134
- /**
135
- * @public
136
- * These states can be set.
137
- */
138
- type WritableToken<T, K extends Canonical = any> = AtomToken<T, K> | WritableSelectorToken<T, K>;
139
- /**
140
- * @public
141
- * These states cannot be set.
142
- */
143
- type ReadableToken<T, K extends Canonical = any> = AtomToken<T, K> | SelectorToken<T, K>;
144
- /**
145
- * @public
146
- * States belonging to this family cannot be set.
147
- */
148
- type ReadableFamilyToken<T, K extends Canonical> = AtomFamilyToken<T, K> | SelectorFamilyToken<T, K>;
149
- /**
150
- * @public
151
- * Identifies a state's connection to its family.
152
- */
153
- type FamilyMetadata<K extends Canonical = any> = {
154
- /** The family's unique key. */
155
- key: string;
156
- /** The family member's unique identifier, in the form of a string. */
157
- subKey: stringified<K>;
158
- };
33
+ declare function usePush<J extends Json.Serializable>(token: AtomIO.WritableToken<J>): <New extends J>(next: New | ((old: J) => New)) => void;
159
34
 
160
- declare function usePullAtom<J extends Json.Serializable>(token: RegularAtomToken<J>): J;
161
-
162
- declare function usePullAtomFamilyMember<J extends Json.Serializable, K extends Canonical, Key extends K>(family: RegularAtomFamilyToken<J, K>, subKey: Key): J;
163
-
164
- declare function usePullMutable<T extends Transceiver<any>, J extends Json.Serializable>(token: MutableAtomToken<T, J>): T;
165
-
166
- declare function usePullMutableAtomFamilyMember<T extends Transceiver<any>, J extends Json.Serializable, K extends Canonical, Key extends K>(familyToken: MutableAtomFamilyToken<T, J, K>, key: Key): T;
167
-
168
- declare function usePullSelector<J extends Json.Serializable>(token: SelectorToken<J>): J;
169
-
170
- declare function usePullSelectorFamilyMember<T, K extends Canonical, Key extends K>(familyToken: SelectorFamilyToken<T, K>, key: Key): T;
171
-
172
- declare function usePush<J extends Json.Serializable>(token: WritableToken<J>): <New extends J>(next: New | ((old: J) => New)) => void;
173
-
174
- declare function useServerAction<F extends Func>(token: TransactionToken<F>): (...parameters: Parameters<F>) => ReturnType<F>;
175
-
176
- type UserKey = `user::${string}`;
177
-
178
- type PerspectiveToken<F extends AtomFamilyToken<any>> = {
179
- type: `realtime_perspective`;
180
- resourceAtoms: F;
181
- viewAtoms: ReadableFamilyToken<ReadableToken<TokenType<F>>[], UserKey>;
182
- };
183
- type ContinuityToken = {
184
- readonly type: `continuity`;
185
- readonly key: string;
186
- readonly globals: AtomToken<any>[];
187
- readonly actions: TransactionToken<any>[];
188
- readonly perspectives: PerspectiveToken<AtomFamilyToken<any, Canonical>>[];
189
- };
35
+ declare function useServerAction<F extends Func>(token: AtomIO.TransactionToken<F>): (...parameters: Parameters<F>) => ReturnType<F>;
190
36
 
191
37
  declare function useSyncContinuity(token: ContinuityToken): void;
192
38
 
@@ -1,6 +1,6 @@
1
- export { RealtimeContext, RealtimeProvider, usePullAtom, usePullAtomFamilyMember, usePullMutable, usePullMutableAtomFamilyMember, usePullSelector, usePullSelectorFamilyMember, usePush, useServerAction, useSyncContinuity } from '../../dist/chunk-354XQWHH.js';
2
- import '../../dist/chunk-Z2UJW4NQ.js';
1
+ export { RealtimeContext, RealtimeProvider, usePullAtom, usePullAtomFamilyMember, usePullMutable, usePullMutableAtomFamilyMember, usePullSelector, usePullSelectorFamilyMember, usePush, useServerAction, useSyncContinuity } from '../../dist/chunk-KVI5OBF2.js';
2
+ import '../../dist/chunk-3ZFTRSNG.js';
3
3
  import '../../dist/chunk-4LWKCEW3.js';
4
- import '../../dist/chunk-5F2V7S3B.js';
5
- import '../../dist/chunk-GY2XQYZY.js';
4
+ import '../../dist/chunk-3PQTWLQQ.js';
5
+ import '../../dist/chunk-UQEYZ3OI.js';
6
6
  import '../../dist/chunk-XWL6SNVU.js';