atom.io 0.24.3 → 0.24.4

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.
@@ -67,8 +67,7 @@ var Junction = class {
67
67
  };
68
68
  }
69
69
  for (const [x, ys] of (_c = data.relations) != null ? _c : []) {
70
- for (const y of ys)
71
- this.addRelation(x, y);
70
+ for (const y of ys) this.addRelation(x, y);
72
71
  }
73
72
  for (const [contentKey, content] of (_d = data.contents) != null ? _d : []) {
74
73
  this.setContent(contentKey, content);
@@ -168,13 +167,11 @@ var Junction = class {
168
167
  switch (this.cardinality) {
169
168
  case `1:1`: {
170
169
  const bPrev = this.getRelatedKey(a);
171
- if (bPrev && bPrev !== b)
172
- this.delete(bPrev, a);
170
+ if (bPrev && bPrev !== b) this.delete(bPrev, a);
173
171
  }
174
172
  case `1:n`: {
175
173
  const aPrev = this.getRelatedKey(b);
176
- if (aPrev && aPrev !== a)
177
- this.delete(aPrev, b);
174
+ if (aPrev && aPrev !== a) this.delete(aPrev, b);
178
175
  }
179
176
  }
180
177
  if (content) {
@@ -1,5 +1,5 @@
1
- import { Junction } from '../../dist/chunk-FTONNX2R.js';
2
- import '../../dist/chunk-F2X4B4VY.js';
1
+ import { Junction } from '../../dist/chunk-HYXKCFVY.js';
2
+ import '../../dist/chunk-S4N6XNPH.js';
3
3
  import { createStandaloneSelector, findInStore, IMPLICIT, getFromStore, setIntoStore, seekInStore, getJsonToken, disposeFromStore, withdraw, growMoleculeInStore, initFamilyMemberInStore, createMutableAtomFamily, createRegularAtomFamily, createMoleculeFamily, newest, makeMoleculeInStore, isChildStore, createRegularAtom, createSelectorFamily, getJsonFamily } from 'atom.io/internal';
4
4
  import { stringifyJson } from 'atom.io/json';
5
5
  import { SetRTX } from 'atom.io/transceivers/set-rtx';
@@ -1,8 +1,7 @@
1
1
  // __unstable__/web-effects/src/storage.ts
2
2
  var persistAtom = (storage) => ({ stringify, parse }) => (key) => ({ setSelf, onSet }) => {
3
3
  const savedValue = storage.getItem(key);
4
- if (savedValue != null)
5
- setSelf(parse(savedValue));
4
+ if (savedValue != null) setSelf(parse(savedValue));
6
5
  onSet(({ newValue }) => {
7
6
  if (newValue == null) {
8
7
  storage.removeItem(key);
@@ -44,8 +44,7 @@ var Junction = class {
44
44
  };
45
45
  }
46
46
  for (const [x, ys] of (_c = data.relations) != null ? _c : []) {
47
- for (const y of ys)
48
- this.addRelation(x, y);
47
+ for (const y of ys) this.addRelation(x, y);
49
48
  }
50
49
  for (const [contentKey, content] of (_d = data.contents) != null ? _d : []) {
51
50
  this.setContent(contentKey, content);
@@ -145,13 +144,11 @@ var Junction = class {
145
144
  switch (this.cardinality) {
146
145
  case `1:1`: {
147
146
  const bPrev = this.getRelatedKey(a);
148
- if (bPrev && bPrev !== b)
149
- this.delete(bPrev, a);
147
+ if (bPrev && bPrev !== b) this.delete(bPrev, a);
150
148
  }
151
149
  case `1:n`: {
152
150
  const aPrev = this.getRelatedKey(b);
153
- if (aPrev && aPrev !== a)
154
- this.delete(aPrev, b);
151
+ if (aPrev && aPrev !== a) this.delete(aPrev, b);
155
152
  }
156
153
  }
157
154
  if (content) {
@@ -113,8 +113,7 @@ var sprawl = (tree, inspector) => {
113
113
  var _a;
114
114
  const inspect = (p, n) => {
115
115
  const result2 = inspector(p, n);
116
- if (result2)
117
- return result2;
116
+ if (result2) return result2;
118
117
  return null;
119
118
  };
120
119
  const result = inspect(path, node);
package/dist/index.d.ts CHANGED
@@ -207,7 +207,7 @@ type MoleculeTransactors<K extends Json.Serializable> = Flat$1<Omit<TransactorsW
207
207
  claim(below: MoleculeToken<any>, options: {
208
208
  exclusive: boolean;
209
209
  }): any;
210
- join(joinToken: JoinToken<any, any, any, any>): void;
210
+ join<J extends JoinToken<any, any, any, any>>(joinToken: J): J;
211
211
  spawn<Key extends Json.Serializable, Ctor extends MoleculeConstructor>(family: MoleculeFamilyToken<Ctor>, key: Key, ...params: MoleculeParams<Ctor>): MoleculeToken<Ctor>;
212
212
  }>;
213
213
  type MoleculeConstructor = new (transactors: MoleculeTransactors<any>, key: any, ...params: any) => any;
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import './chunk-F2X4B4VY.js';
1
+ import './chunk-S4N6XNPH.js';
2
2
  import * as Internal from 'atom.io/internal';
3
3
  import { createStandaloneAtom, IMPLICIT, createAtomFamily, createMoleculeFamily, makeMoleculeInStore, Molecule, createStandaloneSelector, createSelectorFamily, Store, createTransaction, createTimeline, findInStore, getFromStore, setIntoStore, timeTravel, subscribeToTimeline, subscribeToTransaction, subscribeToState, arbitrary, actUponStore } from 'atom.io/internal';
4
4
  import { stringifyJson } from 'atom.io/json';
@@ -1,4 +1,4 @@
1
- import '../../dist/chunk-F2X4B4VY.js';
1
+ import '../../dist/chunk-S4N6XNPH.js';
2
2
  import { findInStore, IMPLICIT } from 'atom.io/internal';
3
3
 
4
4
  function findState(token, key) {
@@ -1,4 +1,4 @@
1
- import { __export } from '../../dist/chunk-F2X4B4VY.js';
1
+ import { __export } from '../../dist/chunk-S4N6XNPH.js';
2
2
  import { ESLintUtils } from '@typescript-eslint/utils';
3
3
 
4
4
  // eslint-plugin/src/rules/index.ts
@@ -1,4 +1,4 @@
1
- import '../../dist/chunk-F2X4B4VY.js';
1
+ import '../../dist/chunk-S4N6XNPH.js';
2
2
  import { seekInStore, IMPLICIT } from 'atom.io/internal';
3
3
 
4
4
  function seekState(token, key) {
@@ -137,8 +137,7 @@ var Junction = class {
137
137
  };
138
138
  }
139
139
  for (const [x, ys] of (_c = data.relations) != null ? _c : []) {
140
- for (const y of ys)
141
- this.addRelation(x, y);
140
+ for (const y of ys) this.addRelation(x, y);
142
141
  }
143
142
  for (const [contentKey, content] of (_d = data.contents) != null ? _d : []) {
144
143
  this.setContent(contentKey, content);
@@ -238,13 +237,11 @@ var Junction = class {
238
237
  switch (this.cardinality) {
239
238
  case `1:1`: {
240
239
  const bPrev = this.getRelatedKey(a);
241
- if (bPrev && bPrev !== b)
242
- this.delete(bPrev, a);
240
+ if (bPrev && bPrev !== b) this.delete(bPrev, a);
243
241
  }
244
242
  case `1:n`: {
245
243
  const aPrev = this.getRelatedKey(b);
246
- if (aPrev && aPrev !== a)
247
- this.delete(aPrev, b);
244
+ if (aPrev && aPrev !== a) this.delete(aPrev, b);
248
245
  }
249
246
  }
250
247
  if (content) {
@@ -456,16 +453,13 @@ var Store = class {
456
453
  ];
457
454
  this.logger = {
458
455
  error: (...messages) => {
459
- for (const logger of this.loggers)
460
- logger.error(...messages);
456
+ for (const logger of this.loggers) logger.error(...messages);
461
457
  },
462
458
  info: (...messages) => {
463
- for (const logger of this.loggers)
464
- logger.info(...messages);
459
+ for (const logger of this.loggers) logger.info(...messages);
465
460
  },
466
461
  warn: (...messages) => {
467
- for (const logger of this.loggers)
468
- logger.warn(...messages);
462
+ for (const logger of this.loggers) logger.warn(...messages);
469
463
  }
470
464
  };
471
465
  if (store !== null) {
@@ -966,8 +960,7 @@ var setAtom = (atom, next, target) => {
966
960
  transceiver = copiedValue;
967
961
  }
968
962
  const accepted = transceiver.do(update.newValue) === null;
969
- if (accepted)
970
- evictDownStream(mutableAtom, target);
963
+ if (accepted) evictDownStream(mutableAtom, target);
971
964
  }
972
965
  }
973
966
  };
@@ -1165,6 +1158,7 @@ function makeMoleculeInStore(store, context, familyToken, key, ...params) {
1165
1158
  const join = data.getJoin(joinToken, store);
1166
1159
  join.molecules.set(json.stringifyJson(key), molecule);
1167
1160
  molecule.joins.set(joinToken.key, join);
1161
+ return joinToken;
1168
1162
  },
1169
1163
  spawn: (f, k, ...p) => makeMoleculeInStore(
1170
1164
  newest(store),
@@ -245,7 +245,7 @@ declare class Store implements Lineage {
245
245
  molecules: Map<string, Molecule<any>>;
246
246
  moleculeFamilies: Map<string, atom_io.Flat<atom_io.MoleculeFamilyToken<any> & {
247
247
  subject: Subject<atom_io.MoleculeDisposal | atom_io.MoleculeCreation<any>>;
248
- dependsOn: "all" | "any";
248
+ dependsOn: `all` | `any`;
249
249
  new: any;
250
250
  }>>;
251
251
  miscResources: Map<string, Disposable>;
@@ -1,5 +1,5 @@
1
- import { Junction } from '../../dist/chunk-FTONNX2R.js';
2
- import { __spreadValues, __spreadProps } from '../../dist/chunk-F2X4B4VY.js';
1
+ import { Junction } from '../../dist/chunk-HYXKCFVY.js';
2
+ import { __spreadValues, __spreadProps } from '../../dist/chunk-S4N6XNPH.js';
3
3
  import { stringifyJson, parseJson, selectJson, selectJsonFamily } from 'atom.io/json';
4
4
  import { AtomIOLogger } from 'atom.io';
5
5
  import { getJoin } from 'atom.io/data';
@@ -178,16 +178,13 @@ var Store = class {
178
178
  ];
179
179
  this.logger = {
180
180
  error: (...messages) => {
181
- for (const logger of this.loggers)
182
- logger.error(...messages);
181
+ for (const logger of this.loggers) logger.error(...messages);
183
182
  },
184
183
  info: (...messages) => {
185
- for (const logger of this.loggers)
186
- logger.info(...messages);
184
+ for (const logger of this.loggers) logger.info(...messages);
187
185
  },
188
186
  warn: (...messages) => {
189
- for (const logger of this.loggers)
190
- logger.warn(...messages);
187
+ for (const logger of this.loggers) logger.warn(...messages);
191
188
  }
192
189
  };
193
190
  if (store !== null) {
@@ -688,8 +685,7 @@ var setAtom = (atom, next, target) => {
688
685
  transceiver = copiedValue;
689
686
  }
690
687
  const accepted = transceiver.do(update.newValue) === null;
691
- if (accepted)
692
- evictDownStream(mutableAtom, target);
688
+ if (accepted) evictDownStream(mutableAtom, target);
693
689
  }
694
690
  }
695
691
  };
@@ -887,6 +883,7 @@ function makeMoleculeInStore(store, context, familyToken, key, ...params) {
887
883
  const join = getJoin(joinToken, store);
888
884
  join.molecules.set(stringifyJson(key), molecule);
889
885
  molecule.joins.set(joinToken.key, join);
886
+ return joinToken;
890
887
  },
891
888
  spawn: (f, k, ...p) => makeMoleculeInStore(
892
889
  newest(store),
@@ -101,10 +101,11 @@ export function makeMoleculeInStore<M extends MoleculeConstructor>(
101
101
  }
102
102
  }
103
103
  },
104
- join: (joinToken: JoinToken<any, any, any, any>) => {
104
+ join: <J extends JoinToken<any, any, any, any>>(joinToken: J) => {
105
105
  const join = getJoin(joinToken, store)
106
106
  join.molecules.set(stringifyJson(key), molecule)
107
107
  molecule.joins.set(joinToken.key, join)
108
+ return joinToken
108
109
  },
109
110
  spawn: (f: MoleculeFamilyToken<any>, k: any, ...p: any[]) =>
110
111
  makeMoleculeInStore(
@@ -1,4 +1,4 @@
1
- import { __spreadValues } from '../../dist/chunk-F2X4B4VY.js';
1
+ import { __spreadValues } from '../../dist/chunk-S4N6XNPH.js';
2
2
  import * as Internal from 'atom.io/internal';
3
3
  import { createRegularAtom, deposit, createStandaloneSelector, IMPLICIT, createRegularAtomFamily, Subject, createSelectorFamily } from 'atom.io/internal';
4
4
  import { getState } from 'atom.io';
@@ -31,7 +31,7 @@ declare namespace json {
31
31
  export type { json_Array as Array, Object$1 as Object, json_Serializable as Serializable };
32
32
  }
33
33
 
34
- declare const parseJson: <S extends Stringified<Serializable>>(str: S | string) => S extends Stringified<infer J extends Serializable> ? J : Serializable;
34
+ declare const parseJson: <S extends Stringified<Serializable>>(str: S | string) => S extends Stringified<infer J> ? J : Serializable;
35
35
  type Stringified<J extends Serializable> = string & {
36
36
  __json: J;
37
37
  };
@@ -1,6 +1,6 @@
1
1
  import { stringifyJson, parseJson } from '../../dist/chunk-BF4MVQF6.js';
2
2
  export { JSON_DEFAULTS, JSON_TYPE_NAMES, isBoolean, isNull, isNumber, isPrimitive, isString, parseJson, stringSetJsonInterface, stringifyJson } from '../../dist/chunk-BF4MVQF6.js';
3
- import '../../dist/chunk-F2X4B4VY.js';
3
+ import '../../dist/chunk-S4N6XNPH.js';
4
4
  import { createStandaloneSelector, IMPLICIT, createSelectorFamily, growMoleculeInStore, initFamilyMemberInStore, seekInStore } from 'atom.io/internal';
5
5
 
6
6
  var selectJson = (atom, transform, store = IMPLICIT.STORE) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "atom.io",
3
- "version": "0.24.3",
3
+ "version": "0.24.4",
4
4
  "description": "Composable and testable reactive data library.",
5
5
  "homepage": "https://atom.io.fyi",
6
6
  "sideEffects": false,
@@ -48,7 +48,7 @@
48
48
  }
49
49
  },
50
50
  "devDependencies": {
51
- "@testing-library/react": "15.0.7",
51
+ "@testing-library/react": "16.0.0",
52
52
  "@types/eslint": "npm:@types/eslint@8.56.10",
53
53
  "@types/eslint-v9": "npm:@types/eslint@8.56.10",
54
54
  "@types/estree": "1.0.5",
@@ -56,17 +56,17 @@
56
56
  "@types/npmlog": "7.0.0",
57
57
  "@types/react": "18.3.3",
58
58
  "@types/tmp": "0.2.6",
59
- "@typescript-eslint/parser": "7.11.0",
60
- "@typescript-eslint/rule-tester": "7.11.0",
59
+ "@typescript-eslint/parser": "7.13.1",
60
+ "@typescript-eslint/rule-tester": "7.13.1",
61
61
  "@vitest/coverage-v8": "1.6.0",
62
62
  "@vitest/ui": "1.6.0",
63
63
  "concurrently": "8.2.2",
64
- "drizzle-kit": "0.21.4",
65
- "drizzle-orm": "0.30.10",
64
+ "drizzle-kit": "0.22.7",
65
+ "drizzle-orm": "0.31.2",
66
66
  "eslint": "npm:eslint@8.57.0",
67
- "eslint-v9": "npm:eslint@9.3.0",
68
- "framer-motion": "11.2.9",
69
- "happy-dom": "14.11.4",
67
+ "eslint-v9": "npm:eslint@9.5.0",
68
+ "framer-motion": "11.2.11",
69
+ "happy-dom": "14.12.3",
70
70
  "http-proxy": "1.18.1",
71
71
  "npmlog": "7.0.1",
72
72
  "postgres": "3.4.4",
@@ -77,9 +77,9 @@
77
77
  "socket.io": "4.7.5",
78
78
  "socket.io-client": "4.7.5",
79
79
  "tmp": "0.2.3",
80
- "tsup": "8.0.2",
81
- "typescript": "5.4.5",
82
- "vite": "5.2.12",
80
+ "tsup": "8.1.0",
81
+ "typescript": "5.5.2",
82
+ "vite": "5.3.1",
83
83
  "vite-tsconfig-paths": "4.3.2",
84
84
  "vitest": "1.6.0"
85
85
  },
@@ -1,4 +1,4 @@
1
- import '../../dist/chunk-F2X4B4VY.js';
1
+ import '../../dist/chunk-S4N6XNPH.js';
2
2
  import { IMPLICIT, findInStore, setIntoStore, subscribeToState, getFromStore, getJsonToken, withdraw, subscribeToTimeline } from 'atom.io/internal';
3
3
  import * as React5 from 'react';
4
4
  import { jsx } from 'react/jsx-runtime';
@@ -153,15 +153,14 @@ var doesExtend = (isValue) => hasProperties(isValue, ALLOW_EXTENSION);
153
153
  // ../anvl/src/object/sprawl.ts
154
154
  var sprawl = (tree, inspector) => {
155
155
  const walk = (path, node) => {
156
- var _a;
156
+ var _a2;
157
157
  const inspect = (p, n) => {
158
158
  const result2 = inspector(p, n);
159
- if (result2)
160
- return result2;
159
+ if (result2) return result2;
161
160
  return null;
162
161
  };
163
162
  const result = inspect(path, node);
164
- if ((_a = result == null ? void 0 : result.jobComplete) != null ? _a : result == null ? void 0 : result.pathComplete) {
163
+ if ((_a2 = result == null ? void 0 : result.jobComplete) != null ? _a2 : result == null ? void 0 : result.pathComplete) {
165
164
  return result;
166
165
  }
167
166
  const childEntries = Array.isArray(node) ? node.map((v, i) => [i, v]) : isPlainObject(node) ? Object.entries(node) : [];
@@ -218,11 +217,11 @@ var mustSatisfyOneOfTheFollowing = (isTypeA, logging = false, refinements = [isT
218
217
  const _ = {
219
218
  [name]: (input) => refinements.some(
220
219
  (refinement) => {
221
- var _a;
220
+ var _a2;
222
221
  return logging && console.log(
223
222
  refinements.map((r) => r.name || `anon`).join(` | `),
224
223
  `>`,
225
- (_a = refinement.name) != null ? _a : `anon`,
224
+ (_a2 = refinement.name) != null ? _a2 : `anon`,
226
225
  `:`,
227
226
  refinement(input)
228
227
  ), refinement(input);
@@ -278,12 +277,10 @@ var refineJsonType = (data) => data === null ? { type: `null`, data: null } : is
278
277
  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.`
279
278
  );
280
279
  var isJson = (input) => {
281
- var _a;
282
- if (input === null)
283
- return true;
284
- if (input === void 0)
285
- return false;
286
- const prototype = (_a = Object.getPrototypeOf(input)) == null ? void 0 : _a.constructor.name;
280
+ var _a2;
281
+ if (input === null) return true;
282
+ if (input === void 0) return false;
283
+ const prototype = (_a2 = Object.getPrototypeOf(input)) == null ? void 0 : _a2.constructor.name;
287
284
  const refine = JSON_PROTOTYPES.includes(prototype);
288
285
  return refine;
289
286
  };
@@ -410,7 +407,7 @@ var Differ = class {
410
407
  }
411
408
  }
412
409
  diff(a, b) {
413
- var _a, _b;
410
+ var _a2, _b2;
414
411
  if (a === b) {
415
412
  return { summary: `No Change` };
416
413
  }
@@ -421,8 +418,8 @@ var Differ = class {
421
418
  } catch (thrown) {
422
419
  console.error(`Error stringifying`, a, b);
423
420
  }
424
- const aRefined = (_a = this.leafRefinery.refine(a)) != null ? _a : this.treeRefinery.refine(a);
425
- const bRefined = (_b = this.leafRefinery.refine(b)) != null ? _b : this.treeRefinery.refine(b);
421
+ const aRefined = (_a2 = this.leafRefinery.refine(a)) != null ? _a2 : this.treeRefinery.refine(a);
422
+ const bRefined = (_b2 = this.leafRefinery.refine(b)) != null ? _b2 : this.treeRefinery.refine(b);
426
423
  if (aRefined !== null && bRefined !== null) {
427
424
  if (aRefined.type === bRefined.type) {
428
425
  if (aRefined.type in this.leafDiffers) {
@@ -458,8 +455,7 @@ var Differ = class {
458
455
  // __unstable__/web-effects/src/storage.ts
459
456
  var persistAtom = (storage) => ({ stringify, parse }) => (key) => ({ setSelf, onSet }) => {
460
457
  const savedValue = storage.getItem(key);
461
- if (savedValue != null)
462
- setSelf(parse(savedValue));
458
+ if (savedValue != null) setSelf(parse(savedValue));
463
459
  onSet(({ newValue }) => {
464
460
  if (newValue == null) {
465
461
  storage.removeItem(key);
@@ -488,7 +484,7 @@ var button = {
488
484
  OpenClose
489
485
  };
490
486
  var ElasticInput = react.forwardRef(function ElasticInputFC(props, ref) {
491
- var _a, _b, _c, _d, _e, _f;
487
+ var _a2, _b2, _c, _d, _e, _f;
492
488
  const inputRef = react.useRef(null);
493
489
  const spanRef = react.useRef(null);
494
490
  const [inputWidth, setInputWidth] = react.useState(`auto`);
@@ -496,8 +492,8 @@ var ElasticInput = react.forwardRef(function ElasticInputFC(props, ref) {
496
492
  ref,
497
493
  () => ({
498
494
  focus: () => {
499
- var _a2;
500
- (_a2 = inputRef.current) == null ? void 0 : _a2.focus();
495
+ var _a3;
496
+ (_a3 = inputRef.current) == null ? void 0 : _a3.focus();
501
497
  }
502
498
  })
503
499
  );
@@ -514,7 +510,7 @@ var ElasticInput = react.forwardRef(function ElasticInputFC(props, ref) {
514
510
  clearInterval(interval);
515
511
  };
516
512
  }
517
- }, [(_a = inputRef.current) == null ? void 0 : _a.value, props.value]);
513
+ }, [(_a2 = inputRef.current) == null ? void 0 : _a2.value, props.value]);
518
514
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: `inline-block`, position: `relative` }, children: [
519
515
  /* @__PURE__ */ jsxRuntime.jsx(
520
516
  "input",
@@ -535,7 +531,7 @@ var ElasticInput = react.forwardRef(function ElasticInputFC(props, ref) {
535
531
  {
536
532
  ref: spanRef,
537
533
  style: {
538
- padding: (_b = props.style) == null ? void 0 : _b.padding,
534
+ padding: (_b2 = props.style) == null ? void 0 : _b2.padding,
539
535
  position: `absolute`,
540
536
  visibility: `hidden`,
541
537
  // color: `red`,
@@ -552,8 +548,7 @@ var ElasticInput = react.forwardRef(function ElasticInputFC(props, ref) {
552
548
  // ../anvl/src/number/clamp.ts
553
549
  var clampInto = (min, max) => (value) => value < min ? min : value > max ? max : value;
554
550
  function round(value, decimalPlaces) {
555
- if (decimalPlaces === void 0)
556
- return value;
551
+ if (decimalPlaces === void 0) return value;
557
552
  const factor = 10 ** decimalPlaces;
558
553
  return Math.round(value * factor) / factor;
559
554
  }
@@ -567,8 +562,7 @@ var VALID_NON_NUMBER_INTERPRETATIONS = {
567
562
  };
568
563
  var isDecimalInProgress = (input) => input === `0` || !Number.isNaN(Number(input)) && input.includes(`.`);
569
564
  var textToValue = (input, allowDecimal) => {
570
- if (isValidNonNumber(input))
571
- return VALID_NON_NUMBER_INTERPRETATIONS[input];
565
+ if (isValidNonNumber(input)) return VALID_NON_NUMBER_INTERPRETATIONS[input];
572
566
  return allowDecimal ? Number.parseFloat(input) : Math.round(Number.parseFloat(input));
573
567
  };
574
568
  var DEFAULT_NUMBER_CONSTRAINTS = {
@@ -623,16 +617,14 @@ var NumberInput = ({
623
617
  userHasMadeDeliberateChange.current = false;
624
618
  };
625
619
  const handleChange = (event) => {
626
- var _a;
627
- if (onChange)
628
- onChange(event);
629
- if (set === void 0)
630
- return;
620
+ var _a2;
621
+ if (onChange) onChange(event);
622
+ if (set === void 0) return;
631
623
  userHasMadeDeliberateChange.current = true;
632
624
  const input = event.target.value;
633
625
  if (isValidNonNumber(input) || isDecimalInProgress(input)) {
634
626
  setTemporaryEntry(input);
635
- const textInterpretation = isDecimalInProgress(input) ? input : (_a = min == null ? void 0 : min.toString()) != null ? _a : `0`;
627
+ const textInterpretation = isDecimalInProgress(input) ? input : (_a2 = min == null ? void 0 : min.toString()) != null ? _a2 : `0`;
636
628
  const newValue = textToValue(textInterpretation, allowDecimal);
637
629
  set(refine(newValue));
638
630
  return;
@@ -822,8 +814,7 @@ var ArrayEditor = ({
822
814
  // ../anvl/src/json-schema/integer.ts
823
815
  var isInteger = (input) => Number.isInteger(input);
824
816
  var parseInteger = (input) => {
825
- if (isInteger(input))
826
- return input;
817
+ if (isInteger(input)) return input;
827
818
  throw new IntegerParseError(input);
828
819
  };
829
820
  var IntegerParseError = class extends Error {
@@ -896,12 +887,10 @@ var retrieveRef = ({
896
887
  if (typeof root === `boolean`) {
897
888
  throw new TypeError(`The root is a boolean and cannot be indexed`);
898
889
  }
899
- if ($ref in refMap)
900
- return { node: refMap[$ref], refMap };
890
+ if ($ref in refMap) return { node: refMap[$ref], refMap };
901
891
  const [_, ...refPath] = $ref.split(`/`);
902
892
  const discovery = delve(root, refPath);
903
- if (discovery instanceof Error)
904
- throw discovery;
893
+ if (discovery instanceof Error) throw discovery;
905
894
  let node = discovery.found;
906
895
  while (isJsonSchemaRef(node)) {
907
896
  const result = retrieveRef({ refNode: node, refMap, root });
@@ -1077,8 +1066,7 @@ var expandPathForSchema = (path) => {
1077
1066
  }
1078
1067
  });
1079
1068
  } catch (caught) {
1080
- if (caught instanceof TypeError)
1081
- return caught;
1069
+ if (caught instanceof TypeError) return caught;
1082
1070
  throw caught;
1083
1071
  }
1084
1072
  };
@@ -1090,8 +1078,7 @@ var findSubSchema = (schema) => {
1090
1078
  }
1091
1079
  return (path) => {
1092
1080
  const pathIntoSchema = expandPathForSchema(path);
1093
- if (pathIntoSchema instanceof Error)
1094
- return pathIntoSchema;
1081
+ if (pathIntoSchema instanceof Error) return pathIntoSchema;
1095
1082
  if (typeof schema === `boolean`) {
1096
1083
  return new TypeError(`The schema is not a JsonSchema`);
1097
1084
  }
@@ -1100,8 +1087,7 @@ var findSubSchema = (schema) => {
1100
1087
  { node: schema, refMap: void 0 }
1101
1088
  );
1102
1089
  const { node, refMap } = reduction;
1103
- if (node instanceof Error)
1104
- throw node;
1090
+ if (node instanceof Error) throw node;
1105
1091
  let subSchema = node;
1106
1092
  while (isJsonSchemaRef(subSchema)) {
1107
1093
  console.log({ subSchema });
@@ -1129,8 +1115,8 @@ var stringToObject = (str) => {
1129
1115
  var objectToString = (obj) => JSON.stringify(obj);
1130
1116
  var objectToBoolean = (obj) => obj.true === true;
1131
1117
  var objectToNumber = (obj) => {
1132
- var _a, _b, _c;
1133
- return Number((_c = (_b = (_a = obj.number) != null ? _a : obj.size) != null ? _b : obj.count) != null ? _c : 0);
1118
+ var _a2, _b2, _c;
1119
+ return Number((_c = (_b2 = (_a2 = obj.number) != null ? _a2 : obj.size) != null ? _b2 : obj.count) != null ? _c : 0);
1134
1120
  };
1135
1121
  var objectToArray = (obj) => Object.entries(obj);
1136
1122
  var booleanToString = (bool) => bool.toString();
@@ -1277,7 +1263,7 @@ var makePropertyRenamers = (data, set, stableKeyMapRef) => mapObject(
1277
1263
  );
1278
1264
  var makePropertyRemovers = (data, set) => mapObject(data, (_, key) => () => {
1279
1265
  set(() => {
1280
- const _a = data, rest = __objRest(_a, [__restKey(key)]);
1266
+ const _a2 = data, rest = __objRest(_a2, [__restKey(key)]);
1281
1267
  return rest;
1282
1268
  });
1283
1269
  });
@@ -1329,7 +1315,7 @@ var ObjectEditor = ({
1329
1315
  set,
1330
1316
  Components
1331
1317
  }) => {
1332
- var _a;
1318
+ var _a2;
1333
1319
  const disabled = isReadonly(path);
1334
1320
  const stableKeyMap = react.useRef(
1335
1321
  Object.keys(data).reduce(
@@ -1347,7 +1333,7 @@ var ObjectEditor = ({
1347
1333
  const sortProperties = makePropertySorter(data, set);
1348
1334
  const makePropertyAdder = makePropertyCreationInterface(data, set);
1349
1335
  const subSchema = isPlainObject(schema) ? findSubSchema(schema)(path) : true;
1350
- const schemaKeys = isLiteral(true)(subSchema) ? true : isObjectSchema(subSchema) ? Object.keys((_a = subSchema.properties) != null ? _a : {}) : [];
1336
+ const schemaKeys = isLiteral(true)(subSchema) ? true : isObjectSchema(subSchema) ? Object.keys((_a2 = subSchema.properties) != null ? _a2 : {}) : [];
1351
1337
  const dataKeys = Object.keys(data);
1352
1338
  const [unofficialKeys, officialKeys] = dataKeys.reduce(
1353
1339
  ([unofficial, official], key) => {
@@ -1469,9 +1455,9 @@ var StringEditor = ({
1469
1455
  ) });
1470
1456
  };
1471
1457
  var DefaultFallback = ({ error, errorInfo }) => {
1472
- var _a, _b, _c;
1473
- const component = (_a = errorInfo == null ? void 0 : errorInfo.componentStack) == null ? void 0 : _a.split(` `).filter(Boolean)[2];
1474
- const message = (_c = (_b = error == null ? void 0 : error.toString()) != null ? _b : errorInfo == null ? void 0 : errorInfo.componentStack) != null ? _c : `Unknown error`;
1458
+ var _a2, _b2, _c;
1459
+ const component = (_a2 = errorInfo == null ? void 0 : errorInfo.componentStack) == null ? void 0 : _a2.split(` `).filter(Boolean)[2];
1460
+ const message = (_c = (_b2 = error == null ? void 0 : error.toString()) != null ? _b2 : errorInfo == null ? void 0 : errorInfo.componentStack) != null ? _c : `Unknown error`;
1475
1461
  return /* @__PURE__ */ jsxRuntime.jsx(
1476
1462
  "div",
1477
1463
  {
@@ -1521,8 +1507,8 @@ var ErrorBoundary = class extends react.Component {
1521
1507
  this.state = {};
1522
1508
  }
1523
1509
  componentDidCatch(error, errorInfo) {
1524
- var _a, _b;
1525
- (_b = (_a = this.props).onError) == null ? void 0 : _b.call(_a, error, errorInfo);
1510
+ var _a2, _b2;
1511
+ (_b2 = (_a2 = this.props).onError) == null ? void 0 : _b2.call(_a2, error, errorInfo);
1526
1512
  this.setState({
1527
1513
  error,
1528
1514
  errorInfo
@@ -1666,15 +1652,13 @@ var findStateTypeState = atom_io.selectorFamily({
1666
1652
  } catch (error) {
1667
1653
  return `error`;
1668
1654
  }
1669
- if (state === void 0)
1670
- return `undefined`;
1671
- if (isJson(state))
1672
- return refineJsonType(state).type;
1655
+ if (state === void 0) return `undefined`;
1656
+ if (isJson(state)) return refineJsonType(state).type;
1673
1657
  return Object.getPrototypeOf(state).constructor.name;
1674
1658
  }
1675
1659
  });
1676
1660
  var StateIndexLeafNode = ({ node, isOpenState, typeState }) => {
1677
- var _a, _b;
1661
+ var _a2, _b2;
1678
1662
  const setIsOpen = react$1.useI(isOpenState);
1679
1663
  const isOpen = react$1.useO(isOpenState);
1680
1664
  const state = react$1.useO(node);
@@ -1701,7 +1685,7 @@ var StateIndexLeafNode = ({ node, isOpenState, typeState }) => {
1701
1685
  console.log(node, atom_io.getState(node));
1702
1686
  },
1703
1687
  children: [
1704
- /* @__PURE__ */ jsxRuntime.jsx("h2", { children: (_b = (_a = node.family) == null ? void 0 : _a.subKey) != null ? _b : node.key }),
1688
+ /* @__PURE__ */ jsxRuntime.jsx("h2", { children: (_b2 = (_a2 = node.family) == null ? void 0 : _a2.subKey) != null ? _b2 : node.key }),
1705
1689
  /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "type detail", children: [
1706
1690
  "(",
1707
1691
  stateType,
@@ -1,7 +1,7 @@
1
- import { lazyLocalStorageEffect } from '../../dist/chunk-BWWVY5O5.js';
2
- import { pipe, ifDefined, isArray, isRecord, doesExtend, isPlainObject, raiseError, sprawl, fallback, doNothing, become, mapObject, delve } from '../../dist/chunk-3V3VWQ7X.js';
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
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-F2X4B4VY.js';
4
+ import { __spreadProps, __spreadValues, __objRest, __restKey } from '../../dist/chunk-S4N6XNPH.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';
@@ -46,11 +46,11 @@ var mustSatisfyOneOfTheFollowing = (isTypeA, logging = false, refinements = [isT
46
46
  const _ = {
47
47
  [name]: (input) => refinements.some(
48
48
  (refinement) => {
49
- var _a;
49
+ var _a2;
50
50
  return logging && console.log(
51
51
  refinements.map((r) => r.name || `anon`).join(` | `),
52
52
  `>`,
53
- (_a = refinement.name) != null ? _a : `anon`,
53
+ (_a2 = refinement.name) != null ? _a2 : `anon`,
54
54
  `:`,
55
55
  refinement(input)
56
56
  ), refinement(input);
@@ -76,12 +76,10 @@ var refineJsonType = (data) => data === null ? { type: `null`, data: null } : is
76
76
  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
77
  );
78
78
  var isJson = (input) => {
79
- var _a;
80
- if (input === null)
81
- return true;
82
- if (input === void 0)
83
- return false;
84
- const prototype = (_a = Object.getPrototypeOf(input)) == null ? void 0 : _a.constructor.name;
79
+ var _a2;
80
+ if (input === null) return true;
81
+ if (input === void 0) return false;
82
+ const prototype = (_a2 = Object.getPrototypeOf(input)) == null ? void 0 : _a2.constructor.name;
85
83
  const refine = JSON_PROTOTYPES.includes(prototype);
86
84
  return refine;
87
85
  };
@@ -208,7 +206,7 @@ var Differ = class {
208
206
  }
209
207
  }
210
208
  diff(a, b) {
211
- var _a, _b;
209
+ var _a2, _b2;
212
210
  if (a === b) {
213
211
  return { summary: `No Change` };
214
212
  }
@@ -219,8 +217,8 @@ var Differ = class {
219
217
  } catch (thrown) {
220
218
  console.error(`Error stringifying`, a, b);
221
219
  }
222
- const aRefined = (_a = this.leafRefinery.refine(a)) != null ? _a : this.treeRefinery.refine(a);
223
- const bRefined = (_b = this.leafRefinery.refine(b)) != null ? _b : this.treeRefinery.refine(b);
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);
224
222
  if (aRefined !== null && bRefined !== null) {
225
223
  if (aRefined.type === bRefined.type) {
226
224
  if (aRefined.type in this.leafDiffers) {
@@ -271,7 +269,7 @@ var button = {
271
269
  OpenClose
272
270
  };
273
271
  var ElasticInput = forwardRef(function ElasticInputFC(props, ref) {
274
- var _a, _b, _c, _d, _e, _f;
272
+ var _a2, _b2, _c, _d, _e, _f;
275
273
  const inputRef = useRef(null);
276
274
  const spanRef = useRef(null);
277
275
  const [inputWidth, setInputWidth] = useState(`auto`);
@@ -279,8 +277,8 @@ var ElasticInput = forwardRef(function ElasticInputFC(props, ref) {
279
277
  ref,
280
278
  () => ({
281
279
  focus: () => {
282
- var _a2;
283
- (_a2 = inputRef.current) == null ? void 0 : _a2.focus();
280
+ var _a3;
281
+ (_a3 = inputRef.current) == null ? void 0 : _a3.focus();
284
282
  }
285
283
  })
286
284
  );
@@ -297,7 +295,7 @@ var ElasticInput = forwardRef(function ElasticInputFC(props, ref) {
297
295
  clearInterval(interval);
298
296
  };
299
297
  }
300
- }, [(_a = inputRef.current) == null ? void 0 : _a.value, props.value]);
298
+ }, [(_a2 = inputRef.current) == null ? void 0 : _a2.value, props.value]);
301
299
  return /* @__PURE__ */ jsxs("div", { style: { display: `inline-block`, position: `relative` }, children: [
302
300
  /* @__PURE__ */ jsx(
303
301
  "input",
@@ -318,7 +316,7 @@ var ElasticInput = forwardRef(function ElasticInputFC(props, ref) {
318
316
  {
319
317
  ref: spanRef,
320
318
  style: {
321
- padding: (_b = props.style) == null ? void 0 : _b.padding,
319
+ padding: (_b2 = props.style) == null ? void 0 : _b2.padding,
322
320
  position: `absolute`,
323
321
  visibility: `hidden`,
324
322
  // color: `red`,
@@ -335,8 +333,7 @@ var ElasticInput = forwardRef(function ElasticInputFC(props, ref) {
335
333
  // ../anvl/src/number/clamp.ts
336
334
  var clampInto = (min, max) => (value) => value < min ? min : value > max ? max : value;
337
335
  function round(value, decimalPlaces) {
338
- if (decimalPlaces === void 0)
339
- return value;
336
+ if (decimalPlaces === void 0) return value;
340
337
  const factor = 10 ** decimalPlaces;
341
338
  return Math.round(value * factor) / factor;
342
339
  }
@@ -350,8 +347,7 @@ var VALID_NON_NUMBER_INTERPRETATIONS = {
350
347
  };
351
348
  var isDecimalInProgress = (input) => input === `0` || !Number.isNaN(Number(input)) && input.includes(`.`);
352
349
  var textToValue = (input, allowDecimal) => {
353
- if (isValidNonNumber(input))
354
- return VALID_NON_NUMBER_INTERPRETATIONS[input];
350
+ if (isValidNonNumber(input)) return VALID_NON_NUMBER_INTERPRETATIONS[input];
355
351
  return allowDecimal ? Number.parseFloat(input) : Math.round(Number.parseFloat(input));
356
352
  };
357
353
  var DEFAULT_NUMBER_CONSTRAINTS = {
@@ -406,16 +402,14 @@ var NumberInput = ({
406
402
  userHasMadeDeliberateChange.current = false;
407
403
  };
408
404
  const handleChange = (event) => {
409
- var _a;
410
- if (onChange)
411
- onChange(event);
412
- if (set === void 0)
413
- return;
405
+ var _a2;
406
+ if (onChange) onChange(event);
407
+ if (set === void 0) return;
414
408
  userHasMadeDeliberateChange.current = true;
415
409
  const input = event.target.value;
416
410
  if (isValidNonNumber(input) || isDecimalInProgress(input)) {
417
411
  setTemporaryEntry(input);
418
- const textInterpretation = isDecimalInProgress(input) ? input : (_a = min == null ? void 0 : min.toString()) != null ? _a : `0`;
412
+ const textInterpretation = isDecimalInProgress(input) ? input : (_a2 = min == null ? void 0 : min.toString()) != null ? _a2 : `0`;
419
413
  const newValue = textToValue(textInterpretation, allowDecimal);
420
414
  set(refine(newValue));
421
415
  return;
@@ -605,8 +599,7 @@ var ArrayEditor = ({
605
599
  // ../anvl/src/json-schema/integer.ts
606
600
  var isInteger = (input) => Number.isInteger(input);
607
601
  var parseInteger = (input) => {
608
- if (isInteger(input))
609
- return input;
602
+ if (isInteger(input)) return input;
610
603
  throw new IntegerParseError(input);
611
604
  };
612
605
  var IntegerParseError = class extends Error {
@@ -679,12 +672,10 @@ var retrieveRef = ({
679
672
  if (typeof root === `boolean`) {
680
673
  throw new TypeError(`The root is a boolean and cannot be indexed`);
681
674
  }
682
- if ($ref in refMap)
683
- return { node: refMap[$ref], refMap };
675
+ if ($ref in refMap) return { node: refMap[$ref], refMap };
684
676
  const [_, ...refPath] = $ref.split(`/`);
685
677
  const discovery = delve(root, refPath);
686
- if (discovery instanceof Error)
687
- throw discovery;
678
+ if (discovery instanceof Error) throw discovery;
688
679
  let node = discovery.found;
689
680
  while (isJsonSchemaRef(node)) {
690
681
  const result = retrieveRef({ refNode: node, refMap, root });
@@ -860,8 +851,7 @@ var expandPathForSchema = (path) => {
860
851
  }
861
852
  });
862
853
  } catch (caught) {
863
- if (caught instanceof TypeError)
864
- return caught;
854
+ if (caught instanceof TypeError) return caught;
865
855
  throw caught;
866
856
  }
867
857
  };
@@ -873,8 +863,7 @@ var findSubSchema = (schema) => {
873
863
  }
874
864
  return (path) => {
875
865
  const pathIntoSchema = expandPathForSchema(path);
876
- if (pathIntoSchema instanceof Error)
877
- return pathIntoSchema;
866
+ if (pathIntoSchema instanceof Error) return pathIntoSchema;
878
867
  if (typeof schema === `boolean`) {
879
868
  return new TypeError(`The schema is not a JsonSchema`);
880
869
  }
@@ -883,8 +872,7 @@ var findSubSchema = (schema) => {
883
872
  { node: schema, refMap: void 0 }
884
873
  );
885
874
  const { node, refMap } = reduction;
886
- if (node instanceof Error)
887
- throw node;
875
+ if (node instanceof Error) throw node;
888
876
  let subSchema = node;
889
877
  while (isJsonSchemaRef(subSchema)) {
890
878
  console.log({ subSchema });
@@ -912,8 +900,8 @@ var stringToObject = (str) => {
912
900
  var objectToString = (obj) => JSON.stringify(obj);
913
901
  var objectToBoolean = (obj) => obj.true === true;
914
902
  var objectToNumber = (obj) => {
915
- var _a, _b, _c;
916
- return Number((_c = (_b = (_a = obj.number) != null ? _a : obj.size) != null ? _b : obj.count) != null ? _c : 0);
903
+ var _a2, _b2, _c;
904
+ return Number((_c = (_b2 = (_a2 = obj.number) != null ? _a2 : obj.size) != null ? _b2 : obj.count) != null ? _c : 0);
917
905
  };
918
906
  var objectToArray = (obj) => Object.entries(obj);
919
907
  var booleanToString = (bool) => bool.toString();
@@ -1060,7 +1048,7 @@ var makePropertyRenamers = (data, set, stableKeyMapRef) => mapObject(
1060
1048
  );
1061
1049
  var makePropertyRemovers = (data, set) => mapObject(data, (_, key) => () => {
1062
1050
  set(() => {
1063
- const _a = data, rest = __objRest(_a, [__restKey(key)]);
1051
+ const _a2 = data, rest = __objRest(_a2, [__restKey(key)]);
1064
1052
  return rest;
1065
1053
  });
1066
1054
  });
@@ -1112,7 +1100,7 @@ var ObjectEditor = ({
1112
1100
  set,
1113
1101
  Components
1114
1102
  }) => {
1115
- var _a;
1103
+ var _a2;
1116
1104
  const disabled = isReadonly(path);
1117
1105
  const stableKeyMap = useRef(
1118
1106
  Object.keys(data).reduce(
@@ -1130,7 +1118,7 @@ var ObjectEditor = ({
1130
1118
  const sortProperties = makePropertySorter(data, set);
1131
1119
  const makePropertyAdder = makePropertyCreationInterface(data, set);
1132
1120
  const subSchema = isPlainObject(schema) ? findSubSchema(schema)(path) : true;
1133
- const schemaKeys = isLiteral(true)(subSchema) ? true : isObjectSchema(subSchema) ? Object.keys((_a = subSchema.properties) != null ? _a : {}) : [];
1121
+ const schemaKeys = isLiteral(true)(subSchema) ? true : isObjectSchema(subSchema) ? Object.keys((_a2 = subSchema.properties) != null ? _a2 : {}) : [];
1134
1122
  const dataKeys = Object.keys(data);
1135
1123
  const [unofficialKeys, officialKeys] = dataKeys.reduce(
1136
1124
  ([unofficial, official], key) => {
@@ -1252,9 +1240,9 @@ var StringEditor = ({
1252
1240
  ) });
1253
1241
  };
1254
1242
  var DefaultFallback = ({ error, errorInfo }) => {
1255
- var _a, _b, _c;
1256
- const component = (_a = errorInfo == null ? void 0 : errorInfo.componentStack) == null ? void 0 : _a.split(` `).filter(Boolean)[2];
1257
- const message = (_c = (_b = error == null ? void 0 : error.toString()) != null ? _b : errorInfo == null ? void 0 : errorInfo.componentStack) != null ? _c : `Unknown error`;
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`;
1258
1246
  return /* @__PURE__ */ jsx(
1259
1247
  "div",
1260
1248
  {
@@ -1304,8 +1292,8 @@ var ErrorBoundary = class extends Component {
1304
1292
  this.state = {};
1305
1293
  }
1306
1294
  componentDidCatch(error, errorInfo) {
1307
- var _a, _b;
1308
- (_b = (_a = this.props).onError) == null ? void 0 : _b.call(_a, error, errorInfo);
1295
+ var _a2, _b2;
1296
+ (_b2 = (_a2 = this.props).onError) == null ? void 0 : _b2.call(_a2, error, errorInfo);
1309
1297
  this.setState({
1310
1298
  error,
1311
1299
  errorInfo
@@ -1449,15 +1437,13 @@ var findStateTypeState = selectorFamily({
1449
1437
  } catch (error) {
1450
1438
  return `error`;
1451
1439
  }
1452
- if (state === void 0)
1453
- return `undefined`;
1454
- if (isJson(state))
1455
- return refineJsonType(state).type;
1440
+ if (state === void 0) return `undefined`;
1441
+ if (isJson(state)) return refineJsonType(state).type;
1456
1442
  return Object.getPrototypeOf(state).constructor.name;
1457
1443
  }
1458
1444
  });
1459
1445
  var StateIndexLeafNode = ({ node, isOpenState, typeState }) => {
1460
- var _a, _b;
1446
+ var _a2, _b2;
1461
1447
  const setIsOpen = useI(isOpenState);
1462
1448
  const isOpen = useO(isOpenState);
1463
1449
  const state = useO(node);
@@ -1484,7 +1470,7 @@ var StateIndexLeafNode = ({ node, isOpenState, typeState }) => {
1484
1470
  console.log(node, getState(node));
1485
1471
  },
1486
1472
  children: [
1487
- /* @__PURE__ */ jsx("h2", { children: (_b = (_a = node.family) == null ? void 0 : _a.subKey) != null ? _b : node.key }),
1473
+ /* @__PURE__ */ jsx("h2", { children: (_b2 = (_a2 = node.family) == null ? void 0 : _a2.subKey) != null ? _b2 : node.key }),
1488
1474
  /* @__PURE__ */ jsxs("span", { className: "type detail", children: [
1489
1475
  "(",
1490
1476
  stateType,
@@ -1,4 +1,4 @@
1
- import '../../dist/chunk-F2X4B4VY.js';
1
+ import '../../dist/chunk-S4N6XNPH.js';
2
2
  import { assignTransactionToContinuity, IMPLICIT, setEpochNumberOfContinuity, getUpdateToken } from 'atom.io/internal';
3
3
  import { atom, selectorFamily } from 'atom.io';
4
4
  import { join, getInternalRelations } from 'atom.io/data';
@@ -181,8 +181,7 @@ function pushState(token, socket, store) {
181
181
  // __unstable__/web-effects/src/storage.ts
182
182
  var persistAtom = (storage) => ({ stringify, parse }) => (key) => ({ setSelf, onSet }) => {
183
183
  const savedValue = storage.getItem(key);
184
- if (savedValue != null)
185
- setSelf(parse(savedValue));
184
+ if (savedValue != null) setSelf(parse(savedValue));
186
185
  onSet(({ newValue }) => {
187
186
  if (newValue == null) {
188
187
  storage.removeItem(key);
@@ -550,8 +549,7 @@ function syncContinuity(continuity, socket, store) {
550
549
  return () => {
551
550
  socket.off(`continuity-init:${continuityKey}`);
552
551
  socket.off(`tx-new:${continuityKey}`);
553
- for (const unsubscribe of unsubscribeFunctions)
554
- unsubscribe();
552
+ for (const unsubscribe of unsubscribeFunctions) unsubscribe();
555
553
  };
556
554
  }
557
555
 
@@ -1,5 +1,5 @@
1
- import { lazyLocalStorageEffect } from '../../dist/chunk-BWWVY5O5.js';
2
- import '../../dist/chunk-F2X4B4VY.js';
1
+ import { lazyLocalStorageEffect } from '../../dist/chunk-H6EDLPKH.js';
2
+ import '../../dist/chunk-S4N6XNPH.js';
3
3
  import * as Internal from 'atom.io/internal';
4
4
  import { setIntoStore, getJsonToken, getUpdateToken, getFromStore, assignTransactionToContinuity, subscribeToTransaction, disposeAtom, setEpochNumberOfContinuity, getEpochNumberOfContinuity, isRootStore, ingestTransactionUpdate, actUponStore } from 'atom.io/internal';
5
5
  import { parseJson } from 'atom.io/json';
@@ -512,8 +512,7 @@ function syncContinuity(continuity, socket, store) {
512
512
  return () => {
513
513
  socket.off(`continuity-init:${continuityKey}`);
514
514
  socket.off(`tx-new:${continuityKey}`);
515
- for (const unsubscribe of unsubscribeFunctions)
516
- unsubscribe();
515
+ for (const unsubscribe of unsubscribeFunctions) unsubscribe();
517
516
  };
518
517
  }
519
518
 
@@ -1,4 +1,4 @@
1
- import '../../dist/chunk-F2X4B4VY.js';
1
+ import '../../dist/chunk-S4N6XNPH.js';
2
2
  import { useI, StoreContext, useO } from 'atom.io/react';
3
3
  import * as RTC from 'atom.io/realtime-client';
4
4
  import { syncContinuity } from 'atom.io/realtime-client';
@@ -669,8 +669,7 @@ function realtimeContinuitySynchronizer({
669
669
  unsubFns.push(unsubscribe);
670
670
  }
671
671
  return () => {
672
- for (const unsubscribe of unsubFns)
673
- unsubscribe();
672
+ for (const unsubscribe of unsubFns) unsubscribe();
674
673
  };
675
674
  };
676
675
  const unsubscribeFromPerspectives = revealPerspectives();
@@ -808,8 +807,7 @@ function realtimeContinuitySynchronizer({
808
807
  socket.off(`tx-run:${continuityKey}`, fillTransactionRequest);
809
808
  socket.on(`tx-run:${continuityKey}`, fillTransactionRequest);
810
809
  return () => {
811
- for (const unsubscribe of unsubscribeFunctions)
812
- unsubscribe();
810
+ for (const unsubscribe of unsubscribeFunctions) unsubscribe();
813
811
  unsubscribeFromPerspectives();
814
812
  socket == null ? void 0 : socket.off(`get:${continuityKey}`, sendInitialPayload);
815
813
  socket == null ? void 0 : socket.off(`tx-run:${continuityKey}`, fillTransactionRequest);
@@ -1,4 +1,4 @@
1
- import { __spreadProps, __spreadValues } from '../../dist/chunk-F2X4B4VY.js';
1
+ import { __spreadProps, __spreadValues } from '../../dist/chunk-S4N6XNPH.js';
2
2
  import { parseJson, stringifyJson } from 'atom.io/json';
3
3
  import { getUpdateToken, IMPLICIT, Subject, getFromStore, subscribeToState, findInStore, getJsonToken, actUponStore, isRootStore, subscribeToTransaction, setIntoStore } from 'atom.io/internal';
4
4
  import { SetRTX } from 'atom.io/transceivers/set-rtx';
@@ -629,8 +629,7 @@ function realtimeContinuitySynchronizer({
629
629
  unsubFns.push(unsubscribe);
630
630
  }
631
631
  return () => {
632
- for (const unsubscribe of unsubFns)
633
- unsubscribe();
632
+ for (const unsubscribe of unsubFns) unsubscribe();
634
633
  };
635
634
  };
636
635
  const unsubscribeFromPerspectives = revealPerspectives();
@@ -768,8 +767,7 @@ function realtimeContinuitySynchronizer({
768
767
  socket.off(`tx-run:${continuityKey}`, fillTransactionRequest);
769
768
  socket.on(`tx-run:${continuityKey}`, fillTransactionRequest);
770
769
  return () => {
771
- for (const unsubscribe of unsubscribeFunctions)
772
- unsubscribe();
770
+ for (const unsubscribe of unsubscribeFunctions) unsubscribe();
773
771
  unsubscribeFromPerspectives();
774
772
  socket == null ? void 0 : socket.off(`get:${continuityKey}`, sendInitialPayload);
775
773
  socket == null ? void 0 : socket.off(`tx-run:${continuityKey}`, fillTransactionRequest);
@@ -74,8 +74,7 @@ var setupRealtimeTestServer = (options) => {
74
74
  const httpServer = http__namespace.createServer((_, res) => res.end(`Hello World!`));
75
75
  const address = httpServer.listen(options.port).address();
76
76
  const port = typeof address === `string` ? null : address === null ? null : address.port;
77
- if (port === null)
78
- throw new Error(`Could not determine port for test server`);
77
+ if (port === null) throw new Error(`Could not determine port for test server`);
79
78
  const server = new SocketIO__namespace.Server(httpServer).use((socket, next) => {
80
79
  const { token, username } = socket.handshake.auth;
81
80
  if (token === `test` && socket.id) {
@@ -1,5 +1,5 @@
1
- import { recordToEntries } from '../../dist/chunk-3V3VWQ7X.js';
2
- import { __spreadProps, __spreadValues } from '../../dist/chunk-F2X4B4VY.js';
1
+ import { recordToEntries } from '../../dist/chunk-MR5NETHW.js';
2
+ import { __spreadProps, __spreadValues } from '../../dist/chunk-S4N6XNPH.js';
3
3
  import * as http from 'http';
4
4
  import { render, prettyDOM } from '@testing-library/react';
5
5
  import * as AtomIO from 'atom.io';
@@ -25,8 +25,7 @@ var setupRealtimeTestServer = (options) => {
25
25
  const httpServer = http.createServer((_, res) => res.end(`Hello World!`));
26
26
  const address = httpServer.listen(options.port).address();
27
27
  const port = typeof address === `string` ? null : address === null ? null : address.port;
28
- if (port === null)
29
- throw new Error(`Could not determine port for test server`);
28
+ if (port === null) throw new Error(`Could not determine port for test server`);
30
29
  const server = new SocketIO.Server(httpServer).use((socket, next) => {
31
30
  const { token, username } = socket.handshake.auth;
32
31
  if (token === `test` && socket.id) {
package/src/molecule.ts CHANGED
@@ -39,7 +39,7 @@ export type MoleculeTransactors<K extends Json.Serializable> = Flat<
39
39
 
40
40
  claim(below: MoleculeToken<any>, options: { exclusive: boolean })
41
41
 
42
- join(joinToken: JoinToken<any, any, any, any>): void
42
+ join<J extends JoinToken<any, any, any, any>>(joinToken: J): J
43
43
 
44
44
  spawn<Key extends Json.Serializable, Ctor extends MoleculeConstructor>(
45
45
  family: MoleculeFamilyToken<Ctor>,
@@ -186,8 +186,7 @@ var SetRTX = class _SetRTX extends Set {
186
186
  break;
187
187
  case `clear`: {
188
188
  const values = JSON.parse(value);
189
- for (const v of values)
190
- this.add(v);
189
+ for (const v of values) this.add(v);
191
190
  break;
192
191
  }
193
192
  case `tx`: {
@@ -1,4 +1,4 @@
1
- import '../../../dist/chunk-F2X4B4VY.js';
1
+ import '../../../dist/chunk-S4N6XNPH.js';
2
2
  import { Subject } from 'atom.io/internal';
3
3
  import { stringifyJson, parseJson } from 'atom.io/json';
4
4
 
@@ -184,8 +184,7 @@ var SetRTX = class _SetRTX extends Set {
184
184
  break;
185
185
  case `clear`: {
186
186
  const values = JSON.parse(value);
187
- for (const v of values)
188
- this.add(v);
187
+ for (const v of values) this.add(v);
189
188
  break;
190
189
  }
191
190
  case `tx`: {
File without changes