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
@@ -18,9 +18,7 @@ declare class Refinery<SupportedTypes extends RefinementSupport> {
18
18
  }[keyof SupportedTypes] | null;
19
19
  }
20
20
 
21
- interface Refinement<A, B extends A> {
22
- (a: A): a is B;
23
- }
21
+ type Refinement<A, B extends A> = (a: A) => a is B;
24
22
 
25
23
  type PlainObject = Record<keyof any, unknown>;
26
24
 
@@ -63,8 +61,8 @@ declare const AtomIODevtools: () => JSX.Element;
63
61
 
64
62
  declare const atomIndex: atom_io.ReadonlySelectorToken<AtomTokenIndex>;
65
63
  declare const selectorIndex: atom_io.ReadonlySelectorToken<SelectorTokenIndex>;
66
- declare const transactionIndex: atom_io.ReadonlySelectorToken<atom_io.TransactionToken<atom_io.ƒn>[]>;
67
- declare const findTransactionLogState: atom_io.ReadonlySelectorFamilyToken<atom_io.TransactionUpdate<atom_io.ƒn>[], string>;
64
+ declare const transactionIndex: atom_io.ReadonlySelectorToken<atom_io.TransactionToken<atom_io.Func>[]>;
65
+ declare const findTransactionLogState: atom_io.ReadonlySelectorFamilyToken<atom_io.TransactionUpdate<atom_io.Func>[], string>;
68
66
  declare const timelineIndex: atom_io.ReadonlySelectorToken<atom_io.TimelineToken<any>[]>;
69
67
  declare const findTimelineState: atom_io.ReadonlySelectorFamilyToken<Internal.Timeline<any>, string>;
70
68
  declare const devtoolsAreOpenState: atom_io.RegularAtomToken<boolean>;
@@ -1,7 +1,7 @@
1
- import { pipe, ifDefined, isArray, isRecord, doesExtend, isPlainObject, raiseError, sprawl, recordToEntries, fallback, doNothing, become, mapObject, delve } from '../../dist/chunk-7VCCW45K.js';
1
+ import { pipe, ifDefined, isArray, isRecord, doesExtend, isPlainObject, raiseError, sprawl, recordToEntries, fallback, doNothing, become, mapObject, delve } from '../../dist/chunk-CC7IF7QF.js';
2
2
  import { lazyLocalStorageEffect } from '../../dist/chunk-BWWVY5O5.js';
3
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-U2IICNHQ.js';
4
+ import { __spreadProps, __spreadValues, __objRest, __restKey } from '../../dist/chunk-F2X4B4VY.js';
5
5
  import { selectorFamily, atom, atomFamily, findState, undo, redo, getState } from 'atom.io';
6
6
  import { attachIntrospectionStates } from 'atom.io/introspection';
7
7
  import { useI, useO } from 'atom.io/react';
@@ -28,7 +28,7 @@ var Refinery = class {
28
28
  if (input instanceof refiner) {
29
29
  return { type: key, data: input };
30
30
  }
31
- } catch (e2) {
31
+ } catch (_) {
32
32
  }
33
33
  }
34
34
  }
