@graphysdk/react-renderer 1.9.0-beta.1789582064893 → 1.9.0-beta.1789643389031
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 +9 -1
- package/dist/editable.mjs +2495 -2411
- package/dist/{history-chords-S1G_f-FU.js → history-chords-BEesSXz6.js} +2665 -2411
- package/dist/history-chords-CgQJHeIs.cjs +2 -0
- package/dist/history-chords.css +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +62 -2
- package/dist/index.mjs +307 -295
- package/package.json +2 -2
- package/dist/history-chords-vcFCt26X.cjs +0 -2
package/dist/index.mjs
CHANGED
|
@@ -1,84 +1,84 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as
|
|
3
|
-
import { COMPILER_STAGE_KEYS as j, Geom as pe, GraphCompilationSession as fe, areEditTargetsEqual as ve, buildDiagnostic as
|
|
4
|
-
import { Component as
|
|
5
|
-
import { Fragment as
|
|
1
|
+
import { A as Dt, Ct as $t, Dt as Ht, E as xt, Et as le, F as Mt, Ft as Pt, Gt as Lt, Ht as Bt, I as Ot, It as At, Jt as ue, Kt, M as Ft, Mt as jt, Nt as me, Ot as F, Pt as Ut, R as Yt, St as Wt, Tt as A, Wt as Vt, Xt as K, Yt as se, _ as Xt, _t as zt, a as Jt, ct as Qt, dt as Zt, ht as er, i as tr, j as rr, kt as he, n as nr, nt as sr, qt as or, r as ir, rt as ar, s as cr, t as ge, ut as dr, vt as lr, z as ur } from "./history-chords-BEesSXz6.js";
|
|
2
|
+
import { n as hr } from "./theme.contract.css-DaZ5UPN0.js";
|
|
3
|
+
import { COMPILER_STAGE_KEYS as j, Geom as pe, GraphCompilationSession as fe, areEditTargetsEqual as ve, buildDiagnostic as X, createAnchorResolver as ye, createCompiler as Se, createGraphyBuilder as be, createStyleResolver as Ee, findAnnotation as Te, findLayerById as z, isCompilerCachingEnabled as Ne, resolveDefinition as Re, setCompilerCachingEnabled as qe, toPercent as L } from "@graphysdk/viz-engine";
|
|
4
|
+
import { Component as Ce, useCallback as f, useEffect as x, useId as Ge, useImperativeHandle as ke, useMemo as H, useRef as J, useState as T, useSyncExternalStore as Ie } from "react";
|
|
5
|
+
import { Fragment as _e, jsx as c, jsxs as v } from "react/jsx-runtime";
|
|
6
6
|
import { useStore as Q } from "zustand";
|
|
7
|
-
import { createStore as
|
|
8
|
-
import
|
|
7
|
+
import { createStore as U } from "zustand/vanilla";
|
|
8
|
+
import we from "clsx";
|
|
9
9
|
import './index.css';var De = "_1a5iqpb0", $e = "_1a5iqpb1";
|
|
10
10
|
var He = "_1a5iqpb3", xe = "_1a5iqpb4", Me = "_1a5iqpb5";
|
|
11
|
-
var
|
|
12
|
-
const [t, ...
|
|
11
|
+
var Z = ({ errors: e }) => {
|
|
12
|
+
const [t, ...n] = e;
|
|
13
13
|
return /* @__PURE__ */ v("div", {
|
|
14
14
|
role: "alert",
|
|
15
15
|
className: De,
|
|
16
16
|
children: [
|
|
17
|
-
/* @__PURE__ */
|
|
17
|
+
/* @__PURE__ */ c("strong", {
|
|
18
18
|
className: $e,
|
|
19
19
|
children: "This chart could not be rendered."
|
|
20
20
|
}),
|
|
21
|
-
t && /* @__PURE__ */
|
|
22
|
-
|
|
21
|
+
t && /* @__PURE__ */ c(ee, { diagnostic: t }),
|
|
22
|
+
n.length > 0 && /* @__PURE__ */ c("ul", {
|
|
23
23
|
className: "_1a5iqpb2",
|
|
24
|
-
children:
|
|
24
|
+
children: n.map((r, o) => /* @__PURE__ */ c("li", { children: /* @__PURE__ */ c(ee, { diagnostic: r }) }, `${r.code}-${o}`))
|
|
25
25
|
})
|
|
26
26
|
]
|
|
27
27
|
});
|
|
28
|
-
},
|
|
28
|
+
}, ee = ({ diagnostic: e }) => /* @__PURE__ */ v("div", {
|
|
29
29
|
className: He,
|
|
30
30
|
children: [
|
|
31
|
-
/* @__PURE__ */
|
|
31
|
+
/* @__PURE__ */ c("span", {
|
|
32
32
|
className: xe,
|
|
33
33
|
children: e.code
|
|
34
34
|
}),
|
|
35
|
-
/* @__PURE__ */
|
|
35
|
+
/* @__PURE__ */ c("p", {
|
|
36
36
|
className: Me,
|
|
37
37
|
children: e.message
|
|
38
38
|
}),
|
|
39
|
-
e.suggestion && /* @__PURE__ */
|
|
39
|
+
e.suggestion && /* @__PURE__ */ c("p", {
|
|
40
40
|
className: "_1a5iqpb6",
|
|
41
41
|
children: e.suggestion
|
|
42
42
|
})
|
|
43
43
|
]
|
|
44
44
|
});
|
|
45
45
|
function Pe(e = [], t = []) {
|
|
46
|
-
return e.length === t.length && e.every((
|
|
46
|
+
return e.length === t.length && e.every((n, r) => Object.is(n, t[r]));
|
|
47
47
|
}
|
|
48
|
-
var Le = class extends
|
|
48
|
+
var Le = class extends Ce {
|
|
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: X(e) };
|
|
54
54
|
}
|
|
55
55
|
componentDidCatch(e, t) {
|
|
56
|
-
const
|
|
57
|
-
|
|
56
|
+
const n = X(e);
|
|
57
|
+
K([n]), this.props.onError?.([n]), 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__ */
|
|
65
|
-
const { forcedErrors: t, children:
|
|
66
|
-
return t && t.length > 0 ? /* @__PURE__ */
|
|
64
|
+
if (e) return /* @__PURE__ */ c(Z, { errors: [e] });
|
|
65
|
+
const { forcedErrors: t, children: n } = this.props;
|
|
66
|
+
return t && t.length > 0 ? /* @__PURE__ */ c(Z, { errors: t }) : n;
|
|
67
67
|
}
|
|
68
|
-
},
|
|
68
|
+
}, oe = (e) => typeof e == "object" && "geom" in e && "render" in e, Be = (e) => {
|
|
69
69
|
const t = Re(e);
|
|
70
70
|
return t instanceof pe ? t : null;
|
|
71
|
-
},
|
|
72
|
-
const
|
|
73
|
-
return
|
|
74
|
-
},
|
|
75
|
-
selection:
|
|
76
|
-
setSelection: (t) => e((
|
|
77
|
-
clearSelection: () => e((t) => t.selection.length === 0 ? t : { selection:
|
|
78
|
-
})),
|
|
79
|
-
const o = t[
|
|
80
|
-
return o !== void 0 && ve(
|
|
81
|
-
}), je = process.env.NODE_ENV !== "production",
|
|
71
|
+
}, Oe = (e, t) => {
|
|
72
|
+
const n = e.filter((r) => Ae(r, t));
|
|
73
|
+
return n.length === e.length ? e : n;
|
|
74
|
+
}, Ae = (e, t) => e.kind === "annotation" ? Te(t.annotations, e.id) !== null : e.kind === "observations" ? z(t.layers, e.layerId) !== void 0 : e.kind === "layer" && e.layerId !== void 0 ? z(t.layers, e.layerId) !== void 0 : !0, te = [], Ke = () => U((e) => ({
|
|
75
|
+
selection: te,
|
|
76
|
+
setSelection: (t) => e((n) => Fe(n.selection, t) ? n : { selection: t }),
|
|
77
|
+
clearSelection: () => e((t) => t.selection.length === 0 ? t : { selection: te })
|
|
78
|
+
})), Fe = (e, t) => e === t ? !0 : e.length !== t.length ? !1 : e.every((n, r) => {
|
|
79
|
+
const o = t[r];
|
|
80
|
+
return o !== void 0 && ve(n, o);
|
|
81
|
+
}), je = process.env.NODE_ENV !== "production", Ue = 5, Ye = (e) => {
|
|
82
82
|
if (!je) return {
|
|
83
83
|
emit: () => {
|
|
84
84
|
},
|
|
@@ -88,40 +88,41 @@ var Le = class extends qe {
|
|
|
88
88
|
getCacheStats: () => e.getCacheStats()
|
|
89
89
|
};
|
|
90
90
|
const t = /* @__PURE__ */ new Set();
|
|
91
|
-
let
|
|
91
|
+
let n = null;
|
|
92
92
|
return {
|
|
93
|
-
emit: (
|
|
93
|
+
emit: (r) => {
|
|
94
94
|
const o = e.getLastCompile();
|
|
95
95
|
if (o) {
|
|
96
|
-
|
|
97
|
-
for (const a of t) a(
|
|
96
|
+
n = r;
|
|
97
|
+
for (const a of t) a(r, o);
|
|
98
98
|
}
|
|
99
99
|
},
|
|
100
|
-
subscribe: (
|
|
101
|
-
t.delete(
|
|
100
|
+
subscribe: (r) => (t.add(r), () => {
|
|
101
|
+
t.delete(r);
|
|
102
102
|
}),
|
|
103
|
-
getLastTrigger: () =>
|
|
103
|
+
getLastTrigger: () => n,
|
|
104
104
|
getLastCompile: () => e.getLastCompile(),
|
|
105
105
|
getCacheStats: () => e.getCacheStats()
|
|
106
106
|
};
|
|
107
|
-
}, We = () =>
|
|
107
|
+
}, We = () => U((e) => ({
|
|
108
108
|
lastCompile: null,
|
|
109
109
|
history: [],
|
|
110
110
|
nextId: 1,
|
|
111
111
|
lastSnapshot: null,
|
|
112
|
-
recordCompile: (t,
|
|
113
|
-
if (
|
|
112
|
+
recordCompile: (t, n) => e((r) => {
|
|
113
|
+
if (r.lastSnapshot === n) return r;
|
|
114
114
|
const o = {
|
|
115
|
-
id:
|
|
115
|
+
id: r.nextId,
|
|
116
116
|
label: Xe(t),
|
|
117
|
-
stages:
|
|
118
|
-
|
|
117
|
+
stages: n.stages,
|
|
118
|
+
stageDurationsMs: n.stageDurationsMs,
|
|
119
|
+
durationMs: n.durationMs
|
|
119
120
|
};
|
|
120
121
|
return {
|
|
121
122
|
lastCompile: o,
|
|
122
|
-
history: ze(
|
|
123
|
-
nextId:
|
|
124
|
-
lastSnapshot:
|
|
123
|
+
history: ze(r.history, o, Ue),
|
|
124
|
+
nextId: r.nextId + 1,
|
|
125
|
+
lastSnapshot: n
|
|
125
126
|
};
|
|
126
127
|
})
|
|
127
128
|
})), Ve = () => {
|
|
@@ -136,15 +137,15 @@ var Le = class extends qe {
|
|
|
136
137
|
case "command":
|
|
137
138
|
return e.command.metadata.description;
|
|
138
139
|
}
|
|
139
|
-
}, ze = (e, t,
|
|
140
|
-
const
|
|
141
|
-
return [...e.slice(
|
|
140
|
+
}, ze = (e, t, n) => {
|
|
141
|
+
const r = e.length >= n ? e.length - (n - 1) : 0;
|
|
142
|
+
return [...e.slice(r), t];
|
|
142
143
|
};
|
|
143
|
-
function
|
|
144
|
-
const t = e.filter(
|
|
145
|
-
for (const
|
|
146
|
-
const u = Be(
|
|
147
|
-
u === null ||
|
|
144
|
+
function Je(e) {
|
|
145
|
+
const t = e.filter(oe), n = /* @__PURE__ */ new Set([...Object.keys(he), ...t.map((d) => d.geom)]), r = [], o = /* @__PURE__ */ new Set();
|
|
146
|
+
for (const d of e) {
|
|
147
|
+
const u = Be(d);
|
|
148
|
+
u === null || n.has(u.type) || o.has(u.type) || (o.add(u.type), r.push({
|
|
148
149
|
kind: "user-input",
|
|
149
150
|
severity: "error",
|
|
150
151
|
code: "MISSING_GEOM_RENDERER",
|
|
@@ -157,55 +158,55 @@ function Qe(e) {
|
|
|
157
158
|
}));
|
|
158
159
|
}
|
|
159
160
|
const a = /* @__PURE__ */ new Map();
|
|
160
|
-
for (const
|
|
161
|
-
if ("definition" in
|
|
162
|
-
const u = `${
|
|
161
|
+
for (const d of t) {
|
|
162
|
+
if ("definition" in d) continue;
|
|
163
|
+
const u = `${d.geom}|${d.coord}`, m = a.get(u);
|
|
163
164
|
m ? m.count += 1 : a.set(u, {
|
|
164
|
-
geom:
|
|
165
|
-
coord:
|
|
165
|
+
geom: d.geom,
|
|
166
|
+
coord: d.coord,
|
|
166
167
|
count: 1
|
|
167
168
|
});
|
|
168
169
|
}
|
|
169
170
|
const i = [];
|
|
170
|
-
for (const { geom:
|
|
171
|
+
for (const { geom: d, coord: u, count: m } of a.values())
|
|
171
172
|
m < 2 || i.push({
|
|
172
173
|
kind: "user-input",
|
|
173
174
|
severity: "warning",
|
|
174
175
|
code: "DUPLICATE_REGISTERED_TYPE",
|
|
175
|
-
message: `Multiple render-only overrides register ('${
|
|
176
|
+
message: `Multiple render-only overrides register ('${d}', '${u}') (${m} entries); the last in the array wins.`,
|
|
176
177
|
context: {
|
|
177
|
-
requested: `${
|
|
178
|
+
requested: `${d}@${u}`,
|
|
178
179
|
kind: "geom-renderer"
|
|
179
180
|
},
|
|
180
|
-
suggestion: `Keep a single render-only override for ('${
|
|
181
|
+
suggestion: `Keep a single render-only override for ('${d}', '${u}').`
|
|
181
182
|
});
|
|
182
183
|
return {
|
|
183
|
-
errors:
|
|
184
|
+
errors: r,
|
|
184
185
|
warnings: i
|
|
185
186
|
};
|
|
186
187
|
}
|
|
187
|
-
function
|
|
188
|
-
const { coordSystem:
|
|
189
|
-
for (const i of
|
|
190
|
-
t(i.geom,
|
|
188
|
+
function Qe(e, t) {
|
|
189
|
+
const { coordSystem: n, layers: r } = e, o = /* @__PURE__ */ new Set(), a = [];
|
|
190
|
+
for (const i of r)
|
|
191
|
+
t(i.geom, n.type) !== null || o.has(i.geom) || (o.add(i.geom), a.push({
|
|
191
192
|
kind: "user-input",
|
|
192
193
|
severity: "warning",
|
|
193
194
|
code: "MISSING_GEOM_RENDERER",
|
|
194
|
-
message: `No renderer for geom '${i.geom}' under ${
|
|
195
|
+
message: `No renderer for geom '${i.geom}' under ${n.type} coords; the layer is not painted.`,
|
|
195
196
|
context: {
|
|
196
197
|
requested: i.geom,
|
|
197
198
|
kind: "geom-renderer"
|
|
198
199
|
},
|
|
199
|
-
suggestion: `Register a renderer for ('${i.geom}', '${
|
|
200
|
+
suggestion: `Register a renderer for ('${i.geom}', '${n.type}') via \`defineGeomRenderer\`.`
|
|
200
201
|
}));
|
|
201
202
|
return a;
|
|
202
203
|
}
|
|
203
204
|
function Ze(e, t) {
|
|
204
|
-
const { coordSystem:
|
|
205
|
-
for (const i of
|
|
205
|
+
const { coordSystem: n, layers: r } = e, o = /* @__PURE__ */ new Set(), a = [];
|
|
206
|
+
for (const i of r) {
|
|
206
207
|
if (i.interactive === !1 || i.spatialKind !== "render-hit-test" || o.has(i.geom)) continue;
|
|
207
|
-
const
|
|
208
|
-
|
|
208
|
+
const d = t(i.geom, n.type);
|
|
209
|
+
d === null || d.hitTest || F(d) || (o.add(i.geom), a.push({
|
|
209
210
|
kind: "user-input",
|
|
210
211
|
severity: "warning",
|
|
211
212
|
code: "MISSING_RENDER_HIT_TEST",
|
|
@@ -214,35 +215,35 @@ function Ze(e, t) {
|
|
|
214
215
|
requested: i.geom,
|
|
215
216
|
kind: "geom-renderer"
|
|
216
217
|
},
|
|
217
|
-
suggestion: `Add a \`hitTest\` factory (precomputed geometry) or an overlay render (\`{ fn, options: { overlay: true } }\`, live simulation) to the renderer for ('${i.geom}', '${
|
|
218
|
+
suggestion: `Add a \`hitTest\` factory (precomputed geometry) or an overlay render (\`{ fn, options: { overlay: true } }\`, live simulation) to the renderer for ('${i.geom}', '${n.type}').`
|
|
218
219
|
}));
|
|
219
220
|
}
|
|
220
221
|
return a;
|
|
221
222
|
}
|
|
222
223
|
function et(e) {
|
|
223
|
-
const t = /* @__PURE__ */ new Set(),
|
|
224
|
-
for (const
|
|
225
|
-
const o =
|
|
226
|
-
|
|
224
|
+
const t = /* @__PURE__ */ new Set(), n = [];
|
|
225
|
+
for (const r of e.layers) {
|
|
226
|
+
const o = r.identityKey;
|
|
227
|
+
r.interactive !== !1 && (r.spatialKind !== "render-hit-test" || typeof o != "object" || t.has(r.geom) || r.data.hasVariable(o.variable) || (t.add(r.geom), n.push({
|
|
227
228
|
kind: "user-input",
|
|
228
229
|
severity: "warning",
|
|
229
230
|
code: "RENDER_HIT_TEST_IDENTITY",
|
|
230
|
-
message: `Geom '${
|
|
231
|
+
message: `Geom '${r.geom}' keys its identity on '${o.variable}', a column its compile output does not emit; its hover lookup is empty.`,
|
|
231
232
|
context: {
|
|
232
|
-
requested:
|
|
233
|
+
requested: r.geom,
|
|
233
234
|
kind: "geom-renderer"
|
|
234
235
|
},
|
|
235
236
|
suggestion: `Emit the '${o.variable}' column from the geom's \`compile()\`, or point \`identityKey\` at a column it does emit.`
|
|
236
237
|
})));
|
|
237
238
|
}
|
|
238
|
-
return
|
|
239
|
+
return n;
|
|
239
240
|
}
|
|
240
241
|
function tt(e, t) {
|
|
241
|
-
const { coordSystem:
|
|
242
|
-
for (const i of
|
|
242
|
+
const { coordSystem: n, layers: r } = e, o = /* @__PURE__ */ new Set(), a = [];
|
|
243
|
+
for (const i of r) {
|
|
243
244
|
if (i.interactive === !1 || i.spatialKind !== "render-hit-test" || o.has(i.geom)) continue;
|
|
244
|
-
const
|
|
245
|
-
|
|
245
|
+
const d = t(i.geom, n.type);
|
|
246
|
+
d === null || !d.hitTest || !F(d) || (o.add(i.geom), a.push({
|
|
246
247
|
kind: "user-input",
|
|
247
248
|
severity: "warning",
|
|
248
249
|
code: "CONFLICTING_RENDER_HIT_TEST",
|
|
@@ -257,9 +258,9 @@ function tt(e, t) {
|
|
|
257
258
|
return a;
|
|
258
259
|
}
|
|
259
260
|
function rt(e, t) {
|
|
260
|
-
const
|
|
261
|
+
const n = /* @__PURE__ */ new Set(), r = [];
|
|
261
262
|
for (const o of e.layers)
|
|
262
|
-
o.interactive !== !1 && (o.spatialKind !== "render-hit-test" ||
|
|
263
|
+
o.interactive !== !1 && (o.spatialKind !== "render-hit-test" || n.has(o.geom) || t.hasCapability(o.geom) || (n.add(o.geom), r.push({
|
|
263
264
|
kind: "user-input",
|
|
264
265
|
severity: "warning",
|
|
265
266
|
code: "MISSING_ANCHOR_CAPABILITY",
|
|
@@ -270,14 +271,14 @@ function rt(e, t) {
|
|
|
270
271
|
},
|
|
271
272
|
suggestion: "Implement `resolveAnchorPosition(observation, context)` on the geom, returning the normalised panel position an annotation on that observation belongs at."
|
|
272
273
|
})));
|
|
273
|
-
return
|
|
274
|
+
return r;
|
|
274
275
|
}
|
|
275
276
|
function nt(e, t) {
|
|
276
|
-
const { coordSystem:
|
|
277
|
-
for (const i of
|
|
277
|
+
const { coordSystem: n, layers: r } = e, o = /* @__PURE__ */ new Set(), a = [];
|
|
278
|
+
for (const i of r) {
|
|
278
279
|
if (i.interactive === !1 || i.spatialKind === "render-hit-test" || o.has(i.geom)) continue;
|
|
279
|
-
const
|
|
280
|
-
|
|
280
|
+
const d = t(i.geom, n.type);
|
|
281
|
+
d === null || !F(d) || (o.add(i.geom), a.push({
|
|
281
282
|
kind: "user-input",
|
|
282
283
|
severity: "warning",
|
|
283
284
|
code: "OVERLAY_REQUIRES_RENDER_HIT_TEST",
|
|
@@ -291,17 +292,17 @@ function nt(e, t) {
|
|
|
291
292
|
}
|
|
292
293
|
return a;
|
|
293
294
|
}
|
|
294
|
-
var st = (e) =>
|
|
295
|
+
var st = (e) => U((t) => ({
|
|
295
296
|
scene: e,
|
|
296
|
-
setScene: (
|
|
297
|
-
})), ot = ({ spec: e, data: t, customPalettes:
|
|
298
|
-
const N =
|
|
297
|
+
setScene: (n) => t((r) => r.scene === n ? r : { scene: n })
|
|
298
|
+
})), ot = ({ spec: e, data: t, customPalettes: n, colorScheme: r, plugins: o, resolveRenderer: a, anchorResolver: i, onSpecChange: d, onError: u, onWarnings: m }) => {
|
|
299
|
+
const N = A(d), k = A(u), C = A(m), [{ session: h, compileBus: l }] = T(() => {
|
|
299
300
|
const s = Se({ plugins: o });
|
|
300
301
|
return {
|
|
301
302
|
session: new fe(s),
|
|
302
303
|
compileBus: Ye(s)
|
|
303
304
|
};
|
|
304
|
-
}), [p] = T(() =>
|
|
305
|
+
}), [p] = T(() => Je(o ?? [])), y = J(null), [I] = T(it), R = J(null), S = f((s) => p.errors.length === 0 ? s : [...p.errors, ...s ?? []], [p]), w = f((s) => {
|
|
305
306
|
if (!s.ok) return s.errors;
|
|
306
307
|
if (R.current) R.current.getState().setScene(s.scene);
|
|
307
308
|
else {
|
|
@@ -309,102 +310,102 @@ var st = (e) => F((t) => ({
|
|
|
309
310
|
g.subscribe(I.notify), R.current = g, I.notify();
|
|
310
311
|
}
|
|
311
312
|
return null;
|
|
312
|
-
}, [I]), [
|
|
313
|
+
}, [I]), [M, D] = T(() => {
|
|
313
314
|
const s = h.compile({
|
|
314
315
|
spec: e,
|
|
315
316
|
data: t,
|
|
316
|
-
customPalettes:
|
|
317
|
-
colorScheme:
|
|
317
|
+
customPalettes: n,
|
|
318
|
+
colorScheme: r
|
|
318
319
|
});
|
|
319
|
-
return y.current = s, S(
|
|
320
|
+
return y.current = s, S(w(s));
|
|
320
321
|
}), G = f((s) => s.ok ? [
|
|
321
322
|
...s.warnings,
|
|
322
|
-
...
|
|
323
|
+
...Qe(s.scene, a),
|
|
323
324
|
...Ze(s.scene, a),
|
|
324
325
|
...et(s.scene),
|
|
325
326
|
...tt(s.scene, a),
|
|
326
327
|
...nt(s.scene, a),
|
|
327
328
|
...rt(s.scene, i)
|
|
328
329
|
] : s.warnings, [a, i]), b = f((s) => {
|
|
329
|
-
s.length !== 0 && (
|
|
330
|
-
}, [k]),
|
|
331
|
-
s.length !== 0 && (
|
|
332
|
-
}, [
|
|
333
|
-
|
|
330
|
+
s.length !== 0 && (K(s), k.current?.(s));
|
|
331
|
+
}, [k]), q = f((s) => {
|
|
332
|
+
s.length !== 0 && (K(s), C.current?.(s));
|
|
333
|
+
}, [C]);
|
|
334
|
+
x(() => {
|
|
334
335
|
const s = y.current;
|
|
335
|
-
s && (b([...p.errors, ...s.ok ? [] : s.errors]),
|
|
336
|
+
s && (b([...p.errors, ...s.ok ? [] : s.errors]), q([...p.warnings, ...G(s)]), s.ok && l.emit({ kind: "init" }));
|
|
336
337
|
}, [
|
|
337
338
|
l,
|
|
338
339
|
b,
|
|
339
|
-
|
|
340
|
+
q,
|
|
340
341
|
p,
|
|
341
342
|
G
|
|
342
|
-
]),
|
|
343
|
+
]), x(() => {
|
|
343
344
|
const s = h.update({
|
|
344
345
|
spec: e,
|
|
345
346
|
data: t,
|
|
346
|
-
customPalettes:
|
|
347
|
-
colorScheme:
|
|
347
|
+
customPalettes: n,
|
|
348
|
+
colorScheme: r
|
|
348
349
|
});
|
|
349
350
|
if (!s) return;
|
|
350
351
|
s.committedSpec && N.current?.(s.committedSpec);
|
|
351
|
-
const g =
|
|
352
|
-
D(S(g)), g && b(g),
|
|
352
|
+
const g = w(s.result);
|
|
353
|
+
D(S(g)), g && b(g), q(G(s.result)), g || l.emit({ kind: s.specChanged ? "spec" : "data" });
|
|
353
354
|
}, [
|
|
354
355
|
e,
|
|
355
356
|
t,
|
|
356
|
-
r,
|
|
357
357
|
n,
|
|
358
|
+
r,
|
|
358
359
|
h,
|
|
359
360
|
l,
|
|
360
|
-
|
|
361
|
+
w,
|
|
361
362
|
b,
|
|
362
|
-
|
|
363
|
+
q,
|
|
363
364
|
S,
|
|
364
365
|
G,
|
|
365
366
|
N
|
|
366
367
|
]);
|
|
367
|
-
const
|
|
368
|
-
D((g) => g === null ? g : S(null)),
|
|
368
|
+
const _ = f((s) => {
|
|
369
|
+
D((g) => g === null ? g : S(null)), q(G(s));
|
|
369
370
|
}, [
|
|
370
371
|
S,
|
|
371
|
-
|
|
372
|
+
q,
|
|
372
373
|
G
|
|
373
|
-
]),
|
|
374
|
-
s.scene && R.current?.getState().setScene(s.scene), s.result &&
|
|
374
|
+
]), P = f((s) => {
|
|
375
|
+
s.scene && R.current?.getState().setScene(s.scene), s.result && _(s.result), s.command && l.emit({
|
|
375
376
|
kind: "command",
|
|
376
377
|
command: s.command
|
|
377
378
|
}), s.spec && N.current?.(s.spec), s.errors && b([...s.errors]);
|
|
378
379
|
}, [
|
|
379
|
-
|
|
380
|
+
_,
|
|
380
381
|
l,
|
|
381
382
|
N,
|
|
382
383
|
b
|
|
383
384
|
]), E = f((s) => {
|
|
384
|
-
for (const g of s)
|
|
385
|
+
for (const g of s) P(g);
|
|
385
386
|
return s.some((g) => !!g.scene);
|
|
386
|
-
}, [
|
|
387
|
+
}, [P]), O = f((s, g) => {
|
|
387
388
|
E(h.applyCommand(s, g));
|
|
388
389
|
}, [h, E]), ae = f(() => {
|
|
389
390
|
E(h.commit());
|
|
390
|
-
}, [h, E]),
|
|
391
|
+
}, [h, E]), W = f(() => E(h.undo()), [h, E]), V = f(() => E(h.redo()), [h, E]), ce = H(() => ({
|
|
391
392
|
stack: h.history,
|
|
392
|
-
undo:
|
|
393
|
-
redo:
|
|
393
|
+
undo: W,
|
|
394
|
+
redo: V
|
|
394
395
|
}), [
|
|
395
396
|
h,
|
|
396
|
-
|
|
397
|
-
|
|
397
|
+
W,
|
|
398
|
+
V
|
|
398
399
|
]), de = f(() => R.current?.getState().scene ?? null, []);
|
|
399
400
|
return {
|
|
400
401
|
store: R.current,
|
|
401
|
-
dispatch:
|
|
402
|
+
dispatch: O,
|
|
402
403
|
commit: ae,
|
|
403
404
|
history: ce,
|
|
404
405
|
subscribe: I.subscribe,
|
|
405
406
|
getScene: de,
|
|
406
407
|
compileBus: l,
|
|
407
|
-
compileErrors:
|
|
408
|
+
compileErrors: M
|
|
408
409
|
};
|
|
409
410
|
}, it = () => {
|
|
410
411
|
const e = /* @__PURE__ */ new Set();
|
|
@@ -414,28 +415,28 @@ var st = (e) => F((t) => ({
|
|
|
414
415
|
}),
|
|
415
416
|
notify: () => e.forEach((t) => t())
|
|
416
417
|
};
|
|
417
|
-
}, at = ({ data: e, spec: t, plugins:
|
|
418
|
-
const [k] = T(() =>
|
|
418
|
+
}, at = ({ data: e, spec: t, plugins: n = [], formattingLocale: r, handleRef: o, onSpecChange: a, onError: i, onWarnings: d, customPalettes: u, colorScheme: m = "light", children: N }) => {
|
|
419
|
+
const [k] = T(() => le(n.filter(oe))), C = Ge(), [h] = T(() => ye(n)), [l] = T(() => Ke()), p = H(() => Ee({ colorScheme: m }), [m]), { store: y, dispatch: I, commit: R, history: S, subscribe: w, getScene: M, compileBus: D, compileErrors: G } = ot({
|
|
419
420
|
spec: t,
|
|
420
421
|
data: e,
|
|
421
422
|
customPalettes: u,
|
|
422
423
|
colorScheme: m,
|
|
423
|
-
plugins:
|
|
424
|
+
plugins: n,
|
|
424
425
|
resolveRenderer: k,
|
|
425
426
|
anchorResolver: h,
|
|
426
427
|
onSpecChange: a,
|
|
427
428
|
onError: i,
|
|
428
|
-
onWarnings:
|
|
429
|
+
onWarnings: d
|
|
429
430
|
});
|
|
430
|
-
|
|
431
|
+
x(() => {
|
|
431
432
|
if (y)
|
|
432
|
-
return y.subscribe((
|
|
433
|
-
if (
|
|
434
|
-
const { selection: E, setSelection:
|
|
435
|
-
E.length !== 0 &&
|
|
433
|
+
return y.subscribe((_, P) => {
|
|
434
|
+
if (_.scene.spec === P.scene.spec) return;
|
|
435
|
+
const { selection: E, setSelection: O } = l.getState();
|
|
436
|
+
E.length !== 0 && O(Oe(E, _.scene.spec));
|
|
436
437
|
});
|
|
437
438
|
}, [y, l]);
|
|
438
|
-
const b =
|
|
439
|
+
const b = H(() => ({
|
|
439
440
|
dispatch: I,
|
|
440
441
|
commit: R
|
|
441
442
|
}), [I, R]);
|
|
@@ -443,65 +444,65 @@ var st = (e) => F((t) => ({
|
|
|
443
444
|
commands: b,
|
|
444
445
|
undo: S.undo,
|
|
445
446
|
redo: S.redo,
|
|
446
|
-
subscribe:
|
|
447
|
-
getScene:
|
|
447
|
+
subscribe: w,
|
|
448
|
+
getScene: M,
|
|
448
449
|
getSelection: () => l.getState().selection,
|
|
449
|
-
setSelection: (
|
|
450
|
+
setSelection: (_) => l.getState().setSelection(_),
|
|
450
451
|
subscribeSelection: l.subscribe
|
|
451
452
|
}), [
|
|
452
453
|
b,
|
|
453
454
|
S,
|
|
454
|
-
|
|
455
|
-
|
|
455
|
+
w,
|
|
456
|
+
M,
|
|
456
457
|
l
|
|
457
458
|
]);
|
|
458
|
-
const
|
|
459
|
-
chartId:
|
|
459
|
+
const q = H(() => y ? {
|
|
460
|
+
chartId: C,
|
|
460
461
|
store: y,
|
|
461
462
|
selectionStore: l,
|
|
462
463
|
commands: b,
|
|
463
464
|
history: S,
|
|
464
|
-
formattingLocale:
|
|
465
|
+
formattingLocale: r,
|
|
465
466
|
compileBus: D,
|
|
466
467
|
colorScheme: m,
|
|
467
468
|
styleResolver: p,
|
|
468
469
|
anchorResolver: h
|
|
469
470
|
} : null, [
|
|
470
|
-
|
|
471
|
+
C,
|
|
471
472
|
y,
|
|
472
473
|
l,
|
|
473
474
|
b,
|
|
474
475
|
S,
|
|
475
|
-
|
|
476
|
+
r,
|
|
476
477
|
D,
|
|
477
478
|
m,
|
|
478
479
|
p,
|
|
479
480
|
h
|
|
480
481
|
]);
|
|
481
|
-
return /* @__PURE__ */
|
|
482
|
+
return /* @__PURE__ */ c(Le, {
|
|
482
483
|
forcedErrors: G,
|
|
483
484
|
onError: i,
|
|
484
485
|
resetKeys: [t, e],
|
|
485
|
-
children:
|
|
486
|
-
value:
|
|
487
|
-
children: /* @__PURE__ */
|
|
486
|
+
children: q ? /* @__PURE__ */ c(ue.Provider, {
|
|
487
|
+
value: q,
|
|
488
|
+
children: /* @__PURE__ */ c(me, {
|
|
488
489
|
value: k,
|
|
489
490
|
children: N
|
|
490
491
|
})
|
|
491
492
|
}) : null
|
|
492
493
|
});
|
|
493
494
|
};
|
|
494
|
-
function
|
|
495
|
+
function br(e) {
|
|
495
496
|
const t = be(e);
|
|
496
497
|
return {
|
|
497
498
|
...t,
|
|
498
|
-
GraphProvider: (
|
|
499
|
-
...
|
|
499
|
+
GraphProvider: (r) => /* @__PURE__ */ c(at, {
|
|
500
|
+
...r,
|
|
500
501
|
plugins: t.plugins
|
|
501
502
|
})
|
|
502
503
|
};
|
|
503
504
|
}
|
|
504
|
-
var
|
|
505
|
+
var Er = ({ children: e, ...t }) => /* @__PURE__ */ c("svg", {
|
|
505
506
|
viewBox: "0 0 1 1",
|
|
506
507
|
preserveAspectRatio: "none",
|
|
507
508
|
width: "100%",
|
|
@@ -509,40 +510,40 @@ var Sr = ({ children: e, ...t }) => /* @__PURE__ */ d("svg", {
|
|
|
509
510
|
pointerEvents: "none",
|
|
510
511
|
...t,
|
|
511
512
|
children: e
|
|
512
|
-
}),
|
|
513
|
-
x:
|
|
514
|
-
y:
|
|
515
|
-
width:
|
|
516
|
-
height:
|
|
513
|
+
}), Tr = ({ box: e, children: t }) => /* @__PURE__ */ c("svg", {
|
|
514
|
+
x: L(e.x0),
|
|
515
|
+
y: L(e.y0),
|
|
516
|
+
width: L(e.x1 - e.x0),
|
|
517
|
+
height: L(e.y1 - e.y0),
|
|
517
518
|
overflow: "hidden",
|
|
518
519
|
pointerEvents: "none",
|
|
519
520
|
children: t
|
|
520
|
-
}), ct = "drqe3u0", dt = "drqe3u1", lt = "drqe3u2", ut = "drqe3u3",
|
|
521
|
+
}), ct = "drqe3u0", dt = "drqe3u1", lt = "drqe3u2", ut = "drqe3u3", $ = "drqe3u4", mt = "drqe3u5", ht = "drqe3u6", gt = "drqe3u7", B = "drqe3u8", pt = "drqe3u9", ft = "drqe3ua";
|
|
521
522
|
var vt = "drqe3uc", yt = "drqe3ud", St = "drqe3ue", bt = "drqe3uf";
|
|
522
|
-
var Et = "drqe3uh", Tt = "drqe3ui",
|
|
523
|
+
var Et = "drqe3uh", Tt = "drqe3ui", re = {
|
|
523
524
|
enabled: "drqe3uk drqe3uj",
|
|
524
525
|
disabled: "drqe3ul drqe3uj"
|
|
525
|
-
},
|
|
526
|
+
}, ne = {
|
|
526
527
|
ran: "drqe3un drqe3um",
|
|
527
528
|
dim: "drqe3uo drqe3um"
|
|
528
|
-
},
|
|
529
|
+
}, ie = {
|
|
529
530
|
ran: "drqe3uq drqe3up",
|
|
530
531
|
cached: "drqe3ur drqe3up",
|
|
531
532
|
untouched: "drqe3us drqe3up"
|
|
532
|
-
},
|
|
533
|
-
const { compileBus:
|
|
534
|
-
|
|
535
|
-
const { recordCompile: l } = o.getState(), p =
|
|
536
|
-
return p && y && l(p, y),
|
|
537
|
-
}, [o,
|
|
538
|
-
const m = Q(o, (l) => l.lastCompile), N = Q(o, (l) => l.history), k =
|
|
533
|
+
}, Nr = ({ width: e = 440, style: t, className: n } = {}) => {
|
|
534
|
+
const { compileBus: r } = se(), [o] = T(() => We()), [a, i] = T(!1), [d, u] = T(Ne);
|
|
535
|
+
x(() => {
|
|
536
|
+
const { recordCompile: l } = o.getState(), p = r.getLastTrigger(), y = r.getLastCompile();
|
|
537
|
+
return p && y && l(p, y), r.subscribe(l);
|
|
538
|
+
}, [o, r]);
|
|
539
|
+
const m = Q(o, (l) => l.lastCompile), N = Q(o, (l) => l.history), k = r.getCacheStats(), C = m === null && N.length === 0, h = () => {
|
|
539
540
|
u((l) => {
|
|
540
541
|
const p = !l;
|
|
541
|
-
return
|
|
542
|
+
return qe(p), p;
|
|
542
543
|
});
|
|
543
544
|
};
|
|
544
545
|
return /* @__PURE__ */ v("div", {
|
|
545
|
-
className:
|
|
546
|
+
className: we(ft, n),
|
|
546
547
|
style: {
|
|
547
548
|
width: e,
|
|
548
549
|
...t
|
|
@@ -550,13 +551,13 @@ var Et = "drqe3uh", Tt = "drqe3ui", te = {
|
|
|
550
551
|
children: [
|
|
551
552
|
/* @__PURE__ */ v("div", {
|
|
552
553
|
className: ct,
|
|
553
|
-
children: [/* @__PURE__ */ v("div", { children: [/* @__PURE__ */
|
|
554
|
+
children: [/* @__PURE__ */ v("div", { children: [/* @__PURE__ */ c("div", {
|
|
554
555
|
className: dt,
|
|
555
556
|
children: "compile cache"
|
|
556
|
-
}), /* @__PURE__ */
|
|
557
|
+
}), /* @__PURE__ */ c("div", {
|
|
557
558
|
className: St,
|
|
558
|
-
children:
|
|
559
|
-
})] }), /* @__PURE__ */
|
|
559
|
+
children: C ? "production: stats disabled" : m ? `last: ${m.label} · ${Y(m.durationMs)}` : "awaiting first compile…"
|
|
560
|
+
})] }), /* @__PURE__ */ c("button", {
|
|
560
561
|
type: "button",
|
|
561
562
|
onClick: () => i((l) => !l),
|
|
562
563
|
className: bt,
|
|
@@ -568,96 +569,105 @@ var Et = "drqe3uh", Tt = "drqe3ui", te = {
|
|
|
568
569
|
children: [/* @__PURE__ */ v("button", {
|
|
569
570
|
type: "button",
|
|
570
571
|
onClick: h,
|
|
571
|
-
className:
|
|
572
|
-
"aria-pressed":
|
|
573
|
-
children: ["cache ",
|
|
574
|
-
}), /* @__PURE__ */
|
|
572
|
+
className: d ? re.enabled : re.disabled,
|
|
573
|
+
"aria-pressed": d,
|
|
574
|
+
children: ["cache ", d ? "enabled" : "disabled"]
|
|
575
|
+
}), /* @__PURE__ */ c("span", {
|
|
575
576
|
className: "drqe3ug",
|
|
576
577
|
children: "next compile reflects this toggle"
|
|
577
578
|
})]
|
|
578
579
|
}),
|
|
579
|
-
!a && !
|
|
580
|
+
!a && !C && /* @__PURE__ */ v(_e, { children: [/* @__PURE__ */ c(Nt, {
|
|
580
581
|
delta: m?.stages,
|
|
582
|
+
durations: m?.stageDurationsMs,
|
|
581
583
|
cumulative: k
|
|
582
|
-
}), /* @__PURE__ */
|
|
584
|
+
}), /* @__PURE__ */ c(Rt, { entries: N })] })
|
|
583
585
|
]
|
|
584
586
|
});
|
|
585
|
-
}, Nt = ({ delta: e,
|
|
587
|
+
}, Nt = ({ delta: e, durations: t, cumulative: n }) => /* @__PURE__ */ v("table", {
|
|
586
588
|
className: lt,
|
|
587
|
-
children: [/* @__PURE__ */
|
|
589
|
+
children: [/* @__PURE__ */ c("thead", { children: /* @__PURE__ */ v("tr", {
|
|
588
590
|
className: Et,
|
|
589
591
|
children: [
|
|
590
|
-
/* @__PURE__ */
|
|
592
|
+
/* @__PURE__ */ c("th", {
|
|
591
593
|
className: ut,
|
|
592
594
|
children: "stage"
|
|
593
595
|
}),
|
|
594
|
-
/* @__PURE__ */
|
|
595
|
-
className:
|
|
596
|
+
/* @__PURE__ */ c("th", {
|
|
597
|
+
className: $,
|
|
598
|
+
children: "time"
|
|
599
|
+
}),
|
|
600
|
+
/* @__PURE__ */ c("th", {
|
|
601
|
+
className: $,
|
|
596
602
|
children: "Δ miss"
|
|
597
603
|
}),
|
|
598
|
-
/* @__PURE__ */
|
|
599
|
-
className:
|
|
604
|
+
/* @__PURE__ */ c("th", {
|
|
605
|
+
className: $,
|
|
600
606
|
children: "Δ hit"
|
|
601
607
|
}),
|
|
602
|
-
/* @__PURE__ */
|
|
603
|
-
className:
|
|
608
|
+
/* @__PURE__ */ c("th", {
|
|
609
|
+
className: $,
|
|
604
610
|
children: "total miss"
|
|
605
611
|
}),
|
|
606
|
-
/* @__PURE__ */
|
|
607
|
-
className:
|
|
612
|
+
/* @__PURE__ */ c("th", {
|
|
613
|
+
className: $,
|
|
608
614
|
children: "total hit"
|
|
609
615
|
})
|
|
610
616
|
]
|
|
611
|
-
}) }), /* @__PURE__ */
|
|
612
|
-
const
|
|
617
|
+
}) }), /* @__PURE__ */ c("tbody", { children: j.map((r) => {
|
|
618
|
+
const o = e?.[r], a = qt(o);
|
|
613
619
|
return /* @__PURE__ */ v("tr", {
|
|
614
620
|
className: vt,
|
|
615
621
|
children: [
|
|
616
622
|
/* @__PURE__ */ v("td", {
|
|
617
623
|
className: mt,
|
|
618
624
|
children: [
|
|
619
|
-
/* @__PURE__ */
|
|
620
|
-
className:
|
|
625
|
+
/* @__PURE__ */ c("span", {
|
|
626
|
+
className: ie[a],
|
|
621
627
|
"aria-hidden": !0
|
|
622
628
|
}),
|
|
623
629
|
" ",
|
|
624
630
|
r
|
|
625
631
|
]
|
|
626
632
|
}),
|
|
627
|
-
/* @__PURE__ */
|
|
628
|
-
className:
|
|
629
|
-
children:
|
|
633
|
+
/* @__PURE__ */ c("td", {
|
|
634
|
+
className: B,
|
|
635
|
+
children: t === void 0 || a === "untouched" ? "—" : Y(t[r])
|
|
636
|
+
}),
|
|
637
|
+
/* @__PURE__ */ c("td", {
|
|
638
|
+
className: a === "ran" ? ne.ran : ne.dim,
|
|
639
|
+
children: o?.misses ?? 0
|
|
630
640
|
}),
|
|
631
|
-
/* @__PURE__ */
|
|
632
|
-
className:
|
|
633
|
-
children:
|
|
641
|
+
/* @__PURE__ */ c("td", {
|
|
642
|
+
className: B,
|
|
643
|
+
children: o?.hits ?? 0
|
|
634
644
|
}),
|
|
635
|
-
/* @__PURE__ */
|
|
636
|
-
className:
|
|
637
|
-
children:
|
|
645
|
+
/* @__PURE__ */ c("td", {
|
|
646
|
+
className: B,
|
|
647
|
+
children: n[r].misses
|
|
638
648
|
}),
|
|
639
|
-
/* @__PURE__ */
|
|
640
|
-
className:
|
|
641
|
-
children:
|
|
649
|
+
/* @__PURE__ */ c("td", {
|
|
650
|
+
className: B,
|
|
651
|
+
children: n[r].hits
|
|
642
652
|
})
|
|
643
653
|
]
|
|
644
654
|
}, r);
|
|
645
655
|
}) })]
|
|
646
656
|
}), Rt = ({ entries: e }) => e.length === 0 ? null : /* @__PURE__ */ v("div", {
|
|
647
657
|
className: yt,
|
|
648
|
-
children: [/* @__PURE__ */
|
|
658
|
+
children: [/* @__PURE__ */ c("div", {
|
|
649
659
|
className: Tt,
|
|
650
660
|
children: "recent compiles"
|
|
651
661
|
}), e.map((t) => {
|
|
652
|
-
const
|
|
662
|
+
const n = Ct(t.stages, (a) => a.misses > 0), r = j.length;
|
|
653
663
|
return /* @__PURE__ */ v("div", {
|
|
654
664
|
className: ht,
|
|
655
665
|
children: [
|
|
656
|
-
/* @__PURE__ */
|
|
657
|
-
className:
|
|
666
|
+
/* @__PURE__ */ c("span", {
|
|
667
|
+
className: ie[n === 0 ? "cached" : "ran"],
|
|
658
668
|
"aria-hidden": !0
|
|
659
669
|
}),
|
|
660
|
-
/* @__PURE__ */
|
|
670
|
+
/* @__PURE__ */ c("span", {
|
|
661
671
|
className: gt,
|
|
662
672
|
title: t.label,
|
|
663
673
|
children: t.label
|
|
@@ -665,30 +675,30 @@ var Et = "drqe3uh", Tt = "drqe3ui", te = {
|
|
|
665
675
|
/* @__PURE__ */ v("span", {
|
|
666
676
|
className: pt,
|
|
667
677
|
children: [
|
|
668
|
-
r,
|
|
669
|
-
"/",
|
|
670
678
|
n,
|
|
679
|
+
"/",
|
|
680
|
+
r,
|
|
671
681
|
" ran · ",
|
|
672
|
-
|
|
682
|
+
Y(t.durationMs)
|
|
673
683
|
]
|
|
674
684
|
})
|
|
675
685
|
]
|
|
676
686
|
}, t.id);
|
|
677
687
|
})]
|
|
678
|
-
}),
|
|
679
|
-
let
|
|
680
|
-
for (const
|
|
681
|
-
return
|
|
682
|
-
},
|
|
683
|
-
const { history: e } =
|
|
684
|
-
return
|
|
688
|
+
}), qt = (e) => !e || e.hits === 0 && e.misses === 0 ? "untouched" : e.misses > 0 ? "ran" : "cached", Ct = (e, t) => {
|
|
689
|
+
let n = 0;
|
|
690
|
+
for (const r of j) t(e[r]) && (n += 1);
|
|
691
|
+
return n;
|
|
692
|
+
}, Y = (e) => e < 0.1 ? "<0.1ms" : e >= 10 ? `${e.toFixed(0)}ms` : `${e.toFixed(2)}ms`, Rr = () => {
|
|
693
|
+
const { history: e } = se(), { stack: t, undo: n, redo: r } = e, o = f((d) => t.subscribe(d), [t]), a = f(() => t.getSnapshot(), [t]), i = Ie(o, a, a);
|
|
694
|
+
return H(() => ({
|
|
685
695
|
...i,
|
|
686
|
-
undo:
|
|
687
|
-
redo:
|
|
696
|
+
undo: n,
|
|
697
|
+
redo: r
|
|
688
698
|
}), [
|
|
689
699
|
i,
|
|
690
|
-
|
|
691
|
-
|
|
700
|
+
n,
|
|
701
|
+
r
|
|
692
702
|
]);
|
|
693
703
|
}, Gt = /* @__PURE__ */ new Set([
|
|
694
704
|
"button",
|
|
@@ -701,67 +711,69 @@ var Et = "drqe3uh", Tt = "drqe3ui", te = {
|
|
|
701
711
|
"range",
|
|
702
712
|
"reset",
|
|
703
713
|
"submit"
|
|
704
|
-
]),
|
|
705
|
-
const { target:
|
|
706
|
-
|
|
707
|
-
const o = kt(
|
|
708
|
-
if (!
|
|
714
|
+
]), qr = (e, t = {}) => {
|
|
715
|
+
const { target: n, enabled: r = !0 } = t;
|
|
716
|
+
x(() => {
|
|
717
|
+
const o = kt(n);
|
|
718
|
+
if (!r || !o) return;
|
|
709
719
|
const a = (i) => {
|
|
710
|
-
if (!It(i) || i.defaultPrevented ||
|
|
711
|
-
const
|
|
712
|
-
if (!
|
|
720
|
+
if (!It(i) || i.defaultPrevented || _t(i.target)) return;
|
|
721
|
+
const d = ge(i);
|
|
722
|
+
if (!d) return;
|
|
713
723
|
const u = e.current;
|
|
714
|
-
u && (
|
|
724
|
+
u && (d === "undo" ? u.undo() : u.redo()) && i.preventDefault();
|
|
715
725
|
};
|
|
716
726
|
return o.addEventListener("keydown", a), () => o.removeEventListener("keydown", a);
|
|
717
727
|
}, [
|
|
718
728
|
e,
|
|
719
|
-
|
|
720
|
-
|
|
729
|
+
n,
|
|
730
|
+
r
|
|
721
731
|
]);
|
|
722
|
-
}, kt = (e) => e === void 0 ? window : e !== null && "current" in e ? e.current : e, It = (e) => "key" in e,
|
|
732
|
+
}, kt = (e) => e === void 0 ? window : e !== null && "current" in e ? e.current : e, It = (e) => "key" in e, _t = (e) => e instanceof HTMLInputElement ? !Gt.has(e.type) : e instanceof HTMLElement ? e.isContentEditable || e.tagName === "TEXTAREA" : !1;
|
|
723
733
|
export {
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
734
|
+
Yt as BrandMark,
|
|
735
|
+
At as CanvasTextMeasurer,
|
|
736
|
+
Ot as DefaultFooter,
|
|
737
|
+
cr as DefaultGrid,
|
|
738
|
+
Mt as DefaultHeader,
|
|
739
|
+
jt as DefaultSwatch,
|
|
740
|
+
sr as DefaultTooltip,
|
|
741
|
+
Nr as DevToolsPanel,
|
|
742
|
+
er as GRAPH_MODES,
|
|
733
743
|
Le as GraphErrorBoundary,
|
|
734
|
-
|
|
744
|
+
Z as GraphErrorPanel,
|
|
735
745
|
at as GraphProvider,
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
Lt as
|
|
766
|
-
|
|
746
|
+
Jt as GraphRenderer,
|
|
747
|
+
$t as HoverProvider,
|
|
748
|
+
Ut as TextMeasurerProvider,
|
|
749
|
+
Qt as ThemeProvider,
|
|
750
|
+
Tr as UnitBoxSvg,
|
|
751
|
+
Er as UnitSpaceSvg,
|
|
752
|
+
br as createGraphyKit,
|
|
753
|
+
dr as darkTheme,
|
|
754
|
+
Ht as defineGeomRenderer,
|
|
755
|
+
Zt as lightTheme,
|
|
756
|
+
Bt as lightenCss,
|
|
757
|
+
Oe as pruneSelection,
|
|
758
|
+
ur as resolveBrandMarkVisual,
|
|
759
|
+
Dt as stampAxisEditTarget,
|
|
760
|
+
rr as stampGridEditTarget,
|
|
761
|
+
Ft as stampLegendEditTarget,
|
|
762
|
+
lr as useElementScreenRect,
|
|
763
|
+
Wt as useGeomHitTest,
|
|
764
|
+
zt as useGeomHover,
|
|
765
|
+
nr as useGraphCommands,
|
|
766
|
+
tr as useGraphHandle,
|
|
767
|
+
Rr as useGraphHistory,
|
|
768
|
+
qr as useGraphHistoryShortcuts,
|
|
769
|
+
Xt as useGraphSelection,
|
|
770
|
+
xt as useGuidesTakePress,
|
|
771
|
+
ir as useHandleScene,
|
|
772
|
+
ar as useHoverState,
|
|
773
|
+
or as useSceneSelector,
|
|
774
|
+
Vt as useStyleReaderTree,
|
|
775
|
+
Lt as useStyleReaders,
|
|
776
|
+
Kt as useStyleResolver,
|
|
777
|
+
Pt as useTextMeasurer,
|
|
778
|
+
hr as vars
|
|
767
779
|
};
|