@sheetxl/react 0.8.0-beta.11 → 0.8.0-beta.13

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 (141) hide show
  1. package/browser/esm/{B93LSmhnvkxNXTq-.mjs → -wQNyCnoJdQUTTfP.mjs} +1 -1
  2. package/browser/esm/{Bl2BFCQ00fotauKB.mjs → AL94cpxFjPurAMQG.mjs} +1 -1
  3. package/browser/esm/{BQYS2Yf-EAV_tBLr.mjs → B4K8rf7TAv0SBkbG.mjs} +1 -1
  4. package/browser/esm/{ClAtIfYbsUPA073B.mjs → BrwfFgqKdMG_-iar.mjs} +1 -1
  5. package/browser/esm/ByBGwdqhc_l75i5G.mjs +145 -0
  6. package/browser/esm/{DgL7Dy-Lqcr1TvW6.mjs → C1zqAqKQ6oa4FiTH.mjs} +4851 -4818
  7. package/browser/esm/C9lQPmVMIlUwXkKr.mjs +303 -0
  8. package/browser/esm/{Dnh1kpz3v1JKtRD_.mjs → CIrcPI7uOT93ydNn.mjs} +2 -2
  9. package/browser/esm/{DS66lAIM-9M-YoZQ.mjs → CZsNidKZjsn0lNnA.mjs} +112 -104
  10. package/browser/esm/{Bos4Rkp8UTF7QXUB.mjs → CcewpxckpDrXSiZ-.mjs} +1 -1
  11. package/browser/esm/{BegvsXeRs7e-9t8k.mjs → CdDvFP8Fqm8uU7Rw.mjs} +1 -1
  12. package/browser/esm/{D2u6THGErqw64KQI.mjs → CfewUx0gINn-wXt3.mjs} +1 -1
  13. package/browser/esm/{C1pc9F4Rt2C5FKUo.mjs → CfvYfq6ALVqkCsdg.mjs} +1 -1
  14. package/browser/esm/CulxiChz6lj3G9lw.mjs +341 -0
  15. package/browser/esm/D5Uy22WeT7vUS36Z.mjs +19 -0
  16. package/browser/esm/{1-LEUre9ZLG0OYYB.mjs → Dd8deQ2CDMdrhzF1.mjs} +6 -6
  17. package/browser/esm/Dit7p67J_fDF5RDj.mjs +262 -0
  18. package/browser/esm/{CPnnESfZz2jjJd82.mjs → DzWFl-_dCN-EOkio.mjs} +3 -3
  19. package/browser/esm/{94dxo1A-z8lgiiGw.mjs → MIDbAwdzknMaoTU5.mjs} +2 -2
  20. package/browser/esm/{B26QVfjer2oY2ewK.mjs → ao9zR4H88b7AmZEV.mjs} +1 -1
  21. package/browser/esm/chart.mjs +28 -27
  22. package/browser/esm/control.mjs +74 -73
  23. package/browser/esm/group.mjs +3 -3
  24. package/browser/esm/index.mjs +6195 -5307
  25. package/browser/esm/note.mjs +5 -5
  26. package/browser/esm/picture.mjs +2 -81
  27. package/browser/esm/sXn9faQLuh4P0TZ9.mjs +401 -0
  28. package/browser/esm/shape.mjs +2 -2
  29. package/browser/esm/slicer.mjs +112 -111
  30. package/browser/esm/{CzRIbc-Lk__VMLKM.mjs → u3A8I4A7GKIOLOOb.mjs} +3 -3
  31. package/browser/esm/{DMdsMPT0fWBbTkNn.mjs → x6A47UA3fzV361tO.mjs} +1 -1
  32. package/node/esm/{BiaDWnN3tT7neoRL.mjs → A_4Y7EtzCWp1AG3Y.mjs} +1 -1
  33. package/node/esm/BNwVylzKMErhrx4i.mjs +406 -0
  34. package/node/esm/BPBUSXc5TVnD15By.mjs +146 -0
  35. package/node/esm/{DxQZmb-j4NLUO9Af.mjs → BTT6UB5lGvPxcq3F.mjs} +1 -1
  36. package/node/esm/{JiQGhLkoL8CJpVvA.mjs → BYiAmyF-aOOuMkD1.mjs} +1 -1
  37. package/node/esm/BqS8o-CmPoCjHDHp.mjs +263 -0
  38. package/node/esm/{b-XRVRI1fYQQMkTC.mjs → CC_XgLOFPvqmFyZ_.mjs} +525 -492
  39. package/node/esm/{BaRfst1euuhquupX.mjs → CMGUrHMaBDeCezK5.mjs} +1 -1
  40. package/node/esm/{umljAT66yb3_rURh.mjs → CP07qkepi21zlB0n.mjs} +118 -110
  41. package/node/esm/{BlxXufqBBg1PtsXd.mjs → CQJJMfuXl6mbgHdT.mjs} +1 -1
  42. package/node/esm/{C_SNx7TlFEcwbYjx.mjs → CVDVFhM7OIpaOlyN.mjs} +1 -1
  43. package/node/esm/{gpD-9LDW92phhoma.mjs → CVMuO9bpR5YK0pPb.mjs} +1 -1
  44. package/node/esm/{BMVK5plvmBOAIlxP.mjs → CaZG4HD3SmHvD-Tu.mjs} +1 -1
  45. package/node/esm/{6zApGj9DozhFy-bx.mjs → CuRPfxQCj2jookWL.mjs} +1 -1
  46. package/node/esm/D8mYmUPUA6i8oFgR.mjs +19 -0
  47. package/node/esm/{Dj5FM7_-YWhCtCCt.mjs → DAUtyjkW5uSdnTli.mjs} +1 -1
  48. package/node/esm/{D_pCpfdQowV_4Aje.mjs → DfvJ0Dpn-AP2mGtz.mjs} +5 -5
  49. package/node/esm/{DTMTIrYIK1eZswsM.mjs → DipZYwHed-W6QMtQ.mjs} +1 -1
  50. package/node/esm/{Be9c1GwQkPo8Piuh.mjs → NvP_j9pSsDiJ_PyY.mjs} +3 -3
  51. package/node/esm/chart.mjs +26 -25
  52. package/node/esm/control.mjs +79 -78
  53. package/node/esm/{sigD1UFqvPlWUw_9.mjs → eecr5gnC2KqVhOzX.mjs} +2 -2
  54. package/node/esm/group.mjs +3 -3
  55. package/node/esm/index.mjs +6594 -5705
  56. package/node/esm/note.mjs +18 -18
  57. package/node/esm/picture.mjs +269 -50
  58. package/node/esm/shape.mjs +185 -578
  59. package/node/esm/slicer.mjs +51 -50
  60. package/package.json +7 -7
  61. package/resources/locales/de/picture.cmd.json +157 -0
  62. package/resources/locales/de/sheet.cmd.json +45 -2
  63. package/resources/locales/de/ui.msg.json +3 -0
  64. package/resources/locales/de/workbook.cmd.json +6 -0
  65. package/resources/locales/en/picture.cmd.json +157 -0
  66. package/resources/locales/en/sheet.cmd.json +45 -2
  67. package/resources/locales/en/ui.msg.json +5 -0
  68. package/resources/locales/en/workbook.cmd.json +6 -0
  69. package/types/src/border/useBorders.d.ts +2 -2
  70. package/types/src/cell/CellCheckboxRenderer.d.ts +20 -0
  71. package/types/src/cell/CellContent.d.ts +68 -0
  72. package/types/src/cell/CellControlContext.d.ts +37 -0
  73. package/types/src/cell/{FormulaCellRenderer.d.ts → CellFormulaRenderer.d.ts} +5 -5
  74. package/types/src/cell/CellImageRenderer.d.ts +11 -0
  75. package/types/src/cell/CellRenderers.d.ts +190 -0
  76. package/types/src/cell/{SheetCellRenderer.d.ts → CellTextRenderer.d.ts} +9 -6
  77. package/types/src/cell/ColumnButton.d.ts +3 -3
  78. package/types/src/cell/OutlineButton.d.ts +4 -4
  79. package/types/src/cell/SheetHeaderRenderer.d.ts +1 -1
  80. package/types/src/cell/index.d.ts +8 -2
  81. package/types/src/cell/useFormulaViewAnchor.d.ts +1 -1
  82. package/types/src/cell/useInsertableCellControls.d.ts +25 -0
  83. package/types/src/chart/ChartCommands.d.ts +1 -1
  84. package/types/src/chart/ChartEditor.d.ts +2 -0
  85. package/types/src/chart/ChartElement.d.ts +14 -3
  86. package/types/src/chart/paint/_graphics.d.ts +0 -8
  87. package/types/src/chart/paint/_mode.d.ts +6 -0
  88. package/types/src/chart/paint/echarts.d.ts +6 -3
  89. package/types/src/chart/paint/index.d.ts +1 -1
  90. package/types/src/chart/paint/kinds/ChartPaintKind.d.ts +9 -1
  91. package/types/src/chart/paint/kinds/_builtIns.d.ts +0 -9
  92. package/types/src/chart/paint/toEChartsOption.d.ts +12 -1
  93. package/types/src/editableLabel/EditableLabel.d.ts +3 -1
  94. package/types/src/editor/SheetReferenceHeaderLayer.d.ts +1 -1
  95. package/types/src/editor/useFormulaHints.d.ts +1 -1
  96. package/types/src/layer/CellErrorLayer.d.ts +3 -2
  97. package/types/src/layer/CellIndicatorLayer.d.ts +31 -0
  98. package/types/src/layer/CircularIndicatorLayer.d.ts +1 -1
  99. package/types/src/layer/HeaderSelectionLayer.d.ts +4 -4
  100. package/types/src/layer/HyperlinkLayer.d.ts +12 -5
  101. package/types/src/layer/ProtectionLayer.d.ts +1 -2
  102. package/types/src/layer/SheetCellLayer.d.ts +11 -4
  103. package/types/src/layer/SheetMovableLayer.d.ts +2 -1
  104. package/types/src/layer/SheetOutlineLayer.d.ts +1 -1
  105. package/types/src/layer/TableLayer.d.ts +1 -1
  106. package/types/src/layer/TableToolbar.d.ts +1 -1
  107. package/types/src/layer/ValidationPromptLayer.d.ts +16 -4
  108. package/types/src/layer/_visibleCellFeatures.d.ts +11 -0
  109. package/types/src/layer/index.d.ts +1 -0
  110. package/types/src/layer/useValidationPicker.d.ts +1 -1
  111. package/types/src/listener/useRangeListener.d.ts +13 -7
  112. package/types/src/movable/DefaultMovable.d.ts +1 -1
  113. package/types/src/movable/MovableControl.d.ts +3 -1
  114. package/types/src/movable/MovableFrame.d.ts +2 -1
  115. package/types/src/movable/MovableLayer.d.ts +6 -3
  116. package/types/src/movable/useFramePreview.d.ts +17 -0
  117. package/types/src/picture/PictureCommands.d.ts +8 -0
  118. package/types/src/picture/_pictureHyperlink.d.ts +13 -0
  119. package/types/src/picture/pictureCrop.d.ts +32 -0
  120. package/types/src/sheet/ISheetHeaderElement.d.ts +2 -2
  121. package/types/src/sheet/IWorksheetElement.d.ts +21 -22
  122. package/types/src/sheet/SheetCommandProvider.d.ts +3 -0
  123. package/types/src/sheet/SheetOutlineElement.d.ts +2 -2
  124. package/types/src/sheet/SheetPanels.d.ts +2 -2
  125. package/types/src/sheet/_hyperlinkEdit.d.ts +7 -0
  126. package/types/src/sheet/circularReferences.d.ts +1 -1
  127. package/types/src/tabStrip/Sortable.d.ts +5 -5
  128. package/types/src/tabStrip/TabStrip.d.ts +6 -6
  129. package/types/src/tabStrip/TabStripItem.d.ts +15 -13
  130. package/types/src/taskPane/CellControlPane.d.ts +17 -0
  131. package/types/src/taskPane/index.d.ts +1 -0
  132. package/types/src/taskPane/useTaskPane.d.ts +6 -3
  133. package/types/src/theme/buildDocThemeCSS.d.ts +4 -1
  134. package/types/src/workbook/DefaultRenderers.d.ts +4 -4
  135. package/types/src/workbook/IWorkbookElement.d.ts +52 -20
  136. package/types/src/workbook/WorkbookStrip.d.ts +5 -5
  137. package/browser/esm/CRi6DQ3UXmPEv-w_.mjs +0 -729
  138. package/browser/esm/cQ6xdPFkEcuDlNTN.mjs +0 -75
  139. package/browser/esm/ugfE7YeZALQURDKF.mjs +0 -241
  140. package/node/esm/DJPgbB1X22YmhbaR.mjs +0 -242
  141. package/node/esm/DgGEHydEjD7nfsDB.mjs +0 -76
