@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.
Files changed (76) hide show
  1. package/browser/esm/{D0g7sllamMog1m-Z.mjs → 2-8Z3hKcjFc9IUm_.mjs} +3 -3
  2. package/browser/esm/{BqIbT28MM3SBdvh_.mjs → B1qMCa-WDnmPYR_C.mjs} +2 -2
  3. package/browser/esm/{D7P7zWW2gdWclI2p.mjs → B1rKvYmr4ynvDkqM.mjs} +3 -3
  4. package/browser/esm/{C7rc3CMd_XOITW1V.mjs → B7RYx03rC74aIduo.mjs} +7 -7
  5. package/browser/esm/{BPS1PDZKyF6ivJwa.mjs → BG96UT5-ooOuigD0.mjs} +1 -1
  6. package/browser/esm/{DgmkBz2cYtVZ8tXv.mjs → BHukFXtx1rpfvfIy.mjs} +1 -1
  7. package/browser/esm/{D8NUgUzdI7YFxyyA.mjs → BN7pckCvCRZMPCmK.mjs} +7 -7
  8. package/browser/esm/{mJyEnJIX0iGfGtvE.mjs → BklsD3lkZGRSwAFi.mjs} +1 -1
  9. package/browser/esm/{CJVcfqrty5b-eowN.mjs → C-eTPeTwXQoqn3Lb.mjs} +2 -2
  10. package/browser/esm/{Biz8qA4-1wRN8de2.mjs → C9wgyCKVT4rwQMSD.mjs} +1 -1
  11. package/browser/esm/{DH8xeknZXWn7AV5q.mjs → CD5gjg2DVLsy6h33.mjs} +6 -6
  12. package/browser/esm/{D01C312OntVURMN9.mjs → CEtZlL4v4JU0TDVR.mjs} +122 -122
  13. package/browser/esm/{np1ChcItFltS6AC5.mjs → CGEyv-QdxMuQmLqk.mjs} +1 -1
  14. package/browser/esm/{CgOhJ3utK7aSQm26.mjs → CLD7Vob5oUran-l0.mjs} +1 -1
  15. package/browser/esm/{B9rbGikcuRq1OnhM.mjs → CXJmpmqTkVe25Ita.mjs} +2 -2
  16. package/browser/esm/{hTeTTb8oYTssk6EY.mjs → CmYMKPG-TaW2dJPu.mjs} +1 -1
  17. package/browser/esm/{CrTfqdSwWScJN566.mjs → CruGvs0fdtWWO_Di.mjs} +1 -1
  18. package/browser/esm/{B9wkino8VMasq6E3.mjs → Cw3PQMs1RDxzIo35.mjs} +2 -2
  19. package/browser/esm/{DhGJU1camaOf7KOq.mjs → D5r5ejlRpFFXN6TK.mjs} +4 -4
  20. package/browser/esm/{mUKvsPCmRWzQke-M.mjs → D952mmmww4cYPatc.mjs} +1 -1
  21. package/browser/esm/{QKnTzTdIYAMcBU8r.mjs → DQ5DeFNj_0mj6QMd.mjs} +1 -1
  22. package/browser/esm/{DyFeCww9e_4G9c-1.mjs → DSvlk_YzOev20rgN.mjs} +173 -160
  23. package/browser/esm/{Bjzo7g25tw9kTCYC.mjs → DedLmnV_HajYHYSM.mjs} +2 -2
  24. package/browser/esm/{DxsGY5rYjITV3SLK.mjs → G6Ek0k1QC1pUHvPd.mjs} +1 -1
  25. package/browser/esm/{HQkKZC6SPUdQwgxi.mjs → OPWkc7t367MwVsVU.mjs} +1 -1
  26. package/browser/esm/chart.mjs +11 -11
  27. package/browser/esm/control.mjs +16 -16
  28. package/browser/esm/group.mjs +29 -29
  29. package/browser/esm/index.mjs +3593 -3588
  30. package/browser/esm/note.mjs +10 -10
  31. package/browser/esm/picture.mjs +2 -2
  32. package/browser/esm/shape.mjs +2 -2
  33. package/browser/esm/slicer.mjs +55 -50
  34. package/node/esm/{CZc2QH8i-TgW9nGI.mjs → B5ae_WW6vAz2jOsn.mjs} +1 -1
  35. package/node/esm/{CcLUKcJROXrbSXjb.mjs → BD04OJgRWKiE2W1H.mjs} +1 -1
  36. package/node/esm/{l0GtU6LYlBywzc9T.mjs → BGLOvRRJr4nt8QdO.mjs} +2 -2
  37. package/node/esm/{CE5fMGMmykts2yJP.mjs → BKrvkWuGTMdkvdy6.mjs} +1 -1
  38. package/node/esm/{aLt3NYdUcYQu4Ur4.mjs → BMWwIbesFn8e6-Ov.mjs} +1 -1
  39. package/node/esm/{CfpNgRvWmu36cTfV.mjs → BhgjRcXOyNKBdqUW.mjs} +5 -5
  40. package/node/esm/{DX7ysYSfnigj0ak8.mjs → Bv0fGxNecKUr_qYS.mjs} +1 -1
  41. package/node/esm/{C3XXdc_UXH2g2W5E.mjs → CF5ztfx05vyEMEub.mjs} +1 -1
  42. package/node/esm/{C91YeRrspETjFcRc.mjs → CeSZX96RPPjn29Hw.mjs} +2 -2
  43. package/node/esm/{-6T2zqPkDm0WgUKI.mjs → CeuVkQpY8O4nZG-k.mjs} +2 -2
  44. package/node/esm/{FUQMKIiQQ5m3xzeO.mjs → Csl959_HnUC4Y06N.mjs} +1 -1
  45. package/node/esm/{cju5Gx-t_74o116W.mjs → Cx16BErZDzlQEXH_.mjs} +2 -2
  46. package/node/esm/{i4aPmKocZebCBeSd.mjs → D8mwVRSclIFn5SVM.mjs} +6 -6
  47. package/node/esm/{BPMjPMRyVTEZq_6j.mjs → DJyNfqgeIlJ6lOHS.mjs} +1 -1
  48. package/node/esm/{COlzVELrEvgm2STX.mjs → DL2RKBB2PXzdJyx_.mjs} +4 -4
  49. package/node/esm/{DHTbAHbCiEWhilV_.mjs → DmHHRlyfyFWj6wvW.mjs} +1 -1
  50. package/node/esm/{BcASbEBHzMKiXn5i.mjs → VFXZqkIvB9MDE2Ea.mjs} +1 -1
  51. package/node/esm/{GG78Gq3CY8SDS-48.mjs → YC2O0ix33xKY0ShQ.mjs} +12 -12
  52. package/node/esm/chart.mjs +19 -19
  53. package/node/esm/control.mjs +16 -16
  54. package/node/esm/group.mjs +27 -27
  55. package/node/esm/{CzQMRmArhJ6blZJp.mjs → iMUcM8KW4HIW2Ksm.mjs} +1 -1
  56. package/node/esm/index.mjs +3558 -3552
  57. package/node/esm/{BpcTu_chuDjr_XFv.mjs → k3c-0DQ1fifSFOnO.mjs} +1 -1
  58. package/node/esm/note.mjs +10 -10
  59. package/node/esm/picture.mjs +175 -162
  60. package/node/esm/shape.mjs +169 -169
  61. package/node/esm/slicer.mjs +100 -95
  62. package/node/esm/{DxKxx-yEkSydHyWQ.mjs → vYeFE_eUMRqsgnkd.mjs} +1 -1
  63. package/package.json +7 -7
  64. package/types/src/cell/CornerTriangle.d.ts +2 -1
  65. package/types/src/editor/SheetCellEditorLayer.d.ts +0 -5
  66. package/types/src/editor/formulaPresentation.d.ts +4 -3
  67. package/types/src/movable/IMovableArea.d.ts +11 -0
  68. package/types/src/sheet/IWorksheetElement.d.ts +13 -4
  69. package/types/src/theme/ExplicitTokens.d.ts +18 -0
  70. package/types/src/theme/ThemeRootStyles.d.ts +31 -0
  71. package/types/src/theme/buildTokensCSS.d.ts +15 -0
  72. package/types/src/theme/index.d.ts +2 -4
  73. package/types/src/theme/useAppColorScheme.d.ts +4 -1
  74. package/types/src/theme/useGridColorScheme.d.ts +2 -1
  75. package/types/src/theme/useSystemColors.d.ts +0 -14
  76. package/types/src/workbook/IWorkbookElement.d.ts +36 -8
