@graphysdk/react-renderer 1.9.0-beta.1795010492985 → 1.9.0-beta.1795022135575

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,13 +1,13 @@
1
- import { $n as ke, $t as _e, An as kr, B as _r, Bn as z, Bt as $r, En as Hr, Fn as te, Gn as xr, Gt as Mr, Hn as U, In as Ie, J as Ar, Jn as $e, Jt as Q, Kn as Or, Kt as Br, Ln as He, Mn as Ne, Mt as Fr, Nn as Kr, Ot as zr, Pn as xe, Pt as Ur, Rn as jr, St as Wr, Un as Yr, Ut as Vr, V as Xr, Vn as re, Wt as Jr, X as Zr, Xn as Qr, Y as en, Yn as Me, Zn as Ae, Zt as Oe, a as tn, an as ne, ar as Be, bn as rn, bt as nn, dn as Fe, dr as ee, er as Pe, fn as Ke, gn as sn, hn as on, i as an, in as cn, ir as ln, j as dn, jn as j, jt as un, kn as mn, l as hn, lr as ze, mn as gn, n as pn, nn as Ue, nr as fn, on as je, or as We, pn as vn, q as yn, qn as Ye, r as Sn, rn as bn, rr as Tn, sn as Gn, sr as ae, t as Ve, tn as Xe, tr as En, un as Rn, xt as In, y as Nn, yt as Pn, z as wn, zn as Je } from "./history-chords-5_I8Lz9f.js";
2
- import { COMPILER_STAGE_KEYS as ce, DEFAULT_LOCALE as Ze, Geom as Qe, GraphCompilationSession as et, areEditTargetsEqual as tt, buildDiagnostic as me, buildPointSymbolPath as rt, canonicalizeLocale as nt, createAnchorResolver as st, createCompiler as ot, createDataLabelPlacementResolver as it, createSpecBuilder as at, createStyleResolver as we, findAnnotation as ct, findIntlLocale as lt, findLayerById as he, foldGeomCornerRadii as dt, isCompilerCachingEnabled as ut, isGeometricSymbol as le, isImageSymbol as mt, resolveDefinition as ht, resolveGeomCornerRadiusPx as ge, setCompilerCachingEnabled as gt, toPercent as J } from "@graphysdk/viz-engine";
3
- import { Component as pt, useCallback as p, useEffect as _, useId as ft, useImperativeHandle as vt, useMemo as H, useRef as pe, useState as y, useSyncExternalStore as yt } from "react";
1
+ import { $ as _r, $n as _e, B as kr, Bn as $r, Ct as Hr, Fn as xr, Ft as Mr, Gn as Ar, Hn as z, In as ke, Jn as Or, Jt as Br, Kt as Fr, Ln as te, Lt as Kr, Mn as zr, Nn as U, On as Ur, Pn as we, Pt as jr, Q as Wr, Qn as Yr, Rn as Ie, Sn as Vr, St as Xr, Tt as Qr, Un as re, Ut as Zr, V as Jr, Vn as $e, Wn as j, Xn as He, Yn as xe, Yt as en, Z as tn, Zn as Me, Zt as J, _n as rn, a as nn, an as Ae, ar as sn, cn as ne, cr as Oe, dr as Be, en as Fe, fn as on, gn as an, hn as cn, i as ln, in as Ke, ir as dn, j as un, jn as mn, jt as hn, l as gn, ln as ze, lr as ae, mn as Ue, n as pn, nn as je, nr as Ne, on as fn, or as vn, pn as We, pr as ee, q as yn, qn as Sn, qt as bn, r as Tn, rr as Gn, sn as En, sr as Ye, t as Ve, tr as Xe, un as Rn, vn as wn, wt as In, y as Nn, z as Pn, zn as Qe } from "./history-chords-eAw9OJIk.js";
2
+ import { COMPILER_STAGE_KEYS as ce, DEFAULT_LOCALE as Ze, Geom as Je, GraphCompilationSession as et, areEditTargetsEqual as tt, buildDiagnostic as me, buildPointSymbolPath as rt, canonicalizeLocale as nt, createAnchorResolver as st, createCompiler as ot, createDataLabelPlacementResolver as it, createSpecBuilder as at, createStyleResolver as Pe, findAnnotation as ct, findIntlLocale as lt, findLayerById as he, foldGeomCornerRadii as dt, isCompilerCachingEnabled as ut, isGeometricSymbol as le, isImageSymbol as mt, resolveDefinition as ht, resolveGeomCornerRadiusPx as ge, setCompilerCachingEnabled as gt, toPercent as Q } from "@graphysdk/viz-engine";
3
+ import { Component as pt, useCallback as p, useEffect as k, useId as ft, useImperativeHandle as vt, useMemo as H, useRef as pe, useState as y, useSyncExternalStore as yt } from "react";
4
4
  import { Fragment as St, jsx as c, jsxs as f } from "react/jsx-runtime";
5
5
  import { useStore as ie } from "zustand";
6
6
  import { motion as se } from "motion/react";
7
7
  import { createStore as de } from "zustand/vanilla";
8
8
  import bt from "clsx";
9
9
  import './index.css';var Tt = "_1a5iqpb0", Gt = "_1a5iqpb1";
10
- var Et = "_1a5iqpb3", Rt = "_1a5iqpb4", It = "_1a5iqpb5";
10
+ var Et = "_1a5iqpb3", Rt = "_1a5iqpb4", wt = "_1a5iqpb5";
11
11
  var fe = ({ errors: e }) => {
12
12
  const [t, ...r] = e;
13
13
  return /* @__PURE__ */ f("div", {
@@ -33,7 +33,7 @@ var fe = ({ errors: e }) => {
33
33
  children: e.code
34
34
  }),
35
35
  /* @__PURE__ */ c("p", {
36
- className: It,
36
+ className: wt,
37
37
  children: e.message
38
38
  }),
39
39
  e.suggestion && /* @__PURE__ */ c("p", {
@@ -42,10 +42,10 @@ var fe = ({ errors: e }) => {
42
42
  })
43
43
  ]
44
44
  });