@@ -66,14 +66,14 @@ var refineJsonType = (data) => data === null ? { type: `null`, data: null } : is
66
66
  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.`
67
67
  );
68
68
  var isJson = (input) => {
69
- var _a2;
69
+ var _a;
70
70
  if (input === null)
71
71
  return true;
72
72
  if (input === void 0)
73
73
  return false;
74
- const prototype = (_a2 = Object.getPrototypeOf(input)) == null ? void 0 : _a2.constructor.name;
75
- const isJson2 = JSON_PROTOTYPES.includes(prototype);
76
- return isJson2;
74
+ const prototype = (_a = Object.getPrototypeOf(input)) == null ? void 0 : _a.constructor.name;
75
+ const refine = JSON_PROTOTYPES.includes(prototype);
76
+ return refine;
77
77
  };
78
78
 
79
79
  // ../anvl/src/refinement/can-exist.ts
@@ -88,11 +88,11 @@ var mustSatisfyOneOfTheFollowing = (isTypeA, logging = false, refinements = [isT
88
88
  const _ = {
89
89
  [name]: (input) => refinements.some(
90
90
  (refinement) => {
91
- var _a2;
91
+ var _a;
92
92
  return logging && console.log(
93
93
  refinements.map((r) => r.name || `anon`).join(` | `),
94
94
  `>`,
95
- (_a2 = refinement.name) != null ? _a2 : `anon`,
95
+ (_a = refinement.name) != null ? _a : `anon`,
96
96
  `:`,
97
97
  refinement(input)
98
98
  ), refinement(input);
@@ -135,32 +135,32 @@ var isLiteral = (value) => (input) => input === value;
135
135
  var isWithin = (args) => (input) => args.includes(input);
136
136
 
137
137
  // ../anvl/src/tree/differ.ts
138
- function diffNumber(a2, b2) {
139
- const sign = a2 < b2 ? `+` : `-`;
138
+ function diffNumber(a, b) {
139
+ const sign = a < b ? `+` : `-`;
140
140
  return {
141
- summary: `${sign}${Math.abs(a2 - b2)} (${a2} \u2192 ${b2})`
141
+ summary: `${sign}${Math.abs(a - b)} (${a} \u2192 ${b})`
142
142
  };
143
143
  }
144
- function diffString(a2, b2) {
145
- const sign = a2.length < b2.length ? `+` : `-`;
144
+ function diffString(a, b) {
145
+ const sign = a.length < b.length ? `+` : `-`;
146
146
  return {
147
- summary: `${sign}${Math.abs(a2.length - b2.length)} ("${a2}" \u2192 "${b2}")`
147
+ summary: `${sign}${Math.abs(a.length - b.length)} ("${a}" \u2192 "${b}")`
148
148
  };
149
149
  }
150
- function diffBoolean(a2, b2) {
150
+ function diffBoolean(a, b) {
151
151
  return {
152
- summary: `${a2} \u2192 ${b2}`
152
+ summary: `${a} \u2192 ${b}`
153
153
  };
154
154
  }
155
- function diffObject(a2, b2, recurse) {
155
+ function diffObject(a, b, recurse) {
156
156
  let summary = ``;
157
157
  const added = [];
158
158
  const removed = [];
159
159
  const changed = [];
160
- sprawl(a2, (path, nodeA) => {
160
+ sprawl(a, (path, nodeA) => {
161
161
  let key;
162
162
  for (key of path) {
163
- const nodeB = b2[key];
163
+ const nodeB = b[key];
164
164
  if (nodeB === void 0) {
165
165
  removed.push([key, JSON.stringify(nodeA)]);
166
166
  } else {
@@ -171,10 +171,10 @@ function diffObject(a2, b2, recurse) {
171
171
  }
172
172
  }
173
173
  });
174
- sprawl(b2, (path, nodeB) => {
174
+ sprawl(b, (path, nodeB) => {
175
175
  let key;
176
176
  for (key of path) {
177
- const nodeA = a2[key];
177
+ const nodeA = a[key];
178
178
  if (nodeA === void 0) {
179
179
  added.push([key, JSON.stringify(nodeB)]);
180
180
  }
@@ -188,8 +188,8 @@ function diffObject(a2, b2, recurse) {
188
188
  changed
189
189
  };
190
190
  }
191
- function diffArray(a2, b2, recurse) {
192
- return diffObject(a2, b2, recurse);
191
+ function diffArray(a, b, recurse) {
192
+ return diffObject(a, b, recurse);
193
193
  }
194
194
  var Differ = class {
195
195
  constructor(leafRefinery, treeRefinery, diffFunctions) {
@@ -206,20 +206,20 @@ var Differ = class {
206
206
  this.treeDiffers[key] = diffFunction;
207
207
  }
208
208
  }
209
- diff(a2, b2) {
210
- var _a2, _b;
211
- if (a2 === b2) {
209
+ diff(a, b) {
210
+ var _a, _b;
211
+ if (a === b) {
212
212
  return { summary: `No Change` };
213
213
  }
214
214
  try {
215
- if (JSON.stringify(a2) === JSON.stringify(b2)) {
215
+ if (JSON.stringify(a) === JSON.stringify(b)) {
216
216
  return { summary: `No Change` };
217
217
  }
218
218
  } catch (thrown) {
219
- console.error(`Error stringifying`, a2, b2);
219
+ console.error(`Error stringifying`, a, b);
220
220
  }
221
- const aRefined = (_a2 = this.leafRefinery.refine(a2)) != null ? _a2 : this.treeRefinery.refine(a2);
222
- const bRefined = (_b = this.leafRefinery.refine(b2)) != null ? _b : this.treeRefinery.refine(b2);
221
+ const aRefined = (_a = this.leafRefinery.refine(a)) != null ? _a : this.treeRefinery.refine(a);
222
+ const bRefined = (_b = this.leafRefinery.refine(b)) != null ? _b : this.treeRefinery.refine(b);
223
223
  if (aRefined !== null && bRefined !== null) {
224
224
  if (aRefined.type === bRefined.type) {
225
225
  if (aRefined.type in this.leafDiffers) {
@@ -239,8 +239,8 @@ var Differ = class {
239
239
  }
240
240
  }
241
241
  }
242
- const typeA = discoverType(a2);
243
- const typeB = discoverType(b2);
242
+ const typeA = discoverType(a);
243
+ const typeB = discoverType(b);
244
244
  if (typeA === typeB) {
245
245
  return {
246
246
  summary: `${typeA} \u2192 ${typeB}`
@@ -258,7 +258,9 @@ var OpenClose = ({ isOpen, setIsOpen, disabled, testid }) => {
258
258
  type: "button",
259
259
  "data-testid": testid,
260
260
  className: `carat ${isOpen ? `open` : `closed`}`,
261
- onClick: () => setIsOpen((isOpen2) => !isOpen2),
261
+ onClick: () => {
262
+ setIsOpen((prev) => !prev);
263
+ },
262
264
  disabled,
263
265
  children: "\u25B6"
264
266
  }
@@ -268,7 +270,7 @@ var button = {
268
270
  OpenClose
269
271
  };
270
272
  var ElasticInput = forwardRef(function ElasticInputFC(props, ref) {
271
- var _a2, _b, _c, _d;
273
+ var _a, _b, _c, _d, _e, _f;
272
274
  const inputRef = useRef(null);
273
275
  const spanRef = useRef(null);
274
276
  const [inputWidth, setInputWidth] = useState(`auto`);
@@ -276,8 +278,8 @@ var ElasticInput = forwardRef(function ElasticInputFC(props, ref) {
276
278
  ref,
277
279
  () => ({
278
280
  focus: () => {
279
- var _a3;
280
- (_a3 = inputRef.current) == null ? void 0 : _a3.focus();
281
+ var _a2;
282
+ (_a2 = inputRef.current) == null ? void 0 : _a2.focus();
281
283
  }
282
284
  })
283
285
  );
@@ -290,9 +292,11 @@ var ElasticInput = forwardRef(function ElasticInputFC(props, ref) {
290
292
  setInputWidth(`${spanRef.current.offsetWidth + extraWidth}px`);
291
293
  }
292
294
  }, 1e3);
293
- return () => clearInterval(interval);
295
+ return () => {
296
+ clearInterval(interval);
297
+ };
294
298
  }
295
- }, [(_a2 = inputRef.current) == null ? void 0 : _a2.value, props.value]);
299
+ }, [(_a = inputRef.current) == null ? void 0 : _a.value, props.value]);
296
300
  return /* @__PURE__ */ jsxs("div", { style: { display: `inline-block`, position: `relative` }, children: [
297
301
  /* @__PURE__ */ jsx(
298
302
  "input",
@@ -318,8 +322,8 @@ var ElasticInput = forwardRef(function ElasticInputFC(props, ref) {
318
322
  visibility: `hidden`,
319
323
  // color: `red`,
320
324
  whiteSpace: `pre`,
321
- fontFamily: ((_c = props.style) == null ? void 0 : _c.fontFamily) || `inherit`,
322
- fontSize: ((_d = props.style) == null ? void 0 : _d.fontSize) || `inherit`
325
+ fontFamily: (_d = (_c = props.style) == null ? void 0 : _c.fontFamily) != null ? _d : `inherit`,
326
+ fontSize: (_f = (_e = props.style) == null ? void 0 : _e.fontSize) != null ? _f : `inherit`
323
327
  },
324
328
  children: props.value
325
329
  }
@@ -401,7 +405,7 @@ var NumberInput = ({
401
405
  userHasMadeDeliberateChange.current = false;
402
406
  };
403
407
  const handleChange = (event) => {
404
- var _a2;
408
+ var _a;
405
409
  if (onChange)
406
410
  onChange(event);
407
411
  if (set === void 0)
@@ -410,7 +414,7 @@ var NumberInput = ({
410
414
  const input = event.target.value;
411
415
  if (isValidNonNumber(input) || isDecimalInProgress(input)) {
412
416
  setTemporaryEntry(input);
413
- const textInterpretation = isDecimalInProgress(input) ? input : (_a2 = min == null ? void 0 : min.toString()) != null ? _a2 : `0`;
417
+ const textInterpretation = isDecimalInProgress(input) ? input : (_a = min == null ? void 0 : min.toString()) != null ? _a : `0`;
414
418
  const newValue = textToValue(textInterpretation, allowDecimal);
415
419
  set(refine(newValue));
416
420
  return;
@@ -529,7 +533,9 @@ var JsonEditor_INTERNAL = ({
529
533
  ElasticInput,
530
534
  {
531
535
  value: name,
532
- onChange: disabled ? doNothing : (e) => rename(e.target.value),
536
+ onChange: disabled ? doNothing : (e) => {
537
+ rename(e.target.value);
538
+ },
533
539
  disabled
534
540
  }
535
541
  ) }),
@@ -550,7 +556,9 @@ var JsonEditor_INTERNAL = ({
550
556
  recast && dataIsJson ? /* @__PURE__ */ jsx(
551
557
  "select",
552
558
  {
553
- onChange: disabled ? doNothing : (e) => recast(e.target.value),
559
+ onChange: disabled ? doNothing : (e) => {
560
+ recast(e.target.value);
561
+ },
554
562
  value: refined.type,
555
563
  disabled,
556
564
  children: Object.keys(SubEditors).map((type) => /* @__PURE__ */ jsx("option", { value: type, children: type }, type))
@@ -560,13 +568,13 @@ var JsonEditor_INTERNAL = ({
560
568
  };
561
569
 
562
570
  // ../hamr/react-json-editor/src/editors-by-type/utilities/array-elements.ts
563
- var makeElementSetters = (data, set) => data.map(
564
- (value, index) => (newValue) => set(() => {
571
+ var makeElementSetters = (data, set) => data.map((value, index) => (newValue) => {
572
+ set(() => {
565
573
  const newData = [...data];
566
574
  newData[index] = become(newValue)(value);
567
575
  return newData;
568
- })
569
- );
576
+ });
577
+ });
570
578
  var ArrayEditor = ({
571
579
  path = [],
572
580
  isReadonly = () => false,
@@ -600,19 +608,6 @@ var parseInteger = (input) => {
600
608
  return input;
601
609
  throw new IntegerParseError(input);
602
610
  };
603
- var _a;
604
- var Fraction = class extends Number {
605
- constructor(n, d) {
606
- super(n / d);
607
- this[_a] = () => this.numerator / this.denominator;
608
- if (d === 0) {
609
- throw new Error(`Denominator cannot be zero`);
610
- }
611
- this.numerator = parseInteger(n);
612
- this.denominator = parseInteger(d);
613
- }
614
- };
615
- _a = Symbol.toPrimitive;
616
611
  var IntegerParseError = class extends Error {
617
612
  constructor(value) {
618
613
  super(`Could not parse integer from ${JSON.stringify(value)}`);
@@ -647,12 +642,6 @@ var Int = Object.assign((input) => parseInteger(input), {
647
642
  };
648
643
  }
649
644
  });
650
- function asNumber(input) {
651
- return input;
652
- }
653
- asNumber(new Fraction(1, 2));
654
- asNumber([new Fraction(1, 2)]);
655
- asNumber({ a: new Fraction(1, 2) });
656
645
 
657
646
  // ../anvl/src/json-schema/refs.ts
658
647
  function isJsonSchemaRef(input) {
@@ -863,7 +852,9 @@ var expandPathForSchema = (path) => {
863
852
  );
864
853
  default:
865
854
  throw new TypeError(
866
- `The key ${key} is not a valid JSON key; expected string or number, got ${typeof key}`
855
+ `The key ${JSON.stringify(
856
+ key
857
+ )} is not a valid JSON key; expected string or number, got ${typeof key}`
867
858
  );
868
859
  }
869
860
  });
@@ -886,10 +877,11 @@ var findSubSchema = (schema) => {
886
877
  if (typeof schema === `boolean`) {
887
878
  return new TypeError(`The schema is not a JsonSchema`);
888
879
  }
889
- const { node, refMap } = pathIntoSchema.reduce(
880
+ const reduction = pathIntoSchema.reduce(
890
881
  ({ 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 }),
891
882
  { node: schema, refMap: void 0 }
892
883
  );
884
+ const { node, refMap } = reduction;
893
885
  if (node instanceof Error)
894
886
  throw node;
895
887
  let subSchema = node;
@@ -919,8 +911,8 @@ var stringToObject = (str) => {
919
911
  var objectToString = (obj) => JSON.stringify(obj);
920
912
  var objectToBoolean = (obj) => obj.true === true;
921
913
  var objectToNumber = (obj) => {
922
- var _a2, _b, _c;
923
- return Number((_c = (_b = (_a2 = obj.number) != null ? _a2 : obj.size) != null ? _b : obj.count) != null ? _c : 0);
914
+ var _a, _b, _c;
915
+ return Number((_c = (_b = (_a = obj.number) != null ? _a : obj.size) != null ? _b : obj.count) != null ? _c : 0);
924
916
  };
925
917
  var objectToArray = (obj) => Object.entries(obj);
926
918
  var booleanToString = (bool) => bool.toString();
@@ -1044,35 +1036,44 @@ var castToJson = (input) => {
1044
1036
  // ../hamr/react-json-editor/src/editors-by-type/utilities/object-properties.ts
1045
1037
  var makePropertySetters = (data, set) => mapObject(
1046
1038
  data,
1047
- (value, key) => (newValue) => set(__spreadProps(__spreadValues({}, data), { [key]: become(newValue)(value[key]) }))
1039
+ (value, key) => (newValue) => {
1040
+ set(__spreadProps(__spreadValues({}, data), { [key]: become(newValue)(value[key]) }));
1041
+ }
1048
1042
  );
1049
1043
  var makePropertyRenamers = (data, set, stableKeyMapRef) => mapObject(
1050
1044
  data,
1051
- (value, key) => (newKey) => Object.hasOwn(data, newKey) ? null : set(() => {
1052
- const entries = Object.entries(data);
1053
- const index = entries.findIndex(([k]) => k === key);
1054
- entries[index] = [newKey, value];
1055
- const stableKeyMap = stableKeyMapRef.current;
1056
- stableKeyMapRef.current = __spreadProps(__spreadValues({}, stableKeyMap), {
1057
- [newKey]: stableKeyMap[key]
1058
- });
1059
- return Object.fromEntries(entries);
1060
- })
1045
+ (value, key) => (newKey) => {
1046
+ if (!Object.hasOwn(data, newKey)) {
1047
+ set(() => {
1048
+ const entries = Object.entries(data);
1049
+ const index = entries.findIndex(([k]) => k === key);
1050
+ entries[index] = [newKey, value];
1051
+ const stableKeyMap = stableKeyMapRef.current;
1052
+ stableKeyMapRef.current = __spreadProps(__spreadValues({}, stableKeyMap), {
1053
+ [newKey]: stableKeyMap[key]
1054
+ });
1055
+ return Object.fromEntries(entries);
1056
+ });
1057
+ }
1058
+ }
1061
1059
  );
1062
- var makePropertyRemovers = (data, set) => mapObject(
1063
- data,
1064
- (_, key) => () => set(() => {
1065
- const _a2 = data, rest = __objRest(_a2, [__restKey(key)]);
1060
+ var makePropertyRemovers = (data, set) => mapObject(data, (_, key) => () => {
1061
+ set(() => {
1062
+ const _a = data, rest = __objRest(_a, [__restKey(key)]);
1066
1063
  return rest;
1067
- })
1068
- );
1064
+ });
1065
+ });
1069
1066
  var makePropertyRecasters = (data, set) => mapObject(
1070
1067
  data,
1071
- (value, key) => (newType) => set(() => __spreadProps(__spreadValues({}, data), {
1072
- [key]: castToJson(value).to[newType]()
1073
- }))
1068
+ (value, key) => (newType) => {
1069
+ set(() => __spreadProps(__spreadValues({}, data), {
1070
+ [key]: castToJson(value).to[newType]()
1071
+ }));
1072
+ }
1074
1073
  );
1075
- var makePropertyCreationInterface = (data, set) => (key, type) => (value) => set(__spreadProps(__spreadValues({}, data), { [key]: value != null ? value : JSON_DEFAULTS[type] }));
1074
+ var makePropertyCreationInterface = (data, set) => (key, type) => (value) => {
1075
+ set(__spreadProps(__spreadValues({}, data), { [key]: value != null ? value : JSON_DEFAULTS[type] }));
1076
+ };
1076
1077
  var makePropertySorter = (data, set, sortFn) => () => {
1077
1078
  const sortedKeys = Object.keys(data).sort(sortFn);
1078
1079
  const sortedObj = {};
@@ -1090,7 +1091,16 @@ var PropertyAdder = ({
1090
1091
  /* @__PURE__ */ jsx(ElasticInput, { disabled: true, defaultValue: propertyKey }),
1091
1092
  ` `,
1092
1093
  /* @__PURE__ */ jsx(ElasticInput, { disabled: true, defaultValue: "is missing" }),
1093
- /* @__PURE__ */ jsx(Components.Button, { onClick: () => addProperty(), disabled, children: "+" })
1094
+ /* @__PURE__ */ jsx(
1095
+ Components.Button,
1096
+ {
1097
+ onClick: () => {
1098
+ addProperty();
1099
+ },
1100
+ disabled,
1101
+ children: "+"
1102
+ }
1103
+ )
1094
1104
  ] });
1095
1105
  var ObjectEditor = ({
1096
1106
  schema,
@@ -1101,7 +1111,7 @@ var ObjectEditor = ({
1101
1111
  set,
1102
1112
  Components
1103
1113
  }) => {
1104
- var _a2;
1114
+ var _a;
1105
1115
  const disabled = isReadonly(path);
1106
1116
  const stableKeyMap = useRef(
1107
1117
  Object.keys(data).reduce(
@@ -1119,7 +1129,7 @@ var ObjectEditor = ({
1119
1129
  const sortProperties = makePropertySorter(data, set);
1120
1130
  const makePropertyAdder = makePropertyCreationInterface(data, set);
1121
1131
  const subSchema = isPlainObject(schema) ? findSubSchema(schema)(path) : true;
1122
- const schemaKeys = isLiteral(true)(subSchema) ? true : isObjectSchema(subSchema) ? Object.keys((_a2 = subSchema.properties) != null ? _a2 : {}) : [];
1132
+ const schemaKeys = isLiteral(true)(subSchema) ? true : isObjectSchema(subSchema) ? Object.keys((_a = subSchema.properties) != null ? _a : {}) : [];
1123
1133
  const dataKeys = Object.keys(data);
1124
1134
  const [unofficialKeys, officialKeys] = dataKeys.reduce(
1125
1135
  ([unofficial, official], key) => {
@@ -1130,7 +1140,16 @@ var ObjectEditor = ({
1130
1140
  );
1131
1141
  const missingKeys = schemaKeys === true ? [] : schemaKeys.filter((key) => !dataKeys.includes(key));
1132
1142
  return /* @__PURE__ */ jsxs(Fragment, { children: [
1133
- /* @__PURE__ */ jsx(Components.Button, { onClick: () => sortProperties(), disabled, children: "Sort" }),
1143
+ /* @__PURE__ */ jsx(
1144
+ Components.Button,
1145
+ {
1146
+ onClick: () => {
1147
+ sortProperties();
1148
+ },
1149
+ disabled,
1150
+ children: "Sort"
1151
+ }
1152
+ ),
1134
1153
  /* @__PURE__ */ jsxs(Components.ObjectWrapper, { children: [
1135
1154
  /* @__PURE__ */ jsx("div", { className: "json_editor_properties", children: [...missingKeys, ...officialKeys, ...unofficialKeys].map((key) => {
1136
1155
  const originalKey = stableKeyMap.current[key];
@@ -1138,16 +1157,19 @@ var ObjectEditor = ({
1138
1157
  const originalPath = [...path, originalKey];
1139
1158
  const isOfficial = schemaKeys === true || schemaKeys.includes(key);
1140
1159
  const isMissing = missingKeys.includes(key);
1141
- return isMissing ? /* @__PURE__ */ jsx(
1142
- PropertyAdder,
1143
- {
1144
- propertyKey: key,
1145
- addProperty: makePropertyAdder(key, `string`),
1146
- disabled,
1147
- Components
1148
- },
1149
- key + `IsMissing`
1150
- ) : /* @__PURE__ */ jsx(
1160
+ if (isMissing) {
1161
+ return /* @__PURE__ */ jsx(
1162
+ PropertyAdder,
1163
+ {
1164
+ propertyKey: key,
1165
+ addProperty: makePropertyAdder(key, `string`),
1166
+ disabled,
1167
+ Components
1168
+ },
1169
+ key + `IsMissing`
1170
+ );
1171
+ }
1172
+ return /* @__PURE__ */ jsx(
1151
1173
  JsonEditor_INTERNAL,
1152
1174
  {
1153
1175
  schema,
@@ -1169,7 +1191,9 @@ var ObjectEditor = ({
1169
1191
  /* @__PURE__ */ jsx(
1170
1192
  Components.Button,
1171
1193
  {
1172
- onClick: disabled ? doNothing : () => makePropertyAdder(`new_property`, `string`)(),
1194
+ onClick: disabled ? doNothing : () => {
1195
+ makePropertyAdder(`new_property`, `string`)();
1196
+ },
1173
1197
  disabled,
1174
1198
  children: "+"
1175
1199
  }
@@ -1186,7 +1210,9 @@ var BooleanEditor = ({
1186
1210
  {
1187
1211
  type: "checkbox",
1188
1212
  checked: data,
1189
- onChange: (event) => set(event.target.checked)
1213
+ onChange: (event) => {
1214
+ set(event.target.checked);
1215
+ }
1190
1216
  }
1191
1217
  ) });
1192
1218
  var NullEditor = ({
@@ -1202,7 +1228,9 @@ var NumberEditor = ({
1202
1228
  NumberInput,
1203
1229
  {
1204
1230
  value: data,
1205
- set: isReadonly(path) ? void 0 : (newValue) => set(Number(newValue)),
1231
+ set: isReadonly(path) ? void 0 : (newValue) => {
1232
+ set(Number(newValue));
1233
+ },
1206
1234
  autoSize: true
1207
1235
  }
1208
1236
  ) });
@@ -1223,8 +1251,8 @@ var StringEditor = ({
1223
1251
  ) });
1224
1252
  };
1225
1253
  var DefaultFallback = ({ error, errorInfo }) => {
1226
- var _a2, _b, _c;
1227
- const component = (_a2 = errorInfo == null ? void 0 : errorInfo.componentStack) == null ? void 0 : _a2.split(` `).filter(Boolean)[2];
1254
+ var _a, _b, _c;
1255
+ const component = (_a = errorInfo == null ? void 0 : errorInfo.componentStack) == null ? void 0 : _a.split(` `).filter(Boolean)[2];
1228
1256
  const message = (_c = (_b = error == null ? void 0 : error.toString()) != null ? _b : errorInfo == null ? void 0 : errorInfo.componentStack) != null ? _c : `Unknown error`;
1229
1257
  return /* @__PURE__ */ jsx(
1230
1258
  "div",
@@ -1275,8 +1303,8 @@ var ErrorBoundary = class extends Component {
1275
1303
  this.state = {};
1276
1304
  }
1277
1305
  componentDidCatch(error, errorInfo) {
1278
- var _a2, _b;
1279
- (_b = (_a2 = this.props).onError) == null ? void 0 : _b.call(_a2, error, errorInfo);
1306
+ var _a, _b;
1307
+ (_b = (_a = this.props).onError) == null ? void 0 : _b.call(_a, error, errorInfo);
1280
1308
  this.setState({
1281
1309
  error,
1282
1310
  errorInfo
@@ -1428,7 +1456,7 @@ var findStateTypeState = selectorFamily({
1428
1456
  }
1429
1457
  });
1430
1458
  var StateIndexLeafNode = ({ node, isOpenState, typeState }) => {
1431
- var _a2, _b;
1459
+ var _a, _b;
1432
1460
  const setIsOpen = useI(isOpenState);
1433
1461
  const isOpen = useO(isOpenState);
1434
1462
  const state = useO(node);
@@ -1448,10 +1476,14 @@ var StateIndexLeafNode = ({ node, isOpenState, typeState }) => {
1448
1476
  /* @__PURE__ */ jsxs(
1449
1477
  "label",
1450
1478
  {
1451
- onClick: () => console.log(node, getState(node)),
1452
- onKeyUp: () => console.log(node, getState(node)),
1479
+ onClick: () => {
1480
+ console.log(node, getState(node));
1481
+ },
1482
+ onKeyUp: () => {
1483
+ console.log(node, getState(node));
1484
+ },
1453
1485
  children: [
1454
- /* @__PURE__ */ jsx("h2", { children: (_b = (_a2 = node.family) == null ? void 0 : _a2.subKey) != null ? _b : node.key }),
1486
+ /* @__PURE__ */ jsx("h2", { children: (_b = (_a = node.family) == null ? void 0 : _a.subKey) != null ? _b : node.key }),
1455
1487
  /* @__PURE__ */ jsxs("span", { className: "type detail", children: [
1456
1488
  "(",
1457
1489
  stateType,
@@ -1527,8 +1559,12 @@ var AtomUpdateFC = ({ atomUpdate }) => {
1527
1559
  "article",
1528
1560
  {
1529
1561
  className: "node atom_update",
1530
- onClick: () => console.log(atomUpdate),
1531
- onKeyUp: () => console.log(atomUpdate),
1562
+ onClick: () => {
1563
+ console.log(atomUpdate);
1564
+ },
1565
+ onKeyUp: () => {
1566
+ console.log(atomUpdate);
1567
+ },
1532
1568
  children: [
1533
1569
  /* @__PURE__ */ jsxs("span", { className: "detail", children: [
1534
1570
  atomUpdate.key,
@@ -1556,8 +1592,12 @@ var TransactionUpdateFC = ({ serialNumber, transactionUpdate }) => {
1556
1592
  "article",
1557
1593
  {
1558
1594
  className: "node transaction_param",
1559
- onClick: () => console.log(transactionUpdate),
1560
- onKeyUp: () => console.log(transactionUpdate),
1595
+ onClick: () => {
1596
+ console.log(transactionUpdate);
1597
+ },
1598
+ onKeyUp: () => {
1599
+ console.log(transactionUpdate);
1600
+ },
1561
1601
  children: [
1562
1602
  /* @__PURE__ */ jsxs("span", { className: "detail", children: [
1563
1603
  discoverType(param),
@@ -1581,14 +1621,17 @@ var TransactionUpdateFC = ({ serialNumber, transactionUpdate }) => {
1581
1621
  /* @__PURE__ */ jsxs("section", { className: "transaction_impact", children: [
1582
1622
  /* @__PURE__ */ jsx("span", { className: "detail", children: "impact: " }),
1583
1623
  transactionUpdate.updates.filter((token) => !token.key.startsWith(`\u{1F441}\u200D\u{1F5E8}`)).map((update, index) => {
1584
- return `newValue` in update ? /* @__PURE__ */ jsx(
1585
- article.AtomUpdate,
1586
- {
1587
- serialNumber: index,
1588
- atomUpdate: update
1589
- },
1590
- `${transactionUpdate.key}:${index}:${update.key}`
1591
- ) : /* @__PURE__ */ jsx(
1624
+ if (`newValue` in update) {
1625
+ return /* @__PURE__ */ jsx(
1626
+ article.AtomUpdate,
1627
+ {
1628
+ serialNumber: index,
1629
+ atomUpdate: update
1630
+ },
1631
+ `${transactionUpdate.key}:${index}:${update.key}`
1632
+ );
1633
+ }
1634
+ return /* @__PURE__ */ jsx(
1592
1635
  TransactionUpdateFC,
1593
1636
  {
1594
1637
  serialNumber: index,
@@ -1691,7 +1734,9 @@ var TimelineLog = ({ token, isOpenState, timelineState }) => {
1691
1734
  "button",
1692
1735
  {
1693
1736
  type: "button",
1694
- onClick: () => undo(token),
1737
+ onClick: () => {
1738
+ undo(token);
1739
+ },
1695
1740
  disabled: timeline.at === 0,
1696
1741
  children: "undo"
1697
1742
  }
@@ -1700,7 +1745,9 @@ var TimelineLog = ({ token, isOpenState, timelineState }) => {
1700
1745
  "button",
1701
1746
  {
1702
1747
  type: "button",
1703
- onClick: () => redo(token),
1748
+ onClick: () => {
1749
+ redo(token);
1750
+ },
1704
1751
  disabled: timeline.at === timeline.history.length,
1705
1752
  children: "redo"
1706
1753
  }
@@ -1836,7 +1883,9 @@ var AtomIODevtools = () => {
1836
1883
  type: "button",
1837
1884
  "data-testid": `view-${viewOption}`,
1838
1885
  className: viewOption === devtoolsView ? `active` : ``,
1839
- onClick: () => setDevtoolsView(viewOption),
1886
+ onClick: () => {
1887
+ setDevtoolsView(viewOption);
1888
+ },
1840
1889
  disabled: viewOption === devtoolsView,
1841
1890
  children: viewOption
1842
1891
  },
@@ -3,7 +3,7 @@
3
3
  "type": "module",
4
4
  "private": true,
5
5
  "main": "dist/index.cjs",
6
- "module": "dist/index.mjs",
6
+ "module": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
8
8
  "exports": {
9
9
  ".": {