@sheetxl/react 0.8.0-beta.9 → 1.0.2
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.
- package/LICENSE.md +8 -7
- package/browser/esm/5B9ljQwRo4GZv5e3.mjs +264 -0
- package/browser/esm/B7K16Rzv-QXeNhTf.mjs +197 -0
- package/browser/esm/BD3e6d1xxwWiZvhM.mjs +78 -0
- package/browser/esm/{Dk6274Lic6AOmEAq.mjs → BIlvSwHzLhtyrkCm.mjs} +84 -2
- package/browser/esm/BTkVpKUjjBXs7S4h.mjs +128 -0
- package/browser/esm/B_X-eExTurXNj2s6.mjs +134 -0
- package/browser/esm/BaXKIZ-EbNXalsn9.mjs +32 -0
- package/browser/esm/ByiwVTu3Ax65JzsV.mjs +36 -0
- package/browser/esm/CBwGe_8NQ_Zwkd9c.mjs +67 -0
- package/browser/esm/CLM5O7S-zDkLuyx4.mjs +323 -0
- package/browser/esm/CN3fS0Je4N_gmPLR.mjs +145 -0
- package/browser/esm/Cb3fQ74AG3ha3Lbb.mjs +31 -0
- package/browser/esm/CyK8M1od0A1rs3IZ.mjs +14092 -0
- package/browser/esm/D-wXCKrEuZsj9YPV.mjs +60 -0
- package/browser/esm/D3h177x5aS9wsvay.mjs +8 -0
- package/browser/esm/DIle1Uzx1TRzW_kQ.mjs +42 -0
- package/browser/esm/DLCK6iNnpw8XUOy8.mjs +79 -0
- package/browser/esm/DS_YUf92NUAjr5M9.mjs +9560 -0
- package/browser/esm/DYLAfjgirgwGJkJo.mjs +20 -0
- package/browser/esm/D_KHWbW4C9PQ7G8l.mjs +401 -0
- package/browser/esm/DclFKNTfrIjTUqZW.mjs +341 -0
- package/browser/esm/DeZNNHG8-BP0qop0.mjs +323 -0
- package/browser/esm/WUqAXqTxytEPWXNZ.mjs +63 -0
- package/browser/esm/Xab6qjmPHkjnBlcs.mjs +45 -0
- package/browser/esm/chart.mjs +41 -0
- package/browser/esm/control.mjs +217 -0
- package/browser/esm/group.mjs +123 -0
- package/browser/esm/index.mjs +21677 -15289
- package/browser/esm/note.mjs +112 -0
- package/browser/esm/picture.mjs +7 -0
- package/browser/esm/shape.mjs +7 -0
- package/browser/esm/slicer.mjs +282 -0
- package/browser/esm/xismu7oIPMRpfRZN.mjs +19 -0
- package/licenses/dependencies.txt +327 -53
- package/node/esm/3O4W5uO7Ei1RSamd.mjs +328 -0
- package/node/esm/BEmcxv9Cg5uinTCr.mjs +80 -0
- package/node/esm/BWuHuJ2nm8MKaUpL.mjs +1697 -0
- package/node/esm/Bb39ZMFsvPRb6_sU.mjs +20 -0
- package/node/esm/Btwf2pH6R5DrzLlO.mjs +32 -0
- package/node/esm/C3_B2QUtmUAAoAbQ.mjs +37 -0
- package/node/esm/CIHXrDGerZpH_kWI.mjs +19 -0
- package/node/esm/CbEtd-l94dqcicGz.mjs +66 -0
- package/node/esm/D06Yw2XsMkKhhpbZ.mjs +406 -0
- package/node/esm/D6pwBrfHwDwzCkt6.mjs +128 -0
- package/node/esm/DKBxWraRN4fQGsFy.mjs +63 -0
- package/node/esm/DPp00qgyktTqWeEp.mjs +68 -0
- package/node/esm/Ddz6TmyZPfCk-PXM.mjs +134 -0
- package/node/esm/Djwke9rsxOR1tTNb.mjs +8 -0
- package/node/esm/DmdPWNpf3d05AFgU.mjs +80 -0
- package/node/esm/DsUEK1CBM3dZfY2X.mjs +198 -0
- package/node/esm/{B-5p0wwNM6Y5jlI2.mjs → DsgT7qY3nHxDGSws.mjs} +84 -2
- package/node/esm/L7XZPzd6aXI7OzdI.mjs +146 -0
- package/node/esm/X9lgoicxH_z9hlaw.mjs +45 -0
- package/node/esm/chart.mjs +41 -0
- package/node/esm/control.mjs +217 -0
- package/node/esm/group.mjs +123 -0
- package/node/esm/index.mjs +16970 -10477
- package/node/esm/note.mjs +113 -0
- package/node/esm/oliuGGZGkPQdm6vE.mjs +35 -0
- package/node/esm/picture.mjs +326 -0
- package/node/esm/s7q4H_VlspTpP2kg.mjs +265 -0
- package/node/esm/shape.mjs +342 -0
- package/node/esm/slicer.mjs +284 -0
- package/package.json +56 -14
- package/resources/contents.json +36 -0
- package/resources/locales/contents.json +84 -0
- package/resources/locales/de/chart.cmd.json +82 -0
- package/resources/locales/de/movable.cmd.json +68 -0
- package/resources/locales/de/picture.cmd.json +188 -0
- package/resources/locales/de/pivot.cmd.json +79 -0
- package/resources/locales/de/shape.cmd.json +17 -0
- package/resources/locales/de/sheet.cmd.json +169 -16
- package/resources/locales/de/slicer.cmd.json +17 -0
- package/resources/locales/de/sparkline.cmd.json +301 -0
- package/resources/locales/de/table.cmd.json +13 -2
- package/resources/locales/de/ui.msg.json +353 -2
- package/resources/locales/de/workbook.cmd.json +8 -1
- package/resources/locales/en/chart.cmd.json +82 -0
- package/resources/locales/en/movable.cmd.json +68 -0
- package/resources/locales/en/picture.cmd.json +188 -0
- package/resources/locales/en/pivot.cmd.json +79 -0
- package/resources/locales/en/shape.cmd.json +17 -0
- package/resources/locales/en/sheet.cmd.json +170 -17
- package/resources/locales/en/slicer.cmd.json +17 -0
- package/resources/locales/en/sparkline.cmd.json +301 -0
- package/resources/locales/en/table.cmd.json +13 -2
- package/resources/locales/en/ui.msg.json +195 -3
- package/resources/locales/en/workbook.cmd.json +8 -1
- package/types/chart.d.ts +2 -0
- package/types/control.d.ts +2 -0
- package/types/group.d.ts +2 -0
- package/types/note.d.ts +2 -0
- package/types/picture.d.ts +2 -0
- package/types/shape.d.ts +2 -0
- package/types/slicer.d.ts +2 -0
- package/types/src/annotation/RangeAnnotationLayer.d.ts +110 -0
- package/types/src/annotation/RangeAnnotationTag.d.ts +23 -0
- package/types/src/annotation/RangeAnnotations.d.ts +180 -0
- package/types/src/annotation/index.d.ts +4 -0
- package/types/src/autoFill/FillMenu.d.ts +2 -2
- package/types/src/autoFill/FillSeries.d.ts +2 -2
- package/types/src/border/StaticBorderRenderer.d.ts +18 -1
- package/types/src/border/useBorders.d.ts +95 -3
- package/types/src/cell/CellCheckboxRenderer.d.ts +20 -0
- package/types/src/cell/CellContent.d.ts +68 -0
- package/types/src/cell/CellControlContext.d.ts +37 -0
- package/types/src/cell/{FormulaCellRenderer.d.ts → CellFormulaRenderer.d.ts} +10 -7
- package/types/src/cell/CellImageRenderer.d.ts +11 -0
- package/types/src/cell/CellRenderers.d.ts +190 -0
- package/types/src/cell/{SheetCellRenderer.d.ts → CellTextRenderer.d.ts} +11 -8
- package/types/src/cell/ColumnButton.d.ts +3 -3
- package/types/src/cell/CornerTriangle.d.ts +2 -1
- package/types/src/cell/OutlineButton.d.ts +4 -4
- package/types/src/cell/PivotButton.d.ts +55 -0
- package/types/src/cell/SheetHeaderRenderer.d.ts +1 -1
- package/types/src/cell/StaticCellRenderer.d.ts +3 -3
- package/types/src/cell/_DropdownFace.d.ts +29 -0
- package/types/src/cell/index.d.ts +9 -2
- package/types/src/cell/useFormulaViewAnchor.d.ts +3 -3
- package/types/src/cell/useInsertableCellControls.d.ts +25 -0
- package/types/src/chart/ChartCommands.d.ts +15 -0
- package/types/src/chart/ChartEditor.d.ts +12 -2
- package/types/src/chart/ChartElement.d.ts +122 -0
- package/types/src/chart/ChartKind.d.ts +7 -0
- package/types/src/chart/PresetChartTypeDescriptors.d.ts +3 -1
- package/types/src/chart/index.d.ts +2 -1
- package/types/src/chart/paint/_fills.d.ts +24 -0
- package/types/src/chart/paint/_graphics.d.ts +38 -0
- package/types/src/chart/paint/_mode.d.ts +6 -0
- package/types/src/chart/paint/echarts.d.ts +33 -0
- package/types/src/chart/paint/index.d.ts +12 -0
- package/types/src/chart/paint/kinds/ChartPaintKind.d.ts +140 -0
- package/types/src/chart/paint/kinds/_Area.d.ts +3 -0
- package/types/src/chart/paint/kinds/_Bar.d.ts +3 -0
- package/types/src/chart/paint/kinds/_BoxWhisker.d.ts +3 -0
- package/types/src/chart/paint/kinds/_Bubble.d.ts +3 -0
- package/types/src/chart/paint/kinds/_Funnel.d.ts +3 -0
- package/types/src/chart/paint/kinds/_Histogram.d.ts +3 -0
- package/types/src/chart/paint/kinds/_Line.d.ts +10 -0
- package/types/src/chart/paint/kinds/_OfPie.d.ts +3 -0
- package/types/src/chart/paint/kinds/_Pie.d.ts +21 -0
- package/types/src/chart/paint/kinds/_Placeholder.d.ts +7 -0
- package/types/src/chart/paint/kinds/_Radar.d.ts +3 -0
- package/types/src/chart/paint/kinds/_Scatter.d.ts +3 -0
- package/types/src/chart/paint/kinds/_Sunburst.d.ts +3 -0
- package/types/src/chart/paint/kinds/_Surface.d.ts +3 -0
- package/types/src/chart/paint/kinds/_Treemap.d.ts +3 -0
- package/types/src/chart/paint/kinds/_Waterfall.d.ts +3 -0
- package/types/src/chart/paint/kinds/_builtIns.d.ts +3 -0
- package/types/src/chart/paint/toEChartsOption.d.ts +42 -0
- package/types/src/checklist/ValueChecklist.d.ts +44 -15
- package/types/src/clipboard/ClipboardCommands.d.ts +3 -3
- package/types/src/clipboard/SheetClipboardLayer.d.ts +2 -2
- package/types/src/commands/ContextualToolbar.d.ts +19 -0
- package/types/src/commands/createTransactionalMiddleware.d.ts +4 -1
- package/types/src/commands/index.d.ts +1 -0
- package/types/src/comment/CommentCardRequest.d.ts +9 -9
- package/types/src/comment/index.d.ts +0 -1
- package/types/src/comment/useSheetComments.d.ts +2 -2
- package/types/src/conditionalFormat/ConditionalFormatPresets.d.ts +6 -6
- package/types/src/context/WorksheetContext.d.ts +18 -0
- package/types/src/context/index.d.ts +1 -1
- package/types/src/control/FormControlRenderers.d.ts +8 -0
- package/types/src/editableLabel/EditableLabel.d.ts +3 -1
- package/types/src/editor/EditorCommands.d.ts +3 -3
- package/types/src/editor/SheetCellEditorLayer.d.ts +2 -7
- package/types/src/editor/SheetCellEditorStartLayer.d.ts +22 -5
- package/types/src/editor/SheetCellInput.d.ts +14 -0
- package/types/src/editor/SheetEditable.d.ts +6 -6
- package/types/src/editor/SheetReferenceHeaderLayer.d.ts +1 -1
- package/types/src/editor/SheetReferenceLayer.d.ts +4 -4
- package/types/src/editor/VirtualKeyboardLayer.d.ts +50 -0
- package/types/src/editor/formulaAnchor.d.ts +12 -0
- package/types/src/editor/formulaPresentation.d.ts +4 -3
- package/types/src/editor/index.d.ts +2 -0
- package/types/src/editor/pickedReference.d.ts +3 -3
- package/types/src/editor/useEditRejectedNotice.d.ts +3 -3
- package/types/src/editor/useFormulaHints.d.ts +3 -3
- package/types/src/editor/useFormulaInput.d.ts +6 -3
- package/types/src/editor/validationAlert.d.ts +24 -0
- package/types/src/form/FormulaInput.d.ts +5 -2
- package/types/src/form/useEditCommit.d.ts +23 -3
- package/types/src/form/useInputField.d.ts +2 -3
- package/types/src/frame/CommandContext.d.ts +74 -3
- package/types/src/group/GroupEditor.d.ts +25 -0
- package/types/src/index.d.ts +10 -2
- package/types/src/layer/BorderLayer.d.ts +5 -2
- package/types/src/layer/CellErrorLayer.d.ts +18 -7
- package/types/src/layer/CellFillLayer.d.ts +2 -2
- package/types/src/layer/CellIndicatorLayer.d.ts +31 -0
- package/types/src/layer/CellInsertLayer.d.ts +71 -0
- package/types/src/layer/CircularIndicatorLayer.d.ts +3 -3
- package/types/src/layer/CommentCardLayer.d.ts +7 -9
- package/types/src/layer/CommentsLayer.d.ts +2 -2
- package/types/src/layer/ConditionalBarLayer.d.ts +2 -2
- package/types/src/layer/ConditionalIcons.d.ts +4 -4
- package/types/src/layer/ConditionalIconsLayer.d.ts +2 -2
- package/types/src/layer/ContextMenuLayer.d.ts +2 -2
- package/types/src/layer/FreezeDragLines.d.ts +17 -0
- package/types/src/layer/GridFreezeLayer.d.ts +11 -0
- package/types/src/layer/HeaderFreezeLayer.d.ts +12 -0
- package/types/src/layer/HeaderResizerLayer.d.ts +2 -1
- package/types/src/layer/HeaderSelectionLayer.d.ts +4 -4
- package/types/src/layer/HyperlinkLayer.d.ts +116 -0
- package/types/src/layer/MovableKindScope.d.ts +17 -0
- package/types/src/layer/PivotLayer.d.ts +47 -0
- package/types/src/layer/PivotToolbar.d.ts +29 -0
- package/types/src/layer/ProtectionLayer.d.ts +4 -5
- package/types/src/layer/RangeToolbar.d.ts +75 -0
- package/types/src/layer/ResizeIndicator.d.ts +11 -10
- package/types/src/layer/ResizeTooltip.d.ts +13 -0
- package/types/src/layer/SheetBackgroundLayer.d.ts +3 -3
- package/types/src/layer/SheetCellLayer.d.ts +15 -8
- package/types/src/layer/SheetColumnButtonLayer.d.ts +2 -2
- package/types/src/layer/SheetGridLineLayer.d.ts +25 -15
- package/types/src/layer/SheetHeaderCellLayer.d.ts +1 -1
- package/types/src/layer/SheetLayers.d.ts +171 -0
- package/types/src/layer/SheetMovableLayer.d.ts +4 -3
- package/types/src/layer/SheetOutlineLayer.d.ts +3 -3
- package/types/src/layer/SheetPivotCommandLayer.d.ts +13 -0
- package/types/src/layer/SheetSparklineCommandLayer.d.ts +14 -0
- package/types/src/layer/SheetTableCommandLayer.d.ts +2 -2
- package/types/src/layer/SparklineLayer.d.ts +32 -0
- package/types/src/layer/SpillLayer.d.ts +2 -2
- package/types/src/layer/TableLayer.d.ts +6 -5
- package/types/src/layer/TableToolbar.d.ts +23 -0
- package/types/src/layer/ValidationDropdownLayer.d.ts +2 -2
- package/types/src/layer/ValidationIndicatorLayer.d.ts +2 -2
- package/types/src/layer/ValidationPromptLayer.d.ts +47 -16
- package/types/src/layer/_sheetBorders.d.ts +6 -0
- package/types/src/layer/_tableColor.d.ts +6 -0
- package/types/src/layer/_visibleCellFeatures.d.ts +11 -0
- package/types/src/layer/cellTip.d.ts +13 -0
- package/types/src/layer/freezeDragState.d.ts +21 -0
- package/types/src/layer/index.d.ts +14 -0
- package/types/src/layer/resizeIndicatorState.d.ts +3 -1
- package/types/src/layer/useFreezeDrag.d.ts +22 -0
- package/types/src/layer/useNormalBorderLines.d.ts +15 -0
- package/types/src/layer/useSheetFeatureRegions.d.ts +2 -2
- package/types/src/layer/useSheetVisibleCells.d.ts +5 -6
- package/types/src/layer/useSheetVisibleDecorations.d.ts +2 -2
- package/types/src/layer/useTableHeaderCells.d.ts +2 -2
- package/types/src/layer/useValidationPicker.d.ts +3 -3
- package/types/src/layer/useVisibleTables.d.ts +2 -2
- package/types/src/layer/validationMark.d.ts +3 -3
- package/types/src/listener/index.d.ts +5 -0
- package/types/src/listener/useCell.d.ts +29 -0
- package/types/src/listener/useCellRange.d.ts +23 -0
- package/types/src/listener/useCellValue.d.ts +26 -0
- package/types/src/listener/useModelListener.d.ts +4 -4
- package/types/src/listener/useRangeListener.d.ts +13 -7
- package/types/src/listener/useRangeSnapshot.d.ts +35 -0
- package/types/src/listener/useTable.d.ts +26 -0
- package/types/src/movable/ConnectionSites.d.ts +18 -0
- package/types/src/movable/DefaultMovable.d.ts +8 -0
- package/types/src/movable/IMovableArea.d.ts +28 -0
- package/types/src/movable/MovableAdornment.d.ts +9 -3
- package/types/src/movable/MovableCommandGroups.d.ts +22 -0
- package/types/src/movable/MovableCommands.d.ts +8 -3
- package/types/src/movable/MovableControl.d.ts +49 -1
- package/types/src/movable/MovableFrame.d.ts +5 -1
- package/types/src/movable/MovableLayer.d.ts +30 -5
- package/types/src/movable/MovableRenderers.d.ts +166 -11
- package/types/src/movable/PlaceholderFrames.d.ts +11 -0
- package/types/src/movable/RotateHandle.d.ts +12 -4
- package/types/src/movable/connect.d.ts +16 -0
- package/types/src/movable/framePlacement.d.ts +44 -1
- package/types/src/movable/geometry.d.ts +13 -3
- package/types/src/movable/index.d.ts +8 -0
- package/types/src/movable/pressTarget.d.ts +20 -0
- package/types/src/movable/useFramePreview.d.ts +17 -0
- package/types/src/picker/cellPickerOpen.d.ts +3 -3
- package/types/src/picker/useCellPicker.d.ts +7 -5
- package/types/src/picture/PictureCommands.d.ts +20 -0
- package/types/src/picture/PictureKind.d.ts +7 -0
- package/types/src/picture/_pictureHyperlink.d.ts +13 -0
- package/types/src/picture/index.d.ts +0 -1
- package/types/src/picture/pictureCrop.d.ts +32 -0
- package/types/src/pivot/PivotAreas.d.ts +16 -0
- package/types/src/pivot/PivotChip.d.ts +33 -0
- package/types/src/pivot/PivotChipMenu.d.ts +74 -0
- package/types/src/pivot/PivotCommands.d.ts +24 -0
- package/types/src/pivot/PivotFieldList.d.ts +14 -0
- package/types/src/pivot/PivotFields.d.ts +47 -0
- package/types/src/pivot/PivotFieldsModel.d.ts +143 -0
- package/types/src/pivot/PivotTablePane.d.ts +47 -0
- package/types/src/pivot/_PivotFieldsContext.d.ts +41 -0
- package/types/src/pivot/_pivotNew.d.ts +12 -0
- package/types/src/pivot/_pivotRegion.d.ts +14 -0
- package/types/src/pivot/index.d.ts +9 -0
- package/types/src/pivot/usePivotFields.d.ts +17 -0
- package/types/src/presence/PresenceCommands.d.ts +35 -0
- package/types/src/presence/PresenceHost.d.ts +58 -0
- package/types/src/presence/PresenceMessages.d.ts +42 -0
- package/types/src/presence/PresenceStore.d.ts +165 -0
- package/types/src/presence/PresenceTypes.d.ts +78 -0
- package/types/src/presence/index.d.ts +7 -0
- package/types/src/presence/usePresence.d.ts +20 -0
- package/types/src/richText/RichTextEditor.d.ts +2 -2
- package/types/src/selection/SelectionCommands.d.ts +2 -2
- package/types/src/selection/SheetSelectionLayer.d.ts +6 -12
- package/types/src/shape/ConnectorControl.d.ts +46 -0
- package/types/src/shape/ShapeCommands.d.ts +11 -0
- package/types/src/shape/ShapeControl.d.ts +8 -0
- package/types/src/shape/ShapeEditor.d.ts +2 -3
- package/types/src/shape/ShapeGallery.d.ts +21 -6
- package/types/src/shape/ShapeKind.d.ts +7 -0
- package/types/src/shape/ShapeSVG.d.ts +6 -8
- package/types/src/shape/index.d.ts +0 -1
- package/types/src/shape/shapeFrame.d.ts +46 -2
- package/types/src/shape/shapeStyle.d.ts +59 -8
- package/types/src/sheet/ISheetHeaderElement.d.ts +3 -3
- package/types/src/sheet/{ISheetElement.d.ts → IWorksheetElement.d.ts} +110 -86
- package/types/src/sheet/OpaqueSheetElement.d.ts +21 -0
- package/types/src/sheet/SheetCommandProvider.d.ts +14 -6
- package/types/src/sheet/SheetCommands.d.ts +18 -3
- package/types/src/sheet/SheetKindIcon.d.ts +14 -0
- package/types/src/sheet/SheetOutlineElement.d.ts +6 -6
- package/types/src/sheet/SheetPanels.d.ts +11 -0
- package/types/src/sheet/SheetScrollbar.d.ts +4 -13
- package/types/src/sheet/TopLeftCorner.d.ts +2 -2
- package/types/src/sheet/WorksheetElement.d.ts +12 -0
- package/types/src/sheet/_freezeAt.d.ts +10 -0
- package/types/src/sheet/_hyperlinkEdit.d.ts +7 -0
- package/types/src/sheet/_useHeaderMetrics.d.ts +11 -0
- package/types/src/sheet/circularReferences.d.ts +4 -4
- package/types/src/sheet/index.d.ts +5 -2
- package/types/src/sheet/useCycleHighlight.d.ts +2 -2
- package/types/src/slicer/SlicerCommands.d.ts +10 -0
- package/types/src/slicer/SlicerEditor.d.ts +8 -2
- package/types/src/slicer/SlicerKind.d.ts +7 -0
- package/types/src/slicer/SlicerStylePreview.d.ts +18 -0
- package/types/src/slicer/index.d.ts +2 -1
- package/types/src/slicer/slicerStyles.d.ts +32 -0
- package/types/src/sparkline/PictureCache.d.ts +37 -0
- package/types/src/sparkline/SparklineCommands.d.ts +23 -0
- package/types/src/sparkline/SparklinePictures.d.ts +7 -0
- package/types/src/sparkline/paint/_drawing.d.ts +24 -0
- package/types/src/sparkline/paint/echarts.d.ts +8 -0
- package/types/src/sparkline/paint/index.d.ts +8 -0
- package/types/src/tabStrip/SheetTab.d.ts +1 -1
- package/types/src/tabStrip/Sortable.d.ts +5 -5
- package/types/src/tabStrip/TabStrip.d.ts +13 -6
- package/types/src/tabStrip/TabStripItem.d.ts +15 -13
- package/types/src/table/TableCommands.d.ts +2 -2
- package/types/src/taskPane/CellControlPane.d.ts +15 -0
- package/types/src/taskPane/MovablePane.d.ts +15 -0
- package/types/src/taskPane/TaskPaneArea.d.ts +7 -0
- package/types/src/taskPane/TaskPaneFrame.d.ts +4 -4
- package/types/src/taskPane/TaskPaneKeys.d.ts +38 -0
- package/types/src/taskPane/TaskPaneRegistry.d.ts +32 -12
- package/types/src/taskPane/_paneReasons.d.ts +7 -0
- package/types/src/taskPane/index.d.ts +3 -0
- package/types/src/taskPane/useTaskPane.d.ts +6 -3
- package/types/src/theme/ExplicitTokens.d.ts +18 -0
- package/types/src/theme/GridColorSchemeContext.d.ts +8 -0
- package/types/src/theme/ThemeRootStyles.d.ts +31 -0
- package/types/src/theme/ThemeState.d.ts +2 -2
- package/types/src/theme/buildDocThemeCSS.d.ts +4 -1
- package/types/src/theme/buildOOXMLThemeCSS.d.ts +2 -2
- package/types/src/theme/buildTokensCSS.d.ts +15 -0
- package/types/src/theme/index.d.ts +2 -4
- package/types/src/theme/useAppColorScheme.d.ts +4 -1
- package/types/src/theme/useGridColorScheme.d.ts +9 -4
- package/types/src/theme/useSystemColors.d.ts +1 -15
- package/types/src/workbook/DefaultMovableRenderers.d.ts +19 -1
- package/types/src/workbook/DefaultRenderers.d.ts +5 -4
- package/types/src/workbook/IWorkbookElement.d.ts +176 -30
- package/types/src/workbook/WorkbookCommands.d.ts +6 -1
- package/types/src/workbook/WorkbookStrip.d.ts +14 -5
- package/browser/cjs/index.cjs +0 -43
- package/browser/cjs/xuAfpHmA2W4MFa_0.cjs +0 -1
- package/types/src/chart/templates/area-stacked-percent-template.json.d.ts +0 -10
- package/types/src/chart/templates/area-stacked-template.json.d.ts +0 -10
- package/types/src/chart/templates/area-template.json.d.ts +0 -9
- package/types/src/chart/templates/bar-stacked-percent-template.json.d.ts +0 -10
- package/types/src/chart/templates/bar-stacked-template.json.d.ts +0 -10
- package/types/src/chart/templates/bar-template.json.d.ts +0 -9
- package/types/src/chart/templates/column-stacked-percent-template.json.d.ts +0 -10
- package/types/src/chart/templates/column-stacked-template.json.d.ts +0 -10
- package/types/src/chart/templates/column-template.json.d.ts +0 -9
- package/types/src/chart/templates/line-markers-template.json.d.ts +0 -10
- package/types/src/chart/templates/line-stacked-markers-template.json.d.ts +0 -11
- package/types/src/chart/templates/line-stacked-percent-markers-template.json.d.ts +0 -11
- package/types/src/chart/templates/line-stacked-percent-template.json.d.ts +0 -10
- package/types/src/chart/templates/line-stacked-template.json.d.ts +0 -10
- package/types/src/chart/templates/line-template.json.d.ts +0 -9
- package/types/src/chart/templates/pie-doughnut-template.json.d.ts +0 -10
- package/types/src/chart/templates/pie-template.json.d.ts +0 -9
- package/types/src/chart/templates/scatter-lines-markers-smooth-template.json.d.ts +0 -10
- package/types/src/chart/templates/scatter-lines-markers-template.json.d.ts +0 -10
- package/types/src/chart/templates/scatter-lines-smooth-template.json.d.ts +0 -10
- package/types/src/chart/templates/scatter-lines-template.json.d.ts +0 -10
- package/types/src/chart/templates/scatter-markers-template.json.d.ts +0 -10
- package/types/src/context/SheetContext.d.ts +0 -18
- package/types/src/control/index.d.ts +0 -2
- package/types/src/sheet/SheetElement.d.ts +0 -15
|
@@ -0,0 +1,341 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v1.0.2
|
|
3
|
+
*
|
|
4
|
+
* (C) 2026-present SheetXL Inc. & Michael T. Ford
|
|
5
|
+
* License: SheetXL EULA — https://www.sheetxl.com/eula
|
|
6
|
+
*/
|
|
7
|
+
import { t as e } from "./Xab6qjmPHkjnBlcs.mjs";
|
|
8
|
+
import { n as t } from "./DYLAfjgirgwGJkJo.mjs";
|
|
9
|
+
import { t as n } from "./WUqAXqTxytEPWXNZ.mjs";
|
|
10
|
+
import { t as r } from "./B_X-eExTurXNj2s6.mjs";
|
|
11
|
+
import { i, n as a, r as o, t as ee } from "./D_KHWbW4C9PQ7G8l.mjs";
|
|
12
|
+
import { forwardRef as s, memo as c, useCallback as l, useEffect as u, useMemo as d, useReducer as te, useRef as f, useState as p } from "react";
|
|
13
|
+
import { jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
14
|
+
import { messageKey as ne } from "@sheetxl/utils";
|
|
15
|
+
import { ReactUtils as g, tokenVar as _, useImperativeElement as v } from "@sheetxl/utils-react";
|
|
16
|
+
import { createPortal as re } from "react-dom";
|
|
17
|
+
var y = c(({ handles: e, width: t, height: n, zoom: r, onDrag: i }) => {
|
|
18
|
+
let a = f(null), o = f(null), [ee, s] = p(!1), c = l((e) => {
|
|
19
|
+
let t = a.current, n = t?.getScreenCTM();
|
|
20
|
+
if (!t || !n) return null;
|
|
21
|
+
let r = new DOMPoint(e.clientX, e.clientY).matrixTransform(n.inverse());
|
|
22
|
+
return {
|
|
23
|
+
x: r.x,
|
|
24
|
+
y: r.y
|
|
25
|
+
};
|
|
26
|
+
}, []), u = l((e, t) => {
|
|
27
|
+
e.button === 0 && (e.stopPropagation(), e.preventDefault(), o.current = {
|
|
28
|
+
index: t,
|
|
29
|
+
pointerId: e.pointerId
|
|
30
|
+
}, e.currentTarget.setPointerCapture(e.pointerId), s(!0));
|
|
31
|
+
}, []), d = l((e) => {
|
|
32
|
+
let t = o.current;
|
|
33
|
+
if (!t || t.pointerId !== e.pointerId) return;
|
|
34
|
+
e.stopPropagation();
|
|
35
|
+
let n = c(e);
|
|
36
|
+
n && i(t.index, n.x, n.y, "move");
|
|
37
|
+
}, [c, i]), te = l((e) => {
|
|
38
|
+
let t = o.current;
|
|
39
|
+
if (!t || t.pointerId !== e.pointerId) return;
|
|
40
|
+
e.stopPropagation(), o.current = null, s(!1);
|
|
41
|
+
let n = c(e);
|
|
42
|
+
n ? i(t.index, n.x, n.y, "end") : i(t.index, 0, 0, "cancel");
|
|
43
|
+
}, [c, i]), ne = l((e) => {
|
|
44
|
+
let t = o.current;
|
|
45
|
+
t && t.pointerId === e.pointerId && (o.current = null, s(!1), i(t.index, 0, 0, "cancel"));
|
|
46
|
+
}, [i]);
|
|
47
|
+
if (!(e.length !== 0 && t > 0 && n > 0)) return null;
|
|
48
|
+
let g = r > 0 ? r : 1, v = 4.5 / g;
|
|
49
|
+
return m("svg", {
|
|
50
|
+
ref: a,
|
|
51
|
+
className: ee ? "sxl-shape-handles sxl-movable-gesture" : "sxl-shape-handles",
|
|
52
|
+
viewBox: `0 0 ${t} ${n}`,
|
|
53
|
+
width: "100%",
|
|
54
|
+
height: "100%",
|
|
55
|
+
preserveAspectRatio: "none",
|
|
56
|
+
overflow: "visible",
|
|
57
|
+
style: {
|
|
58
|
+
position: "absolute",
|
|
59
|
+
left: 0,
|
|
60
|
+
top: 0,
|
|
61
|
+
display: "block",
|
|
62
|
+
pointerEvents: "none",
|
|
63
|
+
touchAction: "none"
|
|
64
|
+
},
|
|
65
|
+
children: e.map((e) => h("g", {
|
|
66
|
+
className: "sxl-shape-handle",
|
|
67
|
+
style: { "--shape-scale": g },
|
|
68
|
+
children: [m("circle", {
|
|
69
|
+
cx: e.x,
|
|
70
|
+
cy: e.y,
|
|
71
|
+
r: v,
|
|
72
|
+
fill: _("color-accent"),
|
|
73
|
+
stroke: _("color-base-100"),
|
|
74
|
+
strokeWidth: 1 / g,
|
|
75
|
+
style: { pointerEvents: "none" }
|
|
76
|
+
}), m("circle", {
|
|
77
|
+
className: "sxl-shape-handle-hit",
|
|
78
|
+
cx: e.x,
|
|
79
|
+
cy: e.y,
|
|
80
|
+
r: v,
|
|
81
|
+
fill: "transparent",
|
|
82
|
+
style: {
|
|
83
|
+
pointerEvents: "all",
|
|
84
|
+
cursor: "crosshair",
|
|
85
|
+
touchAction: "none"
|
|
86
|
+
},
|
|
87
|
+
onPointerDown: (t) => u(t, e.index),
|
|
88
|
+
onPointerMove: d,
|
|
89
|
+
onPointerUp: te,
|
|
90
|
+
onPointerCancel: ne,
|
|
91
|
+
onMouseDown: (e) => e.stopPropagation()
|
|
92
|
+
})]
|
|
93
|
+
}, e.index))
|
|
94
|
+
});
|
|
95
|
+
});
|
|
96
|
+
y.displayName = "ShapeHandles";
|
|
97
|
+
var b = (e, t) => e > 0 || t > 0, x = (e, t, n) => !e || e.getWidth() === t && e.getHeight() === n ? e : b(t, n) ? e.resize(t, n) : null, ie = (e) => {
|
|
98
|
+
let t = [];
|
|
99
|
+
return e.forEachConnection((e) => t.push(e)), t;
|
|
100
|
+
}, ae = c(s((s, c) => {
|
|
101
|
+
let { children: ae, disabled: S, style: oe, shape: C, movable: w, zoom: T = 1, isDragging: se, onHide: ce, onShow: le, onDragZone: ue, onTap: de, adornmentHost: E, flip: fe, gesture: D, debugGeometry: pe = !1, ...me } = s, O = t()?.getStyles() ?? null, [he, k] = te((e) => e + 1, 0);
|
|
102
|
+
e(C, { onAnyChange: k }), e(w ?? null, {
|
|
103
|
+
onBoundsChange: k,
|
|
104
|
+
onSelectionChange: k
|
|
105
|
+
});
|
|
106
|
+
let A = C.toJSON(), { width: j, height: M, rotation: ge, content: N } = i(w), P = C.getShapeType(), _e = C.getAdjustments(), F = b(j, M), [I, L] = p(null), R = f(0);
|
|
107
|
+
u(() => {
|
|
108
|
+
if (!F) return void L(null);
|
|
109
|
+
let e = ++R.current, t = C.getShapeType();
|
|
110
|
+
C.getGeometry(j, M).then((n) => {
|
|
111
|
+
R.current === e && L(n ? {
|
|
112
|
+
shapeType: t,
|
|
113
|
+
geometry: n
|
|
114
|
+
} : null);
|
|
115
|
+
}, () => {
|
|
116
|
+
R.current === e && L(null);
|
|
117
|
+
});
|
|
118
|
+
}, [
|
|
119
|
+
C,
|
|
120
|
+
j,
|
|
121
|
+
M,
|
|
122
|
+
he
|
|
123
|
+
]);
|
|
124
|
+
let z = N?.shapeType !== void 0 && N.shapeType !== P ? N.shapeType : null, [B, ve] = p(null);
|
|
125
|
+
u(() => {
|
|
126
|
+
if (!z || !F || B?.shapeType === z) return;
|
|
127
|
+
let e = !0;
|
|
128
|
+
return C.getGeometry(j, M, { shapeType: z }).then((t) => {
|
|
129
|
+
e && t && ve({
|
|
130
|
+
shapeType: z,
|
|
131
|
+
geometry: t
|
|
132
|
+
});
|
|
133
|
+
}, () => {}), () => {
|
|
134
|
+
e = !1;
|
|
135
|
+
};
|
|
136
|
+
}, [
|
|
137
|
+
C,
|
|
138
|
+
z,
|
|
139
|
+
F
|
|
140
|
+
]);
|
|
141
|
+
let V = d(() => {
|
|
142
|
+
let e = I?.shapeType === P ? I : B?.shapeType === P ? B : null;
|
|
143
|
+
return e ? x(e.geometry, j, M)?.withAdjustments(_e) ?? null : x(I?.geometry ?? null, j, M);
|
|
144
|
+
}, [
|
|
145
|
+
I,
|
|
146
|
+
B,
|
|
147
|
+
P,
|
|
148
|
+
_e,
|
|
149
|
+
j,
|
|
150
|
+
M
|
|
151
|
+
]), ye = l((e) => C.getResource(e), [C]);
|
|
152
|
+
u(() => {
|
|
153
|
+
let e = [];
|
|
154
|
+
for (let t = w?.getParent() ?? null; t; t = t.getParent()) e.push(t.getContent().addListeners({ onAnyChange: k }));
|
|
155
|
+
return () => {
|
|
156
|
+
for (let t of e) t();
|
|
157
|
+
};
|
|
158
|
+
}, [w]);
|
|
159
|
+
let be = a(w), H = d(() => o(A, O, ye, be), [
|
|
160
|
+
A,
|
|
161
|
+
O,
|
|
162
|
+
ye,
|
|
163
|
+
be
|
|
164
|
+
]), [xe, U] = p(null), W = N?.adjustments === void 0 ? xe ?? void 0 : N.adjustments, G = d(() => {
|
|
165
|
+
if (z && B?.shapeType !== z) return V;
|
|
166
|
+
let e = z ? x(B.geometry, j, M) : V;
|
|
167
|
+
return e && W !== void 0 ? e.withAdjustments(W) : e;
|
|
168
|
+
}, [
|
|
169
|
+
V,
|
|
170
|
+
z,
|
|
171
|
+
B,
|
|
172
|
+
j,
|
|
173
|
+
M,
|
|
174
|
+
W
|
|
175
|
+
]), K = f(null), [Se, q] = p(!1), Ce = l((e, t, n, r) => {
|
|
176
|
+
if (r === "cancel") return K.current && (K.current = null, q(!1), D?.cancel()), void U(null);
|
|
177
|
+
if (!G || !V) return;
|
|
178
|
+
let i = G.adjustmentsFromHandle(e, t, n);
|
|
179
|
+
if (r === "move") {
|
|
180
|
+
if (D && !S) {
|
|
181
|
+
if (!K.current) {
|
|
182
|
+
let e = { adjustments: i };
|
|
183
|
+
if (!D.start(ne("op.setShapeAdjustments"), (t) => {
|
|
184
|
+
t.getContent().setAdjustments(e.adjustments);
|
|
185
|
+
})) return;
|
|
186
|
+
K.current = e, q(!0);
|
|
187
|
+
}
|
|
188
|
+
K.current.adjustments = i, D.preview({ content: { adjustments: i } });
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
191
|
+
U(i);
|
|
192
|
+
return;
|
|
193
|
+
}
|
|
194
|
+
let a = K.current;
|
|
195
|
+
if (a) return K.current = null, q(!1), a.adjustments = i, void D?.finish();
|
|
196
|
+
U(null), S || C.setAdjustments(i);
|
|
197
|
+
}, [
|
|
198
|
+
G,
|
|
199
|
+
V,
|
|
200
|
+
C,
|
|
201
|
+
S,
|
|
202
|
+
D
|
|
203
|
+
]), we = d(() => {
|
|
204
|
+
let e = [];
|
|
205
|
+
return G?.forEachHandle((t) => e.push(t)), e;
|
|
206
|
+
}, [G]), Te = v(c, () => ({ isShapeEditor: () => !0 }), []), Ee = fe ?? w?.getFlip(), J = Ee?.horizontal ?? !1, Y = Ee?.vertical ?? !1, De = ge % 360 != 0, Oe = d(() => !De && b(j, M) ? {
|
|
207
|
+
dpr: g.getDevicePixelRatio(),
|
|
208
|
+
zoom: T,
|
|
209
|
+
width: j,
|
|
210
|
+
height: M,
|
|
211
|
+
flipH: J,
|
|
212
|
+
flipV: Y
|
|
213
|
+
} : null, [
|
|
214
|
+
De,
|
|
215
|
+
T,
|
|
216
|
+
j,
|
|
217
|
+
M,
|
|
218
|
+
J,
|
|
219
|
+
Y
|
|
220
|
+
]);
|
|
221
|
+
if (C.isDeleted() || !A) return null;
|
|
222
|
+
let X = oe?.pointerEvents === "none", ke = X ? "none" : "visiblePainted", Ae = !X && !S && (!se || Se) && !!w?.isSelected(), je = {
|
|
223
|
+
transform: J || Y ? `scale(${J ? -1 : 1}, ${Y ? -1 : 1})` : void 0,
|
|
224
|
+
transformOrigin: "center"
|
|
225
|
+
}, Z = null;
|
|
226
|
+
Ae && we.length > 0 && (Z = m(y, {
|
|
227
|
+
handles: we,
|
|
228
|
+
width: j,
|
|
229
|
+
height: M,
|
|
230
|
+
zoom: T,
|
|
231
|
+
onDrag: Ce
|
|
232
|
+
}), E && (Z = re(m("div", {
|
|
233
|
+
className: "sxl-shape-adornment",
|
|
234
|
+
style: {
|
|
235
|
+
position: "absolute",
|
|
236
|
+
left: 0,
|
|
237
|
+
top: 0,
|
|
238
|
+
width: "100%",
|
|
239
|
+
height: "100%",
|
|
240
|
+
...je,
|
|
241
|
+
pointerEvents: "none"
|
|
242
|
+
},
|
|
243
|
+
children: Z
|
|
244
|
+
}), E)));
|
|
245
|
+
let Me = J === Y ? void 0 : "scaleX(-1)", Q = G?.getTextRect(), $ = A.text, Ne = !!$ && $.paragraphs.some((e) => e.runs.some((e) => e.text !== ""));
|
|
246
|
+
return h("div", {
|
|
247
|
+
className: "sxl-shape-editor",
|
|
248
|
+
...me,
|
|
249
|
+
ref: Te,
|
|
250
|
+
style: {
|
|
251
|
+
width: "100%",
|
|
252
|
+
height: "100%",
|
|
253
|
+
position: "relative",
|
|
254
|
+
overflow: "visible",
|
|
255
|
+
filter: S ? "blur(1px)" : void 0,
|
|
256
|
+
...je,
|
|
257
|
+
...oe,
|
|
258
|
+
pointerEvents: "none"
|
|
259
|
+
},
|
|
260
|
+
children: [
|
|
261
|
+
b(j, M) ? h("svg", {
|
|
262
|
+
className: "sxl-shape-geometry",
|
|
263
|
+
viewBox: `0 0 ${j > 0 ? j : 1 / T} ${M > 0 ? M : 1 / T}`,
|
|
264
|
+
width: j > 0 ? "100%" : "1px",
|
|
265
|
+
height: M > 0 ? "100%" : "1px",
|
|
266
|
+
preserveAspectRatio: "none",
|
|
267
|
+
overflow: "visible",
|
|
268
|
+
style: {
|
|
269
|
+
position: "absolute",
|
|
270
|
+
left: 0,
|
|
271
|
+
top: 0,
|
|
272
|
+
display: "block",
|
|
273
|
+
pointerEvents: "none",
|
|
274
|
+
filter: Ae ? `drop-shadow(1px 1px 2px ${_("color-shadow")})` : void 0
|
|
275
|
+
},
|
|
276
|
+
children: [G ? m(ee, {
|
|
277
|
+
geometry: G,
|
|
278
|
+
style: H,
|
|
279
|
+
zoom: T,
|
|
280
|
+
grid: Oe,
|
|
281
|
+
hit: ke
|
|
282
|
+
}) : null, pe && G && Q ? h("g", {
|
|
283
|
+
pointerEvents: "none",
|
|
284
|
+
children: [m("rect", {
|
|
285
|
+
x: Q.l,
|
|
286
|
+
y: Q.t,
|
|
287
|
+
width: Math.max(0, Q.r - Q.l),
|
|
288
|
+
height: Math.max(0, Q.b - Q.t),
|
|
289
|
+
fill: "none",
|
|
290
|
+
stroke: _("color-error"),
|
|
291
|
+
strokeWidth: 1 / T,
|
|
292
|
+
strokeDasharray: `${4 / T} ${2 / T}`
|
|
293
|
+
}), ie(G).map((e) => m("rect", {
|
|
294
|
+
x: e.x - 3 / T,
|
|
295
|
+
y: e.y - 3 / T,
|
|
296
|
+
width: 6 / T,
|
|
297
|
+
height: 6 / T,
|
|
298
|
+
fill: _("color-success")
|
|
299
|
+
}, e.index))]
|
|
300
|
+
}) : null]
|
|
301
|
+
}) : null,
|
|
302
|
+
Ne && Q ? m("div", {
|
|
303
|
+
className: "sxl-shape-text-frame",
|
|
304
|
+
style: {
|
|
305
|
+
position: "absolute",
|
|
306
|
+
left: Q.l,
|
|
307
|
+
top: Q.t,
|
|
308
|
+
width: Math.max(0, Q.r - Q.l),
|
|
309
|
+
height: Math.max(0, Q.b - Q.t),
|
|
310
|
+
zoom: T,
|
|
311
|
+
transform: Me,
|
|
312
|
+
transformOrigin: "center",
|
|
313
|
+
pointerEvents: X ? "none" : "auto",
|
|
314
|
+
color: H.textColor ?? void 0
|
|
315
|
+
},
|
|
316
|
+
children: m(n, {
|
|
317
|
+
movable: w,
|
|
318
|
+
disabled: !0,
|
|
319
|
+
style: {
|
|
320
|
+
fontFamily: "Calibri, Carlito, sans-serif",
|
|
321
|
+
fontSize: "11pt",
|
|
322
|
+
lineHeight: 1.2,
|
|
323
|
+
padding: 0
|
|
324
|
+
},
|
|
325
|
+
contentStyle: {
|
|
326
|
+
padding: 0,
|
|
327
|
+
overflow: "hidden"
|
|
328
|
+
},
|
|
329
|
+
children: m(r, {
|
|
330
|
+
text: $,
|
|
331
|
+
styles: O,
|
|
332
|
+
color: H.textColor
|
|
333
|
+
})
|
|
334
|
+
})
|
|
335
|
+
}) : null,
|
|
336
|
+
Z
|
|
337
|
+
]
|
|
338
|
+
});
|
|
339
|
+
}));
|
|
340
|
+
ae.displayName = "ShapeEditor";
|
|
341
|
+
export { ae as t };
|
|
@@ -0,0 +1,323 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v1.0.2
|
|
3
|
+
*
|
|
4
|
+
* (C) 2026-present SheetXL Inc. & Michael T. Ford
|
|
5
|
+
* License: SheetXL EULA — https://www.sheetxl.com/eula
|
|
6
|
+
*/
|
|
7
|
+
import { t as e } from "./Xab6qjmPHkjnBlcs.mjs";
|
|
8
|
+
import { n as t } from "./DYLAfjgirgwGJkJo.mjs";
|
|
9
|
+
import { t as n } from "./xismu7oIPMRpfRZN.mjs";
|
|
10
|
+
import { i as r, r as i, t as a } from "./D_KHWbW4C9PQ7G8l.mjs";
|
|
11
|
+
import { forwardRef as o, memo as s, useCallback as c, useEffect as l, useId as u, useMemo as d, useReducer as ee, useRef as te, useState as f } from "react";
|
|
12
|
+
import { jsx as p, jsxs as ne } from "react/jsx-runtime";
|
|
13
|
+
import { useSurfaceStateSetter as re } from "@sheetxl/grid-react";
|
|
14
|
+
import { ReactUtils as ie, useImperativeElement as ae, useNotifier as oe, usePendingRender as se } from "@sheetxl/utils-react";
|
|
15
|
+
var m = (e) => Math.round(1e3 * e) / 1e3, h = (e, t, n) => {
|
|
16
|
+
let r = m(50 * (1 - e.width / (n * t.width))), i = m(50 * (1 - e.height / (n * t.height)));
|
|
17
|
+
return {
|
|
18
|
+
left: r,
|
|
19
|
+
right: r,
|
|
20
|
+
top: i,
|
|
21
|
+
bottom: i
|
|
22
|
+
};
|
|
23
|
+
}, g = (e, t) => h(e, t, Math.max(e.width / t.width, e.height / t.height)), _ = (e, t) => h(e, t, Math.min(e.width / t.width, e.height / t.height)), v = (e, t, n) => {
|
|
24
|
+
let r = Math.min(e.width, e.height * n), i = r / n, { left: a = 0, top: o = 0, right: s = 0, bottom: c = 0 } = t, l = (e.width - r) / 2 / e.width * (100 - a - s), u = (e.height - i) / 2 / e.height * (100 - o - c);
|
|
25
|
+
return {
|
|
26
|
+
bounds: {
|
|
27
|
+
x: e.x + (e.width - r) / 2,
|
|
28
|
+
y: e.y + (e.height - i) / 2,
|
|
29
|
+
width: r,
|
|
30
|
+
height: i
|
|
31
|
+
},
|
|
32
|
+
crop: {
|
|
33
|
+
left: m(a + l),
|
|
34
|
+
right: m(s + l),
|
|
35
|
+
top: m(o + u),
|
|
36
|
+
bottom: m(c + u)
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
}, y = "data:image/webp;base64,UklGRhIPAABXRUJQVlA4TAYPAAAv/8F/EM8HIZJtWU0fdlTh3wRCIMlkE+EqkiTFyt57/KQ8/zKeEf5iaseNJClS1DGDxWcwvhfuCo5tW88SHw8Xh5ypbC3tnf8QHEfOB/D97w4PuFHBIx6MHJ74zvj/0aLdlH9AYWEjHiwOJR5M7Q+FAigmTRQOJRqczrVUKABQSMYgoAFFAhIwBkgaYEkBSABowDGgcYakUZirArQhRMUIIHGLBIAEEoDRfyokIAEAMhrSRmEOSPyS/jvR+BYFIWkUhLQhCpLGGQ2rhPiCOKPxDIVQmAZQDMYIjCTfNQXVJv8pnQqhuAonnczGDPv0VwFw/w+uGiAwQYjJXxffaJzROKPHoArGAPA+6o9AtiIj4XgAWGKCwAQBVNMSHQNEjTMqOSWPQEFRHOVl4vp/nnhI/DBNK8CGXCpeFvONip/jvPn67qb957v+Nssyv96/Jwg/xzT9yORhfR4fb6vF9ef39Nt62g55v37/7dRzfx9xFLRtIyX8ae+/AxARE8APxbCQtkidoqVGDBDxR3r8/59vo88vnW07v9nrY+l0tn0zemuSnn03W83Otn2zcarbfIrZqnG7Ykr77/nS5PP+/E6/iP7DgiRJiZX13F2QhYM/OrBtm7at/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Lh4Zt9IaW1Tt6tjfIYhWRY86YGCKH/WWGmUOWraaHxzw1yV2DMxQ2zHq51Tmyfl2o99bI25Jig2vP54ljDp9ykLWsdj3fkO9vvWPKtL8wndo7YeztOy8bcKh5OVncyhq2XNrd96ZpLrjy5/qYb/l8S7q2r1NJlj/bf7b/bP/Z/rP9Z/vP9p/tP9t/tv9s//3djwA=", b = {
|
|
40
|
+
left: "0%",
|
|
41
|
+
top: "0%",
|
|
42
|
+
width: "100%",
|
|
43
|
+
height: "100%"
|
|
44
|
+
}, x = {
|
|
45
|
+
position: "absolute",
|
|
46
|
+
left: 0,
|
|
47
|
+
top: 0,
|
|
48
|
+
width: "100%",
|
|
49
|
+
height: "100%",
|
|
50
|
+
display: "block",
|
|
51
|
+
pointerEvents: "none"
|
|
52
|
+
}, S = s(o((o, s) => {
|
|
53
|
+
let { children: m, disabled: h, style: g, picture: _, movable: v, zoom: S = 1, gesture: ce, description: le, tile: C, offsetX: ue = 0, offsetY: w = 0, isDragging: de, onHide: fe, onShow: pe, onDragZone: me, onTap: T, adornmentHost: he, flip: E, onKeyDownCapture: ge, onFocus: _e, onBlur: ve, loadingPanel: ye, ...be } = o, [D, O] = f(!1), [k, xe] = f(null), [A, j] = f(null), [M, N] = f(null), [Se, P] = ee((e) => e + 1, 0);
|
|
54
|
+
e(_, { onAnyChange: P }), e(v ?? null, {
|
|
55
|
+
onBoundsChange: P,
|
|
56
|
+
onSelectionChange: P
|
|
57
|
+
});
|
|
58
|
+
let Ce = t(), F = oe(), I = _.toJSON(), { width: L, height: R, rotation: z } = r(v), B = L > 0 && R > 0, V = !!I.fill || !!I.stroke || I.geometry !== void 0 && I.geometry !== "rect", we = I.adjustments ? JSON.stringify(I.adjustments) : "", [H, U] = f(null), [Te, W] = f(!1);
|
|
59
|
+
l(() => {
|
|
60
|
+
if (!V || !B) return U(null), void W(!1);
|
|
61
|
+
let e = !0;
|
|
62
|
+
return _.getGeometry(L, R).then((t) => {
|
|
63
|
+
e && (U(t), W(!0));
|
|
64
|
+
}, () => {
|
|
65
|
+
e && (U(null), W(!0));
|
|
66
|
+
}), () => {
|
|
67
|
+
e = !1;
|
|
68
|
+
};
|
|
69
|
+
}, [
|
|
70
|
+
_,
|
|
71
|
+
V,
|
|
72
|
+
B,
|
|
73
|
+
I.geometry,
|
|
74
|
+
we
|
|
75
|
+
]);
|
|
76
|
+
let G = d(() => H && B ? H.getWidth() === L && H.getHeight() === R ? H : H.resize(L, R) : null, [
|
|
77
|
+
H,
|
|
78
|
+
B,
|
|
79
|
+
L,
|
|
80
|
+
R
|
|
81
|
+
]), [Ee, De] = f(null);
|
|
82
|
+
l(() => {
|
|
83
|
+
if (!C || !A) return;
|
|
84
|
+
let e = !0, t = new Image();
|
|
85
|
+
return t.src = A, (typeof t.decode == "function" ? t.decode() : Promise.resolve()).catch(() => {}).then(() => {
|
|
86
|
+
e && De(A);
|
|
87
|
+
}), () => {
|
|
88
|
+
e = !1;
|
|
89
|
+
};
|
|
90
|
+
}, [C, A]), se(!D && (C ? Ee !== A || !A : !k) || V && B && !Te);
|
|
91
|
+
let K = Ce?.getStyles() ?? null, q = d(() => V ? i({
|
|
92
|
+
fill: I.fill,
|
|
93
|
+
stroke: I.stroke,
|
|
94
|
+
style: null
|
|
95
|
+
}, K) : null, [
|
|
96
|
+
V,
|
|
97
|
+
I.fill,
|
|
98
|
+
I.stroke,
|
|
99
|
+
K
|
|
100
|
+
]), Oe = `${u().replace(/[^A-Za-z0-9_-]/g, "")}-clip`, J = d(() => {
|
|
101
|
+
if (!G || I.geometry === void 0 || I.geometry === "rect") return null;
|
|
102
|
+
let e = [];
|
|
103
|
+
return G.forEachPath((t) => {
|
|
104
|
+
t.layer === "fill" && e.push(t.d);
|
|
105
|
+
}), e.length > 0 ? e.join(" ") : null;
|
|
106
|
+
}, [G, I.geometry]), ke = E?.horizontal ?? !1, Ae = E?.vertical ?? !1, je = d(() => z % 360 == 0 && B ? {
|
|
107
|
+
dpr: ie.getDevicePixelRatio(),
|
|
108
|
+
zoom: S,
|
|
109
|
+
width: L,
|
|
110
|
+
height: R,
|
|
111
|
+
flipH: ke,
|
|
112
|
+
flipV: Ae
|
|
113
|
+
} : null, [
|
|
114
|
+
z,
|
|
115
|
+
B,
|
|
116
|
+
S,
|
|
117
|
+
L,
|
|
118
|
+
R,
|
|
119
|
+
ke,
|
|
120
|
+
Ae
|
|
121
|
+
]), Y = _.getHyperlink?.() ?? null, X = re(n, null), Z = te(null);
|
|
122
|
+
l(() => () => {
|
|
123
|
+
Z.current?.(), X((e) => e === _ ? null : e);
|
|
124
|
+
}, [_, X]), l(() => {
|
|
125
|
+
Y || X((e) => e === _ ? null : e);
|
|
126
|
+
}, [
|
|
127
|
+
!Y,
|
|
128
|
+
_,
|
|
129
|
+
X
|
|
130
|
+
]);
|
|
131
|
+
let Q = c((e) => {
|
|
132
|
+
v?.unselect(), e.open().catch((e) => {
|
|
133
|
+
F.showError?.(e instanceof Error ? e : String(e));
|
|
134
|
+
});
|
|
135
|
+
}, [v, F]);
|
|
136
|
+
l(() => {
|
|
137
|
+
T?.(() => {
|
|
138
|
+
let e = _.getHyperlink?.();
|
|
139
|
+
return !!e && (Q(e), !0);
|
|
140
|
+
});
|
|
141
|
+
}, [
|
|
142
|
+
T,
|
|
143
|
+
_,
|
|
144
|
+
Q
|
|
145
|
+
]), l(() => {
|
|
146
|
+
j(null), _.getDetails().then((e) => {
|
|
147
|
+
O(!1), j(e.asUrl()), N(e.asSVGText?.() || null);
|
|
148
|
+
}).catch((e) => {
|
|
149
|
+
console.warn(e), O(!0), j(y), N(null);
|
|
150
|
+
});
|
|
151
|
+
}, [_, Se]);
|
|
152
|
+
let Me = ae(s, () => ({ isPictureEditor: () => !0 }), []), Ne = I.image?.sourceRect, Pe = d(() => ((e) => {
|
|
153
|
+
let { left: t = 0, top: n = 0, right: r = 0, bottom: i = 0 } = e ?? {}, a = (100 - t - r) / 100, o = (100 - n - i) / 100;
|
|
154
|
+
return {
|
|
155
|
+
left: -t / a + "%",
|
|
156
|
+
top: -n / o + "%",
|
|
157
|
+
width: 100 / a + "%",
|
|
158
|
+
height: 100 / o + "%"
|
|
159
|
+
};
|
|
160
|
+
})(Ne), [Ne]), Fe = d(() => {
|
|
161
|
+
if (A || M) return C ? p("div", { style: {
|
|
162
|
+
backgroundPosition: `${ue}px ${w}px`,
|
|
163
|
+
backgroundImage: `url(${A})`,
|
|
164
|
+
backgroundRepeat: "repeat",
|
|
165
|
+
backgroundSize: "auto",
|
|
166
|
+
width: "100%",
|
|
167
|
+
height: "100%",
|
|
168
|
+
filter: "var(--_sxl-image-filter)"
|
|
169
|
+
} }) : p("img", {
|
|
170
|
+
style: {
|
|
171
|
+
position: "absolute",
|
|
172
|
+
...D ? b : Pe,
|
|
173
|
+
border: D ? "var(--sxl-color-neutral, grey) solid 1px" : void 0,
|
|
174
|
+
backgroundColor: D ? "var(--sxl-color-base-100, white)" : void 0,
|
|
175
|
+
boxShadow: D ? "0px 0px 3px var(--sxl-color-error, red)" : void 0,
|
|
176
|
+
objectFit: D ? "contain" : void 0,
|
|
177
|
+
opacity: +!!k,
|
|
178
|
+
filter: "var(--_sxl-image-filter)"
|
|
179
|
+
},
|
|
180
|
+
draggable: !1,
|
|
181
|
+
src: A ?? void 0,
|
|
182
|
+
onLoad: () => {
|
|
183
|
+
xe(!0);
|
|
184
|
+
},
|
|
185
|
+
onError: ({ currentTarget: e }) => {
|
|
186
|
+
console.log("error"), e.onerror = null, j(y), O(!0);
|
|
187
|
+
},
|
|
188
|
+
alt: le ?? `${_.getType()}`
|
|
189
|
+
});
|
|
190
|
+
}, [
|
|
191
|
+
k,
|
|
192
|
+
_,
|
|
193
|
+
A,
|
|
194
|
+
M,
|
|
195
|
+
de,
|
|
196
|
+
C,
|
|
197
|
+
ue,
|
|
198
|
+
w,
|
|
199
|
+
Pe,
|
|
200
|
+
D,
|
|
201
|
+
le
|
|
202
|
+
]);
|
|
203
|
+
if (_.isDeleted()) return;
|
|
204
|
+
let Ie = E && (E.horizontal || E.vertical) ? `scale(${E.horizontal ? -1 : 1}, ${E.vertical ? -1 : 1})` : void 0, $ = g?.pointerEvents === "none" ? "none" : "visiblePainted", { left: Le = 0, top: Re = 0, right: ze = 0, bottom: Be = 0 } = I.image?.stretch ?? {};
|
|
205
|
+
return ne("div", {
|
|
206
|
+
className: "sxl-picture-editor",
|
|
207
|
+
style: {
|
|
208
|
+
position: "relative",
|
|
209
|
+
display: "flex",
|
|
210
|
+
flex: "1 1 100%",
|
|
211
|
+
filter: de ? "drop-shadow(1px 1px 1.5px var(--sxl-color-shadow, rgba(0, 0, 0, .25)))" : void 0,
|
|
212
|
+
transform: Ie,
|
|
213
|
+
transformOrigin: "center",
|
|
214
|
+
...g,
|
|
215
|
+
pointerEvents: "none",
|
|
216
|
+
width: "100%",
|
|
217
|
+
height: "100%"
|
|
218
|
+
},
|
|
219
|
+
...be,
|
|
220
|
+
onPointerDownCapture: Y ? (e) => {
|
|
221
|
+
if (e.button !== 0 || e.ctrlKey || e.metaKey || e.shiftKey || !v || v.isSelected()) return;
|
|
222
|
+
Z.current?.();
|
|
223
|
+
let t = e.currentTarget.ownerDocument, { pointerId: n, clientX: r, clientY: i, timeStamp: a } = e.nativeEvent, o = (e) => {
|
|
224
|
+
if (e.pointerId !== n || (Z.current?.(), !(Math.abs(e.clientX - r) <= 4 && Math.abs(e.clientY - i) <= 4 && e.timeStamp - a <= 500))) return;
|
|
225
|
+
let t = _.getHyperlink();
|
|
226
|
+
t && Q(t);
|
|
227
|
+
}, s = (e) => {
|
|
228
|
+
e.pointerId === n && Z.current?.();
|
|
229
|
+
};
|
|
230
|
+
t.addEventListener("pointerup", o), t.addEventListener("pointercancel", s), Z.current = () => {
|
|
231
|
+
Z.current = null, t.removeEventListener("pointerup", o), t.removeEventListener("pointercancel", s);
|
|
232
|
+
};
|
|
233
|
+
} : void 0,
|
|
234
|
+
onPointerEnter: Y ? () => {
|
|
235
|
+
X(_);
|
|
236
|
+
} : void 0,
|
|
237
|
+
onPointerLeave: Y ? () => {
|
|
238
|
+
X((e) => e === _ ? null : e);
|
|
239
|
+
} : void 0,
|
|
240
|
+
onKeyDownCapture: (e) => {
|
|
241
|
+
ge?.(e);
|
|
242
|
+
},
|
|
243
|
+
ref: Me,
|
|
244
|
+
children: [
|
|
245
|
+
G && q ? p("svg", {
|
|
246
|
+
className: "sxl-picture-fill",
|
|
247
|
+
viewBox: `0 0 ${L} ${R}`,
|
|
248
|
+
preserveAspectRatio: "none",
|
|
249
|
+
overflow: "visible",
|
|
250
|
+
style: x,
|
|
251
|
+
children: p(a, {
|
|
252
|
+
geometry: G,
|
|
253
|
+
style: {
|
|
254
|
+
...q,
|
|
255
|
+
stroke: null,
|
|
256
|
+
strokeGradient: void 0,
|
|
257
|
+
strokeWidth: 0
|
|
258
|
+
},
|
|
259
|
+
zoom: S,
|
|
260
|
+
grid: je,
|
|
261
|
+
hit: $
|
|
262
|
+
})
|
|
263
|
+
}) : null,
|
|
264
|
+
J ? p("svg", {
|
|
265
|
+
width: 0,
|
|
266
|
+
height: 0,
|
|
267
|
+
style: { position: "absolute" },
|
|
268
|
+
"aria-hidden": !0,
|
|
269
|
+
children: p("defs", { children: p("clipPath", {
|
|
270
|
+
id: Oe,
|
|
271
|
+
clipPathUnits: "objectBoundingBox",
|
|
272
|
+
children: p("path", {
|
|
273
|
+
d: J,
|
|
274
|
+
transform: `scale(${1 / L} ${1 / R})`
|
|
275
|
+
})
|
|
276
|
+
}) })
|
|
277
|
+
}) : null,
|
|
278
|
+
p("div", {
|
|
279
|
+
className: "sxl-picture-clip",
|
|
280
|
+
style: {
|
|
281
|
+
position: "absolute",
|
|
282
|
+
...b,
|
|
283
|
+
clipPath: J ? `url(#${Oe})` : void 0,
|
|
284
|
+
pointerEvents: g?.pointerEvents ?? "auto",
|
|
285
|
+
cursor: Y && !v?.isSelected() ? "pointer" : void 0
|
|
286
|
+
},
|
|
287
|
+
children: ne("div", {
|
|
288
|
+
className: "sxl-picture-image",
|
|
289
|
+
style: {
|
|
290
|
+
position: "absolute",
|
|
291
|
+
left: `${Le}%`,
|
|
292
|
+
top: `${Re}%`,
|
|
293
|
+
right: `${ze}%`,
|
|
294
|
+
bottom: `${Be}%`,
|
|
295
|
+
overflow: "hidden"
|
|
296
|
+
},
|
|
297
|
+
children: [k || D ? void 0 : ye, Fe]
|
|
298
|
+
})
|
|
299
|
+
}),
|
|
300
|
+
G && q && q.strokeWidth > 0 ? p("svg", {
|
|
301
|
+
className: "sxl-picture-border",
|
|
302
|
+
viewBox: `0 0 ${L} ${R}`,
|
|
303
|
+
preserveAspectRatio: "none",
|
|
304
|
+
overflow: "visible",
|
|
305
|
+
style: x,
|
|
306
|
+
children: p(a, {
|
|
307
|
+
geometry: G,
|
|
308
|
+
style: {
|
|
309
|
+
...q,
|
|
310
|
+
fill: null,
|
|
311
|
+
gradient: void 0,
|
|
312
|
+
image: void 0
|
|
313
|
+
},
|
|
314
|
+
zoom: S,
|
|
315
|
+
grid: je,
|
|
316
|
+
hit: $
|
|
317
|
+
})
|
|
318
|
+
}) : null
|
|
319
|
+
]
|
|
320
|
+
});
|
|
321
|
+
}));
|
|
322
|
+
S.displayName = "PictureEditor";
|
|
323
|
+
export { _ as i, v as n, g as r, S as t };
|