@@ -0,0 +1,341 @@
1
+ /**
2
+ * @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.8.0-beta.13
3
+ *
4
+ * (C) 2026-present SheetXL Inc. & Michael T. Ford
5
+ * License: The license can be found at https://www.sheetxl.com/license.
6
+ */
7
+ import { t as e } from "./CfvYfq6ALVqkCsdg.mjs";
8
+ import { n as t } from "./B4K8rf7TAv0SBkbG.mjs";
9
+ import { t as n } from "./CfewUx0gINn-wXt3.mjs";
10
+ import { t as r } from "./DzWFl-_dCN-EOkio.mjs";
11
+ import { i, n as a, r as o, t as ee } from "./sXn9faQLuh4P0TZ9.mjs";
12
+ import { forwardRef as s, memo as c, useCallback as l, useEffect as u, useMemo as d, useReducer as f, useRef as p, useState as m } from "react";
13
+ import { jsx as h, jsxs as g } from "react/jsx-runtime";
14
+ import { messageKey as te } from "@sheetxl/utils";
15
+ import { ReactUtils as _, useImperativeElement as v } from "@sheetxl/utils-react";
16
+ import { createPortal as ne } from "react-dom";
17
+ var re = c(({ handles: e, width: t, height: n, zoom: r, onDrag: i }) => {
18
+ let a = p(null), o = p(null), [ee, s] = m(!1), c = l((e) => {
19
+ let t = a.current, n = t?.getScreenCTM();
20
+ if (!t || !n) return null;
21
+ let r = new DOMPoint(e.clientX, e.clientY).matrixTransform(n.inverse());
22
+ return {
23
+ x: r.x,
24
+ y: r.y
25
+ };
26
+ }, []), u = l((e, t) => {
27
+ e.button === 0 && (e.stopPropagation(), e.preventDefault(), o.current = {
28
+ index: t,
29
+ pointerId: e.pointerId
30
+ }, e.currentTarget.setPointerCapture(e.pointerId), s(!0));
31
+ }, []), d = l((e) => {
32
+ let t = o.current;
33
+ if (!t || t.pointerId !== e.pointerId) return;
34
+ e.stopPropagation();
35
+ let n = c(e);
36
+ n && i(t.index, n.x, n.y, "move");
37
+ }, [c, i]), f = l((e) => {
38
+ let t = o.current;
39
+ if (!t || t.pointerId !== e.pointerId) return;
40
+ e.stopPropagation(), o.current = null, s(!1);
41
+ let n = c(e);
42
+ n ? i(t.index, n.x, n.y, "end") : i(t.index, 0, 0, "cancel");
43
+ }, [c, i]), te = l((e) => {
44
+ let t = o.current;
45
+ t && t.pointerId === e.pointerId && (o.current = null, s(!1), i(t.index, 0, 0, "cancel"));
46
+ }, [i]);
47
+ if (!(e.length !== 0 && t > 0 && n > 0)) return null;
48
+ let _ = r > 0 ? r : 1, v = 4.5 / _;
49
+ return h("svg", {
50
+ ref: a,
51
+ className: ee ? "shape-handles movable-gesture" : "shape-handles",
52
+ viewBox: `0 0 ${t} ${n}`,
53
+ width: "100%",
54
+ height: "100%",
55
+ preserveAspectRatio: "none",
56
+ overflow: "visible",
57
+ style: {
58
+ position: "absolute",
59
+ left: 0,
60
+ top: 0,
61
+ display: "block",
62
+ pointerEvents: "none",
63
+ touchAction: "none"
64
+ },
65
+ children: e.map((e) => g("g", {
66
+ className: "shape-handle",
67
+ style: { "--shape-scale": _ },
68
+ children: [h("circle", {
69
+ cx: e.x,
70
+ cy: e.y,
71
+ r: v,
72
+ fill: "#ffc000",
73
+ stroke: "#7f6000",
74
+ strokeWidth: 1 / _,
75
+ style: { pointerEvents: "none" }
76
+ }), h("circle", {
77
+ className: "shape-handle-hit",
78
+ cx: e.x,
79
+ cy: e.y,
80
+ r: v,
81
+ fill: "transparent",
82
+ style: {
83
+ pointerEvents: "all",
84
+ cursor: "crosshair",
85
+ touchAction: "none"
86
+ },
87
+ onPointerDown: (t) => u(t, e.index),
88
+ onPointerMove: d,
89
+ onPointerUp: f,
90
+ onPointerCancel: te,
91
+ onMouseDown: (e) => e.stopPropagation()
92
+ })]
93
+ }, e.index))
94
+ });
95
+ });
96
+ re.displayName = "ShapeHandles";
97
+ var y = (e, t) => e > 0 || t > 0, b = (e, t, n) => !e || e.getWidth() === t && e.getHeight() === n ? e : y(t, n) ? e.resize(t, n) : null, ie = (e) => {
98
+ let t = [];
99
+ return e.forEachConnection((e) => t.push(e)), t;
100
+ }, x = c(s((s, c) => {
101
+ let { children: x, disabled: S, style: ae, shape: C, movable: w, zoom: T = 1, isDragging: oe, onHide: se, onShow: ce, onDragZone: le, adornmentHost: ue, flip: de, gesture: E, debugGeometry: fe = !1, ...pe } = s, D = t()?.getStyles() ?? null, [me, O] = f((e) => e + 1, 0);
102
+ e(C, { onAnyChange: O }), e(w ?? null, {
103
+ onBoundsChange: O,
104
+ onSelectionChange: O
105
+ });
106
+ let k = C.toJSON(), { width: A, height: j, rotation: he, content: M } = i(w), N = C.getShapeType(), ge = C.getAdjustments(), P = y(A, j), [F, I] = m(null), L = p(0);
107
+ u(() => {
108
+ if (!P) return void I(null);
109
+ let e = ++L.current, t = C.getShapeType();
110
+ C.getGeometry(A, j).then((n) => {
111
+ L.current === e && I(n ? {
112
+ shapeType: t,
113
+ geometry: n
114
+ } : null);
115
+ }, () => {
116
+ L.current === e && I(null);
117
+ });
118
+ }, [
119
+ C,
120
+ A,
121
+ j,
122
+ me
123
+ ]);
124
+ let R = M?.shapeType !== void 0 && M.shapeType !== N ? M.shapeType : null, [z, _e] = m(null);
125
+ u(() => {
126
+ if (!R || !P || z?.shapeType === R) return;
127
+ let e = !0;
128
+ return C.getGeometry(A, j, { shapeType: R }).then((t) => {
129
+ e && t && _e({
130
+ shapeType: R,
131
+ geometry: t
132
+ });
133
+ }, () => {}), () => {
134
+ e = !1;
135
+ };
136
+ }, [
137
+ C,
138
+ R,
139
+ P
140
+ ]);
141
+ let B = d(() => {
142
+ let e = F?.shapeType === N ? F : z?.shapeType === N ? z : null;
143
+ return e ? b(e.geometry, A, j)?.withAdjustments(ge) ?? null : b(F?.geometry ?? null, A, j);
144
+ }, [
145
+ F,
146
+ z,
147
+ N,
148
+ ge,
149
+ A,
150
+ j
151
+ ]), ve = l((e) => C.getResource(e), [C]);
152
+ u(() => {
153
+ let e = [];
154
+ for (let t = w?.getParent() ?? null; t; t = t.getParent()) e.push(t.getContent().addListeners({ onAnyChange: O }));
155
+ return () => {
156
+ for (let t of e) t();
157
+ };
158
+ }, [w]);
159
+ let V = a(w), H = d(() => o(k, D, ve, V), [
160
+ k,
161
+ D,
162
+ ve,
163
+ V
164
+ ]), [ye, U] = m(null), W = M?.adjustments === void 0 ? ye ?? void 0 : M.adjustments, G = d(() => {
165
+ if (R && z?.shapeType !== R) return B;
166
+ let e = R ? b(z.geometry, A, j) : B;
167
+ return e && W !== void 0 ? e.withAdjustments(W) : e;
168
+ }, [
169
+ B,
170
+ R,
171
+ z,
172
+ A,
173
+ j,
174
+ W
175
+ ]), K = p(null), [be, q] = m(!1), xe = l((e, t, n, r) => {
176
+ if (r === "cancel") return K.current && (K.current = null, q(!1), E?.cancel()), void U(null);
177
+ if (!G || !B) return;
178
+ let i = G.adjustmentsFromHandle(e, t, n);
179
+ if (r === "move") {
180
+ if (E && !S) {
181
+ if (!K.current) {
182
+ let e = { adjustments: i };
183
+ if (!E.start(te("op.setShapeAdjustments"), (t) => {
184
+ t.getContent().setAdjustments(e.adjustments);
185
+ })) return;
186
+ K.current = e, q(!0);
187
+ }
188
+ K.current.adjustments = i, E.preview({ content: { adjustments: i } });
189
+ return;
190
+ }
191
+ U(i);
192
+ return;
193
+ }
194
+ let a = K.current;
195
+ if (a) return K.current = null, q(!1), a.adjustments = i, void E?.finish();
196
+ U(null), S || C.setAdjustments(i);
197
+ }, [
198
+ G,
199
+ B,
200
+ C,
201
+ S,
202
+ E
203
+ ]), Se = d(() => {
204
+ let e = [];
205
+ return G?.forEachHandle((t) => e.push(t)), e;
206
+ }, [G]), Ce = v(c, () => ({ isShapeEditor: () => !0 }), []), we = de ?? w?.getFlip(), J = we?.horizontal ?? !1, Y = we?.vertical ?? !1, Te = he % 360 != 0, Ee = d(() => !Te && y(A, j) ? {
207
+ dpr: _.getDevicePixelRatio(),
208
+ zoom: T,
209
+ width: A,
210
+ height: j,
211
+ flipH: J,
212
+ flipV: Y
213
+ } : null, [
214
+ Te,
215
+ T,
216
+ A,
217
+ j,
218
+ J,
219
+ Y
220
+ ]);
221
+ if (C.isDeleted() || !k) return null;
222
+ let X = ae?.pointerEvents === "none", De = X ? "none" : "visiblePainted", Oe = !X && !S && (!oe || be) && !!w?.isSelected(), ke = {
223
+ transform: J || Y ? `scale(${J ? -1 : 1}, ${Y ? -1 : 1})` : void 0,
224
+ transformOrigin: "center"
225
+ }, Z = null;
226
+ Oe && Se.length > 0 && (Z = h(re, {
227
+ handles: Se,
228
+ width: A,
229
+ height: j,
230
+ zoom: T,
231
+ onDrag: xe
232
+ }), ue && (Z = ne(h("div", {
233
+ className: "shape-adornment",
234
+ style: {
235
+ position: "absolute",
236
+ left: 0,
237
+ top: 0,
238
+ width: "100%",
239
+ height: "100%",
240
+ ...ke,
241
+ pointerEvents: "none"
242
+ },
243
+ children: Z
244
+ }), ue)));
245
+ let Ae = J === Y ? void 0 : "scaleX(-1)", Q = G?.getTextRect(), $ = k.text, je = !!$ && $.paragraphs.some((e) => e.runs.some((e) => e.text !== ""));
246
+ return g("div", {
247
+ className: "shape-editor",
248
+ ...pe,
249
+ ref: Ce,
250
+ style: {
251
+ width: "100%",
252
+ height: "100%",
253
+ position: "relative",
254
+ overflow: "visible",
255
+ filter: S ? "blur(1px)" : void 0,
256
+ ...ke,
257
+ ...ae,
258
+ pointerEvents: "none"
259
+ },
260
+ children: [
261
+ y(A, j) ? g("svg", {
262
+ className: "shape-geometry",
263
+ viewBox: `0 0 ${A > 0 ? A : 1 / T} ${j > 0 ? j : 1 / T}`,
264
+ width: A > 0 ? "100%" : "1px",
265
+ height: j > 0 ? "100%" : "1px",
266
+ preserveAspectRatio: "none",
267
+ overflow: "visible",
268
+ style: {
269
+ position: "absolute",
270
+ left: 0,
271
+ top: 0,
272
+ display: "block",
273
+ pointerEvents: "none",
274
+ filter: Oe ? "drop-shadow(1px 1px 2px rgba(0,0,0,.15))" : void 0
275
+ },
276
+ children: [G ? h(ee, {
277
+ geometry: G,
278
+ style: H,
279
+ zoom: T,
280
+ grid: Ee,
281
+ hit: De
282
+ }) : null, fe && G && Q ? g("g", {
283
+ pointerEvents: "none",
284
+ children: [h("rect", {
285
+ x: Q.l,
286
+ y: Q.t,
287
+ width: Math.max(0, Q.r - Q.l),
288
+ height: Math.max(0, Q.b - Q.t),
289
+ fill: "none",
290
+ stroke: "#c00",
291
+ strokeWidth: 1 / T,
292
+ strokeDasharray: `${4 / T} ${2 / T}`
293
+ }), ie(G).map((e) => h("rect", {
294
+ x: e.x - 3 / T,
295
+ y: e.y - 3 / T,
296
+ width: 6 / T,
297
+ height: 6 / T,
298
+ fill: "#0a0"
299
+ }, e.index))]
300
+ }) : null]
301
+ }) : null,
302
+ je && Q ? h("div", {
303
+ className: "shape-text-frame",
304
+ style: {
305
+ position: "absolute",
306
+ left: Q.l,
307
+ top: Q.t,
308
+ width: Math.max(0, Q.r - Q.l),
309
+ height: Math.max(0, Q.b - Q.t),
310
+ zoom: T,
311
+ transform: Ae,
312
+ transformOrigin: "center",
313
+ pointerEvents: X ? "none" : "auto",
314
+ color: H.textColor ?? void 0
315
+ },
316
+ children: h(n, {
317
+ movable: w,
318
+ disabled: !0,
319
+ style: {
320
+ fontFamily: "Calibri, Carlito, sans-serif",
321
+ fontSize: "11pt",
322
+ lineHeight: 1.2,
323
+ padding: 0
324
+ },
325
+ contentStyle: {
326
+ padding: 0,
327
+ overflow: "hidden"
328
+ },
329
+ children: h(r, {
330
+ text: $,
331
+ styles: D,
332
+ color: H.textColor
333
+ })
334
+ })
335
+ }) : null,
336
+ Z
337
+ ]
338
+ });
339
+ }));
340
+ x.displayName = "ShapeEditor";
341
+ export { x as t };
@@ -0,0 +1,19 @@
1
+ /**
2
+ * @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.8.0-beta.13
3
+ *
4
+ * (C) 2026-present SheetXL Inc. & Michael T. Ford
5
+ * License: The license can be found at https://www.sheetxl.com/license.
6
+ */
7
+ import { messageKey as e } from "@sheetxl/utils";
8
+ var t = "hovered-picture-link", n = (t, n, r) => {
9
+ r?.showWindow?.("hyperlink", {
10
+ disabled: t.isReadOnly(),
11
+ initialValue: t.getHyperlink()?.getAddress() ?? null,
12
+ hideDisplayText: !0,
13
+ sheetName: n.getName(),
14
+ onInput: (n) => {
15
+ t.setHyperlink(n?.address ? n.address : null, { description: e("op.setPictureHyperlink") });
16
+ }
17
+ });
18
+ };
19
+ export { n, t };
@@ -1,14 +1,14 @@
1
1
  /**
2
- * @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.8.0-beta.11
2
+ * @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.8.0-beta.13
3
3
  *
4
4
  * (C) 2026-present SheetXL Inc. & Michael T. Ford
5
5
  * License: The license can be found at https://www.sheetxl.com/license.
6
6
  */
