@sheetxl/react 0.8.0-beta.1 → 0.8.0-beta.10

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 (248) hide show
  1. package/browser/esm/BHjeSMaycUkS5dVL.mjs +66 -0
  2. package/browser/esm/BZcQ-KYwS62Ut45c.mjs +20 -0
  3. package/browser/esm/Bow9CzRJrYxak2i5.mjs +318 -0
  4. package/browser/esm/BuvXl14hs-1CvjeA.mjs +2706 -0
  5. package/browser/esm/BwRduT8FTrk5n72r.mjs +32 -0
  6. package/browser/esm/C6urN77szrYwODXF.mjs +134 -0
  7. package/browser/esm/CYMRbtPIr6SklGpp.mjs +775 -0
  8. package/browser/esm/CYoUd5KIl7W3AsxH.mjs +196 -0
  9. package/browser/esm/Cfe0kofqVKGxLqO6.mjs +31 -0
  10. package/browser/esm/CiRN-woJZWYOgTn4.mjs +36 -0
  11. package/browser/esm/Dd-ZybXAgoq9pgGv.mjs +45 -0
  12. package/browser/esm/DjiBz4H74I6nPUY6.mjs +79 -0
  13. package/browser/esm/DyU9UInRnfkPYYlR.mjs +63 -0
  14. package/browser/esm/J8cPagZBeXz86Lnd.mjs +777 -0
  15. package/browser/esm/Sp6PJavGKpF8SJzA.mjs +75 -0
  16. package/browser/esm/cYjYjqEsyd63x8t4.mjs +67 -0
  17. package/browser/esm/chart.mjs +60 -0
  18. package/browser/esm/control.mjs +216 -0
  19. package/browser/esm/group.mjs +123 -0
  20. package/browser/esm/index.mjs +14070 -9138
  21. package/browser/esm/note.mjs +86 -0
  22. package/browser/esm/picture.mjs +86 -0
  23. package/{node/esm/DAE_NG8D9uT50zUH.mjs → browser/esm/shape.mjs} +2 -4
  24. package/browser/esm/slicer.mjs +276 -0
  25. package/licenses/dependencies.txt +6 -599
  26. package/node/esm/BJ7ZZm63j5O6cvrB.mjs +134 -0
  27. package/node/esm/BfRn5S5V4X8xIAEa.mjs +20 -0
  28. package/node/esm/BpwE3HqTnrLLzE3C.mjs +775 -0
  29. package/node/esm/Buw-VKYJy3y5dbaJ.mjs +197 -0
  30. package/node/esm/CFFlJxNwgyInjEnh.mjs +45 -0
  31. package/node/esm/CM5BT7h-hMtST2bE.mjs +2706 -0
  32. package/node/esm/CV3bT3Hql74GcHoU.mjs +37 -0
  33. package/node/esm/C_ANM4feA1xV-pri.mjs +32 -0
  34. package/node/esm/D3YXHeOyFp00Xk3m.mjs +323 -0
  35. package/node/esm/DPN0n6MGYQ9vZ2KO.mjs +80 -0
  36. package/node/esm/DYosMUJKp-3MSO4q.mjs +76 -0
  37. package/node/esm/DhSq680c5tgMFFbj.mjs +68 -0
  38. package/node/esm/Dxbm6ryIDCEi26RO.mjs +66 -0
  39. package/node/esm/GkmuxU7OwRZtm2Rf.mjs +63 -0
  40. package/node/esm/chart.mjs +60 -0
  41. package/node/esm/control.mjs +216 -0
  42. package/node/esm/group.mjs +123 -0
  43. package/node/esm/index.mjs +16618 -11534
  44. package/node/esm/note.mjs +87 -0
  45. package/node/esm/picture.mjs +86 -0
  46. package/node/esm/shape.mjs +783 -0
  47. package/node/esm/slicer.mjs +278 -0
  48. package/package.json +53 -14
  49. package/resources/contents.json +18 -0
  50. package/resources/locales/contents.json +42 -0
  51. package/resources/locales/de/movable.cmd.json +154 -0
  52. package/resources/locales/de/picture.cmd.json +31 -0
  53. package/resources/locales/de/selection.cmd.json +8 -0
  54. package/resources/locales/de/shape.cmd.json +17 -0
  55. package/resources/locales/de/sheet.cmd.json +328 -21
  56. package/resources/locales/de/slicer.cmd.json +17 -0
  57. package/resources/locales/de/table.cmd.json +9 -1
  58. package/resources/locales/de/ui.msg.json +309 -3
  59. package/resources/locales/de/workbook.cmd.json +10 -6
  60. package/resources/locales/en/movable.cmd.json +154 -0
  61. package/resources/locales/en/picture.cmd.json +31 -0
  62. package/resources/locales/en/selection.cmd.json +8 -0
  63. package/resources/locales/en/shape.cmd.json +17 -0
  64. package/resources/locales/en/sheet.cmd.json +342 -22
  65. package/resources/locales/en/slicer.cmd.json +17 -0
  66. package/resources/locales/en/table.cmd.json +9 -1
  67. package/resources/locales/en/ui.msg.json +309 -3
  68. package/resources/locales/en/workbook.cmd.json +11 -7
  69. package/types/chart.d.ts +2 -0
  70. package/types/control.d.ts +2 -0
  71. package/types/group.d.ts +2 -0
  72. package/types/note.d.ts +2 -0
  73. package/types/picture.d.ts +2 -0
  74. package/types/shape.d.ts +2 -0
  75. package/types/slicer.d.ts +2 -0
  76. package/types/src/annotation/RangeAnnotations.d.ts +119 -0
  77. package/types/src/annotation/index.d.ts +2 -0
  78. package/types/src/autoFill/AutoFillPresets.d.ts +14 -0
  79. package/types/src/autoFill/FillMenu.d.ts +36 -0
  80. package/types/src/autoFill/FillSeries.d.ts +38 -0
  81. package/types/src/autoFill/index.d.ts +4 -0
  82. package/types/src/border/StaticBorderRenderer.d.ts +2 -2
  83. package/types/src/border/useBorders.d.ts +7 -7
  84. package/types/src/cell/CornerTriangle.d.ts +6 -0
  85. package/types/src/cell/FormulaCellRenderer.d.ts +1 -1
  86. package/types/src/cell/OutlineButton.d.ts +123 -0
  87. package/types/src/cell/SheetCellRenderer.d.ts +2 -2
  88. package/types/src/cell/SheetHeaderRenderer.d.ts +5 -0
  89. package/types/src/cell/StaticCellRenderer.d.ts +57 -0
  90. package/types/src/cell/index.d.ts +2 -0
  91. package/types/src/cell/useFormulaViewAnchor.d.ts +1 -1
  92. package/types/src/chart/index.d.ts +0 -1
  93. package/types/src/checklist/ValueChecklist.d.ts +112 -0
  94. package/types/src/checklist/index.d.ts +2 -0
  95. package/types/src/commands/ContextualToolbar.d.ts +19 -0
  96. package/types/src/commands/createTransactionalMiddleware.d.ts +4 -1
  97. package/types/src/commands/index.d.ts +1 -0
  98. package/types/src/comment/CommentCardRequest.d.ts +94 -0
  99. package/types/src/comment/CommentUtils.d.ts +43 -0
  100. package/types/src/comment/NoteEditor.d.ts +20 -0
  101. package/types/src/comment/index.d.ts +5 -0
  102. package/types/src/comment/useCommentThread.d.ts +37 -0
  103. package/types/src/comment/useSheetComments.d.ts +28 -0
  104. package/types/src/{sheet → conditionalFormat}/ConditionalFormatPresets.d.ts +6 -6
  105. package/types/src/conditionalFormat/index.d.ts +1 -0
  106. package/types/src/control/FormControlRenderers.d.ts +22 -0
  107. package/types/src/editor/FunctionPreviewPanel.d.ts +15 -1
  108. package/types/src/editor/NamedItemLabel.d.ts +29 -0
  109. package/types/src/editor/NamedItemsPanel.d.ts +13 -2
  110. package/types/src/editor/SheetCellEditorLayer.d.ts +3 -7
  111. package/types/src/editor/SheetCellEditorStartLayer.d.ts +44 -0
  112. package/types/src/editor/SheetCellInput.d.ts +26 -2
  113. package/types/src/editor/SheetEditable.d.ts +8 -2
  114. package/types/src/editor/formulaCaret.d.ts +39 -10
  115. package/types/src/editor/formulaEval.d.ts +9 -5
  116. package/types/src/editor/formulaLint.d.ts +36 -0
  117. package/types/src/editor/formulaPresentation.d.ts +7 -0
  118. package/types/src/editor/formulaText.d.ts +17 -5
  119. package/types/src/editor/functionArgs.d.ts +20 -0
  120. package/types/src/editor/index.d.ts +4 -1
  121. package/types/src/editor/pickedReference.d.ts +76 -0
  122. package/types/src/editor/useEditRejectedNotice.d.ts +32 -0
  123. package/types/src/editor/useFormulaHints.d.ts +93 -3
  124. package/types/src/editor/useFormulaInput.d.ts +30 -4
  125. package/types/src/editor/useReferenceMode.d.ts +12 -0
  126. package/types/src/editor/validationAlert.d.ts +24 -0
  127. package/types/src/externalLink/ExternalLinksPaneArgs.d.ts +23 -0
  128. package/types/src/externalLink/index.d.ts +2 -0
  129. package/types/src/form/FormulaInput.d.ts +18 -2
  130. package/types/src/form/FormulaInputParts.d.ts +10 -1
  131. package/types/src/form/useEditCommit.d.ts +23 -3
  132. package/types/src/form/useInputField.d.ts +2 -3
  133. package/types/src/frame/CommandContext.d.ts +188 -6
  134. package/types/src/group/GroupEditor.d.ts +25 -0
  135. package/types/src/index.d.ts +12 -2
  136. package/types/src/io/WorkbookIO.d.ts +2 -0
  137. package/types/src/layer/CellErrorLayer.d.ts +24 -7
  138. package/types/src/layer/CommentCardLayer.d.ts +43 -0
  139. package/types/src/layer/CommentsLayer.d.ts +35 -0
  140. package/types/src/layer/ConditionalIcons.d.ts +4 -4
  141. package/types/src/layer/FreezeDragLines.d.ts +17 -0
  142. package/types/src/layer/GridFreezeLayer.d.ts +11 -0
  143. package/types/src/layer/HeaderFreezeLayer.d.ts +12 -0
  144. package/types/src/layer/HeaderResizerLayer.d.ts +2 -1
  145. package/types/src/layer/HyperlinkLayer.d.ts +109 -0
  146. package/types/src/layer/MovableKindScope.d.ts +17 -0
  147. package/types/src/layer/ProtectionLayer.d.ts +52 -0
  148. package/types/src/layer/RangeAnnotationLayer.d.ts +71 -0
  149. package/types/src/layer/ResizeIndicator.d.ts +9 -8
  150. package/types/src/layer/ResizeTooltip.d.ts +13 -0
  151. package/types/src/layer/SheetHeaderCellLayer.d.ts +10 -1
  152. package/types/src/layer/SheetOutlineLayer.d.ts +40 -0
  153. package/types/src/layer/TableLayer.d.ts +5 -4
  154. package/types/src/layer/TableToolbar.d.ts +42 -0
  155. package/types/src/layer/ValidationDropdownLayer.d.ts +15 -5
  156. package/types/src/layer/ValidationIndicatorLayer.d.ts +9 -3
  157. package/types/src/layer/ValidationPromptLayer.d.ts +64 -0
  158. package/types/src/layer/_tableColor.d.ts +4 -0
  159. package/types/src/layer/cellTip.d.ts +13 -0
  160. package/types/src/layer/freezeDragState.d.ts +21 -0
  161. package/types/src/layer/index.d.ts +12 -1
  162. package/types/src/layer/resizeIndicatorState.d.ts +3 -1
  163. package/types/src/layer/useFreezeDrag.d.ts +22 -0
  164. package/types/src/layer/useValidationPicker.d.ts +35 -35
  165. package/types/src/layer/validationMark.d.ts +63 -0
  166. package/types/src/listener/useModelListener.d.ts +4 -4
  167. package/types/src/movable/ConnectionSites.d.ts +18 -0
  168. package/types/src/movable/IMovableArea.d.ts +56 -0
  169. package/types/src/movable/MovableAdornment.d.ts +26 -0
  170. package/types/src/movable/MovableCommandGroups.d.ts +40 -0
  171. package/types/src/movable/MovableCommands.d.ts +6 -1
  172. package/types/src/movable/MovableControl.d.ts +78 -0
  173. package/types/src/movable/MovableEdit.d.ts +22 -0
  174. package/types/src/movable/MovableFrame.d.ts +16 -13
  175. package/types/src/movable/MovableLayer.d.ts +25 -7
  176. package/types/src/movable/MovableRenderers.d.ts +210 -0
  177. package/types/src/movable/PlaceholderFrames.d.ts +11 -0
  178. package/types/src/movable/RotateHandle.d.ts +37 -0
  179. package/types/src/movable/TextBox.d.ts +34 -0
  180. package/types/src/movable/connect.d.ts +16 -0
  181. package/types/src/movable/framePlacement.d.ts +72 -0
  182. package/types/src/movable/geometry.d.ts +61 -0
  183. package/types/src/movable/index.d.ts +10 -0
  184. package/types/src/movable/pressTarget.d.ts +20 -0
  185. package/types/src/picker/PickerPanel.d.ts +52 -0
  186. package/types/src/picker/cellPickerOpen.d.ts +6 -0
  187. package/types/src/picker/index.d.ts +4 -0
  188. package/types/src/picker/useCellPicker.d.ts +95 -0
  189. package/types/src/picture/PictureCommands.d.ts +12 -0
  190. package/types/src/picture/PictureKind.d.ts +7 -0
  191. package/types/src/picture/index.d.ts +0 -1
  192. package/types/src/protection/ProtectionPaneArgs.d.ts +31 -0
  193. package/types/src/protection/index.d.ts +3 -0
  194. package/types/src/protection/unlockProtectedRanges.d.ts +23 -0
  195. package/types/src/richText/RichTextEditor.d.ts +41 -0
  196. package/types/src/richText/index.d.ts +2 -0
  197. package/types/src/selection/SheetSelectionLayer.d.ts +14 -10
  198. package/types/src/shape/ConnectorControl.d.ts +46 -0
  199. package/types/src/shape/ShapeCommands.d.ts +11 -0
  200. package/types/src/shape/ShapeControl.d.ts +8 -0
  201. package/types/src/shape/ShapeEditor.d.ts +15 -2
  202. package/types/src/shape/ShapeGallery.d.ts +31 -0
  203. package/types/src/shape/ShapeHandles.d.ts +28 -0
  204. package/types/src/shape/ShapeKind.d.ts +7 -0
  205. package/types/src/shape/ShapeSVG.d.ts +22 -0
  206. package/types/src/shape/ShapeText.d.ts +17 -0
  207. package/types/src/shape/icons/ShapeIcons.d.ts +16 -0
  208. package/types/src/shape/icons/_ShapeIconPack.d.ts +4 -0
  209. package/types/src/shape/index.d.ts +3 -1
  210. package/types/src/shape/shapeFrame.d.ts +50 -0
  211. package/types/src/shape/shapeStyle.d.ts +82 -0
  212. package/types/src/sheet/ISheetElement.d.ts +62 -65
  213. package/types/src/sheet/SheetCommandProvider.d.ts +9 -4
  214. package/types/src/sheet/SheetCommands.d.ts +21 -6
  215. package/types/src/sheet/SheetOutlineElement.d.ts +70 -0
  216. package/types/src/sheet/SheetScrollbar.d.ts +1 -10
  217. package/types/src/sheet/_freezeAt.d.ts +10 -0
  218. package/types/src/sheet/_useHeaderMetrics.d.ts +11 -0
  219. package/types/src/sheet/circularReferences.d.ts +9 -1
  220. package/types/src/sheet/index.d.ts +1 -1
  221. package/types/src/sheet/useCycleHighlight.d.ts +21 -0
  222. package/types/src/slicer/SlicerCommands.d.ts +10 -0
  223. package/types/src/slicer/SlicerEditor.d.ts +8 -2
  224. package/types/src/slicer/SlicerKind.d.ts +7 -0
  225. package/types/src/slicer/SlicerStylePreview.d.ts +18 -0
  226. package/types/src/slicer/index.d.ts +2 -1
  227. package/types/src/slicer/slicerStyles.d.ts +32 -0
  228. package/types/src/tabStrip/TabStrip.d.ts +7 -0
  229. package/types/src/taskPane/ITaskPane.d.ts +12 -1
  230. package/types/src/taskPane/MovablePane.d.ts +17 -0
  231. package/types/src/taskPane/index.d.ts +1 -0
  232. package/types/src/theme/ThemeState.d.ts +14 -1
  233. package/types/src/theme/useGridColorScheme.d.ts +1 -1
  234. package/types/src/workbook/DefaultMovableRenderers.d.ts +20 -0
  235. package/types/src/workbook/IWorkbookElement.d.ts +24 -0
  236. package/types/src/workbook/WorkbookCommands.d.ts +2 -4
  237. package/types/src/workbook/WorkbookStrip.d.ts +9 -0
  238. package/types/src/workbook/_followOrigin.d.ts +9 -0
  239. package/types/src/workbook/useWorkbookFormat.d.ts +3 -3
  240. package/browser/cjs/Bo9Kx3L_XQkGPBJ5.cjs +0 -1
  241. package/browser/cjs/Pl04-kDEQSO8_qFU.cjs +0 -156
  242. package/browser/cjs/index.cjs +0 -35
  243. package/browser/esm/SJMJzBwlXTJ9QIO5.mjs +0 -6286
  244. package/types/src/editor/useProtectedEditNotice.d.ts +0 -14
  245. package/types/src/layer/validationList.d.ts +0 -84
  246. package/types/src/list/SheetValueList.d.ts +0 -93
  247. package/types/src/list/index.d.ts +0 -2
  248. package/types/src/movable/MoveableBundle.d.ts +0 -4
