atom.io 0.25.6 → 0.27.0

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 (108) hide show
  1. package/data/dist/index.d.ts +3 -3
  2. package/data/dist/index.js +33 -25
  3. package/data/package.json +1 -4
  4. package/data/src/dict.ts +3 -3
  5. package/dist/chunk-AK23DRMD.js +21 -0
  6. package/dist/{chunk-HYXKCFVY.js → chunk-IBTHB2PI.js} +59 -60
  7. package/dist/{chunk-MR5NETHW.js → chunk-IW6WYRS7.js} +4 -5
  8. package/dist/chunk-XWL6SNVU.js +7 -0
  9. package/dist/index.d.ts +32 -54
  10. package/dist/index.js +33 -21
  11. package/ephemeral/dist/index.d.ts +7 -7
  12. package/ephemeral/dist/index.js +1 -1
  13. package/ephemeral/package.json +1 -4
  14. package/ephemeral/src/find-state.ts +7 -7
  15. package/eslint-plugin/dist/index.js +7 -8
  16. package/eslint-plugin/package.json +1 -4
  17. package/immortal/dist/index.d.ts +7 -7
  18. package/immortal/dist/index.js +1 -1
  19. package/immortal/package.json +1 -4
  20. package/immortal/src/seek-state.ts +8 -8
  21. package/internal/dist/index.d.ts +56 -59
  22. package/internal/dist/index.js +178 -170
  23. package/internal/package.json +1 -4
  24. package/internal/src/families/create-atom-family.ts +4 -4
  25. package/internal/src/families/create-readonly-selector-family.ts +2 -2
  26. package/internal/src/families/create-regular-atom-family.ts +2 -2
  27. package/internal/src/families/create-selector-family.ts +4 -4
  28. package/internal/src/families/create-writable-selector-family.ts +2 -2
  29. package/internal/src/families/dispose-from-store.ts +3 -7
  30. package/internal/src/families/find-in-store.ts +9 -9
  31. package/internal/src/families/init-family-member.ts +25 -37
  32. package/internal/src/families/seek-in-store.ts +11 -10
  33. package/internal/src/get-state/get-from-store.ts +3 -3
  34. package/internal/src/molecule/grow-molecule-in-store.ts +9 -9
  35. package/internal/src/mutable/index.ts +0 -1
  36. package/internal/src/mutable/tracker-family.ts +2 -2
  37. package/internal/src/set-state/set-into-store.ts +4 -4
  38. package/internal/src/store/deposit.ts +3 -3
  39. package/internal/src/store/withdraw.ts +10 -9
  40. package/introspection/dist/index.js +32 -30
  41. package/introspection/package.json +1 -4
  42. package/json/dist/index.d.ts +10 -27
  43. package/json/dist/index.js +3 -3
  44. package/json/package.json +1 -4
  45. package/json/src/index.ts +8 -3
  46. package/json/src/select-json-family.ts +4 -4
  47. package/package.json +36 -65
  48. package/react/dist/index.d.ts +4 -4
  49. package/react/dist/index.js +2 -2
  50. package/react/package.json +1 -4
  51. package/react/src/parse-state-overloads.ts +4 -4
  52. package/react/src/use-i.ts +3 -3
  53. package/react/src/use-json.ts +3 -3
  54. package/react/src/use-o.ts +3 -3
  55. package/react-devtools/dist/index.d.ts +1 -1
  56. package/react-devtools/dist/index.js +90 -72
  57. package/react-devtools/package.json +1 -4
  58. package/react-devtools/src/StateIndex.tsx +5 -4
  59. package/realtime/dist/index.d.ts +3 -3
  60. package/realtime/dist/index.js +8 -9
  61. package/realtime/package.json +1 -4
  62. package/realtime/src/realtime-continuity.ts +2 -2
  63. package/realtime-client/dist/index.js +6 -6
  64. package/realtime-client/package.json +1 -4
  65. package/realtime-react/dist/index.d.ts +4 -4
  66. package/realtime-react/dist/index.js +9 -11
  67. package/realtime-react/package.json +1 -4
  68. package/realtime-react/src/use-pull-atom-family-member.ts +2 -2
  69. package/realtime-react/src/use-pull-mutable-family-member.ts +2 -2
  70. package/realtime-react/src/use-pull-selector-family-member.ts +2 -2
  71. package/realtime-server/dist/index.d.ts +9 -9
  72. package/realtime-server/dist/index.js +59 -54
  73. package/realtime-server/package.json +1 -4
  74. package/realtime-server/src/ipc-sockets/custom-socket.ts +2 -2
  75. package/realtime-server/src/realtime-family-provider.ts +3 -2
  76. package/realtime-server/src/realtime-mutable-family-provider.ts +2 -2
  77. package/realtime-testing/dist/index.js +3 -3
  78. package/realtime-testing/package.json +1 -4
  79. package/src/atom.ts +15 -42
  80. package/src/dispose-state.ts +2 -2
  81. package/src/get-state.ts +4 -4
  82. package/src/index.ts +5 -5
  83. package/src/molecule.ts +4 -3
  84. package/src/selector.ts +17 -39
  85. package/src/set-state.ts +3 -2
  86. package/src/silo.ts +4 -4
  87. package/transceivers/set-rtx/dist/index.js +11 -11
  88. package/transceivers/set-rtx/package.json +1 -4
  89. package/transceivers/set-rtx/src/set-rtx.ts +5 -5
  90. package/data/dist/index.cjs +0 -953
  91. package/dist/chunk-BF4MVQF6.js +0 -44
  92. package/dist/chunk-S4N6XNPH.js +0 -38
  93. package/dist/index.cjs +0 -215
  94. package/ephemeral/dist/index.cjs +0 -11
  95. package/eslint-plugin/dist/index.cjs +0 -388
  96. package/immortal/dist/index.cjs +0 -14
  97. package/internal/dist/index.cjs +0 -3405
  98. package/internal/src/mutable/is-mutable.ts +0 -16
  99. package/introspection/dist/index.cjs +0 -449
  100. package/json/dist/index.cjs +0 -128
  101. package/react/dist/index.cjs +0 -118
  102. package/react-devtools/dist/index.cjs +0 -2191
  103. package/realtime/dist/index.cjs +0 -120
  104. package/realtime-client/dist/index.cjs +0 -569
  105. package/realtime-react/dist/index.cjs +0 -189
  106. package/realtime-server/dist/index.cjs +0 -965
  107. package/realtime-testing/dist/index.cjs +0 -201
  108. package/transceivers/set-rtx/dist/index.cjs +0 -215
