@graphysdk/react-renderer 1.9.0-beta.1788803137845 → 1.9.0-beta.1788852065633

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/dist/index.mjs CHANGED
@@ -1,31 +1,31 @@
1
- import { Ct as kt, Ft as re, It as A, M as Dt, Mt as $t, Nt as xt, O as Ht, Pt as de, St as le, Tt as Mt, X as Pt, Y as Lt, _ as Bt, _t as ue, a as Kt, bt as me, ct as Ot, gt as K, i as At, it as jt, j as Yt, jt as Ft, k as Ut, lt as Wt, mt as Vt, n as Xt, pt as Qt, r as zt, rt as Jt, s as Zt, t as ge, tt as er, vt as tr, wt as rr, xt as nr, yt as j } from "./history-chords-DdWu-GiG.js";
2
- import { d as or, t as he } from "./dev.utils-DZcwQpSI.js";
3
- import { COMPILER_STAGE_KEYS as Y, Geom as pe, GraphCompilationSession as fe, areEditTargetsEqual as ve, buildDiagnostic as V, createAnchorResolver as ye, createCompiler as Se, createGraphyBuilder as be, findAnnotation as Ee, isCompilerCachingEnabled as Te, resolveDefinition as Ce, setCompilerCachingEnabled as Ne, toPercent as M } from "@graphysdk/viz-engine";
4
- import { Component as Re, useCallback as f, useEffect as $, useId as qe, useImperativeHandle as Ge, useMemo as L, useRef as X, useState as C, useSyncExternalStore as we } from "react";
5
- import { Fragment as Ie, jsx as d, jsxs as v } from "react/jsx-runtime";
6
- import { useStore as Q } from "zustand";
1
+ import { Ct as It, Ft as te, It as O, M as _t, Mt as Dt, Nt as $t, O as xt, Pt as de, St as le, Tt as Ht, X as Mt, Y as Pt, _ as Lt, _t as ue, a as Bt, bt as me, ct as Kt, gt as B, i as Ot, it as At, j as jt, jt as Ft, k as Ut, lt as Yt, mt as Wt, n as Vt, pt as Xt, r as Qt, rt as zt, s as Jt, t as ge, tt as Zt, vt as er, wt as tr, xt as rr, yt as A } from "./history-chords-x0wqKMIO.js";
2
+ import { d as sr, t as he } from "./dev.utils-BWIxakWj.js";
3
+ import { COMPILER_STAGE_KEYS as j, Geom as pe, GraphCompilationSession as fe, areEditTargetsEqual as ve, buildDiagnostic as W, createAnchorResolver as ye, createCompiler as be, createGraphyBuilder as Se, findAnnotation as Ee, isCompilerCachingEnabled as Ce, resolveDefinition as Te, setCompilerCachingEnabled as Ne, toPercent as M } from "@graphysdk/viz-engine";
4
+ import { Component as Re, useCallback as f, useEffect as D, useId as qe, useImperativeHandle as Ge, useMemo as L, useRef as V, useState as C, useSyncExternalStore as we } from "react";
5
+ import { Fragment as ke, jsx as d, jsxs as v } from "react/jsx-runtime";
6
+ import { useStore as X } from "zustand";
7
7
  import { createStore as F } from "zustand/vanilla";
8
- import _e from "clsx";
9
- import './index.css';var ke = "_1a5iqpb0", De = "_1a5iqpb1";
8
+ import Ie from "clsx";
9
+ import './index.css';var _e = "_1a5iqpb0", De = "_1a5iqpb1";
10
10
  var $e = "_1a5iqpb3", xe = "_1a5iqpb4", He = "_1a5iqpb5";
