@graphysdk/react-renderer 1.9.0-beta.1788895348418 → 1.9.0-beta.1789025801428
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.mjs +1 -1
- package/dist/history-chords-BRb9sBcM.cjs +1 -0
- package/dist/{history-chords-DhcO3NfJ.js → history-chords-BtNvrHbM.js} +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +208 -208
- package/package.json +2 -2
- package/dist/history-chords-Bnv8UZck.cjs +0 -1
package/dist/index.mjs
CHANGED
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
import { Ct as
|
|
2
|
-
import { d as
|
|
3
|
-
import { COMPILER_STAGE_KEYS as F, Geom as
|
|
4
|
-
import { Component as
|
|
5
|
-
import { Fragment as
|
|
6
|
-
import { useStore as
|
|
1
|
+
import { Ct as Dt, Ft as le, It as ne, Lt as A, M as $t, Mt as xt, Nt as Ht, O as Mt, Pt as Lt, St as ue, Tt as Pt, X as Bt, Y as Kt, _ as Ot, _t as me, a as At, bt as he, ct as jt, gt as K, i as Ft, it as Ut, j as Yt, jt as Wt, k as Vt, lt as Xt, mt as Qt, n as zt, pt as Jt, r as Zt, rt as er, s as tr, t as ge, tt as rr, vt as nr, wt as sr, xt as or, yt as j } from "./history-chords-BtNvrHbM.js";
|
|
2
|
+
import { d as ar, t as pe } from "./dev.utils-DT-z_GBs.js";
|
|
3
|
+
import { COMPILER_STAGE_KEYS as F, Geom as fe, GraphCompilationSession as ve, areEditTargetsEqual as ye, buildDiagnostic as V, createAnchorResolver as be, createCompiler as Se, createGraphyBuilder as Ee, createStyleResolver as Ce, findAnnotation as Te, findLayerById as X, isCompilerCachingEnabled as Ne, resolveDefinition as Re, setCompilerCachingEnabled as qe, toPercent as L } from "@graphysdk/viz-engine";
|
|
4
|
+
import { Component as Ie, useCallback as f, useEffect as x, useId as ke, useImperativeHandle as Ge, useMemo as $, useRef as Q, useState as C, useSyncExternalStore as we } from "react";
|
|
5
|
+
import { Fragment as _e, jsx as d, jsxs as v } from "react/jsx-runtime";
|
|
6
|
+
import { useStore as z } from "zustand";
|
|
7
7
|
import { createStore as U } from "zustand/vanilla";
|
|
8
|
-
import
|
|
9
|
-
import './index.css';var
|
|
10
|
-
var
|
|
11
|
-
var
|
|
8
|
+
import De from "clsx";
|
|
9
|
+
import './index.css';var $e = "_1a5iqpb0", xe = "_1a5iqpb1";
|
|
10
|
+
var He = "_1a5iqpb3", Me = "_1a5iqpb4", Le = "_1a5iqpb5";
|
|
11
|
+
var J = ({ 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
|
-
className:
|
|
18
|
+
className: xe,
|
|
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
|
-
},
|
|
29
|
-
className:
|
|
28
|
+
}, Z = ({ diagnostic: e }) => /* @__PURE__ */ v("div", {
|
|
29
|
+
className: He,
|
|
30
30
|
children: [
|
|
31
31
|
/* @__PURE__ */ d("span", {
|
|
32
|
-
className:
|
|
32
|
+
className: Me,
|
|
33
33
|
children: e.code
|
|
34
34
|
}),
|
|
35
35
|
/* @__PURE__ */ d("p", {
|
|
36
|
-
className:
|
|
36
|
+
className: Le,
|
|
37
37
|
children: e.message
|
|
38
38
|
}),
|
|
39
39
|
e.suggestion && /* @__PURE__ */ d("p", {
|
|
@@ -45,7 +45,7 @@ var z = ({ errors: e }) => {
|
|
|
45
45
|
function Pe(e = [], t = []) {
|
|
46
46
|
return e.length === t.length && e.every((r, n) => Object.is(r, t[n]));
|
|
47
47
|
}
|
|
48
|
-
var
|
|
48
|
+
var Be = class extends Ie {
|
|
49
49
|
constructor(...e) {
|
|
50
50
|
super(...e), this.state = { caughtDiagnostic: null };
|
|
51
51
|
}
|
|
@@ -61,28 +61,28 @@ var Le = class extends qe {
|
|
|
61
61
|
}
|
|
62
62
|
render() {
|
|
63
63
|
const { caughtDiagnostic: e } = this.state;
|
|
64
|
-
if (e) return /* @__PURE__ */ d(
|
|
64
|
+
if (e) return /* @__PURE__ */ d(J, { errors: [e] });
|
|
65
65
|
const { forcedErrors: t, children: r } = this.props;
|
|
66
|
-
return t && t.length > 0 ? /* @__PURE__ */ d(
|
|
66
|
+
return t && t.length > 0 ? /* @__PURE__ */ d(J, { errors: t }) : r;
|
|
67
67
|
}
|
|
68
|
-
},
|
|
69
|
-
const t =
|
|
70
|
-
return t instanceof
|
|
71
|
-
},
|
|
72
|
-
const r = e.filter((n) =>
|
|
68
|
+
}, se = (e) => typeof e == "object" && "geom" in e && "render" in e, Ke = (e) => {
|
|
69
|
+
const t = Re(e);
|
|
70
|
+
return t instanceof fe ? t : null;
|
|
71
|
+
}, Oe = (e, t) => {
|
|
72
|
+
const r = e.filter((n) => Ae(n, t));
|
|
73
73
|
return r.length === e.length ? e : r;
|
|
74
|
-
},
|
|
75
|
-
selection:
|
|
76
|
-
setSelection: (t) => e((r) =>
|
|
77
|
-
clearSelection: () => e((t) => t.selection.length === 0 ? t : { selection:
|
|
78
|
-
})),
|
|
74
|
+
}, Ae = (e, t) => e.kind === "annotation" ? Te(t.annotations, e.id) !== null : e.kind === "observations" ? X(t.layers, e.layerId) !== void 0 : e.kind === "layer" && e.layerId !== void 0 ? X(t.layers, e.layerId) !== void 0 : !0, ee = [], je = () => U((e) => ({
|
|
75
|
+
selection: ee,
|
|
76
|
+
setSelection: (t) => e((r) => Fe(r.selection, t) ? r : { selection: t }),
|
|
77
|
+
clearSelection: () => e((t) => t.selection.length === 0 ? t : { selection: ee })
|
|
78
|
+
})), Fe = (e, t) => e === t ? !0 : e.length !== t.length ? !1 : e.every((r, n) => {
|
|
79
79
|
const o = t[n];
|
|
80
|
-
return o !== void 0 &&
|
|
81
|
-
}),
|
|
82
|
-
if (!
|
|
80
|
+
return o !== void 0 && ye(r, o);
|
|
81
|
+
}), Ue = 5, Ye = (e) => {
|
|
82
|
+
if (!pe) return {
|
|
83
83
|
emit: () => {
|
|
84
84
|
},
|
|
85
|
-
subscribe: () =>
|
|
85
|
+
subscribe: () => Ve,
|
|
86
86
|
getLastTrigger: () => null,
|
|
87
87
|
getLastCompile: () => null,
|
|
88
88
|
getCacheStats: () => e.getCacheStats()
|
|
@@ -104,7 +104,7 @@ var Le = class extends qe {
|
|
|
104
104
|
getLastCompile: () => e.getLastCompile(),
|
|
105
105
|
getCacheStats: () => e.getCacheStats()
|
|
106
106
|
};
|
|
107
|
-
},
|
|
107
|
+
}, We = () => U((e) => ({
|
|
108
108
|
lastCompile: null,
|
|
109
109
|
history: [],
|
|
110
110
|
nextId: 1,
|
|
@@ -113,19 +113,19 @@ var Le = class extends qe {
|
|
|
113
113
|
if (n.lastSnapshot === r) return n;
|
|
114
114
|
const o = {
|
|
115
115
|
id: n.nextId,
|
|
116
|
-
label:
|
|
116
|
+
label: Xe(t),
|
|
117
117
|
stages: r.stages,
|
|
118
118
|
durationMs: r.durationMs
|
|
119
119
|
};
|
|
120
120
|
return {
|
|
121
121
|
lastCompile: o,
|
|
122
|
-
history:
|
|
122
|
+
history: Qe(n.history, o, Ue),
|
|
123
123
|
nextId: n.nextId + 1,
|
|
124
124
|
lastSnapshot: r
|
|
125
125
|
};
|
|
126
126
|
})
|
|
127
|
-
})),
|
|
128
|
-
},
|
|
127
|
+
})), Ve = () => {
|
|
128
|
+
}, Xe = (e) => {
|
|
129
129
|
switch (e.kind) {
|
|
130
130
|
case "init":
|
|
131
131
|
return "init";
|
|
@@ -136,14 +136,14 @@ var Le = class extends qe {
|
|
|
136
136
|
case "command":
|
|
137
137
|
return e.command.metadata.description;
|
|
138
138
|
}
|
|
139
|
-
},
|
|
139
|
+
}, Qe = (e, t, r) => {
|
|
140
140
|
const n = e.length >= r ? e.length - (r - 1) : 0;
|
|
141
141
|
return [...e.slice(n), t];
|
|
142
142
|
};
|
|
143
|
-
function
|
|
144
|
-
const t = e.filter(
|
|
143
|
+
function ze(e) {
|
|
144
|
+
const t = e.filter(se), r = /* @__PURE__ */ new Set([...Object.keys(he), ...t.map((c) => c.geom)]), n = [], o = /* @__PURE__ */ new Set();
|
|
145
145
|
for (const c of e) {
|
|
146
|
-
const u =
|
|
146
|
+
const u = Ke(c);
|
|
147
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",
|
|
@@ -184,7 +184,7 @@ function Qe(e) {
|
|
|
184
184
|
warnings: i
|
|
185
185
|
};
|
|
186
186
|
}
|
|
187
|
-
function
|
|
187
|
+
function Je(e, t) {
|
|
188
188
|
const { coordSystem: r, layers: n } = e, o = /* @__PURE__ */ new Set(), a = [];
|
|
189
189
|
for (const i of n)
|
|
190
190
|
t(i.geom, r.type) !== null || o.has(i.geom) || (o.add(i.geom), a.push({
|
|
@@ -200,7 +200,7 @@ function ze(e, t) {
|
|
|
200
200
|
}));
|
|
201
201
|
return a;
|
|
202
202
|
}
|
|
203
|
-
function
|
|
203
|
+
function Ze(e, t) {
|
|
204
204
|
const { coordSystem: r, layers: n } = e, o = /* @__PURE__ */ new Set(), a = [];
|
|
205
205
|
for (const i of n) {
|
|
206
206
|
if (i.interactive === !1 || i.spatialKind !== "render-hit-test" || o.has(i.geom)) continue;
|
|
@@ -219,7 +219,7 @@ function Je(e, t) {
|
|
|
219
219
|
}
|
|
220
220
|
return a;
|
|
221
221
|
}
|
|
222
|
-
function
|
|
222
|
+
function et(e) {
|
|
223
223
|
const t = /* @__PURE__ */ new Set(), r = [];
|
|
224
224
|
for (const n of e.layers) {
|
|
225
225
|
const o = n.identityKey;
|
|
@@ -237,7 +237,7 @@ function Ze(e) {
|
|
|
237
237
|
}
|
|
238
238
|
return r;
|
|
239
239
|
}
|
|
240
|
-
function
|
|
240
|
+
function tt(e, t) {
|
|
241
241
|
const { coordSystem: r, layers: n } = e, o = /* @__PURE__ */ new Set(), a = [];
|
|
242
242
|
for (const i of n) {
|
|
243
243
|
if (i.interactive === !1 || i.spatialKind !== "render-hit-test" || o.has(i.geom)) continue;
|
|
@@ -256,7 +256,7 @@ function et(e, t) {
|
|
|
256
256
|
}
|
|
257
257
|
return a;
|
|
258
258
|
}
|
|
259
|
-
function
|
|
259
|
+
function rt(e, t) {
|
|
260
260
|
const r = /* @__PURE__ */ new Set(), n = [];
|
|
261
261
|
for (const o of e.layers)
|
|
262
262
|
o.interactive !== !1 && (o.spatialKind !== "render-hit-test" || r.has(o.geom) || t.hasCapability(o.geom) || (r.add(o.geom), n.push({
|
|
@@ -272,7 +272,7 @@ function tt(e, t) {
|
|
|
272
272
|
})));
|
|
273
273
|
return n;
|
|
274
274
|
}
|
|
275
|
-
function
|
|
275
|
+
function nt(e, t) {
|
|
276
276
|
const { coordSystem: r, layers: n } = e, o = /* @__PURE__ */ new Set(), a = [];
|
|
277
277
|
for (const i of n) {
|
|
278
278
|
if (i.interactive === !1 || i.spatialKind === "render-hit-test" || o.has(i.geom)) continue;
|
|
@@ -291,56 +291,56 @@ function rt(e, t) {
|
|
|
291
291
|
}
|
|
292
292
|
return a;
|
|
293
293
|
}
|
|
294
|
-
var
|
|
294
|
+
var st = (e) => U((t) => ({
|
|
295
295
|
compiled: e,
|
|
296
296
|
setCompiled: (r) => t((n) => n.compiled === r ? n : { compiled: r })
|
|
297
|
-
})),
|
|
298
|
-
const T = K(c),
|
|
299
|
-
const s =
|
|
297
|
+
})), ot = ({ input: e, data: t, customPalettes: r, colorScheme: n, plugins: o, resolveRenderer: a, anchorResolver: i, onChange: c, onError: u, onWarnings: m }) => {
|
|
298
|
+
const T = K(c), k = K(u), q = K(m), [{ session: h, compileBus: l }] = C(() => {
|
|
299
|
+
const s = Se({ plugins: o });
|
|
300
300
|
return {
|
|
301
|
-
session: new
|
|
302
|
-
compileBus:
|
|
301
|
+
session: new ve(s),
|
|
302
|
+
compileBus: Ye(s)
|
|
303
303
|
};
|
|
304
|
-
}), [p] = C(() =>
|
|
304
|
+
}), [p] = C(() => ze(o ?? [])), y = Q(null), [G] = C(it), N = Q(null), b = f((s) => p.errors.length === 0 ? s : [...p.errors, ...s ?? []], [p]), _ = f((s) => {
|
|
305
305
|
if (!s.ok) return s.errors;
|
|
306
306
|
if (N.current) N.current.getState().setCompiled(s.compiled);
|
|
307
307
|
else {
|
|
308
|
-
const
|
|
309
|
-
|
|
308
|
+
const g = st(s.compiled);
|
|
309
|
+
g.subscribe(G.notify), N.current = g, G.notify();
|
|
310
310
|
}
|
|
311
311
|
return null;
|
|
312
|
-
}, [
|
|
313
|
-
const s =
|
|
312
|
+
}, [G]), [H, D] = C(() => {
|
|
313
|
+
const s = h.compile({
|
|
314
314
|
input: e,
|
|
315
315
|
data: t,
|
|
316
316
|
customPalettes: r,
|
|
317
317
|
colorScheme: n
|
|
318
318
|
});
|
|
319
319
|
return y.current = s, b(_(s));
|
|
320
|
-
}),
|
|
320
|
+
}), I = f((s) => s.ok ? [
|
|
321
321
|
...s.warnings,
|
|
322
|
-
...ze(s.compiled, a),
|
|
323
322
|
...Je(s.compiled, a),
|
|
324
|
-
...Ze(s.compiled),
|
|
325
|
-
...et(s.compiled
|
|
326
|
-
...
|
|
327
|
-
...
|
|
323
|
+
...Ze(s.compiled, a),
|
|
324
|
+
...et(s.compiled),
|
|
325
|
+
...tt(s.compiled, a),
|
|
326
|
+
...nt(s.compiled, a),
|
|
327
|
+
...rt(s.compiled, i)
|
|
328
328
|
] : s.warnings, [a, i]), S = f((s) => {
|
|
329
|
-
s.length !== 0 && (A(s),
|
|
330
|
-
}, [
|
|
329
|
+
s.length !== 0 && (A(s), k.current?.(s));
|
|
330
|
+
}, [k]), R = f((s) => {
|
|
331
331
|
s.length !== 0 && (A(s), q.current?.(s));
|
|
332
332
|
}, [q]);
|
|
333
333
|
x(() => {
|
|
334
334
|
const s = y.current;
|
|
335
|
-
s && (S([...p.errors, ...s.ok ? [] : s.errors]), R([...p.warnings, ...
|
|
335
|
+
s && (S([...p.errors, ...s.ok ? [] : s.errors]), R([...p.warnings, ...I(s)]), s.ok && l.emit({ kind: "init" }));
|
|
336
336
|
}, [
|
|
337
337
|
l,
|
|
338
338
|
S,
|
|
339
339
|
R,
|
|
340
340
|
p,
|
|
341
|
-
|
|
341
|
+
I
|
|
342
342
|
]), x(() => {
|
|
343
|
-
const s =
|
|
343
|
+
const s = h.update({
|
|
344
344
|
input: e,
|
|
345
345
|
data: t,
|
|
346
346
|
customPalettes: r,
|
|
@@ -348,65 +348,65 @@ var nt = (e) => U((t) => ({
|
|
|
348
348
|
});
|
|
349
349
|
if (!s) return;
|
|
350
350
|
s.sealedInput && T.current?.(s.sealedInput);
|
|
351
|
-
const
|
|
352
|
-
D(b(
|
|
351
|
+
const g = _(s.result);
|
|
352
|
+
D(b(g)), g && S(g), R(I(s.result)), g || l.emit({ kind: s.inputChanged ? "input" : "data" });
|
|
353
353
|
}, [
|
|
354
354
|
e,
|
|
355
355
|
t,
|
|
356
356
|
r,
|
|
357
357
|
n,
|
|
358
|
-
|
|
358
|
+
h,
|
|
359
359
|
l,
|
|
360
360
|
_,
|
|
361
361
|
S,
|
|
362
362
|
R,
|
|
363
363
|
b,
|
|
364
|
-
|
|
364
|
+
I,
|
|
365
365
|
T
|
|
366
366
|
]);
|
|
367
|
-
const
|
|
368
|
-
D((
|
|
367
|
+
const w = f((s) => {
|
|
368
|
+
D((g) => g === null ? g : b(null)), R(I(s));
|
|
369
369
|
}, [
|
|
370
370
|
b,
|
|
371
371
|
R,
|
|
372
|
-
|
|
372
|
+
I
|
|
373
373
|
]), M = f((s) => {
|
|
374
|
-
s.compiled && N.current?.getState().setCompiled(s.compiled), s.result &&
|
|
374
|
+
s.compiled && N.current?.getState().setCompiled(s.compiled), s.result && w(s.result), s.command && l.emit({
|
|
375
375
|
kind: "command",
|
|
376
376
|
command: s.command
|
|
377
377
|
}), s.input && T.current?.(s.input), s.errors && S([...s.errors]);
|
|
378
378
|
}, [
|
|
379
|
-
|
|
379
|
+
w,
|
|
380
380
|
l,
|
|
381
381
|
T,
|
|
382
382
|
S
|
|
383
383
|
]), E = f((s) => {
|
|
384
|
-
for (const
|
|
385
|
-
return s.some((
|
|
386
|
-
}, [M]), B = f((s,
|
|
387
|
-
E(
|
|
388
|
-
}, [
|
|
389
|
-
E(
|
|
390
|
-
}, [
|
|
391
|
-
stack:
|
|
384
|
+
for (const g of s) M(g);
|
|
385
|
+
return s.some((g) => !!g.compiled);
|
|
386
|
+
}, [M]), B = f((s, g) => {
|
|
387
|
+
E(h.applyCommand(s, g));
|
|
388
|
+
}, [h, E]), ae = f(() => {
|
|
389
|
+
E(h.seal());
|
|
390
|
+
}, [h, E]), Y = f(() => E(h.undo()), [h, E]), W = f(() => E(h.redo()), [h, E]), ce = $(() => ({
|
|
391
|
+
stack: h.history,
|
|
392
392
|
undo: Y,
|
|
393
393
|
redo: W
|
|
394
394
|
}), [
|
|
395
|
-
|
|
395
|
+
h,
|
|
396
396
|
Y,
|
|
397
397
|
W
|
|
398
|
-
]),
|
|
398
|
+
]), de = f(() => N.current?.getState().compiled ?? null, []);
|
|
399
399
|
return {
|
|
400
400
|
store: N.current,
|
|
401
401
|
dispatch: B,
|
|
402
|
-
seal:
|
|
403
|
-
history:
|
|
404
|
-
subscribe:
|
|
405
|
-
getCompiled:
|
|
402
|
+
seal: ae,
|
|
403
|
+
history: ce,
|
|
404
|
+
subscribe: G.subscribe,
|
|
405
|
+
getCompiled: de,
|
|
406
406
|
compileBus: l,
|
|
407
407
|
compileErrors: H
|
|
408
408
|
};
|
|
409
|
-
},
|
|
409
|
+
}, it = () => {
|
|
410
410
|
const e = /* @__PURE__ */ new Set();
|
|
411
411
|
return {
|
|
412
412
|
subscribe: (t) => (e.add(t), () => {
|
|
@@ -414,39 +414,39 @@ var nt = (e) => U((t) => ({
|
|
|
414
414
|
}),
|
|
415
415
|
notify: () => e.forEach((t) => t())
|
|
416
416
|
};
|
|
417
|
-
},
|
|
418
|
-
const [
|
|
417
|
+
}, at = ({ data: e, input: t, plugins: r = [], formattingLocale: n, handleRef: o, onChange: a, onError: i, onWarnings: c, customPalettes: u, colorScheme: m = "light", children: T }) => {
|
|
418
|
+
const [k] = C(() => me(r.filter(se))), q = ke(), [h] = C(() => be(r)), [l] = C(() => je()), p = $(() => Ce({ colorScheme: m }), [m]), { store: y, dispatch: G, seal: N, history: b, subscribe: _, getCompiled: H, compileBus: D, compileErrors: I } = ot({
|
|
419
419
|
input: t,
|
|
420
420
|
data: e,
|
|
421
421
|
customPalettes: u,
|
|
422
422
|
colorScheme: m,
|
|
423
423
|
plugins: r,
|
|
424
|
-
resolveRenderer:
|
|
425
|
-
anchorResolver:
|
|
424
|
+
resolveRenderer: k,
|
|
425
|
+
anchorResolver: h,
|
|
426
426
|
onChange: a,
|
|
427
427
|
onError: i,
|
|
428
428
|
onWarnings: c
|
|
429
429
|
});
|
|
430
430
|
x(() => {
|
|
431
431
|
if (y)
|
|
432
|
-
return y.subscribe((
|
|
433
|
-
if (
|
|
432
|
+
return y.subscribe((w, M) => {
|
|
433
|
+
if (w.compiled.spec === M.compiled.spec) return;
|
|
434
434
|
const { selection: E, setSelection: B } = l.getState();
|
|
435
|
-
E.length !== 0 && B(
|
|
435
|
+
E.length !== 0 && B(Oe(E, w.compiled.spec));
|
|
436
436
|
});
|
|
437
437
|
}, [y, l]);
|
|
438
438
|
const S = $(() => ({
|
|
439
|
-
dispatch:
|
|
439
|
+
dispatch: G,
|
|
440
440
|
seal: N
|
|
441
|
-
}), [
|
|
442
|
-
|
|
441
|
+
}), [G, N]);
|
|
442
|
+
Ge(o, () => ({
|
|
443
443
|
commands: S,
|
|
444
444
|
undo: b.undo,
|
|
445
445
|
redo: b.redo,
|
|
446
446
|
subscribe: _,
|
|
447
447
|
getCompiled: H,
|
|
448
448
|
getSelection: () => l.getState().selection,
|
|
449
|
-
setSelection: (
|
|
449
|
+
setSelection: (w) => l.getState().setSelection(w),
|
|
450
450
|
subscribeSelection: l.subscribe
|
|
451
451
|
}), [
|
|
452
452
|
S,
|
|
@@ -465,7 +465,7 @@ var nt = (e) => U((t) => ({
|
|
|
465
465
|
compileBus: D,
|
|
466
466
|
colorScheme: m,
|
|
467
467
|
styleResolver: p,
|
|
468
|
-
anchorResolver:
|
|
468
|
+
anchorResolver: h
|
|
469
469
|
} : null, [
|
|
470
470
|
q,
|
|
471
471
|
y,
|
|
@@ -476,32 +476,32 @@ var nt = (e) => U((t) => ({
|
|
|
476
476
|
D,
|
|
477
477
|
m,
|
|
478
478
|
p,
|
|
479
|
-
|
|
479
|
+
h
|
|
480
480
|
]);
|
|
481
|
-
return /* @__PURE__ */ d(
|
|
482
|
-
forcedErrors:
|
|
481
|
+
return /* @__PURE__ */ d(Be, {
|
|
482
|
+
forcedErrors: I,
|
|
483
483
|
onError: i,
|
|
484
484
|
resetKeys: [t, e],
|
|
485
|
-
children: R ? /* @__PURE__ */ d(
|
|
485
|
+
children: R ? /* @__PURE__ */ d(le.Provider, {
|
|
486
486
|
value: R,
|
|
487
|
-
children: /* @__PURE__ */ d(
|
|
488
|
-
value:
|
|
487
|
+
children: /* @__PURE__ */ d(ue, {
|
|
488
|
+
value: k,
|
|
489
489
|
children: T
|
|
490
490
|
})
|
|
491
491
|
}) : null
|
|
492
492
|
});
|
|
493
493
|
};
|
|
494
494
|
function gr(e) {
|
|
495
|
-
const t =
|
|
495
|
+
const t = Ee(e);
|
|
496
496
|
return {
|
|
497
497
|
...t,
|
|
498
|
-
GraphProvider: (n) => /* @__PURE__ */ d(
|
|
498
|
+
GraphProvider: (n) => /* @__PURE__ */ d(at, {
|
|
499
499
|
...n,
|
|
500
500
|
plugins: t.plugins
|
|
501
501
|
})
|
|
502
502
|
};
|
|
503
503
|
}
|
|
504
|
-
var
|
|
504
|
+
var pr = ({ children: e, ...t }) => /* @__PURE__ */ d("svg", {
|
|
505
505
|
viewBox: "0 0 1 1",
|
|
506
506
|
preserveAspectRatio: "none",
|
|
507
507
|
width: "100%",
|
|
@@ -509,57 +509,57 @@ var hr = ({ children: e, ...t }) => /* @__PURE__ */ d("svg", {
|
|
|
509
509
|
pointerEvents: "none",
|
|
510
510
|
...t,
|
|
511
511
|
children: e
|
|
512
|
-
}),
|
|
513
|
-
x:
|
|
514
|
-
y:
|
|
515
|
-
width:
|
|
516
|
-
height:
|
|
512
|
+
}), fr = ({ box: e, children: t }) => /* @__PURE__ */ d("svg", {
|
|
513
|
+
x: L(e.x0),
|
|
514
|
+
y: L(e.y0),
|
|
515
|
+
width: L(e.x1 - e.x0),
|
|
516
|
+
height: L(e.y1 - e.y0),
|
|
517
517
|
overflow: "hidden",
|
|
518
518
|
pointerEvents: "none",
|
|
519
519
|
children: t
|
|
520
|
-
}),
|
|
521
|
-
var
|
|
522
|
-
var
|
|
520
|
+
}), ct = "drqe3u0", dt = "drqe3u1", lt = "drqe3u2", ut = "drqe3u3", P = "drqe3u4", mt = "drqe3u5", ht = "drqe3u6", gt = "drqe3u7", O = "drqe3u8", pt = "drqe3u9", ft = "drqe3ua";
|
|
521
|
+
var vt = "drqe3uc", yt = "drqe3ud", bt = "drqe3ue", St = "drqe3uf";
|
|
522
|
+
var Et = "drqe3uh", Ct = "drqe3ui", te = {
|
|
523
523
|
enabled: "drqe3uk drqe3uj",
|
|
524
524
|
disabled: "drqe3ul drqe3uj"
|
|
525
|
-
},
|
|
525
|
+
}, re = {
|
|
526
526
|
ran: "drqe3un drqe3um",
|
|
527
527
|
dim: "drqe3uo drqe3um"
|
|
528
|
-
},
|
|
528
|
+
}, oe = {
|
|
529
529
|
ran: "drqe3uq drqe3up",
|
|
530
530
|
cached: "drqe3ur drqe3up",
|
|
531
531
|
untouched: "drqe3us drqe3up"
|
|
532
|
-
},
|
|
533
|
-
const { compileBus: n } =
|
|
532
|
+
}, vr = ({ width: e = 380, style: t, className: r } = {}) => {
|
|
533
|
+
const { compileBus: n } = ne(), [o] = C(() => We()), [a, i] = C(!1), [c, u] = C(Ne);
|
|
534
534
|
x(() => {
|
|
535
535
|
const { recordCompile: l } = o.getState(), p = n.getLastTrigger(), y = n.getLastCompile();
|
|
536
536
|
return p && y && l(p, y), n.subscribe(l);
|
|
537
537
|
}, [o, n]);
|
|
538
|
-
const m =
|
|
538
|
+
const m = z(o, (l) => l.lastCompile), T = z(o, (l) => l.history), k = n.getCacheStats(), q = m === null && T.length === 0, h = () => {
|
|
539
539
|
u((l) => {
|
|
540
540
|
const p = !l;
|
|
541
|
-
return
|
|
541
|
+
return qe(p), p;
|
|
542
542
|
});
|
|
543
543
|
};
|
|
544
544
|
return /* @__PURE__ */ v("div", {
|
|
545
|
-
className:
|
|
545
|
+
className: De(ft, r),
|
|
546
546
|
style: {
|
|
547
547
|
width: e,
|
|
548
548
|
...t
|
|
549
549
|
},
|
|
550
550
|
children: [
|
|
551
551
|
/* @__PURE__ */ v("div", {
|
|
552
|
-
className:
|
|
552
|
+
className: ct,
|
|
553
553
|
children: [/* @__PURE__ */ v("div", { children: [/* @__PURE__ */ d("div", {
|
|
554
|
-
className:
|
|
554
|
+
className: dt,
|
|
555
555
|
children: "compile cache"
|
|
556
556
|
}), /* @__PURE__ */ d("div", {
|
|
557
|
-
className:
|
|
558
|
-
children: q ? "production: stats disabled" : m ? `last: ${m.label} · ${
|
|
557
|
+
className: bt,
|
|
558
|
+
children: q ? "production: stats disabled" : m ? `last: ${m.label} · ${ie(m.durationMs)}` : "awaiting first compile…"
|
|
559
559
|
})] }), /* @__PURE__ */ d("button", {
|
|
560
560
|
type: "button",
|
|
561
561
|
onClick: () => i((l) => !l),
|
|
562
|
-
className:
|
|
562
|
+
className: St,
|
|
563
563
|
children: a ? "▾" : "▴"
|
|
564
564
|
})]
|
|
565
565
|
}),
|
|
@@ -567,8 +567,8 @@ var St = "drqe3uh", Et = "drqe3ui", ee = {
|
|
|
567
567
|
className: "drqe3ub",
|
|
568
568
|
children: [/* @__PURE__ */ v("button", {
|
|
569
569
|
type: "button",
|
|
570
|
-
onClick:
|
|
571
|
-
className: c ?
|
|
570
|
+
onClick: h,
|
|
571
|
+
className: c ? te.enabled : te.disabled,
|
|
572
572
|
"aria-pressed": c,
|
|
573
573
|
children: ["cache ", c ? "enabled" : "disabled"]
|
|
574
574
|
}), /* @__PURE__ */ d("span", {
|
|
@@ -576,48 +576,48 @@ var St = "drqe3uh", Et = "drqe3ui", ee = {
|
|
|
576
576
|
children: "next compile reflects this toggle"
|
|
577
577
|
})]
|
|
578
578
|
}),
|
|
579
|
-
!a && !q && /* @__PURE__ */ v(
|
|
579
|
+
!a && !q && /* @__PURE__ */ v(_e, { children: [/* @__PURE__ */ d(Tt, {
|
|
580
580
|
delta: m?.stages,
|
|
581
|
-
cumulative:
|
|
582
|
-
}), /* @__PURE__ */ d(
|
|
581
|
+
cumulative: k
|
|
582
|
+
}), /* @__PURE__ */ d(Nt, { entries: T })] })
|
|
583
583
|
]
|
|
584
584
|
});
|
|
585
|
-
},
|
|
586
|
-
className:
|
|
585
|
+
}, Tt = ({ delta: e, cumulative: t }) => /* @__PURE__ */ v("table", {
|
|
586
|
+
className: lt,
|
|
587
587
|
children: [/* @__PURE__ */ d("thead", { children: /* @__PURE__ */ v("tr", {
|
|
588
|
-
className:
|
|
588
|
+
className: Et,
|
|
589
589
|
children: [
|
|
590
590
|
/* @__PURE__ */ d("th", {
|
|
591
|
-
className:
|
|
591
|
+
className: ut,
|
|
592
592
|
children: "stage"
|
|
593
593
|
}),
|
|
594
594
|
/* @__PURE__ */ d("th", {
|
|
595
|
-
className:
|
|
595
|
+
className: P,
|
|
596
596
|
children: "Δ miss"
|
|
597
597
|
}),
|
|
598
598
|
/* @__PURE__ */ d("th", {
|
|
599
|
-
className:
|
|
599
|
+
className: P,
|
|
600
600
|
children: "Δ hit"
|
|
601
601
|
}),
|
|
602
602
|
/* @__PURE__ */ d("th", {
|
|
603
|
-
className:
|
|
603
|
+
className: P,
|
|
604
604
|
children: "total miss"
|
|
605
605
|
}),
|
|
606
606
|
/* @__PURE__ */ d("th", {
|
|
607
|
-
className:
|
|
607
|
+
className: P,
|
|
608
608
|
children: "total hit"
|
|
609
609
|
})
|
|
610
610
|
]
|
|
611
611
|
}) }), /* @__PURE__ */ d("tbody", { children: F.map((r) => {
|
|
612
|
-
const n = e?.[r], o =
|
|
612
|
+
const n = e?.[r], o = Rt(n);
|
|
613
613
|
return /* @__PURE__ */ v("tr", {
|
|
614
|
-
className:
|
|
614
|
+
className: vt,
|
|
615
615
|
children: [
|
|
616
616
|
/* @__PURE__ */ v("td", {
|
|
617
|
-
className:
|
|
617
|
+
className: mt,
|
|
618
618
|
children: [
|
|
619
619
|
/* @__PURE__ */ d("span", {
|
|
620
|
-
className:
|
|
620
|
+
className: oe[o],
|
|
621
621
|
"aria-hidden": !0
|
|
622
622
|
}),
|
|
623
623
|
" ",
|
|
@@ -625,7 +625,7 @@ var St = "drqe3uh", Et = "drqe3ui", ee = {
|
|
|
625
625
|
]
|
|
626
626
|
}),
|
|
627
627
|
/* @__PURE__ */ d("td", {
|
|
628
|
-
className: o === "ran" ?
|
|
628
|
+
className: o === "ran" ? re.ran : re.dim,
|
|
629
629
|
children: n?.misses ?? 0
|
|
630
630
|
}),
|
|
631
631
|
/* @__PURE__ */ d("td", {
|
|
@@ -643,18 +643,18 @@ var St = "drqe3uh", Et = "drqe3ui", ee = {
|
|
|
643
643
|
]
|
|
644
644
|
}, r);
|
|
645
645
|
}) })]
|
|
646
|
-
}),
|
|
647
|
-
className:
|
|
646
|
+
}), Nt = ({ entries: e }) => e.length === 0 ? null : /* @__PURE__ */ v("div", {
|
|
647
|
+
className: yt,
|
|
648
648
|
children: [/* @__PURE__ */ d("div", {
|
|
649
|
-
className:
|
|
649
|
+
className: Ct,
|
|
650
650
|
children: "recent compiles"
|
|
651
651
|
}), e.map((t) => {
|
|
652
|
-
const r =
|
|
652
|
+
const r = qt(t.stages, (a) => a.misses > 0), n = F.length;
|
|
653
653
|
return /* @__PURE__ */ v("div", {
|
|
654
|
-
className:
|
|
654
|
+
className: ht,
|
|
655
655
|
children: [
|
|
656
656
|
/* @__PURE__ */ d("span", {
|
|
657
|
-
className:
|
|
657
|
+
className: oe[r === 0 ? "cached" : "ran"],
|
|
658
658
|
"aria-hidden": !0
|
|
659
659
|
}),
|
|
660
660
|
/* @__PURE__ */ d("span", {
|
|
@@ -663,24 +663,24 @@ var St = "drqe3uh", Et = "drqe3ui", ee = {
|
|
|
663
663
|
children: t.label
|
|
664
664
|
}),
|
|
665
665
|
/* @__PURE__ */ v("span", {
|
|
666
|
-
className:
|
|
666
|
+
className: pt,
|
|
667
667
|
children: [
|
|
668
668
|
r,
|
|
669
669
|
"/",
|
|
670
670
|
n,
|
|
671
671
|
" ran · ",
|
|
672
|
-
|
|
672
|
+
ie(t.durationMs)
|
|
673
673
|
]
|
|
674
674
|
})
|
|
675
675
|
]
|
|
676
676
|
}, t.id);
|
|
677
677
|
})]
|
|
678
|
-
}),
|
|
678
|
+
}), Rt = (e) => !e || e.hits === 0 && e.misses === 0 ? "untouched" : e.misses > 0 ? "ran" : "cached", qt = (e, t) => {
|
|
679
679
|
let r = 0;
|
|
680
680
|
for (const n of F) t(e[n]) && (r += 1);
|
|
681
681
|
return r;
|
|
682
|
-
},
|
|
683
|
-
const { history: e } =
|
|
682
|
+
}, ie = (e) => e >= 10 ? `${e.toFixed(0)}ms` : `${e.toFixed(2)}ms`, yr = () => {
|
|
683
|
+
const { history: e } = ne(), { stack: t, undo: r, redo: n } = e, o = f((c) => t.subscribe(c), [t]), a = f(() => t.getSnapshot(), [t]), i = we(o, a, a);
|
|
684
684
|
return $(() => ({
|
|
685
685
|
...i,
|
|
686
686
|
undo: r,
|
|
@@ -690,7 +690,7 @@ var St = "drqe3uh", Et = "drqe3ui", ee = {
|
|
|
690
690
|
r,
|
|
691
691
|
n
|
|
692
692
|
]);
|
|
693
|
-
},
|
|
693
|
+
}, It = /* @__PURE__ */ new Set([
|
|
694
694
|
"button",
|
|
695
695
|
"checkbox",
|
|
696
696
|
"color",
|
|
@@ -701,13 +701,13 @@ var St = "drqe3uh", Et = "drqe3ui", ee = {
|
|
|
701
701
|
"range",
|
|
702
702
|
"reset",
|
|
703
703
|
"submit"
|
|
704
|
-
]),
|
|
704
|
+
]), br = (e, t = {}) => {
|
|
705
705
|
const { target: r, enabled: n = !0 } = t;
|
|
706
706
|
x(() => {
|
|
707
|
-
const o =
|
|
707
|
+
const o = kt(r);
|
|
708
708
|
if (!n || !o) return;
|
|
709
709
|
const a = (i) => {
|
|
710
|
-
if (!
|
|
710
|
+
if (!Gt(i) || i.defaultPrevented || wt(i.target)) return;
|
|
711
711
|
const c = ge(i);
|
|
712
712
|
if (!c) return;
|
|
713
713
|
const u = e.current;
|
|
@@ -719,45 +719,45 @@ var St = "drqe3uh", Et = "drqe3ui", ee = {
|
|
|
719
719
|
r,
|
|
720
720
|
n
|
|
721
721
|
]);
|
|
722
|
-
},
|
|
722
|
+
}, kt = (e) => e === void 0 ? window : e !== null && "current" in e ? e.current : e, Gt = (e) => "key" in e, wt = (e) => e instanceof HTMLInputElement ? !It.has(e.type) : e instanceof HTMLElement ? e.isContentEditable || e.tagName === "TEXTAREA" : !1;
|
|
723
723
|
export {
|
|
724
|
-
|
|
724
|
+
Yt as BrandMark,
|
|
725
725
|
Pt as CanvasTextMeasurer,
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
726
|
+
Vt as DefaultFooter,
|
|
727
|
+
tr as DefaultGrid,
|
|
728
|
+
Mt as DefaultHeader,
|
|
729
|
+
or as DefaultSwatch,
|
|
730
|
+
Kt as DefaultTooltip,
|
|
731
|
+
vr as DevToolsPanel,
|
|
732
|
+
Be as GraphErrorBoundary,
|
|
733
|
+
J as GraphErrorPanel,
|
|
734
|
+
at as GraphProvider,
|
|
735
|
+
At as GraphRenderer,
|
|
736
|
+
Qt as HoverProvider,
|
|
737
|
+
Dt as TextMeasurerProvider,
|
|
738
|
+
rr as ThemeProvider,
|
|
739
|
+
fr as UnitBoxSvg,
|
|
740
|
+
pr as UnitSpaceSvg,
|
|
741
741
|
gr as createGraphyKit,
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
742
|
+
er as darkTheme,
|
|
743
|
+
nr as defineGeomRenderer,
|
|
744
|
+
Ut as lightTheme,
|
|
745
|
+
Wt as lightenCss,
|
|
746
|
+
Oe as pruneSelection,
|
|
747
|
+
$t as resolveBrandMarkVisual,
|
|
748
|
+
Lt as useCompiledSelector,
|
|
749
|
+
Xt as useElementScreenRect,
|
|
750
|
+
Jt as useGeomHitTest,
|
|
751
|
+
jt as useGeomHover,
|
|
752
|
+
zt as useGraphCommands,
|
|
753
|
+
Ft as useGraphHandle,
|
|
754
|
+
yr as useGraphHistory,
|
|
755
|
+
br as useGraphHistoryShortcuts,
|
|
756
|
+
Ot as useGraphSelection,
|
|
757
|
+
Zt as useHandleCompiled,
|
|
758
|
+
Bt as useHoverState,
|
|
759
|
+
xt as useStyleReaders,
|
|
760
|
+
Ht as useStyleResolver,
|
|
761
|
+
sr as useTextMeasurer,
|
|
762
|
+
ar as vars
|
|
763
763
|
};
|