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

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 (261) hide show
  1. package/browser/esm/B4mT3G7GHwgDYFGP.mjs +128 -0
  2. package/browser/esm/{BwRduT8FTrk5n72r.mjs → BDlpRkuBok0Uu4Hn.mjs} +1 -1
  3. package/browser/esm/BR-AiOwuQlYh5-tr.mjs +730 -0
  4. package/browser/esm/{BuvXl14hs-1CvjeA.mjs → BapujiblfiXDlu67.mjs} +1 -1
  5. package/browser/esm/{DyU9UInRnfkPYYlR.mjs → CSFORKZ8zrVL_Y0w.mjs} +1 -1
  6. package/browser/esm/CUekkfE6uwwsdQpc.mjs +36 -0
  7. package/browser/esm/C_LUq-BnguetvGZz.mjs +23561 -0
  8. package/browser/esm/{BZcQ-KYwS62Ut45c.mjs → Ck1LbcsdSfKNi6xq.mjs} +1 -1
  9. package/browser/esm/{CYoUd5KIl7W3AsxH.mjs → Cslk_qRdBSuJIi1O.mjs} +24 -23
  10. package/browser/esm/CtGhA0kS2MCfEsHN.mjs +262 -0
  11. package/browser/esm/D22NJmTiky4NL8tM.mjs +8 -0
  12. package/browser/esm/D2GydDzPuvIjdpok.mjs +42 -0
  13. package/browser/esm/DGG1auUKsjFbAazu.mjs +60 -0
  14. package/browser/esm/{Cfe0kofqVKGxLqO6.mjs → DN3lqq95KY0K6f1x.mjs} +1 -1
  15. package/browser/esm/{DjiBz4H74I6nPUY6.mjs → D_usN3pWuCJU2GN-.mjs} +2 -2
  16. package/browser/esm/{Sp6PJavGKpF8SJzA.mjs → DhYQRc8L2kALmFNz.mjs} +1 -1
  17. package/browser/esm/{Bow9CzRJrYxak2i5.mjs → DxEczXCHTerDemDP.mjs} +113 -108
  18. package/browser/esm/{Dd-ZybXAgoq9pgGv.mjs → LBQDhVhz7S7i6a8i.mjs} +1 -1
  19. package/browser/esm/{C6urN77szrYwODXF.mjs → ZoS0cpNEBcv6p-Z1.mjs} +1 -1
  20. package/browser/esm/{cYjYjqEsyd63x8t4.mjs → _6Sb6ElRcZftxMNh.mjs} +1 -1
  21. package/browser/esm/chart.mjs +33 -52
  22. package/browser/esm/control.mjs +2 -2
  23. package/browser/esm/group.mjs +3 -3
  24. package/browser/esm/index.mjs +8074 -5647
  25. package/browser/esm/note.mjs +73 -47
  26. package/browser/esm/picture.mjs +41 -41
  27. package/browser/esm/shape.mjs +2 -2
  28. package/browser/esm/slicer.mjs +5 -5
  29. package/licenses/dependencies.txt +313 -1
  30. package/node/esm/{Dxbm6ryIDCEi26RO.mjs → Apcuz4_QtBHt7G47.mjs} +1 -1
  31. package/node/esm/Bi2Jwc0zpweaNzKc.mjs +1697 -0
  32. package/node/esm/{Buw-VKYJy3y5dbaJ.mjs → C0KLMCRb3sbd5Q20.mjs} +23 -22
  33. package/node/esm/CH1DVfFhjdd_3pw1.mjs +128 -0
  34. package/node/esm/{BJ7ZZm63j5O6cvrB.mjs → CNOLkUDURBElaaIf.mjs} +1 -1
  35. package/node/esm/{DhSq680c5tgMFFbj.mjs → CalVk3o4-kX79s3v.mjs} +1 -1
  36. package/node/esm/{DYosMUJKp-3MSO4q.mjs → Cp1DuCae46eQKzWy.mjs} +1 -1
  37. package/node/esm/CzN6c6KyxVmNvayz.mjs +8 -0
  38. package/node/esm/DKqdv5JubgVaq-g9.mjs +35 -0
  39. package/node/esm/DWkPWuf5ZrLRMixG.mjs +328 -0
  40. package/node/esm/{BfRn5S5V4X8xIAEa.mjs → DXiNwr6ZnXBe7TlG.mjs} +1 -1
  41. package/node/esm/DayGI0Bt57FDNbVF.mjs +37 -0
  42. package/node/esm/{CM5BT7h-hMtST2bE.mjs → DyetXBW7vFLJWB22.mjs} +1 -1
  43. package/node/esm/{CFFlJxNwgyInjEnh.mjs → MWges5ywL3aEdChp.mjs} +1 -1
  44. package/node/esm/{DPN0n6MGYQ9vZ2KO.mjs → T5lfCrudsUnOTxEn.mjs} +1 -1
  45. package/node/esm/YB_qExw23Ci4nMYy.mjs +263 -0
  46. package/node/esm/{GkmuxU7OwRZtm2Rf.mjs → bRD1KCpSpAYTEs50.mjs} +1 -1
  47. package/node/esm/chart.mjs +32 -51
  48. package/node/esm/control.mjs +2 -2
  49. package/node/esm/group.mjs +3 -3
  50. package/node/esm/{C_ANM4feA1xV-pri.mjs → iL9jKJcnED6oi0B4.mjs} +1 -1
  51. package/node/esm/index.mjs +10998 -8556
  52. package/node/esm/note.mjs +86 -60
  53. package/node/esm/picture.mjs +41 -41
  54. package/node/esm/shape.mjs +285 -332
  55. package/node/esm/slicer.mjs +15 -15
  56. package/package.json +8 -6
  57. package/resources/contents.json +6 -0
  58. package/resources/locales/contents.json +14 -0
  59. package/resources/locales/de/chart.cmd.json +82 -0
  60. package/resources/locales/de/sheet.cmd.json +32 -0
  61. package/resources/locales/de/table.cmd.json +1 -1
  62. package/resources/locales/de/ui.msg.json +12 -0
  63. package/resources/locales/de/workbook.cmd.json +11 -0
  64. package/resources/locales/en/chart.cmd.json +82 -0
  65. package/resources/locales/en/sheet.cmd.json +32 -0
  66. package/resources/locales/en/table.cmd.json +1 -1
  67. package/resources/locales/en/ui.msg.json +14 -0
  68. package/resources/locales/en/workbook.cmd.json +11 -0
  69. package/types/src/autoFill/FillMenu.d.ts +2 -2
  70. package/types/src/autoFill/FillSeries.d.ts +2 -2
  71. package/types/src/border/StaticBorderRenderer.d.ts +18 -1
  72. package/types/src/border/useBorders.d.ts +76 -3
  73. package/types/src/cell/CellCheckboxRenderer.d.ts +20 -0
  74. package/types/src/cell/CellContent.d.ts +68 -0
  75. package/types/src/cell/CellControlContext.d.ts +37 -0
  76. package/types/src/cell/{FormulaCellRenderer.d.ts → CellFormulaRenderer.d.ts} +10 -7
  77. package/types/src/cell/CellImageRenderer.d.ts +11 -0
  78. package/types/src/cell/CellRenderers.d.ts +190 -0
  79. package/types/src/cell/{SheetCellRenderer.d.ts → CellTextRenderer.d.ts} +9 -6
  80. package/types/src/cell/ColumnButton.d.ts +3 -3
  81. package/types/src/cell/OutlineButton.d.ts +4 -4
  82. package/types/src/cell/SheetHeaderRenderer.d.ts +1 -1
  83. package/types/src/cell/index.d.ts +8 -2
  84. package/types/src/cell/useFormulaViewAnchor.d.ts +3 -3
  85. package/types/src/cell/useInsertableCellControls.d.ts +25 -0
  86. package/types/src/chart/ChartCommands.d.ts +15 -0
  87. package/types/src/chart/ChartEditor.d.ts +12 -2
  88. package/types/src/chart/ChartElement.d.ts +122 -0
  89. package/types/src/chart/ChartKind.d.ts +7 -0
  90. package/types/src/chart/PresetChartTypeDescriptors.d.ts +3 -1
  91. package/types/src/chart/index.d.ts +2 -0
  92. package/types/src/chart/paint/_fills.d.ts +24 -0
  93. package/types/src/chart/paint/_graphics.d.ts +46 -0
  94. package/types/src/chart/paint/_mode.d.ts +6 -0
  95. package/types/src/chart/paint/echarts.d.ts +33 -0
  96. package/types/src/chart/paint/index.d.ts +12 -0
  97. package/types/src/chart/paint/kinds/ChartPaintKind.d.ts +140 -0
  98. package/types/src/chart/paint/kinds/_Area.d.ts +3 -0
  99. package/types/src/chart/paint/kinds/_Bar.d.ts +3 -0
  100. package/types/src/chart/paint/kinds/_BoxWhisker.d.ts +3 -0
  101. package/types/src/chart/paint/kinds/_Bubble.d.ts +3 -0
  102. package/types/src/chart/paint/kinds/_Funnel.d.ts +3 -0
  103. package/types/src/chart/paint/kinds/_Histogram.d.ts +3 -0
  104. package/types/src/chart/paint/kinds/_Line.d.ts +10 -0
  105. package/types/src/chart/paint/kinds/_OfPie.d.ts +3 -0
  106. package/types/src/chart/paint/kinds/_Pie.d.ts +21 -0
  107. package/types/src/chart/paint/kinds/_Placeholder.d.ts +7 -0
  108. package/types/src/chart/paint/kinds/_Radar.d.ts +3 -0
  109. package/types/src/chart/paint/kinds/_Scatter.d.ts +3 -0
  110. package/types/src/chart/paint/kinds/_Sunburst.d.ts +3 -0
  111. package/types/src/chart/paint/kinds/_Surface.d.ts +3 -0
  112. package/types/src/chart/paint/kinds/_Treemap.d.ts +3 -0
  113. package/types/src/chart/paint/kinds/_Waterfall.d.ts +3 -0
  114. package/types/src/chart/paint/kinds/_builtIns.d.ts +12 -0
  115. package/types/src/chart/paint/toEChartsOption.d.ts +42 -0
  116. package/types/src/clipboard/ClipboardCommands.d.ts +3 -3
  117. package/types/src/clipboard/SheetClipboardLayer.d.ts +2 -2
  118. package/types/src/comment/CommentCardRequest.d.ts +9 -9
  119. package/types/src/comment/useSheetComments.d.ts +2 -2
  120. package/types/src/context/WorksheetContext.d.ts +18 -0
  121. package/types/src/context/index.d.ts +1 -1
  122. package/types/src/editableLabel/EditableLabel.d.ts +3 -1
  123. package/types/src/editor/EditorCommands.d.ts +3 -3
  124. package/types/src/editor/SheetCellEditorLayer.d.ts +2 -2
  125. package/types/src/editor/SheetCellEditorStartLayer.d.ts +22 -5
  126. package/types/src/editor/SheetEditable.d.ts +6 -6
  127. package/types/src/editor/SheetReferenceHeaderLayer.d.ts +1 -1
  128. package/types/src/editor/SheetReferenceLayer.d.ts +4 -4
  129. package/types/src/editor/VirtualKeyboardLayer.d.ts +49 -0
  130. package/types/src/editor/formulaAnchor.d.ts +12 -0
  131. package/types/src/editor/index.d.ts +1 -0
  132. package/types/src/editor/pickedReference.d.ts +3 -3
  133. package/types/src/editor/useEditRejectedNotice.d.ts +3 -3
  134. package/types/src/editor/useFormulaHints.d.ts +3 -3
  135. package/types/src/editor/validationAlert.d.ts +3 -3
  136. package/types/src/frame/CommandContext.d.ts +7 -7
  137. package/types/src/index.d.ts +2 -0
  138. package/types/src/layer/BorderLayer.d.ts +2 -2
  139. package/types/src/layer/CellErrorLayer.d.ts +5 -4
  140. package/types/src/layer/CellFillLayer.d.ts +2 -2
  141. package/types/src/layer/CellIndicatorLayer.d.ts +31 -0
  142. package/types/src/layer/CellInsertLayer.d.ts +71 -0
  143. package/types/src/layer/CircularIndicatorLayer.d.ts +2 -2
  144. package/types/src/layer/CommentCardLayer.d.ts +2 -2
  145. package/types/src/layer/CommentsLayer.d.ts +2 -2
  146. package/types/src/layer/ConditionalBarLayer.d.ts +2 -2
  147. package/types/src/layer/ConditionalIconsLayer.d.ts +2 -2
  148. package/types/src/layer/ContextMenuLayer.d.ts +2 -2
  149. package/types/src/layer/GridFreezeLayer.d.ts +2 -2
  150. package/types/src/layer/HeaderSelectionLayer.d.ts +4 -4
  151. package/types/src/layer/HyperlinkLayer.d.ts +11 -8
  152. package/types/src/layer/MovableKindScope.d.ts +2 -2
  153. package/types/src/layer/ProtectionLayer.d.ts +4 -5
  154. package/types/src/layer/RangeAnnotationLayer.d.ts +2 -2
  155. package/types/src/layer/ResizeIndicator.d.ts +2 -2
  156. package/types/src/layer/SheetBackgroundLayer.d.ts +3 -3
  157. package/types/src/layer/SheetCellLayer.d.ts +15 -8
  158. package/types/src/layer/SheetColumnButtonLayer.d.ts +2 -2
  159. package/types/src/layer/SheetGridLineLayer.d.ts +11 -13
  160. package/types/src/layer/SheetLayers.d.ts +115 -0
  161. package/types/src/layer/SheetMovableLayer.d.ts +4 -3
  162. package/types/src/layer/SheetOutlineLayer.d.ts +3 -3
  163. package/types/src/layer/SheetTableCommandLayer.d.ts +2 -2
  164. package/types/src/layer/SpillLayer.d.ts +2 -2
  165. package/types/src/layer/TableLayer.d.ts +3 -3
  166. package/types/src/layer/TableToolbar.d.ts +4 -4
  167. package/types/src/layer/ValidationDropdownLayer.d.ts +2 -2
  168. package/types/src/layer/ValidationIndicatorLayer.d.ts +2 -2
  169. package/types/src/layer/ValidationPromptLayer.d.ts +21 -8
  170. package/types/src/layer/_tableColor.d.ts +2 -2
  171. package/types/src/layer/index.d.ts +3 -0
  172. package/types/src/layer/useFreezeDrag.d.ts +2 -2
  173. package/types/src/layer/useNormalBorderLines.d.ts +15 -0
  174. package/types/src/layer/useSheetFeatureRegions.d.ts +2 -2
  175. package/types/src/layer/useSheetVisibleCells.d.ts +2 -2
  176. package/types/src/layer/useSheetVisibleDecorations.d.ts +2 -2
  177. package/types/src/layer/useTableHeaderCells.d.ts +2 -2
  178. package/types/src/layer/useValidationPicker.d.ts +2 -2
  179. package/types/src/layer/useVisibleTables.d.ts +2 -2
  180. package/types/src/layer/validationMark.d.ts +3 -3
  181. package/types/src/listener/index.d.ts +5 -0
  182. package/types/src/listener/useCell.d.ts +29 -0
  183. package/types/src/listener/useCellRange.d.ts +23 -0
  184. package/types/src/listener/useCellValue.d.ts +26 -0
  185. package/types/src/listener/useModelListener.d.ts +4 -4
  186. package/types/src/listener/useRangeListener.d.ts +13 -7
  187. package/types/src/listener/useRangeSnapshot.d.ts +35 -0
  188. package/types/src/listener/useTable.d.ts +26 -0
  189. package/types/src/movable/DefaultMovable.d.ts +8 -0
  190. package/types/src/movable/MovableCommands.d.ts +2 -2
  191. package/types/src/movable/MovableControl.d.ts +3 -1
  192. package/types/src/movable/MovableFrame.d.ts +2 -1
  193. package/types/src/movable/MovableLayer.d.ts +6 -3
  194. package/types/src/movable/MovableRenderers.d.ts +3 -3
  195. package/types/src/movable/index.d.ts +1 -0
  196. package/types/src/picker/cellPickerOpen.d.ts +3 -3
  197. package/types/src/picker/useCellPicker.d.ts +2 -2
  198. package/types/src/richText/RichTextEditor.d.ts +2 -2
  199. package/types/src/selection/SelectionCommands.d.ts +2 -2
  200. package/types/src/selection/SheetSelectionLayer.d.ts +2 -2
  201. package/types/src/sheet/ISheetHeaderElement.d.ts +3 -3
  202. package/types/src/sheet/{ISheetElement.d.ts → IWorksheetElement.d.ts} +64 -32
  203. package/types/src/sheet/OpaqueSheetElement.d.ts +21 -0
  204. package/types/src/sheet/SheetCommandProvider.d.ts +5 -2
  205. package/types/src/sheet/SheetCommands.d.ts +2 -2
  206. package/types/src/sheet/SheetKindIcon.d.ts +14 -0
  207. package/types/src/sheet/SheetOutlineElement.d.ts +6 -6
  208. package/types/src/sheet/SheetPanels.d.ts +11 -0
  209. package/types/src/sheet/SheetScrollbar.d.ts +3 -3
  210. package/types/src/sheet/TopLeftCorner.d.ts +2 -2
  211. package/types/src/sheet/WorksheetElement.d.ts +12 -0
  212. package/types/src/sheet/_freezeAt.d.ts +2 -2
  213. package/types/src/sheet/circularReferences.d.ts +3 -3
  214. package/types/src/sheet/index.d.ts +5 -2
  215. package/types/src/sheet/useCycleHighlight.d.ts +2 -2
  216. package/types/src/tabStrip/SheetTab.d.ts +1 -1
  217. package/types/src/tabStrip/Sortable.d.ts +5 -5
  218. package/types/src/tabStrip/TabStrip.d.ts +6 -6
  219. package/types/src/tabStrip/TabStripItem.d.ts +15 -13
  220. package/types/src/table/TableCommands.d.ts +2 -2
  221. package/types/src/taskPane/CellControlPane.d.ts +17 -0
  222. package/types/src/taskPane/TaskPaneArea.d.ts +7 -0
  223. package/types/src/taskPane/index.d.ts +1 -0
  224. package/types/src/taskPane/useTaskPane.d.ts +6 -3
  225. package/types/src/theme/buildOOXMLThemeCSS.d.ts +2 -2
  226. package/types/src/theme/useGridColorScheme.d.ts +1 -1
  227. package/types/src/theme/useSystemColors.d.ts +2 -2
  228. package/types/src/workbook/DefaultRenderers.d.ts +5 -4
  229. package/types/src/workbook/IWorkbookElement.d.ts +76 -22
  230. package/types/src/workbook/WorkbookStrip.d.ts +5 -5
  231. package/browser/esm/BHjeSMaycUkS5dVL.mjs +0 -66
  232. package/browser/esm/CYMRbtPIr6SklGpp.mjs +0 -775
  233. package/browser/esm/CiRN-woJZWYOgTn4.mjs +0 -36
  234. package/browser/esm/J8cPagZBeXz86Lnd.mjs +0 -777
  235. package/node/esm/BpwE3HqTnrLLzE3C.mjs +0 -775
  236. package/node/esm/CV3bT3Hql74GcHoU.mjs +0 -37
  237. package/node/esm/D3YXHeOyFp00Xk3m.mjs +0 -323
  238. package/types/src/chart/templates/area-stacked-percent-template.json.d.ts +0 -10
  239. package/types/src/chart/templates/area-stacked-template.json.d.ts +0 -10
  240. package/types/src/chart/templates/area-template.json.d.ts +0 -9
  241. package/types/src/chart/templates/bar-stacked-percent-template.json.d.ts +0 -10
  242. package/types/src/chart/templates/bar-stacked-template.json.d.ts +0 -10
  243. package/types/src/chart/templates/bar-template.json.d.ts +0 -9
  244. package/types/src/chart/templates/column-stacked-percent-template.json.d.ts +0 -10
  245. package/types/src/chart/templates/column-stacked-template.json.d.ts +0 -10
  246. package/types/src/chart/templates/column-template.json.d.ts +0 -9
  247. package/types/src/chart/templates/line-markers-template.json.d.ts +0 -10
  248. package/types/src/chart/templates/line-stacked-markers-template.json.d.ts +0 -11
  249. package/types/src/chart/templates/line-stacked-percent-markers-template.json.d.ts +0 -11
  250. package/types/src/chart/templates/line-stacked-percent-template.json.d.ts +0 -10
  251. package/types/src/chart/templates/line-stacked-template.json.d.ts +0 -10
  252. package/types/src/chart/templates/line-template.json.d.ts +0 -9
  253. package/types/src/chart/templates/pie-doughnut-template.json.d.ts +0 -10
  254. package/types/src/chart/templates/pie-template.json.d.ts +0 -9
  255. package/types/src/chart/templates/scatter-lines-markers-smooth-template.json.d.ts +0 -10
  256. package/types/src/chart/templates/scatter-lines-markers-template.json.d.ts +0 -10
  257. package/types/src/chart/templates/scatter-lines-smooth-template.json.d.ts +0 -10
  258. package/types/src/chart/templates/scatter-lines-template.json.d.ts +0 -10
  259. package/types/src/chart/templates/scatter-markers-template.json.d.ts +0 -10
  260. package/types/src/context/SheetContext.d.ts +0 -18
  261. package/types/src/sheet/SheetElement.d.ts +0 -15
