@excalidraw/element 0.18.0-0fc927cb4 → 0.18.0-1acf66e
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 +10079 -6277
- package/dist/dev/index.js.map +4 -4
- package/dist/prod/index.js +20 -19
- package/dist/types/common/debug.d.ts +21 -0
- package/dist/types/common/src/appEventBus.d.ts +27 -0
- package/dist/types/common/src/bounds.d.ts +10 -0
- package/dist/types/common/src/colors.d.ts +59 -39
- package/dist/types/common/src/constants.d.ts +48 -33
- package/dist/types/common/src/editorInterface.d.ts +34 -0
- package/dist/types/common/src/font-metadata.d.ts +1 -3
- package/dist/types/common/src/index.d.ts +5 -0
- package/dist/types/common/src/keys.d.ts +1 -1
- package/dist/types/common/src/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/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 +2 -2
- 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 +8 -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 +9 -8
- package/dist/types/element/src/store.d.ts +3 -2
- 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 -180
- package/dist/types/excalidraw/actions/actionAlign.d.ts +12 -13
- package/dist/types/excalidraw/actions/actionBoundText.d.ts +112 -127
- package/dist/types/excalidraw/actions/actionCanvas.d.ts +412 -1550
- package/dist/types/excalidraw/actions/actionClipboard.d.ts +114 -870
- package/dist/types/excalidraw/actions/actionCropEditor.d.ts +54 -62
- package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +180 -205
- package/dist/types/excalidraw/actions/actionDeselect.d.ts +162 -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 -60
- package/dist/types/excalidraw/actions/actionElementLock.d.ts +111 -126
- package/dist/types/excalidraw/actions/actionExport.d.ts +190 -1410
- 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 -512
- package/dist/types/excalidraw/actions/actionGroup.d.ts +122 -145
- package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +168 -212
- package/dist/types/excalidraw/actions/actionLink.d.ts +53 -61
- package/dist/types/excalidraw/actions/actionMenu.d.ts +45 -425
- package/dist/types/excalidraw/actions/actionNavigate.d.ts +18 -359
- package/dist/types/excalidraw/actions/actionProperties.d.ts +191 -2527
- package/dist/types/excalidraw/actions/actionSelectAll.d.ts +61 -73
- package/dist/types/excalidraw/actions/actionStyles.d.ts +54 -61
- package/dist/types/excalidraw/actions/actionTextAutoResize.d.ts +3 -3
- package/dist/types/excalidraw/actions/{actionEmbeddable.d.ts → actionToggleArrowBinding.d.ts} +69 -76
- package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +58 -67
- package/dist/types/excalidraw/actions/actionToggleMidpointSnapping.d.ts +178 -0
- package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +55 -63
- package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +46 -61
- package/dist/types/excalidraw/actions/actionToggleShapeSwitch.d.ts +2 -2
- package/dist/types/excalidraw/actions/actionToggleStats.d.ts +55 -63
- package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +56 -64
- package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +56 -64
- 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.cursor.d.ts +31 -0
- package/dist/types/excalidraw/components/App.d.ts +447 -122
- 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 +2 -3
- package/dist/types/excalidraw/components/ColorPicker/Picker.d.ts +2 -0
- package/dist/types/excalidraw/components/ColorPicker/PickerColorList.d.ts +2 -1
- package/dist/types/excalidraw/components/ColorPicker/ShadeList.d.ts +2 -1
- package/dist/types/excalidraw/components/ColorPicker/colorPickerUtils.d.ts +1 -2
- package/dist/types/excalidraw/components/ColorPicker/keyboardNavHandlers.d.ts +0 -1
- package/dist/types/excalidraw/components/CommandPalette/CommandPalette.d.ts +1 -0
- package/dist/types/excalidraw/components/CommandPalette/defaultCommandPaletteItems.d.ts +1 -2
- package/dist/types/excalidraw/components/CommandPalette/types.d.ts +2 -4
- package/dist/types/excalidraw/components/ConvertElementTypePopup.d.ts +4 -4
- package/dist/types/excalidraw/components/CursorHint.d.ts +46 -0
- package/dist/types/excalidraw/components/DarkModeToggle.d.ts +1 -1
- package/dist/types/excalidraw/components/DefaultSidebar.d.ts +9 -13
- package/dist/types/excalidraw/components/ElementLinkDialog.d.ts +1 -1
- package/dist/types/excalidraw/components/Ellipsify.d.ts +1 -2
- package/dist/types/excalidraw/components/ErrorDialog.d.ts +1 -1
- package/dist/types/excalidraw/components/EyeDropper.d.ts +1 -2
- package/dist/types/excalidraw/components/FilledButton.d.ts +2 -1
- package/dist/types/excalidraw/components/FontPicker/FontPicker.d.ts +2 -1
- package/dist/types/excalidraw/components/FontPicker/FontPickerTrigger.d.ts +3 -1
- package/dist/types/excalidraw/components/FontPicker/keyboardNavHandlers.d.ts +0 -1
- package/dist/types/excalidraw/components/HelpDialog.d.ts +1 -1
- package/dist/types/excalidraw/components/HintViewer.d.ts +4 -3
- package/dist/types/excalidraw/components/{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 +5 -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 +145 -0
- package/dist/types/excalidraw/components/Trans.d.ts +2 -2
- 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 +52 -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 +339 -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 +175 -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 +487 -50
- package/dist/types/excalidraw/viewport.d.ts +272 -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/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,64 @@
|
|
|
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, Arrowhead, 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 { AppCursor } from "./App.cursor";
|
|
19
|
+
import { AppDrawShape } from "./App.drawshape";
|
|
20
|
+
import { AppFlowchart } from "./App.flowchart";
|
|
21
|
+
import { AppViewport } from "./App.viewport";
|
|
22
|
+
import { CursorHints } from "./CursorHint";
|
|
23
|
+
import { type OnStateChange } from "./AppStateObserver";
|
|
15
24
|
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";
|
|
25
|
+
import type { AppClassProperties, AppProps, AppState, ExcalidrawImperativeAPI, BinaryFiles, LibraryItems, SceneData, FrameNameBoundsCache, SidebarName, SidebarTabName, ToolType, OnUserFollowedPayload, ExcalidrawImperativeAPIEventMap, GenerateDiagramToCode, NullableGridSize, UIConfig } from "../types";
|
|
18
26
|
import type { RoughCanvas } from "roughjs/bin/canvas";
|
|
19
27
|
import type { ActionResult } from "../actions/types";
|
|
28
|
+
declare const editorLifecycleEventBehavior: {
|
|
29
|
+
readonly "editor:mount": {
|
|
30
|
+
readonly cardinality: "once";
|
|
31
|
+
readonly replay: "last";
|
|
32
|
+
};
|
|
33
|
+
readonly "editor:initialize": {
|
|
34
|
+
readonly cardinality: "once";
|
|
35
|
+
readonly replay: "last";
|
|
36
|
+
};
|
|
37
|
+
readonly "editor:unmount": {
|
|
38
|
+
readonly cardinality: "once";
|
|
39
|
+
readonly replay: "last";
|
|
40
|
+
};
|
|
41
|
+
};
|
|
20
42
|
export declare const ExcalidrawContainerContext: React.Context<{
|
|
21
43
|
container: HTMLDivElement | null;
|
|
22
44
|
id: string | null;
|
|
23
45
|
}>;
|
|
46
|
+
export declare const ExcalidrawAPIContext: React.Context<ExcalidrawImperativeAPI | null>;
|
|
47
|
+
export declare const ExcalidrawAPISetContext: React.Context<((api: ExcalidrawImperativeAPI | null) => void) | null>;
|
|
24
48
|
export declare const useApp: () => AppClassProperties;
|
|
25
49
|
export declare const useAppProps: () => AppProps;
|
|
26
|
-
export declare const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
canFitSidebar: boolean;
|
|
34
|
-
};
|
|
50
|
+
export declare const useEditorInterface: () => Readonly<{
|
|
51
|
+
formFactor: "phone" | "tablet" | "desktop";
|
|
52
|
+
desktopUIMode: "compact" | "full";
|
|
53
|
+
userAgent: Readonly<{
|
|
54
|
+
isMobileDevice: boolean;
|
|
55
|
+
platform: "ios" | "android" | "other" | "unknown";
|
|
56
|
+
}>;
|
|
35
57
|
isTouchScreen: boolean;
|
|
58
|
+
canFitSidebar: boolean;
|
|
59
|
+
isLandscape: boolean;
|
|
36
60
|
}>;
|
|
61
|
+
export declare const useStylesPanelMode: () => StylesPanelMode;
|
|
37
62
|
export declare const useExcalidrawContainer: () => {
|
|
38
63
|
container: HTMLDivElement | null;
|
|
39
64
|
id: string | null;
|
|
@@ -42,20 +67,28 @@ export declare const useExcalidrawElements: () => readonly NonDeletedExcalidrawE
|
|
|
42
67
|
export declare const useExcalidrawAppState: () => AppState;
|
|
43
68
|
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
69
|
export declare const useExcalidrawActionManager: () => ActionManager;
|
|
70
|
+
/**
|
|
71
|
+
* Requires wrapping your component in <ExcalidrawAPIContext.Provider>
|
|
72
|
+
*/
|
|
73
|
+
export declare const useExcalidrawAPI: () => ExcalidrawImperativeAPI | null;
|
|
45
74
|
declare class App extends React.Component<AppProps, AppState> {
|
|
46
75
|
canvas: AppClassProperties["canvas"];
|
|
47
76
|
interactiveCanvas: AppClassProperties["interactiveCanvas"];
|
|
77
|
+
sessionExportThemeOverride: AppState["theme"] | undefined;
|
|
48
78
|
rc: RoughCanvas;
|
|
49
79
|
unmounted: boolean;
|
|
50
80
|
actionManager: ActionManager;
|
|
51
|
-
|
|
81
|
+
editorInterface: EditorInterface;
|
|
82
|
+
private stylesPanelMode;
|
|
52
83
|
private excalidrawContainerRef;
|
|
53
84
|
scene: Scene;
|
|
54
85
|
fonts: Fonts;
|
|
55
86
|
renderer: Renderer;
|
|
56
87
|
visibleElements: readonly NonDeletedExcalidrawElement[];
|
|
88
|
+
/** whether the last render had any renderable elements (excludes e.g. the
|
|
89
|
+
* in-progress `newElement` and the edited text element) */
|
|
90
|
+
private hasRenderableElements;
|
|
57
91
|
private resizeObserver;
|
|
58
|
-
private nearestScrollableContainer;
|
|
59
92
|
library: AppClassProperties["library"];
|
|
60
93
|
libraryItemsFromStorage: LibraryItems | undefined;
|
|
61
94
|
id: string;
|
|
@@ -78,26 +111,42 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
78
111
|
/** embeds that have been inserted to DOM (as a perf optim, we don't want to
|
|
79
112
|
* insert to DOM before user initially scrolls to them) */
|
|
80
113
|
private initializedEmbeds;
|
|
81
|
-
private handleToastClose;
|
|
82
114
|
private elementsPendingErasure;
|
|
83
|
-
|
|
84
|
-
private
|
|
115
|
+
private _initialized;
|
|
116
|
+
private readonly editorLifecycleEvents;
|
|
117
|
+
onEvent: AppEventBus<ExcalidrawImperativeAPIEventMap, typeof editorLifecycleEventBehavior>["on"];
|
|
118
|
+
private appStateObserver;
|
|
119
|
+
onStateChange: OnStateChange;
|
|
120
|
+
flowchart: AppFlowchart;
|
|
121
|
+
cursor: AppCursor;
|
|
122
|
+
arrowText: AppArrowText;
|
|
123
|
+
viewport: AppViewport;
|
|
124
|
+
bindModeHandler: ReturnType<typeof setTimeout> | null;
|
|
125
|
+
private textWysiwygSubmitHandler;
|
|
85
126
|
hitLinkElement?: NonDeletedExcalidrawElement;
|
|
86
127
|
lastPointerDownEvent: React.PointerEvent<HTMLElement> | null;
|
|
87
128
|
lastPointerUpEvent: React.PointerEvent<HTMLElement> | PointerEvent | null;
|
|
129
|
+
lastPointerUpIsDoubleClick: boolean;
|
|
88
130
|
lastPointerMoveEvent: PointerEvent | null;
|
|
131
|
+
/** current frame pointer cords */
|
|
89
132
|
lastPointerMoveCoords: {
|
|
90
133
|
x: number;
|
|
91
134
|
y: number;
|
|
92
135
|
} | null;
|
|
93
|
-
|
|
136
|
+
private lastCompletedCanvasClicks;
|
|
137
|
+
/** arrowheads removed via endpoint double-click toggle, so a subsequent
|
|
138
|
+
* toggle can restore the original arrowhead (keyed by `elementId:side`) */
|
|
139
|
+
private removedArrowheads;
|
|
140
|
+
/** previous frame pointer coords */
|
|
141
|
+
previousPointerMoveCoords: {
|
|
94
142
|
x: number;
|
|
95
143
|
y: number;
|
|
96
|
-
};
|
|
97
|
-
|
|
144
|
+
} | null;
|
|
145
|
+
drawShape: AppDrawShape;
|
|
98
146
|
laserTrails: LaserTrails;
|
|
99
147
|
eraserTrail: EraserTrail;
|
|
100
148
|
lassoTrail: LassoTrail;
|
|
149
|
+
cursorHints: CursorHints;
|
|
101
150
|
onChangeEmitter: Emitter<[elements: readonly ExcalidrawElement[], appState: AppState, files: BinaryFiles]>;
|
|
102
151
|
onPointerDownEmitter: Emitter<[activeTool: {
|
|
103
152
|
lastActiveTool: import("../types").ActiveTool | null;
|
|
@@ -112,11 +161,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
112
161
|
x: number;
|
|
113
162
|
y: number;
|
|
114
163
|
}>;
|
|
115
|
-
scrollbars:
|
|
116
|
-
isOverEither: boolean;
|
|
117
|
-
isOverHorizontal: boolean;
|
|
118
|
-
isOverVertical: boolean;
|
|
119
|
-
};
|
|
164
|
+
scrollbars: ReturnType<typeof isOverScrollBars>;
|
|
120
165
|
lastCoords: {
|
|
121
166
|
x: number;
|
|
122
167
|
y: number;
|
|
@@ -129,7 +174,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
129
174
|
x: number;
|
|
130
175
|
y: number;
|
|
131
176
|
};
|
|
132
|
-
arrowDirection: "
|
|
177
|
+
arrowDirection: "origin" | "end";
|
|
133
178
|
center: {
|
|
134
179
|
x: number;
|
|
135
180
|
y: number;
|
|
@@ -153,16 +198,13 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
153
198
|
x: number;
|
|
154
199
|
y: number;
|
|
155
200
|
};
|
|
201
|
+
blockDragging: boolean;
|
|
156
202
|
};
|
|
157
203
|
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;
|
|
204
|
+
onMove: null | ReturnType<typeof import("@excalidraw/common").throttleRAF>;
|
|
205
|
+
onUp: null | ((event: PointerEvent) => void);
|
|
206
|
+
onKeyDown: null | ((event: KeyboardEvent) => void);
|
|
207
|
+
onKeyUp: null | ((event: KeyboardEvent) => void);
|
|
166
208
|
};
|
|
167
209
|
boxSelection: {
|
|
168
210
|
hasOccurred: boolean;
|
|
@@ -181,11 +223,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
181
223
|
x: number;
|
|
182
224
|
y: number;
|
|
183
225
|
}>;
|
|
184
|
-
scrollbars:
|
|
185
|
-
isOverEither: boolean;
|
|
186
|
-
isOverHorizontal: boolean;
|
|
187
|
-
isOverVertical: boolean;
|
|
188
|
-
};
|
|
226
|
+
scrollbars: ReturnType<typeof isOverScrollBars>;
|
|
189
227
|
lastCoords: {
|
|
190
228
|
x: number;
|
|
191
229
|
y: number;
|
|
@@ -198,7 +236,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
198
236
|
x: number;
|
|
199
237
|
y: number;
|
|
200
238
|
};
|
|
201
|
-
arrowDirection: "
|
|
239
|
+
arrowDirection: "origin" | "end";
|
|
202
240
|
center: {
|
|
203
241
|
x: number;
|
|
204
242
|
y: number;
|
|
@@ -222,16 +260,13 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
222
260
|
x: number;
|
|
223
261
|
y: number;
|
|
224
262
|
};
|
|
263
|
+
blockDragging: boolean;
|
|
225
264
|
};
|
|
226
265
|
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;
|
|
266
|
+
onMove: null | ReturnType<typeof import("@excalidraw/common").throttleRAF>;
|
|
267
|
+
onUp: null | ((event: PointerEvent) => void);
|
|
268
|
+
onKeyDown: null | ((event: KeyboardEvent) => void);
|
|
269
|
+
onKeyUp: null | ((event: KeyboardEvent) => void);
|
|
235
270
|
};
|
|
236
271
|
boxSelection: {
|
|
237
272
|
hasOccurred: boolean;
|
|
@@ -243,17 +278,95 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
243
278
|
}>]>;
|
|
244
279
|
missingPointerEventCleanupEmitter: Emitter<[event: PointerEvent | null]>;
|
|
245
280
|
onRemoveEventListenersEmitter: Emitter<[]>;
|
|
281
|
+
api: ExcalidrawImperativeAPI;
|
|
282
|
+
private createExcalidrawAPI;
|
|
246
283
|
constructor(props: AppProps);
|
|
284
|
+
/**
|
|
285
|
+
* Whether the editor accepts user input (pointer, keyboard, wheel, touch,
|
|
286
|
+
* clipboard, drag&drop). When `false`, the editor is fully inert for the
|
|
287
|
+
* user, but remains controllable through the imperative API.
|
|
288
|
+
*
|
|
289
|
+
* All user-input entry points must consult this getter (directly or by
|
|
290
|
+
* not being attached/rendered at all).
|
|
291
|
+
*/
|
|
292
|
+
isInteractionEnabled(props?: Pick<AppProps, "interaction">): boolean;
|
|
293
|
+
/**
|
|
294
|
+
* Whether element links render their link icon and are clickable.
|
|
295
|
+
* True when fully interactive, or when `interaction: { enabled: { links:
|
|
296
|
+
* true } }`
|
|
297
|
+
* (in which case clicking anywhere on a linked element opens the link,
|
|
298
|
+
* same as in view mode).
|
|
299
|
+
*/
|
|
300
|
+
isLinksEnabled(props?: Pick<AppProps, "interaction">): boolean;
|
|
301
|
+
/**
|
|
302
|
+
* Whether canvas navigation — panning & zooming, view-mode style — is
|
|
303
|
+
* enabled. True when fully interactive, or when `interaction: { enabled:
|
|
304
|
+
* { navigation: true } }`. Respects `appState.scrollConstraints`.
|
|
305
|
+
*/
|
|
306
|
+
isNavigationEnabled(props?: Pick<AppProps, "interaction">): boolean;
|
|
307
|
+
/**
|
|
308
|
+
* Whether embeddable & iframe elements are interactive (hover & click to
|
|
309
|
+
* activate, view-mode style). True when fully interactive, or when
|
|
310
|
+
* allowed via `interaction.enabled.embeds` / `.interactiveContent`.
|
|
311
|
+
*/
|
|
312
|
+
isEmbedsEnabled(props?: Pick<AppProps, "interaction">): boolean;
|
|
313
|
+
/**
|
|
314
|
+
* Whether the browser's own zoom (ctrl/cmd + wheel, pinch, keyboard
|
|
315
|
+
* shortcuts) stays available over the non-interactive editor.
|
|
316
|
+
* Prevented by default.
|
|
317
|
+
*/
|
|
318
|
+
isBrowserZoomEnabled(props?: Pick<AppProps, "interaction">): boolean;
|
|
319
|
+
/**
|
|
320
|
+
* Whether the tool can be activated & driven by user input. False when
|
|
321
|
+
* disabled via `UIOptions.tools`, or when the editor is non-interactive
|
|
322
|
+
* and the tool isn't kept user-driven via `interaction.enabled.tools`.
|
|
323
|
+
*
|
|
324
|
+
* (Once UI tool availability is split from input availability — e.g.
|
|
325
|
+
* `props.ui.tools` vs `interaction.disabled.tools` — the UI axis moves
|
|
326
|
+
* out into its own predicate.)
|
|
327
|
+
*
|
|
328
|
+
* We purposely widen the `tool` type so this helper can be called with
|
|
329
|
+
* any tool without having to type check it.
|
|
330
|
+
*/
|
|
331
|
+
isToolSupported: <T extends ToolType | "custom">(tool: T, props?: Pick<AppProps, "interaction" | "UIOptions">) => boolean;
|
|
332
|
+
/**
|
|
333
|
+
* Whether the active tool is locked in place — via the tool lock
|
|
334
|
+
* (padlock / Q) or by being host-forced (`props.activeTool`). A locked
|
|
335
|
+
* tool doesn't revert to the selection tool after use, and elements drawn
|
|
336
|
+
* with it aren't selected. Forcing deliberately does not mutate
|
|
337
|
+
* `activeTool.locked`, which is the user's persisted padlock preference.
|
|
338
|
+
*/
|
|
339
|
+
isToolLocked(): boolean;
|
|
340
|
+
/**
|
|
341
|
+
* Whether the active tool captures the primary pointer instead of the
|
|
342
|
+
* view-mode drag-to-pan — the laser always does; while non-interactive,
|
|
343
|
+
* any tool allowed via `interaction.enabled.tools` does. (Editing tools
|
|
344
|
+
* capture the pointer trivially since view mode implies they're not
|
|
345
|
+
* active; this predicate only 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;
|
|
@@ -265,12 +378,12 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
265
378
|
private toggleOverscrollBehavior;
|
|
266
379
|
render(): import("react/jsx-runtime").JSX.Element;
|
|
267
380
|
focusContainer: AppClassProperties["focusContainer"];
|
|
268
|
-
getSceneElementsIncludingDeleted: () => readonly OrderedExcalidrawElement[];
|
|
269
|
-
getSceneElementsMapIncludingDeleted: () =>
|
|
381
|
+
getSceneElementsIncludingDeleted: () => readonly import("@excalidraw/element/types").OrderedExcalidrawElement[];
|
|
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;
|
|
@@ -289,6 +402,30 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
289
402
|
private onBlur;
|
|
290
403
|
private onUnload;
|
|
291
404
|
private disableEvent;
|
|
405
|
+
private preventBrowserZoomWheel;
|
|
406
|
+
private handleNavigationModeKeyDown;
|
|
407
|
+
/**
|
|
408
|
+
* PageUp/PageDown scroll the canvas by a page — vertically, or
|
|
409
|
+
* horizontally with shift. Respects `appState.scrollConstraints`
|
|
410
|
+
* (via `viewport.translate`).
|
|
411
|
+
*/
|
|
412
|
+
private maybeHandlePageScrollKeyDown;
|
|
413
|
+
private preventBrowserZoomKeyDown;
|
|
414
|
+
/** Ends active input sessions before switching to a view-mode/non-interactive
|
|
415
|
+
* mode. */
|
|
416
|
+
private terminateActiveInteraction;
|
|
417
|
+
private handleInteractionStateChange;
|
|
418
|
+
/** whether the two values reference the same tool (incl. custom subtype) */
|
|
419
|
+
private isSameForcedTool;
|
|
420
|
+
/**
|
|
421
|
+
* Keeps `state.activeTool` synced to the host-controlled
|
|
422
|
+
* `props.activeTool`. `setActiveTool` refuses non-matching activations
|
|
423
|
+
* while forced (user input, API); this backstop covers the writers that
|
|
424
|
+
* bypass the funnel (`actionFinalize`/`actionDeselect`, `restore()` on
|
|
425
|
+
* scene load, ...) and re-applies the tool once it becomes activatable
|
|
426
|
+
* (e.g. `interaction` config changes).
|
|
427
|
+
*/
|
|
428
|
+
private handleForcedToolChange;
|
|
292
429
|
private resetHistory;
|
|
293
430
|
private resetStore;
|
|
294
431
|
/**
|
|
@@ -297,9 +434,11 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
297
434
|
*/
|
|
298
435
|
private resetScene;
|
|
299
436
|
private initializeScene;
|
|
300
|
-
private
|
|
301
|
-
|
|
302
|
-
private
|
|
437
|
+
private getFormFactor;
|
|
438
|
+
refreshEditorInterface: () => void;
|
|
439
|
+
private reconcileStylesPanelMode;
|
|
440
|
+
/** TO BE USED LATER */
|
|
441
|
+
private setDesktopUIMode;
|
|
303
442
|
private clearImageShapeCache;
|
|
304
443
|
componentDidMount(): Promise<void>;
|
|
305
444
|
componentWillUnmount(): void;
|
|
@@ -316,6 +455,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
316
455
|
private static resetTapTwice;
|
|
317
456
|
private onTouchStart;
|
|
318
457
|
private onTouchEnd;
|
|
458
|
+
private insertClipboardContent;
|
|
319
459
|
pasteFromClipboard: (event: ClipboardEvent) => Promise<void>;
|
|
320
460
|
addElementsFromPasteOrLibrary: (opts: {
|
|
321
461
|
elements: readonly ExcalidrawElement[];
|
|
@@ -325,54 +465,19 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
325
465
|
clientY: number;
|
|
326
466
|
} | "cursor" | "center";
|
|
327
467
|
retainSeed?: boolean;
|
|
328
|
-
|
|
468
|
+
fit?: SetViewportOptions["fit"];
|
|
469
|
+
preserveFrameChildrenOrder?: boolean;
|
|
329
470
|
}) => void;
|
|
330
471
|
private addElementsFromMixedContentPaste;
|
|
331
472
|
private addTextFromPaste;
|
|
332
473
|
setAppState: React.Component<any, AppState>["setState"];
|
|
333
474
|
removePointer: (event: React.PointerEvent<HTMLElement> | PointerEvent) => void;
|
|
334
475
|
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;
|
|
476
|
+
updateFrameRendering: (opts: Partial<AppState["frameRendering"]> | ((prevState: AppState["frameRendering"]) => Partial<AppState["frameRendering"]>)) => void;
|
|
341
477
|
togglePenMode: (force: boolean | null) => void;
|
|
342
|
-
|
|
343
|
-
/**
|
|
344
|
-
* Zooms on canvas viewport center
|
|
345
|
-
*/
|
|
346
|
-
zoomCanvas: (value: number) => void;
|
|
347
|
-
private cancelInProgressAnimation;
|
|
348
|
-
scrollToContent: (target?: string | ExcalidrawElement | readonly ExcalidrawElement[], opts?: ({
|
|
349
|
-
fitToContent?: boolean;
|
|
350
|
-
fitToViewport?: never;
|
|
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;
|
|
478
|
+
revealIfHidden: (elements: NonDeletedExcalidrawElement[]) => void;
|
|
368
479
|
private maybeUnfollowRemoteUser;
|
|
369
|
-
|
|
370
|
-
private translateCanvas;
|
|
371
|
-
setToast: (toast: {
|
|
372
|
-
message: string;
|
|
373
|
-
closable?: boolean;
|
|
374
|
-
duration?: number;
|
|
375
|
-
} | null) => void;
|
|
480
|
+
setToast: (toast: AppState["toast"]) => void;
|
|
376
481
|
restoreFileFromShare: () => Promise<void>;
|
|
377
482
|
/**
|
|
378
483
|
* adds supplied files to existing files in the appState.
|
|
@@ -382,7 +487,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
382
487
|
private addMissingFiles;
|
|
383
488
|
updateScene: <K extends keyof AppState>(sceneData: {
|
|
384
489
|
elements?: SceneData["elements"];
|
|
385
|
-
appState?: Pick<AppState, K> | null
|
|
490
|
+
appState?: Pick<AppState, K> | null;
|
|
386
491
|
collaborators?: SceneData["collaborators"];
|
|
387
492
|
/**
|
|
388
493
|
* 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 +504,20 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
399
504
|
}) => void;
|
|
400
505
|
applyDeltas: (deltas: StoreDelta[], options?: ApplyToOptions) => [SceneElementsMap, AppState, boolean];
|
|
401
506
|
mutateElement: <TElement extends Mutable<ExcalidrawElement>>(element: TElement, updates: ElementUpdate<TElement>, informMutation?: boolean) => TElement;
|
|
402
|
-
|
|
507
|
+
triggerRender: (
|
|
508
|
+
/** force always re-renders canvas even if no change */
|
|
509
|
+
force?: boolean) => void;
|
|
403
510
|
/**
|
|
404
511
|
* @returns whether the menu was toggled on or off
|
|
405
512
|
*/
|
|
406
513
|
toggleSidebar: ({ name, tab, force, }: {
|
|
407
514
|
name: SidebarName | null;
|
|
408
|
-
tab?:
|
|
409
|
-
force?: boolean
|
|
515
|
+
tab?: SidebarTabName;
|
|
516
|
+
force?: boolean;
|
|
410
517
|
}) => boolean;
|
|
411
518
|
private updateCurrentCursorPosition;
|
|
412
|
-
getEditorUIOffsets: () => Offsets;
|
|
413
519
|
private onKeyDown;
|
|
414
520
|
private onKeyUp;
|
|
415
|
-
private isToolSupported;
|
|
416
521
|
setActiveTool: (tool: ({
|
|
417
522
|
type: ToolType;
|
|
418
523
|
} | {
|
|
@@ -421,10 +526,18 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
421
526
|
}) & {
|
|
422
527
|
locked?: boolean;
|
|
423
528
|
fromSelection?: boolean;
|
|
424
|
-
},
|
|
529
|
+
}, opts?: {
|
|
530
|
+
keepSelection?: boolean;
|
|
531
|
+
/**
|
|
532
|
+
* When `true`, re-activating an already-active toggle tool (see
|
|
533
|
+
* `TOGGLE_TOOLS`) switches back to the previously active tool.
|
|
534
|
+
* Activation is idempotent by default; toggle tools always record the
|
|
535
|
+
* previously active tool regardless (so ESC and the next `toggle`
|
|
536
|
+
* activation can switch back to it).
|
|
537
|
+
*/
|
|
538
|
+
toggle?: boolean;
|
|
539
|
+
}) => void;
|
|
425
540
|
setOpenDialog: (dialogType: AppState["openDialog"]) => void;
|
|
426
|
-
private setCursor;
|
|
427
|
-
private resetCursor;
|
|
428
541
|
/**
|
|
429
542
|
* returns whether user is making a gesture with >= 2 fingers (points)
|
|
430
543
|
* on o touch screen (not on a trackpad). Currently only relates to Darwin
|
|
@@ -438,19 +551,223 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
438
551
|
private onGestureEnd;
|
|
439
552
|
private handleTextWysiwyg;
|
|
440
553
|
private deselectElements;
|
|
441
|
-
private
|
|
442
|
-
private
|
|
554
|
+
private getSelectedTextElement;
|
|
555
|
+
private getSelectedTextEditingContainerAtPosition;
|
|
556
|
+
getTextElementAtPosition(x: number, y: number): NonDeleted<ExcalidrawTextElement> | null;
|
|
557
|
+
private isHittingTextAutoResizeHandle;
|
|
558
|
+
private handleTextAutoResizeHandlePointerDown;
|
|
559
|
+
getElementAtPosition(x: number, y: number, opts?: ({
|
|
560
|
+
includeBoundTextElement?: boolean;
|
|
561
|
+
includeLockedElements?: boolean;
|
|
562
|
+
} | {
|
|
563
|
+
allHitElements: NonDeleted<ExcalidrawElement>[];
|
|
564
|
+
}) & {
|
|
565
|
+
preferSelected?: boolean;
|
|
566
|
+
}): NonDeleted<ExcalidrawElement> | null;
|
|
443
567
|
private getElementsAtPosition;
|
|
444
568
|
getElementHitThreshold(element: ExcalidrawElement): number;
|
|
445
569
|
private hitElement;
|
|
446
|
-
|
|
570
|
+
getTextBindableContainerAtPosition(x: number, y: number): (Readonly<{
|
|
571
|
+
id: string;
|
|
572
|
+
x: number;
|
|
573
|
+
y: number;
|
|
574
|
+
strokeColor: string;
|
|
575
|
+
backgroundColor: string;
|
|
576
|
+
fillStyle: import("@excalidraw/element/types").FillStyle;
|
|
577
|
+
strokeWidth: number;
|
|
578
|
+
strokeStyle: import("@excalidraw/element/types").StrokeStyle;
|
|
579
|
+
roundness: null | {
|
|
580
|
+
type: import("@excalidraw/element/types").RoundnessType;
|
|
581
|
+
value?: number;
|
|
582
|
+
};
|
|
583
|
+
roughness: number;
|
|
584
|
+
opacity: number;
|
|
585
|
+
width: number;
|
|
586
|
+
height: number;
|
|
587
|
+
angle: Radians;
|
|
588
|
+
seed: number;
|
|
589
|
+
version: number;
|
|
590
|
+
versionNonce: number;
|
|
591
|
+
index: import("@excalidraw/element/types").FractionalIndex | null;
|
|
592
|
+
isDeleted: boolean;
|
|
593
|
+
groupIds: readonly import("@excalidraw/element/types").GroupId[];
|
|
594
|
+
frameId: string | null;
|
|
595
|
+
boundElements: readonly import("@excalidraw/element/types").BoundElement[] | null;
|
|
596
|
+
updated: number;
|
|
597
|
+
link: string | null;
|
|
598
|
+
locked: boolean;
|
|
599
|
+
customData?: Record<string, any>;
|
|
600
|
+
}> & {
|
|
601
|
+
type: "rectangle";
|
|
602
|
+
} & {
|
|
603
|
+
isDeleted: false;
|
|
604
|
+
}) | (Readonly<{
|
|
605
|
+
id: string;
|
|
606
|
+
x: number;
|
|
607
|
+
y: number;
|
|
608
|
+
strokeColor: string;
|
|
609
|
+
backgroundColor: string;
|
|
610
|
+
fillStyle: import("@excalidraw/element/types").FillStyle;
|
|
611
|
+
strokeWidth: number;
|
|
612
|
+
strokeStyle: import("@excalidraw/element/types").StrokeStyle;
|
|
613
|
+
roundness: null | {
|
|
614
|
+
type: import("@excalidraw/element/types").RoundnessType;
|
|
615
|
+
value?: number;
|
|
616
|
+
};
|
|
617
|
+
roughness: number;
|
|
618
|
+
opacity: number;
|
|
619
|
+
width: number;
|
|
620
|
+
height: number;
|
|
621
|
+
angle: Radians;
|
|
622
|
+
seed: number;
|
|
623
|
+
version: number;
|
|
624
|
+
versionNonce: number;
|
|
625
|
+
index: import("@excalidraw/element/types").FractionalIndex | null;
|
|
626
|
+
isDeleted: boolean;
|
|
627
|
+
groupIds: readonly import("@excalidraw/element/types").GroupId[];
|
|
628
|
+
frameId: string | null;
|
|
629
|
+
boundElements: readonly import("@excalidraw/element/types").BoundElement[] | null;
|
|
630
|
+
updated: number;
|
|
631
|
+
link: string | null;
|
|
632
|
+
locked: boolean;
|
|
633
|
+
customData?: Record<string, any>;
|
|
634
|
+
}> & {
|
|
635
|
+
type: "diamond";
|
|
636
|
+
} & {
|
|
637
|
+
isDeleted: false;
|
|
638
|
+
}) | (Readonly<{
|
|
639
|
+
id: string;
|
|
640
|
+
x: number;
|
|
641
|
+
y: number;
|
|
642
|
+
strokeColor: string;
|
|
643
|
+
backgroundColor: string;
|
|
644
|
+
fillStyle: import("@excalidraw/element/types").FillStyle;
|
|
645
|
+
strokeWidth: number;
|
|
646
|
+
strokeStyle: import("@excalidraw/element/types").StrokeStyle;
|
|
647
|
+
roundness: null | {
|
|
648
|
+
type: import("@excalidraw/element/types").RoundnessType;
|
|
649
|
+
value?: number;
|
|
650
|
+
};
|
|
651
|
+
roughness: number;
|
|
652
|
+
opacity: number;
|
|
653
|
+
width: number;
|
|
654
|
+
height: number;
|
|
655
|
+
angle: Radians;
|
|
656
|
+
seed: number;
|
|
657
|
+
version: number;
|
|
658
|
+
versionNonce: number;
|
|
659
|
+
index: import("@excalidraw/element/types").FractionalIndex | null;
|
|
660
|
+
isDeleted: boolean;
|
|
661
|
+
groupIds: readonly import("@excalidraw/element/types").GroupId[];
|
|
662
|
+
frameId: string | null;
|
|
663
|
+
boundElements: readonly import("@excalidraw/element/types").BoundElement[] | null;
|
|
664
|
+
updated: number;
|
|
665
|
+
link: string | null;
|
|
666
|
+
locked: boolean;
|
|
667
|
+
customData?: Record<string, any>;
|
|
668
|
+
}> & {
|
|
669
|
+
type: "ellipse";
|
|
670
|
+
} & {
|
|
671
|
+
isDeleted: false;
|
|
672
|
+
}) | (Readonly<{
|
|
673
|
+
id: string;
|
|
674
|
+
x: number;
|
|
675
|
+
y: number;
|
|
676
|
+
strokeColor: string;
|
|
677
|
+
backgroundColor: string;
|
|
678
|
+
fillStyle: import("@excalidraw/element/types").FillStyle;
|
|
679
|
+
strokeWidth: number;
|
|
680
|
+
strokeStyle: import("@excalidraw/element/types").StrokeStyle;
|
|
681
|
+
roundness: null | {
|
|
682
|
+
type: import("@excalidraw/element/types").RoundnessType;
|
|
683
|
+
value?: number;
|
|
684
|
+
};
|
|
685
|
+
roughness: number;
|
|
686
|
+
opacity: number;
|
|
687
|
+
width: number;
|
|
688
|
+
height: number;
|
|
689
|
+
angle: Radians;
|
|
690
|
+
seed: number;
|
|
691
|
+
version: number;
|
|
692
|
+
versionNonce: number;
|
|
693
|
+
index: import("@excalidraw/element/types").FractionalIndex | null;
|
|
694
|
+
isDeleted: boolean;
|
|
695
|
+
groupIds: readonly import("@excalidraw/element/types").GroupId[];
|
|
696
|
+
frameId: string | null;
|
|
697
|
+
boundElements: readonly import("@excalidraw/element/types").BoundElement[] | null;
|
|
698
|
+
updated: number;
|
|
699
|
+
link: string | null;
|
|
700
|
+
locked: boolean;
|
|
701
|
+
customData?: Record<string, any>;
|
|
702
|
+
}> & Readonly<{
|
|
703
|
+
type: "line" | "arrow";
|
|
704
|
+
points: readonly LocalPoint[];
|
|
705
|
+
startBinding: import("@excalidraw/element/types").FixedPointBinding | null;
|
|
706
|
+
endBinding: import("@excalidraw/element/types").FixedPointBinding | null;
|
|
707
|
+
startArrowhead: Arrowhead | null;
|
|
708
|
+
endArrowhead: Arrowhead | null;
|
|
709
|
+
}> & Readonly<{
|
|
710
|
+
type: "arrow";
|
|
711
|
+
elbowed: boolean;
|
|
712
|
+
}> & {
|
|
713
|
+
isDeleted: false;
|
|
714
|
+
}) | null;
|
|
715
|
+
/**
|
|
716
|
+
* Whether a text element's content is still being authored.
|
|
717
|
+
*
|
|
718
|
+
* Creating a text reverts the tool to selection during pointerdown, so the
|
|
719
|
+
* pointerup that follows looks like an ordinary canvas click and would
|
|
720
|
+
* capture the still-empty element as a history entry of its own. Undo would
|
|
721
|
+
* then rewind only the typing, restoring an invisible, zero-content element
|
|
722
|
+
* (and, for an endpoint label, leaving the arrow bound to it) rather than
|
|
723
|
+
* removing it. The editor's own submit captures the finished text instead,
|
|
724
|
+
* so the whole create-and-type lands in a single entry.
|
|
725
|
+
*/
|
|
726
|
+
private isEditingTextContent;
|
|
447
727
|
private startTextEditing;
|
|
448
728
|
private startImageCropping;
|
|
449
729
|
private finishImageCropping;
|
|
730
|
+
private shouldHandleBrowserCanvasDoubleClick;
|
|
731
|
+
/**
|
|
732
|
+
* Toggles the arrowhead at the given endpoint between no arrowhead and the
|
|
733
|
+
* arrowhead it had before the last toggle (falling back to the current
|
|
734
|
+
* default arrowhead).
|
|
735
|
+
*/
|
|
736
|
+
private toggleArrowheadAtEndpoint;
|
|
450
737
|
private handleCanvasDoubleClick;
|
|
738
|
+
private handleCanvasClick;
|
|
451
739
|
private getElementLinkAtPosition;
|
|
452
|
-
private
|
|
740
|
+
private handleElementLinkClick;
|
|
741
|
+
/**
|
|
742
|
+
* Applies (or clears) the element-link hover affordances — pointer cursor
|
|
743
|
+
* and tooltip — based on the current `hitLinkElement`. Returns whether a
|
|
744
|
+
* link is being hovered.
|
|
745
|
+
*/
|
|
746
|
+
private applyElementLinkHoverAffordance;
|
|
747
|
+
/**
|
|
748
|
+
* On touchscreens (where no hover precedes the tap) re-derives
|
|
749
|
+
* `hitLinkElement`, then opens the hit element link, if any.
|
|
750
|
+
* Returns whether a link click was handled.
|
|
751
|
+
*/
|
|
752
|
+
private maybeHandleElementLinkClick;
|
|
753
|
+
/**
|
|
754
|
+
* Restricted pointer handling for the non-interactive editor with links
|
|
755
|
+
* and/or embeds allowed (`interaction.enabled.links` / `.embeds` /
|
|
756
|
+
* `.interactiveContent`) — runs only the element-link & embed concerns
|
|
757
|
+
* (shared with the full pointer handlers above) so they behave like in
|
|
758
|
+
* view mode without the rest of the canvas pointer machinery.
|
|
759
|
+
*/
|
|
760
|
+
private handleInteractiveContentPointerMove;
|
|
761
|
+
private handleInteractiveContentPointerUp;
|
|
762
|
+
/**
|
|
763
|
+
* finds candidate frame under cursor (when dragging frame children/elements
|
|
764
|
+
* inside frames)
|
|
765
|
+
*/
|
|
453
766
|
private getTopLayerFrameAtSceneCoords;
|
|
767
|
+
private updateFrameToHighlight;
|
|
768
|
+
private maybeUpdateFrameToHighlightOnPointerMove;
|
|
769
|
+
insertNewElements: (elements: readonly ExcalidrawElement[]) => void;
|
|
770
|
+
insertNewElement: (element: ExcalidrawElement) => void;
|
|
454
771
|
private handleCanvasPointerMove;
|
|
455
772
|
private handleEraser;
|
|
456
773
|
private handleTouchMove;
|
|
@@ -467,6 +784,11 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
467
784
|
private maybeCleanupAfterMissingPointerUp;
|
|
468
785
|
handleCanvasPanUsingWheelOrSpaceDrag: (event: React.PointerEvent<HTMLElement> | MouseEvent) => boolean;
|
|
469
786
|
private updateGestureOnPointerDown;
|
|
787
|
+
/**
|
|
788
|
+
* Tracks the pointer within the ongoing multi-touch gesture and applies
|
|
789
|
+
* the two-finger pinch zoom/pan, if any.
|
|
790
|
+
*/
|
|
791
|
+
private updateMultiTouchGesture;
|
|
470
792
|
private initialPointerDownState;
|
|
471
793
|
private handleDraggingScrollBar;
|
|
472
794
|
private clearSelectionIfNotUsingSelection;
|
|
@@ -489,9 +811,10 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
489
811
|
sceneY: number;
|
|
490
812
|
link: string;
|
|
491
813
|
}) => NonDeleted<ExcalidrawEmbeddableElement> | undefined;
|
|
492
|
-
private
|
|
814
|
+
private newImagePlaceholder;
|
|
493
815
|
private handleLinearElementOnPointerDown;
|
|
494
816
|
private getCurrentItemRoundness;
|
|
817
|
+
private getCurrentItemStrokeWidth;
|
|
495
818
|
private createGenericElementOnPointerDown;
|
|
496
819
|
private createFrameElementOnPointerDown;
|
|
497
820
|
private maybeCacheReferenceSnapPoints;
|
|
@@ -510,11 +833,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
510
833
|
* and when you don't want to loose those modifications
|
|
511
834
|
*/
|
|
512
835
|
private getLatestInitializedImageElement;
|
|
513
|
-
|
|
514
|
-
* inserts image into elements array and rerenders
|
|
515
|
-
*/
|
|
516
|
-
private insertImageElement;
|
|
517
|
-
private onImageAction;
|
|
836
|
+
private onImageToolbarButtonClick;
|
|
518
837
|
private getImageNaturalDimensions;
|
|
519
838
|
/** updates image cache, refreshing updated elements and/or setting status
|
|
520
839
|
to error for images that fail during <img> element creation */
|
|
@@ -524,24 +843,29 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
524
843
|
/** generally you should use `addNewImagesToImageCache()` directly if you need
|
|
525
844
|
* to render new images. This is just a failsafe */
|
|
526
845
|
private scheduleImageRefresh;
|
|
527
|
-
private updateBindingEnabledOnPointerMove;
|
|
528
|
-
private maybeSuggestBindingAtCursor;
|
|
529
846
|
private clearSelection;
|
|
530
847
|
private handleInteractiveCanvasRef;
|
|
848
|
+
private insertImages;
|
|
531
849
|
private handleAppOnDrop;
|
|
532
|
-
loadFileToCanvas: (file: File, fileHandle:
|
|
850
|
+
loadFileToCanvas: (file: File, fileHandle: FileSystemFileHandle | null) => Promise<void>;
|
|
533
851
|
private handleCanvasContextMenu;
|
|
534
852
|
private maybeDragNewGenericElement;
|
|
535
853
|
private maybeHandleCrop;
|
|
536
854
|
private maybeHandleResize;
|
|
537
855
|
private getContextMenuItems;
|
|
538
856
|
private handleWheel;
|
|
539
|
-
|
|
857
|
+
getTextWysiwygSnappedToCenterPosition(x: number, y: number, appState: AppState, container?: ExcalidrawTextContainer | null): {
|
|
858
|
+
viewportX: number;
|
|
859
|
+
viewportY: number;
|
|
860
|
+
elementCenterX: number;
|
|
861
|
+
elementCenterY: number;
|
|
862
|
+
} | undefined;
|
|
540
863
|
private savePointer;
|
|
541
864
|
private resetShouldCacheIgnoreZoomDebounced;
|
|
542
865
|
private updateDOMRect;
|
|
543
866
|
refresh: () => void;
|
|
544
867
|
private getCanvasOffsets;
|
|
868
|
+
watchState: () => void;
|
|
545
869
|
private updateLanguage;
|
|
546
870
|
}
|
|
547
871
|
declare global {
|
|
@@ -551,6 +875,7 @@ declare global {
|
|
|
551
875
|
elements: readonly ExcalidrawElement[];
|
|
552
876
|
state: AppState;
|
|
553
877
|
setState: React.Component<any, AppState>["setState"];
|
|
878
|
+
watchState: (prev: any, next: any) => void | undefined;
|
|
554
879
|
app: InstanceType<typeof App>;
|
|
555
880
|
history: History;
|
|
556
881
|
store: Store;
|