atom.io 0.19.1 → 0.19.3

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 (117) hide show
  1. package/data/dist/index.cjs +99 -79
  2. package/data/dist/index.js +3 -3
  3. package/data/package.json +1 -1
  4. package/data/src/join.ts +67 -50
  5. package/dist/{chunk-YDOGCZ53.js → chunk-ATKDGVTV.js} +29 -29
  6. package/dist/{chunk-7VCCW45K.js → chunk-CC7IF7QF.js} +4 -3
  7. package/dist/{chunk-U2IICNHQ.js → chunk-F2X4B4VY.js} +5 -1
  8. package/dist/{chunk-WX2NCOZR.js → chunk-FTONNX2R.js} +8 -8
  9. package/dist/{chunk-7ZR244C2.js → chunk-MSCJWACE.js} +92 -72
  10. package/dist/index.cjs +14 -7
  11. package/dist/index.d.ts +23 -35
  12. package/dist/index.js +15 -8
  13. package/eslint-plugin/dist/index.cjs +180 -0
  14. package/eslint-plugin/dist/index.js +171 -0
  15. package/eslint-plugin/package.json +16 -0
  16. package/eslint-plugin/src/index.ts +11 -0
  17. package/eslint-plugin/src/rules/index.ts +1 -0
  18. package/eslint-plugin/src/rules/synchronous-selector-dependencies.ts +190 -0
  19. package/internal/dist/index.cjs +55 -43
  20. package/internal/dist/index.d.ts +20 -20
  21. package/internal/dist/index.js +49 -37
  22. package/internal/package.json +1 -1
  23. package/internal/src/atom/create-regular-atom.ts +7 -5
  24. package/internal/src/atom/delete-atom.ts +2 -2
  25. package/internal/src/families/create-readonly-selector-family.ts +2 -2
  26. package/internal/src/families/create-regular-atom-family.ts +1 -1
  27. package/internal/src/families/create-writable-selector-family.ts +1 -1
  28. package/internal/src/future.ts +4 -2
  29. package/internal/src/lineage.ts +1 -0
  30. package/internal/src/mutable/create-mutable-atom-family.ts +1 -1
  31. package/internal/src/mutable/create-mutable-atom.ts +7 -5
  32. package/internal/src/mutable/tracker.ts +3 -3
  33. package/internal/src/mutable/transceiver.ts +2 -2
  34. package/internal/src/selector/delete-selector.ts +1 -1
  35. package/internal/src/set-state/copy-mutable-if-needed.ts +1 -1
  36. package/internal/src/store/deposit.ts +5 -5
  37. package/internal/src/store/store.ts +5 -5
  38. package/internal/src/store/withdraw.ts +4 -5
  39. package/internal/src/subject.ts +3 -1
  40. package/internal/src/subscribe/subscribe-to-transaction.ts +4 -4
  41. package/internal/src/timeline/add-atom-to-timeline.ts +13 -8
  42. package/internal/src/timeline/create-timeline.ts +3 -4
  43. package/internal/src/transaction/act-upon-store.ts +5 -5
  44. package/internal/src/transaction/apply-transaction.ts +4 -4
  45. package/internal/src/transaction/build-transaction.ts +9 -6
  46. package/internal/src/transaction/create-transaction.ts +10 -10
  47. package/internal/src/transaction/index.ts +3 -3
  48. package/internal/src/transaction/is-root-store.ts +2 -2
  49. package/introspection/dist/index.d.ts +3 -3
  50. package/introspection/dist/index.js +1 -1
  51. package/introspection/package.json +1 -1
  52. package/introspection/src/attach-introspection-states.ts +3 -3
  53. package/introspection/src/attach-transaction-index.ts +4 -4
  54. package/introspection/src/attach-transaction-logs.ts +8 -4
  55. package/json/dist/index.cjs +6 -2
  56. package/json/dist/index.js +7 -3
  57. package/json/package.json +1 -1
  58. package/json/src/select-json-family.ts +3 -2
  59. package/json/src/select-json.ts +3 -1
  60. package/package.json +258 -241
  61. package/react/dist/index.cjs +9 -3
  62. package/react/dist/index.js +10 -4
  63. package/react/package.json +1 -1
  64. package/react/src/use-i.ts +3 -1
  65. package/react/src/use-tl.ts +6 -2
  66. package/react-devtools/dist/index.cjs +205 -155
  67. package/react-devtools/dist/index.d.ts +3 -5
  68. package/react-devtools/dist/index.js +182 -133
  69. package/react-devtools/package.json +1 -1
  70. package/react-devtools/src/AtomIODevtools.tsx +3 -1
  71. package/react-devtools/src/Button.tsx +3 -1
  72. package/react-devtools/src/StateIndex.tsx +6 -2
  73. package/react-devtools/src/TimelineIndex.tsx +6 -2
  74. package/react-devtools/src/TransactionIndex.tsx +3 -3
  75. package/react-devtools/src/Updates.tsx +24 -13
  76. package/realtime/dist/index.cjs +1 -0
  77. package/realtime/dist/index.d.ts +2 -2
  78. package/realtime/dist/index.js +2 -1
  79. package/realtime/package.json +1 -1
  80. package/realtime/src/realtime-continuity.ts +4 -3
  81. package/realtime-client/dist/index.cjs +29 -29
  82. package/realtime-client/dist/index.d.ts +2 -2
  83. package/realtime-client/dist/index.js +2 -2
  84. package/realtime-client/package.json +1 -1
  85. package/realtime-client/src/server-action.ts +2 -2
  86. package/realtime-client/src/sync-continuity.ts +23 -23
  87. package/realtime-react/dist/index.cjs +29 -29
  88. package/realtime-react/dist/index.d.ts +2 -2
  89. package/realtime-react/dist/index.js +2 -2
  90. package/realtime-react/package.json +1 -1
  91. package/realtime-react/src/use-server-action.ts +3 -3
  92. package/realtime-server/dist/index.cjs +54 -44
  93. package/realtime-server/dist/index.d.ts +5 -5
  94. package/realtime-server/dist/index.js +35 -25
  95. package/realtime-server/package.json +1 -1
  96. package/realtime-server/src/ipc-sockets/child-socket.ts +6 -6
  97. package/realtime-server/src/ipc-sockets/custom-socket.ts +4 -8
  98. package/realtime-server/src/ipc-sockets/parent-socket.ts +13 -7
  99. package/realtime-server/src/realtime-action-receiver.ts +7 -5
  100. package/realtime-server/src/realtime-continuity-synchronizer.ts +3 -3
  101. package/realtime-server/src/realtime-state-receiver.ts +3 -1
  102. package/realtime-testing/dist/index.cjs +15 -13
  103. package/realtime-testing/dist/index.js +10 -8
  104. package/realtime-testing/package.json +1 -1
  105. package/realtime-testing/src/setup-realtime-test.tsx +6 -4
  106. package/src/atom.ts +4 -8
  107. package/src/dispose.ts +1 -0
  108. package/src/index.ts +2 -9
  109. package/src/selector.ts +4 -8
  110. package/src/silo.ts +9 -3
  111. package/src/subscribe.ts +6 -6
  112. package/src/timeline.ts +4 -4
  113. package/src/transaction.ts +24 -24
  114. package/transceivers/set-rtx/dist/index.cjs +11 -12
  115. package/transceivers/set-rtx/dist/index.js +12 -13
  116. package/transceivers/set-rtx/package.json +1 -1
  117. package/transceivers/set-rtx/src/set-rtx.ts +10 -10