@@ -1,125 +1,77 @@
1
1
  /**
2
- * @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.8.0-beta.10
2
+ * @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.8.0-beta.12
3
3
  *
4
4
  * (C) 2026-present SheetXL Inc. & Michael T. Ford
5
5
  * License: The license can be found at https://www.sheetxl.com/license.
6
6
  */
7
- import { t as e } from "./CFFlJxNwgyInjEnh.mjs";
8
- import { n as t } from "./BfRn5S5V4X8xIAEa.mjs";
9
- import { t as n } from "./GkmuxU7OwRZtm2Rf.mjs";
10
- import { t as r } from "./BJ7ZZm63j5O6cvrB.mjs";
11
- import { Color as o, IFill as s, IGeometry as i, IStroke as l, ShapeStyleUtils as a } from "@sheetxl/sdk";
12
- import { forwardRef as h, memo as c, useCallback as u, useEffect as p, useId as d, useMemo as f, useReducer as m, useRef as y, useState as g } from "react";
13
- import { Fragment as x, jsx as v, jsxs as b } from "react/jsx-runtime";
14
- import { BufferUtils as k, messageKey as M } from "@sheetxl/utils";
15
- import { ReactUtils as S, useImperativeElement as w } from "@sheetxl/utils-react";
16
- import { useSurfaceState as D } from "@sheetxl/grid-react";
17
- import { createPortal as T } from "react-dom";
18
- var $ = 96 / 72, C = (e, t) => {
7
+ import { t as e } from "./MWges5ywL3aEdChp.mjs";
8
+ import { n as t } from "./DXiNwr6ZnXBe7TlG.mjs";
9
+ import { t as n } from "./bRD1KCpSpAYTEs50.mjs";
10
+ import { t as r } from "./CNOLkUDURBElaaIf.mjs";
11
+ import { Color as o, IFill as s, IGeometry as i, IStroke as l, PaintUtils as a, ShapeStyleUtils as c } from "@sheetxl/sdk";
12
+ import { forwardRef as h, memo as u, useCallback as p, useEffect as d, useId as f, useMemo as m, useReducer as g, useRef as y, useState as x } from "react";
13
+ import { Fragment as v, jsx as b, jsxs as k } from "react/jsx-runtime";
14
+ import { BufferUtils as M, messageKey as w } from "@sheetxl/utils";
15
+ import { useSurfaceState as T } from "@sheetxl/grid-react";
16
+ import { ReactUtils as C, useImperativeElement as $ } from "@sheetxl/utils-react";
17
+ import { createPortal as S } from "react-dom";
18
+ var P = 96 / 72, j = (e, t) => {
19
19
  if ("string" != typeof e || !e) return null;
20
20
  try {
21
21
  return (t ? t.parseColor(e) : new o(e))?.toCSS("adaptive") ?? null;
22
22
  } catch {
23
23
  return null;
24
24
  }
25
- }, P = (e, t) => {
25
+ }, L = (e) => {
26
26
  if (!e) return null;
27
27
  switch (e.type) {
28
- case s.Type.None: return null;
29
- case s.Type.Solid: return C(e.color, t);
28
+ case s.Type.Solid: return e.color ?? null;
30
29
  case s.Type.Gradient: {
31
- const n = e.stops?.[0];
32
- return C("string" == typeof n ? n : n?.color, t);
30
+ const t = e.stops?.[0];
31
+ return ("string" == typeof t ? t : t?.color) ?? null;
33
32
  }
34
- case s.Type.Pattern: return C(e.foreground ?? e.background, t);
33
+ case s.Type.Pattern: return e.foreground ?? e.background ?? null;
35
34
  case s.Type.Image:
36
35
  default: return null;
37
36
  }
38
- }, j = {
39
- [l.DashStyle.Solid]: null,
40
- [l.DashStyle.Dot]: [1, 3],
41
- [l.DashStyle.Dash]: [4, 3],
42
- [l.DashStyle.DashDot]: [
43
- 4,
44
- 3,
45
- 1,
46
- 3
47
- ],
48
- [l.DashStyle.LongDash]: [8, 3],
49
- [l.DashStyle.LongDashDot]: [
50
- 8,
51
- 3,
52
- 1,
53
- 3
54
- ],
55
- [l.DashStyle.LongDashDotDot]: [
56
- 8,
57
- 3,
58
- 1,
59
- 3,
60
- 1,
61
- 3
62
- ],
63
- [l.DashStyle.SysDot]: [1, 1],
64
- [l.DashStyle.SysDash]: [3, 1],
65
- [l.DashStyle.SysDashDot]: [
66
- 3,
67
- 1,
68
- 1,
69
- 1
70
- ],
71
- [l.DashStyle.SysDashDotDot]: [
72
- 3,
73
- 1,
74
- 1,
75
- 1,
76
- 1,
77
- 1
78
- ]
79
- }, L = (e) => {
80
- if (Array.isArray(e)) {
81
- const t = e.map((e) => Math.max(0, e) / 100);
82
- return t.length > 0 && t.some((e) => e > 0) ? t : null;
83
- }
84
- return (e && j[e]) ?? null;
85
- }, N = (e) => Math.max(0, Math.min(1, e ?? 0)), E = (e, t) => {
86
- const n = e.stops ?? [];
87
- if (n.length < 2) return null;
88
- const r = n.length - 1, o = [];
89
- for (let e = 0; e < n.length; e++) {
90
- const s = n[e], i = C("string" == typeof s ? s : s?.color, t);
91
- if (!i) return null;
92
- const l = "object" == typeof s && "number" == typeof s.offset ? s.offset : e / r;
93
- o.push({
94
- offset: N(l),
95
- color: i
37
+ }, N = (e) => Math.max(0, Math.min(1, e ?? 0)), E = (e) => {
38
+ const t = e.stops ?? [];
39
+ if (t.length < 2) return null;
40
+ const n = t.length - 1, r = [];
41
+ for (let e = 0; e < t.length; e++) {
42
+ const o = t[e], s = "string" == typeof o ? o : o?.color;
43
+ if (!s) return null;
44
+ const i = "object" == typeof o && "number" == typeof o.offset ? o.offset : e / n;
45
+ r.push({
46
+ offset: N(i),
47
+ color: s
96
48
  });
97
49
  }
98
- if (o.sort((e, t) => e.offset - t.offset), (e.gradientType ?? s.GradientType.Linear) === s.GradientType.Linear) return {
50
+ if (r.sort((e, t) => e.offset - t.offset), (e.gradientType ?? s.GradientType.Linear) === s.GradientType.Linear) return {
99
51
  kind: "linear",
100
52
  angle: (((e.angle ?? 0) - 90) % 360 + 360) % 360,
101
53
  scaled: e.scaled ?? !0,
102
- stops: o
54
+ stops: r
103
55
  };
104
- const i = e.focus, l = N(i?.left), a = N(i?.top), h = N(i?.right), c = N(i?.bottom);
105
- if (l > h || a > c) return null;
106
- const u = (l + h) / 2, p = (a + c) / 2, d = Math.max(u, 1 - u), f = Math.max(p, 1 - p);
56
+ const o = e.focus, i = N(o?.left), l = N(o?.top), a = N(o?.right), c = N(o?.bottom);
57
+ if (i > a || l > c) return null;
58
+ const h = (i + a) / 2, u = (l + c) / 2, p = Math.max(h, 1 - h), d = Math.max(u, 1 - u);
107
59
  return {
108
60
  kind: "radial",
109
- cx: u,
110
- cy: p,
111
- r: Math.hypot(d, f),
112
- stops: o
61
+ cx: h,
62
+ cy: u,
63
+ r: Math.hypot(p, d),
64
+ stops: r
113
65
  };
114
- }, A = a.inheritedGroupFill, z = /[MLQCAZ]|[-+]?(?:\d+\.?\d*|\.\d+)(?:[eE][-+]?\d+)?/g, I = {
66
+ }, z = c.inheritedGroupFill, A = /[MLQCAZ]|[-+]?(?:\d+\.?\d*|\.\d+)(?:[eE][-+]?\d+)?/g, I = {
115
67
  M: 1,
116
68
  L: 1,
117
69
  Q: 2,
118
70
  C: 3,
119
71
  A: 1,
120
72
  Z: 0
121
- }, G = (e) => String(Math.round(1e5 * e) / 1e5), F = (e) => {
122
- const t = e.match(z) ?? [], n = [], r = [], o = [];
73
+ }, F = (e) => String(Math.round(1e5 * e) / 1e5), G = (e) => {
74
+ const t = e.match(A) ?? [], n = [], r = [], o = [];
123
75
  let s = {
124
76
  x: 0,
125
77
  y: 0
@@ -139,22 +91,22 @@ var $ = 96 / 72, C = (e, t) => {
139
91
  }), s = i, i = null);
140
92
  continue;
141
93
  }
142
- const h = "A" === a ? t.slice(l, l + 5) : void 0;
143
- h && (l += 5);
144
- const c = [];
145
- for (let e = 0; e < I[a]; e++) c.push({
94
+ const c = "A" === a ? t.slice(l, l + 5) : void 0;
95
+ c && (l += 5);
96
+ const h = [];
97
+ for (let e = 0; e < I[a]; e++) h.push({
146
98
  x: Number(t[l++]),
147
99
  y: Number(t[l++])
148
100
  });
149
- const u = c[c.length - 1];
101
+ const u = h[h.length - 1];
150
102
  if (!u || Number.isNaN(u.x) || Number.isNaN(u.y)) break;
151
103
  "M" === a ? (i && o.push(s), i = u, o.push(u)) : ("L" === a && r.push({
152
104
  from: s,
153
105
  to: u
154
106
  }), i || (i = s, o.push(s))), n.push({
155
107
  c: a,
156
- pts: c,
157
- arc: h
108
+ pts: h,
109
+ arc: c
158
110
  }), s = u;
159
111
  }
160
112
  return i && o.push(s), {
@@ -162,30 +114,30 @@ var $ = 96 / 72, C = (e, t) => {
162
114
  straight: r,
163
115
  ends: o
164
116
  };
165
- }, R = (e) => {
117
+ }, D = (e) => {
166
118
  const t = [];
167
119
  for (const n of e) {
168
- const e = n.pts.map((e) => `${G(e.x)} ${G(e.y)}`).join(" ");
120
+ const e = n.pts.map((e) => `${F(e.x)} ${F(e.y)}`).join(" ");
169
121
  t.push("Z" === n.c ? "Z" : `${n.c}${n.arc ? `${n.arc.join(" ")} ` : ""}${e}`);
170
122
  }
171
123
  return t.join(" ");
172
- }, H = 1e-6, W = (e, t, n, r, o) => {
173
- const s = r ? (o - e) * t.zoom : e * t.zoom, i = S.snapLineCenter(s, n, t.dpr);
124
+ }, R = 1e-6, H = (e, t, n, r, o) => {
125
+ const s = r ? (o - e) * t.zoom : e * t.zoom, i = C.snapLineCenter(s, n, t.dpr);
174
126
  return r ? o - i / t.zoom : i / t.zoom;
175
- }, B = (e, t, n) => {
176
- const r = F(e), o = r.ends.map((e) => ({
127
+ }, W = (e, t, n) => {
128
+ const r = G(e), o = r.ends.map((e) => ({
177
129
  x: e.x,
178
130
  y: e.y
179
131
  })), s = n * t.zoom, i = [];
180
132
  for (const e of r.straight) {
181
- const t = Math.abs(e.to.y - e.from.y) < H;
182
- t !== Math.abs(e.to.x - e.from.x) < H && i.push({
133
+ const t = Math.abs(e.to.y - e.from.y) < R;
134
+ t !== Math.abs(e.to.x - e.from.x) < R && i.push({
183
135
  seg: e,
184
136
  level: t,
185
137
  at: t ? e.from.y : e.from.x
186
138
  });
187
139
  }
188
- for (const { seg: e, level: n, at: r } of i) n ? e.from.y = e.to.y = W(r, t, s, t.flipV, t.height) : e.from.x = e.to.x = W(r, t, s, t.flipH, t.width);
140
+ for (const { seg: e, level: n, at: r } of i) n ? e.from.y = e.to.y = H(r, t, s, t.flipV, t.height) : e.from.x = e.to.x = H(r, t, s, t.flipH, t.width);
189
141
  const l = [];
190
142
  return r.ends.forEach((e, t) => {
191
143
  const n = {
@@ -197,12 +149,12 @@ var $ = 96 / 72, C = (e, t) => {
197
149
  by: n
198
150
  });
199
151
  }), {
200
- d: R(r.cmds),
152
+ d: D(r.cmds),
201
153
  ends: l
202
154
  };
203
- }, O = (e, t) => {
155
+ }, B = (e, t) => {
204
156
  if (0 === t.length) return e;
205
- const n = F(e);
157
+ const n = G(e);
206
158
  let r = [], o = null;
207
159
  const s = /* @__PURE__ */ new Set(), i = () => {
208
160
  if (!o) return;
@@ -218,20 +170,20 @@ var $ = 96 / 72, C = (e, t) => {
218
170
  "M" === e.c && (i(), o = e.pts[0]);
219
171
  for (const t of e.pts) r.push(t);
220
172
  }
221
- return i(), R(n.cmds);
222
- }, U = /* @__PURE__ */ new WeakMap(), Z = (e) => {
223
- const [t, n] = g(null);
224
- return p(() => {
173
+ return i(), D(n.cmds);
174
+ }, O = /* @__PURE__ */ new WeakMap(), U = { filter: "var(--sxl-image-filter)" }, Z = (e) => {
175
+ const [t, n] = x(null);
176
+ return d(() => {
225
177
  if (!e) return;
226
178
  let t = !0;
227
179
  return ((e) => {
228
- let t = U.get(e);
180
+ let t = O.get(e);
229
181
  return t || (t = (async () => {
230
182
  const t = await e.getExternalURI();
231
183
  if (t) return t;
232
184
  const [n, r] = await Promise.all([e.toBuffer(), e.getType()]);
233
- return `data:${r?.mime ?? "image/png"};base64,${k.arrayBufferToBase64(n)}`;
234
- })(), U.set(e, t)), t;
185
+ return `data:${r?.mime ?? "image/png"};base64,${M.arrayBufferToBase64(n)}`;
186
+ })(), O.set(e, t)), t;
235
187
  })(e).then((r) => {
236
188
  t && n({
237
189
  resource: e,
@@ -242,7 +194,7 @@ var $ = 96 / 72, C = (e, t) => {
242
194
  };
243
195
  }, [e]), e && t?.resource === e ? t.url : null;
244
196
  }, J = (e, t, n, r) => {
245
- const o = t.stops.map((e, t) => v("stop", {
197
+ const o = t.stops.map((e, t) => b("stop", {
246
198
  offset: e.offset,
247
199
  stopColor: e.color
248
200
  }, t));
@@ -254,18 +206,18 @@ var $ = 96 / 72, C = (e, t) => {
254
206
  const e = Math.hypot(i, l) || 1;
255
207
  i /= e, l /= e;
256
208
  }
257
- const a = (Math.abs(n * i) + Math.abs(r * l)) / 2, h = n / 2, c = r / 2;
258
- return v("linearGradient", {
209
+ const a = (Math.abs(n * i) + Math.abs(r * l)) / 2, c = n / 2, h = r / 2;
210
+ return b("linearGradient", {
259
211
  id: e,
260
212
  gradientUnits: "userSpaceOnUse",
261
- x1: h - a * i,
262
- y1: c - a * l,
263
- x2: h + a * i,
264
- y2: c + a * l,
213
+ x1: c - a * i,
214
+ y1: h - a * l,
215
+ x2: c + a * i,
216
+ y2: h + a * l,
265
217
  children: o
266
218
  }, e);
267
219
  }
268
- return v("radialGradient", {
220
+ return b("radialGradient", {
269
221
  id: e,
270
222
  gradientUnits: "userSpaceOnUse",
271
223
  cx: t.cx * n,
@@ -274,18 +226,18 @@ var $ = 96 / 72, C = (e, t) => {
274
226
  gradientTransform: `scale(1 ${r / n})`,
275
227
  children: o
276
228
  }, e);
277
- }, Q = c(({ paths: e, style: t, width: n, height: r, zoom: o, grid: s, hit: l }) => {
278
- const a = d().replace(/[^A-Za-z0-9_-]/g, ""), h = Z(t.image?.resource ?? null), c = ((e, t, n = 1) => {
229
+ }, Q = u(({ paths: e, style: t, width: n, height: r, zoom: o, grid: s, hit: l }) => {
230
+ const a = f().replace(/[^A-Za-z0-9_-]/g, ""), c = Z(t.image?.resource ?? null), h = ((e, t, n = 1) => {
279
231
  const r = (t > 0 ? t : 1) * (n > 0 ? n : 1);
280
232
  return Math.max(1, Math.round(Math.max(0, e || 0) * r)) / r;
281
- })(t.strokeWidth, o, s?.dpr ?? S.getDevicePixelRatio()), u = n > 0 && r > 0, p = u ? t.gradient ?? null : null, m = u ? t.strokeGradient ?? null : null, y = t.image ? h ? `url(#${a}-image)` : null : p ? `url(#${a}-fill)` : t.fill, g = m ? `url(#${a}-stroke)` : t.stroke, k = null !== t.stroke && c > 0, M = k ? ((e, t, n) => {
233
+ })(t.strokeWidth, o, s?.dpr ?? C.getDevicePixelRatio()), u = n > 0 && r > 0, p = u ? t.gradient ?? null : null, d = u ? t.strokeGradient ?? null : null, g = t.image ? c ? `url(#${a}-image)` : null : p ? `url(#${a}-fill)` : t.fill, y = d ? `url(#${a}-stroke)` : t.stroke, x = null !== t.stroke && h > 0, M = x ? ((e, t, n) => {
282
234
  if (!(e && t > 0)) return;
283
235
  const r = "butt" !== n, o = e.map((e, n) => {
284
236
  const o = e * t;
285
237
  return r ? n % 2 == 0 ? Math.max(0, o - t) : o + t : o;
286
238
  });
287
239
  return o.length % 2 == 1 && o.push(r ? t : 0), o.map((e) => +e.toFixed(3)).join(" ");
288
- })(t.dash, c, t.lineCap) : void 0, w = f(() => ((e, t, n) => {
240
+ })(t.dash, h, t.lineCap) : void 0, w = m(() => ((e, t, n) => {
289
241
  const r = /* @__PURE__ */ new Map();
290
242
  if (!t) return r;
291
243
  const o = /* @__PURE__ */ new Map(), s = [];
@@ -293,7 +245,7 @@ var $ = 96 / 72, C = (e, t) => {
293
245
  if (l.layer !== i.PathLayer.Stroke) continue;
294
246
  let e = o.get(l.d);
295
247
  if (void 0 === e) {
296
- const r = B(l.d, t, n);
248
+ const r = W(l.d, t, n);
297
249
  e = r.d, o.set(l.d, e), s.push(...r.ends);
298
250
  }
299
251
  r.set(l.index, e);
@@ -301,31 +253,31 @@ var $ = 96 / 72, C = (e, t) => {
301
253
  for (const t of e) if (t.layer === i.PathLayer.Fill) {
302
254
  const e = o.get(t.d);
303
255
  void 0 !== e && r.set(t.index, e);
304
- } else t.layer === i.PathLayer.Marker && r.set(t.index, O(t.d, s));
256
+ } else t.layer === i.PathLayer.Marker && r.set(t.index, B(t.d, s));
305
257
  return r;
306
- })(e, k ? s : null, c), [
258
+ })(e, x ? s : null, h), [
307
259
  e,
308
- k,
260
+ x,
309
261
  s,
310
- c
311
- ]), D = /* @__PURE__ */ new Set(), T = [];
262
+ h
263
+ ]), T = /* @__PURE__ */ new Set(), $ = [];
312
264
  for (const n of e) {
313
265
  const e = `p${n.index}`, r = w.get(n.index) ?? n.d;
314
266
  switch (n.layer) {
315
267
  case i.PathLayer.Fill:
316
- if (null === y) break;
317
- "norm" !== n.fill && D.add(n.fill), T.push(v("path", {
268
+ if (null === g) break;
269
+ "norm" !== n.fill && T.add(n.fill), $.push(b("path", {
318
270
  d: r,
319
- fill: y,
271
+ fill: g,
320
272
  filter: "norm" !== n.fill ? `url(#${a}-${n.fill})` : void 0,
321
273
  stroke: "none",
322
274
  pointerEvents: l
323
275
  }, e));
324
276
  break;
325
277
  case i.PathLayer.Stroke: {
326
- if (!k) break;
278
+ if (!x) break;
327
279
  const n = 8 / (o > 0 ? o : 1);
328
- "none" !== l && n > c && T.push(v("path", {
280
+ "none" !== l && n > h && $.push(b("path", {
329
281
  className: "shape-hit",
330
282
  d: r,
331
283
  fill: "none",
@@ -334,11 +286,11 @@ var $ = 96 / 72, C = (e, t) => {
334
286
  strokeLinejoin: "round",
335
287
  strokeLinecap: "round",
336
288
  pointerEvents: "stroke"
337
- }, `${e}-hit`)), T.push(v("path", {
289
+ }, `${e}-hit`)), $.push(b("path", {
338
290
  d: r,
339
291
  fill: "none",
340
- stroke: g,
341
- strokeWidth: c,
292
+ stroke: y,
293
+ strokeWidth: h,
342
294
  strokeLinejoin: t.lineJoin,
343
295
  strokeLinecap: t.lineCap,
344
296
  strokeMiterlimit: "miter" === t.lineJoin ? t.miterLimit : void 0,
@@ -347,32 +299,32 @@ var $ = 96 / 72, C = (e, t) => {
347
299
  }, e));
348
300
  break;
349
301
  }
350
- case i.PathLayer.Marker: k && T.push(v("path", {
302
+ case i.PathLayer.Marker: x && $.push(b("path", {
351
303
  d: r,
352
- fill: g,
304
+ fill: y,
353
305
  stroke: "none",
354
306
  pointerEvents: l
355
307
  }, e));
356
308
  }
357
309
  }
358
- const $ = [];
359
- for (const e of D) {
310
+ const S = [];
311
+ for (const e of T) {
360
312
  const [t, n] = i.FillTransfer[e];
361
- $.push(v("filter", {
313
+ S.push(b("filter", {
362
314
  id: `${a}-${e}`,
363
315
  colorInterpolationFilters: "sRGB",
364
- children: b("feComponentTransfer", { children: [
365
- v("feFuncR", {
316
+ children: k("feComponentTransfer", { children: [
317
+ b("feFuncR", {
366
318
  type: "linear",
367
319
  slope: t,
368
320
  intercept: n
369
321
  }),
370
- v("feFuncG", {
322
+ b("feFuncG", {
371
323
  type: "linear",
372
324
  slope: t,
373
325
  intercept: n
374
326
  }),
375
- v("feFuncB", {
327
+ b("feFuncB", {
376
328
  type: "linear",
377
329
  slope: t,
378
330
  intercept: n
@@ -380,34 +332,35 @@ var $ = 96 / 72, C = (e, t) => {
380
332
  ] })
381
333
  }, e));
382
334
  }
383
- if (p && !t.image && $.push(J(`${a}-fill`, p, n, r)), m && k && $.push(J(`${a}-stroke`, m, n, r)), t.image && h) {
335
+ if (p && !t.image && S.push(J(`${a}-fill`, p, n, r)), d && x && S.push(J(`${a}-stroke`, d, n, r)), t.image && c) {
384
336
  const e = t.image.fill.stretch ?? {}, o = n * (e.left ?? 0) / 100, s = r * (e.top ?? 0) / 100, i = Math.max(0, n - o - n * (e.right ?? 0) / 100), l = Math.max(0, r - s - r * (e.bottom ?? 0) / 100);
385
- $.push(v("pattern", {
337
+ S.push(b("pattern", {
386
338
  id: `${a}-image`,
387
339
  patternUnits: "userSpaceOnUse",
388
340
  x: 0,
389
341
  y: 0,
390
342
  width: Math.max(n, 1),
391
343
  height: Math.max(r, 1),
392
- children: v("image", {
393
- href: h,
344
+ children: b("image", {
345
+ href: c,
394
346
  x: o,
395
347
  y: s,
396
348
  width: i,
397
349
  height: l,
398
- preserveAspectRatio: "none"
350
+ preserveAspectRatio: "none",
351
+ style: U
399
352
  })
400
353
  }, "image"));
401
354
  }
402
- return b(x, { children: [$.length > 0 ? v("defs", { children: $ }) : null, T] });
355
+ return k(v, { children: [S.length > 0 ? b("defs", { children: S }) : null, $] });
403
356
  });
404
357
  Q.displayName = "PathRun";
405
- var V = c(({ geometry: e, style: t, zoom: n, grid: r = null, hit: o }) => {
406
- const s = f(() => {
358
+ var V = u(({ geometry: e, style: t, zoom: n, grid: r = null, hit: o }) => {
359
+ const s = m(() => {
407
360
  const t = [];
408
361
  return e.forEachPath((e) => t.push(e)), t;
409
362
  }, [e]);
410
- return v(Q, {
363
+ return b(Q, {
411
364
  paths: s,
412
365
  style: t,
413
366
  width: e.getWidth(),
@@ -418,8 +371,8 @@ var V = c(({ geometry: e, style: t, zoom: n, grid: r = null, hit: o }) => {
418
371
  });
419
372
  });
420
373
  V.displayName = "ShapePaths";
421
- var X = c(({ handles: e, width: t, height: n, zoom: r, onDrag: o }) => {
422
- const s = y(null), i = y(null), [l, a] = g(!1), h = u((e) => {
374
+ var X = u(({ handles: e, width: t, height: n, zoom: r, onDrag: o }) => {
375
+ const s = y(null), i = y(null), [l, a] = x(!1), c = p((e) => {
423
376
  const t = s.current, n = t?.getScreenCTM();
424
377
  if (!t || !n) return null;
425
378
  const r = new DOMPoint(e.clientX, e.clientY).matrixTransform(n.inverse());
@@ -427,30 +380,30 @@ var X = c(({ handles: e, width: t, height: n, zoom: r, onDrag: o }) => {
427
380
  x: r.x,
428
381
  y: r.y
429
382
  };
430
- }, []), c = u((e, t) => {
383
+ }, []), h = p((e, t) => {
431
384
  0 === e.button && (e.stopPropagation(), e.preventDefault(), i.current = {
432
385
  index: t,
433
386
  pointerId: e.pointerId
434
387
  }, e.currentTarget.setPointerCapture(e.pointerId), a(!0));
435
- }, []), p = u((e) => {
388
+ }, []), u = p((e) => {
436
389
  const t = i.current;
437
390
  if (!t || t.pointerId !== e.pointerId) return;
438
391
  e.stopPropagation();
439
- const n = h(e);
392
+ const n = c(e);
440
393
  n && o(t.index, n.x, n.y, "move");
441
- }, [h, o]), d = u((e) => {
394
+ }, [c, o]), d = p((e) => {
442
395
  const t = i.current;
443
396
  if (!t || t.pointerId !== e.pointerId) return;
444
397
  e.stopPropagation(), i.current = null, a(!1);
445
- const n = h(e);
398
+ const n = c(e);
446
399
  n ? o(t.index, n.x, n.y, "end") : o(t.index, 0, 0, "cancel");
447
- }, [h, o]), f = u((e) => {
400
+ }, [c, o]), f = p((e) => {
448
401
  const t = i.current;
449
402
  t && t.pointerId === e.pointerId && (i.current = null, a(!1), o(t.index, 0, 0, "cancel"));
450
403
  }, [o]);
451
404
  if (!(0 !== e.length && t > 0 && n > 0)) return null;
452
- const m = r > 0 ? r : 1, x = 4.5 / m;
453
- return v("svg", {
405
+ const m = r > 0 ? r : 1, g = 4.5 / m;
406
+ return b("svg", {
454
407
  ref: s,
455
408
  className: l ? "shape-handles movable-gesture" : "shape-handles",
456
409
  viewBox: `0 0 ${t} ${n}`,
@@ -466,30 +419,30 @@ var X = c(({ handles: e, width: t, height: n, zoom: r, onDrag: o }) => {
466
419
  pointerEvents: "none",
467
420
  touchAction: "none"
468
421
  },
469
- children: e.map((e) => b("g", {
422
+ children: e.map((e) => k("g", {
470
423
  className: "shape-handle",
471
424
  style: { "--shape-scale": m },
472
- children: [v("circle", {
425
+ children: [b("circle", {
473
426
  cx: e.x,
474
427
  cy: e.y,
475
- r: x,
428
+ r: g,
476
429
  fill: "#ffc000",
477
430
  stroke: "#7f6000",
478
431
  strokeWidth: 1 / m,
479
432
  style: { pointerEvents: "none" }
480
- }), v("circle", {
433
+ }), b("circle", {
481
434
  className: "shape-handle-hit",
482
435
  cx: e.x,
483
436
  cy: e.y,
484
- r: x,
437
+ r: g,
485
438
  fill: "transparent",
486
439
  style: {
487
440
  pointerEvents: "all",
488
441
  cursor: "crosshair",
489
442
  touchAction: "none"
490
443
  },
491
- onPointerDown: (t) => c(t, e.index),
492
- onPointerMove: p,
444
+ onPointerDown: (t) => h(t, e.index),
445
+ onPointerMove: u,
493
446
  onPointerUp: d,
494
447
  onPointerCancel: f,
495
448
  onMouseDown: (e) => e.stopPropagation()
@@ -501,177 +454,177 @@ X.displayName = "ShapeHandles";
501
454
  var Y = (e, t) => e > 0 || t > 0, _ = (e, t, n) => !e || e.getWidth() === t && e.getHeight() === n ? e : Y(t, n) ? e.resize(t, n) : null, q = (e) => {
502
455
  const t = [];
503
456
  return e.forEachConnection((e) => t.push(e)), t;
504
- }, K = c(h((o, i) => {
505
- const { children: l, disabled: h, style: c, shape: d, movable: x, zoom: k = 1, isDragging: j, onHide: N, onShow: z, onDragZone: I, adornmentHost: G, flip: F, gesture: R, debugGeometry: H = !1, ...W } = o, B = t()?.getStyles() ?? null, [O, U] = m((e) => e + 1, 0);
506
- e(d, { onAnyChange: U }), e(x ?? null, {
507
- onBoundsChange: U,
508
- onSelectionChange: U
457
+ }, K = u(h((o, i) => {
458
+ const { children: h, disabled: u, style: f, shape: v, movable: M, zoom: N = 1, isDragging: A, onHide: I, onShow: F, onDragZone: G, adornmentHost: D, flip: R, gesture: H, debugGeometry: W = !1, ...B } = o, O = t()?.getStyles() ?? null, [U, Z] = g((e) => e + 1, 0);
459
+ e(v, { onAnyChange: Z }), e(M ?? null, {
460
+ onBoundsChange: Z,
461
+ onSelectionChange: Z
509
462
  });
510
- const Z = d.toJSON(), { width: J, height: Q, rotation: K, content: ee } = ((e) => {
511
- const [t] = D("movable-drag", null), n = e ? t?.[e.getId()] : void 0, r = n?.bounds ?? e?.getBounds();
463
+ const J = v.toJSON(), { width: Q, height: K, rotation: ee, content: te } = ((e) => {
464
+ const [t] = T("movable-drag", null), n = e ? t?.[e.getId()] : void 0, r = n?.bounds ?? e?.getBounds();
512
465
  return {
513
466
  width: r?.width ?? 0,
514
467
  height: r?.height ?? 0,
515
468
  rotation: n?.rotation ?? (e?.getRotation() || 0),
516
469
  content: n?.content ?? null
517
470
  };
518
- })(x), te = d.getShapeType(), ne = d.getAdjustments(), re = Y(J, Q), [oe, se] = g(null), ie = y(0);
519
- p(() => {
520
- if (!re) return void se(null);
521
- const e = ++ie.current, t = d.getShapeType();
522
- d.getGeometry(J, Q).then((n) => {
523
- ie.current === e && se(n ? {
471
+ })(M), ne = v.getShapeType(), re = v.getAdjustments(), oe = Y(Q, K), [se, ie] = x(null), le = y(0);
472
+ d(() => {
473
+ if (!oe) return void ie(null);
474
+ const e = ++le.current, t = v.getShapeType();
475
+ v.getGeometry(Q, K).then((n) => {
476
+ le.current === e && ie(n ? {
524
477
  shapeType: t,
525
478
  geometry: n
526
479
  } : null);
527
480
  }, () => {
528
- ie.current === e && se(null);
481
+ le.current === e && ie(null);
529
482
  });
530
483
  }, [
531
- d,
532
- J,
484
+ v,
533
485
  Q,
534
- O
486
+ K,
487
+ U
535
488
  ]);
536
- const le = void 0 !== ee?.shapeType && ee.shapeType !== te ? ee.shapeType : null, [ae, he] = g(null);
537
- p(() => {
538
- if (!le || !re || ae?.shapeType === le) return;
489
+ const ae = void 0 !== te?.shapeType && te.shapeType !== ne ? te.shapeType : null, [ce, he] = x(null);
490
+ d(() => {
491
+ if (!ae || !oe || ce?.shapeType === ae) return;
539
492
  let e = !0;
540
- return d.getGeometry(J, Q, { shapeType: le }).then((t) => {
493
+ return v.getGeometry(Q, K, { shapeType: ae }).then((t) => {
541
494
  e && t && he({
542
- shapeType: le,
495
+ shapeType: ae,
543
496
  geometry: t
544
497
  });
545
498
  }, () => {}), () => {
546
499
  e = !1;
547
500
  };
548
501
  }, [
549
- d,
550
- le,
551
- re
502
+ v,
503
+ ae,
504
+ oe
552
505
  ]);
553
- const ce = f(() => {
554
- const e = oe?.shapeType === te ? oe : ae?.shapeType === te ? ae : null;
555
- return e ? _(e.geometry, J, Q)?.withAdjustments(ne) ?? null : _(oe?.geometry ?? null, J, Q);
506
+ const ue = m(() => {
507
+ const e = se?.shapeType === ne ? se : ce?.shapeType === ne ? ce : null;
508
+ return e ? _(e.geometry, Q, K)?.withAdjustments(re) ?? null : _(se?.geometry ?? null, Q, K);
556
509
  }, [
557
- oe,
558
- ae,
559
- te,
510
+ se,
511
+ ce,
560
512
  ne,
561
- J,
562
- Q
563
- ]), ue = u((e) => d.getResource(e), [d]);
564
- p(() => {
513
+ re,
514
+ Q,
515
+ K
516
+ ]), pe = p((e) => v.getResource(e), [v]);
517
+ d(() => {
565
518
  const e = [];
566
- for (let t = x?.getParent() ?? null; t; t = t.getParent()) e.push(t.getContent().addListeners({ onAnyChange: U }));
519
+ for (let t = M?.getParent() ?? null; t; t = t.getParent()) e.push(t.getContent().addListeners({ onAnyChange: Z }));
567
520
  return () => {
568
521
  for (const t of e) t();
569
522
  };
570
- }, [x]);
571
- const pe = A(x), de = f(() => ((e, t, n, r) => {
523
+ }, [M]);
524
+ const de = z(M), fe = m(() => ((e, t, n, r) => {
572
525
  let o = null;
573
526
  try {
574
527
  o = t?.getTheme()?.toJSON() ?? null;
575
528
  } catch {
576
529
  o = null;
577
530
  }
578
- const i = a.resolve(e, o, r), { fill: l, stroke: h } = i, c = P(h?.fill, t), u = h?.fill?.type === s.Type.Gradient ? E(h.fill, t) ?? void 0 : void 0, p = P(l, t), d = l?.type === s.Type.Gradient ? E(l, t) ?? void 0 : void 0;
579
- let f;
580
- if (l?.type === s.Type.Image) {
581
- const e = void 0 === l.resId ? null : n?.(l.resId) ?? null;
582
- e && (f = {
531
+ const i = c.resolve(e, o, r), { stroke: h } = i, u = (e) => j(e, t), p = a.toConcreteFill(i.fill, u), d = a.toConcreteFill(h?.fill, u), f = L(d), m = d?.type === s.Type.Gradient ? E(d) ?? void 0 : void 0, g = L(p), y = p?.type === s.Type.Gradient ? E(p) ?? void 0 : void 0;
532
+ let x;
533
+ if (p?.type === s.Type.Image) {
534
+ const e = void 0 === p.resId ? null : n?.(p.resId) ?? null;
535
+ e && (x = {
583
536
  resource: e,
584
- fill: l
537
+ fill: p
585
538
  });
586
539
  }
587
540
  return {
588
- fill: p,
589
- gradient: d,
590
- image: f,
591
- stroke: c,
592
- strokeGradient: u,
593
- strokeWidth: c ? Math.max(0, i.strokeWidth) * $ : 0,
541
+ fill: g,
542
+ gradient: y,
543
+ image: x,
544
+ stroke: f,
545
+ strokeGradient: m,
546
+ strokeWidth: f ? Math.max(0, i.strokeWidth) * P : 0,
594
547
  lineJoin: h?.lineJoin ?? "miter",
595
548
  lineCap: h?.lineCap ?? "butt",
596
549
  miterLimit: "number" == typeof h?.miterLimit ? h.miterLimit : 18.5,
597
- dash: L(h?.dash),
598
- textColor: C(i.fontColor, t)
550
+ dash: l.toDashLengths(h?.dash),
551
+ textColor: j(i.fontColor, t)
599
552
  };
600
- })(Z, B, ue, pe), [
601
- Z,
602
- B,
603
- ue,
604
- pe
605
- ]), [fe, me] = g(null), ye = void 0 !== ee?.adjustments ? ee.adjustments : fe ?? void 0, ge = f(() => {
606
- if (le && ae?.shapeType !== le) return ce;
607
- const e = le ? _(ae.geometry, J, Q) : ce;
553
+ })(J, O, pe, de), [
554
+ J,
555
+ O,
556
+ pe,
557
+ de
558
+ ]), [me, ge] = x(null), ye = void 0 !== te?.adjustments ? te.adjustments : me ?? void 0, xe = m(() => {
559
+ if (ae && ce?.shapeType !== ae) return ue;
560
+ const e = ae ? _(ce.geometry, Q, K) : ue;
608
561
  return e && void 0 !== ye ? e.withAdjustments(ye) : e;
609
562
  }, [
610
- ce,
611
- le,
563
+ ue,
612
564
  ae,
613
- J,
565
+ ce,
614
566
  Q,
567
+ K,
615
568
  ye
616
- ]), xe = y(null), [ve, be] = g(!1), ke = u((e, t, n, r) => {
617
- if ("cancel" === r) return xe.current && (xe.current = null, be(!1), R?.cancel()), void me(null);
618
- if (!ge || !ce) return;
619
- const o = ge.adjustmentsFromHandle(e, t, n);
569
+ ]), ve = y(null), [be, ke] = x(!1), Me = p((e, t, n, r) => {
570
+ if ("cancel" === r) return ve.current && (ve.current = null, ke(!1), H?.cancel()), void ge(null);
571
+ if (!xe || !ue) return;
572
+ const o = xe.adjustmentsFromHandle(e, t, n);
620
573
  if ("move" === r) {
621
- if (R && !h) {
622
- if (!xe.current) {
574
+ if (H && !u) {
575
+ if (!ve.current) {
623
576
  const e = { adjustments: o }, t = (t) => {
624
577
  t.getContent().setAdjustments(e.adjustments);
625
578
  };
626
- if (!R.start(M("op.setShapeAdjustments"), t)) return;
627
- xe.current = e, be(!0);
579
+ if (!H.start(w("op.setShapeAdjustments"), t)) return;
580
+ ve.current = e, ke(!0);
628
581
  }
629
- xe.current.adjustments = o, R.preview({ content: { adjustments: o } });
582
+ ve.current.adjustments = o, H.preview({ content: { adjustments: o } });
630
583
  return;
631
584
  }
632
- me(o);
585
+ ge(o);
633
586
  return;
634
587
  }
635
- const s = xe.current;
636
- if (s) return xe.current = null, be(!1), s.adjustments = o, void R?.finish();
637
- me(null), h || d.setAdjustments(o);
588
+ const s = ve.current;
589
+ if (s) return ve.current = null, ke(!1), s.adjustments = o, void H?.finish();
590
+ ge(null), u || v.setAdjustments(o);
638
591
  }, [
639
- ge,
640
- ce,
641
- d,
642
- h,
643
- R
644
- ]), Me = f(() => {
592
+ xe,
593
+ ue,
594
+ v,
595
+ u,
596
+ H
597
+ ]), we = m(() => {
645
598
  const e = [];
646
- return ge?.forEachHandle((t) => e.push(t)), e;
647
- }, [ge]), Se = w(i, () => ({ isShapeEditor: () => !0 }), []), we = F ?? x?.getFlip(), De = we?.horizontal ?? !1, Te = we?.vertical ?? !1, $e = K % 360 != 0, Ce = f(() => !$e && Y(J, Q) ? {
648
- dpr: S.getDevicePixelRatio(),
649
- zoom: k,
650
- width: J,
651
- height: Q,
652
- flipH: De,
653
- flipV: Te
599
+ return xe?.forEachHandle((t) => e.push(t)), e;
600
+ }, [xe]), Te = $(i, () => ({ isShapeEditor: () => !0 }), []), Ce = R ?? M?.getFlip(), $e = Ce?.horizontal ?? !1, Se = Ce?.vertical ?? !1, Pe = ee % 360 != 0, je = m(() => !Pe && Y(Q, K) ? {
601
+ dpr: C.getDevicePixelRatio(),
602
+ zoom: N,
603
+ width: Q,
604
+ height: K,
605
+ flipH: $e,
606
+ flipV: Se
654
607
  } : null, [
655
- $e,
656
- k,
657
- J,
608
+ Pe,
609
+ N,
658
610
  Q,
659
- De,
660
- Te
611
+ K,
612
+ $e,
613
+ Se
661
614
  ]);
662
- if (d.isDeleted() || !Z) return null;
663
- const Pe = "none" === c?.pointerEvents, je = Pe ? "none" : "visiblePainted", Le = !Pe && !h && (!j || ve) && !!x?.isSelected(), Ne = {
664
- transform: De || Te ? `scale(${De ? -1 : 1}, ${Te ? -1 : 1})` : void 0,
615
+ if (v.isDeleted() || !J) return null;
616
+ const Le = "none" === f?.pointerEvents, Ne = Le ? "none" : "visiblePainted", Ee = !Le && !u && (!A || be) && !!M?.isSelected(), ze = {
617
+ transform: $e || Se ? `scale(${$e ? -1 : 1}, ${Se ? -1 : 1})` : void 0,
665
618
  transformOrigin: "center"
666
619
  };
667
- let Ee = null;
668
- Le && Me.length > 0 && (Ee = v(X, {
669
- handles: Me,
670
- width: J,
671
- height: Q,
672
- zoom: k,
673
- onDrag: ke
674
- }), G && (Ee = T(v("div", {
620
+ let Ae = null;
621
+ Ee && we.length > 0 && (Ae = b(X, {
622
+ handles: we,
623
+ width: Q,
624
+ height: K,
625
+ zoom: N,
626
+ onDrag: Me
627
+ }), D && (Ae = S(b("div", {
675
628
  className: "shape-adornment",
676
629
  style: {
677
630
  position: "absolute",
@@ -679,32 +632,32 @@ var Y = (e, t) => e > 0 || t > 0, _ = (e, t, n) => !e || e.getWidth() === t && e
679
632
  top: 0,
680
633
  width: "100%",
681
634
  height: "100%",
682
- ...Ne,
635
+ ...ze,
683
636
  pointerEvents: "none"
684
637
  },
685
- children: Ee
686
- }), G)));
687
- const Ae = De !== Te ? "scaleX(-1)" : void 0, ze = ge?.getTextRect(), Ie = Z.text, Ge = !!Ie && Ie.paragraphs.some((e) => e.runs.some((e) => "" !== e.text));
688
- return b("div", {
638
+ children: Ae
639
+ }), D)));
640
+ const Ie = $e !== Se ? "scaleX(-1)" : void 0, Fe = xe?.getTextRect(), Ge = J.text, De = !!Ge && Ge.paragraphs.some((e) => e.runs.some((e) => "" !== e.text));
641
+ return k("div", {
689
642
  className: "shape-editor",
690
- ...W,
691
- ref: Se,
643
+ ...B,
644
+ ref: Te,
692
645
  style: {
693
646
  width: "100%",
694
647
  height: "100%",
695
648
  position: "relative",
696
649
  overflow: "visible",
697
- filter: h ? "blur(1px)" : void 0,
698
- ...Ne,
699
- ...c,
650
+ filter: u ? "blur(1px)" : void 0,
651
+ ...ze,
652
+ ...f,
700
653
  pointerEvents: "none"
701
654
  },
702
655
  children: [
703
- Y(J, Q) ? b("svg", {
656
+ Y(Q, K) ? k("svg", {
704
657
  className: "shape-geometry",
705
- viewBox: `0 0 ${J > 0 ? J : 1 / k} ${Q > 0 ? Q : 1 / k}`,
706
- width: J > 0 ? "100%" : "1px",
707
- height: Q > 0 ? "100%" : "1px",
658
+ viewBox: `0 0 ${Q > 0 ? Q : 1 / N} ${K > 0 ? K : 1 / N}`,
659
+ width: Q > 0 ? "100%" : "1px",
660
+ height: K > 0 ? "100%" : "1px",
708
661
  preserveAspectRatio: "none",
709
662
  overflow: "visible",
710
663
  style: {
@@ -713,50 +666,50 @@ var Y = (e, t) => e > 0 || t > 0, _ = (e, t, n) => !e || e.getWidth() === t && e
713
666
  top: 0,
714
667
  display: "block",
715
668
  pointerEvents: "none",
716
- filter: Le ? "drop-shadow(1px 1px 2px rgba(0,0,0,.15))" : void 0
669
+ filter: Ee ? "drop-shadow(1px 1px 2px rgba(0,0,0,.15))" : void 0
717
670
  },
718
- children: [ge ? v(V, {
719
- geometry: ge,
720
- style: de,
721
- zoom: k,
722
- grid: Ce,
723
- hit: je
724
- }) : null, H && ge && ze ? b("g", {
671
+ children: [xe ? b(V, {
672
+ geometry: xe,
673
+ style: fe,
674
+ zoom: N,
675
+ grid: je,
676
+ hit: Ne
677
+ }) : null, W && xe && Fe ? k("g", {
725
678
  pointerEvents: "none",
726
- children: [v("rect", {
727
- x: ze.l,
728
- y: ze.t,
729
- width: Math.max(0, ze.r - ze.l),
730
- height: Math.max(0, ze.b - ze.t),
679
+ children: [b("rect", {
680
+ x: Fe.l,
681
+ y: Fe.t,
682
+ width: Math.max(0, Fe.r - Fe.l),
683
+ height: Math.max(0, Fe.b - Fe.t),
731
684
  fill: "none",
732
685
  stroke: "#c00",
733
- strokeWidth: 1 / k,
734
- strokeDasharray: `${4 / k} ${2 / k}`
735
- }), q(ge).map((e) => v("rect", {
736
- x: e.x - 3 / k,
737
- y: e.y - 3 / k,
738
- width: 6 / k,
739
- height: 6 / k,
686
+ strokeWidth: 1 / N,
687
+ strokeDasharray: `${4 / N} ${2 / N}`
688
+ }), q(xe).map((e) => b("rect", {
689
+ x: e.x - 3 / N,
690
+ y: e.y - 3 / N,
691
+ width: 6 / N,
692
+ height: 6 / N,
740
693
  fill: "#0a0"
741
694
  }, e.index))]
742
695
  }) : null]
743
696
  }) : null,
744
- Ge && ze ? v("div", {
697
+ De && Fe ? b("div", {
745
698
  className: "shape-text-frame",
746
699
  style: {
747
700
  position: "absolute",
748
- left: ze.l,
749
- top: ze.t,
750
- width: Math.max(0, ze.r - ze.l),
751
- height: Math.max(0, ze.b - ze.t),
752
- zoom: k,
753
- transform: Ae,
701
+ left: Fe.l,
702
+ top: Fe.t,
703
+ width: Math.max(0, Fe.r - Fe.l),
704
+ height: Math.max(0, Fe.b - Fe.t),
705
+ zoom: N,
706
+ transform: Ie,
754
707
  transformOrigin: "center",
755
- pointerEvents: Pe ? "none" : "auto",
756
- color: de.textColor ?? void 0
708
+ pointerEvents: Le ? "none" : "auto",
709
+ color: fe.textColor ?? void 0
757
710
  },
758
- children: v(n, {
759
- movable: x,
711
+ children: b(n, {
712
+ movable: M,
760
713
  disabled: !0,
761
714
  style: {
762
715
  fontFamily: "Calibri, Carlito, sans-serif",
@@ -768,14 +721,14 @@ var Y = (e, t) => e > 0 || t > 0, _ = (e, t, n) => !e || e.getWidth() === t && e
768
721
  padding: 0,
769
722
  overflow: "hidden"
770
723
  },
771
- children: v(r, {
772
- text: Ie,
773
- styles: B,
774
- color: de.textColor
724
+ children: b(r, {
725
+ text: Ge,
726
+ styles: O,
727
+ color: fe.textColor
775
728
  })
776
729
  })
777
730
  }) : null,
778
- Ee
731
+ Ae
779
732
  ]
780
733
  });
781
734
  }));