@excalidraw/element 0.18.0-1b287a8ba → 0.18.0-214cd6e
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 +11021 -5814
- 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 +73 -39
- package/dist/types/common/src/constants.d.ts +50 -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 +3 -1
- package/dist/types/common/src/points.d.ts +1 -1
- package/dist/types/common/src/utility-types.d.ts +0 -1
- package/dist/types/common/src/utils.d.ts +47 -77
- package/dist/types/common/src/versionedSnapshotStore.d.ts +17 -0
- package/dist/types/element/src/Scene.d.ts +17 -9
- package/dist/types/element/src/align.d.ts +2 -2
- package/dist/types/element/src/arrowEndpointText.d.ts +49 -0
- package/dist/types/element/src/arrowheads.d.ts +3 -0
- package/dist/types/element/src/arrows/focus.d.ts +30 -0
- package/dist/types/element/src/arrows/helpers.d.ts +5 -0
- package/dist/types/element/src/binding.d.ts +79 -51
- package/dist/types/element/src/bounds.d.ts +26 -19
- package/dist/types/element/src/bucketFill.d.ts +110 -0
- 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/convertToShape.d.ts +23 -0
- package/dist/types/element/src/delta.d.ts +16 -4
- package/dist/types/element/src/distribute.d.ts +3 -2
- package/dist/types/element/src/dragElements.d.ts +30 -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 +7 -7
- 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 +9 -4
- package/dist/types/element/src/linearElementEditor.d.ts +50 -31
- package/dist/types/element/src/mutateElement.d.ts +5 -1
- package/dist/types/element/src/newElement.d.ts +21 -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 +21 -8
- package/dist/types/element/src/sortElements.d.ts +10 -0
- package/dist/types/element/src/store.d.ts +6 -1
- package/dist/types/element/src/textElement.d.ts +15 -11
- 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 +27 -14
- package/dist/types/element/src/utils.d.ts +15 -6
- 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 +173 -189
- package/dist/types/excalidraw/actions/actionAlign.d.ts +12 -13
- package/dist/types/excalidraw/actions/actionBoundText.d.ts +122 -133
- package/dist/types/excalidraw/actions/actionCanvas.d.ts +446 -1576
- package/dist/types/excalidraw/actions/actionClipboard.d.ts +124 -879
- package/dist/types/excalidraw/actions/actionCropEditor.d.ts +59 -65
- package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +198 -217
- package/dist/types/excalidraw/actions/actionDeselect.d.ts +165 -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 +51 -63
- package/dist/types/excalidraw/actions/actionElementLock.d.ts +121 -132
- package/dist/types/excalidraw/actions/actionExport.d.ts +200 -1423
- package/dist/types/excalidraw/actions/actionFinalize.d.ts +11 -395
- package/dist/types/excalidraw/actions/actionFlip.d.ts +2 -3
- package/dist/types/excalidraw/actions/actionFrame.d.ts +283 -522
- package/dist/types/excalidraw/actions/actionGroup.d.ts +132 -151
- package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +195 -205
- package/dist/types/excalidraw/actions/actionLink.d.ts +58 -64
- package/dist/types/excalidraw/actions/actionMenu.d.ts +50 -430
- package/dist/types/excalidraw/actions/actionNavigate.d.ts +18 -361
- package/dist/types/excalidraw/actions/actionProperties.d.ts +204 -2546
- package/dist/types/excalidraw/actions/actionSelectAll.d.ts +66 -76
- package/dist/types/excalidraw/actions/actionStyles.d.ts +59 -64
- package/dist/types/excalidraw/actions/actionTextAutoResize.d.ts +3 -3
- package/dist/types/excalidraw/actions/{actionEmbeddable.d.ts → actionToggleArrowBinding.d.ts} +74 -79
- package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +63 -70
- package/dist/types/excalidraw/actions/actionToggleMidpointSnapping.d.ts +181 -0
- package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +60 -66
- package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +51 -64
- package/dist/types/excalidraw/actions/actionToggleShapeSwitch.d.ts +2 -2
- package/dist/types/excalidraw/actions/actionToggleStats.d.ts +60 -66
- package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +61 -67
- package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +61 -67
- package/dist/types/excalidraw/actions/actionZindex.d.ts +2 -3
- package/dist/types/excalidraw/actions/index.d.ts +5 -3
- package/dist/types/excalidraw/actions/manager.d.ts +1 -0
- 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 +11 -7
- package/dist/types/excalidraw/{animated-trail.d.ts → animatedTrail.d.ts} +4 -3
- package/dist/types/excalidraw/appState.d.ts +32 -18
- 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 +32 -14
- package/dist/types/excalidraw/components/ActiveConfirmDialog.d.ts +1 -1
- package/dist/types/excalidraw/components/App.arrowText.d.ts +104 -0
- package/dist/types/excalidraw/components/App.bucketFill.d.ts +48 -0
- package/dist/types/excalidraw/components/App.cursor.d.ts +38 -0
- package/dist/types/excalidraw/components/App.d.ts +480 -125
- package/dist/types/excalidraw/components/App.drawshape.d.ts +55 -0
- package/dist/types/excalidraw/components/App.flowchart.d.ts +21 -0
- package/dist/types/excalidraw/components/App.viewport.d.ts +73 -0
- 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 +9 -4
- package/dist/types/excalidraw/components/ColorPicker/CustomColorList.d.ts +3 -1
- package/dist/types/excalidraw/components/ColorPicker/Picker.d.ts +5 -1
- package/dist/types/excalidraw/components/ColorPicker/PickerColorList.d.ts +10 -2
- package/dist/types/excalidraw/components/ColorPicker/ShadeList.d.ts +5 -2
- package/dist/types/excalidraw/components/ColorPicker/TopPicks.d.ts +8 -1
- package/dist/types/excalidraw/components/ColorPicker/colorPickerUtils.d.ts +1 -2
- package/dist/types/excalidraw/components/ColorPicker/keyboardNavHandlers.d.ts +2 -2
- package/dist/types/excalidraw/components/ColorPicker/topPicksDnD.d.ts +31 -0
- 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/{ToolButton.d.ts → IconButton.d.ts} +16 -19
- 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/LaserPointerButton.d.ts +2 -4
- package/dist/types/excalidraw/components/LayerUI.d.ts +6 -2
- 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/LockButton.d.ts +3 -4
- package/dist/types/excalidraw/components/MagicButton.d.ts +0 -2
- package/dist/types/excalidraw/components/MobileMenu.d.ts +5 -7
- package/dist/types/excalidraw/components/MobileToolbar.d.ts +9 -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/PenModeButton.d.ts +2 -5
- package/dist/types/excalidraw/components/Popover.d.ts +2 -3
- package/dist/types/excalidraw/components/PropertiesPopover.d.ts +2 -1
- package/dist/types/excalidraw/components/{ButtonIcon.d.ts → RadioButton.d.ts} +2 -5
- 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 +22 -0
- package/dist/types/excalidraw/components/Toolbar.d.ts +11 -0
- package/dist/types/excalidraw/components/Tools.d.ts +146 -0
- package/dist/types/excalidraw/components/Trans.d.ts +2 -2
- package/dist/types/excalidraw/components/UserList.d.ts +3 -2
- package/dist/types/excalidraw/components/ViewportStatusFrame/ViewportStatusFrame.d.ts +11 -0
- package/dist/types/excalidraw/components/canvases/InteractiveCanvas.d.ts +10 -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/footer/Footer.d.ts +3 -1
- 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 +55 -22
- 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/positionElementBesideCursor.d.ts +26 -0
- package/dist/types/excalidraw/components/shapeActionPredicates.d.ts +39 -0
- package/dist/types/excalidraw/data/blob.d.ts +345 -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 +178 -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 +27 -7
- package/dist/types/excalidraw/data/types.d.ts +4 -1
- package/dist/types/excalidraw/drawShapeTrail.d.ts +16 -0
- 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/fonts/Fonts.d.ts +3 -2
- 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/lasso/utils.d.ts +2 -0
- 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/renderer/staticScene.d.ts +4 -1
- package/dist/types/excalidraw/scene/Renderer.d.ts +429 -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 +26 -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 +559 -58
- package/dist/types/excalidraw/viewport.d.ts +275 -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 +36 -0
- package/dist/types/math/src/constants.d.ts +0 -1
- package/dist/types/math/src/curve.d.ts +23 -13
- package/dist/types/math/src/index.d.ts +1 -0
- package/dist/types/math/src/pca.d.ts +79 -0
- package/dist/types/math/src/point.d.ts +8 -2
- package/dist/types/math/src/polygon.d.ts +26 -2
- package/dist/types/math/src/range.d.ts +1 -3
- package/dist/types/math/src/segment.d.ts +10 -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/FollowMode/FollowMode.d.ts +0 -10
- package/dist/types/excalidraw/components/HandButton.d.ts +0 -10
- 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/shapes.d.ts +0 -62
- 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/cursor.d.ts +0 -5
- package/dist/types/excalidraw/data/reconcile.d.ts +0 -6
- 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/excalidraw/scene/zoom.d.ts +0 -12
- package/dist/types/utils/src/bbox.d.ts +0 -9
- package/dist/types/utils/src/withinBounds.d.ts +0 -19
|
@@ -1,39 +1,65 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { type EXPORT_IMAGE_TYPES, Emitter } from "@excalidraw/common";
|
|
3
|
-
import { LinearElementEditor,
|
|
4
|
-
import type {
|
|
2
|
+
import { AppEventBus, type EXPORT_IMAGE_TYPES, Emitter, type EditorInterface, type StylesPanelMode } from "@excalidraw/common";
|
|
3
|
+
import { LinearElementEditor, Scene, Store, type ElementUpdate, StoreDelta, type ApplyToOptions } from "@excalidraw/element";
|
|
4
|
+
import type { LocalPoint, Radians } from "@excalidraw/math";
|
|
5
|
+
import type { ExcalidrawElement, ExcalidrawTextElement, NonDeleted, NonDeletedExcalidrawElement, ExcalidrawTextContainer, ExcalidrawFrameLikeElement, ExcalidrawIframeElement, ExcalidrawEmbeddableElement, Ordered, SceneElementsMap } from "@excalidraw/element/types";
|
|
5
6
|
import type { Mutable } from "@excalidraw/common/utility-types";
|
|
6
7
|
import { ActionManager } from "../actions/manager";
|
|
7
|
-
import { AnimationFrameHandler } from "../animation-frame-handler";
|
|
8
8
|
import { History } from "../history";
|
|
9
9
|
import { Fonts } from "../fonts";
|
|
10
10
|
import { type WritableAtom } from "../editor-jotai";
|
|
11
11
|
import { Renderer } from "../scene/Renderer";
|
|
12
|
-
import {
|
|
12
|
+
import { type SetViewportOptions } from "../viewport";
|
|
13
|
+
import { LaserTrails } from "../laserTrails";
|
|
14
|
+
import { isOverScrollBars } from "../scene/scrollbars";
|
|
13
15
|
import { LassoTrail } from "../lasso";
|
|
14
16
|
import { EraserTrail } from "../eraser";
|
|
17
|
+
import { AppArrowText } from "./App.arrowText";
|
|
18
|
+
import { AppBucketFill } from "./App.bucketFill";
|
|
19
|
+
import { AppCursor } from "./App.cursor";
|
|
20
|
+
import { AppDrawShape } from "./App.drawshape";
|
|
21
|
+
import { AppFlowchart } from "./App.flowchart";
|
|
22
|
+
import { AppViewport } from "./App.viewport";
|
|
23
|
+
import { CursorHints } from "./CursorHint";
|
|
24
|
+
import { type OnStateChange } from "./AppStateObserver";
|
|
15
25
|
import type { ExportedElements } from "../data";
|
|
16
|
-
import type {
|
|
17
|
-
import type { AppClassProperties, AppProps, AppState, ExcalidrawImperativeAPI, BinaryFiles, LibraryItems, SceneData, Device, FrameNameBoundsCache, SidebarName, SidebarTabName, ToolType, OnUserFollowedPayload, GenerateDiagramToCode, NullableGridSize, Offsets } from "../types";
|
|
26
|
+
import type { AppClassProperties, AppProps, AppState, ExcalidrawImperativeAPI, BinaryFiles, LibraryItems, SceneData, FrameNameBoundsCache, SidebarName, SidebarTabName, ToolType, OnUserFollowedPayload, ExcalidrawImperativeAPIEventMap, GenerateDiagramToCode, NullableGridSize, UIConfig } from "../types";
|
|
18
27
|
import type { RoughCanvas } from "roughjs/bin/canvas";
|
|
19
28
|
import type { ActionResult } from "../actions/types";
|
|
29
|
+
declare const editorLifecycleEventBehavior: {
|
|
30
|
+
readonly "editor:mount": {
|
|
31
|
+
readonly cardinality: "once";
|
|
32
|
+
readonly replay: "last";
|
|
33
|
+
};
|
|
34
|
+
readonly "editor:initialize": {
|
|
35
|
+
readonly cardinality: "once";
|
|
36
|
+
readonly replay: "last";
|
|
37
|
+
};
|
|
38
|
+
readonly "editor:unmount": {
|
|
39
|
+
readonly cardinality: "once";
|
|
40
|
+
readonly replay: "last";
|
|
41
|
+
};
|
|
42
|
+
};
|
|
20
43
|
export declare const ExcalidrawContainerContext: React.Context<{
|
|
21
44
|
container: HTMLDivElement | null;
|
|
22
45
|
id: string | null;
|
|
23
46
|
}>;
|
|
47
|
+
export declare const ExcalidrawAPIContext: React.Context<ExcalidrawImperativeAPI | null>;
|
|
48
|
+
export declare const ExcalidrawAPISetContext: React.Context<((api: ExcalidrawImperativeAPI | null) => void) | null>;
|
|
24
49
|
export declare const useApp: () => AppClassProperties;
|
|
25
50
|
export declare const useAppProps: () => AppProps;
|
|
26
|
-
export declare const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
canFitSidebar: boolean;
|
|
34
|
-
};
|
|
51
|
+
export declare const useEditorInterface: () => Readonly<{
|
|
52
|
+
formFactor: "phone" | "tablet" | "desktop";
|
|
53
|
+
desktopUIMode: "compact" | "full";
|
|
54
|
+
userAgent: Readonly<{
|
|
55
|
+
isMobileDevice: boolean;
|
|
56
|
+
platform: "ios" | "android" | "other" | "unknown";
|
|
57
|
+
}>;
|
|
35
58
|
isTouchScreen: boolean;
|
|
59
|
+
canFitSidebar: boolean;
|
|
60
|
+
isLandscape: boolean;
|
|
36
61
|
}>;
|
|
62
|
+
export declare const useStylesPanelMode: () => StylesPanelMode;
|
|
37
63
|
export declare const useExcalidrawContainer: () => {
|
|
38
64
|
container: HTMLDivElement | null;
|
|
39
65
|
id: string | null;
|
|
@@ -42,20 +68,30 @@ export declare const useExcalidrawElements: () => readonly NonDeletedExcalidrawE
|
|
|
42
68
|
export declare const useExcalidrawAppState: () => AppState;
|
|
43
69
|
export declare const useExcalidrawSetAppState: () => <K extends keyof AppState>(state: AppState | ((prevState: Readonly<AppState>, props: Readonly<any>) => AppState | Pick<AppState, K> | null) | Pick<AppState, K> | null, callback?: (() => void) | undefined) => void;
|
|
44
70
|
export declare const useExcalidrawActionManager: () => ActionManager;
|
|
71
|
+
/**
|
|
72
|
+
* Requires wrapping your component in <ExcalidrawAPIContext.Provider>
|
|
73
|
+
*/
|
|
74
|
+
export declare const useExcalidrawAPI: () => ExcalidrawImperativeAPI | null;
|
|
45
75
|
declare class App extends React.Component<AppProps, AppState> {
|
|
46
76
|
canvas: AppClassProperties["canvas"];
|
|
47
77
|
interactiveCanvas: AppClassProperties["interactiveCanvas"];
|
|
78
|
+
sessionExportThemeOverride: AppState["theme"] | undefined;
|
|
48
79
|
rc: RoughCanvas;
|
|
49
80
|
unmounted: boolean;
|
|
50
81
|
actionManager: ActionManager;
|
|
51
|
-
|
|
82
|
+
editorInterface: EditorInterface;
|
|
83
|
+
private stylesPanelMode;
|
|
52
84
|
private excalidrawContainerRef;
|
|
85
|
+
get ownerDocument(): Document;
|
|
86
|
+
get ownerWindow(): Window & typeof globalThis;
|
|
53
87
|
scene: Scene;
|
|
54
88
|
fonts: Fonts;
|
|
55
89
|
renderer: Renderer;
|
|
56
90
|
visibleElements: readonly NonDeletedExcalidrawElement[];
|
|
91
|
+
/** whether the last render had any renderable elements (excludes e.g. the
|
|
92
|
+
* in-progress `newElement` and the edited text element) */
|
|
93
|
+
private hasRenderableElements;
|
|
57
94
|
private resizeObserver;
|
|
58
|
-
private nearestScrollableContainer;
|
|
59
95
|
library: AppClassProperties["library"];
|
|
60
96
|
libraryItemsFromStorage: LibraryItems | undefined;
|
|
61
97
|
id: string;
|
|
@@ -78,26 +114,40 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
78
114
|
/** embeds that have been inserted to DOM (as a perf optim, we don't want to
|
|
79
115
|
* insert to DOM before user initially scrolls to them) */
|
|
80
116
|
private initializedEmbeds;
|
|
81
|
-
private handleToastClose;
|
|
82
117
|
private elementsPendingErasure;
|
|
83
|
-
|
|
84
|
-
private
|
|
118
|
+
private _initialized;
|
|
119
|
+
private readonly editorLifecycleEvents;
|
|
120
|
+
onEvent: AppEventBus<ExcalidrawImperativeAPIEventMap, typeof editorLifecycleEventBehavior>["on"];
|
|
121
|
+
private appStateObserver;
|
|
122
|
+
onStateChange: OnStateChange;
|
|
123
|
+
bucketFill: AppBucketFill;
|
|
124
|
+
flowchart: AppFlowchart;
|
|
125
|
+
cursor: AppCursor;
|
|
126
|
+
arrowText: AppArrowText;
|
|
127
|
+
viewport: AppViewport;
|
|
128
|
+
bindModeHandler: ReturnType<typeof setTimeout> | null;
|
|
129
|
+
private textWysiwygSubmitHandler;
|
|
85
130
|
hitLinkElement?: NonDeletedExcalidrawElement;
|
|
86
131
|
lastPointerDownEvent: React.PointerEvent<HTMLElement> | null;
|
|
87
132
|
lastPointerUpEvent: React.PointerEvent<HTMLElement> | PointerEvent | null;
|
|
133
|
+
lastPointerUpIsDoubleClick: boolean;
|
|
88
134
|
lastPointerMoveEvent: PointerEvent | null;
|
|
135
|
+
/** current frame pointer cords */
|
|
89
136
|
lastPointerMoveCoords: {
|
|
90
137
|
x: number;
|
|
91
138
|
y: number;
|
|
92
139
|
} | null;
|
|
93
|
-
|
|
140
|
+
private lastCompletedCanvasClicks;
|
|
141
|
+
/** previous frame pointer coords */
|
|
142
|
+
previousPointerMoveCoords: {
|
|
94
143
|
x: number;
|
|
95
144
|
y: number;
|
|
96
|
-
};
|
|
97
|
-
|
|
145
|
+
} | null;
|
|
146
|
+
drawShape: AppDrawShape;
|
|
98
147
|
laserTrails: LaserTrails;
|
|
99
148
|
eraserTrail: EraserTrail;
|
|
100
149
|
lassoTrail: LassoTrail;
|
|
150
|
+
cursorHints: CursorHints;
|
|
101
151
|
onChangeEmitter: Emitter<[elements: readonly ExcalidrawElement[], appState: AppState, files: BinaryFiles]>;
|
|
102
152
|
onPointerDownEmitter: Emitter<[activeTool: {
|
|
103
153
|
lastActiveTool: import("../types").ActiveTool | null;
|
|
@@ -112,11 +162,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
112
162
|
x: number;
|
|
113
163
|
y: number;
|
|
114
164
|
}>;
|
|
115
|
-
scrollbars:
|
|
116
|
-
isOverEither: boolean;
|
|
117
|
-
isOverHorizontal: boolean;
|
|
118
|
-
isOverVertical: boolean;
|
|
119
|
-
};
|
|
165
|
+
scrollbars: ReturnType<typeof isOverScrollBars>;
|
|
120
166
|
lastCoords: {
|
|
121
167
|
x: number;
|
|
122
168
|
y: number;
|
|
@@ -129,7 +175,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
129
175
|
x: number;
|
|
130
176
|
y: number;
|
|
131
177
|
};
|
|
132
|
-
arrowDirection: "
|
|
178
|
+
arrowDirection: "origin" | "end";
|
|
133
179
|
center: {
|
|
134
180
|
x: number;
|
|
135
181
|
y: number;
|
|
@@ -141,6 +187,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
141
187
|
wasAddedToSelection: boolean;
|
|
142
188
|
hasBeenDuplicated: boolean;
|
|
143
189
|
hasHitCommonBoundingBoxOfSelectedElements: boolean;
|
|
190
|
+
arrowLabel: boolean;
|
|
144
191
|
};
|
|
145
192
|
withCmdOrCtrl: boolean;
|
|
146
193
|
drag: {
|
|
@@ -153,16 +200,13 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
153
200
|
x: number;
|
|
154
201
|
y: number;
|
|
155
202
|
};
|
|
203
|
+
blockDragging: boolean;
|
|
156
204
|
};
|
|
157
205
|
eventListeners: {
|
|
158
|
-
onMove:
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
} | null;
|
|
163
|
-
onUp: ((event: PointerEvent) => void) | null;
|
|
164
|
-
onKeyDown: ((event: KeyboardEvent) => void) | null;
|
|
165
|
-
onKeyUp: ((event: KeyboardEvent) => void) | null;
|
|
206
|
+
onMove: null | ReturnType<typeof import("@excalidraw/common").throttleRAF>;
|
|
207
|
+
onUp: null | ((event: PointerEvent) => void);
|
|
208
|
+
onKeyDown: null | ((event: KeyboardEvent) => void);
|
|
209
|
+
onKeyUp: null | ((event: KeyboardEvent) => void);
|
|
166
210
|
};
|
|
167
211
|
boxSelection: {
|
|
168
212
|
hasOccurred: boolean;
|
|
@@ -181,11 +225,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
181
225
|
x: number;
|
|
182
226
|
y: number;
|
|
183
227
|
}>;
|
|
184
|
-
scrollbars:
|
|
185
|
-
isOverEither: boolean;
|
|
186
|
-
isOverHorizontal: boolean;
|
|
187
|
-
isOverVertical: boolean;
|
|
188
|
-
};
|
|
228
|
+
scrollbars: ReturnType<typeof isOverScrollBars>;
|
|
189
229
|
lastCoords: {
|
|
190
230
|
x: number;
|
|
191
231
|
y: number;
|
|
@@ -198,7 +238,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
198
238
|
x: number;
|
|
199
239
|
y: number;
|
|
200
240
|
};
|
|
201
|
-
arrowDirection: "
|
|
241
|
+
arrowDirection: "origin" | "end";
|
|
202
242
|
center: {
|
|
203
243
|
x: number;
|
|
204
244
|
y: number;
|
|
@@ -210,6 +250,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
210
250
|
wasAddedToSelection: boolean;
|
|
211
251
|
hasBeenDuplicated: boolean;
|
|
212
252
|
hasHitCommonBoundingBoxOfSelectedElements: boolean;
|
|
253
|
+
arrowLabel: boolean;
|
|
213
254
|
};
|
|
214
255
|
withCmdOrCtrl: boolean;
|
|
215
256
|
drag: {
|
|
@@ -222,16 +263,13 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
222
263
|
x: number;
|
|
223
264
|
y: number;
|
|
224
265
|
};
|
|
266
|
+
blockDragging: boolean;
|
|
225
267
|
};
|
|
226
268
|
eventListeners: {
|
|
227
|
-
onMove:
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
} | null;
|
|
232
|
-
onUp: ((event: PointerEvent) => void) | null;
|
|
233
|
-
onKeyDown: ((event: KeyboardEvent) => void) | null;
|
|
234
|
-
onKeyUp: ((event: KeyboardEvent) => void) | null;
|
|
269
|
+
onMove: null | ReturnType<typeof import("@excalidraw/common").throttleRAF>;
|
|
270
|
+
onUp: null | ((event: PointerEvent) => void);
|
|
271
|
+
onKeyDown: null | ((event: KeyboardEvent) => void);
|
|
272
|
+
onKeyUp: null | ((event: KeyboardEvent) => void);
|
|
235
273
|
};
|
|
236
274
|
boxSelection: {
|
|
237
275
|
hasOccurred: boolean;
|
|
@@ -243,17 +281,101 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
243
281
|
}>]>;
|
|
244
282
|
missingPointerEventCleanupEmitter: Emitter<[event: PointerEvent | null]>;
|
|
245
283
|
onRemoveEventListenersEmitter: Emitter<[]>;
|
|
284
|
+
api: ExcalidrawImperativeAPI;
|
|
285
|
+
private createExcalidrawAPI;
|
|
246
286
|
constructor(props: AppProps);
|
|
287
|
+
/**
|
|
288
|
+
* Whether the editor accepts user input (pointer, keyboard, wheel, touch,
|
|
289
|
+
* clipboard, drag&drop). When `false`, the editor is fully inert for the
|
|
290
|
+
* user, but remains controllable through the imperative API.
|
|
291
|
+
*
|
|
292
|
+
* All user-input entry points must consult this getter (directly or by
|
|
293
|
+
* not being attached/rendered at all).
|
|
294
|
+
*/
|
|
295
|
+
isInteractionEnabled(props?: Pick<AppProps, "interaction">): boolean;
|
|
296
|
+
/**
|
|
297
|
+
* Whether element links render their link icon and are clickable.
|
|
298
|
+
* True when fully interactive, or when `interaction: { enabled: { links:
|
|
299
|
+
* true } }`
|
|
300
|
+
* (in which case clicking anywhere on a linked element opens the link,
|
|
301
|
+
* same as in view mode).
|
|
302
|
+
*/
|
|
303
|
+
isLinksEnabled(props?: Pick<AppProps, "interaction">): boolean;
|
|
304
|
+
/**
|
|
305
|
+
* Whether canvas navigation — panning & zooming, view-mode style — is
|
|
306
|
+
* enabled. True when fully interactive, or when `interaction: { enabled:
|
|
307
|
+
* { navigation: true } }`. Respects `appState.scrollConstraints`.
|
|
308
|
+
*/
|
|
309
|
+
isNavigationEnabled(props?: Pick<AppProps, "interaction">): boolean;
|
|
310
|
+
/**
|
|
311
|
+
* Whether embeddable & iframe elements are interactive (hover & click to
|
|
312
|
+
* activate, view-mode style). True when fully interactive, or when
|
|
313
|
+
* allowed via `interaction.enabled.embeds` / `.interactiveContent`.
|
|
314
|
+
*/
|
|
315
|
+
isEmbedsEnabled(props?: Pick<AppProps, "interaction">): boolean;
|
|
316
|
+
/**
|
|
317
|
+
* Whether the browser's own zoom (ctrl/cmd + wheel, pinch, keyboard
|
|
318
|
+
* shortcuts) stays available over the non-interactive editor.
|
|
319
|
+
* Prevented by default.
|
|
320
|
+
*/
|
|
321
|
+
isBrowserZoomEnabled(props?: Pick<AppProps, "interaction">): boolean;
|
|
322
|
+
/**
|
|
323
|
+
* Whether the tool can be activated & driven by user input. False when
|
|
324
|
+
* disabled via `UIOptions.tools`, or when the editor is non-interactive
|
|
325
|
+
* and the tool isn't kept user-driven via `interaction.enabled.tools`.
|
|
326
|
+
*
|
|
327
|
+
* (Once UI tool availability is split from input availability — e.g.
|
|
328
|
+
* `props.ui.tools` vs `interaction.disabled.tools` — the UI axis moves
|
|
329
|
+
* out into its own predicate.)
|
|
330
|
+
*
|
|
331
|
+
* We purposely widen the `tool` type so this helper can be called with
|
|
332
|
+
* any tool without having to type check it.
|
|
333
|
+
*/
|
|
334
|
+
isToolSupported: <T extends ToolType | "custom">(tool: T, props?: Pick<AppProps, "interaction" | "UIOptions">) => boolean;
|
|
335
|
+
/**
|
|
336
|
+
* Whether the active tool is locked in place — via the tool lock
|
|
337
|
+
* (padlock / Q) or by being host-forced (`props.activeTool`). A locked
|
|
338
|
+
* tool doesn't revert to the selection tool after use, and elements drawn
|
|
339
|
+
* with it aren't selected. Forcing deliberately does not mutate
|
|
340
|
+
* `activeTool.locked`, which is the user's persisted padlock preference.
|
|
341
|
+
*/
|
|
342
|
+
isToolLocked(): boolean;
|
|
343
|
+
/**
|
|
344
|
+
* Whether the active tool captures the primary pointer instead of the
|
|
345
|
+
* view-mode drag-to-pan — the laser and host-implemented custom tools do;
|
|
346
|
+
* while non-interactive, any tool allowed via
|
|
347
|
+
* `interaction.enabled.tools` does. (Editing tools capture the pointer
|
|
348
|
+
* trivially since view mode implies they're not active; this predicate only
|
|
349
|
+
* matters where view-mode gates apply.)
|
|
350
|
+
*/
|
|
351
|
+
isActiveToolPointerCapturing(): boolean;
|
|
352
|
+
/** Whether Excalidraw's full default UI is rendered. */
|
|
353
|
+
isDefaultUIEnabled(props?: Pick<AppProps, "ui">): boolean;
|
|
354
|
+
/** Whether an individual default UI control is rendered. */
|
|
355
|
+
isUIControlEnabled(control: keyof UIConfig["enabled"], props?: Pick<AppProps, "ui">): boolean;
|
|
247
356
|
updateEditorAtom: <Value, Args extends unknown[], Result>(atom: WritableAtom<Value, Args, Result>, ...args: Args) => Result;
|
|
248
357
|
private onWindowMessage;
|
|
358
|
+
private handleSkipBindMode;
|
|
359
|
+
private resetDelayedBindMode;
|
|
360
|
+
private previousHoveredBindableElement;
|
|
361
|
+
private handleDelayedBindModeChange;
|
|
249
362
|
private cacheEmbeddableRef;
|
|
250
363
|
/**
|
|
251
364
|
* Returns gridSize taking into account `gridModeEnabled`.
|
|
252
365
|
* If disabled, returns null.
|
|
253
366
|
*/
|
|
254
367
|
getEffectiveGridSize: () => NullableGridSize;
|
|
368
|
+
private getTextCreationGridPoint;
|
|
255
369
|
private getHTMLIFrameElement;
|
|
256
|
-
|
|
370
|
+
/**
|
|
371
|
+
* AI-generated iframe elements aren't interactive while their generation
|
|
372
|
+
* is still in progress (the partial content is render-only).
|
|
373
|
+
*/
|
|
374
|
+
private isIframeLikeInteractive;
|
|
375
|
+
private handleIframeLikeElementHover;
|
|
376
|
+
/** @returns true if iframe-like element click handled */
|
|
377
|
+
private handleIframeLikeCenterClick;
|
|
378
|
+
private isDoubleClick;
|
|
257
379
|
private isIframeLikeElementCenter;
|
|
258
380
|
private updateEmbedValidationStatus;
|
|
259
381
|
private updateEmbeddables;
|
|
@@ -266,11 +388,11 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
266
388
|
render(): import("react/jsx-runtime").JSX.Element;
|
|
267
389
|
focusContainer: AppClassProperties["focusContainer"];
|
|
268
390
|
getSceneElementsIncludingDeleted: () => readonly import("@excalidraw/element/types").OrderedExcalidrawElement[];
|
|
269
|
-
getSceneElementsMapIncludingDeleted: () =>
|
|
391
|
+
getSceneElementsMapIncludingDeleted: () => SceneElementsMap;
|
|
270
392
|
getSceneElements: () => readonly Ordered<NonDeletedExcalidrawElement>[];
|
|
271
393
|
onInsertElements: (elements: readonly ExcalidrawElement[]) => void;
|
|
272
394
|
onExportImage: (type: keyof typeof EXPORT_IMAGE_TYPES, elements: ExportedElements, opts: {
|
|
273
|
-
exportingFrame: ExcalidrawFrameLikeElement | null;
|
|
395
|
+
exportingFrame: NonDeleted<ExcalidrawFrameLikeElement> | null;
|
|
274
396
|
}) => Promise<void>;
|
|
275
397
|
private magicGenerations;
|
|
276
398
|
private updateMagicGeneration;
|
|
@@ -286,9 +408,34 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
286
408
|
private openEyeDropper;
|
|
287
409
|
dismissLinearEditor: () => void;
|
|
288
410
|
syncActionResult: (actionResult: ActionResult) => void;
|
|
411
|
+
scheduleCapture: () => void;
|
|
289
412
|
private onBlur;
|
|
290
413
|
private onUnload;
|
|
291
414
|
private disableEvent;
|
|
415
|
+
private preventBrowserZoomWheel;
|
|
416
|
+
private handleNavigationModeKeyDown;
|
|
417
|
+
/**
|
|
418
|
+
* PageUp/PageDown scroll the canvas by a page — vertically, or
|
|
419
|
+
* horizontally with shift. Respects `appState.scrollConstraints`
|
|
420
|
+
* (via `viewport.translate`).
|
|
421
|
+
*/
|
|
422
|
+
private maybeHandlePageScrollKeyDown;
|
|
423
|
+
private preventBrowserZoomKeyDown;
|
|
424
|
+
/** Ends active input sessions before switching to a view-mode/non-interactive
|
|
425
|
+
* mode. */
|
|
426
|
+
private terminateActiveInteraction;
|
|
427
|
+
private handleInteractionStateChange;
|
|
428
|
+
/** whether the two values reference the same tool (incl. custom subtype) */
|
|
429
|
+
private isSameForcedTool;
|
|
430
|
+
/**
|
|
431
|
+
* Keeps `state.activeTool` synced to the host-controlled
|
|
432
|
+
* `props.activeTool`. `setActiveTool` refuses non-matching activations
|
|
433
|
+
* while forced (user input, API); this backstop covers the writers that
|
|
434
|
+
* bypass the funnel (`actionFinalize`/`actionDeselect`, `restore()` on
|
|
435
|
+
* scene load, ...) and re-applies the tool once it becomes activatable
|
|
436
|
+
* (e.g. `interaction` config changes).
|
|
437
|
+
*/
|
|
438
|
+
private handleForcedToolChange;
|
|
292
439
|
private resetHistory;
|
|
293
440
|
private resetStore;
|
|
294
441
|
/**
|
|
@@ -297,9 +444,11 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
297
444
|
*/
|
|
298
445
|
private resetScene;
|
|
299
446
|
private initializeScene;
|
|
300
|
-
private
|
|
301
|
-
|
|
302
|
-
private
|
|
447
|
+
private getFormFactor;
|
|
448
|
+
refreshEditorInterface: () => void;
|
|
449
|
+
private reconcileStylesPanelMode;
|
|
450
|
+
/** TO BE USED LATER */
|
|
451
|
+
private setDesktopUIMode;
|
|
303
452
|
private clearImageShapeCache;
|
|
304
453
|
componentDidMount(): Promise<void>;
|
|
305
454
|
componentWillUnmount(): void;
|
|
@@ -316,6 +465,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
316
465
|
private static resetTapTwice;
|
|
317
466
|
private onTouchStart;
|
|
318
467
|
private onTouchEnd;
|
|
468
|
+
private insertClipboardContent;
|
|
319
469
|
pasteFromClipboard: (event: ClipboardEvent) => Promise<void>;
|
|
320
470
|
addElementsFromPasteOrLibrary: (opts: {
|
|
321
471
|
elements: readonly ExcalidrawElement[];
|
|
@@ -325,54 +475,25 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
325
475
|
clientY: number;
|
|
326
476
|
} | "cursor" | "center";
|
|
327
477
|
retainSeed?: boolean;
|
|
328
|
-
|
|
478
|
+
fit?: SetViewportOptions["fit"];
|
|
479
|
+
preserveFrameChildrenOrder?: boolean;
|
|
329
480
|
}) => void;
|
|
330
481
|
private addElementsFromMixedContentPaste;
|
|
331
482
|
private addTextFromPaste;
|
|
332
483
|
setAppState: React.Component<any, AppState>["setState"];
|
|
333
484
|
removePointer: (event: React.PointerEvent<HTMLElement> | PointerEvent) => void;
|
|
334
485
|
toggleLock: (source?: "keyboard" | "ui") => void;
|
|
335
|
-
updateFrameRendering: (opts: Partial<
|
|
336
|
-
enabled: boolean;
|
|
337
|
-
name: boolean;
|
|
338
|
-
outline: boolean;
|
|
339
|
-
clip: boolean;
|
|
340
|
-
}> | ((prevState: AppState["frameRendering"]) => Partial<AppState["frameRendering"]>)) => void;
|
|
486
|
+
updateFrameRendering: (opts: Partial<AppState["frameRendering"]> | ((prevState: AppState["frameRendering"]) => Partial<AppState["frameRendering"]>)) => void;
|
|
341
487
|
togglePenMode: (force: boolean | null) => void;
|
|
342
|
-
|
|
343
|
-
/**
|
|
344
|
-
*
|
|
345
|
-
*/
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
viewportZoomFactor?: number;
|
|
352
|
-
animate?: boolean;
|
|
353
|
-
duration?: number;
|
|
354
|
-
} | {
|
|
355
|
-
fitToContent?: never;
|
|
356
|
-
fitToViewport?: boolean;
|
|
357
|
-
/** when fitToViewport=true, how much screen should the content cover,
|
|
358
|
-
* between 0.1 (10%) and 1 (100%)
|
|
359
|
-
*/
|
|
360
|
-
viewportZoomFactor?: number;
|
|
361
|
-
animate?: boolean;
|
|
362
|
-
duration?: number;
|
|
363
|
-
}) & {
|
|
364
|
-
minZoom?: number;
|
|
365
|
-
maxZoom?: number;
|
|
366
|
-
canvasOffsets?: Offsets;
|
|
367
|
-
}) => void;
|
|
368
|
-
private maybeUnfollowRemoteUser;
|
|
369
|
-
/** use when changing scrollX/scrollY/zoom based on user interaction */
|
|
370
|
-
private translateCanvas;
|
|
371
|
-
setToast: (toast: {
|
|
372
|
-
message: string;
|
|
373
|
-
closable?: boolean;
|
|
374
|
-
duration?: number;
|
|
375
|
-
} | null) => void;
|
|
488
|
+
revealIfHidden: (elements: NonDeletedExcalidrawElement[]) => void;
|
|
489
|
+
/** emits a follow/unfollow intent to the host (which owns the
|
|
490
|
+
* `userToFollow` state) via both the `onUserFollow` prop and the
|
|
491
|
+
* imperative API emitter */
|
|
492
|
+
emitUserFollowIntent: (payload: OnUserFollowedPayload) => void;
|
|
493
|
+
/** emits an UNFOLLOW intent if currently following someone — use on
|
|
494
|
+
* user-initiated viewport changes which should break follow mode */
|
|
495
|
+
requestUnfollow: () => void;
|
|
496
|
+
setToast: (toast: AppState["toast"]) => void;
|
|
376
497
|
restoreFileFromShare: () => Promise<void>;
|
|
377
498
|
/**
|
|
378
499
|
* adds supplied files to existing files in the appState.
|
|
@@ -382,7 +503,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
382
503
|
private addMissingFiles;
|
|
383
504
|
updateScene: <K extends keyof AppState>(sceneData: {
|
|
384
505
|
elements?: SceneData["elements"];
|
|
385
|
-
appState?: Pick<AppState, K> | null
|
|
506
|
+
appState?: Pick<AppState, K> | null;
|
|
386
507
|
collaborators?: SceneData["collaborators"];
|
|
387
508
|
/**
|
|
388
509
|
* Controls which updates should be captured by the `Store`. Captured updates are emmitted and listened to by other components, such as `History` for undo / redo purposes.
|
|
@@ -397,21 +518,22 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
397
518
|
*/
|
|
398
519
|
captureUpdate?: SceneData["captureUpdate"];
|
|
399
520
|
}) => void;
|
|
521
|
+
applyDeltas: (deltas: StoreDelta[], options?: ApplyToOptions) => [SceneElementsMap, AppState, boolean];
|
|
400
522
|
mutateElement: <TElement extends Mutable<ExcalidrawElement>>(element: TElement, updates: ElementUpdate<TElement>, informMutation?: boolean) => TElement;
|
|
401
|
-
|
|
523
|
+
triggerRender: (
|
|
524
|
+
/** force always re-renders canvas even if no change */
|
|
525
|
+
force?: boolean) => void;
|
|
402
526
|
/**
|
|
403
527
|
* @returns whether the menu was toggled on or off
|
|
404
528
|
*/
|
|
405
529
|
toggleSidebar: ({ name, tab, force, }: {
|
|
406
530
|
name: SidebarName | null;
|
|
407
|
-
tab?:
|
|
408
|
-
force?: boolean
|
|
531
|
+
tab?: SidebarTabName;
|
|
532
|
+
force?: boolean;
|
|
409
533
|
}) => boolean;
|
|
410
534
|
private updateCurrentCursorPosition;
|
|
411
|
-
getEditorUIOffsets: () => Offsets;
|
|
412
535
|
private onKeyDown;
|
|
413
536
|
private onKeyUp;
|
|
414
|
-
private isToolSupported;
|
|
415
537
|
setActiveTool: (tool: ({
|
|
416
538
|
type: ToolType;
|
|
417
539
|
} | {
|
|
@@ -420,10 +542,18 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
420
542
|
}) & {
|
|
421
543
|
locked?: boolean;
|
|
422
544
|
fromSelection?: boolean;
|
|
423
|
-
},
|
|
545
|
+
}, opts?: {
|
|
546
|
+
keepSelection?: boolean;
|
|
547
|
+
/**
|
|
548
|
+
* When `true`, re-activating an already-active toggle tool (see
|
|
549
|
+
* `TOGGLE_TOOLS`) switches back to the previously active tool.
|
|
550
|
+
* Activation is idempotent by default; toggle tools always record the
|
|
551
|
+
* previously active tool regardless (so ESC and the next `toggle`
|
|
552
|
+
* activation can switch back to it).
|
|
553
|
+
*/
|
|
554
|
+
toggle?: boolean;
|
|
555
|
+
}) => void;
|
|
424
556
|
setOpenDialog: (dialogType: AppState["openDialog"]) => void;
|
|
425
|
-
private setCursor;
|
|
426
|
-
private resetCursor;
|
|
427
557
|
/**
|
|
428
558
|
* returns whether user is making a gesture with >= 2 fingers (points)
|
|
429
559
|
* on o touch screen (not on a trackpad). Currently only relates to Darwin
|
|
@@ -437,22 +567,239 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
437
567
|
private onGestureEnd;
|
|
438
568
|
private handleTextWysiwyg;
|
|
439
569
|
private deselectElements;
|
|
440
|
-
private
|
|
441
|
-
private
|
|
442
|
-
|
|
570
|
+
private getSelectedTextElement;
|
|
571
|
+
private getSelectedTextEditingContainerAtPosition;
|
|
572
|
+
getTextElementAtPosition(x: number, y: number): NonDeleted<ExcalidrawTextElement> | null;
|
|
573
|
+
private isHittingTextAutoResizeHandle;
|
|
574
|
+
private handleTextAutoResizeHandlePointerDown;
|
|
575
|
+
getElementAtPosition(x: number, y: number, opts?: ({
|
|
576
|
+
includeBoundTextElement?: boolean;
|
|
577
|
+
includeLockedElements?: boolean;
|
|
578
|
+
} | {
|
|
579
|
+
allHitElements: NonDeleted<ExcalidrawElement>[];
|
|
580
|
+
}) & {
|
|
581
|
+
preferSelected?: boolean;
|
|
582
|
+
}): NonDeleted<ExcalidrawElement> | null;
|
|
583
|
+
getElementsAtPosition(x: number, y: number, opts?: {
|
|
584
|
+
includeBoundTextElement?: boolean;
|
|
585
|
+
includeLockedElements?: boolean;
|
|
586
|
+
}): NonDeleted<ExcalidrawElement>[];
|
|
443
587
|
getElementHitThreshold(element: ExcalidrawElement): number;
|
|
444
|
-
|
|
445
|
-
|
|
588
|
+
hitElement(x: number, y: number, element: NonDeletedExcalidrawElement, considerBoundingBox?: boolean): boolean;
|
|
589
|
+
getTextBindableContainerAtPosition(x: number, y: number): (Readonly<{
|
|
590
|
+
id: string;
|
|
591
|
+
x: number;
|
|
592
|
+
y: number;
|
|
593
|
+
strokeColor: string;
|
|
594
|
+
backgroundColor: string;
|
|
595
|
+
fillStyle: import("@excalidraw/element/types").FillStyle;
|
|
596
|
+
strokeWidth: number;
|
|
597
|
+
strokeStyle: import("@excalidraw/element/types").StrokeStyle;
|
|
598
|
+
roundness: null | {
|
|
599
|
+
type: import("@excalidraw/element/types").RoundnessType;
|
|
600
|
+
value?: number;
|
|
601
|
+
};
|
|
602
|
+
roughness: number;
|
|
603
|
+
opacity: number;
|
|
604
|
+
width: number;
|
|
605
|
+
height: number;
|
|
606
|
+
angle: Radians;
|
|
607
|
+
seed: number;
|
|
608
|
+
version: number;
|
|
609
|
+
versionNonce: number;
|
|
610
|
+
index: import("@excalidraw/element/types").FractionalIndex | null;
|
|
611
|
+
isDeleted: boolean;
|
|
612
|
+
groupIds: readonly import("@excalidraw/element/types").GroupId[];
|
|
613
|
+
frameId: string | null;
|
|
614
|
+
boundElements: readonly import("@excalidraw/element/types").BoundElement[] | null;
|
|
615
|
+
updated: number;
|
|
616
|
+
link: string | null;
|
|
617
|
+
locked: boolean;
|
|
618
|
+
customData?: Record<string, any>;
|
|
619
|
+
}> & {
|
|
620
|
+
type: "rectangle";
|
|
621
|
+
} & {
|
|
622
|
+
isDeleted: false;
|
|
623
|
+
}) | (Readonly<{
|
|
624
|
+
id: string;
|
|
625
|
+
x: number;
|
|
626
|
+
y: number;
|
|
627
|
+
strokeColor: string;
|
|
628
|
+
backgroundColor: string;
|
|
629
|
+
fillStyle: import("@excalidraw/element/types").FillStyle;
|
|
630
|
+
strokeWidth: number;
|
|
631
|
+
strokeStyle: import("@excalidraw/element/types").StrokeStyle;
|
|
632
|
+
roundness: null | {
|
|
633
|
+
type: import("@excalidraw/element/types").RoundnessType;
|
|
634
|
+
value?: number;
|
|
635
|
+
};
|
|
636
|
+
roughness: number;
|
|
637
|
+
opacity: number;
|
|
638
|
+
width: number;
|
|
639
|
+
height: number;
|
|
640
|
+
angle: Radians;
|
|
641
|
+
seed: number;
|
|
642
|
+
version: number;
|
|
643
|
+
versionNonce: number;
|
|
644
|
+
index: import("@excalidraw/element/types").FractionalIndex | null;
|
|
645
|
+
isDeleted: boolean;
|
|
646
|
+
groupIds: readonly import("@excalidraw/element/types").GroupId[];
|
|
647
|
+
frameId: string | null;
|
|
648
|
+
boundElements: readonly import("@excalidraw/element/types").BoundElement[] | null;
|
|
649
|
+
updated: number;
|
|
650
|
+
link: string | null;
|
|
651
|
+
locked: boolean;
|
|
652
|
+
customData?: Record<string, any>;
|
|
653
|
+
}> & {
|
|
654
|
+
type: "diamond";
|
|
655
|
+
} & {
|
|
656
|
+
isDeleted: false;
|
|
657
|
+
}) | (Readonly<{
|
|
658
|
+
id: string;
|
|
659
|
+
x: number;
|
|
660
|
+
y: number;
|
|
661
|
+
strokeColor: string;
|
|
662
|
+
backgroundColor: string;
|
|
663
|
+
fillStyle: import("@excalidraw/element/types").FillStyle;
|
|
664
|
+
strokeWidth: number;
|
|
665
|
+
strokeStyle: import("@excalidraw/element/types").StrokeStyle;
|
|
666
|
+
roundness: null | {
|
|
667
|
+
type: import("@excalidraw/element/types").RoundnessType;
|
|
668
|
+
value?: number;
|
|
669
|
+
};
|
|
670
|
+
roughness: number;
|
|
671
|
+
opacity: number;
|
|
672
|
+
width: number;
|
|
673
|
+
height: number;
|
|
674
|
+
angle: Radians;
|
|
675
|
+
seed: number;
|
|
676
|
+
version: number;
|
|
677
|
+
versionNonce: number;
|
|
678
|
+
index: import("@excalidraw/element/types").FractionalIndex | null;
|
|
679
|
+
isDeleted: boolean;
|
|
680
|
+
groupIds: readonly import("@excalidraw/element/types").GroupId[];
|
|
681
|
+
frameId: string | null;
|
|
682
|
+
boundElements: readonly import("@excalidraw/element/types").BoundElement[] | null;
|
|
683
|
+
updated: number;
|
|
684
|
+
link: string | null;
|
|
685
|
+
locked: boolean;
|
|
686
|
+
customData?: Record<string, any>;
|
|
687
|
+
}> & {
|
|
688
|
+
type: "ellipse";
|
|
689
|
+
} & {
|
|
690
|
+
isDeleted: false;
|
|
691
|
+
}) | (Readonly<{
|
|
692
|
+
id: string;
|
|
693
|
+
x: number;
|
|
694
|
+
y: number;
|
|
695
|
+
strokeColor: string;
|
|
696
|
+
backgroundColor: string;
|
|
697
|
+
fillStyle: import("@excalidraw/element/types").FillStyle;
|
|
698
|
+
strokeWidth: number;
|
|
699
|
+
strokeStyle: import("@excalidraw/element/types").StrokeStyle;
|
|
700
|
+
roundness: null | {
|
|
701
|
+
type: import("@excalidraw/element/types").RoundnessType;
|
|
702
|
+
value?: number;
|
|
703
|
+
};
|
|
704
|
+
roughness: number;
|
|
705
|
+
opacity: number;
|
|
706
|
+
width: number;
|
|
707
|
+
height: number;
|
|
708
|
+
angle: Radians;
|
|
709
|
+
seed: number;
|
|
710
|
+
version: number;
|
|
711
|
+
versionNonce: number;
|
|
712
|
+
index: import("@excalidraw/element/types").FractionalIndex | null;
|
|
713
|
+
isDeleted: boolean;
|
|
714
|
+
groupIds: readonly import("@excalidraw/element/types").GroupId[];
|
|
715
|
+
frameId: string | null;
|
|
716
|
+
boundElements: readonly import("@excalidraw/element/types").BoundElement[] | null;
|
|
717
|
+
updated: number;
|
|
718
|
+
link: string | null;
|
|
719
|
+
locked: boolean;
|
|
720
|
+
customData?: Record<string, any>;
|
|
721
|
+
}> & Readonly<{
|
|
722
|
+
type: "line" | "arrow";
|
|
723
|
+
points: readonly LocalPoint[];
|
|
724
|
+
startBinding: import("@excalidraw/element/types").FixedPointBinding | null;
|
|
725
|
+
endBinding: import("@excalidraw/element/types").FixedPointBinding | null;
|
|
726
|
+
startArrowhead: import("@excalidraw/element/types").Arrowhead | null;
|
|
727
|
+
endArrowhead: import("@excalidraw/element/types").Arrowhead | null;
|
|
728
|
+
}> & Readonly<{
|
|
729
|
+
type: "arrow";
|
|
730
|
+
elbowed: boolean;
|
|
731
|
+
}> & {
|
|
732
|
+
isDeleted: false;
|
|
733
|
+
}) | null;
|
|
734
|
+
/**
|
|
735
|
+
* Whether a text element's content is still being authored.
|
|
736
|
+
*
|
|
737
|
+
* Creating a text reverts the tool to selection during pointerdown, so the
|
|
738
|
+
* pointerup that follows looks like an ordinary canvas click and would
|
|
739
|
+
* capture the still-empty element as a history entry of its own. Undo would
|
|
740
|
+
* then rewind only the typing, restoring an invisible, zero-content element
|
|
741
|
+
* (and, for an endpoint label, leaving the arrow bound to it) rather than
|
|
742
|
+
* removing it. The editor's own submit captures the finished text instead,
|
|
743
|
+
* so the whole create-and-type lands in a single entry.
|
|
744
|
+
*/
|
|
745
|
+
private isEditingTextContent;
|
|
446
746
|
private startTextEditing;
|
|
447
747
|
private startImageCropping;
|
|
448
748
|
private finishImageCropping;
|
|
749
|
+
private shouldHandleBrowserCanvasDoubleClick;
|
|
449
750
|
private handleCanvasDoubleClick;
|
|
751
|
+
private handleCanvasClick;
|
|
450
752
|
private getElementLinkAtPosition;
|
|
451
|
-
private
|
|
452
|
-
|
|
753
|
+
private handleElementLinkClick;
|
|
754
|
+
/**
|
|
755
|
+
* Applies (or clears) the element-link hover affordances — pointer cursor
|
|
756
|
+
* and tooltip — based on the current `hitLinkElement`. Returns whether a
|
|
757
|
+
* link is being hovered.
|
|
758
|
+
*/
|
|
759
|
+
private applyElementLinkHoverAffordance;
|
|
760
|
+
/**
|
|
761
|
+
* On touchscreens (where no hover precedes the tap) re-derives
|
|
762
|
+
* `hitLinkElement`, then opens the hit element link, if any.
|
|
763
|
+
* Returns whether a link click was handled.
|
|
764
|
+
*/
|
|
765
|
+
private maybeHandleElementLinkClick;
|
|
766
|
+
/**
|
|
767
|
+
* Restricted pointer handling for the non-interactive editor with links
|
|
768
|
+
* and/or embeds allowed (`interaction.enabled.links` / `.embeds` /
|
|
769
|
+
* `.interactiveContent`) — runs only the element-link & embed concerns
|
|
770
|
+
* (shared with the full pointer handlers above) so they behave like in
|
|
771
|
+
* view mode without the rest of the canvas pointer machinery.
|
|
772
|
+
*/
|
|
773
|
+
private handleInteractiveContentPointerMove;
|
|
774
|
+
private handleInteractiveContentPointerUp;
|
|
775
|
+
/**
|
|
776
|
+
* finds candidate frame under cursor (when dragging frame children/elements
|
|
777
|
+
* inside frames)
|
|
778
|
+
*/
|
|
779
|
+
getTopLayerFrameAtSceneCoords: (
|
|
780
|
+
/**
|
|
781
|
+
* should be already grid aligned (basically should be what the call site
|
|
782
|
+
* sets the element's coords to, if applicable)
|
|
783
|
+
*/
|
|
784
|
+
sceneCoords: {
|
|
785
|
+
x: number;
|
|
786
|
+
y: number;
|
|
787
|
+
}, opts?: {
|
|
788
|
+
/** to exclude selected elements when dragging, etc. */
|
|
789
|
+
excludeElementIds?: AppState["selectedElementIds"];
|
|
790
|
+
currentFrameId?: ExcalidrawElement["frameId"];
|
|
791
|
+
}) => NonDeleted<ExcalidrawFrameLikeElement> | null;
|
|
792
|
+
private updateFrameToHighlight;
|
|
793
|
+
private maybeUpdateFrameToHighlightOnPointerMove;
|
|
794
|
+
insertNewElements: (elements: readonly ExcalidrawElement[]) => void;
|
|
795
|
+
insertNewElement: (element: ExcalidrawElement) => void;
|
|
453
796
|
private handleCanvasPointerMove;
|
|
454
797
|
private handleEraser;
|
|
455
798
|
private handleTouchMove;
|
|
799
|
+
/**
|
|
800
|
+
* Applies the hover affordances of a selected linear element: the cursor,
|
|
801
|
+
* plus the hovered-handle state that renders them highlighted.
|
|
802
|
+
*/
|
|
456
803
|
handleHoverSelectedLinearElement(linearElementEditor: LinearElementEditor, scenePointerX: number, scenePointerY: number): void;
|
|
457
804
|
private handleCanvasPointerDown;
|
|
458
805
|
private handleCanvasPointerUp;
|
|
@@ -466,6 +813,11 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
466
813
|
private maybeCleanupAfterMissingPointerUp;
|
|
467
814
|
handleCanvasPanUsingWheelOrSpaceDrag: (event: React.PointerEvent<HTMLElement> | MouseEvent) => boolean;
|
|
468
815
|
private updateGestureOnPointerDown;
|
|
816
|
+
/**
|
|
817
|
+
* Tracks the pointer within the ongoing multi-touch gesture and applies
|
|
818
|
+
* the two-finger pinch zoom/pan, if any.
|
|
819
|
+
*/
|
|
820
|
+
private updateMultiTouchGesture;
|
|
469
821
|
private initialPointerDownState;
|
|
470
822
|
private handleDraggingScrollBar;
|
|
471
823
|
private clearSelectionIfNotUsingSelection;
|
|
@@ -488,9 +840,10 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
488
840
|
sceneY: number;
|
|
489
841
|
link: string;
|
|
490
842
|
}) => NonDeleted<ExcalidrawEmbeddableElement> | undefined;
|
|
491
|
-
private
|
|
843
|
+
private newImagePlaceholder;
|
|
492
844
|
private handleLinearElementOnPointerDown;
|
|
493
845
|
private getCurrentItemRoundness;
|
|
846
|
+
private getCurrentItemStrokeWidth;
|
|
494
847
|
private createGenericElementOnPointerDown;
|
|
495
848
|
private createFrameElementOnPointerDown;
|
|
496
849
|
private maybeCacheReferenceSnapPoints;
|
|
@@ -509,11 +862,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
509
862
|
* and when you don't want to loose those modifications
|
|
510
863
|
*/
|
|
511
864
|
private getLatestInitializedImageElement;
|
|
512
|
-
|
|
513
|
-
* inserts image into elements array and rerenders
|
|
514
|
-
*/
|
|
515
|
-
private insertImageElement;
|
|
516
|
-
private onImageAction;
|
|
865
|
+
private onImageToolbarButtonClick;
|
|
517
866
|
private getImageNaturalDimensions;
|
|
518
867
|
/** updates image cache, refreshing updated elements and/or setting status
|
|
519
868
|
to error for images that fail during <img> element creation */
|
|
@@ -523,24 +872,29 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
523
872
|
/** generally you should use `addNewImagesToImageCache()` directly if you need
|
|
524
873
|
* to render new images. This is just a failsafe */
|
|
525
874
|
private scheduleImageRefresh;
|
|
526
|
-
private updateBindingEnabledOnPointerMove;
|
|
527
|
-
private maybeSuggestBindingAtCursor;
|
|
528
875
|
private clearSelection;
|
|
529
876
|
private handleInteractiveCanvasRef;
|
|
877
|
+
private insertImages;
|
|
530
878
|
private handleAppOnDrop;
|
|
531
|
-
loadFileToCanvas: (file: File, fileHandle:
|
|
879
|
+
loadFileToCanvas: (file: File, fileHandle: FileSystemFileHandle | null) => Promise<void>;
|
|
532
880
|
private handleCanvasContextMenu;
|
|
533
881
|
private maybeDragNewGenericElement;
|
|
534
882
|
private maybeHandleCrop;
|
|
535
883
|
private maybeHandleResize;
|
|
536
884
|
private getContextMenuItems;
|
|
537
885
|
private handleWheel;
|
|
538
|
-
|
|
886
|
+
getTextWysiwygSnappedToCenterPosition(x: number, y: number, appState: AppState, container?: ExcalidrawTextContainer | null): {
|
|
887
|
+
viewportX: number;
|
|
888
|
+
viewportY: number;
|
|
889
|
+
elementCenterX: number;
|
|
890
|
+
elementCenterY: number;
|
|
891
|
+
} | undefined;
|
|
539
892
|
private savePointer;
|
|
540
893
|
private resetShouldCacheIgnoreZoomDebounced;
|
|
541
894
|
private updateDOMRect;
|
|
542
895
|
refresh: () => void;
|
|
543
896
|
private getCanvasOffsets;
|
|
897
|
+
watchState: () => void;
|
|
544
898
|
private updateLanguage;
|
|
545
899
|
}
|
|
546
900
|
declare global {
|
|
@@ -550,6 +904,7 @@ declare global {
|
|
|
550
904
|
elements: readonly ExcalidrawElement[];
|
|
551
905
|
state: AppState;
|
|
552
906
|
setState: React.Component<any, AppState>["setState"];
|
|
907
|
+
watchState: (prev: any, next: any) => void | undefined;
|
|
553
908
|
app: InstanceType<typeof App>;
|
|
554
909
|
history: History;
|
|
555
910
|
store: Store;
|