@@ -14,18 +14,18 @@ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
14
14
  var __hasOwnProp = Object.prototype.hasOwnProperty;
15
15
  var __propIsEnum = Object.prototype.propertyIsEnumerable;
16
16
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17
- var __spreadValues = (a2, b2) => {
18
- for (var prop in b2 || (b2 = {}))
19
- if (__hasOwnProp.call(b2, prop))
20
- __defNormalProp(a2, prop, b2[prop]);
17
+ var __spreadValues = (a, b) => {
18
+ for (var prop in b || (b = {}))
19
+ if (__hasOwnProp.call(b, prop))
20
+ __defNormalProp(a, prop, b[prop]);
21
21
  if (__getOwnPropSymbols)
22
- for (var prop of __getOwnPropSymbols(b2)) {
23
- if (__propIsEnum.call(b2, prop))
24
- __defNormalProp(a2, prop, b2[prop]);
22
+ for (var prop of __getOwnPropSymbols(b)) {
23
+ if (__propIsEnum.call(b, prop))
24
+ __defNormalProp(a, prop, b[prop]);
25
25
  }
26
- return a2;
26
+ return a;
27
27
  };
28
- var __spreadProps = (a2, b2) => __defProps(a2, __getOwnPropDescs(b2));
28
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
29
29
  var __restKey = (key) => typeof key === "symbol" ? key : key + "";
30
30
  var __objRest = (source, exclude) => {
31
31
  var target = {};
@@ -41,26 +41,26 @@ var __objRest = (source, exclude) => {
41
41
  };
42
42
 
43
43
  // ../anvl/src/function/pipe.ts
44
- function pipe(a2, ab, bc, cd, de, ef, fg, gh, hi) {
44
+ function pipe(a, ab, bc, cd, de, ef, fg, gh, hi) {
45
45
  switch (arguments.length) {
46
46
  case 1:
47
- return a2;
47
+ return a;
48
48
  case 2:
49
- return ab(a2);
49
+ return ab(a);
50
50
  case 3:
51
- return bc(ab(a2));
51
+ return bc(ab(a));
52
52
  case 4:
53
- return cd(bc(ab(a2)));
53
+ return cd(bc(ab(a)));
54
54
  case 5:
55
- return de(cd(bc(ab(a2))));
55
+ return de(cd(bc(ab(a))));
56
56
  case 6:
57
- return ef(de(cd(bc(ab(a2)))));
57
+ return ef(de(cd(bc(ab(a)))));
58
58
  case 7:
59
- return fg(ef(de(cd(bc(ab(a2))))));
59
+ return fg(ef(de(cd(bc(ab(a))))));
60
60
  case 8:
61
- return gh(fg(ef(de(cd(bc(ab(a2)))))));
61
+ return gh(fg(ef(de(cd(bc(ab(a)))))));
62
62
  case 9:
63
- return hi(gh(fg(ef(de(cd(bc(ab(a2))))))));
63
+ return hi(gh(fg(ef(de(cd(bc(ab(a))))))));
64
64
  default: {
65
65
  let ret = arguments[0];
66
66
  for (let i = 1; i < arguments.length; i++) {
@@ -90,8 +90,8 @@ var fallback = (fn, fallbackValue) => {
90
90
 
91
91
  // ../anvl/src/array/index.ts
92
92
  var isArray = (isType) => (input) => Array.isArray(input) && input.every((item) => isType(item));
93
- var map = (f) => (a2) => a2.map(f);
94
- var every = (f = Boolean) => (a2) => a2.every(f);
93
+ var map = (f) => (a) => a.map(f);
94
+ var every = (f = Boolean) => (a) => a.every(f);
95
95
  var allTrue = every((x) => x === true);
96
96
 
97
97
  // ../anvl/src/nullish/index.ts
@@ -152,14 +152,15 @@ var doesExtend = (isValue) => hasProperties(isValue, ALLOW_EXTENSION);
152
152
  // ../anvl/src/object/sprawl.ts
153
153
  var sprawl = (tree, inspector) => {
154
154
  const walk = (path, node) => {
155
- const inspect = (path2, node2) => {
156
- const result2 = inspector(path2, node2);
155
+ var _a;
156
+ const inspect = (p, n) => {
157
+ const result2 = inspector(p, n);
157
158
  if (result2)
158
159
  return result2;
159
160
  return null;
160
161
  };
161
162
  const result = inspect(path, node);
162
- if ((result == null ? void 0 : result.jobComplete) || (result == null ? void 0 : result.pathComplete)) {
163
+ if ((_a = result == null ? void 0 : result.jobComplete) != null ? _a : result == null ? void 0 : result.pathComplete) {
163
164
  return result;
164
165
  }
165
166
  const childEntries = Array.isArray(node) ? node.map((v, i) => [i, v]) : isPlainObject(node) ? Object.entries(node) : [];
@@ -199,7 +200,7 @@ var Refinery = class {
199
200
  if (input instanceof refiner) {
200
201
  return { type: key, data: input };
201
202
  }
202
- } catch (e2) {
203
+ } catch (_) {
203
204
  }
204
205
  }
205
206
  }
@@ -267,14 +268,14 @@ var refineJsonType = (data) => data === null ? { type: `null`, data: null } : is
267
268
  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.`
268
269
  );
269
270
  var isJson = (input) => {
270
- var _a2;
271
+ var _a;
271
272
  if (input === null)
272
273
  return true;
273
274
  if (input === void 0)
274
275
  return false;
275
- const prototype = (_a2 = Object.getPrototypeOf(input)) == null ? void 0 : _a2.constructor.name;
276
- const isJson2 = JSON_PROTOTYPES.includes(prototype);
277
- return isJson2;
276
+ const prototype = (_a = Object.getPrototypeOf(input)) == null ? void 0 : _a.constructor.name;
277
+ const refine = JSON_PROTOTYPES.includes(prototype);
278
+ return refine;
278
279
  };
279
280
 
280
281
  // ../anvl/src/refinement/can-exist.ts
@@ -289,11 +290,11 @@ var mustSatisfyOneOfTheFollowing = (isTypeA, logging = false, refinements = [isT
289
290
  const _ = {
290
291
  [name]: (input) => refinements.some(
291
292
  (refinement) => {
292
- var _a2;
293
+ var _a;
293
294
  return logging && console.log(
294
295
  refinements.map((r) => r.name || `anon`).join(` | `),
295
296
  `>`,
296
- (_a2 = refinement.name) != null ? _a2 : `anon`,
297
+ (_a = refinement.name) != null ? _a : `anon`,
297
298
  `:`,
298
299
  refinement(input)
299
300
  ), refinement(input);
@@ -336,32 +337,32 @@ var isLiteral = (value) => (input) => input === value;
336
337
  var isWithin = (args) => (input) => args.includes(input);
337
338
 
338
339
  // ../anvl/src/tree/differ.ts
339
- function diffNumber(a2, b2) {
340
- const sign = a2 < b2 ? `+` : `-`;
340
+ function diffNumber(a, b) {
341
+ const sign = a < b ? `+` : `-`;
341
342
  return {
342
- summary: `${sign}${Math.abs(a2 - b2)} (${a2} \u2192 ${b2})`
343
+ summary: `${sign}${Math.abs(a - b)} (${a} \u2192 ${b})`
343
344
  };
344
345
  }
345
- function diffString(a2, b2) {
346
- const sign = a2.length < b2.length ? `+` : `-`;
346
+ function diffString(a, b) {
347
+ const sign = a.length < b.length ? `+` : `-`;
347
348
  return {
348
- summary: `${sign}${Math.abs(a2.length - b2.length)} ("${a2}" \u2192 "${b2}")`
349
+ summary: `${sign}${Math.abs(a.length - b.length)} ("${a}" \u2192 "${b}")`
349
350
  };
350
351
  }
351
- function diffBoolean(a2, b2) {
352
+ function diffBoolean(a, b) {
352
353
  return {
353
- summary: `${a2} \u2192 ${b2}`
354
+ summary: `${a} \u2192 ${b}`
354
355
  };
355
356
  }
356
- function diffObject(a2, b2, recurse) {
357
+ function diffObject(a, b, recurse) {
357
358
  let summary = ``;
358
359
  const added = [];
359
360
  const removed = [];
360
361
  const changed = [];
361
- sprawl(a2, (path, nodeA) => {
362
+ sprawl(a, (path, nodeA) => {
362
363
  let key;
363
364
  for (key of path) {
364
- const nodeB = b2[key];
365
+ const nodeB = b[key];
365
366
  if (nodeB === void 0) {
366
367
  removed.push([key, JSON.stringify(nodeA)]);
367
368
  } else {
@@ -372,10 +373,10 @@ function diffObject(a2, b2, recurse) {
372
373
  }
373
374
  }
374
375
  });
375
- sprawl(b2, (path, nodeB) => {
376
+ sprawl(b, (path, nodeB) => {
376
377
  let key;
377
378
  for (key of path) {
378
- const nodeA = a2[key];
379
+ const nodeA = a[key];
379
380
  if (nodeA === void 0) {
380
381
  added.push([key, JSON.stringify(nodeB)]);
381
382
  }
@@ -389,8 +390,8 @@ function diffObject(a2, b2, recurse) {
389
390
  changed
390
391
  };
391
392
  }
392
- function diffArray(a2, b2, recurse) {
393
- return diffObject(a2, b2, recurse);
393
+ function diffArray(a, b, recurse) {
394
+ return diffObject(a, b, recurse);
394
395
  }
395
396
  var Differ = class {
396
397
  constructor(leafRefinery, treeRefinery, diffFunctions) {
@@ -407,20 +408,20 @@ var Differ = class {
407
408
  this.treeDiffers[key] = diffFunction;
408
409
  }
409
410
  }
410
- diff(a2, b2) {
411
- var _a2, _b;
412
- if (a2 === b2) {
411
+ diff(a, b) {
412
+ var _a, _b;
413
+ if (a === b) {
413
414
  return { summary: `No Change` };
414
415
  }
415
416
  try {
416
- if (JSON.stringify(a2) === JSON.stringify(b2)) {
417
+ if (JSON.stringify(a) === JSON.stringify(b)) {
417
418
  return { summary: `No Change` };
418
419
  }
419
420
  } catch (thrown) {
420
- console.error(`Error stringifying`, a2, b2);
421
+ console.error(`Error stringifying`, a, b);
421
422
  }
422
- const aRefined = (_a2 = this.leafRefinery.refine(a2)) != null ? _a2 : this.treeRefinery.refine(a2);
423
- const bRefined = (_b = this.leafRefinery.refine(b2)) != null ? _b : this.treeRefinery.refine(b2);
423
+ const aRefined = (_a = this.leafRefinery.refine(a)) != null ? _a : this.treeRefinery.refine(a);
424
+ const bRefined = (_b = this.leafRefinery.refine(b)) != null ? _b : this.treeRefinery.refine(b);
424
425
  if (aRefined !== null && bRefined !== null) {
425
426
  if (aRefined.type === bRefined.type) {
426
427
  if (aRefined.type in this.leafDiffers) {
@@ -440,8 +441,8 @@ var Differ = class {
440
441
  }
441
442
  }
442
443
  }
443
- const typeA = discoverType(a2);
444
- const typeB = discoverType(b2);
444
+ const typeA = discoverType(a);
445
+ const typeB = discoverType(b);
445
446
  if (typeA === typeB) {
446
447
  return {
447
448
  summary: `${typeA} \u2192 ${typeB}`
@@ -474,7 +475,9 @@ var OpenClose = ({ isOpen, setIsOpen, disabled, testid }) => {
474
475
  type: "button",
475
476
  "data-testid": testid,
476
477
  className: `carat ${isOpen ? `open` : `closed`}`,
477
- onClick: () => setIsOpen((isOpen2) => !isOpen2),
478
+ onClick: () => {
479
+ setIsOpen((prev) => !prev);
480
+ },
478
481
  disabled,
479
482
  children: "\u25B6"
480
483
  }
@@ -484,7 +487,7 @@ var button = {
484
487
  OpenClose
485
488
  };
486
489
  var ElasticInput = react.forwardRef(function ElasticInputFC(props, ref) {
487
- var _a2, _b, _c, _d;
490
+ var _a, _b, _c, _d, _e, _f;
488
491
  const inputRef = react.useRef(null);
489
492
  const spanRef = react.useRef(null);
490
493
  const [inputWidth, setInputWidth] = react.useState(`auto`);
@@ -492,8 +495,8 @@ var ElasticInput = react.forwardRef(function ElasticInputFC(props, ref) {
492
495
  ref,
493
496
  () => ({
494
497
  focus: () => {
495
- var _a3;
496
- (_a3 = inputRef.current) == null ? void 0 : _a3.focus();
498
+ var _a2;
499
+ (_a2 = inputRef.current) == null ? void 0 : _a2.focus();
497
500
  }
498
501
  })
499
502
  );
@@ -506,9 +509,11 @@ var ElasticInput = react.forwardRef(function ElasticInputFC(props, ref) {
506
509
  setInputWidth(`${spanRef.current.offsetWidth + extraWidth}px`);
507
510
  }
508
511
  }, 1e3);
509
- return () => clearInterval(interval);
512
+ return () => {
513
+ clearInterval(interval);
514
+ };
510
515
  }
511
- }, [(_a2 = inputRef.current) == null ? void 0 : _a2.value, props.value]);
516
+ }, [(_a = inputRef.current) == null ? void 0 : _a.value, props.value]);
512
517
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: `inline-block`, position: `relative` }, children: [
513
518
  /* @__PURE__ */ jsxRuntime.jsx(
514
519
  "input",
@@ -534,8 +539,8 @@ var ElasticInput = react.forwardRef(function ElasticInputFC(props, ref) {
534
539
  visibility: `hidden`,
535
540
  // color: `red`,
536
541
  whiteSpace: `pre`,
537
- fontFamily: ((_c = props.style) == null ? void 0 : _c.fontFamily) || `inherit`,
538
- fontSize: ((_d = props.style) == null ? void 0 : _d.fontSize) || `inherit`
542
+ fontFamily: (_d = (_c = props.style) == null ? void 0 : _c.fontFamily) != null ? _d : `inherit`,
543
+ fontSize: (_f = (_e = props.style) == null ? void 0 : _e.fontSize) != null ? _f : `inherit`
539
544
  },
540
545
  children: props.value
541
546
  }
@@ -617,7 +622,7 @@ var NumberInput = ({
617
622
  userHasMadeDeliberateChange.current = false;
618
623
  };
619
624
  const handleChange = (event) => {
620
- var _a2;
625
+ var _a;
621
626
  if (onChange)
622
627
  onChange(event);
623
628
  if (set === void 0)
@@ -626,7 +631,7 @@ var NumberInput = ({
626
631
  const input = event.target.value;
627
632
  if (isValidNonNumber(input) || isDecimalInProgress(input)) {
628
633
  setTemporaryEntry(input);
629
- const textInterpretation = isDecimalInProgress(input) ? input : (_a2 = min == null ? void 0 : min.toString()) != null ? _a2 : `0`;
634
+ const textInterpretation = isDecimalInProgress(input) ? input : (_a = min == null ? void 0 : min.toString()) != null ? _a : `0`;
630
635
  const newValue = textToValue(textInterpretation, allowDecimal);
631
636
  set(refine(newValue));
632
637
  return;
@@ -745,7 +750,9 @@ var JsonEditor_INTERNAL = ({
745
750
  ElasticInput,
746
751
  {
747
752
  value: name,
748
- onChange: disabled ? doNothing : (e) => rename(e.target.value),
753
+ onChange: disabled ? doNothing : (e) => {
754
+ rename(e.target.value);
755
+ },
749
756
  disabled
750
757
  }
751
758
  ) }),
@@ -766,7 +773,9 @@ var JsonEditor_INTERNAL = ({
766
773
  recast && dataIsJson ? /* @__PURE__ */ jsxRuntime.jsx(
767
774
  "select",
768
775
  {
769
- onChange: disabled ? doNothing : (e) => recast(e.target.value),
776
+ onChange: disabled ? doNothing : (e) => {
777
+ recast(e.target.value);
778
+ },
770
779
  value: refined.type,
771
780
  disabled,
772
781
  children: Object.keys(SubEditors).map((type) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: type, children: type }, type))
@@ -776,13 +785,13 @@ var JsonEditor_INTERNAL = ({
776
785
  };
777
786
 
778
787
  // ../hamr/react-json-editor/src/editors-by-type/utilities/array-elements.ts
779
- var makeElementSetters = (data, set) => data.map(
780
- (value, index) => (newValue) => set(() => {
788
+ var makeElementSetters = (data, set) => data.map((value, index) => (newValue) => {
789
+ set(() => {
781
790
  const newData = [...data];
782
791
  newData[index] = become(newValue)(value);
783
792
  return newData;
784
- })
785
- );
793
+ });
794
+ });
786
795
  var ArrayEditor = ({
787
796
  path = [],
788
797
  isReadonly = () => false,
@@ -816,19 +825,6 @@ var parseInteger = (input) => {
816
825
  return input;
817
826
  throw new IntegerParseError(input);
818
827
  };
819
- var _a;
820
- var Fraction = class extends Number {
821
- constructor(n, d) {
822
- super(n / d);
823
- this[_a] = () => this.numerator / this.denominator;
824
- if (d === 0) {
825
- throw new Error(`Denominator cannot be zero`);
826
- }
827
- this.numerator = parseInteger(n);
828
- this.denominator = parseInteger(d);
829
- }
830
- };
831
- _a = Symbol.toPrimitive;
832
828
  var IntegerParseError = class extends Error {
833
829
  constructor(value) {
834
830
  super(`Could not parse integer from ${JSON.stringify(value)}`);
@@ -863,12 +859,6 @@ var Int = Object.assign((input) => parseInteger(input), {
863
859
  };
864
860
  }
865
861
  });
866
- function asNumber(input) {
867
- return input;
868
- }
869
- asNumber(new Fraction(1, 2));
870
- asNumber([new Fraction(1, 2)]);
871
- asNumber({ a: new Fraction(1, 2) });
872
862
 
873
863
  // ../anvl/src/json-schema/refs.ts
874
864
  function isJsonSchemaRef(input) {
@@ -1079,7 +1069,9 @@ var expandPathForSchema = (path) => {
1079
1069
  );
1080
1070
  default:
1081
1071
  throw new TypeError(
1082
- `The key ${key} is not a valid JSON key; expected string or number, got ${typeof key}`
1072
+ `The key ${JSON.stringify(
1073
+ key
1074
+ )} is not a valid JSON key; expected string or number, got ${typeof key}`
1083
1075
  );
1084
1076
  }
1085
1077
  });
@@ -1102,10 +1094,11 @@ var findSubSchema = (schema) => {
1102
1094
  if (typeof schema === `boolean`) {
1103
1095
  return new TypeError(`The schema is not a JsonSchema`);
1104
1096
  }
1105
- const { node, refMap } = pathIntoSchema.reduce(
1097
+ const reduction = pathIntoSchema.reduce(
1106
1098
  ({ node: node2, refMap: refMap2 = void 0 }, key) => (console.log({ node: node2, key }), isJsonSchemaRef(node2) ? retrieveRef({ refNode: node2, root: schema, refMap: refMap2 }) : { node: node2[key], refMap: refMap2 }),
1107
1099
  { node: schema, refMap: void 0 }
1108
1100
  );
1101
+ const { node, refMap } = reduction;
1109
1102
  if (node instanceof Error)
1110
1103
  throw node;
1111
1104
  let subSchema = node;
@@ -1135,8 +1128,8 @@ var stringToObject = (str) => {
1135
1128
  var objectToString = (obj) => JSON.stringify(obj);
1136
1129
  var objectToBoolean = (obj) => obj.true === true;
1137
1130
  var objectToNumber = (obj) => {
1138
- var _a2, _b, _c;
1139
- return Number((_c = (_b = (_a2 = obj.number) != null ? _a2 : obj.size) != null ? _b : obj.count) != null ? _c : 0);
1131
+ var _a, _b, _c;
1132
+ return Number((_c = (_b = (_a = obj.number) != null ? _a : obj.size) != null ? _b : obj.count) != null ? _c : 0);
1140
1133
  };
1141
1134
  var objectToArray = (obj) => Object.entries(obj);
1142
1135
  var booleanToString = (bool) => bool.toString();
@@ -1260,35 +1253,44 @@ var castToJson = (input) => {
1260
1253
  // ../hamr/react-json-editor/src/editors-by-type/utilities/object-properties.ts
1261
1254
  var makePropertySetters = (data, set) => mapObject(
1262
1255
  data,
1263
- (value, key) => (newValue) => set(__spreadProps(__spreadValues({}, data), { [key]: become(newValue)(value[key]) }))
1256
+ (value, key) => (newValue) => {
1257
+ set(__spreadProps(__spreadValues({}, data), { [key]: become(newValue)(value[key]) }));
1258
+ }
1264
1259
  );
1265
1260
  var makePropertyRenamers = (data, set, stableKeyMapRef) => mapObject(
1266
1261
  data,
1267
- (value, key) => (newKey) => Object.hasOwn(data, newKey) ? null : set(() => {
1268
- const entries = Object.entries(data);
1269
- const index = entries.findIndex(([k]) => k === key);
1270
- entries[index] = [newKey, value];
1271
- const stableKeyMap = stableKeyMapRef.current;
1272
- stableKeyMapRef.current = __spreadProps(__spreadValues({}, stableKeyMap), {
1273
- [newKey]: stableKeyMap[key]
1274
- });
1275
- return Object.fromEntries(entries);
1276
- })
1262
+ (value, key) => (newKey) => {
1263
+ if (!Object.hasOwn(data, newKey)) {
1264
+ set(() => {
1265
+ const entries = Object.entries(data);
1266
+ const index = entries.findIndex(([k]) => k === key);
1267
+ entries[index] = [newKey, value];
1268
+ const stableKeyMap = stableKeyMapRef.current;
1269
+ stableKeyMapRef.current = __spreadProps(__spreadValues({}, stableKeyMap), {
1270
+ [newKey]: stableKeyMap[key]
1271
+ });
1272
+ return Object.fromEntries(entries);
1273
+ });
1274
+ }
1275
+ }
1277
1276
  );
1278
- var makePropertyRemovers = (data, set) => mapObject(
1279
- data,
1280
- (_, key) => () => set(() => {
1281
- const _a2 = data, rest = __objRest(_a2, [__restKey(key)]);
1277
+ var makePropertyRemovers = (data, set) => mapObject(data, (_, key) => () => {
1278
+ set(() => {
1279
+ const _a = data, rest = __objRest(_a, [__restKey(key)]);
1282
1280
  return rest;
1283
- })
1284
- );
1281
+ });
1282
+ });
1285
1283
  var makePropertyRecasters = (data, set) => mapObject(
1286
1284
  data,
1287
- (value, key) => (newType) => set(() => __spreadProps(__spreadValues({}, data), {
1288
- [key]: castToJson(value).to[newType]()
1289
- }))
1285
+ (value, key) => (newType) => {
1286
+ set(() => __spreadProps(__spreadValues({}, data), {
1287
+ [key]: castToJson(value).to[newType]()
1288
+ }));
1289
+ }
1290
1290
  );
1291
- var makePropertyCreationInterface = (data, set) => (key, type) => (value) => set(__spreadProps(__spreadValues({}, data), { [key]: value != null ? value : JSON_DEFAULTS[type] }));
1291
+ var makePropertyCreationInterface = (data, set) => (key, type) => (value) => {
1292
+ set(__spreadProps(__spreadValues({}, data), { [key]: value != null ? value : JSON_DEFAULTS[type] }));
1293
+ };
1292
1294
  var makePropertySorter = (data, set, sortFn) => () => {
1293
1295
  const sortedKeys = Object.keys(data).sort(sortFn);
1294
1296
  const sortedObj = {};
@@ -1306,7 +1308,16 @@ var PropertyAdder = ({
1306
1308
  /* @__PURE__ */ jsxRuntime.jsx(ElasticInput, { disabled: true, defaultValue: propertyKey }),
1307
1309
  ` `,
1308
1310
  /* @__PURE__ */ jsxRuntime.jsx(ElasticInput, { disabled: true, defaultValue: "is missing" }),
1309
- /* @__PURE__ */ jsxRuntime.jsx(Components.Button, { onClick: () => addProperty(), disabled, children: "+" })
1311
+ /* @__PURE__ */ jsxRuntime.jsx(
1312
+ Components.Button,
1313
+ {
1314
+ onClick: () => {
1315
+ addProperty();
1316
+ },
1317
+ disabled,
1318
+ children: "+"
1319
+ }
1320
+ )
1310
1321
  ] });
1311
1322
  var ObjectEditor = ({
1312
1323
  schema,
@@ -1317,7 +1328,7 @@ var ObjectEditor = ({
1317
1328
  set,
1318
1329
  Components
1319
1330
  }) => {
1320
- var _a2;
1331
+ var _a;
1321
1332
  const disabled = isReadonly(path);
1322
1333
  const stableKeyMap = react.useRef(
1323
1334
  Object.keys(data).reduce(
@@ -1335,7 +1346,7 @@ var ObjectEditor = ({
1335
1346
  const sortProperties = makePropertySorter(data, set);
1336
1347
  const makePropertyAdder = makePropertyCreationInterface(data, set);
1337
1348
  const subSchema = isPlainObject(schema) ? findSubSchema(schema)(path) : true;
1338
- const schemaKeys = isLiteral(true)(subSchema) ? true : isObjectSchema(subSchema) ? Object.keys((_a2 = subSchema.properties) != null ? _a2 : {}) : [];
1349
+ const schemaKeys = isLiteral(true)(subSchema) ? true : isObjectSchema(subSchema) ? Object.keys((_a = subSchema.properties) != null ? _a : {}) : [];
1339
1350
  const dataKeys = Object.keys(data);
1340
1351
  const [unofficialKeys, officialKeys] = dataKeys.reduce(
1341
1352
  ([unofficial, official], key) => {
@@ -1346,7 +1357,16 @@ var ObjectEditor = ({
1346
1357
  );
1347
1358
  const missingKeys = schemaKeys === true ? [] : schemaKeys.filter((key) => !dataKeys.includes(key));
1348
1359
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1349
- /* @__PURE__ */ jsxRuntime.jsx(Components.Button, { onClick: () => sortProperties(), disabled, children: "Sort" }),
1360
+ /* @__PURE__ */ jsxRuntime.jsx(
1361
+ Components.Button,
1362
+ {
1363
+ onClick: () => {
1364
+ sortProperties();
1365
+ },
1366
+ disabled,
1367
+ children: "Sort"
1368
+ }
1369
+ ),
1350
1370
  /* @__PURE__ */ jsxRuntime.jsxs(Components.ObjectWrapper, { children: [
1351
1371
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "json_editor_properties", children: [...missingKeys, ...officialKeys, ...unofficialKeys].map((key) => {
1352
1372
  const originalKey = stableKeyMap.current[key];
@@ -1354,16 +1374,19 @@ var ObjectEditor = ({
1354
1374
  const originalPath = [...path, originalKey];
1355
1375
  const isOfficial = schemaKeys === true || schemaKeys.includes(key);
1356
1376
  const isMissing = missingKeys.includes(key);
1357
- return isMissing ? /* @__PURE__ */ jsxRuntime.jsx(
1358
- PropertyAdder,
1359
- {
1360
- propertyKey: key,
1361
- addProperty: makePropertyAdder(key, `string`),
1362
- disabled,
1363
- Components
1364
- },
1365
- key + `IsMissing`
1366
- ) : /* @__PURE__ */ jsxRuntime.jsx(
1377
+ if (isMissing) {
1378
+ return /* @__PURE__ */ jsxRuntime.jsx(
1379
+ PropertyAdder,
1380
+ {
1381
+ propertyKey: key,
1382
+ addProperty: makePropertyAdder(key, `string`),
1383
+ disabled,
1384
+ Components
1385
+ },
1386
+ key + `IsMissing`
1387
+ );
1388
+ }
1389
+ return /* @__PURE__ */ jsxRuntime.jsx(
1367
1390
  JsonEditor_INTERNAL,
1368
1391
  {
1369
1392
  schema,
@@ -1385,7 +1408,9 @@ var ObjectEditor = ({
1385
1408
  /* @__PURE__ */ jsxRuntime.jsx(
1386
1409
  Components.Button,
1387
1410
  {
1388
- onClick: disabled ? doNothing : () => makePropertyAdder(`new_property`, `string`)(),
1411
+ onClick: disabled ? doNothing : () => {
1412
+ makePropertyAdder(`new_property`, `string`)();
1413
+ },
1389
1414
  disabled,
1390
1415
  children: "+"
1391
1416
  }
@@ -1402,7 +1427,9 @@ var BooleanEditor = ({
1402
1427
  {
1403
1428
  type: "checkbox",
1404
1429
  checked: data,
1405
- onChange: (event) => set(event.target.checked)
1430
+ onChange: (event) => {
1431
+ set(event.target.checked);
1432
+ }
1406
1433
  }
1407
1434
  ) });
1408
1435
  var NullEditor = ({
@@ -1418,7 +1445,9 @@ var NumberEditor = ({
1418
1445
  NumberInput,
1419
1446
  {
1420
1447
  value: data,
1421
- set: isReadonly(path) ? void 0 : (newValue) => set(Number(newValue)),
1448
+ set: isReadonly(path) ? void 0 : (newValue) => {
1449
+ set(Number(newValue));
1450
+ },
1422
1451
  autoSize: true
1423
1452
  }
1424
1453
  ) });
@@ -1439,8 +1468,8 @@ var StringEditor = ({
1439
1468
  ) });
1440
1469
  };
1441
1470
  var DefaultFallback = ({ error, errorInfo }) => {
1442
- var _a2, _b, _c;
1443
- const component = (_a2 = errorInfo == null ? void 0 : errorInfo.componentStack) == null ? void 0 : _a2.split(` `).filter(Boolean)[2];
1471
+ var _a, _b, _c;
1472
+ const component = (_a = errorInfo == null ? void 0 : errorInfo.componentStack) == null ? void 0 : _a.split(` `).filter(Boolean)[2];
1444
1473
  const message = (_c = (_b = error == null ? void 0 : error.toString()) != null ? _b : errorInfo == null ? void 0 : errorInfo.componentStack) != null ? _c : `Unknown error`;
1445
1474
  return /* @__PURE__ */ jsxRuntime.jsx(
1446
1475
  "div",
@@ -1491,8 +1520,8 @@ var ErrorBoundary = class extends react.Component {
1491
1520
  this.state = {};
1492
1521
  }
1493
1522
  componentDidCatch(error, errorInfo) {
1494
- var _a2, _b;
1495
- (_b = (_a2 = this.props).onError) == null ? void 0 : _b.call(_a2, error, errorInfo);
1523
+ var _a, _b;
1524
+ (_b = (_a = this.props).onError) == null ? void 0 : _b.call(_a, error, errorInfo);
1496
1525
  this.setState({
1497
1526
  error,
1498
1527
  errorInfo
@@ -1644,7 +1673,7 @@ var findStateTypeState = atom_io.selectorFamily({
1644
1673
  }
1645
1674
  });
1646
1675
  var StateIndexLeafNode = ({ node, isOpenState, typeState }) => {
1647
- var _a2, _b;
1676
+ var _a, _b;
1648
1677
  const setIsOpen = react$1.useI(isOpenState);
1649
1678
  const isOpen = react$1.useO(isOpenState);
1650
1679
  const state = react$1.useO(node);
@@ -1664,10 +1693,14 @@ var StateIndexLeafNode = ({ node, isOpenState, typeState }) => {
1664
1693
  /* @__PURE__ */ jsxRuntime.jsxs(
1665
1694
  "label",
1666
1695
  {
1667
- onClick: () => console.log(node, atom_io.getState(node)),
1668
- onKeyUp: () => console.log(node, atom_io.getState(node)),
1696
+ onClick: () => {
1697
+ console.log(node, atom_io.getState(node));
1698
+ },
1699
+ onKeyUp: () => {
1700
+ console.log(node, atom_io.getState(node));
1701
+ },
1669
1702
  children: [
1670
- /* @__PURE__ */ jsxRuntime.jsx("h2", { children: (_b = (_a2 = node.family) == null ? void 0 : _a2.subKey) != null ? _b : node.key }),
1703
+ /* @__PURE__ */ jsxRuntime.jsx("h2", { children: (_b = (_a = node.family) == null ? void 0 : _a.subKey) != null ? _b : node.key }),
1671
1704
  /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "type detail", children: [
1672
1705
  "(",
1673
1706
  stateType,
@@ -1743,8 +1776,12 @@ var AtomUpdateFC = ({ atomUpdate }) => {
1743
1776
  "article",
1744
1777
  {
1745
1778
  className: "node atom_update",
1746
- onClick: () => console.log(atomUpdate),
1747
- onKeyUp: () => console.log(atomUpdate),
1779
+ onClick: () => {
1780
+ console.log(atomUpdate);
1781
+ },
1782
+ onKeyUp: () => {
1783
+ console.log(atomUpdate);
1784
+ },
1748
1785
  children: [
1749
1786
  /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "detail", children: [
1750
1787
  atomUpdate.key,
@@ -1772,8 +1809,12 @@ var TransactionUpdateFC = ({ serialNumber, transactionUpdate }) => {
1772
1809
  "article",
1773
1810
  {
1774
1811
  className: "node transaction_param",
1775
- onClick: () => console.log(transactionUpdate),
1776
- onKeyUp: () => console.log(transactionUpdate),
1812
+ onClick: () => {
1813
+ console.log(transactionUpdate);
1814
+ },
1815
+ onKeyUp: () => {
1816
+ console.log(transactionUpdate);
1817
+ },
1777
1818
  children: [
1778
1819
  /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "detail", children: [
1779
1820
  discoverType(param),
@@ -1797,14 +1838,17 @@ var TransactionUpdateFC = ({ serialNumber, transactionUpdate }) => {
1797
1838
  /* @__PURE__ */ jsxRuntime.jsxs("section", { className: "transaction_impact", children: [
1798
1839
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "detail", children: "impact: " }),
1799
1840
  transactionUpdate.updates.filter((token) => !token.key.startsWith(`\u{1F441}\u200D\u{1F5E8}`)).map((update, index) => {
1800
- return `newValue` in update ? /* @__PURE__ */ jsxRuntime.jsx(
1801
- article.AtomUpdate,
1802
- {
1803
- serialNumber: index,
1804
- atomUpdate: update
1805
- },
1806
- `${transactionUpdate.key}:${index}:${update.key}`
1807
- ) : /* @__PURE__ */ jsxRuntime.jsx(
1841
+ if (`newValue` in update) {
1842
+ return /* @__PURE__ */ jsxRuntime.jsx(
1843
+ article.AtomUpdate,
1844
+ {
1845
+ serialNumber: index,
1846
+ atomUpdate: update
1847
+ },
1848
+ `${transactionUpdate.key}:${index}:${update.key}`
1849
+ );
1850
+ }
1851
+ return /* @__PURE__ */ jsxRuntime.jsx(
1808
1852
  TransactionUpdateFC,
1809
1853
  {
1810
1854
  serialNumber: index,
@@ -1907,7 +1951,9 @@ var TimelineLog = ({ token, isOpenState, timelineState }) => {
1907
1951
  "button",
1908
1952
  {
1909
1953
  type: "button",
1910
- onClick: () => atom_io.undo(token),
1954
+ onClick: () => {
1955
+ atom_io.undo(token);
1956
+ },
1911
1957
  disabled: timeline.at === 0,
1912
1958
  children: "undo"
1913
1959
  }
@@ -1916,7 +1962,9 @@ var TimelineLog = ({ token, isOpenState, timelineState }) => {
1916
1962
  "button",
1917
1963
  {
1918
1964
  type: "button",
1919
- onClick: () => atom_io.redo(token),
1965
+ onClick: () => {
1966
+ atom_io.redo(token);
1967
+ },
1920
1968
  disabled: timeline.at === timeline.history.length,
1921
1969
  children: "redo"
1922
1970
  }
@@ -2052,7 +2100,9 @@ var AtomIODevtools = () => {
2052
2100
  type: "button",
2053
2101
  "data-testid": `view-${viewOption}`,
2054
2102
  className: viewOption === devtoolsView ? `active` : ``,
2055
- onClick: () => setDevtoolsView(viewOption),
2103
+ onClick: () => {
2104
+ setDevtoolsView(viewOption);
2105
+ },
2056
2106
  disabled: viewOption === devtoolsView,
2057
2107
  children: viewOption
2058
2108
  },