@@ -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.22
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 "./DX7ysYSfnigj0ak8.mjs";
8
- import { n as t } from "./CzQMRmArhJ6blZJp.mjs";
9
- import { t as n } from "./C3XXdc_UXH2g2W5E.mjs";
10
- import { t as o } from "./BcASbEBHzMKiXn5i.mjs";
11
- import { i as r, n as s, r as i, t as l } from "./l0GtU6LYlBywzc9T.mjs";
12
- import { forwardRef as a, memo as p, useCallback as c, useEffect as d, useMemo as h, useReducer as u, useRef as m, useState as g } from "react";
13
- import { jsx as f, jsxs as v } from "react/jsx-runtime";
14
- import { messageKey as y } from "@sheetxl/utils";
15
- import { ReactUtils as x, useImperativeElement as w } from "@sheetxl/utils-react";
16
- import { createPortal as b } from "react-dom";
17
- var j = p(({ handles: e, width: t, height: n, zoom: o, onDrag: r }) => {
18
- const s = m(null), i = m(null), [l, a] = g(!1), p = c((e) => {
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 = c((e, t) => {
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 = c((e) => {
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 = p(e);
35
+ const n = c(e);
36
36
  n && r(t.index, n.x, n.y, "move");
37
- }, [p, r]), u = c((e) => {
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 = p(e);
41
+ const n = c(e);
42
42
  n ? r(t.index, n.x, n.y, "end") : r(t.index, 0, 0, "cancel");
43
- }, [p, r]), y = c((e) => {
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, w = 4.5 / x;
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) => v("g", {
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: w,
72
- fill: "#ffc000",
73
- stroke: "#7f6000",
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: w,
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: y,
90
+ onPointerCancel: v,
91
91
  onMouseDown: (e) => e.stopPropagation()
92
92
  })]
93
93
  }, e.index))
94
94
  });
95
95
  });
