atom.io 0.14.0 → 0.14.2

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 (133) hide show
  1. package/data/dist/index.cjs +1421 -52
  2. package/data/dist/index.cjs.map +1 -1
  3. package/data/dist/index.d.cts +317 -16
  4. package/data/dist/index.js +10 -267
  5. package/data/dist/index.js.map +1 -1
  6. package/data/package.json +5 -5
  7. package/data/src/join.ts +3 -3
  8. package/dist/chunk-C4YZZNRH.js +67 -0
  9. package/dist/chunk-C4YZZNRH.js.map +1 -0
  10. package/dist/chunk-CWKKQKVQ.js +68 -0
  11. package/dist/chunk-CWKKQKVQ.js.map +1 -0
  12. package/dist/chunk-GMN5KH6A.js +309 -0
  13. package/dist/chunk-GMN5KH6A.js.map +1 -0
  14. package/dist/chunk-N7ADBQJG.js +176 -0
  15. package/dist/chunk-N7ADBQJG.js.map +1 -0
  16. package/dist/chunk-NYCVSXQB.js +181 -0
  17. package/dist/chunk-NYCVSXQB.js.map +1 -0
  18. package/dist/chunk-PURABO5G.js +2581 -0
  19. package/dist/chunk-PURABO5G.js.map +1 -0
  20. package/dist/index.cjs +2330 -55
  21. package/dist/index.cjs.map +1 -1
  22. package/dist/index.d.cts +272 -22
  23. package/dist/index.js +1 -152
  24. package/dist/index.js.map +1 -1
  25. package/dist/metafile-cjs.json +1 -1
  26. package/internal/dist/index.cjs +299 -106
  27. package/internal/dist/index.cjs.map +1 -1
  28. package/internal/dist/index.d.cts +231 -30
  29. package/internal/dist/index.js +1 -2240
  30. package/internal/dist/index.js.map +1 -1
  31. package/internal/package.json +5 -5
  32. package/internal/src/atom/create-atom.ts +3 -1
  33. package/internal/src/families/create-atom-family.ts +3 -4
  34. package/internal/src/mutable/get-update-family.ts +23 -0
  35. package/internal/src/mutable/index.ts +1 -4
  36. package/internal/src/mutable/is-mutable.ts +44 -0
  37. package/internal/src/mutable/tracker.ts +9 -2
  38. package/internal/src/subject.ts +2 -1
  39. package/internal/src/timeline/add-atom-to-timeline.ts +10 -1
  40. package/internal/src/timeline/create-timeline.ts +44 -16
  41. package/introspection/dist/index.cjs +1566 -46
  42. package/introspection/dist/index.cjs.map +1 -1
  43. package/introspection/dist/index.d.cts +376 -4
  44. package/introspection/dist/index.js +2 -316
  45. package/introspection/dist/index.js.map +1 -1
  46. package/introspection/package.json +5 -5
  47. package/json/dist/index.cjs +1505 -8
  48. package/json/dist/index.cjs.map +1 -1
  49. package/json/dist/index.d.cts +373 -7
  50. package/json/dist/index.js +1 -76
  51. package/json/dist/index.js.map +1 -1
  52. package/json/package.json +5 -5
  53. package/package.json +5 -4
  54. package/react/dist/index.cjs +1549 -14
  55. package/react/dist/index.cjs.map +1 -1
  56. package/react/dist/index.d.cts +377 -4
  57. package/react/dist/index.js +2 -68
  58. package/react/dist/index.js.map +1 -1
  59. package/react/package.json +5 -5
  60. package/react-devtools/dist/index.cjs +2216 -198
  61. package/react-devtools/dist/index.cjs.map +1 -1
  62. package/react-devtools/dist/index.css +2 -2
  63. package/react-devtools/dist/index.d.cts +150 -24
  64. package/react-devtools/dist/index.js +57 -297
  65. package/react-devtools/dist/index.js.map +1 -1
  66. package/react-devtools/package.json +5 -5
  67. package/realtime-client/dist/index.cjs +1530 -35
  68. package/realtime-client/dist/index.cjs.map +1 -1
  69. package/realtime-client/dist/index.d.cts +384 -12
  70. package/realtime-client/dist/index.js +2 -165
  71. package/realtime-client/dist/index.js.map +1 -1
  72. package/realtime-client/package.json +5 -5
  73. package/realtime-react/dist/index.cjs +1727 -35
  74. package/realtime-react/dist/index.cjs.map +1 -1
  75. package/realtime-react/dist/index.d.cts +49 -9
  76. package/realtime-react/dist/index.js +4 -66
  77. package/realtime-react/dist/index.js.map +1 -1
  78. package/realtime-react/package.json +5 -5
  79. package/realtime-server/dist/index.cjs +1549 -58
  80. package/realtime-server/dist/index.cjs.map +1 -1
  81. package/realtime-server/dist/index.d.cts +394 -11
  82. package/realtime-server/dist/index.js +27 -21
  83. package/realtime-server/dist/index.js.map +1 -1
  84. package/realtime-server/package.json +6 -6
  85. package/realtime-testing/dist/index.cjs +2377 -16
  86. package/realtime-testing/dist/index.cjs.map +1 -1
  87. package/realtime-testing/dist/index.d.cts +489 -3
  88. package/realtime-testing/dist/index.js +10 -31
  89. package/realtime-testing/dist/index.js.map +1 -1
  90. package/realtime-testing/package.json +5 -5
  91. package/src/atom.ts +3 -1
  92. package/transceivers/set-rtx/dist/index.cjs +32 -10
  93. package/transceivers/set-rtx/dist/index.cjs.map +1 -1
  94. package/transceivers/set-rtx/dist/index.d.cts +29 -3
  95. package/transceivers/set-rtx/dist/index.js +2 -3
  96. package/transceivers/set-rtx/dist/index.js.map +1 -1
  97. package/transceivers/set-rtx/package.json +6 -6
  98. package/data/dist/index.d.ts +0 -158
  99. package/data/dist/metafile-cjs.json +0 -1
  100. package/data/dist/metafile-esm.json +0 -1
  101. package/dist/index.d.ts +0 -243
  102. package/dist/metafile-esm.json +0 -1
  103. package/internal/dist/index.d.ts +0 -421
  104. package/internal/dist/metafile-cjs.json +0 -1
  105. package/internal/dist/metafile-esm.json +0 -1
  106. package/internal/src/mutable/is-atom-token-mutable.ts +0 -7
  107. package/introspection/dist/index.d.ts +0 -24
  108. package/introspection/dist/metafile-cjs.json +0 -1
  109. package/introspection/dist/metafile-esm.json +0 -1
  110. package/json/dist/index.d.ts +0 -51
  111. package/json/dist/metafile-cjs.json +0 -1
  112. package/json/dist/metafile-esm.json +0 -1
  113. package/react/dist/index.d.ts +0 -23
  114. package/react/dist/metafile-cjs.json +0 -1
  115. package/react/dist/metafile-esm.json +0 -1
  116. package/react-devtools/dist/index.d.ts +0 -341
  117. package/react-devtools/dist/metafile-cjs.json +0 -1
  118. package/react-devtools/dist/metafile-esm.json +0 -1
  119. package/realtime-client/dist/index.d.ts +0 -22
  120. package/realtime-client/dist/metafile-cjs.json +0 -1
  121. package/realtime-client/dist/metafile-esm.json +0 -1
  122. package/realtime-react/dist/index.d.ts +0 -27
  123. package/realtime-react/dist/metafile-cjs.json +0 -1
  124. package/realtime-react/dist/metafile-esm.json +0 -1
  125. package/realtime-server/dist/index.d.ts +0 -25
  126. package/realtime-server/dist/metafile-cjs.json +0 -1
  127. package/realtime-server/dist/metafile-esm.json +0 -1
  128. package/realtime-testing/dist/index.d.ts +0 -49
  129. package/realtime-testing/dist/metafile-cjs.json +0 -1
  130. package/realtime-testing/dist/metafile-esm.json +0 -1
  131. package/transceivers/set-rtx/dist/index.d.ts +0 -40
  132. package/transceivers/set-rtx/dist/metafile-cjs.json +0 -1
  133. package/transceivers/set-rtx/dist/metafile-esm.json +0 -1
