@excalidraw/element 0.18.0-9ba0f5d → 0.18.0-a52cd20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dev/index.js +13141 -8453
- package/dist/dev/index.js.map +4 -4
- package/dist/prod/index.js +20 -19
- package/dist/types/common/debug.d.ts +21 -0
- package/dist/types/common/src/appEventBus.d.ts +27 -0
- package/dist/types/common/src/colors.d.ts +24 -2
- package/dist/types/common/src/constants.d.ts +70 -7
- package/dist/types/common/src/index.d.ts +3 -0
- package/dist/types/common/src/keys.d.ts +4 -0
- package/dist/types/common/src/points.d.ts +1 -1
- package/dist/types/common/src/random.d.ts +7 -0
- package/dist/types/common/src/utils.d.ts +10 -50
- package/dist/types/common/src/versionedSnapshotStore.d.ts +17 -0
- package/dist/types/element/src/Scene.d.ts +9 -5
- package/dist/types/element/src/align.d.ts +2 -2
- package/dist/types/element/src/arrowEndpointText.d.ts +49 -0
- package/dist/types/element/src/arrowheads.d.ts +3 -0
- package/dist/types/element/src/arrows/focus.d.ts +30 -0
- package/dist/types/element/src/arrows/helpers.d.ts +5 -0
- package/dist/types/element/src/binding.d.ts +37 -17
- package/dist/types/element/src/bounds.d.ts +23 -8
- package/dist/types/element/src/bucketFill.d.ts +110 -0
- package/dist/types/element/src/collision.d.ts +7 -3
- package/dist/types/element/src/comparisons.d.ts +8 -5
- package/dist/types/element/src/convertToShape.d.ts +23 -0
- package/dist/types/element/src/delta.d.ts +23 -1
- package/dist/types/element/src/distribute.d.ts +3 -2
- package/dist/types/element/src/dragElements.d.ts +27 -0
- package/dist/types/element/src/duplicate.d.ts +64 -3
- package/dist/types/element/src/elbowArrow.d.ts +2 -0
- package/dist/types/element/src/embeddable.d.ts +2 -2
- package/dist/types/element/src/flowchart.d.ts +11 -7
- package/dist/types/element/src/fractionalIndex.d.ts +2 -2
- package/dist/types/element/src/frame.d.ts +11 -10
- package/dist/types/element/src/groups.d.ts +9 -9
- package/dist/types/element/src/index.d.ts +8 -1
- package/dist/types/element/src/linearElementEditor.d.ts +32 -10
- package/dist/types/element/src/mutateElement.d.ts +3 -1
- package/dist/types/element/src/newElement.d.ts +53 -3
- package/dist/types/element/src/renderElement.d.ts +21 -7
- package/dist/types/element/src/resizeElements.d.ts +2 -2
- package/dist/types/element/src/selection.d.ts +11 -7
- package/dist/types/element/src/shape.d.ts +28 -2
- package/dist/types/element/src/sizeHelpers.d.ts +6 -0
- package/dist/types/element/src/sortElements.d.ts +10 -0
- package/dist/types/element/src/stickyNote.d.ts +183 -0
- package/dist/types/element/src/textElement.d.ts +21 -10
- package/dist/types/element/src/textWrapping.d.ts +26 -0
- package/dist/types/element/src/transform.d.ts +26 -7
- package/dist/types/element/src/typeChecks.d.ts +29 -27
- package/dist/types/element/src/types.d.ts +48 -9
- package/dist/types/element/src/utils.d.ts +19 -6
- package/dist/types/element/src/visualdebug.d.ts +1 -2
- package/dist/types/element/src/zindex.d.ts +2 -2
- package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +125 -53
- package/dist/types/excalidraw/actions/actionAlign.d.ts +6 -6
- package/dist/types/excalidraw/actions/actionBoundText.d.ts +85 -37
- package/dist/types/excalidraw/actions/actionCanvas.d.ts +356 -1019
- package/dist/types/excalidraw/actions/actionClipboard.d.ts +84 -36
- package/dist/types/excalidraw/actions/actionCropEditor.d.ts +42 -18
- package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +130 -55
- package/dist/types/excalidraw/actions/actionDeselect.d.ts +182 -0
- package/dist/types/excalidraw/actions/actionDistribute.d.ts +2 -3
- package/dist/types/excalidraw/actions/actionElementLink.d.ts +38 -18
- package/dist/types/excalidraw/actions/actionElementLock.d.ts +85 -37
- package/dist/types/excalidraw/actions/actionExport.d.ts +133 -359
- package/dist/types/excalidraw/actions/actionFinalize.d.ts +1 -0
- package/dist/types/excalidraw/actions/actionFrame.d.ts +187 -236
- package/dist/types/excalidraw/actions/actionGroup.d.ts +100 -52
- package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +99 -21
- package/dist/types/excalidraw/actions/actionLink.d.ts +43 -19
- package/dist/types/excalidraw/actions/actionMenu.d.ts +38 -18
- package/dist/types/excalidraw/actions/actionProperties.d.ts +120 -56
- package/dist/types/excalidraw/actions/actionSelectAll.d.ts +46 -22
- package/dist/types/excalidraw/actions/actionStyles.d.ts +43 -18
- package/dist/types/excalidraw/actions/actionTextAutoResize.d.ts +3 -3
- package/dist/types/excalidraw/actions/{actionEmbeddable.d.ts → actionToggleArrowBinding.d.ts} +57 -32
- package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +46 -23
- package/dist/types/excalidraw/actions/actionToggleMidpointSnapping.d.ts +195 -0
- package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +43 -19
- package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +42 -23
- package/dist/types/excalidraw/actions/actionToggleShapeSwitch.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionToggleStats.d.ts +43 -19
- package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +44 -20
- package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +43 -19
- package/dist/types/excalidraw/actions/colorTargets.d.ts +39 -0
- package/dist/types/excalidraw/actions/index.d.ts +4 -2
- package/dist/types/excalidraw/actions/manager.d.ts +1 -0
- package/dist/types/excalidraw/actions/shortcuts.d.ts +1 -1
- package/dist/types/excalidraw/actions/types.d.ts +8 -4
- package/dist/types/excalidraw/{animated-trail.d.ts → animatedTrail.d.ts} +4 -3
- package/dist/types/excalidraw/appState.d.ts +39 -13
- package/dist/types/excalidraw/charts/charts.bar.d.ts +2 -0
- package/dist/types/excalidraw/charts/charts.constants.d.ts +48 -0
- package/dist/types/excalidraw/charts/charts.helpers.d.ts +32 -0
- package/dist/types/excalidraw/charts/charts.line.d.ts +2 -0
- package/dist/types/excalidraw/charts/charts.parse.d.ts +10 -0
- package/dist/types/excalidraw/charts/charts.radar.d.ts +2 -0
- package/dist/types/excalidraw/charts/charts.types.d.ts +18 -0
- package/dist/types/excalidraw/charts/index.d.ts +7 -0
- package/dist/types/excalidraw/clipboard.d.ts +6 -7
- package/dist/types/excalidraw/components/Actions.d.ts +17 -12
- package/dist/types/excalidraw/components/ActiveConfirmDialog.d.ts +1 -1
- package/dist/types/excalidraw/components/App.arrowText.d.ts +70 -0
- package/dist/types/excalidraw/components/App.bucketFill.d.ts +48 -0
- package/dist/types/excalidraw/components/App.cursor.d.ts +38 -0
- package/dist/types/excalidraw/components/App.d.ts +604 -89
- package/dist/types/excalidraw/components/App.drawshape.d.ts +55 -0
- package/dist/types/excalidraw/components/App.duplicate.d.ts +51 -0
- package/dist/types/excalidraw/components/App.flowchart.d.ts +21 -0
- package/dist/types/excalidraw/components/App.pan.d.ts +62 -0
- package/dist/types/excalidraw/components/App.textTool.d.ts +140 -0
- package/dist/types/excalidraw/components/App.toolDrag.d.ts +63 -0
- package/dist/types/excalidraw/components/App.viewport.d.ts +113 -0
- package/dist/types/excalidraw/components/App.wheel.d.ts +26 -0
- package/dist/types/excalidraw/components/AppStateObserver.d.ts +37 -0
- package/dist/types/excalidraw/components/ColorPicker/ColorPicker.d.ts +9 -3
- package/dist/types/excalidraw/components/ColorPicker/CustomColorList.d.ts +3 -1
- package/dist/types/excalidraw/components/ColorPicker/Picker.d.ts +5 -1
- package/dist/types/excalidraw/components/ColorPicker/PickerColorList.d.ts +9 -2
- package/dist/types/excalidraw/components/ColorPicker/ShadeList.d.ts +4 -2
- package/dist/types/excalidraw/components/ColorPicker/TopPicks.d.ts +8 -1
- package/dist/types/excalidraw/components/ColorPicker/colorPickerUtils.d.ts +1 -1
- package/dist/types/excalidraw/components/ColorPicker/colorTopPicksDnD.d.ts +11 -0
- package/dist/types/excalidraw/components/ColorPicker/keyboardNavHandlers.d.ts +2 -1
- package/dist/types/excalidraw/components/CommandPalette/defaultCommandPaletteItems.d.ts +1 -2
- package/dist/types/excalidraw/components/CommandPalette/types.d.ts +1 -1
- package/dist/types/excalidraw/components/ConvertElementTypePopup.d.ts +2 -2
- package/dist/types/excalidraw/components/CursorHint.d.ts +46 -0
- package/dist/types/excalidraw/components/EyeDropper.d.ts +1 -1
- package/dist/types/excalidraw/components/FileDropOverlay.d.ts +2 -0
- package/dist/types/excalidraw/components/FontPicker/FontPicker.d.ts +4 -1
- package/dist/types/excalidraw/components/FontPicker/FontPickerList.d.ts +6 -1
- package/dist/types/excalidraw/components/FontPicker/fontTopPicksDnD.d.ts +12 -0
- package/dist/types/excalidraw/components/IconButton.d.ts +48 -0
- package/dist/types/excalidraw/components/IconPicker.d.ts +14 -9
- package/dist/types/excalidraw/components/Island.d.ts +7 -0
- package/dist/types/excalidraw/components/LaserPointerButton.d.ts +2 -4
- package/dist/types/excalidraw/components/LayerUI.d.ts +5 -2
- package/dist/types/excalidraw/components/LibraryMenu.d.ts +1 -1
- package/dist/types/excalidraw/components/LibraryMenuSection.d.ts +6 -2
- package/dist/types/excalidraw/components/LibraryUnit.d.ts +7 -2
- package/dist/types/excalidraw/components/LockButton.d.ts +3 -4
- package/dist/types/excalidraw/components/MagicButton.d.ts +0 -2
- package/dist/types/excalidraw/components/MobileMenu.d.ts +4 -4
- package/dist/types/excalidraw/components/MobileToolbar.d.ts +9 -0
- package/dist/types/excalidraw/components/OverwriteConfirm/OverwriteConfirmState.d.ts +1 -1
- package/dist/types/excalidraw/components/PasteChartDialog.d.ts +4 -5
- package/dist/types/excalidraw/components/PenModeButton.d.ts +2 -5
- package/dist/types/excalidraw/components/Popover.d.ts +1 -3
- package/dist/types/excalidraw/components/PropertiesPopover.d.ts +1 -1
- package/dist/types/excalidraw/components/{ButtonIcon.d.ts → RadioButton.d.ts} +2 -5
- package/dist/types/excalidraw/components/Range.d.ts +10 -4
- package/dist/types/excalidraw/components/SVGLayer.d.ts +1 -1
- package/dist/types/excalidraw/components/SearchMenu.d.ts +1 -1
- package/dist/types/excalidraw/components/Sidebar/Sidebar.d.ts +1 -1
- package/dist/types/excalidraw/components/Stats/Angle.d.ts +2 -2
- package/dist/types/excalidraw/components/Stats/Dimension.d.ts +2 -2
- package/dist/types/excalidraw/components/Stats/DragInput.d.ts +2 -2
- package/dist/types/excalidraw/components/Stats/MultiAngle.d.ts +2 -2
- package/dist/types/excalidraw/components/Stats/MultiDimension.d.ts +2 -2
- package/dist/types/excalidraw/components/Stats/MultiPosition.d.ts +2 -2
- package/dist/types/excalidraw/components/Stats/Position.d.ts +3 -3
- package/dist/types/excalidraw/components/Stats/utils.d.ts +1 -1
- package/dist/types/excalidraw/components/TTDDialog/Chat/ChatInterface.d.ts +2 -6
- package/dist/types/excalidraw/components/TTDDialog/Chat/TTDChatPanel.d.ts +2 -1
- package/dist/types/excalidraw/components/TTDDialog/CodeMirrorEditor.d.ts +11 -0
- package/dist/types/excalidraw/components/TTDDialog/TTDContext.d.ts +4 -4
- package/dist/types/excalidraw/components/TTDDialog/TTDDialog.d.ts +11 -7
- package/dist/types/excalidraw/components/TTDDialog/TTDDialogInput.d.ts +3 -3
- package/dist/types/excalidraw/components/TTDDialog/TTDDialogOutput.d.ts +4 -1
- package/dist/types/excalidraw/components/TTDDialog/TTDWelcomeMessage.d.ts +1 -0
- package/dist/types/excalidraw/components/TTDDialog/TextToDiagram.d.ts +2 -1
- package/dist/types/excalidraw/components/TTDDialog/mermaid-lang-lite.d.ts +2 -0
- package/dist/types/excalidraw/components/TTDDialog/types.d.ts +4 -0
- package/dist/types/excalidraw/components/TTDDialog/useTTDChatStorage.d.ts +3 -3
- package/dist/types/excalidraw/components/TTDDialog/utils/mermaidAutoFix.d.ts +1 -0
- package/dist/types/excalidraw/components/TTDDialog/utils/mermaidError.d.ts +10 -0
- package/dist/types/excalidraw/components/Toast.d.ts +8 -4
- package/dist/types/excalidraw/components/ToolPopover.d.ts +3 -6
- package/dist/types/excalidraw/components/Toolbar.d.ts +11 -0
- package/dist/types/excalidraw/components/Tools.d.ts +151 -0
- package/dist/types/excalidraw/components/Tooltip.d.ts +15 -1
- package/dist/types/excalidraw/components/TopPicksDnD/TopPicksContextMenu.d.ts +14 -0
- package/dist/types/excalidraw/components/TopPicksDnD/TopPicksTip.d.ts +11 -0
- package/dist/types/excalidraw/components/TopPicksDnD/topPicksDnD.d.ts +58 -0
- package/dist/types/excalidraw/components/UserList.d.ts +3 -2
- package/dist/types/excalidraw/components/ViewportStatusFrame/ViewportStatusFrame.d.ts +11 -0
- package/dist/types/excalidraw/components/canvases/InteractiveCanvas.d.ts +4 -1
- package/dist/types/excalidraw/components/canvases/NewElementCanvas.d.ts +3 -0
- package/dist/types/excalidraw/components/canvases/StaticCanvas.d.ts +1 -1
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenu.d.ts +30 -16
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuContent.d.ts +3 -2
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItem.d.ts +11 -12
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemCheckbox.d.ts +5 -0
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemContent.d.ts +2 -1
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemContentRadio.d.ts +2 -1
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuSub.d.ts +23 -0
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuSubContent.d.ts +8 -0
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuSubTrigger.d.ts +12 -0
- package/dist/types/excalidraw/components/dropdownMenu/common.d.ts +1 -1
- package/dist/types/excalidraw/components/dropdownMenu/dropdownMenuUtils.d.ts +2 -0
- package/dist/types/excalidraw/components/footer/Footer.d.ts +3 -1
- package/dist/types/excalidraw/components/hyperlink/helpers.d.ts +2 -2
- package/dist/types/excalidraw/components/icons.d.ts +30 -10
- package/dist/types/excalidraw/components/main-menu/DefaultItems.d.ts +26 -3
- package/dist/types/excalidraw/components/main-menu/MainMenu.d.ts +23 -14
- package/dist/types/excalidraw/components/positionElementBesideCursor.d.ts +26 -0
- package/dist/types/excalidraw/components/shapeActionPredicates.d.ts +39 -0
- package/dist/types/excalidraw/data/blob.d.ts +107 -60
- package/dist/types/excalidraw/data/filesystem.d.ts +3 -5
- package/dist/types/excalidraw/data/index.d.ts +6 -7
- package/dist/types/excalidraw/data/json.d.ts +62 -30
- package/dist/types/excalidraw/data/library.d.ts +1 -1
- package/dist/types/excalidraw/data/resave.d.ts +7 -2
- package/dist/types/excalidraw/drawShapeTrail.d.ts +16 -0
- package/dist/types/excalidraw/eraser/index.d.ts +2 -3
- package/dist/types/excalidraw/fonts/Fonts.d.ts +3 -2
- package/dist/types/excalidraw/hooks/useAppStateValue.d.ts +29 -0
- package/dist/types/excalidraw/hooks/useLibraryItemSvg.d.ts +1 -1
- package/dist/types/excalidraw/hooks/useTextEditorFocus.d.ts +5 -5
- package/dist/types/excalidraw/{laser-trails.d.ts → laserTrails.d.ts} +5 -7
- package/dist/types/excalidraw/lasso/index.d.ts +2 -3
- package/dist/types/excalidraw/lasso/utils.d.ts +2 -0
- package/dist/types/excalidraw/renderOverrides.d.ts +9 -0
- package/dist/types/excalidraw/renderer/animation.d.ts +5 -1
- package/dist/types/excalidraw/renderer/helpers.d.ts +25 -0
- package/dist/types/excalidraw/renderer/interactiveScene.d.ts +2 -4
- package/dist/types/excalidraw/scene/Renderer.d.ts +489 -20
- package/dist/types/excalidraw/scene/export.d.ts +3 -3
- package/dist/types/excalidraw/scene/index.d.ts +2 -2
- package/dist/types/excalidraw/scene/types.d.ts +7 -4
- package/dist/types/excalidraw/snapping.d.ts +7 -7
- package/dist/types/excalidraw/textAutoResizeHandle.d.ts +15 -0
- package/dist/types/excalidraw/types.d.ts +619 -42
- package/dist/types/excalidraw/viewport.d.ts +302 -0
- package/dist/types/excalidraw/wysiwyg/textWysiwyg.d.ts +12 -3
- package/dist/types/fractional-indexing/src/index.d.ts +29 -0
- package/dist/types/laser-pointer/src/index.d.ts +2 -0
- package/dist/types/laser-pointer/src/math.d.ts +16 -0
- package/dist/types/laser-pointer/src/simplify.d.ts +2 -0
- package/dist/types/laser-pointer/src/state.d.ts +36 -0
- package/dist/types/math/src/constants.d.ts +0 -1
- package/dist/types/math/src/curve.d.ts +23 -13
- package/dist/types/math/src/index.d.ts +1 -0
- package/dist/types/math/src/pca.d.ts +79 -0
- package/dist/types/math/src/point.d.ts +8 -2
- package/dist/types/math/src/polygon.d.ts +25 -1
- package/dist/types/math/src/segment.d.ts +6 -0
- package/dist/types/math/src/types.d.ts +25 -1
- package/dist/types/utils/src/export.d.ts +4 -3
- package/dist/types/utils/src/index.d.ts +1 -2
- package/dist/types/utils/src/shape.d.ts +2 -2
- package/package.json +4 -3
- package/dist/types/excalidraw/animation-frame-handler.d.ts +0 -16
- package/dist/types/excalidraw/charts.d.ts +0 -27
- package/dist/types/excalidraw/components/DiagramToCodePlugin/DiagramToCodePlugin.d.ts +0 -4
- package/dist/types/excalidraw/components/ExcalidrawLogo.d.ts +0 -15
- package/dist/types/excalidraw/components/FollowMode/FollowMode.d.ts +0 -10
- package/dist/types/excalidraw/components/HandButton.d.ts +0 -10
- package/dist/types/excalidraw/components/InitializeApp.d.ts +0 -10
- package/dist/types/excalidraw/components/MobileToolBar.d.ts +0 -10
- package/dist/types/excalidraw/components/TTDDialog/TTDDialogTrigger.d.ts +0 -8
- package/dist/types/excalidraw/components/TTDDialog/utils/TTDStreamFetch.d.ts +0 -24
- package/dist/types/excalidraw/components/ToolButton.d.ts +0 -49
- package/dist/types/excalidraw/components/footer/FooterCenter.d.ts +0 -8
- package/dist/types/excalidraw/components/live-collaboration/LiveCollaborationTrigger.d.ts +0 -11
- package/dist/types/excalidraw/components/shapes.d.ts +0 -190
- package/dist/types/excalidraw/components/welcome-screen/WelcomeScreen.Center.d.ts +0 -58
- package/dist/types/excalidraw/components/welcome-screen/WelcomeScreen.Hints.d.ts +0 -19
- package/dist/types/excalidraw/components/welcome-screen/WelcomeScreen.d.ts +0 -84
- package/dist/types/excalidraw/cursor.d.ts +0 -5
- package/dist/types/excalidraw/data/reconcile.d.ts +0 -7
- package/dist/types/excalidraw/index.d.ts +0 -46
- package/dist/types/excalidraw/polyfill.d.ts +0 -2
- package/dist/types/excalidraw/scene/scroll.d.ts +0 -18
- package/dist/types/excalidraw/scene/zoom.d.ts +0 -12
- package/dist/types/utils/src/bbox.d.ts +0 -9
- package/dist/types/utils/src/withinBounds.d.ts +0 -19
|
@@ -2,12 +2,11 @@ import { IMAGE_MIME_TYPES, MIME_TYPES } from "@excalidraw/common";
|
|
|
2
2
|
import type { ValueOf } from "@excalidraw/common/utility-types";
|
|
3
3
|
import type { ExcalidrawElement, FileId } from "@excalidraw/element/types";
|
|
4
4
|
import type { AppState, DataURL, LibraryItem } from "../types";
|
|
5
|
-
import type { FileSystemHandle } from "browser-fs-access";
|
|
6
5
|
import type { ImportedLibraryData } from "./types";
|
|
7
6
|
export declare const getMimeType: (blob: Blob | string) => string;
|
|
8
|
-
export declare const getFileHandleType: (handle:
|
|
7
|
+
export declare const getFileHandleType: (handle: FileSystemFileHandle | null) => string | null;
|
|
9
8
|
export declare const isImageFileHandleType: (type: string | null) => type is "png" | "svg";
|
|
10
|
-
export declare const isImageFileHandle: (handle:
|
|
9
|
+
export declare const isImageFileHandle: (handle: FileSystemFileHandle | null) => handle is FileSystemFileHandle;
|
|
11
10
|
export declare const isSupportedImageFileType: (type: string | null | undefined) => boolean;
|
|
12
11
|
export declare const isSupportedImageFile: (blob: Blob | null | undefined) => blob is Blob & {
|
|
13
12
|
type: ValueOf<typeof IMAGE_MIME_TYPES>;
|
|
@@ -15,8 +14,8 @@ export declare const isSupportedImageFile: (blob: Blob | null | undefined) => bl
|
|
|
15
14
|
export declare const loadSceneOrLibraryFromBlob: (blob: Blob | File,
|
|
16
15
|
/** @see restore.localAppState */
|
|
17
16
|
localAppState: AppState | null, localElements: readonly ExcalidrawElement[] | null,
|
|
18
|
-
/**
|
|
19
|
-
fileHandle?:
|
|
17
|
+
/** FileSystemFileHandle. Defaults to `blob.handle` if defined, otherwise null. */
|
|
18
|
+
fileHandle?: FileSystemFileHandle | null) => Promise<{
|
|
20
19
|
type: "application/vnd.excalidraw+json";
|
|
21
20
|
data: {
|
|
22
21
|
elements: import("@excalidraw/element/types").OrderedExcalidrawElement[];
|
|
@@ -46,12 +45,21 @@ fileHandle?: FileSystemHandle | null) => Promise<{
|
|
|
46
45
|
} | {
|
|
47
46
|
name: "elementLinkSelector";
|
|
48
47
|
sourceElementId: ExcalidrawElement["id"];
|
|
48
|
+
} | {
|
|
49
|
+
name: "charts";
|
|
50
|
+
data: import("../charts").Spreadsheet;
|
|
51
|
+
rawText: string;
|
|
49
52
|
};
|
|
50
53
|
editingGroupId: import("@excalidraw/element/types").GroupId | null;
|
|
51
54
|
selectedElementIds: Readonly<{
|
|
52
55
|
[id: string]: true;
|
|
53
56
|
}>;
|
|
54
57
|
frameToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
|
|
58
|
+
activeTool: {
|
|
59
|
+
lastActiveTool: import("../types").ActiveTool | null;
|
|
60
|
+
locked: boolean;
|
|
61
|
+
fromSelection: boolean;
|
|
62
|
+
} & import("../types").ActiveTool;
|
|
55
63
|
activeEmbeddable: {
|
|
56
64
|
element: import("@excalidraw/element/types").NonDeletedExcalidrawElement;
|
|
57
65
|
state: "hover" | "active";
|
|
@@ -64,13 +72,29 @@ fileHandle?: FileSystemHandle | null) => Promise<{
|
|
|
64
72
|
multiElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawLinearElement> | null;
|
|
65
73
|
newElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawNonSelectionElement> | null;
|
|
66
74
|
isBindingEnabled: boolean;
|
|
67
|
-
|
|
75
|
+
isMidpointSnappingEnabled: boolean;
|
|
76
|
+
gridModeEnabled: boolean;
|
|
77
|
+
suggestedBinding: {
|
|
78
|
+
element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
|
|
79
|
+
midPoint?: import("@excalidraw/math").GlobalPoint;
|
|
80
|
+
} | null;
|
|
81
|
+
textToolHover: {
|
|
82
|
+
type: "text";
|
|
83
|
+
elementId: ExcalidrawElement["id"];
|
|
84
|
+
} | {
|
|
85
|
+
type: "container";
|
|
86
|
+
elementId: ExcalidrawElement["id"];
|
|
87
|
+
} | {
|
|
88
|
+
type: "arrow";
|
|
89
|
+
elementId: import("@excalidraw/element/types").ExcalidrawArrowElement["id"];
|
|
90
|
+
anchor: "start" | "end" | "label";
|
|
91
|
+
} | null;
|
|
68
92
|
isRotating: boolean;
|
|
69
|
-
elementsToHighlight: import("@excalidraw/element/types").
|
|
93
|
+
elementsToHighlight: readonly import("@excalidraw/element/types").NonDeletedExcalidrawElement[] | null;
|
|
70
94
|
collaborators: Map<import("../types").SocketId, import("../types").Collaborator>;
|
|
71
95
|
snapLines: readonly import("../snapping").SnapLine[];
|
|
72
96
|
zenModeEnabled: boolean;
|
|
73
|
-
editingTextElement: import("@excalidraw/element/types").
|
|
97
|
+
editingTextElement: import("@excalidraw/element/types").ExcalidrawTextElement | null;
|
|
74
98
|
isCropping: boolean;
|
|
75
99
|
croppingElementId: ExcalidrawElement["id"] | null;
|
|
76
100
|
searchMatches: Readonly<{
|
|
@@ -83,8 +107,9 @@ fileHandle?: FileSystemHandle | null) => Promise<{
|
|
|
83
107
|
}>;
|
|
84
108
|
shouldCacheIgnoreZoom: boolean;
|
|
85
109
|
exportScale: number;
|
|
86
|
-
|
|
110
|
+
currentItemArrowType: "sharp" | "round" | "elbow";
|
|
87
111
|
gridSize: number;
|
|
112
|
+
bindMode: import("@excalidraw/element/types").BindMode;
|
|
88
113
|
contextMenu: {
|
|
89
114
|
items: import("../components/ContextMenu").ContextMenuItems;
|
|
90
115
|
top: number;
|
|
@@ -94,13 +119,11 @@ fileHandle?: FileSystemHandle | null) => Promise<{
|
|
|
94
119
|
isLoading: boolean;
|
|
95
120
|
errorMessage: React.ReactNode;
|
|
96
121
|
resizingElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
fromSelection: boolean;
|
|
103
|
-
} & import("../types").ActiveTool;
|
|
122
|
+
boxSelectionMode: import("../types").BoxSelectionMode;
|
|
123
|
+
bindingPreference: "enabled" | "disabled";
|
|
124
|
+
showHints: boolean;
|
|
125
|
+
inputDevice: import("../types").InputDevice;
|
|
126
|
+
editingFrame: import("@excalidraw/element/types").ExcalidrawFrameLikeElement["id"] | null;
|
|
104
127
|
preferredSelectionTool: {
|
|
105
128
|
type: "selection" | "lasso";
|
|
106
129
|
initialized: boolean;
|
|
@@ -111,11 +134,14 @@ fileHandle?: FileSystemHandle | null) => Promise<{
|
|
|
111
134
|
exportEmbedScene: boolean;
|
|
112
135
|
exportWithDarkMode: boolean;
|
|
113
136
|
currentItemStrokeColor: string;
|
|
137
|
+
currentItemStickynoteStrokeColor: string;
|
|
138
|
+
currentItemStickynoteBackgroundColor: string;
|
|
114
139
|
currentItemBackgroundColor: string;
|
|
115
140
|
currentItemFillStyle: ExcalidrawElement["fillStyle"];
|
|
116
|
-
|
|
141
|
+
currentItemStrokeWidthKey: import("@excalidraw/common").StrokeWidthKey;
|
|
117
142
|
currentItemStrokeStyle: ExcalidrawElement["strokeStyle"];
|
|
118
143
|
currentItemRoughness: number;
|
|
144
|
+
currentItemStrokeVariability: import("@excalidraw/element/types").StrokeVariability;
|
|
119
145
|
currentItemOpacity: number;
|
|
120
146
|
currentItemFontFamily: import("@excalidraw/element/types").FontFamilyValues;
|
|
121
147
|
currentItemFontSize: number;
|
|
@@ -124,7 +150,7 @@ fileHandle?: FileSystemHandle | null) => Promise<{
|
|
|
124
150
|
currentItemEndArrowhead: import("@excalidraw/element/types").Arrowhead | null;
|
|
125
151
|
currentHoveredFontFamily: import("@excalidraw/element/types").FontFamilyValues | null;
|
|
126
152
|
currentItemRoundness: import("@excalidraw/element/types").StrokeRoundness;
|
|
127
|
-
|
|
153
|
+
scrollConstraints: import("../types").ScrollConstraints | null;
|
|
128
154
|
cursorButton: "up" | "down";
|
|
129
155
|
scrolledOutside: boolean;
|
|
130
156
|
isResizing: boolean;
|
|
@@ -141,36 +167,33 @@ fileHandle?: FileSystemHandle | null) => Promise<{
|
|
|
141
167
|
};
|
|
142
168
|
selectedElementsAreBeingDragged: boolean;
|
|
143
169
|
toast: {
|
|
144
|
-
message:
|
|
170
|
+
message: React.ReactNode;
|
|
145
171
|
closable?: boolean;
|
|
146
172
|
duration?: number;
|
|
147
173
|
} | null;
|
|
148
174
|
gridStep: number;
|
|
149
|
-
|
|
150
|
-
fileHandle: FileSystemHandle | null;
|
|
175
|
+
fileHandle: FileSystemFileHandle | null;
|
|
151
176
|
stats: {
|
|
152
177
|
open: boolean;
|
|
153
178
|
panels: number;
|
|
154
179
|
};
|
|
155
|
-
currentChartType: import("@excalidraw/element/types").ChartType;
|
|
156
|
-
pasteDialog: {
|
|
157
|
-
shown: false;
|
|
158
|
-
data: null;
|
|
159
|
-
} | {
|
|
160
|
-
shown: true;
|
|
161
|
-
data: import("../charts").Spreadsheet;
|
|
162
|
-
};
|
|
163
180
|
showHyperlinkPopup: false | "info" | "editor";
|
|
164
181
|
originSnapOffset: {
|
|
165
182
|
x: number;
|
|
166
183
|
y: number;
|
|
167
184
|
} | null;
|
|
168
185
|
objectsSnapModeEnabled: boolean;
|
|
169
|
-
userToFollow: import("../types").UserToFollow | null;
|
|
170
|
-
followedBy: Set<import("../types").SocketId>;
|
|
171
186
|
lockedMultiSelections: {
|
|
172
187
|
[groupId: string]: true;
|
|
173
188
|
};
|
|
189
|
+
colorTopPicks: {
|
|
190
|
+
elementStroke: readonly string[] | null;
|
|
191
|
+
elementBackground: readonly string[] | null;
|
|
192
|
+
bucketFill: readonly string[] | null;
|
|
193
|
+
stickyNoteStroke: readonly string[] | null;
|
|
194
|
+
stickyNoteBackground: readonly string[] | null;
|
|
195
|
+
};
|
|
196
|
+
fontTopPicks: readonly import("@excalidraw/element/types").FontFamilyValues[] | null;
|
|
174
197
|
};
|
|
175
198
|
files: import("../types").BinaryFiles;
|
|
176
199
|
};
|
|
@@ -181,8 +204,8 @@ fileHandle?: FileSystemHandle | null) => Promise<{
|
|
|
181
204
|
export declare const loadFromBlob: (blob: Blob,
|
|
182
205
|
/** @see restore.localAppState */
|
|
183
206
|
localAppState: AppState | null, localElements: readonly ExcalidrawElement[] | null,
|
|
184
|
-
/**
|
|
185
|
-
fileHandle?:
|
|
207
|
+
/** FileSystemFileHandle. Defaults to `blob.handle` if defined, otherwise null. */
|
|
208
|
+
fileHandle?: FileSystemFileHandle | null) => Promise<{
|
|
186
209
|
elements: import("@excalidraw/element/types").OrderedExcalidrawElement[];
|
|
187
210
|
appState: {
|
|
188
211
|
viewBackgroundColor: string;
|
|
@@ -210,12 +233,21 @@ fileHandle?: FileSystemHandle | null) => Promise<{
|
|
|
210
233
|
} | {
|
|
211
234
|
name: "elementLinkSelector";
|
|
212
235
|
sourceElementId: ExcalidrawElement["id"];
|
|
236
|
+
} | {
|
|
237
|
+
name: "charts";
|
|
238
|
+
data: import("../charts").Spreadsheet;
|
|
239
|
+
rawText: string;
|
|
213
240
|
};
|
|
214
241
|
editingGroupId: import("@excalidraw/element/types").GroupId | null;
|
|
215
242
|
selectedElementIds: Readonly<{
|
|
216
243
|
[id: string]: true;
|
|
217
244
|
}>;
|
|
218
245
|
frameToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
|
|
246
|
+
activeTool: {
|
|
247
|
+
lastActiveTool: import("../types").ActiveTool | null;
|
|
248
|
+
locked: boolean;
|
|
249
|
+
fromSelection: boolean;
|
|
250
|
+
} & import("../types").ActiveTool;
|
|
219
251
|
activeEmbeddable: {
|
|
220
252
|
element: import("@excalidraw/element/types").NonDeletedExcalidrawElement;
|
|
221
253
|
state: "hover" | "active";
|
|
@@ -228,13 +260,29 @@ fileHandle?: FileSystemHandle | null) => Promise<{
|
|
|
228
260
|
multiElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawLinearElement> | null;
|
|
229
261
|
newElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawNonSelectionElement> | null;
|
|
230
262
|
isBindingEnabled: boolean;
|
|
231
|
-
|
|
263
|
+
isMidpointSnappingEnabled: boolean;
|
|
264
|
+
gridModeEnabled: boolean;
|
|
265
|
+
suggestedBinding: {
|
|
266
|
+
element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
|
|
267
|
+
midPoint?: import("@excalidraw/math").GlobalPoint;
|
|
268
|
+
} | null;
|
|
269
|
+
textToolHover: {
|
|
270
|
+
type: "text";
|
|
271
|
+
elementId: ExcalidrawElement["id"];
|
|
272
|
+
} | {
|
|
273
|
+
type: "container";
|
|
274
|
+
elementId: ExcalidrawElement["id"];
|
|
275
|
+
} | {
|
|
276
|
+
type: "arrow";
|
|
277
|
+
elementId: import("@excalidraw/element/types").ExcalidrawArrowElement["id"];
|
|
278
|
+
anchor: "start" | "end" | "label";
|
|
279
|
+
} | null;
|
|
232
280
|
isRotating: boolean;
|
|
233
|
-
elementsToHighlight: import("@excalidraw/element/types").
|
|
281
|
+
elementsToHighlight: readonly import("@excalidraw/element/types").NonDeletedExcalidrawElement[] | null;
|
|
234
282
|
collaborators: Map<import("../types").SocketId, import("../types").Collaborator>;
|
|
235
283
|
snapLines: readonly import("../snapping").SnapLine[];
|
|
236
284
|
zenModeEnabled: boolean;
|
|
237
|
-
editingTextElement: import("@excalidraw/element/types").
|
|
285
|
+
editingTextElement: import("@excalidraw/element/types").ExcalidrawTextElement | null;
|
|
238
286
|
isCropping: boolean;
|
|
239
287
|
croppingElementId: ExcalidrawElement["id"] | null;
|
|
240
288
|
searchMatches: Readonly<{
|
|
@@ -247,8 +295,9 @@ fileHandle?: FileSystemHandle | null) => Promise<{
|
|
|
247
295
|
}>;
|
|
248
296
|
shouldCacheIgnoreZoom: boolean;
|
|
249
297
|
exportScale: number;
|
|
250
|
-
|
|
298
|
+
currentItemArrowType: "sharp" | "round" | "elbow";
|
|
251
299
|
gridSize: number;
|
|
300
|
+
bindMode: import("@excalidraw/element/types").BindMode;
|
|
252
301
|
contextMenu: {
|
|
253
302
|
items: import("../components/ContextMenu").ContextMenuItems;
|
|
254
303
|
top: number;
|
|
@@ -258,13 +307,11 @@ fileHandle?: FileSystemHandle | null) => Promise<{
|
|
|
258
307
|
isLoading: boolean;
|
|
259
308
|
errorMessage: React.ReactNode;
|
|
260
309
|
resizingElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
fromSelection: boolean;
|
|
267
|
-
} & import("../types").ActiveTool;
|
|
310
|
+
boxSelectionMode: import("../types").BoxSelectionMode;
|
|
311
|
+
bindingPreference: "enabled" | "disabled";
|
|
312
|
+
showHints: boolean;
|
|
313
|
+
inputDevice: import("../types").InputDevice;
|
|
314
|
+
editingFrame: import("@excalidraw/element/types").ExcalidrawFrameLikeElement["id"] | null;
|
|
268
315
|
preferredSelectionTool: {
|
|
269
316
|
type: "selection" | "lasso";
|
|
270
317
|
initialized: boolean;
|
|
@@ -275,11 +322,14 @@ fileHandle?: FileSystemHandle | null) => Promise<{
|
|
|
275
322
|
exportEmbedScene: boolean;
|
|
276
323
|
exportWithDarkMode: boolean;
|
|
277
324
|
currentItemStrokeColor: string;
|
|
325
|
+
currentItemStickynoteStrokeColor: string;
|
|
326
|
+
currentItemStickynoteBackgroundColor: string;
|
|
278
327
|
currentItemBackgroundColor: string;
|
|
279
328
|
currentItemFillStyle: ExcalidrawElement["fillStyle"];
|
|
280
|
-
|
|
329
|
+
currentItemStrokeWidthKey: import("@excalidraw/common").StrokeWidthKey;
|
|
281
330
|
currentItemStrokeStyle: ExcalidrawElement["strokeStyle"];
|
|
282
331
|
currentItemRoughness: number;
|
|
332
|
+
currentItemStrokeVariability: import("@excalidraw/element/types").StrokeVariability;
|
|
283
333
|
currentItemOpacity: number;
|
|
284
334
|
currentItemFontFamily: import("@excalidraw/element/types").FontFamilyValues;
|
|
285
335
|
currentItemFontSize: number;
|
|
@@ -288,7 +338,7 @@ fileHandle?: FileSystemHandle | null) => Promise<{
|
|
|
288
338
|
currentItemEndArrowhead: import("@excalidraw/element/types").Arrowhead | null;
|
|
289
339
|
currentHoveredFontFamily: import("@excalidraw/element/types").FontFamilyValues | null;
|
|
290
340
|
currentItemRoundness: import("@excalidraw/element/types").StrokeRoundness;
|
|
291
|
-
|
|
341
|
+
scrollConstraints: import("../types").ScrollConstraints | null;
|
|
292
342
|
cursorButton: "up" | "down";
|
|
293
343
|
scrolledOutside: boolean;
|
|
294
344
|
isResizing: boolean;
|
|
@@ -305,36 +355,33 @@ fileHandle?: FileSystemHandle | null) => Promise<{
|
|
|
305
355
|
};
|
|
306
356
|
selectedElementsAreBeingDragged: boolean;
|
|
307
357
|
toast: {
|
|
308
|
-
message:
|
|
358
|
+
message: React.ReactNode;
|
|
309
359
|
closable?: boolean;
|
|
310
360
|
duration?: number;
|
|
311
361
|
} | null;
|
|
312
362
|
gridStep: number;
|
|
313
|
-
|
|
314
|
-
fileHandle: FileSystemHandle | null;
|
|
363
|
+
fileHandle: FileSystemFileHandle | null;
|
|
315
364
|
stats: {
|
|
316
365
|
open: boolean;
|
|
317
366
|
panels: number;
|
|
318
367
|
};
|
|
319
|
-
currentChartType: import("@excalidraw/element/types").ChartType;
|
|
320
|
-
pasteDialog: {
|
|
321
|
-
shown: false;
|
|
322
|
-
data: null;
|
|
323
|
-
} | {
|
|
324
|
-
shown: true;
|
|
325
|
-
data: import("../charts").Spreadsheet;
|
|
326
|
-
};
|
|
327
368
|
showHyperlinkPopup: false | "info" | "editor";
|
|
328
369
|
originSnapOffset: {
|
|
329
370
|
x: number;
|
|
330
371
|
y: number;
|
|
331
372
|
} | null;
|
|
332
373
|
objectsSnapModeEnabled: boolean;
|
|
333
|
-
userToFollow: import("../types").UserToFollow | null;
|
|
334
|
-
followedBy: Set<import("../types").SocketId>;
|
|
335
374
|
lockedMultiSelections: {
|
|
336
375
|
[groupId: string]: true;
|
|
337
376
|
};
|
|
377
|
+
colorTopPicks: {
|
|
378
|
+
elementStroke: readonly string[] | null;
|
|
379
|
+
elementBackground: readonly string[] | null;
|
|
380
|
+
bucketFill: readonly string[] | null;
|
|
381
|
+
stickyNoteStroke: readonly string[] | null;
|
|
382
|
+
stickyNoteBackground: readonly string[] | null;
|
|
383
|
+
};
|
|
384
|
+
fontTopPicks: readonly import("@excalidraw/element/types").FontFamilyValues[] | null;
|
|
338
385
|
};
|
|
339
386
|
files: import("../types").BinaryFiles;
|
|
340
387
|
}>;
|
|
@@ -358,7 +405,7 @@ export declare const SVGStringToFile: (SVGString: string, filename?: string) =>
|
|
|
358
405
|
type: typeof MIME_TYPES.svg;
|
|
359
406
|
};
|
|
360
407
|
export declare const ImageURLToFile: (imageUrl: string, filename?: string) => Promise<File | undefined>;
|
|
361
|
-
export declare const getFileHandle: (event: DragEvent | React.DragEvent | DataTransferItem) => Promise<
|
|
408
|
+
export declare const getFileHandle: (event: DragEvent | React.DragEvent | DataTransferItem) => Promise<FileSystemFileHandle | null>;
|
|
362
409
|
export declare const createFile: (blob: File | Blob | ArrayBuffer, mimeType: string, name: string | undefined) => File;
|
|
363
410
|
/** attempts to detect correct mimeType if none is set, or if an image
|
|
364
411
|
* has an incorrect extension.
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { supported as nativeFileSystemSupported } from "browser-fs-access";
|
|
2
2
|
import { MIME_TYPES } from "@excalidraw/common";
|
|
3
|
-
import type { FileSystemHandle } from "browser-fs-access";
|
|
4
3
|
type FILE_EXTENSION = Exclude<keyof typeof MIME_TYPES, "binary">;
|
|
5
4
|
export declare const fileOpen: <M extends boolean | undefined = false>(opts: {
|
|
6
5
|
extensions?: FILE_EXTENSION[];
|
|
@@ -14,8 +13,7 @@ export declare const fileSave: (blob: Blob | Promise<Blob>, opts: {
|
|
|
14
13
|
extension: FILE_EXTENSION;
|
|
15
14
|
mimeTypes?: string[];
|
|
16
15
|
description: string;
|
|
17
|
-
/** existing
|
|
18
|
-
fileHandle?:
|
|
19
|
-
}) => Promise<
|
|
16
|
+
/** existing FileSystemFileHandle */
|
|
17
|
+
fileHandle?: FileSystemFileHandle | null;
|
|
18
|
+
}) => Promise<FileSystemFileHandle | null>;
|
|
20
19
|
export { nativeFileSystemSupported };
|
|
21
|
-
export type { FileSystemHandle };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type { ExcalidrawElement, ExcalidrawFrameLikeElement, NonDeletedExcalidrawElement } from "@excalidraw/element/types";
|
|
2
|
-
import type { FileSystemHandle } from "./filesystem";
|
|
1
|
+
import type { ExcalidrawElement, ExcalidrawFrameLikeElement, NonDeleted, NonDeletedExcalidrawElement } from "@excalidraw/element/types";
|
|
3
2
|
import type { ExportType } from "../scene/types";
|
|
4
3
|
import type { AppState, BinaryFiles } from "../types";
|
|
5
4
|
export { loadFromBlob } from "./blob";
|
|
@@ -7,8 +6,8 @@ export { loadFromJSON, saveAsJSON } from "./json";
|
|
|
7
6
|
export type ExportedElements = readonly NonDeletedExcalidrawElement[] & {
|
|
8
7
|
_brand: "exportedElements";
|
|
9
8
|
};
|
|
10
|
-
export declare const prepareElementsForExport: (
|
|
11
|
-
exportingFrame: ExcalidrawFrameLikeElement | null;
|
|
9
|
+
export declare const prepareElementsForExport: (allElements: readonly ExcalidrawElement[], { selectedElementIds }: Pick<AppState, "selectedElementIds">, exportSelectionOnly: boolean) => {
|
|
10
|
+
exportingFrame: NonDeleted<ExcalidrawFrameLikeElement> | null;
|
|
12
11
|
exportedElements: ExportedElements;
|
|
13
12
|
};
|
|
14
13
|
export declare const exportCanvas: (type: Omit<ExportType, "backend">, elements: ExportedElements, appState: AppState, files: BinaryFiles, { exportBackground, exportPadding, viewBackgroundColor, name, fileHandle, exportingFrame, }: {
|
|
@@ -17,6 +16,6 @@ export declare const exportCanvas: (type: Omit<ExportType, "backend">, elements:
|
|
|
17
16
|
viewBackgroundColor: string;
|
|
18
17
|
/** filename, if applicable */
|
|
19
18
|
name?: string;
|
|
20
|
-
fileHandle?:
|
|
21
|
-
exportingFrame: ExcalidrawFrameLikeElement | null;
|
|
22
|
-
}) => Promise<
|
|
19
|
+
fileHandle?: FileSystemFileHandle | null;
|
|
20
|
+
exportingFrame: NonDeleted<ExcalidrawFrameLikeElement> | null;
|
|
21
|
+
}) => Promise<FileSystemFileHandle | null | undefined>;
|
|
@@ -1,11 +1,19 @@
|
|
|
1
1
|
import type { ExcalidrawElement } from "@excalidraw/element/types";
|
|
2
|
+
import type { MaybePromise } from "@excalidraw/common/utility-types";
|
|
2
3
|
import type { AppState, BinaryFiles, LibraryItems } from "../types";
|
|
3
4
|
import type { ImportedDataState, ImportedLibraryData } from "./types";
|
|
5
|
+
export type JSONExportData = {
|
|
6
|
+
elements: readonly ExcalidrawElement[];
|
|
7
|
+
appState: AppState;
|
|
8
|
+
files: BinaryFiles;
|
|
9
|
+
};
|
|
4
10
|
export declare const serializeAsJSON: (elements: readonly ExcalidrawElement[], appState: Partial<AppState>, files: BinaryFiles, type: "local" | "database") => string;
|
|
5
|
-
export declare const saveAsJSON: (
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
fileHandle:
|
|
11
|
+
export declare const saveAsJSON: ({ data, filename, fileHandle, }: {
|
|
12
|
+
data: MaybePromise<JSONExportData>;
|
|
13
|
+
filename: string;
|
|
14
|
+
fileHandle: AppState["fileHandle"];
|
|
15
|
+
}) => Promise<{
|
|
16
|
+
fileHandle: FileSystemFileHandle | null;
|
|
9
17
|
}>;
|
|
10
18
|
export declare const loadFromJSON: (localAppState: AppState, localElements: readonly ExcalidrawElement[] | null) => Promise<{
|
|
11
19
|
elements: import("@excalidraw/element/types").OrderedExcalidrawElement[];
|
|
@@ -35,12 +43,21 @@ export declare const loadFromJSON: (localAppState: AppState, localElements: read
|
|
|
35
43
|
} | {
|
|
36
44
|
name: "elementLinkSelector";
|
|
37
45
|
sourceElementId: ExcalidrawElement["id"];
|
|
46
|
+
} | {
|
|
47
|
+
name: "charts";
|
|
48
|
+
data: import("../charts").Spreadsheet;
|
|
49
|
+
rawText: string;
|
|
38
50
|
};
|
|
39
51
|
editingGroupId: import("@excalidraw/element/types").GroupId | null;
|
|
40
52
|
selectedElementIds: Readonly<{
|
|
41
53
|
[id: string]: true;
|
|
42
54
|
}>;
|
|
43
55
|
frameToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
|
|
56
|
+
activeTool: {
|
|
57
|
+
lastActiveTool: import("../types").ActiveTool | null;
|
|
58
|
+
locked: boolean;
|
|
59
|
+
fromSelection: boolean;
|
|
60
|
+
} & import("../types").ActiveTool;
|
|
44
61
|
activeEmbeddable: {
|
|
45
62
|
element: import("@excalidraw/element/types").NonDeletedExcalidrawElement;
|
|
46
63
|
state: "hover" | "active";
|
|
@@ -53,13 +70,29 @@ export declare const loadFromJSON: (localAppState: AppState, localElements: read
|
|
|
53
70
|
multiElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawLinearElement> | null;
|
|
54
71
|
newElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawNonSelectionElement> | null;
|
|
55
72
|
isBindingEnabled: boolean;
|
|
56
|
-
|
|
73
|
+
isMidpointSnappingEnabled: boolean;
|
|
74
|
+
gridModeEnabled: boolean;
|
|
75
|
+
suggestedBinding: {
|
|
76
|
+
element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
|
|
77
|
+
midPoint?: import("@excalidraw/math").GlobalPoint;
|
|
78
|
+
} | null;
|
|
79
|
+
textToolHover: {
|
|
80
|
+
type: "text";
|
|
81
|
+
elementId: ExcalidrawElement["id"];
|
|
82
|
+
} | {
|
|
83
|
+
type: "container";
|
|
84
|
+
elementId: ExcalidrawElement["id"];
|
|
85
|
+
} | {
|
|
86
|
+
type: "arrow";
|
|
87
|
+
elementId: import("@excalidraw/element/types").ExcalidrawArrowElement["id"];
|
|
88
|
+
anchor: "start" | "end" | "label";
|
|
89
|
+
} | null;
|
|
57
90
|
isRotating: boolean;
|
|
58
|
-
elementsToHighlight: import("@excalidraw/element/types").
|
|
91
|
+
elementsToHighlight: readonly import("@excalidraw/element/types").NonDeletedExcalidrawElement[] | null;
|
|
59
92
|
collaborators: Map<import("../types").SocketId, import("../types").Collaborator>;
|
|
60
93
|
snapLines: readonly import("../snapping").SnapLine[];
|
|
61
94
|
zenModeEnabled: boolean;
|
|
62
|
-
editingTextElement: import("@excalidraw/element/types").
|
|
95
|
+
editingTextElement: import("@excalidraw/element/types").ExcalidrawTextElement | null;
|
|
63
96
|
isCropping: boolean;
|
|
64
97
|
croppingElementId: ExcalidrawElement["id"] | null;
|
|
65
98
|
searchMatches: Readonly<{
|
|
@@ -72,8 +105,9 @@ export declare const loadFromJSON: (localAppState: AppState, localElements: read
|
|
|
72
105
|
}>;
|
|
73
106
|
shouldCacheIgnoreZoom: boolean;
|
|
74
107
|
exportScale: number;
|
|
75
|
-
|
|
108
|
+
currentItemArrowType: "sharp" | "round" | "elbow";
|
|
76
109
|
gridSize: number;
|
|
110
|
+
bindMode: import("@excalidraw/element/types").BindMode;
|
|
77
111
|
contextMenu: {
|
|
78
112
|
items: import("../components/ContextMenu").ContextMenuItems;
|
|
79
113
|
top: number;
|
|
@@ -83,13 +117,11 @@ export declare const loadFromJSON: (localAppState: AppState, localElements: read
|
|
|
83
117
|
isLoading: boolean;
|
|
84
118
|
errorMessage: React.ReactNode;
|
|
85
119
|
resizingElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
fromSelection: boolean;
|
|
92
|
-
} & import("../types").ActiveTool;
|
|
120
|
+
boxSelectionMode: import("../types").BoxSelectionMode;
|
|
121
|
+
bindingPreference: "enabled" | "disabled";
|
|
122
|
+
showHints: boolean;
|
|
123
|
+
inputDevice: import("../types").InputDevice;
|
|
124
|
+
editingFrame: import("@excalidraw/element/types").ExcalidrawFrameLikeElement["id"] | null;
|
|
93
125
|
preferredSelectionTool: {
|
|
94
126
|
type: "selection" | "lasso";
|
|
95
127
|
initialized: boolean;
|
|
@@ -100,11 +132,14 @@ export declare const loadFromJSON: (localAppState: AppState, localElements: read
|
|
|
100
132
|
exportEmbedScene: boolean;
|
|
101
133
|
exportWithDarkMode: boolean;
|
|
102
134
|
currentItemStrokeColor: string;
|
|
135
|
+
currentItemStickynoteStrokeColor: string;
|
|
136
|
+
currentItemStickynoteBackgroundColor: string;
|
|
103
137
|
currentItemBackgroundColor: string;
|
|
104
138
|
currentItemFillStyle: ExcalidrawElement["fillStyle"];
|
|
105
|
-
|
|
139
|
+
currentItemStrokeWidthKey: import("@excalidraw/common").StrokeWidthKey;
|
|
106
140
|
currentItemStrokeStyle: ExcalidrawElement["strokeStyle"];
|
|
107
141
|
currentItemRoughness: number;
|
|
142
|
+
currentItemStrokeVariability: import("@excalidraw/element/types").StrokeVariability;
|
|
108
143
|
currentItemOpacity: number;
|
|
109
144
|
currentItemFontFamily: import("@excalidraw/element/types").FontFamilyValues;
|
|
110
145
|
currentItemFontSize: number;
|
|
@@ -113,7 +148,7 @@ export declare const loadFromJSON: (localAppState: AppState, localElements: read
|
|
|
113
148
|
currentItemEndArrowhead: import("@excalidraw/element/types").Arrowhead | null;
|
|
114
149
|
currentHoveredFontFamily: import("@excalidraw/element/types").FontFamilyValues | null;
|
|
115
150
|
currentItemRoundness: import("@excalidraw/element/types").StrokeRoundness;
|
|
116
|
-
|
|
151
|
+
scrollConstraints: import("../types").ScrollConstraints | null;
|
|
117
152
|
cursorButton: "up" | "down";
|
|
118
153
|
scrolledOutside: boolean;
|
|
119
154
|
isResizing: boolean;
|
|
@@ -130,36 +165,33 @@ export declare const loadFromJSON: (localAppState: AppState, localElements: read
|
|
|
130
165
|
};
|
|
131
166
|
selectedElementsAreBeingDragged: boolean;
|
|
132
167
|
toast: {
|
|
133
|
-
message:
|
|
168
|
+
message: React.ReactNode;
|
|
134
169
|
closable?: boolean;
|
|
135
170
|
duration?: number;
|
|
136
171
|
} | null;
|
|
137
172
|
gridStep: number;
|
|
138
|
-
|
|
139
|
-
fileHandle: import("browser-fs-access").FileSystemHandle | null;
|
|
173
|
+
fileHandle: FileSystemFileHandle | null;
|
|
140
174
|
stats: {
|
|
141
175
|
open: boolean;
|
|
142
176
|
panels: number;
|
|
143
177
|
};
|
|
144
|
-
currentChartType: import("@excalidraw/element/types").ChartType;
|
|
145
|
-
pasteDialog: {
|
|
146
|
-
shown: false;
|
|
147
|
-
data: null;
|
|
148
|
-
} | {
|
|
149
|
-
shown: true;
|
|
150
|
-
data: import("../charts").Spreadsheet;
|
|
151
|
-
};
|
|
152
178
|
showHyperlinkPopup: false | "info" | "editor";
|
|
153
179
|
originSnapOffset: {
|
|
154
180
|
x: number;
|
|
155
181
|
y: number;
|
|
156
182
|
} | null;
|
|
157
183
|
objectsSnapModeEnabled: boolean;
|
|
158
|
-
userToFollow: import("../types").UserToFollow | null;
|
|
159
|
-
followedBy: Set<import("../types").SocketId>;
|
|
160
184
|
lockedMultiSelections: {
|
|
161
185
|
[groupId: string]: true;
|
|
162
186
|
};
|
|
187
|
+
colorTopPicks: {
|
|
188
|
+
elementStroke: readonly string[] | null;
|
|
189
|
+
elementBackground: readonly string[] | null;
|
|
190
|
+
bucketFill: readonly string[] | null;
|
|
191
|
+
stickyNoteStroke: readonly string[] | null;
|
|
192
|
+
stickyNoteBackground: readonly string[] | null;
|
|
193
|
+
};
|
|
194
|
+
fontTopPicks: readonly import("@excalidraw/element/types").FontFamilyValues[] | null;
|
|
163
195
|
};
|
|
164
196
|
files: BinaryFiles;
|
|
165
197
|
}>;
|
|
@@ -37,7 +37,7 @@ export interface LibraryMigrationAdapter {
|
|
|
37
37
|
/** clears entire storage afterwards */
|
|
38
38
|
clear(): MaybePromise<void>;
|
|
39
39
|
}
|
|
40
|
-
export declare const libraryItemsAtom: import("jotai
|
|
40
|
+
export declare const libraryItemsAtom: import("jotai").PrimitiveAtom<{
|
|
41
41
|
status: "loading" | "loaded";
|
|
42
42
|
/** indicates whether library is initialized with library items (has gone
|
|
43
43
|
* through at least one update). Used in UI. Specific to this atom only. */
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
+
import type { MaybePromise } from "@excalidraw/common/utility-types";
|
|
1
2
|
import type { ExcalidrawElement } from "@excalidraw/element/types";
|
|
2
3
|
import type { AppState, BinaryFiles } from "../types";
|
|
3
|
-
export declare const resaveAsImageWithScene: (
|
|
4
|
-
|
|
4
|
+
export declare const resaveAsImageWithScene: (data: MaybePromise<{
|
|
5
|
+
elements: readonly ExcalidrawElement[];
|
|
6
|
+
appState: AppState;
|
|
7
|
+
files: BinaryFiles;
|
|
8
|
+
}>, fileHandle: FileSystemFileHandle, filename: string) => Promise<{
|
|
9
|
+
fileHandle: FileSystemFileHandle;
|
|
5
10
|
}>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { GlobalPoint } from "@excalidraw/math";
|
|
2
|
+
import type App from "./components/App";
|
|
3
|
+
import type { Trail } from "./animatedTrail";
|
|
4
|
+
export declare class DrawShapeTrail implements Trail {
|
|
5
|
+
private app;
|
|
6
|
+
private trail;
|
|
7
|
+
constructor(app: App);
|
|
8
|
+
private getTrailOptions;
|
|
9
|
+
startPath(x: number, y: number): void;
|
|
10
|
+
addPointToPath(x: number, y: number): void;
|
|
11
|
+
endPath(): void;
|
|
12
|
+
clearTrails(): void;
|
|
13
|
+
getCurrentPoints(): GlobalPoint[];
|
|
14
|
+
start(container: SVGSVGElement): void;
|
|
15
|
+
stop(): void;
|
|
16
|
+
}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { AnimatedTrail } from "../
|
|
2
|
-
import type { AnimationFrameHandler } from "../animation-frame-handler";
|
|
1
|
+
import { AnimatedTrail } from "../animatedTrail";
|
|
3
2
|
import type App from "../components/App";
|
|
4
3
|
export declare class EraserTrail extends AnimatedTrail {
|
|
5
4
|
private elementsToErase;
|
|
6
5
|
private groupsToErase;
|
|
7
|
-
constructor(
|
|
6
|
+
constructor(app: App);
|
|
8
7
|
startPath(x: number, y: number): void;
|
|
9
8
|
addPointToPath(x: number, y: number, restore?: boolean): string[];
|
|
10
9
|
private updateElementsToBeErased;
|