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