@excalidraw/element 0.18.0-042a6979d → 0.18.0-063e025
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/dist/dev/index.js +7295 -4299
- package/dist/dev/index.js.map +4 -4
- package/dist/prod/index.js +20 -19
- package/dist/types/common/debug.d.ts +21 -0
- package/dist/types/common/src/appEventBus.d.ts +27 -0
- package/dist/types/common/src/bounds.d.ts +10 -0
- package/dist/types/common/src/colors.d.ts +59 -39
- package/dist/types/common/src/constants.d.ts +46 -33
- package/dist/types/common/src/editorInterface.d.ts +34 -0
- package/dist/types/common/src/font-metadata.d.ts +1 -3
- package/dist/types/common/src/index.d.ts +5 -0
- package/dist/types/common/src/keys.d.ts +1 -1
- package/dist/types/common/src/utility-types.d.ts +0 -1
- package/dist/types/common/src/utils.d.ts +46 -76
- package/dist/types/common/src/versionedSnapshotStore.d.ts +17 -0
- package/dist/types/element/src/Scene.d.ts +11 -7
- package/dist/types/element/src/align.d.ts +2 -2
- package/dist/types/element/src/arrowheads.d.ts +3 -0
- package/dist/types/element/src/arrows/focus.d.ts +27 -0
- package/dist/types/element/src/arrows/helpers.d.ts +5 -0
- package/dist/types/element/src/binding.d.ts +69 -50
- package/dist/types/element/src/bounds.d.ts +26 -19
- package/dist/types/element/src/collision.d.ts +7 -2
- package/dist/types/element/src/comparisons.d.ts +8 -7
- package/dist/types/element/src/delta.d.ts +0 -1
- package/dist/types/element/src/distribute.d.ts +3 -2
- package/dist/types/element/src/dragElements.d.ts +3 -3
- package/dist/types/element/src/duplicate.d.ts +7 -6
- package/dist/types/element/src/elbowArrow.d.ts +2 -0
- package/dist/types/element/src/embeddable.d.ts +2 -2
- package/dist/types/element/src/flowchart.d.ts +3 -3
- package/dist/types/element/src/fractionalIndex.d.ts +4 -4
- package/dist/types/element/src/frame.d.ts +14 -9
- package/dist/types/element/src/groups.d.ts +9 -9
- package/dist/types/element/src/heading.d.ts +2 -1
- package/dist/types/element/src/image.d.ts +1 -11
- package/dist/types/element/src/index.d.ts +6 -4
- package/dist/types/element/src/linearElementEditor.d.ts +31 -30
- package/dist/types/element/src/mutateElement.d.ts +5 -1
- package/dist/types/element/src/newElement.d.ts +7 -6
- package/dist/types/element/src/positionElementsOnGrid.d.ts +2 -0
- package/dist/types/element/src/renderElement.d.ts +4 -10
- package/dist/types/element/src/resizeElements.d.ts +12 -12
- package/dist/types/element/src/resizeTest.d.ts +6 -5
- package/dist/types/element/src/selection.d.ts +14 -14
- package/dist/types/element/src/shape.d.ts +9 -8
- package/dist/types/element/src/textElement.d.ts +9 -9
- package/dist/types/element/src/textMeasurements.d.ts +1 -3
- package/dist/types/element/src/textWrapping.d.ts +26 -0
- package/dist/types/{excalidraw/data → element/src}/transform.d.ts +3 -3
- package/dist/types/element/src/transformHandles.d.ts +8 -27
- package/dist/types/element/src/typeChecks.d.ts +29 -31
- package/dist/types/element/src/types.d.ts +20 -14
- package/dist/types/element/src/utils.d.ts +9 -4
- package/dist/types/element/src/visualdebug.d.ts +58 -0
- package/dist/types/element/src/zindex.d.ts +7 -1
- package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +143 -177
- package/dist/types/excalidraw/actions/actionAlign.d.ts +12 -13
- package/dist/types/excalidraw/actions/actionBoundText.d.ts +102 -125
- package/dist/types/excalidraw/actions/actionCanvas.d.ts +522 -1194
- package/dist/types/excalidraw/actions/actionClipboard.d.ts +104 -868
- package/dist/types/excalidraw/actions/actionCropEditor.d.ts +49 -61
- package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +164 -202
- package/dist/types/excalidraw/actions/actionDeselect.d.ts +161 -0
- package/dist/types/excalidraw/actions/actionDistribute.d.ts +4 -6
- package/dist/types/excalidraw/actions/actionDuplicateSelection.d.ts +2 -3
- package/dist/types/excalidraw/actions/actionElementLink.d.ts +41 -59
- package/dist/types/excalidraw/actions/actionElementLock.d.ts +101 -124
- package/dist/types/excalidraw/actions/actionEmbeddable.d.ts +50 -62
- package/dist/types/excalidraw/actions/actionExport.d.ts +179 -1407
- package/dist/types/excalidraw/actions/actionFinalize.d.ts +10 -394
- package/dist/types/excalidraw/actions/actionFlip.d.ts +2 -3
- package/dist/types/excalidraw/actions/actionFrame.d.ts +304 -386
- package/dist/types/excalidraw/actions/actionGroup.d.ts +112 -143
- package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +162 -211
- package/dist/types/excalidraw/actions/actionLink.d.ts +48 -60
- package/dist/types/excalidraw/actions/actionMenu.d.ts +40 -424
- package/dist/types/excalidraw/actions/actionNavigate.d.ts +18 -359
- package/dist/types/excalidraw/actions/actionProperties.d.ts +181 -2525
- package/dist/types/excalidraw/actions/actionSelectAll.d.ts +56 -72
- package/dist/types/excalidraw/actions/actionStyles.d.ts +49 -60
- package/dist/types/excalidraw/actions/actionTextAutoResize.d.ts +3 -3
- package/dist/types/excalidraw/actions/actionToggleArrowBinding.d.ts +174 -0
- package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +53 -66
- package/dist/types/excalidraw/actions/actionToggleMidpointSnapping.d.ts +174 -0
- package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +50 -62
- package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +41 -60
- package/dist/types/excalidraw/actions/actionToggleShapeSwitch.d.ts +2 -2
- package/dist/types/excalidraw/actions/actionToggleStats.d.ts +50 -62
- package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +50 -62
- package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +51 -63
- package/dist/types/excalidraw/actions/actionZindex.d.ts +2 -3
- package/dist/types/excalidraw/actions/index.d.ts +5 -2
- package/dist/types/excalidraw/actions/register.d.ts +2 -2
- package/dist/types/excalidraw/actions/shortcuts.d.ts +1 -1
- package/dist/types/excalidraw/actions/types.d.ts +7 -7
- package/dist/types/excalidraw/{animated-trail.d.ts → animatedTrail.d.ts} +4 -3
- package/dist/types/excalidraw/appState.d.ts +24 -15
- package/dist/types/excalidraw/charts/charts.bar.d.ts +2 -0
- package/dist/types/excalidraw/charts/charts.constants.d.ts +48 -0
- package/dist/types/excalidraw/charts/charts.helpers.d.ts +32 -0
- package/dist/types/excalidraw/charts/charts.line.d.ts +2 -0
- package/dist/types/excalidraw/charts/charts.parse.d.ts +10 -0
- package/dist/types/excalidraw/charts/charts.radar.d.ts +2 -0
- package/dist/types/excalidraw/charts/charts.types.d.ts +18 -0
- package/dist/types/excalidraw/charts/index.d.ts +7 -0
- package/dist/types/excalidraw/clipboard.d.ts +57 -19
- package/dist/types/excalidraw/components/Actions.d.ts +23 -7
- package/dist/types/excalidraw/components/ActiveConfirmDialog.d.ts +1 -1
- package/dist/types/excalidraw/components/App.d.ts +179 -100
- package/dist/types/excalidraw/components/AppStateObserver.d.ts +37 -0
- package/dist/types/excalidraw/components/Card.d.ts +1 -3
- package/dist/types/excalidraw/components/ColorPicker/ColorInput.d.ts +2 -4
- package/dist/types/excalidraw/components/ColorPicker/ColorPicker.d.ts +2 -3
- package/dist/types/excalidraw/components/ColorPicker/Picker.d.ts +2 -0
- package/dist/types/excalidraw/components/ColorPicker/PickerColorList.d.ts +2 -1
- package/dist/types/excalidraw/components/ColorPicker/ShadeList.d.ts +2 -1
- package/dist/types/excalidraw/components/ColorPicker/colorPickerUtils.d.ts +1 -2
- package/dist/types/excalidraw/components/ColorPicker/keyboardNavHandlers.d.ts +0 -1
- package/dist/types/excalidraw/components/CommandPalette/CommandPalette.d.ts +1 -0
- package/dist/types/excalidraw/components/CommandPalette/defaultCommandPaletteItems.d.ts +1 -2
- package/dist/types/excalidraw/components/CommandPalette/types.d.ts +2 -4
- package/dist/types/excalidraw/components/ConvertElementTypePopup.d.ts +4 -4
- package/dist/types/excalidraw/components/CursorHint.d.ts +46 -0
- package/dist/types/excalidraw/components/DarkModeToggle.d.ts +1 -1
- package/dist/types/excalidraw/components/DefaultSidebar.d.ts +9 -13
- package/dist/types/excalidraw/components/ElementLinkDialog.d.ts +1 -1
- package/dist/types/excalidraw/components/Ellipsify.d.ts +1 -2
- package/dist/types/excalidraw/components/ErrorDialog.d.ts +1 -1
- package/dist/types/excalidraw/components/EyeDropper.d.ts +1 -2
- package/dist/types/excalidraw/components/FilledButton.d.ts +2 -1
- package/dist/types/excalidraw/components/FontPicker/FontPicker.d.ts +2 -1
- package/dist/types/excalidraw/components/FontPicker/FontPickerTrigger.d.ts +3 -1
- package/dist/types/excalidraw/components/FontPicker/keyboardNavHandlers.d.ts +0 -1
- package/dist/types/excalidraw/components/HelpDialog.d.ts +1 -1
- package/dist/types/excalidraw/components/HintViewer.d.ts +4 -3
- package/dist/types/excalidraw/components/IconPicker.d.ts +14 -9
- package/dist/types/excalidraw/components/InlineIcon.d.ts +3 -1
- package/dist/types/excalidraw/components/Island.d.ts +7 -0
- package/dist/types/excalidraw/components/LayerUI.d.ts +2 -1
- package/dist/types/excalidraw/components/LibraryMenu.d.ts +1 -1
- package/dist/types/excalidraw/components/LibraryMenuControlButtons.d.ts +1 -1
- package/dist/types/excalidraw/components/LibraryMenuHeaderContent.d.ts +1 -2
- package/dist/types/excalidraw/components/LibraryMenuSection.d.ts +1 -1
- package/dist/types/excalidraw/components/LibraryUnit.d.ts +2 -3
- package/dist/types/excalidraw/components/LoadingMessage.d.ts +0 -1
- package/dist/types/excalidraw/components/MobileMenu.d.ts +3 -5
- package/dist/types/excalidraw/components/MobileToolBar.d.ts +10 -0
- package/dist/types/excalidraw/components/Modal.d.ts +0 -1
- package/dist/types/excalidraw/components/OverwriteConfirm/OverwriteConfirm.d.ts +1 -1
- package/dist/types/excalidraw/components/OverwriteConfirm/OverwriteConfirmState.d.ts +1 -1
- package/dist/types/excalidraw/components/PasteChartDialog.d.ts +4 -5
- package/dist/types/excalidraw/components/Popover.d.ts +2 -1
- package/dist/types/excalidraw/components/PropertiesPopover.d.ts +2 -1
- package/dist/types/excalidraw/components/RadioGroup.d.ts +0 -1
- package/dist/types/excalidraw/components/RadioSelection.d.ts +4 -4
- package/dist/types/excalidraw/components/Range.d.ts +10 -4
- package/dist/types/excalidraw/components/SVGLayer.d.ts +1 -1
- package/dist/types/excalidraw/components/ScrollableList.d.ts +0 -1
- package/dist/types/excalidraw/components/SearchMenu.d.ts +1 -1
- package/dist/types/excalidraw/components/Sidebar/Sidebar.d.ts +16 -22
- package/dist/types/excalidraw/components/Sidebar/SidebarHeader.d.ts +1 -1
- package/dist/types/excalidraw/components/Sidebar/SidebarTab.d.ts +1 -2
- package/dist/types/excalidraw/components/Sidebar/SidebarTabTrigger.d.ts +1 -2
- package/dist/types/excalidraw/components/Sidebar/SidebarTabTriggers.d.ts +1 -2
- package/dist/types/excalidraw/components/Sidebar/SidebarTabs.d.ts +1 -2
- package/dist/types/excalidraw/components/Spinner.d.ts +4 -4
- package/dist/types/excalidraw/components/Stats/Angle.d.ts +2 -2
- package/dist/types/excalidraw/components/Stats/CanvasGrid.d.ts +0 -1
- package/dist/types/excalidraw/components/Stats/Collapsible.d.ts +0 -1
- package/dist/types/excalidraw/components/Stats/Dimension.d.ts +2 -2
- package/dist/types/excalidraw/components/Stats/DragInput.d.ts +2 -3
- package/dist/types/excalidraw/components/Stats/MultiAngle.d.ts +2 -2
- package/dist/types/excalidraw/components/Stats/MultiDimension.d.ts +2 -2
- package/dist/types/excalidraw/components/Stats/MultiPosition.d.ts +2 -2
- package/dist/types/excalidraw/components/Stats/Position.d.ts +3 -3
- package/dist/types/excalidraw/components/Stats/index.d.ts +7 -8
- package/dist/types/excalidraw/components/Stats/utils.d.ts +1 -1
- package/dist/types/excalidraw/components/TTDDialog/Chat/ChatHistoryMenu.d.ts +15 -0
- package/dist/types/excalidraw/components/TTDDialog/Chat/ChatInterface.d.ts +23 -0
- package/dist/types/excalidraw/components/TTDDialog/Chat/ChatMessage.d.ts +14 -0
- package/dist/types/excalidraw/components/TTDDialog/Chat/TTDChatPanel.d.ts +27 -0
- package/dist/types/excalidraw/components/TTDDialog/Chat/index.d.ts +3 -0
- package/dist/types/excalidraw/components/TTDDialog/Chat/useChatAgent.d.ts +8 -0
- package/dist/types/excalidraw/components/TTDDialog/CodeMirrorEditor.d.ts +11 -0
- package/dist/types/excalidraw/components/TTDDialog/MermaidToExcalidraw.d.ts +3 -2
- package/dist/types/excalidraw/components/TTDDialog/TTDContext.d.ts +13 -0
- package/dist/types/excalidraw/components/TTDDialog/TTDDialog.d.ts +12 -29
- package/dist/types/excalidraw/components/TTDDialog/TTDDialogInput.d.ts +3 -3
- package/dist/types/excalidraw/components/TTDDialog/TTDDialogOutput.d.ts +5 -2
- package/dist/types/excalidraw/components/TTDDialog/TTDDialogPanel.d.ts +13 -9
- package/dist/types/excalidraw/components/TTDDialog/TTDDialogTab.d.ts +1 -2
- package/dist/types/excalidraw/components/TTDDialog/TTDDialogTabTrigger.d.ts +1 -2
- package/dist/types/excalidraw/components/TTDDialog/TTDDialogTabTriggers.d.ts +1 -2
- package/dist/types/excalidraw/components/TTDDialog/TTDPreviewPanel.d.ts +9 -0
- package/dist/types/excalidraw/components/TTDDialog/TTDWelcomeMessage.d.ts +1 -0
- package/dist/types/excalidraw/components/TTDDialog/TextToDiagram.d.ts +9 -0
- package/dist/types/excalidraw/components/TTDDialog/common.d.ts +16 -16
- package/dist/types/excalidraw/components/TTDDialog/hooks/useChatManagement.d.ts +13 -0
- package/dist/types/excalidraw/components/TTDDialog/hooks/useMermaidRenderer.d.ts +14 -0
- package/dist/types/excalidraw/components/TTDDialog/hooks/useTextGeneration.d.ts +7 -0
- package/dist/types/excalidraw/components/TTDDialog/mermaid-lang-lite.d.ts +2 -0
- package/dist/types/excalidraw/components/TTDDialog/types.d.ts +95 -0
- package/dist/types/excalidraw/components/TTDDialog/useTTDChatStorage.d.ts +22 -0
- package/dist/types/excalidraw/components/TTDDialog/utils/chat.d.ts +10 -0
- package/dist/types/excalidraw/components/TTDDialog/utils/mermaidAutoFix.d.ts +1 -0
- package/dist/types/excalidraw/components/TTDDialog/utils/mermaidError.d.ts +10 -0
- package/dist/types/excalidraw/components/TTDDialog/utils/mermaidValidation.d.ts +1 -0
- package/dist/types/excalidraw/components/TextField.d.ts +1 -0
- package/dist/types/excalidraw/components/Toast.d.ts +11 -7
- package/dist/types/excalidraw/components/ToolPopover.d.ts +25 -0
- package/dist/types/excalidraw/components/Trans.d.ts +2 -2
- package/dist/types/excalidraw/components/canvases/InteractiveCanvas.d.ts +8 -4
- package/dist/types/excalidraw/components/canvases/NewElementCanvas.d.ts +1 -0
- package/dist/types/excalidraw/components/canvases/StaticCanvas.d.ts +1 -1
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenu.d.ts +47 -35
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuContent.d.ts +7 -5
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuGroup.d.ts +3 -3
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItem.d.ts +13 -22
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemCheckbox.d.ts +5 -0
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemContent.d.ts +5 -4
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemContentRadio.d.ts +2 -2
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemCustom.d.ts +2 -2
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemLink.d.ts +6 -6
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuSub.d.ts +23 -0
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuSubContent.d.ts +8 -0
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuSubTrigger.d.ts +12 -0
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuTrigger.d.ts +3 -4
- package/dist/types/excalidraw/components/dropdownMenu/common.d.ts +2 -2
- package/dist/types/excalidraw/components/dropdownMenu/dropdownMenuUtils.d.ts +2 -0
- package/dist/types/excalidraw/components/hoc/withInternalFallback.d.ts +1 -1
- package/dist/types/excalidraw/components/hyperlink/helpers.d.ts +3 -3
- package/dist/types/excalidraw/components/icons.d.ts +51 -21
- package/dist/types/excalidraw/components/main-menu/DefaultItems.d.ts +24 -3
- package/dist/types/excalidraw/components/main-menu/MainMenu.d.ts +39 -35
- package/dist/types/excalidraw/components/shapes.d.ts +209 -1
- package/dist/types/excalidraw/data/blob.d.ts +331 -12
- package/dist/types/excalidraw/data/encode.d.ts +4 -4
- package/dist/types/excalidraw/data/encryption.d.ts +5 -5
- package/dist/types/excalidraw/data/filesystem.d.ts +5 -7
- package/dist/types/excalidraw/data/index.d.ts +8 -9
- package/dist/types/excalidraw/data/json.d.ts +171 -3
- package/dist/types/excalidraw/data/library.d.ts +25 -10
- package/dist/types/excalidraw/data/resave.d.ts +7 -2
- package/dist/types/excalidraw/data/restore.d.ts +25 -10
- package/dist/types/excalidraw/data/types.d.ts +4 -1
- package/dist/types/excalidraw/editor-jotai.d.ts +11 -11
- package/dist/types/excalidraw/eraser/index.d.ts +2 -3
- package/dist/types/excalidraw/errors.d.ts +14 -0
- package/dist/types/excalidraw/hooks/useAppStateValue.d.ts +29 -0
- package/dist/types/excalidraw/hooks/useLibraryItemSvg.d.ts +2 -2
- package/dist/types/excalidraw/hooks/useOutsideClick.d.ts +4 -3
- package/dist/types/excalidraw/hooks/useScrollPosition.d.ts +1 -2
- package/dist/types/excalidraw/hooks/useTextEditorFocus.d.ts +14 -0
- package/dist/types/excalidraw/i18n.d.ts +2 -2
- package/dist/types/excalidraw/{laser-trails.d.ts → laserTrails.d.ts} +5 -7
- package/dist/types/excalidraw/lasso/index.d.ts +2 -3
- package/dist/types/excalidraw/renderer/animation.d.ts +16 -0
- package/dist/types/excalidraw/renderer/helpers.d.ts +6 -8
- package/dist/types/excalidraw/renderer/interactiveScene.d.ts +7 -15
- package/dist/types/excalidraw/scene/Renderer.d.ts +428 -18
- package/dist/types/excalidraw/scene/export.d.ts +4 -4
- package/dist/types/excalidraw/scene/index.d.ts +2 -2
- package/dist/types/excalidraw/scene/types.d.ts +23 -8
- package/dist/types/excalidraw/shortcut.d.ts +1 -0
- package/dist/types/excalidraw/snapping.d.ts +12 -12
- package/dist/types/excalidraw/subset/harfbuzz/harfbuzz-bindings.d.ts +1 -1
- package/dist/types/excalidraw/subset/harfbuzz/harfbuzz-loader.d.ts +1 -1
- package/dist/types/excalidraw/subset/harfbuzz/harfbuzz-wasm.d.ts +1 -1
- package/dist/types/excalidraw/subset/woff2/woff2-loader.d.ts +2 -2
- package/dist/types/excalidraw/subset/woff2/woff2-wasm.d.ts +1 -1
- package/dist/types/excalidraw/textAutoResizeHandle.d.ts +15 -0
- package/dist/types/excalidraw/types.d.ts +294 -43
- package/dist/types/excalidraw/viewport.d.ts +316 -0
- package/dist/types/excalidraw/wysiwyg/textWysiwyg.d.ts +8 -5
- package/dist/types/fractional-indexing/src/index.d.ts +29 -0
- package/dist/types/laser-pointer/src/index.d.ts +2 -0
- package/dist/types/laser-pointer/src/math.d.ts +16 -0
- package/dist/types/laser-pointer/src/simplify.d.ts +2 -0
- package/dist/types/laser-pointer/src/state.d.ts +35 -0
- package/dist/types/math/src/constants.d.ts +0 -1
- package/dist/types/math/src/curve.d.ts +4 -1
- package/dist/types/math/src/point.d.ts +8 -2
- package/dist/types/math/src/polygon.d.ts +2 -2
- package/dist/types/math/src/range.d.ts +1 -3
- package/dist/types/math/src/segment.d.ts +4 -3
- package/dist/types/math/src/types.d.ts +25 -1
- package/dist/types/utils/src/export.d.ts +8 -8
- package/dist/types/utils/src/index.d.ts +1 -2
- package/dist/types/utils/src/shape.d.ts +6 -6
- package/package.json +10 -3
- package/dist/types/excalidraw/animation-frame-handler.d.ts +0 -16
- package/dist/types/excalidraw/charts.d.ts +0 -27
- package/dist/types/excalidraw/components/DiagramToCodePlugin/DiagramToCodePlugin.d.ts +0 -4
- package/dist/types/excalidraw/components/ExcalidrawLogo.d.ts +0 -16
- package/dist/types/excalidraw/components/InitializeApp.d.ts +0 -10
- package/dist/types/excalidraw/components/TTDDialog/TTDDialogTrigger.d.ts +0 -9
- package/dist/types/excalidraw/components/footer/FooterCenter.d.ts +0 -8
- package/dist/types/excalidraw/components/live-collaboration/LiveCollaborationTrigger.d.ts +0 -10
- package/dist/types/excalidraw/components/welcome-screen/WelcomeScreen.Center.d.ts +0 -58
- package/dist/types/excalidraw/components/welcome-screen/WelcomeScreen.Hints.d.ts +0 -19
- package/dist/types/excalidraw/components/welcome-screen/WelcomeScreen.d.ts +0 -85
- package/dist/types/excalidraw/data/reconcile.d.ts +0 -7
- package/dist/types/excalidraw/index.d.ts +0 -47
- package/dist/types/excalidraw/polyfill.d.ts +0 -2
- package/dist/types/excalidraw/scene/scroll.d.ts +0 -23
- package/dist/types/utils/src/bbox.d.ts +0 -9
- package/dist/types/utils/src/withinBounds.d.ts +0 -19
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { GlobalPoint, LineSegment } from "@excalidraw/math";
|
|
2
2
|
import type { FrameNameBounds } from "@excalidraw/excalidraw/types";
|
|
3
|
-
import type { ElementsMap, ExcalidrawElement } from "./types";
|
|
3
|
+
import type { ElementsMap, ExcalidrawArrowElement, ExcalidrawBindableElement, ExcalidrawElement, NonDeleted, NonDeletedExcalidrawElement, NonDeletedSceneElementsMap, Ordered } from "./types";
|
|
4
4
|
export declare const shouldTestInside: (element: ExcalidrawElement) => boolean;
|
|
5
5
|
export type HitTestArgs = {
|
|
6
6
|
point: GlobalPoint;
|
|
@@ -8,11 +8,15 @@ export type HitTestArgs = {
|
|
|
8
8
|
threshold: number;
|
|
9
9
|
elementsMap: ElementsMap;
|
|
10
10
|
frameNameBound?: FrameNameBounds | null;
|
|
11
|
+
overrideShouldTestInside?: boolean;
|
|
11
12
|
};
|
|
12
|
-
export declare const hitElementItself: ({ point, element, threshold, elementsMap, frameNameBound, }: HitTestArgs) => boolean;
|
|
13
|
+
export declare const hitElementItself: ({ point, element, threshold, elementsMap, frameNameBound, overrideShouldTestInside, }: HitTestArgs) => boolean;
|
|
13
14
|
export declare const hitElementBoundingBox: (point: GlobalPoint, element: ExcalidrawElement, elementsMap: ElementsMap, tolerance?: number) => boolean;
|
|
14
15
|
export declare const hitElementBoundingBoxOnly: (hitArgs: HitTestArgs, elementsMap: ElementsMap) => boolean;
|
|
15
16
|
export declare const hitElementBoundText: (point: GlobalPoint, element: ExcalidrawElement, elementsMap: ElementsMap) => boolean;
|
|
17
|
+
export declare const getAllHoveredElementAtPoint: (point: Readonly<GlobalPoint>, elements: readonly Ordered<NonDeletedExcalidrawElement>[], elementsMap: NonDeletedSceneElementsMap, tolerance?: number) => NonDeleted<ExcalidrawBindableElement>[];
|
|
18
|
+
export declare const getHoveredElementForBinding: (point: Readonly<GlobalPoint>, elements: readonly Ordered<NonDeletedExcalidrawElement>[], elementsMap: NonDeletedSceneElementsMap, tolerance?: number) => NonDeleted<ExcalidrawBindableElement> | null;
|
|
19
|
+
export declare const getHoveredElementForFocusPoint: (point: GlobalPoint, arrow: ExcalidrawArrowElement, elements: readonly Ordered<NonDeletedExcalidrawElement>[], elementsMap: NonDeletedSceneElementsMap, tolerance?: number) => NonDeleted<ExcalidrawBindableElement> | null;
|
|
16
20
|
/**
|
|
17
21
|
* Intersect a line with an element for binding test
|
|
18
22
|
*
|
|
@@ -30,3 +34,4 @@ export declare const intersectElementWithLineSegment: (element: ExcalidrawElemen
|
|
|
30
34
|
* @returns
|
|
31
35
|
*/
|
|
32
36
|
export declare const isPointInElement: (point: GlobalPoint, element: ExcalidrawElement, elementsMap: ElementsMap) => boolean;
|
|
37
|
+
export declare const isBindableElementInsideOtherBindable: (innerElement: ExcalidrawBindableElement, outerElement: ExcalidrawBindableElement, elementsMap: ElementsMap) => boolean;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { ElementOrToolType } from "@excalidraw/excalidraw/types";
|
|
2
|
-
export declare const hasBackground: (type: ElementOrToolType) =>
|
|
3
|
-
export declare const hasStrokeColor: (type: ElementOrToolType) =>
|
|
4
|
-
export declare const hasStrokeWidth: (type: ElementOrToolType) =>
|
|
5
|
-
export declare const hasStrokeStyle: (type: ElementOrToolType) =>
|
|
6
|
-
export declare const
|
|
7
|
-
export declare const
|
|
8
|
-
export declare const
|
|
2
|
+
export declare const hasBackground: (type: ElementOrToolType) => type is "line" | "rectangle" | "diamond" | "ellipse" | "embeddable" | "iframe" | "freedraw";
|
|
3
|
+
export declare const hasStrokeColor: (type: ElementOrToolType) => type is "line" | "arrow" | "text" | "rectangle" | "diamond" | "ellipse" | "embeddable" | "freedraw";
|
|
4
|
+
export declare const hasStrokeWidth: (type: ElementOrToolType) => type is "line" | "arrow" | "rectangle" | "diamond" | "ellipse" | "embeddable" | "iframe" | "freedraw";
|
|
5
|
+
export declare const hasStrokeStyle: (type: ElementOrToolType) => type is "line" | "arrow" | "rectangle" | "diamond" | "ellipse" | "embeddable" | "iframe";
|
|
6
|
+
export declare const hasFreedrawMode: (type: ElementOrToolType) => type is "freedraw";
|
|
7
|
+
export declare const canChangeRoundness: (type: ElementOrToolType) => type is "line" | "rectangle" | "diamond" | "embeddable" | "iframe" | "image";
|
|
8
|
+
export declare const toolIsArrow: (type: ElementOrToolType) => type is "arrow";
|
|
9
|
+
export declare const canHaveArrowheads: (type: ElementOrToolType) => type is "arrow";
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { AppState } from "@excalidraw/excalidraw/types";
|
|
2
|
-
import type {
|
|
2
|
+
import type { Scene } from "./Scene";
|
|
3
|
+
import type { ElementsMap, NonDeletedExcalidrawElement } from "./types";
|
|
3
4
|
export interface Distribution {
|
|
4
5
|
space: "between";
|
|
5
6
|
axis: "x" | "y";
|
|
6
7
|
}
|
|
7
|
-
export declare const distributeElements: (selectedElements:
|
|
8
|
+
export declare const distributeElements: (selectedElements: NonDeletedExcalidrawElement[], elementsMap: ElementsMap, distribution: Distribution, appState: Readonly<AppState>, scene: Scene) => NonDeletedExcalidrawElement[];
|
|
@@ -24,10 +24,10 @@ export declare const dragNewElement: ({ newElement, elementType, originX, origin
|
|
|
24
24
|
scene: Scene;
|
|
25
25
|
/** whether to keep given aspect ratio when `isResizeWithSidesSameLength` is
|
|
26
26
|
true */
|
|
27
|
-
widthAspectRatio?: number | null
|
|
27
|
+
widthAspectRatio?: number | null;
|
|
28
28
|
originOffset?: {
|
|
29
29
|
x: number;
|
|
30
30
|
y: number;
|
|
31
|
-
} | null
|
|
32
|
-
informMutation?: boolean
|
|
31
|
+
} | null;
|
|
32
|
+
informMutation?: boolean;
|
|
33
33
|
}) => void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Mutable } from "@excalidraw/common/utility-types";
|
|
2
2
|
import type { AppState } from "@excalidraw/excalidraw/types";
|
|
3
|
-
import type { ExcalidrawElement, GroupId } from "./types";
|
|
3
|
+
import type { ExcalidrawElement, GroupId, NonDeletedExcalidrawElement } from "./types";
|
|
4
4
|
/**
|
|
5
5
|
* Duplicate an element, often used in the alt-drag operation.
|
|
6
6
|
* Note that this method has gotten a bit complicated since the
|
|
@@ -17,12 +17,12 @@ import type { ExcalidrawElement, GroupId } from "./types";
|
|
|
17
17
|
export declare const duplicateElement: <TElement extends ExcalidrawElement>(editingGroupId: AppState["editingGroupId"], groupIdMapForOperation: Map<GroupId, GroupId>, element: TElement, randomizeSeed?: boolean) => Readonly<TElement>;
|
|
18
18
|
export declare const duplicateElements: (opts: {
|
|
19
19
|
elements: readonly ExcalidrawElement[];
|
|
20
|
-
randomizeSeed?: boolean
|
|
21
|
-
overrides?: (
|
|
20
|
+
randomizeSeed?: boolean;
|
|
21
|
+
overrides?: (data: {
|
|
22
22
|
duplicateElement: ExcalidrawElement;
|
|
23
23
|
origElement: ExcalidrawElement;
|
|
24
24
|
origIdToDuplicateId: Map<ExcalidrawElement["id"], ExcalidrawElement["id"]>;
|
|
25
|
-
}) => Partial<ExcalidrawElement
|
|
25
|
+
}) => Partial<ExcalidrawElement>;
|
|
26
26
|
} & ({
|
|
27
27
|
/**
|
|
28
28
|
* Duplicates all elements in array.
|
|
@@ -31,6 +31,7 @@ export declare const duplicateElements: (opts: {
|
|
|
31
31
|
* user interaction.
|
|
32
32
|
*/
|
|
33
33
|
type: "everything";
|
|
34
|
+
preserveFrameChildrenOrder?: boolean;
|
|
34
35
|
} | {
|
|
35
36
|
/**
|
|
36
37
|
* Duplicates specified elements and inserts them back into the array
|
|
@@ -46,8 +47,8 @@ export declare const duplicateElements: (opts: {
|
|
|
46
47
|
selectedGroupIds: AppState["selectedGroupIds"];
|
|
47
48
|
};
|
|
48
49
|
})) => {
|
|
49
|
-
duplicatedElements:
|
|
50
|
-
duplicateElementsMap: Map<string,
|
|
50
|
+
duplicatedElements: NonDeletedExcalidrawElement[];
|
|
51
|
+
duplicateElementsMap: Map<string, NonDeletedExcalidrawElement>;
|
|
51
52
|
elementsWithDuplicates: ExcalidrawElement[];
|
|
52
53
|
origIdToDuplicateId: Map<string, string>;
|
|
53
54
|
};
|
|
@@ -13,5 +13,7 @@ export declare const updateElbowArrowPoints: (arrow: Readonly<ExcalidrawElbowArr
|
|
|
13
13
|
endBinding?: FixedPointBinding | null;
|
|
14
14
|
}, options?: {
|
|
15
15
|
isDragging?: boolean;
|
|
16
|
+
isBindingEnabled?: boolean;
|
|
17
|
+
isMidpointSnappingEnabled?: boolean;
|
|
16
18
|
}) => ElementUpdate<ExcalidrawElbowArrowElement>;
|
|
17
19
|
export declare const validateElbowPoints: <P extends GlobalPoint | LocalPoint>(points: readonly P[], tolerance?: number) => boolean;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { ExcalidrawProps } from "@excalidraw/excalidraw/types";
|
|
2
2
|
import type { MarkRequired } from "@excalidraw/common/utility-types";
|
|
3
|
-
import type {
|
|
3
|
+
import type { ExcalidrawIframeLikeElement, IframeData, NonDeletedExcalidrawElement } from "./types";
|
|
4
4
|
type IframeDataWithSandbox = MarkRequired<IframeData, "sandbox">;
|
|
5
5
|
export declare const createSrcDoc: (body: string) => string;
|
|
6
6
|
export declare const getEmbedLink: (link: string | null | undefined) => IframeDataWithSandbox | null;
|
|
7
|
-
export declare const createPlaceholderEmbeddableLabel: (element: ExcalidrawIframeLikeElement) =>
|
|
7
|
+
export declare const createPlaceholderEmbeddableLabel: (element: ExcalidrawIframeLikeElement) => NonDeletedExcalidrawElement;
|
|
8
8
|
export declare const maybeParseEmbedSrc: (str: string) => string;
|
|
9
9
|
export declare const embeddableURLValidator: (url: string | null | undefined, validateEmbeddable: ExcalidrawProps["validateEmbeddable"]) => boolean;
|
|
10
10
|
export {};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { AppState, PendingExcalidrawElements } from "@excalidraw/excalidraw/types";
|
|
2
|
-
import { type ElementsMap, type ExcalidrawBindableElement, type ExcalidrawElement, type ExcalidrawFlowchartNodeElement } from "./types";
|
|
2
|
+
import { type NonDeleted, type ElementsMap, type ExcalidrawBindableElement, type ExcalidrawElement, type ExcalidrawFlowchartNodeElement, type NonDeletedExcalidrawElement } from "./types";
|
|
3
3
|
import type { Scene } from "./Scene";
|
|
4
4
|
type LinkDirection = "up" | "right" | "down" | "left";
|
|
5
5
|
export declare const getLinkDirectionFromKey: (key: string) => LinkDirection;
|
|
6
6
|
export declare const getPredecessors: (node: ExcalidrawBindableElement, elementsMap: ElementsMap, direction: LinkDirection) => ExcalidrawBindableElement[];
|
|
7
|
-
export declare const addNewNodes: (startNode: ExcalidrawFlowchartNodeElement
|
|
7
|
+
export declare const addNewNodes: (startNode: NonDeleted<ExcalidrawFlowchartNodeElement>, appState: AppState, direction: LinkDirection, scene: Scene, numberOfNodes: number) => NonDeletedExcalidrawElement[];
|
|
8
8
|
export declare class FlowChartNavigator {
|
|
9
9
|
isExploring: boolean;
|
|
10
10
|
private sameLevelNodes;
|
|
@@ -19,7 +19,7 @@ export declare class FlowChartCreator {
|
|
|
19
19
|
private numberOfNodes;
|
|
20
20
|
private direction;
|
|
21
21
|
pendingNodes: PendingExcalidrawElements | null;
|
|
22
|
-
createNodes(startNode: ExcalidrawFlowchartNodeElement
|
|
22
|
+
createNodes(startNode: NonDeleted<ExcalidrawFlowchartNodeElement>, appState: AppState, direction: LinkDirection, scene: Scene): void;
|
|
23
23
|
clear(): void;
|
|
24
24
|
}
|
|
25
25
|
export declare const isNodeInFlowchart: (element: ExcalidrawFlowchartNodeElement, elementsMap: ElementsMap) => boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ElementsMap, ExcalidrawElement, OrderedExcalidrawElement, SceneElementsMap } from "./types";
|
|
1
|
+
import type { ElementsMap, ExcalidrawElement, Ordered, OrderedExcalidrawElement, SceneElementsMap } from "./types";
|
|
2
2
|
export declare class InvalidFractionalIndexError extends Error {
|
|
3
3
|
code: "ELEMENT_HAS_INVALID_INDEX";
|
|
4
4
|
}
|
|
@@ -26,11 +26,11 @@ export declare class InvalidFractionalIndexError extends Error {
|
|
|
26
26
|
export declare const validateFractionalIndices: (elements: readonly ExcalidrawElement[], { shouldThrow, includeBoundTextValidation, ignoreLogs, reconciliationContext, }: {
|
|
27
27
|
shouldThrow: boolean;
|
|
28
28
|
includeBoundTextValidation: boolean;
|
|
29
|
-
ignoreLogs?: true
|
|
29
|
+
ignoreLogs?: true;
|
|
30
30
|
reconciliationContext?: {
|
|
31
31
|
localElements: ReadonlyArray<ExcalidrawElement>;
|
|
32
32
|
remoteElements: ReadonlyArray<ExcalidrawElement>;
|
|
33
|
-
}
|
|
33
|
+
};
|
|
34
34
|
}) => void;
|
|
35
35
|
/**
|
|
36
36
|
* Order the elements based on the fractional indices.
|
|
@@ -48,7 +48,7 @@ export declare const syncMovedIndices: (elements: readonly ExcalidrawElement[],
|
|
|
48
48
|
*
|
|
49
49
|
* WARN: in edge cases it could modify the elements which were not moved, as it's impossible to guess the actually moved elements from the elements array itself.
|
|
50
50
|
*/
|
|
51
|
-
export declare const syncInvalidIndices: (elements: readonly
|
|
51
|
+
export declare const syncInvalidIndices: <T extends ExcalidrawElement>(elements: readonly T[]) => Ordered<T>[];
|
|
52
52
|
/**
|
|
53
53
|
* Synchronizes all invalid fractional indices within the array order by creating new instances of elements with corrected indices.
|
|
54
54
|
*
|
|
@@ -29,31 +29,36 @@ export declare const getFrameLikeElements: (allElements: ExcalidrawElementsInclu
|
|
|
29
29
|
*
|
|
30
30
|
* Considers non-frame bound elements (container or arrow labels) as root.
|
|
31
31
|
*/
|
|
32
|
-
export declare const getRootElements: (allElements:
|
|
32
|
+
export declare const getRootElements: <T extends ExcalidrawElement>(allElements: readonly T[]) => T[];
|
|
33
33
|
export declare const getElementsInResizingFrame: (allElements: ExcalidrawElementsIncludingDeleted, frame: ExcalidrawFrameLikeElement, appState: AppState, elementsMap: ElementsMap) => ExcalidrawElement[];
|
|
34
34
|
export declare const getElementsInNewFrame: (elements: ExcalidrawElementsIncludingDeleted, frame: ExcalidrawFrameLikeElement, elementsMap: ElementsMap) => (import("./types").ExcalidrawLinearElement | import("./types").ExcalidrawSelectionElement | 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 | import("./types").ExcalidrawFreeDrawElement)[];
|
|
35
35
|
export declare const omitPartialGroups: (elements: ExcalidrawElement[], frame: ExcalidrawFrameLikeElement, allElementsMap: ElementsMap) => (import("./types").ExcalidrawLinearElement | import("./types").ExcalidrawSelectionElement | 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 | import("./types").ExcalidrawFreeDrawElement)[];
|
|
36
36
|
export declare const getContainingFrame: (element: ExcalidrawElement, elementsMap: ElementsMap) => ExcalidrawFrameLikeElement | null;
|
|
37
37
|
/** */
|
|
38
38
|
export declare const filterElementsEligibleAsFrameChildren: (elements: readonly ExcalidrawElement[], frame: ExcalidrawFrameLikeElement) => ExcalidrawElement[];
|
|
39
|
+
export declare const getCommonFrameId: (elements: readonly ExcalidrawElement[]) => string | null;
|
|
40
|
+
export declare const getFrameChildrenInsertionIndex: (elements: readonly ExcalidrawElement[], frameId: ExcalidrawFrameLikeElement["id"]) => number | null;
|
|
39
41
|
/**
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
* [el, el, child, child, frame, el]
|
|
42
|
+
* Adds elements and their bound elements to frame. Reorders added elements to
|
|
43
|
+
* be just below frame, or just above its highest child (whichever is higher).
|
|
43
44
|
*
|
|
44
45
|
* @returns mutated allElements (same data structure)
|
|
45
46
|
*/
|
|
46
|
-
export declare const addElementsToFrame: <T extends ElementsMapOrArray>(allElements: T, elementsToAdd:
|
|
47
|
-
export declare const removeElementsFromFrame: (elementsToRemove: ReadonlySetLike<
|
|
47
|
+
export declare const addElementsToFrame: <T extends ElementsMapOrArray>(allElements: T, elementsToAdd: ExcalidrawElement[], frame: ExcalidrawFrameLikeElement) => T;
|
|
48
|
+
export declare const removeElementsFromFrame: (elementsToRemove: ReadonlySetLike<ExcalidrawElement>, elementsMap: ElementsMap) => void;
|
|
48
49
|
export declare const removeAllElementsFromFrame: <T extends ExcalidrawElement>(allElements: readonly T[], frame: ExcalidrawFrameLikeElement) => readonly T[];
|
|
49
|
-
export declare const replaceAllElementsInFrame: <T extends ExcalidrawElement>(allElements: readonly T[], nextElementsInFrame: ExcalidrawElement[], frame: ExcalidrawFrameLikeElement
|
|
50
|
+
export declare const replaceAllElementsInFrame: <T extends ExcalidrawElement>(allElements: readonly T[], nextElementsInFrame: ExcalidrawElement[], frame: ExcalidrawFrameLikeElement) => T[];
|
|
50
51
|
/** does not mutate elements, but returns new ones */
|
|
51
52
|
export declare const updateFrameMembershipOfSelectedElements: <T extends ElementsMapOrArray>(allElements: T, appState: AppState, app: AppClassProperties) => T;
|
|
52
53
|
/**
|
|
53
54
|
* filters out elements that are inside groups that contain a frame element
|
|
54
55
|
* anywhere in the group tree
|
|
55
56
|
*/
|
|
56
|
-
export declare const omitGroupsContainingFrameLikes: (allElements: ElementsMapOrArray,
|
|
57
|
+
export declare const omitGroupsContainingFrameLikes: (allElements: ElementsMapOrArray,
|
|
58
|
+
/** subset of elements you want to filter. Optional perf optimization so we
|
|
59
|
+
* don't have to filter all elements unnecessarily
|
|
60
|
+
*/
|
|
61
|
+
selectedElements?: readonly ExcalidrawElement[]) => ExcalidrawElement[];
|
|
57
62
|
/**
|
|
58
63
|
* depending on the appState, return target frame, which is the frame the given element
|
|
59
64
|
* is going to be added to or remove from
|
|
@@ -66,5 +71,5 @@ export declare const isElementInFrame: (element: ExcalidrawElement, allElementsM
|
|
|
66
71
|
export declare const shouldApplyFrameClip: (element: ExcalidrawElement, frame: ExcalidrawFrameLikeElement, appState: StaticCanvasAppState, elementsMap: ElementsMap, checkedGroups?: Map<string, boolean>) => boolean;
|
|
67
72
|
export declare const getDefaultFrameName: (element: ExcalidrawFrameLikeElement) => "Frame" | "AI Frame";
|
|
68
73
|
export declare const getFrameLikeTitle: (element: ExcalidrawFrameLikeElement) => string;
|
|
69
|
-
export declare const getElementsOverlappingFrame: (elements: readonly
|
|
74
|
+
export declare const getElementsOverlappingFrame: <T extends ExcalidrawElement>(elements: readonly T[], frame: ExcalidrawFrameLikeElement, elementsMap: ElementsMap) => T[];
|
|
70
75
|
export declare const frameAndChildrenSelectedTogether: (selectedElements: readonly ExcalidrawElement[]) => boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { AppClassProperties, AppState, InteractiveCanvasAppState } from "@excalidraw/excalidraw/types";
|
|
2
2
|
import type { Mutable } from "@excalidraw/common/utility-types";
|
|
3
|
-
import type { GroupId, ExcalidrawElement, NonDeleted,
|
|
4
|
-
export declare const selectGroup: (groupId: GroupId, appState: InteractiveCanvasAppState, elements: readonly
|
|
3
|
+
import type { GroupId, ExcalidrawElement, NonDeleted, ElementsMapOrArray, ElementsMap, NonDeletedExcalidrawElement, NonDeletedElementsMapOrArray } from "./types";
|
|
4
|
+
export declare const selectGroup: (groupId: GroupId, appState: InteractiveCanvasAppState, elements: readonly NonDeletedExcalidrawElement[]) => Pick<InteractiveCanvasAppState, "selectedGroupIds" | "selectedElementIds" | "editingGroupId">;
|
|
5
5
|
export declare const selectGroupsForSelectedElements: {
|
|
6
6
|
(appState: Pick<AppState, "selectedElementIds" | "editingGroupId">, elements: readonly NonDeletedExcalidrawElement[], prevAppState: InteractiveCanvasAppState, app: AppClassProperties | null): Mutable<Pick<InteractiveCanvasAppState, "selectedGroupIds" | "editingGroupId" | "selectedElementIds">>;
|
|
7
7
|
clearCache(): void;
|
|
@@ -10,15 +10,15 @@ export declare const selectGroupsForSelectedElements: {
|
|
|
10
10
|
* If the element's group is selected, don't render an individual
|
|
11
11
|
* selection border around it.
|
|
12
12
|
*/
|
|
13
|
-
export declare const isSelectedViaGroup: (appState: InteractiveCanvasAppState, element: ExcalidrawElement) => boolean;
|
|
13
|
+
export declare const isSelectedViaGroup: (appState: Pick<InteractiveCanvasAppState, "editingGroupId" | "selectedGroupIds">, element: ExcalidrawElement) => boolean;
|
|
14
14
|
export declare const getSelectedGroupForElement: (appState: Pick<InteractiveCanvasAppState, "editingGroupId" | "selectedGroupIds">, element: ExcalidrawElement) => string | undefined;
|
|
15
|
-
export declare const getSelectedGroupIds: (appState: InteractiveCanvasAppState) => GroupId[];
|
|
16
|
-
export declare const selectGroupsFromGivenElements: (elements: readonly
|
|
15
|
+
export declare const getSelectedGroupIds: (appState: Pick<InteractiveCanvasAppState, "selectedGroupIds">) => GroupId[];
|
|
16
|
+
export declare const selectGroupsFromGivenElements: (elements: readonly NonDeletedExcalidrawElement[], appState: InteractiveCanvasAppState) => {
|
|
17
17
|
[groupId: string]: boolean;
|
|
18
18
|
};
|
|
19
19
|
export declare const editGroupForSelectedElement: (appState: AppState, element: NonDeleted<ExcalidrawElement>) => AppState;
|
|
20
20
|
export declare const isElementInGroup: (element: ExcalidrawElement, groupId: string) => boolean;
|
|
21
|
-
export declare const getElementsInGroup: (elements: ElementsMapOrArray, groupId: string) =>
|
|
21
|
+
export declare const getElementsInGroup: <P extends NonDeletedExcalidrawElement | ExcalidrawElement>(elements: P extends NonDeletedExcalidrawElement ? NonDeletedElementsMapOrArray : ElementsMapOrArray, groupId: string) => P[];
|
|
22
22
|
export declare const getSelectedGroupIdForElement: (element: ExcalidrawElement, selectedGroupIds: {
|
|
23
23
|
[groupId: string]: boolean;
|
|
24
24
|
}) => string | undefined;
|
|
@@ -26,9 +26,9 @@ export declare const addToGroup: (prevGroupIds: ExcalidrawElement["groupIds"], n
|
|
|
26
26
|
export declare const removeFromSelectedGroups: (groupIds: ExcalidrawElement["groupIds"], selectedGroupIds: {
|
|
27
27
|
[groupId: string]: boolean;
|
|
28
28
|
}) => string[];
|
|
29
|
-
export declare const getMaximumGroups: (elements:
|
|
29
|
+
export declare const getMaximumGroups: <T extends NonDeletedExcalidrawElement | ExcalidrawElement>(elements: T[], elementsMap: ElementsMap) => T[][];
|
|
30
30
|
export declare const getNonDeletedGroupIds: (elements: ElementsMap) => Set<string>;
|
|
31
31
|
export declare const elementsAreInSameGroup: (elements: readonly ExcalidrawElement[]) => boolean;
|
|
32
|
-
export declare const isInGroup: (element:
|
|
32
|
+
export declare const isInGroup: (element: ExcalidrawElement) => boolean;
|
|
33
33
|
export declare const getNewGroupIdsForDuplication: (groupIds: ExcalidrawElement["groupIds"], editingGroupId: AppState["editingGroupId"], mapper: (groupId: GroupId) => GroupId) => string[];
|
|
34
|
-
export declare const getSelectedElementsByGroup: (selectedElements: ExcalidrawElement[], elementsMap: ElementsMap, appState: Readonly<AppState
|
|
34
|
+
export declare const getSelectedElementsByGroup: (selectedElements: ExcalidrawElement[], elementsMap: ElementsMap, appState: Readonly<Pick<AppState, "selectedGroupIds" | "editingGroupId">>) => NonDeletedExcalidrawElement[][];
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type Bounds } from "@excalidraw/common";
|
|
1
2
|
import type { LocalPoint, GlobalPoint, Vector } from "@excalidraw/math";
|
|
2
3
|
import type { ExcalidrawBindableElement } from "./types";
|
|
3
4
|
export declare const HEADING_RIGHT: Heading;
|
|
@@ -11,5 +12,5 @@ export declare const headingForPointIsHorizontal: <P extends GlobalPoint | Local
|
|
|
11
12
|
export declare const compareHeading: (a: Heading, b: Heading) => boolean;
|
|
12
13
|
export declare const headingIsHorizontal: (a: Heading) => boolean;
|
|
13
14
|
export declare const headingIsVertical: (a: Heading) => boolean;
|
|
14
|
-
export declare const headingForPointFromElement: <Point extends GlobalPoint>(element: Readonly<ExcalidrawBindableElement>, aabb:
|
|
15
|
+
export declare const headingForPointFromElement: <Point extends GlobalPoint>(element: Readonly<ExcalidrawBindableElement>, aabb: Readonly<Bounds>, p: Readonly<Point>) => Heading;
|
|
15
16
|
export declare const flipHeading: (h: Heading) => Heading;
|
|
@@ -10,17 +10,7 @@ export declare const updateImageCache: ({ fileIds, files, imageCache, }: {
|
|
|
10
10
|
}) => Promise<{
|
|
11
11
|
imageCache: Map<FileId, {
|
|
12
12
|
image: HTMLImageElement | Promise<HTMLImageElement>;
|
|
13
|
-
mimeType: import("@excalidraw/common/utility-types").ValueOf<
|
|
14
|
-
readonly svg: "image/svg+xml";
|
|
15
|
-
readonly png: "image/png";
|
|
16
|
-
readonly jpg: "image/jpeg";
|
|
17
|
-
readonly gif: "image/gif";
|
|
18
|
-
readonly webp: "image/webp";
|
|
19
|
-
readonly bmp: "image/bmp";
|
|
20
|
-
readonly ico: "image/x-icon";
|
|
21
|
-
readonly avif: "image/avif";
|
|
22
|
-
readonly jfif: "image/jfif";
|
|
23
|
-
}>;
|
|
13
|
+
mimeType: import("@excalidraw/common/utility-types").ValueOf<typeof import("@excalidraw/common").IMAGE_MIME_TYPES>;
|
|
24
14
|
}>;
|
|
25
15
|
/** includes errored files because they cache was updated nonetheless */
|
|
26
16
|
updatedFiles: Map<FileId, true>;
|
|
@@ -8,12 +8,9 @@ export declare const getSceneVersion: (elements: readonly ExcalidrawElement[]) =
|
|
|
8
8
|
*/
|
|
9
9
|
export declare const hashElementsVersion: (elements: ElementsMapOrArray) => number;
|
|
10
10
|
export declare const hashString: (s: string) => number;
|
|
11
|
+
export declare const isNonDeletedElement: <T extends ExcalidrawElement>(element: T) => element is NonDeleted<T>;
|
|
11
12
|
export declare const getVisibleElements: (elements: readonly ExcalidrawElement[]) => readonly NonDeletedExcalidrawElement[];
|
|
12
13
|
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
14
|
export * from "./align";
|
|
18
15
|
export * from "./binding";
|
|
19
16
|
export * from "./bounds";
|
|
@@ -30,6 +27,7 @@ export * from "./elbowArrow";
|
|
|
30
27
|
export * from "./elementLink";
|
|
31
28
|
export * from "./embeddable";
|
|
32
29
|
export * from "./flowchart";
|
|
30
|
+
export * from "./arrows/focus";
|
|
33
31
|
export * from "./fractionalIndex";
|
|
34
32
|
export * from "./frame";
|
|
35
33
|
export * from "./groups";
|
|
@@ -38,6 +36,7 @@ export * from "./image";
|
|
|
38
36
|
export * from "./linearElementEditor";
|
|
39
37
|
export * from "./mutateElement";
|
|
40
38
|
export * from "./newElement";
|
|
39
|
+
export * from "./positionElementsOnGrid";
|
|
41
40
|
export * from "./renderElement";
|
|
42
41
|
export * from "./resizeElements";
|
|
43
42
|
export * from "./resizeTest";
|
|
@@ -51,7 +50,10 @@ export * from "./store";
|
|
|
51
50
|
export * from "./textElement";
|
|
52
51
|
export * from "./textMeasurements";
|
|
53
52
|
export * from "./textWrapping";
|
|
53
|
+
export * from "./transform";
|
|
54
54
|
export * from "./transformHandles";
|
|
55
55
|
export * from "./typeChecks";
|
|
56
56
|
export * from "./utils";
|
|
57
57
|
export * from "./zindex";
|
|
58
|
+
export * from "./arrows/helpers";
|
|
59
|
+
export * from "./arrowheads";
|
|
@@ -1,65 +1,62 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { type GlobalPoint, type LocalPoint } from "@excalidraw/math";
|
|
3
2
|
import { type Store } from "@excalidraw/element";
|
|
4
3
|
import type { AppState, PointerCoords, InteractiveCanvasAppState, AppClassProperties, NullableGridSize, Zoom } from "@excalidraw/excalidraw/types";
|
|
4
|
+
import type { Bounds } from "@excalidraw/common";
|
|
5
5
|
import type { Scene } from "./Scene";
|
|
6
|
-
import type {
|
|
7
|
-
import type { NonDeleted, ExcalidrawLinearElement, ExcalidrawElement, PointBinding, ExcalidrawBindableElement, ExcalidrawTextElementWithContainer, ElementsMap, NonDeletedSceneElementsMap, ExcalidrawElbowArrowElement, PointsPositionUpdates } from "./types";
|
|
6
|
+
import type { NonDeleted, ExcalidrawLinearElement, ExcalidrawElement, ExcalidrawTextElementWithContainer, ElementsMap, NonDeletedSceneElementsMap, FixedPointBinding, ExcalidrawElbowArrowElement, PointsPositionUpdates } from "./types";
|
|
8
7
|
export declare class LinearElementEditor {
|
|
9
8
|
readonly elementId: ExcalidrawElement["id"] & {
|
|
10
9
|
_brand: "excalidrawLinearElementId";
|
|
11
10
|
};
|
|
12
11
|
/** indices */
|
|
13
12
|
readonly selectedPointsIndices: readonly number[] | null;
|
|
14
|
-
readonly
|
|
13
|
+
readonly initialState: Readonly<{
|
|
15
14
|
prevSelectedPointsIndices: readonly number[] | null;
|
|
16
15
|
/** index */
|
|
17
16
|
lastClickedPoint: number;
|
|
18
|
-
|
|
19
|
-
origin: Readonly<{
|
|
20
|
-
x: number;
|
|
21
|
-
y: number;
|
|
22
|
-
}> | null;
|
|
17
|
+
origin: Readonly<GlobalPoint> | null;
|
|
23
18
|
segmentMidpoint: {
|
|
24
19
|
value: GlobalPoint | null;
|
|
25
20
|
index: number | null;
|
|
26
21
|
added: boolean;
|
|
27
22
|
};
|
|
23
|
+
arrowStartIsInside: boolean;
|
|
24
|
+
altFocusPoint: Readonly<GlobalPoint> | null;
|
|
28
25
|
}>;
|
|
29
26
|
/** whether you're dragging a point */
|
|
30
27
|
readonly isDragging: boolean;
|
|
31
28
|
readonly lastUncommittedPoint: LocalPoint | null;
|
|
29
|
+
readonly lastCommittedPoint: LocalPoint | null;
|
|
32
30
|
readonly pointerOffset: Readonly<{
|
|
33
31
|
x: number;
|
|
34
32
|
y: number;
|
|
35
33
|
}>;
|
|
36
|
-
readonly startBindingElement: ExcalidrawBindableElement | null | "keep";
|
|
37
|
-
readonly endBindingElement: ExcalidrawBindableElement | null | "keep";
|
|
38
34
|
readonly hoverPointIndex: number;
|
|
39
35
|
readonly segmentMidPointHoveredCoords: GlobalPoint | null;
|
|
36
|
+
readonly hoveredFocusPointBinding: "start" | "end" | null;
|
|
37
|
+
readonly draggedFocusPointBinding: "start" | "end" | null;
|
|
40
38
|
readonly elbowed: boolean;
|
|
41
39
|
readonly customLineAngle: number | null;
|
|
42
40
|
readonly isEditing: boolean;
|
|
41
|
+
readonly pointerDownState: never;
|
|
43
42
|
constructor(element: NonDeleted<ExcalidrawLinearElement>, elementsMap: ElementsMap, isEditing?: boolean);
|
|
44
43
|
static POINT_HANDLE_SIZE: number;
|
|
45
44
|
/**
|
|
46
45
|
* @param id the `elementId` from the instance of this class (so that we can
|
|
47
46
|
* statically guarantee this method returns an ExcalidrawLinearElement)
|
|
48
47
|
*/
|
|
49
|
-
static getElement<T extends ExcalidrawLinearElement>(id: InstanceType<typeof LinearElementEditor>["elementId"], elementsMap: ElementsMap): T | null;
|
|
48
|
+
static getElement<T extends ExcalidrawLinearElement>(id: InstanceType<typeof LinearElementEditor>["elementId"], elementsMap: ElementsMap): NonDeleted<T> | null;
|
|
50
49
|
static handleBoxSelection(event: PointerEvent, appState: AppState, setState: React.Component<any, AppState>["setState"], elementsMap: NonDeletedSceneElementsMap): false | undefined;
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
*/
|
|
54
|
-
static handlePointDragging(event: PointerEvent, app: AppClassProperties, scenePointerX: number, scenePointerY: number, linearElementEditor: LinearElementEditor): Pick<AppState, keyof AppState> | null;
|
|
50
|
+
static handlePointerMove(event: PointerEvent, app: AppClassProperties, scenePointerX: number, scenePointerY: number, linearElementEditor: LinearElementEditor): Pick<AppState, "suggestedBinding" | "selectedLinearElement"> | null;
|
|
51
|
+
static handlePointDragging(event: PointerEvent, app: AppClassProperties, scenePointerX: number, scenePointerY: number, linearElementEditor: LinearElementEditor): Pick<AppState, "suggestedBinding" | "selectedLinearElement"> | null;
|
|
55
52
|
static handlePointerUp(event: PointerEvent, editingLinearElement: LinearElementEditor, appState: AppState, scene: Scene): LinearElementEditor;
|
|
56
|
-
static getEditorMidPoints: (element:
|
|
53
|
+
static getEditorMidPoints: (element: ExcalidrawLinearElement, elementsMap: ElementsMap, appState: InteractiveCanvasAppState) => (GlobalPoint | null)[];
|
|
57
54
|
static getSegmentMidpointHitCoords: (linearElementEditor: LinearElementEditor, scenePointer: {
|
|
58
55
|
x: number;
|
|
59
56
|
y: number;
|
|
60
57
|
}, appState: AppState, elementsMap: ElementsMap) => GlobalPoint | null;
|
|
61
|
-
static isSegmentTooShort<P extends GlobalPoint | LocalPoint>(element:
|
|
62
|
-
static getSegmentMidPoint(element:
|
|
58
|
+
static isSegmentTooShort<P extends GlobalPoint | LocalPoint>(element: ExcalidrawLinearElement, startPoint: P, endPoint: P, index: number, zoom: Zoom, elementsMap: ElementsMap): boolean;
|
|
59
|
+
static getSegmentMidPoint(element: ExcalidrawLinearElement, index: number, elementsMap: ElementsMap): GlobalPoint;
|
|
63
60
|
static getSegmentMidPointIndex(linearElementEditor: LinearElementEditor, appState: AppState, midPoint: GlobalPoint, elementsMap: ElementsMap): number;
|
|
64
61
|
static handlePointerDown(event: React.PointerEvent<HTMLElement>, app: AppClassProperties, store: Store, scenePointer: {
|
|
65
62
|
x: number;
|
|
@@ -70,16 +67,16 @@ export declare class LinearElementEditor {
|
|
|
70
67
|
linearElementEditor: LinearElementEditor | null;
|
|
71
68
|
};
|
|
72
69
|
static arePointsEqual<Point extends LocalPoint | GlobalPoint>(point1: Point | null, point2: Point | null): boolean;
|
|
73
|
-
static
|
|
70
|
+
static handlePointerMoveInEditMode(event: React.PointerEvent<HTMLCanvasElement>, scenePointerX: number, scenePointerY: number, app: AppClassProperties): LinearElementEditor | null;
|
|
74
71
|
/** scene coords */
|
|
75
|
-
static getPointGlobalCoordinates(element:
|
|
72
|
+
static getPointGlobalCoordinates(element: ExcalidrawLinearElement, p: LocalPoint, elementsMap: ElementsMap): GlobalPoint;
|
|
76
73
|
/** scene coords */
|
|
77
|
-
static getPointsGlobalCoordinates(element:
|
|
78
|
-
static getPointAtIndexGlobalCoordinates(element:
|
|
74
|
+
static getPointsGlobalCoordinates(element: ExcalidrawLinearElement, elementsMap: ElementsMap): GlobalPoint[];
|
|
75
|
+
static getPointAtIndexGlobalCoordinates(element: ExcalidrawLinearElement, indexMaybeFromEnd: number, // -1 for last element
|
|
79
76
|
elementsMap: ElementsMap): GlobalPoint;
|
|
80
|
-
static pointFromAbsoluteCoords(element:
|
|
81
|
-
static getPointIndexUnderCursor(element:
|
|
82
|
-
static createPointAt(element:
|
|
77
|
+
static pointFromAbsoluteCoords(element: ExcalidrawLinearElement, absoluteCoords: GlobalPoint, elementsMap: ElementsMap): LocalPoint;
|
|
78
|
+
static getPointIndexUnderCursor(element: ExcalidrawLinearElement, elementsMap: ElementsMap, zoom: AppState["zoom"], x: number, y: number): number;
|
|
79
|
+
static createPointAt(element: ExcalidrawLinearElement, elementsMap: ElementsMap, scenePointerX: number, scenePointerY: number, gridSize: NullableGridSize): LocalPoint;
|
|
83
80
|
/**
|
|
84
81
|
* Normalizes line points so that the start point is at [0,0]. This is
|
|
85
82
|
* expected in various parts of the codebase.
|
|
@@ -96,12 +93,16 @@ export declare class LinearElementEditor {
|
|
|
96
93
|
static deletePoints(element: NonDeleted<ExcalidrawLinearElement>, app: AppClassProperties, pointIndices: readonly number[]): void;
|
|
97
94
|
static addPoints(element: NonDeleted<ExcalidrawLinearElement>, scene: Scene, addedPoints: LocalPoint[]): void;
|
|
98
95
|
static movePoints(element: NonDeleted<ExcalidrawLinearElement>, scene: Scene, pointUpdates: PointsPositionUpdates, otherUpdates?: {
|
|
99
|
-
startBinding?:
|
|
100
|
-
endBinding?:
|
|
96
|
+
startBinding?: FixedPointBinding | null;
|
|
97
|
+
endBinding?: FixedPointBinding | null;
|
|
98
|
+
moveMidPointsWithElement?: boolean | null;
|
|
99
|
+
}, options?: {
|
|
100
|
+
isBindingEnabled?: boolean;
|
|
101
|
+
isMidpointSnappingEnabled?: boolean;
|
|
101
102
|
}): void;
|
|
102
103
|
static shouldAddMidpoint(linearElementEditor: LinearElementEditor, pointerCoords: PointerCoords, appState: AppState, elementsMap: ElementsMap): boolean;
|
|
103
104
|
static addMidpoint(linearElementEditor: LinearElementEditor, pointerCoords: PointerCoords, app: AppClassProperties, snapToGrid: boolean, scene: Scene): {
|
|
104
|
-
pointerDownState: LinearElementEditor["
|
|
105
|
+
pointerDownState: LinearElementEditor["initialState"];
|
|
105
106
|
selectedPointsIndices: LinearElementEditor["selectedPointsIndices"];
|
|
106
107
|
} | undefined;
|
|
107
108
|
private static _updatePoints;
|
|
@@ -112,6 +113,6 @@ export declare class LinearElementEditor {
|
|
|
112
113
|
};
|
|
113
114
|
static getMinMaxXYWithBoundText: (element: ExcalidrawLinearElement, elementsMap: ElementsMap, elementBounds: Bounds, boundTextElement: ExcalidrawTextElementWithContainer) => [number, number, number, number, number, number];
|
|
114
115
|
static getElementAbsoluteCoords: (element: ExcalidrawLinearElement, elementsMap: ElementsMap, includeBoundText?: boolean) => [number, number, number, number, number, number];
|
|
115
|
-
static moveFixedSegment(linearElement: LinearElementEditor, index: number, x: number, y: number, scene: Scene): LinearElementEditor
|
|
116
|
+
static moveFixedSegment(linearElement: LinearElementEditor, index: number, x: number, y: number, scene: Scene): Pick<LinearElementEditor, "segmentMidPointHoveredCoords" | "initialState">;
|
|
116
117
|
static deleteFixedSegment(element: ExcalidrawElbowArrowElement, scene: Scene, index: number): void;
|
|
117
118
|
}
|
|
@@ -11,8 +11,12 @@ export type ElementUpdate<TElement extends ExcalidrawElement> = Omit<Partial<TEl
|
|
|
11
11
|
*/
|
|
12
12
|
export declare const mutateElement: <TElement extends Mutable<ExcalidrawElement>>(element: TElement, elementsMap: ElementsMap, updates: ElementUpdate<TElement>, options?: {
|
|
13
13
|
isDragging?: boolean;
|
|
14
|
+
isBindingEnabled?: boolean;
|
|
15
|
+
isMidpointSnappingEnabled?: boolean;
|
|
14
16
|
}) => TElement;
|
|
15
|
-
export declare const newElementWith: <TElement extends ExcalidrawElement>(element: TElement, updates: ElementUpdate<TElement>,
|
|
17
|
+
export declare const newElementWith: <TElement extends ExcalidrawElement>(element: TElement, updates: ElementUpdate<TElement>,
|
|
18
|
+
/** pass `true` to always regenerate */
|
|
19
|
+
force?: boolean) => TElement;
|
|
16
20
|
/**
|
|
17
21
|
* Mutates element, bumping `version`, `versionNonce`, and `updated`.
|
|
18
22
|
*
|
|
@@ -38,6 +38,7 @@ export declare const newFreeDrawElement: (opts: {
|
|
|
38
38
|
type: "freedraw";
|
|
39
39
|
points?: ExcalidrawFreeDrawElement["points"];
|
|
40
40
|
simulatePressure: boolean;
|
|
41
|
+
strokeOptions?: ExcalidrawFreeDrawElement["strokeOptions"];
|
|
41
42
|
pressures?: ExcalidrawFreeDrawElement["pressures"];
|
|
42
43
|
} & ElementConstructorOpts) => NonDeleted<ExcalidrawFreeDrawElement>;
|
|
43
44
|
export declare const newLinearElement: (opts: {
|
|
@@ -47,12 +48,12 @@ export declare const newLinearElement: (opts: {
|
|
|
47
48
|
} & ElementConstructorOpts) => NonDeleted<ExcalidrawLinearElement>;
|
|
48
49
|
export declare const newArrowElement: <T extends boolean>(opts: {
|
|
49
50
|
type: ExcalidrawArrowElement["type"];
|
|
50
|
-
startArrowhead?: Arrowhead | null
|
|
51
|
-
endArrowhead?: Arrowhead | null
|
|
52
|
-
points?:
|
|
53
|
-
elbowed?: T
|
|
54
|
-
fixedSegments?:
|
|
55
|
-
} &
|
|
51
|
+
startArrowhead?: Arrowhead | null;
|
|
52
|
+
endArrowhead?: Arrowhead | null;
|
|
53
|
+
points?: ExcalidrawArrowElement["points"];
|
|
54
|
+
elbowed?: T;
|
|
55
|
+
fixedSegments?: ExcalidrawElbowArrowElement["fixedSegments"] | null;
|
|
56
|
+
} & ElementConstructorOpts) => T extends true ? NonDeleted<ExcalidrawElbowArrowElement> : NonDeleted<ExcalidrawArrowElement>;
|
|
56
57
|
export declare const newImageElement: (opts: {
|
|
57
58
|
type: ExcalidrawImageElement["type"];
|
|
58
59
|
status?: ExcalidrawImageElement["status"];
|
|
@@ -1,28 +1,22 @@
|
|
|
1
|
+
import { type GlobalPoint } from "@excalidraw/math";
|
|
1
2
|
import type { AppState, StaticCanvasAppState, InteractiveCanvasAppState, ElementsPendingErasure, PendingExcalidrawElements } from "@excalidraw/excalidraw/types";
|
|
2
3
|
import type { StaticCanvasRenderConfig, RenderableElementsMap, InteractiveCanvasRenderConfig } from "@excalidraw/excalidraw/scene/types";
|
|
3
|
-
import type { ExcalidrawElement, ExcalidrawTextElement, NonDeletedExcalidrawElement, ExcalidrawFreeDrawElement, ExcalidrawImageElement, ExcalidrawFrameLikeElement, NonDeletedSceneElementsMap } from "./types";
|
|
4
|
+
import type { ExcalidrawElement, ExcalidrawTextElement, NonDeletedExcalidrawElement, ExcalidrawFreeDrawElement, ExcalidrawImageElement, ExcalidrawFrameLikeElement, NonDeletedSceneElementsMap, ElementsMap } from "./types";
|
|
4
5
|
import type { RoughCanvas } from "roughjs/bin/canvas";
|
|
5
|
-
export declare const IMAGE_INVERT_FILTER = "invert(100%) hue-rotate(180deg) saturate(1.25)";
|
|
6
6
|
export declare const getRenderOpacity: (element: ExcalidrawElement, containingFrame: ExcalidrawFrameLikeElement | null, elementsPendingErasure: ElementsPendingErasure, pendingNodes: Readonly<PendingExcalidrawElements> | null, globalAlpha?: number) => number;
|
|
7
7
|
export interface ExcalidrawElementWithCanvas {
|
|
8
8
|
element: ExcalidrawElement | ExcalidrawTextElement;
|
|
9
9
|
canvas: HTMLCanvasElement;
|
|
10
10
|
theme: AppState["theme"];
|
|
11
11
|
scale: number;
|
|
12
|
-
angle: number;
|
|
13
12
|
zoomValue: AppState["zoom"]["value"];
|
|
14
13
|
canvasOffsetX: number;
|
|
15
14
|
canvasOffsetY: number;
|
|
16
|
-
boundTextElementVersion: number | null;
|
|
17
15
|
imageCrop: ExcalidrawImageElement["crop"] | null;
|
|
18
16
|
containingFrameOpacity: number;
|
|
19
|
-
boundTextCanvas: HTMLCanvasElement;
|
|
20
17
|
}
|
|
21
18
|
export declare const DEFAULT_LINK_SIZE = 14;
|
|
22
19
|
export declare const elementWithCanvasCache: WeakMap<ExcalidrawElement, ExcalidrawElementWithCanvas>;
|
|
23
20
|
export declare const renderSelectionElement: (element: NonDeletedExcalidrawElement, context: CanvasRenderingContext2D, appState: InteractiveCanvasAppState, selectionColor: InteractiveCanvasRenderConfig["selectionColor"]) => void;
|
|
24
|
-
export declare const renderElement: (element: NonDeletedExcalidrawElement, elementsMap: RenderableElementsMap, allElementsMap: NonDeletedSceneElementsMap, rc: RoughCanvas, context: CanvasRenderingContext2D, renderConfig: StaticCanvasRenderConfig, appState: StaticCanvasAppState) => void;
|
|
25
|
-
export declare
|
|
26
|
-
export declare function generateFreeDrawShape(element: ExcalidrawFreeDrawElement): Path2D;
|
|
27
|
-
export declare function getFreeDrawPath2D(element: ExcalidrawFreeDrawElement): Path2D | undefined;
|
|
28
|
-
export declare function getFreeDrawSvgPath(element: ExcalidrawFreeDrawElement): string;
|
|
21
|
+
export declare const renderElement: (element: NonDeletedExcalidrawElement, elementsMap: RenderableElementsMap, allElementsMap: NonDeletedSceneElementsMap, rc: RoughCanvas, context: CanvasRenderingContext2D, renderConfig: StaticCanvasRenderConfig, appState: StaticCanvasAppState | InteractiveCanvasAppState) => void;
|
|
22
|
+
export declare function getFreedrawOutlineAsSegments(element: ExcalidrawFreeDrawElement, points: [number, number][], elementsMap: ElementsMap): import("@excalidraw/math").LineSegment<GlobalPoint>[];
|