45
- function Nt(e = [], t = []) {
45
+ function It(e = [], t = []) {
46
46
  return e.length === t.length && e.every((r, n) => Object.is(r, t[n]));
47
47
  }
48
- var Pt = class extends pt {
48
+ var Nt = class extends pt {
49
49
  constructor(...e) {
50
50
  super(...e), this.state = { caughtDiagnostic: null };
51
51
  }
@@ -57,7 +57,7 @@ var Pt = class extends pt {
57
57
  ee([r]), this.props.onError?.([r]), console.error("Chart render component stack:", t.componentStack);
58
58
  }
59
59
  componentDidUpdate(e) {
60
- this.state.caughtDiagnostic && !Nt(e.resetKeys, this.props.resetKeys) && this.setState({ caughtDiagnostic: null });
60
+ this.state.caughtDiagnostic && !It(e.resetKeys, this.props.resetKeys) && this.setState({ caughtDiagnostic: null });
61
61
  }
62
62
  render() {
63
63
  const { caughtDiagnostic: e } = this.state;
@@ -65,21 +65,21 @@ var Pt = class extends pt {
65
65
  const { forcedErrors: t, children: r } = this.props;
66
66
  return t && t.length > 0 ? /* @__PURE__ */ c(fe, { errors: t }) : r;
67
67
  }
68
- }, Ce = (e) => typeof e == "object" && "geom" in e && "render" in e, De = (e) => {
68
+ }, Ce = (e) => typeof e == "object" && "geom" in e && "render" in e, Le = (e) => {
69
69
  const t = ht(e);
70
- return t instanceof Qe ? t : null;
71
- }, wt = (e, t) => {
70
+ return t instanceof Je ? t : null;
71
+ }, Pt = (e, t) => {
72
72
  const r = e.filter((n) => Ct(n, t));
73
73
  return r.length === e.length ? e : r;
74
- }, Ct = (e, t) => e.kind === "annotation" ? ct(t.annotations, e.id) !== null : e.kind === "observations" ? he(t.layers, e.layerId) !== void 0 : e.kind === "layer" && e.layerId !== void 0 ? he(t.layers, e.layerId) !== void 0 : !0, ye = [], Dt = () => de((e) => ({
74
+ }, Ct = (e, t) => e.kind === "annotation" ? ct(t.annotations, e.id) !== null : e.kind === "observations" ? he(t.layers, e.layerId) !== void 0 : e.kind === "layer" && e.layerId !== void 0 ? he(t.layers, e.layerId) !== void 0 : !0, ye = [], Lt = () => de((e) => ({
75
75
  selection: ye,
76
- setSelection: (t) => e((r) => Lt(r.selection, t) ? r : { selection: t }),
76
+ setSelection: (t) => e((r) => Dt(r.selection, t) ? r : { selection: t }),
77
77
  clearSelection: () => e((t) => t.selection.length === 0 ? t : { selection: ye })
78
- })), Lt = (e, t) => e === t ? !0 : e.length !== t.length ? !1 : e.every((r, n) => {
78
+ })), Dt = (e, t) => e === t ? !0 : e.length !== t.length ? !1 : e.every((r, n) => {
79
79
  const s = t[n];
80
80
  return s !== void 0 && tt(r, s);
81
- }), qt = 5, kt = (e) => {
82
- if (!Pe) return {
81
+ }), qt = 5, _t = (e) => {
82
+ if (!Ne) return {
83
83
  emit: () => {
84
84
  },
85
85
  subscribe: () => $t,
@@ -104,7 +104,7 @@ var Pt = class extends pt {
104
104
  getLastCompile: () => e.getLastCompile(),
105
105
  getCacheStats: () => e.getCacheStats()
106
106
  };
107
- }, _t = () => de((e) => ({
107
+ }, kt = () => de((e) => ({
108
108
  lastCompile: null,
109
109
  history: [],
110
110
  nextId: 1,
@@ -142,9 +142,9 @@ var Pt = class extends pt {
142
142
  return [...e.slice(n), t];
143
143
  };
144
144
  function Se(e) {
145
- const t = e.filter(Ce), r = /* @__PURE__ */ new Set([...Object.keys(je), ...t.map((l) => l.geom)]), n = [], s = /* @__PURE__ */ new Set();
145
+ const t = e.filter(Ce), r = /* @__PURE__ */ new Set([...Object.keys(ze), ...t.map((l) => l.geom)]), n = [], s = /* @__PURE__ */ new Set();
146
146
  for (const l of e) {
147
- const d = De(l);
147
+ const d = Le(l);
148
148
  d === null || r.has(d.type) || s.has(d.type) || (s.add(d.type), n.push({
149
149
  kind: "userInput",
150
150
  severity: "error",
@@ -294,7 +294,7 @@ function Kt(e, t) {
294
294
  }
295
295
  function zt(e, t) {
296
296
  let r;
297
- return e.layers.flatMap((n, s) => ne(t(n.geom, e.coordSystem.type)) ? Ut(n) ? (r ??= we().readers(e), (r.geom(n).get("overpaint", void 0, "hovered")?.length ?? 0) === 0 ? [] : [{
297
+ return e.layers.flatMap((n, s) => ne(t(n.geom, e.coordSystem.type)) ? Ut(n) ? (r ??= Pe().readers(e), (r.geom(n).get("overpaint", void 0, "hovered")?.length ?? 0) === 0 ? [] : [{
298
298
  kind: "userInput",
299
299
  severity: "warning",
300
300
  code: "INVALID_STYLE_RULE",
@@ -311,7 +311,7 @@ var Ut = (e) => [e.styles.defaults, e.styles.overrides].some((t) => t.some((r) =
311
311
  function jt(e) {
312
312
  const t = /* @__PURE__ */ new Set(), r = [];
313
313
  for (const n of e) {
314
- const s = De(n);
314
+ const s = Le(n);
315
315
  s === null || t.has(s.type) || s.dataLabelCoordTypes.length === 0 || s.getDataLabelPlacements !== void 0 || (t.add(s.type), r.push({
316
316
  kind: "userInput",
317
317
  severity: "warning",
@@ -330,14 +330,14 @@ var Wt = (e) => de((t) => ({
330
330
  scene: e,
331
331
  setScene: (r) => t((n) => n.scene === r ? n : { scene: r })
332
332
  })), Yt = ({ spec: e, data: t, colorScheme: r, plugins: n, theme: s, resolveRenderer: i, anchorResolver: a, onSpecChange: l, onError: d, onWarnings: h }) => {
333
- const S = Q(l), D = Q(d), N = Q(h), [{ session: g, compileBus: m, findGeom: T }] = y(() => {
333
+ const S = J(l), L = J(d), I = J(h), [{ session: g, compileBus: m, findGeom: T }] = y(() => {
334
334
  const o = ot({
335
335
  plugins: n,
336
336
  theme: s
337
337
  });
338
338
  return {
339
339
  session: new et(o),
340
- compileBus: kt(o),
340
+ compileBus: _t(o),
341
341
  findGeom: (u) => o.findGeom(u)
342
342
  };
343
343
  }), [v] = y(() => {
@@ -346,7 +346,7 @@ var Wt = (e) => de((t) => ({
346
346
  errors: [...u.errors, ...o.errors],
347
347
  warnings: [...u.warnings, ...o.warnings]
348
348
  };
349
- }), L = pe(null), [R] = y(Vt), G = pe(null), P = p((o) => v.errors.length === 0 ? o : [...v.errors, ...o ?? []], [v]), q = p((o) => {
349
+ }), D = pe(null), [R] = y(Vt), G = pe(null), N = p((o) => v.errors.length === 0 ? o : [...v.errors, ...o ?? []], [v]), q = p((o) => {
350
350
  if (!o.ok) return o.errors;
351
351
  if (G.current) G.current.getState().setScene(o.scene);
352
352
  else {
@@ -354,14 +354,14 @@ var Wt = (e) => de((t) => ({
354
354
  u.subscribe(R.notify), G.current = u, R.notify();
355
355
  }
356
356
  return null;
357
- }, [R]), [I, x] = y(() => {
357
+ }, [R]), [w, x] = y(() => {
358
358
  const o = g.compile({
359
359
  spec: e,
360
360
  data: t,
361
361
  colorScheme: r
362
362
  });
363
- return L.current = o, P(q(o));
364
- }), w = p((o) => o.ok ? [
363
+ return D.current = o, N(q(o));
364
+ }), P = p((o) => o.ok ? [
365
365
  ...o.warnings,
366
366
  ...Mt(o.scene, i),
367
367
  ...At(o.scene, i),
@@ -371,20 +371,20 @@ var Wt = (e) => de((t) => ({
371
371
  ...zt(o.scene, i),
372
372
  ...Ft(o.scene, a)
373
373
  ] : o.warnings, [i, a]), b = p((o) => {
374
- o.length !== 0 && (ee(o), D.current?.(o));
375
- }, [D]), C = p((o) => {
376
- o.length !== 0 && (ee(o), N.current?.(o));
377
- }, [N]);
378
- _(() => {
379
- const o = L.current;
380
- o && (b([...v.errors, ...o.ok ? [] : o.errors]), C([...v.warnings, ...w(o)]), o.ok && m.emit({ kind: "init" }));
374
+ o.length !== 0 && (ee(o), L.current?.(o));
375
+ }, [L]), C = p((o) => {
376
+ o.length !== 0 && (ee(o), I.current?.(o));
377
+ }, [I]);
378
+ k(() => {
379
+ const o = D.current;
380
+ o && (b([...v.errors, ...o.ok ? [] : o.errors]), C([...v.warnings, ...P(o)]), o.ok && m.emit({ kind: "init" }));
381
381
  }, [
382
382
  m,
383
383
  b,
384
384
  C,
385
385
  v,
386
- w
387
- ]), _(() => {
386
+ P
387
+ ]), k(() => {
388
388
  const o = g.update({
389
389
  spec: e,
390
390
  data: t,
@@ -393,7 +393,7 @@ var Wt = (e) => de((t) => ({
393
393
  if (!o) return;
394
394
  o.committedSpec && S.current?.(o.committedSpec);
395
395
  const u = q(o.result);
396
- x(P(u)), u && b(u), C(w(o.result)), u || m.emit({ kind: o.hasSpecChange ? "spec" : "data" });
396
+ x(N(u)), u && b(u), C(P(o.result)), u || m.emit({ kind: o.hasSpecChange ? "spec" : "data" });
397
397
  }, [
398
398
  e,
399
399
  t,
@@ -403,16 +403,16 @@ var Wt = (e) => de((t) => ({
403
403
  q,
404
404
  b,
405
405
  C,
406
+ N,
406
407
  P,
407
- w,
408
408
  S
409
409
  ]);
410
410
  const M = p((o) => {
411
- x((u) => u === null ? u : P(null)), C(w(o));
411
+ x((u) => u === null ? u : N(null)), C(P(o));
412
412
  }, [
413
- P,
413
+ N,
414
414
  C,
415
- w
415
+ P
416
416
  ]), A = p((o) => {
417
417
  o.scene && G.current?.getState().setScene(o.scene), o.result && M(o.result), o.command && m.emit({
418
418
  kind: "command",
@@ -426,7 +426,7 @@ var Wt = (e) => de((t) => ({
426
426
  ]), E = p((o) => {
427
427
  for (const u of o) A(u);
428
428
  return o.some((u) => !!u.scene);
429
- }, [A]), k = p((o, u) => {
429
+ }, [A]), _ = p((o, u) => {
430
430
  E(g.applyCommand(o, u));
431
431
  }, [g, E]), W = p(() => {
432
432
  E(g.commit());
@@ -447,7 +447,7 @@ var Wt = (e) => de((t) => ({
447
447
  ]), V = p(() => G.current?.getState().scene ?? null, []);
448
448
  return {
449
449
  store: G.current,
450
- dispatch: k,
450
+ dispatch: _,
451
451
  commit: W,
452
452
  paintPreview: oe,
453
453
  clearPreview: Y,
@@ -455,7 +455,7 @@ var Wt = (e) => de((t) => ({
455
455
  subscribe: R.subscribe,
456
456
  getScene: V,
457
457
  compileBus: m,
458
- compileErrors: I,
458
+ compileErrors: w,
459
459
  findGeom: T
460
460
  };
461
461
  }, Vt = () => {
@@ -466,29 +466,29 @@ var Wt = (e) => de((t) => ({
466
466
  }),
467
467
  notify: () => e.forEach((t) => t())
468
468
  };
469
- }, Xt = ["cartesian", "polar"], Jt = ({ data: e, spec: t, plugins: r = [], theme: n, glyphs: s, formattingLocale: i, handleRef: a, onSpecChange: l, onError: d, onWarnings: h, colorScheme: S = "light", mode: D = _e.readonly, children: N }) => {
470
- const g = Xe(D), m = er(i, h), [T] = y(() => n), [v] = y(() => Ae(n?.glyphs, s)), L = T?.colorScheme ?? S, [R] = y(() => Ue([...T?.plugins ?? [], ...r].filter(Ce)));
471
- Qt(R, v);
472
- const G = ft(), [P] = y(() => st(r)), [q] = y(() => it(r)), [I] = y(() => Dt()), [x] = y(() => Oe()), w = H(() => we({ colorScheme: L }), [L]), { store: b, dispatch: C, commit: M, paintPreview: A, clearPreview: E, history: k, subscribe: W, getScene: O, compileBus: B, compileErrors: oe, findGeom: Y } = Yt({
469
+ }, Xt = ["cartesian", "polar"], Qt = ({ data: e, spec: t, plugins: r = [], theme: n, glyphs: s, formattingLocale: i, handleRef: a, onSpecChange: l, onError: d, onWarnings: h, colorScheme: S = "light", mode: L = je.readonly, children: I }) => {
470
+ const g = Ke(L), m = er(i, h), [T] = y(() => n), [v] = y(() => _e(n?.glyphs, s)), D = T?.colorScheme ?? S, [R] = y(() => Ae([...T?.plugins ?? [], ...r].filter(Ce)));
471
+ Jt(R, v);
472
+ const G = ft(), [N] = y(() => st(r)), [q] = y(() => it(r)), [w] = y(() => Lt()), [x] = y(() => Fe()), P = H(() => Pe({ colorScheme: D }), [D]), { store: b, dispatch: C, commit: M, paintPreview: A, clearPreview: E, history: _, subscribe: W, getScene: O, compileBus: B, compileErrors: oe, findGeom: Y } = Yt({
473
473
  spec: t,
474
474
  data: e,
475
- colorScheme: L,
475
+ colorScheme: D,
476
476
  plugins: r,
477
477
  theme: T,
478
478
  resolveRenderer: R,
479
- anchorResolver: P,
479
+ anchorResolver: N,
480
480
  onSpecChange: l,
481
481
  onError: d,
482
482
  onWarnings: h
483
483
  });
484
- _(() => {
484
+ k(() => {
485
485
  if (b)
486
486
  return b.subscribe((o, u) => {
487
487
  if (o.scene.spec === u.scene.spec) return;
488
- const { selection: X, setSelection: qe } = I.getState();
489
- X.length !== 0 && qe(wt(X, o.scene.spec));
488
+ const { selection: X, setSelection: qe } = w.getState();
489
+ X.length !== 0 && qe(Pt(X, o.scene.spec));
490
490
  });
491
- }, [b, I]);
491
+ }, [b, w]);
492
492
  const $ = H(() => ({
493
493
  dispatch: C,
494
494
  commit: M,
@@ -502,25 +502,25 @@ var Wt = (e) => de((t) => ({
502
502
  ]);
503
503
  vt(a, () => ({
504
504
  commands: $,
505
- undo: k.undo,
506
- redo: k.redo,
505
+ undo: _.undo,
506
+ redo: _.redo,
507
507
  subscribe: W,
508
508
  getScene: O,
509
509
  formattingLocale: m,
510
- getSelection: () => I.getState().selection,
511
- setSelection: (o) => I.getState().setSelection(o),
512
- subscribeSelection: I.subscribe,
510
+ getSelection: () => w.getState().selection,
511
+ setSelection: (o) => w.getState().setSelection(o),
512
+ subscribeSelection: w.subscribe,
513
513
  canPlaceDataLabels: q.hasCapability,
514
514
  canFormatDataLabelsAsPercentages: q.hasPercentageFormat,
515
515
  getGlyphs: () => v,
516
516
  getPointSymbols: (o) => R("point", o)?.symbols
517
517
  }), [
518
518
  $,
519
- k,
519
+ _,
520
520
  W,
521
521
  O,
522
522
  m,
523
- I,
523
+ w,
524
524
  q,
525
525
  v,
526
526
  R
@@ -528,62 +528,62 @@ var Wt = (e) => de((t) => ({
528
528
  const V = H(() => b ? {
529
529
  chartId: G,
530
530
  store: b,
531
- selectionStore: I,
531
+ selectionStore: w,
532
532
  targetBoundaryStore: x,
533
533
  commands: $,
534
- history: k,
534
+ history: _,
535
535
  formattingLocale: m,
536
536
  compileBus: B,
537
- colorScheme: L,
537
+ colorScheme: D,
538
538
  mode: g,
539
- styleResolver: w,
540
- anchorResolver: P,
539
+ styleResolver: P,
540
+ anchorResolver: N,
541
541
  findGeom: Y
542
542
  } : null, [
543
543
  G,
544
544
  b,
545
- I,
545
+ w,
546
546
  x,
547
547
  $,
548
- k,
548
+ _,
549
549
  m,
550
550
  B,
551
- L,
551
+ D,
552
552
  g,
553
- w,
554
553
  P,
554
+ N,
555
555
  Y
556
556
  ]);
557
- return /* @__PURE__ */ c(Pt, {
557
+ return /* @__PURE__ */ c(Nt, {
558
558
  forcedErrors: oe,
559
559
  onError: d,
560
560
  resetKeys: [t, e],
561
- children: V ? /* @__PURE__ */ c(We.Provider, {
561
+ children: V ? /* @__PURE__ */ c(Oe.Provider, {
562
562
  value: V,
563
- children: /* @__PURE__ */ c(Fe, {
563
+ children: /* @__PURE__ */ c(We, {
564
564
  value: R,
565
- children: /* @__PURE__ */ c(ze, {
565
+ children: /* @__PURE__ */ c(Be, {
566
566
  value: q,
567
- children: /* @__PURE__ */ c(j, {
567
+ children: /* @__PURE__ */ c(U, {
568
568
  shapes: T?.shapes,
569
569
  children: /* @__PURE__ */ c(Me, {
570
570
  glyphs: v,
571
- children: N
571
+ children: I
572
572
  })
573
573
  })
574
574
  })
575
575
  })
576
576
  }) : null
577
577
  });
578
- }, Zt = (e, t) => (e ?? []).filter((r) => !le(r) && !t.has(r)), Qt = (e, t) => {
579
- _(() => {
580
- if (!Pe) return;
578
+ }, Zt = (e, t) => (e ?? []).filter((r) => !le(r) && !t.has(r)), Jt = (e, t) => {
579
+ k(() => {
580
+ if (!Ne) return;
581
581
  const r = new Set(t.map(({ name: n }) => n));
582
582
  for (const n of Xt) for (const s of Zt(e("point", n)?.symbols, r)) console.warn(`[graphy] The ${n} point renderer lists "${s}", but no glyph has that name. The shape menu offers it, and SymbolFigure draws the first listed symbol in its place.`);
583
583
  }, [e, t]);
584
584
  }, er = (e, t) => {
585
- const r = Q(t);
586
- return _(() => {
585
+ const r = J(t);
586
+ return k(() => {
587
587
  if (e === void 0 || lt(e) !== void 0) return;
588
588
  const n = [{
589
589
  severity: "warning",
@@ -598,7 +598,7 @@ function Hn({ theme: e, glyphs: t, ...r } = {}) {
598
598
  const n = at(r);
599
599
  return {
600
600
  ...n,
601
- GraphProvider: (i) => /* @__PURE__ */ c(Jt, {
601
+ GraphProvider: (i) => /* @__PURE__ */ c(Qt, {
602
602
  ...i,
603
603
  plugins: n.plugins,
604
604
  theme: e,
@@ -620,7 +620,7 @@ var K = (e, t) => {
620
620
  height: d
621
621
  };
622
622
  }, tr = ({ animateTransitions: e, cx: t, cy: r, r: n, effects: s, ...i }) => {
623
- const a = U(s);
623
+ const a = j(s);
624
624
  return e ? /* @__PURE__ */ c(se.circle, {
625
625
  initial: !1,
626
626
  animate: {
@@ -639,7 +639,7 @@ var K = (e, t) => {
639
639
  ...i
640
640
  });
641
641
  }, rr = ({ animateTransitions: e, x1: t, y1: r, x2: n, y2: s, effects: i, ...a }) => {
642
- const l = U(i);
642
+ const l = j(i);
643
643
  return e ? /* @__PURE__ */ c(se.line, {
644
644
  initial: !1,
645
645
  animate: {
@@ -660,7 +660,7 @@ var K = (e, t) => {
660
660
  ...a
661
661
  });
662
662
  }, nr = ({ animateTransitions: e, x: t, y: r, width: n, height: s, rx: i, ry: a, effects: l, ...d }) => {
663
- const h = U(l);
663
+ const h = j(l);
664
664
  return e ? /* @__PURE__ */ c(se.rect, {
665
665
  initial: !1,
666
666
  animate: {
@@ -687,7 +687,7 @@ var K = (e, t) => {
687
687
  ...d
688
688
  });
689
689
  }, sr = ({ animateTransitions: e, d: t, source: r, effects: n, ...s }) => {
690
- const i = U(n);
690
+ const i = j(n);
691
691
  return e ? /* @__PURE__ */ c(or, {
692
692
  d: t,
693
693
  source: r,
@@ -704,9 +704,9 @@ var K = (e, t) => {
704
704
  animateTransitions: r
705
705
  };
706
706
  return n !== void 0 && n !== "circle" ? /* @__PURE__ */ c("g", {
707
- style: U(e.effects),
707
+ style: j(e.effects),
708
708
  "data-testid": e["data-testid"],
709
- children: /* @__PURE__ */ c(Ye, {
709
+ children: /* @__PURE__ */ c(xe, {
710
710
  symbol: n,
711
711
  cx: be(e.cx),
712
712
  cy: be(e.cy),
@@ -723,28 +723,28 @@ var K = (e, t) => {
723
723
  fadesIn: !1
724
724
  } : null
725
725
  })
726
- }) : t === void 0 ? tr(i) : /* @__PURE__ */ c(j, { children: /* @__PURE__ */ c(t, { ...i }) });
726
+ }) : t === void 0 ? tr(i) : /* @__PURE__ */ c(U, { children: /* @__PURE__ */ c(t, { ...i }) });
727
727
  }, An = (e) => {
728
728
  const { Line: t } = te(), { animateTransitions: r } = re(), n = {
729
729
  ...e,
730
730
  animateTransitions: r
731
731
  };
732
- return t === void 0 ? rr(n) : /* @__PURE__ */ c(j, { children: /* @__PURE__ */ c(t, { ...n }) });
732
+ return t === void 0 ? rr(n) : /* @__PURE__ */ c(U, { children: /* @__PURE__ */ c(t, { ...n }) });
733
733
  }, On = ({ cornerRadius: e, ...t }) => {
734
- const { Rect: r } = te(), n = Ie()?.size ?? null, s = xe(), { animateTransitions: i } = re(), a = {
734
+ const { Rect: r } = te(), n = Ie()?.size ?? null, s = ke(), { animateTransitions: i } = re(), a = {
735
735
  ...t,
736
736
  animateTransitions: i,
737
737
  ...ir(e, t, n, s)
738
738
  };
739
- return r === void 0 ? nr(a) : /* @__PURE__ */ c(j, { children: /* @__PURE__ */ c(r, { ...a }) });
739
+ return r === void 0 ? nr(a) : /* @__PURE__ */ c(U, { children: /* @__PURE__ */ c(r, { ...a }) });
740
740
  }, Bn = (e) => {
741
741
  const { Path: t } = te(), { animateTransitions: r } = re(), n = {
742
742
  ...e,
743
743
  animateTransitions: r
744
744
  };
745
- return t === void 0 ? sr(n) : /* @__PURE__ */ c(j, { children: /* @__PURE__ */ c(t, { ...n }) });
745
+ return t === void 0 ? sr(n) : /* @__PURE__ */ c(U, { children: /* @__PURE__ */ c(t, { ...n }) });
746
746
  }, be = (e) => typeof e == "number" ? `${e}px` : e, or = ({ d: e, source: t, ...r }) => {
747
- const n = Je(e, z, t);
747
+ const n = $e(e, z, t);
748
748
  return /* @__PURE__ */ c(se.path, {
749
749
  d: n,
750
750
  ...r
@@ -779,7 +779,7 @@ var K = (e, t) => {
779
779
  rx: e / t.x,
780
780
  ry: e / t.y
781
781
  }, Fn = ({ symbol: e, size: t, fill: r, fillOpacity: n, stroke: s, strokeOpacity: i, strokeWidth: a }) => {
782
- const l = ke(), d = Ke(), h = Be((N) => N.coordSystem.type), S = cr(e, d("point", h)?.symbols ?? [], l), D = {
782
+ const l = Xe(), d = Ue(), h = Ye((I) => I.coordSystem.type), S = cr(e, d("point", h)?.symbols ?? [], l), L = {
783
783
  size: t,
784
784
  fill: r,
785
785
  fillOpacity: n,
@@ -795,10 +795,10 @@ var K = (e, t) => {
795
795
  strokeOpacity: i,
796
796
  strokeWidth: a,
797
797
  strokeLinejoin: "round"
798
- }) : /* @__PURE__ */ c($e, {
798
+ }) : /* @__PURE__ */ c(He, {
799
799
  symbol: S,
800
800
  glyphs: l,
801
- ...D
801
+ ...L
802
802
  });
803
803
  }, cr = (e, t, r) => mt(e) || t.includes(e) || !le(e) && r.has(e) ? e : t[0] ?? "circle", Kn = ({ children: e, ...t }) => {
804
804
  const r = Ie()?.size ?? null;
@@ -809,25 +809,25 @@ var K = (e, t) => {
809
809
  height: "100%",
810
810
  pointerEvents: "none",
811
811
  ...t,
812
- children: /* @__PURE__ */ c(Ne, {
812
+ children: /* @__PURE__ */ c(we, {
813
813
  size: r,
814
814
  space: "unit",
815
815
  children: e
816
816
  })
817
817
  });
818
818
  }, zn = ({ box: e, children: t }) => {
819
- const r = He(), n = r === null ? null : r.width * (e.x1 - e.x0), s = r === null ? null : r.height * (e.y1 - e.y0), i = H(() => n === null || s === null ? null : {
819
+ const r = Qe(), n = r === null ? null : r.width * (e.x1 - e.x0), s = r === null ? null : r.height * (e.y1 - e.y0), i = H(() => n === null || s === null ? null : {
820
820
  width: n,
821
821
  height: s
822
822
  }, [n, s]);
823
823
  return /* @__PURE__ */ c("svg", {
824
- x: J(e.x0),
825
- y: J(e.y0),
826
- width: J(e.x1 - e.x0),
827
- height: J(e.y1 - e.y0),
824
+ x: Q(e.x0),
825
+ y: Q(e.y0),
826
+ width: Q(e.x1 - e.x0),
827
+ height: Q(e.y1 - e.y0),
828
828
  overflow: "hidden",
829
829
  pointerEvents: "none",
830
- children: /* @__PURE__ */ c(Ne, {
830
+ children: /* @__PURE__ */ c(we, {
831
831
  size: i,
832
832
  children: t
833
833
  })
@@ -840,17 +840,17 @@ var Gr = "drqe3uh", Er = "drqe3ui", Ee = {
840
840
  }, Re = {
841
841
  ran: "drqe3un drqe3um",
842
842
  dim: "drqe3uo drqe3um"
843
- }, Le = {
843
+ }, De = {
844
844
  ran: "drqe3uq drqe3up",
845
845
  cached: "drqe3ur drqe3up",
846
846
  untouched: "drqe3us drqe3up"
847
847
  }, Un = ({ width: e = 440, style: t, className: r } = {}) => {
848
- const { compileBus: n } = ae(), [s] = y(() => _t()), [i, a] = y(!1), [l, d] = y(ut);
849
- _(() => {
848
+ const { compileBus: n } = ae(), [s] = y(() => kt()), [i, a] = y(!1), [l, d] = y(ut);
849
+ k(() => {
850
850
  const { recordCompile: m } = s.getState(), T = n.getLastTrigger(), v = n.getLastCompile();
851
851
  return T && v && m(T, v), n.subscribe(m);
852
852
  }, [s, n]);
853
- const h = ie(s, (m) => m.lastCompile), S = ie(s, (m) => m.history), D = n.getCacheStats(), N = h === null && S.length === 0, g = () => {
853
+ const h = ie(s, (m) => m.lastCompile), S = ie(s, (m) => m.history), L = n.getCacheStats(), I = h === null && S.length === 0, g = () => {
854
854
  d((m) => {
855
855
  const T = !m;
856
856
  return gt(T), T;
@@ -870,7 +870,7 @@ var Gr = "drqe3uh", Er = "drqe3ui", Ee = {
870
870
  children: "compile cache"
871
871
  }), /* @__PURE__ */ c("div", {
872
872
  className: br,
873
- children: N ? "production: stats disabled" : h ? `last: ${h.label} · ${ue(h.durationMs)}` : "awaiting first compile…"
873
+ children: I ? "production: stats disabled" : h ? `last: ${h.label} · ${ue(h.durationMs)}` : "awaiting first compile…"
874
874
  })] }), /* @__PURE__ */ c("button", {
875
875
  type: "button",
876
876
  onClick: () => a((m) => !m),
@@ -891,11 +891,11 @@ var Gr = "drqe3uh", Er = "drqe3ui", Ee = {
891
891
  children: "next compile reflects this toggle"
892
892
  })]
893
893
  }),
894
- !i && !N && /* @__PURE__ */ f(St, { children: [/* @__PURE__ */ c(Rr, {
894
+ !i && !I && /* @__PURE__ */ f(St, { children: [/* @__PURE__ */ c(Rr, {
895
895
  delta: h?.stages,
896
896
  durations: h?.stageDurationsMs,
897
- cumulative: D
898
- }), /* @__PURE__ */ c(Ir, { entries: S })] })
897
+ cumulative: L
898
+ }), /* @__PURE__ */ c(wr, { entries: S })] })
899
899
  ]
900
900
  });
901
901
  }, Rr = ({ delta: e, durations: t, cumulative: r }) => /* @__PURE__ */ f("table", {
@@ -929,7 +929,7 @@ var Gr = "drqe3uh", Er = "drqe3ui", Ee = {
929
929
  })
930
930
  ]
931
931
  }) }), /* @__PURE__ */ c("tbody", { children: ce.map((n) => {
932
- const s = e?.[n], i = Nr(s);
932
+ const s = e?.[n], i = Ir(s);
933
933
  return /* @__PURE__ */ f("tr", {
934
934
  className: yr,
935
935
  children: [
@@ -937,7 +937,7 @@ var Gr = "drqe3uh", Er = "drqe3ui", Ee = {
937
937
  className: hr,
938
938
  children: [
939
939
  /* @__PURE__ */ c("span", {
940
- className: Le[i],
940
+ className: De[i],
941
941
  "aria-hidden": !0
942
942
  }),
943
943
  " ",
@@ -967,18 +967,18 @@ var Gr = "drqe3uh", Er = "drqe3ui", Ee = {
967
967
  ]
968
968
  }, n);
969
969
  }) })]
970
- }), Ir = ({ entries: e }) => e.length === 0 ? null : /* @__PURE__ */ f("div", {
970
+ }), wr = ({ entries: e }) => e.length === 0 ? null : /* @__PURE__ */ f("div", {
971
971
  className: Sr,
972
972
  children: [/* @__PURE__ */ c("div", {
973
973
  className: Er,
974
974
  children: "recent compiles"
975
975
  }), e.map((t) => {
976
- const r = Pr(t.stages, (i) => i.misses > 0), n = ce.length;
976
+ const r = Nr(t.stages, (i) => i.misses > 0), n = ce.length;
977
977
  return /* @__PURE__ */ f("div", {
978
978
  className: gr,
979
979
  children: [
980
980
  /* @__PURE__ */ c("span", {
981
- className: Le[r === 0 ? "cached" : "ran"],
981
+ className: De[r === 0 ? "cached" : "ran"],
982
982
  "aria-hidden": !0
983
983
  }),
984
984
  /* @__PURE__ */ c("span", {
@@ -999,7 +999,7 @@ var Gr = "drqe3uh", Er = "drqe3ui", Ee = {
999
999
  ]
1000
1000
  }, t.id);
1001
1001
  })]
1002
- }), Nr = (e) => !e || e.hits === 0 && e.misses === 0 ? "untouched" : e.misses > 0 ? "ran" : "cached", Pr = (e, t) => {
1002
+ }), Ir = (e) => !e || e.hits === 0 && e.misses === 0 ? "untouched" : e.misses > 0 ? "ran" : "cached", Nr = (e, t) => {
1003
1003
  let r = 0;
1004
1004
  for (const n of ce) t(e[n]) && (r += 1);
1005
1005
  return r;
@@ -1014,7 +1014,7 @@ var Gr = "drqe3uh", Er = "drqe3ui", Ee = {
1014
1014
  r,
1015
1015
  n
1016
1016
  ]);
1017
- }, wr = /* @__PURE__ */ new Set([
1017
+ }, Pr = /* @__PURE__ */ new Set([
1018
1018
  "button",
1019
1019
  "checkbox",
1020
1020
  "color",
@@ -1027,11 +1027,11 @@ var Gr = "drqe3uh", Er = "drqe3ui", Ee = {
1027
1027
  "submit"
1028
1028
  ]), Wn = (e, t = {}) => {
1029
1029
  const { target: r, enabled: n = !0 } = t;
1030
- _(() => {
1030
+ k(() => {
1031
1031
  const s = Cr(r);
1032
1032
  if (!n || !s) return;
1033
1033
  const i = (a) => {
1034
- if (!Dr(a) || a.defaultPrevented || Lr(a.target)) return;
1034
+ if (!Lr(a) || a.defaultPrevented || Dr(a.target)) return;
1035
1035
  const l = Ve(a);
1036
1036
  if (!l) return;
1037
1037
  const d = e.current;
@@ -1043,84 +1043,84 @@ var Gr = "drqe3uh", Er = "drqe3ui", Ee = {
1043
1043
  r,
1044
1044
  n
1045
1045
  ]);
1046
- }, Cr = (e) => e === void 0 ? window : e !== null && "current" in e ? e.current : e, Dr = (e) => "key" in e, Lr = (e) => e instanceof HTMLInputElement ? !wr.has(e.type) : e instanceof HTMLElement ? e.isContentEditable || e.tagName === "TEXTAREA" : !1, Yn = () => {
1046
+ }, Cr = (e) => e === void 0 ? window : e !== null && "current" in e ? e.current : e, Lr = (e) => "key" in e, Dr = (e) => e instanceof HTMLInputElement ? !Pr.has(e.type) : e instanceof HTMLElement ? e.isContentEditable || e.tagName === "TEXTAREA" : !1, Yn = () => {
1047
1047
  const { targetBoundaryStore: e } = ae();
1048
1048
  return ie(e, (t) => t.boundary);
1049
1049
  };
1050
1050
  export {
1051
- on as CanvasTextMeasurer,
1052
- Ar as DefaultFooter,
1051
+ rn as CanvasTextMeasurer,
1052
+ tn as DefaultFooter,
1053
1053
  tr as DefaultGeomCircle,
1054
1054
  rr as DefaultGeomLine,
1055
1055
  sr as DefaultGeomPath,
1056
1056
  nr as DefaultGeomRect,
1057
- hn as DefaultGrid,
1057
+ gn as DefaultGrid,
1058
1058
  yn as DefaultHeader,
1059
- Rn as DefaultSwatch,
1059
+ on as DefaultSwatch,
1060
1060
  In as DefaultTooltip,
1061
1061
  Un as DevToolsPanel,
1062
- _e as GRAPH_MODES,
1062
+ je as GRAPH_MODES,
1063
1063
  Mn as GeomCircle,
1064
1064
  An as GeomLine,
1065
- Jr as GeomOverpaint,
1066
- kr as GeomPanelSizeProvider,
1065
+ bn as GeomOverpaint,
1066
+ zr as GeomPanelSizeProvider,
1067
1067
  Bn as GeomPath,
1068
1068
  On as GeomRect,
1069
- Pt as GraphErrorBoundary,
1069
+ Nt as GraphErrorBoundary,
1070
1070
  fe as GraphErrorPanel,
1071
- Jt as GraphProvider,
1072
- tn as GraphRenderer,
1073
- en as GraphyBadge,
1074
- Br as HoverProvider,
1075
- Ur as IntlProvider,
1076
- Gn as IntroFade,
1077
- jr as IntroWipeClip,
1071
+ Qt as GraphProvider,
1072
+ nn as GraphRenderer,
1073
+ Wr as GraphyBadge,
1074
+ en as HoverProvider,
1075
+ Kr as IntlProvider,
1076
+ Rn as IntroFade,
1077
+ $r as IntroWipeClip,
1078
1078
  Fn as SymbolFigure,
1079
- vn as TextMeasurerProvider,
1080
- zr as ThemeProvider,
1079
+ cn as TextMeasurerProvider,
1080
+ hn as ThemeProvider,
1081
1081
  zn as UnitBoxSvg,
1082
1082
  Kn as UnitSpaceSvg,
1083
- xr as buildDotsEditOutlineShapes,
1083
+ Sn as buildDotsEditOutlineShapes,
1084
1084
  Hn as createGraphyKit,
1085
- un as darkTheme,
1086
- bn as defineGeomRenderer,
1087
- Qr as defineGlyph,
1088
- cn as getBuiltInEditOutlineShapes,
1089
- Fr as lightTheme,
1090
- rn as lightenCss,
1091
- wt as pruneSelection,
1085
+ jr as darkTheme,
1086
+ fn as defineGeomRenderer,
1087
+ Yr as defineGlyph,
1088
+ En as getBuiltInEditOutlineShapes,
1089
+ Mr as lightTheme,
1090
+ Vr as lightenCss,
1091
+ Pt as pruneSelection,
1092
1092
  K as readPositionPixels,
1093
1093
  xn as readRectPixels,
1094
- Zr as resolveGraphyBadgeVariant,
1095
- Yr as resolvePathStroke,
1094
+ _r as resolveGraphyBadgeVariant,
1095
+ Ar as resolvePathStroke,
1096
1096
  Or as scalePointToPanel,
1097
- wn as stampAxisEditTarget,
1098
- _r as stampGridEditTarget,
1099
- Xr as stampLegendEditTarget,
1100
- $r as useElementScreenRect,
1101
- Pn as useFormattingLocale,
1102
- Mr as useGeomHitTest,
1103
- Vr as useGeomHover,
1104
- Kr as useGeomPanelSize,
1105
- En as useGeomReaderTree,
1106
- fn as useGeomStyleReader,
1107
- He as useGeomViewportSize,
1097
+ Pn as stampAxisEditTarget,
1098
+ kr as stampGridEditTarget,
1099
+ Jr as stampLegendEditTarget,
1100
+ Zr as useElementScreenRect,
1101
+ Xr as useFormattingLocale,
1102
+ Br as useGeomHitTest,
1103
+ Fr as useGeomHover,
1104
+ xr as useGeomPanelSize,
1105
+ Gn as useGeomReaderTree,
1106
+ dn as useGeomStyleReader,
1107
+ Qe as useGeomViewportSize,
1108
1108
  re as useGraphAnimation,
1109
1109
  pn as useGraphCommands,
1110
- an as useGraphHandle,
1110
+ ln as useGraphHandle,
1111
1111
  jn as useGraphHistory,
1112
1112
  Wn as useGraphHistoryShortcuts,
1113
- nn as useGraphLocale,
1113
+ Hr as useGraphLocale,
1114
1114
  Nn as useGraphSelection,
1115
- dn as useGuidesTakePress,
1116
- Sn as useHandleScene,
1117
- Wr as useHoverState,
1115
+ un as useGuidesTakePress,
1116
+ Tn as useHandleScene,
1117
+ Qr as useHoverState,
1118
1118
  mn as usePaintDefs,
1119
- sn as useResolvedStyle,
1120
- Be as useSceneSelector,
1121
- Tn as useStyleReaderTree,
1122
- ln as useStyleResolver,
1119
+ wn as useResolvedStyle,
1120
+ Ye as useSceneSelector,
1121
+ sn as useStyleReaderTree,
1122
+ vn as useStyleResolver,
1123
1123
  Yn as useTargetBoundary,
1124
- gn as useTextMeasurer,
1125
- Hr as vars
1124
+ an as useTextMeasurer,
1125
+ Ur as vars
1126
1126
  };