@wildmio/excalidraw-common 0.18.0-custom.1
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/README.md +19 -0
- package/dist/dev/index.js +2695 -0
- package/dist/dev/index.js.map +7 -0
- package/dist/prod/index.js +4 -0
- package/dist/types/common/src/binary-heap.d.ts +12 -0
- package/dist/types/common/src/bounds.d.ts +10 -0
- package/dist/types/common/src/colors.d.ts +62 -0
- package/dist/types/common/src/constants.d.ts +352 -0
- package/dist/types/common/src/editorInterface.d.ts +34 -0
- package/dist/types/common/src/emitter.d.ts +16 -0
- package/dist/types/common/src/font-metadata.d.ts +46 -0
- package/dist/types/common/src/index.d.ts +15 -0
- package/dist/types/common/src/keys.d.ts +189 -0
- package/dist/types/common/src/points.d.ts +9 -0
- package/dist/types/common/src/promise-pool.d.ts +6 -0
- package/dist/types/common/src/queue.d.ts +9 -0
- package/dist/types/common/src/random.d.ts +3 -0
- package/dist/types/common/src/url.d.ts +7 -0
- package/dist/types/common/src/utility-types.d.ts +37 -0
- package/dist/types/common/src/utils.d.ts +279 -0
- package/dist/types/common/src/visualdebug.d.ts +41 -0
- package/dist/types/element/src/Scene.d.ts +80 -0
- package/dist/types/element/src/align.d.ts +8 -0
- package/dist/types/element/src/binding.d.ts +124 -0
- package/dist/types/element/src/bounds.d.ts +81 -0
- package/dist/types/element/src/collision.d.ts +36 -0
- package/dist/types/element/src/comparisons.d.ts +8 -0
- package/dist/types/element/src/containerCache.d.ts +11 -0
- package/dist/types/element/src/cropElement.d.ts +19 -0
- package/dist/types/element/src/delta.d.ts +228 -0
- package/dist/types/element/src/distance.d.ts +3 -0
- package/dist/types/element/src/distribute.d.ts +7 -0
- package/dist/types/element/src/dragElements.d.ts +33 -0
- package/dist/types/element/src/duplicate.d.ts +63 -0
- package/dist/types/element/src/elbowArrow.d.ts +17 -0
- package/dist/types/element/src/elementLink.d.ts +13 -0
- package/dist/types/element/src/embeddable.d.ts +10 -0
- package/dist/types/element/src/flowchart.d.ts +26 -0
- package/dist/types/element/src/fractionalIndex.d.ts +57 -0
- package/dist/types/element/src/frame.d.ts +74 -0
- package/dist/types/element/src/groups.d.ts +34 -0
- package/dist/types/element/src/heading.d.ts +16 -0
- package/dist/types/element/src/image.d.ts +22 -0
- package/dist/types/element/src/index.d.ts +56 -0
- package/dist/types/element/src/linearElementEditor.d.ts +113 -0
- package/dist/types/element/src/mutateElement.d.ts +23 -0
- package/dist/types/element/src/newElement.d.ts +62 -0
- package/dist/types/element/src/positionElementsOnGrid.d.ts +2 -0
- package/dist/types/element/src/renderElement.d.ts +31 -0
- package/dist/types/element/src/resizeElements.d.ts +32 -0
- package/dist/types/element/src/resizeTest.d.ts +16 -0
- package/dist/types/element/src/selection.d.ts +34 -0
- package/dist/types/element/src/shape.d.ts +42 -0
- package/dist/types/element/src/showSelectedShapeActions.d.ts +3 -0
- package/dist/types/element/src/sizeHelpers.d.ts +35 -0
- package/dist/types/element/src/sortElements.d.ts +2 -0
- package/dist/types/element/src/store.d.ts +237 -0
- package/dist/types/element/src/textElement.d.ts +40 -0
- package/dist/types/element/src/textMeasurements.d.ts +39 -0
- package/dist/types/element/src/textWrapping.d.ts +13 -0
- package/dist/types/element/src/transform.d.ts +81 -0
- package/dist/types/element/src/transformHandles.d.ts +36 -0
- package/dist/types/element/src/typeChecks.d.ts +54 -0
- package/dist/types/element/src/types.d.ts +291 -0
- package/dist/types/element/src/utils.d.ts +34 -0
- package/dist/types/element/src/zindex.d.ts +13 -0
- package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +485 -0
- package/dist/types/excalidraw/actions/actionAlign.d.ts +109 -0
- package/dist/types/excalidraw/actions/actionBoundText.d.ts +360 -0
- package/dist/types/excalidraw/actions/actionCanvas.d.ts +2059 -0
- package/dist/types/excalidraw/actions/actionClipboard.d.ts +399 -0
- package/dist/types/excalidraw/actions/actionCropEditor.d.ts +174 -0
- package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +519 -0
- package/dist/types/excalidraw/actions/actionDistribute.d.ts +34 -0
- package/dist/types/excalidraw/actions/actionDuplicateSelection.d.ts +17 -0
- package/dist/types/excalidraw/actions/actionElementLink.d.ts +194 -0
- package/dist/types/excalidraw/actions/actionElementLock.d.ts +346 -0
- package/dist/types/excalidraw/actions/actionEmbeddable.d.ts +171 -0
- package/dist/types/excalidraw/actions/actionExport.d.ts +683 -0
- package/dist/types/excalidraw/actions/actionFinalize.d.ts +13 -0
- package/dist/types/excalidraw/actions/actionFlip.d.ts +34 -0
- package/dist/types/excalidraw/actions/actionFrame.d.ts +1150 -0
- package/dist/types/excalidraw/actions/actionGroup.d.ts +350 -0
- package/dist/types/excalidraw/actions/actionHistory.d.ts +6 -0
- package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +659 -0
- package/dist/types/excalidraw/actions/actionLink.d.ts +175 -0
- package/dist/types/excalidraw/actions/actionMenu.d.ts +163 -0
- package/dist/types/excalidraw/actions/actionNavigate.d.ts +20 -0
- package/dist/types/excalidraw/actions/actionProperties.d.ts +402 -0
- package/dist/types/excalidraw/actions/actionSelectAll.d.ts +170 -0
- package/dist/types/excalidraw/actions/actionStyles.d.ts +188 -0
- package/dist/types/excalidraw/actions/actionTextAutoResize.d.ts +17 -0
- package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +177 -0
- package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +175 -0
- package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +166 -0
- package/dist/types/excalidraw/actions/actionToggleShapeSwitch.d.ts +19 -0
- package/dist/types/excalidraw/actions/actionToggleStats.d.ts +174 -0
- package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +175 -0
- package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +175 -0
- package/dist/types/excalidraw/actions/actionZindex.d.ts +74 -0
- package/dist/types/excalidraw/actions/index.d.ts +28 -0
- package/dist/types/excalidraw/actions/manager.d.ts +21 -0
- package/dist/types/excalidraw/actions/register.d.ts +5 -0
- package/dist/types/excalidraw/actions/shortcuts.d.ts +4 -0
- package/dist/types/excalidraw/actions/types.d.ts +47 -0
- package/dist/types/excalidraw/analytics.d.ts +1 -0
- package/dist/types/excalidraw/animated-trail.d.ts +39 -0
- package/dist/types/excalidraw/animation-frame-handler.d.ts +16 -0
- package/dist/types/excalidraw/appState.d.ts +102 -0
- package/dist/types/excalidraw/charts.d.ts +27 -0
- package/dist/types/excalidraw/clients.d.ts +14 -0
- package/dist/types/excalidraw/clipboard.d.ts +105 -0
- package/dist/types/excalidraw/components/Actions.d.ts +47 -0
- package/dist/types/excalidraw/components/ActiveConfirmDialog.d.ts +4 -0
- package/dist/types/excalidraw/components/App.d.ts +563 -0
- package/dist/types/excalidraw/components/Avatar.d.ts +11 -0
- package/dist/types/excalidraw/components/BraveMeasureTextError.d.ts +2 -0
- package/dist/types/excalidraw/components/Button.d.ts +17 -0
- package/dist/types/excalidraw/components/ButtonIcon.d.ts +16 -0
- package/dist/types/excalidraw/components/ButtonSeparator.d.ts +1 -0
- package/dist/types/excalidraw/components/Card.d.ts +6 -0
- package/dist/types/excalidraw/components/CheckboxItem.d.ts +8 -0
- package/dist/types/excalidraw/components/ColorPicker/ColorInput.d.ts +10 -0
- package/dist/types/excalidraw/components/ColorPicker/ColorPicker.d.ts +23 -0
- package/dist/types/excalidraw/components/ColorPicker/CustomColorList.d.ts +8 -0
- package/dist/types/excalidraw/components/ColorPicker/HotkeyLabel.d.ts +7 -0
- package/dist/types/excalidraw/components/ColorPicker/Picker.d.ts +19 -0
- package/dist/types/excalidraw/components/ColorPicker/PickerColorList.d.ts +10 -0
- package/dist/types/excalidraw/components/ColorPicker/PickerHeading.d.ts +5 -0
- package/dist/types/excalidraw/components/ColorPicker/ShadeList.d.ts +9 -0
- package/dist/types/excalidraw/components/ColorPicker/TopPicks.d.ts +9 -0
- package/dist/types/excalidraw/components/ColorPicker/colorPickerUtils.d.ts +21 -0
- package/dist/types/excalidraw/components/ColorPicker/keyboardNavHandlers.d.ts +20 -0
- package/dist/types/excalidraw/components/CommandPalette/CommandPalette.d.ts +19 -0
- package/dist/types/excalidraw/components/CommandPalette/defaultCommandPaletteItems.d.ts +2 -0
- package/dist/types/excalidraw/components/CommandPalette/types.d.ts +24 -0
- package/dist/types/excalidraw/components/ConfirmDialog.d.ts +10 -0
- package/dist/types/excalidraw/components/ContextMenu.d.ts +16 -0
- package/dist/types/excalidraw/components/ConvertElementTypePopup.d.ts +23 -0
- package/dist/types/excalidraw/components/DarkModeToggle.d.ts +7 -0
- package/dist/types/excalidraw/components/DefaultSidebar.d.ts +27 -0
- package/dist/types/excalidraw/components/DiagramToCodePlugin/DiagramToCodePlugin.d.ts +4 -0
- package/dist/types/excalidraw/components/Dialog.d.ts +13 -0
- package/dist/types/excalidraw/components/DialogActionButton.d.ts +10 -0
- package/dist/types/excalidraw/components/ElementCanvasButtons.d.ts +7 -0
- package/dist/types/excalidraw/components/ElementLinkDialog.d.ts +12 -0
- package/dist/types/excalidraw/components/Ellipsify.d.ts +3 -0
- package/dist/types/excalidraw/components/ErrorDialog.d.ts +5 -0
- package/dist/types/excalidraw/components/ExcalidrawLogo.d.ts +15 -0
- package/dist/types/excalidraw/components/EyeButton.d.ts +8 -0
- package/dist/types/excalidraw/components/EyeDropper.d.ts +27 -0
- package/dist/types/excalidraw/components/FilledButton.d.ts +18 -0
- package/dist/types/excalidraw/components/FixedSideContainer.d.ts +9 -0
- package/dist/types/excalidraw/components/FollowMode/FollowMode.d.ts +10 -0
- package/dist/types/excalidraw/components/FontPicker/FontPicker.d.ts +22 -0
- package/dist/types/excalidraw/components/FontPicker/FontPickerList.d.ts +26 -0
- package/dist/types/excalidraw/components/FontPicker/FontPickerTrigger.d.ts +8 -0
- package/dist/types/excalidraw/components/FontPicker/keyboardNavHandlers.d.ts +13 -0
- package/dist/types/excalidraw/components/HandButton.d.ts +10 -0
- package/dist/types/excalidraw/components/HelpButton.d.ts +7 -0
- package/dist/types/excalidraw/components/HelpDialog.d.ts +4 -0
- package/dist/types/excalidraw/components/HintViewer.d.ts +11 -0
- package/dist/types/excalidraw/components/IconPicker.d.ts +15 -0
- package/dist/types/excalidraw/components/ImageExportDialog.d.ts +14 -0
- package/dist/types/excalidraw/components/InitializeApp.d.ts +10 -0
- package/dist/types/excalidraw/components/InlineIcon.d.ts +5 -0
- package/dist/types/excalidraw/components/Island.d.ts +10 -0
- package/dist/types/excalidraw/components/JSONExportDialog.d.ts +15 -0
- package/dist/types/excalidraw/components/LaserPointerButton.d.ts +10 -0
- package/dist/types/excalidraw/components/LayerUI.d.ts +32 -0
- package/dist/types/excalidraw/components/LibraryMenu.d.ts +10 -0
- package/dist/types/excalidraw/components/LibraryMenuBrowseButton.d.ts +7 -0
- package/dist/types/excalidraw/components/LibraryMenuControlButtons.d.ts +9 -0
- package/dist/types/excalidraw/components/LibraryMenuHeaderContent.d.ts +17 -0
- package/dist/types/excalidraw/components/LibraryMenuItems.d.ts +14 -0
- package/dist/types/excalidraw/components/LibraryMenuSection.d.ts +23 -0
- package/dist/types/excalidraw/components/LibraryUnit.d.ts +14 -0
- package/dist/types/excalidraw/components/LoadingMessage.d.ts +5 -0
- package/dist/types/excalidraw/components/LockButton.d.ts +10 -0
- package/dist/types/excalidraw/components/MagicButton.d.ts +10 -0
- package/dist/types/excalidraw/components/MobileMenu.d.ts +24 -0
- package/dist/types/excalidraw/components/MobileToolBar.d.ts +10 -0
- package/dist/types/excalidraw/components/Modal.d.ts +11 -0
- package/dist/types/excalidraw/components/OverwriteConfirm/OverwriteConfirm.d.ts +17 -0
- package/dist/types/excalidraw/components/OverwriteConfirm/OverwriteConfirmActions.d.ts +17 -0
- package/dist/types/excalidraw/components/OverwriteConfirm/OverwriteConfirmState.d.ts +22 -0
- package/dist/types/excalidraw/components/PasteChartDialog.d.ts +8 -0
- package/dist/types/excalidraw/components/PenModeButton.d.ts +12 -0
- package/dist/types/excalidraw/components/Popover.d.ts +16 -0
- package/dist/types/excalidraw/components/ProjectName.d.ts +10 -0
- package/dist/types/excalidraw/components/PropertiesPopover.d.ts +16 -0
- package/dist/types/excalidraw/components/PublishLibrary.d.ts +16 -0
- package/dist/types/excalidraw/components/QuickSearch.d.ts +9 -0
- package/dist/types/excalidraw/components/RadioGroup.d.ts +13 -0
- package/dist/types/excalidraw/components/RadioSelection.d.ts +20 -0
- package/dist/types/excalidraw/components/Range.d.ts +8 -0
- package/dist/types/excalidraw/components/SVGLayer.d.ts +7 -0
- package/dist/types/excalidraw/components/ScrollableList.d.ts +8 -0
- package/dist/types/excalidraw/components/SearchMenu.d.ts +5 -0
- package/dist/types/excalidraw/components/Section.d.ts +6 -0
- package/dist/types/excalidraw/components/Sidebar/Sidebar.d.ts +70 -0
- package/dist/types/excalidraw/components/Sidebar/SidebarHeader.d.ts +7 -0
- package/dist/types/excalidraw/components/Sidebar/SidebarTab.d.ts +8 -0
- package/dist/types/excalidraw/components/Sidebar/SidebarTabTrigger.d.ts +9 -0
- package/dist/types/excalidraw/components/Sidebar/SidebarTabTriggers.d.ts +6 -0
- package/dist/types/excalidraw/components/Sidebar/SidebarTabs.d.ts +6 -0
- package/dist/types/excalidraw/components/Sidebar/SidebarTrigger.d.ts +6 -0
- package/dist/types/excalidraw/components/Sidebar/common.d.ts +34 -0
- package/dist/types/excalidraw/components/Spinner.d.ts +8 -0
- package/dist/types/excalidraw/components/Stack.d.ts +15 -0
- package/dist/types/excalidraw/components/Stats/Angle.d.ts +11 -0
- package/dist/types/excalidraw/components/Stats/CanvasGrid.d.ts +10 -0
- package/dist/types/excalidraw/components/Stats/Collapsible.d.ts +10 -0
- package/dist/types/excalidraw/components/Stats/Dimension.d.ts +11 -0
- package/dist/types/excalidraw/components/Stats/DragInput.d.ts +44 -0
- package/dist/types/excalidraw/components/Stats/FontSize.d.ts +11 -0
- package/dist/types/excalidraw/components/Stats/MultiAngle.d.ts +11 -0
- package/dist/types/excalidraw/components/Stats/MultiDimension.d.ts +14 -0
- package/dist/types/excalidraw/components/Stats/MultiFontSize.d.ts +12 -0
- package/dist/types/excalidraw/components/Stats/MultiPosition.d.ts +14 -0
- package/dist/types/excalidraw/components/Stats/Position.d.ts +12 -0
- package/dist/types/excalidraw/components/Stats/index.d.ts +35 -0
- package/dist/types/excalidraw/components/Stats/utils.d.ts +19 -0
- package/dist/types/excalidraw/components/Switch.d.ts +9 -0
- package/dist/types/excalidraw/components/TTDDialog/MermaidToExcalidraw.d.ts +6 -0
- package/dist/types/excalidraw/components/TTDDialog/TTDDialog.d.ts +29 -0
- package/dist/types/excalidraw/components/TTDDialog/TTDDialogInput.d.ts +9 -0
- package/dist/types/excalidraw/components/TTDDialog/TTDDialogOutput.d.ts +7 -0
- package/dist/types/excalidraw/components/TTDDialog/TTDDialogPanel.d.ts +17 -0
- package/dist/types/excalidraw/components/TTDDialog/TTDDialogPanels.d.ts +4 -0
- package/dist/types/excalidraw/components/TTDDialog/TTDDialogSubmitShortcut.d.ts +1 -0
- package/dist/types/excalidraw/components/TTDDialog/TTDDialogTab.d.ts +7 -0
- package/dist/types/excalidraw/components/TTDDialog/TTDDialogTabTrigger.d.ts +8 -0
- package/dist/types/excalidraw/components/TTDDialog/TTDDialogTabTriggers.d.ts +6 -0
- package/dist/types/excalidraw/components/TTDDialog/TTDDialogTabs.d.ts +11 -0
- package/dist/types/excalidraw/components/TTDDialog/TTDDialogTrigger.d.ts +8 -0
- package/dist/types/excalidraw/components/TTDDialog/common.d.ts +32 -0
- package/dist/types/excalidraw/components/TextField.d.ts +22 -0
- package/dist/types/excalidraw/components/Toast.d.ts +9 -0
- package/dist/types/excalidraw/components/ToolButton.d.ts +49 -0
- package/dist/types/excalidraw/components/ToolPopover.d.ts +25 -0
- package/dist/types/excalidraw/components/Tooltip.d.ts +18 -0
- package/dist/types/excalidraw/components/Trans.d.ts +9 -0
- package/dist/types/excalidraw/components/UnlockPopup.d.ts +8 -0
- package/dist/types/excalidraw/components/UserList.d.ts +18 -0
- package/dist/types/excalidraw/components/canvases/InteractiveCanvas.d.ts +33 -0
- package/dist/types/excalidraw/components/canvases/NewElementCanvas.d.ts +14 -0
- package/dist/types/excalidraw/components/canvases/StaticCanvas.d.ts +19 -0
- package/dist/types/excalidraw/components/canvases/index.d.ts +3 -0
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenu.d.ts +84 -0
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuContent.d.ts +16 -0
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuGroup.d.ts +11 -0
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItem.d.ts +38 -0
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemContent.d.ts +8 -0
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemContentRadio.d.ts +17 -0
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemCustom.d.ts +7 -0
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemLink.d.ts +16 -0
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuSeparator.d.ts +5 -0
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuTrigger.d.ts +10 -0
- package/dist/types/excalidraw/components/dropdownMenu/common.d.ts +6 -0
- package/dist/types/excalidraw/components/dropdownMenu/dropdownMenuUtils.d.ts +3 -0
- package/dist/types/excalidraw/components/footer/Footer.d.ts +17 -0
- package/dist/types/excalidraw/components/footer/FooterCenter.d.ts +8 -0
- package/dist/types/excalidraw/components/hoc/withInternalFallback.d.ts +4 -0
- package/dist/types/excalidraw/components/hyperlink/Hyperlink.d.ts +19 -0
- package/dist/types/excalidraw/components/hyperlink/helpers.d.ts +10 -0
- package/dist/types/excalidraw/components/icons.d.ts +237 -0
- package/dist/types/excalidraw/components/live-collaboration/LiveCollaborationTrigger.d.ts +11 -0
- package/dist/types/excalidraw/components/main-menu/DefaultItems.d.ts +64 -0
- package/dist/types/excalidraw/components/main-menu/MainMenu.d.ts +76 -0
- package/dist/types/excalidraw/components/shapes.d.ts +190 -0
- package/dist/types/excalidraw/components/welcome-screen/WelcomeScreen.Center.d.ts +58 -0
- package/dist/types/excalidraw/components/welcome-screen/WelcomeScreen.Hints.d.ts +19 -0
- package/dist/types/excalidraw/components/welcome-screen/WelcomeScreen.d.ts +84 -0
- package/dist/types/excalidraw/context/tunnels.d.ts +21 -0
- package/dist/types/excalidraw/context/ui-appState.d.ts +4 -0
- package/dist/types/excalidraw/cursor.d.ts +5 -0
- package/dist/types/excalidraw/data/EditorLocalStorage.d.ts +8 -0
- package/dist/types/excalidraw/data/blob.d.ts +57 -0
- package/dist/types/excalidraw/data/encode.d.ts +55 -0
- package/dist/types/excalidraw/data/encryption.d.ts +9 -0
- package/dist/types/excalidraw/data/filesystem.d.ts +21 -0
- package/dist/types/excalidraw/data/image.d.ts +9 -0
- package/dist/types/excalidraw/data/index.d.ts +22 -0
- package/dist/types/excalidraw/data/json.d.ts +18 -0
- package/dist/types/excalidraw/data/library.d.ts +127 -0
- package/dist/types/excalidraw/data/reconcile.d.ts +7 -0
- package/dist/types/excalidraw/data/resave.d.ts +5 -0
- package/dist/types/excalidraw/data/restore.d.ts +35 -0
- package/dist/types/excalidraw/data/types.d.ts +48 -0
- package/dist/types/excalidraw/deburr.d.ts +1 -0
- package/dist/types/excalidraw/editor-jotai.d.ts +56 -0
- package/dist/types/excalidraw/eraser/index.d.ts +12 -0
- package/dist/types/excalidraw/errors.d.ts +29 -0
- package/dist/types/excalidraw/fonts/Cascadia/index.d.ts +2 -0
- package/dist/types/excalidraw/fonts/ComicShanns/index.d.ts +2 -0
- package/dist/types/excalidraw/fonts/Emoji/index.d.ts +2 -0
- package/dist/types/excalidraw/fonts/ExcalidrawFontFace.d.ts +25 -0
- package/dist/types/excalidraw/fonts/Excalifont/index.d.ts +2 -0
- package/dist/types/excalidraw/fonts/Fonts.d.ts +79 -0
- package/dist/types/excalidraw/fonts/Helvetica/index.d.ts +2 -0
- package/dist/types/excalidraw/fonts/Liberation/index.d.ts +2 -0
- package/dist/types/excalidraw/fonts/Lilita/index.d.ts +2 -0
- package/dist/types/excalidraw/fonts/Nunito/index.d.ts +2 -0
- package/dist/types/excalidraw/fonts/Virgil/index.d.ts +2 -0
- package/dist/types/excalidraw/fonts/Xiaolai/index.d.ts +8 -0
- package/dist/types/excalidraw/fonts/index.d.ts +1 -0
- package/dist/types/excalidraw/gesture.d.ts +6 -0
- package/dist/types/excalidraw/history.d.ts +48 -0
- package/dist/types/excalidraw/hooks/useCallbackRefState.d.ts +1 -0
- package/dist/types/excalidraw/hooks/useCopiedIndicator.d.ts +5 -0
- package/dist/types/excalidraw/hooks/useCreatePortalContainer.d.ts +4 -0
- package/dist/types/excalidraw/hooks/useEmitter.d.ts +2 -0
- package/dist/types/excalidraw/hooks/useLibraryItemSvg.d.ts +11 -0
- package/dist/types/excalidraw/hooks/useOutsideClick.d.ts +21 -0
- package/dist/types/excalidraw/hooks/useScrollPosition.d.ts +1 -0
- package/dist/types/excalidraw/hooks/useStable.d.ts +1 -0
- package/dist/types/excalidraw/hooks/useStableCallback.d.ts +4 -0
- package/dist/types/excalidraw/hooks/useTextEditorFocus.d.ts +14 -0
- package/dist/types/excalidraw/hooks/useTransition.d.ts +2 -0
- package/dist/types/excalidraw/i18n.d.ts +24 -0
- package/dist/types/excalidraw/index.d.ts +45 -0
- package/dist/types/excalidraw/laser-trails.d.ts +20 -0
- package/dist/types/excalidraw/lasso/index.d.ts +16 -0
- package/dist/types/excalidraw/lasso/utils.d.ts +13 -0
- package/dist/types/excalidraw/mermaid.d.ts +2 -0
- package/dist/types/excalidraw/polyfill.d.ts +2 -0
- package/dist/types/excalidraw/reactUtils.d.ts +14 -0
- package/dist/types/excalidraw/renderer/animation.d.ts +12 -0
- package/dist/types/excalidraw/renderer/helpers.d.ts +16 -0
- package/dist/types/excalidraw/renderer/interactiveScene.d.ts +14 -0
- package/dist/types/excalidraw/renderer/renderNewElementScene.d.ts +7 -0
- package/dist/types/excalidraw/renderer/renderSnaps.d.ts +2 -0
- package/dist/types/excalidraw/renderer/roundRect.d.ts +11 -0
- package/dist/types/excalidraw/renderer/staticScene.d.ts +14 -0
- package/dist/types/excalidraw/renderer/staticSvgScene.d.ts +5 -0
- package/dist/types/excalidraw/scene/Renderer.d.ts +30 -0
- package/dist/types/excalidraw/scene/export.d.ts +36 -0
- package/dist/types/excalidraw/scene/index.d.ts +4 -0
- package/dist/types/excalidraw/scene/normalize.d.ts +4 -0
- package/dist/types/excalidraw/scene/scroll.d.ts +18 -0
- package/dist/types/excalidraw/scene/scrollbars.d.ts +11 -0
- package/dist/types/excalidraw/scene/types.d.ts +132 -0
- package/dist/types/excalidraw/scene/zoom.d.ts +12 -0
- package/dist/types/excalidraw/shortcut.d.ts +1 -0
- package/dist/types/excalidraw/snapping.d.ts +111 -0
- package/dist/types/excalidraw/subset/harfbuzz/harfbuzz-bindings.d.ts +45 -0
- package/dist/types/excalidraw/subset/harfbuzz/harfbuzz-loader.d.ts +13 -0
- package/dist/types/excalidraw/subset/harfbuzz/harfbuzz-wasm.d.ts +2 -0
- package/dist/types/excalidraw/subset/subset-main.d.ts +12 -0
- package/dist/types/excalidraw/subset/subset-shared.chunk.d.ts +32 -0
- package/dist/types/excalidraw/subset/subset-worker.chunk.d.ts +15 -0
- package/dist/types/excalidraw/subset/woff2/woff2-bindings.d.ts +31 -0
- package/dist/types/excalidraw/subset/woff2/woff2-loader.d.ts +14 -0
- package/dist/types/excalidraw/subset/woff2/woff2-wasm.d.ts +2 -0
- package/dist/types/excalidraw/types.d.ts +744 -0
- package/dist/types/excalidraw/workers.d.ts +36 -0
- package/dist/types/excalidraw/wysiwyg/textWysiwyg.d.ts +24 -0
- package/dist/types/math/src/angle.d.ts +19 -0
- package/dist/types/math/src/constants.d.ts +3 -0
- package/dist/types/math/src/curve.d.ts +74 -0
- package/dist/types/math/src/ellipse.d.ts +44 -0
- package/dist/types/math/src/index.d.ts +13 -0
- package/dist/types/math/src/line.d.ts +17 -0
- package/dist/types/math/src/point.d.ts +122 -0
- package/dist/types/math/src/polygon.d.ts +6 -0
- package/dist/types/math/src/range.d.ts +44 -0
- package/dist/types/math/src/rectangle.d.ts +5 -0
- package/dist/types/math/src/segment.d.ts +40 -0
- package/dist/types/math/src/triangle.d.ts +11 -0
- package/dist/types/math/src/types.d.ts +106 -0
- package/dist/types/math/src/utils.d.ts +7 -0
- package/dist/types/math/src/vector.d.ts +94 -0
- package/dist/types/utils/src/bbox.d.ts +9 -0
- package/dist/types/utils/src/export.d.ts +35 -0
- package/dist/types/utils/src/index.d.ts +4 -0
- package/dist/types/utils/src/shape.d.ts +58 -0
- package/dist/types/utils/src/withinBounds.d.ts +19 -0
- package/package.json +59 -0
|
@@ -0,0 +1,563 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { 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
|
+
import type { Mutable } from "@excalidraw/common/utility-types";
|
|
6
|
+
import { ActionManager } from "../actions/manager";
|
|
7
|
+
import { AnimationFrameHandler } from "../animation-frame-handler";
|
|
8
|
+
import { History } from "../history";
|
|
9
|
+
import { Fonts } from "../fonts";
|
|
10
|
+
import { type WritableAtom } from "../editor-jotai";
|
|
11
|
+
import { Renderer } from "../scene/Renderer";
|
|
12
|
+
import { LaserTrails } from "../laser-trails";
|
|
13
|
+
import { isOverScrollBars } from "../scene/scrollbars";
|
|
14
|
+
import { LassoTrail } from "../lasso";
|
|
15
|
+
import { EraserTrail } from "../eraser";
|
|
16
|
+
import type { ExportedElements } from "../data";
|
|
17
|
+
import type { FileSystemHandle } from "../data/filesystem";
|
|
18
|
+
import type { AppClassProperties, AppProps, AppState, ExcalidrawImperativeAPI, BinaryFiles, LibraryItems, SceneData, FrameNameBoundsCache, SidebarName, SidebarTabName, ToolType, OnUserFollowedPayload, GenerateDiagramToCode, NullableGridSize, Offsets } from "../types";
|
|
19
|
+
import type { RoughCanvas } from "roughjs/bin/canvas";
|
|
20
|
+
import type { ActionResult } from "../actions/types";
|
|
21
|
+
export declare const ExcalidrawContainerContext: React.Context<{
|
|
22
|
+
container: HTMLDivElement | null;
|
|
23
|
+
id: string | null;
|
|
24
|
+
}>;
|
|
25
|
+
export declare const useApp: () => AppClassProperties;
|
|
26
|
+
export declare const useAppProps: () => AppProps;
|
|
27
|
+
export declare const useEditorInterface: () => Readonly<{
|
|
28
|
+
formFactor: "phone" | "tablet" | "desktop";
|
|
29
|
+
desktopUIMode: "compact" | "full";
|
|
30
|
+
userAgent: Readonly<{
|
|
31
|
+
isMobileDevice: boolean;
|
|
32
|
+
platform: "ios" | "android" | "other" | "unknown";
|
|
33
|
+
}>;
|
|
34
|
+
isTouchScreen: boolean;
|
|
35
|
+
canFitSidebar: boolean;
|
|
36
|
+
isLandscape: boolean;
|
|
37
|
+
}>;
|
|
38
|
+
export declare const useStylesPanelMode: () => StylesPanelMode;
|
|
39
|
+
export declare const useExcalidrawContainer: () => {
|
|
40
|
+
container: HTMLDivElement | null;
|
|
41
|
+
id: string | null;
|
|
42
|
+
};
|
|
43
|
+
export declare const useExcalidrawElements: () => readonly NonDeletedExcalidrawElement[];
|
|
44
|
+
export declare const useExcalidrawAppState: () => AppState;
|
|
45
|
+
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;
|
|
46
|
+
export declare const useExcalidrawActionManager: () => ActionManager;
|
|
47
|
+
declare class App extends React.Component<AppProps, AppState> {
|
|
48
|
+
canvas: AppClassProperties["canvas"];
|
|
49
|
+
interactiveCanvas: AppClassProperties["interactiveCanvas"];
|
|
50
|
+
rc: RoughCanvas;
|
|
51
|
+
unmounted: boolean;
|
|
52
|
+
actionManager: ActionManager;
|
|
53
|
+
editorInterface: EditorInterface;
|
|
54
|
+
private stylesPanelMode;
|
|
55
|
+
private excalidrawContainerRef;
|
|
56
|
+
scene: Scene;
|
|
57
|
+
fonts: Fonts;
|
|
58
|
+
renderer: Renderer;
|
|
59
|
+
visibleElements: readonly NonDeletedExcalidrawElement[];
|
|
60
|
+
private resizeObserver;
|
|
61
|
+
library: AppClassProperties["library"];
|
|
62
|
+
libraryItemsFromStorage: LibraryItems | undefined;
|
|
63
|
+
id: string;
|
|
64
|
+
private store;
|
|
65
|
+
private history;
|
|
66
|
+
excalidrawContainerValue: {
|
|
67
|
+
container: HTMLDivElement | null;
|
|
68
|
+
id: string;
|
|
69
|
+
};
|
|
70
|
+
files: BinaryFiles;
|
|
71
|
+
imageCache: AppClassProperties["imageCache"];
|
|
72
|
+
private iFrameRefs;
|
|
73
|
+
/**
|
|
74
|
+
* Indicates whether the embeddable's url has been validated for rendering.
|
|
75
|
+
* If value not set, indicates that the validation is pending.
|
|
76
|
+
* Initially or on url change the flag is not reset so that we can guarantee
|
|
77
|
+
* the validation came from a trusted source (the editor).
|
|
78
|
+
**/
|
|
79
|
+
private embedsValidationStatus;
|
|
80
|
+
/** embeds that have been inserted to DOM (as a perf optim, we don't want to
|
|
81
|
+
* insert to DOM before user initially scrolls to them) */
|
|
82
|
+
private initializedEmbeds;
|
|
83
|
+
private handleToastClose;
|
|
84
|
+
private elementsPendingErasure;
|
|
85
|
+
flowChartCreator: FlowChartCreator;
|
|
86
|
+
private flowChartNavigator;
|
|
87
|
+
bindModeHandler: ReturnType<typeof setTimeout> | null;
|
|
88
|
+
hitLinkElement?: NonDeletedExcalidrawElement;
|
|
89
|
+
lastPointerDownEvent: React.PointerEvent<HTMLElement> | null;
|
|
90
|
+
lastPointerUpEvent: React.PointerEvent<HTMLElement> | PointerEvent | null;
|
|
91
|
+
lastPointerMoveEvent: PointerEvent | null;
|
|
92
|
+
lastPointerMoveCoords: {
|
|
93
|
+
x: number;
|
|
94
|
+
y: number;
|
|
95
|
+
} | null;
|
|
96
|
+
lastViewportPosition: {
|
|
97
|
+
x: number;
|
|
98
|
+
y: number;
|
|
99
|
+
};
|
|
100
|
+
animationFrameHandler: AnimationFrameHandler;
|
|
101
|
+
laserTrails: LaserTrails;
|
|
102
|
+
eraserTrail: EraserTrail;
|
|
103
|
+
lassoTrail: LassoTrail;
|
|
104
|
+
onChangeEmitter: Emitter<[elements: readonly ExcalidrawElement[], appState: AppState, files: BinaryFiles]>;
|
|
105
|
+
onPointerDownEmitter: Emitter<[activeTool: {
|
|
106
|
+
lastActiveTool: import("../types").ActiveTool | null;
|
|
107
|
+
locked: boolean;
|
|
108
|
+
fromSelection: boolean;
|
|
109
|
+
} & import("../types").ActiveTool, pointerDownState: Readonly<{
|
|
110
|
+
origin: Readonly<{
|
|
111
|
+
x: number;
|
|
112
|
+
y: number;
|
|
113
|
+
}>;
|
|
114
|
+
originInGrid: Readonly<{
|
|
115
|
+
x: number;
|
|
116
|
+
y: number;
|
|
117
|
+
}>;
|
|
118
|
+
scrollbars: ReturnType<typeof isOverScrollBars>;
|
|
119
|
+
lastCoords: {
|
|
120
|
+
x: number;
|
|
121
|
+
y: number;
|
|
122
|
+
};
|
|
123
|
+
originalElements: Map<string, NonDeleted<ExcalidrawElement>>;
|
|
124
|
+
resize: {
|
|
125
|
+
handleType: import("@excalidraw/element").MaybeTransformHandleType;
|
|
126
|
+
isResizing: boolean;
|
|
127
|
+
offset: {
|
|
128
|
+
x: number;
|
|
129
|
+
y: number;
|
|
130
|
+
};
|
|
131
|
+
arrowDirection: "origin" | "end";
|
|
132
|
+
center: {
|
|
133
|
+
x: number;
|
|
134
|
+
y: number;
|
|
135
|
+
};
|
|
136
|
+
};
|
|
137
|
+
hit: {
|
|
138
|
+
element: NonDeleted<ExcalidrawElement> | null;
|
|
139
|
+
allHitElements: NonDeleted<ExcalidrawElement>[];
|
|
140
|
+
wasAddedToSelection: boolean;
|
|
141
|
+
hasBeenDuplicated: boolean;
|
|
142
|
+
hasHitCommonBoundingBoxOfSelectedElements: boolean;
|
|
143
|
+
};
|
|
144
|
+
withCmdOrCtrl: boolean;
|
|
145
|
+
drag: {
|
|
146
|
+
hasOccurred: boolean;
|
|
147
|
+
offset: {
|
|
148
|
+
x: number;
|
|
149
|
+
y: number;
|
|
150
|
+
} | null;
|
|
151
|
+
origin: {
|
|
152
|
+
x: number;
|
|
153
|
+
y: number;
|
|
154
|
+
};
|
|
155
|
+
blockDragging: boolean;
|
|
156
|
+
};
|
|
157
|
+
eventListeners: {
|
|
158
|
+
onMove: null | ReturnType<typeof import("@excalidraw/common").throttleRAF>;
|
|
159
|
+
onUp: null | ((event: PointerEvent) => void);
|
|
160
|
+
onKeyDown: null | ((event: KeyboardEvent) => void);
|
|
161
|
+
onKeyUp: null | ((event: KeyboardEvent) => void);
|
|
162
|
+
};
|
|
163
|
+
boxSelection: {
|
|
164
|
+
hasOccurred: boolean;
|
|
165
|
+
};
|
|
166
|
+
}>, event: React.PointerEvent<HTMLElement>]>;
|
|
167
|
+
onPointerUpEmitter: Emitter<[activeTool: {
|
|
168
|
+
lastActiveTool: import("../types").ActiveTool | null;
|
|
169
|
+
locked: boolean;
|
|
170
|
+
fromSelection: boolean;
|
|
171
|
+
} & import("../types").ActiveTool, pointerDownState: Readonly<{
|
|
172
|
+
origin: Readonly<{
|
|
173
|
+
x: number;
|
|
174
|
+
y: number;
|
|
175
|
+
}>;
|
|
176
|
+
originInGrid: Readonly<{
|
|
177
|
+
x: number;
|
|
178
|
+
y: number;
|
|
179
|
+
}>;
|
|
180
|
+
scrollbars: ReturnType<typeof isOverScrollBars>;
|
|
181
|
+
lastCoords: {
|
|
182
|
+
x: number;
|
|
183
|
+
y: number;
|
|
184
|
+
};
|
|
185
|
+
originalElements: Map<string, NonDeleted<ExcalidrawElement>>;
|
|
186
|
+
resize: {
|
|
187
|
+
handleType: import("@excalidraw/element").MaybeTransformHandleType;
|
|
188
|
+
isResizing: boolean;
|
|
189
|
+
offset: {
|
|
190
|
+
x: number;
|
|
191
|
+
y: number;
|
|
192
|
+
};
|
|
193
|
+
arrowDirection: "origin" | "end";
|
|
194
|
+
center: {
|
|
195
|
+
x: number;
|
|
196
|
+
y: number;
|
|
197
|
+
};
|
|
198
|
+
};
|
|
199
|
+
hit: {
|
|
200
|
+
element: NonDeleted<ExcalidrawElement> | null;
|
|
201
|
+
allHitElements: NonDeleted<ExcalidrawElement>[];
|
|
202
|
+
wasAddedToSelection: boolean;
|
|
203
|
+
hasBeenDuplicated: boolean;
|
|
204
|
+
hasHitCommonBoundingBoxOfSelectedElements: boolean;
|
|
205
|
+
};
|
|
206
|
+
withCmdOrCtrl: boolean;
|
|
207
|
+
drag: {
|
|
208
|
+
hasOccurred: boolean;
|
|
209
|
+
offset: {
|
|
210
|
+
x: number;
|
|
211
|
+
y: number;
|
|
212
|
+
} | null;
|
|
213
|
+
origin: {
|
|
214
|
+
x: number;
|
|
215
|
+
y: number;
|
|
216
|
+
};
|
|
217
|
+
blockDragging: boolean;
|
|
218
|
+
};
|
|
219
|
+
eventListeners: {
|
|
220
|
+
onMove: null | ReturnType<typeof import("@excalidraw/common").throttleRAF>;
|
|
221
|
+
onUp: null | ((event: PointerEvent) => void);
|
|
222
|
+
onKeyDown: null | ((event: KeyboardEvent) => void);
|
|
223
|
+
onKeyUp: null | ((event: KeyboardEvent) => void);
|
|
224
|
+
};
|
|
225
|
+
boxSelection: {
|
|
226
|
+
hasOccurred: boolean;
|
|
227
|
+
};
|
|
228
|
+
}>, event: PointerEvent]>;
|
|
229
|
+
onUserFollowEmitter: Emitter<[payload: OnUserFollowedPayload]>;
|
|
230
|
+
onScrollChangeEmitter: Emitter<[scrollX: number, scrollY: number, zoom: Readonly<{
|
|
231
|
+
value: import("../types").NormalizedZoomValue;
|
|
232
|
+
}>]>;
|
|
233
|
+
onHideAnnotationsChangeEmitter: Emitter<[hideAnnotations: boolean]>;
|
|
234
|
+
missingPointerEventCleanupEmitter: Emitter<[event: PointerEvent | null]>;
|
|
235
|
+
onRemoveEventListenersEmitter: Emitter<[]>;
|
|
236
|
+
constructor(props: AppProps);
|
|
237
|
+
updateEditorAtom: <Value, Args extends unknown[], Result>(atom: WritableAtom<Value, Args, Result>, ...args: Args) => Result;
|
|
238
|
+
private onWindowMessage;
|
|
239
|
+
private handleSkipBindMode;
|
|
240
|
+
private resetDelayedBindMode;
|
|
241
|
+
private previousHoveredBindableElement;
|
|
242
|
+
private handleDelayedBindModeChange;
|
|
243
|
+
private cacheEmbeddableRef;
|
|
244
|
+
/**
|
|
245
|
+
* Returns gridSize taking into account `gridModeEnabled`.
|
|
246
|
+
* If disabled, returns null.
|
|
247
|
+
*/
|
|
248
|
+
getEffectiveGridSize: () => NullableGridSize;
|
|
249
|
+
private getHTMLIFrameElement;
|
|
250
|
+
private handleEmbeddableCenterClick;
|
|
251
|
+
private isIframeLikeElementCenter;
|
|
252
|
+
private updateEmbedValidationStatus;
|
|
253
|
+
private updateEmbeddables;
|
|
254
|
+
private renderEmbeddables;
|
|
255
|
+
private getFrameNameDOMId;
|
|
256
|
+
frameNameBoundsCache: FrameNameBoundsCache;
|
|
257
|
+
private resetEditingFrame;
|
|
258
|
+
private renderFrameNames;
|
|
259
|
+
private toggleOverscrollBehavior;
|
|
260
|
+
render(): import("react/jsx-runtime").JSX.Element;
|
|
261
|
+
focusContainer: AppClassProperties["focusContainer"];
|
|
262
|
+
getSceneElementsIncludingDeleted: () => readonly import("@excalidraw/element/types").OrderedExcalidrawElement[];
|
|
263
|
+
getSceneElementsMapIncludingDeleted: () => Map<string, Ordered<ExcalidrawElement>> & import("@excalidraw/common/utility-types").MakeBrand<"SceneElementsMap">;
|
|
264
|
+
getSceneElements: () => readonly Ordered<NonDeletedExcalidrawElement>[];
|
|
265
|
+
onInsertElements: (elements: readonly ExcalidrawElement[]) => void;
|
|
266
|
+
onExportImage: (type: keyof typeof EXPORT_IMAGE_TYPES, elements: ExportedElements, opts: {
|
|
267
|
+
exportingFrame: ExcalidrawFrameLikeElement | null;
|
|
268
|
+
}) => Promise<void>;
|
|
269
|
+
private magicGenerations;
|
|
270
|
+
private updateMagicGeneration;
|
|
271
|
+
plugins: {
|
|
272
|
+
diagramToCode?: {
|
|
273
|
+
generate: GenerateDiagramToCode;
|
|
274
|
+
};
|
|
275
|
+
};
|
|
276
|
+
setPlugins(plugins: Partial<App["plugins"]>): void;
|
|
277
|
+
private onMagicFrameGenerate;
|
|
278
|
+
private onIframeSrcCopy;
|
|
279
|
+
onMagicframeToolSelect: () => void;
|
|
280
|
+
private openEyeDropper;
|
|
281
|
+
dismissLinearEditor: () => void;
|
|
282
|
+
syncActionResult: (actionResult: ActionResult) => void;
|
|
283
|
+
private onBlur;
|
|
284
|
+
private onUnload;
|
|
285
|
+
private disableEvent;
|
|
286
|
+
private resetHistory;
|
|
287
|
+
private resetStore;
|
|
288
|
+
/**
|
|
289
|
+
* Resets scene & history.
|
|
290
|
+
* ! Do not use to clear scene user action !
|
|
291
|
+
*/
|
|
292
|
+
private resetScene;
|
|
293
|
+
private initializeScene;
|
|
294
|
+
private getFormFactor;
|
|
295
|
+
refreshEditorInterface: () => void;
|
|
296
|
+
private reconcileStylesPanelMode;
|
|
297
|
+
/** TO BE USED LATER */
|
|
298
|
+
private setDesktopUIMode;
|
|
299
|
+
private clearImageShapeCache;
|
|
300
|
+
componentDidMount(): Promise<void>;
|
|
301
|
+
componentWillUnmount(): void;
|
|
302
|
+
private onResize;
|
|
303
|
+
/** generally invoked only if fullscreen was invoked programmatically */
|
|
304
|
+
private onFullscreenChange;
|
|
305
|
+
private removeEventListeners;
|
|
306
|
+
private addEventListeners;
|
|
307
|
+
componentDidUpdate(prevProps: AppProps, prevState: AppState): void;
|
|
308
|
+
private renderInteractiveSceneCallback;
|
|
309
|
+
private onScroll;
|
|
310
|
+
private onCut;
|
|
311
|
+
private onCopy;
|
|
312
|
+
private static resetTapTwice;
|
|
313
|
+
private onTouchStart;
|
|
314
|
+
private onTouchEnd;
|
|
315
|
+
private insertClipboardContent;
|
|
316
|
+
pasteFromClipboard: (event: ClipboardEvent) => Promise<void>;
|
|
317
|
+
addElementsFromPasteOrLibrary: (opts: {
|
|
318
|
+
elements: readonly ExcalidrawElement[];
|
|
319
|
+
files: BinaryFiles | null;
|
|
320
|
+
position: {
|
|
321
|
+
clientX: number;
|
|
322
|
+
clientY: number;
|
|
323
|
+
} | "cursor" | "center";
|
|
324
|
+
retainSeed?: boolean;
|
|
325
|
+
fitToContent?: boolean;
|
|
326
|
+
}) => void;
|
|
327
|
+
private addElementsFromMixedContentPaste;
|
|
328
|
+
private addTextFromPaste;
|
|
329
|
+
setAppState: React.Component<any, AppState>["setState"];
|
|
330
|
+
removePointer: (event: React.PointerEvent<HTMLElement> | PointerEvent) => void;
|
|
331
|
+
toggleLock: (source?: "keyboard" | "ui") => void;
|
|
332
|
+
updateFrameRendering: (opts: Partial<AppState["frameRendering"]> | ((prevState: AppState["frameRendering"]) => Partial<AppState["frameRendering"]>)) => void;
|
|
333
|
+
togglePenMode: (force: boolean | null) => void;
|
|
334
|
+
onHandToolToggle: () => void;
|
|
335
|
+
/**
|
|
336
|
+
* Zooms on canvas viewport center
|
|
337
|
+
*/
|
|
338
|
+
zoomCanvas: (
|
|
339
|
+
/**
|
|
340
|
+
* Decimal fraction, auto-clamped between MIN_ZOOM and MAX_ZOOM.
|
|
341
|
+
* 1 = 100% zoom, 2 = 200% zoom, 0.5 = 50% zoom
|
|
342
|
+
*/
|
|
343
|
+
value: number) => void;
|
|
344
|
+
private cancelInProgressAnimation;
|
|
345
|
+
scrollToContent: (
|
|
346
|
+
/**
|
|
347
|
+
* target to scroll to
|
|
348
|
+
*
|
|
349
|
+
* - string - id of element or group, or url containing elementLink
|
|
350
|
+
* - ExcalidrawElement | ExcalidrawElement[] - element(s) objects
|
|
351
|
+
*/
|
|
352
|
+
target?: string | ExcalidrawElement | readonly ExcalidrawElement[], opts?: ({
|
|
353
|
+
fitToContent?: boolean;
|
|
354
|
+
fitToViewport?: never;
|
|
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;
|
|
380
|
+
restoreFileFromShare: () => Promise<void>;
|
|
381
|
+
/**
|
|
382
|
+
* adds supplied files to existing files in the appState.
|
|
383
|
+
* NOTE if file already exists in editor state, the file data is not updated
|
|
384
|
+
* */
|
|
385
|
+
addFiles: ExcalidrawImperativeAPI["addFiles"];
|
|
386
|
+
private addMissingFiles;
|
|
387
|
+
updateScene: <K extends keyof AppState>(sceneData: {
|
|
388
|
+
elements?: SceneData["elements"];
|
|
389
|
+
appState?: Pick<AppState, K> | null;
|
|
390
|
+
collaborators?: SceneData["collaborators"];
|
|
391
|
+
/**
|
|
392
|
+
* 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.
|
|
393
|
+
*
|
|
394
|
+
* - `CaptureUpdateAction.IMMEDIATELY`: Updates are immediately undoable. Use for most local updates.
|
|
395
|
+
* - `CaptureUpdateAction.NEVER`: Updates never make it to undo/redo stack. Use for remote updates or scene initialization.
|
|
396
|
+
* - `CaptureUpdateAction.EVENTUALLY`: Updates will be eventually be captured as part of a future increment.
|
|
397
|
+
*
|
|
398
|
+
* Check [API docs](https://docs.excalidraw.com/docs/@excalidraw/excalidraw/api/props/excalidraw-api#captureUpdate) for more details.
|
|
399
|
+
*
|
|
400
|
+
* @default CaptureUpdateAction.EVENTUALLY
|
|
401
|
+
*/
|
|
402
|
+
captureUpdate?: SceneData["captureUpdate"];
|
|
403
|
+
}) => void;
|
|
404
|
+
applyDeltas: (deltas: StoreDelta[], options?: ApplyToOptions) => [SceneElementsMap, AppState, boolean];
|
|
405
|
+
mutateElement: <TElement extends Mutable<ExcalidrawElement>>(element: TElement, updates: ElementUpdate<TElement>, informMutation?: boolean) => TElement;
|
|
406
|
+
private triggerRender;
|
|
407
|
+
/**
|
|
408
|
+
* @returns whether the menu was toggled on or off
|
|
409
|
+
*/
|
|
410
|
+
toggleSidebar: ({ name, tab, force, }: {
|
|
411
|
+
name: SidebarName | null;
|
|
412
|
+
tab?: SidebarTabName;
|
|
413
|
+
force?: boolean;
|
|
414
|
+
}) => boolean;
|
|
415
|
+
private updateCurrentCursorPosition;
|
|
416
|
+
getEditorUIOffsets: () => Offsets;
|
|
417
|
+
private onKeyDown;
|
|
418
|
+
private onKeyUp;
|
|
419
|
+
private isToolSupported;
|
|
420
|
+
setActiveTool: (tool: ({
|
|
421
|
+
type: ToolType;
|
|
422
|
+
} | {
|
|
423
|
+
type: "custom";
|
|
424
|
+
customType: string;
|
|
425
|
+
}) & {
|
|
426
|
+
locked?: boolean;
|
|
427
|
+
fromSelection?: boolean;
|
|
428
|
+
}, keepSelection?: boolean) => void;
|
|
429
|
+
setOpenDialog: (dialogType: AppState["openDialog"]) => void;
|
|
430
|
+
private setCursor;
|
|
431
|
+
private resetCursor;
|
|
432
|
+
/**
|
|
433
|
+
* returns whether user is making a gesture with >= 2 fingers (points)
|
|
434
|
+
* on o touch screen (not on a trackpad). Currently only relates to Darwin
|
|
435
|
+
* (iOS/iPadOS,MacOS), but may work on other devices in the future if
|
|
436
|
+
* GestureEvent is standardized.
|
|
437
|
+
*/
|
|
438
|
+
private isTouchScreenMultiTouchGesture;
|
|
439
|
+
getName: () => string;
|
|
440
|
+
private onGestureStart;
|
|
441
|
+
private onGestureChange;
|
|
442
|
+
private onGestureEnd;
|
|
443
|
+
private handleTextWysiwyg;
|
|
444
|
+
private deselectElements;
|
|
445
|
+
private getTextElementAtPosition;
|
|
446
|
+
private getElementAtPosition;
|
|
447
|
+
private getElementsAtPosition;
|
|
448
|
+
getElementHitThreshold(element: ExcalidrawElement): number;
|
|
449
|
+
private hitElement;
|
|
450
|
+
private getTextBindableContainerAtPosition;
|
|
451
|
+
private startTextEditing;
|
|
452
|
+
private startImageCropping;
|
|
453
|
+
private finishImageCropping;
|
|
454
|
+
private handleCanvasDoubleClick;
|
|
455
|
+
private getElementLinkAtPosition;
|
|
456
|
+
private redirectToLink;
|
|
457
|
+
private getTopLayerFrameAtSceneCoords;
|
|
458
|
+
private handleCanvasPointerMove;
|
|
459
|
+
private handleEraser;
|
|
460
|
+
private handleTouchMove;
|
|
461
|
+
handleHoverSelectedLinearElement(linearElementEditor: LinearElementEditor, scenePointerX: number, scenePointerY: number): void;
|
|
462
|
+
private handleCanvasPointerDown;
|
|
463
|
+
private handleCanvasPointerUp;
|
|
464
|
+
private maybeOpenContextMenuAfterPointerDownOnTouchDevices;
|
|
465
|
+
private resetContextMenuTimer;
|
|
466
|
+
/**
|
|
467
|
+
* pointerup may not fire in certian cases (user tabs away...), so in order
|
|
468
|
+
* to properly cleanup pointerdown state, we need to fire any hanging
|
|
469
|
+
* pointerup handlers manually
|
|
470
|
+
*/
|
|
471
|
+
private maybeCleanupAfterMissingPointerUp;
|
|
472
|
+
handleCanvasPanUsingWheelOrSpaceDrag: (event: React.PointerEvent<HTMLElement> | MouseEvent) => boolean;
|
|
473
|
+
private updateGestureOnPointerDown;
|
|
474
|
+
private initialPointerDownState;
|
|
475
|
+
private handleDraggingScrollBar;
|
|
476
|
+
private clearSelectionIfNotUsingSelection;
|
|
477
|
+
/**
|
|
478
|
+
* @returns whether the pointer event has been completely handled
|
|
479
|
+
*/
|
|
480
|
+
private handleSelectionOnPointerDown;
|
|
481
|
+
private isASelectedElement;
|
|
482
|
+
private isHittingCommonBoundingBoxOfSelectedElements;
|
|
483
|
+
private handleTextOnPointerDown;
|
|
484
|
+
private handleFreeDrawElementOnPointerDown;
|
|
485
|
+
insertIframeElement: ({ sceneX, sceneY, width, height, }: {
|
|
486
|
+
sceneX: number;
|
|
487
|
+
sceneY: number;
|
|
488
|
+
width: number;
|
|
489
|
+
height: number;
|
|
490
|
+
}) => NonDeleted<ExcalidrawIframeElement>;
|
|
491
|
+
insertEmbeddableElement: ({ sceneX, sceneY, link, }: {
|
|
492
|
+
sceneX: number;
|
|
493
|
+
sceneY: number;
|
|
494
|
+
link: string;
|
|
495
|
+
}) => NonDeleted<ExcalidrawEmbeddableElement> | undefined;
|
|
496
|
+
private newImagePlaceholder;
|
|
497
|
+
private handleLinearElementOnPointerDown;
|
|
498
|
+
private getCurrentItemRoundness;
|
|
499
|
+
private createGenericElementOnPointerDown;
|
|
500
|
+
private createFrameElementOnPointerDown;
|
|
501
|
+
private maybeCacheReferenceSnapPoints;
|
|
502
|
+
private maybeCacheVisibleGaps;
|
|
503
|
+
private onKeyDownFromPointerDownHandler;
|
|
504
|
+
private onKeyUpFromPointerDownHandler;
|
|
505
|
+
private onPointerMoveFromPointerDownHandler;
|
|
506
|
+
private handlePointerMoveOverScrollbars;
|
|
507
|
+
private onPointerUpFromPointerDownHandler;
|
|
508
|
+
private restoreReadyToEraseElements;
|
|
509
|
+
private eraseElements;
|
|
510
|
+
private initializeImage;
|
|
511
|
+
/**
|
|
512
|
+
* use during async image initialization,
|
|
513
|
+
* when the placeholder image could have been modified in the meantime,
|
|
514
|
+
* and when you don't want to loose those modifications
|
|
515
|
+
*/
|
|
516
|
+
private getLatestInitializedImageElement;
|
|
517
|
+
private onImageToolbarButtonClick;
|
|
518
|
+
private getImageNaturalDimensions;
|
|
519
|
+
/** updates image cache, refreshing updated elements and/or setting status
|
|
520
|
+
to error for images that fail during <img> element creation */
|
|
521
|
+
private updateImageCache;
|
|
522
|
+
/** adds new images to imageCache and re-renders if needed */
|
|
523
|
+
private addNewImagesToImageCache;
|
|
524
|
+
/** generally you should use `addNewImagesToImageCache()` directly if you need
|
|
525
|
+
* to render new images. This is just a failsafe */
|
|
526
|
+
private scheduleImageRefresh;
|
|
527
|
+
private updateBindingEnabledOnPointerMove;
|
|
528
|
+
private clearSelection;
|
|
529
|
+
private handleInteractiveCanvasRef;
|
|
530
|
+
private insertImages;
|
|
531
|
+
private handleAppOnDrop;
|
|
532
|
+
loadFileToCanvas: (file: File, fileHandle: FileSystemHandle | null) => Promise<void>;
|
|
533
|
+
private handleCanvasContextMenu;
|
|
534
|
+
private maybeDragNewGenericElement;
|
|
535
|
+
private maybeHandleCrop;
|
|
536
|
+
private maybeHandleResize;
|
|
537
|
+
private getContextMenuItems;
|
|
538
|
+
private handleWheel;
|
|
539
|
+
private getTextWysiwygSnappedToCenterPosition;
|
|
540
|
+
private savePointer;
|
|
541
|
+
private resetShouldCacheIgnoreZoomDebounced;
|
|
542
|
+
private updateDOMRect;
|
|
543
|
+
refresh: () => void;
|
|
544
|
+
private getCanvasOffsets;
|
|
545
|
+
watchState: () => void;
|
|
546
|
+
private updateLanguage;
|
|
547
|
+
}
|
|
548
|
+
declare global {
|
|
549
|
+
interface Window {
|
|
550
|
+
h: {
|
|
551
|
+
scene: Scene;
|
|
552
|
+
elements: readonly ExcalidrawElement[];
|
|
553
|
+
state: AppState;
|
|
554
|
+
setState: React.Component<any, AppState>["setState"];
|
|
555
|
+
watchState: (prev: any, next: any) => void | undefined;
|
|
556
|
+
app: InstanceType<typeof App>;
|
|
557
|
+
history: History;
|
|
558
|
+
store: Store;
|
|
559
|
+
};
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
export declare const createTestHook: () => void;
|
|
563
|
+
export default App;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./Avatar.scss";
|
|
3
|
+
type AvatarProps = {
|
|
4
|
+
onClick: (e: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
|
|
5
|
+
color: string;
|
|
6
|
+
name: string;
|
|
7
|
+
src?: string;
|
|
8
|
+
className?: string;
|
|
9
|
+
};
|
|
10
|
+
export declare const Avatar: ({ color, onClick, name, src, className, }: AvatarProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./Button.scss";
|
|
3
|
+
interface ButtonProps extends React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement> {
|
|
4
|
+
type?: "button" | "submit" | "reset";
|
|
5
|
+
onSelect: () => any;
|
|
6
|
+
/** whether button is in active state */
|
|
7
|
+
selected?: boolean;
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
className?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* A generic button component that follows Excalidraw's design system.
|
|
13
|
+
* Style can be customised using `className` or `style` prop.
|
|
14
|
+
* Accepts all props that a regular `button` element accepts.
|
|
15
|
+
*/
|
|
16
|
+
export declare const Button: ({ type, onSelect, selected, children, className, ...rest }: ButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import "./ButtonIcon.scss";
|
|
2
|
+
import type { JSX } from "react";
|
|
3
|
+
interface ButtonIconProps {
|
|
4
|
+
icon: JSX.Element;
|
|
5
|
+
title: string;
|
|
6
|
+
className?: string;
|
|
7
|
+
testId?: string;
|
|
8
|
+
/** if not supplied, defaults to value identity check */
|
|
9
|
+
active?: boolean;
|
|
10
|
+
/** include standalone style (could interfere with parent styles) */
|
|
11
|
+
standalone?: boolean;
|
|
12
|
+
onClick: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
|
|
13
|
+
style?: React.CSSProperties;
|
|
14
|
+
}
|
|
15
|
+
export declare const ButtonIcon: import("react").ForwardRefExoticComponent<ButtonIconProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ButtonSeparator: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ColorPickerType } from "./colorPickerUtils";
|
|
2
|
+
interface ColorInputProps {
|
|
3
|
+
color: string;
|
|
4
|
+
onChange: (color: string) => void;
|
|
5
|
+
label: string;
|
|
6
|
+
colorPickerType: ColorPickerType;
|
|
7
|
+
placeholder?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const ColorInput: ({ color, onChange, label, colorPickerType, placeholder, }: ColorInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ColorTuple, ColorPaletteCustom } from "@excalidraw/common";
|
|
2
|
+
import type { ExcalidrawElement } from "@excalidraw/element/types";
|
|
3
|
+
import "./ColorPicker.scss";
|
|
4
|
+
import type { ColorPickerType } from "./colorPickerUtils";
|
|
5
|
+
import type { AppState } from "../../types";
|
|
6
|
+
export declare const getColor: (color: string) => string | null;
|
|
7
|
+
interface ColorPickerProps {
|
|
8
|
+
type: ColorPickerType;
|
|
9
|
+
/**
|
|
10
|
+
* null indicates no color should be displayed as active
|
|
11
|
+
* (e.g. when multiple shapes selected with different colors)
|
|
12
|
+
*/
|
|
13
|
+
color: string | null;
|
|
14
|
+
onChange: (color: string) => void;
|
|
15
|
+
label: string;
|
|
16
|
+
elements: readonly ExcalidrawElement[];
|
|
17
|
+
appState: AppState;
|
|
18
|
+
palette?: ColorPaletteCustom | null;
|
|
19
|
+
topPicks?: ColorTuple;
|
|
20
|
+
updateData: (formData?: any) => void;
|
|
21
|
+
}
|
|
22
|
+
export declare const ColorPicker: ({ type, color, onChange, label, elements, palette, topPicks, updateData, appState, }: ColorPickerProps) => import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
interface CustomColorListProps {
|
|
2
|
+
colors: string[];
|
|
3
|
+
color: string | null;
|
|
4
|
+
onChange: (color: string) => void;
|
|
5
|
+
label: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const CustomColorList: ({ colors, color, onChange, label, }: CustomColorListProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|