@excalidraw/math 0.18.0-4e0441e → 0.18.0-4e758db
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 +313 -116
- 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 +75 -34
- 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 +45 -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 +79 -51
- package/dist/types/element/src/bounds.d.ts +25 -18
- package/dist/types/element/src/bucketFill.d.ts +110 -0
- package/dist/types/element/src/collision.d.ts +7 -2
- package/dist/types/element/src/comparisons.d.ts +10 -7
- package/dist/types/element/src/convertToShape.d.ts +23 -0
- 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 +7 -6
- package/dist/types/element/src/elbowArrow.d.ts +2 -0
- package/dist/types/element/src/embeddable.d.ts +2 -2
- package/dist/types/element/src/flowchart.d.ts +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 -9
- package/dist/types/element/src/heading.d.ts +2 -1
- package/dist/types/element/src/image.d.ts +1 -11
- package/dist/types/element/src/index.d.ts +9 -4
- package/dist/types/element/src/linearElementEditor.d.ts +48 -30
- package/dist/types/element/src/mutateElement.d.ts +6 -2
- package/dist/types/element/src/newElement.d.ts +44 -8
- package/dist/types/element/src/renderElement.d.ts +1 -10
- package/dist/types/element/src/resizeElements.d.ts +12 -12
- package/dist/types/element/src/resizeTest.d.ts +6 -5
- package/dist/types/element/src/selection.d.ts +14 -14
- package/dist/types/element/src/shape.d.ts +21 -8
- package/dist/types/element/src/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 +14 -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 +15 -6
- package/dist/types/element/src/zindex.d.ts +7 -1
- package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +206 -219
- package/dist/types/excalidraw/actions/actionAlign.d.ts +12 -13
- package/dist/types/excalidraw/actions/actionBoundText.d.ts +122 -131
- package/dist/types/excalidraw/actions/actionCanvas.d.ts +446 -1594
- package/dist/types/excalidraw/actions/actionClipboard.d.ts +149 -919
- package/dist/types/excalidraw/actions/actionCropEditor.d.ts +59 -64
- package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +192 -208
- package/dist/types/excalidraw/actions/actionDeselect.d.ts +170 -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 +66 -77
- package/dist/types/excalidraw/actions/actionElementLock.d.ts +121 -130
- package/dist/types/excalidraw/actions/actionExport.d.ts +200 -1449
- package/dist/types/excalidraw/actions/actionFinalize.d.ts +11 -404
- package/dist/types/excalidraw/actions/actionFlip.d.ts +2 -3
- package/dist/types/excalidraw/actions/actionFrame.d.ts +318 -509
- package/dist/types/excalidraw/actions/actionGroup.d.ts +132 -149
- package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +205 -196
- package/dist/types/excalidraw/actions/actionLink.d.ts +73 -78
- package/dist/types/excalidraw/actions/actionMenu.d.ts +60 -71
- package/dist/types/excalidraw/actions/actionNavigate.d.ts +18 -369
- package/dist/types/excalidraw/actions/actionProperties.d.ts +213 -2610
- package/dist/types/excalidraw/actions/actionSelectAll.d.ts +66 -75
- package/dist/types/excalidraw/actions/actionStyles.d.ts +60 -64
- package/dist/types/excalidraw/actions/actionTextAutoResize.d.ts +4 -4
- package/dist/types/excalidraw/actions/actionToggleArrowBinding.d.ts +186 -0
- package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +74 -80
- package/dist/types/excalidraw/actions/actionToggleMidpointSnapping.d.ts +186 -0
- package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +73 -78
- package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +62 -74
- package/dist/types/excalidraw/actions/actionToggleShapeSwitch.d.ts +2 -2
- package/dist/types/excalidraw/actions/actionToggleStats.d.ts +72 -77
- package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +73 -78
- package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +73 -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 +4 -2
- 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 +50 -25
- 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 -38
- package/dist/types/excalidraw/components/Actions.d.ts +22 -14
- package/dist/types/excalidraw/components/ActiveConfirmDialog.d.ts +1 -1
- package/dist/types/excalidraw/components/App.arrowText.d.ts +104 -0
- package/dist/types/excalidraw/components/App.bucketFill.d.ts +48 -0
- package/dist/types/excalidraw/components/App.cursor.d.ts +38 -0
- package/dist/types/excalidraw/components/App.d.ts +552 -125
- package/dist/types/excalidraw/components/App.drawshape.d.ts +55 -0
- package/dist/types/excalidraw/components/App.flowchart.d.ts +21 -0
- package/dist/types/excalidraw/components/App.toolDrag.d.ts +63 -0
- package/dist/types/excalidraw/components/App.viewport.d.ts +73 -0
- package/dist/types/excalidraw/components/App.wheel.d.ts +33 -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 -5
- package/dist/types/excalidraw/components/ColorPicker/CustomColorList.d.ts +3 -1
- package/dist/types/excalidraw/components/ColorPicker/Picker.d.ts +3 -1
- package/dist/types/excalidraw/components/ColorPicker/PickerColorList.d.ts +9 -2
- package/dist/types/excalidraw/components/ColorPicker/ShadeList.d.ts +4 -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/keyboardNavHandlers.d.ts +2 -2
- package/dist/types/excalidraw/components/ColorPicker/topPicksDnD.d.ts +31 -0
- package/dist/types/excalidraw/components/CommandPalette/defaultCommandPaletteItems.d.ts +1 -2
- package/dist/types/excalidraw/components/CommandPalette/types.d.ts +2 -4
- package/dist/types/excalidraw/components/ConvertElementTypePopup.d.ts +4 -4
- package/dist/types/excalidraw/components/CursorHint.d.ts +46 -0
- package/dist/types/excalidraw/components/DarkModeToggle.d.ts +1 -1
- package/dist/types/excalidraw/components/DefaultSidebar.d.ts +9 -13
- package/dist/types/excalidraw/components/ElementLinkDialog.d.ts +1 -1
- package/dist/types/excalidraw/components/Ellipsify.d.ts +1 -2
- package/dist/types/excalidraw/components/ErrorDialog.d.ts +1 -1
- package/dist/types/excalidraw/components/EyeDropper.d.ts +1 -2
- package/dist/types/excalidraw/components/FilledButton.d.ts +2 -1
- package/dist/types/excalidraw/components/FontPicker/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 +2 -2
- package/dist/types/excalidraw/components/Island.d.ts +7 -0
- package/dist/types/excalidraw/components/LaserPointerButton.d.ts +2 -4
- package/dist/types/excalidraw/components/LayerUI.d.ts +5 -2
- package/dist/types/excalidraw/components/LibraryMenu.d.ts +1 -1
- package/dist/types/excalidraw/components/LibraryMenuControlButtons.d.ts +1 -1
- package/dist/types/excalidraw/components/LibraryMenuHeaderContent.d.ts +1 -2
- package/dist/types/excalidraw/components/LibraryUnit.d.ts +2 -3
- package/dist/types/excalidraw/components/LoadingMessage.d.ts +0 -1
- package/dist/types/excalidraw/components/LockButton.d.ts +3 -4
- package/dist/types/excalidraw/components/MagicButton.d.ts +0 -2
- package/dist/types/excalidraw/components/MobileMenu.d.ts +4 -4
- 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 +1 -3
- package/dist/types/excalidraw/components/PropertiesPopover.d.ts +1 -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/Toast.d.ts +11 -7
- package/dist/types/excalidraw/components/ToolPopover.d.ts +3 -6
- 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/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 +48 -38
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuContent.d.ts +7 -6
- 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 +51 -22
- package/dist/types/excalidraw/components/main-menu/DefaultItems.d.ts +25 -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 +354 -7
- 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 +183 -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/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 +1 -1
- 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 +5 -5
- 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/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 +477 -18
- package/dist/types/excalidraw/scene/export.d.ts +4 -4
- package/dist/types/excalidraw/scene/index.d.ts +2 -2
- package/dist/types/excalidraw/scene/types.d.ts +27 -8
- 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 +566 -55
- package/dist/types/excalidraw/viewport.d.ts +280 -0
- package/dist/types/excalidraw/wysiwyg/textWysiwyg.d.ts +8 -5
- package/dist/types/fractional-indexing/src/index.d.ts +29 -0
- package/dist/types/laser-pointer/src/index.d.ts +2 -0
- package/dist/types/laser-pointer/src/math.d.ts +16 -0
- package/dist/types/laser-pointer/src/simplify.d.ts +2 -0
- package/dist/types/laser-pointer/src/state.d.ts +36 -0
- package/dist/types/math/src/constants.d.ts +0 -1
- package/dist/types/math/src/curve.d.ts +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 +9 -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 -190
- 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/MobileToolBar.d.ts +0 -11
- package/dist/types/excalidraw/components/TTDDialog/TTDDialogTrigger.d.ts +0 -8
- 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,68 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { type EXPORT_IMAGE_TYPES, Emitter } from "@excalidraw/common";
|
|
3
|
-
import { LinearElementEditor,
|
|
4
|
-
import type {
|
|
2
|
+
import { AppEventBus, type EXPORT_IMAGE_TYPES, Emitter, type EditorInterface, type StylesPanelMode } from "@excalidraw/common";
|
|
3
|
+
import { LinearElementEditor, Scene, Store, type ElementUpdate, StoreDelta, type ApplyToOptions } from "@excalidraw/element";
|
|
4
|
+
import type { LocalPoint, Radians } from "@excalidraw/math";
|
|
5
|
+
import type { ExcalidrawElement, ExcalidrawTextElement, NonDeleted, NonDeletedExcalidrawElement, ExcalidrawTextContainer, ExcalidrawFrameLikeElement, ExcalidrawIframeElement, ExcalidrawEmbeddableElement, Ordered, SceneElementsMap } from "@excalidraw/element/types";
|
|
6
|
+
import type { ArrowEndpoint, TransformHandleDirection } from "@excalidraw/element";
|
|
5
7
|
import type { Mutable } from "@excalidraw/common/utility-types";
|
|
6
8
|
import { ActionManager } from "../actions/manager";
|
|
7
|
-
import { AnimationFrameHandler } from "../animation-frame-handler";
|
|
8
9
|
import { History } from "../history";
|
|
9
10
|
import { Fonts } from "../fonts";
|
|
10
11
|
import { type WritableAtom } from "../editor-jotai";
|
|
11
12
|
import { Renderer } from "../scene/Renderer";
|
|
12
|
-
import {
|
|
13
|
+
import { type SetViewportOptions } from "../viewport";
|
|
14
|
+
import { LaserTrails } from "../laserTrails";
|
|
15
|
+
import { isOverScrollBars } from "../scene/scrollbars";
|
|
13
16
|
import { LassoTrail } from "../lasso";
|
|
14
17
|
import { EraserTrail } from "../eraser";
|
|
18
|
+
import { AppArrowText } from "./App.arrowText";
|
|
19
|
+
import { AppBucketFill } from "./App.bucketFill";
|
|
20
|
+
import { AppToolDrag } from "./App.toolDrag";
|
|
21
|
+
import { AppCursor } from "./App.cursor";
|
|
22
|
+
import { AppDrawShape } from "./App.drawshape";
|
|
23
|
+
import { AppFlowchart } from "./App.flowchart";
|
|
24
|
+
import { AppViewport } from "./App.viewport";
|
|
25
|
+
import { AppWheel } from "./App.wheel";
|
|
26
|
+
import { CursorHints } from "./CursorHint";
|
|
27
|
+
import { type OnStateChange } from "./AppStateObserver";
|
|
15
28
|
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";
|
|
29
|
+
import type { AppClassProperties, AppProps, AppState, ExcalidrawImperativeAPI, BinaryFiles, LibraryItems, SceneData, FrameNameBoundsCache, SidebarName, SidebarTabName, ToolType, OnUserFollowedPayload, ExcalidrawImperativeAPIEventMap, GenerateDiagramToCode, NullableGridSize, UIConfig } from "../types";
|
|
18
30
|
import type { RoughCanvas } from "roughjs/bin/canvas";
|
|
19
31
|
import type { ActionResult } from "../actions/types";
|
|
32
|
+
declare const editorLifecycleEventBehavior: {
|
|
33
|
+
readonly "editor:mount": {
|
|
34
|
+
readonly cardinality: "once";
|
|
35
|
+
readonly replay: "last";
|
|
36
|
+
};
|
|
37
|
+
readonly "editor:initialize": {
|
|
38
|
+
readonly cardinality: "once";
|
|
39
|
+
readonly replay: "last";
|
|
40
|
+
};
|
|
41
|
+
readonly "editor:unmount": {
|
|
42
|
+
readonly cardinality: "once";
|
|
43
|
+
readonly replay: "last";
|
|
44
|
+
};
|
|
45
|
+
};
|
|
20
46
|
export declare const ExcalidrawContainerContext: React.Context<{
|
|
21
47
|
container: HTMLDivElement | null;
|
|
22
48
|
id: string | null;
|
|
23
49
|
}>;
|
|
50
|
+
export declare const ExcalidrawAPIContext: React.Context<ExcalidrawImperativeAPI | null>;
|
|
51
|
+
export declare const ExcalidrawAPISetContext: React.Context<((api: ExcalidrawImperativeAPI | null) => void) | null>;
|
|
24
52
|
export declare const useApp: () => AppClassProperties;
|
|
25
53
|
export declare const useAppProps: () => AppProps;
|
|
26
|
-
export declare const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
canFitSidebar: boolean;
|
|
34
|
-
};
|
|
54
|
+
export declare const useEditorInterface: () => Readonly<{
|
|
55
|
+
formFactor: "phone" | "tablet" | "desktop";
|
|
56
|
+
desktopUIMode: "compact" | "full";
|
|
57
|
+
userAgent: Readonly<{
|
|
58
|
+
isMobileDevice: boolean;
|
|
59
|
+
platform: "ios" | "android" | "other" | "unknown";
|
|
60
|
+
}>;
|
|
35
61
|
isTouchScreen: boolean;
|
|
62
|
+
canFitSidebar: boolean;
|
|
63
|
+
isLandscape: boolean;
|
|
36
64
|
}>;
|
|
65
|
+
export declare const useStylesPanelMode: () => StylesPanelMode;
|
|
37
66
|
export declare const useExcalidrawContainer: () => {
|
|
38
67
|
container: HTMLDivElement | null;
|
|
39
68
|
id: string | null;
|
|
@@ -42,24 +71,34 @@ export declare const useExcalidrawElements: () => readonly NonDeletedExcalidrawE
|
|
|
42
71
|
export declare const useExcalidrawAppState: () => AppState;
|
|
43
72
|
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
73
|
export declare const useExcalidrawActionManager: () => ActionManager;
|
|
74
|
+
/**
|
|
75
|
+
* Requires wrapping your component in <ExcalidrawAPIContext.Provider>
|
|
76
|
+
*/
|
|
77
|
+
export declare const useExcalidrawAPI: () => ExcalidrawImperativeAPI | null;
|
|
45
78
|
declare class App extends React.Component<AppProps, AppState> {
|
|
46
79
|
canvas: AppClassProperties["canvas"];
|
|
47
80
|
interactiveCanvas: AppClassProperties["interactiveCanvas"];
|
|
81
|
+
sessionExportThemeOverride: AppState["theme"] | undefined;
|
|
48
82
|
rc: RoughCanvas;
|
|
49
83
|
unmounted: boolean;
|
|
50
84
|
actionManager: ActionManager;
|
|
51
|
-
|
|
85
|
+
editorInterface: EditorInterface;
|
|
86
|
+
private stylesPanelMode;
|
|
52
87
|
private excalidrawContainerRef;
|
|
88
|
+
get ownerDocument(): Document;
|
|
89
|
+
get ownerWindow(): Window & typeof globalThis;
|
|
53
90
|
scene: Scene;
|
|
54
91
|
fonts: Fonts;
|
|
55
92
|
renderer: Renderer;
|
|
56
93
|
visibleElements: readonly NonDeletedExcalidrawElement[];
|
|
94
|
+
/** whether the last render had any renderable elements (excludes e.g. the
|
|
95
|
+
* in-progress `newElement` and the edited text element) */
|
|
96
|
+
private hasRenderableElements;
|
|
57
97
|
private resizeObserver;
|
|
58
|
-
private nearestScrollableContainer;
|
|
59
98
|
library: AppClassProperties["library"];
|
|
60
99
|
libraryItemsFromStorage: LibraryItems | undefined;
|
|
61
100
|
id: string;
|
|
62
|
-
|
|
101
|
+
store: Store;
|
|
63
102
|
private history;
|
|
64
103
|
excalidrawContainerValue: {
|
|
65
104
|
container: HTMLDivElement | null;
|
|
@@ -78,26 +117,49 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
78
117
|
/** embeds that have been inserted to DOM (as a perf optim, we don't want to
|
|
79
118
|
* insert to DOM before user initially scrolls to them) */
|
|
80
119
|
private initializedEmbeds;
|
|
81
|
-
private handleToastClose;
|
|
82
120
|
private elementsPendingErasure;
|
|
83
|
-
|
|
84
|
-
private
|
|
121
|
+
private _initialized;
|
|
122
|
+
private readonly editorLifecycleEvents;
|
|
123
|
+
onEvent: AppEventBus<ExcalidrawImperativeAPIEventMap, typeof editorLifecycleEventBehavior>["on"];
|
|
124
|
+
private appStateObserver;
|
|
125
|
+
onStateChange: OnStateChange;
|
|
126
|
+
bucketFill: AppBucketFill;
|
|
127
|
+
toolDrag: AppToolDrag;
|
|
128
|
+
flowchart: AppFlowchart;
|
|
129
|
+
cursor: AppCursor;
|
|
130
|
+
arrowText: AppArrowText;
|
|
131
|
+
viewport: AppViewport;
|
|
132
|
+
wheel: AppWheel;
|
|
133
|
+
bindModeHandler: ReturnType<typeof setTimeout> | null;
|
|
134
|
+
private textWysiwygSubmitHandler;
|
|
85
135
|
hitLinkElement?: NonDeletedExcalidrawElement;
|
|
86
136
|
lastPointerDownEvent: React.PointerEvent<HTMLElement> | null;
|
|
137
|
+
/**
|
|
138
|
+
* the handle of the resize in progress while `state.isResizing` — for UI
|
|
139
|
+
* that words itself by handle (a sticky note's corners resize
|
|
140
|
+
* proportionally, its edges freely); not app state, so it costs no
|
|
141
|
+
* re-render of its own
|
|
142
|
+
*/
|
|
143
|
+
activeResizeHandle: TransformHandleDirection | null;
|
|
87
144
|
lastPointerUpEvent: React.PointerEvent<HTMLElement> | PointerEvent | null;
|
|
145
|
+
lastPointerUpIsDoubleClick: boolean;
|
|
88
146
|
lastPointerMoveEvent: PointerEvent | null;
|
|
147
|
+
/** current frame pointer cords */
|
|
89
148
|
lastPointerMoveCoords: {
|
|
90
149
|
x: number;
|
|
91
150
|
y: number;
|
|
92
151
|
} | null;
|
|
93
|
-
|
|
152
|
+
private lastCompletedCanvasClicks;
|
|
153
|
+
/** previous frame pointer coords */
|
|
154
|
+
previousPointerMoveCoords: {
|
|
94
155
|
x: number;
|
|
95
156
|
y: number;
|
|
96
|
-
};
|
|
97
|
-
|
|
157
|
+
} | null;
|
|
158
|
+
drawShape: AppDrawShape;
|
|
98
159
|
laserTrails: LaserTrails;
|
|
99
160
|
eraserTrail: EraserTrail;
|
|
100
161
|
lassoTrail: LassoTrail;
|
|
162
|
+
cursorHints: CursorHints;
|
|
101
163
|
onChangeEmitter: Emitter<[elements: readonly ExcalidrawElement[], appState: AppState, files: BinaryFiles]>;
|
|
102
164
|
onPointerDownEmitter: Emitter<[activeTool: {
|
|
103
165
|
lastActiveTool: import("../types").ActiveTool | null;
|
|
@@ -112,11 +174,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
112
174
|
x: number;
|
|
113
175
|
y: number;
|
|
114
176
|
}>;
|
|
115
|
-
scrollbars:
|
|
116
|
-
isOverEither: boolean;
|
|
117
|
-
isOverHorizontal: boolean;
|
|
118
|
-
isOverVertical: boolean;
|
|
119
|
-
};
|
|
177
|
+
scrollbars: ReturnType<typeof isOverScrollBars>;
|
|
120
178
|
lastCoords: {
|
|
121
179
|
x: number;
|
|
122
180
|
y: number;
|
|
@@ -129,7 +187,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
129
187
|
x: number;
|
|
130
188
|
y: number;
|
|
131
189
|
};
|
|
132
|
-
arrowDirection: "
|
|
190
|
+
arrowDirection: "origin" | "end";
|
|
133
191
|
center: {
|
|
134
192
|
x: number;
|
|
135
193
|
y: number;
|
|
@@ -141,6 +199,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
141
199
|
wasAddedToSelection: boolean;
|
|
142
200
|
hasBeenDuplicated: boolean;
|
|
143
201
|
hasHitCommonBoundingBoxOfSelectedElements: boolean;
|
|
202
|
+
arrowLabel: boolean;
|
|
144
203
|
};
|
|
145
204
|
withCmdOrCtrl: boolean;
|
|
146
205
|
drag: {
|
|
@@ -156,14 +215,10 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
156
215
|
blockDragging: boolean;
|
|
157
216
|
};
|
|
158
217
|
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;
|
|
218
|
+
onMove: null | ReturnType<typeof import("@excalidraw/common").throttleRAF>;
|
|
219
|
+
onUp: null | ((event: PointerEvent) => void);
|
|
220
|
+
onKeyDown: null | ((event: KeyboardEvent) => void);
|
|
221
|
+
onKeyUp: null | ((event: KeyboardEvent) => void);
|
|
167
222
|
};
|
|
168
223
|
boxSelection: {
|
|
169
224
|
hasOccurred: boolean;
|
|
@@ -182,11 +237,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
182
237
|
x: number;
|
|
183
238
|
y: number;
|
|
184
239
|
}>;
|
|
185
|
-
scrollbars:
|
|
186
|
-
isOverEither: boolean;
|
|
187
|
-
isOverHorizontal: boolean;
|
|
188
|
-
isOverVertical: boolean;
|
|
189
|
-
};
|
|
240
|
+
scrollbars: ReturnType<typeof isOverScrollBars>;
|
|
190
241
|
lastCoords: {
|
|
191
242
|
x: number;
|
|
192
243
|
y: number;
|
|
@@ -199,7 +250,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
199
250
|
x: number;
|
|
200
251
|
y: number;
|
|
201
252
|
};
|
|
202
|
-
arrowDirection: "
|
|
253
|
+
arrowDirection: "origin" | "end";
|
|
203
254
|
center: {
|
|
204
255
|
x: number;
|
|
205
256
|
y: number;
|
|
@@ -211,6 +262,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
211
262
|
wasAddedToSelection: boolean;
|
|
212
263
|
hasBeenDuplicated: boolean;
|
|
213
264
|
hasHitCommonBoundingBoxOfSelectedElements: boolean;
|
|
265
|
+
arrowLabel: boolean;
|
|
214
266
|
};
|
|
215
267
|
withCmdOrCtrl: boolean;
|
|
216
268
|
drag: {
|
|
@@ -226,14 +278,10 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
226
278
|
blockDragging: boolean;
|
|
227
279
|
};
|
|
228
280
|
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;
|
|
281
|
+
onMove: null | ReturnType<typeof import("@excalidraw/common").throttleRAF>;
|
|
282
|
+
onUp: null | ((event: PointerEvent) => void);
|
|
283
|
+
onKeyDown: null | ((event: KeyboardEvent) => void);
|
|
284
|
+
onKeyUp: null | ((event: KeyboardEvent) => void);
|
|
237
285
|
};
|
|
238
286
|
boxSelection: {
|
|
239
287
|
hasOccurred: boolean;
|
|
@@ -245,17 +293,101 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
245
293
|
}>]>;
|
|
246
294
|
missingPointerEventCleanupEmitter: Emitter<[event: PointerEvent | null]>;
|
|
247
295
|
onRemoveEventListenersEmitter: Emitter<[]>;
|
|
296
|
+
api: ExcalidrawImperativeAPI;
|
|
297
|
+
private createExcalidrawAPI;
|
|
248
298
|
constructor(props: AppProps);
|
|
299
|
+
/**
|
|
300
|
+
* Whether the editor accepts user input (pointer, keyboard, wheel, touch,
|
|
301
|
+
* clipboard, drag&drop). When `false`, the editor is fully inert for the
|
|
302
|
+
* user, but remains controllable through the imperative API.
|
|
303
|
+
*
|
|
304
|
+
* All user-input entry points must consult this getter (directly or by
|
|
305
|
+
* not being attached/rendered at all).
|
|
306
|
+
*/
|
|
307
|
+
isInteractionEnabled(props?: Pick<AppProps, "interaction">): boolean;
|
|
308
|
+
/**
|
|
309
|
+
* Whether element links render their link icon and are clickable.
|
|
310
|
+
* True when fully interactive, or when `interaction: { enabled: { links:
|
|
311
|
+
* true } }`
|
|
312
|
+
* (in which case clicking anywhere on a linked element opens the link,
|
|
313
|
+
* same as in view mode).
|
|
314
|
+
*/
|
|
315
|
+
isLinksEnabled(props?: Pick<AppProps, "interaction">): boolean;
|
|
316
|
+
/**
|
|
317
|
+
* Whether canvas navigation — panning & zooming, view-mode style — is
|
|
318
|
+
* enabled. True when fully interactive, or when `interaction: { enabled:
|
|
319
|
+
* { navigation: true } }`. Respects `appState.scrollConstraints`.
|
|
320
|
+
*/
|
|
321
|
+
isNavigationEnabled(props?: Pick<AppProps, "interaction">): boolean;
|
|
322
|
+
/**
|
|
323
|
+
* Whether embeddable & iframe elements are interactive (hover & click to
|
|
324
|
+
* activate, view-mode style). True when fully interactive, or when
|
|
325
|
+
* allowed via `interaction.enabled.embeds` / `.interactiveContent`.
|
|
326
|
+
*/
|
|
327
|
+
isEmbedsEnabled(props?: Pick<AppProps, "interaction">): boolean;
|
|
328
|
+
/**
|
|
329
|
+
* Whether the browser's own zoom (ctrl/cmd + wheel, pinch, keyboard
|
|
330
|
+
* shortcuts) stays available over the non-interactive editor.
|
|
331
|
+
* Prevented by default.
|
|
332
|
+
*/
|
|
333
|
+
isBrowserZoomEnabled(props?: Pick<AppProps, "interaction">): boolean;
|
|
334
|
+
/**
|
|
335
|
+
* Whether the tool can be activated & driven by user input. False when
|
|
336
|
+
* disabled via `UIOptions.tools`, or when the editor is non-interactive
|
|
337
|
+
* and the tool isn't kept user-driven via `interaction.enabled.tools`.
|
|
338
|
+
*
|
|
339
|
+
* (Once UI tool availability is split from input availability — e.g.
|
|
340
|
+
* `props.ui.tools` vs `interaction.disabled.tools` — the UI axis moves
|
|
341
|
+
* out into its own predicate.)
|
|
342
|
+
*
|
|
343
|
+
* We purposely widen the `tool` type so this helper can be called with
|
|
344
|
+
* any tool without having to type check it.
|
|
345
|
+
*/
|
|
346
|
+
isToolSupported: <T extends ToolType | "custom">(tool: T, props?: Pick<AppProps, "interaction" | "UIOptions">) => boolean;
|
|
347
|
+
/**
|
|
348
|
+
* Whether the active tool is locked in place — via the tool lock
|
|
349
|
+
* (padlock / Q) or by being host-forced (`props.activeTool`). A locked
|
|
350
|
+
* tool doesn't revert to the selection tool after use, and elements drawn
|
|
351
|
+
* with it aren't selected. Forcing deliberately does not mutate
|
|
352
|
+
* `activeTool.locked`, which is the user's persisted padlock preference.
|
|
353
|
+
*/
|
|
354
|
+
isToolLocked(): boolean;
|
|
355
|
+
/**
|
|
356
|
+
* Whether the active tool captures the primary pointer instead of the
|
|
357
|
+
* view-mode drag-to-pan — the laser and host-implemented custom tools do;
|
|
358
|
+
* while non-interactive, any tool allowed via
|
|
359
|
+
* `interaction.enabled.tools` does. (Editing tools capture the pointer
|
|
360
|
+
* trivially since view mode implies they're not active; this predicate only
|
|
361
|
+
* matters where view-mode gates apply.)
|
|
362
|
+
*/
|
|
363
|
+
isActiveToolPointerCapturing(): boolean;
|
|
364
|
+
/** Whether Excalidraw's full default UI is rendered. */
|
|
365
|
+
isDefaultUIEnabled(props?: Pick<AppProps, "ui">): boolean;
|
|
366
|
+
/** Whether an individual default UI control is rendered. */
|
|
367
|
+
isUIControlEnabled(control: keyof UIConfig["enabled"], props?: Pick<AppProps, "ui">): boolean;
|
|
249
368
|
updateEditorAtom: <Value, Args extends unknown[], Result>(atom: WritableAtom<Value, Args, Result>, ...args: Args) => Result;
|
|
250
369
|
private onWindowMessage;
|
|
370
|
+
private handleSkipBindMode;
|
|
371
|
+
private resetDelayedBindMode;
|
|
372
|
+
private previousHoveredBindableElement;
|
|
373
|
+
private handleDelayedBindModeChange;
|
|
251
374
|
private cacheEmbeddableRef;
|
|
252
375
|
/**
|
|
253
376
|
* Returns gridSize taking into account `gridModeEnabled`.
|
|
254
377
|
* If disabled, returns null.
|
|
255
378
|
*/
|
|
256
379
|
getEffectiveGridSize: () => NullableGridSize;
|
|
380
|
+
private getTextCreationGridPoint;
|
|
257
381
|
private getHTMLIFrameElement;
|
|
258
|
-
|
|
382
|
+
/**
|
|
383
|
+
* AI-generated iframe elements aren't interactive while their generation
|
|
384
|
+
* is still in progress (the partial content is render-only).
|
|
385
|
+
*/
|
|
386
|
+
private isIframeLikeInteractive;
|
|
387
|
+
private handleIframeLikeElementHover;
|
|
388
|
+
/** @returns true if iframe-like element click handled */
|
|
389
|
+
private handleIframeLikeCenterClick;
|
|
390
|
+
private isDoubleClick;
|
|
259
391
|
private isIframeLikeElementCenter;
|
|
260
392
|
private updateEmbedValidationStatus;
|
|
261
393
|
private updateEmbeddables;
|
|
@@ -268,11 +400,11 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
268
400
|
render(): import("react/jsx-runtime").JSX.Element;
|
|
269
401
|
focusContainer: AppClassProperties["focusContainer"];
|
|
270
402
|
getSceneElementsIncludingDeleted: () => readonly import("@excalidraw/element/types").OrderedExcalidrawElement[];
|
|
271
|
-
getSceneElementsMapIncludingDeleted: () =>
|
|
403
|
+
getSceneElementsMapIncludingDeleted: () => SceneElementsMap;
|
|
272
404
|
getSceneElements: () => readonly Ordered<NonDeletedExcalidrawElement>[];
|
|
273
405
|
onInsertElements: (elements: readonly ExcalidrawElement[]) => void;
|
|
274
406
|
onExportImage: (type: keyof typeof EXPORT_IMAGE_TYPES, elements: ExportedElements, opts: {
|
|
275
|
-
exportingFrame: ExcalidrawFrameLikeElement | null;
|
|
407
|
+
exportingFrame: NonDeleted<ExcalidrawFrameLikeElement> | null;
|
|
276
408
|
}) => Promise<void>;
|
|
277
409
|
private magicGenerations;
|
|
278
410
|
private updateMagicGeneration;
|
|
@@ -288,9 +420,33 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
288
420
|
private openEyeDropper;
|
|
289
421
|
dismissLinearEditor: () => void;
|
|
290
422
|
syncActionResult: (actionResult: ActionResult) => void;
|
|
423
|
+
scheduleCapture: () => void;
|
|
291
424
|
private onBlur;
|
|
292
425
|
private onUnload;
|
|
293
426
|
private disableEvent;
|
|
427
|
+
private handleNavigationModeKeyDown;
|
|
428
|
+
/**
|
|
429
|
+
* PageUp/PageDown scroll the canvas by a page — vertically, or
|
|
430
|
+
* horizontally with shift. Respects `appState.scrollConstraints`
|
|
431
|
+
* (via `viewport.translate`).
|
|
432
|
+
*/
|
|
433
|
+
private maybeHandlePageScrollKeyDown;
|
|
434
|
+
private preventBrowserZoomKeyDown;
|
|
435
|
+
/** Ends active input sessions before switching to a view-mode/non-interactive
|
|
436
|
+
* mode. */
|
|
437
|
+
private terminateActiveInteraction;
|
|
438
|
+
private handleInteractionStateChange;
|
|
439
|
+
/** whether the two values reference the same tool (incl. custom subtype) */
|
|
440
|
+
private isSameForcedTool;
|
|
441
|
+
/**
|
|
442
|
+
* Keeps `state.activeTool` synced to the host-controlled
|
|
443
|
+
* `props.activeTool`. `setActiveTool` refuses non-matching activations
|
|
444
|
+
* while forced (user input, API); this backstop covers the writers that
|
|
445
|
+
* bypass the funnel (`actionFinalize`/`actionDeselect`, `restore()` on
|
|
446
|
+
* scene load, ...) and re-applies the tool once it becomes activatable
|
|
447
|
+
* (e.g. `interaction` config changes).
|
|
448
|
+
*/
|
|
449
|
+
private handleForcedToolChange;
|
|
294
450
|
private resetHistory;
|
|
295
451
|
private resetStore;
|
|
296
452
|
/**
|
|
@@ -299,10 +455,11 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
299
455
|
*/
|
|
300
456
|
private resetScene;
|
|
301
457
|
private initializeScene;
|
|
302
|
-
private
|
|
303
|
-
|
|
304
|
-
private
|
|
305
|
-
|
|
458
|
+
private getFormFactor;
|
|
459
|
+
refreshEditorInterface: () => void;
|
|
460
|
+
private reconcileStylesPanelMode;
|
|
461
|
+
/** TO BE USED LATER */
|
|
462
|
+
private setDesktopUIMode;
|
|
306
463
|
private clearImageShapeCache;
|
|
307
464
|
componentDidMount(): Promise<void>;
|
|
308
465
|
componentWillUnmount(): void;
|
|
@@ -329,54 +486,25 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
329
486
|
clientY: number;
|
|
330
487
|
} | "cursor" | "center";
|
|
331
488
|
retainSeed?: boolean;
|
|
332
|
-
|
|
489
|
+
fit?: SetViewportOptions["fit"];
|
|
490
|
+
preserveFrameChildrenOrder?: boolean;
|
|
333
491
|
}) => void;
|
|
334
492
|
private addElementsFromMixedContentPaste;
|
|
335
493
|
private addTextFromPaste;
|
|
336
494
|
setAppState: React.Component<any, AppState>["setState"];
|
|
337
495
|
removePointer: (event: React.PointerEvent<HTMLElement> | PointerEvent) => void;
|
|
338
496
|
toggleLock: (source?: "keyboard" | "ui") => void;
|
|
339
|
-
updateFrameRendering: (opts: Partial<
|
|
340
|
-
enabled: boolean;
|
|
341
|
-
name: boolean;
|
|
342
|
-
outline: boolean;
|
|
343
|
-
clip: boolean;
|
|
344
|
-
}> | ((prevState: AppState["frameRendering"]) => Partial<AppState["frameRendering"]>)) => void;
|
|
497
|
+
updateFrameRendering: (opts: Partial<AppState["frameRendering"]> | ((prevState: AppState["frameRendering"]) => Partial<AppState["frameRendering"]>)) => void;
|
|
345
498
|
togglePenMode: (force: boolean | null) => void;
|
|
346
|
-
|
|
347
|
-
/**
|
|
348
|
-
*
|
|
349
|
-
*/
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
viewportZoomFactor?: number;
|
|
356
|
-
animate?: boolean;
|
|
357
|
-
duration?: number;
|
|
358
|
-
} | {
|
|
359
|
-
fitToContent?: never;
|
|
360
|
-
fitToViewport?: boolean;
|
|
361
|
-
/** when fitToViewport=true, how much screen should the content cover,
|
|
362
|
-
* between 0.1 (10%) and 1 (100%)
|
|
363
|
-
*/
|
|
364
|
-
viewportZoomFactor?: number;
|
|
365
|
-
animate?: boolean;
|
|
366
|
-
duration?: number;
|
|
367
|
-
}) & {
|
|
368
|
-
minZoom?: number;
|
|
369
|
-
maxZoom?: number;
|
|
370
|
-
canvasOffsets?: Offsets;
|
|
371
|
-
}) => void;
|
|
372
|
-
private maybeUnfollowRemoteUser;
|
|
373
|
-
/** use when changing scrollX/scrollY/zoom based on user interaction */
|
|
374
|
-
private translateCanvas;
|
|
375
|
-
setToast: (toast: {
|
|
376
|
-
message: string;
|
|
377
|
-
closable?: boolean;
|
|
378
|
-
duration?: number;
|
|
379
|
-
} | null) => void;
|
|
499
|
+
revealIfHidden: (elements: NonDeletedExcalidrawElement[]) => void;
|
|
500
|
+
/** emits a follow/unfollow intent to the host (which owns the
|
|
501
|
+
* `userToFollow` state) via both the `onUserFollow` prop and the
|
|
502
|
+
* imperative API emitter */
|
|
503
|
+
emitUserFollowIntent: (payload: OnUserFollowedPayload) => void;
|
|
504
|
+
/** emits an UNFOLLOW intent if currently following someone — use on
|
|
505
|
+
* user-initiated viewport changes which should break follow mode */
|
|
506
|
+
requestUnfollow: () => void;
|
|
507
|
+
setToast: (toast: AppState["toast"]) => void;
|
|
380
508
|
restoreFileFromShare: () => Promise<void>;
|
|
381
509
|
/**
|
|
382
510
|
* adds supplied files to existing files in the appState.
|
|
@@ -386,7 +514,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
386
514
|
private addMissingFiles;
|
|
387
515
|
updateScene: <K extends keyof AppState>(sceneData: {
|
|
388
516
|
elements?: SceneData["elements"];
|
|
389
|
-
appState?: Pick<AppState, K> | null
|
|
517
|
+
appState?: Pick<AppState, K> | null;
|
|
390
518
|
collaborators?: SceneData["collaborators"];
|
|
391
519
|
/**
|
|
392
520
|
* 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.
|
|
@@ -403,20 +531,20 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
403
531
|
}) => void;
|
|
404
532
|
applyDeltas: (deltas: StoreDelta[], options?: ApplyToOptions) => [SceneElementsMap, AppState, boolean];
|
|
405
533
|
mutateElement: <TElement extends Mutable<ExcalidrawElement>>(element: TElement, updates: ElementUpdate<TElement>, informMutation?: boolean) => TElement;
|
|
406
|
-
|
|
534
|
+
triggerRender: (
|
|
535
|
+
/** force always re-renders canvas even if no change */
|
|
536
|
+
force?: boolean) => void;
|
|
407
537
|
/**
|
|
408
538
|
* @returns whether the menu was toggled on or off
|
|
409
539
|
*/
|
|
410
540
|
toggleSidebar: ({ name, tab, force, }: {
|
|
411
541
|
name: SidebarName | null;
|
|
412
|
-
tab?:
|
|
413
|
-
force?: boolean
|
|
542
|
+
tab?: SidebarTabName;
|
|
543
|
+
force?: boolean;
|
|
414
544
|
}) => boolean;
|
|
415
545
|
private updateCurrentCursorPosition;
|
|
416
|
-
getEditorUIOffsets: () => Offsets;
|
|
417
546
|
private onKeyDown;
|
|
418
547
|
private onKeyUp;
|
|
419
|
-
private isToolSupported;
|
|
420
548
|
setActiveTool: (tool: ({
|
|
421
549
|
type: ToolType;
|
|
422
550
|
} | {
|
|
@@ -425,10 +553,18 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
425
553
|
}) & {
|
|
426
554
|
locked?: boolean;
|
|
427
555
|
fromSelection?: boolean;
|
|
428
|
-
},
|
|
556
|
+
}, opts?: {
|
|
557
|
+
keepSelection?: boolean;
|
|
558
|
+
/**
|
|
559
|
+
* When `true`, re-activating an already-active toggle tool (see
|
|
560
|
+
* `TOGGLE_TOOLS`) switches back to the previously active tool.
|
|
561
|
+
* Activation is idempotent by default; toggle tools always record the
|
|
562
|
+
* previously active tool regardless (so ESC and the next `toggle`
|
|
563
|
+
* activation can switch back to it).
|
|
564
|
+
*/
|
|
565
|
+
toggle?: boolean;
|
|
566
|
+
}) => void;
|
|
429
567
|
setOpenDialog: (dialogType: AppState["openDialog"]) => void;
|
|
430
|
-
private setCursor;
|
|
431
|
-
private resetCursor;
|
|
432
568
|
/**
|
|
433
569
|
* returns whether user is making a gesture with >= 2 fingers (points)
|
|
434
570
|
* on o touch screen (not on a trackpad). Currently only relates to Darwin
|
|
@@ -442,22 +578,297 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
442
578
|
private onGestureEnd;
|
|
443
579
|
private handleTextWysiwyg;
|
|
444
580
|
private deselectElements;
|
|
445
|
-
private
|
|
446
|
-
private
|
|
447
|
-
|
|
581
|
+
private getSelectedTextElement;
|
|
582
|
+
private getSelectedTextEditingContainerAtPosition;
|
|
583
|
+
getTextElementAtPosition(x: number, y: number): NonDeleted<ExcalidrawTextElement> | null;
|
|
584
|
+
private isHittingTextAutoResizeHandle;
|
|
585
|
+
private handleTextAutoResizeHandlePointerDown;
|
|
586
|
+
getElementAtPosition(x: number, y: number, opts?: ({
|
|
587
|
+
includeBoundTextElement?: boolean;
|
|
588
|
+
includeLockedElements?: boolean;
|
|
589
|
+
} | {
|
|
590
|
+
allHitElements: NonDeleted<ExcalidrawElement>[];
|
|
591
|
+
}) & {
|
|
592
|
+
preferSelected?: boolean;
|
|
593
|
+
}): NonDeleted<ExcalidrawElement> | null;
|
|
594
|
+
getElementsAtPosition(x: number, y: number, opts?: {
|
|
595
|
+
includeBoundTextElement?: boolean;
|
|
596
|
+
includeLockedElements?: boolean;
|
|
597
|
+
}): NonDeleted<ExcalidrawElement>[];
|
|
448
598
|
getElementHitThreshold(element: ExcalidrawElement): number;
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
599
|
+
hitElement(x: number, y: number, element: NonDeletedExcalidrawElement, considerBoundingBox?: boolean): boolean;
|
|
600
|
+
getTextBindableContainerAtPosition(x: number, y: number): (Readonly<{
|
|
601
|
+
id: string;
|
|
602
|
+
x: number;
|
|
603
|
+
y: number;
|
|
604
|
+
strokeColor: string;
|
|
605
|
+
backgroundColor: string;
|
|
606
|
+
fillStyle: import("@excalidraw/element/types").FillStyle;
|
|
607
|
+
strokeWidth: number;
|
|
608
|
+
strokeStyle: import("@excalidraw/element/types").StrokeStyle;
|
|
609
|
+
roundness: null | {
|
|
610
|
+
type: import("@excalidraw/element/types").RoundnessType;
|
|
611
|
+
value?: number;
|
|
612
|
+
};
|
|
613
|
+
roughness: number;
|
|
614
|
+
opacity: number;
|
|
615
|
+
width: number;
|
|
616
|
+
height: number;
|
|
617
|
+
angle: Radians;
|
|
618
|
+
seed: number;
|
|
619
|
+
version: number;
|
|
620
|
+
versionNonce: number;
|
|
621
|
+
index: import("@excalidraw/element/types").FractionalIndex | null;
|
|
622
|
+
isDeleted: boolean;
|
|
623
|
+
groupIds: readonly import("@excalidraw/element/types").GroupId[];
|
|
624
|
+
frameId: string | null;
|
|
625
|
+
boundElements: readonly import("@excalidraw/element/types").BoundElement[] | null;
|
|
626
|
+
updated: number;
|
|
627
|
+
created: number | null;
|
|
628
|
+
link: string | null;
|
|
629
|
+
locked: boolean;
|
|
630
|
+
customData?: Record<string, any>;
|
|
631
|
+
}> & {
|
|
632
|
+
type: "rectangle";
|
|
633
|
+
} & {
|
|
634
|
+
isDeleted: false;
|
|
635
|
+
}) | (Readonly<{
|
|
636
|
+
id: string;
|
|
637
|
+
x: number;
|
|
638
|
+
y: number;
|
|
639
|
+
strokeColor: string;
|
|
640
|
+
backgroundColor: string;
|
|
641
|
+
fillStyle: import("@excalidraw/element/types").FillStyle;
|
|
642
|
+
strokeWidth: number;
|
|
643
|
+
strokeStyle: import("@excalidraw/element/types").StrokeStyle;
|
|
644
|
+
roundness: null | {
|
|
645
|
+
type: import("@excalidraw/element/types").RoundnessType;
|
|
646
|
+
value?: number;
|
|
647
|
+
};
|
|
648
|
+
roughness: number;
|
|
649
|
+
opacity: number;
|
|
650
|
+
width: number;
|
|
651
|
+
height: number;
|
|
652
|
+
angle: Radians;
|
|
653
|
+
seed: number;
|
|
654
|
+
version: number;
|
|
655
|
+
versionNonce: number;
|
|
656
|
+
index: import("@excalidraw/element/types").FractionalIndex | null;
|
|
657
|
+
isDeleted: boolean;
|
|
658
|
+
groupIds: readonly import("@excalidraw/element/types").GroupId[];
|
|
659
|
+
frameId: string | null;
|
|
660
|
+
boundElements: readonly import("@excalidraw/element/types").BoundElement[] | null;
|
|
661
|
+
updated: number;
|
|
662
|
+
created: number | null;
|
|
663
|
+
link: string | null;
|
|
664
|
+
locked: boolean;
|
|
665
|
+
customData?: Record<string, any>;
|
|
666
|
+
}> & Readonly<{
|
|
667
|
+
type: "stickynote";
|
|
668
|
+
baseHeight: number;
|
|
669
|
+
}> & {
|
|
670
|
+
isDeleted: false;
|
|
671
|
+
}) | (Readonly<{
|
|
672
|
+
id: string;
|
|
673
|
+
x: number;
|
|
674
|
+
y: number;
|
|
675
|
+
strokeColor: string;
|
|
676
|
+
backgroundColor: string;
|
|
677
|
+
fillStyle: import("@excalidraw/element/types").FillStyle;
|
|
678
|
+
strokeWidth: number;
|
|
679
|
+
strokeStyle: import("@excalidraw/element/types").StrokeStyle;
|
|
680
|
+
roundness: null | {
|
|
681
|
+
type: import("@excalidraw/element/types").RoundnessType;
|
|
682
|
+
value?: number;
|
|
683
|
+
};
|
|
684
|
+
roughness: number;
|
|
685
|
+
opacity: number;
|
|
686
|
+
width: number;
|
|
687
|
+
height: number;
|
|
688
|
+
angle: Radians;
|
|
689
|
+
seed: number;
|
|
690
|
+
version: number;
|
|
691
|
+
versionNonce: number;
|
|
692
|
+
index: import("@excalidraw/element/types").FractionalIndex | null;
|
|
693
|
+
isDeleted: boolean;
|
|
694
|
+
groupIds: readonly import("@excalidraw/element/types").GroupId[];
|
|
695
|
+
frameId: string | null;
|
|
696
|
+
boundElements: readonly import("@excalidraw/element/types").BoundElement[] | null;
|
|
697
|
+
updated: number;
|
|
698
|
+
created: number | null;
|
|
699
|
+
link: string | null;
|
|
700
|
+
locked: boolean;
|
|
701
|
+
customData?: Record<string, any>;
|
|
702
|
+
}> & {
|
|
703
|
+
type: "diamond";
|
|
704
|
+
} & {
|
|
705
|
+
isDeleted: false;
|
|
706
|
+
}) | (Readonly<{
|
|
707
|
+
id: string;
|
|
708
|
+
x: number;
|
|
709
|
+
y: number;
|
|
710
|
+
strokeColor: string;
|
|
711
|
+
backgroundColor: string;
|
|
712
|
+
fillStyle: import("@excalidraw/element/types").FillStyle;
|
|
713
|
+
strokeWidth: number;
|
|
714
|
+
strokeStyle: import("@excalidraw/element/types").StrokeStyle;
|
|
715
|
+
roundness: null | {
|
|
716
|
+
type: import("@excalidraw/element/types").RoundnessType;
|
|
717
|
+
value?: number;
|
|
718
|
+
};
|
|
719
|
+
roughness: number;
|
|
720
|
+
opacity: number;
|
|
721
|
+
width: number;
|
|
722
|
+
height: number;
|
|
723
|
+
angle: Radians;
|
|
724
|
+
seed: number;
|
|
725
|
+
version: number;
|
|
726
|
+
versionNonce: number;
|
|
727
|
+
index: import("@excalidraw/element/types").FractionalIndex | null;
|
|
728
|
+
isDeleted: boolean;
|
|
729
|
+
groupIds: readonly import("@excalidraw/element/types").GroupId[];
|
|
730
|
+
frameId: string | null;
|
|
731
|
+
boundElements: readonly import("@excalidraw/element/types").BoundElement[] | null;
|
|
732
|
+
updated: number;
|
|
733
|
+
created: number | null;
|
|
734
|
+
link: string | null;
|
|
735
|
+
locked: boolean;
|
|
736
|
+
customData?: Record<string, any>;
|
|
737
|
+
}> & {
|
|
738
|
+
type: "ellipse";
|
|
739
|
+
} & {
|
|
740
|
+
isDeleted: false;
|
|
741
|
+
}) | (Readonly<{
|
|
742
|
+
id: string;
|
|
743
|
+
x: number;
|
|
744
|
+
y: number;
|
|
745
|
+
strokeColor: string;
|
|
746
|
+
backgroundColor: string;
|
|
747
|
+
fillStyle: import("@excalidraw/element/types").FillStyle;
|
|
748
|
+
strokeWidth: number;
|
|
749
|
+
strokeStyle: import("@excalidraw/element/types").StrokeStyle;
|
|
750
|
+
roundness: null | {
|
|
751
|
+
type: import("@excalidraw/element/types").RoundnessType;
|
|
752
|
+
value?: number;
|
|
753
|
+
};
|
|
754
|
+
roughness: number;
|
|
755
|
+
opacity: number;
|
|
756
|
+
width: number;
|
|
757
|
+
height: number;
|
|
758
|
+
angle: Radians;
|
|
759
|
+
seed: number;
|
|
760
|
+
version: number;
|
|
761
|
+
versionNonce: number;
|
|
762
|
+
index: import("@excalidraw/element/types").FractionalIndex | null;
|
|
763
|
+
isDeleted: boolean;
|
|
764
|
+
groupIds: readonly import("@excalidraw/element/types").GroupId[];
|
|
765
|
+
frameId: string | null;
|
|
766
|
+
boundElements: readonly import("@excalidraw/element/types").BoundElement[] | null;
|
|
767
|
+
updated: number;
|
|
768
|
+
created: number | null;
|
|
769
|
+
link: string | null;
|
|
770
|
+
locked: boolean;
|
|
771
|
+
customData?: Record<string, any>;
|
|
772
|
+
}> & Readonly<{
|
|
773
|
+
type: "line" | "arrow";
|
|
774
|
+
points: readonly LocalPoint[];
|
|
775
|
+
startBinding: import("@excalidraw/element/types").FixedPointBinding | null;
|
|
776
|
+
endBinding: import("@excalidraw/element/types").FixedPointBinding | null;
|
|
777
|
+
startArrowhead: import("@excalidraw/element/types").Arrowhead | null;
|
|
778
|
+
endArrowhead: import("@excalidraw/element/types").Arrowhead | null;
|
|
779
|
+
}> & Readonly<{
|
|
780
|
+
type: "arrow";
|
|
781
|
+
elbowed: boolean;
|
|
782
|
+
}> & {
|
|
783
|
+
isDeleted: false;
|
|
784
|
+
}) | null;
|
|
785
|
+
/**
|
|
786
|
+
* Whether a text element's content is still being authored.
|
|
787
|
+
*
|
|
788
|
+
* Creating a text reverts the tool to selection during pointerdown, so the
|
|
789
|
+
* pointerup that follows looks like an ordinary canvas click and would
|
|
790
|
+
* capture the still-empty element as a history entry of its own. Undo would
|
|
791
|
+
* then rewind only the typing, restoring an invisible, zero-content element
|
|
792
|
+
* (and, for an endpoint label, leaving the arrow bound to it) rather than
|
|
793
|
+
* removing it. The editor's own submit captures the finished text instead,
|
|
794
|
+
* so the whole create-and-type lands in a single entry.
|
|
795
|
+
*/
|
|
796
|
+
private isEditingTextContent;
|
|
797
|
+
startTextEditing: ({ sceneX, sceneY, insertAtParentCenter, container, autoEdit, initialCaretSceneCoords, arrowEndpoint, }: {
|
|
798
|
+
/** X position to insert text at */
|
|
799
|
+
sceneX: number;
|
|
800
|
+
/** Y position to insert text at */
|
|
801
|
+
sceneY: number;
|
|
802
|
+
/** whether to attempt to insert at element center if applicable */
|
|
803
|
+
insertAtParentCenter?: boolean;
|
|
804
|
+
container?: ExcalidrawTextContainer | null;
|
|
805
|
+
autoEdit?: boolean;
|
|
806
|
+
initialCaretSceneCoords?: {
|
|
807
|
+
x: number;
|
|
808
|
+
y: number;
|
|
809
|
+
};
|
|
810
|
+
/**
|
|
811
|
+
* creates the text as a label for this arrow endpoint: the binding then
|
|
812
|
+
* dictates the text's position and alignment, overriding (sceneX, sceneY)
|
|
813
|
+
*/
|
|
814
|
+
arrowEndpoint?: ArrowEndpoint | null;
|
|
815
|
+
}) => void;
|
|
452
816
|
private startImageCropping;
|
|
453
817
|
private finishImageCropping;
|
|
818
|
+
private shouldHandleBrowserCanvasDoubleClick;
|
|
454
819
|
private handleCanvasDoubleClick;
|
|
820
|
+
private handleCanvasClick;
|
|
455
821
|
private getElementLinkAtPosition;
|
|
456
|
-
private
|
|
457
|
-
|
|
822
|
+
private handleElementLinkClick;
|
|
823
|
+
/**
|
|
824
|
+
* Applies (or clears) the element-link hover affordances — pointer cursor
|
|
825
|
+
* and tooltip — based on the current `hitLinkElement`. Returns whether a
|
|
826
|
+
* link is being hovered.
|
|
827
|
+
*/
|
|
828
|
+
private applyElementLinkHoverAffordance;
|
|
829
|
+
/**
|
|
830
|
+
* On touchscreens (where no hover precedes the tap) re-derives
|
|
831
|
+
* `hitLinkElement`, then opens the hit element link, if any.
|
|
832
|
+
* Returns whether a link click was handled.
|
|
833
|
+
*/
|
|
834
|
+
private maybeHandleElementLinkClick;
|
|
835
|
+
/**
|
|
836
|
+
* Restricted pointer handling for the non-interactive editor with links
|
|
837
|
+
* and/or embeds allowed (`interaction.enabled.links` / `.embeds` /
|
|
838
|
+
* `.interactiveContent`) — runs only the element-link & embed concerns
|
|
839
|
+
* (shared with the full pointer handlers above) so they behave like in
|
|
840
|
+
* view mode without the rest of the canvas pointer machinery.
|
|
841
|
+
*/
|
|
842
|
+
private handleInteractiveContentPointerMove;
|
|
843
|
+
private handleInteractiveContentPointerUp;
|
|
844
|
+
/**
|
|
845
|
+
* finds candidate frame under cursor (when dragging frame children/elements
|
|
846
|
+
* inside frames)
|
|
847
|
+
*/
|
|
848
|
+
getTopLayerFrameAtSceneCoords: (
|
|
849
|
+
/**
|
|
850
|
+
* should be already grid aligned (basically should be what the call site
|
|
851
|
+
* sets the element's coords to, if applicable)
|
|
852
|
+
*/
|
|
853
|
+
sceneCoords: {
|
|
854
|
+
x: number;
|
|
855
|
+
y: number;
|
|
856
|
+
}, opts?: {
|
|
857
|
+
/** to exclude selected elements when dragging, etc. */
|
|
858
|
+
excludeElementIds?: AppState["selectedElementIds"];
|
|
859
|
+
currentFrameId?: ExcalidrawElement["frameId"];
|
|
860
|
+
}) => NonDeleted<ExcalidrawFrameLikeElement> | null;
|
|
861
|
+
private updateFrameToHighlight;
|
|
862
|
+
private maybeUpdateFrameToHighlightOnPointerMove;
|
|
863
|
+
insertNewElements: (elements: readonly ExcalidrawElement[]) => void;
|
|
864
|
+
insertNewElement: (element: ExcalidrawElement) => void;
|
|
458
865
|
private handleCanvasPointerMove;
|
|
459
866
|
private handleEraser;
|
|
460
867
|
private handleTouchMove;
|
|
868
|
+
/**
|
|
869
|
+
* Applies the hover affordances of a selected linear element: the cursor,
|
|
870
|
+
* plus the hovered-handle state that renders them highlighted.
|
|
871
|
+
*/
|
|
461
872
|
handleHoverSelectedLinearElement(linearElementEditor: LinearElementEditor, scenePointerX: number, scenePointerY: number): void;
|
|
462
873
|
private handleCanvasPointerDown;
|
|
463
874
|
private handleCanvasPointerUp;
|
|
@@ -471,6 +882,11 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
471
882
|
private maybeCleanupAfterMissingPointerUp;
|
|
472
883
|
handleCanvasPanUsingWheelOrSpaceDrag: (event: React.PointerEvent<HTMLElement> | MouseEvent) => boolean;
|
|
473
884
|
private updateGestureOnPointerDown;
|
|
885
|
+
/**
|
|
886
|
+
* Tracks the pointer within the ongoing multi-touch gesture and applies
|
|
887
|
+
* the two-finger pinch zoom/pan, if any.
|
|
888
|
+
*/
|
|
889
|
+
private updateMultiTouchGesture;
|
|
474
890
|
private initialPointerDownState;
|
|
475
891
|
private handleDraggingScrollBar;
|
|
476
892
|
private clearSelectionIfNotUsingSelection;
|
|
@@ -495,7 +911,10 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
495
911
|
}) => NonDeleted<ExcalidrawEmbeddableElement> | undefined;
|
|
496
912
|
private newImagePlaceholder;
|
|
497
913
|
private handleLinearElementOnPointerDown;
|
|
498
|
-
|
|
914
|
+
getCurrentItemRoundness(elementType: "selection" | "rectangle" | "stickynote" | "diamond" | "ellipse" | "iframe" | "embeddable"): {
|
|
915
|
+
type: 2 | 3;
|
|
916
|
+
} | null;
|
|
917
|
+
getCurrentItemStrokeWidth(elementType: ExcalidrawElement["type"]): number;
|
|
499
918
|
private createGenericElementOnPointerDown;
|
|
500
919
|
private createFrameElementOnPointerDown;
|
|
501
920
|
private maybeCacheReferenceSnapPoints;
|
|
@@ -524,25 +943,32 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
524
943
|
/** generally you should use `addNewImagesToImageCache()` directly if you need
|
|
525
944
|
* to render new images. This is just a failsafe */
|
|
526
945
|
private scheduleImageRefresh;
|
|
527
|
-
private updateBindingEnabledOnPointerMove;
|
|
528
|
-
private maybeSuggestBindingAtCursor;
|
|
529
946
|
private clearSelection;
|
|
530
947
|
private handleInteractiveCanvasRef;
|
|
531
948
|
private insertImages;
|
|
532
949
|
private handleAppOnDrop;
|
|
533
|
-
loadFileToCanvas: (file: File, fileHandle:
|
|
950
|
+
loadFileToCanvas: (file: File, fileHandle: FileSystemFileHandle | null) => Promise<void>;
|
|
534
951
|
private handleCanvasContextMenu;
|
|
535
952
|
private maybeDragNewGenericElement;
|
|
536
953
|
private maybeHandleCrop;
|
|
537
954
|
private maybeHandleResize;
|
|
538
955
|
private getContextMenuItems;
|
|
539
|
-
|
|
540
|
-
|
|
956
|
+
getTextWysiwygSnappedToCenterPosition(x: number, y: number, appState: AppState, container?: ExcalidrawTextContainer | null): {
|
|
957
|
+
viewportX: number;
|
|
958
|
+
viewportY: number;
|
|
959
|
+
elementCenterX: number;
|
|
960
|
+
elementCenterY: number;
|
|
961
|
+
} | undefined;
|
|
541
962
|
private savePointer;
|
|
542
|
-
|
|
963
|
+
resetShouldCacheIgnoreZoomDebounced: {
|
|
964
|
+
(): void;
|
|
965
|
+
flush(): void;
|
|
966
|
+
cancel(): void;
|
|
967
|
+
};
|
|
543
968
|
private updateDOMRect;
|
|
544
969
|
refresh: () => void;
|
|
545
970
|
private getCanvasOffsets;
|
|
971
|
+
watchState: () => void;
|
|
546
972
|
private updateLanguage;
|
|
547
973
|
}
|
|
548
974
|
declare global {
|
|
@@ -552,6 +978,7 @@ declare global {
|
|
|
552
978
|
elements: readonly ExcalidrawElement[];
|
|
553
979
|
state: AppState;
|
|
554
980
|
setState: React.Component<any, AppState>["setState"];
|
|
981
|
+
watchState: (prev: any, next: any) => void | undefined;
|
|
555
982
|
app: InstanceType<typeof App>;
|
|
556
983
|
history: History;
|
|
557
984
|
store: Store;
|