@sheetxl/react 0.7.28-beta.4 → 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 (245) 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 +14122 -8944
  21. package/browser/esm/note.mjs +86 -0
  22. package/browser/esm/picture.mjs +86 -0
  23. package/{node/esm/Ban9guHVB-Vxa-tq.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 +16649 -11320
  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 +17 -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 -1
  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 +61 -0
  156. package/types/src/layer/ValidationIndicatorLayer.d.ts +14 -21
  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 +14 -0
  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 +54 -0
  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/BdJpSdwyWuh-Te5p.mjs +0 -6286
  244. package/types/src/editor/useProtectedEditNotice.d.ts +0 -14
  245. package/types/src/movable/MoveableBundle.d.ts +0 -4
@@ -0,0 +1,37 @@
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", a = (e, t) => !!e && (e.getTags?.() ?? []).includes(t);
8
+ function n(e) {
9
+ const { transaction: n, notifier: o, manager: r } = e, s = e.isRepeatable ?? ((e) => !a(e, "noRepeat"));
10
+ let i = Promise.resolve();
11
+ return (e) => (c, l) => {
12
+ if (a(l, "noTransaction")) return e(c, l);
13
+ const u = i.then(async () => {
14
+ const a = l?.getLabel?.() ?? void 0, i = l?.getKey?.(), u = o ? await Promise.resolve(o.showBusy(a ?? "Working…")) : null;
15
+ try {
16
+ let o;
17
+ return await n.doBatch(async () => {
18
+ o = await e(c, l);
19
+ }, {
20
+ description: a,
21
+ meta: i ? { [t]: i } : void 0
22
+ }), r && l && s(l) && r.setRepeatableOperation({
23
+ description: a ?? "last action",
24
+ repeat: () => {
25
+ l.execute(c);
26
+ }
27
+ }), o;
28
+ } catch (e) {
29
+ e && o?.showError?.(e);
30
+ } finally {
31
+ u?.();
32
+ }
33
+ });
34
+ return i = u.then(() => {}, () => {}), u;
35
+ };
36
+ }
37
+ export { n, e as r, t };
@@ -0,0 +1,32 @@
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 { SlicerEditor as e } from "./slicer.mjs";
8
+ import { jsx as t } from "react/jsx-runtime";
9
+ import { messageKey as r } from "@sheetxl/utils";
10
+ var s = {
11
+ renderer: (r) => t(e, {
12
+ ...r,
13
+ slicer: r.movable.getContent()
14
+ }),
15
+ commands: (e, t) => {
16
+ const { sheet: s, movable: o } = t, n = o.getContent(), a = () => ({
17
+ slicer: () => n,
18
+ styles: () => s.getStyles()
19
+ }), l = () => {
20
+ e.updateCommand("formatSlicerStyle", {
21
+ callback: (e) => {
22
+ e && n.setStyle(e);
23
+ },
24
+ state: n.getStyle(),
25
+ context: a,
26
+ disabledReasons: n.isReadOnly() ? [r("reason.sheetProtected")] : []
27
+ });
28
+ };
29
+ return l(), n.addListeners({ onAnyChange: l });
30
+ }
31
+ };
32
+ export { s as SlicerKind };
@@ -0,0 +1,323 @@
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 "./CFFlJxNwgyInjEnh.mjs";
8
+ import { createContext as t, memo as n, useCallback as o, useEffect as r, useReducer as a, useRef as l } from "react";
9
+ import { Fragment as i, jsx as s, jsxs as c } from "react/jsx-runtime";
10
+ import { LazyModules as d, defineLazyModule as u } from "@sheetxl/utils";
11
+ import { ReactUtils as p } from "@sheetxl/utils-react";
12
+ import { useGridPane as m } from "@sheetxl/grid-react";
13
+ var h = Object.freeze({
14
+ x: 0,
15
+ y: 0,
16
+ width: 0,
17
+ height: 0
18
+ }), f = (e, t, n) => {
19
+ const o = n?.bounds ?? e.getBounds(), r = o ? t.toPaneBounds(o) : h, a = p.getDevicePixelRatio();
20
+ return {
21
+ left: p.snapDeviceEdge(r.x, a),
22
+ top: p.snapDeviceEdge(r.y, a),
23
+ width: r.width,
24
+ height: r.height,
25
+ rotation: n?.rotation ?? (e.getRotation() || 0),
26
+ flip: n?.flip ?? e.getFlip()
27
+ };
28
+ }, g = "data-movable-id", v = (e) => {
29
+ let t = e;
30
+ for (let e = t.getParent(); e; e = t.getParent()) t = e;
31
+ return t;
32
+ }, b = (e, t, n) => {
33
+ const o = [];
34
+ let r = t;
35
+ for (; r && r !== n;) {
36
+ const e = r.getAttribute?.(g);
37
+ e && o.unshift(e), r = r.parentElement;
38
+ }
39
+ if (0 === o.length) return e;
40
+ const a = [e];
41
+ for (const e of o) {
42
+ const t = a[a.length - 1].getMovables()?.getItems().find((t) => t.getId() === e);
43
+ if (!t) break;
44
+ a.push(t);
45
+ }
46
+ const l = a.length - 1;
47
+ for (let e = l; e >= 0; e--) if (a[e].isSelected()) return a[Math.min(e + 1, l)];
48
+ const i = e.getRange().getSheet().getView().getMovableSelection().getContainer();
49
+ return i && v(i) === e ? a[Math.min(w(i) + 1, l)] : e;
50
+ }, w = (e) => {
51
+ let t = 0;
52
+ for (let n = e.getParent(); n; n = n.getParent()) t++;
53
+ return t;
54
+ }, C = t(/* @__PURE__ */ new Map()), x = n(({ movable: t, preview: n, onHost: r, children: l }) => {
55
+ const i = m(), [, c] = a((e) => e + 1, 0);
56
+ e(t, {
57
+ onBoundsChange: () => c(),
58
+ onAnyChange: () => c()
59
+ });
60
+ const d = o((e) => {
61
+ r(t, e);
62
+ }, [t, r]), u = f(t, i, n);
63
+ return s("div", {
64
+ className: "movable-adornment",
65
+ ref: d,
66
+ style: {
67
+ position: "absolute",
68
+ left: u.left,
69
+ top: u.top,
70
+ width: u.width,
71
+ height: u.height,
72
+ transform: u.rotation ? `rotate(${u.rotation}deg)` : void 0,
73
+ transformOrigin: "center",
74
+ zIndex: 3001,
75
+ pointerEvents: "none"
76
+ },
77
+ children: l
78
+ });
79
+ });
80
+ x.displayName = "MovableAdornment";
81
+ var y = {
82
+ nw: [-1, -1],
83
+ n: [0, -1],
84
+ ne: [1, -1],
85
+ w: [-1, 0],
86
+ e: [1, 0],
87
+ sw: [-1, 1],
88
+ s: [0, 1],
89
+ se: [1, 1]
90
+ }, M = [
91
+ "ew-resize",
92
+ "nwse-resize",
93
+ "ns-resize",
94
+ "nesw-resize"
95
+ ], R = (e, t) => {
96
+ const n = 180 * Math.atan2(e[1], e[0]) / Math.PI + t;
97
+ return M[(Math.round(n / 45) % 4 + 4) % 4];
98
+ }, z = n((e) => {
99
+ const { directions: t, rotation: n, isDragging: r = !1, onResizeStart: a, onResize: i, onResizeEnd: d, onResizeCancel: u, context: p = !1, onMoveStart: m, children: h } = e, f = l(null), g = o((e) => {
100
+ if (0 !== e.button) return;
101
+ e.stopPropagation(), e.preventDefault();
102
+ const t = y[e.currentTarget.dataset.direction ?? ""];
103
+ t && a() && (f.current = {
104
+ pointerId: e.pointerId,
105
+ direction: t,
106
+ press: {
107
+ x: e.clientX,
108
+ y: e.clientY
109
+ }
110
+ }, e.currentTarget.setPointerCapture(e.pointerId));
111
+ }, [a]), v = o((e) => {
112
+ const t = f.current;
113
+ t && t.pointerId === e.pointerId && (e.stopPropagation(), i(t.direction, [e.clientX - t.press.x, e.clientY - t.press.y], e.shiftKey));
114
+ }, [i]), b = o((e) => {
115
+ const t = f.current;
116
+ t && t.pointerId === e.pointerId && (e.stopPropagation(), f.current = null, d());
117
+ }, [d]), w = o((e) => {
118
+ const t = f.current;
119
+ t && t.pointerId === e.pointerId && (f.current = null, u());
120
+ }, [u]), C = o((e) => {
121
+ 0 === e.button && (e.stopPropagation(), e.preventDefault(), m?.(e.nativeEvent));
122
+ }, [m]);
123
+ return c("div", {
124
+ className: [
125
+ "movable-control",
126
+ r ? "dragging" : null,
127
+ p ? "context" : null
128
+ ].filter(Boolean).join(" "),
129
+ children: [
130
+ h,
131
+ s("div", { className: "movable-control-outline" }),
132
+ t.map((e) => {
133
+ const t = y[e];
134
+ return t ? s("div", {
135
+ className: "movable-control-handle",
136
+ "data-direction": e,
137
+ style: {
138
+ left: 50 * (t[0] + 1) + "%",
139
+ top: 50 * (t[1] + 1) + "%",
140
+ cursor: R(t, n)
141
+ },
142
+ onPointerDown: g,
143
+ onPointerMove: v,
144
+ onPointerUp: b,
145
+ onPointerCancel: w
146
+ }, e) : null;
147
+ }),
148
+ m ? s("div", {
149
+ className: "movable-move-handle",
150
+ onPointerDown: C,
151
+ children: s("svg", {
152
+ viewBox: "0 0 24 24",
153
+ "aria-hidden": "true",
154
+ children: s("path", { d: "M10 9h4V6h3l-5-5-5 5h3v3zm-1 1H6V7l-5 5 5 5v-3h3v-4zm14 2-5-5v3h-3v4h3v3l5-5zm-9 3h-4v3H7l5 5 5-5h-3v-3z" })
155
+ })
156
+ }) : null
157
+ ]
158
+ });
159
+ });
160
+ z.displayName = "MovableControl";
161
+ var P = /* @__PURE__ */ new Map(), B = /* @__PURE__ */ new Map(), S = /* @__PURE__ */ new Map(), j = /* @__PURE__ */ new Set(), k = () => {
162
+ for (const e of [...j]) e();
163
+ }, I = !1, D = () => {
164
+ I || (I = !0, function(e) {
165
+ e("picture", () => import("./DYosMUJKp-3MSO4q.mjs"), { select: (e) => e.PictureKind }), e("chart", () => import("./chart.mjs"), { select: ({ ChartEditor: e }) => (t) => s(e, {
166
+ ...t,
167
+ chart: t.movable.getContent()
168
+ }) }), e("slicer", () => import("./C_ANM4feA1xV-pri.mjs"), { select: (e) => e.SlicerKind }), e("shape", () => import("./Buw-VKYJy3y5dbaJ.mjs"), {
169
+ select: (e) => e.ShapeKind,
170
+ selectionShadow: !1
171
+ }), e("group", () => import("./group.mjs"), { select: ({ GroupEditor: e }) => (t) => s(e, {
172
+ ...t,
173
+ container: t.movable.getContent()
174
+ }) }), e("note", () => import("./note.mjs"), { select: ({ NoteEditor: e }) => (t) => {
175
+ const { onContextMenuCapture: n, ...o } = t;
176
+ return s(e, {
177
+ ...o,
178
+ note: t.movable.getContent()
179
+ });
180
+ } }), e("error", () => import("./Dxbm6ryIDCEi26RO.mjs").then((e) => e.t), { select: ({ ErrorContentFrame: e }) => (t) => s(e, { ...t }) });
181
+ const t = (t, n) => {
182
+ e(t, () => import("./control.mjs"), { select: n });
183
+ };
184
+ t("button", (e) => e.ButtonRenderer), t("checkBox", (e) => e.CheckBoxRenderer), t("optionButton", (e) => e.OptionButtonRenderer), t("listBox", (e) => e.ListBoxRenderer), t("dropDown", (e) => e.DropDownRenderer), t("scrollBar", (e) => e.ScrollBarRenderer), t("spinner", (e) => e.SpinnerRenderer), t("groupBox", (e) => e.GroupBoxRenderer), t("label", (e) => e.LabelRenderer), t("editBox", (e) => e.UnmodeledControlRenderer), t("dialog", (e) => e.UnmodeledControlRenderer), t("formControl", (e) => e.UnmodeledControlRenderer);
185
+ }(Y));
186
+ }, E = (e) => (D(), B.get(e) ?? P.get(e)), N = (e) => {
187
+ const { movable: t, fallback: n, children: o } = e, [, l] = a((e) => e + 1, 0), c = t.isContentLoaded();
188
+ return r(() => {
189
+ if (c) return;
190
+ let e = !0;
191
+ return t.whenContentLoaded().then(() => {
192
+ e && l();
193
+ }), () => {
194
+ e = !1;
195
+ };
196
+ }, [t, c]), s(i, { children: c ? o : n });
197
+ }, L = (e) => {
198
+ const [, t] = a((e) => e + 1, 0), n = e.module;
199
+ return r(() => {
200
+ if (n) return;
201
+ let o = !0;
202
+ const r = O(() => {
203
+ o && e.module && t();
204
+ });
205
+ return e.loadModule().catch(() => {}), () => {
206
+ o = !1, r();
207
+ };
208
+ }, [e, n]), n;
209
+ }, A = (e) => {
210
+ const t = L(e.kind);
211
+ if (!t) return s(i, { children: e.fallback });
212
+ const n = t.renderer;
213
+ return s(n, { ...e.props });
214
+ }, K = (e, t, n, o) => {
215
+ const r = u(e, t, {
216
+ select: (e) => {
217
+ const t = n?.select ? n.select(e) : e, o = "object" == typeof (r = t) && null !== r && "renderer" in r ? t : { renderer: t };
218
+ var r;
219
+ return c.module = o, c.control = o.control, c.loaded = !0, k(), o;
220
+ },
221
+ prefetch: !1 !== n?.prefetch && (o ?? !0)
222
+ });
223
+ let a = null;
224
+ const l = n?.fallback ?? null, i = (e) => s(N, {
225
+ movable: e.movable,
226
+ fallback: l,
227
+ children: s(A, {
228
+ kind: c,
229
+ fallback: l,
230
+ props: e
231
+ })
232
+ }), c = {
233
+ Renderer: "content" === n?.hitArea ? i : (e) => s("div", {
234
+ className: "movable-content",
235
+ style: e.style,
236
+ children: i(e)
237
+ }),
238
+ loaded: !1,
239
+ control: void 0,
240
+ LazyControl: (e) => {
241
+ const t = L(c)?.control ?? z;
242
+ return s(t, { ...e });
243
+ },
244
+ ownShadow: !1 === n?.selectionShadow,
245
+ loadModule: () => (a ??= r.load().then((e) => (a = null, e), (t) => {
246
+ throw a = null, console.warn(`The renderer '${e}' could not be loaded; its movables are drawn as the fallback.`, t), t;
247
+ }), a),
248
+ module: void 0,
249
+ lazyModule: r
250
+ };
251
+ return c;
252
+ };
253
+ function U(e, t, n) {
254
+ D();
255
+ const o = K(`movable-renderer:${e}`, t, n);
256
+ return B.set(e, o), k(), () => {
257
+ B.get(e) === o && (B.delete(e), d.remove(o.lazyModule), k());
258
+ };
259
+ }
260
+ function $(e, t) {
261
+ let n = null;
262
+ const o = {
263
+ load: () => (n ??= t().then((t) => {
264
+ o.pane = t, S.get(e) === o && k();
265
+ }, (e) => {
266
+ throw n = null, e;
267
+ }), n),
268
+ pane: void 0
269
+ };
270
+ return S.set(e, o), k(), () => {
271
+ S.get(e) === o && (S.delete(e), k());
272
+ };
273
+ }
274
+ function F(e) {
275
+ const t = E(e);
276
+ if (!t?.module) return;
277
+ const n = S.get(e);
278
+ n && !n.pane && n.load().catch(() => {});
279
+ const { control: o, commands: r, toolbar: a, pane: l } = t.module;
280
+ return {
281
+ type: e,
282
+ control: o,
283
+ commands: r,
284
+ toolbar: a,
285
+ pane: n ? n.pane : l
286
+ };
287
+ }
288
+ async function H(e) {
289
+ const t = E(e);
290
+ if (t) {
291
+ try {
292
+ await t.loadModule(), await S.get(e)?.load();
293
+ } catch {
294
+ return;
295
+ }
296
+ return F(e);
297
+ }
298
+ }
299
+ function O(e) {
300
+ return j.add(e), () => {
301
+ j.delete(e);
302
+ };
303
+ }
304
+ function T(e) {
305
+ return !E(e)?.ownShadow;
306
+ }
307
+ function V(e) {
308
+ const t = E(e);
309
+ if (t) return t.loaded ? t.control : t.LazyControl;
310
+ }
311
+ function G(e) {
312
+ return E(e)?.Renderer;
313
+ }
314
+ function X() {
315
+ return D(), [.../* @__PURE__ */ new Set([...P.keys(), ...B.keys()])];
316
+ }
317
+ function Y(e, t, n) {
318
+ P.set(e, K(`movable-renderer:built-in:${e}`, t, {
319
+ hitArea: "content",
320
+ ...n
321
+ }, () => !B.has(e)));
322
+ }
323
+ export { v as _, X as a, $ as c, z as d, R as f, b as g, g as h, G as i, U as l, x as m, V as n, T as o, C as p, F as r, Y as s, O as t, H as u, f as v };
@@ -0,0 +1,80 @@
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 t, memo as e, useMemo as n, useRef as o } from "react";
8
+ import { jsx as r } from "react/jsx-runtime";
9
+ import { useMergeRefs as i } from "react-merge-refs";
10
+ var l = "data-run", s = (t) => "string" == typeof t ? t ? [{ text: t }] : [] : t.runs ?? [], a = (t) => {
11
+ if (3 === t.nodeType) return t.nodeValue ?? "";
12
+ if (1 !== t.nodeType) return "";
13
+ if ("br" === t.localName) return "\n";
14
+ let e = "";
15
+ const n = t.childNodes;
16
+ for (let t = 0; t < n.length; t++) e += a(n[t]);
17
+ return e;
18
+ }, u = e(t((t, e) => {
19
+ const { value: u, onChange: p, onDone: c, readOnly: d = !1, runStyle: f, style: y, onKeyDown: g, onBlur: h, ...x } = t, m = o(null), v = n(() => s(u), [u]), b = n(() => JSON.stringify(u), [u]), w = () => {
20
+ const t = m.current;
21
+ if (!t || d) return;
22
+ const e = ((t, e) => {
23
+ const n = [], o = t.childNodes;
24
+ for (let t = 0; t < o.length; t++) {
25
+ const r = o[t], i = a(r);
26
+ if (!i) continue;
27
+ const s = 1 === r.nodeType ? r.getAttribute(l) : null;
28
+ if (null !== s) {
29
+ const t = e[parseInt(s, 10)]?.font;
30
+ n.push(t ? {
31
+ text: i,
32
+ font: t
33
+ } : { text: i });
34
+ continue;
35
+ }
36
+ const u = n[n.length - 1];
37
+ u ? u.text += i : n.push({ text: i });
38
+ }
39
+ return n.every((t) => !t.font) ? n.map((t) => t.text).join("") : { runs: n };
40
+ })(t, v);
41
+ JSON.stringify(s(e)) !== JSON.stringify(v) && p?.(e);
42
+ }, N = (t) => {
43
+ t.stopPropagation();
44
+ }, S = i([m, e]);
45
+ return r("div", {
46
+ ref: S,
47
+ contentEditable: !d && "plaintext-only",
48
+ suppressContentEditableWarning: !0,
49
+ spellCheck: !1,
50
+ ...x,
51
+ style: {
52
+ width: "100%",
53
+ minHeight: "100%",
54
+ boxSizing: "border-box",
55
+ outline: "none",
56
+ whiteSpace: "pre-wrap",
57
+ overflowWrap: "break-word",
58
+ userSelect: "text",
59
+ cursor: d ? void 0 : "text",
60
+ ...y
61
+ },
62
+ onKeyDown: (t) => {
63
+ g?.(t), d || (t.stopPropagation(), "Escape" === t.key && (t.preventDefault(), t.currentTarget.blur(), c?.()));
64
+ },
65
+ onKeyUp: d ? void 0 : N,
66
+ onCopy: d ? void 0 : N,
67
+ onCut: d ? void 0 : N,
68
+ onPaste: d ? void 0 : N,
69
+ onBlur: (t) => {
70
+ w(), h?.(t);
71
+ },
72
+ children: v.map((t, e) => r("span", {
73
+ [l]: e,
74
+ style: t.font ? f?.(t.font) : void 0,
75
+ children: t.text
76
+ }, e))
77
+ }, b);
78
+ }));
79
+ u.displayName = "RichTextEditor";
80
+ export { u as t };
@@ -0,0 +1,76 @@
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 { PictureEditor as e } from "./picture.mjs";
8
+ import { jsx as t } from "react/jsx-runtime";
9
+ import { DOMUtils as i, messageKey as o, t as a } from "@sheetxl/utils";
10
+ import { NotifierType as n } from "@sheetxl/utils-react";
11
+ var s = {
12
+ renderer: (i) => {
13
+ const o = i.movable.getContent();
14
+ return t(e, {
15
+ loadingPanel: t("div", { style: {
16
+ position: "absolute",
17
+ width: "100%",
18
+ height: "100%"
19
+ } }),
20
+ picture: o,
21
+ description: o.getDescription() ?? o.getName?.() ?? void 0,
22
+ ...i
23
+ });
24
+ },
25
+ commands: (e, t) => {
26
+ const { sheet: s, movable: r, notifier: l } = t, c = r.getContent(), u = async (e) => {
27
+ const t = await (async (e) => {
28
+ const t = await Promise.resolve(l?.showBusy?.(a(o("op.setPictureResource"))) ?? null);
29
+ try {
30
+ const t = s.getResources().add(e);
31
+ return await t.toBuffer(), t;
32
+ } catch (e) {
33
+ let t = e;
34
+ if ("string" != typeof t) {
35
+ console.warn(e);
36
+ const i = "string" == typeof e?.cause ? e.cause : "";
37
+ let o = "string" == typeof e?.message ? e.message : "";
38
+ i && (o = o ? `${o} (${i})` : i), t = a("error.insertImage.unresolved", { detail: o });
39
+ }
40
+ return l?.showMessage?.(t, { type: n.Error }), null;
41
+ } finally {
42
+ t?.();
43
+ }
44
+ })(e);
45
+ t && c.setResource(t);
46
+ };
47
+ e.updateCommand("changePictureFromFile", {
48
+ tags: ["noTransaction", "noRepeat"],
49
+ callback: async (e) => {
50
+ let t = null, o = null;
51
+ "string" == typeof e ? o = e : t = e ?? null, (t || (t = await i.openFileDialog(o ?? "image/*"), t)) && await u({ source: { file: await Promise.resolve(t) } });
52
+ }
53
+ }), e.updateCommand("changePictureFromURL", {
54
+ tags: ["noTransaction", "noRepeat"],
55
+ callback: async (e) => {
56
+ if (!e) {
57
+ const t = await l?.showInput?.({
58
+ title: a("dialog.changePicture.title"),
59
+ description: a("dialog.changePicture.description"),
60
+ inputLabel: a("dialog.insertImage.inputLabel"),
61
+ initialValue: "https://picsum.photos/360",
62
+ propsInput: { style: { minWidth: "440px" } },
63
+ options: [{
64
+ id: "Change",
65
+ label: () => a("dialog.change")
66
+ }]
67
+ });
68
+ if (!t || "Change" !== t.option) return;
69
+ e = t.input;
70
+ }
71
+ e && await u({ source: { fetch: e } });
72
+ }
73
+ });
74
+ }
75
+ };
76
+ export { s as PictureKind };
@@ -0,0 +1,68 @@
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 t = (t) => {
8
+ const e = t?.getSlicerStyles();
9
+ if (!e) return {
10
+ custom: [],
11
+ light: [],
12
+ other: [],
13
+ dark: []
14
+ };
15
+ const o = e.getItems({ type: "builtIn" }).map((t) => t.getName()), r = new Set(o.map((t) => t.toLowerCase()));
16
+ return {
17
+ custom: e.getItems({ type: "custom" }).map((t) => t.getName()).filter((t) => !r.has(t.toLowerCase())),
18
+ light: o.filter((t) => t.startsWith("SlicerStyleLight")),
19
+ other: o.filter((t) => t.startsWith("SlicerStyleOther")),
20
+ dark: o.filter((t) => t.startsWith("SlicerStyleDark"))
21
+ };
22
+ }, e = (t, e) => {
23
+ const o = e?.getSlicerStyles();
24
+ return o ? (o.getByName(t) ?? o.getByName("SlicerStyleLight1"))?.getProperties() ?? null : null;
25
+ }, o = (t, e, o) => {
26
+ const r = `${t ? "Selected" : "Unselected"}ItemWith${e ? "Data" : "NoData"}`;
27
+ return o ? `hovered${r}` : r.charAt(0).toLowerCase() + r.slice(1);
28
+ }, r = (t, e) => {
29
+ const o = {};
30
+ if (!t || !e) return o;
31
+ const r = (t) => {
32
+ if (t) return e.parseColor(t)?.toCSS("adaptive") ?? void 0;
33
+ }, s = t.font;
34
+ if (s) {
35
+ (s.weight ?? 400) >= 700 && (o.fontWeight = "bold");
36
+ const t = r(s.color);
37
+ t && (o.color = t);
38
+ }
39
+ const n = t.fill;
40
+ if ("gradient" === n?.type && n.stops?.length) {
41
+ const t = n.stops.length, e = n.stops.map((e, o) => {
42
+ const s = e && "object" == typeof e && "color" in e ? e : { color: e }, n = s.offset ?? (t > 1 ? o / (t - 1) : 0);
43
+ return `${r(s.color) ?? "transparent"} ${100 * n}%`;
44
+ });
45
+ o.background = `linear-gradient(${n.angle ?? 0}deg, ${e.join(", ")})`;
46
+ } else if ("pattern" === n?.type && "none" !== n.patternType) {
47
+ const t = r(n.foreground);
48
+ t && (o.background = t);
49
+ } else if ("solid" === n?.type) {
50
+ const t = r(n.color);
51
+ t && (o.background = t);
52
+ }
53
+ const i = t.borders;
54
+ if (i) for (const t of [
55
+ "left",
56
+ "right",
57
+ "top",
58
+ "bottom"
59
+ ]) {
60
+ const e = i[t];
61
+ if (!e || "none" === e.style) continue;
62
+ const s = r(e.color);
63
+ if (!s) continue;
64
+ o[`border${t.charAt(0).toUpperCase()}${t.slice(1)}`] = `1px solid ${s}`;
65
+ }
66
+ return o;
67
+ };
68
+ export { o as i, t as n, r, e as t };
@@ -0,0 +1,66 @@
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 r, useEffect as o } from "react";
8
+ import { jsx as t } from "react/jsx-runtime";
9
+ import { useImperativeElement as n, useMeasure as a, useTranslator as i } from "@sheetxl/utils-react";
10
+ import { useMergeRefs as s } from "react-merge-refs";
11
+ var l = Object.defineProperty, d = (e, r) => {
12
+ let o = {};
13
+ for (var t in e) l(o, t, {
14
+ get: e[t],
15
+ enumerable: !0
16
+ });
17
+ return r || l(o, Symbol.toStringTag, { value: "Module" }), o;
18
+ }, m = r(e((e, r) => {
19
+ const { children: i, disabled: l, style: d, movable: m, zoom: g = 1, description: p, isDragging: c, onHide: b, onShow: u, onDragZone: v, adornmentHost: x, flip: y, gesture: f, ...h } = e;
20
+ o(() => {}, [p]);
21
+ const w = n(r, () => ({ isEmptyFrame: () => !0 }), []), [k, { height: C, width: S }] = a(), j = s([w, k]);
22
+ return t("div", {
23
+ className: "unknown-editor",
24
+ ...h,
25
+ ref: j,
26
+ style: {
27
+ width: "100%",
28
+ height: "100%",
29
+ border: "var(--sxl-color-neutral, grey) solid 1px",
30
+ backgroundColor: "var(--sxl-color-base-100, white)",
31
+ backgroundImage: "var(--sxl-image-background)",
32
+ alignItems: "center",
33
+ justifyContent: "center",
34
+ zoom: g,
35
+ display: "flex",
36
+ position: "relative",
37
+ filter: l ? "blur(1px)" : void 0,
38
+ boxShadow: c ? "1px 1px 2px var(--sxl-color-shadow, rgba(0,0,0,.15))" : void 0,
39
+ overflow: "hidden",
40
+ wordBreak: "break-word",
41
+ ...d
42
+ },
43
+ children: p
44
+ });
45
+ })), g = d({
46
+ ErrorContentFrame: () => c,
47
+ UnsupportedContentFrame: () => b
48
+ }), p = Object.freeze({ border: "var(--sxl-color-error, red) solid 2px" }), c = r((e) => {
49
+ const r = i(), o = e.movable.getContent(), n = o.getError(), a = n?.message ?? String(n);
50
+ return t(m, {
51
+ ...e,
52
+ style: p,
53
+ description: r("movable.contentError", {
54
+ type: o.getOriginalType(),
55
+ message: a
56
+ })
57
+ });
58
+ }), b = r((e) => {
59
+ const r = i();
60
+ return t(m, {
61
+ ...e,
62
+ style: p,
63
+ description: r("movable.unsupportedType", { type: e.movable.getContent().getType() })
64
+ });
65
+ });
66
+ export { d as i, b as n, m as r, g as t };