atom.io 0.25.5 → 0.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/data/dist/index.js +33 -25
  2. package/data/package.json +1 -4
  3. package/data/src/join.ts +0 -1
  4. package/dist/{chunk-HYXKCFVY.js → chunk-IBTHB2PI.js} +59 -60
  5. package/dist/{chunk-MR5NETHW.js → chunk-IW6WYRS7.js} +4 -5
  6. package/dist/chunk-XWL6SNVU.js +7 -0
  7. package/dist/index.js +33 -21
  8. package/ephemeral/dist/index.js +1 -1
  9. package/ephemeral/package.json +1 -4
  10. package/eslint-plugin/dist/index.d.ts +1 -1
  11. package/eslint-plugin/dist/index.js +7 -8
  12. package/eslint-plugin/package.json +1 -4
  13. package/immortal/dist/index.js +1 -1
  14. package/immortal/package.json +1 -4
  15. package/internal/dist/index.js +173 -160
  16. package/internal/package.json +1 -4
  17. package/introspection/dist/index.js +32 -30
  18. package/introspection/package.json +1 -4
  19. package/json/dist/index.js +1 -1
  20. package/json/package.json +1 -4
  21. package/package.json +27 -58
  22. package/react/dist/index.js +2 -2
  23. package/react/package.json +1 -4
  24. package/react-devtools/dist/index.js +75 -68
  25. package/react-devtools/package.json +1 -4
  26. package/realtime/dist/index.js +8 -9
  27. package/realtime/package.json +1 -4
  28. package/realtime-client/dist/index.js +6 -6
  29. package/realtime-client/package.json +1 -4
  30. package/realtime-react/dist/index.js +9 -11
  31. package/realtime-react/package.json +1 -4
  32. package/realtime-server/dist/index.js +59 -54
  33. package/realtime-server/package.json +1 -4
  34. package/realtime-testing/dist/index.js +3 -3
  35. package/realtime-testing/package.json +1 -4
  36. package/transceivers/set-rtx/dist/index.js +11 -11
  37. package/transceivers/set-rtx/package.json +1 -4
  38. package/data/dist/index.cjs +0 -953
  39. package/dist/chunk-S4N6XNPH.js +0 -38
  40. package/dist/index.cjs +0 -215
  41. package/ephemeral/dist/index.cjs +0 -11
  42. package/eslint-plugin/dist/index.cjs +0 -388
  43. package/immortal/dist/index.cjs +0 -14
  44. package/internal/dist/index.cjs +0 -3405
  45. package/introspection/dist/index.cjs +0 -449
  46. package/json/dist/index.cjs +0 -128
  47. package/react/dist/index.cjs +0 -118
  48. package/react-devtools/dist/index.cjs +0 -2191
  49. package/realtime/dist/index.cjs +0 -120
  50. package/realtime-client/dist/index.cjs +0 -569
  51. package/realtime-react/dist/index.cjs +0 -189
  52. package/realtime-server/dist/index.cjs +0 -965
  53. package/realtime-testing/dist/index.cjs +0 -201
  54. package/transceivers/set-rtx/dist/index.cjs +0 -215
@@ -1,7 +1,7 @@
1
1
  import { lazyLocalStorageEffect } from '../../dist/chunk-H6EDLPKH.js';
2
- import { pipe, ifDefined, isArray, isRecord, doesExtend, isPlainObject, raiseError, sprawl, fallback, doNothing, become, mapObject, delve } from '../../dist/chunk-MR5NETHW.js';
2
+ import { pipe, ifDefined, isArray, isRecord, doesExtend, isPlainObject, raiseError, sprawl, fallback, doNothing, become, mapObject, delve } from '../../dist/chunk-IW6WYRS7.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-S4N6XNPH.js';
4
+ import '../../dist/chunk-XWL6SNVU.js';
5
5
  import { selectorFamily, atom, atomFamily, undo, redo, getState } from 'atom.io';
6
6
  import { attachIntrospectionStates } from 'atom.io/introspection';
7
7
  import { useI, useO } from 'atom.io/react';
@@ -18,7 +18,7 @@ var cannotExist = (_) => false;
18
18
 
19
19
  // ../anvl/src/refinement/is-intersection.ts
