@excalidraw/element 0.18.0-200a6bd94 → 0.18.0-2a82821
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 +8373 -5210
- package/dist/dev/index.js.map +4 -4
- package/dist/prod/index.js +20 -19
- package/dist/types/common/debug.d.ts +21 -0
- package/dist/types/common/src/appEventBus.d.ts +27 -0
- package/dist/types/common/src/bounds.d.ts +10 -0
- package/dist/types/common/src/colors.d.ts +59 -39
- package/dist/types/common/src/constants.d.ts +46 -33
- package/dist/types/common/src/editorInterface.d.ts +34 -0
- package/dist/types/common/src/font-metadata.d.ts +1 -3
- package/dist/types/common/src/index.d.ts +5 -0
- package/dist/types/common/src/keys.d.ts +1 -1
- package/dist/types/common/src/utility-types.d.ts +0 -1
- package/dist/types/common/src/utils.d.ts +53 -41
- package/dist/types/common/src/versionedSnapshotStore.d.ts +17 -0
- package/dist/types/element/src/Scene.d.ts +16 -8
- package/dist/types/element/src/arrowheads.d.ts +3 -0
- package/dist/types/element/src/arrows/focus.d.ts +27 -0
- package/dist/types/element/src/arrows/helpers.d.ts +5 -0
- package/dist/types/element/src/binding.d.ts +67 -48
- package/dist/types/element/src/bounds.d.ts +25 -14
- package/dist/types/element/src/collision.d.ts +7 -2
- package/dist/types/element/src/comparisons.d.ts +8 -7
- package/dist/types/element/src/delta.d.ts +6 -4
- package/dist/types/element/src/distribute.d.ts +2 -1
- package/dist/types/element/src/dragElements.d.ts +3 -3
- package/dist/types/element/src/duplicate.d.ts +4 -3
- package/dist/types/element/src/elbowArrow.d.ts +2 -0
- package/dist/types/element/src/fractionalIndex.d.ts +2 -2
- package/dist/types/element/src/frame.d.ts +12 -7
- 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 +5 -3
- package/dist/types/element/src/linearElementEditor.d.ts +23 -22
- package/dist/types/element/src/mutateElement.d.ts +5 -1
- package/dist/types/element/src/newElement.d.ts +7 -6
- package/dist/types/element/src/positionElementsOnGrid.d.ts +2 -0
- package/dist/types/element/src/renderElement.d.ts +4 -7
- package/dist/types/element/src/resizeElements.d.ts +10 -10
- package/dist/types/element/src/resizeTest.d.ts +6 -5
- package/dist/types/element/src/selection.d.ts +10 -10
- package/dist/types/element/src/shape.d.ts +9 -8
- package/dist/types/element/src/store.d.ts +6 -1
- package/dist/types/element/src/textElement.d.ts +2 -2
- package/dist/types/element/src/textMeasurements.d.ts +1 -3
- package/dist/types/element/src/textWrapping.d.ts +26 -0
- package/dist/types/{excalidraw/data → element/src}/transform.d.ts +3 -3
- package/dist/types/element/src/transformHandles.d.ts +8 -27
- package/dist/types/element/src/typeChecks.d.ts +5 -7
- package/dist/types/element/src/types.d.ts +18 -13
- package/dist/types/element/src/utils.d.ts +9 -4
- package/dist/types/element/src/visualdebug.d.ts +58 -0
- package/dist/types/element/src/zindex.d.ts +7 -1
- package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +137 -174
- package/dist/types/excalidraw/actions/actionAlign.d.ts +6 -7
- package/dist/types/excalidraw/actions/actionBoundText.d.ts +98 -123
- package/dist/types/excalidraw/actions/actionCanvas.d.ts +581 -913
- package/dist/types/excalidraw/actions/actionClipboard.d.ts +100 -866
- package/dist/types/excalidraw/actions/actionCropEditor.d.ts +47 -60
- package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +157 -198
- package/dist/types/excalidraw/actions/actionDeselect.d.ts +160 -0
- package/dist/types/excalidraw/actions/actionDistribute.d.ts +2 -3
- package/dist/types/excalidraw/actions/actionDuplicateSelection.d.ts +2 -3
- package/dist/types/excalidraw/actions/actionElementLink.d.ts +39 -58
- package/dist/types/excalidraw/actions/actionElementLock.d.ts +96 -121
- package/dist/types/excalidraw/actions/actionEmbeddable.d.ts +48 -61
- package/dist/types/excalidraw/actions/actionExport.d.ts +177 -1407
- package/dist/types/excalidraw/actions/actionFinalize.d.ts +10 -394
- package/dist/types/excalidraw/actions/actionFlip.d.ts +2 -3
- package/dist/types/excalidraw/actions/actionFrame.d.ts +288 -374
- package/dist/types/excalidraw/actions/actionGroup.d.ts +101 -134
- package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +158 -208
- package/dist/types/excalidraw/actions/actionLink.d.ts +45 -58
- package/dist/types/excalidraw/actions/actionMenu.d.ts +38 -423
- package/dist/types/excalidraw/actions/actionNavigate.d.ts +18 -359
- package/dist/types/excalidraw/actions/actionProperties.d.ts +164 -2510
- package/dist/types/excalidraw/actions/actionSelectAll.d.ts +50 -67
- package/dist/types/excalidraw/actions/actionStyles.d.ts +47 -59
- package/dist/types/excalidraw/actions/actionTextAutoResize.d.ts +3 -3
- package/dist/types/excalidraw/actions/actionToggleArrowBinding.d.ts +173 -0
- package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +47 -60
- package/dist/types/excalidraw/actions/actionToggleMidpointSnapping.d.ts +173 -0
- package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +47 -60
- package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +36 -55
- package/dist/types/excalidraw/actions/actionToggleShapeSwitch.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionToggleStats.d.ts +47 -60
- package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +47 -60
- package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +48 -61
- package/dist/types/excalidraw/actions/actionZindex.d.ts +2 -3
- package/dist/types/excalidraw/actions/index.d.ts +5 -2
- 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 +4 -4
- package/dist/types/excalidraw/{animated-trail.d.ts → animatedTrail.d.ts} +4 -3
- package/dist/types/excalidraw/appState.d.ts +24 -15
- 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 +22 -5
- package/dist/types/excalidraw/components/ActiveConfirmDialog.d.ts +1 -1
- package/dist/types/excalidraw/components/App.d.ts +129 -79
- 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 +0 -1
- package/dist/types/excalidraw/components/ColorPicker/Picker.d.ts +2 -0
- package/dist/types/excalidraw/components/ColorPicker/PickerColorList.d.ts +2 -1
- package/dist/types/excalidraw/components/ColorPicker/ShadeList.d.ts +2 -1
- package/dist/types/excalidraw/components/ColorPicker/colorPickerUtils.d.ts +1 -2
- package/dist/types/excalidraw/components/ColorPicker/keyboardNavHandlers.d.ts +0 -1
- package/dist/types/excalidraw/components/CommandPalette/CommandPalette.d.ts +1 -0
- package/dist/types/excalidraw/components/CommandPalette/defaultCommandPaletteItems.d.ts +1 -2
- package/dist/types/excalidraw/components/CommandPalette/types.d.ts +2 -4
- package/dist/types/excalidraw/components/ConvertElementTypePopup.d.ts +3 -3
- package/dist/types/excalidraw/components/DarkModeToggle.d.ts +1 -1
- package/dist/types/excalidraw/components/DefaultSidebar.d.ts +9 -13
- package/dist/types/excalidraw/components/ElementLinkDialog.d.ts +1 -1
- package/dist/types/excalidraw/components/Ellipsify.d.ts +1 -2
- package/dist/types/excalidraw/components/ErrorDialog.d.ts +1 -1
- package/dist/types/excalidraw/components/EyeDropper.d.ts +1 -2
- package/dist/types/excalidraw/components/FilledButton.d.ts +2 -1
- package/dist/types/excalidraw/components/FontPicker/FontPicker.d.ts +2 -1
- package/dist/types/excalidraw/components/FontPicker/FontPickerTrigger.d.ts +3 -1
- package/dist/types/excalidraw/components/FontPicker/keyboardNavHandlers.d.ts +0 -1
- package/dist/types/excalidraw/components/HelpDialog.d.ts +1 -1
- package/dist/types/excalidraw/components/HintViewer.d.ts +4 -3
- package/dist/types/excalidraw/components/IconPicker.d.ts +14 -9
- package/dist/types/excalidraw/components/InlineIcon.d.ts +3 -1
- package/dist/types/excalidraw/components/LayerUI.d.ts +2 -1
- package/dist/types/excalidraw/components/LibraryMenu.d.ts +1 -1
- package/dist/types/excalidraw/components/LibraryMenuControlButtons.d.ts +1 -1
- package/dist/types/excalidraw/components/LibraryMenuHeaderContent.d.ts +1 -2
- package/dist/types/excalidraw/components/LibraryMenuSection.d.ts +1 -1
- package/dist/types/excalidraw/components/LibraryUnit.d.ts +2 -3
- package/dist/types/excalidraw/components/LoadingMessage.d.ts +0 -1
- package/dist/types/excalidraw/components/MobileMenu.d.ts +3 -5
- package/dist/types/excalidraw/components/MobileToolBar.d.ts +10 -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/Popover.d.ts +2 -1
- package/dist/types/excalidraw/components/PropertiesPopover.d.ts +2 -1
- 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/CanvasGrid.d.ts +0 -1
- package/dist/types/excalidraw/components/Stats/Collapsible.d.ts +0 -1
- package/dist/types/excalidraw/components/Stats/DragInput.d.ts +0 -1
- 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 +25 -0
- package/dist/types/excalidraw/components/Trans.d.ts +2 -2
- package/dist/types/excalidraw/components/canvases/InteractiveCanvas.d.ts +8 -4
- package/dist/types/excalidraw/components/canvases/NewElementCanvas.d.ts +1 -0
- package/dist/types/excalidraw/components/canvases/StaticCanvas.d.ts +1 -1
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenu.d.ts +47 -35
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuContent.d.ts +7 -5
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuGroup.d.ts +3 -3
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItem.d.ts +13 -22
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemCheckbox.d.ts +5 -0
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemContent.d.ts +5 -4
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemContentRadio.d.ts +2 -2
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemCustom.d.ts +2 -2
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemLink.d.ts +6 -6
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuSub.d.ts +23 -0
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuSubContent.d.ts +8 -0
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuSubTrigger.d.ts +12 -0
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuTrigger.d.ts +3 -4
- package/dist/types/excalidraw/components/dropdownMenu/common.d.ts +2 -2
- package/dist/types/excalidraw/components/dropdownMenu/dropdownMenuUtils.d.ts +2 -0
- package/dist/types/excalidraw/components/hoc/withInternalFallback.d.ts +1 -1
- package/dist/types/excalidraw/components/hyperlink/helpers.d.ts +1 -1
- package/dist/types/excalidraw/components/icons.d.ts +51 -21
- package/dist/types/excalidraw/components/main-menu/DefaultItems.d.ts +24 -3
- package/dist/types/excalidraw/components/main-menu/MainMenu.d.ts +39 -35
- package/dist/types/excalidraw/components/shapes.d.ts +209 -1
- package/dist/types/excalidraw/data/blob.d.ts +329 -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 +4 -5
- package/dist/types/excalidraw/data/json.d.ts +171 -4
- 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/editor-jotai.d.ts +11 -11
- package/dist/types/excalidraw/eraser/index.d.ts +2 -3
- package/dist/types/excalidraw/errors.d.ts +14 -0
- package/dist/types/excalidraw/hooks/useLibraryItemSvg.d.ts +2 -2
- package/dist/types/excalidraw/hooks/useOutsideClick.d.ts +4 -3
- package/dist/types/excalidraw/hooks/useScrollPosition.d.ts +1 -2
- package/dist/types/excalidraw/hooks/useTextEditorFocus.d.ts +14 -0
- package/dist/types/excalidraw/i18n.d.ts +2 -2
- package/dist/types/excalidraw/{laser-trails.d.ts → laserTrails.d.ts} +5 -7
- package/dist/types/excalidraw/lasso/index.d.ts +2 -3
- package/dist/types/excalidraw/renderer/animation.d.ts +15 -0
- package/dist/types/excalidraw/renderer/helpers.d.ts +6 -8
- package/dist/types/excalidraw/renderer/interactiveScene.d.ts +8 -14
- package/dist/types/excalidraw/scene/Renderer.d.ts +428 -18
- package/dist/types/excalidraw/scene/export.d.ts +2 -2
- package/dist/types/excalidraw/scene/index.d.ts +1 -1
- package/dist/types/excalidraw/scene/scroll.d.ts +1 -6
- package/dist/types/excalidraw/scene/types.d.ts +22 -5
- package/dist/types/excalidraw/shortcut.d.ts +1 -0
- package/dist/types/excalidraw/snapping.d.ts +5 -5
- 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 +149 -38
- package/dist/types/excalidraw/wysiwyg/textWysiwyg.d.ts +7 -3
- 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 +35 -0
- package/dist/types/math/src/constants.d.ts +0 -1
- package/dist/types/math/src/curve.d.ts +4 -1
- package/dist/types/math/src/point.d.ts +8 -2
- package/dist/types/math/src/polygon.d.ts +2 -2
- package/dist/types/math/src/range.d.ts +1 -3
- package/dist/types/math/src/segment.d.ts +4 -3
- package/dist/types/math/src/types.d.ts +25 -1
- package/dist/types/utils/src/export.d.ts +5 -5
- package/dist/types/utils/src/index.d.ts +1 -2
- package/dist/types/utils/src/shape.d.ts +6 -6
- package/package.json +10 -3
- package/dist/types/excalidraw/animation-frame-handler.d.ts +0 -16
- package/dist/types/excalidraw/charts.d.ts +0 -27
- package/dist/types/excalidraw/components/DiagramToCodePlugin/DiagramToCodePlugin.d.ts +0 -4
- package/dist/types/excalidraw/components/ExcalidrawLogo.d.ts +0 -16
- package/dist/types/excalidraw/components/InitializeApp.d.ts +0 -10
- package/dist/types/excalidraw/components/TTDDialog/TTDDialogTrigger.d.ts +0 -9
- package/dist/types/excalidraw/components/footer/FooterCenter.d.ts +0 -8
- package/dist/types/excalidraw/components/live-collaboration/LiveCollaborationTrigger.d.ts +0 -10
- package/dist/types/excalidraw/components/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/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/utils/src/bbox.d.ts +0 -9
- package/dist/types/utils/src/withinBounds.d.ts +0 -19
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { ALLOWED_PASTE_MIME_TYPES } from "@excalidraw/common";
|
|
2
|
+
import type { ValueOf } from "@excalidraw/common/utility-types";
|
|
3
|
+
import type { IMAGE_MIME_TYPES, STRING_MIME_TYPES } from "@excalidraw/common";
|
|
2
4
|
import type { ExcalidrawElement, NonDeletedExcalidrawElement } from "@excalidraw/element/types";
|
|
3
|
-
import type { Spreadsheet } from "./charts";
|
|
4
5
|
import type { BinaryFiles } from "./types";
|
|
5
6
|
export type PastedMixedContent = {
|
|
6
7
|
type: "text" | "imageUrl";
|
|
7
8
|
value: string;
|
|
8
9
|
}[];
|
|
9
10
|
export interface ClipboardData {
|
|
10
|
-
spreadsheet?: Spreadsheet;
|
|
11
11
|
elements?: readonly ExcalidrawElement[];
|
|
12
12
|
files?: BinaryFiles;
|
|
13
13
|
text?: string;
|
|
@@ -20,26 +20,16 @@ export declare const probablySupportsClipboardReadText: boolean;
|
|
|
20
20
|
export declare const probablySupportsClipboardWriteText: boolean;
|
|
21
21
|
export declare const probablySupportsClipboardBlob: boolean;
|
|
22
22
|
export declare const createPasteEvent: ({ types, files, }: {
|
|
23
|
-
types?: {
|
|
24
|
-
|
|
25
|
-
"text/html"?: string | File | undefined;
|
|
26
|
-
"image/svg+xml"?: string | File | undefined;
|
|
27
|
-
"image/png"?: string | File | undefined;
|
|
28
|
-
"image/jpeg"?: string | File | undefined;
|
|
29
|
-
"image/gif"?: string | File | undefined;
|
|
30
|
-
"image/webp"?: string | File | undefined;
|
|
31
|
-
"image/bmp"?: string | File | undefined;
|
|
32
|
-
"image/x-icon"?: string | File | undefined;
|
|
33
|
-
"image/avif"?: string | File | undefined;
|
|
34
|
-
"image/jfif"?: string | File | undefined;
|
|
35
|
-
} | undefined;
|
|
36
|
-
files?: File[] | undefined;
|
|
23
|
+
types?: { [key in AllowedPasteMimeTypes]?: string | File; };
|
|
24
|
+
files?: File[];
|
|
37
25
|
}) => ClipboardEvent;
|
|
38
26
|
export declare const serializeAsClipboardJSON: ({ elements, files, }: {
|
|
39
27
|
elements: readonly NonDeletedExcalidrawElement[];
|
|
40
28
|
files: BinaryFiles | null;
|
|
41
29
|
}) => string;
|
|
42
|
-
export declare const copyToClipboard: (elements: readonly NonDeletedExcalidrawElement[], files: BinaryFiles | null,
|
|
30
|
+
export declare const copyToClipboard: (elements: readonly NonDeletedExcalidrawElement[], files: BinaryFiles | null,
|
|
31
|
+
/** supply if available to make the operation more certain to succeed */
|
|
32
|
+
clipboardEvent?: ClipboardEvent | null) => Promise<void>;
|
|
43
33
|
/**
|
|
44
34
|
* Reads OS clipboard programmatically. May not work on all browsers.
|
|
45
35
|
* Will prompt user for permission if not granted.
|
|
@@ -57,10 +47,58 @@ export declare const readSystemClipboard: () => Promise<{
|
|
|
57
47
|
"image/avif"?: string | File | undefined;
|
|
58
48
|
"image/jfif"?: string | File | undefined;
|
|
59
49
|
}>;
|
|
50
|
+
type AllowedParsedDataTransferItem = {
|
|
51
|
+
type: ValueOf<typeof IMAGE_MIME_TYPES>;
|
|
52
|
+
kind: "file";
|
|
53
|
+
file: File;
|
|
54
|
+
fileHandle: FileSystemFileHandle | null;
|
|
55
|
+
} | {
|
|
56
|
+
type: ValueOf<typeof STRING_MIME_TYPES>;
|
|
57
|
+
kind: "string";
|
|
58
|
+
value: string;
|
|
59
|
+
};
|
|
60
|
+
type ParsedDataTransferItem = {
|
|
61
|
+
type: string;
|
|
62
|
+
kind: "file";
|
|
63
|
+
file: File;
|
|
64
|
+
fileHandle: FileSystemFileHandle | null;
|
|
65
|
+
} | {
|
|
66
|
+
type: string;
|
|
67
|
+
kind: "string";
|
|
68
|
+
value: string;
|
|
69
|
+
};
|
|
70
|
+
type ParsedDataTransferItemType<T extends AllowedParsedDataTransferItem["type"]> = AllowedParsedDataTransferItem & {
|
|
71
|
+
type: T;
|
|
72
|
+
};
|
|
73
|
+
export type ParsedDataTransferFile = Extract<AllowedParsedDataTransferItem, {
|
|
74
|
+
kind: "file";
|
|
75
|
+
}>;
|
|
76
|
+
export type ParsedDataTranferList = ParsedDataTransferItem[] & {
|
|
77
|
+
/**
|
|
78
|
+
* Only allows filtering by known `string` data types, since `file`
|
|
79
|
+
* types can have multiple items of the same type (e.g. multiple image files)
|
|
80
|
+
* unlike `string` data transfer items.
|
|
81
|
+
*/
|
|
82
|
+
findByType: typeof findDataTransferItemType;
|
|
83
|
+
/**
|
|
84
|
+
* Only allows filtering by known `string` data types, since `file`
|
|
85
|
+
* types can have multiple items of the same type (e.g. multiple image files)
|
|
86
|
+
* unlike `string` data transfer items.
|
|
87
|
+
*/
|
|
88
|
+
getData: typeof getDataTransferItemData;
|
|
89
|
+
getFiles: typeof getDataTransferFiles;
|
|
90
|
+
};
|
|
91
|
+
declare const findDataTransferItemType: <T extends ValueOf<typeof STRING_MIME_TYPES>>(this: ParsedDataTranferList, type: T) => ParsedDataTransferItemType<T> | null;
|
|
92
|
+
declare const getDataTransferItemData: <T extends ValueOf<typeof STRING_MIME_TYPES>>(this: ParsedDataTranferList, type: T) => ParsedDataTransferItemType<ValueOf<typeof STRING_MIME_TYPES>>["value"] | null;
|
|
93
|
+
declare const getDataTransferFiles: (this: ParsedDataTranferList) => ParsedDataTransferFile[];
|
|
94
|
+
/** @returns list of MIME types, synchronously */
|
|
95
|
+
export declare const parseDataTransferEventMimeTypes: (event: ClipboardEvent | DragEvent | React.DragEvent<HTMLDivElement>) => Set<string>;
|
|
96
|
+
export declare const parseDataTransferEvent: (event: ClipboardEvent | DragEvent | React.DragEvent<HTMLDivElement>) => Promise<ParsedDataTranferList>;
|
|
60
97
|
/**
|
|
61
98
|
* Attempts to parse clipboard event.
|
|
62
99
|
*/
|
|
63
|
-
export declare const parseClipboard: (
|
|
100
|
+
export declare const parseClipboard: (dataList: ParsedDataTranferList, isPlainPaste?: boolean) => Promise<ClipboardData>;
|
|
64
101
|
export declare const copyBlobToClipboardAsPng: (blob: Blob | Promise<Blob>) => Promise<void>;
|
|
65
|
-
export declare const copyTextToSystemClipboard: (text: string | null, clipboardEvent?: ClipboardEvent | null) => Promise<void>;
|
|
102
|
+
export declare const copyTextToSystemClipboard: <MimeType extends ValueOf<typeof STRING_MIME_TYPES>>(text: string | { [K in MimeType]: string; } | null, clipboardEvent?: ClipboardEvent | null) => Promise<void>;
|
|
103
|
+
export declare const isClipboardEvent: (event: React.SyntheticEvent | Event) => event is ClipboardEvent;
|
|
66
104
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ExcalidrawElement, NonDeletedElementsMap, NonDeletedSceneElementsMap } from "@excalidraw/element/types";
|
|
2
2
|
import "./Actions.scss";
|
|
3
|
-
import type { AppClassProperties, AppProps, UIAppState, Zoom } from "../types";
|
|
3
|
+
import type { AppClassProperties, AppProps, UIAppState, Zoom, AppState } from "../types";
|
|
4
4
|
import type { ActionManager } from "../actions/manager";
|
|
5
5
|
export declare const canChangeStrokeColor: (appState: UIAppState, targetElements: ExcalidrawElement[]) => boolean;
|
|
6
6
|
export declare const canChangeBackgroundColor: (appState: UIAppState, targetElements: ExcalidrawElement[]) => boolean;
|
|
@@ -10,9 +10,23 @@ export declare const SelectedShapeActions: ({ appState, elementsMap, renderActio
|
|
|
10
10
|
renderAction: ActionManager["renderAction"];
|
|
11
11
|
app: AppClassProperties;
|
|
12
12
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
-
export declare const
|
|
14
|
-
activeTool: UIAppState["activeTool"];
|
|
13
|
+
export declare const CompactShapeActions: ({ appState, elementsMap, renderAction, app, setAppState, }: {
|
|
15
14
|
appState: UIAppState;
|
|
15
|
+
elementsMap: NonDeletedElementsMap | NonDeletedSceneElementsMap;
|
|
16
|
+
renderAction: ActionManager["renderAction"];
|
|
17
|
+
app: AppClassProperties;
|
|
18
|
+
setAppState: React.Component<any, AppState>["setState"];
|
|
19
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export declare const MobileShapeActions: ({ appState, elementsMap, renderAction, app, setAppState, }: {
|
|
21
|
+
appState: UIAppState;
|
|
22
|
+
elementsMap: NonDeletedElementsMap | NonDeletedSceneElementsMap;
|
|
23
|
+
renderAction: ActionManager["renderAction"];
|
|
24
|
+
app: AppClassProperties;
|
|
25
|
+
setAppState: React.Component<any, AppState>["setState"];
|
|
26
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
export declare const ShapesSwitcher: ({ activeTool, setAppState, app, UIOptions, }: {
|
|
28
|
+
activeTool: UIAppState["activeTool"];
|
|
29
|
+
setAppState: React.Component<any, AppState>["setState"];
|
|
16
30
|
app: AppClassProperties;
|
|
17
31
|
UIOptions: AppProps["UIOptions"];
|
|
18
32
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -22,9 +36,12 @@ export declare const ZoomActions: ({ renderAction, zoom, }: {
|
|
|
22
36
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
23
37
|
export declare const UndoRedoActions: ({ renderAction, className, }: {
|
|
24
38
|
renderAction: ActionManager["renderAction"];
|
|
25
|
-
className?: string
|
|
39
|
+
className?: string;
|
|
26
40
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
27
|
-
export declare const
|
|
41
|
+
export declare const ExitZenModeButton: ({ actionManager, showExitZenModeBtn, }: {
|
|
28
42
|
actionManager: ActionManager;
|
|
29
43
|
showExitZenModeBtn: boolean;
|
|
30
44
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
45
|
+
export declare const ExitViewModeButton: ({ actionManager, }: {
|
|
46
|
+
actionManager: ActionManager;
|
|
47
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const activeConfirmDialogAtom: import("jotai
|
|
1
|
+
export declare const activeConfirmDialogAtom: import("jotai").PrimitiveAtom<"clearCanvas" | null> & {
|
|
2
2
|
init: "clearCanvas" | null;
|
|
3
3
|
};
|
|
4
4
|
export declare const ActiveConfirmDialog: () => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,39 +1,56 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { type EXPORT_IMAGE_TYPES, Emitter } from "@excalidraw/common";
|
|
3
|
-
import { LinearElementEditor, FlowChartCreator, Scene, Store, type ElementUpdate } from "@excalidraw/element";
|
|
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, FlowChartCreator, 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
5
|
import type { Mutable } from "@excalidraw/common/utility-types";
|
|
6
6
|
import { ActionManager } from "../actions/manager";
|
|
7
|
-
import { AnimationFrameHandler } from "../animation-frame-handler";
|
|
8
7
|
import { History } from "../history";
|
|
9
8
|
import { Fonts } from "../fonts";
|
|
10
9
|
import { type WritableAtom } from "../editor-jotai";
|
|
11
10
|
import { Renderer } from "../scene/Renderer";
|
|
12
|
-
import { LaserTrails } from "../
|
|
11
|
+
import { LaserTrails } from "../laserTrails";
|
|
12
|
+
import { isOverScrollBars } from "../scene/scrollbars";
|
|
13
13
|
import { LassoTrail } from "../lasso";
|
|
14
14
|
import { EraserTrail } from "../eraser";
|
|
15
|
+
import { type OnStateChange } from "./AppStateObserver";
|
|
15
16
|
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";
|
|
17
|
+
import type { AppClassProperties, AppProps, AppState, ExcalidrawImperativeAPI, BinaryFiles, LibraryItems, SceneData, FrameNameBoundsCache, SidebarName, SidebarTabName, ToolType, OnUserFollowedPayload, ExcalidrawImperativeAPIEventMap, GenerateDiagramToCode, NullableGridSize, Offsets } from "../types";
|
|
18
18
|
import type { RoughCanvas } from "roughjs/bin/canvas";
|
|
19
19
|
import type { ActionResult } from "../actions/types";
|
|
20
|
+
declare const editorLifecycleEventBehavior: {
|
|
21
|
+
readonly "editor:mount": {
|
|
22
|
+
readonly cardinality: "once";
|
|
23
|
+
readonly replay: "last";
|
|
24
|
+
};
|
|
25
|
+
readonly "editor:initialize": {
|
|
26
|
+
readonly cardinality: "once";
|
|
27
|
+
readonly replay: "last";
|
|
28
|
+
};
|
|
29
|
+
readonly "editor:unmount": {
|
|
30
|
+
readonly cardinality: "once";
|
|
31
|
+
readonly replay: "last";
|
|
32
|
+
};
|
|
33
|
+
};
|
|
20
34
|
export declare const ExcalidrawContainerContext: React.Context<{
|
|
21
35
|
container: HTMLDivElement | null;
|
|
22
36
|
id: string | null;
|
|
23
37
|
}>;
|
|
38
|
+
export declare const ExcalidrawAPIContext: React.Context<ExcalidrawImperativeAPI | null>;
|
|
39
|
+
export declare const ExcalidrawAPISetContext: React.Context<((api: ExcalidrawImperativeAPI | null) => void) | null>;
|
|
24
40
|
export declare const useApp: () => AppClassProperties;
|
|
25
41
|
export declare const useAppProps: () => AppProps;
|
|
26
|
-
export declare const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
canFitSidebar: boolean;
|
|
34
|
-
};
|
|
42
|
+
export declare const useEditorInterface: () => Readonly<{
|
|
43
|
+
formFactor: "phone" | "tablet" | "desktop";
|
|
44
|
+
desktopUIMode: "compact" | "full";
|
|
45
|
+
userAgent: Readonly<{
|
|
46
|
+
isMobileDevice: boolean;
|
|
47
|
+
platform: "ios" | "android" | "other" | "unknown";
|
|
48
|
+
}>;
|
|
35
49
|
isTouchScreen: boolean;
|
|
50
|
+
canFitSidebar: boolean;
|
|
51
|
+
isLandscape: boolean;
|
|
36
52
|
}>;
|
|
53
|
+
export declare const useStylesPanelMode: () => StylesPanelMode;
|
|
37
54
|
export declare const useExcalidrawContainer: () => {
|
|
38
55
|
container: HTMLDivElement | null;
|
|
39
56
|
id: string | null;
|
|
@@ -42,20 +59,25 @@ export declare const useExcalidrawElements: () => readonly NonDeletedExcalidrawE
|
|
|
42
59
|
export declare const useExcalidrawAppState: () => AppState;
|
|
43
60
|
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
61
|
export declare const useExcalidrawActionManager: () => ActionManager;
|
|
62
|
+
/**
|
|
63
|
+
* Requires wrapping your component in <ExcalidrawAPIContext.Provider>
|
|
64
|
+
*/
|
|
65
|
+
export declare const useExcalidrawAPI: () => ExcalidrawImperativeAPI | null;
|
|
45
66
|
declare class App extends React.Component<AppProps, AppState> {
|
|
46
67
|
canvas: AppClassProperties["canvas"];
|
|
47
68
|
interactiveCanvas: AppClassProperties["interactiveCanvas"];
|
|
69
|
+
sessionExportThemeOverride: AppState["theme"] | undefined;
|
|
48
70
|
rc: RoughCanvas;
|
|
49
71
|
unmounted: boolean;
|
|
50
72
|
actionManager: ActionManager;
|
|
51
|
-
|
|
73
|
+
editorInterface: EditorInterface;
|
|
74
|
+
private stylesPanelMode;
|
|
52
75
|
private excalidrawContainerRef;
|
|
53
76
|
scene: Scene;
|
|
54
77
|
fonts: Fonts;
|
|
55
78
|
renderer: Renderer;
|
|
56
79
|
visibleElements: readonly NonDeletedExcalidrawElement[];
|
|
57
80
|
private resizeObserver;
|
|
58
|
-
private nearestScrollableContainer;
|
|
59
81
|
library: AppClassProperties["library"];
|
|
60
82
|
libraryItemsFromStorage: LibraryItems | undefined;
|
|
61
83
|
id: string;
|
|
@@ -78,23 +100,35 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
78
100
|
/** embeds that have been inserted to DOM (as a perf optim, we don't want to
|
|
79
101
|
* insert to DOM before user initially scrolls to them) */
|
|
80
102
|
private initializedEmbeds;
|
|
81
|
-
private handleToastClose;
|
|
82
103
|
private elementsPendingErasure;
|
|
104
|
+
private _initialized;
|
|
105
|
+
private readonly editorLifecycleEvents;
|
|
106
|
+
onEvent: AppEventBus<ExcalidrawImperativeAPIEventMap, typeof editorLifecycleEventBehavior>["on"];
|
|
107
|
+
private appStateObserver;
|
|
108
|
+
onStateChange: OnStateChange;
|
|
83
109
|
flowChartCreator: FlowChartCreator;
|
|
84
110
|
private flowChartNavigator;
|
|
111
|
+
bindModeHandler: ReturnType<typeof setTimeout> | null;
|
|
85
112
|
hitLinkElement?: NonDeletedExcalidrawElement;
|
|
86
113
|
lastPointerDownEvent: React.PointerEvent<HTMLElement> | null;
|
|
87
114
|
lastPointerUpEvent: React.PointerEvent<HTMLElement> | PointerEvent | null;
|
|
115
|
+
lastPointerUpIsDoubleClick: boolean;
|
|
88
116
|
lastPointerMoveEvent: PointerEvent | null;
|
|
117
|
+
/** current frame pointer cords */
|
|
89
118
|
lastPointerMoveCoords: {
|
|
90
119
|
x: number;
|
|
91
120
|
y: number;
|
|
92
121
|
} | null;
|
|
122
|
+
private lastCompletedCanvasClicks;
|
|
123
|
+
/** previous frame pointer coords */
|
|
124
|
+
previousPointerMoveCoords: {
|
|
125
|
+
x: number;
|
|
126
|
+
y: number;
|
|
127
|
+
} | null;
|
|
93
128
|
lastViewportPosition: {
|
|
94
129
|
x: number;
|
|
95
130
|
y: number;
|
|
96
131
|
};
|
|
97
|
-
animationFrameHandler: AnimationFrameHandler;
|
|
98
132
|
laserTrails: LaserTrails;
|
|
99
133
|
eraserTrail: EraserTrail;
|
|
100
134
|
lassoTrail: LassoTrail;
|
|
@@ -112,11 +146,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
112
146
|
x: number;
|
|
113
147
|
y: number;
|
|
114
148
|
}>;
|
|
115
|
-
scrollbars:
|
|
116
|
-
isOverEither: boolean;
|
|
117
|
-
isOverHorizontal: boolean;
|
|
118
|
-
isOverVertical: boolean;
|
|
119
|
-
};
|
|
149
|
+
scrollbars: ReturnType<typeof isOverScrollBars>;
|
|
120
150
|
lastCoords: {
|
|
121
151
|
x: number;
|
|
122
152
|
y: number;
|
|
@@ -129,7 +159,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
129
159
|
x: number;
|
|
130
160
|
y: number;
|
|
131
161
|
};
|
|
132
|
-
arrowDirection: "
|
|
162
|
+
arrowDirection: "origin" | "end";
|
|
133
163
|
center: {
|
|
134
164
|
x: number;
|
|
135
165
|
y: number;
|
|
@@ -153,16 +183,13 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
153
183
|
x: number;
|
|
154
184
|
y: number;
|
|
155
185
|
};
|
|
186
|
+
blockDragging: boolean;
|
|
156
187
|
};
|
|
157
188
|
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;
|
|
189
|
+
onMove: null | ReturnType<typeof import("@excalidraw/common").throttleRAF>;
|
|
190
|
+
onUp: null | ((event: PointerEvent) => void);
|
|
191
|
+
onKeyDown: null | ((event: KeyboardEvent) => void);
|
|
192
|
+
onKeyUp: null | ((event: KeyboardEvent) => void);
|
|
166
193
|
};
|
|
167
194
|
boxSelection: {
|
|
168
195
|
hasOccurred: boolean;
|
|
@@ -181,11 +208,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
181
208
|
x: number;
|
|
182
209
|
y: number;
|
|
183
210
|
}>;
|
|
184
|
-
scrollbars:
|
|
185
|
-
isOverEither: boolean;
|
|
186
|
-
isOverHorizontal: boolean;
|
|
187
|
-
isOverVertical: boolean;
|
|
188
|
-
};
|
|
211
|
+
scrollbars: ReturnType<typeof isOverScrollBars>;
|
|
189
212
|
lastCoords: {
|
|
190
213
|
x: number;
|
|
191
214
|
y: number;
|
|
@@ -198,7 +221,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
198
221
|
x: number;
|
|
199
222
|
y: number;
|
|
200
223
|
};
|
|
201
|
-
arrowDirection: "
|
|
224
|
+
arrowDirection: "origin" | "end";
|
|
202
225
|
center: {
|
|
203
226
|
x: number;
|
|
204
227
|
y: number;
|
|
@@ -222,16 +245,13 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
222
245
|
x: number;
|
|
223
246
|
y: number;
|
|
224
247
|
};
|
|
248
|
+
blockDragging: boolean;
|
|
225
249
|
};
|
|
226
250
|
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;
|
|
251
|
+
onMove: null | ReturnType<typeof import("@excalidraw/common").throttleRAF>;
|
|
252
|
+
onUp: null | ((event: PointerEvent) => void);
|
|
253
|
+
onKeyDown: null | ((event: KeyboardEvent) => void);
|
|
254
|
+
onKeyUp: null | ((event: KeyboardEvent) => void);
|
|
235
255
|
};
|
|
236
256
|
boxSelection: {
|
|
237
257
|
hasOccurred: boolean;
|
|
@@ -243,17 +263,27 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
243
263
|
}>]>;
|
|
244
264
|
missingPointerEventCleanupEmitter: Emitter<[event: PointerEvent | null]>;
|
|
245
265
|
onRemoveEventListenersEmitter: Emitter<[]>;
|
|
266
|
+
api: ExcalidrawImperativeAPI;
|
|
267
|
+
private createExcalidrawAPI;
|
|
246
268
|
constructor(props: AppProps);
|
|
247
269
|
updateEditorAtom: <Value, Args extends unknown[], Result>(atom: WritableAtom<Value, Args, Result>, ...args: Args) => Result;
|
|
248
270
|
private onWindowMessage;
|
|
271
|
+
private handleSkipBindMode;
|
|
272
|
+
private resetDelayedBindMode;
|
|
273
|
+
private previousHoveredBindableElement;
|
|
274
|
+
private handleDelayedBindModeChange;
|
|
249
275
|
private cacheEmbeddableRef;
|
|
250
276
|
/**
|
|
251
277
|
* Returns gridSize taking into account `gridModeEnabled`.
|
|
252
278
|
* If disabled, returns null.
|
|
253
279
|
*/
|
|
254
280
|
getEffectiveGridSize: () => NullableGridSize;
|
|
281
|
+
private getTextCreationGridPoint;
|
|
255
282
|
private getHTMLIFrameElement;
|
|
256
|
-
private
|
|
283
|
+
private handleIframeLikeElementHover;
|
|
284
|
+
/** @returns true if iframe-like element click handled */
|
|
285
|
+
private handleIframeLikeCenterClick;
|
|
286
|
+
private isDoubleClick;
|
|
257
287
|
private isIframeLikeElementCenter;
|
|
258
288
|
private updateEmbedValidationStatus;
|
|
259
289
|
private updateEmbeddables;
|
|
@@ -266,7 +296,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
266
296
|
render(): import("react/jsx-runtime").JSX.Element;
|
|
267
297
|
focusContainer: AppClassProperties["focusContainer"];
|
|
268
298
|
getSceneElementsIncludingDeleted: () => readonly import("@excalidraw/element/types").OrderedExcalidrawElement[];
|
|
269
|
-
getSceneElementsMapIncludingDeleted: () =>
|
|
299
|
+
getSceneElementsMapIncludingDeleted: () => SceneElementsMap;
|
|
270
300
|
getSceneElements: () => readonly Ordered<NonDeletedExcalidrawElement>[];
|
|
271
301
|
onInsertElements: (elements: readonly ExcalidrawElement[]) => void;
|
|
272
302
|
onExportImage: (type: keyof typeof EXPORT_IMAGE_TYPES, elements: ExportedElements, opts: {
|
|
@@ -297,9 +327,11 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
297
327
|
*/
|
|
298
328
|
private resetScene;
|
|
299
329
|
private initializeScene;
|
|
300
|
-
private
|
|
301
|
-
|
|
302
|
-
private
|
|
330
|
+
private getFormFactor;
|
|
331
|
+
refreshEditorInterface: () => void;
|
|
332
|
+
private reconcileStylesPanelMode;
|
|
333
|
+
/** TO BE USED LATER */
|
|
334
|
+
private setDesktopUIMode;
|
|
303
335
|
private clearImageShapeCache;
|
|
304
336
|
componentDidMount(): Promise<void>;
|
|
305
337
|
componentWillUnmount(): void;
|
|
@@ -316,6 +348,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
316
348
|
private static resetTapTwice;
|
|
317
349
|
private onTouchStart;
|
|
318
350
|
private onTouchEnd;
|
|
351
|
+
private insertClipboardContent;
|
|
319
352
|
pasteFromClipboard: (event: ClipboardEvent) => Promise<void>;
|
|
320
353
|
addElementsFromPasteOrLibrary: (opts: {
|
|
321
354
|
elements: readonly ExcalidrawElement[];
|
|
@@ -326,26 +359,34 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
326
359
|
} | "cursor" | "center";
|
|
327
360
|
retainSeed?: boolean;
|
|
328
361
|
fitToContent?: boolean;
|
|
362
|
+
preserveFrameChildrenOrder?: boolean;
|
|
329
363
|
}) => void;
|
|
330
364
|
private addElementsFromMixedContentPaste;
|
|
331
365
|
private addTextFromPaste;
|
|
332
366
|
setAppState: React.Component<any, AppState>["setState"];
|
|
333
367
|
removePointer: (event: React.PointerEvent<HTMLElement> | PointerEvent) => void;
|
|
334
368
|
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;
|
|
369
|
+
updateFrameRendering: (opts: Partial<AppState["frameRendering"]> | ((prevState: AppState["frameRendering"]) => Partial<AppState["frameRendering"]>)) => void;
|
|
341
370
|
togglePenMode: (force: boolean | null) => void;
|
|
342
371
|
onHandToolToggle: () => void;
|
|
343
372
|
/**
|
|
344
373
|
* Zooms on canvas viewport center
|
|
345
374
|
*/
|
|
346
|
-
zoomCanvas: (
|
|
375
|
+
zoomCanvas: (
|
|
376
|
+
/**
|
|
377
|
+
* Decimal fraction, auto-clamped between MIN_ZOOM and MAX_ZOOM.
|
|
378
|
+
* 1 = 100% zoom, 2 = 200% zoom, 0.5 = 50% zoom
|
|
379
|
+
*/
|
|
380
|
+
value: number) => void;
|
|
347
381
|
private cancelInProgressAnimation;
|
|
348
|
-
scrollToContent: (
|
|
382
|
+
scrollToContent: (
|
|
383
|
+
/**
|
|
384
|
+
* target to scroll to
|
|
385
|
+
*
|
|
386
|
+
* - string - id of element or group, or url containing elementLink
|
|
387
|
+
* - ExcalidrawElement | ExcalidrawElement[] - element(s) objects
|
|
388
|
+
*/
|
|
389
|
+
target?: string | ExcalidrawElement | readonly ExcalidrawElement[], opts?: ({
|
|
349
390
|
fitToContent?: boolean;
|
|
350
391
|
fitToViewport?: never;
|
|
351
392
|
viewportZoomFactor?: number;
|
|
@@ -368,11 +409,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
368
409
|
private maybeUnfollowRemoteUser;
|
|
369
410
|
/** use when changing scrollX/scrollY/zoom based on user interaction */
|
|
370
411
|
private translateCanvas;
|
|
371
|
-
setToast: (toast:
|
|
372
|
-
message: string;
|
|
373
|
-
closable?: boolean;
|
|
374
|
-
duration?: number;
|
|
375
|
-
} | null) => void;
|
|
412
|
+
setToast: (toast: AppState["toast"]) => void;
|
|
376
413
|
restoreFileFromShare: () => Promise<void>;
|
|
377
414
|
/**
|
|
378
415
|
* adds supplied files to existing files in the appState.
|
|
@@ -382,7 +419,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
382
419
|
private addMissingFiles;
|
|
383
420
|
updateScene: <K extends keyof AppState>(sceneData: {
|
|
384
421
|
elements?: SceneData["elements"];
|
|
385
|
-
appState?: Pick<AppState, K> | null
|
|
422
|
+
appState?: Pick<AppState, K> | null;
|
|
386
423
|
collaborators?: SceneData["collaborators"];
|
|
387
424
|
/**
|
|
388
425
|
* 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,6 +434,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
397
434
|
*/
|
|
398
435
|
captureUpdate?: SceneData["captureUpdate"];
|
|
399
436
|
}) => void;
|
|
437
|
+
applyDeltas: (deltas: StoreDelta[], options?: ApplyToOptions) => [SceneElementsMap, AppState, boolean];
|
|
400
438
|
mutateElement: <TElement extends Mutable<ExcalidrawElement>>(element: TElement, updates: ElementUpdate<TElement>, informMutation?: boolean) => TElement;
|
|
401
439
|
private triggerRender;
|
|
402
440
|
/**
|
|
@@ -404,8 +442,8 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
404
442
|
*/
|
|
405
443
|
toggleSidebar: ({ name, tab, force, }: {
|
|
406
444
|
name: SidebarName | null;
|
|
407
|
-
tab?:
|
|
408
|
-
force?: boolean
|
|
445
|
+
tab?: SidebarTabName;
|
|
446
|
+
force?: boolean;
|
|
409
447
|
}) => boolean;
|
|
410
448
|
private updateCurrentCursorPosition;
|
|
411
449
|
getEditorUIOffsets: () => Offsets;
|
|
@@ -437,7 +475,11 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
437
475
|
private onGestureEnd;
|
|
438
476
|
private handleTextWysiwyg;
|
|
439
477
|
private deselectElements;
|
|
478
|
+
private getSelectedTextElement;
|
|
479
|
+
private getSelectedTextEditingContainerAtPosition;
|
|
440
480
|
private getTextElementAtPosition;
|
|
481
|
+
private isHittingTextAutoResizeHandle;
|
|
482
|
+
private handleTextAutoResizeHandlePointerDown;
|
|
441
483
|
private getElementAtPosition;
|
|
442
484
|
private getElementsAtPosition;
|
|
443
485
|
getElementHitThreshold(element: ExcalidrawElement): number;
|
|
@@ -446,10 +488,20 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
446
488
|
private startTextEditing;
|
|
447
489
|
private startImageCropping;
|
|
448
490
|
private finishImageCropping;
|
|
491
|
+
private shouldHandleBrowserCanvasDoubleClick;
|
|
449
492
|
private handleCanvasDoubleClick;
|
|
493
|
+
private handleCanvasClick;
|
|
450
494
|
private getElementLinkAtPosition;
|
|
451
|
-
private
|
|
495
|
+
private handleElementLinkClick;
|
|
496
|
+
/**
|
|
497
|
+
* finds candidate frame under cursor (when dragging frame children/elements
|
|
498
|
+
* inside frames)
|
|
499
|
+
*/
|
|
452
500
|
private getTopLayerFrameAtSceneCoords;
|
|
501
|
+
private updateFrameToHighlight;
|
|
502
|
+
private maybeUpdateFrameToHighlightOnPointerMove;
|
|
503
|
+
private insertNewElements;
|
|
504
|
+
private insertNewElement;
|
|
453
505
|
private handleCanvasPointerMove;
|
|
454
506
|
private handleEraser;
|
|
455
507
|
private handleTouchMove;
|
|
@@ -488,9 +540,10 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
488
540
|
sceneY: number;
|
|
489
541
|
link: string;
|
|
490
542
|
}) => NonDeleted<ExcalidrawEmbeddableElement> | undefined;
|
|
491
|
-
private
|
|
543
|
+
private newImagePlaceholder;
|
|
492
544
|
private handleLinearElementOnPointerDown;
|
|
493
545
|
private getCurrentItemRoundness;
|
|
546
|
+
private getCurrentItemStrokeWidth;
|
|
494
547
|
private createGenericElementOnPointerDown;
|
|
495
548
|
private createFrameElementOnPointerDown;
|
|
496
549
|
private maybeCacheReferenceSnapPoints;
|
|
@@ -509,11 +562,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
509
562
|
* and when you don't want to loose those modifications
|
|
510
563
|
*/
|
|
511
564
|
private getLatestInitializedImageElement;
|
|
512
|
-
|
|
513
|
-
* inserts image into elements array and rerenders
|
|
514
|
-
*/
|
|
515
|
-
private insertImageElement;
|
|
516
|
-
private onImageAction;
|
|
565
|
+
private onImageToolbarButtonClick;
|
|
517
566
|
private getImageNaturalDimensions;
|
|
518
567
|
/** updates image cache, refreshing updated elements and/or setting status
|
|
519
568
|
to error for images that fail during <img> element creation */
|
|
@@ -523,12 +572,11 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
523
572
|
/** generally you should use `addNewImagesToImageCache()` directly if you need
|
|
524
573
|
* to render new images. This is just a failsafe */
|
|
525
574
|
private scheduleImageRefresh;
|
|
526
|
-
private updateBindingEnabledOnPointerMove;
|
|
527
|
-
private maybeSuggestBindingAtCursor;
|
|
528
575
|
private clearSelection;
|
|
529
576
|
private handleInteractiveCanvasRef;
|
|
577
|
+
private insertImages;
|
|
530
578
|
private handleAppOnDrop;
|
|
531
|
-
loadFileToCanvas: (file: File, fileHandle:
|
|
579
|
+
loadFileToCanvas: (file: File, fileHandle: FileSystemFileHandle | null) => Promise<void>;
|
|
532
580
|
private handleCanvasContextMenu;
|
|
533
581
|
private maybeDragNewGenericElement;
|
|
534
582
|
private maybeHandleCrop;
|
|
@@ -541,6 +589,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
541
589
|
private updateDOMRect;
|
|
542
590
|
refresh: () => void;
|
|
543
591
|
private getCanvasOffsets;
|
|
592
|
+
watchState: () => void;
|
|
544
593
|
private updateLanguage;
|
|
545
594
|
}
|
|
546
595
|
declare global {
|
|
@@ -550,6 +599,7 @@ declare global {
|
|
|
550
599
|
elements: readonly ExcalidrawElement[];
|
|
551
600
|
state: AppState;
|
|
552
601
|
setState: React.Component<any, AppState>["setState"];
|
|
602
|
+
watchState: (prev: any, next: any) => void | undefined;
|
|
553
603
|
app: InstanceType<typeof App>;
|
|
554
604
|
history: History;
|
|
555
605
|
store: Store;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { AppState, UnsubscribeCallback } from "../types";
|
|
2
|
+
type StateChangeSelector = keyof AppState | (keyof AppState)[] | ((appState: AppState) => unknown);
|
|
3
|
+
export type OnStateChange = {
|
|
4
|
+
<K extends keyof AppState>(prop: K, callback: (value: AppState[K], appState: AppState) => void, opts?: {
|
|
5
|
+
once: boolean;
|
|
6
|
+
}): UnsubscribeCallback;
|
|
7
|
+
<K extends keyof AppState>(prop: K): Promise<AppState[K]>;
|
|
8
|
+
(prop: (keyof AppState)[], callback: (appState: AppState, appState2: AppState) => void, opts?: {
|
|
9
|
+
once: boolean;
|
|
10
|
+
}): UnsubscribeCallback;
|
|
11
|
+
(prop: (keyof AppState)[]): Promise<AppState>;
|
|
12
|
+
<T>(prop: (appState: AppState) => T, callback: (value: T, appState: AppState) => void, opts?: {
|
|
13
|
+
once: boolean;
|
|
14
|
+
}): UnsubscribeCallback;
|
|
15
|
+
<T>(prop: (appState: AppState) => T): Promise<T>;
|
|
16
|
+
(opts: {
|
|
17
|
+
predicate: (appState: AppState) => boolean;
|
|
18
|
+
callback: (appState: AppState) => void;
|
|
19
|
+
once?: boolean;
|
|
20
|
+
}): UnsubscribeCallback;
|
|
21
|
+
(opts: {
|
|
22
|
+
predicate: (appState: AppState) => boolean;
|
|
23
|
+
}): Promise<AppState>;
|
|
24
|
+
(selector: StateChangeSelector, callback: (value: any, appState: AppState) => void): any;
|
|
25
|
+
};
|
|
26
|
+
export declare class AppStateObserver {
|
|
27
|
+
private readonly getState;
|
|
28
|
+
private listeners;
|
|
29
|
+
constructor(getState: () => AppState);
|
|
30
|
+
private isStateChangePredicateOptions;
|
|
31
|
+
private subscribe;
|
|
32
|
+
private normalize;
|
|
33
|
+
onStateChange: OnStateChange;
|
|
34
|
+
flush(prevState: AppState): void;
|
|
35
|
+
clear(): void;
|
|
36
|
+
}
|
|
37
|
+
export {};
|