atom.io 0.32.0 → 0.32.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.d.ts +8 -925
- package/data/dist/index.js +2 -2
- package/dist/{chunk-5F2V7S3B.js → chunk-HEEVASKG.js} +1 -1
- package/dist/{chunk-ECOMOMUN.js → chunk-KMBRCA5Q.js} +20 -19
- package/dist/{chunk-R3ZUK5EH.js → chunk-NDTM5IY3.js} +22 -11
- package/dist/{chunk-354XQWHH.js → chunk-QRPY4LSO.js} +5 -5
- package/dist/{chunk-GY2XQYZY.js → chunk-RXQWAO26.js} +50 -41
- package/dist/{chunk-Z2UJW4NQ.js → chunk-XN3EO2UT.js} +3 -3
- package/dist/{chunk-NF7FJKJD.js → chunk-YPME5OLO.js} +6 -4
- package/dist/index.d.ts +45 -516
- package/dist/index.js +1 -1
- package/eslint-plugin/dist/index.js +3 -3
- package/eslint-plugin/src/rules/explicit-state-types.ts +1 -0
- package/eslint-plugin/src/rules/synchronous-selector-dependencies.ts +1 -0
- package/eslint-plugin/src/walk.ts +1 -0
- package/internal/dist/index.d.ts +9 -657
- package/internal/dist/index.js +1 -1
- package/internal/src/join/join-internal.ts +1 -1
- package/internal/src/junction.ts +7 -4
- package/internal/src/lazy-map.ts +3 -1
- package/internal/src/set-state/emit-update.ts +3 -1
- package/internal/src/timeline/create-timeline.ts +2 -1
- package/internal/src/timeline/time-travel.ts +2 -1
- package/introspection/dist/index.d.ts +6 -922
- package/introspection/dist/index.js +2 -2
- package/introspection/src/auditor.ts +3 -3
- package/json/dist/index.d.ts +5 -899
- package/json/dist/index.js +1 -1
- package/package.json +10 -10
- package/react/dist/index.d.ts +3 -921
- package/react/dist/index.js +2 -2
- package/react-devtools/dist/index.d.ts +1 -26
- package/react-devtools/dist/index.js +28 -15
- package/react-devtools/src/Updates.tsx +12 -0
- package/react-devtools/src/json-editor/editors-by-type/utilities/cast-to-json.ts +2 -1
- package/realtime/dist/index.d.ts +8 -203
- package/realtime/dist/index.js +2 -2
- package/realtime/src/realtime-continuity.ts +5 -1
- package/realtime-client/dist/index.d.ts +21 -959
- package/realtime-client/dist/index.js +2 -2
- package/realtime-react/dist/index.d.ts +12 -166
- package/realtime-react/dist/index.js +4 -4
- package/realtime-server/dist/index.d.ts +27 -972
- package/realtime-server/dist/index.js +3 -3
- package/realtime-server/src/ipc-sockets/child-socket.ts +2 -0
- package/realtime-server/src/ipc-sockets/custom-socket.ts +6 -1
- package/realtime-server/src/realtime-server-stores/server-sync-store.ts +10 -2
- package/realtime-testing/dist/index.d.ts +3 -1091
- package/realtime-testing/dist/index.js +7 -7
- package/src/logger.ts +12 -4
- package/transceivers/set-rtx/dist/index.d.ts +6 -40
- package/transceivers/set-rtx/dist/index.js +1 -1
- package/transceivers/set-rtx/src/set-rtx.ts +4 -7
- package/web/dist/index.d.ts +1 -30
- package/react-devtools/src/json-editor/assets/Untitled-1.ai +2 -1436
- package/react-devtools/src/json-editor/assets/data-vis.ai +1 -1548
- package/react-devtools/src/json-editor/comp/json-editor-sketches.ai +5 -1449
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { RealtimeProvider } from '../../dist/chunk-
|
|
2
|
-
import { myUsernameState } from '../../dist/chunk-
|
|
3
|
-
import { socketAtoms, usersOfSockets, userIndex, socketIndex, roomSelectors } from '../../dist/chunk-
|
|
4
|
-
import { roomIndex } from '../../dist/chunk-
|
|
1
|
+
import { RealtimeProvider } from '../../dist/chunk-QRPY4LSO.js';
|
|
2
|
+
import { myUsernameState } from '../../dist/chunk-XN3EO2UT.js';
|
|
3
|
+
import { socketAtoms, usersOfSockets, userIndex, socketIndex, roomSelectors } from '../../dist/chunk-NDTM5IY3.js';
|
|
4
|
+
import { roomIndex } from '../../dist/chunk-YPME5OLO.js';
|
|
5
5
|
import '../../dist/chunk-4LWKCEW3.js';
|
|
6
|
-
import { StoreProvider } from '../../dist/chunk-
|
|
7
|
-
import { Silo, IMPLICIT, Realm, findInStore, setIntoStore, editRelationsInStore, toEntries, findRelationsInStore, getFromStore,
|
|
6
|
+
import { StoreProvider } from '../../dist/chunk-HEEVASKG.js';
|
|
7
|
+
import { Silo, IMPLICIT, Realm, findInStore, setIntoStore, editRelationsInStore, toEntries, findRelationsInStore, getFromStore, clearStore, AtomIOLogger } from '../../dist/chunk-RXQWAO26.js';
|
|
8
8
|
import '../../dist/chunk-XWL6SNVU.js';
|
|
9
9
|
import * as http from 'node:http';
|
|
10
10
|
import { render, prettyDOM } from '@testing-library/react';
|
|
@@ -15,7 +15,7 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
15
15
|
|
|
16
16
|
var testNumber = 0;
|
|
17
17
|
function prefixLogger(store, prefix) {
|
|
18
|
-
store.loggers[0] = new AtomIOLogger(`info`,
|
|
18
|
+
store.loggers[0] = new AtomIOLogger(`info`, void 0, {
|
|
19
19
|
info: (...args) => {
|
|
20
20
|
console.info(prefix, ...args);
|
|
21
21
|
},
|
package/src/logger.ts
CHANGED
|
@@ -98,11 +98,19 @@ export const simpleLogger: Logger = {
|
|
|
98
98
|
}
|
|
99
99
|
|
|
100
100
|
export class AtomIOLogger implements Logger {
|
|
101
|
+
public logLevel: `error` | `info` | `warn` | null
|
|
102
|
+
private readonly filter: LogFilter | undefined
|
|
103
|
+
private readonly logger: Logger
|
|
104
|
+
|
|
101
105
|
public constructor(
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
) {
|
|
106
|
+
logLevel: `error` | `info` | `warn` | null,
|
|
107
|
+
filter?: LogFilter,
|
|
108
|
+
logger: Logger = simpleLogger,
|
|
109
|
+
) {
|
|
110
|
+
this.logLevel = logLevel
|
|
111
|
+
this.filter = filter
|
|
112
|
+
this.logger = logger
|
|
113
|
+
}
|
|
106
114
|
|
|
107
115
|
public error: LogFn = (...args) => {
|
|
108
116
|
if ((this.filter?.(...args) ?? true) && this.logLevel !== null) {
|
|
@@ -1,42 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
namespace Tree {
|
|
4
|
-
type Array<Element = unknown> = ReadonlyArray<Element>;
|
|
5
|
-
type Object<K extends string = string, V = unknown> = Record<K, V>;
|
|
6
|
-
type Fork = Array | Object;
|
|
7
|
-
type Leaf = primitive;
|
|
8
|
-
type Node = Fork | Leaf;
|
|
9
|
-
}
|
|
10
|
-
type Serializable = primitive | Readonly<{
|
|
11
|
-
[key: string]: Serializable;
|
|
12
|
-
}> | ReadonlyArray<Serializable>;
|
|
13
|
-
type Object<Key extends string = string, Value extends Serializable = Serializable> = Record<Key, Value>;
|
|
14
|
-
type Array<Element extends Serializable = Serializable> = ReadonlyArray<Element>;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
declare class Subject<T> {
|
|
18
|
-
Subscriber: (value: T) => void;
|
|
19
|
-
subscribers: Map<string, this[`Subscriber`]>;
|
|
20
|
-
subscribe(key: string, subscriber: this[`Subscriber`]): () => void;
|
|
21
|
-
private unsubscribe;
|
|
22
|
-
next(value: T): void;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
interface Lineage {
|
|
26
|
-
parent: typeof this | null;
|
|
27
|
-
child: typeof this | null;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
interface Transceiver<S extends Json.Serializable> {
|
|
31
|
-
do: (update: S) => number | `OUT_OF_RANGE` | null;
|
|
32
|
-
undo: (update: S) => void;
|
|
33
|
-
subscribe: (key: string, fn: (update: S) => void) => () => void;
|
|
34
|
-
cacheUpdateNumber: number;
|
|
35
|
-
getUpdateNumber: (update: S) => number;
|
|
36
|
-
}
|
|
37
|
-
type TransceiverMode = `playback` | `record` | `transaction`;
|
|
1
|
+
import { Transceiver, Lineage, TransceiverMode, Subject } from 'atom.io/internal';
|
|
2
|
+
import { primitive, Json } from 'atom.io/json';
|
|
38
3
|
|
|
39
|
-
type
|
|
4
|
+
type SetUpdateType = `add` | `clear` | `del` | `tx`;
|
|
5
|
+
type SetUpdate = `${SetUpdateType}:${string}`;
|
|
40
6
|
type NumberedSetUpdate = `${number}=${SetUpdate}`;
|
|
41
7
|
interface SetRTXJson<P extends primitive> extends Json.Object {
|
|
42
8
|
members: P[];
|
|
@@ -47,7 +13,7 @@ interface SetRTXJson<P extends primitive> extends Json.Object {
|
|
|
47
13
|
}
|
|
48
14
|
declare class SetRTX<P extends primitive> extends Set<P> implements Transceiver<NumberedSetUpdate>, Lineage {
|
|
49
15
|
mode: TransceiverMode;
|
|
50
|
-
readonly subject: Subject
|
|
16
|
+
readonly subject: Subject<`add:${string}` | `clear:${string}` | `del:${string}` | `tx:${string}`>;
|
|
51
17
|
cacheLimit: number;
|
|
52
18
|
cache: (NumberedSetUpdate | null)[];
|
|
53
19
|
cacheIdx: number;
|
|
@@ -72,4 +38,4 @@ declare class SetRTX<P extends primitive> extends Set<P> implements Transceiver<
|
|
|
72
38
|
undo(update: NumberedSetUpdate): number | null;
|
|
73
39
|
}
|
|
74
40
|
|
|
75
|
-
export { type NumberedSetUpdate, SetRTX, type SetRTXJson, type SetUpdate };
|
|
41
|
+
export { type NumberedSetUpdate, SetRTX, type SetRTXJson, type SetUpdate, type SetUpdateType };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { SetRTX } from '../../../dist/chunk-
|
|
1
|
+
export { SetRTX } from '../../../dist/chunk-RXQWAO26.js';
|
|
2
2
|
import '../../../dist/chunk-XWL6SNVU.js';
|
|
@@ -3,11 +3,8 @@ import { Subject } from "atom.io/internal"
|
|
|
3
3
|
import type { Json, primitive } from "atom.io/json"
|
|
4
4
|
import { stringifyJson } from "atom.io/json"
|
|
5
5
|
|
|
6
|
-
export type
|
|
7
|
-
|
|
8
|
-
| `clear:${string}`
|
|
9
|
-
| `del:${string}`
|
|
10
|
-
| `tx:${string}`
|
|
6
|
+
export type SetUpdateType = `add` | `clear` | `del` | `tx`
|
|
7
|
+
export type SetUpdate = `${SetUpdateType}:${string}`
|
|
11
8
|
export type NumberedSetUpdate = `${number}=${SetUpdate}`
|
|
12
9
|
|
|
13
10
|
export interface SetRTXJson<P extends primitive> extends Json.Object {
|
|
@@ -145,7 +142,7 @@ export class SetRTX<P extends primitive>
|
|
|
145
142
|
|
|
146
143
|
private doStep(update: SetUpdate): void {
|
|
147
144
|
const typeValueBreak = update.indexOf(`:`)
|
|
148
|
-
const type = update.substring(0, typeValueBreak)
|
|
145
|
+
const type = update.substring(0, typeValueBreak) as SetUpdateType
|
|
149
146
|
const value = update.substring(typeValueBreak + 1)
|
|
150
147
|
switch (type) {
|
|
151
148
|
case `add`:
|
|
@@ -214,7 +211,7 @@ export class SetRTX<P extends primitive>
|
|
|
214
211
|
|
|
215
212
|
public undoStep(update: SetUpdate): void {
|
|
216
213
|
const breakpoint = update.indexOf(`:`)
|
|
217
|
-
const type = update.substring(0, breakpoint)
|
|
214
|
+
const type = update.substring(0, breakpoint) as SetUpdateType
|
|
218
215
|
const value = update.substring(breakpoint + 1)
|
|
219
216
|
switch (type) {
|
|
220
217
|
case `add`:
|
package/web/dist/index.d.ts
CHANGED
|
@@ -1,33 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
type Effectors<T> = {
|
|
3
|
-
/**
|
|
4
|
-
* Set the value of the atom
|
|
5
|
-
* @param next - The new value of the atom, or a setter function
|
|
6
|
-
*/
|
|
7
|
-
setSelf: <New extends T>(next: New | Setter<T, New>) => void;
|
|
8
|
-
/** Subscribe to changes to the atom */
|
|
9
|
-
onSet: (callback: (options: {
|
|
10
|
-
newValue: T;
|
|
11
|
-
oldValue: T;
|
|
12
|
-
}) => void) => void;
|
|
13
|
-
};
|
|
14
|
-
/**
|
|
15
|
-
* @public
|
|
16
|
-
* A function that runs side effects when the atom is set
|
|
17
|
-
* @param tools - {@link Effectors} that can be used to run side effects
|
|
18
|
-
* @returns
|
|
19
|
-
* Optionally, a cleanup function that will be called when the atom is disposed
|
|
20
|
-
*/
|
|
21
|
-
type AtomEffect<T> = (tools: Effectors<T>) => (() => void) | void;
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* @public
|
|
25
|
-
* A function that sets the value of a state.
|
|
26
|
-
* @param oldValue - The current value of the state.
|
|
27
|
-
* @returns
|
|
28
|
-
* The new value of the state.
|
|
29
|
-
*/
|
|
30
|
-
type Setter<T, New extends T> = (oldValue: T) => New;
|
|
1
|
+
import { AtomEffect } from 'atom.io';
|
|
31
2
|
|
|
32
3
|
type StringInterface<T> = {
|
|
33
4
|
stringify: (t: T) => string;
|