@@ -1,4 +1,4 @@
1
- /* ../../hamr/src/react-data-designer/RelationEditor.module.scss */
1
+ /* ../hamr/src/react-data-designer/RelationEditor.module.scss */
2
2
  .class {
3
3
  display: flex;
4
4
  flex-flow: row wrap;
@@ -16,7 +16,7 @@
16
16
  }
17
17
  }
18
18
 
19
- /* src/devtools.scss */
19
+ /* react-devtools/src/devtools.scss */
20
20
  main.atom_io_devtools {
21
21
  --fg-color: #eee;
22
22
  --bg-color: #111;
@@ -1,7 +1,3 @@
1
- import * as atom_io from 'atom.io';
2
- import { FamilyMetadata, ƒn, TransactionUpdate, MutableAtomToken, AtomToken, StateToken, TimelineUpdate, StateUpdate, AtomFamily, ReadonlySelectorFamily, SelectorFamily, ReadonlySelectorToken, SelectorToken, TransactionToken, TimelineToken, AtomIOLogger, Logger } from 'atom.io';
3
- import { Json } from 'atom.io/json';
4
-
5
1
  type ClassSignature = abstract new (...args: any) => any;
6
2
 
7
3
  type RefinementStrategy = ClassSignature | Refinement$1<unknown, any>;
@@ -24,6 +20,142 @@ interface Refinement$1<A, B extends A> {
24
20
 
25
21
  type PlainObject = Record<keyof any, unknown>;
26
22
 
23
+ type primitive = boolean | number | string | null;
24
+
25
+ type Serializable = primitive | Readonly<{
26
+ [key: string]: Serializable;
27
+ }> | ReadonlyArray<Serializable>;
28
+ type Object$1<Key extends string = string, Value extends Serializable = Serializable> = Record<Key, Value>;
29
+
30
+ type AtomFamily<T, K extends Serializable = Serializable> = ((key: K) => AtomToken<T>) & {
31
+ key: string;
32
+ type: `atom_family`;
33
+ subject: Subject<AtomToken<T>>;
34
+ mutable?: boolean;
35
+ };
36
+
37
+ declare const LoggerIconDictionary: {
38
+ readonly "\u231B": "Timeline event fully captured";
39
+ readonly "\u23E9": "Timeline redo";
40
+ readonly "\u23EA": "Timeline undo";
41
+ readonly "\u23ED\uFE0F": "Transaction redo";
42
+ readonly "\u23EE\uFE0F": "Transaction undo";
43
+ readonly "\u23F3": "Timeline event partially captured";
44
+ readonly "\u23F9\uFE0F": "Time-travel complete";
45
+ readonly "\uD83D\uDC81": "Notice";
46
+ readonly "\uD83D\uDD04": "Realtime transaction synchronized";
47
+ readonly "\u2705": "Realtime transaction success";
48
+ readonly "\u2728": "Computation complete";
49
+ readonly "\u274C": "Conflict prevents attempted action";
50
+ readonly "\u2B55": "Operation start";
51
+ readonly "\uD83D\uDC1E": "Possible bug in AtomIO";
52
+ readonly "\uD83D\uDC40": "Subscription added";
53
+ readonly "\uD83D\uDC6A": "Family member added";
54
+ readonly "\uD83D\uDCC1": "Stow update";
55
+ readonly "\uD83D\uDCC3": "Copy mutable";
56
+ readonly "\uD83D\uDCD6": "Read state";
57
+ readonly "\uD83D\uDCDD": "Write state";
58
+ readonly "\uD83D\uDCE2": "Notify subscribers";
59
+ readonly "\uD83D\uDD0C": "Register dependency";
60
+ readonly "\uD83D\uDD0D": "Discover root";
61
+ readonly "\uD83D\uDD25": "Delete state";
62
+ readonly "\uD83D\uDD27": "Create mutable atom";
63
+ readonly "\uD83D\uDD28": "Create immutable atom";
64
+ readonly "\uD83D\uDD34": "Operation complete";
65
+ readonly "\uD83D\uDDD1": "Evict cached value";
66
+ readonly "\uD83D\uDCA5": "Caught";
67
+ readonly "\uD83D\uDE48": "Subscription canceled";
68
+ readonly "\uD83D\uDEC4": "Apply transaction";
69
+ readonly "\uD83D\uDEE0\uFE0F": "Install atom into store";
70
+ readonly "\uD83D\uDEEB": "Begin transaction";
71
+ readonly "\uD83D\uDEEC": "Complete transaction";
72
+ readonly "\uD83E\uDDEE": "Computing selector";
73
+ readonly "\uD83E\uDDF9": "Prepare to evict";
74
+ readonly "\uD83E\uDE82": "Abort transaction";
75
+ };
76
+ type LoggerIcon = keyof typeof LoggerIconDictionary;
77
+ declare const LOG_LEVELS: readonly ["info", "warn", "error"];
78
+ type LogLevel = (typeof LOG_LEVELS)[number];
79
+ type LogFn = (icon: LoggerIcon, tokenType: `atom` | `readonly_selector` | `selector` | `state` | `timeline` | `transaction` | `unknown`, tokenKey: string, message: string, ...rest: unknown[]) => void;
80
+ type LogFilter = (...params: Parameters<LogFn>) => boolean;
81
+ type Logger = Record<LogLevel, LogFn>;
82
+ declare class AtomIOLogger implements Logger {
83
+ logLevel: `error` | `info` | `warn` | null;
84
+ private readonly filter?;
85
+ private readonly logger;
86
+ constructor(logLevel: `error` | `info` | `warn` | null, filter?: LogFilter | undefined, logger?: Logger);
87
+ error: LogFn;
88
+ info: LogFn;
89
+ warn: LogFn;
90
+ }
91
+
92
+ type TransactionToken<_> = {
93
+ key: string;
94
+ type: `transaction`;
95
+ __brand?: _;
96
+ };
97
+ type TransactionUpdate<ƒ extends ƒn> = {
98
+ key: string;
99
+ updates: (KeyedStateUpdate<unknown> | TransactionUpdate<ƒn>)[];
100
+ params: Parameters<ƒ>;
101
+ output: ReturnType<ƒ>;
102
+ };
103
+
104
+ type SelectorFamily<T, K extends Serializable = Serializable> = ((key: K) => SelectorToken<T>) & {
105
+ key: string;
106
+ type: `selector_family`;
107
+ subject: Subject<SelectorToken<T>>;
108
+ };
109
+ type ReadonlySelectorFamily<T, K extends Serializable = Serializable> = ((key: K) => ReadonlySelectorToken<T>) & {
110
+ key: string;
111
+ type: `readonly_selector_family`;
112
+ subject: Subject<ReadonlySelectorToken<T>>;
113
+ };
114
+
115
+ type StateUpdate<T> = {
116
+ newValue: T;
117
+ oldValue: T;
118
+ };
119
+ type KeyedStateUpdate<T> = StateUpdate<T> & {
120
+ key: string;
121
+ family?: FamilyMetadata;
122
+ };
123
+
124
+ type TimelineToken = {
125
+ key: string;
126
+ type: `timeline`;
127
+ };
128
+ type TimelineUpdate = TimelineAtomUpdate | TimelineSelectorUpdate | TimelineTransactionUpdate;
129
+
130
+ type ƒn = (...parameters: any[]) => any;
131
+ type AtomToken<_> = {
132
+ key: string;
133
+ type: `atom`;
134
+ family?: FamilyMetadata;
135
+ __brand?: _;
136
+ };
137
+ interface MutableAtomToken<T extends Transceiver<any>, J extends Serializable> extends AtomToken<T> {
138
+ __asJSON?: J;
139
+ __update?: T extends Transceiver<infer Update> ? Update : never;
140
+ }
141
+ type SelectorToken<_> = {
142
+ key: string;
143
+ type: `selector`;
144
+ family?: FamilyMetadata;
145
+ __brand?: _;
146
+ };
147
+ type StateToken<T> = AtomToken<T> | SelectorToken<T>;
148
+ type ReadonlySelectorToken<_> = {
149
+ key: string;
150
+ type: `readonly_selector`;
151
+ family?: FamilyMetadata;
152
+ __brand?: _;
153
+ };
154
+ type FamilyMetadata = {
155
+ key: string;
156
+ subKey: string;
157
+ };
158
+
27
159
  declare class Subject<T> {
28
160
  Subscriber: (value: T) => void;
29
161
  subscribers: Map<string, this[`Subscriber`]>;
@@ -75,13 +207,6 @@ type TransactionMeta<ƒ extends ƒn> = {
75
207
  update: TransactionUpdate<ƒ>;
76
208
  };
77
209
 
78
- type primitive = boolean | number | string | null;
79
-
80
- type Serializable = primitive | Readonly<{
81
- [key: string]: Serializable;
82
- }> | ReadonlyArray<Serializable>;
83
- type Object$1<Key extends string = string, Value extends Serializable = Serializable> = Record<Key, Value>;
84
-
85
210
  type Refinement<Unrefined, Refined extends Unrefined> = (value: Unrefined) => value is Refined;
86
211
  type Cardinality = `1:1` | `1:n` | `n:n`;
87
212
 
@@ -154,7 +279,7 @@ interface Lineage {
154
279
  child: typeof this | null;
155
280
  }
156
281
 
157
- interface Transceiver<Signal extends Json.Serializable> {
282
+ interface Transceiver<Signal extends Serializable> {
158
283
  do: (update: Signal) => void;
159
284
  undo: (update: Signal) => void;
160
285
  subscribe: (key: string, fn: (update: Signal) => void) => () => void;
@@ -173,9 +298,9 @@ declare class Tracker<Mutable extends Transceiver<any>> {
173
298
  private unsubscribeFromInnerValue;
174
299
  private observeCore;
175
300
  private updateCore;
176
- mutableState: MutableAtomToken<Mutable, Json.Serializable>;
301
+ mutableState: MutableAtomToken<Mutable, Serializable>;
177
302
  latestUpdateState: AtomToken<typeof this.Update | null>;
178
- constructor(mutableState: MutableAtomToken<Mutable, Json.Serializable>, store: Store);
303
+ constructor(mutableState: MutableAtomToken<Mutable, Serializable>, store: Store);
179
304
  }
180
305
 
181
306
  interface MutableAtom<T> extends Atom<T> {
@@ -260,6 +385,7 @@ declare class Store implements Lineage {
260
385
  type Atom<T> = {
261
386
  key: string;
262
387
  type: `atom`;
388
+ mutable?: boolean;
263
389
  family?: FamilyMetadata;
264
390
  install: (store: Store) => void;
265
391
  subject: Subject<{
@@ -307,17 +433,17 @@ declare class Differ<Leaf extends Record<string, any>, Tree extends Record<strin
307
433
 
308
434
  declare const AtomIODevtools: () => JSX.Element;
309
435
 
310
- declare const atomIndex: atom_io.ReadonlySelectorToken<AtomTokenIndex>;
311
- declare const selectorIndex: atom_io.ReadonlySelectorToken<SelectorTokenIndex>;
312
- declare const transactionIndex: atom_io.ReadonlySelectorToken<atom_io.TransactionToken<atom_io.ƒn>[]>;
313
- declare const findTransactionLogState: atom_io.ReadonlySelectorFamily<atom_io.TransactionUpdate<atom_io.ƒn>[]>;
314
- declare const timelineIndex: atom_io.ReadonlySelectorToken<atom_io.TimelineToken[]>;
315
- declare const findTimelineState: atom_io.ReadonlySelectorFamily<Timeline>;
316
- declare const devtoolsAreOpenState: atom_io.AtomToken<boolean>;
436
+ declare const atomIndex: ReadonlySelectorToken<AtomTokenIndex>;
437
+ declare const selectorIndex: ReadonlySelectorToken<SelectorTokenIndex>;
438
+ declare const transactionIndex: ReadonlySelectorToken<TransactionTokenn>[]>;
439
+ declare const findTransactionLogState: ReadonlySelectorFamily<TransactionUpdaten>[]>;
440
+ declare const timelineIndex: ReadonlySelectorToken<TimelineToken[]>;
441
+ declare const findTimelineState: ReadonlySelectorFamily<Timeline>;
442
+ declare const devtoolsAreOpenState: AtomToken<boolean>;
317
443
  type DevtoolsView = `atoms` | `selectors` | `timelines` | `transactions`;
318
- declare const devtoolsViewSelectionState: atom_io.AtomToken<DevtoolsView>;
319
- declare const devtoolsViewOptionsState: atom_io.AtomToken<DevtoolsView[]>;
320
- declare const findViewIsOpenState: atom_io.AtomFamily<boolean, string>;
444
+ declare const devtoolsViewSelectionState: AtomToken<DevtoolsView>;
445
+ declare const devtoolsViewOptionsState: AtomToken<DevtoolsView[]>;
446
+ declare const findViewIsOpenState: AtomFamily<boolean, string>;
321
447
  declare const primitiveRefinery: Refinery<{
322
448
  number: (input: unknown) => input is number;
323
449
  string: (input: unknown) => input is string;