11
- var z = ({ errors: e }) => {
11
+ var Q = ({ errors: e }) => {
12
12
  const [t, ...r] = e;
13
13
  return /* @__PURE__ */ v("div", {
14
14
  role: "alert",
15
- className: ke,
15
+ className: _e,
16
16
  children: [
17
17
  /* @__PURE__ */ d("strong", {
18
18
  className: De,
19
19
  children: "This chart could not be rendered."
20
20
  }),
21
- t && /* @__PURE__ */ d(J, { diagnostic: t }),
21
+ t && /* @__PURE__ */ d(z, { diagnostic: t }),
22
22
  r.length > 0 && /* @__PURE__ */ d("ul", {
23
23
  className: "_1a5iqpb2",
24
- children: r.map((n, o) => /* @__PURE__ */ d("li", { children: /* @__PURE__ */ d(J, { diagnostic: n }) }, `${n.code}-${o}`))
24
+ children: r.map((n, o) => /* @__PURE__ */ d("li", { children: /* @__PURE__ */ d(z, { diagnostic: n }) }, `${n.code}-${o}`))
25
25
  })
26
26
  ]
27
27
  });
28
- }, J = ({ diagnostic: e }) => /* @__PURE__ */ v("div", {
28
+ }, z = ({ diagnostic: e }) => /* @__PURE__ */ v("div", {
29
29
  className: $e,
30
30
  children: [
31
31
  /* @__PURE__ */ d("span", {
@@ -50,39 +50,39 @@ var Pe = class extends Re {
50
50
  super(...e), this.state = { caughtDiagnostic: null };
51
51
  }
52
52
  static getDerivedStateFromError(e) {
53
- return { caughtDiagnostic: V(e) };
53
+ return { caughtDiagnostic: W(e) };
54
54
  }
55
55
  componentDidCatch(e, t) {
56
- const r = V(e);
57
- A([r]), this.props.onError?.([r]), console.error("Chart render component stack:", t.componentStack);
56
+ const r = W(e);
57
+ O([r]), this.props.onError?.([r]), console.error("Chart render component stack:", t.componentStack);
58
58
  }
59
59
  componentDidUpdate(e) {
60
60
  this.state.caughtDiagnostic && !Me(e.resetKeys, this.props.resetKeys) && this.setState({ caughtDiagnostic: null });
61
61
  }
62
62
  render() {
63
63
  const { caughtDiagnostic: e } = this.state;
64
- if (e) return /* @__PURE__ */ d(z, { errors: [e] });
64
+ if (e) return /* @__PURE__ */ d(Q, { errors: [e] });
65
65
  const { forcedErrors: t, children: r } = this.props;
66
- return t && t.length > 0 ? /* @__PURE__ */ d(z, { errors: t }) : r;
66
+ return t && t.length > 0 ? /* @__PURE__ */ d(Q, { errors: t }) : r;
67
67
  }
68
- }, ne = (e) => typeof e == "object" && "geom" in e && "render" in e, Le = (e) => {
69
- const t = Ce(e);
68
+ }, re = (e) => typeof e == "object" && "geom" in e && "render" in e, Le = (e) => {
69
+ const t = Te(e);
70
70
  return t instanceof pe ? t : null;
71
71
  }, Be = (e, t) => {
72
72
  const r = e.filter((n) => Ke(n, t));
73
73
  return r.length === e.length ? e : r;
74
- }, Ke = (e, t) => e.kind !== "annotation" ? !0 : Ee(t.annotations, e.id) !== null, Z = [], Oe = () => F((e) => ({
75
- selection: Z,
74
+ }, Ke = (e, t) => e.kind !== "annotation" ? !0 : Ee(t.annotations, e.id) !== null, J = [], Oe = () => F((e) => ({
75
+ selection: J,
76
76
  setSelection: (t) => e((r) => Ae(r.selection, t) ? r : { selection: t }),
77
- clearSelection: () => e((t) => t.selection.length === 0 ? t : { selection: Z })
77
+ clearSelection: () => e((t) => t.selection.length === 0 ? t : { selection: J })
78
78
  })), Ae = (e, t) => e === t ? !0 : e.length !== t.length ? !1 : e.every((r, n) => {
79
79
  const o = t[n];
80
80
  return o !== void 0 && ve(r, o);
81
- }), je = 5, Ye = (e) => {
81
+ }), je = 5, Fe = (e) => {
82
82
  if (!he) return {
83
83
  emit: () => {
84
84
  },
85
- subscribe: () => Ue,
85
+ subscribe: () => Ye,
86
86
  getLastTrigger: () => null,
87
87
  getLastCompile: () => null,
88
88
  getCacheStats: () => e.getCacheStats()
@@ -104,7 +104,7 @@ var Pe = class extends Re {
104
104
  getLastCompile: () => e.getLastCompile(),
105
105
  getCacheStats: () => e.getCacheStats()
106
106
  };
107
- }, Fe = () => F((e) => ({
107
+ }, Ue = () => F((e) => ({
108
108
  lastCompile: null,
109
109
  history: [],
110
110
  nextId: 1,
@@ -124,7 +124,7 @@ var Pe = class extends Re {
124
124
  lastSnapshot: r
125
125
  };
126
126
  })
127
- })), Ue = () => {
127
+ })), Ye = () => {
128
128
  }, We = (e) => {
129
129
  switch (e.kind) {
130
130
  case "init":
@@ -141,43 +141,43 @@ var Pe = class extends Re {
141
141
  return [...e.slice(n), t];
142
142
  };
143
143
  function Xe(e) {
144
- const t = e.filter(ne), r = /* @__PURE__ */ new Set([...Object.keys(me), ...t.map((c) => c.geom)]), n = [], o = /* @__PURE__ */ new Set();
144
+ const t = e.filter(re), r = /* @__PURE__ */ new Set([...Object.keys(me), ...t.map((c) => c.geom)]), n = [], o = /* @__PURE__ */ new Set();
145
145
  for (const c of e) {
146
- const l = Le(c);
147
- l === null || r.has(l.type) || o.has(l.type) || (o.add(l.type), n.push({
146
+ const u = Le(c);
147
+ u === null || r.has(u.type) || o.has(u.type) || (o.add(u.type), n.push({
148
148
  kind: "user-input",
149
149
  severity: "error",
150
150
  code: "MISSING_GEOM_RENDERER",
151
- message: `Custom geom '${l.type}' is registered but has no renderer.`,
151
+ message: `Custom geom '${u.type}' is registered but has no renderer.`,
152
152
  context: {
153
- requested: l.type,
153
+ requested: u.type,
154
154
  kind: "geom-renderer"
155
155
  },
156
- suggestion: `Add a render half for it: \`defineGeomRenderer(${l.type}Geom, { coord, render })\`, then include it in \`plugins\`.`
156
+ suggestion: `Add a render half for it: \`defineGeomRenderer(${u.type}Geom, { coord, render })\`, then include it in \`plugins\`.`
157
157
  }));
158
158
  }
159
159
  const a = /* @__PURE__ */ new Map();
160
160
  for (const c of t) {
161
161
  if ("definition" in c) continue;
162
- const l = `${c.geom}|${c.coord}`, h = a.get(l);
163
- h ? h.count += 1 : a.set(l, {
162
+ const u = `${c.geom}|${c.coord}`, h = a.get(u);
163
+ h ? h.count += 1 : a.set(u, {
164
164
  geom: c.geom,
165
165
  coord: c.coord,
166
166
  count: 1
167
167
  });
168
168
  }
169
169
  const i = [];
170
- for (const { geom: c, coord: l, count: h } of a.values())
170
+ for (const { geom: c, coord: u, count: h } of a.values())
171
171
  h < 2 || i.push({
172
172
  kind: "user-input",
173
173
  severity: "warning",
174
174
  code: "DUPLICATE_REGISTERED_TYPE",
175
- message: `Multiple render-only overrides register ('${c}', '${l}') (${h} entries); the last in the array wins.`,
175
+ message: `Multiple render-only overrides register ('${c}', '${u}') (${h} entries); the last in the array wins.`,
176
176
  context: {
177
- requested: `${c}@${l}`,
177
+ requested: `${c}@${u}`,
178
178
  kind: "geom-renderer"
179
179
  },
180
- suggestion: `Keep a single render-only override for ('${c}', '${l}').`
180
+ suggestion: `Keep a single render-only override for ('${c}', '${u}').`
181
181
  });
182
182
  return {
183
183
  errors: n,
@@ -205,7 +205,7 @@ function ze(e, t) {
205
205
  for (const i of n) {
206
206
  if (i.interactive === !1 || i.spatialKind !== "render-hit-test" || o.has(i.geom)) continue;
207
207
  const c = t(i.geom, r.type);
208
- c === null || c.hitTest || j(c) || (o.add(i.geom), a.push({
208
+ c === null || c.hitTest || A(c) || (o.add(i.geom), a.push({
209
209
  kind: "user-input",
210
210
  severity: "warning",
211
211
  code: "MISSING_RENDER_HIT_TEST",
@@ -242,7 +242,7 @@ function Ze(e, t) {
242
242
  for (const i of n) {
243
243
  if (i.interactive === !1 || i.spatialKind !== "render-hit-test" || o.has(i.geom)) continue;
244
244
  const c = t(i.geom, r.type);
245
- c === null || !c.hitTest || !j(c) || (o.add(i.geom), a.push({
245
+ c === null || !c.hitTest || !A(c) || (o.add(i.geom), a.push({
246
246
  kind: "user-input",
247
247
  severity: "warning",
248
248
  code: "CONFLICTING_RENDER_HIT_TEST",
@@ -277,7 +277,7 @@ function tt(e, t) {
277
277
  for (const i of n) {
278
278
  if (i.interactive === !1 || i.spatialKind === "render-hit-test" || o.has(i.geom)) continue;
279
279
  const c = t(i.geom, r.type);
280
- c === null || !j(c) || (o.add(i.geom), a.push({
280
+ c === null || !A(c) || (o.add(i.geom), a.push({
281
281
  kind: "user-input",
282
282
  severity: "warning",
283
283
  code: "OVERLAY_REQUIRES_RENDER_HIT_TEST",
@@ -294,30 +294,30 @@ function tt(e, t) {
294
294
  var rt = (e) => F((t) => ({
295
295
  compiled: e,
296
296
  setCompiled: (r) => t((n) => n.compiled === r ? n : { compiled: r })
297
- })), nt = ({ input: e, data: t, customPalettes: r, colorScheme: n, plugins: o, resolveRenderer: a, anchorResolver: i, onChange: c, onError: l, onWarnings: h }) => {
298
- const T = K(c), _ = K(l), q = K(h), [{ session: g, compileBus: u }] = C(() => {
299
- const s = Se({ plugins: o });
297
+ })), nt = ({ input: e, data: t, customPalettes: r, colorScheme: n, plugins: o, resolveRenderer: a, anchorResolver: i, onChange: c, onError: u, onWarnings: h }) => {
298
+ const T = B(c), w = B(u), R = B(h), [{ session: m, compileBus: l }] = C(() => {
299
+ const s = be({ plugins: o });
300
300
  return {
301
301
  session: new fe(s),
302
- compileBus: Ye(s)
302
+ compileBus: Fe(s)
303
303
  };
304
- }), [m] = C(() => Xe(o ?? [])), y = X(null), [w] = C(st), N = X(null), S = f((s) => m.errors.length === 0 ? s : [...m.errors, ...s ?? []], [m]), k = f((s) => {
304
+ }), [g] = C(() => Xe(o ?? [])), q = V(null), [k] = C(st), y = V(null), G = f((s) => g.errors.length === 0 ? s : [...g.errors, ...s ?? []], [g]), I = f((s) => {
305
305
  if (!s.ok) return s.errors;
306
- if (N.current) N.current.getState().setCompiled(s.compiled);
306
+ if (y.current) y.current.getState().setCompiled(s.compiled);
307
307
  else {
308
308
  const p = rt(s.compiled);
309
- p.subscribe(w.notify), N.current = p, w.notify();
309
+ p.subscribe(k.notify), y.current = p, k.notify();
310
310
  }
311
311
  return null;
312
- }, [w]), [x, D] = C(() => {
313
- const s = g.compile({
312
+ }, [k]), [$, x] = C(() => {
313
+ const s = m.compile({
314
314
  input: e,
315
315
  data: t,
316
316
  customPalettes: r,
317
317
  colorScheme: n
318
318
  });
319
- return y.current = s, S(k(s));
320
- }), G = f((s) => s.ok ? [
319
+ return q.current = s, G(I(s));
320
+ }), b = f((s) => s.ok ? [
321
321
  ...s.warnings,
322
322
  ...Qe(s.compiled, a),
323
323
  ...ze(s.compiled, a),
@@ -325,22 +325,22 @@ var rt = (e) => F((t) => ({
325
325
  ...Ze(s.compiled, a),
326
326
  ...tt(s.compiled, a),
327
327
  ...et(s.compiled, i)
328
- ] : s.warnings, [a, i]), b = f((s) => {
329
- s.length !== 0 && (A(s), _.current?.(s));
330
- }, [_]), R = f((s) => {
331
- s.length !== 0 && (A(s), q.current?.(s));
332
- }, [q]);
333
- $(() => {
334
- const s = y.current;
335
- s && (b([...m.errors, ...s.ok ? [] : s.errors]), R([...m.warnings, ...G(s)]), s.ok && u.emit({ kind: "init" }));
328
+ ] : s.warnings, [a, i]), N = f((s) => {
329
+ s.length !== 0 && (O(s), w.current?.(s));
330
+ }, [w]), S = f((s) => {
331
+ s.length !== 0 && (O(s), R.current?.(s));
332
+ }, [R]);
333
+ D(() => {
334
+ const s = q.current;
335
+ s && (N([...g.errors, ...s.ok ? [] : s.errors]), S([...g.warnings, ...b(s)]), s.ok && l.emit({ kind: "init" }));
336
336
  }, [
337
- u,
338
- b,
339
- R,
340
- m,
341
- G
342
- ]), $(() => {
343
- const s = g.update({
337
+ l,
338
+ N,
339
+ S,
340
+ g,
341
+ b
342
+ ]), D(() => {
343
+ const s = m.update({
344
344
  input: e,
345
345
  data: t,
346
346
  customPalettes: r,
@@ -348,63 +348,63 @@ var rt = (e) => F((t) => ({
348
348
  });
349
349
  if (!s) return;
350
350
  s.sealedInput && T.current?.(s.sealedInput);
351
- const p = k(s.result);
352
- D(S(p)), p && b(p), R(G(s.result)), p || u.emit({ kind: s.inputChanged ? "input" : "data" });
351
+ const p = I(s.result);
352
+ x(G(p)), p && N(p), S(b(s.result)), p || l.emit({ kind: s.inputChanged ? "input" : "data" });
353
353
  }, [
354
354
  e,
355
355
  t,
356
356
  r,
357
357
  n,
358
- g,
359
- u,
360
- k,
361
- b,
362
- R,
358
+ m,
359
+ l,
360
+ I,
361
+ N,
363
362
  S,
364
363
  G,
364
+ b,
365
365
  T
366
366
  ]);
367
- const I = f((s) => {
368
- D((p) => p === null ? p : S(null)), R(G(s));
367
+ const H = f((s) => {
368
+ x((p) => p === null ? p : G(null)), S(b(s));
369
369
  }, [
370
+ G,
370
371
  S,
371
- R,
372
- G
373
- ]), H = f((s) => {
374
- s.compiled && N.current?.getState().setCompiled(s.compiled), s.result && I(s.result), s.command && u.emit({
372
+ b
373
+ ]), _ = f((s) => {
374
+ s.compiled && y.current?.getState().setCompiled(s.compiled), s.result && H(s.result), s.command && l.emit({
375
375
  kind: "command",
376
376
  command: s.command
377
- }), s.input && T.current?.(s.input), s.errors && b([...s.errors]);
377
+ }), s.input && T.current?.(s.input), s.errors && N([...s.errors]);
378
378
  }, [
379
- I,
380
- u,
379
+ H,
380
+ l,
381
381
  T,
382
- b
382
+ N
383
383
  ]), E = f((s) => {
384
- for (const p of s) H(p);
384
+ for (const p of s) _(p);
385
385
  return s.some((p) => !!p.compiled);
386
- }, [H]), B = f((s, p) => {
387
- E(g.applyCommand(s, p));
388
- }, [g, E]), ie = f(() => {
389
- E(g.seal());
390
- }, [g, E]), U = f(() => E(g.undo()), [g, E]), W = f(() => E(g.redo()), [g, E]), ae = L(() => ({
391
- stack: g.history,
386
+ }, [_]), oe = f((s, p) => {
387
+ E(m.applyCommand(s, p));
388
+ }, [m, E]), ie = f(() => {
389
+ E(m.seal());
390
+ }, [m, E]), U = f(() => E(m.undo()), [m, E]), Y = f(() => E(m.redo()), [m, E]), ae = L(() => ({
391
+ stack: m.history,
392
392
  undo: U,
393
- redo: W
393
+ redo: Y
394
394
  }), [
395
- g,
395
+ m,
396
396
  U,
397
- W
398
- ]), ce = f(() => N.current?.getState().compiled ?? null, []);
397
+ Y
398
+ ]), ce = f(() => y.current?.getState().compiled ?? null, []);
399
399
  return {
400
- store: N.current,
401
- dispatch: B,
400
+ store: y.current,
401
+ dispatch: oe,
402
402
  seal: ie,
403
403
  history: ae,
404
- subscribe: w.subscribe,
404
+ subscribe: k.subscribe,
405
405
  getCompiled: ce,
406
- compileBus: u,
407
- compileErrors: x
406
+ compileBus: l,
407
+ compileErrors: $
408
408
  };
409
409
  }, st = () => {
410
410
  const e = /* @__PURE__ */ new Set();
@@ -414,94 +414,92 @@ var rt = (e) => F((t) => ({
414
414
  }),
415
415
  notify: () => e.forEach((t) => t())
416
416
  };
417
- }, ot = {}, it = ({ data: e, input: t, plugins: r = [], formattingLocale: n, handleRef: o, onChange: a, onError: i, onWarnings: c, customPalettes: l, colorScheme: h = "light", themeOverrides: T = ot, children: _ }) => {
418
- const [q] = C(() => ue(r.filter(ne))), g = qe(), [u] = C(() => ye(r)), [m] = C(() => Oe()), { store: y, dispatch: w, seal: N, history: S, subscribe: k, getCompiled: x, compileBus: D, compileErrors: G } = nt({
417
+ }, ot = ({ data: e, input: t, plugins: r = [], formattingLocale: n, handleRef: o, onChange: a, onError: i, onWarnings: c, customPalettes: u, colorScheme: h = "light", children: T }) => {
418
+ const [w] = C(() => ue(r.filter(re))), R = qe(), [m] = C(() => ye(r)), [l] = C(() => Oe()), { store: g, dispatch: q, seal: k, history: y, subscribe: G, getCompiled: I, compileBus: $, compileErrors: x } = nt({
419
419
  input: t,
420
420
  data: e,
421
- customPalettes: l,
421
+ customPalettes: u,
422
422
  colorScheme: h,
423
423
  plugins: r,
424
- resolveRenderer: q,
425
- anchorResolver: u,
424
+ resolveRenderer: w,
425
+ anchorResolver: m,
426
426
  onChange: a,
427
427
  onError: i,
428
428
  onWarnings: c
429
429
  });
430
- $(() => {
431
- if (y)
432
- return y.subscribe((I, H) => {
433
- if (I.compiled.spec === H.compiled.spec) return;
434
- const { selection: E, setSelection: B } = m.getState();
435
- E.length !== 0 && B(Be(E, I.compiled.spec));
430
+ D(() => {
431
+ if (g)
432
+ return g.subscribe((S, H) => {
433
+ if (S.compiled.spec === H.compiled.spec) return;
434
+ const { selection: _, setSelection: E } = l.getState();
435
+ _.length !== 0 && E(Be(_, S.compiled.spec));
436
436
  });
437
- }, [y, m]);
437
+ }, [g, l]);
438
438
  const b = L(() => ({
439
- dispatch: w,
440
- seal: N
441
- }), [w, N]);
439
+ dispatch: q,
440
+ seal: k
441
+ }), [q, k]);
442
442
  Ge(o, () => ({
443
443
  commands: b,
444
- undo: S.undo,
445
- redo: S.redo,
446
- subscribe: k,
447
- getCompiled: x,
448
- getSelection: () => m.getState().selection,
449
- setSelection: (I) => m.getState().setSelection(I),
450
- subscribeSelection: m.subscribe
444
+ undo: y.undo,
445
+ redo: y.redo,
446
+ subscribe: G,
447
+ getCompiled: I,
448
+ getSelection: () => l.getState().selection,
449
+ setSelection: (S) => l.getState().setSelection(S),
450
+ subscribeSelection: l.subscribe
451
451
  }), [
452
452
  b,
453
- S,
454
- k,
455
- x,
456
- m
453
+ y,
454
+ G,
455
+ I,
456
+ l
457
457
  ]);
458
- const R = L(() => y ? {
459
- chartId: g,
460
- store: y,
461
- selectionStore: m,
458
+ const N = L(() => g ? {
459
+ chartId: R,
460
+ store: g,
461
+ selectionStore: l,
462
462
  commands: b,
463
- history: S,
463
+ history: y,
464
464
  formattingLocale: n,
465
- compileBus: D,
465
+ compileBus: $,
466
466
  colorScheme: h,
467
- themeOverrides: T,
468
- anchorResolver: u
467
+ anchorResolver: m
469
468
  } : null, [
469
+ R,
470
470
  g,
471
- y,
472
- m,
471
+ l,
473
472
  b,
474
- S,
473
+ y,
475
474
  n,
476
- D,
475
+ $,
477
476
  h,
478
- T,
479
- u
477
+ m
480
478
  ]);
481
479
  return /* @__PURE__ */ d(Pe, {
482
- forcedErrors: G,
480
+ forcedErrors: x,
483
481
  onError: i,
484
482
  resetKeys: [t, e],
485
- children: R ? /* @__PURE__ */ d(de.Provider, {
486
- value: R,
483
+ children: N ? /* @__PURE__ */ d(de.Provider, {
484
+ value: N,
487
485
  children: /* @__PURE__ */ d(le, {
488
- value: q,
489
- children: _
486
+ value: w,
487
+ children: T
490
488
  })
491
489
  }) : null
492
490
  });
493
491
  };
494
- function mr(e) {
495
- const t = be(e);
492
+ function ur(e) {
493
+ const t = Se(e);
496
494
  return {
497
495
  ...t,
498
- GraphProvider: (n) => /* @__PURE__ */ d(it, {
496
+ GraphProvider: (n) => /* @__PURE__ */ d(ot, {
499
497
  ...n,
500
498
  plugins: t.plugins
501
499
  })
502
500
  };
503
501
  }
504
- var gr = ({ children: e, ...t }) => /* @__PURE__ */ d("svg", {
502
+ var mr = ({ children: e, ...t }) => /* @__PURE__ */ d("svg", {
505
503
  viewBox: "0 0 1 1",
506
504
  preserveAspectRatio: "none",
507
505
  width: "100%",
@@ -509,7 +507,7 @@ var gr = ({ children: e, ...t }) => /* @__PURE__ */ d("svg", {
509
507
  pointerEvents: "none",
510
508
  ...t,
511
509
  children: e
512
- }), hr = ({ box: e, children: t }) => /* @__PURE__ */ d("svg", {
510
+ }), gr = ({ box: e, children: t }) => /* @__PURE__ */ d("svg", {
513
511
  x: M(e.x0),
514
512
  y: M(e.y0),
515
513
  width: M(e.x1 - e.x0),
@@ -517,49 +515,49 @@ var gr = ({ children: e, ...t }) => /* @__PURE__ */ d("svg", {
517
515
  overflow: "hidden",
518
516
  pointerEvents: "none",
519
517
  children: t
520
- }), at = "drqe3u0", ct = "drqe3u1", dt = "drqe3u2", lt = "drqe3u3", P = "drqe3u4", ut = "drqe3u5", mt = "drqe3u6", gt = "drqe3u7", O = "drqe3u8", ht = "drqe3u9", pt = "drqe3ua";
521
- var ft = "drqe3uc", vt = "drqe3ud", yt = "drqe3ue", St = "drqe3uf";
522
- var bt = "drqe3uh", Et = "drqe3ui", ee = {
518
+ }), it = "drqe3u0", at = "drqe3u1", ct = "drqe3u2", dt = "drqe3u3", P = "drqe3u4", lt = "drqe3u5", ut = "drqe3u6", mt = "drqe3u7", K = "drqe3u8", gt = "drqe3u9", ht = "drqe3ua";
519
+ var pt = "drqe3uc", ft = "drqe3ud", vt = "drqe3ue", yt = "drqe3uf";
520
+ var bt = "drqe3uh", St = "drqe3ui", Z = {
523
521
  enabled: "drqe3uk drqe3uj",
524
522
  disabled: "drqe3ul drqe3uj"
525
- }, te = {
523
+ }, ee = {
526
524
  ran: "drqe3un drqe3um",
527
525
  dim: "drqe3uo drqe3um"
528
- }, se = {
526
+ }, ne = {
529
527
  ran: "drqe3uq drqe3up",
530
528
  cached: "drqe3ur drqe3up",
531
529
  untouched: "drqe3us drqe3up"
532
- }, pr = ({ width: e = 380, style: t, className: r } = {}) => {
533
- const { compileBus: n } = re(), [o] = C(() => Fe()), [a, i] = C(!1), [c, l] = C(Te);
534
- $(() => {
535
- const { recordCompile: u } = o.getState(), m = n.getLastTrigger(), y = n.getLastCompile();
536
- return m && y && u(m, y), n.subscribe(u);
530
+ }, hr = ({ width: e = 380, style: t, className: r } = {}) => {
531
+ const { compileBus: n } = te(), [o] = C(() => Ue()), [a, i] = C(!1), [c, u] = C(Ce);
532
+ D(() => {
533
+ const { recordCompile: l } = o.getState(), g = n.getLastTrigger(), q = n.getLastCompile();
534
+ return g && q && l(g, q), n.subscribe(l);
537
535
  }, [o, n]);
538
- const h = Q(o, (u) => u.lastCompile), T = Q(o, (u) => u.history), _ = n.getCacheStats(), q = h === null && T.length === 0, g = () => {
539
- l((u) => {
540
- const m = !u;
541
- return Ne(m), m;
536
+ const h = X(o, (l) => l.lastCompile), T = X(o, (l) => l.history), w = n.getCacheStats(), R = h === null && T.length === 0, m = () => {
537
+ u((l) => {
538
+ const g = !l;
539
+ return Ne(g), g;
542
540
  });
543
541
  };
544
542
  return /* @__PURE__ */ v("div", {
545
- className: _e(pt, r),
543
+ className: Ie(ht, r),
546
544
  style: {
547
545
  width: e,
548
546
  ...t
549
547
  },
550
548
  children: [
551
549
  /* @__PURE__ */ v("div", {
552
- className: at,
550
+ className: it,
553
551
  children: [/* @__PURE__ */ v("div", { children: [/* @__PURE__ */ d("div", {
554
- className: ct,
552
+ className: at,
555
553
  children: "compile cache"
556
554
  }), /* @__PURE__ */ d("div", {
557
- className: yt,
558
- children: q ? "production: stats disabled" : h ? `last: ${h.label} · ${oe(h.durationMs)}` : "awaiting first compile…"
555
+ className: vt,
556
+ children: R ? "production: stats disabled" : h ? `last: ${h.label} · ${se(h.durationMs)}` : "awaiting first compile…"
559
557
  })] }), /* @__PURE__ */ d("button", {
560
558
  type: "button",
561
- onClick: () => i((u) => !u),
562
- className: St,
559
+ onClick: () => i((l) => !l),
560
+ className: yt,
563
561
  children: a ? "▾" : "▴"
564
562
  })]
565
563
  }),
@@ -567,8 +565,8 @@ var bt = "drqe3uh", Et = "drqe3ui", ee = {
567
565
  className: "drqe3ub",
568
566
  children: [/* @__PURE__ */ v("button", {
569
567
  type: "button",
570
- onClick: g,
571
- className: c ? ee.enabled : ee.disabled,
568
+ onClick: m,
569
+ className: c ? Z.enabled : Z.disabled,
572
570
  "aria-pressed": c,
573
571
  children: ["cache ", c ? "enabled" : "disabled"]
574
572
  }), /* @__PURE__ */ d("span", {
@@ -576,19 +574,19 @@ var bt = "drqe3uh", Et = "drqe3ui", ee = {
576
574
  children: "next compile reflects this toggle"
577
575
  })]
578
576
  }),
579
- !a && !q && /* @__PURE__ */ v(Ie, { children: [/* @__PURE__ */ d(Tt, {
577
+ !a && !R && /* @__PURE__ */ v(ke, { children: [/* @__PURE__ */ d(Et, {
580
578
  delta: h?.stages,
581
- cumulative: _
579
+ cumulative: w
582
580
  }), /* @__PURE__ */ d(Ct, { entries: T })] })
583
581
  ]
584
582
  });
585
- }, Tt = ({ delta: e, cumulative: t }) => /* @__PURE__ */ v("table", {
586
- className: dt,
583
+ }, Et = ({ delta: e, cumulative: t }) => /* @__PURE__ */ v("table", {
584
+ className: ct,
587
585
  children: [/* @__PURE__ */ d("thead", { children: /* @__PURE__ */ v("tr", {
588
586
  className: bt,
589
587
  children: [
590
588
  /* @__PURE__ */ d("th", {
591
- className: lt,
589
+ className: dt,
592
590
  children: "stage"
593
591
  }),
594
592
  /* @__PURE__ */ d("th", {
@@ -608,16 +606,16 @@ var bt = "drqe3uh", Et = "drqe3ui", ee = {
608
606
  children: "total hit"
609
607
  })
610
608
  ]
611
- }) }), /* @__PURE__ */ d("tbody", { children: Y.map((r) => {
612
- const n = e?.[r], o = Nt(n);
609
+ }) }), /* @__PURE__ */ d("tbody", { children: j.map((r) => {
610
+ const n = e?.[r], o = Tt(n);
613
611
  return /* @__PURE__ */ v("tr", {
614
- className: ft,
612
+ className: pt,
615
613
  children: [
616
614
  /* @__PURE__ */ v("td", {
617
- className: ut,
615
+ className: lt,
618
616
  children: [
619
617
  /* @__PURE__ */ d("span", {
620
- className: se[o],
618
+ className: ne[o],
621
619
  "aria-hidden": !0
622
620
  }),
623
621
  " ",
@@ -625,62 +623,62 @@ var bt = "drqe3uh", Et = "drqe3ui", ee = {
625
623
  ]
626
624
  }),
627
625
  /* @__PURE__ */ d("td", {
628
- className: o === "ran" ? te.ran : te.dim,
626
+ className: o === "ran" ? ee.ran : ee.dim,
629
627
  children: n?.misses ?? 0
630
628
  }),
631
629
  /* @__PURE__ */ d("td", {
632
- className: O,
630
+ className: K,
633
631
  children: n?.hits ?? 0
634
632
  }),
635
633
  /* @__PURE__ */ d("td", {
636
- className: O,
634
+ className: K,
637
635
  children: t[r].misses
638
636
  }),
639
637
  /* @__PURE__ */ d("td", {
640
- className: O,
638
+ className: K,
641
639
  children: t[r].hits
642
640
  })
643
641
  ]
644
642
  }, r);
645
643
  }) })]
646
644
  }), Ct = ({ entries: e }) => e.length === 0 ? null : /* @__PURE__ */ v("div", {
647
- className: vt,
645
+ className: ft,
648
646
  children: [/* @__PURE__ */ d("div", {
649
- className: Et,
647
+ className: St,
650
648
  children: "recent compiles"
651
649
  }), e.map((t) => {
652
- const r = Rt(t.stages, (a) => a.misses > 0), n = Y.length;
650
+ const r = Nt(t.stages, (a) => a.misses > 0), n = j.length;
653
651
  return /* @__PURE__ */ v("div", {
654
- className: mt,
652
+ className: ut,
655
653
  children: [
656
654
  /* @__PURE__ */ d("span", {
657
- className: se[r === 0 ? "cached" : "ran"],
655
+ className: ne[r === 0 ? "cached" : "ran"],
658
656
  "aria-hidden": !0
659
657
  }),
660
658
  /* @__PURE__ */ d("span", {
661
- className: gt,
659
+ className: mt,
662
660
  title: t.label,
663
661
  children: t.label
664
662
  }),
665
663
  /* @__PURE__ */ v("span", {
666
- className: ht,
664
+ className: gt,
667
665
  children: [
668
666
  r,
669
667
  "/",
670
668
  n,
671
669
  " ran · ",
672
- oe(t.durationMs)
670
+ se(t.durationMs)
673
671
  ]
674
672
  })
675
673
  ]
676
674
  }, t.id);
677
675
  })]
678
- }), Nt = (e) => !e || e.hits === 0 && e.misses === 0 ? "untouched" : e.misses > 0 ? "ran" : "cached", Rt = (e, t) => {
676
+ }), Tt = (e) => !e || e.hits === 0 && e.misses === 0 ? "untouched" : e.misses > 0 ? "ran" : "cached", Nt = (e, t) => {
679
677
  let r = 0;
680
- for (const n of Y) t(e[n]) && (r += 1);
678
+ for (const n of j) t(e[n]) && (r += 1);
681
679
  return r;
682
- }, oe = (e) => e >= 10 ? `${e.toFixed(0)}ms` : `${e.toFixed(2)}ms`, fr = () => {
683
- const { history: e } = re(), { stack: t, undo: r, redo: n } = e, o = f((c) => t.subscribe(c), [t]), a = f(() => t.getSnapshot(), [t]), i = we(o, a, a);
680
+ }, se = (e) => e >= 10 ? `${e.toFixed(0)}ms` : `${e.toFixed(2)}ms`, pr = () => {
681
+ const { history: e } = te(), { stack: t, undo: r, redo: n } = e, o = f((c) => t.subscribe(c), [t]), a = f(() => t.getSnapshot(), [t]), i = we(o, a, a);
684
682
  return L(() => ({
685
683
  ...i,
686
684
  undo: r,
@@ -690,7 +688,7 @@ var bt = "drqe3uh", Et = "drqe3ui", ee = {
690
688
  r,
691
689
  n
692
690
  ]);
693
- }, qt = /* @__PURE__ */ new Set([
691
+ }, Rt = /* @__PURE__ */ new Set([
694
692
  "button",
695
693
  "checkbox",
696
694
  "color",
@@ -701,17 +699,17 @@ var bt = "drqe3uh", Et = "drqe3ui", ee = {
701
699
  "range",
702
700
  "reset",
703
701
  "submit"
704
- ]), vr = (e, t = {}) => {
702
+ ]), fr = (e, t = {}) => {
705
703
  const { target: r, enabled: n = !0 } = t;
706
- $(() => {
707
- const o = Gt(r);
704
+ D(() => {
705
+ const o = qt(r);
708
706
  if (!n || !o) return;
709
707
  const a = (i) => {
710
- if (!wt(i) || i.defaultPrevented || It(i.target)) return;
708
+ if (!Gt(i) || i.defaultPrevented || wt(i.target)) return;
711
709
  const c = ge(i);
712
710
  if (!c) return;
713
- const l = e.current;
714
- l && (c === "undo" ? l.undo() : l.redo()) && i.preventDefault();
711
+ const u = e.current;
712
+ u && (c === "undo" ? u.undo() : u.redo()) && i.preventDefault();
715
713
  };
716
714
  return o.addEventListener("keydown", a), () => o.removeEventListener("keydown", a);
717
715
  }, [
@@ -719,44 +717,44 @@ var bt = "drqe3uh", Et = "drqe3ui", ee = {
719
717
  r,
720
718
  n
721
719
  ]);
722
- }, Gt = (e) => e === void 0 ? window : e !== null && "current" in e ? e.current : e, wt = (e) => "key" in e, It = (e) => e instanceof HTMLInputElement ? !qt.has(e.type) : e instanceof HTMLElement ? e.isContentEditable || e.tagName === "TEXTAREA" : !1;
720
+ }, qt = (e) => e === void 0 ? window : e !== null && "current" in e ? e.current : e, Gt = (e) => "key" in e, wt = (e) => e instanceof HTMLInputElement ? !Rt.has(e.type) : e instanceof HTMLElement ? e.isContentEditable || e.tagName === "TEXTAREA" : !1;
723
721
  export {
724
- Yt as BrandMark,
725
- Mt as CanvasTextMeasurer,
722
+ jt as BrandMark,
723
+ Ht as CanvasTextMeasurer,
726
724
  Ut as DefaultFooter,
727
- Zt as DefaultGrid,
728
- Ht as DefaultHeader,
729
- nr as DefaultSwatch,
730
- Lt as DefaultTooltip,
731
- pr as DevToolsPanel,
725
+ Jt as DefaultGrid,
726
+ xt as DefaultHeader,
727
+ rr as DefaultSwatch,
728
+ Pt as DefaultTooltip,
729
+ hr as DevToolsPanel,
732
730
  Pe as GraphErrorBoundary,
733
- z as GraphErrorPanel,
734
- it as GraphProvider,
735
- Kt as GraphRenderer,
736
- Vt as HoverProvider,
737
- kt as TextMeasurerProvider,
738
- er as ThemeProvider,
739
- hr as UnitBoxSvg,
740
- gr as UnitSpaceSvg,
741
- mr as createGraphyKit,
742
- Jt as darkTheme,
743
- tr as defineGeomRenderer,
744
- jt as lightTheme,
731
+ Q as GraphErrorPanel,
732
+ ot as GraphProvider,
733
+ Bt as GraphRenderer,
734
+ Wt as HoverProvider,
735
+ It as TextMeasurerProvider,
736
+ Zt as ThemeProvider,
737
+ gr as UnitBoxSvg,
738
+ mr as UnitSpaceSvg,
739
+ ur as createGraphyKit,
740
+ zt as darkTheme,
741
+ er as defineGeomRenderer,
742
+ At as lightTheme,
745
743
  Ft as lightenCss,
746
744
  Be as pruneSelection,
747
- Dt as resolveBrandMarkVisual,
748
- xt as useCompiledSelector,
749
- Wt as useElementScreenRect,
750
- Qt as useGeomHitTest,
751
- Ot as useGeomHover,
752
- Xt as useGraphCommands,
753
- At as useGraphHandle,
754
- fr as useGraphHistory,
755
- vr as useGraphHistoryShortcuts,
756
- Bt as useGraphSelection,
757
- zt as useHandleCompiled,
758
- Pt as useHoverState,
759
- $t as useStyleReaders,
760
- rr as useTextMeasurer,
761
- or as vars
745
+ _t as resolveBrandMarkVisual,
746
+ $t as useCompiledSelector,
747
+ Yt as useElementScreenRect,
748
+ Xt as useGeomHitTest,
749
+ Kt as useGeomHover,
750
+ Vt as useGraphCommands,
751
+ Ot as useGraphHandle,
752
+ pr as useGraphHistory,
753
+ fr as useGraphHistoryShortcuts,
754
+ Lt as useGraphSelection,
755
+ Qt as useHandleCompiled,
756
+ Mt as useHoverState,
757
+ Dt as useStyleReaders,
758
+ tr as useTextMeasurer,
759
+ sr as vars
762
760
  };