@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,21 @@
|
|
|
1
|
+
import { supported as nativeFileSystemSupported } from "browser-fs-access";
|
|
2
|
+
import { MIME_TYPES } from "@excalidraw/common";
|
|
3
|
+
import type { FileSystemHandle } from "browser-fs-access";
|
|
4
|
+
type FILE_EXTENSION = Exclude<keyof typeof MIME_TYPES, "binary">;
|
|
5
|
+
export declare const fileOpen: <M extends boolean | undefined = false>(opts: {
|
|
6
|
+
extensions?: FILE_EXTENSION[];
|
|
7
|
+
description: string;
|
|
8
|
+
multiple?: M;
|
|
9
|
+
}) => Promise<M extends false | undefined ? File : File[]>;
|
|
10
|
+
export declare const fileSave: (blob: Blob | Promise<Blob>, opts: {
|
|
11
|
+
/** supply without the extension */
|
|
12
|
+
name: string;
|
|
13
|
+
/** file extension */
|
|
14
|
+
extension: FILE_EXTENSION;
|
|
15
|
+
mimeTypes?: string[];
|
|
16
|
+
description: string;
|
|
17
|
+
/** existing FileSystemHandle */
|
|
18
|
+
fileHandle?: FileSystemHandle | null;
|
|
19
|
+
}) => Promise<FileSystemHandle | null>;
|
|
20
|
+
export { nativeFileSystemSupported };
|
|
21
|
+
export type { FileSystemHandle };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const getTEXtChunk: (blob: Blob) => Promise<{
|
|
2
|
+
keyword: string;
|
|
3
|
+
text: string;
|
|
4
|
+
} | null>;
|
|
5
|
+
export declare const encodePngMetadata: ({ blob, metadata, }: {
|
|
6
|
+
blob: Blob;
|
|
7
|
+
metadata: string;
|
|
8
|
+
}) => Promise<Blob>;
|
|
9
|
+
export declare const decodePngMetadata: (blob: Blob) => Promise<string>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ExcalidrawElement, ExcalidrawFrameLikeElement, NonDeletedExcalidrawElement } from "@excalidraw/element/types";
|
|
2
|
+
import type { FileSystemHandle } from "./filesystem";
|
|
3
|
+
import type { ExportType } from "../scene/types";
|
|
4
|
+
import type { AppState, BinaryFiles } from "../types";
|
|
5
|
+
export { loadFromBlob } from "./blob";
|
|
6
|
+
export { loadFromJSON, saveAsJSON } from "./json";
|
|
7
|
+
export type ExportedElements = readonly NonDeletedExcalidrawElement[] & {
|
|
8
|
+
_brand: "exportedElements";
|
|
9
|
+
};
|
|
10
|
+
export declare const prepareElementsForExport: (elements: readonly ExcalidrawElement[], { selectedElementIds }: Pick<AppState, "selectedElementIds">, exportSelectionOnly: boolean) => {
|
|
11
|
+
exportingFrame: ExcalidrawFrameLikeElement | null;
|
|
12
|
+
exportedElements: ExportedElements;
|
|
13
|
+
};
|
|
14
|
+
export declare const exportCanvas: (type: Omit<ExportType, "backend">, elements: ExportedElements, appState: AppState, files: BinaryFiles, { exportBackground, exportPadding, viewBackgroundColor, name, fileHandle, exportingFrame, }: {
|
|
15
|
+
exportBackground: boolean;
|
|
16
|
+
exportPadding?: number;
|
|
17
|
+
viewBackgroundColor: string;
|
|
18
|
+
/** filename, if applicable */
|
|
19
|
+
name?: string;
|
|
20
|
+
fileHandle?: FileSystemHandle | null;
|
|
21
|
+
exportingFrame: ExcalidrawFrameLikeElement | null;
|
|
22
|
+
}) => Promise<FileSystemHandle | null | undefined>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ExcalidrawElement } from "@excalidraw/element/types";
|
|
2
|
+
import type { AppState, BinaryFiles, LibraryItems } from "../types";
|
|
3
|
+
import type { ImportedDataState, ImportedLibraryData } from "./types";
|
|
4
|
+
export declare const serializeAsJSON: (elements: readonly ExcalidrawElement[], appState: Partial<AppState>, files: BinaryFiles, type: "local" | "database") => string;
|
|
5
|
+
export declare const saveAsJSON: (elements: readonly ExcalidrawElement[], appState: AppState, files: BinaryFiles,
|
|
6
|
+
/** filename */
|
|
7
|
+
name?: string) => Promise<{
|
|
8
|
+
fileHandle: import("browser-fs-access").FileSystemHandle | null;
|
|
9
|
+
}>;
|
|
10
|
+
export declare const loadFromJSON: (localAppState: AppState, localElements: readonly ExcalidrawElement[] | null) => Promise<import("./restore").RestoredDataState>;
|
|
11
|
+
export declare const isValidExcalidrawData: (data?: {
|
|
12
|
+
type?: any;
|
|
13
|
+
elements?: any;
|
|
14
|
+
appState?: any;
|
|
15
|
+
}) => data is ImportedDataState;
|
|
16
|
+
export declare const isValidLibrary: (json: any) => json is ImportedLibraryData;
|
|
17
|
+
export declare const serializeLibraryAsJSON: (libraryItems: LibraryItems) => string;
|
|
18
|
+
export declare const saveLibraryAsJSON: (libraryItems: LibraryItems) => Promise<void>;
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import type { ExcalidrawElement } from "@excalidraw/element/types";
|
|
2
|
+
import type { MaybePromise } from "@excalidraw/common/utility-types";
|
|
3
|
+
import type App from "../components/App";
|
|
4
|
+
import type { LibraryItems, ExcalidrawImperativeAPI, LibraryItemsSource, LibraryItems_anyVersion } from "../types";
|
|
5
|
+
export type LibraryPersistedData = {
|
|
6
|
+
libraryItems: LibraryItems;
|
|
7
|
+
};
|
|
8
|
+
export type LibraryAdatapterSource = "load" | "save";
|
|
9
|
+
export interface LibraryPersistenceAdapter {
|
|
10
|
+
/**
|
|
11
|
+
* Should load data that were previously saved into the database using the
|
|
12
|
+
* `save` method. Should throw if saving fails.
|
|
13
|
+
*
|
|
14
|
+
* Will be used internally in multiple places, such as during save to
|
|
15
|
+
* in order to reconcile changes with latest store data.
|
|
16
|
+
*/
|
|
17
|
+
load(metadata: {
|
|
18
|
+
/**
|
|
19
|
+
* Indicates whether we're loading data for save purposes, or reading
|
|
20
|
+
* purposes, in which case host app can implement more aggressive caching.
|
|
21
|
+
*/
|
|
22
|
+
source: LibraryAdatapterSource;
|
|
23
|
+
}): MaybePromise<{
|
|
24
|
+
libraryItems: LibraryItems_anyVersion;
|
|
25
|
+
} | null>;
|
|
26
|
+
/** Should persist to the database as is (do no change the data structure). */
|
|
27
|
+
save(libraryData: LibraryPersistedData): MaybePromise<void>;
|
|
28
|
+
}
|
|
29
|
+
export interface LibraryMigrationAdapter {
|
|
30
|
+
/**
|
|
31
|
+
* loads data from legacy data source. Returns `null` if no data is
|
|
32
|
+
* to be migrated.
|
|
33
|
+
*/
|
|
34
|
+
load(): MaybePromise<{
|
|
35
|
+
libraryItems: LibraryItems_anyVersion;
|
|
36
|
+
} | null>;
|
|
37
|
+
/** clears entire storage afterwards */
|
|
38
|
+
clear(): MaybePromise<void>;
|
|
39
|
+
}
|
|
40
|
+
export declare const libraryItemsAtom: import("jotai/vanilla/atom").PrimitiveAtom<{
|
|
41
|
+
status: "loading" | "loaded";
|
|
42
|
+
/** indicates whether library is initialized with library items (has gone
|
|
43
|
+
* through at least one update). Used in UI. Specific to this atom only. */
|
|
44
|
+
isInitialized: boolean;
|
|
45
|
+
libraryItems: LibraryItems;
|
|
46
|
+
}> & {
|
|
47
|
+
init: {
|
|
48
|
+
status: "loading" | "loaded";
|
|
49
|
+
/** indicates whether library is initialized with library items (has gone
|
|
50
|
+
* through at least one update). Used in UI. Specific to this atom only. */
|
|
51
|
+
isInitialized: boolean;
|
|
52
|
+
libraryItems: LibraryItems;
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
/** Merges otherItems into localItems. Unique items in otherItems array are
|
|
56
|
+
sorted first. */
|
|
57
|
+
export declare const mergeLibraryItems: (localItems: LibraryItems, otherItems: LibraryItems) => LibraryItems;
|
|
58
|
+
declare class Library {
|
|
59
|
+
/** latest libraryItems */
|
|
60
|
+
private currLibraryItems;
|
|
61
|
+
/** snapshot of library items since last onLibraryChange call */
|
|
62
|
+
private prevLibraryItems;
|
|
63
|
+
private app;
|
|
64
|
+
constructor(app: App);
|
|
65
|
+
private updateQueue;
|
|
66
|
+
private getLastUpdateTask;
|
|
67
|
+
private notifyListeners;
|
|
68
|
+
/** call on excalidraw instance unmount */
|
|
69
|
+
destroy: () => void;
|
|
70
|
+
resetLibrary: () => Promise<LibraryItems>;
|
|
71
|
+
/**
|
|
72
|
+
* @returns latest cloned libraryItems. Awaits all in-progress updates first.
|
|
73
|
+
*/
|
|
74
|
+
getLatestLibrary: () => Promise<LibraryItems>;
|
|
75
|
+
updateLibrary: ({ libraryItems, prompt, merge, openLibraryMenu, defaultStatus, }: {
|
|
76
|
+
libraryItems: LibraryItemsSource;
|
|
77
|
+
merge?: boolean;
|
|
78
|
+
prompt?: boolean;
|
|
79
|
+
openLibraryMenu?: boolean;
|
|
80
|
+
defaultStatus?: "unpublished" | "published";
|
|
81
|
+
}) => Promise<LibraryItems>;
|
|
82
|
+
setLibrary: (
|
|
83
|
+
/**
|
|
84
|
+
* LibraryItems that will replace current items. Can be a function which
|
|
85
|
+
* will be invoked after all previous tasks are resolved
|
|
86
|
+
* (this is the prefered way to update the library to avoid race conditions,
|
|
87
|
+
* but you'll want to manually merge the library items in the callback
|
|
88
|
+
* - which is what we're doing in Library.importLibrary()).
|
|
89
|
+
*
|
|
90
|
+
* If supplied promise is rejected with AbortError, we swallow it and
|
|
91
|
+
* do not update the library.
|
|
92
|
+
*/
|
|
93
|
+
libraryItems: LibraryItems | Promise<LibraryItems> | ((latestLibraryItems: LibraryItems) => LibraryItems | Promise<LibraryItems>)) => Promise<LibraryItems>;
|
|
94
|
+
}
|
|
95
|
+
export default Library;
|
|
96
|
+
export declare const distributeLibraryItemsOnSquareGrid: (libraryItems: LibraryItems) => ExcalidrawElement[];
|
|
97
|
+
export declare const validateLibraryUrl: (libraryUrl: string,
|
|
98
|
+
/**
|
|
99
|
+
* @returns `true` if the URL is valid, throws otherwise.
|
|
100
|
+
*/
|
|
101
|
+
validator?: ((libraryUrl: string) => boolean) | string[]) => true;
|
|
102
|
+
export declare const parseLibraryTokensFromUrl: () => {
|
|
103
|
+
libraryUrl: string;
|
|
104
|
+
idToken: string | null;
|
|
105
|
+
} | null;
|
|
106
|
+
export declare const getLibraryItemsHash: (items: LibraryItems) => number;
|
|
107
|
+
export declare const useHandleLibrary: (opts: {
|
|
108
|
+
excalidrawAPI: ExcalidrawImperativeAPI | null;
|
|
109
|
+
/**
|
|
110
|
+
* Return `true` if the library install url should be allowed.
|
|
111
|
+
* If not supplied, only the excalidraw.com base domain is allowed.
|
|
112
|
+
*/
|
|
113
|
+
validateLibraryUrl?: (libraryUrl: string) => boolean;
|
|
114
|
+
} & ({
|
|
115
|
+
/** @deprecated we recommend using `opts.adapter` instead */
|
|
116
|
+
getInitialLibraryItems?: () => MaybePromise<LibraryItemsSource>;
|
|
117
|
+
} | {
|
|
118
|
+
adapter: LibraryPersistenceAdapter;
|
|
119
|
+
/**
|
|
120
|
+
* Adapter that takes care of loading data from legacy data store.
|
|
121
|
+
* Supply this if you want to migrate data on initial load from legacy
|
|
122
|
+
* data store.
|
|
123
|
+
*
|
|
124
|
+
* Can be a different LibraryPersistenceAdapter.
|
|
125
|
+
*/
|
|
126
|
+
migrationAdapter?: LibraryMigrationAdapter;
|
|
127
|
+
})) => void;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { OrderedExcalidrawElement } from "@excalidraw/element/types";
|
|
2
|
+
import type { MakeBrand } from "@excalidraw/common/utility-types";
|
|
3
|
+
import type { AppState } from "../types";
|
|
4
|
+
export type ReconciledExcalidrawElement = OrderedExcalidrawElement & MakeBrand<"ReconciledElement">;
|
|
5
|
+
export type RemoteExcalidrawElement = OrderedExcalidrawElement & MakeBrand<"RemoteExcalidrawElement">;
|
|
6
|
+
export declare const shouldDiscardRemoteElement: (localAppState: AppState, local: OrderedExcalidrawElement | undefined, remote: RemoteExcalidrawElement) => boolean;
|
|
7
|
+
export declare const reconcileElements: (localElements: readonly OrderedExcalidrawElement[], remoteElements: readonly RemoteExcalidrawElement[], localAppState: AppState) => ReconciledExcalidrawElement[];
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ExcalidrawElement } from "@excalidraw/element/types";
|
|
2
|
+
import type { AppState, BinaryFiles } from "../types";
|
|
3
|
+
export declare const resaveAsImageWithScene: (elements: readonly ExcalidrawElement[], appState: AppState, files: BinaryFiles, name: string) => Promise<{
|
|
4
|
+
fileHandle: import("browser-fs-access").FileSystemHandle;
|
|
5
|
+
}>;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { ElementsMap, ElementsMapOrArray, ExcalidrawElement, ExcalidrawSelectionElement, OrderedExcalidrawElement } from "@excalidraw/element/types";
|
|
2
|
+
import type { AppState, BinaryFiles, LibraryItem } from "../types";
|
|
3
|
+
import type { ImportedDataState } from "./types";
|
|
4
|
+
type RestoredAppState = Omit<AppState, "offsetTop" | "offsetLeft" | "width" | "height">;
|
|
5
|
+
export declare const AllowedExcalidrawActiveTools: Record<AppState["activeTool"]["type"], boolean>;
|
|
6
|
+
export type RestoredDataState = {
|
|
7
|
+
elements: OrderedExcalidrawElement[];
|
|
8
|
+
appState: RestoredAppState;
|
|
9
|
+
files: BinaryFiles;
|
|
10
|
+
};
|
|
11
|
+
export declare const restoreElement: (element: Exclude<ExcalidrawElement, ExcalidrawSelectionElement>, targetElementsMap: Readonly<ElementsMap>, localElementsMap: Readonly<ElementsMap> | null | undefined, opts?: {
|
|
12
|
+
deleteInvisibleElements?: boolean;
|
|
13
|
+
}) => typeof element | null;
|
|
14
|
+
export declare const restoreElements: (targetElements: ImportedDataState["elements"],
|
|
15
|
+
/** NOTE doesn't serve for reconciliation */
|
|
16
|
+
localElements: Readonly<ElementsMapOrArray> | null | undefined, opts?: {
|
|
17
|
+
refreshDimensions?: boolean;
|
|
18
|
+
repairBindings?: boolean;
|
|
19
|
+
deleteInvisibleElements?: boolean;
|
|
20
|
+
} | undefined) => OrderedExcalidrawElement[];
|
|
21
|
+
export declare const restoreAppState: (appState: ImportedDataState["appState"], localAppState: Partial<AppState> | null | undefined) => RestoredAppState;
|
|
22
|
+
export declare const restore: (data: Pick<ImportedDataState, "appState" | "elements" | "files"> | null,
|
|
23
|
+
/**
|
|
24
|
+
* Local AppState (`this.state` or initial state from localStorage) so that we
|
|
25
|
+
* don't overwrite local state with default values (when values not
|
|
26
|
+
* explicitly specified).
|
|
27
|
+
* Supply `null` if you can't get access to it.
|
|
28
|
+
*/
|
|
29
|
+
localAppState: Partial<AppState> | null | undefined, localElements: readonly ExcalidrawElement[] | null | undefined, elementsConfig?: {
|
|
30
|
+
refreshDimensions?: boolean;
|
|
31
|
+
repairBindings?: boolean;
|
|
32
|
+
deleteInvisibleElements?: boolean;
|
|
33
|
+
}) => RestoredDataState;
|
|
34
|
+
export declare const restoreLibraryItems: (libraryItems: ImportedDataState["libraryItems"], defaultStatus: LibraryItem["status"]) => LibraryItem[];
|
|
35
|
+
export {};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { VERSIONS } from "@excalidraw/common";
|
|
2
|
+
import type { ExcalidrawElement } from "@excalidraw/element/types";
|
|
3
|
+
import type { cleanAppStateForExport } from "../appState";
|
|
4
|
+
import type { AppState, BinaryFiles, LibraryItem, LibraryItems, LibraryItems_anyVersion } from "../types";
|
|
5
|
+
export interface ExportedDataState {
|
|
6
|
+
type: string;
|
|
7
|
+
version: number;
|
|
8
|
+
source: string;
|
|
9
|
+
elements: readonly ExcalidrawElement[];
|
|
10
|
+
appState: ReturnType<typeof cleanAppStateForExport>;
|
|
11
|
+
files: BinaryFiles | undefined;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Map of legacy AppState keys, with values of:
|
|
15
|
+
* [<legacy type>, <new AppState proeprty>]
|
|
16
|
+
*
|
|
17
|
+
* This is a helper type used in downstream abstractions.
|
|
18
|
+
* Don't consume on its own.
|
|
19
|
+
*/
|
|
20
|
+
export type LegacyAppState = {
|
|
21
|
+
/** @deprecated #6213 TODO remove 23-06-01 */
|
|
22
|
+
isSidebarDocked: [boolean, "defaultSidebarDockedPreference"];
|
|
23
|
+
};
|
|
24
|
+
export interface ImportedDataState {
|
|
25
|
+
type?: string;
|
|
26
|
+
version?: number;
|
|
27
|
+
source?: string;
|
|
28
|
+
elements?: readonly ExcalidrawElement[] | null;
|
|
29
|
+
appState?: Readonly<Partial<AppState & {
|
|
30
|
+
[T in keyof LegacyAppState]: LegacyAppState[T][0];
|
|
31
|
+
}>> | null;
|
|
32
|
+
scrollToContent?: boolean;
|
|
33
|
+
libraryItems?: LibraryItems_anyVersion;
|
|
34
|
+
files?: BinaryFiles;
|
|
35
|
+
}
|
|
36
|
+
export interface ExportedLibraryData {
|
|
37
|
+
type: string;
|
|
38
|
+
version: typeof VERSIONS.excalidrawLibrary;
|
|
39
|
+
source: string;
|
|
40
|
+
libraryItems: LibraryItems;
|
|
41
|
+
}
|
|
42
|
+
export interface ImportedLibraryData extends Partial<ExportedLibraryData> {
|
|
43
|
+
/** @deprecated v1 */
|
|
44
|
+
library?: LibraryItems;
|
|
45
|
+
}
|
|
46
|
+
export type ExcalidrawLibraryIds = {
|
|
47
|
+
itemIds: LibraryItem["id"][];
|
|
48
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const deburr: (str: string) => string;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { atom, createStore, type PrimitiveAtom, type WritableAtom } from "jotai";
|
|
2
|
+
import { createIsolation } from "jotai-scope";
|
|
3
|
+
export { atom, PrimitiveAtom, WritableAtom };
|
|
4
|
+
export declare const useAtom: typeof import("jotai").useAtom, useSetAtom: typeof import("jotai").useSetAtom, useAtomValue: typeof import("jotai").useAtomValue, useStore: (options?: {
|
|
5
|
+
store?: {
|
|
6
|
+
get: <Value>(atom: import("jotai").Atom<Value>) => Value;
|
|
7
|
+
set: <Value_1, Args extends unknown[], Result>(atom: WritableAtom<Value_1, Args, Result>, ...args: Args) => Result;
|
|
8
|
+
sub: (atom: import("jotai").Atom<unknown>, listener: () => void) => () => void;
|
|
9
|
+
} | ({
|
|
10
|
+
get: <Value>(atom: import("jotai").Atom<Value>) => Value;
|
|
11
|
+
set: <Value_1, Args extends unknown[], Result>(atom: WritableAtom<Value_1, Args, Result>, ...args: Args) => Result;
|
|
12
|
+
sub: (atom: import("jotai").Atom<unknown>, listener: () => void) => () => void;
|
|
13
|
+
} & {
|
|
14
|
+
dev4_get_internal_weak_map: () => WeakMap<import("jotai").Atom<unknown>, {
|
|
15
|
+
readonly d: Map<import("jotai").Atom<unknown>, number>;
|
|
16
|
+
readonly p: Set<import("jotai").Atom<unknown>>;
|
|
17
|
+
n: number;
|
|
18
|
+
m?: {
|
|
19
|
+
readonly l: Set<() => void>;
|
|
20
|
+
readonly d: Set<import("jotai").Atom<unknown>>;
|
|
21
|
+
readonly t: Set<import("jotai").Atom<unknown>>;
|
|
22
|
+
u?: () => void;
|
|
23
|
+
};
|
|
24
|
+
v?: unknown;
|
|
25
|
+
e?: unknown;
|
|
26
|
+
}>;
|
|
27
|
+
dev4_get_mounted_atoms: () => Set<import("jotai").Atom<unknown>>;
|
|
28
|
+
dev4_restore_atoms: (values: Iterable<readonly [import("jotai").Atom<unknown>, unknown]>) => void;
|
|
29
|
+
});
|
|
30
|
+
} | undefined) => {
|
|
31
|
+
get: <Value>(atom: import("jotai").Atom<Value>) => Value;
|
|
32
|
+
set: <Value_1, Args extends unknown[], Result>(atom: WritableAtom<Value_1, Args, Result>, ...args: Args) => Result;
|
|
33
|
+
sub: (atom: import("jotai").Atom<unknown>, listener: () => void) => () => void;
|
|
34
|
+
} | ({
|
|
35
|
+
get: <Value>(atom: import("jotai").Atom<Value>) => Value;
|
|
36
|
+
set: <Value_1, Args extends unknown[], Result>(atom: WritableAtom<Value_1, Args, Result>, ...args: Args) => Result;
|
|
37
|
+
sub: (atom: import("jotai").Atom<unknown>, listener: () => void) => () => void;
|
|
38
|
+
} & {
|
|
39
|
+
dev4_get_internal_weak_map: () => WeakMap<import("jotai").Atom<unknown>, {
|
|
40
|
+
readonly d: Map<import("jotai").Atom<unknown>, number>;
|
|
41
|
+
readonly p: Set<import("jotai").Atom<unknown>>;
|
|
42
|
+
n: number;
|
|
43
|
+
m?: {
|
|
44
|
+
readonly l: Set<() => void>;
|
|
45
|
+
readonly d: Set<import("jotai").Atom<unknown>>;
|
|
46
|
+
readonly t: Set<import("jotai").Atom<unknown>>;
|
|
47
|
+
u?: () => void;
|
|
48
|
+
};
|
|
49
|
+
v?: unknown;
|
|
50
|
+
e?: unknown;
|
|
51
|
+
}>;
|
|
52
|
+
dev4_get_mounted_atoms: () => Set<import("jotai").Atom<unknown>>;
|
|
53
|
+
dev4_restore_atoms: (values: Iterable<readonly [import("jotai").Atom<unknown>, unknown]>) => void;
|
|
54
|
+
});
|
|
55
|
+
export declare const EditorJotaiProvider: ReturnType<typeof createIsolation>["Provider"];
|
|
56
|
+
export declare const editorJotaiStore: ReturnType<typeof createStore>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { AnimatedTrail } from "../animated-trail";
|
|
2
|
+
import type { AnimationFrameHandler } from "../animation-frame-handler";
|
|
3
|
+
import type App from "../components/App";
|
|
4
|
+
export declare class EraserTrail extends AnimatedTrail {
|
|
5
|
+
private elementsToErase;
|
|
6
|
+
private groupsToErase;
|
|
7
|
+
constructor(animationFrameHandler: AnimationFrameHandler, app: App);
|
|
8
|
+
startPath(x: number, y: number): void;
|
|
9
|
+
addPointToPath(x: number, y: number, restore?: boolean): string[];
|
|
10
|
+
private updateElementsToBeErased;
|
|
11
|
+
endPath(): void;
|
|
12
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
type CANVAS_ERROR_NAMES = "CANVAS_ERROR" | "CANVAS_POSSIBLY_TOO_BIG";
|
|
2
|
+
export declare class CanvasError extends Error {
|
|
3
|
+
constructor(message?: string, name?: CANVAS_ERROR_NAMES);
|
|
4
|
+
}
|
|
5
|
+
export declare class AbortError extends DOMException {
|
|
6
|
+
constructor(message?: string);
|
|
7
|
+
}
|
|
8
|
+
type ImageSceneDataErrorCode = "IMAGE_NOT_CONTAINS_SCENE_DATA" | "IMAGE_SCENE_DATA_ERROR";
|
|
9
|
+
export declare class ImageSceneDataError extends Error {
|
|
10
|
+
code: ImageSceneDataErrorCode;
|
|
11
|
+
constructor(message?: string, code?: ImageSceneDataErrorCode);
|
|
12
|
+
}
|
|
13
|
+
type WorkerErrorCodes = "WORKER_URL_NOT_DEFINED" | "WORKER_IN_THE_MAIN_CHUNK";
|
|
14
|
+
export declare class WorkerUrlNotDefinedError extends Error {
|
|
15
|
+
code: WorkerErrorCodes;
|
|
16
|
+
constructor(message?: string, code?: WorkerErrorCodes);
|
|
17
|
+
}
|
|
18
|
+
export declare class WorkerInTheMainChunkError extends Error {
|
|
19
|
+
code: WorkerErrorCodes;
|
|
20
|
+
constructor(message?: string, code?: WorkerErrorCodes);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Use this for generic, handled errors, so you can check against them
|
|
24
|
+
* and rethrow if needed
|
|
25
|
+
*/
|
|
26
|
+
export declare class ExcalidrawError extends Error {
|
|
27
|
+
constructor(message: string);
|
|
28
|
+
}
|
|
29
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
type DataURL = string;
|
|
2
|
+
export declare class ExcalidrawFontFace {
|
|
3
|
+
readonly urls: URL[] | DataURL[];
|
|
4
|
+
readonly fontFace: FontFace;
|
|
5
|
+
private static readonly ASSETS_FALLBACK_URL;
|
|
6
|
+
constructor(family: string, uri: string, descriptors?: FontFaceDescriptors);
|
|
7
|
+
/**
|
|
8
|
+
* Generates CSS `@font-face` definition with the (subsetted) font source as a data url for the characters within the unicode range.
|
|
9
|
+
*
|
|
10
|
+
* Retrieves `undefined` otherwise.
|
|
11
|
+
*/
|
|
12
|
+
toCSS(characters: string): Promise<string> | undefined;
|
|
13
|
+
/**
|
|
14
|
+
* Tries to fetch woff2 content, based on the registered urls (from first to last, treated as fallbacks).
|
|
15
|
+
*
|
|
16
|
+
* @returns base64 with subsetted glyphs based on the passed codepoint, last defined url otherwise
|
|
17
|
+
*/
|
|
18
|
+
getContent(codePoints: Array<number>): Promise<string>;
|
|
19
|
+
fetchFont(url: URL | DataURL): Promise<ArrayBuffer>;
|
|
20
|
+
private getUnicodeRangeRegex;
|
|
21
|
+
private static createUrls;
|
|
22
|
+
private static getFormat;
|
|
23
|
+
private static normalizeBaseUrl;
|
|
24
|
+
}
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { type FontMetadata } from "@excalidraw/common";
|
|
2
|
+
import type { ExcalidrawElement } from "@excalidraw/element/types";
|
|
3
|
+
import type { Scene } from "@excalidraw/element";
|
|
4
|
+
import { ExcalidrawFontFace } from "./ExcalidrawFontFace";
|
|
5
|
+
export declare class Fonts {
|
|
6
|
+
static readonly loadedFontsCache: Set<string>;
|
|
7
|
+
private static _registered;
|
|
8
|
+
private static _initialized;
|
|
9
|
+
static get registered(): Map<number, {
|
|
10
|
+
metadata: FontMetadata;
|
|
11
|
+
fontFaces: ExcalidrawFontFace[];
|
|
12
|
+
}>;
|
|
13
|
+
get registered(): Map<number, {
|
|
14
|
+
metadata: FontMetadata;
|
|
15
|
+
fontFaces: ExcalidrawFontFace[];
|
|
16
|
+
}>;
|
|
17
|
+
private readonly scene;
|
|
18
|
+
constructor(scene: Scene);
|
|
19
|
+
/**
|
|
20
|
+
* Get all the font families for the given scene.
|
|
21
|
+
*/
|
|
22
|
+
getSceneFamilies: () => number[];
|
|
23
|
+
/**
|
|
24
|
+
* if we load a (new) font, it's likely that text elements using it have
|
|
25
|
+
* already been rendered using a fallback font. Thus, we want invalidate
|
|
26
|
+
* their shapes and rerender. See #637.
|
|
27
|
+
*
|
|
28
|
+
* Invalidates text elements and rerenders scene, provided that at least one
|
|
29
|
+
* of the supplied fontFaces has not already been processed.
|
|
30
|
+
*/
|
|
31
|
+
onLoaded: (fontFaces: readonly FontFace[]) => void;
|
|
32
|
+
/**
|
|
33
|
+
* Load font faces for a given scene and trigger scene update.
|
|
34
|
+
*/
|
|
35
|
+
loadSceneFonts: () => Promise<FontFace[]>;
|
|
36
|
+
/**
|
|
37
|
+
* Load font faces for passed elements - use when the scene is unavailable (i.e. export).
|
|
38
|
+
*/
|
|
39
|
+
static loadElementsFonts: (elements: readonly ExcalidrawElement[]) => Promise<FontFace[]>;
|
|
40
|
+
/**
|
|
41
|
+
* Generate CSS @font-face declarations for the given elements.
|
|
42
|
+
*/
|
|
43
|
+
static generateFontFaceDeclarations(elements: readonly ExcalidrawElement[]): Promise<string[]>;
|
|
44
|
+
private static loadFontFaces;
|
|
45
|
+
private static fontFacesLoader;
|
|
46
|
+
private static fontFacesStylesGenerator;
|
|
47
|
+
/**
|
|
48
|
+
* Register a new font.
|
|
49
|
+
*
|
|
50
|
+
* @param family font family
|
|
51
|
+
* @param metadata font metadata
|
|
52
|
+
* @param fontFacesDecriptors font faces descriptors
|
|
53
|
+
*/
|
|
54
|
+
private static register;
|
|
55
|
+
/**
|
|
56
|
+
* WARN: should be called just once on init, even across multiple instances.
|
|
57
|
+
*/
|
|
58
|
+
private static init;
|
|
59
|
+
/**
|
|
60
|
+
* Get all the unique font families for the given elements.
|
|
61
|
+
*/
|
|
62
|
+
private static getUniqueFamilies;
|
|
63
|
+
/**
|
|
64
|
+
* Get all the unique characters per font family for the given scene.
|
|
65
|
+
*/
|
|
66
|
+
private static getCharsPerFamily;
|
|
67
|
+
/**
|
|
68
|
+
* Get characters for a given family.
|
|
69
|
+
*/
|
|
70
|
+
private static getCharacters;
|
|
71
|
+
/**
|
|
72
|
+
* Get all registered font families.
|
|
73
|
+
*/
|
|
74
|
+
private static getAllFamilies;
|
|
75
|
+
}
|
|
76
|
+
export interface ExcalidrawFontFaceDescriptor {
|
|
77
|
+
uri: string;
|
|
78
|
+
descriptors?: FontFaceDescriptors;
|
|
79
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type ExcalidrawFontFaceDescriptor } from "../Fonts";
|
|
2
|
+
/**
|
|
3
|
+
* The original font was modified with the following changes:
|
|
4
|
+
* - removed non-CJK codepoints
|
|
5
|
+
* - reduced any Hangul side-bearings to 40%
|
|
6
|
+
* - centered in width of inproperly centered CJK codepoints
|
|
7
|
+
*/
|
|
8
|
+
export declare const XiaolaiFontFaces: ExcalidrawFontFaceDescriptor[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Fonts";
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { Emitter } from "@excalidraw/common";
|
|
2
|
+
import { StoreDelta } from "@excalidraw/element";
|
|
3
|
+
import type { StoreSnapshot, Store } from "@excalidraw/element";
|
|
4
|
+
import type { SceneElementsMap } from "@excalidraw/element/types";
|
|
5
|
+
import type { AppState } from "./types";
|
|
6
|
+
export declare class HistoryDelta extends StoreDelta {
|
|
7
|
+
/**
|
|
8
|
+
* Apply the delta to the passed elements and appState, does not modify the snapshot.
|
|
9
|
+
*/
|
|
10
|
+
applyTo(elements: SceneElementsMap, appState: AppState, snapshot: StoreSnapshot): [SceneElementsMap, AppState, boolean];
|
|
11
|
+
/**
|
|
12
|
+
* Overriding once to avoid type casting everywhere.
|
|
13
|
+
*/
|
|
14
|
+
static calculate(prevSnapshot: StoreSnapshot, nextSnapshot: StoreSnapshot): HistoryDelta;
|
|
15
|
+
/**
|
|
16
|
+
* Overriding once to avoid type casting everywhere.
|
|
17
|
+
*/
|
|
18
|
+
static inverse(delta: StoreDelta): HistoryDelta;
|
|
19
|
+
/**
|
|
20
|
+
* Overriding once to avoid type casting everywhere.
|
|
21
|
+
*/
|
|
22
|
+
static applyLatestChanges(delta: StoreDelta, prevElements: SceneElementsMap, nextElements: SceneElementsMap, modifierOptions?: "deleted" | "inserted"): HistoryDelta;
|
|
23
|
+
}
|
|
24
|
+
export declare class HistoryChangedEvent {
|
|
25
|
+
readonly isUndoStackEmpty: boolean;
|
|
26
|
+
readonly isRedoStackEmpty: boolean;
|
|
27
|
+
constructor(isUndoStackEmpty?: boolean, isRedoStackEmpty?: boolean);
|
|
28
|
+
}
|
|
29
|
+
export declare class History {
|
|
30
|
+
private readonly store;
|
|
31
|
+
readonly onHistoryChangedEmitter: Emitter<[HistoryChangedEvent]>;
|
|
32
|
+
readonly undoStack: HistoryDelta[];
|
|
33
|
+
readonly redoStack: HistoryDelta[];
|
|
34
|
+
get isUndoStackEmpty(): boolean;
|
|
35
|
+
get isRedoStackEmpty(): boolean;
|
|
36
|
+
constructor(store: Store);
|
|
37
|
+
clear(): void;
|
|
38
|
+
/**
|
|
39
|
+
* Record a non-empty local durable increment, which will go into the undo stack..
|
|
40
|
+
* Do not re-record history entries, which were already pushed to undo / redo stack, as part of history action.
|
|
41
|
+
*/
|
|
42
|
+
record(delta: StoreDelta): void;
|
|
43
|
+
undo(elements: SceneElementsMap, appState: AppState): void | [SceneElementsMap, AppState];
|
|
44
|
+
redo(elements: SceneElementsMap, appState: AppState): void | [SceneElementsMap, AppState];
|
|
45
|
+
private perform;
|
|
46
|
+
private static pop;
|
|
47
|
+
private static push;
|
|
48
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useCallbackRefState: <T>() => readonly [T | null, (value: T | null) => void];
|