@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,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 { t as e } from "./Cfe0kofqVKGxLqO6.mjs";
8
+ import { forwardRef as t, memo as n, useEffect as r } from "react";
9
+ import { jsx as i } from "react/jsx-runtime";
10
+ import { useImperativeElement as a, useMeasure as o, useTranslator as s } from "@sheetxl/utils-react";
11
+ var c = Object.defineProperty, l = (e, t) => {
12
+ let n = {};
13
+ for (var r in e) c(n, r, {
14
+ get: e[r],
15
+ enumerable: !0
16
+ });
17
+ return t || c(n, Symbol.toStringTag, { value: "Module" }), n;
18
+ }, u = n(t((t, n) => {
19
+ let { children: s, disabled: c, style: l, movable: u, zoom: d = 1, description: f, isDragging: p, onHide: m, onShow: h, onDragZone: g, adornmentHost: _, flip: v, gesture: y, ...b } = t;
20
+ r(() => {}, [f]);
21
+ let x = a(n, () => ({ isEmptyFrame: () => !0 }), []), [S, { height: C, width: w }] = o(), T = e([x, S]);
22
+ return i("div", {
23
+ className: "unknown-editor",
24
+ ...b,
25
+ ref: T,
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: d,
35
+ display: "flex",
36
+ position: "relative",
37
+ filter: c ? "blur(1px)" : void 0,
38
+ boxShadow: p ? "1px 1px 2px var(--sxl-color-shadow, rgba(0,0,0,.15))" : void 0,
39
+ overflow: "hidden",
40
+ wordBreak: "break-word",
41
+ ...l
42
+ },
43
+ children: f
44
+ });
45
+ })), d = l({
46
+ ErrorContentFrame: () => p,
47
+ UnsupportedContentFrame: () => m
48
+ }), f = Object.freeze({ border: "var(--sxl-color-error, red) solid 2px" }), p = n((e) => {
49
+ let t = s(), n = e.movable.getContent(), r = n.getError(), a = r?.message ?? String(r);
50
+ return i(u, {
51
+ ...e,
52
+ style: f,
53
+ description: t("movable.contentError", {
54
+ type: n.getOriginalType(),
55
+ message: a
56
+ })
57
+ });
58
+ }), m = n((e) => {
59
+ let t = s();
60
+ return i(u, {
61
+ ...e,
62
+ style: f,
63
+ description: t("movable.unsupportedType", { type: e.movable.getContent().getType() })
64
+ });
65
+ });
66
+ export { l as i, m as n, u as r, d as t };
@@ -0,0 +1,20 @@
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 { createContext as e, useContext as t } from "react";
8
+ import { jsx as n } from "react/jsx-runtime";
9
+ var r = e(null);
10
+ function i(e) {
11
+ let { sheet: t, children: i } = e;
12
+ return n(r.Provider, {
13
+ value: t,
14
+ children: i
15
+ });
16
+ }
17
+ function a() {
18
+ return t(r);
19
+ }
20
+ export { a as n, i as t };
@@ -0,0 +1,318 @@
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 { createContext as t, memo as n, useCallback as r, useEffect as i, useReducer as a, useRef as o } from "react";
9
+ import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
10
+ import { LazyModules as u, defineLazyModule as d } from "@sheetxl/utils";
11
+ import { ReactUtils as f } from "@sheetxl/utils-react";
12
+ import { useGridPane as p } from "@sheetxl/grid-react";
13
+ var m = Object.freeze({
14
+ x: 0,
15
+ y: 0,
16
+ width: 0,
17
+ height: 0
18
+ }), h = (e, t, n) => {
19
+ let r = n?.bounds ?? e.getBounds(), i = r ? t.toPaneBounds(r) : m, a = f.getDevicePixelRatio();
20
+ return {
21
+ left: f.snapDeviceEdge(i.x, a),
22
+ top: f.snapDeviceEdge(i.y, a),
23
+ width: i.width,
24
+ height: i.height,
25
+ rotation: n?.rotation ?? (e.getRotation() || 0),
26
+ flip: n?.flip ?? e.getFlip()
27
+ };
28
+ }, g = "data-movable-id", _ = (e) => {
29
+ let t = e;
30
+ for (let e = t.getParent(); e; e = t.getParent()) t = e;
31
+ return t;
32
+ }, v = (e, t, n) => {
33
+ let r = [], i = t;
34
+ for (; i && i !== n;) {
35
+ let e = i.getAttribute?.(g);
36
+ e && r.unshift(e), i = i.parentElement;
37
+ }
38
+ if (r.length === 0) return e;
39
+ let a = [e];
40
+ for (let e of r) {
41
+ let t = a[a.length - 1].getMovables()?.getItems().find((t) => t.getId() === e);
42
+ if (!t) break;
43
+ a.push(t);
44
+ }
45
+ let o = a.length - 1;
46
+ for (let e = o; e >= 0; e--) if (a[e].isSelected()) return a[Math.min(e + 1, o)];
47
+ let s = e.getRange().getSheet().getView().getMovableSelection().getContainer();
48
+ return s && _(s) === e ? a[Math.min(y(s) + 1, o)] : e;
49
+ }, y = (e) => {
50
+ let t = 0;
51
+ for (let n = e.getParent(); n; n = n.getParent()) t++;
52
+ return t;
53
+ }, b = t(/* @__PURE__ */ new Map()), x = n(({ movable: t, preview: n, onHost: i, children: o }) => {
54
+ let s = p(), [, l] = a((e) => e + 1, 0);
55
+ e(t, {
56
+ onBoundsChange: () => l(),
57
+ onAnyChange: () => l()
58
+ });
59
+ let u = r((e) => {
60
+ i(t, e);
61
+ }, [t, i]), d = h(t, s, n);
62
+ return c("div", {
63
+ className: "movable-adornment",
64
+ ref: u,
65
+ style: {
66
+ position: "absolute",
67
+ left: d.left,
68
+ top: d.top,
69
+ width: d.width,
70
+ height: d.height,
71
+ transform: d.rotation ? `rotate(${d.rotation}deg)` : void 0,
72
+ transformOrigin: "center",
73
+ zIndex: 3001,
74
+ pointerEvents: "none"
75
+ },
76
+ children: o
77
+ });
78
+ });
79
+ x.displayName = "MovableAdornment";
80
+ var S = {
81
+ nw: [-1, -1],
82
+ n: [0, -1],
83
+ ne: [1, -1],
84
+ w: [-1, 0],
85
+ e: [1, 0],
86
+ sw: [-1, 1],
87
+ s: [0, 1],
88
+ se: [1, 1]
89
+ }, C = [
90
+ "ew-resize",
91
+ "nwse-resize",
92
+ "ns-resize",
93
+ "nesw-resize"
94
+ ], w = (e, t) => {
95
+ let n = 180 * Math.atan2(e[1], e[0]) / Math.PI + t;
96
+ return C[(Math.round(n / 45) % 4 + 4) % 4];
97
+ }, T = n((e) => {
98
+ let { directions: t, rotation: n, isDragging: i = !1, onResizeStart: a, onResize: s, onResizeEnd: u, onResizeCancel: d, context: f = !1, onMoveStart: p, children: m } = e, h = o(null), g = r((e) => {
99
+ if (e.button !== 0) return;
100
+ e.stopPropagation(), e.preventDefault();
101
+ let t = S[e.currentTarget.dataset.direction ?? ""];
102
+ t && a() && (h.current = {
103
+ pointerId: e.pointerId,
104
+ direction: t,
105
+ press: {
106
+ x: e.clientX,
107
+ y: e.clientY
108
+ }
109
+ }, e.currentTarget.setPointerCapture(e.pointerId));
110
+ }, [a]), _ = r((e) => {
111
+ let t = h.current;
112
+ t && t.pointerId === e.pointerId && (e.stopPropagation(), s(t.direction, [e.clientX - t.press.x, e.clientY - t.press.y], e.shiftKey));
113
+ }, [s]), v = r((e) => {
114
+ let t = h.current;
115
+ t && t.pointerId === e.pointerId && (e.stopPropagation(), h.current = null, u());
116
+ }, [u]), y = r((e) => {
117
+ let t = h.current;
118
+ t && t.pointerId === e.pointerId && (h.current = null, d());
119
+ }, [d]), b = r((e) => {
120
+ e.button === 0 && (e.stopPropagation(), e.preventDefault(), p?.(e.nativeEvent));
121
+ }, [p]);
122
+ return l("div", {
123
+ className: [
124
+ "movable-control",
125
+ i ? "dragging" : null,
126
+ f ? "context" : null
127
+ ].filter(Boolean).join(" "),
128
+ children: [
129
+ m,
130
+ c("div", { className: "movable-control-outline" }),
131
+ t.map((e) => {
132
+ let t = S[e];
133
+ return t ? c("div", {
134
+ className: "movable-control-handle",
135
+ "data-direction": e,
136
+ style: {
137
+ left: 50 * (t[0] + 1) + "%",
138
+ top: 50 * (t[1] + 1) + "%",
139
+ cursor: w(t, n)
140
+ },
141
+ onPointerDown: g,
142
+ onPointerMove: _,
143
+ onPointerUp: v,
144
+ onPointerCancel: y
145
+ }, e) : null;
146
+ }),
147
+ p ? c("div", {
148
+ className: "movable-move-handle",
149
+ onPointerDown: b,
150
+ children: c("svg", {
151
+ viewBox: "0 0 24 24",
152
+ "aria-hidden": "true",
153
+ children: c("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" })
154
+ })
155
+ }) : null
156
+ ]
157
+ });
158
+ });
159
+ T.displayName = "MovableControl";
160
+ var E = /* @__PURE__ */ new Map(), D = /* @__PURE__ */ new Map(), O = /* @__PURE__ */ new Map(), k = /* @__PURE__ */ new Set(), A = () => {
161
+ for (let e of [...k]) e();
162
+ }, j = !1, M = () => {
163
+ j || (j = !0, function(e) {
164
+ e("picture", () => import("./Sp6PJavGKpF8SJzA.mjs"), { select: (e) => e.PictureKind }), e("chart", () => import("./chart.mjs"), { select: ({ ChartEditor: e }) => (t) => c(e, {
165
+ ...t,
166
+ chart: t.movable.getContent()
167
+ }) }), e("slicer", () => import("./BwRduT8FTrk5n72r.mjs"), { select: (e) => e.SlicerKind }), e("shape", () => import("./CYoUd5KIl7W3AsxH.mjs"), {
168
+ select: (e) => e.ShapeKind,
169
+ selectionShadow: !1
170
+ }), e("group", () => import("./group.mjs"), { select: ({ GroupEditor: e }) => (t) => c(e, {
171
+ ...t,
172
+ container: t.movable.getContent()
173
+ }) }), e("note", () => import("./note.mjs"), { select: ({ NoteEditor: e }) => (t) => {
174
+ let { onContextMenuCapture: n, ...r } = t;
175
+ return c(e, {
176
+ ...r,
177
+ note: t.movable.getContent()
178
+ });
179
+ } }), e("error", () => import("./BHjeSMaycUkS5dVL.mjs").then((e) => e.t), { select: ({ ErrorContentFrame: e }) => (t) => c(e, { ...t }) });
180
+ let t = (t, n) => {
181
+ e(t, () => import("./control.mjs"), { select: n });
182
+ };
183
+ 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);
184
+ }(q));
185
+ }, N = (e) => (M(), D.get(e) ?? E.get(e)), P = (e) => {
186
+ let { movable: t, fallback: n, children: r } = e, [, o] = a((e) => e + 1, 0), l = t.isContentLoaded();
187
+ return i(() => {
188
+ if (l) return;
189
+ let e = !0;
190
+ return t.whenContentLoaded().then(() => {
191
+ e && o();
192
+ }), () => {
193
+ e = !1;
194
+ };
195
+ }, [t, l]), c(s, { children: l ? r : n });
196
+ }, F = (e) => {
197
+ let [, t] = a((e) => e + 1, 0), n = e.module;
198
+ return i(() => {
199
+ if (n) return;
200
+ let r = !0, i = H(() => {
201
+ r && e.module && t();
202
+ });
203
+ return e.loadModule().catch(() => {}), () => {
204
+ r = !1, i();
205
+ };
206
+ }, [e, n]), n;
207
+ }, I = (e) => {
208
+ let t = F(e.kind);
209
+ if (!t) return c(s, { children: e.fallback });
210
+ let n = t.renderer;
211
+ return c(n, { ...e.props });
212
+ }, L = (e, t, n, r) => {
213
+ let i = d(e, t, {
214
+ select: (e) => {
215
+ let t = n?.select ? n.select(e) : e, r = typeof (i = t) == "object" && i !== null && "renderer" in i ? t : { renderer: t };
216
+ var i;
217
+ return l.module = r, l.control = r.control, l.loaded = !0, A(), r;
218
+ },
219
+ prefetch: !1 !== n?.prefetch && (r ?? !0)
220
+ }), a = null, o = n?.fallback ?? null, s = (e) => c(P, {
221
+ movable: e.movable,
222
+ fallback: o,
223
+ children: c(I, {
224
+ kind: l,
225
+ fallback: o,
226
+ props: e
227
+ })
228
+ }), l = {
229
+ Renderer: n?.hitArea === "content" ? s : (e) => c("div", {
230
+ className: "movable-content",
231
+ style: e.style,
232
+ children: s(e)
233
+ }),
234
+ loaded: !1,
235
+ control: void 0,
236
+ LazyControl: (e) => {
237
+ let t = F(l)?.control ?? T;
238
+ return c(t, { ...e });
239
+ },
240
+ ownShadow: !1 === n?.selectionShadow,
241
+ loadModule: () => (a ??= i.load().then((e) => (a = null, e), (t) => {
242
+ throw a = null, console.warn(`The renderer '${e}' could not be loaded; its movables are drawn as the fallback.`, t), t;
243
+ }), a),
244
+ module: void 0,
245
+ lazyModule: i
246
+ };
247
+ return l;
248
+ };
249
+ function R(e, t, n) {
250
+ M();
251
+ let r = L(`movable-renderer:${e}`, t, n);
252
+ return D.set(e, r), A(), () => {
253
+ D.get(e) === r && (D.delete(e), u.remove(r.lazyModule), A());
254
+ };
255
+ }
256
+ function z(e, t) {
257
+ let n = null, r = {
258
+ load: () => (n ??= t().then((t) => {
259
+ r.pane = t, O.get(e) === r && A();
260
+ }, (e) => {
261
+ throw n = null, e;
262
+ }), n),
263
+ pane: void 0
264
+ };
265
+ return O.set(e, r), A(), () => {
266
+ O.get(e) === r && (O.delete(e), A());
267
+ };
268
+ }
269
+ function B(e) {
270
+ let t = N(e);
271
+ if (!t?.module) return;
272
+ let n = O.get(e);
273
+ n && !n.pane && n.load().catch(() => {});
274
+ let { control: r, commands: i, toolbar: a, pane: o } = t.module;
275
+ return {
276
+ type: e,
277
+ control: r,
278
+ commands: i,
279
+ toolbar: a,
280
+ pane: n ? n.pane : o
281
+ };
282
+ }
283
+ async function V(e) {
284
+ let t = N(e);
285
+ if (t) {
286
+ try {
287
+ await t.loadModule(), await O.get(e)?.load();
288
+ } catch {
289
+ return;
290
+ }
291
+ return B(e);
292
+ }
293
+ }
294
+ function H(e) {
295
+ return k.add(e), () => {
296
+ k.delete(e);
297
+ };
298
+ }
299
+ function U(e) {
300
+ return !N(e)?.ownShadow;
301
+ }
302
+ function W(e) {
303
+ let t = N(e);
304
+ if (t) return t.loaded ? t.control : t.LazyControl;
305
+ }
306
+ function G(e) {
307
+ return N(e)?.Renderer;
308
+ }
309
+ function K() {
310
+ return M(), [.../* @__PURE__ */ new Set([...E.keys(), ...D.keys()])];
311
+ }
312
+ function q(e, t, n) {
313
+ E.set(e, L(`movable-renderer:built-in:${e}`, t, {
314
+ hitArea: "content",
315
+ ...n
316
+ }, () => !D.has(e)));
317
+ }
318
+ export { _, K as a, z as c, T as d, w as f, v as g, g as h, G as i, R as l, x as m, W as n, U as o, b as p, B as r, q as s, H as t, V as u, h as v };