@graphysdk/react-renderer 1.9.0-beta.1793705178615 → 1.9.0-beta.1793705972988
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 +7 -7
- package/dist/editable.mjs +245 -245
- package/dist/{history-chords-DFaoLzYd.js → history-chords-8Qa2vuLW.js} +2199 -2163
- package/dist/history-chords-CrTzRf6N.cjs +2 -0
- package/dist/history-chords.css +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +7 -7
- package/dist/index.mjs +72 -72
- package/package.json +4 -4
- package/dist/history-chords-D0TR7SJV.cjs +0 -2
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { $t as ur,
|
|
2
|
-
import { COMPILER_STAGE_KEYS as se, DEFAULT_LOCALE as He, Geom as $e, GraphCompilationSession as xe, areEditTargetsEqual as Me, buildDiagnostic as ie, canonicalizeLocale as Ae, createAnchorResolver as Be, createCompiler as Oe, createDataLabelPlacementResolver as Fe, createSpecBuilder as Ke, createStyleResolver as Ee, findAnnotation as
|
|
1
|
+
import { $t as ur, A as mr, An as hr, B as gr, Bt as Ne, Dn as pr, En as fr, Et as vr, Ft as yr, Gt as Ie, Ht as Sr, In as V, Kt as br, L as Er, Lt as z, M as Tr, Mn as Ce, Nn as ne, Nt as Rr, On as Gr, Pn as we, Pt as Nr, Qt as Ir, R as Cr, Sn as wr, Tn as Dr, Ut as Lr, Vt as De, Wt as X, Xt as Le, Yt as Pr, _n as Q, _t as qr, a as _r, an as kr, at as Hr, bn as J, bt as $r, cn as xr, ct as Mr, dn as Ar, en as Br, fn as Se, gn as Pe, h as Or, hn as qe, i as Fr, it as Kr, j as jr, jn as Ur, jt as Wr, kn as Yr, kt as zr, mn as be, mt as Vr, n as Xr, ot as Qr, pn as B, r as Jr, s as Zr, t as _e, tn as en, vn as tn, vt as rn, w as nn, wn as sn, xn as Z, yn as ke, z as on } from "./history-chords-8Qa2vuLW.js";
|
|
2
|
+
import { COMPILER_STAGE_KEYS as se, DEFAULT_LOCALE as He, Geom as $e, GraphCompilationSession as xe, areEditTargetsEqual as Me, buildDiagnostic as ie, canonicalizeLocale as Ae, createAnchorResolver as Be, createCompiler as Oe, createDataLabelPlacementResolver as Fe, createSpecBuilder as Ke, createStyleResolver as Ee, findAnnotation as je, findIntlLocale as Ue, findLayerById as ce, foldGeomCornerRadii as We, isCompilerCachingEnabled as Ye, resolveDefinition as ze, resolveGeomCornerRadiusPx as le, setCompilerCachingEnabled as Ve, toPercent as W } from "@graphysdk/viz-engine";
|
|
3
3
|
import { Component as Xe, useCallback as p, useEffect as H, useId as Qe, useImperativeHandle as Je, useMemo as k, useRef as de, useState as S, useSyncExternalStore as Ze } from "react";
|
|
4
4
|
import { Fragment as et, jsx as c, jsxs as f } from "react/jsx-runtime";
|
|
5
5
|
import { useStore as re } from "zustand";
|
|
@@ -71,7 +71,7 @@ var ct = class extends Xe {
|
|
|
71
71
|
}, lt = (e, t) => {
|
|
72
72
|
const r = e.filter((n) => dt(n, t));
|
|
73
73
|
return r.length === e.length ? e : r;
|
|
74
|
-
}, dt = (e, t) => e.kind === "annotation" ?
|
|
74
|
+
}, dt = (e, t) => e.kind === "annotation" ? je(t.annotations, e.id) !== null : e.kind === "observations" ? ce(t.layers, e.layerId) !== void 0 : e.kind === "layer" && e.layerId !== void 0 ? ce(t.layers, e.layerId) !== void 0 : !0, he = [], ut = () => oe((e) => ({
|
|
75
75
|
selection: he,
|
|
76
76
|
setSelection: (t) => e((r) => mt(r.selection, t) ? r : { selection: t }),
|
|
77
77
|
clearSelection: () => e((t) => t.selection.length === 0 ? t : { selection: he })
|
|
@@ -180,7 +180,7 @@ function ge(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(...wt(e)), {
|
|
184
184
|
errors: n,
|
|
185
185
|
warnings: a
|
|
186
186
|
};
|
|
@@ -308,7 +308,7 @@ function It(e, t) {
|
|
|
308
308
|
}]) : [] : []);
|
|
309
309
|
}
|
|
310
310
|
var Ct = (e) => [e.styles.defaults, e.styles.overrides].some((t) => t.some((r) => r.state === "hovered" && (r.declarations.overpaint?.length ?? 0) > 0));
|
|
311
|
-
function
|
|
311
|
+
function wt(e) {
|
|
312
312
|
const t = /* @__PURE__ */ new Set(), r = [];
|
|
313
313
|
for (const n of e) {
|
|
314
314
|
const s = Re(n);
|
|
@@ -326,7 +326,7 @@ function Dt(e) {
|
|
|
326
326
|
}
|
|
327
327
|
return r;
|
|
328
328
|
}
|
|
329
|
-
var
|
|
329
|
+
var Dt = (e) => oe((t) => ({
|
|
330
330
|
scene: e,
|
|
331
331
|
setScene: (r) => t((n) => n.scene === r ? n : { scene: r })
|
|
332
332
|
})), Lt = ({ spec: e, data: t, colorScheme: r, plugins: n, theme: s, resolveRenderer: o, anchorResolver: a, onSpecChange: l, onError: d, onWarnings: g }) => {
|
|
@@ -350,7 +350,7 @@ var wt = (e) => oe((t) => ({
|
|
|
350
350
|
if (!i.ok) return i.errors;
|
|
351
351
|
if (C.current) C.current.getState().setScene(i.scene);
|
|
352
352
|
else {
|
|
353
|
-
const h =
|
|
353
|
+
const h = Dt(i.scene);
|
|
354
354
|
h.subscribe(y.notify), C.current = h, y.notify();
|
|
355
355
|
}
|
|
356
356
|
return null;
|
|
@@ -370,18 +370,18 @@ var wt = (e) => oe((t) => ({
|
|
|
370
370
|
...Nt(i.scene, o),
|
|
371
371
|
...It(i.scene, o),
|
|
372
372
|
...Gt(i.scene, a)
|
|
373
|
-
] : i.warnings, [o, a]),
|
|
373
|
+
] : i.warnings, [o, a]), w = p((i) => {
|
|
374
374
|
i.length !== 0 && (V(i), I.current?.(i));
|
|
375
|
-
}, [I]),
|
|
375
|
+
}, [I]), D = p((i) => {
|
|
376
376
|
i.length !== 0 && (V(i), T.current?.(i));
|
|
377
377
|
}, [T]);
|
|
378
378
|
H(() => {
|
|
379
379
|
const i = P.current;
|
|
380
|
-
i && (
|
|
380
|
+
i && (w([...v.errors, ...i.ok ? [] : i.errors]), D([...v.warnings, ...b(i)]), i.ok && m.emit({ kind: "init" }));
|
|
381
381
|
}, [
|
|
382
382
|
m,
|
|
383
|
-
D,
|
|
384
383
|
w,
|
|
384
|
+
D,
|
|
385
385
|
v,
|
|
386
386
|
b
|
|
387
387
|
]), H(() => {
|
|
@@ -393,7 +393,7 @@ var wt = (e) => oe((t) => ({
|
|
|
393
393
|
if (!i) return;
|
|
394
394
|
i.committedSpec && N.current?.(i.committedSpec);
|
|
395
395
|
const h = G(i.result);
|
|
396
|
-
$(L(h)), h &&
|
|
396
|
+
$(L(h)), h && w(h), D(b(i.result)), h || m.emit({ kind: i.hasSpecChange ? "spec" : "data" });
|
|
397
397
|
}, [
|
|
398
398
|
e,
|
|
399
399
|
t,
|
|
@@ -401,28 +401,28 @@ var wt = (e) => oe((t) => ({
|
|
|
401
401
|
u,
|
|
402
402
|
m,
|
|
403
403
|
G,
|
|
404
|
-
D,
|
|
405
404
|
w,
|
|
405
|
+
D,
|
|
406
406
|
L,
|
|
407
407
|
b,
|
|
408
408
|
N
|
|
409
409
|
]);
|
|
410
410
|
const x = p((i) => {
|
|
411
|
-
$((h) => h === null ? h : L(null)),
|
|
411
|
+
$((h) => h === null ? h : L(null)), D(b(i));
|
|
412
412
|
}, [
|
|
413
413
|
L,
|
|
414
|
-
|
|
414
|
+
D,
|
|
415
415
|
b
|
|
416
416
|
]), F = p((i) => {
|
|
417
417
|
i.scene && C.current?.getState().setScene(i.scene), i.result && x(i.result), i.command && m.emit({
|
|
418
418
|
kind: "command",
|
|
419
419
|
command: i.command
|
|
420
|
-
}), i.spec && N.current?.(i.spec), i.errors &&
|
|
420
|
+
}), i.spec && N.current?.(i.spec), i.errors && w([...i.errors]);
|
|
421
421
|
}, [
|
|
422
422
|
x,
|
|
423
423
|
m,
|
|
424
424
|
N,
|
|
425
|
-
|
|
425
|
+
w
|
|
426
426
|
]), E = p((i) => {
|
|
427
427
|
for (const h of i) F(h);
|
|
428
428
|
return i.some((h) => !!h.scene);
|
|
@@ -430,20 +430,20 @@ var wt = (e) => oe((t) => ({
|
|
|
430
430
|
E(u.applyCommand(i, h));
|
|
431
431
|
}, [u, E]), K = p(() => {
|
|
432
432
|
E(u.commit());
|
|
433
|
-
}, [u, E]), q = p(() => E(u.undo()), [u, E]),
|
|
433
|
+
}, [u, E]), q = p(() => E(u.undo()), [u, E]), j = p(() => E(u.redo()), [u, E]), U = k(() => ({
|
|
434
434
|
stack: u.history,
|
|
435
435
|
undo: q,
|
|
436
|
-
redo:
|
|
436
|
+
redo: j
|
|
437
437
|
}), [
|
|
438
438
|
u,
|
|
439
439
|
q,
|
|
440
|
-
|
|
440
|
+
j
|
|
441
441
|
]), te = p(() => C.current?.getState().scene ?? null, []);
|
|
442
442
|
return {
|
|
443
443
|
store: C.current,
|
|
444
444
|
dispatch: _,
|
|
445
445
|
commit: K,
|
|
446
|
-
history:
|
|
446
|
+
history: U,
|
|
447
447
|
subscribe: y.subscribe,
|
|
448
448
|
getScene: te,
|
|
449
449
|
compileBus: m,
|
|
@@ -459,7 +459,7 @@ var wt = (e) => oe((t) => ({
|
|
|
459
459
|
notify: () => e.forEach((t) => t())
|
|
460
460
|
};
|
|
461
461
|
}, qt = ({ data: e, spec: t, plugins: r = [], theme: n, formattingLocale: s, handleRef: o, onSpecChange: a, onError: l, onWarnings: d, colorScheme: g = "light", children: N }) => {
|
|
462
|
-
const I = _t(s, d), [T] = S(() => n), u = T?.colorScheme ?? g, [m] = S(() =>
|
|
462
|
+
const I = _t(s, d), [T] = S(() => n), u = T?.colorScheme ?? g, [m] = S(() => De([...T?.plugins ?? [], ...r].filter(Te))), R = Qe(), [v] = S(() => Be(r)), [P] = S(() => Fe(r)), [y] = S(() => ut()), [C] = S(() => Ne()), L = k(() => Ee({ colorScheme: u }), [u]), { store: G, dispatch: O, commit: $, history: b, subscribe: w, getScene: D, compileBus: x, compileErrors: F, findGeom: E } = Lt({
|
|
463
463
|
spec: t,
|
|
464
464
|
data: e,
|
|
465
465
|
colorScheme: u,
|
|
@@ -473,10 +473,10 @@ var wt = (e) => oe((t) => ({
|
|
|
473
473
|
});
|
|
474
474
|
H(() => {
|
|
475
475
|
if (G)
|
|
476
|
-
return G.subscribe((q,
|
|
477
|
-
if (q.scene.spec ===
|
|
478
|
-
const { selection:
|
|
479
|
-
|
|
476
|
+
return G.subscribe((q, j) => {
|
|
477
|
+
if (q.scene.spec === j.scene.spec) return;
|
|
478
|
+
const { selection: U, setSelection: te } = y.getState();
|
|
479
|
+
U.length !== 0 && te(lt(U, q.scene.spec));
|
|
480
480
|
});
|
|
481
481
|
}, [G, y]);
|
|
482
482
|
const _ = k(() => ({
|
|
@@ -487,8 +487,8 @@ var wt = (e) => oe((t) => ({
|
|
|
487
487
|
commands: _,
|
|
488
488
|
undo: b.undo,
|
|
489
489
|
redo: b.redo,
|
|
490
|
-
subscribe:
|
|
491
|
-
getScene:
|
|
490
|
+
subscribe: w,
|
|
491
|
+
getScene: D,
|
|
492
492
|
formattingLocale: I,
|
|
493
493
|
getSelection: () => y.getState().selection,
|
|
494
494
|
setSelection: (q) => y.getState().setSelection(q),
|
|
@@ -498,8 +498,8 @@ var wt = (e) => oe((t) => ({
|
|
|
498
498
|
}), [
|
|
499
499
|
_,
|
|
500
500
|
b,
|
|
501
|
-
D,
|
|
502
501
|
w,
|
|
502
|
+
D,
|
|
503
503
|
I,
|
|
504
504
|
y,
|
|
505
505
|
P
|
|
@@ -539,7 +539,7 @@ var wt = (e) => oe((t) => ({
|
|
|
539
539
|
value: K,
|
|
540
540
|
children: /* @__PURE__ */ c(Le, {
|
|
541
541
|
value: m,
|
|
542
|
-
children: /* @__PURE__ */ c(
|
|
542
|
+
children: /* @__PURE__ */ c(we, {
|
|
543
543
|
value: P,
|
|
544
544
|
children: /* @__PURE__ */ c(B, {
|
|
545
545
|
shapes: T?.shapes,
|
|
@@ -552,7 +552,7 @@ var wt = (e) => oe((t) => ({
|
|
|
552
552
|
}, _t = (e, t) => {
|
|
553
553
|
const r = z(t);
|
|
554
554
|
return H(() => {
|
|
555
|
-
if (e === void 0 ||
|
|
555
|
+
if (e === void 0 || Ue(e) !== void 0) return;
|
|
556
556
|
const n = [{
|
|
557
557
|
severity: "warning",
|
|
558
558
|
kind: "userInput",
|
|
@@ -747,7 +747,7 @@ var A = (e, t) => {
|
|
|
747
747
|
children: t
|
|
748
748
|
})
|
|
749
749
|
});
|
|
750
|
-
}, Ot = "drqe3u0", Ft = "drqe3u1", Kt = "drqe3u2",
|
|
750
|
+
}, Ot = "drqe3u0", Ft = "drqe3u1", Kt = "drqe3u2", jt = "drqe3u3", M = "drqe3u4", Ut = "drqe3u5", Wt = "drqe3u6", Yt = "drqe3u7", Y = "drqe3u8", zt = "drqe3u9", Vt = "drqe3ua";
|
|
751
751
|
var Xt = "drqe3uc", Qt = "drqe3ud", Jt = "drqe3ue", Zt = "drqe3uf";
|
|
752
752
|
var er = "drqe3uh", tr = "drqe3ui", ve = {
|
|
753
753
|
enabled: "drqe3uk drqe3uj",
|
|
@@ -819,7 +819,7 @@ var er = "drqe3uh", tr = "drqe3ui", ve = {
|
|
|
819
819
|
className: er,
|
|
820
820
|
children: [
|
|
821
821
|
/* @__PURE__ */ c("th", {
|
|
822
|
-
className:
|
|
822
|
+
className: jt,
|
|
823
823
|
children: "stage"
|
|
824
824
|
}),
|
|
825
825
|
/* @__PURE__ */ c("th", {
|
|
@@ -849,7 +849,7 @@ var er = "drqe3uh", tr = "drqe3ui", ve = {
|
|
|
849
849
|
className: Xt,
|
|
850
850
|
children: [
|
|
851
851
|
/* @__PURE__ */ f("td", {
|
|
852
|
-
className:
|
|
852
|
+
className: Ut,
|
|
853
853
|
children: [
|
|
854
854
|
/* @__PURE__ */ c("span", {
|
|
855
855
|
className: Ge[o],
|
|
@@ -963,18 +963,18 @@ var er = "drqe3uh", tr = "drqe3ui", ve = {
|
|
|
963
963
|
return re(e, (t) => t.boundary);
|
|
964
964
|
};
|
|
965
965
|
export {
|
|
966
|
-
|
|
967
|
-
|
|
966
|
+
Br as CanvasTextMeasurer,
|
|
967
|
+
Cr as DefaultFooter,
|
|
968
968
|
kt as DefaultGeomCircle,
|
|
969
969
|
Ht as DefaultGeomLine,
|
|
970
970
|
xt as DefaultGeomPath,
|
|
971
971
|
$t as DefaultGeomRect,
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
972
|
+
Zr as DefaultGrid,
|
|
973
|
+
Er as DefaultHeader,
|
|
974
|
+
Pr as DefaultSwatch,
|
|
975
975
|
Qr as DefaultTooltip,
|
|
976
976
|
Tn as DevToolsPanel,
|
|
977
|
-
|
|
977
|
+
Wr as GRAPH_MODES,
|
|
978
978
|
fn as GeomCircle,
|
|
979
979
|
vn as GeomLine,
|
|
980
980
|
Rr as GeomOverpaint,
|
|
@@ -984,54 +984,54 @@ export {
|
|
|
984
984
|
ue as GraphErrorPanel,
|
|
985
985
|
qt as GraphProvider,
|
|
986
986
|
_r as GraphRenderer,
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
987
|
+
on as GraphyBadge,
|
|
988
|
+
yr as HoverProvider,
|
|
989
|
+
$r as IntlProvider,
|
|
990
|
+
br as IntroFade,
|
|
991
|
+
tn as IntroWipeClip,
|
|
992
992
|
Ir as TextMeasurerProvider,
|
|
993
|
-
|
|
993
|
+
Vr as ThemeProvider,
|
|
994
994
|
En as UnitBoxSvg,
|
|
995
995
|
bn as UnitSpaceSvg,
|
|
996
|
-
|
|
996
|
+
sn as buildDotsEditOutlineShapes,
|
|
997
997
|
gn as createGraphyKit,
|
|
998
|
-
|
|
999
|
-
|
|
998
|
+
qr as darkTheme,
|
|
999
|
+
Sr as defineGeomRenderer,
|
|
1000
1000
|
Lr as getBuiltInEditOutlineShapes,
|
|
1001
|
-
|
|
1001
|
+
rn as lightTheme,
|
|
1002
1002
|
kr as lightenCss,
|
|
1003
1003
|
fr as projectPointCartesian,
|
|
1004
1004
|
lt as pruneSelection,
|
|
1005
1005
|
A as readPositionPixels,
|
|
1006
1006
|
pn as readRectPixels,
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1007
|
+
gr as resolveGraphyBadgeVariant,
|
|
1008
|
+
wr as resolvePathStroke,
|
|
1009
|
+
Dr as scalePointToPanel,
|
|
1010
|
+
mr as stampAxisEditTarget,
|
|
1011
|
+
jr as stampGridEditTarget,
|
|
1012
1012
|
Tr as stampLegendEditTarget,
|
|
1013
|
-
|
|
1014
|
-
|
|
1013
|
+
vr as useElementScreenRect,
|
|
1014
|
+
Kr as useFormattingLocale,
|
|
1015
1015
|
Nr as useGeomHitTest,
|
|
1016
|
-
|
|
1016
|
+
zr as useGeomHover,
|
|
1017
1017
|
qe as useGeomPanelSize,
|
|
1018
|
-
|
|
1018
|
+
pr as useGeomReaderTree,
|
|
1019
1019
|
Gr as useGeomStyleReader,
|
|
1020
|
-
|
|
1021
|
-
|
|
1020
|
+
Xr as useGraphCommands,
|
|
1021
|
+
Fr as useGraphHandle,
|
|
1022
1022
|
Rn as useGraphHistory,
|
|
1023
1023
|
Gn as useGraphHistoryShortcuts,
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1024
|
+
Hr as useGraphLocale,
|
|
1025
|
+
Or as useGraphSelection,
|
|
1026
|
+
nn as useGuidesTakePress,
|
|
1027
|
+
Jr as useHandleScene,
|
|
1028
|
+
Mr as useHoverState,
|
|
1029
|
+
Ar as usePaintDefs,
|
|
1030
|
+
en as useResolvedStyle,
|
|
1031
|
+
Ur as useSceneSelector,
|
|
1032
|
+
Yr as useStyleReaderTree,
|
|
1033
|
+
hr as useStyleResolver,
|
|
1034
1034
|
Nn as useTargetBoundary,
|
|
1035
1035
|
ur as useTextMeasurer,
|
|
1036
|
-
|
|
1036
|
+
xr as vars
|
|
1037
1037
|
};
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"visualization",
|
|
12
12
|
"renderer"
|
|
13
13
|
],
|
|
14
|
-
"version": "1.9.0-beta.
|
|
14
|
+
"version": "1.9.0-beta.1793705972988",
|
|
15
15
|
"type": "module",
|
|
16
16
|
"sideEffects": [
|
|
17
17
|
"**/*.css.ts",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"react-colorful": "^5.6.1",
|
|
51
51
|
"react-intl": "^8.1.3",
|
|
52
52
|
"zustand": "^5.0.12",
|
|
53
|
-
"@graphysdk/viz-engine": "1.9.0-beta.
|
|
53
|
+
"@graphysdk/viz-engine": "1.9.0-beta.1793705972988"
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
56
|
"@tiptap/core": "^3.0.0",
|
|
@@ -150,10 +150,10 @@
|
|
|
150
150
|
"vite-plugin-dts": "^4.5.4",
|
|
151
151
|
"vite-plugin-lib-inject-css": "^2.2.2",
|
|
152
152
|
"vitest": "^4.1.11",
|
|
153
|
-
"@graphytools/eslint-config": "0.0.1",
|
|
154
153
|
"@graphytools/eslint-plugin-graphy": "1.0.0",
|
|
155
154
|
"@graphytools/typescript-config": "0.0.1",
|
|
156
|
-
"@graphytools/vitest-config": "1.0.0"
|
|
155
|
+
"@graphytools/vitest-config": "1.0.0",
|
|
156
|
+
"@graphytools/eslint-config": "0.0.1"
|
|
157
157
|
},
|
|
158
158
|
"publishConfig": {
|
|
159
159
|
"access": "public"
|