atom.io 0.6.7 → 0.6.8

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 (63) hide show
  1. package/dist/index.d.mts +27 -17
  2. package/dist/index.d.ts +27 -17
  3. package/dist/index.js +28 -22
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.mjs +28 -22
  6. package/dist/index.mjs.map +1 -1
  7. package/introspection/dist/index.d.mts +14 -15
  8. package/introspection/dist/index.d.ts +14 -15
  9. package/introspection/dist/index.js +2 -2
  10. package/introspection/dist/index.js.map +1 -1
  11. package/introspection/dist/index.mjs +2 -2
  12. package/introspection/dist/index.mjs.map +1 -1
  13. package/json/dist/index.d.mts +5 -7
  14. package/json/dist/index.d.ts +5 -7
  15. package/json/dist/index.js.map +1 -1
  16. package/json/dist/index.mjs.map +1 -1
  17. package/package.json +15 -7
  18. package/react-devtools/dist/index.css +9 -1
  19. package/react-devtools/dist/index.css.map +1 -1
  20. package/react-devtools/dist/index.d.mts +14 -15
  21. package/react-devtools/dist/index.d.ts +14 -15
  22. package/react-devtools/dist/index.js +769 -249
  23. package/react-devtools/dist/index.js.map +1 -1
  24. package/react-devtools/dist/index.mjs +752 -227
  25. package/react-devtools/dist/index.mjs.map +1 -1
  26. package/realtime/dist/index.d.mts +6 -8
  27. package/realtime/dist/index.d.ts +6 -8
  28. package/realtime/dist/index.js +0 -1
  29. package/realtime/dist/index.js.map +1 -1
  30. package/realtime/dist/index.mjs +0 -1
  31. package/realtime/dist/index.mjs.map +1 -1
  32. package/realtime-react/dist/index.d.mts +11 -13
  33. package/realtime-react/dist/index.d.ts +11 -13
  34. package/realtime-react/dist/index.js.map +1 -1
  35. package/realtime-react/dist/index.mjs.map +1 -1
  36. package/src/atom.ts +4 -4
  37. package/src/index.ts +1 -1
  38. package/src/internal/families-internal.ts +23 -20
  39. package/src/internal/index.ts +1 -1
  40. package/src/internal/selector/create-read-write-selector.ts +3 -1
  41. package/src/internal/selector/create-readonly-selector.ts +3 -1
  42. package/src/internal/time-travel-internal.ts +4 -4
  43. package/src/internal/timeline/add-atom-to-timeline.ts +2 -2
  44. package/src/internal/timeline-internal.ts +2 -2
  45. package/src/introspection/attach-timeline-family.ts +1 -1
  46. package/src/json/select-json.ts +1 -1
  47. package/src/react-devtools/StateEditor.tsx +5 -1
  48. package/src/react-devtools/StateIndex.tsx +4 -1
  49. package/src/react-devtools/devtools.scss +0 -1
  50. package/src/realtime/hook-composition/expose-family.ts +2 -2
  51. package/src/realtime/hook-composition/expose-single.ts +1 -1
  52. package/src/realtime/hook-composition/receive-state.ts +1 -1
  53. package/src/realtime-react/realtime-hooks.ts +4 -4
  54. package/src/realtime-react/use-pull-family-member.ts +2 -2
  55. package/src/realtime-react/use-pull-family.ts +2 -2
  56. package/src/realtime-react/use-pull.ts +3 -1
  57. package/src/realtime-react/use-push.ts +3 -1
  58. package/src/selector.ts +14 -12
  59. package/src/subscribe.ts +1 -1
  60. package/src/tracker/index.ts +3 -0
  61. package/src/tracker/tracker.ts +61 -0
  62. package/src/web-effects/storage.ts +1 -1
  63. package/src/internal/subject.ts +0 -24
@@ -5,18 +5,17 @@ type PlainObject = Record<keyof any, unknown>;
5
5
 
6
6
  type ƒn = (...parameters: any[]) => any;
7
7
 
