@graphysdk/react-renderer 1.9.0-beta.1794569506652 → 1.9.0-beta.1794586691328
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/editable.cjs +1 -1
- package/dist/editable.d.ts +0 -3
- package/dist/editable.mjs +2061 -2066
- package/dist/{history-chords-L-9s4-lq.js → history-chords-D6QY_KYF.js} +3010 -3006
- package/dist/history-chords-DMIXDx00.cjs +2 -0
- package/dist/history-chords.css +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +34 -20
- package/dist/index.mjs +339 -328
- package/package.json +4 -4
- package/dist/history-chords-CHDa7G9D.cjs +0 -2
package/dist/index.mjs
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { $n as
|
|
2
|
-
import { COMPILER_STAGE_KEYS as
|
|
3
|
-
import { Component as
|
|
1
|
+
import { $n as Dr, $t as qe, A as Lr, An as ke, At as qr, B as kr, Dn as F, En as _r, Et as $r, Fn as _e, G as Hr, Gn as $e, Hn as xr, In as K, J as Mr, Jt as Ar, K as Or, Kn as Br, Kt as Fr, Ln as ee, Mn as Re, Mt as Kr, Nn as He, On as Ie, Pn as zr, Qn as Ur, R as Wr, Rn as z, Rt as Vr, Sn as Yr, Tn as jr, Un as xe, Vn as Xr, Vt as Jr, Wn as Me, Wt as Qr, Xn as Ne, Xt as Q, Yn as Ae, Zn as Zr, _t as en, a as tn, an as rn, bt as nn, cn as sn, dn as on, en as Oe, er as an, fn as cn, i as ln, in as Be, ir as Fe, jn as te, kn as dn, kt as un, l as mn, ln as Ke, mn as hn, n as gn, nn as pn, nr as ze, or as Z, pn as fn, q as vn, qn as Ue, qt as yn, r as Sn, rn as re, rr as ie, t as We, tn as bn, tr as Ve, un as Ye, vn as Tn, vt as En, y as Gn, yt as Rn, z as In, zn as Nn } from "./history-chords-D6QY_KYF.js";
|
|
2
|
+
import { COMPILER_STAGE_KEYS as ae, DEFAULT_LOCALE as je, Geom as Xe, GraphCompilationSession as Je, areEditTargetsEqual as Qe, buildDiagnostic as ue, buildPointSymbolPath as Ze, canonicalizeLocale as et, createAnchorResolver as tt, createCompiler as rt, createDataLabelPlacementResolver as nt, createSpecBuilder as st, createStyleResolver as we, findAnnotation as ot, findIntlLocale as it, findLayerById as me, foldGeomCornerRadii as at, isCompilerCachingEnabled as ct, isGeometricSymbol as ce, isImageSymbol as lt, resolveDefinition as dt, resolveGeomCornerRadiusPx as he, setCompilerCachingEnabled as ut, toPercent as X } from "@graphysdk/viz-engine";
|
|
3
|
+
import { Component as mt, useCallback as p, useEffect as k, useId as ht, useImperativeHandle as gt, useMemo as H, useRef as ge, useState as S, useSyncExternalStore as pt } from "react";
|
|
4
4
|
import { Fragment as ft, jsx as c, jsxs as v } from "react/jsx-runtime";
|
|
5
|
-
import { useStore as
|
|
6
|
-
import { motion as
|
|
7
|
-
import { createStore as
|
|
8
|
-
import
|
|
9
|
-
import './index.css';var
|
|
10
|
-
var
|
|
11
|
-
var
|
|
5
|
+
import { useStore as oe } from "zustand";
|
|
6
|
+
import { motion as ne } from "motion/react";
|
|
7
|
+
import { createStore as le } from "zustand/vanilla";
|
|
8
|
+
import vt from "clsx";
|
|
9
|
+
import './index.css';var yt = "_1a5iqpb0", St = "_1a5iqpb1";
|
|
10
|
+
var bt = "_1a5iqpb3", Tt = "_1a5iqpb4", Et = "_1a5iqpb5";
|
|
11
|
+
var pe = ({ errors: e }) => {
|
|
12
12
|
const [t, ...r] = e;
|
|
13
13
|
return /* @__PURE__ */ v("div", {
|
|
14
14
|
role: "alert",
|
|
15
|
-
className:
|
|
15
|
+
className: yt,
|
|
16
16
|
children: [
|
|
17
17
|
/* @__PURE__ */ c("strong", {
|
|
18
|
-
className:
|
|
18
|
+
className: St,
|
|
19
19
|
children: "This chart could not be rendered."
|
|
20
20
|
}),
|
|
21
21
|
t && /* @__PURE__ */ c(fe, { diagnostic: t }),
|
|
@@ -26,14 +26,14 @@ var ge = ({ errors: e }) => {
|
|
|
26
26
|
]
|
|
27
27
|
});
|
|
28
28
|
}, fe = ({ diagnostic: e }) => /* @__PURE__ */ v("div", {
|
|
29
|
-
className:
|
|
29
|
+
className: bt,
|
|
30
30
|
children: [
|
|
31
31
|
/* @__PURE__ */ c("span", {
|
|
32
|
-
className:
|
|
32
|
+
className: Tt,
|
|
33
33
|
children: e.code
|
|
34
34
|
}),
|
|
35
35
|
/* @__PURE__ */ c("p", {
|
|
36
|
-
className:
|
|
36
|
+
className: Et,
|
|
37
37
|
children: e.message
|
|
38
38
|
}),
|
|
39
39
|
e.suggestion && /* @__PURE__ */ c("p", {
|
|
@@ -42,47 +42,47 @@ var ge = ({ errors: e }) => {
|
|
|
42
42
|
})
|
|
43
43
|
]
|
|
44
44
|
});
|
|
45
|
-
function
|
|
45
|
+
function Gt(e = [], t = []) {
|
|
46
46
|
return e.length === t.length && e.every((r, n) => Object.is(r, t[n]));
|
|
47
47
|
}
|
|
48
|
-
var
|
|
48
|
+
var Rt = class extends mt {
|
|
49
49
|
constructor(...e) {
|
|
50
50
|
super(...e), this.state = { caughtDiagnostic: null };
|
|
51
51
|
}
|
|
52
52
|
static getDerivedStateFromError(e) {
|
|
53
|
-
return { caughtDiagnostic:
|
|
53
|
+
return { caughtDiagnostic: ue(e) };
|
|
54
54
|
}
|
|
55
55
|
componentDidCatch(e, t) {
|
|
56
|
-
const r =
|
|
56
|
+
const r = ue(e);
|
|
57
57
|
Z([r]), this.props.onError?.([r]), console.error("Chart render component stack:", t.componentStack);
|
|
58
58
|
}
|
|
59
59
|
componentDidUpdate(e) {
|
|
60
|
-
this.state.caughtDiagnostic && !
|
|
60
|
+
this.state.caughtDiagnostic && !Gt(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__ */ c(
|
|
64
|
+
if (e) return /* @__PURE__ */ c(pe, { errors: [e] });
|
|
65
65
|
const { forcedErrors: t, children: r } = this.props;
|
|
66
|
-
return t && t.length > 0 ? /* @__PURE__ */ c(
|
|
66
|
+
return t && t.length > 0 ? /* @__PURE__ */ c(pe, { errors: t }) : r;
|
|
67
67
|
}
|
|
68
|
-
},
|
|
69
|
-
const t =
|
|
70
|
-
return t instanceof
|
|
71
|
-
},
|
|
68
|
+
}, Pe = (e) => typeof e == "object" && "geom" in e && "render" in e, Ce = (e) => {
|
|
69
|
+
const t = dt(e);
|
|
70
|
+
return t instanceof Xe ? t : null;
|
|
71
|
+
}, It = (e, t) => {
|
|
72
72
|
const r = e.filter((n) => Nt(n, t));
|
|
73
73
|
return r.length === e.length ? e : r;
|
|
74
|
-
}, Nt = (e, t) => e.kind === "annotation" ?
|
|
75
|
-
selection:
|
|
76
|
-
setSelection: (t) => e((r) =>
|
|
77
|
-
clearSelection: () => e((t) => t.selection.length === 0 ? t : { selection:
|
|
78
|
-
})),
|
|
74
|
+
}, Nt = (e, t) => e.kind === "annotation" ? ot(t.annotations, e.id) !== null : e.kind === "observations" ? me(t.layers, e.layerId) !== void 0 : e.kind === "layer" && e.layerId !== void 0 ? me(t.layers, e.layerId) !== void 0 : !0, ve = [], wt = () => le((e) => ({
|
|
75
|
+
selection: ve,
|
|
76
|
+
setSelection: (t) => e((r) => Pt(r.selection, t) ? r : { selection: t }),
|
|
77
|
+
clearSelection: () => e((t) => t.selection.length === 0 ? t : { selection: ve })
|
|
78
|
+
})), Pt = (e, t) => e === t ? !0 : e.length !== t.length ? !1 : e.every((r, n) => {
|
|
79
79
|
const s = t[n];
|
|
80
|
-
return s !== void 0 &&
|
|
81
|
-
}), Ct = 5,
|
|
82
|
-
if (!
|
|
80
|
+
return s !== void 0 && Qe(r, s);
|
|
81
|
+
}), Ct = 5, Dt = (e) => {
|
|
82
|
+
if (!Ne) return {
|
|
83
83
|
emit: () => {
|
|
84
84
|
},
|
|
85
|
-
subscribe: () =>
|
|
85
|
+
subscribe: () => qt,
|
|
86
86
|
getLastTrigger: () => null,
|
|
87
87
|
getLastCompile: () => null,
|
|
88
88
|
getCacheStats: () => e.getCacheStats()
|
|
@@ -104,7 +104,7 @@ var Gt = class extends ut {
|
|
|
104
104
|
getLastCompile: () => e.getLastCompile(),
|
|
105
105
|
getCacheStats: () => e.getCacheStats()
|
|
106
106
|
};
|
|
107
|
-
},
|
|
107
|
+
}, Lt = () => le((e) => ({
|
|
108
108
|
lastCompile: null,
|
|
109
109
|
history: [],
|
|
110
110
|
nextId: 1,
|
|
@@ -113,7 +113,7 @@ var Gt = class extends ut {
|
|
|
113
113
|
if (n.lastSnapshot === r) return n;
|
|
114
114
|
const s = {
|
|
115
115
|
id: n.nextId,
|
|
116
|
-
label:
|
|
116
|
+
label: kt(t),
|
|
117
117
|
stages: r.stages,
|
|
118
118
|
stageDurationsMs: r.stageDurationsMs,
|
|
119
119
|
durationMs: r.durationMs
|
|
@@ -125,8 +125,8 @@ var Gt = class extends ut {
|
|
|
125
125
|
lastSnapshot: r
|
|
126
126
|
};
|
|
127
127
|
})
|
|
128
|
-
})),
|
|
129
|
-
},
|
|
128
|
+
})), qt = () => {
|
|
129
|
+
}, kt = (e) => {
|
|
130
130
|
switch (e.kind) {
|
|
131
131
|
case "init":
|
|
132
132
|
return "init";
|
|
@@ -141,8 +141,8 @@ var Gt = class extends ut {
|
|
|
141
141
|
const n = e.length >= r ? e.length - (r - 1) : 0;
|
|
142
142
|
return [...e.slice(n), t];
|
|
143
143
|
};
|
|
144
|
-
function
|
|
145
|
-
const t = e.filter(
|
|
144
|
+
function ye(e) {
|
|
145
|
+
const t = e.filter(Pe), r = /* @__PURE__ */ new Set([...Object.keys(Be), ...t.map((l) => l.geom)]), n = [], s = /* @__PURE__ */ new Set();
|
|
146
146
|
for (const l of e) {
|
|
147
147
|
const d = Ce(l);
|
|
148
148
|
d === null || r.has(d.type) || s.has(d.type) || (s.add(d.type), n.push({
|
|
@@ -180,12 +180,12 @@ function ve(e) {
|
|
|
180
180
|
},
|
|
181
181
|
suggestion: `Keep a single render-only override for ('${l}', '${d}').`
|
|
182
182
|
});
|
|
183
|
-
return a.push(...
|
|
183
|
+
return a.push(...Kt(e)), {
|
|
184
184
|
errors: n,
|
|
185
185
|
warnings: a
|
|
186
186
|
};
|
|
187
187
|
}
|
|
188
|
-
function
|
|
188
|
+
function $t(e, t) {
|
|
189
189
|
const { coordSystem: r, layers: n } = e, s = /* @__PURE__ */ new Set(), i = [];
|
|
190
190
|
for (const a of n)
|
|
191
191
|
t(a.geom, r.type) !== null || s.has(a.geom) || (s.add(a.geom), i.push({
|
|
@@ -201,12 +201,12 @@ function kt(e, t) {
|
|
|
201
201
|
}));
|
|
202
202
|
return i;
|
|
203
203
|
}
|
|
204
|
-
function
|
|
204
|
+
function Ht(e, t) {
|
|
205
205
|
const { coordSystem: r, layers: n } = e, s = /* @__PURE__ */ new Set(), i = [];
|
|
206
206
|
for (const a of n) {
|
|
207
207
|
if (a.interactive === !1 || a.spatialKind !== "renderHitTest" || s.has(a.geom)) continue;
|
|
208
208
|
const l = t(a.geom, r.type);
|
|
209
|
-
l === null || l.hitTest ||
|
|
209
|
+
l === null || l.hitTest || re(l) || (s.add(a.geom), i.push({
|
|
210
210
|
kind: "userInput",
|
|
211
211
|
severity: "warning",
|
|
212
212
|
code: "MISSING_RENDER_HIT_TEST",
|
|
@@ -220,7 +220,7 @@ function $t(e, t) {
|
|
|
220
220
|
}
|
|
221
221
|
return i;
|
|
222
222
|
}
|
|
223
|
-
function
|
|
223
|
+
function xt(e) {
|
|
224
224
|
const t = /* @__PURE__ */ new Set(), r = [];
|
|
225
225
|
for (const n of e.layers) {
|
|
226
226
|
const s = n.identityKey;
|
|
@@ -238,12 +238,12 @@ function Ht(e) {
|
|
|
238
238
|
}
|
|
239
239
|
return r;
|
|
240
240
|
}
|
|
241
|
-
function
|
|
241
|
+
function Mt(e, t) {
|
|
242
242
|
const { coordSystem: r, layers: n } = e, s = /* @__PURE__ */ new Set(), i = [];
|
|
243
243
|
for (const a of n) {
|
|
244
244
|
if (a.interactive === !1 || a.spatialKind !== "renderHitTest" || s.has(a.geom)) continue;
|
|
245
245
|
const l = t(a.geom, r.type);
|
|
246
|
-
l === null || !l.hitTest || !
|
|
246
|
+
l === null || !l.hitTest || !re(l) || (s.add(a.geom), i.push({
|
|
247
247
|
kind: "userInput",
|
|
248
248
|
severity: "warning",
|
|
249
249
|
code: "CONFLICTING_RENDER_HIT_TEST",
|
|
@@ -257,7 +257,7 @@ function xt(e, t) {
|
|
|
257
257
|
}
|
|
258
258
|
return i;
|
|
259
259
|
}
|
|
260
|
-
function
|
|
260
|
+
function At(e, t) {
|
|
261
261
|
const r = /* @__PURE__ */ new Set(), n = [];
|
|
262
262
|
for (const s of e.layers)
|
|
263
263
|
s.interactive !== !1 && (s.spatialKind !== "renderHitTest" || r.has(s.geom) || t.hasCapability(s.geom) || (r.add(s.geom), n.push({
|
|
@@ -273,12 +273,12 @@ function Mt(e, t) {
|
|
|
273
273
|
})));
|
|
274
274
|
return n;
|
|
275
275
|
}
|
|
276
|
-
function
|
|
276
|
+
function Ot(e, t) {
|
|
277
277
|
const { coordSystem: r, layers: n } = e, s = /* @__PURE__ */ new Set(), i = [];
|
|
278
278
|
for (const a of n) {
|
|
279
279
|
if (a.interactive === !1 || a.spatialKind === "renderHitTest" || s.has(a.geom)) continue;
|
|
280
280
|
const l = t(a.geom, r.type);
|
|
281
|
-
l === null || !
|
|
281
|
+
l === null || !re(l) || (s.add(a.geom), i.push({
|
|
282
282
|
kind: "userInput",
|
|
283
283
|
severity: "warning",
|
|
284
284
|
code: "LIVE_RENDER_REQUIRES_RENDER_HIT_TEST",
|
|
@@ -292,9 +292,9 @@ function At(e, t) {
|
|
|
292
292
|
}
|
|
293
293
|
return i;
|
|
294
294
|
}
|
|
295
|
-
function
|
|
295
|
+
function Bt(e, t) {
|
|
296
296
|
let r;
|
|
297
|
-
return e.layers.flatMap((n, s) =>
|
|
297
|
+
return e.layers.flatMap((n, s) => re(t(n.geom, e.coordSystem.type)) ? Ft(n) ? (r ??= we().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",
|
|
@@ -307,8 +307,8 @@ function Ot(e, t) {
|
|
|
307
307
|
suggestion: "Remove the hovered overpaint, or paint the hover treatment in the geom's live render."
|
|
308
308
|
}]) : [] : []);
|
|
309
309
|
}
|
|
310
|
-
var
|
|
311
|
-
function
|
|
310
|
+
var Ft = (e) => [e.styles.defaults, e.styles.overrides].some((t) => t.some((r) => r.state === "hovered" && (r.declarations.overpaint?.length ?? 0) > 0));
|
|
311
|
+
function Kt(e) {
|
|
312
312
|
const t = /* @__PURE__ */ new Set(), r = [];
|
|
313
313
|
for (const n of e) {
|
|
314
314
|
const s = Ce(n);
|
|
@@ -326,65 +326,65 @@ function Ft(e) {
|
|
|
326
326
|
}
|
|
327
327
|
return r;
|
|
328
328
|
}
|
|
329
|
-
var
|
|
329
|
+
var zt = (e) => le((t) => ({
|
|
330
330
|
scene: e,
|
|
331
331
|
setScene: (r) => t((n) => n.scene === r ? n : { scene: r })
|
|
332
|
-
})),
|
|
333
|
-
const b = Q(l),
|
|
334
|
-
const o =
|
|
332
|
+
})), Ut = ({ spec: e, data: t, colorScheme: r, plugins: n, theme: s, resolveRenderer: i, anchorResolver: a, onSpecChange: l, onError: d, onWarnings: g }) => {
|
|
333
|
+
const b = Q(l), C = Q(d), G = Q(g), [{ session: m, compileBus: h, findGeom: T }] = S(() => {
|
|
334
|
+
const o = rt({
|
|
335
335
|
plugins: n,
|
|
336
336
|
theme: s
|
|
337
337
|
});
|
|
338
338
|
return {
|
|
339
|
-
session: new
|
|
340
|
-
compileBus:
|
|
339
|
+
session: new Je(o),
|
|
340
|
+
compileBus: Dt(o),
|
|
341
341
|
findGeom: (u) => o.findGeom(u)
|
|
342
342
|
};
|
|
343
|
-
}), [
|
|
344
|
-
const o =
|
|
343
|
+
}), [f] = S(() => {
|
|
344
|
+
const o = ye(n ?? []), u = ye(s?.plugins ?? []);
|
|
345
345
|
return {
|
|
346
346
|
errors: [...u.errors, ...o.errors],
|
|
347
347
|
warnings: [...u.warnings, ...o.warnings]
|
|
348
348
|
};
|
|
349
|
-
}), x =
|
|
349
|
+
}), x = ge(null), [D] = S(Wt), E = ge(null), y = p((o) => f.errors.length === 0 ? o : [...f.errors, ...o ?? []], [f]), _ = p((o) => {
|
|
350
350
|
if (!o.ok) return o.errors;
|
|
351
351
|
if (E.current) E.current.getState().setScene(o.scene);
|
|
352
352
|
else {
|
|
353
|
-
const u =
|
|
353
|
+
const u = zt(o.scene);
|
|
354
354
|
u.subscribe(D.notify), E.current = u, D.notify();
|
|
355
355
|
}
|
|
356
356
|
return null;
|
|
357
|
-
}, [D]), [U,
|
|
357
|
+
}, [D]), [U, I] = S(() => {
|
|
358
358
|
const o = m.compile({
|
|
359
359
|
spec: e,
|
|
360
360
|
data: t,
|
|
361
361
|
colorScheme: r
|
|
362
362
|
});
|
|
363
|
-
return x.current = o, y(
|
|
364
|
-
}),
|
|
363
|
+
return x.current = o, y(_(o));
|
|
364
|
+
}), N = p((o) => o.ok ? [
|
|
365
365
|
...o.warnings,
|
|
366
|
-
...kt(o.scene, i),
|
|
367
366
|
...$t(o.scene, i),
|
|
368
|
-
...Ht(o.scene),
|
|
369
|
-
...xt(o.scene
|
|
370
|
-
...
|
|
367
|
+
...Ht(o.scene, i),
|
|
368
|
+
...xt(o.scene),
|
|
369
|
+
...Mt(o.scene, i),
|
|
371
370
|
...Ot(o.scene, i),
|
|
372
|
-
...
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
371
|
+
...Bt(o.scene, i),
|
|
372
|
+
...At(o.scene, a)
|
|
373
|
+
] : o.warnings, [i, a]), w = p((o) => {
|
|
374
|
+
o.length !== 0 && (Z(o), C.current?.(o));
|
|
375
|
+
}, [C]), P = p((o) => {
|
|
376
376
|
o.length !== 0 && (Z(o), G.current?.(o));
|
|
377
377
|
}, [G]);
|
|
378
|
-
|
|
378
|
+
k(() => {
|
|
379
379
|
const o = x.current;
|
|
380
|
-
o && (w([...
|
|
380
|
+
o && (w([...f.errors, ...o.ok ? [] : o.errors]), P([...f.warnings, ...N(o)]), o.ok && h.emit({ kind: "init" }));
|
|
381
381
|
}, [
|
|
382
382
|
h,
|
|
383
383
|
w,
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
]),
|
|
384
|
+
P,
|
|
385
|
+
f,
|
|
386
|
+
N
|
|
387
|
+
]), k(() => {
|
|
388
388
|
const o = m.update({
|
|
389
389
|
spec: e,
|
|
390
390
|
data: t,
|
|
@@ -392,28 +392,28 @@ var Kt = (e) => ce((t) => ({
|
|
|
392
392
|
});
|
|
393
393
|
if (!o) return;
|
|
394
394
|
o.committedSpec && b.current?.(o.committedSpec);
|
|
395
|
-
const u =
|
|
396
|
-
|
|
395
|
+
const u = _(o.result);
|
|
396
|
+
I(y(u)), u && w(u), P(N(o.result)), u || h.emit({ kind: o.hasSpecChange ? "spec" : "data" });
|
|
397
397
|
}, [
|
|
398
398
|
e,
|
|
399
399
|
t,
|
|
400
400
|
r,
|
|
401
401
|
m,
|
|
402
402
|
h,
|
|
403
|
-
|
|
403
|
+
_,
|
|
404
404
|
w,
|
|
405
|
-
|
|
405
|
+
P,
|
|
406
406
|
y,
|
|
407
|
-
|
|
407
|
+
N,
|
|
408
408
|
b
|
|
409
409
|
]);
|
|
410
|
-
const M =
|
|
411
|
-
|
|
410
|
+
const M = p((o) => {
|
|
411
|
+
I((u) => u === null ? u : y(null)), P(N(o));
|
|
412
412
|
}, [
|
|
413
413
|
y,
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
]), L =
|
|
414
|
+
P,
|
|
415
|
+
N
|
|
416
|
+
]), L = p((o) => {
|
|
417
417
|
o.scene && E.current?.getState().setScene(o.scene), o.result && M(o.result), o.command && h.emit({
|
|
418
418
|
kind: "command",
|
|
419
419
|
command: o.command
|
|
@@ -423,42 +423,42 @@ var Kt = (e) => ce((t) => ({
|
|
|
423
423
|
h,
|
|
424
424
|
b,
|
|
425
425
|
w
|
|
426
|
-
]), R =
|
|
426
|
+
]), R = p((o) => {
|
|
427
427
|
for (const u of o) L(u);
|
|
428
428
|
return o.some((u) => !!u.scene);
|
|
429
|
-
}, [L]), W =
|
|
429
|
+
}, [L]), W = p((o, u) => {
|
|
430
430
|
R(m.applyCommand(o, u));
|
|
431
|
-
}, [m, R]),
|
|
431
|
+
}, [m, R]), V = p(() => {
|
|
432
432
|
R(m.commit());
|
|
433
|
-
}, [m, R]),
|
|
434
|
-
const u = m.preview(o).find((
|
|
433
|
+
}, [m, R]), Y = p(() => R(m.undo()), [m, R]), A = p(() => R(m.redo()), [m, R]), $ = p((o) => {
|
|
434
|
+
const u = m.preview(o).find((Le) => Le.scene)?.scene;
|
|
435
435
|
return u ? (E.current?.getState().setScene(u), !0) : !1;
|
|
436
|
-
}, [m]),
|
|
436
|
+
}, [m]), j = p(() => {
|
|
437
437
|
const o = m.scene;
|
|
438
438
|
o && E.current?.getState().setScene(o);
|
|
439
439
|
}, [m]), q = H(() => ({
|
|
440
440
|
stack: m.history,
|
|
441
|
-
undo:
|
|
441
|
+
undo: Y,
|
|
442
442
|
redo: A
|
|
443
443
|
}), [
|
|
444
444
|
m,
|
|
445
|
-
|
|
445
|
+
Y,
|
|
446
446
|
A
|
|
447
|
-
]),
|
|
447
|
+
]), se = p(() => E.current?.getState().scene ?? null, []);
|
|
448
448
|
return {
|
|
449
449
|
store: E.current,
|
|
450
450
|
dispatch: W,
|
|
451
|
-
commit:
|
|
451
|
+
commit: V,
|
|
452
452
|
paintPreview: $,
|
|
453
|
-
clearPreview:
|
|
453
|
+
clearPreview: j,
|
|
454
454
|
history: q,
|
|
455
455
|
subscribe: D.subscribe,
|
|
456
|
-
getScene:
|
|
456
|
+
getScene: se,
|
|
457
457
|
compileBus: h,
|
|
458
458
|
compileErrors: U,
|
|
459
459
|
findGeom: T
|
|
460
460
|
};
|
|
461
|
-
},
|
|
461
|
+
}, Wt = () => {
|
|
462
462
|
const e = /* @__PURE__ */ new Set();
|
|
463
463
|
return {
|
|
464
464
|
subscribe: (t) => (e.add(t), () => {
|
|
@@ -466,41 +466,41 @@ var Kt = (e) => ce((t) => ({
|
|
|
466
466
|
}),
|
|
467
467
|
notify: () => e.forEach((t) => t())
|
|
468
468
|
};
|
|
469
|
-
},
|
|
470
|
-
const G =
|
|
471
|
-
|
|
472
|
-
const x =
|
|
469
|
+
}, Vt = ["cartesian", "polar"], Yt = ({ data: e, spec: t, plugins: r = [], theme: n, glyphs: s, formattingLocale: i, handleRef: a, onSpecChange: l, onError: d, onWarnings: g, colorScheme: b = "light", children: C }) => {
|
|
470
|
+
const G = Jt(i, g), [m] = S(() => n), [h] = S(() => Ue(n?.glyphs, s)), T = m?.colorScheme ?? b, [f] = S(() => Oe([...m?.plugins ?? [], ...r].filter(Pe)));
|
|
471
|
+
Xt(f, h);
|
|
472
|
+
const x = ht(), [D] = S(() => tt(r)), [E] = S(() => nt(r)), [y] = S(() => wt()), [_] = S(() => qe()), U = H(() => we({ colorScheme: T }), [T]), { store: I, dispatch: N, commit: w, paintPreview: P, clearPreview: M, history: L, subscribe: R, getScene: W, compileBus: V, compileErrors: Y, findGeom: A } = Ut({
|
|
473
473
|
spec: t,
|
|
474
474
|
data: e,
|
|
475
475
|
colorScheme: T,
|
|
476
476
|
plugins: r,
|
|
477
477
|
theme: m,
|
|
478
|
-
resolveRenderer:
|
|
478
|
+
resolveRenderer: f,
|
|
479
479
|
anchorResolver: D,
|
|
480
480
|
onSpecChange: l,
|
|
481
481
|
onError: d,
|
|
482
482
|
onWarnings: g
|
|
483
483
|
});
|
|
484
|
-
|
|
485
|
-
if (
|
|
486
|
-
return
|
|
487
|
-
if (q.scene.spec ===
|
|
484
|
+
k(() => {
|
|
485
|
+
if (I)
|
|
486
|
+
return I.subscribe((q, se) => {
|
|
487
|
+
if (q.scene.spec === se.scene.spec) return;
|
|
488
488
|
const { selection: o, setSelection: u } = y.getState();
|
|
489
|
-
o.length !== 0 && u(
|
|
489
|
+
o.length !== 0 && u(It(o, q.scene.spec));
|
|
490
490
|
});
|
|
491
|
-
}, [
|
|
491
|
+
}, [I, y]);
|
|
492
492
|
const $ = H(() => ({
|
|
493
|
-
dispatch:
|
|
493
|
+
dispatch: N,
|
|
494
494
|
commit: w,
|
|
495
|
-
paintPreview:
|
|
495
|
+
paintPreview: P,
|
|
496
496
|
clearPreview: M
|
|
497
497
|
}), [
|
|
498
|
-
|
|
498
|
+
N,
|
|
499
499
|
w,
|
|
500
|
-
|
|
500
|
+
P,
|
|
501
501
|
M
|
|
502
502
|
]);
|
|
503
|
-
|
|
503
|
+
gt(a, () => ({
|
|
504
504
|
commands: $,
|
|
505
505
|
undo: L.undo,
|
|
506
506
|
redo: L.redo,
|
|
@@ -513,7 +513,7 @@ var Kt = (e) => ce((t) => ({
|
|
|
513
513
|
canPlaceDataLabels: E.hasCapability,
|
|
514
514
|
canFormatDataLabelsAsPercentages: E.hasPercentageFormat,
|
|
515
515
|
getGlyphs: () => h,
|
|
516
|
-
getPointSymbols: (q) =>
|
|
516
|
+
getPointSymbols: (q) => f("point", q)?.symbols
|
|
517
517
|
}), [
|
|
518
518
|
$,
|
|
519
519
|
L,
|
|
@@ -523,66 +523,66 @@ var Kt = (e) => ce((t) => ({
|
|
|
523
523
|
y,
|
|
524
524
|
E,
|
|
525
525
|
h,
|
|
526
|
-
|
|
526
|
+
f
|
|
527
527
|
]);
|
|
528
|
-
const
|
|
528
|
+
const j = H(() => I ? {
|
|
529
529
|
chartId: x,
|
|
530
|
-
store:
|
|
530
|
+
store: I,
|
|
531
531
|
selectionStore: y,
|
|
532
|
-
targetBoundaryStore:
|
|
532
|
+
targetBoundaryStore: _,
|
|
533
533
|
commands: $,
|
|
534
534
|
history: L,
|
|
535
535
|
formattingLocale: G,
|
|
536
|
-
compileBus:
|
|
536
|
+
compileBus: V,
|
|
537
537
|
colorScheme: T,
|
|
538
538
|
styleResolver: U,
|
|
539
539
|
anchorResolver: D,
|
|
540
540
|
findGeom: A
|
|
541
541
|
} : null, [
|
|
542
542
|
x,
|
|
543
|
-
|
|
543
|
+
I,
|
|
544
544
|
y,
|
|
545
|
-
|
|
545
|
+
_,
|
|
546
546
|
$,
|
|
547
547
|
L,
|
|
548
548
|
G,
|
|
549
|
-
|
|
549
|
+
V,
|
|
550
550
|
T,
|
|
551
551
|
U,
|
|
552
552
|
D,
|
|
553
553
|
A
|
|
554
554
|
]);
|
|
555
|
-
return /* @__PURE__ */ c(
|
|
556
|
-
forcedErrors:
|
|
555
|
+
return /* @__PURE__ */ c(Rt, {
|
|
556
|
+
forcedErrors: Y,
|
|
557
557
|
onError: d,
|
|
558
558
|
resetKeys: [t, e],
|
|
559
|
-
children:
|
|
560
|
-
value:
|
|
561
|
-
children: /* @__PURE__ */ c(
|
|
562
|
-
value:
|
|
563
|
-
children: /* @__PURE__ */ c(
|
|
559
|
+
children: j ? /* @__PURE__ */ c(ze.Provider, {
|
|
560
|
+
value: j,
|
|
561
|
+
children: /* @__PURE__ */ c(Ke, {
|
|
562
|
+
value: f,
|
|
563
|
+
children: /* @__PURE__ */ c(Fe, {
|
|
564
564
|
value: E,
|
|
565
|
-
children: /* @__PURE__ */ c(
|
|
565
|
+
children: /* @__PURE__ */ c(F, {
|
|
566
566
|
shapes: m?.shapes,
|
|
567
|
-
children: /* @__PURE__ */ c(
|
|
567
|
+
children: /* @__PURE__ */ c($e, {
|
|
568
568
|
glyphs: h,
|
|
569
|
-
children:
|
|
569
|
+
children: C
|
|
570
570
|
})
|
|
571
571
|
})
|
|
572
572
|
})
|
|
573
573
|
})
|
|
574
574
|
}) : null
|
|
575
575
|
});
|
|
576
|
-
}, jt = (e, t) => (e ?? []).filter((r) => !
|
|
577
|
-
|
|
578
|
-
if (!
|
|
576
|
+
}, jt = (e, t) => (e ?? []).filter((r) => !ce(r) && !t.has(r)), Xt = (e, t) => {
|
|
577
|
+
k(() => {
|
|
578
|
+
if (!Ne) return;
|
|
579
579
|
const r = new Set(t.map(({ name: n }) => n));
|
|
580
|
-
for (const n of
|
|
580
|
+
for (const n of Vt) for (const s of jt(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.`);
|
|
581
581
|
}, [e, t]);
|
|
582
|
-
},
|
|
582
|
+
}, Jt = (e, t) => {
|
|
583
583
|
const r = Q(t);
|
|
584
|
-
return
|
|
585
|
-
if (e === void 0 ||
|
|
584
|
+
return k(() => {
|
|
585
|
+
if (e === void 0 || it(e) !== void 0) return;
|
|
586
586
|
const n = [{
|
|
587
587
|
severity: "warning",
|
|
588
588
|
kind: "userInput",
|
|
@@ -590,10 +590,10 @@ var Kt = (e) => ce((t) => ({
|
|
|
590
590
|
message: `formattingLocale '${e}' is not a tag Intl can format in, so the chart formats in ${je}.`
|
|
591
591
|
}];
|
|
592
592
|
Z(n), r.current?.(n);
|
|
593
|
-
}, [e, r]), e === void 0 ? void 0 :
|
|
593
|
+
}, [e, r]), e === void 0 ? void 0 : et(e);
|
|
594
594
|
};
|
|
595
595
|
function _n({ theme: e, glyphs: t, ...r } = {}) {
|
|
596
|
-
const n =
|
|
596
|
+
const n = st(r);
|
|
597
597
|
return {
|
|
598
598
|
...n,
|
|
599
599
|
GraphProvider: (i) => /* @__PURE__ */ c(Yt, {
|
|
@@ -609,7 +609,7 @@ var B = (e, t) => {
|
|
|
609
609
|
if (!e.endsWith("%")) return null;
|
|
610
610
|
const r = Number.parseFloat(e);
|
|
611
611
|
return Number.isFinite(r) ? r / 100 * t : null;
|
|
612
|
-
},
|
|
612
|
+
}, $n = ({ x: e, y: t, width: r, height: n }, s) => {
|
|
613
613
|
const i = B(e, s.width), a = B(t, s.height), l = B(r, s.width), d = B(n, s.height);
|
|
614
614
|
return i === null || a === null || l === null || d === null ? null : {
|
|
615
615
|
x: i,
|
|
@@ -617,16 +617,16 @@ var B = (e, t) => {
|
|
|
617
617
|
width: l,
|
|
618
618
|
height: d
|
|
619
619
|
};
|
|
620
|
-
},
|
|
620
|
+
}, Qt = ({ animateTransitions: e, cx: t, cy: r, r: n, effects: s, ...i }) => {
|
|
621
621
|
const a = z(s);
|
|
622
|
-
return e ? /* @__PURE__ */ c(
|
|
622
|
+
return e ? /* @__PURE__ */ c(ne.circle, {
|
|
623
623
|
initial: !1,
|
|
624
624
|
animate: {
|
|
625
625
|
cx: t,
|
|
626
626
|
cy: r,
|
|
627
627
|
r: n
|
|
628
628
|
},
|
|
629
|
-
transition:
|
|
629
|
+
transition: K,
|
|
630
630
|
style: a,
|
|
631
631
|
...i
|
|
632
632
|
}) : /* @__PURE__ */ c("circle", {
|
|
@@ -636,9 +636,9 @@ var B = (e, t) => {
|
|
|
636
636
|
style: a,
|
|
637
637
|
...i
|
|
638
638
|
});
|
|
639
|
-
},
|
|
639
|
+
}, Zt = ({ animateTransitions: e, x1: t, y1: r, x2: n, y2: s, effects: i, ...a }) => {
|
|
640
640
|
const l = z(i);
|
|
641
|
-
return e ? /* @__PURE__ */ c(
|
|
641
|
+
return e ? /* @__PURE__ */ c(ne.line, {
|
|
642
642
|
initial: !1,
|
|
643
643
|
animate: {
|
|
644
644
|
x1: t,
|
|
@@ -646,7 +646,7 @@ var B = (e, t) => {
|
|
|
646
646
|
x2: n,
|
|
647
647
|
y2: s
|
|
648
648
|
},
|
|
649
|
-
transition:
|
|
649
|
+
transition: K,
|
|
650
650
|
style: l,
|
|
651
651
|
...a
|
|
652
652
|
}) : /* @__PURE__ */ c("line", {
|
|
@@ -657,9 +657,9 @@ var B = (e, t) => {
|
|
|
657
657
|
style: l,
|
|
658
658
|
...a
|
|
659
659
|
});
|
|
660
|
-
},
|
|
660
|
+
}, er = ({ animateTransitions: e, x: t, y: r, width: n, height: s, rx: i, ry: a, effects: l, ...d }) => {
|
|
661
661
|
const g = z(l);
|
|
662
|
-
return e ? /* @__PURE__ */ c(
|
|
662
|
+
return e ? /* @__PURE__ */ c(ne.rect, {
|
|
663
663
|
initial: !1,
|
|
664
664
|
animate: {
|
|
665
665
|
attrX: t,
|
|
@@ -671,7 +671,7 @@ var B = (e, t) => {
|
|
|
671
671
|
ry: a
|
|
672
672
|
} : {}
|
|
673
673
|
},
|
|
674
|
-
transition:
|
|
674
|
+
transition: K,
|
|
675
675
|
style: g,
|
|
676
676
|
...d
|
|
677
677
|
}) : /* @__PURE__ */ c("rect", {
|
|
@@ -684,9 +684,9 @@ var B = (e, t) => {
|
|
|
684
684
|
style: g,
|
|
685
685
|
...d
|
|
686
686
|
});
|
|
687
|
-
},
|
|
687
|
+
}, tr = ({ animateTransitions: e, d: t, source: r, effects: n, ...s }) => {
|
|
688
688
|
const i = z(n);
|
|
689
|
-
return e ? /* @__PURE__ */ c(
|
|
689
|
+
return e ? /* @__PURE__ */ c(rr, {
|
|
690
690
|
d: t,
|
|
691
691
|
source: r,
|
|
692
692
|
style: i,
|
|
@@ -696,15 +696,18 @@ var B = (e, t) => {
|
|
|
696
696
|
style: i,
|
|
697
697
|
...s
|
|
698
698
|
});
|
|
699
|
-
},
|
|
700
|
-
const { Circle: t } = ee(), { symbol:
|
|
701
|
-
|
|
699
|
+
}, Hn = (e) => {
|
|
700
|
+
const { Circle: t } = te(), { animateTransitions: r } = ee(), { symbol: n, ...s } = e, i = {
|
|
701
|
+
...s,
|
|
702
|
+
animateTransitions: r
|
|
703
|
+
};
|
|
704
|
+
return n !== void 0 && n !== "circle" ? /* @__PURE__ */ c("g", {
|
|
702
705
|
style: z(e.effects),
|
|
703
706
|
"data-testid": e["data-testid"],
|
|
704
|
-
children: /* @__PURE__ */ c(
|
|
705
|
-
symbol:
|
|
706
|
-
cx:
|
|
707
|
-
cy:
|
|
707
|
+
children: /* @__PURE__ */ c(xe, {
|
|
708
|
+
symbol: n,
|
|
709
|
+
cx: Se(e.cx),
|
|
710
|
+
cy: Se(e.cy),
|
|
708
711
|
size: e.r * 2,
|
|
709
712
|
fill: e.fill ?? "currentColor",
|
|
710
713
|
fillOpacity: e.fillOpacity,
|
|
@@ -712,62 +715,69 @@ var B = (e, t) => {
|
|
|
712
715
|
stroke: e.stroke,
|
|
713
716
|
strokeOpacity: e.strokeOpacity,
|
|
714
717
|
strokeWidth: e.strokeWidth,
|
|
715
|
-
motion:
|
|
716
|
-
transition:
|
|
718
|
+
motion: r ? {
|
|
719
|
+
transition: K,
|
|
717
720
|
intro: !1,
|
|
718
721
|
fadesIn: !1
|
|
719
722
|
} : null
|
|
720
723
|
})
|
|
721
|
-
}) : t === void 0 ?
|
|
722
|
-
},
|
|
723
|
-
const { Line: t } = ee()
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
724
|
+
}) : t === void 0 ? Qt(i) : /* @__PURE__ */ c(F, { children: /* @__PURE__ */ c(t, { ...i }) });
|
|
725
|
+
}, xn = (e) => {
|
|
726
|
+
const { Line: t } = te(), { animateTransitions: r } = ee(), n = {
|
|
727
|
+
...e,
|
|
728
|
+
animateTransitions: r
|
|
729
|
+
};
|
|
730
|
+
return t === void 0 ? Zt(n) : /* @__PURE__ */ c(F, { children: /* @__PURE__ */ c(t, { ...n }) });
|
|
731
|
+
}, Mn = ({ cornerRadius: e, ...t }) => {
|
|
732
|
+
const { Rect: r } = te(), n = Re()?.size ?? null, s = ke(), { animateTransitions: i } = ee(), a = {
|
|
727
733
|
...t,
|
|
728
|
-
|
|
734
|
+
animateTransitions: i,
|
|
735
|
+
...nr(e, t, n, s)
|
|
729
736
|
};
|
|
730
|
-
return r === void 0 ?
|
|
731
|
-
},
|
|
732
|
-
const { Path: t } = ee()
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
return /* @__PURE__ */ c(
|
|
737
|
+
return r === void 0 ? er(a) : /* @__PURE__ */ c(F, { children: /* @__PURE__ */ c(r, { ...a }) });
|
|
738
|
+
}, An = (e) => {
|
|
739
|
+
const { Path: t } = te(), { animateTransitions: r } = ee(), n = {
|
|
740
|
+
...e,
|
|
741
|
+
animateTransitions: r
|
|
742
|
+
};
|
|
743
|
+
return t === void 0 ? tr(n) : /* @__PURE__ */ c(F, { children: /* @__PURE__ */ c(t, { ...n }) });
|
|
744
|
+
}, Se = (e) => typeof e == "number" ? `${e}px` : e, rr = ({ d: e, source: t, ...r }) => {
|
|
745
|
+
const n = _e(e, K, t);
|
|
746
|
+
return /* @__PURE__ */ c(ne.path, {
|
|
737
747
|
d: n,
|
|
738
748
|
...r
|
|
739
749
|
});
|
|
740
|
-
},
|
|
750
|
+
}, nr = (e, t, r, n) => {
|
|
741
751
|
if (e === void 0) return {};
|
|
742
|
-
const s =
|
|
752
|
+
const s = at(e);
|
|
743
753
|
if (s === void 0) return {};
|
|
744
|
-
const i =
|
|
754
|
+
const i = sr(t, r, n);
|
|
745
755
|
if (i === null)
|
|
746
|
-
return s === "full" ? {} :
|
|
747
|
-
const a = Math.min(
|
|
756
|
+
return s === "full" ? {} : Te(he({ cornerRadius: s }), n);
|
|
757
|
+
const a = Math.min(he({
|
|
748
758
|
cornerRadius: s,
|
|
749
759
|
box: i
|
|
750
760
|
}), Math.min(i.width, i.height) / 2);
|
|
751
|
-
return
|
|
752
|
-
},
|
|
753
|
-
const n =
|
|
761
|
+
return Te(a, n);
|
|
762
|
+
}, sr = (e, t, r) => {
|
|
763
|
+
const n = be(e.width, t?.width, r.x), s = be(e.height, t?.height, r.y);
|
|
754
764
|
return n === null || s === null ? null : {
|
|
755
765
|
width: n,
|
|
756
766
|
height: s
|
|
757
767
|
};
|
|
758
|
-
},
|
|
768
|
+
}, be = (e, t, r) => {
|
|
759
769
|
if (typeof e == "number") return Number.isFinite(e) ? Math.abs(e) * r : null;
|
|
760
770
|
if (t === void 0) return null;
|
|
761
771
|
const n = B(e, t);
|
|
762
772
|
return n === null ? null : Math.abs(n);
|
|
763
|
-
},
|
|
773
|
+
}, Te = (e, t) => t.x <= 0 || t.y <= 0 ? {
|
|
764
774
|
rx: 0,
|
|
765
775
|
ry: 0
|
|
766
776
|
} : {
|
|
767
777
|
rx: e / t.x,
|
|
768
778
|
ry: e / t.y
|
|
769
|
-
},
|
|
770
|
-
const l =
|
|
779
|
+
}, On = ({ symbol: e, size: t, fill: r, fillOpacity: n, stroke: s, strokeOpacity: i, strokeWidth: a }) => {
|
|
780
|
+
const l = Ae(), d = Ye(), g = Ve((G) => G.coordSystem.type), b = or(e, d("point", g)?.symbols ?? [], l), C = {
|
|
771
781
|
size: t,
|
|
772
782
|
fill: r,
|
|
773
783
|
fillOpacity: n,
|
|
@@ -775,21 +785,21 @@ var B = (e, t) => {
|
|
|
775
785
|
strokeOpacity: i,
|
|
776
786
|
strokeWidth: a
|
|
777
787
|
};
|
|
778
|
-
return
|
|
779
|
-
d:
|
|
788
|
+
return ce(b) ? /* @__PURE__ */ c("path", {
|
|
789
|
+
d: Ze(b, t),
|
|
780
790
|
fill: r,
|
|
781
791
|
fillOpacity: n,
|
|
782
792
|
stroke: s,
|
|
783
793
|
strokeOpacity: i,
|
|
784
794
|
strokeWidth: a,
|
|
785
795
|
strokeLinejoin: "round"
|
|
786
|
-
}) : /* @__PURE__ */ c(
|
|
796
|
+
}) : /* @__PURE__ */ c(Me, {
|
|
787
797
|
symbol: b,
|
|
788
798
|
glyphs: l,
|
|
789
|
-
...
|
|
799
|
+
...C
|
|
790
800
|
});
|
|
791
|
-
},
|
|
792
|
-
const r =
|
|
801
|
+
}, or = (e, t, r) => lt(e) || t.includes(e) || !ce(e) && r.has(e) ? e : t[0] ?? "circle", Bn = ({ children: e, ...t }) => {
|
|
802
|
+
const r = Re()?.size ?? null;
|
|
793
803
|
return /* @__PURE__ */ c("svg", {
|
|
794
804
|
viewBox: "0 0 1 1",
|
|
795
805
|
preserveAspectRatio: "none",
|
|
@@ -797,14 +807,14 @@ var B = (e, t) => {
|
|
|
797
807
|
height: "100%",
|
|
798
808
|
pointerEvents: "none",
|
|
799
809
|
...t,
|
|
800
|
-
children: /* @__PURE__ */ c(
|
|
810
|
+
children: /* @__PURE__ */ c(Ie, {
|
|
801
811
|
size: r,
|
|
802
812
|
space: "unit",
|
|
803
813
|
children: e
|
|
804
814
|
})
|
|
805
815
|
});
|
|
806
|
-
},
|
|
807
|
-
const r =
|
|
816
|
+
}, Fn = ({ box: e, children: t }) => {
|
|
817
|
+
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 : {
|
|
808
818
|
width: n,
|
|
809
819
|
height: s
|
|
810
820
|
}, [n, s]);
|
|
@@ -815,54 +825,54 @@ var B = (e, t) => {
|
|
|
815
825
|
height: X(e.y1 - e.y0),
|
|
816
826
|
overflow: "hidden",
|
|
817
827
|
pointerEvents: "none",
|
|
818
|
-
children: /* @__PURE__ */ c(
|
|
828
|
+
children: /* @__PURE__ */ c(Ie, {
|
|
819
829
|
size: i,
|
|
820
830
|
children: t
|
|
821
831
|
})
|
|
822
832
|
});
|
|
823
|
-
},
|
|
824
|
-
var
|
|
825
|
-
var
|
|
833
|
+
}, ir = "drqe3u0", ar = "drqe3u1", cr = "drqe3u2", lr = "drqe3u3", O = "drqe3u4", dr = "drqe3u5", ur = "drqe3u6", mr = "drqe3u7", J = "drqe3u8", hr = "drqe3u9", gr = "drqe3ua";
|
|
834
|
+
var pr = "drqe3uc", fr = "drqe3ud", vr = "drqe3ue", yr = "drqe3uf";
|
|
835
|
+
var Sr = "drqe3uh", br = "drqe3ui", Ee = {
|
|
826
836
|
enabled: "drqe3uk drqe3uj",
|
|
827
837
|
disabled: "drqe3ul drqe3uj"
|
|
828
|
-
},
|
|
838
|
+
}, Ge = {
|
|
829
839
|
ran: "drqe3un drqe3um",
|
|
830
840
|
dim: "drqe3uo drqe3um"
|
|
831
|
-
},
|
|
841
|
+
}, De = {
|
|
832
842
|
ran: "drqe3uq drqe3up",
|
|
833
843
|
cached: "drqe3ur drqe3up",
|
|
834
844
|
untouched: "drqe3us drqe3up"
|
|
835
|
-
},
|
|
836
|
-
const { compileBus: n } =
|
|
837
|
-
|
|
838
|
-
const { recordCompile: h } = s.getState(), T = n.getLastTrigger(),
|
|
839
|
-
return T &&
|
|
845
|
+
}, Kn = ({ width: e = 440, style: t, className: r } = {}) => {
|
|
846
|
+
const { compileBus: n } = ie(), [s] = S(() => Lt()), [i, a] = S(!1), [l, d] = S(ct);
|
|
847
|
+
k(() => {
|
|
848
|
+
const { recordCompile: h } = s.getState(), T = n.getLastTrigger(), f = n.getLastCompile();
|
|
849
|
+
return T && f && h(T, f), n.subscribe(h);
|
|
840
850
|
}, [s, n]);
|
|
841
|
-
const g =
|
|
851
|
+
const g = oe(s, (h) => h.lastCompile), b = oe(s, (h) => h.history), C = n.getCacheStats(), G = g === null && b.length === 0, m = () => {
|
|
842
852
|
d((h) => {
|
|
843
853
|
const T = !h;
|
|
844
|
-
return
|
|
854
|
+
return ut(T), T;
|
|
845
855
|
});
|
|
846
856
|
};
|
|
847
857
|
return /* @__PURE__ */ v("div", {
|
|
848
|
-
className:
|
|
858
|
+
className: vt(gr, r),
|
|
849
859
|
style: {
|
|
850
860
|
width: e,
|
|
851
861
|
...t
|
|
852
862
|
},
|
|
853
863
|
children: [
|
|
854
864
|
/* @__PURE__ */ v("div", {
|
|
855
|
-
className:
|
|
865
|
+
className: ir,
|
|
856
866
|
children: [/* @__PURE__ */ v("div", { children: [/* @__PURE__ */ c("div", {
|
|
857
|
-
className:
|
|
867
|
+
className: ar,
|
|
858
868
|
children: "compile cache"
|
|
859
869
|
}), /* @__PURE__ */ c("div", {
|
|
860
|
-
className:
|
|
861
|
-
children: G ? "production: stats disabled" : g ? `last: ${g.label} · ${
|
|
870
|
+
className: vr,
|
|
871
|
+
children: G ? "production: stats disabled" : g ? `last: ${g.label} · ${de(g.durationMs)}` : "awaiting first compile…"
|
|
862
872
|
})] }), /* @__PURE__ */ c("button", {
|
|
863
873
|
type: "button",
|
|
864
874
|
onClick: () => a((h) => !h),
|
|
865
|
-
className:
|
|
875
|
+
className: yr,
|
|
866
876
|
children: i ? "▾" : "▴"
|
|
867
877
|
})]
|
|
868
878
|
}),
|
|
@@ -871,7 +881,7 @@ var yr = "drqe3uh", Sr = "drqe3ui", Te = {
|
|
|
871
881
|
children: [/* @__PURE__ */ v("button", {
|
|
872
882
|
type: "button",
|
|
873
883
|
onClick: m,
|
|
874
|
-
className: l ?
|
|
884
|
+
className: l ? Ee.enabled : Ee.disabled,
|
|
875
885
|
"aria-pressed": l,
|
|
876
886
|
children: ["cache ", l ? "enabled" : "disabled"]
|
|
877
887
|
}), /* @__PURE__ */ c("span", {
|
|
@@ -879,20 +889,20 @@ var yr = "drqe3uh", Sr = "drqe3ui", Te = {
|
|
|
879
889
|
children: "next compile reflects this toggle"
|
|
880
890
|
})]
|
|
881
891
|
}),
|
|
882
|
-
!i && !G && /* @__PURE__ */ v(ft, { children: [/* @__PURE__ */ c(
|
|
892
|
+
!i && !G && /* @__PURE__ */ v(ft, { children: [/* @__PURE__ */ c(Tr, {
|
|
883
893
|
delta: g?.stages,
|
|
884
894
|
durations: g?.stageDurationsMs,
|
|
885
|
-
cumulative:
|
|
886
|
-
}), /* @__PURE__ */ c(
|
|
895
|
+
cumulative: C
|
|
896
|
+
}), /* @__PURE__ */ c(Er, { entries: b })] })
|
|
887
897
|
]
|
|
888
898
|
});
|
|
889
|
-
},
|
|
890
|
-
className:
|
|
899
|
+
}, Tr = ({ delta: e, durations: t, cumulative: r }) => /* @__PURE__ */ v("table", {
|
|
900
|
+
className: cr,
|
|
891
901
|
children: [/* @__PURE__ */ c("thead", { children: /* @__PURE__ */ v("tr", {
|
|
892
|
-
className:
|
|
902
|
+
className: Sr,
|
|
893
903
|
children: [
|
|
894
904
|
/* @__PURE__ */ c("th", {
|
|
895
|
-
className:
|
|
905
|
+
className: lr,
|
|
896
906
|
children: "stage"
|
|
897
907
|
}),
|
|
898
908
|
/* @__PURE__ */ c("th", {
|
|
@@ -916,16 +926,16 @@ var yr = "drqe3uh", Sr = "drqe3ui", Te = {
|
|
|
916
926
|
children: "total hit"
|
|
917
927
|
})
|
|
918
928
|
]
|
|
919
|
-
}) }), /* @__PURE__ */ c("tbody", { children:
|
|
920
|
-
const s = e?.[n], i =
|
|
929
|
+
}) }), /* @__PURE__ */ c("tbody", { children: ae.map((n) => {
|
|
930
|
+
const s = e?.[n], i = Gr(s);
|
|
921
931
|
return /* @__PURE__ */ v("tr", {
|
|
922
|
-
className:
|
|
932
|
+
className: pr,
|
|
923
933
|
children: [
|
|
924
934
|
/* @__PURE__ */ v("td", {
|
|
925
|
-
className:
|
|
935
|
+
className: dr,
|
|
926
936
|
children: [
|
|
927
937
|
/* @__PURE__ */ c("span", {
|
|
928
|
-
className:
|
|
938
|
+
className: De[i],
|
|
929
939
|
"aria-hidden": !0
|
|
930
940
|
}),
|
|
931
941
|
" ",
|
|
@@ -934,10 +944,10 @@ var yr = "drqe3uh", Sr = "drqe3ui", Te = {
|
|
|
934
944
|
}),
|
|
935
945
|
/* @__PURE__ */ c("td", {
|
|
936
946
|
className: J,
|
|
937
|
-
children: t === void 0 || i === "untouched" ? "—" :
|
|
947
|
+
children: t === void 0 || i === "untouched" ? "—" : de(t[n])
|
|
938
948
|
}),
|
|
939
949
|
/* @__PURE__ */ c("td", {
|
|
940
|
-
className: i === "ran" ?
|
|
950
|
+
className: i === "ran" ? Ge.ran : Ge.dim,
|
|
941
951
|
children: s?.misses ?? 0
|
|
942
952
|
}),
|
|
943
953
|
/* @__PURE__ */ c("td", {
|
|
@@ -955,44 +965,44 @@ var yr = "drqe3uh", Sr = "drqe3ui", Te = {
|
|
|
955
965
|
]
|
|
956
966
|
}, n);
|
|
957
967
|
}) })]
|
|
958
|
-
}),
|
|
968
|
+
}), Er = ({ entries: e }) => e.length === 0 ? null : /* @__PURE__ */ v("div", {
|
|
959
969
|
className: fr,
|
|
960
970
|
children: [/* @__PURE__ */ c("div", {
|
|
961
|
-
className:
|
|
971
|
+
className: br,
|
|
962
972
|
children: "recent compiles"
|
|
963
973
|
}), e.map((t) => {
|
|
964
|
-
const r =
|
|
974
|
+
const r = Rr(t.stages, (i) => i.misses > 0), n = ae.length;
|
|
965
975
|
return /* @__PURE__ */ v("div", {
|
|
966
|
-
className:
|
|
976
|
+
className: ur,
|
|
967
977
|
children: [
|
|
968
978
|
/* @__PURE__ */ c("span", {
|
|
969
|
-
className:
|
|
979
|
+
className: De[r === 0 ? "cached" : "ran"],
|
|
970
980
|
"aria-hidden": !0
|
|
971
981
|
}),
|
|
972
982
|
/* @__PURE__ */ c("span", {
|
|
973
|
-
className:
|
|
983
|
+
className: mr,
|
|
974
984
|
title: t.label,
|
|
975
985
|
children: t.label
|
|
976
986
|
}),
|
|
977
987
|
/* @__PURE__ */ v("span", {
|
|
978
|
-
className:
|
|
988
|
+
className: hr,
|
|
979
989
|
children: [
|
|
980
990
|
r,
|
|
981
991
|
"/",
|
|
982
992
|
n,
|
|
983
993
|
" ran · ",
|
|
984
|
-
|
|
994
|
+
de(t.durationMs)
|
|
985
995
|
]
|
|
986
996
|
})
|
|
987
997
|
]
|
|
988
998
|
}, t.id);
|
|
989
999
|
})]
|
|
990
|
-
}),
|
|
1000
|
+
}), Gr = (e) => !e || e.hits === 0 && e.misses === 0 ? "untouched" : e.misses > 0 ? "ran" : "cached", Rr = (e, t) => {
|
|
991
1001
|
let r = 0;
|
|
992
|
-
for (const n of
|
|
1002
|
+
for (const n of ae) t(e[n]) && (r += 1);
|
|
993
1003
|
return r;
|
|
994
|
-
},
|
|
995
|
-
const { history: e } =
|
|
1004
|
+
}, de = (e) => e < 0.1 ? "<0.1ms" : e >= 10 ? `${e.toFixed(0)}ms` : `${e.toFixed(2)}ms`, zn = () => {
|
|
1005
|
+
const { history: e } = ie(), { stack: t, undo: r, redo: n } = e, s = p((l) => t.subscribe(l), [t]), i = p(() => t.getSnapshot(), [t]), a = pt(s, i, i);
|
|
996
1006
|
return H(() => ({
|
|
997
1007
|
...a,
|
|
998
1008
|
undo: r,
|
|
@@ -1002,7 +1012,7 @@ var yr = "drqe3uh", Sr = "drqe3ui", Te = {
|
|
|
1002
1012
|
r,
|
|
1003
1013
|
n
|
|
1004
1014
|
]);
|
|
1005
|
-
},
|
|
1015
|
+
}, Ir = /* @__PURE__ */ new Set([
|
|
1006
1016
|
"button",
|
|
1007
1017
|
"checkbox",
|
|
1008
1018
|
"color",
|
|
@@ -1013,14 +1023,14 @@ var yr = "drqe3uh", Sr = "drqe3ui", Te = {
|
|
|
1013
1023
|
"range",
|
|
1014
1024
|
"reset",
|
|
1015
1025
|
"submit"
|
|
1016
|
-
]),
|
|
1026
|
+
]), Un = (e, t = {}) => {
|
|
1017
1027
|
const { target: r, enabled: n = !0 } = t;
|
|
1018
|
-
|
|
1028
|
+
k(() => {
|
|
1019
1029
|
const s = Nr(r);
|
|
1020
1030
|
if (!n || !s) return;
|
|
1021
1031
|
const i = (a) => {
|
|
1022
|
-
if (!
|
|
1023
|
-
const l =
|
|
1032
|
+
if (!wr(a) || a.defaultPrevented || Pr(a.target)) return;
|
|
1033
|
+
const l = We(a);
|
|
1024
1034
|
if (!l) return;
|
|
1025
1035
|
const d = e.current;
|
|
1026
1036
|
d && (l === "undo" ? d.undo() : d.redo()) && a.preventDefault();
|
|
@@ -1031,83 +1041,84 @@ var yr = "drqe3uh", Sr = "drqe3ui", Te = {
|
|
|
1031
1041
|
r,
|
|
1032
1042
|
n
|
|
1033
1043
|
]);
|
|
1034
|
-
}, Nr = (e) => e === void 0 ? window : e !== null && "current" in e ? e.current : e,
|
|
1035
|
-
const { targetBoundaryStore: e } =
|
|
1036
|
-
return
|
|
1044
|
+
}, Nr = (e) => e === void 0 ? window : e !== null && "current" in e ? e.current : e, wr = (e) => "key" in e, Pr = (e) => e instanceof HTMLInputElement ? !Ir.has(e.type) : e instanceof HTMLElement ? e.isContentEditable || e.tagName === "TEXTAREA" : !1, Wn = () => {
|
|
1045
|
+
const { targetBoundaryStore: e } = ie();
|
|
1046
|
+
return oe(e, (t) => t.boundary);
|
|
1037
1047
|
};
|
|
1038
1048
|
export {
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1049
|
+
fn as CanvasTextMeasurer,
|
|
1050
|
+
Or as DefaultFooter,
|
|
1051
|
+
Qt as DefaultGeomCircle,
|
|
1052
|
+
Zt as DefaultGeomLine,
|
|
1053
|
+
tr as DefaultGeomPath,
|
|
1054
|
+
er as DefaultGeomRect,
|
|
1055
|
+
mn as DefaultGrid,
|
|
1056
|
+
Hr as DefaultHeader,
|
|
1057
|
+
sn as DefaultSwatch,
|
|
1058
|
+
Rn as DefaultTooltip,
|
|
1059
|
+
Kn as DevToolsPanel,
|
|
1060
|
+
Qr as GRAPH_MODES,
|
|
1061
|
+
Hn as GeomCircle,
|
|
1062
|
+
xn as GeomLine,
|
|
1063
|
+
Fr as GeomOverpaint,
|
|
1064
|
+
_r as GeomPanelSizeProvider,
|
|
1065
|
+
An as GeomPath,
|
|
1066
|
+
Mn as GeomRect,
|
|
1067
|
+
Rt as GraphErrorBoundary,
|
|
1068
|
+
pe as GraphErrorPanel,
|
|
1059
1069
|
Yt as GraphProvider,
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1070
|
+
tn as GraphRenderer,
|
|
1071
|
+
vn as GraphyBadge,
|
|
1072
|
+
Ar as HoverProvider,
|
|
1073
|
+
Kr as IntlProvider,
|
|
1074
|
+
rn as IntroFade,
|
|
1075
|
+
zr as IntroWipeClip,
|
|
1076
|
+
On as SymbolFigure,
|
|
1077
|
+
on as TextMeasurerProvider,
|
|
1078
|
+
$r as ThemeProvider,
|
|
1079
|
+
Fn as UnitBoxSvg,
|
|
1080
|
+
Bn as UnitSpaceSvg,
|
|
1071
1081
|
Xr as buildDotsEditOutlineShapes,
|
|
1072
1082
|
_n as createGraphyKit,
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1083
|
+
un as darkTheme,
|
|
1084
|
+
bn as defineGeomRenderer,
|
|
1085
|
+
Br as defineGlyph,
|
|
1086
|
+
pn as getBuiltInEditOutlineShapes,
|
|
1087
|
+
qr as lightTheme,
|
|
1078
1088
|
Tn as lightenCss,
|
|
1079
|
-
|
|
1089
|
+
It as pruneSelection,
|
|
1080
1090
|
B as readPositionPixels,
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
zn as
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
Sn as
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1091
|
+
$n as readRectPixels,
|
|
1092
|
+
Mr as resolveGraphyBadgeVariant,
|
|
1093
|
+
Nn as resolvePathStroke,
|
|
1094
|
+
xr as scalePointToPanel,
|
|
1095
|
+
Wr as stampAxisEditTarget,
|
|
1096
|
+
In as stampGridEditTarget,
|
|
1097
|
+
kr as stampLegendEditTarget,
|
|
1098
|
+
Vr as useElementScreenRect,
|
|
1099
|
+
en as useFormattingLocale,
|
|
1100
|
+
yn as useGeomHitTest,
|
|
1101
|
+
Jr as useGeomHover,
|
|
1102
|
+
dn as useGeomPanelSize,
|
|
1103
|
+
Zr as useGeomReaderTree,
|
|
1104
|
+
Ur as useGeomStyleReader,
|
|
1105
|
+
He as useGeomViewportSize,
|
|
1106
|
+
ee as useGraphAnimation,
|
|
1107
|
+
gn as useGraphCommands,
|
|
1108
|
+
ln as useGraphHandle,
|
|
1109
|
+
zn as useGraphHistory,
|
|
1110
|
+
Un as useGraphHistoryShortcuts,
|
|
1111
|
+
En as useGraphLocale,
|
|
1112
|
+
Gn as useGraphSelection,
|
|
1113
|
+
Lr as useGuidesTakePress,
|
|
1114
|
+
Sn as useHandleScene,
|
|
1115
|
+
nn as useHoverState,
|
|
1116
|
+
jr as usePaintDefs,
|
|
1117
|
+
hn as useResolvedStyle,
|
|
1118
|
+
Ve as useSceneSelector,
|
|
1119
|
+
Dr as useStyleReaderTree,
|
|
1120
|
+
an as useStyleResolver,
|
|
1121
|
+
Wn as useTargetBoundary,
|
|
1122
|
+
cn as useTextMeasurer,
|
|
1123
|
+
Yr as vars
|
|
1113
1124
|
};
|