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.
- package/data/dist/index.cjs +1421 -52
- package/data/dist/index.cjs.map +1 -1
- package/data/dist/index.d.cts +317 -16
- package/data/dist/index.js +10 -267
- package/data/dist/index.js.map +1 -1
- package/data/package.json +5 -5
- package/data/src/join.ts +3 -3
- package/dist/chunk-C4YZZNRH.js +67 -0
- package/dist/chunk-C4YZZNRH.js.map +1 -0
- package/dist/chunk-CWKKQKVQ.js +68 -0
- package/dist/chunk-CWKKQKVQ.js.map +1 -0
- package/dist/chunk-GMN5KH6A.js +309 -0
- package/dist/chunk-GMN5KH6A.js.map +1 -0
- package/dist/chunk-N7ADBQJG.js +176 -0
- package/dist/chunk-N7ADBQJG.js.map +1 -0
- package/dist/chunk-NYCVSXQB.js +181 -0
- package/dist/chunk-NYCVSXQB.js.map +1 -0
- package/dist/chunk-PURABO5G.js +2581 -0
- package/dist/chunk-PURABO5G.js.map +1 -0
- package/dist/index.cjs +2330 -55
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +272 -22
- package/dist/index.js +1 -152
- package/dist/index.js.map +1 -1
- package/dist/metafile-cjs.json +1 -1
- package/internal/dist/index.cjs +299 -106
- package/internal/dist/index.cjs.map +1 -1
- package/internal/dist/index.d.cts +231 -30
- package/internal/dist/index.js +1 -2240
- package/internal/dist/index.js.map +1 -1
- package/internal/package.json +5 -5
- package/internal/src/atom/create-atom.ts +3 -1
- package/internal/src/families/create-atom-family.ts +3 -4
- package/internal/src/mutable/get-update-family.ts +23 -0
- package/internal/src/mutable/index.ts +1 -4
- package/internal/src/mutable/is-mutable.ts +44 -0
- package/internal/src/mutable/tracker.ts +9 -2
- package/internal/src/subject.ts +2 -1
- package/internal/src/timeline/add-atom-to-timeline.ts +10 -1
- package/internal/src/timeline/create-timeline.ts +44 -16
- package/introspection/dist/index.cjs +1566 -46
- package/introspection/dist/index.cjs.map +1 -1
- package/introspection/dist/index.d.cts +376 -4
- package/introspection/dist/index.js +2 -316
- package/introspection/dist/index.js.map +1 -1
- package/introspection/package.json +5 -5
- package/json/dist/index.cjs +1505 -8
- package/json/dist/index.cjs.map +1 -1
- package/json/dist/index.d.cts +373 -7
- package/json/dist/index.js +1 -76
- package/json/dist/index.js.map +1 -1
- package/json/package.json +5 -5
- package/package.json +5 -4
- package/react/dist/index.cjs +1549 -14
- package/react/dist/index.cjs.map +1 -1
- package/react/dist/index.d.cts +377 -4
- package/react/dist/index.js +2 -68
- package/react/dist/index.js.map +1 -1
- package/react/package.json +5 -5
- package/react-devtools/dist/index.cjs +2216 -198
- package/react-devtools/dist/index.cjs.map +1 -1
- package/react-devtools/dist/index.css +2 -2
- package/react-devtools/dist/index.d.cts +150 -24
- package/react-devtools/dist/index.js +57 -297
- package/react-devtools/dist/index.js.map +1 -1
- package/react-devtools/package.json +5 -5
- package/realtime-client/dist/index.cjs +1530 -35
- package/realtime-client/dist/index.cjs.map +1 -1
- package/realtime-client/dist/index.d.cts +384 -12
- package/realtime-client/dist/index.js +2 -165
- package/realtime-client/dist/index.js.map +1 -1
- package/realtime-client/package.json +5 -5
- package/realtime-react/dist/index.cjs +1727 -35
- package/realtime-react/dist/index.cjs.map +1 -1
- package/realtime-react/dist/index.d.cts +49 -9
- package/realtime-react/dist/index.js +4 -66
- package/realtime-react/dist/index.js.map +1 -1
- package/realtime-react/package.json +5 -5
- package/realtime-server/dist/index.cjs +1549 -58
- package/realtime-server/dist/index.cjs.map +1 -1
- package/realtime-server/dist/index.d.cts +394 -11
- package/realtime-server/dist/index.js +27 -21
- package/realtime-server/dist/index.js.map +1 -1
- package/realtime-server/package.json +6 -6
- package/realtime-testing/dist/index.cjs +2377 -16
- package/realtime-testing/dist/index.cjs.map +1 -1
- package/realtime-testing/dist/index.d.cts +489 -3
- package/realtime-testing/dist/index.js +10 -31
- package/realtime-testing/dist/index.js.map +1 -1
- package/realtime-testing/package.json +5 -5
- package/src/atom.ts +3 -1
- package/transceivers/set-rtx/dist/index.cjs +32 -10
- package/transceivers/set-rtx/dist/index.cjs.map +1 -1
- package/transceivers/set-rtx/dist/index.d.cts +29 -3
- package/transceivers/set-rtx/dist/index.js +2 -3
- package/transceivers/set-rtx/dist/index.js.map +1 -1
- package/transceivers/set-rtx/package.json +6 -6
- package/data/dist/index.d.ts +0 -158
- package/data/dist/metafile-cjs.json +0 -1
- package/data/dist/metafile-esm.json +0 -1
- package/dist/index.d.ts +0 -243
- package/dist/metafile-esm.json +0 -1
- package/internal/dist/index.d.ts +0 -421
- package/internal/dist/metafile-cjs.json +0 -1
- package/internal/dist/metafile-esm.json +0 -1
- package/internal/src/mutable/is-atom-token-mutable.ts +0 -7
- package/introspection/dist/index.d.ts +0 -24
- package/introspection/dist/metafile-cjs.json +0 -1
- package/introspection/dist/metafile-esm.json +0 -1
- package/json/dist/index.d.ts +0 -51
- package/json/dist/metafile-cjs.json +0 -1
- package/json/dist/metafile-esm.json +0 -1
- package/react/dist/index.d.ts +0 -23
- package/react/dist/metafile-cjs.json +0 -1
- package/react/dist/metafile-esm.json +0 -1
- package/react-devtools/dist/index.d.ts +0 -341
- package/react-devtools/dist/metafile-cjs.json +0 -1
- package/react-devtools/dist/metafile-esm.json +0 -1
- package/realtime-client/dist/index.d.ts +0 -22
- package/realtime-client/dist/metafile-cjs.json +0 -1
- package/realtime-client/dist/metafile-esm.json +0 -1
- package/realtime-react/dist/index.d.ts +0 -27
- package/realtime-react/dist/metafile-cjs.json +0 -1
- package/realtime-react/dist/metafile-esm.json +0 -1
- package/realtime-server/dist/index.d.ts +0 -25
- package/realtime-server/dist/metafile-cjs.json +0 -1
- package/realtime-server/dist/metafile-esm.json +0 -1
- package/realtime-testing/dist/index.d.ts +0 -49
- package/realtime-testing/dist/metafile-cjs.json +0 -1
- package/realtime-testing/dist/metafile-esm.json +0 -1
- package/transceivers/set-rtx/dist/index.d.ts +0 -40
- package/transceivers/set-rtx/dist/metafile-cjs.json +0 -1
- package/transceivers/set-rtx/dist/metafile-esm.json +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*
|
|
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
|
|
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,
|
|
301
|
+
mutableState: MutableAtomToken<Mutable, Serializable>;
|
|
177
302
|
latestUpdateState: AtomToken<typeof this.Update | null>;
|
|
178
|
-
constructor(mutableState: MutableAtomToken<Mutable,
|
|
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:
|
|
311
|
-
declare const selectorIndex:
|
|
312
|
-
declare const transactionIndex:
|
|
313
|
-
declare const findTransactionLogState:
|
|
314
|
-
declare const timelineIndex:
|
|
315
|
-
declare const findTimelineState:
|
|
316
|
-
declare const devtoolsAreOpenState:
|
|
436
|
+
declare const atomIndex: ReadonlySelectorToken<AtomTokenIndex>;
|
|
437
|
+
declare const selectorIndex: ReadonlySelectorToken<SelectorTokenIndex>;
|
|
438
|
+
declare const transactionIndex: ReadonlySelectorToken<TransactionToken<ƒn>[]>;
|
|
439
|
+
declare const findTransactionLogState: ReadonlySelectorFamily<TransactionUpdate<ƒn>[]>;
|
|
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:
|
|
319
|
-
declare const devtoolsViewOptionsState:
|
|
320
|
-
declare const findViewIsOpenState:
|
|
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;
|