8
- type JsonInterface<T, J extends Json = Json> = {
8
+ type JsonInterface<T, J extends Serializable = Serializable> = {
9
9
  toJson: (t: T) => J;
10
10
  fromJson: (json: J) => T;
11
11
  };
12
12
 
13
- type Primitive = boolean | number | string | null;
14
- type Serializable = Primitive | Readonly<{
13
+ type primitive = boolean | number | string | null;
14
+
15
+ type Serializable = primitive | Readonly<{
15
16
  [key: string]: Serializable;
16
17
  }> | ReadonlyArray<Serializable>;
17
- type JsonObj<Key extends string = string, Value extends Serializable = Serializable> = Record<Key, Value>;
18
- type JsonArr<Element extends Serializable = Serializable> = ReadonlyArray<Element>;
19
- type Json = JsonArr | JsonObj | Primitive;
18
+ type Object$1<Key extends string = string, Value extends Serializable = Serializable> = Record<Key, Value>;
20
19
 
21
20
  type Identified = {
22
21
  id: string;
@@ -24,23 +23,23 @@ type Identified = {
24
23
 
25
24
  declare const RELATION_TYPES: readonly ["1:1", "1:n", "n:n"];
26
25
  type RelationType = typeof RELATION_TYPES[number];
27
- type RelationData<CONTENT extends JsonObj | null = null, A extends string = `from`, B extends string = `to`> = {
28
- contents: JsonObj<string, CONTENT>;
29
- relations: JsonObj<string, string[]>;
26
+ type RelationData<CONTENT extends Object$1 | null = null, A extends string = `from`, B extends string = `to`> = {
27
+ contents: Object$1<string, CONTENT>;
28
+ relations: Object$1<string, string[]>;
30
29
  relationType: RelationType;
31
30
  a: A;
32
31
  b: B;
33
32
  };
34
- type IsRelationDataOptions<CONTENT extends JsonObj | null = null, A extends string = `from`, B extends string = `to`> = {
33
+ type IsRelationDataOptions<CONTENT extends Object$1 | null = null, A extends string = `from`, B extends string = `to`> = {
35
34
  from?: A;
36
35
  to?: B;
37
- isContent?: (json: Json) => json is CONTENT;
36
+ isContent?: (json: Serializable) => json is CONTENT;
38
37
  };
39
38
 
40
39
  type NullSafeUnion<Base, Extension> = Extension extends null ? Base : Base & Extension;
41
- type NullSafeRest<MaybeArg> = MaybeArg extends null ? [] | [undefined] : [MaybeArg];
40
+ type NullSafeRest<MaybeArg, IfArg = MaybeArg> = MaybeArg extends null ? [] | [undefined] : [IfArg];
42
41
 
43
- declare class Join<CONTENT extends JsonObj | null = null, A extends string = `from`, B extends string = `to`> implements RelationData<CONTENT, A, B> {
42
+ declare class Join<CONTENT extends Object$1 | null = null, A extends string = `from`, B extends string = `to`> implements RelationData<CONTENT, A, B> {
44
43
  readonly relationType: `1:1` | `1:n` | `n:n`;
45
44
  readonly a: A;
46
45
  readonly b: B;
@@ -48,7 +47,7 @@ declare class Join<CONTENT extends JsonObj | null = null, A extends string = `fr
48
47
  readonly contents: Record<string, CONTENT>;
49
48
  constructor(json?: Partial<RelationData<CONTENT, A, B>>);
50
49
  toJSON(): RelationData<CONTENT, A, B>;
51
- static fromJSON<CONTENT extends JsonObj | null, A extends string, B extends string>(json: Json, options?: IsRelationDataOptions<CONTENT, A, B>): Join<CONTENT, A, B>;
50
+ static fromJSON<CONTENT extends Object$1 | null, A extends string, B extends string>(json: Serializable, options?: IsRelationDataOptions<CONTENT, A, B>): Join<CONTENT, A, B>;
52
51
  from<AA extends string>(newA: AA): Join<CONTENT, AA, B>;
53
52
  to<BB extends string>(newB: BB): Join<CONTENT, A, BB>;
54
53
  makeJsonInterface: (...params: CONTENT extends null ? [
@@ -239,7 +238,7 @@ type TimelineTransactionUpdate = TransactionUpdate<ƒn> & {
239
238
  type Timeline = {
240
239
  key: string;
241
240
  at: number;
242
- timeTraveling: boolean;
241
+ timeTraveling: `into_future` | `into_past` | null;
243
242
  history: TimelineUpdate[];
244
243
  selectorTime: number | null;
245
244
  transactionKey: string | null;
@@ -5,18 +5,17 @@ type PlainObject = Record<keyof any, unknown>;
5
5
 
6
6
  type ƒn = (...parameters: any[]) => any;
7
7
 
8
- type JsonInterface<T, J extends Json = Json> = {
8
+ type JsonInterface<T, J extends Serializable = Serializable> = {
9
9
  toJson: (t: T) => J;
10
10
  fromJson: (json: J) => T;
11
11
  };
12
12
 
13
- type Primitive = boolean | number | string | null;
14
- type Serializable = Primitive | Readonly<{
13
+ type primitive = boolean | number | string | null;
14
+
15
+ type Serializable = primitive | Readonly<{
15
16
  [key: string]: Serializable;
16
17
  }> | ReadonlyArray<Serializable>;
17
- type JsonObj<Key extends string = string, Value extends Serializable = Serializable> = Record<Key, Value>;
18
- type JsonArr<Element extends Serializable = Serializable> = ReadonlyArray<Element>;
19
- type Json = JsonArr | JsonObj | Primitive;
18
+ type Object$1<Key extends string = string, Value extends Serializable = Serializable> = Record<Key, Value>;
20
19
 
21
20
  type Identified = {
22
21
  id: string;
@@ -24,23 +23,23 @@ type Identified = {
24
23
 
25
24
  declare const RELATION_TYPES: readonly ["1:1", "1:n", "n:n"];
26
25
  type RelationType = typeof RELATION_TYPES[number];
27
- type RelationData<CONTENT extends JsonObj | null = null, A extends string = `from`, B extends string = `to`> = {
28
- contents: JsonObj<string, CONTENT>;
29
- relations: JsonObj<string, string[]>;
26
+ type RelationData<CONTENT extends Object$1 | null = null, A extends string = `from`, B extends string = `to`> = {
27
+ contents: Object$1<string, CONTENT>;
28
+ relations: Object$1<string, string[]>;
30
29
  relationType: RelationType;
31
30
  a: A;
32
31
  b: B;
33
32
  };
34
- type IsRelationDataOptions<CONTENT extends JsonObj | null = null, A extends string = `from`, B extends string = `to`> = {
33
+ type IsRelationDataOptions<CONTENT extends Object$1 | null = null, A extends string = `from`, B extends string = `to`> = {
35
34
  from?: A;
36
35
  to?: B;
37
- isContent?: (json: Json) => json is CONTENT;
36
+ isContent?: (json: Serializable) => json is CONTENT;
38
37
  };
39
38
 
40
39
  type NullSafeUnion<Base, Extension> = Extension extends null ? Base : Base & Extension;
41
- type NullSafeRest<MaybeArg> = MaybeArg extends null ? [] | [undefined] : [MaybeArg];
40
+ type NullSafeRest<MaybeArg, IfArg = MaybeArg> = MaybeArg extends null ? [] | [undefined] : [IfArg];
42
41
 
43
- declare class Join<CONTENT extends JsonObj | null = null, A extends string = `from`, B extends string = `to`> implements RelationData<CONTENT, A, B> {
42
+ declare class Join<CONTENT extends Object$1 | null = null, A extends string = `from`, B extends string = `to`> implements RelationData<CONTENT, A, B> {
44
43
  readonly relationType: `1:1` | `1:n` | `n:n`;
45
44
  readonly a: A;
46
45
  readonly b: B;
@@ -48,7 +47,7 @@ declare class Join<CONTENT extends JsonObj | null = null, A extends string = `fr
48
47
  readonly contents: Record<string, CONTENT>;
49
48
  constructor(json?: Partial<RelationData<CONTENT, A, B>>);
50
49
  toJSON(): RelationData<CONTENT, A, B>;
51
- static fromJSON<CONTENT extends JsonObj | null, A extends string, B extends string>(json: Json, options?: IsRelationDataOptions<CONTENT, A, B>): Join<CONTENT, A, B>;
50
+ static fromJSON<CONTENT extends Object$1 | null, A extends string, B extends string>(json: Serializable, options?: IsRelationDataOptions<CONTENT, A, B>): Join<CONTENT, A, B>;
52
51
  from<AA extends string>(newA: AA): Join<CONTENT, AA, B>;
53
52
  to<BB extends string>(newB: BB): Join<CONTENT, A, BB>;
54
53
  makeJsonInterface: (...params: CONTENT extends null ? [
@@ -239,7 +238,7 @@ type TimelineTransactionUpdate = TransactionUpdate<ƒn> & {
239
238
  type Timeline = {
240
239
  key: string;
241
240
  at: number;
242
- timeTraveling: boolean;
241
+ timeTraveling: `into_future` | `into_past` | null;
243
242
  history: TimelineUpdate[];
244
243
  selectorTime: number | null;
245
244
  transactionKey: string | null;