@graphysdk/react-renderer 1.9.0-beta.1795707432298 → 1.9.0-beta.1795708068076
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/ar-DRJfF3kx.cjs +1 -0
- package/dist/ar-DhjH4ZbY.js +883 -0
- package/dist/editable.cjs +1 -1
- package/dist/editable.d.ts +3 -2
- package/dist/editable.mjs +3552 -6165
- package/dist/en-gb-Bj-PFdWU.js +886 -0
- package/dist/en-gb-wV0MmZLj.cjs +1 -0
- package/dist/en-us-CNHaFu8A.js +11 -0
- package/dist/en-us-CfL-X7mL.cjs +1 -0
- package/dist/{history-chords-DsyzK0E1.js → history-chords-Buxa3waC.js} +92 -91
- package/dist/{history-chords-DaTCFopa.cjs → history-chords-DDZ_6FBc.cjs} +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +152 -152
- package/dist/pt-pt-1KAFquYm.js +884 -0
- package/dist/pt-pt-Dl-e1WyP.cjs +1 -0
- package/dist/{rich-text-editor-module-Gwyekzd_.js → rich-text-editor-module-BjO3665Z.js} +8 -8
- package/dist/{rich-text-editor-module-E-39Qvp9.cjs → rich-text-editor-module-DiUIhnGd.cjs} +1 -1
- package/dist/{start-arrow-button-CqFgBJ0s.js → start-arrow-button-CGhJeFr2.js} +79 -79
- package/dist/{start-arrow-button-DlSXTrKp.cjs → start-arrow-button-DjGnXDVD.cjs} +1 -1
- package/package.json +4 -4
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { AUTO_COLOR as ie, PANEL_FRACTION_BOUNDS as Tr, RemoveAnnotationCommand as
|
|
3
|
-
import { createContext as K, useCallback as
|
|
1
|
+
import { Bt as lr, Er as cr, Fn as dr, Fr as A, Gt as Fe, Hn as ur, Ht as E, In as hr, J as W, K as vr, Or as De, Qt as L, Rn as pr, S as mr, Sr as fr, Tt as gr, Un as re, Vt as R, f as br, ft as Cr, g as wr, jn as yr, pt as Ee, t as Nr, zn as xr, zt as ye } from "./history-chords-Buxa3waC.js";
|
|
2
|
+
import { AUTO_COLOR as ie, PANEL_FRACTION_BOUNDS as Tr, RemoveAnnotationCommand as Le, SequenceCommand as Sr, UpdateAnnotationCommand as Z, alignUnitFractions as _r, projectAnchorToPanel as Ir, projectRegionToPanel as Pr, toFontSpec as kr } from "@graphysdk/viz-engine";
|
|
3
|
+
import { createContext as K, useCallback as U, useContext as M, useEffect as pe, useId as fe, useLayoutEffect as Ar, useMemo as Y, useRef as Ne, useState as S } from "react";
|
|
4
4
|
import { Fragment as Oe, jsx as t, jsxs as b } from "react/jsx-runtime";
|
|
5
5
|
import { clamp as Be } from "lodash-es";
|
|
6
6
|
import { assignInlineVars as He } from "@vanilla-extract/dynamic";
|
|
@@ -16,7 +16,7 @@ import { Select as I } from "@base-ui/react/select";
|
|
|
16
16
|
import { Slider as ee } from "@base-ui/react/slider";
|
|
17
17
|
import { Switch as xe } from "@base-ui/react/switch";
|
|
18
18
|
import { Input as Fr } from "@base-ui/react/input";
|
|
19
|
-
import { Menu as
|
|
19
|
+
import { Menu as G } from "@base-ui/react/menu";
|
|
20
20
|
import { Toolbar as q } from "@base-ui/react/toolbar";
|
|
21
21
|
import './start-arrow-button.css';var ge = (e) => /* @__PURE__ */ t(W, {
|
|
22
22
|
...e,
|
|
@@ -48,8 +48,8 @@ import './start-arrow-button.css';var ge = (e) => /* @__PURE__ */ t(W, {
|
|
|
48
48
|
...c !== void 0 && { "aria-labelledby": c }
|
|
49
49
|
};
|
|
50
50
|
}, X = "_18ja6qr0", Dr = ({ children: e }) => {
|
|
51
|
-
const { themeValues: r } =
|
|
52
|
-
return /* @__PURE__ */ t(
|
|
51
|
+
const { themeValues: r } = Fe();
|
|
52
|
+
return /* @__PURE__ */ t(E, {
|
|
53
53
|
style: Y(() => He({
|
|
54
54
|
[re.fontFamily]: r.fontFamily,
|
|
55
55
|
[re.textScale]: r.textScale
|
|
@@ -57,11 +57,11 @@ import './start-arrow-button.css';var ge = (e) => /* @__PURE__ */ t(W, {
|
|
|
57
57
|
children: e
|
|
58
58
|
});
|
|
59
59
|
};
|
|
60
|
-
var
|
|
60
|
+
var Er = "srewh00", Lr = "srewh01", Or = {
|
|
61
61
|
pointer: null,
|
|
62
62
|
focus: null,
|
|
63
63
|
last: "pointer"
|
|
64
|
-
},
|
|
64
|
+
}, Ue = K({
|
|
65
65
|
hovered: !1,
|
|
66
66
|
dismissed: !1,
|
|
67
67
|
reachedTooltipId: null,
|
|
@@ -72,18 +72,18 @@ var Lr = "srewh00", Er = "srewh01", Or = {
|
|
|
72
72
|
dismiss: () => {
|
|
73
73
|
}
|
|
74
74
|
}), Hn = ({ className: e, children: r }) => {
|
|
75
|
-
const [a, n] = S(!1), [s, i] = S(!1), [u, o] = S(Or), c =
|
|
75
|
+
const [a, n] = S(!1), [s, i] = S(!1), [u, o] = S(Or), c = U((p, f) => {
|
|
76
76
|
i(!1), o((g) => ({
|
|
77
77
|
...g,
|
|
78
78
|
[f]: p,
|
|
79
79
|
last: f
|
|
80
80
|
}));
|
|
81
|
-
}, []), h =
|
|
81
|
+
}, []), h = U((p, f) => {
|
|
82
82
|
o((g) => g[f] === p ? {
|
|
83
83
|
...g,
|
|
84
84
|
[f]: null
|
|
85
85
|
} : g);
|
|
86
|
-
}, []), d =
|
|
86
|
+
}, []), d = U(() => i(!0), []), l = Br(u), v = Y(() => ({
|
|
87
87
|
hovered: a,
|
|
88
88
|
dismissed: s,
|
|
89
89
|
reachedTooltipId: l,
|
|
@@ -104,13 +104,13 @@ var Lr = "srewh00", Er = "srewh01", Or = {
|
|
|
104
104
|
p.pointerType !== "touch" && (n(!0), i(!1));
|
|
105
105
|
},
|
|
106
106
|
onPointerLeave: () => n(!1),
|
|
107
|
-
children: /* @__PURE__ */ t(
|
|
107
|
+
children: /* @__PURE__ */ t(Ue.Provider, {
|
|
108
108
|
value: v,
|
|
109
109
|
children: r
|
|
110
110
|
})
|
|
111
111
|
});
|
|
112
112
|
}, k = ({ label: e, checked: r = !1, side: a, delay: n, nameTrigger: s = !0, suppressed: i = !1, children: u }) => {
|
|
113
|
-
const { hovered: o, dismissed: c, reachedTooltipId: h, reach: d, release: l, dismiss: v } = M(
|
|
113
|
+
const { hovered: o, dismissed: c, reachedTooltipId: h, reach: d, release: l, dismiss: v } = M(Ue), m = fe(), [p, f] = S(!1), g = o ? !c && (h === m || r && h === null) : p;
|
|
114
114
|
pe(() => () => {
|
|
115
115
|
l(m, "pointer"), l(m, "focus");
|
|
116
116
|
}, [m, l]);
|
|
@@ -135,9 +135,9 @@ var Lr = "srewh00", Er = "srewh01", Or = {
|
|
|
135
135
|
children: /* @__PURE__ */ t(Dr, { children: /* @__PURE__ */ t(z.Positioner, {
|
|
136
136
|
side: a,
|
|
137
137
|
sideOffset: 6,
|
|
138
|
-
className:
|
|
138
|
+
className: Lr,
|
|
139
139
|
children: /* @__PURE__ */ t(z.Popup, {
|
|
140
|
-
className:
|
|
140
|
+
className: Er,
|
|
141
141
|
children: e
|
|
142
142
|
})
|
|
143
143
|
}) })
|
|
@@ -206,21 +206,21 @@ var jr = {
|
|
|
206
206
|
focus: "color-mix(in srgb, transparent, var(--graphy-editor-text, var(--graphy-editor-default-text)) 55.00000000000001%)",
|
|
207
207
|
focusWidth: "2px",
|
|
208
208
|
shadow: "var(--graphy-editor-default-shadow)"
|
|
209
|
-
},
|
|
210
|
-
var
|
|
209
|
+
}, Ur = "linear-gradient(to top right, transparent calc(50% - 1px), var(--graphy-alert) calc(50% - 1px), var(--graphy-alert) calc(50% + 1px), transparent calc(50% + 1px))", Gr = "linear-gradient(135deg, var(--graphy-white) 50%, var(--graphy-black) 50%) border-box";
|
|
210
|
+
var Ge = "_14ty2ng0", Te = "_14ty2ng1", Wr = "_14ty2ng2", Kr = "_14ty2ng3", We = "_14ty2ng4", $n = "_14ty2ng5", jn = "_14ty2ng6", Se = "transparent", Ke = (e) => {
|
|
211
211
|
const r = `1px solid ${Vr.borderStrong}`;
|
|
212
212
|
return e === "transparent" ? {
|
|
213
|
-
background:
|
|
213
|
+
background: Ur,
|
|
214
214
|
border: r
|
|
215
215
|
} : e === ie ? {
|
|
216
|
-
background:
|
|
216
|
+
background: Gr,
|
|
217
217
|
border: r
|
|
218
218
|
} : {
|
|
219
219
|
background: e,
|
|
220
220
|
border: r
|
|
221
221
|
};
|
|
222
222
|
}, Yr = ({ title: e, colors: r, value: a, onChange: n, trailing: s, clearable: i = !1, names: u, side: o, delay: c, disabled: h, id: d, ariaLabel: l, ariaLabelledBy: v }) => {
|
|
223
|
-
const m =
|
|
223
|
+
const m = L(), p = _({
|
|
224
224
|
id: d,
|
|
225
225
|
ariaLabel: l,
|
|
226
226
|
ariaLabelledBy: v
|
|
@@ -246,7 +246,7 @@ var Ue = "_14ty2ng0", Te = "_14ty2ng1", Wr = "_14ty2ng2", Kr = "_14ty2ng3", We =
|
|
|
246
246
|
}, C);
|
|
247
247
|
};
|
|
248
248
|
return /* @__PURE__ */ b("div", {
|
|
249
|
-
className:
|
|
249
|
+
className: Ge,
|
|
250
250
|
children: [e !== void 0 && /* @__PURE__ */ t("div", {
|
|
251
251
|
className: "_14ty2ng1",
|
|
252
252
|
children: e
|
|
@@ -266,7 +266,7 @@ var Ue = "_14ty2ng0", Te = "_14ty2ng1", Wr = "_14ty2ng2", Kr = "_14ty2ng3", We =
|
|
|
266
266
|
})]
|
|
267
267
|
})]
|
|
268
268
|
});
|
|
269
|
-
}, Ye = (e, r) => r !== null && e.toLowerCase() === r.toLowerCase(), qr = "data-graphy-chart-chrome", zn = "data-graphy-keyboard-input", Xr = "data-graphy-chart-menu", Vn = { [Xr]: "" }, ae = (e) => ({ [qr]: e }), Jr = (e, r) => e instanceof Element && e.closest(`[data-graphy-chart-chrome="${CSS.escape(r)}"]`) !== null,
|
|
269
|
+
}, Ye = (e, r) => r !== null && e.toLowerCase() === r.toLowerCase(), qr = "data-graphy-chart-chrome", zn = "data-graphy-keyboard-input", Xr = "data-graphy-chart-menu", Vn = { [Xr]: "" }, ae = (e) => ({ [qr]: e }), Jr = (e, r) => e instanceof Element && e.closest(`[data-graphy-chart-chrome="${CSS.escape(r)}"]`) !== null, Un = (e) => e instanceof Element && e.closest("[data-graphy-chart-menu]") !== null, Gn = (e) => e instanceof Element && e.closest("[data-graphy-chart-chrome]") !== null, Wn = (e, r, a) => e instanceof Node && (r.contains(e) || Jr(e, a)), Qr = "cml7ha0", qe = K(null), Kn = ({ children: e }) => {
|
|
270
270
|
const { chartId: r } = A(), [a] = S(R), [n, s] = S(null);
|
|
271
271
|
return a === null ? null : /* @__PURE__ */ b(Oe, { children: [$e(/* @__PURE__ */ t("div", {
|
|
272
272
|
ref: s,
|
|
@@ -281,9 +281,9 @@ var Ue = "_14ty2ng0", Te = "_14ty2ng1", Wr = "_14ty2ng2", Kr = "_14ty2ng3", We =
|
|
|
281
281
|
align: "shift",
|
|
282
282
|
fallbackAxisSide: "end"
|
|
283
283
|
}, la = ({ value: e, onChange: r, onCommit: a, popupAttributes: n, variant: s = "default" }) => {
|
|
284
|
-
const i =
|
|
284
|
+
const i = L(), u = Xe(), [o, c] = S(!1), h = (v) => {
|
|
285
285
|
c(v), v || a?.();
|
|
286
|
-
}, d = e !== null &&
|
|
286
|
+
}, d = e !== null && hr(e) ? e : "#000000", l = dr(d) ? d.toUpperCase() : "#000000";
|
|
287
287
|
return /* @__PURE__ */ b(x.Root, {
|
|
288
288
|
open: o,
|
|
289
289
|
onOpenChange: h,
|
|
@@ -293,7 +293,7 @@ var Ue = "_14ty2ng0", Te = "_14ty2ng1", Wr = "_14ty2ng2", Kr = "_14ty2ng3", We =
|
|
|
293
293
|
"aria-label": i("graph.colorDropdown.pickCustom"),
|
|
294
294
|
children: /* @__PURE__ */ t("span", { className: ra })
|
|
295
295
|
}) : /* @__PURE__ */ b("div", {
|
|
296
|
-
className:
|
|
296
|
+
className: Ge,
|
|
297
297
|
children: [/* @__PURE__ */ t("div", {
|
|
298
298
|
className: Te,
|
|
299
299
|
children: i("graph.colorDropdown.custom")
|
|
@@ -312,7 +312,7 @@ var Ue = "_14ty2ng0", Te = "_14ty2ng1", Wr = "_14ty2ng2", Kr = "_14ty2ng3", We =
|
|
|
312
312
|
}), /* @__PURE__ */ t(x.Portal, {
|
|
313
313
|
container: u ?? R(),
|
|
314
314
|
className: X,
|
|
315
|
-
children: /* @__PURE__ */ t(
|
|
315
|
+
children: /* @__PURE__ */ t(E, { children: /* @__PURE__ */ t(x.Positioner, {
|
|
316
316
|
side: "right",
|
|
317
317
|
align: "start",
|
|
318
318
|
sideOffset: 18,
|
|
@@ -580,7 +580,7 @@ var Ta = 6, Sa = ({ options: e, value: r, onChange: a, onCommit: n, columns: s,
|
|
|
580
580
|
children: /* @__PURE__ */ t("path", { d: "M20 6 9 17l-5-5" })
|
|
581
581
|
})
|
|
582
582
|
}), Pa = "_1g5x15w0 uz3g760", ka = "_1g5x15w1", Aa = "_1g5x15w2", Ie = "_1g5x15w3", Ra = "_1g5x15w4", Ma = "_1g5x15w5", Fa = "_1g5x15w6", Da = "_1g5x15w7";
|
|
583
|
-
var
|
|
583
|
+
var Ea = ({ options: e, value: r, onChange: a, placeholder: n, disabled: s, hasError: i, ariaLabel: u, ariaLabelledBy: o, id: c }) => {
|
|
584
584
|
const h = _({
|
|
585
585
|
id: c,
|
|
586
586
|
ariaLabel: u,
|
|
@@ -600,7 +600,7 @@ var La = ({ options: e, value: r, onChange: a, placeholder: n, disabled: s, hasE
|
|
|
600
600
|
...h,
|
|
601
601
|
children: [/* @__PURE__ */ t(I.Value, {
|
|
602
602
|
className: ka,
|
|
603
|
-
children: (l) =>
|
|
603
|
+
children: (l) => La(e, l, n)
|
|
604
604
|
}), /* @__PURE__ */ t(I.Icon, {
|
|
605
605
|
className: Ie,
|
|
606
606
|
children: /* @__PURE__ */ t(ge, { size: "sm" })
|
|
@@ -608,7 +608,7 @@ var La = ({ options: e, value: r, onChange: a, placeholder: n, disabled: s, hasE
|
|
|
608
608
|
}), /* @__PURE__ */ t(I.Portal, {
|
|
609
609
|
container: d ?? R(),
|
|
610
610
|
className: X,
|
|
611
|
-
children: /* @__PURE__ */ t(
|
|
611
|
+
children: /* @__PURE__ */ t(E, { children: /* @__PURE__ */ t(I.Positioner, {
|
|
612
612
|
className: Ra,
|
|
613
613
|
sideOffset: 4,
|
|
614
614
|
alignItemWithTrigger: !1,
|
|
@@ -637,15 +637,15 @@ var La = ({ options: e, value: r, onChange: a, placeholder: n, disabled: s, hasE
|
|
|
637
637
|
}) })
|
|
638
638
|
})]
|
|
639
639
|
});
|
|
640
|
-
},
|
|
640
|
+
}, La = (e, r, a) => r === null ? /* @__PURE__ */ t("span", {
|
|
641
641
|
className: Aa,
|
|
642
642
|
children: a
|
|
643
643
|
}) : Oa(e, r), Oa = (e, r) => e.find((a) => a.value === r)?.label ?? r, Ba = "vod76w0", Ha = "vod76w1", $a = "vod76w2", ja = "vod76w3", za = "vod76w4", Va = "vod76w5";
|
|
644
|
-
var
|
|
644
|
+
var Ua = ({ value: e, onChange: r, onCommit: a, min: n, max: s, step: i, suffix: u, formatValue: o, showValue: c = !0, disabled: h, ariaLabel: d, ariaLabelledBy: l }) => {
|
|
645
645
|
const v = _({
|
|
646
646
|
ariaLabel: d,
|
|
647
647
|
ariaLabelledBy: l
|
|
648
|
-
}, !1), m =
|
|
648
|
+
}, !1), m = Ga(e, u, o), { commitUnlessHeldKey: p, gestureHandlers: f } = ue(a);
|
|
649
649
|
return /* @__PURE__ */ b("div", {
|
|
650
650
|
className: Ba,
|
|
651
651
|
children: [/* @__PURE__ */ t(ee.Root, {
|
|
@@ -675,7 +675,7 @@ var Ga = ({ value: e, onChange: r, onCommit: a, min: n, max: s, step: i, suffix:
|
|
|
675
675
|
children: m
|
|
676
676
|
})]
|
|
677
677
|
});
|
|
678
|
-
},
|
|
678
|
+
}, Ga = (e, r, a) => a !== void 0 ? a(e) : `${e}${r ?? ""}`, Wa = (e) => /* @__PURE__ */ t(W, {
|
|
679
679
|
...e,
|
|
680
680
|
children: /* @__PURE__ */ b("g", {
|
|
681
681
|
stroke: "currentColor",
|
|
@@ -690,7 +690,7 @@ var Qa = 1e-9, Za = (e) => {
|
|
|
690
690
|
id: d,
|
|
691
691
|
ariaLabel: c,
|
|
692
692
|
ariaLabelledBy: h
|
|
693
|
-
}), g =
|
|
693
|
+
}), g = L(), C = i ?? g("editor.accessibility.decrease"), w = u ?? g("editor.accessibility.increase"), [y, T] = S(r), [O, ne] = S(r);
|
|
694
694
|
r !== O && (ne(r), T(r));
|
|
695
695
|
const J = r === null ? void 0 : p(r), Q = r === null ? void 0 : m(r), B = (N) => {
|
|
696
696
|
N !== void 0 && (T(N), a(N));
|
|
@@ -709,7 +709,7 @@ var Qa = 1e-9, Za = (e) => {
|
|
|
709
709
|
children: [
|
|
710
710
|
/* @__PURE__ */ t(Pe, {
|
|
711
711
|
label: C,
|
|
712
|
-
icon: /* @__PURE__ */ t(
|
|
712
|
+
icon: /* @__PURE__ */ t(vr, {}),
|
|
713
713
|
disabled: o === !0 || J === void 0,
|
|
714
714
|
onPress: () => B(J)
|
|
715
715
|
}),
|
|
@@ -874,13 +874,13 @@ var ct = ({ options: e, value: r, onChange: a, onCommit: n, itemLayout: s = "inl
|
|
|
874
874
|
}, ut = {
|
|
875
875
|
ToggleGroup: ct,
|
|
876
876
|
Switch: tt,
|
|
877
|
-
Slider:
|
|
877
|
+
Slider: Ua,
|
|
878
878
|
RadioGrid: Sa,
|
|
879
879
|
Button: zr,
|
|
880
880
|
TextField: st,
|
|
881
881
|
NumberField: ya,
|
|
882
882
|
Stepper: Za,
|
|
883
|
-
Select:
|
|
883
|
+
Select: Ea,
|
|
884
884
|
ColorSwatches: Yr,
|
|
885
885
|
CustomColor: la,
|
|
886
886
|
DateField: ua,
|
|
@@ -958,7 +958,7 @@ var ct = ({ options: e, value: r, onChange: a, onCommit: n, itemLayout: s = "inl
|
|
|
958
958
|
width: V(a.width, r.width),
|
|
959
959
|
height: V(a.height, r.height)
|
|
960
960
|
};
|
|
961
|
-
}, mt = K((e) => new
|
|
961
|
+
}, mt = K((e) => new Le({ id: e })), ft = (e, r, a, n) => {
|
|
962
962
|
const s = (o) => o.anchorType === "annotation" && o.ref === e, i = [];
|
|
963
963
|
for (const o of r.textAnnotations) {
|
|
964
964
|
if (!s(o.at)) continue;
|
|
@@ -1011,24 +1011,24 @@ var ct = ({ options: e, value: r, onChange: a, onCommit: n, itemLayout: s = "inl
|
|
|
1011
1011
|
patch: { region: Ae(c.region, n) }
|
|
1012
1012
|
}));
|
|
1013
1013
|
}
|
|
1014
|
-
const u = new
|
|
1014
|
+
const u = new Le({ id: e });
|
|
1015
1015
|
return i.length === 0 ? u : new Sr({ commands: [...i, u] }, { description: u.metadata.description });
|
|
1016
1016
|
}, gt = (e) => {
|
|
1017
|
-
const r =
|
|
1018
|
-
spec:
|
|
1017
|
+
const r = fr({
|
|
1018
|
+
spec: De((a) => a.spec.annotations),
|
|
1019
1019
|
scene: mr(e),
|
|
1020
1020
|
panelRect: e
|
|
1021
1021
|
});
|
|
1022
|
-
return
|
|
1022
|
+
return U((a) => {
|
|
1023
1023
|
const n = r.current;
|
|
1024
1024
|
return ft(a, n.spec, n.scene, n.panelRect);
|
|
1025
1025
|
}, [r]);
|
|
1026
1026
|
}, eo = (e) => {
|
|
1027
1027
|
const { commands: r } = A(), a = gt(e);
|
|
1028
|
-
return
|
|
1028
|
+
return U((n) => r.dispatch(a(n)), [r, a]);
|
|
1029
1029
|
}, ro = () => M(mt), bt = () => {
|
|
1030
|
-
const e =
|
|
1031
|
-
return
|
|
1030
|
+
const e = Ee(), { selectionStore: r } = A();
|
|
1031
|
+
return U((a, n) => {
|
|
1032
1032
|
r.getState().clearSelection();
|
|
1033
1033
|
const s = e.getState();
|
|
1034
1034
|
s.setPlotMenu(null), s.claimInteraction({
|
|
@@ -1039,35 +1039,35 @@ var ct = ({ options: e, value: r, onChange: a, onCommit: n, itemLayout: s = "inl
|
|
|
1039
1039
|
});
|
|
1040
1040
|
}, [e, r]);
|
|
1041
1041
|
}, Ct = 2, ao = () => {
|
|
1042
|
-
const e =
|
|
1042
|
+
const e = L(), r = cr(), a = yr();
|
|
1043
1043
|
return ({ annotationId: n, anchorX: s, align: i, panelWidth: u, minWidth: o, paddingInline: c, pickedFontSize: h = null, pickedFont: d = null }) => {
|
|
1044
1044
|
if (u <= 0) return o;
|
|
1045
|
-
const l = r.annotation.text(n).resolve(), v = r.graph().get("textScale"), m = h === null ? l.fontSize : h * v, p =
|
|
1045
|
+
const l = r.annotation.text(n).resolve(), v = r.graph().get("textScale"), m = h === null ? l.fontSize : h * v, p = lr(d) ?? l.fontFamily, f = (a.measureText(e("graph.annotations.text.placeholder"), kr({
|
|
1046
1046
|
...l,
|
|
1047
1047
|
fontSize: m,
|
|
1048
1048
|
fontFamily: p
|
|
1049
|
-
},
|
|
1049
|
+
}, xr)).width + (c ?? l.paddingInline) * 2 + Ct) / u;
|
|
1050
1050
|
return Math.max(o, Math.min(f, wt(s, _r(i).x)));
|
|
1051
1051
|
};
|
|
1052
1052
|
}, wt = (e, r) => {
|
|
1053
1053
|
const a = r > 0 ? e / r : Number.POSITIVE_INFINITY, n = r < 1 ? (1 - e) / (1 - r) : Number.POSITIVE_INFINITY;
|
|
1054
1054
|
return Math.min(a, n);
|
|
1055
1055
|
}, yt = () => {
|
|
1056
|
-
const e =
|
|
1056
|
+
const e = L();
|
|
1057
1057
|
return Y(() => ({
|
|
1058
1058
|
...Object.fromEntries(rr.map((r) => [r.color, e(`editor.canvasColors.${r.phrase}`)])),
|
|
1059
1059
|
[re.canvasDefault]: e("editor.canvasColors.canvasDefault"),
|
|
1060
1060
|
[re.canvasInverse]: e("editor.canvasColors.canvasInverse")
|
|
1061
1061
|
}), [e]);
|
|
1062
1062
|
}, Nt = () => {
|
|
1063
|
-
const e =
|
|
1063
|
+
const e = De((r) => r.scales.color);
|
|
1064
1064
|
return Y(() => !e || e.kind !== "visual" ? [] : [...new Set(e.palette)], [e]);
|
|
1065
1065
|
}, xt = (e) => e !== "canvasDefault" && e !== "canvasInverse", rr = [
|
|
1066
1066
|
{
|
|
1067
1067
|
color: "#000000",
|
|
1068
1068
|
phrase: "canvasBlack"
|
|
1069
1069
|
},
|
|
1070
|
-
...
|
|
1070
|
+
...ur.filter(xt).map((e) => ({
|
|
1071
1071
|
color: re[e],
|
|
1072
1072
|
phrase: e
|
|
1073
1073
|
})),
|
|
@@ -1104,7 +1104,7 @@ var _t = "d0bl03", It = "d0bl04", te = (e) => /* @__PURE__ */ t(k, {
|
|
|
1104
1104
|
...e,
|
|
1105
1105
|
side: "bottom"
|
|
1106
1106
|
}), Pt = 0.01, oo = (e) => ar.some((r) => r.toLowerCase() === e.toLowerCase()), kt = ({ color: e, onChange: r, open: a, onOpenChange: n, children: s, label: i, popupAttributes: u, opacity: o, onOpacityChange: c, hasTransparentOption: h = !1, hasAutomaticOption: d = !1, showTooltip: l = !1 }) => {
|
|
1107
|
-
const v =
|
|
1107
|
+
const v = L(), { ColorSwatches: m, Slider: p } = er(), f = yt(), g = Nt(), C = [
|
|
1108
1108
|
...d ? [ie] : [],
|
|
1109
1109
|
...h ? [Se] : [],
|
|
1110
1110
|
...ar
|
|
@@ -1138,7 +1138,7 @@ var _t = "d0bl03", It = "d0bl04", te = (e) => /* @__PURE__ */ t(k, {
|
|
|
1138
1138
|
}) : B, /* @__PURE__ */ t(x.Portal, {
|
|
1139
1139
|
container: R(),
|
|
1140
1140
|
className: X,
|
|
1141
|
-
children: /* @__PURE__ */ t(
|
|
1141
|
+
children: /* @__PURE__ */ t(E, { children: /* @__PURE__ */ t(x.Positioner, {
|
|
1142
1142
|
sideOffset: 6,
|
|
1143
1143
|
align: "start",
|
|
1144
1144
|
className: _t,
|
|
@@ -1184,37 +1184,37 @@ var _t = "d0bl03", It = "d0bl04", te = (e) => /* @__PURE__ */ t(k, {
|
|
|
1184
1184
|
})]
|
|
1185
1185
|
});
|
|
1186
1186
|
}, At = ({ value: e, onChange: r, popupAttributes: a }) => {
|
|
1187
|
-
const { CustomColor: n } = er(), { themeValues: s } =
|
|
1187
|
+
const { CustomColor: n } = er(), { themeValues: s } = Fe();
|
|
1188
1188
|
return /* @__PURE__ */ t(n, {
|
|
1189
1189
|
variant: "chip",
|
|
1190
|
-
value: e === null || e === ie ? null :
|
|
1190
|
+
value: e === null || e === ie ? null : wr(e, s),
|
|
1191
1191
|
onChange: r,
|
|
1192
1192
|
popupAttributes: a
|
|
1193
1193
|
});
|
|
1194
|
-
}, Re = (e, r) => e.some((a) => Ye(a, r)), Rt = "l9kff0", Mt = "l9kff1", Ft = "l9kff2", Dt = "xn24px0",
|
|
1194
|
+
}, Re = (e, r) => e.some((a) => Ye(a, r)), Rt = "l9kff0", Mt = "l9kff1", Ft = "l9kff2", Dt = "xn24px0", Et = "xn24px1", Lt = "xn24px2", Ot = ({ children: e, popupAttributes: r }) => /* @__PURE__ */ t(G.Portal, {
|
|
1195
1195
|
container: R(),
|
|
1196
1196
|
className: X,
|
|
1197
|
-
children: /* @__PURE__ */ t(
|
|
1197
|
+
children: /* @__PURE__ */ t(E, { children: /* @__PURE__ */ t(G.Positioner, {
|
|
1198
1198
|
side: "bottom",
|
|
1199
1199
|
align: "start",
|
|
1200
1200
|
sideOffset: 6,
|
|
1201
1201
|
className: Dt,
|
|
1202
|
-
children: /* @__PURE__ */ t(
|
|
1203
|
-
className:
|
|
1202
|
+
children: /* @__PURE__ */ t(G.Popup, {
|
|
1203
|
+
className: Et,
|
|
1204
1204
|
onMouseDown: (a) => a.preventDefault(),
|
|
1205
1205
|
...r,
|
|
1206
1206
|
children: e
|
|
1207
1207
|
})
|
|
1208
1208
|
}) })
|
|
1209
|
-
}), Bt = ({ children: e, selected: r = !1, disabled: a = !1, onClick: n }) => /* @__PURE__ */ t(
|
|
1210
|
-
className:
|
|
1209
|
+
}), Bt = ({ children: e, selected: r = !1, disabled: a = !1, onClick: n }) => /* @__PURE__ */ t(G.Item, {
|
|
1210
|
+
className: Lt,
|
|
1211
1211
|
"data-selected": r,
|
|
1212
1212
|
disabled: a,
|
|
1213
1213
|
onClick: n,
|
|
1214
1214
|
children: e
|
|
1215
1215
|
}), Ht = "d0bl03", $t = "d0bl00", jt = "_1r8zpuq0 d0bl04", zt = "_1r8zpuq1", Vt = "_1r8zpuq2";
|
|
1216
|
-
var
|
|
1217
|
-
const o =
|
|
1216
|
+
var Ut = ({ value: e, onChange: r, label: a, open: n, onOpenChange: s, popupAttributes: i, showTooltip: u = !1 }) => {
|
|
1217
|
+
const o = br(), c = o?.[e], h = (l) => {
|
|
1218
1218
|
l !== e && r(l), s(!1);
|
|
1219
1219
|
}, d = /* @__PURE__ */ t(x.Trigger, {
|
|
1220
1220
|
render: /* @__PURE__ */ t(q.Button, {}),
|
|
@@ -1237,7 +1237,7 @@ var Gt = ({ value: e, onChange: r, label: a, open: n, onOpenChange: s, popupAttr
|
|
|
1237
1237
|
}) : d, /* @__PURE__ */ t(x.Portal, {
|
|
1238
1238
|
container: R(),
|
|
1239
1239
|
className: X,
|
|
1240
|
-
children: /* @__PURE__ */ t(
|
|
1240
|
+
children: /* @__PURE__ */ t(E, { children: /* @__PURE__ */ t(x.Positioner, {
|
|
1241
1241
|
sideOffset: 6,
|
|
1242
1242
|
align: "start",
|
|
1243
1243
|
className: Ht,
|
|
@@ -1267,7 +1267,7 @@ var Gt = ({ value: e, onChange: r, label: a, open: n, onOpenChange: s, popupAttr
|
|
|
1267
1267
|
}) })
|
|
1268
1268
|
})]
|
|
1269
1269
|
});
|
|
1270
|
-
},
|
|
1270
|
+
}, Gt = ({ className: e, ...r }) => /* @__PURE__ */ t(z.Provider, { children: /* @__PURE__ */ t(q.Root, {
|
|
1271
1271
|
...r,
|
|
1272
1272
|
className: D(Rt, e)
|
|
1273
1273
|
}) }), Wt = ({ className: e, ...r }) => /* @__PURE__ */ t(q.Group, {
|
|
@@ -1278,15 +1278,15 @@ var Gt = ({ value: e, onChange: r, label: a, open: n, onOpenChange: s, popupAttr
|
|
|
1278
1278
|
className: D(Ft, e)
|
|
1279
1279
|
}), Yt = ({ children: e }) => {
|
|
1280
1280
|
const r = R();
|
|
1281
|
-
return r === null ? null : $e(/* @__PURE__ */ t(
|
|
1281
|
+
return r === null ? null : $e(/* @__PURE__ */ t(E, { children: e }), r);
|
|
1282
1282
|
}, P = {
|
|
1283
1283
|
Portal: Yt,
|
|
1284
|
-
Root:
|
|
1284
|
+
Root: Gt,
|
|
1285
1285
|
Group: Wt,
|
|
1286
1286
|
Separator: Kt,
|
|
1287
1287
|
Button: q.Button,
|
|
1288
1288
|
ColorPicker: kt,
|
|
1289
|
-
StickerPicker:
|
|
1289
|
+
StickerPicker: Ut,
|
|
1290
1290
|
MenuPopup: Ot,
|
|
1291
1291
|
MenuItem: Bt
|
|
1292
1292
|
}, qt = "var(--pvjfpx0)", Xt = "var(--pvjfpx1)", Jt = "pvjfpx2", Qt = "pvjfpx3", Zt = "pvjfpx4", en = "pvjfpx6 pvjfpx5", rn = "pvjfpx7 pvjfpx6 pvjfpx5", an = "pvjfpx8 pvjfpx5", j = 8, tn = ({ anchorBox: e, panelRect: r, frameWidth: a, frameHeight: n, avoidBoxes: s = [], pillWidthPx: i }) => {
|
|
@@ -1363,14 +1363,14 @@ var Gt = ({ value: e, onChange: r, label: a, open: n, onOpenChange: s, popupAttr
|
|
|
1363
1363
|
});
|
|
1364
1364
|
}, sn = ({ label: e, trigger: r, open: a, onOpenChange: n, disabled: s = !1, children: i }) => {
|
|
1365
1365
|
const { chartId: u } = A();
|
|
1366
|
-
return /* @__PURE__ */ b(
|
|
1366
|
+
return /* @__PURE__ */ b(G.Root, {
|
|
1367
1367
|
open: a,
|
|
1368
1368
|
modal: !1,
|
|
1369
1369
|
onOpenChange: n,
|
|
1370
1370
|
children: [/* @__PURE__ */ t(te, {
|
|
1371
1371
|
label: e,
|
|
1372
1372
|
suppressed: a,
|
|
1373
|
-
children: /* @__PURE__ */ b(
|
|
1373
|
+
children: /* @__PURE__ */ b(G.Trigger, {
|
|
1374
1374
|
render: /* @__PURE__ */ t(P.Button, {}),
|
|
1375
1375
|
"aria-label": e,
|
|
1376
1376
|
className: an,
|
|
@@ -1399,7 +1399,7 @@ var Gt = ({ value: e, onChange: r, label: a, open: n, onOpenChange: s, popupAttr
|
|
|
1399
1399
|
});
|
|
1400
1400
|
}, dn = ({ color: e, opacity: r }) => /* @__PURE__ */ t("span", {
|
|
1401
1401
|
className: Zt,
|
|
1402
|
-
style: { background: r === void 0 ? e :
|
|
1402
|
+
style: { background: r === void 0 ? e : pr(e, r) }
|
|
1403
1403
|
}), un = ({ label: e, onClick: r, children: a }) => /* @__PURE__ */ t(te, {
|
|
1404
1404
|
label: e,
|
|
1405
1405
|
children: /* @__PURE__ */ t(P.Button, {
|
|
@@ -1429,7 +1429,7 @@ var Gt = ({ value: e, onChange: r, label: a, open: n, onOpenChange: s, popupAttr
|
|
|
1429
1429
|
Button: P.Button,
|
|
1430
1430
|
Separator: P.Separator
|
|
1431
1431
|
}, vn = { kind: "chrome-popup" }, so = () => {
|
|
1432
|
-
const { commands: e } = A(), r =
|
|
1432
|
+
const { commands: e } = A(), r = Ee(), [a, n] = S(null);
|
|
1433
1433
|
pe(() => () => e.commit(), [e]), pe(() => {
|
|
1434
1434
|
const { claimInteraction: i, releaseInteraction: u } = r.getState();
|
|
1435
1435
|
return a === null ? u("chrome-popup") : i(vn), () => u("chrome-popup");
|
|
@@ -1480,8 +1480,8 @@ var Gt = ({ value: e, onChange: r, label: a, open: n, onOpenChange: s, popupAttr
|
|
|
1480
1480
|
const [r, ...a] = e;
|
|
1481
1481
|
return r === void 0 ? null : a.every((n) => n === r) ? r : null;
|
|
1482
1482
|
}, fn = (e) => typeof e == "string" && e.length > 0 ? e : void 0, ir = (e) => typeof e == "number" && Number.isFinite(e) ? e : void 0, gn = (e) => e === "left" || e === "center" || e === "right" ? e : void 0, mo = ({ annotationId: e }) => {
|
|
1483
|
-
const r =
|
|
1484
|
-
return
|
|
1483
|
+
const r = L(), a = bt();
|
|
1484
|
+
return Cr((n) => n.caret?.annotationId === e) ? null : /* @__PURE__ */ b(Oe, { children: [/* @__PURE__ */ t(Me.IconButton, {
|
|
1485
1485
|
label: r("graph.annotations.baseMenu.arrowFromHere"),
|
|
1486
1486
|
onClick: (n) => a({ start: {
|
|
1487
1487
|
anchorType: "annotation",
|
|
@@ -1497,7 +1497,7 @@ var Gt = ({ value: e, onChange: r, label: a, open: n, onOpenChange: s, popupAttr
|
|
|
1497
1497
|
export {
|
|
1498
1498
|
Vn as $,
|
|
1499
1499
|
Qn as A,
|
|
1500
|
-
|
|
1500
|
+
Ua as B,
|
|
1501
1501
|
gt as C,
|
|
1502
1502
|
Jn as D,
|
|
1503
1503
|
Zn as E,
|
|
@@ -1517,7 +1517,7 @@ export {
|
|
|
1517
1517
|
mt as S,
|
|
1518
1518
|
ro as T,
|
|
1519
1519
|
Sa as U,
|
|
1520
|
-
|
|
1520
|
+
Ea as V,
|
|
1521
1521
|
ya as W,
|
|
1522
1522
|
Kn as X,
|
|
1523
1523
|
la as Y,
|
|
@@ -1531,7 +1531,7 @@ export {
|
|
|
1531
1531
|
$n as ct,
|
|
1532
1532
|
Me as d,
|
|
1533
1533
|
k as dt,
|
|
1534
|
-
|
|
1534
|
+
Gn as et,
|
|
1535
1535
|
P as f,
|
|
1536
1536
|
Hn as ft,
|
|
1537
1537
|
Tt as g,
|
|
@@ -1551,10 +1551,10 @@ export {
|
|
|
1551
1551
|
vo as o,
|
|
1552
1552
|
Se as ot,
|
|
1553
1553
|
oo as p,
|
|
1554
|
-
|
|
1554
|
+
Er as pt,
|
|
1555
1555
|
Je as q,
|
|
1556
1556
|
ce as r,
|
|
1557
|
-
|
|
1557
|
+
Un as rt,
|
|
1558
1558
|
co as s,
|
|
1559
1559
|
Ye as st,
|
|
1560
1560
|
mo as t,
|