96
- j.displayName = "ShapeHandles";
97
- var T = (e, t) => e > 0 || t > 0, C = (e, t, n) => !e || e.getWidth() === t && e.getHeight() === n ? e : T(t, n) ? e.resize(t, n) : null, P = (e) => {
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
- }, S = p(a((a, p) => {
101
- const { children: S, disabled: E, style: A, shape: D, movable: N, zoom: z = 1, isDragging: I, onHide: H, onShow: M, onDragZone: $, adornmentHost: k, flip: R, gesture: O, debugGeometry: B = !1, ...F } = a, G = t()?.getStyles() ?? null, [W, X] = u((e) => e + 1, 0);
102
- e(D, { onAnyChange: X }), e(N ?? null, {
103
- onBoundsChange: X,
104
- onSelectionChange: X
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 J = D.toJSON(), { width: L, height: U, rotation: V, content: Y } = r(N), Z = D.getShapeType(), q = D.getAdjustments(), K = T(L, U), [Q, _] = g(null), ee = m(0);
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 (!K) return void _(null);
109
- const e = ++ee.current, t = D.getShapeType();
110
- D.getGeometry(L, U).then((n) => {
111
- ee.current === e && _(n ? {
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
- ee.current === e && _(null);
116
+ ne.current === e && te(null);
117
117
  });
118
118
  }, [
119
- D,
120
- L,
121
- U,
122
- W
119
+ N,
120
+ V,
121
+ Y,
122
+ J
123
123
  ]);
124
- const te = void 0 !== Y?.shapeType && Y.shapeType !== Z ? Y.shapeType : null, [ne, oe] = g(null);
124
+ const oe = void 0 !== q?.shapeType && q.shapeType !== K ? q.shapeType : null, [re, se] = g(null);
125
125
  d(() => {
126
- if (!te || !K || ne?.shapeType === te) return;
126
+ if (!oe || !_ || re?.shapeType === oe) return;
127
127
  let e = !0;
128
- return D.getGeometry(L, U, { shapeType: te }).then((t) => {
129
- e && t && oe({
130
- shapeType: te,
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
- D,
138
- te,
139
- K
137
+ N,
138
+ oe,
139
+ _
140
140
  ]);
141
- const re = h(() => {
142
- const e = Q?.shapeType === Z ? Q : ne?.shapeType === Z ? ne : null;
143
- return e ? C(e.geometry, L, U)?.withAdjustments(q) ?? null : C(Q?.geometry ?? null, L, U);
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
- ne,
147
- Z,
148
- q,
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 = N?.getParent() ?? null; t; t = t.getParent()) e.push(t.getContent().addListeners({ onAnyChange: X }));
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
- }, [N]);
159
- const ie = s(N), le = h(() => i(J, G, se, ie), [
160
- J,
161
- G,
162
- se,
163
- ie
164
- ]), [ae, pe] = g(null), ce = void 0 !== Y?.adjustments ? Y.adjustments : ae ?? void 0, de = h(() => {
165
- if (te && ne?.shapeType !== te) return re;
166
- const e = te ? C(ne.geometry, L, U) : re;
167
- return e && void 0 !== ce ? e.withAdjustments(ce) : e;
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
- te,
171
- ne,
172
- L,
173
- U,
174
- ce
175
- ]), he = m(null), [ue, me] = g(!1), ge = c((e, t, n, o) => {
176
- if ("cancel" === o) return he.current && (he.current = null, me(!1), O?.cancel()), void pe(null);
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 (O && !E) {
181
- if (!he.current) {
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 (!O.start(y("op.setShapeAdjustments"), t)) return;
186
- he.current = e, me(!0);
185
+ if (!F.start(v("op.setShapeAdjustments"), t)) return;
186
+ me.current = e, fe(!0);
187
187
  }
188
- he.current.adjustments = r, O.preview({ content: { adjustments: r } });
188
+ me.current.adjustments = r, F.preview({ content: { adjustments: r } });
189
189
  return;
190
190
  }
191
- pe(r);
191
+ de(r);
192
192
  return;
193
193
  }
194
- const s = he.current;
195
- if (s) return he.current = null, me(!1), s.adjustments = r, void O?.finish();
196
- pe(null), E || D.setAdjustments(r);
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
- de,
199
- re,
200
- D,
201
- E,
202
- O
203
- ]), fe = h(() => {
198
+ ue,
199
+ ie,
200
+ N,
201
+ A,
202
+ F
203
+ ]), ve = h(() => {
204
204
  const e = [];
205
- return de?.forEachHandle((t) => e.push(t)), e;
206
- }, [de]), ve = w(p, () => ({ isShapeEditor: () => !0 }), []), ye = R ?? N?.getFlip(), xe = ye?.horizontal ?? !1, we = ye?.vertical ?? !1, be = V % 360 != 0, je = h(() => !be && T(L, U) ? {
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: z,
209
- width: L,
210
- height: U,
211
- flipH: xe,
212
- flipV: we
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
- z,
216
- L,
217
- U,
218
- xe,
219
- we
219
+ je
220
220
  ]);
221
- if (D.isDeleted() || !J) return null;
222
- const Te = "none" === A?.pointerEvents, Ce = Te ? "none" : "visiblePainted", Pe = !Te && !E && (!I || ue) && !!N?.isSelected(), Se = {
223
- transform: xe || we ? `scale(${xe ? -1 : 1}, ${we ? -1 : 1})` : void 0,
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 Ee = null;
227
- Pe && fe.length > 0 && (Ee = f(j, {
228
- handles: fe,
229
- width: L,
230
- height: U,
231
- zoom: z,
232
- onDrag: ge
233
- }), k && (Ee = b(f("div", {
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
- ...Se,
241
+ ...Ae,
242
242
  pointerEvents: "none"
243
243
  },
244
- children: Ee
245
- }), k)));
246
- const Ae = xe !== we ? "scaleX(-1)" : void 0, De = de?.getTextRect(), Ne = J.text, ze = !!Ne && Ne.paragraphs.some((e) => e.runs.some((e) => "" !== e.text));
247
- return v("div", {
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
- ...F,
250
- ref: ve,
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: E ? "blur(1px)" : void 0,
257
- ...Se,
258
- ...A,
256
+ filter: A ? "blur(1px)" : void 0,
257
+ ...Ae,
258
+ ...D,
259
259
  pointerEvents: "none"
260
260
  },
261
261
  children: [
262
- T(L, U) ? v("svg", {
262
+ C(V, Y) ? y("svg", {
263
263
  className: "sxl-shape-geometry",
264
- viewBox: `0 0 ${L > 0 ? L : 1 / z} ${U > 0 ? U : 1 / z}`,
265
- width: L > 0 ? "100%" : "1px",
266
- height: U > 0 ? "100%" : "1px",
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: Pe ? "drop-shadow(1px 1px 2px var(--sxl-color-shadow, rgba(0, 0, 0, 0.15)))" : void 0
275
+ filter: Ee ? `drop-shadow(1px 1px 2px ${w("color-shadow")})` : void 0
276
276
  },
277
- children: [de ? f(l, {
278
- geometry: de,
279
- style: le,
280
- zoom: z,
281
- grid: je,
282
- hit: Ce
283
- }) : null, B && de && De ? v("g", {
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: De.l,
287
- y: De.t,
288
- width: Math.max(0, De.r - De.l),
289
- height: Math.max(0, De.b - De.t),
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: "#c00",
292
- strokeWidth: 1 / z,
293
- strokeDasharray: `${4 / z} ${2 / z}`
294
- }), P(de).map((e) => f("rect", {
295
- x: e.x - 3 / z,
296
- y: e.y - 3 / z,
297
- width: 6 / z,
298
- height: 6 / z,
299
- fill: "#0a0"
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
- ze && De ? f("div", {
303
+ $e && ze ? f("div", {
304
304
  className: "sxl-shape-text-frame",
305
305
  style: {
306
306
  position: "absolute",
307
- left: De.l,
308
- top: De.t,
309
- width: Math.max(0, De.r - De.l),
310
- height: Math.max(0, De.b - De.t),
311
- zoom: z,
312
- transform: Ae,
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: Te ? "none" : "auto",
315
- color: le.textColor ?? void 0
314
+ pointerEvents: Pe ? "none" : "auto",
315
+ color: ce.textColor ?? void 0
316
316
  },
317
317
  children: f(n, {
318
- movable: N,
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: Ne,
332
- styles: G,
333
- color: le.textColor
331
+ text: Ie,
332
+ styles: X,
333
+ color: ce.textColor
334
334
  })
335
335
  })
336
336
  }) : null,
337
- Ee
337
+ De
338
338
  ]
339
339
  });
340
340
  }));
341
- S.displayName = "ShapeEditor";
342
- export { S as ShapeEditor };
341
+ E.displayName = "ShapeEditor";
342
+ export { E as ShapeEditor };