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.
Files changed (57) 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-HEEVASKG.js} +1 -1
  4. package/dist/{chunk-ECOMOMUN.js → chunk-KMBRCA5Q.js} +20 -19
  5. package/dist/{chunk-R3ZUK5EH.js → chunk-NDTM5IY3.js} +22 -11
  6. package/dist/{chunk-354XQWHH.js → chunk-QRPY4LSO.js} +5 -5
  7. package/dist/{chunk-GY2XQYZY.js → chunk-RXQWAO26.js} +50 -41
  8. package/dist/{chunk-Z2UJW4NQ.js → chunk-XN3EO2UT.js} +3 -3
  9. package/dist/{chunk-NF7FJKJD.js → chunk-YPME5OLO.js} +6 -4
  10. package/dist/index.d.ts +45 -516
  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 +9 -657
  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/lazy-map.ts +3 -1
  21. package/internal/src/set-state/emit-update.ts +3 -1
  22. package/internal/src/timeline/create-timeline.ts +2 -1
  23. package/internal/src/timeline/time-travel.ts +2 -1
  24. package/introspection/dist/index.d.ts +6 -922
  25. package/introspection/dist/index.js +2 -2
  26. package/introspection/src/auditor.ts +3 -3
  27. package/json/dist/index.d.ts +5 -899
  28. package/json/dist/index.js +1 -1
  29. package/package.json +10 -10
  30. package/react/dist/index.d.ts +3 -921
  31. package/react/dist/index.js +2 -2
  32. package/react-devtools/dist/index.d.ts +1 -26
  33. package/react-devtools/dist/index.js +28 -15
  34. package/react-devtools/src/Updates.tsx +12 -0
  35. package/react-devtools/src/json-editor/editors-by-type/utilities/cast-to-json.ts +2 -1
  36. package/realtime/dist/index.d.ts +8 -203
  37. package/realtime/dist/index.js +2 -2
  38. package/realtime/src/realtime-continuity.ts +5 -1
  39. package/realtime-client/dist/index.d.ts +21 -959
  40. package/realtime-client/dist/index.js +2 -2
  41. package/realtime-react/dist/index.d.ts +12 -166
  42. package/realtime-react/dist/index.js +4 -4
  43. package/realtime-server/dist/index.d.ts +27 -972
  44. package/realtime-server/dist/index.js +3 -3
  45. package/realtime-server/src/ipc-sockets/child-socket.ts +2 -0
  46. package/realtime-server/src/ipc-sockets/custom-socket.ts +6 -1
  47. package/realtime-server/src/realtime-server-stores/server-sync-store.ts +10 -2
  48. package/realtime-testing/dist/index.d.ts +3 -1091
  49. package/realtime-testing/dist/index.js +7 -7
  50. package/src/logger.ts +12 -4
  51. package/transceivers/set-rtx/dist/index.d.ts +6 -40
  52. package/transceivers/set-rtx/dist/index.js +1 -1
  53. package/transceivers/set-rtx/src/set-rtx.ts +4 -7
  54. package/web/dist/index.d.ts +1 -30
  55. package/react-devtools/src/json-editor/assets/Untitled-1.ai +2 -1436
  56. package/react-devtools/src/json-editor/assets/data-vis.ai +1 -1548
  57. package/react-devtools/src/json-editor/comp/json-editor-sketches.ai +5 -1449
@@ -1,10 +1,10 @@
1
- import { RealtimeProvider } from '../../dist/chunk-354XQWHH.js';
2
- import { myUsernameState } from '../../dist/chunk-Z2UJW4NQ.js';
3
- import { socketAtoms, usersOfSockets, userIndex, socketIndex, roomSelectors } from '../../dist/chunk-R3ZUK5EH.js';
4
- import { roomIndex } from '../../dist/chunk-NF7FJKJD.js';
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-5F2V7S3B.js';
7
- import { Silo, IMPLICIT, Realm, findInStore, setIntoStore, editRelationsInStore, toEntries, findRelationsInStore, getFromStore, AtomIOLogger, clearStore } from '../../dist/chunk-GY2XQYZY.js';
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`, undefined, {
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
- public logLevel: `error` | `info` | `warn` | null,
103
- private readonly filter?: LogFilter,
104
- private readonly logger: Logger = simpleLogger,
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
- type primitive = boolean | number | string | null;
2
- declare namespace Json {
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 SetUpdate = `add:${string}` | `clear:${string}` | `del:${string}` | `tx:${string}`;
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<SetUpdate>;
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-GY2XQYZY.js';
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 SetUpdate =
7
- | `add:${string}`
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`:
@@ -1,33 +1,4 @@
1
- /** @public */
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;