@@ -1,6 +1,6 @@
1
1
  import type { ReadableFamilyToken, ReadableToken } from "atom.io"
2
2
  import { getFromStore, subscribeToState } from "atom.io/internal"
3
- import type { Json } from "atom.io/json"
3
+ import type { Canonical } from "atom.io/json"
4
4
  import * as React from "react"
5
5
 
6
6
  import { parseStateOverloads } from "./parse-state-overloads"
@@ -8,12 +8,12 @@ import { StoreContext } from "./store-context"
8
8
 
9
9
  export function useO<T>(token: ReadableToken<T>): T
10
10
 
11
- export function useO<T, K extends Json.Serializable>(
11
+ export function useO<T, K extends Canonical>(
12
12
  token: ReadableFamilyToken<T, K>,
13
13
  key: K,
14
14
  ): T
15
15
 
16
- export function useO<T, K extends Json.Serializable>(
16
+ export function useO<T, K extends Canonical>(
17
17
  ...params: [ReadableFamilyToken<T, K>, K] | [ReadableToken<T>]
18
18
  ): T {
19
19
  const store = React.useContext(StoreContext)
@@ -69,7 +69,7 @@ declare const devtoolsAreOpenState: atom_io.RegularAtomToken<boolean>;
69
69
  type DevtoolsView = `atoms` | `selectors` | `timelines` | `transactions`;
70
70
  declare const devtoolsViewSelectionState: atom_io.RegularAtomToken<DevtoolsView>;
71
71
  declare const devtoolsViewOptionsState: atom_io.RegularAtomToken<DevtoolsView[]>;
72
- declare const findViewIsOpenState: atom_io.RegularAtomFamilyTokenWithCall<boolean, string>;
72
+ declare const findViewIsOpenState: atom_io.RegularAtomFamilyToken<boolean, string>;
73
73
  declare const primitiveRefinery: Refinery<{
74
74
  number: (input: unknown) => input is number;
75
75
  string: (input: unknown) => input is string;
@@ -1,7 +1,7 @@
1
1
  import { lazyLocalStorageEffect } from '../../dist/chunk-H6EDLPKH.js';
2
- import { pipe, ifDefined, isArray, isRecord, doesExtend, isPlainObject, raiseError, sprawl, fallback, doNothing, become, mapObject, delve } from '../../dist/chunk-MR5NETHW.js';
3
- import { JSON_TYPE_NAMES, isString, isNumber, isBoolean, stringifyJson, JSON_DEFAULTS } from '../../dist/chunk-BF4MVQF6.js';
4
- import { __spreadProps, __spreadValues, __objRest, __restKey } from '../../dist/chunk-S4N6XNPH.js';
2
+ import { pipe, ifDefined, isArray, isRecord, doesExtend, isPlainObject, raiseError, sprawl, fallback, doNothing, become, mapObject, delve } from '../../dist/chunk-IW6WYRS7.js';
3
+ import { JSON_TYPE_NAMES, stringifyJson, JSON_DEFAULTS } from '../../dist/chunk-AK23DRMD.js';
4
+ import '../../dist/chunk-XWL6SNVU.js';
5
5
  import { selectorFamily, atom, atomFamily, undo, redo, getState } from 'atom.io';
6
6
  import { attachIntrospectionStates } from 'atom.io/introspection';
7
7
  import { useI, useO } from 'atom.io/react';
@@ -18,7 +18,7 @@ var cannotExist = (_) => false;
18
18
 
19
19
  // ../anvl/src/refinement/is-intersection.ts
20
20
  function mustSatisfyAllOfTheFollowing(isTypeA, logging = false, refinements = [isTypeA]) {
21
- const name = `(${refinements.map((r) => (r == null ? void 0 : r.name) || `anon`).join(` & `)})`;
21
+ const name = `(${refinements.map((r) => r?.name || `anon`).join(` & `)})`;
22
22
  const _ = {
23
23
  [name]: (input) => refinements.every(
24
24
  (refinement) => (logging && console.log(
@@ -42,19 +42,16 @@ var isIntersection = mustSatisfyAllOfTheFollowing(canExist);
42
42
 
43
43
  // ../anvl/src/refinement/is-union.ts
44
44
  var mustSatisfyOneOfTheFollowing = (isTypeA, logging = false, refinements = [isTypeA]) => {
45
- const name = `(${refinements.map((r) => (r == null ? void 0 : r.name) || `anon`).join(` | `)})`;
45
+ const name = `(${refinements.map((r) => r?.name || `anon`).join(` | `)})`;
46
46
  const _ = {
47
47
  [name]: (input) => refinements.some(
48
- (refinement) => {
49
- var _a2;
50
- return logging && console.log(
51
- refinements.map((r) => r.name || `anon`).join(` | `),
52
- `>`,
53
- (_a2 = refinement.name) != null ? _a2 : `anon`,
54
- `:`,
55
- refinement(input)
56
- ), refinement(input);
57
- }
48
+ (refinement) => (logging && console.log(
49
+ refinements.map((r) => r.name || `anon`).join(` | `),
50
+ `>`,
51
+ refinement.name ?? `anon`,
52
+ `:`,
53
+ refinement(input)
54
+ ), refinement(input))
58
55
  )
59
56
  };
60
57
  const checkTypes = Object.assign(_[name], {
@@ -64,6 +61,17 @@ var mustSatisfyOneOfTheFollowing = (isTypeA, logging = false, refinements = [isT
64
61
  };
65
62
  var isUnion = mustSatisfyOneOfTheFollowing(cannotExist);
66
63
 
64
+ // ../anvl/src/primitive/index.ts
65
+ var isString = (input) => {
66
+ return typeof input === `string`;
67
+ };
68
+ var isNumber = (input) => {
69
+ return typeof input === `number`;
70
+ };
71
+ var isBoolean = (input) => {
72
+ return typeof input === `boolean`;
73
+ };
74
+
67
75
  // ../anvl/src/refinement/refine-json.ts
68
76
  var JSON_PROTOTYPES = [
69
77
  `Array`,
@@ -76,16 +84,16 @@ var refineJsonType = (data) => data === null ? { type: `null`, data: null } : is
76
84
  data === void 0 ? `undefined passed to refineJsonType. This is not valid JSON.` : `${stringifyJson(data)} with prototype "${Object.getPrototypeOf(data).constructor.name}" passed to refineJsonType. This is not valid JSON.`
77
85
  );
78
86
  var isJson = (input) => {
79
- var _a2;
80
87
  if (input === null) return true;
81
88
  if (input === void 0) return false;
82
- const prototype = (_a2 = Object.getPrototypeOf(input)) == null ? void 0 : _a2.constructor.name;
89
+ const prototype = Object.getPrototypeOf(input)?.constructor.name;
83
90
  const refine = JSON_PROTOTYPES.includes(prototype);
84
91
  return refine;
85
92
  };
86
93
 
87
94
  // ../anvl/src/refinement/refinery.ts
88
95
  var Refinery = class {
96
+ supported;
89
97
  constructor(supported) {
90
98
  this.supported = supported;
91
99
  }
@@ -191,6 +199,10 @@ function diffArray(a, b, recurse) {
191
199
  return diffObject(a, b, recurse);
192
200
  }
193
201
  var Differ = class {
202
+ leafRefinery;
203
+ treeRefinery;
204
+ leafDiffers;
205
+ treeDiffers;
194
206
  constructor(leafRefinery, treeRefinery, diffFunctions) {
195
207
  this.leafRefinery = leafRefinery;
196
208
  this.treeRefinery = treeRefinery;
@@ -206,7 +218,6 @@ var Differ = class {
206
218
  }
207
219
  }
208
220
  diff(a, b) {
209
- var _a2, _b2;
210
221
  if (a === b) {
211
222
  return { summary: `No Change` };
212
223
  }
@@ -217,8 +228,8 @@ var Differ = class {
217
228
  } catch (thrown) {
218
229
  console.error(`Error stringifying`, a, b);
219
230
  }
220
- const aRefined = (_a2 = this.leafRefinery.refine(a)) != null ? _a2 : this.treeRefinery.refine(a);
221
- const bRefined = (_b2 = this.leafRefinery.refine(b)) != null ? _b2 : this.treeRefinery.refine(b);
231
+ const aRefined = this.leafRefinery.refine(a) ?? this.treeRefinery.refine(a);
232
+ const bRefined = this.leafRefinery.refine(b) ?? this.treeRefinery.refine(b);
222
233
  if (aRefined !== null && bRefined !== null) {
223
234
  if (aRefined.type === bRefined.type) {
224
235
  if (aRefined.type in this.leafDiffers) {
@@ -269,7 +280,6 @@ var button = {
269
280
  OpenClose
270
281
  };
271
282
  var ElasticInput = forwardRef(function ElasticInputFC(props, ref) {
272
- var _a2, _b2, _c, _d, _e, _f;
273
283
  const inputRef = useRef(null);
274
284
  const spanRef = useRef(null);
275
285
  const [inputWidth, setInputWidth] = useState(`auto`);
@@ -277,8 +287,7 @@ var ElasticInput = forwardRef(function ElasticInputFC(props, ref) {
277
287
  ref,
278
288
  () => ({
279
289
  focus: () => {
280
- var _a3;
281
- (_a3 = inputRef.current) == null ? void 0 : _a3.focus();
290
+ inputRef.current?.focus();
282
291
  }
283
292
  })
284
293
  );
@@ -295,34 +304,36 @@ var ElasticInput = forwardRef(function ElasticInputFC(props, ref) {
295
304
  clearInterval(interval);
296
305
  };
297
306
  }
298
- }, [(_a2 = inputRef.current) == null ? void 0 : _a2.value, props.value]);
307
+ }, [inputRef.current?.value, props.value]);
299
308
  return /* @__PURE__ */ jsxs("div", { style: { display: `inline-block`, position: `relative` }, children: [
300
309
  /* @__PURE__ */ jsx(
301
310
  "input",
302
- __spreadProps(__spreadValues({}, props), {
311
+ {
312
+ ...props,
303
313
  ref: inputRef,
304
- style: __spreadValues({
314
+ style: {
305
315
  padding: 0,
306
316
  borderRadius: 0,
307
317
  border: `none`,
308
318
  fontFamily: `inherit`,
309
319
  fontSize: `inherit`,
310
- width: inputWidth
311
- }, props.style)
312
- })
320
+ width: inputWidth,
321
+ ...props.style
322
+ }
323
+ }
313
324
  ),
314
325
  /* @__PURE__ */ jsx(
315
326
  "span",
316
327
  {
317
328
  ref: spanRef,
318
329
  style: {
319
- padding: (_b2 = props.style) == null ? void 0 : _b2.padding,
330
+ padding: props.style?.padding,
320
331
  position: `absolute`,
321
332
  visibility: `hidden`,
322
333
  // color: `red`,
323
334
  whiteSpace: `pre`,
324
- fontFamily: (_d = (_c = props.style) == null ? void 0 : _c.fontFamily) != null ? _d : `inherit`,
325
- fontSize: (_f = (_e = props.style) == null ? void 0 : _e.fontSize) != null ? _f : `inherit`
335
+ fontFamily: props.style?.fontFamily ?? `inherit`,
336
+ fontSize: props.style?.fontSize ?? `inherit`
326
337
  },
327
338
  children: props.value
328
339
  }
@@ -360,9 +371,12 @@ var initRefinery = (constraints) => (input) => {
360
371
  if (input === null && constraints.nullable === true) {
361
372
  return null;
362
373
  }
363
- const { max, min, decimalPlaces } = __spreadValues(__spreadValues({}, DEFAULT_NUMBER_CONSTRAINTS), constraints);
374
+ const { max, min, decimalPlaces } = {
375
+ ...DEFAULT_NUMBER_CONSTRAINTS,
376
+ ...constraints
377
+ };
364
378
  const constrained = pipe(
365
- input != null ? input : 0,
379
+ input ?? 0,
366
380
  clampInto(min, max),
367
381
  (n) => decimalPlaces ? round(n, decimalPlaces) : n
368
382
  );
@@ -396,20 +410,19 @@ var NumberInput = ({
396
410
  const allowDecimal = decimalPlaces === void 0 || decimalPlaces > 0;
397
411
  const handleBlur = () => {
398
412
  if (userHasMadeDeliberateChange.current) {
399
- set(refine(value != null ? value : null));
413
+ set(refine(value ?? null));
400
414
  setTemporaryEntry(null);
401
415
  }
402
416
  userHasMadeDeliberateChange.current = false;
403
417
  };
404
418
  const handleChange = (event) => {
405
- var _a2;
406
419
  if (onChange) onChange(event);
407
420
  if (set === void 0) return;
408
421
  userHasMadeDeliberateChange.current = true;
409
422
  const input = event.target.value;
410
423
  if (isValidNonNumber(input) || isDecimalInProgress(input)) {
411
424
  setTemporaryEntry(input);
412
- const textInterpretation = isDecimalInProgress(input) ? input : (_a2 = min == null ? void 0 : min.toString()) != null ? _a2 : `0`;
425
+ const textInterpretation = isDecimalInProgress(input) ? input : min?.toString() ?? `0`;
413
426
  const newValue = textToValue(textInterpretation, allowDecimal);
414
427
  set(refine(newValue));
415
428
  return;
@@ -421,7 +434,7 @@ var NumberInput = ({
421
434
  set(refine(numericValue));
422
435
  }
423
436
  };
424
- const displayValue = temporaryEntry != null ? temporaryEntry : valueToText(value ? refine(value) : value);
437
+ const displayValue = temporaryEntry ?? valueToText(value ? refine(value) : value);
425
438
  return /* @__PURE__ */ jsxs("span", { children: [
426
439
  label && /* @__PURE__ */ jsx("label", { htmlFor: id, children: label }),
427
440
  autoSize ? /* @__PURE__ */ jsx(
@@ -429,28 +442,28 @@ var NumberInput = ({
429
442
  {
430
443
  type: "text",
431
444
  value: displayValue,
432
- placeholder: placeholder != null ? placeholder : `-`,
445
+ placeholder: placeholder ?? `-`,
433
446
  onChange: handleChange,
434
447
  onBlur: handleBlur,
435
448
  disabled,
436
- name: name != null ? name : id,
449
+ name: name ?? id,
437
450
  id,
438
451
  onClick,
439
- "data-testid": `number-input-${testId != null ? testId : id}`
452
+ "data-testid": `number-input-${testId ?? id}`
440
453
  }
441
454
  ) : /* @__PURE__ */ jsx(
442
455
  "input",
443
456
  {
444
457
  type: "text",
445
458
  value: displayValue,
446
- placeholder: placeholder != null ? placeholder : `-`,
459
+ placeholder: placeholder ?? `-`,
447
460
  onChange: handleChange,
448
461
  onBlur: handleBlur,
449
462
  disabled,
450
- name: name != null ? name : id,
463
+ name: name ?? id,
451
464
  id,
452
465
  onClick,
453
- "data-testid": `number-input-${testId != null ? testId : id}`
466
+ "data-testid": `number-input-${testId ?? id}`
454
467
  }
455
468
  )
456
469
  ] });
@@ -469,7 +482,7 @@ var TextInput = ({
469
482
  {
470
483
  type: "text",
471
484
  value,
472
- onChange: (e) => set == null ? void 0 : set(e.target.value),
485
+ onChange: (e) => set?.(e.target.value),
473
486
  disabled: set === void 0,
474
487
  placeholder
475
488
  }
@@ -478,7 +491,7 @@ var TextInput = ({
478
491
  {
479
492
  type: "text",
480
493
  value,
481
- onChange: (e) => set == null ? void 0 : set(e.target.value),
494
+ onChange: (e) => set?.(e.target.value),
482
495
  disabled: set === void 0,
483
496
  placeholder
484
497
  }
@@ -683,7 +696,7 @@ var retrieveRef = ({
683
696
  refMap = result.refMap;
684
697
  }
685
698
  if (isJsonSchema(node)) {
686
- return { node, refMap: __spreadProps(__spreadValues({}, refMap), { [$ref]: node }) };
699
+ return { node, refMap: { ...refMap, [$ref]: node } };
687
700
  }
688
701
  throw new TypeError(`The refNode is not a JsonSchema`);
689
702
  };
@@ -808,12 +821,19 @@ var negationSchemaStructure = { not: isJsonSchema };
808
821
  function isNegationSchema(input) {
809
822
  return doesExtend(negationSchemaStructure)(input);
810
823
  }
811
- var mixedSchemaStructure = __spreadProps(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, arraySchemaStructure), booleanSchemaStructure), integerSchemaStructure), nullSchemaStructure), numberSchemaStructure), objectSchemaStructure), stringSchemaStructure), {
824
+ var mixedSchemaStructure = {
825
+ ...arraySchemaStructure,
826
+ ...booleanSchemaStructure,
827
+ ...integerSchemaStructure,
828
+ ...nullSchemaStructure,
829
+ ...numberSchemaStructure,
830
+ ...objectSchemaStructure,
831
+ ...stringSchemaStructure,
812
832
  type: isArray(isWithin(JSON_SCHEMA_TYPE_NAMES)),
813
833
  enum: ifDefined(
814
834
  isArray(isUnion.or(isInteger).or(isBoolean).or(isNumber).or(isString))
815
835
  )
816
- });
836
+ };
817
837
  function isMixedSchema(input) {
818
838
  return doesExtend(mixedSchemaStructure)(input);
819
839
  }
@@ -899,10 +919,7 @@ var stringToObject = (str) => {
899
919
  };
900
920
  var objectToString = (obj) => JSON.stringify(obj);
901
921
  var objectToBoolean = (obj) => obj.true === true;
902
- var objectToNumber = (obj) => {
903
- var _a2, _b2, _c;
904
- return Number((_c = (_b2 = (_a2 = obj.number) != null ? _a2 : obj.size) != null ? _b2 : obj.count) != null ? _c : 0);
905
- };
922
+ var objectToNumber = (obj) => Number(obj.number ?? obj.size ?? obj.count ?? 0);
906
923
  var objectToArray = (obj) => Object.entries(obj);
907
924
  var booleanToString = (bool) => bool.toString();
908
925
  var booleanToNumber = (bool) => +bool;
@@ -1026,7 +1043,7 @@ var castToJson = (input) => {
1026
1043
  var makePropertySetters = (data, set) => mapObject(
1027
1044
  data,
1028
1045
  (value, key) => (newValue) => {
1029
- set(__spreadProps(__spreadValues({}, data), { [key]: become(newValue)(value[key]) }));
1046
+ set({ ...data, [key]: become(newValue)(value[key]) });
1030
1047
  }
1031
1048
  );
1032
1049
  var makePropertyRenamers = (data, set, stableKeyMapRef) => mapObject(
@@ -1038,9 +1055,10 @@ var makePropertyRenamers = (data, set, stableKeyMapRef) => mapObject(
1038
1055
  const index = entries.findIndex(([k]) => k === key);
1039
1056
  entries[index] = [newKey, value];
1040
1057
  const stableKeyMap = stableKeyMapRef.current;
1041
- stableKeyMapRef.current = __spreadProps(__spreadValues({}, stableKeyMap), {
1058
+ stableKeyMapRef.current = {
1059
+ ...stableKeyMap,
1042
1060
  [newKey]: stableKeyMap[key]
1043
- });
1061
+ };
1044
1062
  return Object.fromEntries(entries);
1045
1063
  });
1046
1064
  }
@@ -1048,20 +1066,21 @@ var makePropertyRenamers = (data, set, stableKeyMapRef) => mapObject(
1048
1066
  );
1049
1067
  var makePropertyRemovers = (data, set) => mapObject(data, (_, key) => () => {
1050
1068
  set(() => {
1051
- const _a2 = data, rest = __objRest(_a2, [__restKey(key)]);
1069
+ const { [key]: __, ...rest } = data;
1052
1070
  return rest;
1053
1071
  });
1054
1072
  });
1055
1073
  var makePropertyRecasters = (data, set) => mapObject(
1056
1074
  data,
1057
1075
  (value, key) => (newType) => {
1058
- set(() => __spreadProps(__spreadValues({}, data), {
1076
+ set(() => ({
1077
+ ...data,
1059
1078
  [key]: castToJson(value).to[newType]()
1060
1079
  }));
1061
1080
  }
1062
1081
  );
1063
1082
  var makePropertyCreationInterface = (data, set) => (key, type) => (value) => {
1064
- set(__spreadProps(__spreadValues({}, data), { [key]: value != null ? value : JSON_DEFAULTS[type] }));
1083
+ set({ ...data, [key]: value ?? JSON_DEFAULTS[type] });
1065
1084
  };
1066
1085
  var makePropertySorter = (data, set, sortFn) => () => {
1067
1086
  const sortedKeys = Object.keys(data).sort(sortFn);
@@ -1100,7 +1119,6 @@ var ObjectEditor = ({
1100
1119
  set,
1101
1120
  Components
1102
1121
  }) => {
1103
- var _a2;
1104
1122
  const disabled = isReadonly(path);
1105
1123
  const stableKeyMap = useRef(
1106
1124
  Object.keys(data).reduce(
@@ -1118,7 +1136,7 @@ var ObjectEditor = ({
1118
1136
  const sortProperties = makePropertySorter(data, set);
1119
1137
  const makePropertyAdder = makePropertyCreationInterface(data, set);
1120
1138
  const subSchema = isPlainObject(schema) ? findSubSchema(schema)(path) : true;
1121
- const schemaKeys = isLiteral(true)(subSchema) ? true : isObjectSchema(subSchema) ? Object.keys((_a2 = subSchema.properties) != null ? _a2 : {}) : [];
1139
+ const schemaKeys = isLiteral(true)(subSchema) ? true : isObjectSchema(subSchema) ? Object.keys(subSchema.properties ?? {}) : [];
1122
1140
  const dataKeys = Object.keys(data);
1123
1141
  const [unofficialKeys, officialKeys] = dataKeys.reduce(
1124
1142
  ([unofficial, official], key) => {
@@ -1240,9 +1258,8 @@ var StringEditor = ({
1240
1258
  ) });
1241
1259
  };
1242
1260
  var DefaultFallback = ({ error, errorInfo }) => {
1243
- var _a2, _b2, _c;
1244
- const component = (_a2 = errorInfo == null ? void 0 : errorInfo.componentStack) == null ? void 0 : _a2.split(` `).filter(Boolean)[2];
1245
- const message = (_c = (_b2 = error == null ? void 0 : error.toString()) != null ? _b2 : errorInfo == null ? void 0 : errorInfo.componentStack) != null ? _c : `Unknown error`;
1261
+ const component = errorInfo?.componentStack?.split(` `).filter(Boolean)[2];
1262
+ const message = error?.toString() ?? errorInfo?.componentStack ?? `Unknown error`;
1246
1263
  return /* @__PURE__ */ jsx(
1247
1264
  "div",
1248
1265
  {
@@ -1292,8 +1309,7 @@ var ErrorBoundary = class extends Component {
1292
1309
  this.state = {};
1293
1310
  }
1294
1311
  componentDidCatch(error, errorInfo) {
1295
- var _a2, _b2;
1296
- (_b2 = (_a2 = this.props).onError) == null ? void 0 : _b2.call(_a2, error, errorInfo);
1312
+ this.props.onError?.(error, errorInfo);
1297
1313
  this.setState({
1298
1314
  error,
1299
1315
  errorInfo
@@ -1363,7 +1379,10 @@ var JsonEditor = ({
1363
1379
  style,
1364
1380
  Components: CustomComponents = {}
1365
1381
  }) => {
1366
- const Components = __spreadValues(__spreadValues({}, DEFAULT_JSON_EDITOR_COMPONENTS), CustomComponents);
1382
+ const Components = {
1383
+ ...DEFAULT_JSON_EDITOR_COMPONENTS,
1384
+ ...CustomComponents
1385
+ };
1367
1386
  return /* @__PURE__ */ jsx(
1368
1387
  JsonEditor_INTERNAL,
1369
1388
  {
@@ -1443,7 +1462,6 @@ var findStateTypeState = selectorFamily({
1443
1462
  }
1444
1463
  });
1445
1464
  var StateIndexLeafNode = ({ node, isOpenState, typeState }) => {
1446
- var _a2, _b2;
1447
1465
  const setIsOpen = useI(isOpenState);
1448
1466
  const isOpen = useO(isOpenState);
1449
1467
  const state = useO(node);
@@ -1470,7 +1488,7 @@ var StateIndexLeafNode = ({ node, isOpenState, typeState }) => {
1470
1488
  console.log(node, getState(node));
1471
1489
  },
1472
1490
  children: [
1473
- /* @__PURE__ */ jsx("h2", { children: (_b2 = (_a2 = node.family) == null ? void 0 : _a2.subKey) != null ? _b2 : node.key }),
1491
+ /* @__PURE__ */ jsx("h2", { children: node.family?.subKey ?? node.key }),
1474
1492
  /* @__PURE__ */ jsxs("span", { className: "type detail", children: [
1475
1493
  "(",
1476
1494
  stateType,
@@ -1489,7 +1507,7 @@ var StateIndexTreeNode = ({ node, isOpenState }) => {
1489
1507
  const isOpen = useO(isOpenState);
1490
1508
  for (const [key, childNode] of node.familyMembers) {
1491
1509
  findState(findViewIsOpenState, key);
1492
- findState(findStateTypeState, childNode);
1510
+ findState(findStateTypeState, childNode.key);
1493
1511
  }
1494
1512
  return /* @__PURE__ */ jsxs(Fragment, { children: [
1495
1513
  /* @__PURE__ */ jsxs("header", { children: [
@@ -1511,7 +1529,7 @@ var StateIndexTreeNode = ({ node, isOpenState }) => {
1511
1529
  {
1512
1530
  node: childNode,
1513
1531
  isOpenState: findState(findViewIsOpenState, childNode.key),
1514
- typeState: findState(findStateTypeState, childNode)
1532
+ typeState: findState(findStateTypeState, childNode.key)
1515
1533
  },
1516
1534
  key
1517
1535
  )) : null
@@ -1535,7 +1553,7 @@ var StateIndex = ({ tokenIndex }) => {
1535
1553
  {
1536
1554
  node,
1537
1555
  isOpenState: findState(findViewIsOpenState, node.key),
1538
- typeState: findState(findStateTypeState, node)
1556
+ typeState: findState(findStateTypeState, node.key)
1539
1557
  },
1540
1558
  key
1541
1559
  );
@@ -2,14 +2,11 @@
2
2
  "name": "atom.io-react-devtools",
3
3
  "type": "module",
4
4
  "private": true,
5
- "main": "dist/index.cjs",
6
- "module": "dist/index.js",
5
+ "main": "dist/index.js",
7
6
  "types": "dist/index.d.ts",
8
7
  "exports": {
9
8
  ".": {
10
9
  "import": "./dist/index.js",
11
- "browser": "./dist/index.js",
12
- "require": "./dist/index.cjs",
13
10
  "types": "./dist/index.d.ts"
14
11
  }
15
12
  }
@@ -6,6 +6,7 @@ import type {
6
6
  import { getState, selectorFamily } from "atom.io"
7
7
  import { findState } from "atom.io/ephemeral"
8
8
  import type { FamilyNode, WritableTokenIndex } from "atom.io/introspection"
9
+ import type { Canonical } from "atom.io/json"
9
10
  import { useI, useO } from "atom.io/react"
10
11
  import type { FC } from "react"
11
12
 
@@ -15,7 +16,7 @@ import { findViewIsOpenState, primitiveRefinery } from "."
15
16
  import { button } from "./Button"
16
17
  import { StoreEditor } from "./StateEditor"
17
18
 
18
- const findStateTypeState = selectorFamily<string, { key: string }>({
19
+ const findStateTypeState = selectorFamily<string, Canonical>({
19
20
  key: `👁‍🗨 State Type`,
20
21
  get:
21
22
  (token) =>
@@ -83,7 +84,7 @@ export const StateIndexTreeNode: FC<{
83
84
  const isOpen = useO(isOpenState)
84
85
  for (const [key, childNode] of node.familyMembers) {
85
86
  findState(findViewIsOpenState, key)
86
- findState(findStateTypeState, childNode)
87
+ findState(findStateTypeState, childNode.key)
87
88
  }
88
89
  return (
89
90
  <>
@@ -104,7 +105,7 @@ export const StateIndexTreeNode: FC<{
104
105
  key={key}
105
106
  node={childNode}
106
107
  isOpenState={findState(findViewIsOpenState, childNode.key)}
107
- typeState={findState(findStateTypeState, childNode)}
108
+ typeState={findState(findStateTypeState, childNode.key)}
108
109
  />
109
110
  ))
110
111
  : null}
@@ -147,7 +148,7 @@ export const StateIndex: FC<{
147
148
  key={key}
148
149
  node={node}
149
150
  isOpenState={findState(findViewIsOpenState, node.key)}
150
- typeState={findState(findStateTypeState, node)}
151
+ typeState={findState(findStateTypeState, node.key)}
151
152
  />
152
153
  )
153
154
  })}
@@ -1,6 +1,6 @@
1
1
  import * as atom_io from 'atom.io';
2
2
  import { AtomFamilyToken, ReadableFamilyToken, ReadableToken, AtomToken, TransactionToken, MutableAtomToken } from 'atom.io';
3
- import { Json } from 'atom.io/json';
3
+ import { Canonical, Json } from 'atom.io/json';
4
4
  import * as atom_io_data from 'atom.io/data';
5
5
  import { SetRTX, SetRTXJson } from 'atom.io/transceivers/set-rtx';
6
6
 
@@ -18,7 +18,7 @@ type ContinuityToken = {
18
18
  readonly key: string;
19
19
  readonly globals: AtomToken<any>[];
20
20
  readonly actions: TransactionToken<any>[];
21
- readonly perspectives: PerspectiveToken<AtomFamilyToken<any, Json.Serializable>, Json.Serializable>[];
21
+ readonly perspectives: PerspectiveToken<AtomFamilyToken<any, Canonical>, Json.Serializable>[];
22
22
  };
23
23
  declare class SyncGroup {
24
24
  protected readonly key: string;
@@ -46,6 +46,6 @@ type UserInRoomMeta = {
46
46
  };
47
47
  declare const DEFAULT_USER_IN_ROOM_META: UserInRoomMeta;
48
48
  declare const usersInRooms: atom_io_data.JoinToken<"room", "user", "1:n", UserInRoomMeta>;
49
- declare const usersInMyRoomView: atom_io.ReadonlySelectorFamilyTokenWithCall<MutableAtomToken<SetRTX<string>, SetRTXJson<string>>[], string>;
49
+ declare const usersInMyRoomView: atom_io.ReadonlySelectorFamilyToken<MutableAtomToken<SetRTX<string>, SetRTXJson<string>>[], string>;
50
50
 
51
51
  export { type ContinuityOptions, type ContinuityToken, DEFAULT_USER_IN_ROOM_META, InvariantMap, type PerspectiveToken, SyncGroup, type UserInRoomMeta, continuity, roomIndex, usersInMyRoomView, usersInRooms, usersInThisRoomIndex };
@@ -1,5 +1,5 @@
1
- import '../../dist/chunk-S4N6XNPH.js';
2
- import { assignTransactionToContinuity, IMPLICIT, setEpochNumberOfContinuity, getUpdateToken } from 'atom.io/internal';
1
+ import '../../dist/chunk-XWL6SNVU.js';
2
+ import { getUpdateToken, assignTransactionToContinuity, IMPLICIT, setEpochNumberOfContinuity } from 'atom.io/internal';
3
3
  import { atom, selectorFamily } from 'atom.io';
4
4
  import { join, getInternalRelations } from 'atom.io/data';
5
5
  import { SetRTX } from 'atom.io/transceivers/set-rtx';
@@ -19,14 +19,15 @@ var InvariantMap = class extends Map {
19
19
  throw new Error(`Cannot clear an InvariantMap`);
20
20
  }
21
21
  };
22
- var _SyncGroup = class _SyncGroup {
22
+ var SyncGroup = class _SyncGroup {
23
23
  constructor(key) {
24
24
  this.key = key;
25
- this.type = `continuity`;
26
- this.globals = [];
27
- this.actions = [];
28
- this.perspectives = [];
29
25
  }
26
+ type = `continuity`;
27
+ globals = [];
28
+ actions = [];
29
+ perspectives = [];
30
+ static existing = new InvariantMap();
30
31
  static create(key, builder) {
31
32
  const group = new _SyncGroup(key);
32
33
  const { type, globals, actions, perspectives } = builder(group);
@@ -62,8 +63,6 @@ var _SyncGroup = class _SyncGroup {
62
63
  return this;
63
64
  }
64
65
  };
65
- _SyncGroup.existing = new InvariantMap();
66
- var SyncGroup = _SyncGroup;
67
66
  function continuity(options) {
68
67
  const { key, config } = options;
69
68
  const token = SyncGroup.create(key, config);
@@ -2,14 +2,11 @@
2
2
  "name": "atom.io-realtime",
3
3
  "type": "module",
4
4
  "private": true,
5
- "main": "dist/index.cjs",
6
- "module": "dist/index.js",
5
+ "main": "dist/index.js",
7
6
  "types": "dist/index.d.ts",
8
7
  "exports": {
9
8
  ".": {
10
9
  "import": "./dist/index.js",
11
- "browser": "./dist/index.js",
12
- "require": "./dist/index.cjs",
13
10
  "types": "./dist/index.d.ts"
14
11
  }
15
12
  }
@@ -11,7 +11,7 @@ import {
11
11
  IMPLICIT,
12
12
  setEpochNumberOfContinuity,
13
13
  } from "atom.io/internal"
14
- import type { Json } from "atom.io/json"
14
+ import type { Canonical, Json } from "atom.io/json"
15
15
 
16
16
  export class InvariantMap<K, V> extends Map<K, V> {
17
17
  public set(key: K, value: V): this {
@@ -45,7 +45,7 @@ export type ContinuityToken = {
45
45
  readonly globals: AtomToken<any>[]
46
46
  readonly actions: TransactionToken<any>[]
47
47
  readonly perspectives: PerspectiveToken<
48
- AtomFamilyToken<any, Json.Serializable>,
48
+ AtomFamilyToken<any, Canonical>,
49
49
  Json.Serializable
50
50
  >[]
51
51
  }