7
- import { t as e } from "./C1pc9F4Rt2C5FKUo.mjs";
8
- import { d as t } from "./DS66lAIM-9M-YoZQ.mjs";
9
- import { t as n } from "./BegvsXeRs7e-9t8k.mjs";
10
- import { n as r } from "./Bl2BFCQ00fotauKB.mjs";
11
- import { t as i } from "./CRi6DQ3UXmPEv-w_.mjs";
7
+ import { t as e } from "./CfvYfq6ALVqkCsdg.mjs";
8
+ import { d as t } from "./CZsNidKZjsn0lNnA.mjs";
9
+ import { t as n } from "./CdDvFP8Fqm8uU7Rw.mjs";
10
+ import { n as r } from "./AL94cpxFjPurAMQG.mjs";
11
+ import { t as i } from "./CulxiChz6lj3G9lw.mjs";
12
12
  import { memo as a, useCallback as o, useReducer as s, useRef as c } from "react";
13
13
  import { jsx as l } from "react/jsx-runtime";
14
14
  import { messageKey as u } from "@sheetxl/utils";
@@ -0,0 +1,262 @@
1
+ /**
2
+ * @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.8.0-beta.13
3
+ *
4
+ * (C) 2026-present SheetXL Inc. & Michael T. Ford
5
+ * License: The license can be found at https://www.sheetxl.com/license.
6
+ */
7
+ import { t as e } from "./CcewpxckpDrXSiZ-.mjs";
8
+ import { forwardRef as t, memo as n, useCallback as r, useEffect as i, useLayoutEffect as a, useRef as o, useState as s } from "react";
9
+ import { jsx as c, jsxs as l } from "react/jsx-runtime";
10
+ import { CommonUtils as u, defineLazyModule as ee } from "@sheetxl/utils";
11
+ import { useImperativeElement as te, useMeasure as ne, usePendingRender as re, usePersistentState as d, useResolvedThemeMode as f } from "@sheetxl/utils-react";
12
+ var p = {
13
+ Mode: "themeMode",
14
+ DarkGrid: "enableDarkGrid",
15
+ DarkImages: "enableDarkImages"
16
+ }, m = {
17
+ [p.Mode]: null,
18
+ [p.DarkGrid]: !1,
19
+ [p.DarkImages]: !1
20
+ }, h = (e) => {
21
+ let [t] = d(p.Mode, m[p.Mode]), [n] = d(p.DarkGrid, m[p.DarkGrid]), { themeMode: r } = f({ mode: e ?? t ?? void 0 });
22
+ return e || (r === "dark" && n ? "dark" : "light");
23
+ }, g = () => {
24
+ let [e] = d(p.Mode, m[p.Mode]), { themeMode: t } = f({ mode: e ?? void 0 });
25
+ return t;
26
+ }, _ = ee("chart:paint", () => import("./C1zqAqKQ6oa4FiTH.mjs")), v = (e, t) => {
27
+ let n = e.getElementType();
28
+ if (n === "point") {
29
+ let n = e.getParent();
30
+ return t === n || t?.getElementType() === "point" && t.getParent() === n ? e : n;
31
+ }
32
+ if (n === "legendEntry") {
33
+ let n = e.getParent();
34
+ return t === n || t?.getElementType() === "legendEntry" ? e : n;
35
+ }
36
+ if (n === "dataLabel") {
37
+ let n = e.getParent()?.getParent(), r = n?.getDataLabels();
38
+ return r ? t === r || t?.getElementType() === "dataLabel" && t.getParent()?.getParent() === n ? e : r : e;
39
+ }
40
+ return e;
41
+ }, y = {
42
+ boxes: [],
43
+ handles: []
44
+ }, b = n(t((t, n) => {
45
+ let { children: ee, style: d, chart: f, onChartChange: p, zoom: m = 1, width: h, height: b, selection: x = null, colorScheme: ie, onElementPress: S, onPointerDown: C, ...w } = t, [T, ae] = s(() => u.isPromiseLike(f) ? null : f), [E, oe] = s(null), D = o(p);
46
+ D.current = p;
47
+ let O = o(null);
48
+ i(() => {
49
+ let e = !0, t = (e, t) => {
50
+ oe(t), ae(e), O.current !== e && (O.current = e, D.current?.(e));
51
+ };
52
+ if (u.isPromiseLike(f)) return f.then((n) => {
53
+ e && t(n, null);
54
+ }, (n) => {
55
+ e && t(null, n);
56
+ }), () => {
57
+ e = !1;
58
+ };
59
+ t(f, null);
60
+ }, [f]);
61
+ let [k, A] = ne(), j = typeof h == "number" ? h : A.width, M = typeof b == "number" ? b : A.height, N = j ? Math.round(j / m) : 0, P = M ? Math.round(M / m) : 0, F = o({
62
+ width: N,
63
+ height: P
64
+ });
65
+ F.current = {
66
+ width: N,
67
+ height: P
68
+ };
69
+ let I = g(), L = (ie ?? I) === "dark", R = r(async (e) => {
70
+ let t = F.current;
71
+ if (!T || !t.width || !t.height) return null;
72
+ let n = T.getLayout(t);
73
+ return n ? (await _.load()).renderChartToSVG(n, { darkMode: e?.darkMode ?? !1 }) : null;
74
+ }, [T]), z = o(null), B = o(null), V = o(m);
75
+ V.current = m;
76
+ let H = r((e, t) => {
77
+ let n = z.current;
78
+ if (!n) return null;
79
+ let r = n.getBoundingClientRect(), i = V.current || 1;
80
+ return {
81
+ x: (e - r.left) / i,
82
+ y: (t - r.top) / i
83
+ };
84
+ }, []), U = r((e, t) => {
85
+ let n = B.current, r = H(e, t);
86
+ return T && n && r ? T.getElementAt(r, n) : null;
87
+ }, [T, H]), W = te(n, () => ({
88
+ isChartElement: () => !0,
89
+ getChart: () => T,
90
+ toSVG: R,
91
+ getElementAt: U
92
+ }), [
93
+ T,
94
+ R,
95
+ U
96
+ ]), G = e([
97
+ W,
98
+ k,
99
+ z
100
+ ]), K = o(null), q = o(null), [J, Y] = s(() => _.peek() ?? null), [X, se] = s(null), [ce, le] = s(0), [Z, ue] = s(y);
101
+ i(() => T?.addListeners({ onLayoutChange: () => le((e) => e + 1) }), [T]), re(!(X || E || J && T)), i(() => {
102
+ if (J) return;
103
+ let e = !0;
104
+ return _.load().then((t) => {
105
+ e && Y(t);
106
+ }, (t) => {
107
+ e && se(t);
108
+ }), () => {
109
+ e = !1;
110
+ };
111
+ }, [J]);
112
+ let Q = r(() => {
113
+ let e = B.current;
114
+ ue(T && e && x && !x.isEmpty() ? ((e, t, n) => {
115
+ let r = [], i = [];
116
+ for (let a of n.getItems()) {
117
+ if (a.getChart() !== e) continue;
118
+ let o = a.getElementType();
119
+ if (o === "series" || o === "dataLabels") {
120
+ let n = o === "series" ? a : a.getParent(), i = o === "series" ? n.getPoints() : n.getPoints().map((e) => e.getDataLabel());
121
+ for (let n of i) {
122
+ let i = e.getElementBounds(n, t);
123
+ i && r.push(i);
124
+ }
125
+ if (r.length > 0) continue;
126
+ }
127
+ let s = e.getElementBounds(a, t);
128
+ if (s && (r.push(s), n.getItems().length === 1)) {
129
+ let e = [
130
+ s.x,
131
+ s.x + s.width / 2,
132
+ s.x + s.width
133
+ ], t = [
134
+ s.y,
135
+ s.y + s.height / 2,
136
+ s.y + s.height
137
+ ];
138
+ for (let n of e) for (let r of t) n === e[1] && r === t[1] || i.push({
139
+ x: n,
140
+ y: r
141
+ });
142
+ }
143
+ }
144
+ return {
145
+ boxes: r,
146
+ handles: i
147
+ };
148
+ })(T, e, x) : y);
149
+ }, [T, x]);
150
+ i(() => x?.addListeners({ onChange: Q }), [x, Q]), a(() => {
151
+ let e = K.current;
152
+ if (!(J && e && T && N && P)) return;
153
+ let t = T.getLayout({
154
+ width: N,
155
+ height: P
156
+ });
157
+ if (B.current = t, !t) return q.current?.dispose(), q.current = null, e.style.backgroundColor = "", void Q();
158
+ let n = t.chartArea.fill === void 0;
159
+ e.style.backgroundColor = n ? `var(--sxl-color-base-100, ${L ? "#121212" : "#FFFFFF"})` : "", e.style.borderRadius = n ? `${t.chartArea.cornerRadius}px` : "";
160
+ let r = {
161
+ darkMode: L,
162
+ background: "transparent"
163
+ };
164
+ q.current ? q.current.update(t, r) : q.current = J.mountChart(e, t, r), Q();
165
+ }, [
166
+ J,
167
+ T,
168
+ N,
169
+ P,
170
+ ce,
171
+ L,
172
+ Q
173
+ ]), i(() => () => {
174
+ q.current?.dispose(), q.current = null, B.current = null;
175
+ }, [T]);
176
+ let de = r((e) => {
177
+ if (C?.(e), e.button !== 0 && e.button !== 2) return;
178
+ let t = B.current, n = H(e.clientX, e.clientY);
179
+ if (!T || !t || !n) return;
180
+ let r = T.getElementAt(n, t);
181
+ if (S?.({
182
+ element: r,
183
+ point: n,
184
+ event: e
185
+ }), !x) return;
186
+ if (!r || r.getElementType() === "chartArea") return void x.clear();
187
+ let i = v(r, x.getActive());
188
+ x.isSelected(i) && x.getItems().length === 1 || x.select([i]);
189
+ }, [
190
+ T,
191
+ x,
192
+ S,
193
+ C,
194
+ H
195
+ ]);
196
+ if (T?.isDeleted()) return;
197
+ let $ = X ?? E;
198
+ return l("div", {
199
+ ...w,
200
+ onPointerDown: de,
201
+ style: {
202
+ ...h === void 0 ? {} : { width: h },
203
+ ...b === void 0 ? {} : { height: b },
204
+ ...d,
205
+ overflow: "hidden"
206
+ },
207
+ ref: G,
208
+ children: [
209
+ $ ? c("div", {
210
+ className: "chart-element-error",
211
+ style: {
212
+ padding: "8px",
213
+ fontSize: "12px",
214
+ color: "var(--sxl-color-error, #b00020)"
215
+ },
216
+ children: $.message
217
+ }) : null,
218
+ c("div", {
219
+ className: "chart-element",
220
+ ref: K,
221
+ style: {
222
+ width: N || "100%",
223
+ height: P || "100%",
224
+ zoom: m,
225
+ position: "relative"
226
+ }
227
+ }),
228
+ Z.boxes.length > 0 ? l("div", {
229
+ className: "chart-element-selection",
230
+ style: {
231
+ position: "absolute",
232
+ left: 0,
233
+ top: 0,
234
+ width: N,
235
+ height: P,
236
+ zoom: m,
237
+ pointerEvents: "none"
238
+ },
239
+ children: [Z.boxes.map((e, t) => c("div", { style: {
240
+ position: "absolute",
241
+ left: e.x - 1,
242
+ top: e.y - 1,
243
+ width: Math.max(0, e.width),
244
+ height: Math.max(0, e.height),
245
+ border: "1px solid var(--sxl-color-primary, #1a73e8)",
246
+ boxSizing: "content-box"
247
+ } }, `box-${t}`)), Z.handles.map((e, t) => c("div", { style: {
248
+ position: "absolute",
249
+ left: e.x - 3,
250
+ top: e.y - 3,
251
+ width: 6,
252
+ height: 6,
253
+ background: "var(--sxl-color-base-100, #fff)",
254
+ border: "1px solid var(--sxl-color-primary, #1a73e8)",
255
+ boxSizing: "border-box"
256
+ } }, `handle-${t}`))]
257
+ }) : null
258
+ ]
259
+ });
260
+ }));
261
+ b.displayName = "ChartElement";
262
+ export { m as a, h as i, v as n, p as o, g as r, b as t };
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.8.0-beta.11
2
+ * @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.8.0-beta.13
3
3
  *
