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