@excalidraw/common 0.18.0-3bdaafe → 0.18.0-3c916c5
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 +1867 -345
- package/dist/dev/index.js.map +4 -4
- package/dist/prod/index.js +3 -3
- 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 +81 -39
- package/dist/types/common/src/constants.d.ts +103 -35
- 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 +5 -1
- package/dist/types/common/src/points.d.ts +1 -1
- package/dist/types/common/src/random.d.ts +7 -0
- package/dist/types/common/src/utility-types.d.ts +0 -1
- package/dist/types/common/src/utils.d.ts +59 -78
- package/dist/types/common/src/versionedSnapshotStore.d.ts +17 -0
- package/dist/types/element/src/Scene.d.ts +12 -8
- package/dist/types/element/src/align.d.ts +5 -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 +145 -49
- package/dist/types/element/src/bounds.d.ts +34 -19
- package/dist/types/element/src/bucketFill.d.ts +110 -0
- package/dist/types/element/src/collision.d.ts +24 -3
- package/dist/types/element/src/comparisons.d.ts +10 -7
- package/dist/types/element/src/convertToShape.d.ts +23 -0
- package/dist/types/element/src/cropElement.d.ts +36 -4
- package/dist/types/element/src/delta.d.ts +30 -2
- package/dist/types/element/src/distribute.d.ts +6 -2
- package/dist/types/element/src/dragElements.d.ts +37 -5
- package/dist/types/element/src/duplicate.d.ts +67 -6
- package/dist/types/element/src/elbowArrow.d.ts +7 -0
- package/dist/types/element/src/embeddable.d.ts +3 -2
- package/dist/types/element/src/flowchart.d.ts +9 -11
- package/dist/types/element/src/fractionalIndex.d.ts +4 -4
- package/dist/types/element/src/frame.d.ts +35 -12
- package/dist/types/element/src/groups.d.ts +10 -15
- package/dist/types/element/src/heading.d.ts +2 -1
- package/dist/types/element/src/image.d.ts +6 -13
- package/dist/types/element/src/index.d.ts +11 -4
- package/dist/types/element/src/linearElementEditor.d.ts +51 -30
- package/dist/types/element/src/listMarker.d.ts +39 -0
- package/dist/types/element/src/mutateElement.d.ts +6 -2
- package/dist/types/element/src/newElement.d.ts +61 -9
- package/dist/types/element/src/renderElement.d.ts +33 -12
- package/dist/types/element/src/renderEnvironment.d.ts +66 -0
- package/dist/types/element/src/resizeElements.d.ts +24 -14
- package/dist/types/element/src/resizeTest.d.ts +6 -5
- package/dist/types/element/src/selection.d.ts +11 -17
- package/dist/types/element/src/shape.d.ts +38 -9
- package/dist/types/element/src/sizeHelpers.d.ts +6 -0
- package/dist/types/element/src/sortElements.d.ts +10 -0
- package/dist/types/element/src/stickyNote.d.ts +191 -0
- package/dist/types/element/src/textElement.d.ts +23 -11
- package/dist/types/element/src/textMeasurements.d.ts +16 -14
- package/dist/types/element/src/textWrapping.d.ts +28 -1
- package/dist/types/{excalidraw/data → element/src}/transform.d.ts +32 -9
- package/dist/types/element/src/transformHandles.d.ts +8 -27
- package/dist/types/element/src/typeChecks.d.ts +30 -31
- package/dist/types/element/src/types.d.ts +55 -20
- package/dist/types/element/src/utils.d.ts +22 -6
- package/dist/types/element/src/zindex.d.ts +7 -1
- package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +248 -219
- package/dist/types/excalidraw/actions/actionAlign.d.ts +12 -13
- package/dist/types/excalidraw/actions/actionBoundText.d.ts +116 -272
- package/dist/types/excalidraw/actions/actionCanvas.d.ts +578 -1611
- package/dist/types/excalidraw/actions/actionClipboard.d.ts +177 -899
- package/dist/types/excalidraw/actions/actionCropEditor.d.ts +73 -64
- package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +4 -562
- package/dist/types/excalidraw/actions/actionDeselect.d.ts +182 -0
- package/dist/types/excalidraw/actions/actionDistribute.d.ts +4 -6
- package/dist/types/excalidraw/actions/actionDuplicateSelection.d.ts +3 -4
- package/dist/types/excalidraw/actions/actionElementLink.d.ts +80 -77
- package/dist/types/excalidraw/actions/actionElementLock.d.ts +149 -130
- package/dist/types/excalidraw/actions/actionExport.d.ts +229 -1415
- package/dist/types/excalidraw/actions/actionFinalize.d.ts +11 -394
- package/dist/types/excalidraw/actions/actionFlip.d.ts +2 -3
- package/dist/types/excalidraw/actions/actionFrame.d.ts +247 -875
- package/dist/types/excalidraw/actions/actionGroup.d.ts +160 -149
- package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +261 -238
- package/dist/types/excalidraw/actions/actionLink.d.ts +86 -77
- package/dist/types/excalidraw/actions/actionMenu.d.ts +75 -438
- package/dist/types/excalidraw/actions/actionNavigate.d.ts +18 -359
- package/dist/types/excalidraw/actions/actionProperties.d.ts +238 -2533
- package/dist/types/excalidraw/actions/actionSelectAll.d.ts +80 -75
- package/dist/types/excalidraw/actions/actionStyles.d.ts +74 -64
- package/dist/types/excalidraw/actions/actionTextAutoResize.d.ts +4 -4
- package/dist/types/excalidraw/actions/actionToggleArrowBinding.d.ts +195 -0
- package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +88 -80
- package/dist/types/excalidraw/actions/actionToggleMidpointSnapping.d.ts +195 -0
- package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +87 -78
- package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +76 -74
- package/dist/types/excalidraw/actions/actionToggleShapeSwitch.d.ts +2 -2
- package/dist/types/excalidraw/actions/actionToggleShowHints.d.ts +197 -0
- package/dist/types/excalidraw/actions/actionToggleStats.d.ts +86 -77
- package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +87 -78
- package/dist/types/excalidraw/actions/actionToggleWrap.d.ts +12 -0
- package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +87 -78
- package/dist/types/excalidraw/actions/actionZindex.d.ts +8 -9
- package/dist/types/excalidraw/actions/colorTargets.d.ts +39 -0
- package/dist/types/excalidraw/actions/index.d.ts +7 -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 +66 -35
- package/dist/types/excalidraw/charts/charts.bar.d.ts +3 -0
- package/dist/types/excalidraw/charts/charts.constants.d.ts +48 -0
- package/dist/types/excalidraw/charts/charts.helpers.d.ts +33 -0
- package/dist/types/excalidraw/charts/charts.line.d.ts +3 -0
- package/dist/types/excalidraw/charts/charts.parse.d.ts +10 -0
- package/dist/types/excalidraw/charts/charts.radar.d.ts +3 -0
- package/dist/types/excalidraw/charts/charts.types.d.ts +18 -0
- package/dist/types/excalidraw/charts/index.d.ts +8 -0
- package/dist/types/excalidraw/clipboard.d.ts +58 -21
- 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 +70 -0
- package/dist/types/excalidraw/components/App.bucketFill.d.ts +48 -0
- package/dist/types/excalidraw/components/App.clipboard.d.ts +31 -0
- package/dist/types/excalidraw/components/App.cursor.d.ts +38 -0
- package/dist/types/excalidraw/components/App.d.ts +415 -154
- package/dist/types/excalidraw/components/App.drawshape.d.ts +55 -0
- package/dist/types/excalidraw/components/App.duplicate.d.ts +101 -0
- package/dist/types/excalidraw/components/App.flowchart.d.ts +21 -0
- package/dist/types/excalidraw/components/App.host.d.ts +102 -0
- package/dist/types/excalidraw/components/App.modifiers.d.ts +38 -0
- package/dist/types/excalidraw/components/App.pan.d.ts +62 -0
- package/dist/types/excalidraw/components/App.selection.d.ts +265 -0
- package/dist/types/excalidraw/components/App.selectionTool.d.ts +93 -0
- package/dist/types/excalidraw/components/App.text.d.ts +146 -0
- package/dist/types/excalidraw/components/App.textTool.d.ts +140 -0
- package/dist/types/excalidraw/components/App.toolDrag.d.ts +63 -0
- package/dist/types/excalidraw/components/App.viewport.d.ts +123 -0
- package/dist/types/excalidraw/components/App.wheel.d.ts +26 -0
- package/dist/types/excalidraw/components/App.wrap.d.ts +31 -0
- package/dist/types/excalidraw/components/AppStateObserver.d.ts +37 -0
- package/dist/types/excalidraw/components/Card.d.ts +1 -3
- package/dist/types/excalidraw/components/ColorPicker/ColorInput.d.ts +2 -4
- package/dist/types/excalidraw/components/ColorPicker/ColorPicker.d.ts +9 -4
- package/dist/types/excalidraw/components/ColorPicker/CustomColorList.d.ts +3 -1
- package/dist/types/excalidraw/components/ColorPicker/Picker.d.ts +7 -1
- package/dist/types/excalidraw/components/ColorPicker/PickerColorList.d.ts +10 -2
- package/dist/types/excalidraw/components/ColorPicker/ShadeList.d.ts +5 -2
- package/dist/types/excalidraw/components/ColorPicker/TopPicks.d.ts +8 -1
- package/dist/types/excalidraw/components/ColorPicker/colorPickerUtils.d.ts +1 -2
- package/dist/types/excalidraw/components/ColorPicker/colorTopPicksDnD.d.ts +11 -0
- 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 +6 -5
- 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/FileDropOverlay.d.ts +2 -0
- package/dist/types/excalidraw/components/FilledButton.d.ts +2 -1
- package/dist/types/excalidraw/components/FontPicker/FontPicker.d.ts +5 -1
- package/dist/types/excalidraw/components/FontPicker/FontPickerList.d.ts +6 -1
- package/dist/types/excalidraw/components/FontPicker/FontPickerTrigger.d.ts +3 -1
- package/dist/types/excalidraw/components/FontPicker/fontTopPicksDnD.d.ts +12 -0
- 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/IconButton.d.ts +48 -0
- 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 +7 -3
- package/dist/types/excalidraw/components/LibraryUnit.d.ts +9 -5
- 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 +4 -2
- 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 +4 -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 +9 -3
- 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 +12 -0
- package/dist/types/excalidraw/components/TTDDialog/TTDWelcomeMessage.d.ts +1 -0
- package/dist/types/excalidraw/components/TTDDialog/TextToDiagram.d.ts +10 -0
- package/dist/types/excalidraw/components/TTDDialog/common.d.ts +19 -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 +8 -0
- package/dist/types/excalidraw/components/TTDDialog/mermaid-lang-lite.d.ts +2 -0
- package/dist/types/excalidraw/components/TTDDialog/types.d.ts +108 -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 +26 -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 +151 -0
- package/dist/types/excalidraw/components/Tooltip.d.ts +26 -2
- package/dist/types/excalidraw/components/TopPicksDnD/TopPicksContextMenu.d.ts +14 -0
- package/dist/types/excalidraw/components/TopPicksDnD/TopPicksTip.d.ts +11 -0
- package/dist/types/excalidraw/components/TopPicksDnD/topPicksDnD.d.ts +58 -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 +9 -4
- package/dist/types/excalidraw/components/canvases/NewElementCanvas.d.ts +3 -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/Hyperlink.d.ts +3 -2
- package/dist/types/excalidraw/components/hyperlink/helpers.d.ts +16 -5
- package/dist/types/excalidraw/components/icons.d.ts +56 -22
- package/dist/types/excalidraw/components/main-menu/DefaultItems.d.ts +26 -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 +373 -15
- 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 +11 -12
- package/dist/types/excalidraw/data/json.d.ts +192 -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/fonts/Fonts.d.ts +12 -8
- package/dist/types/excalidraw/history.d.ts +10 -4
- package/dist/types/excalidraw/hooks/useAppStateValue.d.ts +29 -0
- package/dist/types/excalidraw/hooks/useLibraryItemSvg.d.ts +2 -2
- package/dist/types/excalidraw/hooks/useOutsideClick.d.ts +4 -3
- package/dist/types/excalidraw/hooks/useScrollPosition.d.ts +1 -2
- package/dist/types/excalidraw/hooks/useTextEditorFocus.d.ts +14 -0
- package/dist/types/excalidraw/i18n.d.ts +2 -2
- package/dist/types/excalidraw/{laser-trails.d.ts → laserTrails.d.ts} +5 -7
- package/dist/types/excalidraw/lasso/index.d.ts +2 -3
- package/dist/types/excalidraw/lasso/utils.d.ts +2 -0
- package/dist/types/excalidraw/mermaid.d.ts +7 -0
- package/dist/types/excalidraw/reactUtils.d.ts +1 -1
- package/dist/types/excalidraw/renderOverrides.d.ts +9 -0
- package/dist/types/excalidraw/renderer/animation.d.ts +23 -0
- package/dist/types/excalidraw/renderer/helpers.d.ts +31 -8
- package/dist/types/excalidraw/renderer/interactiveScene.d.ts +7 -15
- package/dist/types/excalidraw/renderer/staticScene.d.ts +11 -6
- package/dist/types/excalidraw/scene/Renderer.d.ts +492 -20
- package/dist/types/excalidraw/scene/export.d.ts +344 -21
- package/dist/types/excalidraw/scene/index.d.ts +2 -2
- package/dist/types/excalidraw/scene/types.d.ts +51 -9
- 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 +697 -61
- package/dist/types/excalidraw/viewport.d.ts +302 -0
- package/dist/types/excalidraw/wysiwyg/textWysiwyg.d.ts +19 -5
- package/dist/types/fractional-indexing/src/index.d.ts +29 -0
- package/dist/types/laser-pointer/src/index.d.ts +2 -0
- package/dist/types/laser-pointer/src/math.d.ts +16 -0
- package/dist/types/laser-pointer/src/simplify.d.ts +2 -0
- package/dist/types/laser-pointer/src/state.d.ts +36 -0
- package/dist/types/math/src/constants.d.ts +0 -1
- package/dist/types/math/src/curve.d.ts +23 -13
- package/dist/types/math/src/index.d.ts +1 -0
- package/dist/types/math/src/pca.d.ts +79 -0
- package/dist/types/math/src/point.d.ts +8 -2
- package/dist/types/math/src/polygon.d.ts +26 -2
- package/dist/types/math/src/range.d.ts +1 -3
- package/dist/types/math/src/segment.d.ts +10 -3
- package/dist/types/math/src/types.d.ts +25 -1
- package/dist/types/utils/src/index.d.ts +4 -3
- package/dist/types/utils/src/shape.d.ts +8 -8
- package/package.json +7 -1
- package/dist/types/excalidraw/actions/actionEmbeddable.d.ts +0 -185
- 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/ToolButton.d.ts +0 -49
- 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 -190
- 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/export.d.ts +0 -35
- package/dist/types/utils/src/withinBounds.d.ts +0 -19
|
@@ -1,39 +1,77 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { type EXPORT_IMAGE_TYPES, Emitter } from "@excalidraw/common";
|
|
3
|
-
import { LinearElementEditor,
|
|
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
4
|
import type { ExcalidrawElement, NonDeleted, NonDeletedExcalidrawElement, ExcalidrawFrameLikeElement, ExcalidrawIframeElement, ExcalidrawEmbeddableElement, Ordered, SceneElementsMap } from "@excalidraw/element/types";
|
|
5
|
+
import type { RenderEnvironment, TransformHandleDirection } from "@excalidraw/element";
|
|
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 { AppClipboard } from "./App.clipboard";
|
|
19
|
+
import { AppText } from "./App.text";
|
|
20
|
+
import { AppTextTool } from "./App.textTool";
|
|
21
|
+
import { AppBucketFill } from "./App.bucketFill";
|
|
22
|
+
import { AppToolDrag } from "./App.toolDrag";
|
|
23
|
+
import { AppCursor } from "./App.cursor";
|
|
24
|
+
import { AppDrawShape } from "./App.drawshape";
|
|
25
|
+
import { AppDuplicate } from "./App.duplicate";
|
|
26
|
+
import { AppFlowchart } from "./App.flowchart";
|
|
27
|
+
import { AppModifiers } from "./App.modifiers";
|
|
28
|
+
import { AppPan } from "./App.pan";
|
|
29
|
+
import { AppViewport } from "./App.viewport";
|
|
30
|
+
import { AppWheel } from "./App.wheel";
|
|
31
|
+
import { AppSelection } from "./App.selection";
|
|
32
|
+
import { AppSelectionTool } from "./App.selectionTool";
|
|
33
|
+
import { AppWrap } from "./App.wrap";
|
|
34
|
+
import { AppHost } from "./App.host";
|
|
35
|
+
import { CursorHints } from "./CursorHint";
|
|
36
|
+
import { type OnStateChange } from "./AppStateObserver";
|
|
15
37
|
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";
|
|
38
|
+
import type { AppClassProperties, AppProps, AppState, ElementRenderOverrides, ExcalidrawImperativeAPI, BinaryFiles, LibraryItems, PointerDownState, SceneData, FrameNameBoundsCache, SidebarName, SidebarTabName, KeyboardModifiersObject, ToolType, OnUserFollowedPayload, ExcalidrawImperativeAPIEventMap, GenerateDiagramToCode, NullableGridSize, UIConfig } from "../types";
|
|
18
39
|
import type { RoughCanvas } from "roughjs/bin/canvas";
|
|
19
40
|
import type { ActionResult } from "../actions/types";
|
|
41
|
+
declare const editorLifecycleEventBehavior: {
|
|
42
|
+
readonly "editor:mount": {
|
|
43
|
+
readonly cardinality: "once";
|
|
44
|
+
readonly replay: "last";
|
|
45
|
+
};
|
|
46
|
+
readonly "editor:initialize": {
|
|
47
|
+
readonly cardinality: "once";
|
|
48
|
+
readonly replay: "last";
|
|
49
|
+
};
|
|
50
|
+
readonly "editor:unmount": {
|
|
51
|
+
readonly cardinality: "once";
|
|
52
|
+
readonly replay: "last";
|
|
53
|
+
};
|
|
54
|
+
};
|
|
20
55
|
export declare const ExcalidrawContainerContext: React.Context<{
|
|
21
56
|
container: HTMLDivElement | null;
|
|
22
57
|
id: string | null;
|
|
23
58
|
}>;
|
|
59
|
+
export declare const ExcalidrawAPIContext: React.Context<ExcalidrawImperativeAPI | null>;
|
|
60
|
+
export declare const ExcalidrawAPISetContext: React.Context<((api: ExcalidrawImperativeAPI | null) => void) | null>;
|
|
24
61
|
export declare const useApp: () => AppClassProperties;
|
|
25
62
|
export declare const useAppProps: () => AppProps;
|
|
26
|
-
export declare const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
canFitSidebar: boolean;
|
|
34
|
-
};
|
|
63
|
+
export declare const useEditorInterface: () => Readonly<{
|
|
64
|
+
formFactor: "phone" | "tablet" | "desktop";
|
|
65
|
+
desktopUIMode: "compact" | "full";
|
|
66
|
+
userAgent: Readonly<{
|
|
67
|
+
isMobileDevice: boolean;
|
|
68
|
+
platform: "ios" | "android" | "other" | "unknown";
|
|
69
|
+
}>;
|
|
35
70
|
isTouchScreen: boolean;
|
|
71
|
+
canFitSidebar: boolean;
|
|
72
|
+
isLandscape: boolean;
|
|
36
73
|
}>;
|
|
74
|
+
export declare const useStylesPanelMode: () => StylesPanelMode;
|
|
37
75
|
export declare const useExcalidrawContainer: () => {
|
|
38
76
|
container: HTMLDivElement | null;
|
|
39
77
|
id: string | null;
|
|
@@ -42,24 +80,43 @@ export declare const useExcalidrawElements: () => readonly NonDeletedExcalidrawE
|
|
|
42
80
|
export declare const useExcalidrawAppState: () => AppState;
|
|
43
81
|
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
82
|
export declare const useExcalidrawActionManager: () => ActionManager;
|
|
83
|
+
/**
|
|
84
|
+
* Requires wrapping your component in <ExcalidrawAPIContext.Provider>
|
|
85
|
+
*/
|
|
86
|
+
export declare const useExcalidrawAPI: () => ExcalidrawImperativeAPI | null;
|
|
45
87
|
declare class App extends React.Component<AppProps, AppState> {
|
|
46
88
|
canvas: AppClassProperties["canvas"];
|
|
47
89
|
interactiveCanvas: AppClassProperties["interactiveCanvas"];
|
|
90
|
+
sessionExportThemeOverride: AppState["theme"] | undefined;
|
|
48
91
|
rc: RoughCanvas;
|
|
49
92
|
unmounted: boolean;
|
|
50
93
|
actionManager: ActionManager;
|
|
51
|
-
|
|
94
|
+
editorInterface: EditorInterface;
|
|
95
|
+
private stylesPanelMode;
|
|
52
96
|
private excalidrawContainerRef;
|
|
97
|
+
private zenModeTransitionTimer;
|
|
98
|
+
get ownerDocument(): Document;
|
|
99
|
+
get ownerWindow(): Window & typeof globalThis;
|
|
100
|
+
/**
|
|
101
|
+
* Everything binding this editor to the document/window it renders into
|
|
102
|
+
* (render environment, hyperlink tooltip ownership). Delegated to so the
|
|
103
|
+
* cross-document ownership rules live in one place.
|
|
104
|
+
*/
|
|
105
|
+
host: AppHost;
|
|
106
|
+
/** @see AppHost.renderEnvironment */
|
|
107
|
+
get renderEnvironment(): RenderEnvironment;
|
|
53
108
|
scene: Scene;
|
|
54
109
|
fonts: Fonts;
|
|
55
110
|
renderer: Renderer;
|
|
56
111
|
visibleElements: readonly NonDeletedExcalidrawElement[];
|
|
112
|
+
/** whether the last render had any renderable elements (excludes e.g. the
|
|
113
|
+
* in-progress `newElement` and the edited text element) */
|
|
114
|
+
private hasRenderableElements;
|
|
57
115
|
private resizeObserver;
|
|
58
|
-
private nearestScrollableContainer;
|
|
59
116
|
library: AppClassProperties["library"];
|
|
60
117
|
libraryItemsFromStorage: LibraryItems | undefined;
|
|
61
118
|
id: string;
|
|
62
|
-
|
|
119
|
+
store: Store;
|
|
63
120
|
private history;
|
|
64
121
|
excalidrawContainerValue: {
|
|
65
122
|
container: HTMLDivElement | null;
|
|
@@ -78,26 +135,51 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
78
135
|
/** embeds that have been inserted to DOM (as a perf optim, we don't want to
|
|
79
136
|
* insert to DOM before user initially scrolls to them) */
|
|
80
137
|
private initializedEmbeds;
|
|
81
|
-
private handleToastClose;
|
|
82
138
|
private elementsPendingErasure;
|
|
83
|
-
|
|
84
|
-
private
|
|
139
|
+
private _initialized;
|
|
140
|
+
private readonly editorLifecycleEvents;
|
|
141
|
+
onEvent: AppEventBus<ExcalidrawImperativeAPIEventMap, typeof editorLifecycleEventBehavior>["on"];
|
|
142
|
+
private appStateObserver;
|
|
143
|
+
onStateChange: OnStateChange;
|
|
144
|
+
bucketFill: AppBucketFill;
|
|
145
|
+
duplicate: AppDuplicate;
|
|
146
|
+
toolDrag: AppToolDrag;
|
|
147
|
+
flowchart: AppFlowchart;
|
|
148
|
+
cursor: AppCursor;
|
|
149
|
+
arrowText: AppArrowText;
|
|
150
|
+
pan: AppPan;
|
|
151
|
+
textTool: AppTextTool;
|
|
152
|
+
clipboard: AppClipboard;
|
|
153
|
+
text: AppText;
|
|
154
|
+
viewport: AppViewport;
|
|
155
|
+
wheel: AppWheel;
|
|
156
|
+
selection: AppSelection;
|
|
157
|
+
selectionTool: AppSelectionTool;
|
|
158
|
+
wrap: AppWrap;
|
|
159
|
+
bindModeHandler: ReturnType<typeof setTimeout> | null;
|
|
85
160
|
hitLinkElement?: NonDeletedExcalidrawElement;
|
|
86
161
|
lastPointerDownEvent: React.PointerEvent<HTMLElement> | null;
|
|
162
|
+
/**
|
|
163
|
+
* the handle of the resize in progress while `state.isResizing` — for UI
|
|
164
|
+
* that words itself by handle (a sticky note's corners resize
|
|
165
|
+
* proportionally, its edges freely); not app state, so it costs no
|
|
166
|
+
* re-render of its own
|
|
167
|
+
*/
|
|
168
|
+
activeResizeHandle: TransformHandleDirection | null;
|
|
87
169
|
lastPointerUpEvent: React.PointerEvent<HTMLElement> | PointerEvent | null;
|
|
170
|
+
lastPointerUpIsDoubleClick: boolean;
|
|
88
171
|
lastPointerMoveEvent: PointerEvent | null;
|
|
172
|
+
/** current frame pointer cords */
|
|
89
173
|
lastPointerMoveCoords: {
|
|
90
174
|
x: number;
|
|
91
175
|
y: number;
|
|
92
176
|
} | null;
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
y: number;
|
|
96
|
-
};
|
|
97
|
-
animationFrameHandler: AnimationFrameHandler;
|
|
177
|
+
private lastCompletedCanvasClicks;
|
|
178
|
+
drawShape: AppDrawShape;
|
|
98
179
|
laserTrails: LaserTrails;
|
|
99
180
|
eraserTrail: EraserTrail;
|
|
100
181
|
lassoTrail: LassoTrail;
|
|
182
|
+
cursorHints: CursorHints;
|
|
101
183
|
onChangeEmitter: Emitter<[elements: readonly ExcalidrawElement[], appState: AppState, files: BinaryFiles]>;
|
|
102
184
|
onPointerDownEmitter: Emitter<[activeTool: {
|
|
103
185
|
lastActiveTool: import("../types").ActiveTool | null;
|
|
@@ -112,11 +194,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
112
194
|
x: number;
|
|
113
195
|
y: number;
|
|
114
196
|
}>;
|
|
115
|
-
scrollbars:
|
|
116
|
-
isOverEither: boolean;
|
|
117
|
-
isOverHorizontal: boolean;
|
|
118
|
-
isOverVertical: boolean;
|
|
119
|
-
};
|
|
197
|
+
scrollbars: ReturnType<typeof isOverScrollBars>;
|
|
120
198
|
lastCoords: {
|
|
121
199
|
x: number;
|
|
122
200
|
y: number;
|
|
@@ -129,7 +207,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
129
207
|
x: number;
|
|
130
208
|
y: number;
|
|
131
209
|
};
|
|
132
|
-
arrowDirection: "
|
|
210
|
+
arrowDirection: "origin" | "end";
|
|
133
211
|
center: {
|
|
134
212
|
x: number;
|
|
135
213
|
y: number;
|
|
@@ -139,8 +217,12 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
139
217
|
element: NonDeleted<ExcalidrawElement> | null;
|
|
140
218
|
allHitElements: NonDeleted<ExcalidrawElement>[];
|
|
141
219
|
wasAddedToSelection: boolean;
|
|
220
|
+
cycleTarget: NonDeleted<ExcalidrawElement> | null;
|
|
142
221
|
hasBeenDuplicated: boolean;
|
|
222
|
+
advancedListMarkers: readonly import("@excalidraw/element").ListMarkerAdvance[];
|
|
223
|
+
editedTextId: import("@excalidraw/element/types").ExcalidrawTextElement["id"] | null;
|
|
143
224
|
hasHitCommonBoundingBoxOfSelectedElements: boolean;
|
|
225
|
+
arrowLabel: boolean;
|
|
144
226
|
};
|
|
145
227
|
withCmdOrCtrl: boolean;
|
|
146
228
|
drag: {
|
|
@@ -153,17 +235,17 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
153
235
|
x: number;
|
|
154
236
|
y: number;
|
|
155
237
|
};
|
|
238
|
+
lastOffset: {
|
|
239
|
+
x: number;
|
|
240
|
+
y: number;
|
|
241
|
+
};
|
|
156
242
|
blockDragging: boolean;
|
|
157
243
|
};
|
|
158
244
|
eventListeners: {
|
|
159
|
-
onMove:
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
} | null;
|
|
164
|
-
onUp: ((event: PointerEvent) => void) | null;
|
|
165
|
-
onKeyDown: ((event: KeyboardEvent) => void) | null;
|
|
166
|
-
onKeyUp: ((event: KeyboardEvent) => void) | null;
|
|
245
|
+
onMove: null | ReturnType<typeof import("@excalidraw/common").throttleRAF>;
|
|
246
|
+
onUp: null | ((event: PointerEvent) => void);
|
|
247
|
+
onKeyDown: null | ((event: KeyboardEvent) => void);
|
|
248
|
+
onKeyUp: null | ((event: KeyboardEvent) => void);
|
|
167
249
|
};
|
|
168
250
|
boxSelection: {
|
|
169
251
|
hasOccurred: boolean;
|
|
@@ -182,11 +264,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
182
264
|
x: number;
|
|
183
265
|
y: number;
|
|
184
266
|
}>;
|
|
185
|
-
scrollbars:
|
|
186
|
-
isOverEither: boolean;
|
|
187
|
-
isOverHorizontal: boolean;
|
|
188
|
-
isOverVertical: boolean;
|
|
189
|
-
};
|
|
267
|
+
scrollbars: ReturnType<typeof isOverScrollBars>;
|
|
190
268
|
lastCoords: {
|
|
191
269
|
x: number;
|
|
192
270
|
y: number;
|
|
@@ -199,7 +277,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
199
277
|
x: number;
|
|
200
278
|
y: number;
|
|
201
279
|
};
|
|
202
|
-
arrowDirection: "
|
|
280
|
+
arrowDirection: "origin" | "end";
|
|
203
281
|
center: {
|
|
204
282
|
x: number;
|
|
205
283
|
y: number;
|
|
@@ -209,8 +287,12 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
209
287
|
element: NonDeleted<ExcalidrawElement> | null;
|
|
210
288
|
allHitElements: NonDeleted<ExcalidrawElement>[];
|
|
211
289
|
wasAddedToSelection: boolean;
|
|
290
|
+
cycleTarget: NonDeleted<ExcalidrawElement> | null;
|
|
212
291
|
hasBeenDuplicated: boolean;
|
|
292
|
+
advancedListMarkers: readonly import("@excalidraw/element").ListMarkerAdvance[];
|
|
293
|
+
editedTextId: import("@excalidraw/element/types").ExcalidrawTextElement["id"] | null;
|
|
213
294
|
hasHitCommonBoundingBoxOfSelectedElements: boolean;
|
|
295
|
+
arrowLabel: boolean;
|
|
214
296
|
};
|
|
215
297
|
withCmdOrCtrl: boolean;
|
|
216
298
|
drag: {
|
|
@@ -223,17 +305,17 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
223
305
|
x: number;
|
|
224
306
|
y: number;
|
|
225
307
|
};
|
|
308
|
+
lastOffset: {
|
|
309
|
+
x: number;
|
|
310
|
+
y: number;
|
|
311
|
+
};
|
|
226
312
|
blockDragging: boolean;
|
|
227
313
|
};
|
|
228
314
|
eventListeners: {
|
|
229
|
-
onMove:
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
} | null;
|
|
234
|
-
onUp: ((event: PointerEvent) => void) | null;
|
|
235
|
-
onKeyDown: ((event: KeyboardEvent) => void) | null;
|
|
236
|
-
onKeyUp: ((event: KeyboardEvent) => void) | null;
|
|
315
|
+
onMove: null | ReturnType<typeof import("@excalidraw/common").throttleRAF>;
|
|
316
|
+
onUp: null | ((event: PointerEvent) => void);
|
|
317
|
+
onKeyDown: null | ((event: KeyboardEvent) => void);
|
|
318
|
+
onKeyUp: null | ((event: KeyboardEvent) => void);
|
|
237
319
|
};
|
|
238
320
|
boxSelection: {
|
|
239
321
|
hasOccurred: boolean;
|
|
@@ -245,10 +327,91 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
245
327
|
}>]>;
|
|
246
328
|
missingPointerEventCleanupEmitter: Emitter<[event: PointerEvent | null]>;
|
|
247
329
|
onRemoveEventListenersEmitter: Emitter<[]>;
|
|
248
|
-
|
|
330
|
+
modifiers: AppModifiers;
|
|
331
|
+
api: ExcalidrawImperativeAPI;
|
|
332
|
+
private elementRenderOverrides;
|
|
333
|
+
/** offsets of `elementRenderOverrides`; keeps its identity while they don't change */
|
|
334
|
+
private elementRenderOffsets;
|
|
335
|
+
private renderOverridesUpdatePending;
|
|
336
|
+
private getRenderOverrideConfig;
|
|
337
|
+
private getElementRenderState;
|
|
338
|
+
private createExcalidrawAPI;
|
|
249
339
|
constructor(props: AppProps);
|
|
340
|
+
/**
|
|
341
|
+
* Whether the editor accepts user input (pointer, keyboard, wheel, touch,
|
|
342
|
+
* clipboard, drag&drop). When `false`, the editor is fully inert for the
|
|
343
|
+
* user, but remains controllable through the imperative API.
|
|
344
|
+
*
|
|
345
|
+
* All user-input entry points must consult this getter (directly or by
|
|
346
|
+
* not being attached/rendered at all).
|
|
347
|
+
*/
|
|
348
|
+
isInteractionEnabled(props?: Pick<AppProps, "interaction">): boolean;
|
|
349
|
+
/**
|
|
350
|
+
* Whether element links render their link icon and are clickable.
|
|
351
|
+
* True when fully interactive, or when `interaction: { enabled: { links:
|
|
352
|
+
* true } }`
|
|
353
|
+
* (in which case clicking anywhere on a linked element opens the link,
|
|
354
|
+
* same as in view mode).
|
|
355
|
+
*/
|
|
356
|
+
isLinksEnabled(props?: Pick<AppProps, "interaction">): boolean;
|
|
357
|
+
/**
|
|
358
|
+
* Whether canvas navigation — panning & zooming, view-mode style — is
|
|
359
|
+
* enabled. True when fully interactive, or when `interaction: { enabled:
|
|
360
|
+
* { navigation: true } }`. Respects `appState.scrollConstraints`.
|
|
361
|
+
*/
|
|
362
|
+
isNavigationEnabled(props?: Pick<AppProps, "interaction">): boolean;
|
|
363
|
+
/**
|
|
364
|
+
* Whether embeddable & iframe elements are interactive (hover & click to
|
|
365
|
+
* activate, view-mode style). True when fully interactive, or when
|
|
366
|
+
* allowed via `interaction.enabled.embeds` / `.interactiveContent`.
|
|
367
|
+
*/
|
|
368
|
+
isEmbedsEnabled(props?: Pick<AppProps, "interaction">): boolean;
|
|
369
|
+
/**
|
|
370
|
+
* Whether the browser's own zoom (ctrl/cmd + wheel, pinch, keyboard
|
|
371
|
+
* shortcuts) stays available over the non-interactive editor.
|
|
372
|
+
* Prevented by default.
|
|
373
|
+
*/
|
|
374
|
+
isBrowserZoomEnabled(props?: Pick<AppProps, "interaction">): boolean;
|
|
375
|
+
/**
|
|
376
|
+
* Whether the tool can be activated & driven by user input. False when
|
|
377
|
+
* disabled via `UIOptions.tools`, or when the editor is non-interactive
|
|
378
|
+
* and the tool isn't kept user-driven via `interaction.enabled.tools`.
|
|
379
|
+
*
|
|
380
|
+
* (Once UI tool availability is split from input availability — e.g.
|
|
381
|
+
* `props.ui.tools` vs `interaction.disabled.tools` — the UI axis moves
|
|
382
|
+
* out into its own predicate.)
|
|
383
|
+
*
|
|
384
|
+
* We purposely widen the `tool` type so this helper can be called with
|
|
385
|
+
* any tool without having to type check it.
|
|
386
|
+
*/
|
|
387
|
+
isToolSupported: <T extends ToolType | "custom">(tool: T, props?: Pick<AppProps, "interaction" | "UIOptions">) => boolean;
|
|
388
|
+
/**
|
|
389
|
+
* Whether the active tool is locked in place — via the tool lock
|
|
390
|
+
* (padlock / Q) or by being host-forced (`props.activeTool`). A locked
|
|
391
|
+
* tool doesn't revert to the selection tool after use, and elements drawn
|
|
392
|
+
* with it aren't selected. Forcing deliberately does not mutate
|
|
393
|
+
* `activeTool.locked`, which is the user's persisted padlock preference.
|
|
394
|
+
*/
|
|
395
|
+
isToolLocked(): boolean;
|
|
396
|
+
/**
|
|
397
|
+
* Whether the active tool captures the primary pointer instead of the
|
|
398
|
+
* view-mode drag-to-pan — the laser and host-implemented custom tools do;
|
|
399
|
+
* while non-interactive, any tool allowed via
|
|
400
|
+
* `interaction.enabled.tools` does. (Editing tools capture the pointer
|
|
401
|
+
* trivially since view mode implies they're not active; this predicate only
|
|
402
|
+
* matters where view-mode gates apply.)
|
|
403
|
+
*/
|
|
404
|
+
isActiveToolPointerCapturing(): boolean;
|
|
405
|
+
/** Whether Excalidraw's full default UI is rendered. */
|
|
406
|
+
isDefaultUIEnabled(props?: Pick<AppProps, "ui">): boolean;
|
|
407
|
+
/** Whether an individual default UI control is rendered. */
|
|
408
|
+
isUIControlEnabled(control: keyof UIConfig["enabled"], props?: Pick<AppProps, "ui">): boolean;
|
|
250
409
|
updateEditorAtom: <Value, Args extends unknown[], Result>(atom: WritableAtom<Value, Args, Result>, ...args: Args) => Result;
|
|
251
410
|
private onWindowMessage;
|
|
411
|
+
private handleSkipBindMode;
|
|
412
|
+
private resetDelayedBindMode;
|
|
413
|
+
private previousHoveredBindableElement;
|
|
414
|
+
private handleDelayedBindModeChange;
|
|
252
415
|
private cacheEmbeddableRef;
|
|
253
416
|
/**
|
|
254
417
|
* Returns gridSize taking into account `gridModeEnabled`.
|
|
@@ -256,7 +419,15 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
256
419
|
*/
|
|
257
420
|
getEffectiveGridSize: () => NullableGridSize;
|
|
258
421
|
private getHTMLIFrameElement;
|
|
259
|
-
|
|
422
|
+
/**
|
|
423
|
+
* AI-generated iframe elements aren't interactive while their generation
|
|
424
|
+
* is still in progress (the partial content is render-only).
|
|
425
|
+
*/
|
|
426
|
+
private isIframeLikeInteractive;
|
|
427
|
+
private handleIframeLikeElementHover;
|
|
428
|
+
/** @returns true if iframe-like element click handled */
|
|
429
|
+
private handleIframeLikeCenterClick;
|
|
430
|
+
private isDoubleClick;
|
|
260
431
|
private isIframeLikeElementCenter;
|
|
261
432
|
private updateEmbedValidationStatus;
|
|
262
433
|
private updateEmbeddables;
|
|
@@ -269,11 +440,11 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
269
440
|
render(): import("react/jsx-runtime").JSX.Element;
|
|
270
441
|
focusContainer: AppClassProperties["focusContainer"];
|
|
271
442
|
getSceneElementsIncludingDeleted: () => readonly import("@excalidraw/element/types").OrderedExcalidrawElement[];
|
|
272
|
-
getSceneElementsMapIncludingDeleted: () =>
|
|
443
|
+
getSceneElementsMapIncludingDeleted: () => SceneElementsMap;
|
|
273
444
|
getSceneElements: () => readonly Ordered<NonDeletedExcalidrawElement>[];
|
|
274
445
|
onInsertElements: (elements: readonly ExcalidrawElement[]) => void;
|
|
275
446
|
onExportImage: (type: keyof typeof EXPORT_IMAGE_TYPES, elements: ExportedElements, opts: {
|
|
276
|
-
exportingFrame: ExcalidrawFrameLikeElement | null;
|
|
447
|
+
exportingFrame: NonDeleted<ExcalidrawFrameLikeElement> | null;
|
|
277
448
|
}) => Promise<void>;
|
|
278
449
|
private magicGenerations;
|
|
279
450
|
private updateMagicGeneration;
|
|
@@ -289,9 +460,35 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
289
460
|
private openEyeDropper;
|
|
290
461
|
dismissLinearEditor: () => void;
|
|
291
462
|
syncActionResult: (actionResult: ActionResult) => void;
|
|
463
|
+
scheduleCapture: () => void;
|
|
292
464
|
private onBlur;
|
|
293
465
|
private onUnload;
|
|
294
466
|
private disableEvent;
|
|
467
|
+
private isFileDropEnabled;
|
|
468
|
+
private onDragOver;
|
|
469
|
+
private handleNavigationModeKeyDown;
|
|
470
|
+
/**
|
|
471
|
+
* PageUp/PageDown scroll the canvas by a page — vertically, or
|
|
472
|
+
* horizontally with shift. Respects `appState.scrollConstraints`
|
|
473
|
+
* (via `viewport.translate`).
|
|
474
|
+
*/
|
|
475
|
+
private maybeHandlePageScrollKeyDown;
|
|
476
|
+
private preventBrowserZoomKeyDown;
|
|
477
|
+
/** Ends active input sessions before switching to a view-mode/non-interactive
|
|
478
|
+
* mode. */
|
|
479
|
+
private terminateActiveInteraction;
|
|
480
|
+
private handleInteractionStateChange;
|
|
481
|
+
/** whether the two values reference the same tool (incl. custom subtype) */
|
|
482
|
+
private isSameForcedTool;
|
|
483
|
+
/**
|
|
484
|
+
* Keeps `state.activeTool` synced to the host-controlled
|
|
485
|
+
* `props.activeTool`. `setActiveTool` refuses non-matching activations
|
|
486
|
+
* while forced (user input, API); this backstop covers the writers that
|
|
487
|
+
* bypass the funnel (`actionFinalize`/`actionDeselect`, `restore()` on
|
|
488
|
+
* scene load, ...) and re-applies the tool once it becomes activatable
|
|
489
|
+
* (e.g. `interaction` config changes).
|
|
490
|
+
*/
|
|
491
|
+
private handleForcedToolChange;
|
|
295
492
|
private resetHistory;
|
|
296
493
|
private resetStore;
|
|
297
494
|
/**
|
|
@@ -300,10 +497,11 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
300
497
|
*/
|
|
301
498
|
private resetScene;
|
|
302
499
|
private initializeScene;
|
|
303
|
-
private
|
|
304
|
-
|
|
305
|
-
private
|
|
306
|
-
|
|
500
|
+
private getFormFactor;
|
|
501
|
+
refreshEditorInterface: () => void;
|
|
502
|
+
private reconcileStylesPanelMode;
|
|
503
|
+
/** TO BE USED LATER */
|
|
504
|
+
private setDesktopUIMode;
|
|
307
505
|
private clearImageShapeCache;
|
|
308
506
|
componentDidMount(): Promise<void>;
|
|
309
507
|
componentWillUnmount(): void;
|
|
@@ -312,16 +510,20 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
312
510
|
private onFullscreenChange;
|
|
313
511
|
private removeEventListeners;
|
|
314
512
|
private addEventListeners;
|
|
513
|
+
getSnapshotBeforeUpdate(prevProps: AppProps, prevState: AppState): null;
|
|
514
|
+
/**
|
|
515
|
+
* Flags the container while toggling zen mode so that UI chrome
|
|
516
|
+
* (backgrounds etc.) animates only then, and hover transitions stay
|
|
517
|
+
* instant. A data attribute so that React doesn't reset it on re-render.
|
|
518
|
+
*/
|
|
519
|
+
private markZenModeTransition;
|
|
520
|
+
private unmarkZenModeTransition;
|
|
315
521
|
componentDidUpdate(prevProps: AppProps, prevState: AppState): void;
|
|
316
522
|
private renderInteractiveSceneCallback;
|
|
317
523
|
private onScroll;
|
|
318
|
-
private onCut;
|
|
319
|
-
private onCopy;
|
|
320
524
|
private static resetTapTwice;
|
|
321
525
|
private onTouchStart;
|
|
322
526
|
private onTouchEnd;
|
|
323
|
-
private insertClipboardContent;
|
|
324
|
-
pasteFromClipboard: (event: ClipboardEvent) => Promise<void>;
|
|
325
527
|
addElementsFromPasteOrLibrary: (opts: {
|
|
326
528
|
elements: readonly ExcalidrawElement[];
|
|
327
529
|
files: BinaryFiles | null;
|
|
@@ -330,54 +532,25 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
330
532
|
clientY: number;
|
|
331
533
|
} | "cursor" | "center";
|
|
332
534
|
retainSeed?: boolean;
|
|
333
|
-
|
|
535
|
+
fit?: SetViewportOptions["fit"];
|
|
536
|
+
preserveFrameChildrenOrder?: boolean;
|
|
334
537
|
}) => void;
|
|
335
|
-
private addElementsFromMixedContentPaste;
|
|
336
|
-
private addTextFromPaste;
|
|
337
538
|
setAppState: React.Component<any, AppState>["setState"];
|
|
338
539
|
removePointer: (event: React.PointerEvent<HTMLElement> | PointerEvent) => void;
|
|
339
540
|
toggleLock: (source?: "keyboard" | "ui") => void;
|
|
340
|
-
updateFrameRendering: (opts: Partial<
|
|
341
|
-
enabled: boolean;
|
|
342
|
-
name: boolean;
|
|
343
|
-
outline: boolean;
|
|
344
|
-
clip: boolean;
|
|
345
|
-
}> | ((prevState: AppState["frameRendering"]) => Partial<AppState["frameRendering"]>)) => void;
|
|
541
|
+
updateFrameRendering: (opts: Partial<AppState["frameRendering"]> | ((prevState: AppState["frameRendering"]) => Partial<AppState["frameRendering"]>)) => void;
|
|
346
542
|
togglePenMode: (force: boolean | null) => void;
|
|
347
|
-
|
|
348
|
-
/**
|
|
349
|
-
*
|
|
350
|
-
*/
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
duration?: number;
|
|
359
|
-
} | {
|
|
360
|
-
fitToContent?: never;
|
|
361
|
-
fitToViewport?: boolean;
|
|
362
|
-
/** when fitToViewport=true, how much screen should the content cover,
|
|
363
|
-
* between 0.1 (10%) and 1 (100%)
|
|
364
|
-
*/
|
|
365
|
-
viewportZoomFactor?: number;
|
|
366
|
-
animate?: boolean;
|
|
367
|
-
duration?: number;
|
|
368
|
-
}) & {
|
|
369
|
-
minZoom?: number;
|
|
370
|
-
maxZoom?: number;
|
|
371
|
-
canvasOffsets?: Offsets;
|
|
372
|
-
}) => void;
|
|
373
|
-
private maybeUnfollowRemoteUser;
|
|
374
|
-
/** use when changing scrollX/scrollY/zoom based on user interaction */
|
|
375
|
-
private translateCanvas;
|
|
376
|
-
setToast: (toast: {
|
|
377
|
-
message: string;
|
|
378
|
-
closable?: boolean;
|
|
379
|
-
duration?: number;
|
|
380
|
-
} | null) => void;
|
|
543
|
+
revealIfHidden: (elements: NonDeletedExcalidrawElement[]) => void;
|
|
544
|
+
/** emits a follow/unfollow intent to the host (which owns the
|
|
545
|
+
* `userToFollow` state) via both the `onUserFollow` prop and the
|
|
546
|
+
* imperative API emitter */
|
|
547
|
+
emitUserFollowIntent: (payload: OnUserFollowedPayload) => void;
|
|
548
|
+
/** emits an UNFOLLOW intent if currently following someone — use on
|
|
549
|
+
* viewport changes that take the view over from the followed user (user
|
|
550
|
+
* pans and zooms, `setViewport` navigation) */
|
|
551
|
+
requestUnfollow: () => void;
|
|
552
|
+
setToast: (toast: AppState["toast"]) => void;
|
|
553
|
+
private showSceneReplacedToast;
|
|
381
554
|
restoreFileFromShare: () => Promise<void>;
|
|
382
555
|
/**
|
|
383
556
|
* adds supplied files to existing files in the appState.
|
|
@@ -387,7 +560,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
387
560
|
private addMissingFiles;
|
|
388
561
|
updateScene: <K extends keyof AppState>(sceneData: {
|
|
389
562
|
elements?: SceneData["elements"];
|
|
390
|
-
appState?: Pick<AppState, K> | null
|
|
563
|
+
appState?: Pick<AppState, K> | null;
|
|
391
564
|
collaborators?: SceneData["collaborators"];
|
|
392
565
|
/**
|
|
393
566
|
* 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.
|
|
@@ -402,22 +575,26 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
402
575
|
*/
|
|
403
576
|
captureUpdate?: SceneData["captureUpdate"];
|
|
404
577
|
}) => void;
|
|
578
|
+
/**
|
|
579
|
+
* see {@link ExcalidrawImperativeAPI.setElementRenderOverrides} for details
|
|
580
|
+
*/
|
|
581
|
+
setElementRenderOverrides: (overrides: ElementRenderOverrides | null) => void;
|
|
405
582
|
applyDeltas: (deltas: StoreDelta[], options?: ApplyToOptions) => [SceneElementsMap, AppState, boolean];
|
|
406
583
|
mutateElement: <TElement extends Mutable<ExcalidrawElement>>(element: TElement, updates: ElementUpdate<TElement>, informMutation?: boolean) => TElement;
|
|
407
|
-
|
|
584
|
+
triggerRender: (
|
|
585
|
+
/** force always re-renders canvas even if no change */
|
|
586
|
+
force?: boolean) => void;
|
|
408
587
|
/**
|
|
409
588
|
* @returns whether the menu was toggled on or off
|
|
410
589
|
*/
|
|
411
590
|
toggleSidebar: ({ name, tab, force, }: {
|
|
412
591
|
name: SidebarName | null;
|
|
413
|
-
tab?:
|
|
414
|
-
force?: boolean
|
|
592
|
+
tab?: SidebarTabName;
|
|
593
|
+
force?: boolean;
|
|
415
594
|
}) => boolean;
|
|
416
595
|
private updateCurrentCursorPosition;
|
|
417
|
-
getEditorUIOffsets: () => Offsets;
|
|
418
596
|
private onKeyDown;
|
|
419
597
|
private onKeyUp;
|
|
420
|
-
private isToolSupported;
|
|
421
598
|
setActiveTool: (tool: ({
|
|
422
599
|
type: ToolType;
|
|
423
600
|
} | {
|
|
@@ -426,10 +603,18 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
426
603
|
}) & {
|
|
427
604
|
locked?: boolean;
|
|
428
605
|
fromSelection?: boolean;
|
|
429
|
-
},
|
|
606
|
+
}, opts?: {
|
|
607
|
+
keepSelection?: boolean;
|
|
608
|
+
/**
|
|
609
|
+
* When `true`, re-activating an already-active toggle tool (see
|
|
610
|
+
* `TOGGLE_TOOLS`) switches back to the previously active tool.
|
|
611
|
+
* Activation is idempotent by default; toggle tools always record the
|
|
612
|
+
* previously active tool regardless (so ESC and the next `toggle`
|
|
613
|
+
* activation can switch back to it).
|
|
614
|
+
*/
|
|
615
|
+
toggle?: boolean;
|
|
616
|
+
}) => void;
|
|
430
617
|
setOpenDialog: (dialogType: AppState["openDialog"]) => void;
|
|
431
|
-
private setCursor;
|
|
432
|
-
private resetCursor;
|
|
433
618
|
/**
|
|
434
619
|
* returns whether user is making a gesture with >= 2 fingers (points)
|
|
435
620
|
* on o touch screen (not on a trackpad). Currently only relates to Darwin
|
|
@@ -441,26 +626,93 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
441
626
|
private onGestureStart;
|
|
442
627
|
private onGestureChange;
|
|
443
628
|
private onGestureEnd;
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
629
|
+
getElementAtPosition(x: number, y: number, opts?: ({
|
|
630
|
+
includeBoundTextElement?: boolean;
|
|
631
|
+
includeLockedElements?: boolean;
|
|
632
|
+
} | {
|
|
633
|
+
allHitElements: NonDeleted<ExcalidrawElement>[];
|
|
634
|
+
}) & {
|
|
635
|
+
preferSelected?: boolean;
|
|
636
|
+
}): NonDeleted<ExcalidrawElement> | null;
|
|
637
|
+
getElementsAtPosition(x: number, y: number, opts?: {
|
|
638
|
+
includeBoundTextElement?: boolean;
|
|
639
|
+
includeLockedElements?: boolean;
|
|
640
|
+
}): NonDeleted<ExcalidrawElement>[];
|
|
641
|
+
/**
|
|
642
|
+
* Whether the element's frame clips it away at the position — hitting a
|
|
643
|
+
* frame's element from outside the frame is not considered a hit.
|
|
644
|
+
*/
|
|
645
|
+
isClippedByFrameAt(x: number, y: number, element: ExcalidrawElement): boolean;
|
|
449
646
|
getElementHitThreshold(element: ExcalidrawElement): number;
|
|
450
|
-
|
|
451
|
-
private getTextBindableContainerAtPosition;
|
|
452
|
-
private startTextEditing;
|
|
647
|
+
hitElement(x: number, y: number, element: NonDeletedExcalidrawElement, considerBoundingBox?: boolean): boolean;
|
|
453
648
|
private startImageCropping;
|
|
454
|
-
|
|
649
|
+
finishImageCropping: () => void;
|
|
650
|
+
private shouldHandleBrowserCanvasDoubleClick;
|
|
455
651
|
private handleCanvasDoubleClick;
|
|
456
|
-
private
|
|
457
|
-
|
|
458
|
-
|
|
652
|
+
private handleCanvasClick;
|
|
653
|
+
getElementLinkAtPosition: (scenePointer: Readonly<{
|
|
654
|
+
x: number;
|
|
655
|
+
y: number;
|
|
656
|
+
}>, hitElementMightBeLocked: NonDeletedExcalidrawElement | null) => NonDeletedExcalidrawElement | undefined;
|
|
657
|
+
private handleElementLinkClick;
|
|
658
|
+
/**
|
|
659
|
+
* Applies (or clears) the element-link hover affordances — pointer cursor
|
|
660
|
+
* and tooltip — based on the current `hitLinkElement`. Returns whether a
|
|
661
|
+
* link is being hovered.
|
|
662
|
+
*/
|
|
663
|
+
private applyElementLinkHoverAffordance;
|
|
664
|
+
/**
|
|
665
|
+
* On touchscreens (where no hover precedes the tap) re-derives
|
|
666
|
+
* `hitLinkElement`, then opens the hit element link, if any.
|
|
667
|
+
* Returns whether a link click was handled.
|
|
668
|
+
*/
|
|
669
|
+
private maybeHandleElementLinkClick;
|
|
670
|
+
/**
|
|
671
|
+
* Restricted pointer handling for the non-interactive editor with links
|
|
672
|
+
* and/or embeds allowed (`interaction.enabled.links` / `.embeds` /
|
|
673
|
+
* `.interactiveContent`) — runs only the element-link & embed concerns
|
|
674
|
+
* (shared with the full pointer handlers above) so they behave like in
|
|
675
|
+
* view mode without the rest of the canvas pointer machinery.
|
|
676
|
+
*/
|
|
677
|
+
private handleInteractiveContentPointerMove;
|
|
678
|
+
private handleInteractiveContentPointerUp;
|
|
679
|
+
/**
|
|
680
|
+
* finds candidate frame under cursor (when dragging frame children/elements
|
|
681
|
+
* inside frames)
|
|
682
|
+
*/
|
|
683
|
+
getTopLayerFrameAtSceneCoords: (
|
|
684
|
+
/**
|
|
685
|
+
* should be already grid aligned (basically should be what the call site
|
|
686
|
+
* sets the element's coords to, if applicable)
|
|
687
|
+
*/
|
|
688
|
+
sceneCoords: {
|
|
689
|
+
x: number;
|
|
690
|
+
y: number;
|
|
691
|
+
}, opts?: {
|
|
692
|
+
/** to exclude selected elements when dragging, etc. */
|
|
693
|
+
excludeElementIds?: AppState["selectedElementIds"];
|
|
694
|
+
currentFrameId?: ExcalidrawElement["frameId"];
|
|
695
|
+
}) => NonDeleted<ExcalidrawFrameLikeElement> | null;
|
|
696
|
+
updateFrameToHighlight: (frameToHighlight: AppState["frameToHighlight"]) => void;
|
|
697
|
+
private maybeUpdateFrameToHighlightOnPointerMove;
|
|
698
|
+
insertNewElements: (elements: readonly ExcalidrawElement[]) => void;
|
|
699
|
+
insertNewElement: (element: ExcalidrawElement) => void;
|
|
459
700
|
private handleCanvasPointerMove;
|
|
460
701
|
private handleEraser;
|
|
461
702
|
private handleTouchMove;
|
|
703
|
+
/**
|
|
704
|
+
* Applies the hover affordances of a selected linear element: the cursor,
|
|
705
|
+
* plus the hovered-handle state that renders them highlighted.
|
|
706
|
+
*/
|
|
462
707
|
handleHoverSelectedLinearElement(linearElementEditor: LinearElementEditor, scenePointerX: number, scenePointerY: number): void;
|
|
463
708
|
private handleCanvasPointerDown;
|
|
709
|
+
/**
|
|
710
|
+
* The browser took the pointer over (scroll, pinch, palm rejection): no
|
|
711
|
+
* pointerup will follow, so the gesture is torn down here and now — the
|
|
712
|
+
* same cleanup a lost pointerup gets at the next press, only not left
|
|
713
|
+
* lying in wait for it, where its replay would tangle with that press.
|
|
714
|
+
*/
|
|
715
|
+
private handleCanvasPointerCancel;
|
|
464
716
|
private handleCanvasPointerUp;
|
|
465
717
|
private maybeOpenContextMenuAfterPointerDownOnTouchDevices;
|
|
466
718
|
private resetContextMenuTimer;
|
|
@@ -470,18 +722,14 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
470
722
|
* pointerup handlers manually
|
|
471
723
|
*/
|
|
472
724
|
private maybeCleanupAfterMissingPointerUp;
|
|
473
|
-
handleCanvasPanUsingWheelOrSpaceDrag: (event: React.PointerEvent<HTMLElement> | MouseEvent) => boolean;
|
|
474
725
|
private updateGestureOnPointerDown;
|
|
475
|
-
private initialPointerDownState;
|
|
476
|
-
private handleDraggingScrollBar;
|
|
477
|
-
private clearSelectionIfNotUsingSelection;
|
|
478
726
|
/**
|
|
479
|
-
*
|
|
727
|
+
* Tracks the pointer within the ongoing multi-touch gesture and applies
|
|
728
|
+
* the two-finger pinch zoom/pan, if any.
|
|
480
729
|
*/
|
|
481
|
-
private
|
|
482
|
-
private
|
|
483
|
-
private
|
|
484
|
-
private handleTextOnPointerDown;
|
|
730
|
+
private updateMultiTouchGesture;
|
|
731
|
+
private initialPointerDownState;
|
|
732
|
+
private handleDraggingScrollBar;
|
|
485
733
|
private handleFreeDrawElementOnPointerDown;
|
|
486
734
|
insertIframeElement: ({ sceneX, sceneY, width, height, }: {
|
|
487
735
|
sceneX: number;
|
|
@@ -496,11 +744,14 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
496
744
|
}) => NonDeleted<ExcalidrawEmbeddableElement> | undefined;
|
|
497
745
|
private newImagePlaceholder;
|
|
498
746
|
private handleLinearElementOnPointerDown;
|
|
499
|
-
|
|
747
|
+
getCurrentItemRoundness(elementType: "selection" | "rectangle" | "stickynote" | "diamond" | "ellipse" | "iframe" | "embeddable"): {
|
|
748
|
+
type: 2 | 3;
|
|
749
|
+
} | null;
|
|
750
|
+
getCurrentItemStrokeWidth(elementType: ExcalidrawElement["type"]): number;
|
|
500
751
|
private createGenericElementOnPointerDown;
|
|
501
752
|
private createFrameElementOnPointerDown;
|
|
502
|
-
|
|
503
|
-
|
|
753
|
+
maybeCacheReferenceSnapPoints(event: KeyboardModifiersObject, selectedElements: readonly NonDeletedExcalidrawElement[], recomputeAnyways?: boolean): void;
|
|
754
|
+
maybeCacheVisibleGaps(event: KeyboardModifiersObject, selectedElements: readonly NonDeletedExcalidrawElement[], recomputeAnyways?: boolean): void;
|
|
504
755
|
private onKeyDownFromPointerDownHandler;
|
|
505
756
|
private onKeyUpFromPointerDownHandler;
|
|
506
757
|
private onPointerMoveFromPointerDownHandler;
|
|
@@ -525,25 +776,34 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
525
776
|
/** generally you should use `addNewImagesToImageCache()` directly if you need
|
|
526
777
|
* to render new images. This is just a failsafe */
|
|
527
778
|
private scheduleImageRefresh;
|
|
528
|
-
private updateBindingEnabledOnPointerMove;
|
|
529
|
-
private maybeSuggestBindingAtCursor;
|
|
530
|
-
private clearSelection;
|
|
531
779
|
private handleInteractiveCanvasRef;
|
|
532
|
-
|
|
780
|
+
insertImages: (imageFiles: File[], sceneX: number, sceneY: number) => Promise<void>;
|
|
533
781
|
private handleAppOnDrop;
|
|
534
|
-
|
|
782
|
+
/** @returns true if the file replaced the scene */
|
|
783
|
+
loadFileToCanvas: (file: File, fileHandle: FileSystemFileHandle | null, insertPosition?: {
|
|
784
|
+
clientX: number;
|
|
785
|
+
clientY: number;
|
|
786
|
+
}) => Promise<true | undefined>;
|
|
535
787
|
private handleCanvasContextMenu;
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
788
|
+
/** opens the context menu for the element under the pointer, or the canvas */
|
|
789
|
+
openContextMenu: (pointer: {
|
|
790
|
+
clientX: number;
|
|
791
|
+
clientY: number;
|
|
792
|
+
button?: number;
|
|
793
|
+
pointerType?: string;
|
|
794
|
+
}) => void;
|
|
795
|
+
maybeDragNewGenericElement: (pointerDownState: PointerDownState, event: MouseEvent | KeyboardEvent, informMutation?: boolean) => void;
|
|
539
796
|
private getContextMenuItems;
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
797
|
+
savePointer: (x: number, y: number, button: "up" | "down") => void;
|
|
798
|
+
resetShouldCacheIgnoreZoomDebounced: {
|
|
799
|
+
(): void;
|
|
800
|
+
flush(): void;
|
|
801
|
+
cancel(): void;
|
|
802
|
+
};
|
|
544
803
|
private updateDOMRect;
|
|
545
804
|
refresh: () => void;
|
|
546
805
|
private getCanvasOffsets;
|
|
806
|
+
watchState: () => void;
|
|
547
807
|
private updateLanguage;
|
|
548
808
|
}
|
|
549
809
|
declare global {
|
|
@@ -553,6 +813,7 @@ declare global {
|
|
|
553
813
|
elements: readonly ExcalidrawElement[];
|
|
554
814
|
state: AppState;
|
|
555
815
|
setState: React.Component<any, AppState>["setState"];
|
|
816
|
+
watchState: (prev: any, next: any) => void | undefined;
|
|
556
817
|
app: InstanceType<typeof App>;
|
|
557
818
|
history: History;
|
|
558
819
|
store: Store;
|