@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/dev.css +1 -0
- package/dist/{dev.utils-DZcwQpSI.js → dev.utils-BWIxakWj.js} +1 -1
- package/dist/dev.utils-MDtVKEi4.cjs +2 -0
- package/dist/editable.cjs +1 -1
- package/dist/editable.mjs +2 -2
- package/dist/graph-config.cjs +1 -1
- package/dist/graph-config.d.ts +7 -9
- package/dist/graph-config.mjs +1 -1
- package/dist/history-chords-D__p4inW.cjs +1 -0
- package/dist/{history-chords-DdWu-GiG.js → history-chords-x0wqKMIO.js} +1004 -1015
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +5 -8
- package/dist/index.mjs +240 -242
- package/package.json +2 -2
- package/dist/dev.utils-BU9Kwcpp.cjs +0 -2
- package/dist/history-chords-Dj1OKqU5.cjs +0 -1
package/dist/index.mjs
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { Ct as
|
|
2
|
-
import { d as
|
|
3
|
-
import { COMPILER_STAGE_KEYS as
|
|
4
|
-
import { Component as Re, useCallback as f, useEffect as
|
|
5
|
-
import { Fragment as
|
|
6
|
-
import { useStore as
|
|
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
|
|
9
|
-
import './index.css';var
|
|
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
|
|
11
|
+
var Q = ({ errors: e }) => {
|
|
12
12
|
const [t, ...r] = e;
|
|
13
13
|
return /* @__PURE__ */ v("div", {
|
|
14
14
|
role: "alert",
|
|
15
|
-
className:
|
|
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(
|
|
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(
|
|
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
|
-
},
|
|
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:
|
|
53
|
+
return { caughtDiagnostic: W(e) };
|
|
54
54
|
}
|
|
55
55
|
componentDidCatch(e, t) {
|
|
56
|
-
const r =
|
|
57
|
-
|
|
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(
|
|
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(
|
|
66
|
+
return t && t.length > 0 ? /* @__PURE__ */ d(Q, { errors: t }) : r;
|
|
67
67
|
}
|
|
68
|
-
},
|
|
69
|
-
const t =
|
|
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,
|
|
75
|
-
selection:
|
|
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:
|
|
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,
|
|
81
|
+
}), je = 5, Fe = (e) => {
|
|
82
82
|
if (!he) return {
|
|
83
83
|
emit: () => {
|
|
84
84
|
},
|
|
85
|
-
subscribe: () =>
|
|
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
|
-
},
|
|
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
|
-
})),
|
|
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(
|
|
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
|
|
147
|
-
|
|
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 '${
|
|
151
|
+
message: `Custom geom '${u.type}' is registered but has no renderer.`,
|
|
152
152
|
context: {
|
|
153
|
-
requested:
|
|
153
|
+
requested: u.type,
|
|
154
154
|
kind: "geom-renderer"
|
|
155
155
|
},
|
|
156
|
-
suggestion: `Add a render half for it: \`defineGeomRenderer(${
|
|
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
|
|
163
|
-
h ? h.count += 1 : a.set(
|
|
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:
|
|
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}', '${
|
|
175
|
+
message: `Multiple render-only overrides register ('${c}', '${u}') (${h} entries); the last in the array wins.`,
|
|
176
176
|
context: {
|
|
177
|
-
requested: `${c}@${
|
|
177
|
+
requested: `${c}@${u}`,
|
|
178
178
|
kind: "geom-renderer"
|
|
179
179
|
},
|
|
180
|
-
suggestion: `Keep a single render-only override for ('${c}', '${
|
|
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 ||
|
|
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 || !
|
|
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 || !
|
|
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:
|
|
298
|
-
const T =
|
|
299
|
-
const s =
|
|
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:
|
|
302
|
+
compileBus: Fe(s)
|
|
303
303
|
};
|
|
304
|
-
}), [
|
|
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 (
|
|
306
|
+
if (y.current) y.current.getState().setCompiled(s.compiled);
|
|
307
307
|
else {
|
|
308
308
|
const p = rt(s.compiled);
|
|
309
|
-
p.subscribe(
|
|
309
|
+
p.subscribe(k.notify), y.current = p, k.notify();
|
|
310
310
|
}
|
|
311
311
|
return null;
|
|
312
|
-
}, [
|
|
313
|
-
const s =
|
|
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
|
|
320
|
-
}),
|
|
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]),
|
|
329
|
-
s.length !== 0 && (
|
|
330
|
-
}, [
|
|
331
|
-
s.length !== 0 && (
|
|
332
|
-
}, [
|
|
333
|
-
|
|
334
|
-
const s =
|
|
335
|
-
s && (
|
|
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
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
]),
|
|
343
|
-
const s =
|
|
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 =
|
|
352
|
-
|
|
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
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
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
|
|
368
|
-
|
|
367
|
+
const H = f((s) => {
|
|
368
|
+
x((p) => p === null ? p : G(null)), S(b(s));
|
|
369
369
|
}, [
|
|
370
|
+
G,
|
|
370
371
|
S,
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
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 &&
|
|
377
|
+
}), s.input && T.current?.(s.input), s.errors && N([...s.errors]);
|
|
378
378
|
}, [
|
|
379
|
-
|
|
380
|
-
|
|
379
|
+
H,
|
|
380
|
+
l,
|
|
381
381
|
T,
|
|
382
|
-
|
|
382
|
+
N
|
|
383
383
|
]), E = f((s) => {
|
|
384
|
-
for (const p of s)
|
|
384
|
+
for (const p of s) _(p);
|
|
385
385
|
return s.some((p) => !!p.compiled);
|
|
386
|
-
}, [
|
|
387
|
-
E(
|
|
388
|
-
}, [
|
|
389
|
-
E(
|
|
390
|
-
}, [
|
|
391
|
-
stack:
|
|
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:
|
|
393
|
+
redo: Y
|
|
394
394
|
}), [
|
|
395
|
-
|
|
395
|
+
m,
|
|
396
396
|
U,
|
|
397
|
-
|
|
398
|
-
]), ce = f(() =>
|
|
397
|
+
Y
|
|
398
|
+
]), ce = f(() => y.current?.getState().compiled ?? null, []);
|
|
399
399
|
return {
|
|
400
|
-
store:
|
|
401
|
-
dispatch:
|
|
400
|
+
store: y.current,
|
|
401
|
+
dispatch: oe,
|
|
402
402
|
seal: ie,
|
|
403
403
|
history: ae,
|
|
404
|
-
subscribe:
|
|
404
|
+
subscribe: k.subscribe,
|
|
405
405
|
getCompiled: ce,
|
|
406
|
-
compileBus:
|
|
407
|
-
compileErrors:
|
|
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 =
|
|
418
|
-
const [
|
|
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:
|
|
421
|
+
customPalettes: u,
|
|
422
422
|
colorScheme: h,
|
|
423
423
|
plugins: r,
|
|
424
|
-
resolveRenderer:
|
|
425
|
-
anchorResolver:
|
|
424
|
+
resolveRenderer: w,
|
|
425
|
+
anchorResolver: m,
|
|
426
426
|
onChange: a,
|
|
427
427
|
onError: i,
|
|
428
428
|
onWarnings: c
|
|
429
429
|
});
|
|
430
|
-
|
|
431
|
-
if (
|
|
432
|
-
return
|
|
433
|
-
if (
|
|
434
|
-
const { selection:
|
|
435
|
-
|
|
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
|
-
}, [
|
|
437
|
+
}, [g, l]);
|
|
438
438
|
const b = L(() => ({
|
|
439
|
-
dispatch:
|
|
440
|
-
seal:
|
|
441
|
-
}), [
|
|
439
|
+
dispatch: q,
|
|
440
|
+
seal: k
|
|
441
|
+
}), [q, k]);
|
|
442
442
|
Ge(o, () => ({
|
|
443
443
|
commands: b,
|
|
444
|
-
undo:
|
|
445
|
-
redo:
|
|
446
|
-
subscribe:
|
|
447
|
-
getCompiled:
|
|
448
|
-
getSelection: () =>
|
|
449
|
-
setSelection: (
|
|
450
|
-
subscribeSelection:
|
|
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
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
453
|
+
y,
|
|
454
|
+
G,
|
|
455
|
+
I,
|
|
456
|
+
l
|
|
457
457
|
]);
|
|
458
|
-
const
|
|
459
|
-
chartId:
|
|
460
|
-
store:
|
|
461
|
-
selectionStore:
|
|
458
|
+
const N = L(() => g ? {
|
|
459
|
+
chartId: R,
|
|
460
|
+
store: g,
|
|
461
|
+
selectionStore: l,
|
|
462
462
|
commands: b,
|
|
463
|
-
history:
|
|
463
|
+
history: y,
|
|
464
464
|
formattingLocale: n,
|
|
465
|
-
compileBus:
|
|
465
|
+
compileBus: $,
|
|
466
466
|
colorScheme: h,
|
|
467
|
-
|
|
468
|
-
anchorResolver: u
|
|
467
|
+
anchorResolver: m
|
|
469
468
|
} : null, [
|
|
469
|
+
R,
|
|
470
470
|
g,
|
|
471
|
-
|
|
472
|
-
m,
|
|
471
|
+
l,
|
|
473
472
|
b,
|
|
474
|
-
|
|
473
|
+
y,
|
|
475
474
|
n,
|
|
476
|
-
|
|
475
|
+
$,
|
|
477
476
|
h,
|
|
478
|
-
|
|
479
|
-
u
|
|
477
|
+
m
|
|
480
478
|
]);
|
|
481
479
|
return /* @__PURE__ */ d(Pe, {
|
|
482
|
-
forcedErrors:
|
|
480
|
+
forcedErrors: x,
|
|
483
481
|
onError: i,
|
|
484
482
|
resetKeys: [t, e],
|
|
485
|
-
children:
|
|
486
|
-
value:
|
|
483
|
+
children: N ? /* @__PURE__ */ d(de.Provider, {
|
|
484
|
+
value: N,
|
|
487
485
|
children: /* @__PURE__ */ d(le, {
|
|
488
|
-
value:
|
|
489
|
-
children:
|
|
486
|
+
value: w,
|
|
487
|
+
children: T
|
|
490
488
|
})
|
|
491
489
|
}) : null
|
|
492
490
|
});
|
|
493
491
|
};
|
|
494
|
-
function
|
|
495
|
-
const t =
|
|
492
|
+
function ur(e) {
|
|
493
|
+
const t = Se(e);
|
|
496
494
|
return {
|
|
497
495
|
...t,
|
|
498
|
-
GraphProvider: (n) => /* @__PURE__ */ d(
|
|
496
|
+
GraphProvider: (n) => /* @__PURE__ */ d(ot, {
|
|
499
497
|
...n,
|
|
500
498
|
plugins: t.plugins
|
|
501
499
|
})
|
|
502
500
|
};
|
|
503
501
|
}
|
|
504
|
-
var
|
|
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
|
-
}),
|
|
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
|
-
}),
|
|
521
|
-
var
|
|
522
|
-
var bt = "drqe3uh",
|
|
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
|
-
},
|
|
523
|
+
}, ee = {
|
|
526
524
|
ran: "drqe3un drqe3um",
|
|
527
525
|
dim: "drqe3uo drqe3um"
|
|
528
|
-
},
|
|
526
|
+
}, ne = {
|
|
529
527
|
ran: "drqe3uq drqe3up",
|
|
530
528
|
cached: "drqe3ur drqe3up",
|
|
531
529
|
untouched: "drqe3us drqe3up"
|
|
532
|
-
},
|
|
533
|
-
const { compileBus: n } =
|
|
534
|
-
|
|
535
|
-
const { recordCompile:
|
|
536
|
-
return
|
|
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 =
|
|
539
|
-
|
|
540
|
-
const
|
|
541
|
-
return Ne(
|
|
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:
|
|
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:
|
|
550
|
+
className: it,
|
|
553
551
|
children: [/* @__PURE__ */ v("div", { children: [/* @__PURE__ */ d("div", {
|
|
554
|
-
className:
|
|
552
|
+
className: at,
|
|
555
553
|
children: "compile cache"
|
|
556
554
|
}), /* @__PURE__ */ d("div", {
|
|
557
|
-
className:
|
|
558
|
-
children:
|
|
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((
|
|
562
|
-
className:
|
|
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:
|
|
571
|
-
className: c ?
|
|
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 && !
|
|
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
|
-
},
|
|
586
|
-
className:
|
|
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:
|
|
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:
|
|
612
|
-
const n = e?.[r], o =
|
|
609
|
+
}) }), /* @__PURE__ */ d("tbody", { children: j.map((r) => {
|
|
610
|
+
const n = e?.[r], o = Tt(n);
|
|
613
611
|
return /* @__PURE__ */ v("tr", {
|
|
614
|
-
className:
|
|
612
|
+
className: pt,
|
|
615
613
|
children: [
|
|
616
614
|
/* @__PURE__ */ v("td", {
|
|
617
|
-
className:
|
|
615
|
+
className: lt,
|
|
618
616
|
children: [
|
|
619
617
|
/* @__PURE__ */ d("span", {
|
|
620
|
-
className:
|
|
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" ?
|
|
626
|
+
className: o === "ran" ? ee.ran : ee.dim,
|
|
629
627
|
children: n?.misses ?? 0
|
|
630
628
|
}),
|
|
631
629
|
/* @__PURE__ */ d("td", {
|
|
632
|
-
className:
|
|
630
|
+
className: K,
|
|
633
631
|
children: n?.hits ?? 0
|
|
634
632
|
}),
|
|
635
633
|
/* @__PURE__ */ d("td", {
|
|
636
|
-
className:
|
|
634
|
+
className: K,
|
|
637
635
|
children: t[r].misses
|
|
638
636
|
}),
|
|
639
637
|
/* @__PURE__ */ d("td", {
|
|
640
|
-
className:
|
|
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:
|
|
645
|
+
className: ft,
|
|
648
646
|
children: [/* @__PURE__ */ d("div", {
|
|
649
|
-
className:
|
|
647
|
+
className: St,
|
|
650
648
|
children: "recent compiles"
|
|
651
649
|
}), e.map((t) => {
|
|
652
|
-
const r =
|
|
650
|
+
const r = Nt(t.stages, (a) => a.misses > 0), n = j.length;
|
|
653
651
|
return /* @__PURE__ */ v("div", {
|
|
654
|
-
className:
|
|
652
|
+
className: ut,
|
|
655
653
|
children: [
|
|
656
654
|
/* @__PURE__ */ d("span", {
|
|
657
|
-
className:
|
|
655
|
+
className: ne[r === 0 ? "cached" : "ran"],
|
|
658
656
|
"aria-hidden": !0
|
|
659
657
|
}),
|
|
660
658
|
/* @__PURE__ */ d("span", {
|
|
661
|
-
className:
|
|
659
|
+
className: mt,
|
|
662
660
|
title: t.label,
|
|
663
661
|
children: t.label
|
|
664
662
|
}),
|
|
665
663
|
/* @__PURE__ */ v("span", {
|
|
666
|
-
className:
|
|
664
|
+
className: gt,
|
|
667
665
|
children: [
|
|
668
666
|
r,
|
|
669
667
|
"/",
|
|
670
668
|
n,
|
|
671
669
|
" ran · ",
|
|
672
|
-
|
|
670
|
+
se(t.durationMs)
|
|
673
671
|
]
|
|
674
672
|
})
|
|
675
673
|
]
|
|
676
674
|
}, t.id);
|
|
677
675
|
})]
|
|
678
|
-
}),
|
|
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
|
|
678
|
+
for (const n of j) t(e[n]) && (r += 1);
|
|
681
679
|
return r;
|
|
682
|
-
},
|
|
683
|
-
const { history: e } =
|
|
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
|
-
},
|
|
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
|
-
]),
|
|
702
|
+
]), fr = (e, t = {}) => {
|
|
705
703
|
const { target: r, enabled: n = !0 } = t;
|
|
706
|
-
|
|
707
|
-
const o =
|
|
704
|
+
D(() => {
|
|
705
|
+
const o = qt(r);
|
|
708
706
|
if (!n || !o) return;
|
|
709
707
|
const a = (i) => {
|
|
710
|
-
if (!
|
|
708
|
+
if (!Gt(i) || i.defaultPrevented || wt(i.target)) return;
|
|
711
709
|
const c = ge(i);
|
|
712
710
|
if (!c) return;
|
|
713
|
-
const
|
|
714
|
-
|
|
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
|
-
},
|
|
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
|
-
|
|
725
|
-
|
|
722
|
+
jt as BrandMark,
|
|
723
|
+
Ht as CanvasTextMeasurer,
|
|
726
724
|
Ut as DefaultFooter,
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
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
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
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
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
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
|
};
|