@graphysdk/react-renderer 1.9.0-beta.1789558511894 → 1.9.0-beta.1789572763405

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,14 +1,14 @@
1
- import { A as Dt, At as $t, Bt as Ht, Ct as le, Dt as ue, Et as xt, Ht as he, It as Mt, M as Pt, N as Lt, Ot as Bt, Rt as Ot, St as U, Ut as ne, Vt as At, Wt as K, X as Kt, Z as Ut, _ as jt, _t as Ft, a as Yt, at as Wt, bt as ge, dt as Vt, ft as Xt, gt as zt, i as Qt, it as Zt, k as Jt, kt as er, lt as tr, n as rr, nt as nr, r as sr, s as or, t as me, xt as ir, yt as O, zt as ar } from "./history-chords-D--YHD4z.js";
2
- import { n as dr } from "./theme.contract.css-DaZ5UPN0.js";
3
- import { COMPILER_STAGE_KEYS as j, Geom as pe, GraphCompilationSession as fe, areEditTargetsEqual as ve, buildDiagnostic as V, createAnchorResolver as ye, createCompiler as Se, createGraphyBuilder as be, createStyleResolver as Ee, findAnnotation as Re, findLayerById as X, isCompilerCachingEnabled as Te, resolveDefinition as Ne, setCompilerCachingEnabled as Ce, toPercent as P } from "@graphysdk/viz-engine";
4
- import { Component as qe, useCallback as f, useEffect as H, useId as Ie, useImperativeHandle as ke, useMemo as $, useRef as z, useState as R, useSyncExternalStore as Ge } from "react";
5
- import { Fragment as _e, jsx as d, jsxs as v } from "react/jsx-runtime";
6
- import { useStore as Q } from "zustand";
1
+ import { $ as Dt, At as $t, Bt as Ht, Ct as xt, F as Mt, Gt as ne, Ht as Pt, Kt as A, M as Lt, Mt as Bt, Ot as Kt, P as Ot, Q as At, Rt as jt, St as le, Tt as ue, Ut, Vt as Ft, Wt as he, _ as Yt, a as Wt, dt as Vt, i as Qt, it as Xt, j as zt, jt as Jt, kt as me, mt as Zt, n as er, ot as tr, pt as rr, r as nr, s as sr, st as or, t as ge, vt as ir, wt as j, xt as K, yt as ar } from "./history-chords-3nxfCajN.js";
2
+ import { n as dr } from "./theme.contract.css-BVYwXVfn.js";
3
+ import { COMPILER_STAGE_KEYS as U, Geom as pe, GraphCompilationSession as fe, areEditTargetsEqual as ve, buildDiagnostic as V, createAnchorResolver as ye, createCompiler as Se, createGraphyBuilder as be, createStyleResolver as Ee, findAnnotation as Te, findLayerById as Q, isCompilerCachingEnabled as Re, resolveDefinition as Ne, setCompilerCachingEnabled as Ce, toPercent as P } from "@graphysdk/viz-engine";
4
+ import { Component as qe, useCallback as f, useEffect as H, useId as Ge, useImperativeHandle as Ie, useMemo as $, useRef as X, useState as T, useSyncExternalStore as ke } from "react";
5
+ import { Fragment as we, jsx as d, jsxs as v } from "react/jsx-runtime";
6
+ import { useStore as z } from "zustand";
7
7
  import { createStore as F } from "zustand/vanilla";
8
- import we from "clsx";
8
+ import _e from "clsx";
9
9
  import './index.css';var De = "_1a5iqpb0", $e = "_1a5iqpb1";
10
10
  var He = "_1a5iqpb3", xe = "_1a5iqpb4", Me = "_1a5iqpb5";