20
20
  function mustSatisfyAllOfTheFollowing(isTypeA, logging = false, refinements = [isTypeA]) {
21
- const name = `(${refinements.map((r) => (r == null ? void 0 : r.name) || `anon`).join(` & `)})`;
21
+ const name = `(${refinements.map((r) => r?.name || `anon`).join(` & `)})`;
22
22
  const _ = {
23
23
  [name]: (input) => refinements.every(
24
24
  (refinement) => (logging && console.log(
@@ -42,19 +42,16 @@ var isIntersection = mustSatisfyAllOfTheFollowing(canExist);
42
42
 
43
43
  // ../anvl/src/refinement/is-union.ts
44
44
  var mustSatisfyOneOfTheFollowing = (isTypeA, logging = false, refinements = [isTypeA]) => {
45
- const name = `(${refinements.map((r) => (r == null ? void 0 : r.name) || `anon`).join(` | `)})`;
45
+ const name = `(${refinements.map((r) => r?.name || `anon`).join(` | `)})`;
46
46
  const _ = {
47
47
  [name]: (input) => refinements.some(
48
- (refinement) => {
49
- var _a2;
50
- return logging && console.log(
51
- refinements.map((r) => r.name || `anon`).join(` | `),
52
- `>`,
53
- (_a2 = refinement.name) != null ? _a2 : `anon`,
54
- `:`,
55
- refinement(input)
56
- ), refinement(input);
57
- }
48
+ (refinement) => (logging && console.log(
49
+ refinements.map((r) => r.name || `anon`).join(` | `),
50
+ `>`,
51
+ refinement.name ?? `anon`,
52
+ `:`,
53
+ refinement(input)
54
+ ), refinement(input))
58
55
  )
59
56
  };
60
57
  const checkTypes = Object.assign(_[name], {
@@ -76,16 +73,16 @@ var refineJsonType = (data) => data === null ? { type: `null`, data: null } : is
76
73
  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
74
  );
78
75
  var isJson = (input) => {
79
- var _a2;
80
76
  if (input === null) return true;
81
77
  if (input === void 0) return false;
82
- const prototype = (_a2 = Object.getPrototypeOf(input)) == null ? void 0 : _a2.constructor.name;
78
+ const prototype = Object.getPrototypeOf(input)?.constructor.name;
83
79
  const refine = JSON_PROTOTYPES.includes(prototype);
84
80
  return refine;
85
81
  };
86
82
 
87
83
  // ../anvl/src/refinement/refinery.ts
88
84
  var Refinery = class {
85
+ supported;
89
86
  constructor(supported) {
90
87
  this.supported = supported;
91
88
  }
@@ -191,6 +188,10 @@ function diffArray(a, b, recurse) {
191
188
  return diffObject(a, b, recurse);
192
189
  }
193
190
  var Differ = class {
191
+ leafRefinery;
192
+ treeRefinery;
193
+ leafDiffers;
194
+ treeDiffers;
194
195
  constructor(leafRefinery, treeRefinery, diffFunctions) {
195
196
  this.leafRefinery = leafRefinery;
196
197
  this.treeRefinery = treeRefinery;
@@ -206,7 +207,6 @@ var Differ = class {
206
207
  }
207
208
  }
208
209
  diff(a, b) {
209
- var _a2, _b2;
210
210
  if (a === b) {
211
211
  return { summary: `No Change` };
212
212
  }
@@ -217,8 +217,8 @@ var Differ = class {
217
217
  } catch (thrown) {
218
218
  console.error(`Error stringifying`, a, b);
219
219
  }
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);
220
+ const aRefined = this.leafRefinery.refine(a) ?? this.treeRefinery.refine(a);
221
+ const bRefined = this.leafRefinery.refine(b) ?? this.treeRefinery.refine(b);
222
222
  if (aRefined !== null && bRefined !== null) {
223
223
  if (aRefined.type === bRefined.type) {
224
224
  if (aRefined.type in this.leafDiffers) {
@@ -269,7 +269,6 @@ var button = {
269
269
  OpenClose
270
270
  };
271
271
  var ElasticInput = forwardRef(function ElasticInputFC(props, ref) {
272
- var _a2, _b2, _c, _d, _e, _f;
273
272
  const inputRef = useRef(null);
274
273
  const spanRef = useRef(null);
275
274
  const [inputWidth, setInputWidth] = useState(`auto`);
@@ -277,8 +276,7 @@ var ElasticInput = forwardRef(function ElasticInputFC(props, ref) {
277
276
  ref,
278
277
  () => ({
279
278
  focus: () => {
280
- var _a3;
281
- (_a3 = inputRef.current) == null ? void 0 : _a3.focus();
279
+ inputRef.current?.focus();
282
280
  }
283
281
  })
284
282
  );
@@ -295,34 +293,36 @@ var ElasticInput = forwardRef(function ElasticInputFC(props, ref) {
295
293
  clearInterval(interval);
296
294
  };
297
295
  }
298
- }, [(_a2 = inputRef.current) == null ? void 0 : _a2.value, props.value]);
296
+ }, [inputRef.current?.value, props.value]);
299
297
  return /* @__PURE__ */ jsxs("div", { style: { display: `inline-block`, position: `relative` }, children: [
300
298
  /* @__PURE__ */ jsx(
301
299
  "input",
302
- __spreadProps(__spreadValues({}, props), {
300
+ {
301
+ ...props,
303
302
  ref: inputRef,
304
- style: __spreadValues({
303
+ style: {
305
304
  padding: 0,
306
305
  borderRadius: 0,
307
306
  border: `none`,
308
307
  fontFamily: `inherit`,
309
308
  fontSize: `inherit`,
310
- width: inputWidth
311
- }, props.style)
312
- })
309
+ width: inputWidth,
310
+ ...props.style
311
+ }
312
+ }
313
313
  ),
314
314
  /* @__PURE__ */ jsx(
315
315
  "span",
316
316
  {
317
317
  ref: spanRef,
318
318
  style: {
319
- padding: (_b2 = props.style) == null ? void 0 : _b2.padding,
319
+ padding: props.style?.padding,
320
320
  position: `absolute`,
321
321
  visibility: `hidden`,
322
322
  // color: `red`,
323
323
  whiteSpace: `pre`,
324
- fontFamily: (_d = (_c = props.style) == null ? void 0 : _c.fontFamily) != null ? _d : `inherit`,
325
- fontSize: (_f = (_e = props.style) == null ? void 0 : _e.fontSize) != null ? _f : `inherit`
324
+ fontFamily: props.style?.fontFamily ?? `inherit`,
325
+ fontSize: props.style?.fontSize ?? `inherit`
326
326
  },
327
327
  children: props.value
328
328
  }
@@ -360,9 +360,12 @@ var initRefinery = (constraints) => (input) => {
360
360
  if (input === null && constraints.nullable === true) {
361
361
  return null;
362
362
  }
363
- const { max, min, decimalPlaces } = __spreadValues(__spreadValues({}, DEFAULT_NUMBER_CONSTRAINTS), constraints);
363
+ const { max, min, decimalPlaces } = {
364
+ ...DEFAULT_NUMBER_CONSTRAINTS,
365
+ ...constraints
366
+ };
364
367
  const constrained = pipe(
365
- input != null ? input : 0,
368
+ input ?? 0,
366
369
  clampInto(min, max),
367
370
  (n) => decimalPlaces ? round(n, decimalPlaces) : n
368
371
  );
@@ -396,20 +399,19 @@ var NumberInput = ({
396
399
  const allowDecimal = decimalPlaces === void 0 || decimalPlaces > 0;
397
400
  const handleBlur = () => {
398
401
  if (userHasMadeDeliberateChange.current) {
399
- set(refine(value != null ? value : null));
402
+ set(refine(value ?? null));
400
403
  setTemporaryEntry(null);
401
404
  }
402
405
  userHasMadeDeliberateChange.current = false;
403
406
  };
404
407
  const handleChange = (event) => {
405
- var _a2;
406
408
  if (onChange) onChange(event);
407
409
  if (set === void 0) return;
408
410
  userHasMadeDeliberateChange.current = true;
409
411
  const input = event.target.value;
410
412
  if (isValidNonNumber(input) || isDecimalInProgress(input)) {
411
413
  setTemporaryEntry(input);
412
- const textInterpretation = isDecimalInProgress(input) ? input : (_a2 = min == null ? void 0 : min.toString()) != null ? _a2 : `0`;
414
+ const textInterpretation = isDecimalInProgress(input) ? input : min?.toString() ?? `0`;
413
415
  const newValue = textToValue(textInterpretation, allowDecimal);
414
416
  set(refine(newValue));
415
417
  return;
@@ -421,7 +423,7 @@ var NumberInput = ({
421
423
  set(refine(numericValue));
422
424
  }
423
425
  };
424
- const displayValue = temporaryEntry != null ? temporaryEntry : valueToText(value ? refine(value) : value);
426
+ const displayValue = temporaryEntry ?? valueToText(value ? refine(value) : value);
425
427
  return /* @__PURE__ */ jsxs("span", { children: [
426
428
  label && /* @__PURE__ */ jsx("label", { htmlFor: id, children: label }),
427
429
  autoSize ? /* @__PURE__ */ jsx(
@@ -429,28 +431,28 @@ var NumberInput = ({
429
431
  {
430
432
  type: "text",
431
433
  value: displayValue,
432
- placeholder: placeholder != null ? placeholder : `-`,
434
+ placeholder: placeholder ?? `-`,
433
435
  onChange: handleChange,
434
436
  onBlur: handleBlur,
435
437
  disabled,
436
- name: name != null ? name : id,
438
+ name: name ?? id,
437
439
  id,
438
440
  onClick,
439
- "data-testid": `number-input-${testId != null ? testId : id}`
441
+ "data-testid": `number-input-${testId ?? id}`
440
442
  }
441
443
  ) : /* @__PURE__ */ jsx(
442
444
  "input",
443
445
  {
444
446
  type: "text",
445
447
  value: displayValue,
446
- placeholder: placeholder != null ? placeholder : `-`,
448
+ placeholder: placeholder ?? `-`,
447
449
  onChange: handleChange,
448
450
  onBlur: handleBlur,
449
451
  disabled,
450
- name: name != null ? name : id,
452
+ name: name ?? id,
451
453
  id,
452
454
  onClick,
453
- "data-testid": `number-input-${testId != null ? testId : id}`
455
+ "data-testid": `number-input-${testId ?? id}`
454
456
  }
455
457
  )
456
458
  ] });
@@ -469,7 +471,7 @@ var TextInput = ({
469
471
  {
470
472
  type: "text",
471
473
  value,
472
- onChange: (e) => set == null ? void 0 : set(e.target.value),
474
+ onChange: (e) => set?.(e.target.value),
473
475
  disabled: set === void 0,
474
476
  placeholder
475
477
  }
@@ -478,7 +480,7 @@ var TextInput = ({
478
480
  {
479
481
  type: "text",
480
482
  value,
481
- onChange: (e) => set == null ? void 0 : set(e.target.value),
483
+ onChange: (e) => set?.(e.target.value),
482
484
  disabled: set === void 0,
483
485
  placeholder
484
486
  }
@@ -683,7 +685,7 @@ var retrieveRef = ({
683
685
  refMap = result.refMap;
684
686
  }
685
687
  if (isJsonSchema(node)) {
686
- return { node, refMap: __spreadProps(__spreadValues({}, refMap), { [$ref]: node }) };
688
+ return { node, refMap: { ...refMap, [$ref]: node } };
687
689
  }
688
690
  throw new TypeError(`The refNode is not a JsonSchema`);
689
691
  };
@@ -808,12 +810,19 @@ var negationSchemaStructure = { not: isJsonSchema };
808
810
  function isNegationSchema(input) {
809
811
  return doesExtend(negationSchemaStructure)(input);
810
812
  }
811
- var mixedSchemaStructure = __spreadProps(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, arraySchemaStructure), booleanSchemaStructure), integerSchemaStructure), nullSchemaStructure), numberSchemaStructure), objectSchemaStructure), stringSchemaStructure), {
813
+ var mixedSchemaStructure = {
814
+ ...arraySchemaStructure,
815
+ ...booleanSchemaStructure,
816
+ ...integerSchemaStructure,
817
+ ...nullSchemaStructure,
818
+ ...numberSchemaStructure,
819
+ ...objectSchemaStructure,
820
+ ...stringSchemaStructure,
812
821
  type: isArray(isWithin(JSON_SCHEMA_TYPE_NAMES)),
813
822
  enum: ifDefined(
814
823
  isArray(isUnion.or(isInteger).or(isBoolean).or(isNumber).or(isString))
815
824
  )
816
- });
825
+ };
817
826
  function isMixedSchema(input) {
818
827
  return doesExtend(mixedSchemaStructure)(input);
819
828
  }
@@ -899,10 +908,7 @@ var stringToObject = (str) => {
899
908
  };
900
909
  var objectToString = (obj) => JSON.stringify(obj);
901
910
  var objectToBoolean = (obj) => obj.true === true;
902
- var objectToNumber = (obj) => {
903
- var _a2, _b2, _c;
904
- return Number((_c = (_b2 = (_a2 = obj.number) != null ? _a2 : obj.size) != null ? _b2 : obj.count) != null ? _c : 0);
905
- };
911
+ var objectToNumber = (obj) => Number(obj.number ?? obj.size ?? obj.count ?? 0);
906
912
  var objectToArray = (obj) => Object.entries(obj);
907
913
  var booleanToString = (bool) => bool.toString();
908
914
  var booleanToNumber = (bool) => +bool;
@@ -1026,7 +1032,7 @@ var castToJson = (input) => {
1026
1032
  var makePropertySetters = (data, set) => mapObject(
1027
1033
  data,
1028
1034
  (value, key) => (newValue) => {
1029
- set(__spreadProps(__spreadValues({}, data), { [key]: become(newValue)(value[key]) }));
1035
+ set({ ...data, [key]: become(newValue)(value[key]) });
1030
1036
  }
1031
1037
  );
1032
1038
  var makePropertyRenamers = (data, set, stableKeyMapRef) => mapObject(
@@ -1038,9 +1044,10 @@ var makePropertyRenamers = (data, set, stableKeyMapRef) => mapObject(
1038
1044
  const index = entries.findIndex(([k]) => k === key);
1039
1045
  entries[index] = [newKey, value];
1040
1046
  const stableKeyMap = stableKeyMapRef.current;
1041
- stableKeyMapRef.current = __spreadProps(__spreadValues({}, stableKeyMap), {
1047
+ stableKeyMapRef.current = {
1048
+ ...stableKeyMap,
1042
1049
  [newKey]: stableKeyMap[key]
1043
- });
1050
+ };
1044
1051
  return Object.fromEntries(entries);
1045
1052
  });
1046
1053
  }
@@ -1048,20 +1055,21 @@ var makePropertyRenamers = (data, set, stableKeyMapRef) => mapObject(
1048
1055
  );
1049
1056
  var makePropertyRemovers = (data, set) => mapObject(data, (_, key) => () => {
1050
1057
  set(() => {
1051
- const _a2 = data, rest = __objRest(_a2, [__restKey(key)]);
1058
+ const { [key]: __, ...rest } = data;
1052
1059
  return rest;
1053
1060
  });
1054
1061
  });
1055
1062
  var makePropertyRecasters = (data, set) => mapObject(
1056
1063
  data,
1057
1064
  (value, key) => (newType) => {
1058
- set(() => __spreadProps(__spreadValues({}, data), {
1065
+ set(() => ({
1066
+ ...data,
1059
1067
  [key]: castToJson(value).to[newType]()
1060
1068
  }));
1061
1069
  }
1062
1070
  );
1063
1071
  var makePropertyCreationInterface = (data, set) => (key, type) => (value) => {
1064
- set(__spreadProps(__spreadValues({}, data), { [key]: value != null ? value : JSON_DEFAULTS[type] }));
1072
+ set({ ...data, [key]: value ?? JSON_DEFAULTS[type] });
1065
1073
  };
1066
1074
  var makePropertySorter = (data, set, sortFn) => () => {
1067
1075
  const sortedKeys = Object.keys(data).sort(sortFn);
@@ -1100,7 +1108,6 @@ var ObjectEditor = ({
1100
1108
  set,
1101
1109
  Components
1102
1110
  }) => {
1103
- var _a2;
1104
1111
  const disabled = isReadonly(path);
1105
1112
  const stableKeyMap = useRef(
1106
1113
  Object.keys(data).reduce(
@@ -1118,7 +1125,7 @@ var ObjectEditor = ({
1118
1125
  const sortProperties = makePropertySorter(data, set);
1119
1126
  const makePropertyAdder = makePropertyCreationInterface(data, set);
1120
1127
  const subSchema = isPlainObject(schema) ? findSubSchema(schema)(path) : true;
1121
- const schemaKeys = isLiteral(true)(subSchema) ? true : isObjectSchema(subSchema) ? Object.keys((_a2 = subSchema.properties) != null ? _a2 : {}) : [];
1128
+ const schemaKeys = isLiteral(true)(subSchema) ? true : isObjectSchema(subSchema) ? Object.keys(subSchema.properties ?? {}) : [];
1122
1129
  const dataKeys = Object.keys(data);
1123
1130
  const [unofficialKeys, officialKeys] = dataKeys.reduce(
1124
1131
  ([unofficial, official], key) => {
@@ -1240,9 +1247,8 @@ var StringEditor = ({
1240
1247
  ) });
1241
1248
  };
1242
1249
  var DefaultFallback = ({ error, errorInfo }) => {
1243
- var _a2, _b2, _c;
1244
- const component = (_a2 = errorInfo == null ? void 0 : errorInfo.componentStack) == null ? void 0 : _a2.split(` `).filter(Boolean)[2];
1245
- const message = (_c = (_b2 = error == null ? void 0 : error.toString()) != null ? _b2 : errorInfo == null ? void 0 : errorInfo.componentStack) != null ? _c : `Unknown error`;
1250
+ const component = errorInfo?.componentStack?.split(` `).filter(Boolean)[2];
1251
+ const message = error?.toString() ?? errorInfo?.componentStack ?? `Unknown error`;
1246
1252
  return /* @__PURE__ */ jsx(
1247
1253
  "div",
1248
1254
  {
@@ -1292,8 +1298,7 @@ var ErrorBoundary = class extends Component {
1292
1298
  this.state = {};
1293
1299
  }
1294
1300
  componentDidCatch(error, errorInfo) {
1295
- var _a2, _b2;
1296
- (_b2 = (_a2 = this.props).onError) == null ? void 0 : _b2.call(_a2, error, errorInfo);
1301
+ this.props.onError?.(error, errorInfo);
1297
1302
  this.setState({
1298
1303
  error,
1299
1304
  errorInfo
@@ -1363,7 +1368,10 @@ var JsonEditor = ({
1363
1368
  style,
1364
1369
  Components: CustomComponents = {}
1365
1370
  }) => {
1366
- const Components = __spreadValues(__spreadValues({}, DEFAULT_JSON_EDITOR_COMPONENTS), CustomComponents);
1371
+ const Components = {
1372
+ ...DEFAULT_JSON_EDITOR_COMPONENTS,
1373
+ ...CustomComponents
1374
+ };
1367
1375
  return /* @__PURE__ */ jsx(
1368
1376
  JsonEditor_INTERNAL,
1369
1377
  {
@@ -1443,7 +1451,6 @@ var findStateTypeState = selectorFamily({
1443
1451
  }
1444
1452
  });
1445
1453
  var StateIndexLeafNode = ({ node, isOpenState, typeState }) => {
1446
- var _a2, _b2;
1447
1454
  const setIsOpen = useI(isOpenState);
1448
1455
  const isOpen = useO(isOpenState);
1449
1456
  const state = useO(node);
@@ -1470,7 +1477,7 @@ var StateIndexLeafNode = ({ node, isOpenState, typeState }) => {
1470
1477
  console.log(node, getState(node));
1471
1478
  },
1472
1479
  children: [
1473
- /* @__PURE__ */ jsx("h2", { children: (_b2 = (_a2 = node.family) == null ? void 0 : _a2.subKey) != null ? _b2 : node.key }),
1480
+ /* @__PURE__ */ jsx("h2", { children: node.family?.subKey ?? node.key }),
1474
1481
  /* @__PURE__ */ jsxs("span", { className: "type detail", children: [
1475
1482
  "(",
1476
1483
  stateType,
@@ -2,14 +2,11 @@
2
2
  "name": "atom.io-react-devtools",
3
3
  "type": "module",
4
4
  "private": true,
5
- "main": "dist/index.cjs",
6
- "module": "dist/index.js",
5
+ "main": "dist/index.js",
7
6
  "types": "dist/index.d.ts",
8
7
  "exports": {
9
8
  ".": {
10
9
  "import": "./dist/index.js",
11
- "browser": "./dist/index.js",
12
- "require": "./dist/index.cjs",
13
10
  "types": "./dist/index.d.ts"
14
11
  }
15
12
  }
@@ -1,5 +1,5 @@
1
- import '../../dist/chunk-S4N6XNPH.js';
2
- import { assignTransactionToContinuity, IMPLICIT, setEpochNumberOfContinuity, getUpdateToken } from 'atom.io/internal';
1
+ import '../../dist/chunk-XWL6SNVU.js';
2
+ import { getUpdateToken, assignTransactionToContinuity, IMPLICIT, setEpochNumberOfContinuity } from 'atom.io/internal';
3
3
  import { atom, selectorFamily } from 'atom.io';
4
4
  import { join, getInternalRelations } from 'atom.io/data';
5
5
  import { SetRTX } from 'atom.io/transceivers/set-rtx';
@@ -19,14 +19,15 @@ var InvariantMap = class extends Map {
19
19
  throw new Error(`Cannot clear an InvariantMap`);
20
20
  }
21
21
  };
22
- var _SyncGroup = class _SyncGroup {
22
+ var SyncGroup = class _SyncGroup {
23
23
  constructor(key) {
24
24
  this.key = key;
25
- this.type = `continuity`;
26
- this.globals = [];
27
- this.actions = [];
28
- this.perspectives = [];
29
25
  }
26
+ type = `continuity`;
27
+ globals = [];
28
+ actions = [];
29
+ perspectives = [];
30
+ static existing = new InvariantMap();
30
31
  static create(key, builder) {
31
32
  const group = new _SyncGroup(key);
32
33
  const { type, globals, actions, perspectives } = builder(group);
@@ -62,8 +63,6 @@ var _SyncGroup = class _SyncGroup {
62
63
  return this;
63
64
  }
64
65
  };
65
- _SyncGroup.existing = new InvariantMap();
66
- var SyncGroup = _SyncGroup;
67
66
  function continuity(options) {
68
67
  const { key, config } = options;
69
68
  const token = SyncGroup.create(key, config);
@@ -2,14 +2,11 @@
2
2
  "name": "atom.io-realtime",
3
3
  "type": "module",
4
4
  "private": true,
5
- "main": "dist/index.cjs",
6
- "module": "dist/index.js",
5
+ "main": "dist/index.js",
7
6
  "types": "dist/index.d.ts",
8
7
  "exports": {
9
8
  ".": {
10
9
  "import": "./dist/index.js",
11
- "browser": "./dist/index.js",
12
- "require": "./dist/index.cjs",
13
10
  "types": "./dist/index.d.ts"
14
11
  }
15
12
  }
@@ -1,5 +1,5 @@
1
1
  import { lazyLocalStorageEffect } from '../../dist/chunk-H6EDLPKH.js';
2
- import '../../dist/chunk-S4N6XNPH.js';
2
+ import '../../dist/chunk-XWL6SNVU.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';
@@ -25,13 +25,13 @@ function pullAtomFamilyMember(token, socket, store) {
25
25
  }
26
26
  const { key: familyKey, subKey: serializedSubKey } = token.family;
27
27
  const subKey = parseJson(serializedSubKey);
28
- socket == null ? void 0 : socket.on(`serve:${token.key}`, (data) => {
28
+ socket?.on(`serve:${token.key}`, (data) => {
29
29
  setIntoStore(token, data, store);
30
30
  });
31
- socket == null ? void 0 : socket.emit(`sub:${familyKey}`, subKey);
31
+ socket?.emit(`sub:${familyKey}`, subKey);
32
32
  return () => {
33
- socket == null ? void 0 : socket.off(`serve:${token.key}`);
34
- socket == null ? void 0 : socket.emit(`unsub:${token.key}`);
33
+ socket?.off(`serve:${token.key}`);
34
+ socket?.emit(`unsub:${token.key}`);
35
35
  };
36
36
  }
37
37
  function pullMutableAtom(token, socket, store) {
@@ -332,7 +332,7 @@ function syncContinuity(continuity, socket, store) {
332
332
  reconcileEpoch(zerothOptimisticUpdate, confirmed);
333
333
  for (const nextConfirmed of confirmedUpdates) {
334
334
  const nextOptimistic = optimisticUpdates[0];
335
- if (nextConfirmed.epoch === (nextOptimistic == null ? void 0 : nextOptimistic.epoch)) {
335
+ if (nextConfirmed.epoch === nextOptimistic?.epoch) {
336
336
  reconcileEpoch(nextOptimistic, nextConfirmed);
337
337
  } else {
338
338
  break;
@@ -2,14 +2,11 @@
2
2
  "name": "atom.io-realtime-client",
3
3
  "type": "module",
4
4
  "private": true,
5
- "main": "dist/index.cjs",
6
- "module": "dist/index.js",
5
+ "main": "dist/index.js",
7
6
  "types": "dist/index.d.ts",
8
7
  "exports": {
9
8
  ".": {
10
9
  "import": "./dist/index.js",
11
- "browser": "./dist/index.js",
12
- "require": "./dist/index.cjs",
13
10
  "types": "./dist/index.d.ts"
14
11
  }
15
12
  }
@@ -1,4 +1,4 @@
1
- import '../../dist/chunk-S4N6XNPH.js';
1
+ import '../../dist/chunk-XWL6SNVU.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';
@@ -14,11 +14,11 @@ var RealtimeProvider = ({ children, socket }) => {
14
14
  const services = React.useRef(/* @__PURE__ */ new Map()).current;
15
15
  const setMyId = useI(RTC.myIdState__INTERNAL);
16
16
  React.useEffect(() => {
17
- setMyId(socket == null ? void 0 : socket.id);
18
- socket == null ? void 0 : socket.on(`connect`, () => {
17
+ setMyId(socket?.id);
18
+ socket?.on(`connect`, () => {
19
19
  setMyId(socket.id);
20
20
  });
21
- socket == null ? void 0 : socket.on(`disconnect`, () => {
21
+ socket?.on(`disconnect`, () => {
22
22
  setMyId(void 0);
23
23
  });
24
24
  }, [socket, setMyId]);
@@ -32,10 +32,9 @@ function useSingleEffect(effect, deps) {
32
32
  if (IN_DEV) {
33
33
  const cleanup = React.useRef(noop);
34
34
  React.useEffect(() => {
35
- var _a;
36
35
  let dispose = cleanup.current;
37
36
  if (dispose === noop) {
38
- dispose = (_a = effect()) != null ? _a : noop;
37
+ dispose = effect() ?? noop;
39
38
  cleanup.current = dispose;
40
39
  } else {
41
40
  return () => {
@@ -58,21 +57,20 @@ function onMount(effect) {
58
57
  function useRealtimeService(key, create) {
59
58
  const { socket, services } = React.useContext(RealtimeContext);
60
59
  onMount(() => {
61
- let service = services == null ? void 0 : services.get(key);
60
+ let service = services?.get(key);
62
61
  if (service) {
63
62
  service[0]++;
64
63
  } else {
65
64
  const dispose = socket ? create(socket) : void 0;
66
65
  service = [1, dispose];
67
- services == null ? void 0 : services.set(key, service);
66
+ services?.set(key, service);
68
67
  }
69
68
  return () => {
70
- var _a;
71
69
  if (service) {
72
70
  service[0]--;
73
71
  if (service[0] === 0) {
74
- (_a = service[1]) == null ? void 0 : _a.call(service);
75
- services == null ? void 0 : services.delete(key);
72
+ service[1]?.();
73
+ services?.delete(key);
76
74
  }
77
75
  }
78
76
  };
@@ -2,14 +2,11 @@
2
2
  "name": "atom.io-realtime-react",
3
3
  "type": "module",
4
4
  "private": true,
5
- "main": "dist/index.cjs",
6
- "module": "dist/index.js",
5
+ "main": "dist/index.js",
7
6
  "types": "dist/index.d.ts",
8
7
  "exports": {
9
8
  ".": {
10
9
  "import": "./dist/index.js",
11
- "browser": "./dist/index.js",
12
- "require": "./dist/index.cjs",
13
10
  "types": "./dist/index.d.ts"
14
11
  }
15
12
  }