@sheetxl/react 0.8.0-beta.22 → 0.8.0-beta.23
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/browser/esm/{D0g7sllamMog1m-Z.mjs → 2-8Z3hKcjFc9IUm_.mjs} +3 -3
- package/browser/esm/{BqIbT28MM3SBdvh_.mjs → B1qMCa-WDnmPYR_C.mjs} +2 -2
- package/browser/esm/{D7P7zWW2gdWclI2p.mjs → B1rKvYmr4ynvDkqM.mjs} +3 -3
- package/browser/esm/{C7rc3CMd_XOITW1V.mjs → B7RYx03rC74aIduo.mjs} +7 -7
- package/browser/esm/{BPS1PDZKyF6ivJwa.mjs → BG96UT5-ooOuigD0.mjs} +1 -1
- package/browser/esm/{DgmkBz2cYtVZ8tXv.mjs → BHukFXtx1rpfvfIy.mjs} +1 -1
- package/browser/esm/{D8NUgUzdI7YFxyyA.mjs → BN7pckCvCRZMPCmK.mjs} +7 -7
- package/browser/esm/{mJyEnJIX0iGfGtvE.mjs → BklsD3lkZGRSwAFi.mjs} +1 -1
- package/browser/esm/{CJVcfqrty5b-eowN.mjs → C-eTPeTwXQoqn3Lb.mjs} +2 -2
- package/browser/esm/{Biz8qA4-1wRN8de2.mjs → C9wgyCKVT4rwQMSD.mjs} +1 -1
- package/browser/esm/{DH8xeknZXWn7AV5q.mjs → CD5gjg2DVLsy6h33.mjs} +6 -6
- package/browser/esm/{D01C312OntVURMN9.mjs → CEtZlL4v4JU0TDVR.mjs} +122 -122
- package/browser/esm/{np1ChcItFltS6AC5.mjs → CGEyv-QdxMuQmLqk.mjs} +1 -1
- package/browser/esm/{CgOhJ3utK7aSQm26.mjs → CLD7Vob5oUran-l0.mjs} +1 -1
- package/browser/esm/{B9rbGikcuRq1OnhM.mjs → CXJmpmqTkVe25Ita.mjs} +2 -2
- package/browser/esm/{hTeTTb8oYTssk6EY.mjs → CmYMKPG-TaW2dJPu.mjs} +1 -1
- package/browser/esm/{CrTfqdSwWScJN566.mjs → CruGvs0fdtWWO_Di.mjs} +1 -1
- package/browser/esm/{B9wkino8VMasq6E3.mjs → Cw3PQMs1RDxzIo35.mjs} +2 -2
- package/browser/esm/{DhGJU1camaOf7KOq.mjs → D5r5ejlRpFFXN6TK.mjs} +4 -4
- package/browser/esm/{mUKvsPCmRWzQke-M.mjs → D952mmmww4cYPatc.mjs} +1 -1
- package/browser/esm/{QKnTzTdIYAMcBU8r.mjs → DQ5DeFNj_0mj6QMd.mjs} +1 -1
- package/browser/esm/{DyFeCww9e_4G9c-1.mjs → DSvlk_YzOev20rgN.mjs} +173 -160
- package/browser/esm/{Bjzo7g25tw9kTCYC.mjs → DedLmnV_HajYHYSM.mjs} +2 -2
- package/browser/esm/{DxsGY5rYjITV3SLK.mjs → G6Ek0k1QC1pUHvPd.mjs} +1 -1
- package/browser/esm/{HQkKZC6SPUdQwgxi.mjs → OPWkc7t367MwVsVU.mjs} +1 -1
- package/browser/esm/chart.mjs +11 -11
- package/browser/esm/control.mjs +16 -16
- package/browser/esm/group.mjs +29 -29
- package/browser/esm/index.mjs +3593 -3588
- package/browser/esm/note.mjs +10 -10
- package/browser/esm/picture.mjs +2 -2
- package/browser/esm/shape.mjs +2 -2
- package/browser/esm/slicer.mjs +55 -50
- package/node/esm/{CZc2QH8i-TgW9nGI.mjs → B5ae_WW6vAz2jOsn.mjs} +1 -1
- package/node/esm/{CcLUKcJROXrbSXjb.mjs → BD04OJgRWKiE2W1H.mjs} +1 -1
- package/node/esm/{l0GtU6LYlBywzc9T.mjs → BGLOvRRJr4nt8QdO.mjs} +2 -2
- package/node/esm/{CE5fMGMmykts2yJP.mjs → BKrvkWuGTMdkvdy6.mjs} +1 -1
- package/node/esm/{aLt3NYdUcYQu4Ur4.mjs → BMWwIbesFn8e6-Ov.mjs} +1 -1
- package/node/esm/{CfpNgRvWmu36cTfV.mjs → BhgjRcXOyNKBdqUW.mjs} +5 -5
- package/node/esm/{DX7ysYSfnigj0ak8.mjs → Bv0fGxNecKUr_qYS.mjs} +1 -1
- package/node/esm/{C3XXdc_UXH2g2W5E.mjs → CF5ztfx05vyEMEub.mjs} +1 -1
- package/node/esm/{C91YeRrspETjFcRc.mjs → CeSZX96RPPjn29Hw.mjs} +2 -2
- package/node/esm/{-6T2zqPkDm0WgUKI.mjs → CeuVkQpY8O4nZG-k.mjs} +2 -2
- package/node/esm/{FUQMKIiQQ5m3xzeO.mjs → Csl959_HnUC4Y06N.mjs} +1 -1
- package/node/esm/{cju5Gx-t_74o116W.mjs → Cx16BErZDzlQEXH_.mjs} +2 -2
- package/node/esm/{i4aPmKocZebCBeSd.mjs → D8mwVRSclIFn5SVM.mjs} +6 -6
- package/node/esm/{BPMjPMRyVTEZq_6j.mjs → DJyNfqgeIlJ6lOHS.mjs} +1 -1
- package/node/esm/{COlzVELrEvgm2STX.mjs → DL2RKBB2PXzdJyx_.mjs} +4 -4
- package/node/esm/{DHTbAHbCiEWhilV_.mjs → DmHHRlyfyFWj6wvW.mjs} +1 -1
- package/node/esm/{BcASbEBHzMKiXn5i.mjs → VFXZqkIvB9MDE2Ea.mjs} +1 -1
- package/node/esm/{GG78Gq3CY8SDS-48.mjs → YC2O0ix33xKY0ShQ.mjs} +12 -12
- package/node/esm/chart.mjs +19 -19
- package/node/esm/control.mjs +16 -16
- package/node/esm/group.mjs +27 -27
- package/node/esm/{CzQMRmArhJ6blZJp.mjs → iMUcM8KW4HIW2Ksm.mjs} +1 -1
- package/node/esm/index.mjs +3558 -3552
- package/node/esm/{BpcTu_chuDjr_XFv.mjs → k3c-0DQ1fifSFOnO.mjs} +1 -1
- package/node/esm/note.mjs +10 -10
- package/node/esm/picture.mjs +175 -162
- package/node/esm/shape.mjs +169 -169
- package/node/esm/slicer.mjs +100 -95
- package/node/esm/{DxKxx-yEkSydHyWQ.mjs → vYeFE_eUMRqsgnkd.mjs} +1 -1
- package/package.json +7 -7
- package/types/src/cell/CornerTriangle.d.ts +2 -1
- package/types/src/editor/SheetCellEditorLayer.d.ts +0 -5
- package/types/src/editor/formulaPresentation.d.ts +4 -3
- package/types/src/movable/IMovableArea.d.ts +11 -0
- package/types/src/sheet/IWorksheetElement.d.ts +13 -4
- package/types/src/theme/ExplicitTokens.d.ts +18 -0
- package/types/src/theme/ThemeRootStyles.d.ts +31 -0
- package/types/src/theme/buildTokensCSS.d.ts +15 -0
- package/types/src/theme/index.d.ts +2 -4
- package/types/src/theme/useAppColorScheme.d.ts +4 -1
- package/types/src/theme/useGridColorScheme.d.ts +2 -1
- package/types/src/theme/useSystemColors.d.ts +0 -14
- package/types/src/workbook/IWorkbookElement.d.ts +36 -8
package/node/esm/shape.mjs
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.8.0-beta.
|
|
2
|
+
* @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.8.0-beta.23
|
|
3
3
|
*
|
|
4
4
|
* (C) 2026-present SheetXL Inc. & Michael T. Ford
|
|
5
5
|
* License: SheetXL EULA — https://www.sheetxl.com/eula
|
|
6
6
|
*/
|
|
7
|
-
import { t as e } from "./
|
|
8
|
-
import { n as t } from "./
|
|
9
|
-
import { t as n } from "./
|
|
10
|
-
import { t as o } from "./
|
|
11
|
-
import { i as r, n as s, r as i, t as l } from "./
|
|
12
|
-
import { forwardRef as a, memo as
|
|
13
|
-
import { jsx as f, jsxs as
|
|
14
|
-
import { messageKey as
|
|
15
|
-
import { ReactUtils as x,
|
|
16
|
-
import { createPortal as
|
|
17
|
-
var
|
|
18
|
-
const s = m(null), i = m(null), [l, a] = g(!1),
|
|
7
|
+
import { t as e } from "./Bv0fGxNecKUr_qYS.mjs";
|
|
8
|
+
import { n as t } from "./iMUcM8KW4HIW2Ksm.mjs";
|
|
9
|
+
import { t as n } from "./CF5ztfx05vyEMEub.mjs";
|
|
10
|
+
import { t as o } from "./VFXZqkIvB9MDE2Ea.mjs";
|
|
11
|
+
import { i as r, n as s, r as i, t as l } from "./BGLOvRRJr4nt8QdO.mjs";
|
|
12
|
+
import { forwardRef as a, memo as c, useCallback as p, useEffect as d, useMemo as h, useReducer as u, useRef as m, useState as g } from "react";
|
|
13
|
+
import { jsx as f, jsxs as y } from "react/jsx-runtime";
|
|
14
|
+
import { messageKey as v } from "@sheetxl/utils";
|
|
15
|
+
import { ReactUtils as x, tokenVar as w, useImperativeElement as b } from "@sheetxl/utils-react";
|
|
16
|
+
import { createPortal as j } from "react-dom";
|
|
17
|
+
var T = c(({ handles: e, width: t, height: n, zoom: o, onDrag: r }) => {
|
|
18
|
+
const s = m(null), i = m(null), [l, a] = g(!1), c = p((e) => {
|
|
19
19
|
const t = s.current, n = t?.getScreenCTM();
|
|
20
20
|
if (!t || !n) return null;
|
|
21
21
|
const o = new DOMPoint(e.clientX, e.clientY).matrixTransform(n.inverse());
|
|
@@ -23,29 +23,29 @@ var j = p(({ handles: e, width: t, height: n, zoom: o, onDrag: r }) => {
|
|
|
23
23
|
x: o.x,
|
|
24
24
|
y: o.y
|
|
25
25
|
};
|
|
26
|
-
}, []), d =
|
|
26
|
+
}, []), d = p((e, t) => {
|
|
27
27
|
0 === e.button && (e.stopPropagation(), e.preventDefault(), i.current = {
|
|
28
28
|
index: t,
|
|
29
29
|
pointerId: e.pointerId
|
|
30
30
|
}, e.currentTarget.setPointerCapture(e.pointerId), a(!0));
|
|
31
|
-
}, []), h =
|
|
31
|
+
}, []), h = p((e) => {
|
|
32
32
|
const t = i.current;
|
|
33
33
|
if (!t || t.pointerId !== e.pointerId) return;
|
|
34
34
|
e.stopPropagation();
|
|
35
|
-
const n =
|
|
35
|
+
const n = c(e);
|
|
36
36
|
n && r(t.index, n.x, n.y, "move");
|
|
37
|
-
}, [
|
|
37
|
+
}, [c, r]), u = p((e) => {
|
|
38
38
|
const t = i.current;
|
|
39
39
|
if (!t || t.pointerId !== e.pointerId) return;
|
|
40
40
|
e.stopPropagation(), i.current = null, a(!1);
|
|
41
|
-
const n =
|
|
41
|
+
const n = c(e);
|
|
42
42
|
n ? r(t.index, n.x, n.y, "end") : r(t.index, 0, 0, "cancel");
|
|
43
|
-
}, [
|
|
43
|
+
}, [c, r]), v = p((e) => {
|
|
44
44
|
const t = i.current;
|
|
45
45
|
t && t.pointerId === e.pointerId && (i.current = null, a(!1), r(t.index, 0, 0, "cancel"));
|
|
46
46
|
}, [r]);
|
|
47
47
|
if (!(0 !== e.length && t > 0 && n > 0)) return null;
|
|
48
|
-
const x = o > 0 ? o : 1,
|
|
48
|
+
const x = o > 0 ? o : 1, b = 4.5 / x;
|
|
49
49
|
return f("svg", {
|
|
50
50
|
ref: s,
|
|
51
51
|
className: l ? "sxl-shape-handles sxl-movable-gesture" : "sxl-shape-handles",
|
|
@@ -62,22 +62,22 @@ var j = p(({ handles: e, width: t, height: n, zoom: o, onDrag: r }) => {
|
|
|
62
62
|
pointerEvents: "none",
|
|
63
63
|
touchAction: "none"
|
|
64
64
|
},
|
|
65
|
-
children: e.map((e) =>
|
|
65
|
+
children: e.map((e) => y("g", {
|
|
66
66
|
className: "sxl-shape-handle",
|
|
67
67
|
style: { "--shape-scale": x },
|
|
68
68
|
children: [f("circle", {
|
|
69
69
|
cx: e.x,
|
|
70
70
|
cy: e.y,
|
|
71
|
-
r:
|
|
72
|
-
fill: "
|
|
73
|
-
stroke: "
|
|
71
|
+
r: b,
|
|
72
|
+
fill: w("color-accent"),
|
|
73
|
+
stroke: w("color-base-100"),
|
|
74
74
|
strokeWidth: 1 / x,
|
|
75
75
|
style: { pointerEvents: "none" }
|
|
76
76
|
}), f("circle", {
|
|
77
77
|
className: "sxl-shape-handle-hit",
|
|
78
78
|
cx: e.x,
|
|
79
79
|
cy: e.y,
|
|
80
|
-
r:
|
|
80
|
+
r: b,
|
|
81
81
|
fill: "transparent",
|
|
82
82
|
style: {
|
|
83
83
|
pointerEvents: "all",
|
|
@@ -87,150 +87,150 @@ var j = p(({ handles: e, width: t, height: n, zoom: o, onDrag: r }) => {
|
|
|
87
87
|
onPointerDown: (t) => d(t, e.index),
|
|
88
88
|
onPointerMove: h,
|
|
89
89
|
onPointerUp: u,
|
|
90
|
-
onPointerCancel:
|
|
90
|
+
onPointerCancel: v,
|
|
91
91
|
onMouseDown: (e) => e.stopPropagation()
|
|
92
92
|
})]
|
|
93
93
|
}, e.index))
|
|
94
94
|
});
|
|
95
95
|
});
|
|
96
|
-
|
|
97
|
-
var
|
|
96
|
+
T.displayName = "ShapeHandles";
|
|
97
|
+
var C = (e, t) => e > 0 || t > 0, P = (e, t, n) => !e || e.getWidth() === t && e.getHeight() === n ? e : C(t, n) ? e.resize(t, n) : null, S = (e) => {
|
|
98
98
|
const t = [];
|
|
99
99
|
return e.forEachConnection((e) => t.push(e)), t;
|
|
100
|
-
},
|
|
101
|
-
const { children:
|
|
102
|
-
e(
|
|
103
|
-
onBoundsChange:
|
|
104
|
-
onSelectionChange:
|
|
100
|
+
}, E = c(a((a, c) => {
|
|
101
|
+
const { children: E, disabled: A, style: D, shape: N, movable: z, zoom: I = 1, isDragging: $, onHide: H, onShow: M, onDragZone: k, onTap: R, adornmentHost: O, flip: B, gesture: F, debugGeometry: G = !1, ...W } = a, X = t()?.getStyles() ?? null, [J, L] = u((e) => e + 1, 0);
|
|
102
|
+
e(N, { onAnyChange: L }), e(z ?? null, {
|
|
103
|
+
onBoundsChange: L,
|
|
104
|
+
onSelectionChange: L
|
|
105
105
|
});
|
|
106
|
-
const
|
|
106
|
+
const U = N.toJSON(), { width: V, height: Y, rotation: Z, content: q } = r(z), K = N.getShapeType(), Q = N.getAdjustments(), _ = C(V, Y), [ee, te] = g(null), ne = m(0);
|
|
107
107
|
d(() => {
|
|
108
|
-
if (!
|
|
109
|
-
const e = ++
|
|
110
|
-
|
|
111
|
-
|
|
108
|
+
if (!_) return void te(null);
|
|
109
|
+
const e = ++ne.current, t = N.getShapeType();
|
|
110
|
+
N.getGeometry(V, Y).then((n) => {
|
|
111
|
+
ne.current === e && te(n ? {
|
|
112
112
|
shapeType: t,
|
|
113
113
|
geometry: n
|
|
114
114
|
} : null);
|
|
115
115
|
}, () => {
|
|
116
|
-
|
|
116
|
+
ne.current === e && te(null);
|
|
117
117
|
});
|
|
118
118
|
}, [
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
119
|
+
N,
|
|
120
|
+
V,
|
|
121
|
+
Y,
|
|
122
|
+
J
|
|
123
123
|
]);
|
|
124
|
-
const
|
|
124
|
+
const oe = void 0 !== q?.shapeType && q.shapeType !== K ? q.shapeType : null, [re, se] = g(null);
|
|
125
125
|
d(() => {
|
|
126
|
-
if (!
|
|
126
|
+
if (!oe || !_ || re?.shapeType === oe) return;
|
|
127
127
|
let e = !0;
|
|
128
|
-
return
|
|
129
|
-
e && t &&
|
|
130
|
-
shapeType:
|
|
128
|
+
return N.getGeometry(V, Y, { shapeType: oe }).then((t) => {
|
|
129
|
+
e && t && se({
|
|
130
|
+
shapeType: oe,
|
|
131
131
|
geometry: t
|
|
132
132
|
});
|
|
133
133
|
}, () => {}), () => {
|
|
134
134
|
e = !1;
|
|
135
135
|
};
|
|
136
136
|
}, [
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
137
|
+
N,
|
|
138
|
+
oe,
|
|
139
|
+
_
|
|
140
140
|
]);
|
|
141
|
-
const
|
|
142
|
-
const e =
|
|
143
|
-
return e ?
|
|
141
|
+
const ie = h(() => {
|
|
142
|
+
const e = ee?.shapeType === K ? ee : re?.shapeType === K ? re : null;
|
|
143
|
+
return e ? P(e.geometry, V, Y)?.withAdjustments(Q) ?? null : P(ee?.geometry ?? null, V, Y);
|
|
144
144
|
}, [
|
|
145
|
+
ee,
|
|
146
|
+
re,
|
|
147
|
+
K,
|
|
145
148
|
Q,
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
L,
|
|
150
|
-
U
|
|
151
|
-
]), se = c((e) => D.getResource(e), [D]);
|
|
149
|
+
V,
|
|
150
|
+
Y
|
|
151
|
+
]), le = p((e) => N.getResource(e), [N]);
|
|
152
152
|
d(() => {
|
|
153
153
|
const e = [];
|
|
154
|
-
for (let t =
|
|
154
|
+
for (let t = z?.getParent() ?? null; t; t = t.getParent()) e.push(t.getContent().addListeners({ onAnyChange: L }));
|
|
155
155
|
return () => {
|
|
156
156
|
for (const t of e) t();
|
|
157
157
|
};
|
|
158
|
-
}, [
|
|
159
|
-
const
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
]), [
|
|
165
|
-
if (
|
|
166
|
-
const e =
|
|
167
|
-
return e && void 0 !==
|
|
158
|
+
}, [z]);
|
|
159
|
+
const ae = s(z), ce = h(() => i(U, X, le, ae), [
|
|
160
|
+
U,
|
|
161
|
+
X,
|
|
162
|
+
le,
|
|
163
|
+
ae
|
|
164
|
+
]), [pe, de] = g(null), he = void 0 !== q?.adjustments ? q.adjustments : pe ?? void 0, ue = h(() => {
|
|
165
|
+
if (oe && re?.shapeType !== oe) return ie;
|
|
166
|
+
const e = oe ? P(re.geometry, V, Y) : ie;
|
|
167
|
+
return e && void 0 !== he ? e.withAdjustments(he) : e;
|
|
168
168
|
}, [
|
|
169
|
+
ie,
|
|
170
|
+
oe,
|
|
169
171
|
re,
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
if (!de || !re) return;
|
|
178
|
-
const r = de.adjustmentsFromHandle(e, t, n);
|
|
172
|
+
V,
|
|
173
|
+
Y,
|
|
174
|
+
he
|
|
175
|
+
]), me = m(null), [ge, fe] = g(!1), ye = p((e, t, n, o) => {
|
|
176
|
+
if ("cancel" === o) return me.current && (me.current = null, fe(!1), F?.cancel()), void de(null);
|
|
177
|
+
if (!ue || !ie) return;
|
|
178
|
+
const r = ue.adjustmentsFromHandle(e, t, n);
|
|
179
179
|
if ("move" === o) {
|
|
180
|
-
if (
|
|
181
|
-
if (!
|
|
180
|
+
if (F && !A) {
|
|
181
|
+
if (!me.current) {
|
|
182
182
|
const e = { adjustments: r }, t = (t) => {
|
|
183
183
|
t.getContent().setAdjustments(e.adjustments);
|
|
184
184
|
};
|
|
185
|
-
if (!
|
|
186
|
-
|
|
185
|
+
if (!F.start(v("op.setShapeAdjustments"), t)) return;
|
|
186
|
+
me.current = e, fe(!0);
|
|
187
187
|
}
|
|
188
|
-
|
|
188
|
+
me.current.adjustments = r, F.preview({ content: { adjustments: r } });
|
|
189
189
|
return;
|
|
190
190
|
}
|
|
191
|
-
|
|
191
|
+
de(r);
|
|
192
192
|
return;
|
|
193
193
|
}
|
|
194
|
-
const s =
|
|
195
|
-
if (s) return
|
|
196
|
-
|
|
194
|
+
const s = me.current;
|
|
195
|
+
if (s) return me.current = null, fe(!1), s.adjustments = r, void F?.finish();
|
|
196
|
+
de(null), A || N.setAdjustments(r);
|
|
197
197
|
}, [
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
]),
|
|
198
|
+
ue,
|
|
199
|
+
ie,
|
|
200
|
+
N,
|
|
201
|
+
A,
|
|
202
|
+
F
|
|
203
|
+
]), ve = h(() => {
|
|
204
204
|
const e = [];
|
|
205
|
-
return
|
|
206
|
-
}, [
|
|
205
|
+
return ue?.forEachHandle((t) => e.push(t)), e;
|
|
206
|
+
}, [ue]), xe = b(c, () => ({ isShapeEditor: () => !0 }), []), we = B ?? z?.getFlip(), be = we?.horizontal ?? !1, je = we?.vertical ?? !1, Te = Z % 360 != 0, Ce = h(() => !Te && C(V, Y) ? {
|
|
207
207
|
dpr: x.getDevicePixelRatio(),
|
|
208
|
-
zoom:
|
|
209
|
-
width:
|
|
210
|
-
height:
|
|
211
|
-
flipH:
|
|
212
|
-
flipV:
|
|
208
|
+
zoom: I,
|
|
209
|
+
width: V,
|
|
210
|
+
height: Y,
|
|
211
|
+
flipH: be,
|
|
212
|
+
flipV: je
|
|
213
213
|
} : null, [
|
|
214
|
+
Te,
|
|
215
|
+
I,
|
|
216
|
+
V,
|
|
217
|
+
Y,
|
|
214
218
|
be,
|
|
215
|
-
|
|
216
|
-
L,
|
|
217
|
-
U,
|
|
218
|
-
xe,
|
|
219
|
-
we
|
|
219
|
+
je
|
|
220
220
|
]);
|
|
221
|
-
if (
|
|
222
|
-
const
|
|
223
|
-
transform:
|
|
221
|
+
if (N.isDeleted() || !U) return null;
|
|
222
|
+
const Pe = "none" === D?.pointerEvents, Se = Pe ? "none" : "visiblePainted", Ee = !Pe && !A && (!$ || ge) && !!z?.isSelected(), Ae = {
|
|
223
|
+
transform: be || je ? `scale(${be ? -1 : 1}, ${je ? -1 : 1})` : void 0,
|
|
224
224
|
transformOrigin: "center"
|
|
225
225
|
};
|
|
226
|
-
let
|
|
227
|
-
|
|
228
|
-
handles:
|
|
229
|
-
width:
|
|
230
|
-
height:
|
|
231
|
-
zoom:
|
|
232
|
-
onDrag:
|
|
233
|
-
}),
|
|
226
|
+
let De = null;
|
|
227
|
+
Ee && ve.length > 0 && (De = f(T, {
|
|
228
|
+
handles: ve,
|
|
229
|
+
width: V,
|
|
230
|
+
height: Y,
|
|
231
|
+
zoom: I,
|
|
232
|
+
onDrag: ye
|
|
233
|
+
}), O && (De = j(f("div", {
|
|
234
234
|
className: "sxl-shape-adornment",
|
|
235
235
|
style: {
|
|
236
236
|
position: "absolute",
|
|
@@ -238,32 +238,32 @@ var T = (e, t) => e > 0 || t > 0, C = (e, t, n) => !e || e.getWidth() === t && e
|
|
|
238
238
|
top: 0,
|
|
239
239
|
width: "100%",
|
|
240
240
|
height: "100%",
|
|
241
|
-
...
|
|
241
|
+
...Ae,
|
|
242
242
|
pointerEvents: "none"
|
|
243
243
|
},
|
|
244
|
-
children:
|
|
245
|
-
}),
|
|
246
|
-
const
|
|
247
|
-
return
|
|
244
|
+
children: De
|
|
245
|
+
}), O)));
|
|
246
|
+
const Ne = be !== je ? "scaleX(-1)" : void 0, ze = ue?.getTextRect(), Ie = U.text, $e = !!Ie && Ie.paragraphs.some((e) => e.runs.some((e) => "" !== e.text));
|
|
247
|
+
return y("div", {
|
|
248
248
|
className: "sxl-shape-editor",
|
|
249
|
-
...
|
|
250
|
-
ref:
|
|
249
|
+
...W,
|
|
250
|
+
ref: xe,
|
|
251
251
|
style: {
|
|
252
252
|
width: "100%",
|
|
253
253
|
height: "100%",
|
|
254
254
|
position: "relative",
|
|
255
255
|
overflow: "visible",
|
|
256
|
-
filter:
|
|
257
|
-
...
|
|
258
|
-
...
|
|
256
|
+
filter: A ? "blur(1px)" : void 0,
|
|
257
|
+
...Ae,
|
|
258
|
+
...D,
|
|
259
259
|
pointerEvents: "none"
|
|
260
260
|
},
|
|
261
261
|
children: [
|
|
262
|
-
|
|
262
|
+
C(V, Y) ? y("svg", {
|
|
263
263
|
className: "sxl-shape-geometry",
|
|
264
|
-
viewBox: `0 0 ${
|
|
265
|
-
width:
|
|
266
|
-
height:
|
|
264
|
+
viewBox: `0 0 ${V > 0 ? V : 1 / I} ${Y > 0 ? Y : 1 / I}`,
|
|
265
|
+
width: V > 0 ? "100%" : "1px",
|
|
266
|
+
height: Y > 0 ? "100%" : "1px",
|
|
267
267
|
preserveAspectRatio: "none",
|
|
268
268
|
overflow: "visible",
|
|
269
269
|
style: {
|
|
@@ -272,50 +272,50 @@ var T = (e, t) => e > 0 || t > 0, C = (e, t, n) => !e || e.getWidth() === t && e
|
|
|
272
272
|
top: 0,
|
|
273
273
|
display: "block",
|
|
274
274
|
pointerEvents: "none",
|
|
275
|
-
filter:
|
|
275
|
+
filter: Ee ? `drop-shadow(1px 1px 2px ${w("color-shadow")})` : void 0
|
|
276
276
|
},
|
|
277
|
-
children: [
|
|
278
|
-
geometry:
|
|
279
|
-
style:
|
|
280
|
-
zoom:
|
|
281
|
-
grid:
|
|
282
|
-
hit:
|
|
283
|
-
}) : null,
|
|
277
|
+
children: [ue ? f(l, {
|
|
278
|
+
geometry: ue,
|
|
279
|
+
style: ce,
|
|
280
|
+
zoom: I,
|
|
281
|
+
grid: Ce,
|
|
282
|
+
hit: Se
|
|
283
|
+
}) : null, G && ue && ze ? y("g", {
|
|
284
284
|
pointerEvents: "none",
|
|
285
285
|
children: [f("rect", {
|
|
286
|
-
x:
|
|
287
|
-
y:
|
|
288
|
-
width: Math.max(0,
|
|
289
|
-
height: Math.max(0,
|
|
286
|
+
x: ze.l,
|
|
287
|
+
y: ze.t,
|
|
288
|
+
width: Math.max(0, ze.r - ze.l),
|
|
289
|
+
height: Math.max(0, ze.b - ze.t),
|
|
290
290
|
fill: "none",
|
|
291
|
-
stroke: "
|
|
292
|
-
strokeWidth: 1 /
|
|
293
|
-
strokeDasharray: `${4 /
|
|
294
|
-
}),
|
|
295
|
-
x: e.x - 3 /
|
|
296
|
-
y: e.y - 3 /
|
|
297
|
-
width: 6 /
|
|
298
|
-
height: 6 /
|
|
299
|
-
fill: "
|
|
291
|
+
stroke: w("color-error"),
|
|
292
|
+
strokeWidth: 1 / I,
|
|
293
|
+
strokeDasharray: `${4 / I} ${2 / I}`
|
|
294
|
+
}), S(ue).map((e) => f("rect", {
|
|
295
|
+
x: e.x - 3 / I,
|
|
296
|
+
y: e.y - 3 / I,
|
|
297
|
+
width: 6 / I,
|
|
298
|
+
height: 6 / I,
|
|
299
|
+
fill: w("color-success")
|
|
300
300
|
}, e.index))]
|
|
301
301
|
}) : null]
|
|
302
302
|
}) : null,
|
|
303
|
-
|
|
303
|
+
$e && ze ? f("div", {
|
|
304
304
|
className: "sxl-shape-text-frame",
|
|
305
305
|
style: {
|
|
306
306
|
position: "absolute",
|
|
307
|
-
left:
|
|
308
|
-
top:
|
|
309
|
-
width: Math.max(0,
|
|
310
|
-
height: Math.max(0,
|
|
311
|
-
zoom:
|
|
312
|
-
transform:
|
|
307
|
+
left: ze.l,
|
|
308
|
+
top: ze.t,
|
|
309
|
+
width: Math.max(0, ze.r - ze.l),
|
|
310
|
+
height: Math.max(0, ze.b - ze.t),
|
|
311
|
+
zoom: I,
|
|
312
|
+
transform: Ne,
|
|
313
313
|
transformOrigin: "center",
|
|
314
|
-
pointerEvents:
|
|
315
|
-
color:
|
|
314
|
+
pointerEvents: Pe ? "none" : "auto",
|
|
315
|
+
color: ce.textColor ?? void 0
|
|
316
316
|
},
|
|
317
317
|
children: f(n, {
|
|
318
|
-
movable:
|
|
318
|
+
movable: z,
|
|
319
319
|
disabled: !0,
|
|
320
320
|
style: {
|
|
321
321
|
fontFamily: "Calibri, Carlito, sans-serif",
|
|
@@ -328,15 +328,15 @@ var T = (e, t) => e > 0 || t > 0, C = (e, t, n) => !e || e.getWidth() === t && e
|
|
|
328
328
|
overflow: "hidden"
|
|
329
329
|
},
|
|
330
330
|
children: f(o, {
|
|
331
|
-
text:
|
|
332
|
-
styles:
|
|
333
|
-
color:
|
|
331
|
+
text: Ie,
|
|
332
|
+
styles: X,
|
|
333
|
+
color: ce.textColor
|
|
334
334
|
})
|
|
335
335
|
})
|
|
336
336
|
}) : null,
|
|
337
|
-
|
|
337
|
+
De
|
|
338
338
|
]
|
|
339
339
|
});
|
|
340
340
|
}));
|
|
341
|
-
|
|
342
|
-
export {
|
|
341
|
+
E.displayName = "ShapeEditor";
|
|
342
|
+
export { E as ShapeEditor };
|