11
- var Z = ({ errors: e }) => {
11
+ var J = ({ errors: e }) => {
12
12
  const [t, ...r] = e;
13
13
  return /* @__PURE__ */ v("div", {
14
14
  role: "alert",
@@ -18,14 +18,14 @@ var Z = ({ errors: e }) => {
18
18
  className: $e,
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: He,
30
30
  children: [
31
31
  /* @__PURE__ */ d("span", {
@@ -54,32 +54,32 @@ var Le = class extends qe {
54
54
  }
55
55
  componentDidCatch(e, t) {
56
56
  const r = V(e);
57
- K([r]), this.props.onError?.([r]), console.error("Chart render component stack:", t.componentStack);
57
+ A([r]), this.props.onError?.([r]), console.error("Chart render component stack:", t.componentStack);
58
58
  }
59
59
  componentDidUpdate(e) {
60
60
  this.state.caughtDiagnostic && !Pe(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(J, { 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(J, { errors: t }) : r;
67
67
  }
68
68
  }, se = (e) => typeof e == "object" && "geom" in e && "render" in e, Be = (e) => {
69
69
  const t = Ne(e);
70
70
  return t instanceof pe ? t : null;
71
- }, Oe = (e, t) => {
72
- const r = e.filter((n) => Ae(n, t));
71
+ }, Ke = (e, t) => {
72
+ const r = e.filter((n) => Oe(n, t));
73
73
  return r.length === e.length ? e : r;
74
- }, Ae = (e, t) => e.kind === "annotation" ? Re(t.annotations, e.id) !== null : e.kind === "observations" ? X(t.layers, e.layerId) !== void 0 : e.kind === "layer" && e.layerId !== void 0 ? X(t.layers, e.layerId) !== void 0 : !0, ee = [], Ke = () => F((e) => ({
74
+ }, Oe = (e, t) => e.kind === "annotation" ? Te(t.annotations, e.id) !== null : e.kind === "observations" ? Q(t.layers, e.layerId) !== void 0 : e.kind === "layer" && e.layerId !== void 0 ? Q(t.layers, e.layerId) !== void 0 : !0, ee = [], Ae = () => F((e) => ({
75
75
  selection: ee,
76
- setSelection: (t) => e((r) => Ue(r.selection, t) ? r : { selection: t }),
76
+ setSelection: (t) => e((r) => je(r.selection, t) ? r : { selection: t }),
77
77
  clearSelection: () => e((t) => t.selection.length === 0 ? t : { selection: ee })
78
- })), Ue = (e, t) => e === t ? !0 : e.length !== t.length ? !1 : e.every((r, n) => {
78
+ })), je = (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 = process.env.NODE_ENV !== "production", Fe = 5, Ye = (e) => {
82
- if (!je) return {
81
+ }), Ue = process.env.NODE_ENV !== "production", Fe = 5, Ye = (e) => {
82
+ if (!Ue) return {
83
83
  emit: () => {
84
84
  },
85
85
  subscribe: () => Ve,
@@ -113,19 +113,19 @@ var Le = class extends qe {
113
113
  if (n.lastSnapshot === r) return n;
114
114
  const o = {
115
115
  id: n.nextId,
116
- label: Xe(t),
116
+ label: Qe(t),
117
117
  stages: r.stages,
118
118
  durationMs: r.durationMs
119
119
  };
120
120
  return {
121
121
  lastCompile: o,
122
- history: ze(n.history, o, Fe),
122
+ history: Xe(n.history, o, Fe),
123
123
  nextId: n.nextId + 1,
124
124
  lastSnapshot: r
125
125
  };
126
126
  })
127
127
  })), Ve = () => {
128
- }, Xe = (e) => {
128
+ }, Qe = (e) => {
129
129
  switch (e.kind) {
130
130
  case "init":
131
131
  return "init";
@@ -136,12 +136,12 @@ var Le = class extends qe {
136
136
  case "command":
137
137
  return e.command.metadata.description;
138
138
  }
139
- }, ze = (e, t, r) => {
139
+ }, Xe = (e, t, r) => {
140
140
  const n = e.length >= r ? e.length - (r - 1) : 0;
141
141
  return [...e.slice(n), t];
142
142
  };
143
- function Qe(e) {
144
- const t = e.filter(se), r = /* @__PURE__ */ new Set([...Object.keys(le), ...t.map((c) => c.geom)]), n = [], o = /* @__PURE__ */ new Set();
143
+ function ze(e) {
144
+ const t = e.filter(se), r = /* @__PURE__ */ new Set([...Object.keys(ue), ...t.map((c) => c.geom)]), n = [], o = /* @__PURE__ */ new Set();
145
145
  for (const c of e) {
146
146
  const u = Be(c);
147
147
  u === null || r.has(u.type) || o.has(u.type) || (o.add(u.type), n.push({
@@ -184,7 +184,7 @@ function Qe(e) {
184
184
  warnings: i
185
185
  };
186
186
  }
187
- function Ze(e, t) {
187
+ function Je(e, t) {
188
188
  const { coordSystem: r, layers: n } = e, o = /* @__PURE__ */ new Set(), a = [];
189
189
  for (const i of n)
190
190
  t(i.geom, r.type) !== null || o.has(i.geom) || (o.add(i.geom), a.push({
@@ -200,12 +200,12 @@ function Ze(e, t) {
200
200
  }));
201
201
  return a;
202
202
  }
203
- function Je(e, t) {
203
+ function Ze(e, t) {
204
204
  const { coordSystem: r, layers: n } = e, o = /* @__PURE__ */ new Set(), a = [];
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 || U(c) || (o.add(i.geom), a.push({
208
+ c === null || c.hitTest || j(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 tt(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 || !U(c) || (o.add(i.geom), a.push({
245
+ c === null || !c.hitTest || !j(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 nt(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 || !U(c) || (o.add(i.geom), a.push({
280
+ c === null || !j(c) || (o.add(i.geom), a.push({
281
281
  kind: "user-input",
282
282
  severity: "warning",
283
283
  code: "OVERLAY_REQUIRES_RENDER_HIT_TEST",
@@ -295,104 +295,104 @@ var st = (e) => F((t) => ({
295
295
  scene: e,
296
296
  setScene: (r) => t((n) => n.scene === r ? n : { scene: r })
297
297
  })), ot = ({ input: e, data: t, customPalettes: r, colorScheme: n, plugins: o, resolveRenderer: a, anchorResolver: i, onChange: c, onError: u, onWarnings: h }) => {
298
- const T = O(c), k = O(u), q = O(h), [{ session: g, compileBus: l }] = R(() => {
298
+ const R = K(c), I = K(u), q = K(h), [{ session: m, compileBus: l }] = T(() => {
299
299
  const s = Se({ plugins: o });
300
300
  return {
301
301
  session: new fe(s),
302
302
  compileBus: Ye(s)
303
303
  };
304
- }), [p] = R(() => Qe(o ?? [])), y = z(null), [G] = R(it), N = z(null), S = f((s) => p.errors.length === 0 ? s : [...p.errors, ...s ?? []], [p]), w = f((s) => {
304
+ }), [p] = T(() => ze(o ?? [])), y = X(null), [k] = T(it), N = X(null), S = f((s) => p.errors.length === 0 ? s : [...p.errors, ...s ?? []], [p]), _ = f((s) => {
305
305
  if (!s.ok) return s.errors;
306
306
  if (N.current) N.current.getState().setScene(s.scene);
307
307
  else {
308
- const m = st(s.scene);
309
- m.subscribe(G.notify), N.current = m, G.notify();
308
+ const g = st(s.scene);
309
+ g.subscribe(k.notify), N.current = g, k.notify();
310
310
  }
311
311
  return null;
312
- }, [G]), [x, D] = R(() => {
313
- const s = g.compile({
312
+ }, [k]), [x, D] = T(() => {
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(w(s));
320
- }), I = f((s) => s.ok ? [
319
+ return y.current = s, S(_(s));
320
+ }), G = f((s) => s.ok ? [
321
321
  ...s.warnings,
322
- ...Ze(s.scene, a),
323
322
  ...Je(s.scene, a),
323
+ ...Ze(s.scene, a),
324
324
  ...et(s.scene),
325
325
  ...tt(s.scene, a),
326
326
  ...nt(s.scene, a),
327
327
  ...rt(s.scene, i)
328
328
  ] : s.warnings, [a, i]), b = f((s) => {
329
- s.length !== 0 && (K(s), k.current?.(s));
330
- }, [k]), C = f((s) => {
331
- s.length !== 0 && (K(s), q.current?.(s));
329
+ s.length !== 0 && (A(s), I.current?.(s));
330
+ }, [I]), C = f((s) => {
331
+ s.length !== 0 && (A(s), q.current?.(s));
332
332
  }, [q]);
333
333
  H(() => {
334
334
  const s = y.current;
335
- s && (b([...p.errors, ...s.ok ? [] : s.errors]), C([...p.warnings, ...I(s)]), s.ok && l.emit({ kind: "init" }));
335
+ s && (b([...p.errors, ...s.ok ? [] : s.errors]), C([...p.warnings, ...G(s)]), s.ok && l.emit({ kind: "init" }));
336
336
  }, [
337
337
  l,
338
338
  b,
339
339
  C,
340
340
  p,
341
- I
341
+ G
342
342
  ]), H(() => {
343
- const s = g.update({
343
+ const s = m.update({
344
344
  input: e,
345
345
  data: t,
346
346
  customPalettes: r,
347
347
  colorScheme: n
348
348
  });
349
349
  if (!s) return;
350
- s.sealedInput && T.current?.(s.sealedInput);
351
- const m = w(s.result);
352
- D(S(m)), m && b(m), C(I(s.result)), m || l.emit({ kind: s.inputChanged ? "input" : "data" });
350
+ s.sealedInput && R.current?.(s.sealedInput);
351
+ const g = _(s.result);
352
+ D(S(g)), g && b(g), C(G(s.result)), g || l.emit({ kind: s.inputChanged ? "input" : "data" });
353
353
  }, [
354
354
  e,
355
355
  t,
356
356
  r,
357
357
  n,
358
- g,
358
+ m,
359
359
  l,
360
- w,
360
+ _,
361
361
  b,
362
362
  C,
363
363
  S,
364
- I,
365
- T
364
+ G,
365
+ R
366
366
  ]);
367
- const _ = f((s) => {
368
- D((m) => m === null ? m : S(null)), C(I(s));
367
+ const w = f((s) => {
368
+ D((g) => g === null ? g : S(null)), C(G(s));
369
369
  }, [
370
370
  S,
371
371
  C,
372
- I
372
+ G
373
373
  ]), M = f((s) => {
374
- s.scene && N.current?.getState().setScene(s.scene), s.result && _(s.result), s.command && l.emit({
374
+ s.scene && N.current?.getState().setScene(s.scene), s.result && w(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 && R.current?.(s.input), s.errors && b([...s.errors]);
378
378
  }, [
379
- _,
379
+ w,
380
380
  l,
381
- T,
381
+ R,
382
382
  b
383
383
  ]), E = f((s) => {
384
- for (const m of s) M(m);
385
- return s.some((m) => !!m.scene);
386
- }, [M]), B = f((s, m) => {
387
- E(g.applyCommand(s, m));
388
- }, [g, E]), ae = f(() => {
389
- E(g.seal());
390
- }, [g, E]), Y = f(() => E(g.undo()), [g, E]), W = f(() => E(g.redo()), [g, E]), ce = $(() => ({
391
- stack: g.history,
384
+ for (const g of s) M(g);
385
+ return s.some((g) => !!g.scene);
386
+ }, [M]), B = f((s, g) => {
387
+ E(m.applyCommand(s, g));
388
+ }, [m, E]), ae = f(() => {
389
+ E(m.seal());
390
+ }, [m, E]), Y = f(() => E(m.undo()), [m, E]), W = f(() => E(m.redo()), [m, E]), ce = $(() => ({
391
+ stack: m.history,
392
392
  undo: Y,
393
393
  redo: W
394
394
  }), [
395
- g,
395
+ m,
396
396
  Y,
397
397
  W
398
398
  ]), de = f(() => N.current?.getState().scene ?? null, []);
@@ -401,7 +401,7 @@ var st = (e) => F((t) => ({
401
401
  dispatch: B,
402
402
  seal: ae,
403
403
  history: ce,
404
- subscribe: G.subscribe,
404
+ subscribe: k.subscribe,
405
405
  getScene: de,
406
406
  compileBus: l,
407
407
  compileErrors: x
@@ -414,44 +414,44 @@ var st = (e) => F((t) => ({
414
414
  }),
415
415
  notify: () => e.forEach((t) => t())
416
416
  };
417
- }, at = ({ 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 [k] = R(() => ge(r.filter(se))), q = Ie(), [g] = R(() => ye(r)), [l] = R(() => Ke()), p = $(() => Ee({ colorScheme: h }), [h]), { store: y, dispatch: G, seal: N, history: S, subscribe: w, getScene: x, compileBus: D, compileErrors: I } = ot({
417
+ }, at = ({ data: e, input: t, plugins: r = [], formattingLocale: n, handleRef: o, onChange: a, onError: i, onWarnings: c, customPalettes: u, colorScheme: h = "light", children: R }) => {
418
+ const [I] = T(() => le(r.filter(se))), q = Ge(), [m] = T(() => ye(r)), [l] = T(() => Ae()), p = $(() => Ee({ colorScheme: h }), [h]), { store: y, dispatch: k, seal: N, history: S, subscribe: _, getScene: x, compileBus: D, compileErrors: G } = ot({
419
419
  input: t,
420
420
  data: e,
421
421
  customPalettes: u,
422
422
  colorScheme: h,
423
423
  plugins: r,
424
- resolveRenderer: k,
425
- anchorResolver: g,
424
+ resolveRenderer: I,
425
+ anchorResolver: m,
426
426
  onChange: a,
427
427
  onError: i,
428
428
  onWarnings: c
429
429
  });
430
430
  H(() => {
431
431
  if (y)
432
- return y.subscribe((_, M) => {
433
- if (_.scene.spec === M.scene.spec) return;
432
+ return y.subscribe((w, M) => {
433
+ if (w.scene.spec === M.scene.spec) return;
434
434
  const { selection: E, setSelection: B } = l.getState();
435
- E.length !== 0 && B(Oe(E, _.scene.spec));
435
+ E.length !== 0 && B(Ke(E, w.scene.spec));
436
436
  });
437
437
  }, [y, l]);
438
438
  const b = $(() => ({
439
- dispatch: G,
439
+ dispatch: k,
440
440
  seal: N
441
- }), [G, N]);
442
- ke(o, () => ({
441
+ }), [k, N]);
442
+ Ie(o, () => ({
443
443
  commands: b,
444
444
  undo: S.undo,
445
445
  redo: S.redo,
446
- subscribe: w,
446
+ subscribe: _,
447
447
  getScene: x,
448
448
  getSelection: () => l.getState().selection,
449
- setSelection: (_) => l.getState().setSelection(_),
449
+ setSelection: (w) => l.getState().setSelection(w),
450
450
  subscribeSelection: l.subscribe
451
451
  }), [
452
452
  b,
453
453
  S,
454
- w,
454
+ _,
455
455
  x,
456
456
  l
457
457
  ]);
@@ -465,7 +465,7 @@ var st = (e) => F((t) => ({
465
465
  compileBus: D,
466
466
  colorScheme: h,
467
467
  styleResolver: p,
468
- anchorResolver: g
468
+ anchorResolver: m
469
469
  } : null, [
470
470
  q,
471
471
  y,
@@ -476,17 +476,17 @@ var st = (e) => F((t) => ({
476
476
  D,
477
477
  h,
478
478
  p,
479
- g
479
+ m
480
480
  ]);
481
481
  return /* @__PURE__ */ d(Le, {
482
- forcedErrors: I,
482
+ forcedErrors: G,
483
483
  onError: i,
484
484
  resetKeys: [t, e],
485
485
  children: C ? /* @__PURE__ */ d(he.Provider, {
486
486
  value: C,
487
- children: /* @__PURE__ */ d(ue, {
488
- value: k,
489
- children: T
487
+ children: /* @__PURE__ */ d(me, {
488
+ value: I,
489
+ children: R
490
490
  })
491
491
  }) : null
492
492
  });
@@ -517,9 +517,9 @@ var vr = ({ children: e, ...t }) => /* @__PURE__ */ d("svg", {
517
517
  overflow: "hidden",
518
518
  pointerEvents: "none",
519
519
  children: t
520
- }), ct = "drqe3u0", dt = "drqe3u1", lt = "drqe3u2", ut = "drqe3u3", L = "drqe3u4", ht = "drqe3u5", gt = "drqe3u6", mt = "drqe3u7", A = "drqe3u8", pt = "drqe3u9", ft = "drqe3ua";
520
+ }), ct = "drqe3u0", dt = "drqe3u1", lt = "drqe3u2", ut = "drqe3u3", L = "drqe3u4", ht = "drqe3u5", mt = "drqe3u6", gt = "drqe3u7", O = "drqe3u8", pt = "drqe3u9", ft = "drqe3ua";
521
521
  var vt = "drqe3uc", yt = "drqe3ud", St = "drqe3ue", bt = "drqe3uf";
522
- var Et = "drqe3uh", Rt = "drqe3ui", te = {
522
+ var Et = "drqe3uh", Tt = "drqe3ui", te = {
523
523
  enabled: "drqe3uk drqe3uj",
524
524
  disabled: "drqe3ul drqe3uj"
525
525
  }, re = {
@@ -530,19 +530,19 @@ var Et = "drqe3uh", Rt = "drqe3ui", te = {
530
530
  cached: "drqe3ur drqe3up",
531
531
  untouched: "drqe3us drqe3up"
532
532
  }, Sr = ({ width: e = 380, style: t, className: r } = {}) => {
533
- const { compileBus: n } = ne(), [o] = R(() => We()), [a, i] = R(!1), [c, u] = R(Te);
533
+ const { compileBus: n } = ne(), [o] = T(() => We()), [a, i] = T(!1), [c, u] = T(Re);
534
534
  H(() => {
535
535
  const { recordCompile: l } = o.getState(), p = n.getLastTrigger(), y = n.getLastCompile();
536
536
  return p && y && l(p, y), n.subscribe(l);
537
537
  }, [o, n]);
538
- const h = Q(o, (l) => l.lastCompile), T = Q(o, (l) => l.history), k = n.getCacheStats(), q = h === null && T.length === 0, g = () => {
538
+ const h = z(o, (l) => l.lastCompile), R = z(o, (l) => l.history), I = n.getCacheStats(), q = h === null && R.length === 0, m = () => {
539
539
  u((l) => {
540
540
  const p = !l;
541
541
  return Ce(p), p;
542
542
  });
543
543
  };
544
544
  return /* @__PURE__ */ v("div", {
545
- className: we(ft, r),
545
+ className: _e(ft, r),
546
546
  style: {
547
547
  width: e,
548
548
  ...t
@@ -567,7 +567,7 @@ var Et = "drqe3uh", Rt = "drqe3ui", te = {
567
567
  className: "drqe3ub",
568
568
  children: [/* @__PURE__ */ v("button", {
569
569
  type: "button",
570
- onClick: g,
570
+ onClick: m,
571
571
  className: c ? te.enabled : te.disabled,
572
572
  "aria-pressed": c,
573
573
  children: ["cache ", c ? "enabled" : "disabled"]
@@ -576,13 +576,13 @@ var Et = "drqe3uh", Rt = "drqe3ui", te = {
576
576
  children: "next compile reflects this toggle"
577
577
  })]
578
578
  }),
579
- !a && !q && /* @__PURE__ */ v(_e, { children: [/* @__PURE__ */ d(Tt, {
579
+ !a && !q && /* @__PURE__ */ v(we, { children: [/* @__PURE__ */ d(Rt, {
580
580
  delta: h?.stages,
581
- cumulative: k
582
- }), /* @__PURE__ */ d(Nt, { entries: T })] })
581
+ cumulative: I
582
+ }), /* @__PURE__ */ d(Nt, { entries: R })] })
583
583
  ]
584
584
  });
585
- }, Tt = ({ delta: e, cumulative: t }) => /* @__PURE__ */ v("table", {
585
+ }, Rt = ({ delta: e, cumulative: t }) => /* @__PURE__ */ v("table", {
586
586
  className: lt,
587
587
  children: [/* @__PURE__ */ d("thead", { children: /* @__PURE__ */ v("tr", {
588
588
  className: Et,
@@ -608,7 +608,7 @@ var Et = "drqe3uh", Rt = "drqe3ui", te = {
608
608
  children: "total hit"
609
609
  })
610
610
  ]
611
- }) }), /* @__PURE__ */ d("tbody", { children: j.map((r) => {
611
+ }) }), /* @__PURE__ */ d("tbody", { children: U.map((r) => {
612
612
  const n = e?.[r], o = Ct(n);
613
613
  return /* @__PURE__ */ v("tr", {
614
614
  className: vt,
@@ -629,15 +629,15 @@ var Et = "drqe3uh", Rt = "drqe3ui", te = {
629
629
  children: n?.misses ?? 0
630
630
  }),
631
631
  /* @__PURE__ */ d("td", {
632
- className: A,
632
+ className: O,
633
633
  children: n?.hits ?? 0
634
634
  }),
635
635
  /* @__PURE__ */ d("td", {
636
- className: A,
636
+ className: O,
637
637
  children: t[r].misses
638
638
  }),
639
639
  /* @__PURE__ */ d("td", {
640
- className: A,
640
+ className: O,
641
641
  children: t[r].hits
642
642
  })
643
643
  ]
@@ -646,19 +646,19 @@ var Et = "drqe3uh", Rt = "drqe3ui", te = {
646
646
  }), Nt = ({ entries: e }) => e.length === 0 ? null : /* @__PURE__ */ v("div", {
647
647
  className: yt,
648
648
  children: [/* @__PURE__ */ d("div", {
649
- className: Rt,
649
+ className: Tt,
650
650
  children: "recent compiles"
651
651
  }), e.map((t) => {
652
- const r = qt(t.stages, (a) => a.misses > 0), n = j.length;
652
+ const r = qt(t.stages, (a) => a.misses > 0), n = U.length;
653
653
  return /* @__PURE__ */ v("div", {
654
- className: gt,
654
+ className: mt,
655
655
  children: [
656
656
  /* @__PURE__ */ d("span", {
657
657
  className: oe[r === 0 ? "cached" : "ran"],
658
658
  "aria-hidden": !0
659
659
  }),
660
660
  /* @__PURE__ */ d("span", {
661
- className: mt,
661
+ className: gt,
662
662
  title: t.label,
663
663
  children: t.label
664
664
  }),
@@ -677,10 +677,10 @@ var Et = "drqe3uh", Rt = "drqe3ui", te = {
677
677
  })]
678
678
  }), Ct = (e) => !e || e.hits === 0 && e.misses === 0 ? "untouched" : e.misses > 0 ? "ran" : "cached", qt = (e, t) => {
679
679
  let r = 0;
680
- for (const n of j) t(e[n]) && (r += 1);
680
+ for (const n of U) t(e[n]) && (r += 1);
681
681
  return r;
682
682
  }, ie = (e) => e >= 10 ? `${e.toFixed(0)}ms` : `${e.toFixed(2)}ms`, br = () => {
683
- const { history: e } = ne(), { stack: t, undo: r, redo: n } = e, o = f((c) => t.subscribe(c), [t]), a = f(() => t.getSnapshot(), [t]), i = Ge(o, a, a);
683
+ const { history: e } = ne(), { stack: t, undo: r, redo: n } = e, o = f((c) => t.subscribe(c), [t]), a = f(() => t.getSnapshot(), [t]), i = ke(o, a, a);
684
684
  return $(() => ({
685
685
  ...i,
686
686
  undo: r,
@@ -690,7 +690,7 @@ var Et = "drqe3uh", Rt = "drqe3ui", te = {
690
690
  r,
691
691
  n
692
692
  ]);
693
- }, It = /* @__PURE__ */ new Set([
693
+ }, Gt = /* @__PURE__ */ new Set([
694
694
  "button",
695
695
  "checkbox",
696
696
  "color",
@@ -704,11 +704,11 @@ var Et = "drqe3uh", Rt = "drqe3ui", te = {
704
704
  ]), Er = (e, t = {}) => {
705
705
  const { target: r, enabled: n = !0 } = t;
706
706
  H(() => {
707
- const o = kt(r);
707
+ const o = It(r);
708
708
  if (!n || !o) return;
709
709
  const a = (i) => {
710
- if (!Gt(i) || i.defaultPrevented || _t(i.target)) return;
711
- const c = me(i);
710
+ if (!kt(i) || i.defaultPrevented || wt(i.target)) return;
711
+ const c = ge(i);
712
712
  if (!c) return;
713
713
  const u = e.current;
714
714
  u && (c === "undo" ? u.undo() : u.redo()) && i.preventDefault();
@@ -719,47 +719,47 @@ var Et = "drqe3uh", Rt = "drqe3ui", te = {
719
719
  r,
720
720
  n
721
721
  ]);
722
- }, kt = (e) => e === void 0 ? window : e !== null && "current" in e ? e.current : e, Gt = (e) => "key" in e, _t = (e) => e instanceof HTMLInputElement ? !It.has(e.type) : e instanceof HTMLElement ? e.isContentEditable || e.tagName === "TEXTAREA" : !1;
722
+ }, It = (e) => e === void 0 ? window : e !== null && "current" in e ? e.current : e, kt = (e) => "key" in e, wt = (e) => e instanceof HTMLInputElement ? !Gt.has(e.type) : e instanceof HTMLElement ? e.isContentEditable || e.tagName === "TEXTAREA" : !1;
723
723
  export {
724
- Pt as BrandMark,
725
- $t as CanvasTextMeasurer,
726
- Dt as DefaultFooter,
727
- or as DefaultGrid,
728
- Jt as DefaultHeader,
729
- xt as DefaultSwatch,
730
- Kt as DefaultTooltip,
724
+ Ot as BrandMark,
725
+ Bt as CanvasTextMeasurer,
726
+ Lt as DefaultFooter,
727
+ sr as DefaultGrid,
728
+ zt as DefaultHeader,
729
+ Kt as DefaultSwatch,
730
+ At as DefaultTooltip,
731
731
  Sr as DevToolsPanel,
732
- tr as GRAPH_MODES,
732
+ Vt as GRAPH_MODES,
733
733
  Le as GraphErrorBoundary,
734
- Z as GraphErrorPanel,
734
+ J as GraphErrorPanel,
735
735
  at as GraphProvider,
736
- Yt as GraphRenderer,
737
- Ft as HoverProvider,
738
- Bt as TextMeasurerProvider,
739
- nr as ThemeProvider,
736
+ Wt as GraphRenderer,
737
+ ar as HoverProvider,
738
+ $t as TextMeasurerProvider,
739
+ Xt as ThemeProvider,
740
740
  yr as UnitBoxSvg,
741
741
  vr as UnitSpaceSvg,
742
742
  fr as createGraphyKit,
743
- Zt as darkTheme,
744
- ir as defineGeomRenderer,
745
- Wt as lightTheme,
746
- Mt as lightenCss,
747
- Oe as pruneSelection,
748
- Lt as resolveBrandMarkVisual,
749
- Xt as useElementScreenRect,
750
- zt as useGeomHitTest,
751
- Vt as useGeomHover,
752
- rr as useGraphCommands,
743
+ tr as darkTheme,
744
+ xt as defineGeomRenderer,
745
+ or as lightTheme,
746
+ jt as lightenCss,
747
+ Ke as pruneSelection,
748
+ Mt as resolveBrandMarkVisual,
749
+ Zt as useElementScreenRect,
750
+ ir as useGeomHitTest,
751
+ rr as useGeomHover,
752
+ er as useGraphCommands,
753
753
  Qt as useGraphHandle,
754
754
  br as useGraphHistory,
755
755
  Er as useGraphHistoryShortcuts,
756
- jt as useGraphSelection,
757
- sr as useHandleScene,
758
- Ut as useHoverState,
759
- At as useSceneSelector,
760
- Ot as useStyleReaderTree,
761
- ar as useStyleReaders,
762
- Ht as useStyleResolver,
763
- er as useTextMeasurer,
756
+ Yt as useGraphSelection,
757
+ nr as useHandleScene,
758
+ Dt as useHoverState,
759
+ Ut as useSceneSelector,
760
+ Ht as useStyleReaderTree,
761
+ Ft as useStyleReaders,
762
+ Pt as useStyleResolver,
763
+ Jt as useTextMeasurer,
764
764
  dr as vars
765
765
  };
@@ -1,4 +1,4 @@
1
- import './theme.contract.css';var a = [
1
+ var a = [
2
2
  "canvasDefault",
3
3
  "canvasBlue",
4
4
  "canvasCyan",
@@ -0,0 +1 @@
1
+ var a=["canvasDefault","canvasBlue","canvasCyan","canvasGreen","canvasYellow","canvasOrange","canvasRed","canvasPink","canvasPurple","canvasGray","canvasInverse"],r={white:"var(--graphy-white)",black:"var(--graphy-black)",transparent:"var(--graphy-transparent)",gray100:"var(--graphy-gray-100)",gray95:"var(--graphy-gray-95)",gray90:"var(--graphy-gray-90)",gray85:"var(--graphy-gray-85)",gray80:"var(--graphy-gray-80)",gray75:"var(--graphy-gray-75)",gray70:"var(--graphy-gray-70)",gray60:"var(--graphy-gray-60)",gray50:"var(--graphy-gray-50)",gray0:"var(--graphy-gray-0)",grayGradient80:"var(--graphy-gray-gradient-80)",green60:"var(--graphy-green-60)",green50:"var(--graphy-green-50)",red60:"var(--graphy-red-60)",red50:"var(--graphy-red-50)",amber70:"var(--graphy-amber-70)",amber50:"var(--graphy-amber-50)",amber40:"var(--graphy-amber-40)",amber30:"var(--graphy-amber-30)",blue80:"var(--graphy-blue-80)",blue60:"var(--graphy-blue-60)",purple50:"var(--graphy-purple-50)",purple30:"var(--graphy-purple-30)",brand:"var(--graphy-brand)",success:"var(--graphy-success)",warning:"var(--graphy-warning)",alert:"var(--graphy-alert)",textPrimary:"var(--graphy-text-primary)",textSecondary:"var(--graphy-text-secondary)",textDisabled:"var(--graphy-text-disabled)",iconPrimary:"var(--graphy-icon-primary)",iconSecondary:"var(--graphy-icon-secondary)",iconStickerBackground:"var(--graphy-icon-sticker-background)",border100:"var(--graphy-border-100)",border50:"var(--graphy-border-50)",border10:"var(--graphy-border-10)",sunkenBackground:"var(--graphy-sunken-background)",defaultBackground:"var(--graphy-default-background)",raisedBackground:"var(--graphy-raised-background)",overlayBackground:"var(--graphy-overlay-background)",overlayBorderGradient:"var(--graphy-overlay-border-gradient)",graphBackground:"var(--graphy-graph-background)",legendFocusOutlineColor:"var(--graphy-legend-focus-outline-color)",annotationFrameBorderColor:"var(--graphy-annotation-frame-border-color)",editMenuTriggerIconColor:"var(--graphy-edit-menu-trigger-icon-color)",tooltipRowGap:"var(--graphy-tooltip-row-gap)",editorControlHeight:"var(--graphy-editor-control-height)",legendSwatchGap:"var(--graphy-legend-swatch-gap)",headlineRowGap:"var(--graphy-headline-row-gap)",canvasDefault:"var(--graphy-canvas-default)",canvasBlue:"var(--graphy-canvas-blue)",canvasCyan:"var(--graphy-canvas-cyan)",canvasGreen:"var(--graphy-canvas-green)",canvasYellow:"var(--graphy-canvas-yellow)",canvasOrange:"var(--graphy-canvas-orange)",canvasRed:"var(--graphy-canvas-red)",canvasPink:"var(--graphy-canvas-pink)",canvasPurple:"var(--graphy-canvas-purple)",canvasGray:"var(--graphy-canvas-gray)",canvasInverse:"var(--graphy-canvas-inverse)",elevationXs:"var(--graphy-elevation-xs)",elevationSm:"var(--graphy-elevation-sm)",elevationMd:"var(--graphy-elevation-md)",elevationLg:"var(--graphy-elevation-lg)",radiiXs:"var(--graphy-radii-xs)",radiiSm:"var(--graphy-radii-sm)",radiiMd:"var(--graphy-radii-md)",radiiLg:"var(--graphy-radii-lg)",spaceXxs:"var(--graphy-space-xxs)",spaceXs:"var(--graphy-space-xs)",spaceSm:"var(--graphy-space-sm)",spaceMd:"var(--graphy-space-md)",spaceLg:"var(--graphy-space-lg)",spaceXl:"var(--graphy-space-xl)",zIndexToolbar:"var(--graphy-z-index-toolbar)",zIndexToolbarTooltip:"var(--graphy-z-index-toolbar-tooltip)",zIndexToolbarPopover:"var(--graphy-z-index-toolbar-popover)",zIndexEditorPopover:"var(--graphy-z-index-editor-popover)",toolbarBackgroundColor:"var(--graphy-toolbar-background-color)",toolbarButtonBackgroundColor:"var(--graphy-toolbar-button-background-color)",toolbarButtonBackgroundColorHovered:"var(--graphy-toolbar-button-background-color-hovered)",toolbarButtonBackgroundColorSelected:"var(--graphy-toolbar-button-background-color-selected)",toolbarSeparatorColor:"var(--graphy-toolbar-separator-color)",fontFamily:"var(--graphy-font-family)",fontFamilyHeading:"var(--graphy-font-family-heading)",fontWeightRegular:"var(--graphy-font-weight-regular)",fontWeightMedium:"var(--graphy-font-weight-medium)",fontWeightSemibold:"var(--graphy-font-weight-semibold)",fontWeightBold:"var(--graphy-font-weight-bold)",fontWeightExtraBold:"var(--graphy-font-weight-extra-bold)",textScale:"var(--graphy-text-scale)",fontSizeXxs:"var(--graphy-font-size-xxs)",fontSizeXs:"var(--graphy-font-size-xs)",fontSizeSm:"var(--graphy-font-size-sm)",fontSizeMd:"var(--graphy-font-size-md)",fontSizeLg:"var(--graphy-font-size-lg)",fontSizeXl:"var(--graphy-font-size-xl)",fontLineHeightXxs:"var(--graphy-font-line-height-xxs)",fontLineHeightXs:"var(--graphy-font-line-height-xs)",fontLineHeightSm:"var(--graphy-font-line-height-sm)",fontLineHeightMd:"var(--graphy-font-line-height-md)",fontLineHeightLg:"var(--graphy-font-line-height-lg)",fontLineHeightXl:"var(--graphy-font-line-height-xl)",fontSizeEditorBody:"var(--graphy-font-size-editor-body)",fontSizeHeadingSm:"var(--graphy-font-size-heading-sm)",fontSizeHeadingMd:"var(--graphy-font-size-heading-md)",fontSizeHeadingLg:"var(--graphy-font-size-heading-lg)",fontLineHeightEditorBody:"var(--graphy-font-line-height-editor-body)",fontLineHeightHeadingSm:"var(--graphy-font-line-height-heading-sm)",fontLineHeightHeadingMd:"var(--graphy-font-line-height-heading-md)",fontLineHeightHeadingLg:"var(--graphy-font-line-height-heading-lg)",fontButton:"var(--graphy-font-button)",fontInput:"var(--graphy-font-input)",fontInputLabel:"var(--graphy-font-input-label)",fontSelectLabel:"var(--graphy-font-select-label)",fontSelectDescription:"var(--graphy-font-select-description)",fontColorSelectLabel:"var(--graphy-font-color-select-label)",fontMenuTitle:"var(--graphy-font-menu-title)",fontMenuGroupTitle:"var(--graphy-font-menu-group-title)",fontMenuItemLabel:"var(--graphy-font-menu-item-label)",fontMenuItemLabelSecondary:"var(--graphy-font-menu-item-label-secondary)",fontUITooltip:"var(--graphy-font-uitooltip)",fontUITooltipSecondary:"var(--graphy-font-uitooltip-secondary)",fontErrorBoundaryTitle:"var(--graphy-font-error-boundary-title)",fontErrorBoundaryMessage:"var(--graphy-font-error-boundary-message)",fontTableCell:"var(--graphy-font-table-cell)",fontTableHeaderCell:"var(--graphy-font-table-header-cell)",fontSourceLabel:"var(--graphy-font-source-label)",fontSourceLink:"var(--graphy-font-source-link)",fontTextEditorH1:"var(--graphy-font-text-editor-h1)",fontTextEditorH2:"var(--graphy-font-text-editor-h2)",fontTextEditorH3:"var(--graphy-font-text-editor-h3)",fontTextEditorH6:"var(--graphy-font-text-editor-h6)",fontTextEditorBody:"var(--graphy-font-text-editor-body)",fontTextEditorLink:"var(--graphy-font-text-editor-link)",fontHighlightModeTitle:"var(--graphy-font-highlight-mode-title)",fontHighlightModeSubtitle:"var(--graphy-font-highlight-mode-subtitle)",fontEditorControlLabel:"var(--graphy-font-editor-control-label)",fontEditorControlValue:"var(--graphy-font-editor-control-value)",fontEditorSectionTitle:"var(--graphy-font-editor-section-title)",fontEditorCaption:"var(--graphy-font-editor-caption)"};Object.defineProperty(exports,"CANVAS_COLOR_KEYS",{enumerable:!0,get:function(){return a}});Object.defineProperty(exports,"vars",{enumerable:!0,get:function(){return r}});