@atom.io/spa-devtools 0.0.1 → 0.0.2

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.
package/README.md CHANGED
@@ -43,7 +43,7 @@ Sizes are exact minified and level-9 gzip JavaScript byte counts. Declarations,
43
43
 
44
44
  | Recipe | Entry | Minified JS | Gzip JS |
45
45
  | ----------------------------- | ----------------------------- | ----------: | -------: |
46
- | Interactive app with debugger | `tonnage-recipes/debugger.ts` | 85,500 B | 24,749 B |
46
+ | Interactive app with debugger | `tonnage-recipes/debugger.ts` | 86,548 B | 25,110 B |
47
47
 
48
48
  Report maintained with [tonnage](https://github.com/jeremybanka/tonnage).
49
49
 
package/dist/index.js CHANGED
@@ -175,12 +175,12 @@ function JsonEditor(props) {
175
175
  get "value"() {
176
176
  return kind(props.value);
177
177
  },
178
- "onChange": (event) => {
178
+ "onChange": ((event) => {
179
179
  const type = event.currentTarget.value;
180
180
  props.tools.attempt(() => {
181
181
  props.change?.((previous) => convert(previous, type));
182
182
  });
183
- },
183
+ }),
184
184
  children: [jsx("option", {
185
185
  "value": "other",
186
186
  "disabled": true,
@@ -224,7 +224,7 @@ function JsonEditor(props) {
224
224
  }
225
225
  })), () => props.change ? jsx("footer", { children: [jsx("button", {
226
226
  "type": "button",
227
- "onClick": () => {
227
+ "onClick": (() => {
228
228
  props.tools.attempt(() => {
229
229
  props.change?.((previous) => {
230
230
  if (Array.isArray(previous)) return [...previous, null];
@@ -237,15 +237,15 @@ function JsonEditor(props) {
237
237
  };
238
238
  });
239
239
  });
240
- },
240
+ }),
241
241
  children: ["add ", () => Array.isArray(props.value) ? `item` : `property`]
242
242
  }), () => Array.isArray(props.value) ? jsx("button", {
243
243
  "type": "button",
244
- "onClick": () => {
244
+ "onClick": (() => {
245
245
  props.tools.attempt(() => {
246
246
  props.change?.((previous) => [...previous].sort((a, b) => typeof a === `number` && typeof b === `number` ? a - b : describe(a).localeCompare(describe(b))));
247
247
  });
248
- },
248
+ }),
249
249
  children: "sort"
250
250
  }) : null] }) : null]
251
251
  }) : null]
@@ -270,9 +270,9 @@ function Primitive(props) {
270
270
  get "disabled"() {
271
271
  return !props.change;
272
272
  },
273
- "onChange": (event) => {
273
+ "onChange": ((event) => {
274
274
  set(event.currentTarget.checked);
275
- }
275
+ })
276
276
  }) : kind(props.value) === `string` || kind(props.value) === `number` ? jsx("input", {
277
277
  get "aria-label"() {
278
278
  return props.label;
@@ -287,14 +287,14 @@ function Primitive(props) {
287
287
  get "readOnly"() {
288
288
  return !props.change;
289
289
  },
290
- "onInput": (event) => {
290
+ "onInput": ((event) => {
291
291
  const text = event.currentTarget.value;
292
292
  if (kind(props.value) === `string`) set(text);
293
293
  else if (text.trim() && Number.isFinite(Number(text))) set(Number(text));
294
- },
295
- "onBlur": (event) => {
294
+ }),
295
+ "onBlur": ((event) => {
296
296
  event.currentTarget.value = String(props.value);
297
- }
297
+ })
298
298
  }) : jsx("code", { children: () => describe(props.value) })
299
299
  });
300
300
  }
@@ -325,7 +325,7 @@ function Property(props) {
325
325
  get "value"() {
326
326
  return props.name;
327
327
  },
328
- "onChange": (event) => {
328
+ "onChange": ((event) => {
329
329
  const input = event.currentTarget;
330
330
  const name = input.value;
331
331
  parent.tools.attempt(() => {
@@ -336,7 +336,7 @@ function Property(props) {
336
336
  });
337
337
  });
338
338
  input.value = props.name;
339
- }
339
+ })
340
340
  }) : jsx("strong", { children: () => props.name });
341
341
  },
342
342
  get "actions"() {
@@ -345,11 +345,11 @@ function Property(props) {
345
345
  get "aria-label"() {
346
346
  return `Delete ${props.name}`;
347
347
  },
348
- "onClick": () => {
348
+ "onClick": (() => {
349
349
  parent.tools.attempt(() => {
350
350
  parent.change?.((previous) => Array.isArray(previous) ? previous.filter((_, index) => index !== Number(props.name)) : Object.fromEntries(Object.entries(previous).filter(([key]) => key !== props.name)));
351
351
  });
352
- },
352
+ }),
353
353
  children: "×"
354
354
  }) : null;
355
355
  },
@@ -461,11 +461,11 @@ function StateLeaf(props) {
461
461
  get "aria-label"() {
462
462
  return `Dispose ${props.token.key}`;
463
463
  },
464
- "onClick": () => {
464
+ "onClick": (() => {
465
465
  props.tools.attempt(() => {
466
466
  disposeFromStore(props.tools.store, props.token);
467
467
  });
468
- },
468
+ }),
469
469
  children: "×"
470
470
  }) : null;
471
471
  },
@@ -665,9 +665,9 @@ function TimelineLog(props) {
665
665
  get "disabled"() {
666
666
  return controls().at === 0;
667
667
  },
668
- "onClick": () => {
668
+ "onClick": (() => {
669
669
  props.tools.attempt(controls().undo);
670
- },
670
+ }),
671
671
  children: "undo"
672
672
  }),
673
673
  jsx("button", {
@@ -675,9 +675,9 @@ function TimelineLog(props) {
675
675
  get "disabled"() {
676
676
  return controls().at === controls().length;
677
677
  },
678
- "onClick": () => {
678
+ "onClick": (() => {
679
679
  props.tools.attempt(controls().redo);
680
- },
680
+ }),
681
681
  children: "redo"
682
682
  })
683
683
  ] }), () => open() ? jsx("section", { children: [() => log().history.map((event, index) => jsx("section", {
@@ -798,7 +798,7 @@ function Panel(props) {
798
798
  "class": "drag-handle",
799
799
  "aria-label": "Move debugger",
800
800
  "title": "Drag to move; arrow keys to nudge",
801
- "onPointerdown": (event) => {
801
+ "onPointerdown": ((event) => {
802
802
  if (event.button !== 0) return;
803
803
  drag = {
804
804
  id: event.pointerId,
@@ -807,8 +807,8 @@ function Panel(props) {
807
807
  ...position()
808
808
  };
809
809
  event.currentTarget.setPointerCapture(event.pointerId);
810
- },
811
- "onPointermove": (event) => {
810
+ }),
811
+ "onPointermove": ((event) => {
812
812
  if (!drag || drag.id !== event.pointerId || !panel) return;
813
813
  const rect = panel.getBoundingClientRect();
814
814
  const next = {
@@ -818,14 +818,14 @@ function Panel(props) {
818
818
  next.x = Math.max(position().x - rect.left, Math.min(next.x, position().x + window.innerWidth - rect.right));
819
819
  next.y = Math.max(position().y - rect.top, Math.min(next.y, position().y + window.innerHeight - rect.bottom));
820
820
  setPosition(next);
821
- },
822
- "onPointerup": () => {
821
+ }),
822
+ "onPointerup": (() => {
823
823
  drag = void 0;
824
- },
825
- "onPointercancel": () => {
824
+ }),
825
+ "onPointercancel": (() => {
826
826
  drag = void 0;
827
- },
828
- "onKeydown": (event) => {
827
+ }),
828
+ "onKeydown": ((event) => {
829
829
  const step = {
830
830
  ArrowLeft: [-10, 0],
831
831
  ArrowRight: [10, 0],
@@ -839,7 +839,7 @@ function Panel(props) {
839
839
  y: y + step[1]
840
840
  }));
841
841
  }
842
- },
842
+ }),
843
843
  children: "⠿"
844
844
  }),
845
845
  jsx("h1", { children: "atom.io" }),
@@ -853,9 +853,9 @@ function Panel(props) {
853
853
  get "data-testid"() {
854
854
  return `view-${name}`;
855
855
  },
856
- "onClick": () => {
856
+ "onClick": (() => {
857
857
  setSelection(name);
858
- },
858
+ }),
859
859
  children: () => name
860
860
  }))
861
861
  }) : null,
@@ -865,17 +865,17 @@ function Panel(props) {
865
865
  return open() ? `Minimize debugger` : `Open debugger`;
866
866
  },
867
867
  "data-testid": "open-close-devtools",
868
- "onClick": () => {
868
+ "onClick": (() => {
869
869
  setOpen((value) => !value);
870
- },
870
+ }),
871
871
  children: () => open() ? `−` : `🔍`
872
872
  }),
873
873
  jsx("button", {
874
874
  "type": "button",
875
875
  "aria-label": "Hide debugger (Ctrl+Shift+A)",
876
- "onClick": () => {
876
+ "onClick": (() => {
877
877
  setHidden(true);
878
- },
878
+ }),
879
879
  children: "×"
880
880
  })
