@excalidraw/excalidraw 0.18.0-817d8c5 → 0.18.0-8608d7b
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/CHANGELOG.md +11 -11
- package/dist/dev/chunk-CP5DND7P.js +7 -0
- package/dist/dev/chunk-CP5DND7P.js.map +7 -0
- package/dist/dev/chunk-FB2NA5UG.js +4132 -0
- package/dist/dev/chunk-FB2NA5UG.js.map +7 -0
- package/dist/dev/{chunk-LMHBUWQS.js → chunk-PWQMCSHA.js} +27 -8
- package/dist/dev/chunk-PWQMCSHA.js.map +7 -0
- package/dist/dev/chunk-YMRX7R7U.js +5671 -0
- package/dist/dev/chunk-YMRX7R7U.js.map +7 -0
- package/dist/dev/data/{image-V26YBSDB.js → image-L23D26XS.js} +3 -3
- package/dist/dev/index.css +3945 -3493
- package/dist/dev/index.css.map +3 -3
- package/dist/dev/index.js +33090 -24527
- package/dist/dev/index.js.map +4 -4
- package/dist/dev/locales/{en-OZCJJ2HN.js → en-V3NQTBPG.js} +2 -2
- package/dist/dev/subset-shared.chunk.js +2 -2
- package/dist/dev/subset-worker.chunk.js +2 -2
- package/dist/prod/chunk-A66AFZZU.js +7 -0
- package/dist/prod/chunk-GF46JCB3.js +12 -0
- package/dist/prod/chunk-HT4FKTIQ.js +4 -0
- package/dist/prod/chunk-LS7FJGPW.js +86 -0
- package/dist/prod/data/image-NWF7UX55.js +1 -0
- package/dist/prod/index.css +1 -1
- package/dist/prod/index.js +27 -16
- package/dist/prod/locales/{en-B4ZKOASM.js → en-LQE6K457.js} +1 -1
- package/dist/prod/subset-shared.chunk.js +1 -1
- package/dist/prod/subset-worker.chunk.js +1 -1
- package/dist/types/{excalidraw/binaryheap.d.ts → common/src/binary-heap.d.ts} +1 -1
- package/dist/types/{excalidraw → common/src}/colors.d.ts +1 -0
- package/dist/types/{excalidraw → common/src}/constants.d.ts +52 -12
- package/dist/types/{excalidraw → common/src}/emitter.d.ts +1 -1
- package/dist/types/{excalidraw/fonts/FontMetadata.d.ts → common/src/font-metadata.d.ts} +15 -5
- package/dist/types/common/src/index.d.ts +12 -0
- package/dist/types/{excalidraw → common/src}/points.d.ts +2 -0
- package/dist/types/common/src/promise-pool.d.ts +6 -0
- package/dist/types/{excalidraw → common/src}/utility-types.d.ts +5 -0
- package/dist/types/{excalidraw → common/src}/utils.d.ts +25 -11
- package/dist/types/{excalidraw/scene → element/src}/Scene.d.ts +19 -18
- package/dist/types/element/src/align.d.ts +8 -0
- package/dist/types/{excalidraw/element → element/src}/binding.d.ts +30 -19
- package/dist/types/{excalidraw/element → element/src}/bounds.d.ts +20 -7
- package/dist/types/element/src/collision.d.ts +32 -0
- package/dist/types/{excalidraw/scene → element/src}/comparisons.d.ts +1 -1
- package/dist/types/{excalidraw/element → element/src}/cropElement.d.ts +1 -1
- package/dist/types/{excalidraw/change.d.ts → element/src/delta.d.ts} +78 -41
- package/dist/types/element/src/distance.d.ts +3 -0
- package/dist/types/{excalidraw → element/src}/distribute.d.ts +3 -2
- package/dist/types/{excalidraw/element → element/src}/dragElements.d.ts +5 -4
- package/dist/types/element/src/duplicate.d.ts +63 -0
- package/dist/types/{excalidraw/element → element/src}/elbowArrow.d.ts +1 -1
- package/dist/types/{excalidraw/element → element/src}/elementLink.d.ts +1 -1
- package/dist/types/element/src/embeddable.d.ts +10 -0
- package/dist/types/{excalidraw/element → element/src}/flowchart.d.ts +4 -3
- package/dist/types/{excalidraw → element/src}/fractionalIndex.d.ts +12 -3
- package/dist/types/{excalidraw → element/src}/frame.d.ts +8 -7
- package/dist/types/{excalidraw → element/src}/groups.d.ts +6 -5
- package/dist/types/{excalidraw/element → element/src}/heading.d.ts +1 -2
- package/dist/types/{excalidraw/element → element/src}/image.d.ts +2 -2
- package/dist/types/element/src/index.d.ts +58 -0
- package/dist/types/{excalidraw/element → element/src}/linearElementEditor.d.ts +24 -37
- package/dist/types/element/src/mutateElement.d.ts +21 -0
- package/dist/types/{excalidraw/element → element/src}/newElement.d.ts +4 -43
- package/dist/types/element/src/positionElementsOnGrid.d.ts +2 -0
- package/dist/types/{excalidraw/renderer → element/src}/renderElement.d.ts +6 -3
- package/dist/types/{excalidraw/element → element/src}/resizeElements.d.ts +7 -6
- package/dist/types/{excalidraw/element → element/src}/resizeTest.d.ts +4 -4
- package/dist/types/{excalidraw/scene → element/src}/selection.d.ts +13 -7
- package/dist/types/element/src/shape.d.ts +42 -0
- package/dist/types/{excalidraw/element → element/src}/showSelectedShapeActions.d.ts +1 -1
- package/dist/types/{excalidraw/element → element/src}/sizeHelpers.d.ts +3 -3
- package/dist/types/element/src/store.d.ts +237 -0
- package/dist/types/{excalidraw/element → element/src}/textElement.d.ts +8 -7
- package/dist/types/{excalidraw/element → element/src}/transformHandles.d.ts +7 -7
- package/dist/types/{excalidraw/element → element/src}/typeChecks.d.ts +21 -3
- package/dist/types/{excalidraw/element → element/src}/types.d.ts +17 -4
- package/dist/types/element/src/utils.d.ts +31 -0
- package/dist/types/{excalidraw → element/src}/zindex.d.ts +5 -4
- package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +115 -109
- package/dist/types/excalidraw/actions/actionAlign.d.ts +7 -7
- package/dist/types/excalidraw/actions/actionBoundText.d.ts +82 -78
- package/dist/types/excalidraw/actions/actionCanvas.d.ts +705 -502
- package/dist/types/excalidraw/actions/actionClipboard.d.ts +242 -228
- package/dist/types/excalidraw/actions/actionCropEditor.d.ts +40 -38
- package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +120 -113
- package/dist/types/excalidraw/actions/actionDistribute.d.ts +3 -3
- package/dist/types/excalidraw/actions/actionDuplicateSelection.d.ts +3 -7
- package/dist/types/excalidraw/actions/actionElementLink.d.ts +43 -41
- package/dist/types/excalidraw/actions/actionElementLock.d.ts +94 -92
- package/dist/types/excalidraw/{element/embeddable.d.ts → actions/actionEmbeddable.d.ts} +40 -48
- package/dist/types/excalidraw/actions/actionExport.d.ts +405 -387
- package/dist/types/excalidraw/actions/actionFinalize.d.ts +112 -67
- package/dist/types/excalidraw/actions/actionFlip.d.ts +3 -3
- package/dist/types/excalidraw/actions/actionFrame.d.ts +276 -268
- package/dist/types/excalidraw/actions/actionGroup.d.ts +79 -75
- package/dist/types/excalidraw/actions/actionHistory.d.ts +2 -3
- package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +568 -42
- package/dist/types/excalidraw/actions/actionLink.d.ts +41 -39
- package/dist/types/excalidraw/actions/actionMenu.d.ts +116 -110
- package/dist/types/excalidraw/actions/actionNavigate.d.ts +77 -73
- package/dist/types/excalidraw/actions/actionProperties.d.ts +571 -524
- package/dist/types/excalidraw/actions/actionSelectAll.d.ts +41 -39
- package/dist/types/excalidraw/actions/actionStyles.d.ts +42 -40
- package/dist/types/excalidraw/actions/actionTextAutoResize.d.ts +3 -3
- package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +40 -38
- package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +40 -38
- package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +39 -209
- package/dist/types/excalidraw/actions/actionToggleShapeSwitch.d.ts +19 -0
- package/dist/types/excalidraw/actions/actionToggleStats.d.ts +39 -38
- package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +40 -39
- package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +40 -39
- package/dist/types/excalidraw/actions/actionZindex.d.ts +8 -8
- package/dist/types/excalidraw/actions/index.d.ts +2 -1
- package/dist/types/excalidraw/actions/manager.d.ts +2 -2
- package/dist/types/excalidraw/actions/shortcuts.d.ts +1 -1
- package/dist/types/excalidraw/actions/types.d.ts +6 -5
- package/dist/types/excalidraw/animated-trail.d.ts +7 -1
- package/dist/types/excalidraw/appState.d.ts +42 -28
- package/dist/types/excalidraw/charts.d.ts +1 -1
- package/dist/types/excalidraw/clipboard.d.ts +71 -8
- package/dist/types/excalidraw/components/Actions.d.ts +19 -9
- package/dist/types/excalidraw/components/App.d.ts +58 -34
- package/dist/types/excalidraw/components/Avatar.d.ts +1 -1
- package/dist/types/excalidraw/components/ButtonIcon.d.ts +2 -1
- package/dist/types/excalidraw/components/ColorPicker/ColorInput.d.ts +2 -1
- package/dist/types/excalidraw/components/ColorPicker/ColorPicker.d.ts +10 -5
- package/dist/types/excalidraw/components/ColorPicker/CustomColorList.d.ts +1 -1
- package/dist/types/excalidraw/components/ColorPicker/HotkeyLabel.d.ts +1 -2
- package/dist/types/excalidraw/components/ColorPicker/Picker.d.ts +6 -5
- package/dist/types/excalidraw/components/ColorPicker/PickerColorList.d.ts +4 -4
- package/dist/types/excalidraw/components/ColorPicker/ShadeList.d.ts +4 -3
- package/dist/types/excalidraw/components/ColorPicker/TopPicks.d.ts +1 -1
- package/dist/types/excalidraw/components/ColorPicker/colorPickerUtils.d.ts +4 -4
- package/dist/types/excalidraw/components/ColorPicker/keyboardNavHandlers.d.ts +2 -2
- package/dist/types/excalidraw/components/CommandPalette/CommandPalette.d.ts +2 -1
- package/dist/types/excalidraw/components/ConfirmDialog.d.ts +1 -1
- package/dist/types/excalidraw/components/ContextMenu.d.ts +2 -2
- package/dist/types/excalidraw/components/ConvertElementTypePopup.d.ts +23 -0
- package/dist/types/excalidraw/components/DarkModeToggle.d.ts +1 -1
- package/dist/types/excalidraw/components/DefaultSidebar.d.ts +2 -2
- package/dist/types/excalidraw/components/DialogActionButton.d.ts +1 -1
- package/dist/types/excalidraw/{element → components}/ElementCanvasButtons.d.ts +1 -1
- package/dist/types/excalidraw/components/ElementLinkDialog.d.ts +5 -4
- package/dist/types/excalidraw/components/Ellipsify.d.ts +4 -0
- package/dist/types/excalidraw/components/ExcalidrawLogo.d.ts +1 -1
- package/dist/types/excalidraw/components/EyeDropper.d.ts +1 -1
- package/dist/types/excalidraw/components/FixedSideContainer.d.ts +1 -1
- package/dist/types/excalidraw/components/FollowMode/FollowMode.d.ts +1 -1
- package/dist/types/excalidraw/components/FontPicker/FontPicker.d.ts +3 -2
- package/dist/types/excalidraw/components/FontPicker/FontPickerList.d.ts +3 -3
- package/dist/types/excalidraw/components/FontPicker/FontPickerTrigger.d.ts +4 -2
- package/dist/types/excalidraw/components/FontPicker/keyboardNavHandlers.d.ts +1 -1
- package/dist/types/excalidraw/components/HintViewer.d.ts +1 -1
- package/dist/types/excalidraw/components/IconPicker.d.ts +1 -1
- package/dist/types/excalidraw/components/ImageExportDialog.d.ts +2 -2
- package/dist/types/excalidraw/components/InitializeApp.d.ts +1 -1
- package/dist/types/excalidraw/components/InlineIcon.d.ts +3 -1
- package/dist/types/excalidraw/components/Island.d.ts +1 -1
- package/dist/types/excalidraw/components/JSONExportDialog.d.ts +2 -2
- package/dist/types/excalidraw/components/LayerUI.d.ts +5 -4
- package/dist/types/excalidraw/components/LibraryMenuHeaderContent.d.ts +1 -1
- package/dist/types/excalidraw/components/LibraryMenuItems.d.ts +1 -1
- package/dist/types/excalidraw/components/LibraryMenuSection.d.ts +4 -4
- package/dist/types/excalidraw/components/LibraryUnit.d.ts +2 -2
- package/dist/types/excalidraw/components/LoadingMessage.d.ts +1 -1
- package/dist/types/excalidraw/components/MagicButton.d.ts +1 -1
- package/dist/types/excalidraw/components/MobileMenu.d.ts +5 -7
- package/dist/types/excalidraw/components/MobileToolBar.d.ts +11 -0
- package/dist/types/excalidraw/components/PasteChartDialog.d.ts +1 -1
- package/dist/types/excalidraw/components/PropertiesPopover.d.ts +2 -1
- package/dist/types/excalidraw/components/PublishLibrary.d.ts +1 -1
- package/dist/types/excalidraw/components/{ButtonIconSelect.d.ts → RadioSelection.d.ts} +1 -1
- package/dist/types/excalidraw/components/Range.d.ts +3 -3
- package/dist/types/excalidraw/components/SVGLayer.d.ts +1 -1
- package/dist/types/excalidraw/components/Sidebar/SidebarTrigger.d.ts +1 -1
- package/dist/types/excalidraw/components/Sidebar/common.d.ts +1 -1
- package/dist/types/excalidraw/components/Stack.d.ts +1 -1
- package/dist/types/excalidraw/components/Stats/Angle.d.ts +2 -2
- package/dist/types/excalidraw/components/Stats/CanvasGrid.d.ts +1 -1
- package/dist/types/excalidraw/components/Stats/Collapsible.d.ts +2 -1
- package/dist/types/excalidraw/components/Stats/Dimension.d.ts +2 -2
- package/dist/types/excalidraw/components/Stats/DragInput.d.ts +14 -4
- package/dist/types/excalidraw/components/Stats/FontSize.d.ts +2 -2
- package/dist/types/excalidraw/components/Stats/MultiAngle.d.ts +2 -2
- package/dist/types/excalidraw/components/Stats/MultiDimension.d.ts +3 -3
- package/dist/types/excalidraw/components/Stats/MultiFontSize.d.ts +2 -2
- package/dist/types/excalidraw/components/Stats/MultiPosition.d.ts +2 -2
- package/dist/types/excalidraw/components/Stats/Position.d.ts +2 -2
- package/dist/types/excalidraw/components/Stats/index.d.ts +2 -2
- package/dist/types/excalidraw/components/Stats/utils.d.ts +4 -11
- package/dist/types/excalidraw/components/TTDDialog/TTDDialogTrigger.d.ts +1 -2
- package/dist/types/excalidraw/components/TTDDialog/common.d.ts +1 -1
- package/dist/types/excalidraw/components/TextField.d.ts +2 -1
- package/dist/types/excalidraw/components/Toast.d.ts +1 -1
- package/dist/types/excalidraw/components/ToolButton.d.ts +2 -2
- package/dist/types/excalidraw/components/ToolPopover.d.ts +25 -0
- package/dist/types/excalidraw/components/Tooltip.d.ts +1 -1
- package/dist/types/excalidraw/components/UnlockPopup.d.ts +8 -0
- package/dist/types/excalidraw/components/UserList.d.ts +1 -1
- package/dist/types/excalidraw/components/canvases/InteractiveCanvas.d.ts +4 -3
- package/dist/types/excalidraw/components/canvases/NewElementCanvas.d.ts +2 -2
- package/dist/types/excalidraw/components/canvases/StaticCanvas.d.ts +3 -3
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenu.d.ts +5 -3
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuContent.d.ts +2 -1
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItem.d.ts +2 -2
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemLink.d.ts +1 -1
- package/dist/types/excalidraw/components/hyperlink/Hyperlink.d.ts +5 -4
- package/dist/types/excalidraw/components/hyperlink/helpers.d.ts +3 -2
- package/dist/types/excalidraw/components/icons.d.ts +10 -1
- package/dist/types/excalidraw/components/main-menu/DefaultItems.d.ts +1 -1
- package/dist/types/excalidraw/components/main-menu/MainMenu.d.ts +4 -1
- package/dist/types/excalidraw/components/shapes.d.ts +190 -0
- package/dist/types/excalidraw/context/tunnels.d.ts +1 -1
- package/dist/types/excalidraw/data/EditorLocalStorage.d.ts +1 -1
- package/dist/types/excalidraw/data/blob.d.ts +7 -11
- package/dist/types/excalidraw/data/filesystem.d.ts +2 -2
- package/dist/types/excalidraw/data/index.d.ts +2 -2
- package/dist/types/excalidraw/data/json.d.ts +1 -1
- package/dist/types/excalidraw/data/library.d.ts +3 -3
- package/dist/types/excalidraw/data/reconcile.d.ts +3 -2
- package/dist/types/excalidraw/data/resave.d.ts +1 -1
- package/dist/types/excalidraw/data/restore.d.ts +6 -1
- package/dist/types/excalidraw/data/transform.d.ts +4 -4
- package/dist/types/excalidraw/data/types.d.ts +6 -3
- package/dist/types/excalidraw/editor-jotai.d.ts +6 -6
- package/dist/types/excalidraw/eraser/index.d.ts +12 -0
- package/dist/types/excalidraw/errors.d.ts +0 -3
- package/dist/types/excalidraw/fonts/Fonts.d.ts +3 -13
- package/dist/types/excalidraw/history.d.ts +31 -23
- package/dist/types/excalidraw/hooks/useEmitter.d.ts +1 -1
- package/dist/types/excalidraw/hooks/useLibraryItemSvg.d.ts +1 -1
- package/dist/types/excalidraw/hooks/useTextEditorFocus.d.ts +14 -0
- package/dist/types/excalidraw/i18n.d.ts +1 -1
- package/dist/types/excalidraw/index.d.ts +18 -16
- package/dist/types/excalidraw/laser-trails.d.ts +1 -1
- package/dist/types/excalidraw/lasso/index.d.ts +16 -0
- package/dist/types/excalidraw/lasso/utils.d.ts +13 -0
- package/dist/types/excalidraw/renderer/helpers.d.ts +8 -3
- package/dist/types/excalidraw/renderer/staticScene.d.ts +4 -1
- package/dist/types/excalidraw/renderer/staticSvgScene.d.ts +2 -2
- package/dist/types/excalidraw/scene/Renderer.d.ts +3 -4
- package/dist/types/excalidraw/scene/export.d.ts +1 -1
- package/dist/types/excalidraw/scene/index.d.ts +2 -2
- package/dist/types/excalidraw/scene/scroll.d.ts +1 -1
- package/dist/types/excalidraw/scene/scrollbars.d.ts +2 -3
- package/dist/types/excalidraw/scene/types.d.ts +6 -4
- package/dist/types/excalidraw/snapping.d.ts +5 -6
- package/dist/types/excalidraw/types.d.ts +55 -26
- package/dist/types/excalidraw/{element → wysiwyg}/textWysiwyg.d.ts +4 -2
- package/dist/types/math/{angle.d.ts → src/angle.d.ts} +2 -0
- package/dist/types/math/src/constants.d.ts +3 -0
- package/dist/types/math/src/curve.d.ts +74 -0
- package/dist/types/math/{index.d.ts → src/index.d.ts} +1 -0
- package/dist/types/math/{point.d.ts → src/point.d.ts} +3 -3
- package/dist/types/math/{polygon.d.ts → src/polygon.d.ts} +1 -0
- package/dist/types/math/{rectangle.d.ts → src/rectangle.d.ts} +2 -0
- package/dist/types/math/{segment.d.ts → src/segment.d.ts} +2 -1
- package/dist/types/math/{types.d.ts → src/types.d.ts} +1 -0
- package/dist/types/math/{vector.d.ts → src/vector.d.ts} +8 -2
- package/dist/types/utils/{bbox.d.ts → src/bbox.d.ts} +1 -1
- package/dist/types/utils/{export.d.ts → src/export.d.ts} +2 -2
- package/dist/types/utils/{index.d.ts → src/index.d.ts} +1 -1
- package/dist/types/utils/{geometry → src}/shape.d.ts +2 -15
- package/dist/types/utils/{withinBounds.d.ts → src/withinBounds.d.ts} +2 -2
- package/history.ts +148 -109
- package/package.json +26 -11
- package/dist/dev/chunk-3SN6HYVK.js +0 -25695
- package/dist/dev/chunk-3SN6HYVK.js.map +0 -7
- package/dist/dev/chunk-53KHN5WM.js +0 -7
- package/dist/dev/chunk-53KHN5WM.js.map +0 -7
- package/dist/dev/chunk-LMHBUWQS.js.map +0 -7
- package/dist/dev/chunk-OKSO7T74.js +0 -4132
- package/dist/dev/chunk-OKSO7T74.js.map +0 -7
- package/dist/prod/chunk-36CXSE6H.js +0 -34
- package/dist/prod/chunk-6U3AYISY.js +0 -12
- package/dist/prod/chunk-EIO257PC.js +0 -86
- package/dist/prod/chunk-G5N3DNGT.js +0 -7
- package/dist/prod/data/image-N4WCURRR.js +0 -1
- package/dist/types/excalidraw/align.d.ts +0 -7
- package/dist/types/excalidraw/components/ButtonSelect.d.ts +0 -9
- package/dist/types/excalidraw/element/collision.d.ts +0 -26
- package/dist/types/excalidraw/element/distance.d.ts +0 -3
- package/dist/types/excalidraw/element/index.d.ts +0 -26
- package/dist/types/excalidraw/element/mutateElement.d.ts +0 -13
- package/dist/types/excalidraw/element/utils.d.ts +0 -21
- package/dist/types/excalidraw/scene/Shape.d.ts +0 -17
- package/dist/types/excalidraw/scene/ShapeCache.d.ts +0 -25
- package/dist/types/excalidraw/shapes.d.ts +0 -85
- package/dist/types/excalidraw/store.d.ts +0 -129
- package/dist/types/excalidraw/visualdebug.d.ts +0 -41
- package/dist/types/math/curve.d.ts +0 -40
- package/dist/types/utils/collision.d.ts +0 -9
- /package/dist/dev/data/{image-V26YBSDB.js.map → image-L23D26XS.js.map} +0 -0
- /package/dist/dev/locales/{en-OZCJJ2HN.js.map → en-V3NQTBPG.js.map} +0 -0
- /package/dist/types/{excalidraw → common/src}/keys.d.ts +0 -0
- /package/dist/types/{excalidraw → common/src}/queue.d.ts +0 -0
- /package/dist/types/{excalidraw → common/src}/random.d.ts +0 -0
- /package/dist/types/{excalidraw/data → common/src}/url.d.ts +0 -0
- /package/dist/types/{excalidraw/element → element/src}/containerCache.d.ts +0 -0
- /package/dist/types/{excalidraw/element → element/src}/sortElements.d.ts +0 -0
- /package/dist/types/{excalidraw/element → element/src}/textMeasurements.d.ts +0 -0
- /package/dist/types/{excalidraw/element → element/src}/textWrapping.d.ts +0 -0
- /package/dist/types/math/{ellipse.d.ts → src/ellipse.d.ts} +0 -0
- /package/dist/types/math/{line.d.ts → src/line.d.ts} +0 -0
- /package/dist/types/math/{range.d.ts → src/range.d.ts} +0 -0
- /package/dist/types/math/{triangle.d.ts → src/triangle.d.ts} +0 -0
- /package/dist/types/math/{utils.d.ts → src/utils.d.ts} +0 -0
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { ExcalidrawElement, NonDeletedExcalidrawElement, NonDeleted, ElementsMapOrArray } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* @deprecated unsafe, use hashElementsVersion instead
|
|
4
|
+
*/
|
|
5
|
+
export declare const getSceneVersion: (elements: readonly ExcalidrawElement[]) => number;
|
|
6
|
+
/**
|
|
7
|
+
* Hashes elements' versionNonce (using djb2 algo). Order of elements matters.
|
|
8
|
+
*/
|
|
9
|
+
export declare const hashElementsVersion: (elements: ElementsMapOrArray) => number;
|
|
10
|
+
export declare const hashString: (s: string) => number;
|
|
11
|
+
export declare const getVisibleElements: (elements: readonly ExcalidrawElement[]) => readonly NonDeletedExcalidrawElement[];
|
|
12
|
+
export declare const getNonDeletedElements: <T extends ExcalidrawElement>(elements: readonly T[]) => readonly NonDeleted<T>[];
|
|
13
|
+
export declare const isNonDeletedElement: <T extends ExcalidrawElement>(element: T) => element is NonDeleted<T>;
|
|
14
|
+
export declare const clearElementsForDatabase: (elements: readonly ExcalidrawElement[]) => ExcalidrawElement[];
|
|
15
|
+
export declare const clearElementsForExport: (elements: readonly ExcalidrawElement[]) => ExcalidrawElement[];
|
|
16
|
+
export declare const clearElementsForLocalStorage: (elements: readonly ExcalidrawElement[]) => ExcalidrawElement[];
|
|
17
|
+
export * from "./align";
|
|
18
|
+
export * from "./binding";
|
|
19
|
+
export * from "./bounds";
|
|
20
|
+
export * from "./collision";
|
|
21
|
+
export * from "./comparisons";
|
|
22
|
+
export * from "./containerCache";
|
|
23
|
+
export * from "./cropElement";
|
|
24
|
+
export * from "./delta";
|
|
25
|
+
export * from "./distance";
|
|
26
|
+
export * from "./distribute";
|
|
27
|
+
export * from "./dragElements";
|
|
28
|
+
export * from "./duplicate";
|
|
29
|
+
export * from "./elbowArrow";
|
|
30
|
+
export * from "./elementLink";
|
|
31
|
+
export * from "./embeddable";
|
|
32
|
+
export * from "./flowchart";
|
|
33
|
+
export * from "./fractionalIndex";
|
|
34
|
+
export * from "./frame";
|
|
35
|
+
export * from "./groups";
|
|
36
|
+
export * from "./heading";
|
|
37
|
+
export * from "./image";
|
|
38
|
+
export * from "./linearElementEditor";
|
|
39
|
+
export * from "./mutateElement";
|
|
40
|
+
export * from "./newElement";
|
|
41
|
+
export * from "./positionElementsOnGrid";
|
|
42
|
+
export * from "./renderElement";
|
|
43
|
+
export * from "./resizeElements";
|
|
44
|
+
export * from "./resizeTest";
|
|
45
|
+
export * from "./Scene";
|
|
46
|
+
export * from "./selection";
|
|
47
|
+
export * from "./shape";
|
|
48
|
+
export * from "./showSelectedShapeActions";
|
|
49
|
+
export * from "./sizeHelpers";
|
|
50
|
+
export * from "./sortElements";
|
|
51
|
+
export * from "./store";
|
|
52
|
+
export * from "./textElement";
|
|
53
|
+
export * from "./textMeasurements";
|
|
54
|
+
export * from "./textWrapping";
|
|
55
|
+
export * from "./transformHandles";
|
|
56
|
+
export * from "./typeChecks";
|
|
57
|
+
export * from "./utils";
|
|
58
|
+
export * from "./zindex";
|
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type { NonDeleted, ExcalidrawLinearElement, ExcalidrawElement, PointBinding, ExcalidrawBindableElement, ExcalidrawTextElementWithContainer, ElementsMap, NonDeletedSceneElementsMap, SceneElementsMap, ExcalidrawElbowArrowElement } from "./types";
|
|
3
|
-
import type { Bounds } from "./bounds";
|
|
4
|
-
import type { AppState, PointerCoords, InteractiveCanvasAppState, AppClassProperties, NullableGridSize, Zoom } from "../types";
|
|
5
|
-
import type { Store } from "../store";
|
|
6
|
-
import type Scene from "../scene/Scene";
|
|
7
2
|
import { type GlobalPoint, type LocalPoint } from "@excalidraw/math";
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
};
|
|
3
|
+
import { type Store } from "@excalidraw/element";
|
|
4
|
+
import type { AppState, PointerCoords, InteractiveCanvasAppState, AppClassProperties, NullableGridSize, Zoom } from "@excalidraw/excalidraw/types";
|
|
5
|
+
import type { Scene } from "./Scene";
|
|
6
|
+
import type { Bounds } from "./bounds";
|
|
7
|
+
import type { NonDeleted, ExcalidrawLinearElement, ExcalidrawElement, PointBinding, ExcalidrawBindableElement, ExcalidrawTextElementWithContainer, ElementsMap, NonDeletedSceneElementsMap, ExcalidrawElbowArrowElement, PointsPositionUpdates } from "./types";
|
|
13
8
|
export declare class LinearElementEditor {
|
|
14
9
|
readonly elementId: ExcalidrawElement["id"] & {
|
|
15
10
|
_brand: "excalidrawLinearElementId";
|
|
@@ -43,7 +38,9 @@ export declare class LinearElementEditor {
|
|
|
43
38
|
readonly hoverPointIndex: number;
|
|
44
39
|
readonly segmentMidPointHoveredCoords: GlobalPoint | null;
|
|
45
40
|
readonly elbowed: boolean;
|
|
46
|
-
|
|
41
|
+
readonly customLineAngle: number | null;
|
|
42
|
+
readonly isEditing: boolean;
|
|
43
|
+
constructor(element: NonDeleted<ExcalidrawLinearElement>, elementsMap: ElementsMap, isEditing?: boolean);
|
|
47
44
|
static POINT_HANDLE_SIZE: number;
|
|
48
45
|
/**
|
|
49
46
|
* @param id the `elementId` from the instance of this class (so that we can
|
|
@@ -54,19 +51,15 @@ export declare class LinearElementEditor {
|
|
|
54
51
|
/**
|
|
55
52
|
* @returns whether point was dragged
|
|
56
53
|
*/
|
|
57
|
-
static handlePointDragging(event: PointerEvent, app: AppClassProperties, scenePointerX: number, scenePointerY: number,
|
|
58
|
-
x: number;
|
|
59
|
-
y: number;
|
|
60
|
-
}[]) => void, linearElementEditor: LinearElementEditor, scene: Scene): boolean;
|
|
54
|
+
static handlePointDragging(event: PointerEvent, app: AppClassProperties, scenePointerX: number, scenePointerY: number, linearElementEditor: LinearElementEditor): Pick<AppState, keyof AppState> | null;
|
|
61
55
|
static handlePointerUp(event: PointerEvent, editingLinearElement: LinearElementEditor, appState: AppState, scene: Scene): LinearElementEditor;
|
|
62
|
-
static getEditorMidPoints: (element: NonDeleted<ExcalidrawLinearElement>, elementsMap: ElementsMap, appState: InteractiveCanvasAppState) => (
|
|
63
|
-
static updateEditorMidPointsCache: (element: NonDeleted<ExcalidrawLinearElement>, elementsMap: ElementsMap, appState: InteractiveCanvasAppState) => void;
|
|
56
|
+
static getEditorMidPoints: (element: NonDeleted<ExcalidrawLinearElement>, elementsMap: ElementsMap, appState: InteractiveCanvasAppState) => (GlobalPoint | null)[];
|
|
64
57
|
static getSegmentMidpointHitCoords: (linearElementEditor: LinearElementEditor, scenePointer: {
|
|
65
58
|
x: number;
|
|
66
59
|
y: number;
|
|
67
60
|
}, appState: AppState, elementsMap: ElementsMap) => GlobalPoint | null;
|
|
68
61
|
static isSegmentTooShort<P extends GlobalPoint | LocalPoint>(element: NonDeleted<ExcalidrawLinearElement>, startPoint: P, endPoint: P, index: number, zoom: Zoom): boolean;
|
|
69
|
-
static getSegmentMidPoint(element: NonDeleted<ExcalidrawLinearElement>,
|
|
62
|
+
static getSegmentMidPoint(element: NonDeleted<ExcalidrawLinearElement>, index: number): GlobalPoint;
|
|
70
63
|
static getSegmentMidPointIndex(linearElementEditor: LinearElementEditor, appState: AppState, midPoint: GlobalPoint, elementsMap: ElementsMap): number;
|
|
71
64
|
static handlePointerDown(event: React.PointerEvent<HTMLElement>, app: AppClassProperties, store: Store, scenePointer: {
|
|
72
65
|
x: number;
|
|
@@ -77,7 +70,7 @@ export declare class LinearElementEditor {
|
|
|
77
70
|
linearElementEditor: LinearElementEditor | null;
|
|
78
71
|
};
|
|
79
72
|
static arePointsEqual<Point extends LocalPoint | GlobalPoint>(point1: Point | null, point2: Point | null): boolean;
|
|
80
|
-
static handlePointerMove(event: React.PointerEvent<HTMLCanvasElement>, scenePointerX: number, scenePointerY: number, app: AppClassProperties
|
|
73
|
+
static handlePointerMove(event: React.PointerEvent<HTMLCanvasElement>, scenePointerX: number, scenePointerY: number, app: AppClassProperties): LinearElementEditor | null;
|
|
81
74
|
/** scene coords */
|
|
82
75
|
static getPointGlobalCoordinates(element: NonDeleted<ExcalidrawLinearElement>, p: LocalPoint, elementsMap: ElementsMap): GlobalPoint;
|
|
83
76
|
/** scene coords */
|
|
@@ -89,30 +82,25 @@ export declare class LinearElementEditor {
|
|
|
89
82
|
static createPointAt(element: NonDeleted<ExcalidrawLinearElement>, elementsMap: ElementsMap, scenePointerX: number, scenePointerY: number, gridSize: NullableGridSize): LocalPoint;
|
|
90
83
|
/**
|
|
91
84
|
* Normalizes line points so that the start point is at [0,0]. This is
|
|
92
|
-
* expected in various parts of the codebase.
|
|
93
|
-
*
|
|
85
|
+
* expected in various parts of the codebase.
|
|
86
|
+
*
|
|
87
|
+
* Also returns normalized x and y coords to account for the normalization
|
|
88
|
+
* of the points.
|
|
94
89
|
*/
|
|
95
|
-
static
|
|
90
|
+
static getNormalizeElementPointsAndCoords(element: ExcalidrawLinearElement): {
|
|
96
91
|
points: LocalPoint[];
|
|
97
92
|
x: number;
|
|
98
93
|
y: number;
|
|
99
94
|
};
|
|
100
|
-
static
|
|
101
|
-
static
|
|
102
|
-
static
|
|
103
|
-
static
|
|
104
|
-
point: LocalPoint;
|
|
105
|
-
}[]): void;
|
|
106
|
-
static movePoints(element: NonDeleted<ExcalidrawLinearElement>, targetPoints: {
|
|
107
|
-
index: number;
|
|
108
|
-
point: LocalPoint;
|
|
109
|
-
isDragging?: boolean;
|
|
110
|
-
}[], otherUpdates?: {
|
|
95
|
+
static duplicateSelectedPoints(appState: AppState, scene: Scene): AppState;
|
|
96
|
+
static deletePoints(element: NonDeleted<ExcalidrawLinearElement>, app: AppClassProperties, pointIndices: readonly number[]): void;
|
|
97
|
+
static addPoints(element: NonDeleted<ExcalidrawLinearElement>, scene: Scene, addedPoints: LocalPoint[]): void;
|
|
98
|
+
static movePoints(element: NonDeleted<ExcalidrawLinearElement>, scene: Scene, pointUpdates: PointsPositionUpdates, otherUpdates?: {
|
|
111
99
|
startBinding?: PointBinding | null;
|
|
112
100
|
endBinding?: PointBinding | null;
|
|
113
101
|
}): void;
|
|
114
102
|
static shouldAddMidpoint(linearElementEditor: LinearElementEditor, pointerCoords: PointerCoords, appState: AppState, elementsMap: ElementsMap): boolean;
|
|
115
|
-
static addMidpoint(linearElementEditor: LinearElementEditor, pointerCoords: PointerCoords, app: AppClassProperties, snapToGrid: boolean,
|
|
103
|
+
static addMidpoint(linearElementEditor: LinearElementEditor, pointerCoords: PointerCoords, app: AppClassProperties, snapToGrid: boolean, scene: Scene): {
|
|
116
104
|
pointerDownState: LinearElementEditor["pointerDownState"];
|
|
117
105
|
selectedPointsIndices: LinearElementEditor["selectedPointsIndices"];
|
|
118
106
|
} | undefined;
|
|
@@ -124,7 +112,6 @@ export declare class LinearElementEditor {
|
|
|
124
112
|
};
|
|
125
113
|
static getMinMaxXYWithBoundText: (element: ExcalidrawLinearElement, elementsMap: ElementsMap, elementBounds: Bounds, boundTextElement: ExcalidrawTextElementWithContainer) => [number, number, number, number, number, number];
|
|
126
114
|
static getElementAbsoluteCoords: (element: ExcalidrawLinearElement, elementsMap: ElementsMap, includeBoundText?: boolean) => [number, number, number, number, number, number];
|
|
127
|
-
static moveFixedSegment(linearElement: LinearElementEditor, index: number, x: number, y: number,
|
|
128
|
-
static deleteFixedSegment(element: ExcalidrawElbowArrowElement, index: number): void;
|
|
115
|
+
static moveFixedSegment(linearElement: LinearElementEditor, index: number, x: number, y: number, scene: Scene): LinearElementEditor;
|
|
116
|
+
static deleteFixedSegment(element: ExcalidrawElbowArrowElement, scene: Scene, index: number): void;
|
|
129
117
|
}
|
|
130
|
-
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Mutable } from "@excalidraw/common/utility-types";
|
|
2
|
+
import type { ElementsMap, ExcalidrawElement } from "./types";
|
|
3
|
+
export type ElementUpdate<TElement extends ExcalidrawElement> = Omit<Partial<TElement>, "id" | "updated">;
|
|
4
|
+
/**
|
|
5
|
+
* This function tracks updates of text elements for the purposes for collaboration.
|
|
6
|
+
* The version is used to compare updates when more than one user is working in
|
|
7
|
+
* the same drawing.
|
|
8
|
+
*
|
|
9
|
+
* WARNING: this won't trigger the component to update, so if you need to trigger component update,
|
|
10
|
+
* use `scene.mutateElement` or `ExcalidrawImperativeAPI.mutateElement` instead.
|
|
11
|
+
*/
|
|
12
|
+
export declare const mutateElement: <TElement extends Mutable<ExcalidrawElement>>(element: TElement, elementsMap: ElementsMap, updates: ElementUpdate<TElement>, options?: {
|
|
13
|
+
isDragging?: boolean;
|
|
14
|
+
}) => TElement;
|
|
15
|
+
export declare const newElementWith: <TElement extends ExcalidrawElement>(element: TElement, updates: ElementUpdate<TElement>, force?: boolean) => TElement;
|
|
16
|
+
/**
|
|
17
|
+
* Mutates element, bumping `version`, `versionNonce`, and `updated`.
|
|
18
|
+
*
|
|
19
|
+
* NOTE: does not trigger re-render.
|
|
20
|
+
*/
|
|
21
|
+
export declare const bumpVersion: <T extends Mutable<ExcalidrawElement>>(element: T, version?: ExcalidrawElement["version"]) => T;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
import type { MarkOptional, Mutable } from "../utility-types";
|
|
1
|
+
import type { MarkOptional } from "@excalidraw/common/utility-types";
|
|
2
|
+
import type { ExcalidrawImageElement, ExcalidrawTextElement, ExcalidrawLinearElement, ExcalidrawGenericElement, NonDeleted, TextAlign, VerticalAlign, Arrowhead, ExcalidrawFreeDrawElement, FontFamilyValues, ExcalidrawTextContainer, ExcalidrawFrameElement, ExcalidrawEmbeddableElement, ExcalidrawMagicFrameElement, ExcalidrawIframeElement, ElementsMap, ExcalidrawArrowElement, ExcalidrawElbowArrowElement, ExcalidrawLineElement } from "./types";
|
|
4
3
|
export type ElementConstructorOpts = MarkOptional<Omit<ExcalidrawGenericElement, "id" | "type" | "isDeleted" | "updated">, "width" | "height" | "angle" | "groupIds" | "frameId" | "index" | "boundElements" | "seed" | "version" | "versionNonce" | "link" | "strokeStyle" | "fillStyle" | "strokeColor" | "backgroundColor" | "roughness" | "strokeWidth" | "roundness" | "locked" | "opacity" | "customData">;
|
|
5
4
|
export declare const newElement: (opts: {
|
|
6
5
|
type: ExcalidrawGenericElement["type"];
|
|
@@ -44,6 +43,7 @@ export declare const newFreeDrawElement: (opts: {
|
|
|
44
43
|
export declare const newLinearElement: (opts: {
|
|
45
44
|
type: ExcalidrawLinearElement["type"];
|
|
46
45
|
points?: ExcalidrawLinearElement["points"];
|
|
46
|
+
polygon?: ExcalidrawLineElement["polygon"];
|
|
47
47
|
} & ElementConstructorOpts) => NonDeleted<ExcalidrawLinearElement>;
|
|
48
48
|
export declare const newArrowElement: <T extends boolean>(opts: {
|
|
49
49
|
type: ExcalidrawArrowElement["type"];
|
|
@@ -51,7 +51,7 @@ export declare const newArrowElement: <T extends boolean>(opts: {
|
|
|
51
51
|
endArrowhead?: Arrowhead | null | undefined;
|
|
52
52
|
points?: readonly import("@excalidraw/math").LocalPoint[] | undefined;
|
|
53
53
|
elbowed?: T | undefined;
|
|
54
|
-
fixedSegments?: FixedSegment[] | null | undefined;
|
|
54
|
+
fixedSegments?: readonly import("./types").FixedSegment[] | null | undefined;
|
|
55
55
|
} & Omit<Omit<ExcalidrawGenericElement, "id" | "isDeleted" | "updated" | "type">, "link" | "strokeColor" | "backgroundColor" | "fillStyle" | "strokeWidth" | "strokeStyle" | "roundness" | "roughness" | "opacity" | "width" | "height" | "angle" | "seed" | "version" | "versionNonce" | "index" | "groupIds" | "frameId" | "boundElements" | "locked" | "customData"> & Partial<Pick<Omit<ExcalidrawGenericElement, "id" | "isDeleted" | "updated" | "type">, "link" | "strokeColor" | "backgroundColor" | "fillStyle" | "strokeWidth" | "strokeStyle" | "roundness" | "roughness" | "opacity" | "width" | "height" | "angle" | "seed" | "version" | "versionNonce" | "index" | "groupIds" | "frameId" | "boundElements" | "locked" | "customData">>) => T extends true ? NonDeleted<ExcalidrawElbowArrowElement> : NonDeleted<ExcalidrawArrowElement>;
|
|
56
56
|
export declare const newImageElement: (opts: {
|
|
57
57
|
type: ExcalidrawImageElement["type"];
|
|
@@ -60,42 +60,3 @@ export declare const newImageElement: (opts: {
|
|
|
60
60
|
scale?: ExcalidrawImageElement["scale"];
|
|
61
61
|
crop?: ExcalidrawImageElement["crop"];
|
|
62
62
|
} & ElementConstructorOpts) => NonDeleted<ExcalidrawImageElement>;
|
|
63
|
-
/**
|
|
64
|
-
* Clones ExcalidrawElement data structure. Does not regenerate id, nonce, or
|
|
65
|
-
* any value. The purpose is to to break object references for immutability
|
|
66
|
-
* reasons, whenever we want to keep the original element, but ensure it's not
|
|
67
|
-
* mutated.
|
|
68
|
-
*
|
|
69
|
-
* Only clones plain objects and arrays. Doesn't clone Date, RegExp, Map, Set,
|
|
70
|
-
* Typed arrays and other non-null objects.
|
|
71
|
-
*/
|
|
72
|
-
export declare const deepCopyElement: <T extends ExcalidrawElement>(val: T) => Mutable<T>;
|
|
73
|
-
/**
|
|
74
|
-
* Duplicate an element, often used in the alt-drag operation.
|
|
75
|
-
* Note that this method has gotten a bit complicated since the
|
|
76
|
-
* introduction of gruoping/ungrouping elements.
|
|
77
|
-
* @param editingGroupId The current group being edited. The new
|
|
78
|
-
* element will inherit this group and its
|
|
79
|
-
* parents.
|
|
80
|
-
* @param groupIdMapForOperation A Map that maps old group IDs to
|
|
81
|
-
* duplicated ones. If you are duplicating
|
|
82
|
-
* multiple elements at once, share this map
|
|
83
|
-
* amongst all of them
|
|
84
|
-
* @param element Element to duplicate
|
|
85
|
-
* @param overrides Any element properties to override
|
|
86
|
-
*/
|
|
87
|
-
export declare const duplicateElement: <TElement extends ExcalidrawElement>(editingGroupId: AppState["editingGroupId"], groupIdMapForOperation: Map<GroupId, GroupId>, element: TElement, overrides?: Partial<TElement> | undefined) => Readonly<TElement>;
|
|
88
|
-
/**
|
|
89
|
-
* Clones elements, regenerating their ids (including bindings) and group ids.
|
|
90
|
-
*
|
|
91
|
-
* If bindings don't exist in the elements array, they are removed. Therefore,
|
|
92
|
-
* it's advised to supply the whole elements array, or sets of elements that
|
|
93
|
-
* are encapsulated (such as library items), if the purpose is to retain
|
|
94
|
-
* bindings to the cloned elements intact.
|
|
95
|
-
*
|
|
96
|
-
* NOTE by default does not randomize or regenerate anything except the id.
|
|
97
|
-
*/
|
|
98
|
-
export declare const duplicateElements: (elements: readonly ExcalidrawElement[], opts?: {
|
|
99
|
-
/** NOTE also updates version flags and `updated` */
|
|
100
|
-
randomizeSeed: boolean;
|
|
101
|
-
}) => ExcalidrawElement[];
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type GlobalPoint } from "@excalidraw/math";
|
|
2
|
+
import type { AppState, StaticCanvasAppState, InteractiveCanvasAppState, ElementsPendingErasure, PendingExcalidrawElements } from "@excalidraw/excalidraw/types";
|
|
3
|
+
import type { StaticCanvasRenderConfig, RenderableElementsMap, InteractiveCanvasRenderConfig } from "@excalidraw/excalidraw/scene/types";
|
|
4
|
+
import type { ExcalidrawElement, ExcalidrawTextElement, NonDeletedExcalidrawElement, ExcalidrawFreeDrawElement, ExcalidrawImageElement, ExcalidrawFrameLikeElement, NonDeletedSceneElementsMap, ElementsMap } from "./types";
|
|
2
5
|
import type { RoughCanvas } from "roughjs/bin/canvas";
|
|
3
|
-
import type { StaticCanvasRenderConfig, RenderableElementsMap, InteractiveCanvasRenderConfig } from "../scene/types";
|
|
4
|
-
import type { AppState, StaticCanvasAppState, InteractiveCanvasAppState, ElementsPendingErasure, PendingExcalidrawElements } from "../types";
|
|
5
6
|
export declare const IMAGE_INVERT_FILTER = "invert(100%) hue-rotate(180deg) saturate(1.25)";
|
|
6
7
|
export declare const getRenderOpacity: (element: ExcalidrawElement, containingFrame: ExcalidrawFrameLikeElement | null, elementsPendingErasure: ElementsPendingErasure, pendingNodes: Readonly<PendingExcalidrawElements> | null, globalAlpha?: number) => number;
|
|
7
8
|
export interface ExcalidrawElementWithCanvas {
|
|
@@ -26,3 +27,5 @@ export declare const pathsCache: WeakMap<ExcalidrawFreeDrawElement, Path2D>;
|
|
|
26
27
|
export declare function generateFreeDrawShape(element: ExcalidrawFreeDrawElement): Path2D;
|
|
27
28
|
export declare function getFreeDrawPath2D(element: ExcalidrawFreeDrawElement): Path2D | undefined;
|
|
28
29
|
export declare function getFreeDrawSvgPath(element: ExcalidrawFreeDrawElement): string;
|
|
30
|
+
export declare function getFreedrawOutlineAsSegments(element: ExcalidrawFreeDrawElement, points: [number, number][], elementsMap: ElementsMap): import("@excalidraw/math").LineSegment<GlobalPoint>[];
|
|
31
|
+
export declare function getFreedrawOutlinePoints(element: ExcalidrawFreeDrawElement): [number, number][];
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type LocalPoint } from "@excalidraw/math";
|
|
2
|
+
import type { PointerDownState } from "@excalidraw/excalidraw/types";
|
|
3
|
+
import type { Scene } from "./Scene";
|
|
2
4
|
import type { BoundingBox } from "./bounds";
|
|
3
5
|
import type { MaybeTransformHandleType, TransformHandleDirection } from "./transformHandles";
|
|
4
|
-
import type {
|
|
5
|
-
|
|
6
|
-
import { type LocalPoint } from "@excalidraw/math";
|
|
7
|
-
export declare const transformElements: (originalElements: PointerDownState["originalElements"], transformHandleType: MaybeTransformHandleType, selectedElements: readonly NonDeletedExcalidrawElement[], elementsMap: SceneElementsMap, scene: Scene, shouldRotateWithDiscreteAngle: boolean, shouldResizeFromCenter: boolean, shouldMaintainAspectRatio: boolean, pointerX: number, pointerY: number, centerX: number, centerY: number) => boolean;
|
|
6
|
+
import type { ExcalidrawLinearElement, ExcalidrawTextElement, NonDeletedExcalidrawElement, NonDeleted, ExcalidrawElement, ElementsMap } from "./types";
|
|
7
|
+
export declare const transformElements: (originalElements: PointerDownState["originalElements"], transformHandleType: MaybeTransformHandleType, selectedElements: readonly NonDeletedExcalidrawElement[], scene: Scene, shouldRotateWithDiscreteAngle: boolean, shouldResizeFromCenter: boolean, shouldMaintainAspectRatio: boolean, pointerX: number, pointerY: number, centerX: number, centerY: number) => boolean;
|
|
8
8
|
export declare const rescalePointsInElement: (element: NonDeletedExcalidrawElement, width: number, height: number, normalizePoints: boolean) => {
|
|
9
9
|
points: LocalPoint[];
|
|
10
10
|
} | {
|
|
@@ -13,9 +13,10 @@ export declare const rescalePointsInElement: (element: NonDeletedExcalidrawEleme
|
|
|
13
13
|
export declare const measureFontSizeFromWidth: (element: NonDeleted<ExcalidrawTextElement>, elementsMap: ElementsMap, nextWidth: number) => {
|
|
14
14
|
size: number;
|
|
15
15
|
} | null;
|
|
16
|
+
export declare const resizeSingleTextElement: (origElement: NonDeleted<ExcalidrawTextElement>, element: NonDeleted<ExcalidrawTextElement>, scene: Scene, transformHandleType: TransformHandleDirection, shouldResizeFromCenter: boolean, nextWidth: number, nextHeight: number) => void;
|
|
16
17
|
export declare const getResizeOffsetXY: (transformHandleType: MaybeTransformHandleType, selectedElements: NonDeletedExcalidrawElement[], elementsMap: ElementsMap, x: number, y: number) => [number, number];
|
|
17
18
|
export declare const getResizeArrowDirection: (transformHandleType: MaybeTransformHandleType, element: NonDeleted<ExcalidrawLinearElement>) => "origin" | "end";
|
|
18
|
-
export declare const resizeSingleElement: (nextWidth: number, nextHeight: number, latestElement: ExcalidrawElement, origElement: ExcalidrawElement,
|
|
19
|
+
export declare const resizeSingleElement: (nextWidth: number, nextHeight: number, latestElement: ExcalidrawElement, origElement: ExcalidrawElement, originalElementsMap: ElementsMap, scene: Scene, handleDirection: TransformHandleDirection, { shouldInformMutation, shouldMaintainAspectRatio, shouldResizeFromCenter, }?: {
|
|
19
20
|
shouldMaintainAspectRatio?: boolean | undefined;
|
|
20
21
|
shouldResizeFromCenter?: boolean | undefined;
|
|
21
22
|
shouldInformMutation?: boolean | undefined;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { ExcalidrawElement, PointerType, NonDeletedExcalidrawElement, ElementsMap } from "./types";
|
|
2
|
-
import type { MaybeTransformHandleType } from "./transformHandles";
|
|
3
|
-
import type { AppState, Device, Zoom } from "../types";
|
|
4
|
-
import type { Bounds } from "./bounds";
|
|
5
1
|
import type { GlobalPoint, LocalPoint } from "@excalidraw/math";
|
|
2
|
+
import type { AppState, Device, Zoom } from "@excalidraw/excalidraw/types";
|
|
3
|
+
import type { Bounds } from "./bounds";
|
|
4
|
+
import type { MaybeTransformHandleType } from "./transformHandles";
|
|
5
|
+
import type { ExcalidrawElement, PointerType, NonDeletedExcalidrawElement, ElementsMap } from "./types";
|
|
6
6
|
export declare const resizeTest: <Point extends GlobalPoint | LocalPoint>(element: NonDeletedExcalidrawElement, elementsMap: ElementsMap, appState: AppState, x: number, y: number, zoom: Zoom, pointerType: PointerType, device: Device) => MaybeTransformHandleType;
|
|
7
7
|
export declare const getElementWithTransformHandleType: (elements: readonly NonDeletedExcalidrawElement[], appState: AppState, scenePointerX: number, scenePointerY: number, zoom: Zoom, pointerType: PointerType, elementsMap: ElementsMap, device: Device) => {
|
|
8
8
|
element: NonDeletedExcalidrawElement;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import
|
|
1
|
+
import type { AppState, InteractiveCanvasAppState } from "@excalidraw/excalidraw/types";
|
|
2
|
+
import { LinearElementEditor } from "./linearElementEditor";
|
|
3
|
+
import type { ElementsMap, ElementsMapOrArray, ExcalidrawElement, NonDeletedExcalidrawElement } from "./types";
|
|
3
4
|
/**
|
|
4
5
|
* Frames and their containing elements are not to be selected at the same time.
|
|
5
6
|
* Given an array of selected elements, if there are frames and their containing elements
|
|
@@ -13,11 +14,6 @@ export declare const isSomeElementSelected: {
|
|
|
13
14
|
(elements: readonly NonDeletedExcalidrawElement[], appState: Pick<AppState, "selectedElementIds">): boolean;
|
|
14
15
|
clearCache(): void;
|
|
15
16
|
};
|
|
16
|
-
/**
|
|
17
|
-
* Returns common attribute (picked by `getAttribute` callback) of selected
|
|
18
|
-
* elements. If elements don't share the same value, returns `null`.
|
|
19
|
-
*/
|
|
20
|
-
export declare const getCommonAttributeOfSelectedElements: <T>(elements: readonly NonDeletedExcalidrawElement[], appState: Pick<AppState, "selectedElementIds">, getAttribute: (element: ExcalidrawElement) => T) => T | null;
|
|
21
17
|
export declare const getSelectedElements: (elements: ElementsMapOrArray, appState: Pick<InteractiveCanvasAppState, "selectedElementIds">, opts?: {
|
|
22
18
|
includeBoundTextElement?: boolean;
|
|
23
19
|
includeElementsInFrames?: boolean;
|
|
@@ -30,3 +26,13 @@ export declare const getTargetElements: (elements: ElementsMapOrArray, appState:
|
|
|
30
26
|
export declare const makeNextSelectedElementIds: (nextSelectedElementIds: AppState["selectedElementIds"], prevState: Pick<AppState, "selectedElementIds">) => Readonly<{
|
|
31
27
|
[id: string]: true;
|
|
32
28
|
}>;
|
|
29
|
+
export declare const getSelectionStateForElements: (targetElements: readonly ExcalidrawElement[], allElements: readonly NonDeletedExcalidrawElement[], appState: AppState) => {
|
|
30
|
+
editingGroupId: string | null;
|
|
31
|
+
selectedElementIds: Readonly<{
|
|
32
|
+
[id: string]: true;
|
|
33
|
+
}>;
|
|
34
|
+
selectedGroupIds: {
|
|
35
|
+
[groupId: string]: boolean;
|
|
36
|
+
};
|
|
37
|
+
selectedLinearElement: LinearElementEditor | null;
|
|
38
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { type GeometricShape } from "@excalidraw/utils/shape";
|
|
2
|
+
import { type LocalPoint } from "@excalidraw/math";
|
|
3
|
+
import type { GlobalPoint } from "@excalidraw/math";
|
|
4
|
+
import type { AppState, EmbedsValidationStatus } from "@excalidraw/excalidraw/types";
|
|
5
|
+
import type { ElementShape, ElementShapes } from "@excalidraw/excalidraw/scene/types";
|
|
6
|
+
import type { ExcalidrawElement, ExcalidrawLinearElement, ExcalidrawFreeDrawElement, ElementsMap, ExcalidrawLineElement } from "./types";
|
|
7
|
+
import type { Drawable, Options } from "roughjs/bin/core";
|
|
8
|
+
export declare class ShapeCache {
|
|
9
|
+
private static rg;
|
|
10
|
+
private static cache;
|
|
11
|
+
/**
|
|
12
|
+
* Retrieves shape from cache if available. Use this only if shape
|
|
13
|
+
* is optional and you have a fallback in case it's not cached.
|
|
14
|
+
*/
|
|
15
|
+
static get: <T extends ExcalidrawElement>(element: T) => T["type"] extends keyof ElementShapes ? ElementShapes[T["type"]] | undefined : ElementShape | undefined;
|
|
16
|
+
static set: <T extends ExcalidrawElement>(element: T, shape: T["type"] extends keyof ElementShapes ? ElementShapes[T["type"]] : Drawable) => WeakMap<ExcalidrawElement, ElementShape>;
|
|
17
|
+
static delete: (element: ExcalidrawElement) => boolean;
|
|
18
|
+
static destroy: () => void;
|
|
19
|
+
/**
|
|
20
|
+
* Generates & caches shape for element if not already cached, otherwise
|
|
21
|
+
* returns cached shape.
|
|
22
|
+
*/
|
|
23
|
+
static generateElementShape: <T extends ExcalidrawLinearElement | import("./types").ExcalidrawRectangleElement | import("./types").ExcalidrawDiamondElement | import("./types").ExcalidrawEllipseElement | import("./types").ExcalidrawEmbeddableElement | import("./types").ExcalidrawIframeElement | import("./types").ExcalidrawImageElement | import("./types").ExcalidrawFrameElement | import("./types").ExcalidrawMagicFrameElement | import("./types").ExcalidrawTextElement | ExcalidrawFreeDrawElement | import("./types").ExcalidrawArrowElement>(element: T, renderConfig: {
|
|
24
|
+
isExporting: boolean;
|
|
25
|
+
canvasBackgroundColor: AppState["viewBackgroundColor"];
|
|
26
|
+
embedsValidationStatus: EmbedsValidationStatus;
|
|
27
|
+
} | null) => ((T["type"] extends keyof ElementShapes ? ElementShapes[T["type"]] | undefined : ElementShape | undefined) & ({} | null)) | (T["type"] extends keyof ElementShapes ? ElementShapes[T["type"]] : Drawable | null);
|
|
28
|
+
}
|
|
29
|
+
export declare const generateRoughOptions: (element: ExcalidrawElement, continuousPath?: boolean) => Options;
|
|
30
|
+
export declare const generateLinearCollisionShape: (element: ExcalidrawLinearElement | ExcalidrawFreeDrawElement) => {
|
|
31
|
+
op: string;
|
|
32
|
+
data: number[];
|
|
33
|
+
}[];
|
|
34
|
+
/**
|
|
35
|
+
* get the pure geometric shape of an excalidraw elementw
|
|
36
|
+
* which is then used for hit detection
|
|
37
|
+
*/
|
|
38
|
+
export declare const getElementShape: <Point extends GlobalPoint | LocalPoint>(element: ExcalidrawElement, elementsMap: ElementsMap) => GeometricShape<Point>;
|
|
39
|
+
export declare const toggleLinePolygonState: (element: ExcalidrawLineElement, nextPolygonState: boolean) => {
|
|
40
|
+
polygon: ExcalidrawLineElement["polygon"];
|
|
41
|
+
points: ExcalidrawLineElement["points"];
|
|
42
|
+
} | null;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
+
import type { UIAppState } from "@excalidraw/excalidraw/types";
|
|
1
2
|
import type { NonDeletedExcalidrawElement } from "./types";
|
|
2
|
-
import type { UIAppState } from "../types";
|
|
3
3
|
export declare const showSelectedShapeActions: (appState: UIAppState, elements: readonly NonDeletedExcalidrawElement[]) => boolean;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import type { AppState, Offsets, Zoom } from "@excalidraw/excalidraw/types";
|
|
1
2
|
import type { ElementsMap, ExcalidrawElement } from "./types";
|
|
2
|
-
|
|
3
|
+
export declare const INVISIBLY_SMALL_ELEMENT_SIZE = 0.1;
|
|
3
4
|
export declare const isInvisiblySmallElement: (element: ExcalidrawElement) => boolean;
|
|
4
5
|
export declare const isElementInViewport: (element: ExcalidrawElement, width: number, height: number, viewTransformations: {
|
|
5
6
|
zoom: Zoom;
|
|
@@ -22,11 +23,10 @@ export declare const getPerfectElementSize: (elementType: AppState["activeTool"]
|
|
|
22
23
|
width: number;
|
|
23
24
|
height: number;
|
|
24
25
|
};
|
|
25
|
-
export declare const getLockedLinearCursorAlignSize: (originX: number, originY: number, x: number, y: number) => {
|
|
26
|
+
export declare const getLockedLinearCursorAlignSize: (originX: number, originY: number, x: number, y: number, customAngle?: number) => {
|
|
26
27
|
width: number;
|
|
27
28
|
height: number;
|
|
28
29
|
};
|
|
29
|
-
export declare const resizePerfectLineForNWHandler: (element: ExcalidrawElement, x: number, y: number) => void;
|
|
30
30
|
export declare const getNormalizedDimensions: (element: Pick<ExcalidrawElement, "width" | "height" | "x" | "y">) => {
|
|
31
31
|
width: ExcalidrawElement["width"];
|
|
32
32
|
height: ExcalidrawElement["height"];
|