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