4
4
  * (C) 2026-present SheetXL Inc. & Michael T. Ford
5
5
  * License: The license can be found at https://www.sheetxl.com/license.
@@ -46,13 +46,13 @@ var l = (n, r) => {
46
46
  }, p = (e, t) => e ? "percent" in e ? e.percent / 100 * 1.2 : `${e.points}pt` : t, m = (e, t, r) => {
47
47
  let i = [];
48
48
  t.underline && t.underline !== "none" && i.push("underline"), t.strike && t.strike !== "none" && i.push("line-through");
49
- let a = t.font?.family ?? t.font?.fallbacks?.[0];
49
+ let a = [t.font?.family, ...t.font?.fallbacks ?? []].filter((e) => !!e);
50
50
  return {
51
51
  fontSize: typeof t.size == "number" ? `${t.size}pt` : void 0,
52
52
  fontWeight: t.weight,
53
53
  fontStyle: t.style === n.Style.Italic ? "italic" : void 0,
54
54
  textDecoration: i.length ? i.join(" ") : void 0,
55
- fontFamily: a,
55
+ fontFamily: a.length ? n.toCSSFontFamily(a[0], a.slice(1)) : void 0,
56
56
  color: l(e, t.color) ?? r ?? void 0,
57
57
  letterSpacing: typeof t.letterSpacing == "number" ? `${t.letterSpacing}pt` : void 0,
58
58
  verticalAlign: typeof t.baseline == "number" && t.baseline !== 0 ? `${t.baseline}%` : void 0,
@@ -1,10 +1,10 @@
1
1
  /**
2
- * @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.8.0-beta.11
2
+ * @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.8.0-beta.13
3
3
  *
4
4
  * (C) 2026-present SheetXL Inc. & Michael T. Ford
5
5
  * License: The license can be found at https://www.sheetxl.com/license.
6
6
  */
7
- import { n as e } from "./Bl2BFCQ00fotauKB.mjs";
7
+ import { n as e } from "./AL94cpxFjPurAMQG.mjs";
8
8
  import { ChartEditor as t } from "./chart.mjs";
9
9
  import { jsx as n } from "react/jsx-runtime";
10
10
  import { messageKey as r, t as i } from "@sheetxl/utils";
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.8.0-beta.11
2
+ * @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.8.0-beta.13
3
3
  *
4
4
  * (C) 2026-present SheetXL Inc. & Michael T. Ford
5
5
  * License: The license can be found at https://www.sheetxl.com/license.