@@ -0,0 +1,196 @@
1
+ /**
2
+ * @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.8.0-beta.10
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 "./Dd-ZybXAgoq9pgGv.mjs";
8
+ import { d as t } from "./Bow9CzRJrYxak2i5.mjs";
9
+ import { n, r } from "./CiRN-woJZWYOgTn4.mjs";
10
+ import { t as i } from "./J8cPagZBeXz86Lnd.mjs";
11
+ import { memo as a, useCallback as o, useReducer as s, useRef as c } from "react";
12
+ import { jsx as l } from "react/jsx-runtime";
13
+ import { messageKey as u } from "@sheetxl/utils";
14
+ import { useGridPaneOptional as d, useSurfaceStateSetter as f } from "@sheetxl/grid-react";
15
+ var p = (e, t) => {
16
+ let n = [t.horizontal ? 1 : -1, t.vertical ? 1 : -1];
17
+ return e === "start" ? n : [-n[0], -n[1]];
18
+ }, m = (e) => {
19
+ let t = e.getBounds();
20
+ return t ? {
21
+ bounds: t,
22
+ rotation: e.getRotation() || 0,
23
+ flip: e.getFlip()
24
+ } : null;
25
+ }, h = (e, t, n) => {
26
+ let { x: r, y: i, width: a, height: o } = e.bounds, s = -(e.rotation || 0) * Math.PI / 180, c = t.x - (r + a / 2), l = t.y - (i + o / 2), u = c * Math.cos(s) - l * Math.sin(s), d = c * Math.sin(s) + l * Math.cos(s);
27
+ return Math.abs(u) <= a / 2 + n && Math.abs(d) <= o / 2 + n;
28
+ }, g = a((t) => {
29
+ let { movable: n, flip: i, isDragging: a = !1, gesture: g } = t, _ = d(), v = f(r, null), [, y] = s((e) => e + 1, 0), b = n.getContent();
30
+ e(b, { onAnyChange: y });
31
+ let x = b.getConnectorFormat(), S = c(null), C = o((e) => {
32
+ let t = _?.getPanePointFromPointer(e.clientX, e.clientY);
33
+ if (!_ || !t) return null;
34
+ let n = _.toAbsoluteBounds({
35
+ x: t.x,
36
+ y: t.y,
37
+ width: 0,
38
+ height: 0
39
+ });
40
+ return {
41
+ x: n.x,
42
+ y: n.y
43
+ };
44
+ }, [_]), w = o((e) => {
45
+ if (e.button !== 0) return;
46
+ e.stopPropagation(), e.preventDefault();
47
+ let t = e.currentTarget.dataset.end, r = m(n);
48
+ if (!r || !_) return;
49
+ let i = {
50
+ pointerId: e.pointerId,
51
+ end: t,
52
+ placement: r,
53
+ candidates: [],
54
+ hit: null
55
+ };
56
+ g.start(u("op.connectShape"), (e) => {
57
+ let n = e.getContent().getConnectorFormat();
58
+ if (!n) return;
59
+ let r = i.hit, a = t === "start" ? n.getStartConnectedMovable() : n.getEndConnectedMovable(), o = t === "start" ? n.getStartConnectionSite() : n.getEndConnectionSite();
60
+ (r ? a !== r.target || o !== r.index : a !== null) && (r ? t === "start" ? n.startConnect(r.target, r.index) : n.endConnect(r.target, r.index) : t === "start" ? n.startDisconnect() : n.endDisconnect());
61
+ }) && (i.candidates = ((e) => {
62
+ let t = e.getRange().getSheet(), n = /* @__PURE__ */ new Set([e]);
63
+ for (let t = e.getParent(); t; t = t.getParent()) n.add(t);
64
+ let r = [];
65
+ for (let e of t.getMovables().getItems({ deep: !0 })) {
66
+ if (n.has(e) || e.isHidden()) continue;
67
+ let t = m(e);
68
+ t && r.push({
69
+ movable: e,
70
+ placement: t
71
+ });
72
+ }
73
+ return r;
74
+ })(n), S.current = i, e.currentTarget.setPointerCapture(e.pointerId), v({
75
+ connector: n.getId(),
76
+ target: null,
77
+ index: null
78
+ }));
79
+ }, [
80
+ n,
81
+ _,
82
+ g,
83
+ v
84
+ ]), T = o((e) => {
85
+ let t = S.current;
86
+ if (!t || t.pointerId !== e.pointerId) return;
87
+ e.stopPropagation();
88
+ let r = C(e);
89
+ if (!r) return;
90
+ let i = ((e, t, n) => {
91
+ let r = 8 / n, i = 10 / n, a = null, o = 1 / 0;
92
+ for (let { movable: n, placement: s } of t) {
93
+ let t = n.getConnectionSites(s);
94
+ if (!t || t.length === 0) continue;
95
+ let c = h(s, e, r);
96
+ for (let r of t) {
97
+ let t = Math.hypot(r.x - e.x, r.y - e.y);
98
+ (c || t <= i) && t < o && (a = {
99
+ target: n,
100
+ index: r.index,
101
+ x: r.x,
102
+ y: r.y
103
+ }, o = t);
104
+ }
105
+ }
106
+ return a;
107
+ })(r, t.candidates, _?.getZoom() || 1);
108
+ t.hit = i;
109
+ let a = n.getContent().getConnectorFormat(), o = a?.getEndPoints(t.placement);
110
+ if (!a || !o) return;
111
+ let s = o[t.end === "start" ? "end" : "start"];
112
+ o[t.end] = i ? {
113
+ x: i.x,
114
+ y: i.y
115
+ } : e.shiftKey ? ((e, t, n = 15) => {
116
+ let r = t.x - e.x, i = t.y - e.y;
117
+ if (r === 0 && i === 0) return t;
118
+ let a = n * Math.PI / 180, o = Math.round(Math.atan2(i, r) / a) * a, s = Math.abs(Math.cos(o)) < 1e-12 ? 0 : Math.cos(o), c = Math.abs(Math.sin(o)) < 1e-12 ? 0 : Math.sin(o), l = r * s + i * c;
119
+ return {
120
+ x: e.x + l * s,
121
+ y: e.y + l * c
122
+ };
123
+ })(s, r) : r;
124
+ let c = a.placeEnds(o.start, o.end);
125
+ v({
126
+ connector: n.getId(),
127
+ target: i ? i.target.getId() : null,
128
+ index: i ? i.index : null
129
+ }), g.preview({
130
+ bounds: c.bounds,
131
+ flip: c.flip,
132
+ grip: {
133
+ kind: "resize",
134
+ direction: p(t.end, c.flip)
135
+ }
136
+ });
137
+ }, [
138
+ C,
139
+ _,
140
+ n,
141
+ g,
142
+ v
143
+ ]), E = o((e) => {
144
+ let t = S.current;
145
+ t && t.pointerId === e.pointerId && (e.stopPropagation(), S.current = null, v(null), g.finish());
146
+ }, [g, v]), D = o((e) => {
147
+ let t = S.current;
148
+ t && t.pointerId === e.pointerId && (S.current = null, v(null), g.cancel());
149
+ }, [g, v]);
150
+ return l("div", {
151
+ className: [
152
+ "movable-control",
153
+ "connector",
154
+ a ? "dragging" : null
155
+ ].filter(Boolean).join(" "),
156
+ children: ["start", "end"].map((e) => {
157
+ let t = p(e, i), n = e === "start" ? !!x?.isStartConnected() : !!x?.isEndConnected();
158
+ return l("div", {
159
+ className: n ? "movable-control-handle connector-end glued" : "movable-control-handle connector-end",
160
+ "data-end": e,
161
+ style: {
162
+ left: 50 * (t[0] + 1) + "%",
163
+ top: 50 * (t[1] + 1) + "%"
164
+ },
165
+ onPointerDown: w,
166
+ onPointerMove: T,
167
+ onPointerUp: E,
168
+ onPointerCancel: D
169
+ }, e);
170
+ })
171
+ });
172
+ });
173
+ g.displayName = "ConnectorControl";
174
+ var _ = a((e) => e.movable.getContent().isConnector() ? l(g, { ...e }) : l(t, { ...e }));
175
+ _.displayName = "ShapeControl";
176
+ var v = {
177
+ renderer: (e) => l(i, {
178
+ ...e,
179
+ shape: e.movable.getContent()
180
+ }),
181
+ control: _,
182
+ commands: (e, t) => {
183
+ let { sheet: r, movable: i, notifier: a } = t, o = i.getContent();
184
+ e.use(n({
185
+ transaction: r,
186
+ notifier: a
187
+ })), e.updateCommand("changeShape", {
188
+ disabledReasons: o.getConnectorFormat() ? [u("reason.connectorShape")] : [],
189
+ callback: (e) => {
190
+ let t = typeof e == "object" && e ? e.geometry : e;
191
+ o.setShapeType(typeof t == "string" ? t : "rect");
192
+ }
193
+ });
194
+ }
195
+ };
196
+ export { v as ShapeKind };
@@ -0,0 +1,31 @@
1
+ /**
2
+ * @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.8.0-beta.10
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 { useMemo as e, version as t } from "react";
8
+ function n(e, t) {
9
+ if (typeof e == "function") return e(t);
10
+ e && (e.current = t);
11
+ }
12
+ var r = parseInt(t.split(".")[0], 10) >= 19 ? function(e) {
13
+ return (t) => {
14
+ let r = [];
15
+ for (let i of e) {
16
+ let e = n(i, t), a = typeof e == "function";
17
+ r.push(a ? e : () => n(i, null));
18
+ }
19
+ return () => {
20
+ for (let e of r) e();
21
+ };
22
+ };
23
+ } : function(e) {
24
+ return (t) => {
25
+ for (let r of e) n(r, t);
26
+ };
27
+ };
28
+ function i(t) {
29
+ return e(() => r(t), t);
30
+ }
31
+ export { i as t };
@@ -0,0 +1,36 @@
1
+ /**
2
+ * @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.8.0-beta.10
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
+ var e = "movable-connect", t = "command", n = (e, t) => !!e && (e.getTags?.() ?? []).includes(t);
8
+ function r(e) {
9
+ let { transaction: r, notifier: i, manager: a } = e, o = e.isRepeatable ?? ((e) => !n(e, "noRepeat")), s = Promise.resolve();
10
+ return (e) => (c, l) => {
11
+ if (n(l, "noTransaction")) return e(c, l);
12
+ let u = s.then(async () => {
13
+ let n = l?.getLabel?.() ?? void 0, s = l?.getKey?.(), u = i ? await Promise.resolve(i.showBusy(n ?? "Working…")) : null;
14
+ try {
15
+ let i;
16
+ return await r.doBatch(async () => {
17
+ i = await e(c, l);
18
+ }, {
19
+ description: n,
20
+ meta: s ? { [t]: s } : void 0
21
+ }), a && l && o(l) && a.setRepeatableOperation({
22
+ description: n ?? "last action",
23
+ repeat: () => {
24
+ l.execute(c);
25
+ }
26
+ }), i;
27
+ } catch (e) {
28
+ e && i?.showError?.(e);
29
+ } finally {
30
+ u?.();
31
+ }
32
+ });
33
+ return s = u.then(() => {}, () => {}), u;
34
+ };
35
+ }
36
+ export { r as n, e as r, t };
@@ -0,0 +1,45 @@
1
+ /**
2
+ * @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.8.0-beta.10
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 { useEffect as e, useMemo as t, useReducer as n, useRef as r } from "react";
8
+ var i = (t, n, i) => {
9
+ let a = r(n);
10
+ a.current = n;
11
+ let s = (i = i ? {
12
+ ...o,
13
+ ...i
14
+ } : o).ignoreModelChange;
15
+ e(() => {
16
+ if (!t || !a.current) return;
17
+ let e = Object.keys(a.current), n = {}, r = e.length;
18
+ for (let t = 0; t < r; t++) {
19
+ let r = e[t];
20
+ n[r] = (e, t) => a.current[r]?.(e, t);
21
+ }
22
+ let o = i?.debugText;
23
+ o && console.log("Add: " + o);
24
+ let c = t.addListeners(n, i);
25
+ if (!s) for (let i = 0; i < r; i++) n[e[i]]?.(t);
26
+ return () => {
27
+ o && console.log("Remove: " + o), c?.();
28
+ };
29
+ }, [t]);
30
+ };
31
+ function a(e, r) {
32
+ let [a, o] = n((e) => e + 1, 0);
33
+ i(e, t(() => {
34
+ let e = (e, t) => {
35
+ o();
36
+ }, t = Array.isArray(r) ? r : [r], n = {};
37
+ for (let r of t) n[r] = e;
38
+ return n;
39
+ }, [e, ...Array.isArray(r) ? r : [r]]));
40
+ }
41
+ var o = {
42
+ transactional: !1,
43
+ ignoreModelChange: !1
44
+ };
45
+ export { a as n, i as t };
@@ -0,0 +1,79 @@
1
+ /**
2
+ * @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.8.0-beta.10
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 "./Cfe0kofqVKGxLqO6.mjs";
8
+ import { forwardRef as t, memo as n, useMemo as r, useRef as i } from "react";
9
+ import { jsx as a } from "react/jsx-runtime";
10
+ var o = "data-run", s = (e) => typeof e == "string" ? e ? [{ text: e }] : [] : e.runs ?? [], c = (e) => {
11
+ if (e.nodeType === 3) return e.nodeValue ?? "";
12
+ if (e.nodeType !== 1) return "";
13
+ if (e.localName === "br") return "\n";
14
+ let t = "", n = e.childNodes;
15
+ for (let e = 0; e < n.length; e++) t += c(n[e]);
16
+ return t;
17
+ }, l = n(t((t, n) => {
18
+ let { value: l, onChange: u, onDone: d, readOnly: f = !1, runStyle: p, style: m, onKeyDown: h, onBlur: g, ..._ } = t, v = i(null), y = r(() => s(l), [l]), b = r(() => JSON.stringify(l), [l]), x = () => {
19
+ let e = v.current;
20
+ if (!e || f) return;
21
+ let t = ((e, t) => {
22
+ let n = [], r = e.childNodes;
23
+ for (let e = 0; e < r.length; e++) {
24
+ let i = r[e], a = c(i);
25
+ if (!a) continue;
26
+ let s = i.nodeType === 1 ? i.getAttribute(o) : null;
27
+ if (s !== null) {
28
+ let e = t[parseInt(s, 10)]?.font;
29
+ n.push(e ? {
30
+ text: a,
31
+ font: e
32
+ } : { text: a });
33
+ continue;
34
+ }
35
+ let l = n[n.length - 1];
36
+ l ? l.text += a : n.push({ text: a });
37
+ }
38
+ return n.every((e) => !e.font) ? n.map((e) => e.text).join("") : { runs: n };
39
+ })(e, y);
40
+ JSON.stringify(s(t)) !== JSON.stringify(y) && u?.(t);
41
+ }, S = (e) => {
42
+ e.stopPropagation();
43
+ }, C = e([v, n]);
44
+ return a("div", {
45
+ ref: C,
46
+ contentEditable: !f && "plaintext-only",
47
+ suppressContentEditableWarning: !0,
48
+ spellCheck: !1,
49
+ ..._,
50
+ style: {
51
+ width: "100%",
52
+ minHeight: "100%",
53
+ boxSizing: "border-box",
54
+ outline: "none",
55
+ whiteSpace: "pre-wrap",
56
+ overflowWrap: "break-word",
57
+ userSelect: "text",
58
+ cursor: f ? void 0 : "text",
59
+ ...m
60
+ },
61
+ onKeyDown: (e) => {
62
+ h?.(e), f || (e.stopPropagation(), e.key === "Escape" && (e.preventDefault(), e.currentTarget.blur(), d?.()));
63
+ },
64
+ onKeyUp: f ? void 0 : S,
65
+ onCopy: f ? void 0 : S,
66
+ onCut: f ? void 0 : S,
67
+ onPaste: f ? void 0 : S,
68
+ onBlur: (e) => {
69
+ x(), g?.(e);
70
+ },
71
+ children: y.map((e, t) => a("span", {
72
+ [o]: t,
73
+ style: e.font ? p?.(e.font) : void 0,
74
+ children: e.text
75
+ }, t))
76
+ }, b);
77
+ }));
78
+ l.displayName = "RichTextEditor";
79
+ export { l as t };
@@ -0,0 +1,63 @@
1
+ /**
2
+ * @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.8.0-beta.10
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 { forwardRef as e, memo as t, useEffect as n, useLayoutEffect as r, useRef as i } from "react";
8
+ import { jsx as a } from "react/jsx-runtime";
9
+ var o = /* @__PURE__ */ new WeakMap(), s = /* @__PURE__ */ new WeakSet(), c = (e) => !!((e) => {
10
+ let t = o.get(e);
11
+ if (!t) return !1;
12
+ for (let e of t) if (e()) return !0;
13
+ return !1;
14
+ })(e) || (s.add(e), !1), l = (e, t) => {
15
+ let n = o.get(e);
16
+ return n || (n = /* @__PURE__ */ new Set(), o.set(e, n)), n.add(t), s.has(e) && (s.delete(e), e.isSelected() && t()), () => {
17
+ n.delete(t);
18
+ };
19
+ }, u = t(e((e, t) => {
20
+ let { children: o, style: s, contentStyle: c, disabled: u = !1, movable: d, onDragZone: f, ...p } = e, m = i(null);
21
+ return r(() => {
22
+ f?.((e) => {
23
+ let t = m.current;
24
+ return !t || !t.contains(e.target);
25
+ });
26
+ }, [f]), n(() => {
27
+ if (d && !u) return l(d, () => ((e) => {
28
+ let t = e?.querySelector("textarea, input, [contenteditable]:not([contenteditable=\"false\"])");
29
+ if (!t) return !1;
30
+ if (t.focus(), t.isContentEditable) {
31
+ let e = t.ownerDocument.getSelection();
32
+ e?.selectAllChildren(t), e?.collapseToEnd();
33
+ }
34
+ return !0;
35
+ })(m.current));
36
+ }, [d, u]), a("div", {
37
+ ref: t,
38
+ ...p,
39
+ style: {
40
+ width: "100%",
41
+ height: "100%",
42
+ boxSizing: "border-box",
43
+ padding: "3px",
44
+ position: "relative",
45
+ overflow: "hidden",
46
+ ...s
47
+ },
48
+ children: a("div", {
49
+ ref: m,
50
+ style: {
51
+ width: "100%",
52
+ height: "100%",
53
+ boxSizing: "border-box",
54
+ overflow: "hidden",
55
+ cursor: u ? void 0 : "text",
56
+ ...c
57
+ },
58
+ children: o
59
+ })
60
+ });
61
+ }));
62
+ u.displayName = "TextBox";
63
+ export { l as n, c as r, u as t };