881
881
  ]
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_spa","_spa","_spa"],"sources":["../src/store.ts","../src/value.ts","../src/JsonEditor.tsx","../src/Indexes.tsx","../src/AtomIODevtools.tsx"],"sourcesContent":["import type { Accessor } from \"@atom.io/spa\"\nimport { onCleanup, useId, useSetter, useValue } from \"@atom.io/spa\"\nimport type { RegularAtomFamilyToken, RegularAtomToken, Setter } from \"atom.io\"\nimport type { RootStore } from \"atom.io/internal\"\nimport {\n\tcreateRegularAtomFamily,\n\tdisposeFromStore,\n\tfindInStore,\n\tsetIntoStore,\n} from \"atom.io/internal\"\nimport type { IntrospectionStates } from \"atom.io/introspection\"\nimport { attachIntrospectionStates } from \"atom.io/introspection\"\n\nconst locals = new WeakMap<RootStore, RegularAtomFamilyToken<unknown, string>>()\nconst introspection = new WeakMap<RootStore, IntrospectionStates>()\nexport type Path = readonly string[]\nexport interface Tools extends IntrospectionStates {\n\tstore: RootStore\n\texpanded: RegularAtomToken<Record<string, boolean>>\n\terror: RegularAtomToken<string>\n\tattempt(run: () => void): void\n}\n\nexport function ownedAtom<T>(store: RootStore, initial: T): RegularAtomToken<T> {\n\tlet family = locals.get(store)\n\tif (!family) {\n\t\tfamily = createRegularAtomFamily<unknown, string, never>(store, {\n\t\t\tkey: `🔍 spa devtools`,\n\t\t\tdefault: undefined,\n\t\t})\n\t\tlocals.set(store, family)\n\t}\n\tconst token = findInStore(store, family, useId()) as RegularAtomToken<T>\n\tsetIntoStore(store, token, initial)\n\tonCleanup(() => {\n\t\tdisposeFromStore(store, token)\n\t})\n\treturn token\n}\nexport function useLocal<T>(\n\tstore: RootStore,\n\tinitial: T,\n): [Accessor<T>, (next: T | Setter<T>) => void] {\n\tconst token = ownedAtom(store, initial)\n\treturn [useValue(token) as Accessor<T>, useSetter(token)]\n}\nexport function useSaved<T>(\n\tstore: RootStore,\n\tkey: string,\n\tfallback: T,\n): [Accessor<T>, (next: T | Setter<T>) => void] {\n\tlet initial = fallback\n\ttry {\n\t\tconst saved: unknown = JSON.parse(localStorage.getItem(key) ?? `null`)\n\t\tif (saved !== null && typeof saved === typeof fallback) initial = saved as T\n\t} catch {\n\t\t/* Storage may be unavailable. */\n\t}\n\tconst [value, set] = useLocal(store, initial)\n\treturn [\n\t\tvalue,\n\t\t(next) => {\n\t\t\tset(next)\n\t\t\ttry {\n\t\t\t\tlocalStorage.setItem(key, JSON.stringify(value()))\n\t\t\t} catch {\n\t\t\t\t/* Keep in-memory state when storage is unavailable. */\n\t\t\t}\n\t\t},\n\t]\n}\nexport function useTools(store: RootStore): Tools {\n\tlet states = introspection.get(store)\n\tif (!states) {\n\t\tstates = attachIntrospectionStates(store)\n\t\tintrospection.set(store, states)\n\t}\n\tlet expanded: Record<string, boolean> = {}\n\ttry {\n\t\tconst saved: unknown = JSON.parse(\n\t\t\tlocalStorage.getItem(`🔍 spa expanded`) ?? `{}`,\n\t\t)\n\t\tif (\n\t\t\tsaved &&\n\t\t\ttypeof saved === `object` &&\n\t\t\t!Array.isArray(saved) &&\n\t\t\tObject.values(saved).every((value) => typeof value === `boolean`)\n\t\t)\n\t\t\texpanded = saved as Record<string, boolean>\n\t} catch {\n\t\t/* Ignore corrupt or unavailable storage. */\n\t}\n\tconst error = ownedAtom(store, ``)\n\tconst setError = useSetter(error)\n\treturn {\n\t\t...states,\n\t\tstore,\n\t\terror,\n\t\texpanded: ownedAtom(store, expanded),\n\t\tattempt(run) {\n\t\t\ttry {\n\t\t\t\trun()\n\t\t\t\tsetError(``)\n\t\t\t} catch (caught) {\n\t\t\t\tsetError(caught instanceof Error ? caught.message : String(caught))\n\t\t\t}\n\t\t},\n\t}\n}\nexport function useExpanded(\n\ttools: Tools,\n\tpath: Path,\n\tinitial = false,\n): [Accessor<boolean>, (event: MouseEvent) => void] {\n\tconst value = useValue(tools.expanded)\n\tconst set = useSetter(tools.expanded)\n\tconst key = JSON.stringify(path)\n\tconst group = `all:${JSON.stringify(path.slice(0, -1))}`\n\tconst read = () => value()[key] ?? value()[group] ?? initial\n\treturn [\n\t\tread,\n\t\t(event) => {\n\t\t\tconst next = !read()\n\t\t\tset((previous) => {\n\t\t\t\tconst result = { ...previous }\n\t\t\t\tif (event.shiftKey) {\n\t\t\t\t\tconst parent = JSON.stringify(path.slice(0, -1))\n\t\t\t\t\tfor (const item of Object.keys(result)) {\n\t\t\t\t\t\tif (item.startsWith(`[`)) {\n\t\t\t\t\t\t\tconst candidate = JSON.parse(item) as string[]\n\t\t\t\t\t\t\tif (JSON.stringify(candidate.slice(0, -1)) === parent)\n\t\t\t\t\t\t\t\tReflect.deleteProperty(result, item)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tresult[group] = next\n\t\t\t\t} else {\n\t\t\t\t\tresult[key] = next\n\t\t\t\t}\n\t\t\t\ttry {\n\t\t\t\t\tlocalStorage.setItem(`🔍 spa expanded`, JSON.stringify(result))\n\t\t\t\t} catch {\n\t\t\t\t\t/* Keep in-memory expansion state. */\n\t\t\t\t}\n\t\t\t\treturn result\n\t\t\t})\n\t\t},\n\t]\n}\n","export type Change = (update: (previous: unknown) => unknown) => void\nexport type JsonKind =\n\t| `string`\n\t| `number`\n\t| `boolean`\n\t| `null`\n\t| `array`\n\t| `object`\nexport function kind(value: unknown): JsonKind | `other` {\n\tif (value === null) return `null`\n\tif (Array.isArray(value)) return `array`\n\tif (\n\t\ttypeof value === `object` &&\n\t\t(Object.getPrototypeOf(value) === Object.prototype ||\n\t\t\tObject.getPrototypeOf(value) === null)\n\t)\n\t\treturn `object`\n\tif (\n\t\ttypeof value === `string` ||\n\t\ttypeof value === `number` ||\n\t\ttypeof value === `boolean`\n\t)\n\t\treturn typeof value as JsonKind\n\treturn `other`\n}\nexport function describe(value: unknown): string {\n\ttry {\n\t\tconst seen = new WeakSet<object>()\n\t\treturn (\n\t\t\tJSON.stringify(value, (_, item: unknown) => {\n\t\t\t\tif (typeof item === `bigint`) return `${item}n`\n\t\t\t\tif (item instanceof Error) return `${item.name}: ${item.message}`\n\t\t\t\tif (item instanceof Map) return { Map: [...item] }\n\t\t\t\tif (item instanceof Set) return { Set: [...item] }\n\t\t\t\tif (typeof item === `object` && item !== null) {\n\t\t\t\t\tif (seen.has(item)) return `[Circular]`\n\t\t\t\t\tseen.add(item)\n\t\t\t\t}\n\t\t\t\treturn item\n\t\t\t}) ?? String(value)\n\t\t)\n\t} catch {\n\t\treturn Object.prototype.toString.call(value)\n\t}\n}\nexport function convert(value: unknown, type: JsonKind): unknown {\n\tswitch (type) {\n\t\tcase `null`:\n\t\t\treturn null\n\t\tcase `string`:\n\t\t\treturn value == null\n\t\t\t\t? ``\n\t\t\t\t: typeof value === `string`\n\t\t\t\t\t? value\n\t\t\t\t\t: describe(value)\n\t\tcase `number`: {\n\t\t\tconst next = Array.isArray(value) ? value.length : Number(value)\n\t\t\treturn Number.isFinite(next) ? next : 0\n\t\t}\n\t\tcase `boolean`:\n\t\t\treturn typeof value === `string` ? value === `true` : Boolean(value)\n\t\tcase `array`:\n\t\t\treturn Array.isArray(value)\n\t\t\t\t? value\n\t\t\t\t: value == null\n\t\t\t\t\t? []\n\t\t\t\t\t: typeof value === `object`\n\t\t\t\t\t\t? Object.entries(value)\n\t\t\t\t\t\t: [value]\n\t\tcase `object`:\n\t\t\treturn kind(value) === `object`\n\t\t\t\t? value\n\t\t\t\t: Array.isArray(value)\n\t\t\t\t\t? Object.fromEntries(value.map((item, index) => [index, item]))\n\t\t\t\t\t: value == null\n\t\t\t\t\t\t? {}\n\t\t\t\t\t\t: { value }\n\t}\n}\n","import type { Child, VNode } from \"@atom.io/spa\"\n\nimport type { Path, Tools } from \"./store.ts\"\nimport { useExpanded } from \"./store.ts\"\nimport type { Change, JsonKind } from \"./value.ts\"\nimport { convert, describe, kind } from \"./value.ts\"\n\ninterface EditorProps {\n\ttools: Tools\n\tvalue: unknown\n\tchange?: Change | undefined\n\tpath: Path\n\tancestors?: readonly unknown[]\n\tlabel?: Child\n\tactions?: Child\n}\nconst TYPES: JsonKind[] = [\n\t`string`,\n\t`number`,\n\t`boolean`,\n\t`null`,\n\t`array`,\n\t`object`,\n]\nexport function JsonEditor(props: EditorProps): VNode {\n\tconst [expanded, toggle] = useExpanded(props.tools, props.path)\n\tconst circular = () =>\n\t\t(props.ancestors?.includes(props.value) ?? false) || props.path.length > 50\n\tconst container = () =>\n\t\t!circular() &&\n\t\t(kind(props.value) === `object` || kind(props.value) === `array`)\n\tconst entries = () => Object.entries(props.value as Record<string, unknown>)\n\treturn (\n\t\t<section\n\t\t\tclass=\"json-editor\"\n\t\t\tdata-testid={`${props.path.join(`.`)}-state-editor`}\n\t\t>\n\t\t\t<header>\n\t\t\t\t{container() ? (\n\t\t\t\t\t<button\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\taria-label={`Expand ${props.path.at(-1)}`}\n\t\t\t\t\t\taria-expanded={expanded()}\n\t\t\t\t\t\tonClick={toggle}\n\t\t\t\t\t>\n\t\t\t\t\t\t{expanded() ? `▾` : `▸`}\n\t\t\t\t\t</button>\n\t\t\t\t) : (\n\t\t\t\t\t<span class=\"carat-spacer\" />\n\t\t\t\t)}\n\t\t\t\t<span class=\"field-name\">{props.label}</span>\n\t\t\t\t{props.change ? (\n\t\t\t\t\t<select\n\t\t\t\t\t\taria-label={`Type of ${props.path.at(-1)}`}\n\t\t\t\t\t\tvalue={kind(props.value)}\n\t\t\t\t\t\tonChange={(event) => {\n\t\t\t\t\t\t\tconst type = event.currentTarget.value as JsonKind\n\t\t\t\t\t\t\tprops.tools.attempt(() => {\n\t\t\t\t\t\t\t\tprops.change?.((previous) => convert(previous, type))\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t<option value=\"other\" disabled>\n\t\t\t\t\t\t\tother\n\t\t\t\t\t\t</option>\n\t\t\t\t\t\t{TYPES.map((type) => (\n\t\t\t\t\t\t\t<option value={type}>{type}</option>\n\t\t\t\t\t\t))}\n\t\t\t\t\t</select>\n\t\t\t\t) : (\n\t\t\t\t\t<small>{kind(props.value)}</small>\n\t\t\t\t)}\n\t\t\t\t{container() ? (\n\t\t\t\t\t<code title={describe(props.value)}>{describe(props.value)}</code>\n\t\t\t\t) : circular() ? (\n\t\t\t\t\t<code>[Circular]</code>\n\t\t\t\t) : (\n\t\t\t\t\t<Primitive\n\t\t\t\t\t\tvalue={props.value}\n\t\t\t\t\t\tchange={props.change}\n\t\t\t\t\t\ttools={props.tools}\n\t\t\t\t\t\tlabel={props.path.at(-1) ?? `value`}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t\t{props.actions}\n\t\t\t</header>\n\t\t\t{container() && expanded() ? (\n\t\t\t\t<section class=\"properties\">\n\t\t\t\t\t{entries().map(([key]) => (\n\t\t\t\t\t\t<Property key={key} name={key} editor={props} />\n\t\t\t\t\t))}\n\t\t\t\t\t{props.change ? (\n\t\t\t\t\t\t<footer>\n\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\t\t\tprops.tools.attempt(() => {\n\t\t\t\t\t\t\t\t\t\tprops.change?.((previous) => {\n\t\t\t\t\t\t\t\t\t\t\tif (Array.isArray(previous)) return [...previous, null]\n\t\t\t\t\t\t\t\t\t\t\tconst object = previous as Record<string, unknown>\n\t\t\t\t\t\t\t\t\t\t\tlet name = `new`\n\t\t\t\t\t\t\t\t\t\t\twhile (Object.hasOwn(object, name)) name += `_`\n\t\t\t\t\t\t\t\t\t\t\treturn { ...object, [name]: null }\n\t\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\tadd {Array.isArray(props.value) ? `item` : `property`}\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t{Array.isArray(props.value) ? (\n\t\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\t\t\t\tprops.tools.attempt(() => {\n\t\t\t\t\t\t\t\t\t\t\tprops.change?.((previous) =>\n\t\t\t\t\t\t\t\t\t\t\t\t[...(previous as unknown[])].sort((a, b) =>\n\t\t\t\t\t\t\t\t\t\t\t\t\ttypeof a === `number` && typeof b === `number`\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t? a - b\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t: describe(a).localeCompare(describe(b)),\n\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\tsort\n\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t</footer>\n\t\t\t\t\t) : null}\n\t\t\t\t</section>\n\t\t\t) : null}\n\t\t</section>\n\t)\n}\nfunction Primitive(props: {\n\tvalue: unknown\n\tchange?: Change | undefined\n\ttools: Tools\n\tlabel: string\n}): VNode {\n\tconst set = (value: unknown) => {\n\t\tprops.tools.attempt(() => {\n\t\t\tprops.change?.(() => value)\n\t\t})\n\t}\n\treturn (\n\t\t<span class=\"primitive\">\n\t\t\t{kind(props.value) === `boolean` ? (\n\t\t\t\t<input\n\t\t\t\t\taria-label={props.label}\n\t\t\t\t\ttype=\"checkbox\"\n\t\t\t\t\tchecked={Boolean(props.value)}\n\t\t\t\t\tdisabled={!props.change}\n\t\t\t\t\tonChange={(event) => {\n\t\t\t\t\t\tset(event.currentTarget.checked)\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t) : kind(props.value) === `string` || kind(props.value) === `number` ? (\n\t\t\t\t<input\n\t\t\t\t\taria-label={props.label}\n\t\t\t\t\ttype=\"text\"\n\t\t\t\t\tinputmode={kind(props.value) === `number` ? `decimal` : `text`}\n\t\t\t\t\tvalue={String(props.value)}\n\t\t\t\t\treadOnly={!props.change}\n\t\t\t\t\tonInput={(event) => {\n\t\t\t\t\t\tconst text = event.currentTarget.value\n\t\t\t\t\t\tif (kind(props.value) === `string`) set(text)\n\t\t\t\t\t\telse if (text.trim() && Number.isFinite(Number(text)))\n\t\t\t\t\t\t\tset(Number(text))\n\t\t\t\t\t}}\n\t\t\t\t\tonBlur={(event) => {\n\t\t\t\t\t\tevent.currentTarget.value = String(props.value)\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t) : (\n\t\t\t\t<code>{describe(props.value)}</code>\n\t\t\t)}\n\t\t</span>\n\t)\n}\nfunction Property(props: { name: string; editor: EditorProps }): VNode {\n\tconst parent = props.editor\n\tconst read = () => (parent.value as Record<string, unknown>)[props.name]\n\tconst change: Change = (update) => {\n\t\tparent.change?.((previous) => {\n\t\t\tif (Array.isArray(previous))\n\t\t\t\treturn previous.map((value, index) =>\n\t\t\t\t\tindex === Number(props.name) ? update(value) : value,\n\t\t\t\t)\n\t\t\tconst object = previous as Record<string, unknown>\n\t\t\treturn { ...object, [props.name]: update(object[props.name]) }\n\t\t})\n\t}\n\treturn (\n\t\t<section class=\"property\">\n\t\t\t<JsonEditor\n\t\t\t\tlabel={\n\t\t\t\t\tparent.change && !Array.isArray(parent.value) ? (\n\t\t\t\t\t\t<input\n\t\t\t\t\t\t\taria-label={`Rename ${props.name}`}\n\t\t\t\t\t\t\tstyle={`width:calc(${Math.max(1, props.name.length)}ch + 6px)`}\n\t\t\t\t\t\t\tvalue={props.name}\n\t\t\t\t\t\t\tonChange={(event) => {\n\t\t\t\t\t\t\t\tconst input = event.currentTarget\n\t\t\t\t\t\t\t\tconst name = input.value\n\t\t\t\t\t\t\t\tparent.tools.attempt(() => {\n\t\t\t\t\t\t\t\t\tparent.change?.((previous) => {\n\t\t\t\t\t\t\t\t\t\tconst object = previous as Record<string, unknown>\n\t\t\t\t\t\t\t\t\t\tif (name !== props.name && Object.hasOwn(object, name))\n\t\t\t\t\t\t\t\t\t\t\tthrow new Error(`Property \"${name}\" already exists`)\n\t\t\t\t\t\t\t\t\t\treturn Object.fromEntries(\n\t\t\t\t\t\t\t\t\t\t\tObject.entries(object).map(([key, value]) => [\n\t\t\t\t\t\t\t\t\t\t\t\tkey === props.name ? name : key,\n\t\t\t\t\t\t\t\t\t\t\t\tvalue,\n\t\t\t\t\t\t\t\t\t\t\t]),\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\tinput.value = props.name\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t/>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<strong>{props.name}</strong>\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t\tactions={\n\t\t\t\t\tparent.change ? (\n\t\t\t\t\t\t<button\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\taria-label={`Delete ${props.name}`}\n\t\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\t\tparent.tools.attempt(() => {\n\t\t\t\t\t\t\t\t\tparent.change?.((previous) =>\n\t\t\t\t\t\t\t\t\t\tArray.isArray(previous)\n\t\t\t\t\t\t\t\t\t\t\t? previous.filter(\n\t\t\t\t\t\t\t\t\t\t\t\t\t(_, index) => index !== Number(props.name),\n\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t: Object.fromEntries(\n\t\t\t\t\t\t\t\t\t\t\t\t\tObject.entries(previous as object).filter(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t([key]) => key !== props.name,\n\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t×\n\t\t\t\t\t\t</button>\n\t\t\t\t\t) : null\n\t\t\t\t}\n\t\t\t\ttools={parent.tools}\n\t\t\t\tpath={[...parent.path, props.name]}\n\t\t\t\tvalue={read()}\n\t\t\t\tchange={parent.change ? change : undefined}\n\t\t\t\tancestors={[...(parent.ancestors ?? []), parent.value]}\n\t\t\t/>\n\t\t</section>\n\t)\n}\n","import type { VNode } from \"@atom.io/spa\"\nimport { useSetter, useTimeline, useValue } from \"@atom.io/spa\"\nimport type {\n\tReadableToken,\n\tTimelineToken,\n\tTransactionToken,\n\tWritableToken,\n} from \"atom.io\"\nimport {\n\tdisposeFromStore,\n\tfindInStore,\n\tisReservedIntrospectionKey,\n} from \"atom.io/internal\"\nimport type { FamilyNode } from \"atom.io/introspection\"\n\nimport { JsonEditor } from \"./JsonEditor.tsx\"\nimport type { Tools } from \"./store.ts\"\nimport { useExpanded } from \"./store.ts\"\nimport { describe } from \"./value.ts\"\n\ntype Token = ReadableToken<unknown, any, any>\nexport function StateIndex(props: {\n\ttools: Tools\n\ttype: `atoms` | `selectors`\n}): VNode {\n\tconst index = useValue<Map<string, Token | FamilyNode<Token>>>(\n\t\tprops.type === `atoms` ? props.tools.atomIndex : props.tools.selectorIndex,\n\t)\n\treturn (\n\t\t<article class=\"index\" data-testid=\"state-index\">\n\t\t\t{index().size === 0 ? (\n\t\t\t\t<p>(no {props.type})</p>\n\t\t\t) : (\n\t\t\t\t[...index().values()].map((node) => (\n\t\t\t\t\t<StateNode key={node.key} tools={props.tools} node={node} />\n\t\t\t\t))\n\t\t\t)}\n\t\t</article>\n\t)\n}\nfunction StateNode(props: {\n\ttools: Tools\n\tnode: Token | FamilyNode<Token>\n}): VNode {\n\tconst [open, toggle] = useExpanded(props.tools, [props.node.key])\n\treturn (\n\t\t<section class=\"node\" data-testid={`state-${props.node.key}`}>\n\t\t\t{`familyMembers` in props.node ? (\n\t\t\t\t<>\n\t\t\t\t\t<header>\n\t\t\t\t\t\t<button\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\taria-expanded={open()}\n\t\t\t\t\t\t\tdata-testid={`open-close-state-family-${props.node.key}`}\n\t\t\t\t\t\t\tonClick={toggle}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{open() ? `▾` : `▸`}\n\t\t\t\t\t\t</button>\n\t\t\t\t\t\t<h2>{props.node.key}</h2>\n\t\t\t\t\t\t<small>family</small>\n\t\t\t\t\t</header>\n\t\t\t\t\t{open()\n\t\t\t\t\t\t? [...props.node.familyMembers.values()].map((token) => (\n\t\t\t\t\t\t\t\t<StateLeaf key={token.key} tools={props.tools} token={token} />\n\t\t\t\t\t\t\t))\n\t\t\t\t\t\t: null}\n\t\t\t\t</>\n\t\t\t) : (\n\t\t\t\t<StateLeaf tools={props.tools} token={props.node} />\n\t\t\t)}\n\t\t</section>\n\t)\n}\nfunction StateLeaf(props: { tools: Tools; token: Token }): VNode {\n\tconst read = useValue(props.token)\n\tconst writable = !props.token.type.startsWith(`readonly`)\n\tconst set = writable\n\t\t? useSetter(props.token as WritableToken<unknown, any, any>)\n\t\t: undefined\n\tconst value = () => {\n\t\ttry {\n\t\t\treturn read()\n\t\t} catch (error) {\n\t\t\treturn error\n\t\t}\n\t}\n\treturn (\n\t\t<section class=\"state-leaf\" data-testid={`state-value-${props.token.key}`}>\n\t\t\t<JsonEditor\n\t\t\t\tlabel={<h3>{props.token.family?.subKey ?? props.token.key}</h3>}\n\t\t\t\tactions={\n\t\t\t\t\tprops.token.family ? (\n\t\t\t\t\t\t<button\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\taria-label={`Dispose ${props.token.key}`}\n\t\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\t\tprops.tools.attempt(() => {\n\t\t\t\t\t\t\t\t\tdisposeFromStore(props.tools.store, props.token)\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t×\n\t\t\t\t\t\t</button>\n\t\t\t\t\t) : null\n\t\t\t\t}\n\t\t\t\ttools={props.tools}\n\t\t\t\tvalue={value()}\n\t\t\t\tchange={\n\t\t\t\t\tset\n\t\t\t\t\t\t? (update) => {\n\t\t\t\t\t\t\t\t// Validate edits before opening an atom.io write operation.\n\t\t\t\t\t\t\t\tconst next = update(read())\n\t\t\t\t\t\t\t\tset(() => next)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t: undefined\n\t\t\t\t}\n\t\t\t\tpath={\n\t\t\t\t\tprops.token.family\n\t\t\t\t\t\t? [props.token.family.key, props.token.family.subKey]\n\t\t\t\t\t\t: [props.token.key]\n\t\t\t\t}\n\t\t\t/>\n\t\t</section>\n\t)\n}\nexport function TransactionIndex(props: { tools: Tools }): VNode {\n\tconst index = useValue(props.tools.transactionIndex)\n\tconst visible = () =>\n\t\tindex().filter((token) => !isReservedIntrospectionKey(token.key))\n\treturn (\n\t\t<article class=\"index\" data-testid=\"transaction-index\">\n\t\t\t{visible().length === 0 ? (\n\t\t\t\t<p>(no transactions)</p>\n\t\t\t) : (\n\t\t\t\tvisible().map((token) => (\n\t\t\t\t\t<TransactionLog key={token.key} tools={props.tools} token={token} />\n\t\t\t\t))\n\t\t\t)}\n\t\t</article>\n\t)\n}\nfunction TransactionLog(props: {\n\ttools: Tools\n\ttoken: TransactionToken<any>\n}): VNode {\n\tconst log = useValue(\n\t\tfindInStore(\n\t\t\tprops.tools.store,\n\t\t\tprops.tools.transactionLogSelectors,\n\t\t\tprops.token.key,\n\t\t),\n\t)\n\tconst [open, toggle] = useExpanded(props.tools, [props.token.key])\n\treturn (\n\t\t<section class=\"node\" data-testid={`transaction-${props.token.key}`}>\n\t\t\t<header>\n\t\t\t\t<button\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\taria-expanded={open()}\n\t\t\t\t\tdata-testid={`open-close-transaction-${props.token.key}`}\n\t\t\t\t\tonClick={toggle}\n\t\t\t\t>\n\t\t\t\t\t{open() ? `▾` : `▸`}\n\t\t\t\t</button>\n\t\t\t\t<h2>{props.token.key}</h2>\n\t\t\t\t<small>({log().length})</small>\n\t\t\t</header>\n\t\t\t{open()\n\t\t\t\t? log().map((event, index) => (\n\t\t\t\t\t\t<EventView\n\t\t\t\t\t\t\tkey={index}\n\t\t\t\t\t\t\ttools={props.tools}\n\t\t\t\t\t\t\tevent={event}\n\t\t\t\t\t\t\tindex={index}\n\t\t\t\t\t\t/>\n\t\t\t\t\t))\n\t\t\t\t: null}\n\t\t</section>\n\t)\n}\n// Events are recursive discriminated records, including user-defined transaction outputs.\nexport function EventView(props: {\n\ttools: Tools\n\tevent: any\n\tindex: number\n}): VNode {\n\tconst [open, toggle] = useExpanded(\n\t\tprops.tools,\n\t\t[`event`, props.event.token?.key ?? ``, String(props.index)],\n\t\ttrue,\n\t)\n\treturn (\n\t\t<section\n\t\t\tclass=\"event\"\n\t\t\tdata-testid={`${props.event.type === `transaction_outcome` ? `transaction` : `timeline`}-update-${props.event.token?.key}-${props.index}`}\n\t\t>\n\t\t\t<header>\n\t\t\t\t<button type=\"button\" aria-expanded={open()} onClick={toggle}>\n\t\t\t\t\t{open() ? `▾` : `▸`}\n\t\t\t\t</button>\n\t\t\t\t<strong>{props.event.token?.key}</strong>\n\t\t\t\t<small>{props.event.type}</small>\n\t\t\t</header>\n\t\t\t{open() ? (\n\t\t\t\tprops.event.type === `transaction_outcome` ? (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\tparams: <code>{describe(props.event.params)}</code>\n\t\t\t\t\t\t</p>\n\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\toutput: <code>{describe(props.event.output)}</code>\n\t\t\t\t\t\t</p>\n\t\t\t\t\t\t<section class=\"impact\">\n\t\t\t\t\t\t\t{props.event.subEvents.map((event: any, index: number) => (\n\t\t\t\t\t\t\t\t<EventView\n\t\t\t\t\t\t\t\t\tkey={index}\n\t\t\t\t\t\t\t\t\ttools={props.tools}\n\t\t\t\t\t\t\t\t\tevent={event}\n\t\t\t\t\t\t\t\t\tindex={index}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t</section>\n\t\t\t\t\t</>\n\t\t\t\t) : props.event.update ? (\n\t\t\t\t\t<p>\n\t\t\t\t\t\t<del>{describe(props.event.update.oldValue)}</del> →{` `}\n\t\t\t\t\t\t<ins>{describe(props.event.update.newValue)}</ins>\n\t\t\t\t\t</p>\n\t\t\t\t) : (\n\t\t\t\t\t<code>{describe(props.event)}</code>\n\t\t\t\t)\n\t\t\t) : null}\n\t\t</section>\n\t)\n}\nexport function TimelineIndex(props: { tools: Tools }): VNode {\n\tconst index = useValue(props.tools.timelineIndex)\n\tconst groups = () => {\n\t\tconst result = new Map<string, TimelineToken<any>[]>()\n\t\tfor (const token of index()) {\n\t\t\tif (isReservedIntrospectionKey(token.key) || token.key.startsWith(`👁‍🗨`))\n\t\t\t\tcontinue\n\t\t\tconst key = token.family?.key ?? ``\n\t\t\tconst members = result.get(key) ?? []\n\t\t\tmembers.push(token)\n\t\t\tresult.set(key, members)\n\t\t}\n\t\treturn [...result]\n\t}\n\treturn (\n\t\t<article class=\"index\" data-testid=\"timeline-index\">\n\t\t\t{groups().length === 0 ? (\n\t\t\t\t<p>(no timelines)</p>\n\t\t\t) : (\n\t\t\t\tgroups().map(([family, members]) => (\n\t\t\t\t\t<section\n\t\t\t\t\t\tkey={family}\n\t\t\t\t\t\tdata-testid={family ? `timeline-family-${family}` : undefined}\n\t\t\t\t\t>\n\t\t\t\t\t\t{family ? <h2>{family}</h2> : null}\n\t\t\t\t\t\t{members.map((token) => (\n\t\t\t\t\t\t\t<TimelineLog key={token.key} tools={props.tools} token={token} />\n\t\t\t\t\t\t))}\n\t\t\t\t\t</section>\n\t\t\t\t))\n\t\t\t)}\n\t\t</article>\n\t)\n}\nfunction TimelineLog(props: { tools: Tools; token: TimelineToken<any> }): VNode {\n\tconst controls = useTimeline(props.token)\n\tconst log = useValue(\n\t\tfindInStore(\n\t\t\tprops.tools.store,\n\t\t\tprops.tools.timelineSelectors,\n\t\t\tprops.token.key,\n\t\t),\n\t)\n\tconst [open, toggle] = useExpanded(props.tools, [props.token.key])\n\treturn (\n\t\t<section class=\"node\" data-testid={`timeline-${props.token.key}`}>\n\t\t\t<header>\n\t\t\t\t<button\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\taria-expanded={open()}\n\t\t\t\t\tdata-testid={`open-close-timeline-${props.token.key}`}\n\t\t\t\t\tonClick={toggle}\n\t\t\t\t>\n\t\t\t\t\t{open() ? `▾` : `▸`}\n\t\t\t\t</button>\n\t\t\t\t<h2>{props.token.family?.subKey ?? props.token.key}</h2>\n\t\t\t\t<small>\n\t\t\t\t\t({controls().at}/{controls().length})\n\t\t\t\t</small>\n\t\t\t\t<button\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\tdisabled={controls().at === 0}\n\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\tprops.tools.attempt(controls().undo)\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\tundo\n\t\t\t\t</button>\n\t\t\t\t<button\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\tdisabled={controls().at === controls().length}\n\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\tprops.tools.attempt(controls().redo)\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\tredo\n\t\t\t\t</button>\n\t\t\t</header>\n\t\t\t{open() ? (\n\t\t\t\t<section>\n\t\t\t\t\t{log().history.map((event, index) => (\n\t\t\t\t\t\t<section key={index}>\n\t\t\t\t\t\t\t{index === log().at ? (\n\t\t\t\t\t\t\t\t<p class=\"you-are-here\">you are here</p>\n\t\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t\t<EventView tools={props.tools} event={event} index={index} />\n\t\t\t\t\t\t</section>\n\t\t\t\t\t))}\n\t\t\t\t\t{log().at === log().history.length ? (\n\t\t\t\t\t\t<p class=\"you-are-here\">you are here</p>\n\t\t\t\t\t) : null}\n\t\t\t\t</section>\n\t\t\t) : null}\n\t\t</section>\n\t)\n}\n","import type { VNode } from \"@atom.io/spa\"\nimport { onCleanup, onMount, render, useValue } from \"@atom.io/spa\"\nimport type { RootStore } from \"atom.io/internal\"\nimport { IMPLICIT } from \"atom.io/internal\"\n\nimport { StateIndex, TimelineIndex, TransactionIndex } from \"./Indexes.tsx\"\nimport { useLocal, useSaved, useTools } from \"./store.ts\"\n\nexport interface AtomIODevtoolsProps {\n\t/** Inspected store. Fixed for this component instance; change its key to replace it. */\n\tstore?: RootStore\n\thideByDefault?: boolean\n}\n/** Owns a rendering root in the inspected store, independently of its parent island. */\nexport function AtomIODevtools(props: AtomIODevtoolsProps): VNode {\n\tlet host: HTMLElement | null = null\n\tconst attach = (element: HTMLElement | null) => {\n\t\thost = element\n\t}\n\tonMount(() => {\n\t\tconst store = props.store ?? IMPLICIT.STORE\n\t\tconst root = render(\n\t\t\t() => <Panel store={store} hideByDefault={props.hideByDefault ?? false} />,\n\t\t\thost!,\n\t\t\t{ store },\n\t\t)\n\t\tonCleanup(root.dispose)\n\t})\n\treturn <spa-devtools ref={attach} />\n}\nconst VIEWS = [`atoms`, `selectors`, `transactions`, `timelines`] as const\ntype View = (typeof VIEWS)[number]\nfunction Panel(props: { store: RootStore; hideByDefault: boolean }): VNode {\n\tconst tools = useTools(props.store)\n\tconst [hidden, setHidden] = useSaved(\n\t\tprops.store,\n\t\t`🔍 Devtools Are Hidden`,\n\t\tprops.hideByDefault,\n\t)\n\tconst [open, setOpen] = useSaved(props.store, `🔍 Devtools Are Open`, true)\n\tconst [selection, setSelection] = useSaved<string>(\n\t\tprops.store,\n\t\t`🔍 Devtools View`,\n\t\t`atoms`,\n\t)\n\tconst view = () =>\n\t\tVIEWS.includes(selection() as View) ? (selection() as View) : `atoms`\n\tconst [position, setPosition] = useLocal(props.store, { x: 0, y: 0 })\n\tconst error = useValue(tools.error)\n\tlet panel: HTMLElement | null = null\n\tconst attach = (element: HTMLElement | null) => {\n\t\tpanel = element\n\t}\n\tlet drag:\n\t\t| { id: number; startX: number; startY: number; x: number; y: number }\n\t\t| undefined\n\tonMount(() => {\n\t\tconst shortcut = (event: KeyboardEvent) => {\n\t\t\tif (event.ctrlKey && event.shiftKey && event.code === `KeyA`) {\n\t\t\t\tevent.preventDefault()\n\t\t\t\tsetHidden((value) => !value)\n\t\t\t}\n\t\t}\n\t\tconst reset = () => {\n\t\t\tsetPosition({ x: 0, y: 0 })\n\t\t}\n\t\tdocument.addEventListener(`keydown`, shortcut)\n\t\twindow.addEventListener(`resize`, reset)\n\t\tonCleanup(() => {\n\t\t\tdocument.removeEventListener(`keydown`, shortcut)\n\t\t\twindow.removeEventListener(`resize`, reset)\n\t\t})\n\t})\n\treturn (\n\t\t<main\n\t\t\tref={attach}\n\t\t\tdata-css=\"spa-devtools\"\n\t\t\tdata-testid=\"atom-io-devtools\"\n\t\t\thidden={hidden()}\n\t\t\tdata-open={open()}\n\t\t\tstyle={`transform:translate(${position().x}px,${position().y}px)`}\n\t\t>\n\t\t\t<header class=\"toolbar\">\n\t\t\t\t<button\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\tclass=\"drag-handle\"\n\t\t\t\t\taria-label=\"Move debugger\"\n\t\t\t\t\ttitle=\"Drag to move; arrow keys to nudge\"\n\t\t\t\t\tonPointerdown={(event) => {\n\t\t\t\t\t\tif (event.button !== 0) return\n\t\t\t\t\t\tdrag = {\n\t\t\t\t\t\t\tid: event.pointerId,\n\t\t\t\t\t\t\tstartX: event.clientX,\n\t\t\t\t\t\t\tstartY: event.clientY,\n\t\t\t\t\t\t\t...position(),\n\t\t\t\t\t\t}\n\t\t\t\t\t\t;(event.currentTarget as HTMLElement).setPointerCapture(\n\t\t\t\t\t\t\tevent.pointerId,\n\t\t\t\t\t\t)\n\t\t\t\t\t}}\n\t\t\t\t\tonPointermove={(event) => {\n\t\t\t\t\t\tif (!drag || drag.id !== event.pointerId || !panel) return\n\t\t\t\t\t\tconst rect = panel.getBoundingClientRect()\n\t\t\t\t\t\tconst next = {\n\t\t\t\t\t\t\tx: drag.x + event.clientX - drag.startX,\n\t\t\t\t\t\t\ty: drag.y + event.clientY - drag.startY,\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnext.x = Math.max(\n\t\t\t\t\t\t\tposition().x - rect.left,\n\t\t\t\t\t\t\tMath.min(next.x, position().x + window.innerWidth - rect.right),\n\t\t\t\t\t\t)\n\t\t\t\t\t\tnext.y = Math.max(\n\t\t\t\t\t\t\tposition().y - rect.top,\n\t\t\t\t\t\t\tMath.min(next.y, position().y + window.innerHeight - rect.bottom),\n\t\t\t\t\t\t)\n\t\t\t\t\t\tsetPosition(next)\n\t\t\t\t\t}}\n\t\t\t\t\tonPointerup={() => {\n\t\t\t\t\t\tdrag = undefined\n\t\t\t\t\t}}\n\t\t\t\t\tonPointercancel={() => {\n\t\t\t\t\t\tdrag = undefined\n\t\t\t\t\t}}\n\t\t\t\t\tonKeydown={(event) => {\n\t\t\t\t\t\tconst step = {\n\t\t\t\t\t\t\tArrowLeft: [-10, 0],\n\t\t\t\t\t\t\tArrowRight: [10, 0],\n\t\t\t\t\t\t\tArrowUp: [0, -10],\n\t\t\t\t\t\t\tArrowDown: [0, 10],\n\t\t\t\t\t\t}[event.key]\n\t\t\t\t\t\tif (step) {\n\t\t\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\t\t\tsetPosition(({ x, y }) => ({ x: x + step[0], y: y + step[1] }))\n\t\t\t\t\t\t}\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t⠿\n\t\t\t\t</button>\n\t\t\t\t<h1>atom.io</h1>\n\t\t\t\t{open() ? (\n\t\t\t\t\t<nav aria-label=\"Debugger views\">\n\t\t\t\t\t\t{VIEWS.map((name) => (\n\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\taria-pressed={view() === name}\n\t\t\t\t\t\t\t\tdata-testid={`view-${name}`}\n\t\t\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\t\t\tsetSelection(name)\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{name}\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t))}\n\t\t\t\t\t</nav>\n\t\t\t\t) : null}\n\t\t\t\t<button\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\taria-label={open() ? `Minimize debugger` : `Open debugger`}\n\t\t\t\t\tdata-testid=\"open-close-devtools\"\n\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\tsetOpen((value) => !value)\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t{open() ? `−` : `🔍`}\n\t\t\t\t</button>\n\t\t\t\t<button\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\taria-label=\"Hide debugger (Ctrl+Shift+A)\"\n\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\tsetHidden(true)\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t×\n\t\t\t\t</button>\n\t\t\t</header>\n\t\t\t{open() ? (\n\t\t\t\t<>\n\t\t\t\t\t{error() ? <p role=\"alert\">{error()}</p> : null}\n\t\t\t\t\t{view() === `atoms` || view() === `selectors` ? (\n\t\t\t\t\t\t<StateIndex\n\t\t\t\t\t\t\tkey={view()}\n\t\t\t\t\t\t\ttools={tools}\n\t\t\t\t\t\t\ttype={view() as `atoms` | `selectors`}\n\t\t\t\t\t\t/>\n\t\t\t\t\t) : view() === `transactions` ? (\n\t\t\t\t\t\t<TransactionIndex tools={tools} />\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<TimelineIndex tools={tools} />\n\t\t\t\t\t)}\n\t\t\t\t</>\n\t\t\t) : null}\n\t\t</main>\n\t)\n}\n"],"mappings":";;;;;AAaA,MAAM,yBAAS,IAAI,QAA4D;AAC/E,MAAM,gCAAgB,IAAI,QAAwC;AASlE,SAAgB,UAAa,OAAkB,SAAiC;CAC/E,IAAI,SAAS,OAAO,IAAI,KAAK;CAC7B,IAAI,CAAC,QAAQ;EACZ,SAAS,wBAAgD,OAAO;GAC/D,KAAK;GACL,SAAS,KAAA;EACV,CAAC;EACD,OAAO,IAAI,OAAO,MAAM;CACzB;CACA,MAAM,QAAQ,YAAY,OAAO,QAAQ,MAAM,CAAC;CAChD,aAAa,OAAO,OAAO,OAAO;CAClC,gBAAgB;EACf,iBAAiB,OAAO,KAAK;CAC9B,CAAC;CACD,OAAO;AACR;AACA,SAAgB,SACf,OACA,SAC+C;CAC/C,MAAM,QAAQ,UAAU,OAAO,OAAO;CACtC,OAAO,CAA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;MAAM;MAAA,iBACZ;OACd,aAAa,IAAI;MAClB;MAAC,gBAEA;KAAI,CAAA,CAEN;IAAC,CAAA,IAEA;IAAIA,IAAA,UAAA;KAAA,QAEF;KAAQ,IAAA,eAAA;MAAA,OACD,KAAK,IAAI,sBAAsB;KAAe;KAAA,eAC9C;KAAqB,iBAClB;MACd,SAAS,UAAU,CAAC,KAAK;KAC1B;KAAC,gBAEA,KAAK,IAAI,MAAM;IAAI,CAAA;IAAAA,IAAA,UAAA;KAAA,QAGf;KAAQ,cACF;KAA8B,iBAC1B;MACd,UAAU,IAAI;KACf;KAAC,UACD;IAED,CAAA;GAAA;EAAA,CAAA,SAEA,KAAK,IAACA,IAAA,MAAA,EAAA,UAAA,OAEJ,MAAM,IAACA,IAAA,KAAA;GAAA,QAAW;GAAO,gBAAE,MAAM;EAAC,CAAA,IAAQ,YAC1C,KAAK,MAAM,WAAW,KAAK,MAAM,cAAWA,IAAA,YAAA;GAAA,OAEtC,KAAK;GAAC,IAAA,UAAA;IAAA,OACJ;GAAK;GAAA,IAAA,SAAA;IAAA,OACN,KAAK;GAA0B;EAAA,CAAA,IAEnC,KAAK,MAAM,iBAAcA,IAAA,kBAAA,EAAA,IAAA,UAAA;GAAA,OACH;EAAK,EAAA,CAAA,IAAAA,IAAA,eAAA,EAAA,IAAA,UAAA;GAAA,OAER;EAAK,EAAA,CAAA,CAC3B,EAAA,CAAA,IAEC,IAAI;CAAA,CAAA;AAGX;AAAC,eAAA,MAAA;AAAA,MAAA,MAAA"}
1
+ {"version":3,"file":"index.js","names":["_spa","_spa","_spa"],"sources":["../src/store.ts","../src/value.ts","../src/JsonEditor.tsx","../src/Indexes.tsx","../src/AtomIODevtools.tsx"],"sourcesContent":["import type { Accessor } from \"@atom.io/spa\"\nimport { onCleanup, useId, useSetter, useValue } from \"@atom.io/spa\"\nimport type { RegularAtomFamilyToken, RegularAtomToken, Setter } from \"atom.io\"\nimport type { RootStore } from \"atom.io/internal\"\nimport {\n\tcreateRegularAtomFamily,\n\tdisposeFromStore,\n\tfindInStore,\n\tsetIntoStore,\n} from \"atom.io/internal\"\nimport type { IntrospectionStates } from \"atom.io/introspection\"\nimport { attachIntrospectionStates } from \"atom.io/introspection\"\n\nconst locals = new WeakMap<RootStore, RegularAtomFamilyToken<unknown, string>>()\nconst introspection = new WeakMap<RootStore, IntrospectionStates>()\nexport type Path = readonly string[]\nexport interface Tools extends IntrospectionStates {\n\tstore: RootStore\n\texpanded: RegularAtomToken<Record<string, boolean>>\n\terror: RegularAtomToken<string>\n\tattempt(run: () => void): void\n}\n\nexport function ownedAtom<T>(store: RootStore, initial: T): RegularAtomToken<T> {\n\tlet family = locals.get(store)\n\tif (!family) {\n\t\tfamily = createRegularAtomFamily<unknown, string, never>(store, {\n\t\t\tkey: `🔍 spa devtools`,\n\t\t\tdefault: undefined,\n\t\t})\n\t\tlocals.set(store, family)\n\t}\n\tconst token = findInStore(store, family, useId()) as RegularAtomToken<T>\n\tsetIntoStore(store, token, initial)\n\tonCleanup(() => {\n\t\tdisposeFromStore(store, token)\n\t})\n\treturn token\n}\nexport function useLocal<T>(\n\tstore: RootStore,\n\tinitial: T,\n): [Accessor<T>, (next: T | Setter<T>) => void] {\n\tconst token = ownedAtom(store, initial)\n\treturn [useValue(token) as Accessor<T>, useSetter(token)]\n}\nexport function useSaved<T>(\n\tstore: RootStore,\n\tkey: string,\n\tfallback: T,\n): [Accessor<T>, (next: T | Setter<T>) => void] {\n\tlet initial = fallback\n\ttry {\n\t\tconst saved: unknown = JSON.parse(localStorage.getItem(key) ?? `null`)\n\t\tif (saved !== null && typeof saved === typeof fallback) initial = saved as T\n\t} catch {\n\t\t/* Storage may be unavailable. */\n\t}\n\tconst [value, set] = useLocal(store, initial)\n\treturn [\n\t\tvalue,\n\t\t(next) => {\n\t\t\tset(next)\n\t\t\ttry {\n\t\t\t\tlocalStorage.setItem(key, JSON.stringify(value()))\n\t\t\t} catch {\n\t\t\t\t/* Keep in-memory state when storage is unavailable. */\n\t\t\t}\n\t\t},\n\t]\n}\nexport function useTools(store: RootStore): Tools {\n\tlet states = introspection.get(store)\n\tif (!states) {\n\t\tstates = attachIntrospectionStates(store)\n\t\tintrospection.set(store, states)\n\t}\n\tlet expanded: Record<string, boolean> = {}\n\ttry {\n\t\tconst saved: unknown = JSON.parse(\n\t\t\tlocalStorage.getItem(`🔍 spa expanded`) ?? `{}`,\n\t\t)\n\t\tif (\n\t\t\tsaved &&\n\t\t\ttypeof saved === `object` &&\n\t\t\t!Array.isArray(saved) &&\n\t\t\tObject.values(saved).every((value) => typeof value === `boolean`)\n\t\t)\n\t\t\texpanded = saved as Record<string, boolean>\n\t} catch {\n\t\t/* Ignore corrupt or unavailable storage. */\n\t}\n\tconst error = ownedAtom(store, ``)\n\tconst setError = useSetter(error)\n\treturn {\n\t\t...states,\n\t\tstore,\n\t\terror,\n\t\texpanded: ownedAtom(store, expanded),\n\t\tattempt(run) {\n\t\t\ttry {\n\t\t\t\trun()\n\t\t\t\tsetError(``)\n\t\t\t} catch (caught) {\n\t\t\t\tsetError(caught instanceof Error ? caught.message : String(caught))\n\t\t\t}\n\t\t},\n\t}\n}\nexport function useExpanded(\n\ttools: Tools,\n\tpath: Path,\n\tinitial = false,\n): [Accessor<boolean>, (event: MouseEvent) => void] {\n\tconst value = useValue(tools.expanded)\n\tconst set = useSetter(tools.expanded)\n\tconst key = JSON.stringify(path)\n\tconst group = `all:${JSON.stringify(path.slice(0, -1))}`\n\tconst read = () => value()[key] ?? value()[group] ?? initial\n\treturn [\n\t\tread,\n\t\t(event) => {\n\t\t\tconst next = !read()\n\t\t\tset((previous) => {\n\t\t\t\tconst result = { ...previous }\n\t\t\t\tif (event.shiftKey) {\n\t\t\t\t\tconst parent = JSON.stringify(path.slice(0, -1))\n\t\t\t\t\tfor (const item of Object.keys(result)) {\n\t\t\t\t\t\tif (item.startsWith(`[`)) {\n\t\t\t\t\t\t\tconst candidate = JSON.parse(item) as string[]\n\t\t\t\t\t\t\tif (JSON.stringify(candidate.slice(0, -1)) === parent)\n\t\t\t\t\t\t\t\tReflect.deleteProperty(result, item)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tresult[group] = next\n\t\t\t\t} else {\n\t\t\t\t\tresult[key] = next\n\t\t\t\t}\n\t\t\t\ttry {\n\t\t\t\t\tlocalStorage.setItem(`🔍 spa expanded`, JSON.stringify(result))\n\t\t\t\t} catch {\n\t\t\t\t\t/* Keep in-memory expansion state. */\n\t\t\t\t}\n\t\t\t\treturn result\n\t\t\t})\n\t\t},\n\t]\n}\n","export type Change = (update: (previous: unknown) => unknown) => void\nexport type JsonKind =\n\t| `string`\n\t| `number`\n\t| `boolean`\n\t| `null`\n\t| `array`\n\t| `object`\nexport function kind(value: unknown): JsonKind | `other` {\n\tif (value === null) return `null`\n\tif (Array.isArray(value)) return `array`\n\tif (\n\t\ttypeof value === `object` &&\n\t\t(Object.getPrototypeOf(value) === Object.prototype ||\n\t\t\tObject.getPrototypeOf(value) === null)\n\t)\n\t\treturn `object`\n\tif (\n\t\ttypeof value === `string` ||\n\t\ttypeof value === `number` ||\n\t\ttypeof value === `boolean`\n\t)\n\t\treturn typeof value as JsonKind\n\treturn `other`\n}\nexport function describe(value: unknown): string {\n\ttry {\n\t\tconst seen = new WeakSet<object>()\n\t\treturn (\n\t\t\tJSON.stringify(value, (_, item: unknown) => {\n\t\t\t\tif (typeof item === `bigint`) return `${item}n`\n\t\t\t\tif (item instanceof Error) return `${item.name}: ${item.message}`\n\t\t\t\tif (item instanceof Map) return { Map: [...item] }\n\t\t\t\tif (item instanceof Set) return { Set: [...item] }\n\t\t\t\tif (typeof item === `object` && item !== null) {\n\t\t\t\t\tif (seen.has(item)) return `[Circular]`\n\t\t\t\t\tseen.add(item)\n\t\t\t\t}\n\t\t\t\treturn item\n\t\t\t}) ?? String(value)\n\t\t)\n\t} catch {\n\t\treturn Object.prototype.toString.call(value)\n\t}\n}\nexport function convert(value: unknown, type: JsonKind): unknown {\n\tswitch (type) {\n\t\tcase `null`:\n\t\t\treturn null\n\t\tcase `string`:\n\t\t\treturn value == null\n\t\t\t\t? ``\n\t\t\t\t: typeof value === `string`\n\t\t\t\t\t? value\n\t\t\t\t\t: describe(value)\n\t\tcase `number`: {\n\t\t\tconst next = Array.isArray(value) ? value.length : Number(value)\n\t\t\treturn Number.isFinite(next) ? next : 0\n\t\t}\n\t\tcase `boolean`:\n\t\t\treturn typeof value === `string` ? value === `true` : Boolean(value)\n\t\tcase `array`:\n\t\t\treturn Array.isArray(value)\n\t\t\t\t? value\n\t\t\t\t: value == null\n\t\t\t\t\t? []\n\t\t\t\t\t: typeof value === `object`\n\t\t\t\t\t\t? Object.entries(value)\n\t\t\t\t\t\t: [value]\n\t\tcase `object`:\n\t\t\treturn kind(value) === `object`\n\t\t\t\t? value\n\t\t\t\t: Array.isArray(value)\n\t\t\t\t\t? Object.fromEntries(value.map((item, index) => [index, item]))\n\t\t\t\t\t: value == null\n\t\t\t\t\t\t? {}\n\t\t\t\t\t\t: { value }\n\t}\n}\n","import type { Child, VNode } from \"@atom.io/spa\"\n\nimport type { Path, Tools } from \"./store.ts\"\nimport { useExpanded } from \"./store.ts\"\nimport type { Change, JsonKind } from \"./value.ts\"\nimport { convert, describe, kind } from \"./value.ts\"\n\ninterface EditorProps {\n\ttools: Tools\n\tvalue: unknown\n\tchange?: Change | undefined\n\tpath: Path\n\tancestors?: readonly unknown[]\n\tlabel?: Child\n\tactions?: Child\n}\nconst TYPES: JsonKind[] = [\n\t`string`,\n\t`number`,\n\t`boolean`,\n\t`null`,\n\t`array`,\n\t`object`,\n]\nexport function JsonEditor(props: EditorProps): VNode {\n\tconst [expanded, toggle] = useExpanded(props.tools, props.path)\n\tconst circular = () =>\n\t\t(props.ancestors?.includes(props.value) ?? false) || props.path.length > 50\n\tconst container = () =>\n\t\t!circular() &&\n\t\t(kind(props.value) === `object` || kind(props.value) === `array`)\n\tconst entries = () => Object.entries(props.value as Record<string, unknown>)\n\treturn (\n\t\t<section\n\t\t\tclass=\"json-editor\"\n\t\t\tdata-testid={`${props.path.join(`.`)}-state-editor`}\n\t\t>\n\t\t\t<header>\n\t\t\t\t{container() ? (\n\t\t\t\t\t<button\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\taria-label={`Expand ${props.path.at(-1)}`}\n\t\t\t\t\t\taria-expanded={expanded()}\n\t\t\t\t\t\tonClick={toggle}\n\t\t\t\t\t>\n\t\t\t\t\t\t{expanded() ? `▾` : `▸`}\n\t\t\t\t\t</button>\n\t\t\t\t) : (\n\t\t\t\t\t<span class=\"carat-spacer\" />\n\t\t\t\t)}\n\t\t\t\t<span class=\"field-name\">{props.label}</span>\n\t\t\t\t{props.change ? (\n\t\t\t\t\t<select\n\t\t\t\t\t\taria-label={`Type of ${props.path.at(-1)}`}\n\t\t\t\t\t\tvalue={kind(props.value)}\n\t\t\t\t\t\tonChange={(event) => {\n\t\t\t\t\t\t\tconst type = event.currentTarget.value as JsonKind\n\t\t\t\t\t\t\tprops.tools.attempt(() => {\n\t\t\t\t\t\t\t\tprops.change?.((previous) => convert(previous, type))\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t<option value=\"other\" disabled>\n\t\t\t\t\t\t\tother\n\t\t\t\t\t\t</option>\n\t\t\t\t\t\t{TYPES.map((type) => (\n\t\t\t\t\t\t\t<option value={type}>{type}</option>\n\t\t\t\t\t\t))}\n\t\t\t\t\t</select>\n\t\t\t\t) : (\n\t\t\t\t\t<small>{kind(props.value)}</small>\n\t\t\t\t)}\n\t\t\t\t{container() ? (\n\t\t\t\t\t<code title={describe(props.value)}>{describe(props.value)}</code>\n\t\t\t\t) : circular() ? (\n\t\t\t\t\t<code>[Circular]</code>\n\t\t\t\t) : (\n\t\t\t\t\t<Primitive\n\t\t\t\t\t\tvalue={props.value}\n\t\t\t\t\t\tchange={props.change}\n\t\t\t\t\t\ttools={props.tools}\n\t\t\t\t\t\tlabel={props.path.at(-1) ?? `value`}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t\t{props.actions}\n\t\t\t</header>\n\t\t\t{container() && expanded() ? (\n\t\t\t\t<section class=\"properties\">\n\t\t\t\t\t{entries().map(([key]) => (\n\t\t\t\t\t\t<Property key={key} name={key} editor={props} />\n\t\t\t\t\t))}\n\t\t\t\t\t{props.change ? (\n\t\t\t\t\t\t<footer>\n\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\t\t\tprops.tools.attempt(() => {\n\t\t\t\t\t\t\t\t\t\tprops.change?.((previous) => {\n\t\t\t\t\t\t\t\t\t\t\tif (Array.isArray(previous)) return [...previous, null]\n\t\t\t\t\t\t\t\t\t\t\tconst object = previous as Record<string, unknown>\n\t\t\t\t\t\t\t\t\t\t\tlet name = `new`\n\t\t\t\t\t\t\t\t\t\t\twhile (Object.hasOwn(object, name)) name += `_`\n\t\t\t\t\t\t\t\t\t\t\treturn { ...object, [name]: null }\n\t\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\tadd {Array.isArray(props.value) ? `item` : `property`}\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t{Array.isArray(props.value) ? (\n\t\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\t\t\t\tprops.tools.attempt(() => {\n\t\t\t\t\t\t\t\t\t\t\tprops.change?.((previous) =>\n\t\t\t\t\t\t\t\t\t\t\t\t[...(previous as unknown[])].sort((a, b) =>\n\t\t\t\t\t\t\t\t\t\t\t\t\ttypeof a === `number` && typeof b === `number`\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t? a - b\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t: describe(a).localeCompare(describe(b)),\n\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\tsort\n\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t</footer>\n\t\t\t\t\t) : null}\n\t\t\t\t</section>\n\t\t\t) : null}\n\t\t</section>\n\t)\n}\nfunction Primitive(props: {\n\tvalue: unknown\n\tchange?: Change | undefined\n\ttools: Tools\n\tlabel: string\n}): VNode {\n\tconst set = (value: unknown) => {\n\t\tprops.tools.attempt(() => {\n\t\t\tprops.change?.(() => value)\n\t\t})\n\t}\n\treturn (\n\t\t<span class=\"primitive\">\n\t\t\t{kind(props.value) === `boolean` ? (\n\t\t\t\t<input\n\t\t\t\t\taria-label={props.label}\n\t\t\t\t\ttype=\"checkbox\"\n\t\t\t\t\tchecked={Boolean(props.value)}\n\t\t\t\t\tdisabled={!props.change}\n\t\t\t\t\tonChange={(event) => {\n\t\t\t\t\t\tset(event.currentTarget.checked)\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t) : kind(props.value) === `string` || kind(props.value) === `number` ? (\n\t\t\t\t<input\n\t\t\t\t\taria-label={props.label}\n\t\t\t\t\ttype=\"text\"\n\t\t\t\t\tinputmode={kind(props.value) === `number` ? `decimal` : `text`}\n\t\t\t\t\tvalue={String(props.value)}\n\t\t\t\t\treadOnly={!props.change}\n\t\t\t\t\tonInput={(event) => {\n\t\t\t\t\t\tconst text = event.currentTarget.value\n\t\t\t\t\t\tif (kind(props.value) === `string`) set(text)\n\t\t\t\t\t\telse if (text.trim() && Number.isFinite(Number(text)))\n\t\t\t\t\t\t\tset(Number(text))\n\t\t\t\t\t}}\n\t\t\t\t\tonBlur={(event) => {\n\t\t\t\t\t\tevent.currentTarget.value = String(props.value)\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t) : (\n\t\t\t\t<code>{describe(props.value)}</code>\n\t\t\t)}\n\t\t</span>\n\t)\n}\nfunction Property(props: { name: string; editor: EditorProps }): VNode {\n\tconst parent = props.editor\n\tconst read = () => (parent.value as Record<string, unknown>)[props.name]\n\tconst change: Change = (update) => {\n\t\tparent.change?.((previous) => {\n\t\t\tif (Array.isArray(previous))\n\t\t\t\treturn previous.map((value, index) =>\n\t\t\t\t\tindex === Number(props.name) ? update(value) : value,\n\t\t\t\t)\n\t\t\tconst object = previous as Record<string, unknown>\n\t\t\treturn { ...object, [props.name]: update(object[props.name]) }\n\t\t})\n\t}\n\treturn (\n\t\t<section class=\"property\">\n\t\t\t<JsonEditor\n\t\t\t\tlabel={\n\t\t\t\t\tparent.change && !Array.isArray(parent.value) ? (\n\t\t\t\t\t\t<input\n\t\t\t\t\t\t\taria-label={`Rename ${props.name}`}\n\t\t\t\t\t\t\tstyle={`width:calc(${Math.max(1, props.name.length)}ch + 6px)`}\n\t\t\t\t\t\t\tvalue={props.name}\n\t\t\t\t\t\t\tonChange={(event) => {\n\t\t\t\t\t\t\t\tconst input = event.currentTarget\n\t\t\t\t\t\t\t\tconst name = input.value\n\t\t\t\t\t\t\t\tparent.tools.attempt(() => {\n\t\t\t\t\t\t\t\t\tparent.change?.((previous) => {\n\t\t\t\t\t\t\t\t\t\tconst object = previous as Record<string, unknown>\n\t\t\t\t\t\t\t\t\t\tif (name !== props.name && Object.hasOwn(object, name))\n\t\t\t\t\t\t\t\t\t\t\tthrow new Error(`Property \"${name}\" already exists`)\n\t\t\t\t\t\t\t\t\t\treturn Object.fromEntries(\n\t\t\t\t\t\t\t\t\t\t\tObject.entries(object).map(([key, value]) => [\n\t\t\t\t\t\t\t\t\t\t\t\tkey === props.name ? name : key,\n\t\t\t\t\t\t\t\t\t\t\t\tvalue,\n\t\t\t\t\t\t\t\t\t\t\t]),\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\tinput.value = props.name\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t/>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<strong>{props.name}</strong>\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t\tactions={\n\t\t\t\t\tparent.change ? (\n\t\t\t\t\t\t<button\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\taria-label={`Delete ${props.name}`}\n\t\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\t\tparent.tools.attempt(() => {\n\t\t\t\t\t\t\t\t\tparent.change?.((previous) =>\n\t\t\t\t\t\t\t\t\t\tArray.isArray(previous)\n\t\t\t\t\t\t\t\t\t\t\t? previous.filter(\n\t\t\t\t\t\t\t\t\t\t\t\t\t(_, index) => index !== Number(props.name),\n\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t: Object.fromEntries(\n\t\t\t\t\t\t\t\t\t\t\t\t\tObject.entries(previous as object).filter(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t([key]) => key !== props.name,\n\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t×\n\t\t\t\t\t\t</button>\n\t\t\t\t\t) : null\n\t\t\t\t}\n\t\t\t\ttools={parent.tools}\n\t\t\t\tpath={[...parent.path, props.name]}\n\t\t\t\tvalue={read()}\n\t\t\t\tchange={parent.change ? change : undefined}\n\t\t\t\tancestors={[...(parent.ancestors ?? []), parent.value]}\n\t\t\t/>\n\t\t</section>\n\t)\n}\n","import type { VNode } from \"@atom.io/spa\"\nimport { useSetter, useTimeline, useValue } from \"@atom.io/spa\"\nimport type {\n\tReadableToken,\n\tTimelineToken,\n\tTransactionToken,\n\tWritableToken,\n} from \"atom.io\"\nimport {\n\tdisposeFromStore,\n\tfindInStore,\n\tisReservedIntrospectionKey,\n} from \"atom.io/internal\"\nimport type { FamilyNode } from \"atom.io/introspection\"\n\nimport { JsonEditor } from \"./JsonEditor.tsx\"\nimport type { Tools } from \"./store.ts\"\nimport { useExpanded } from \"./store.ts\"\nimport { describe } from \"./value.ts\"\n\ntype Token = ReadableToken<unknown, any, any>\nexport function StateIndex(props: {\n\ttools: Tools\n\ttype: `atoms` | `selectors`\n}): VNode {\n\tconst index = useValue<Map<string, Token | FamilyNode<Token>>>(\n\t\tprops.type === `atoms` ? props.tools.atomIndex : props.tools.selectorIndex,\n\t)\n\treturn (\n\t\t<article class=\"index\" data-testid=\"state-index\">\n\t\t\t{index().size === 0 ? (\n\t\t\t\t<p>(no {props.type})</p>\n\t\t\t) : (\n\t\t\t\t[...index().values()].map((node) => (\n\t\t\t\t\t<StateNode key={node.key} tools={props.tools} node={node} />\n\t\t\t\t))\n\t\t\t)}\n\t\t</article>\n\t)\n}\nfunction StateNode(props: {\n\ttools: Tools\n\tnode: Token | FamilyNode<Token>\n}): VNode {\n\tconst [open, toggle] = useExpanded(props.tools, [props.node.key])\n\treturn (\n\t\t<section class=\"node\" data-testid={`state-${props.node.key}`}>\n\t\t\t{`familyMembers` in props.node ? (\n\t\t\t\t<>\n\t\t\t\t\t<header>\n\t\t\t\t\t\t<button\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\taria-expanded={open()}\n\t\t\t\t\t\t\tdata-testid={`open-close-state-family-${props.node.key}`}\n\t\t\t\t\t\t\tonClick={toggle}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{open() ? `▾` : `▸`}\n\t\t\t\t\t\t</button>\n\t\t\t\t\t\t<h2>{props.node.key}</h2>\n\t\t\t\t\t\t<small>family</small>\n\t\t\t\t\t</header>\n\t\t\t\t\t{open()\n\t\t\t\t\t\t? [...props.node.familyMembers.values()].map((token) => (\n\t\t\t\t\t\t\t\t<StateLeaf key={token.key} tools={props.tools} token={token} />\n\t\t\t\t\t\t\t))\n\t\t\t\t\t\t: null}\n\t\t\t\t</>\n\t\t\t) : (\n\t\t\t\t<StateLeaf tools={props.tools} token={props.node} />\n\t\t\t)}\n\t\t</section>\n\t)\n}\nfunction StateLeaf(props: { tools: Tools; token: Token }): VNode {\n\tconst read = useValue(props.token)\n\tconst writable = !props.token.type.startsWith(`readonly`)\n\tconst set = writable\n\t\t? useSetter(props.token as WritableToken<unknown, any, any>)\n\t\t: undefined\n\tconst value = () => {\n\t\ttry {\n\t\t\treturn read()\n\t\t} catch (error) {\n\t\t\treturn error\n\t\t}\n\t}\n\treturn (\n\t\t<section class=\"state-leaf\" data-testid={`state-value-${props.token.key}`}>\n\t\t\t<JsonEditor\n\t\t\t\tlabel={<h3>{props.token.family?.subKey ?? props.token.key}</h3>}\n\t\t\t\tactions={\n\t\t\t\t\tprops.token.family ? (\n\t\t\t\t\t\t<button\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\taria-label={`Dispose ${props.token.key}`}\n\t\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\t\tprops.tools.attempt(() => {\n\t\t\t\t\t\t\t\t\tdisposeFromStore(props.tools.store, props.token)\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t×\n\t\t\t\t\t\t</button>\n\t\t\t\t\t) : null\n\t\t\t\t}\n\t\t\t\ttools={props.tools}\n\t\t\t\tvalue={value()}\n\t\t\t\tchange={\n\t\t\t\t\tset\n\t\t\t\t\t\t? (update) => {\n\t\t\t\t\t\t\t\t// Validate edits before opening an atom.io write operation.\n\t\t\t\t\t\t\t\tconst next = update(read())\n\t\t\t\t\t\t\t\tset(() => next)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t: undefined\n\t\t\t\t}\n\t\t\t\tpath={\n\t\t\t\t\tprops.token.family\n\t\t\t\t\t\t? [props.token.family.key, props.token.family.subKey]\n\t\t\t\t\t\t: [props.token.key]\n\t\t\t\t}\n\t\t\t/>\n\t\t</section>\n\t)\n}\nexport function TransactionIndex(props: { tools: Tools }): VNode {\n\tconst index = useValue(props.tools.transactionIndex)\n\tconst visible = () =>\n\t\tindex().filter((token) => !isReservedIntrospectionKey(token.key))\n\treturn (\n\t\t<article class=\"index\" data-testid=\"transaction-index\">\n\t\t\t{visible().length === 0 ? (\n\t\t\t\t<p>(no transactions)</p>\n\t\t\t) : (\n\t\t\t\tvisible().map((token) => (\n\t\t\t\t\t<TransactionLog key={token.key} tools={props.tools} token={token} />\n\t\t\t\t))\n\t\t\t)}\n\t\t</article>\n\t)\n}\nfunction TransactionLog(props: {\n\ttools: Tools\n\ttoken: TransactionToken<any>\n}): VNode {\n\tconst log = useValue(\n\t\tfindInStore(\n\t\t\tprops.tools.store,\n\t\t\tprops.tools.transactionLogSelectors,\n\t\t\tprops.token.key,\n\t\t),\n\t)\n\tconst [open, toggle] = useExpanded(props.tools, [props.token.key])\n\treturn (\n\t\t<section class=\"node\" data-testid={`transaction-${props.token.key}`}>\n\t\t\t<header>\n\t\t\t\t<button\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\taria-expanded={open()}\n\t\t\t\t\tdata-testid={`open-close-transaction-${props.token.key}`}\n\t\t\t\t\tonClick={toggle}\n\t\t\t\t>\n\t\t\t\t\t{open() ? `▾` : `▸`}\n\t\t\t\t</button>\n\t\t\t\t<h2>{props.token.key}</h2>\n\t\t\t\t<small>({log().length})</small>\n\t\t\t</header>\n\t\t\t{open()\n\t\t\t\t? log().map((event, index) => (\n\t\t\t\t\t\t<EventView\n\t\t\t\t\t\t\tkey={index}\n\t\t\t\t\t\t\ttools={props.tools}\n\t\t\t\t\t\t\tevent={event}\n\t\t\t\t\t\t\tindex={index}\n\t\t\t\t\t\t/>\n\t\t\t\t\t))\n\t\t\t\t: null}\n\t\t</section>\n\t)\n}\n// Events are recursive discriminated records, including user-defined transaction outputs.\nexport function EventView(props: {\n\ttools: Tools\n\tevent: any\n\tindex: number\n}): VNode {\n\tconst [open, toggle] = useExpanded(\n\t\tprops.tools,\n\t\t[`event`, props.event.token?.key ?? ``, String(props.index)],\n\t\ttrue,\n\t)\n\treturn (\n\t\t<section\n\t\t\tclass=\"event\"\n\t\t\tdata-testid={`${props.event.type === `transaction_outcome` ? `transaction` : `timeline`}-update-${props.event.token?.key}-${props.index}`}\n\t\t>\n\t\t\t<header>\n\t\t\t\t<button type=\"button\" aria-expanded={open()} onClick={toggle}>\n\t\t\t\t\t{open() ? `▾` : `▸`}\n\t\t\t\t</button>\n\t\t\t\t<strong>{props.event.token?.key}</strong>\n\t\t\t\t<small>{props.event.type}</small>\n\t\t\t</header>\n\t\t\t{open() ? (\n\t\t\t\tprops.event.type === `transaction_outcome` ? (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\tparams: <code>{describe(props.event.params)}</code>\n\t\t\t\t\t\t</p>\n\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\toutput: <code>{describe(props.event.output)}</code>\n\t\t\t\t\t\t</p>\n\t\t\t\t\t\t<section class=\"impact\">\n\t\t\t\t\t\t\t{props.event.subEvents.map((event: any, index: number) => (\n\t\t\t\t\t\t\t\t<EventView\n\t\t\t\t\t\t\t\t\tkey={index}\n\t\t\t\t\t\t\t\t\ttools={props.tools}\n\t\t\t\t\t\t\t\t\tevent={event}\n\t\t\t\t\t\t\t\t\tindex={index}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t</section>\n\t\t\t\t\t</>\n\t\t\t\t) : props.event.update ? (\n\t\t\t\t\t<p>\n\t\t\t\t\t\t<del>{describe(props.event.update.oldValue)}</del> →{` `}\n\t\t\t\t\t\t<ins>{describe(props.event.update.newValue)}</ins>\n\t\t\t\t\t</p>\n\t\t\t\t) : (\n\t\t\t\t\t<code>{describe(props.event)}</code>\n\t\t\t\t)\n\t\t\t) : null}\n\t\t</section>\n\t)\n}\nexport function TimelineIndex(props: { tools: Tools }): VNode {\n\tconst index = useValue(props.tools.timelineIndex)\n\tconst groups = () => {\n\t\tconst result = new Map<string, TimelineToken<any>[]>()\n\t\tfor (const token of index()) {\n\t\t\tif (isReservedIntrospectionKey(token.key) || token.key.startsWith(`👁‍🗨`))\n\t\t\t\tcontinue\n\t\t\tconst key = token.family?.key ?? ``\n\t\t\tconst members = result.get(key) ?? []\n\t\t\tmembers.push(token)\n\t\t\tresult.set(key, members)\n\t\t}\n\t\treturn [...result]\n\t}\n\treturn (\n\t\t<article class=\"index\" data-testid=\"timeline-index\">\n\t\t\t{groups().length === 0 ? (\n\t\t\t\t<p>(no timelines)</p>\n\t\t\t) : (\n\t\t\t\tgroups().map(([family, members]) => (\n\t\t\t\t\t<section\n\t\t\t\t\t\tkey={family}\n\t\t\t\t\t\tdata-testid={family ? `timeline-family-${family}` : undefined}\n\t\t\t\t\t>\n\t\t\t\t\t\t{family ? <h2>{family}</h2> : null}\n\t\t\t\t\t\t{members.map((token) => (\n\t\t\t\t\t\t\t<TimelineLog key={token.key} tools={props.tools} token={token} />\n\t\t\t\t\t\t))}\n\t\t\t\t\t</section>\n\t\t\t\t))\n\t\t\t)}\n\t\t</article>\n\t)\n}\nfunction TimelineLog(props: { tools: Tools; token: TimelineToken<any> }): VNode {\n\tconst controls = useTimeline(props.token)\n\tconst log = useValue(\n\t\tfindInStore(\n\t\t\tprops.tools.store,\n\t\t\tprops.tools.timelineSelectors,\n\t\t\tprops.token.key,\n\t\t),\n\t)\n\tconst [open, toggle] = useExpanded(props.tools, [props.token.key])\n\treturn (\n\t\t<section class=\"node\" data-testid={`timeline-${props.token.key}`}>\n\t\t\t<header>\n\t\t\t\t<button\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\taria-expanded={open()}\n\t\t\t\t\tdata-testid={`open-close-timeline-${props.token.key}`}\n\t\t\t\t\tonClick={toggle}\n\t\t\t\t>\n\t\t\t\t\t{open() ? `▾` : `▸`}\n\t\t\t\t</button>\n\t\t\t\t<h2>{props.token.family?.subKey ?? props.token.key}</h2>\n\t\t\t\t<small>\n\t\t\t\t\t({controls().at}/{controls().length})\n\t\t\t\t</small>\n\t\t\t\t<button\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\tdisabled={controls().at === 0}\n\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\tprops.tools.attempt(controls().undo)\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\tundo\n\t\t\t\t</button>\n\t\t\t\t<button\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\tdisabled={controls().at === controls().length}\n\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\tprops.tools.attempt(controls().redo)\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\tredo\n\t\t\t\t</button>\n\t\t\t</header>\n\t\t\t{open() ? (\n\t\t\t\t<section>\n\t\t\t\t\t{log().history.map((event, index) => (\n\t\t\t\t\t\t<section key={index}>\n\t\t\t\t\t\t\t{index === log().at ? (\n\t\t\t\t\t\t\t\t<p class=\"you-are-here\">you are here</p>\n\t\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t\t<EventView tools={props.tools} event={event} index={index} />\n\t\t\t\t\t\t</section>\n\t\t\t\t\t))}\n\t\t\t\t\t{log().at === log().history.length ? (\n\t\t\t\t\t\t<p class=\"you-are-here\">you are here</p>\n\t\t\t\t\t) : null}\n\t\t\t\t</section>\n\t\t\t) : null}\n\t\t</section>\n\t)\n}\n","import type { VNode } from \"@atom.io/spa\"\nimport { onCleanup, onMount, render, useValue } from \"@atom.io/spa\"\nimport type { RootStore } from \"atom.io/internal\"\nimport { IMPLICIT } from \"atom.io/internal\"\n\nimport { StateIndex, TimelineIndex, TransactionIndex } from \"./Indexes.tsx\"\nimport { useLocal, useSaved, useTools } from \"./store.ts\"\n\nexport interface AtomIODevtoolsProps {\n\t/** Inspected store. Fixed for this component instance; change its key to replace it. */\n\tstore?: RootStore\n\thideByDefault?: boolean\n}\n/** Owns a rendering root in the inspected store, independently of its parent island. */\nexport function AtomIODevtools(props: AtomIODevtoolsProps): VNode {\n\tlet host: HTMLElement | null = null\n\tconst attach = (element: HTMLElement | null) => {\n\t\thost = element\n\t}\n\tonMount(() => {\n\t\tconst store = props.store ?? IMPLICIT.STORE\n\t\tconst root = render(\n\t\t\t() => <Panel store={store} hideByDefault={props.hideByDefault ?? false} />,\n\t\t\thost!,\n\t\t\t{ store },\n\t\t)\n\t\tonCleanup(root.dispose)\n\t})\n\treturn <spa-devtools ref={attach} />\n}\nconst VIEWS = [`atoms`, `selectors`, `transactions`, `timelines`] as const\ntype View = (typeof VIEWS)[number]\nfunction Panel(props: { store: RootStore; hideByDefault: boolean }): VNode {\n\tconst tools = useTools(props.store)\n\tconst [hidden, setHidden] = useSaved(\n\t\tprops.store,\n\t\t`🔍 Devtools Are Hidden`,\n\t\tprops.hideByDefault,\n\t)\n\tconst [open, setOpen] = useSaved(props.store, `🔍 Devtools Are Open`, true)\n\tconst [selection, setSelection] = useSaved<string>(\n\t\tprops.store,\n\t\t`🔍 Devtools View`,\n\t\t`atoms`,\n\t)\n\tconst view = () =>\n\t\tVIEWS.includes(selection() as View) ? (selection() as View) : `atoms`\n\tconst [position, setPosition] = useLocal(props.store, { x: 0, y: 0 })\n\tconst error = useValue(tools.error)\n\tlet panel: HTMLElement | null = null\n\tconst attach = (element: HTMLElement | null) => {\n\t\tpanel = element\n\t}\n\tlet drag:\n\t\t| { id: number; startX: number; startY: number; x: number; y: number }\n\t\t| undefined\n\tonMount(() => {\n\t\tconst shortcut = (event: KeyboardEvent) => {\n\t\t\tif (event.ctrlKey && event.shiftKey && event.code === `KeyA`) {\n\t\t\t\tevent.preventDefault()\n\t\t\t\tsetHidden((value) => !value)\n\t\t\t}\n\t\t}\n\t\tconst reset = () => {\n\t\t\tsetPosition({ x: 0, y: 0 })\n\t\t}\n\t\tdocument.addEventListener(`keydown`, shortcut)\n\t\twindow.addEventListener(`resize`, reset)\n\t\tonCleanup(() => {\n\t\t\tdocument.removeEventListener(`keydown`, shortcut)\n\t\t\twindow.removeEventListener(`resize`, reset)\n\t\t})\n\t})\n\treturn (\n\t\t<main\n\t\t\tref={attach}\n\t\t\tdata-css=\"spa-devtools\"\n\t\t\tdata-testid=\"atom-io-devtools\"\n\t\t\thidden={hidden()}\n\t\t\tdata-open={open()}\n\t\t\tstyle={`transform:translate(${position().x}px,${position().y}px)`}\n\t\t>\n\t\t\t<header class=\"toolbar\">\n\t\t\t\t<button\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\tclass=\"drag-handle\"\n\t\t\t\t\taria-label=\"Move debugger\"\n\t\t\t\t\ttitle=\"Drag to move; arrow keys to nudge\"\n\t\t\t\t\tonPointerdown={(event) => {\n\t\t\t\t\t\tif (event.button !== 0) return\n\t\t\t\t\t\tdrag = {\n\t\t\t\t\t\t\tid: event.pointerId,\n\t\t\t\t\t\t\tstartX: event.clientX,\n\t\t\t\t\t\t\tstartY: event.clientY,\n\t\t\t\t\t\t\t...position(),\n\t\t\t\t\t\t}\n\t\t\t\t\t\t;(event.currentTarget as HTMLElement).setPointerCapture(\n\t\t\t\t\t\t\tevent.pointerId,\n\t\t\t\t\t\t)\n\t\t\t\t\t}}\n\t\t\t\t\tonPointermove={(event) => {\n\t\t\t\t\t\tif (!drag || drag.id !== event.pointerId || !panel) return\n\t\t\t\t\t\tconst rect = panel.getBoundingClientRect()\n\t\t\t\t\t\tconst next = {\n\t\t\t\t\t\t\tx: drag.x + event.clientX - drag.startX,\n\t\t\t\t\t\t\ty: drag.y + event.clientY - drag.startY,\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnext.x = Math.max(\n\t\t\t\t\t\t\tposition().x - rect.left,\n\t\t\t\t\t\t\tMath.min(next.x, position().x + window.innerWidth - rect.right),\n\t\t\t\t\t\t)\n\t\t\t\t\t\tnext.y = Math.max(\n\t\t\t\t\t\t\tposition().y - rect.top,\n\t\t\t\t\t\t\tMath.min(next.y, position().y + window.innerHeight - rect.bottom),\n\t\t\t\t\t\t)\n\t\t\t\t\t\tsetPosition(next)\n\t\t\t\t\t}}\n\t\t\t\t\tonPointerup={() => {\n\t\t\t\t\t\tdrag = undefined\n\t\t\t\t\t}}\n\t\t\t\t\tonPointercancel={() => {\n\t\t\t\t\t\tdrag = undefined\n\t\t\t\t\t}}\n\t\t\t\t\tonKeydown={(event) => {\n\t\t\t\t\t\tconst step = {\n\t\t\t\t\t\t\tArrowLeft: [-10, 0],\n\t\t\t\t\t\t\tArrowRight: [10, 0],\n\t\t\t\t\t\t\tArrowUp: [0, -10],\n\t\t\t\t\t\t\tArrowDown: [0, 10],\n\t\t\t\t\t\t}[event.key]\n\t\t\t\t\t\tif (step) {\n\t\t\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\t\t\tsetPosition(({ x, y }) => ({ x: x + step[0], y: y + step[1] }))\n\t\t\t\t\t\t}\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t⠿\n\t\t\t\t</button>\n\t\t\t\t<h1>atom.io</h1>\n\t\t\t\t{open() ? (\n\t\t\t\t\t<nav aria-label=\"Debugger views\">\n\t\t\t\t\t\t{VIEWS.map((name) => (\n\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\taria-pressed={view() === name}\n\t\t\t\t\t\t\t\tdata-testid={`view-${name}`}\n\t\t\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\t\t\tsetSelection(name)\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{name}\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t))}\n\t\t\t\t\t</nav>\n\t\t\t\t) : null}\n\t\t\t\t<button\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\taria-label={open() ? `Minimize debugger` : `Open debugger`}\n\t\t\t\t\tdata-testid=\"open-close-devtools\"\n\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\tsetOpen((value) => !value)\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t{open() ? `−` : `🔍`}\n\t\t\t\t</button>\n\t\t\t\t<button\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\taria-label=\"Hide debugger (Ctrl+Shift+A)\"\n\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\tsetHidden(true)\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t×\n\t\t\t\t</button>\n\t\t\t</header>\n\t\t\t{open() ? (\n\t\t\t\t<>\n\t\t\t\t\t{error() ? <p role=\"alert\">{error()}</p> : null}\n\t\t\t\t\t{view() === `atoms` || view() === `selectors` ? (\n\t\t\t\t\t\t<StateIndex\n\t\t\t\t\t\t\tkey={view()}\n\t\t\t\t\t\t\ttools={tools}\n\t\t\t\t\t\t\ttype={view() as `atoms` | `selectors`}\n\t\t\t\t\t\t/>\n\t\t\t\t\t) : view() === `transactions` ? (\n\t\t\t\t\t\t<TransactionIndex tools={tools} />\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<TimelineIndex tools={tools} />\n\t\t\t\t\t)}\n\t\t\t\t</>\n\t\t\t) : null}\n\t\t</main>\n\t)\n}\n"],"mappings":";;;;;AAaA,MAAM,yBAAS,IAAI,QAA4D;AAC/E,MAAM,gCAAgB,IAAI,QAAwC;AASlE,SAAgB,UAAa,OAAkB,SAAiC;CAC/E,IAAI,SAAS,OAAO,IAAI,KAAK;CAC7B,IAAI,CAAC,QAAQ;EACZ,SAAS,wBAAgD,OAAO;GAC/D,KAAK;GACL,SAAS,KAAA;EACV,CAAC;EACD,OAAO,IAAI,OAAO,MAAM;CACzB;CACA,MAAM,QAAQ,YAAY,OAAO,QAAQ,MAAM,CAAC;CAChD,aAAa,OAAO,OAAO,OAAO;CAClC,gBAAgB;EACf,iBAAiB,OAAO,KAAK;CAC9B,CAAC;CACD,OAAO;AACR;AACA,SAAgB,SACf,OACA,SAC+C;CAC/C,MAAM,QAAQ,UAAU,OAAO,OAAO;CAC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KAAA,eAAA;KAAA,kBAE3C;MACd,SAAS,UAAU,CAAC,KAAK;KAC1B;KAAC,gBAEA,KAAK,IAAI,MAAM;IAAI,CAAA;IAErBA,IAAA,UAAA;KAAA,QAAA;KAAA,cAAA;KAAA,kBAGgB;MACd,UAAU,IAAI;KACf;KAAC,UAAA;IAAA,CAAA;GAGO;EAAA,CAAA,SAET,KAAK,IACLA,IAAA,MAAA,EAAA,UAAA,OACE,MAAM,IAAIA,IAAA,KAAA;GAAA,QAAA;GAAA,gBAAiB,MAAM;EAAC,CAAA,IAAQ,YAC1C,KAAK,MAAM,WAAW,KAAK,MAAM,cACjCA,IAAA,YAAA;GAAA,OACM,KAAK;GAAC,IAAA,UAAA;IAAA,OACJ;GAAK;GAAA,IAAA,SAAA;IAAA,OACN,KAAK;GAA0B;EAAA,CAAA,IAEnC,KAAK,MAAM,iBACdA,IAAA,kBAAA,EAAA,IAAA,UAAA;GAAA,OAAyB;EAAK,EAAA,CAAA,IAE9BA,IAAA,eAAA,EAAA,IAAA,UAAA;GAAA,OAAsB;EAAK,EAAA,CAAA,CAC3B,EAAA,CAAA,IAEC,IAAI;CAAA,CAAA;AAGX"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atom.io/spa-devtools",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "description": "Atom.io's debugger, rendered with spa.",
5
5
  "homepage": "https://github.com/jeremybanka/atom.io/tree/main/packages/spa-devtools#readme",
6
6
  "repository": {
@@ -32,17 +32,17 @@
32
32
  "src"
33
33
  ],
34
34
  "devDependencies": {
35
- "@atom.io/spa": "0.0.1",
35
+ "@atom.io/spa": "0.0.2",
36
36
  "@breakage/changesets": "0.1.0",
37
37
  "@types/node": "26.6.6",
38
- "@vitest/coverage-v8": "5.0.5",
38
+ "@vitest/coverage-v8": "5.1.0",
39
39
  "atom.io": "0.54.3",
40
40
  "breakage": "0.10.1",
41
- "eslint": "10.13.0",
41
+ "eslint": "10.14.0",
42
42
  "happy-dom": "21.0.4",
43
43
  "tsdown": "0.23.4",
44
44
  "typescript": "7.0.2",
45
- "vitest": "5.0.5"
45
+ "vitest": "5.1.0"
46
46
  },
47
47
  "peerDependencies": {
48
48
  "@atom.io/spa": ">=0.0.0 <0.2.0",