@excalidraw/excalidraw 0.18.0-817d8c5 → 0.18.0-a30e1b2
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/CHANGELOG.md +11 -11
- package/dist/dev/{chunk-LMHBUWQS.js → chunk-CARD3WJZ.js} +10 -4
- package/dist/dev/chunk-CARD3WJZ.js.map +7 -0
- package/dist/dev/{chunk-3SN6HYVK.js → chunk-ETWEPOFC.js} +15663 -22657
- package/dist/dev/chunk-ETWEPOFC.js.map +7 -0
- package/dist/dev/chunk-FB2NA5UG.js +4132 -0
- package/dist/dev/chunk-FB2NA5UG.js.map +7 -0
- package/dist/dev/{chunk-53KHN5WM.js → chunk-RS23HYC4.js} +2 -2
- package/dist/dev/{chunk-53KHN5WM.js.map → chunk-RS23HYC4.js.map} +1 -1
- package/dist/dev/data/{image-V26YBSDB.js → image-AYLHSOBV.js} +3 -3
- package/dist/dev/index.css +3093 -3055
- package/dist/dev/index.css.map +3 -3
- package/dist/dev/index.js +32056 -23232
- package/dist/dev/index.js.map +4 -4
- package/dist/dev/locales/{en-OZCJJ2HN.js → en-E3O5XSXJ.js} +2 -2
- package/dist/dev/subset-shared.chunk.js +2 -2
- package/dist/dev/subset-worker.chunk.js +2 -2
- package/dist/prod/chunk-6BSJPDKJ.js +33 -0
- package/dist/prod/{chunk-6U3AYISY.js → chunk-FGHASORR.js} +4 -4
- package/dist/prod/chunk-LS7FJGPW.js +86 -0
- package/dist/prod/{chunk-G5N3DNGT.js → chunk-SBKTMZM7.js} +1 -1
- package/dist/prod/data/image-VAYKYPXV.js +1 -0
- package/dist/prod/index.css +1 -1
- package/dist/prod/index.js +19 -15
- package/dist/prod/locales/{en-B4ZKOASM.js → en-44IKVKYT.js} +1 -1
- package/dist/prod/subset-shared.chunk.js +1 -1
- package/dist/prod/subset-worker.chunk.js +1 -1
- package/dist/types/{excalidraw/binaryheap.d.ts → common/src/binary-heap.d.ts} +1 -1
- package/dist/types/{excalidraw → common/src}/colors.d.ts +1 -0
- package/dist/types/{excalidraw → common/src}/constants.d.ts +11 -6
- package/dist/types/{excalidraw → common/src}/emitter.d.ts +1 -1
- package/dist/types/{excalidraw/fonts/FontMetadata.d.ts → common/src/font-metadata.d.ts} +15 -5
- package/dist/types/common/src/index.d.ts +12 -0
- package/dist/types/{excalidraw → common/src}/points.d.ts +2 -0
- package/dist/types/common/src/promise-pool.d.ts +6 -0
- package/dist/types/{excalidraw → common/src}/utility-types.d.ts +5 -0
- package/dist/types/{excalidraw → common/src}/utils.d.ts +22 -12
- package/dist/types/{excalidraw/scene → element/src}/Scene.d.ts +12 -15
- package/dist/types/{excalidraw/scene → element/src}/Shape.d.ts +2 -2
- package/dist/types/{excalidraw/scene → element/src}/ShapeCache.d.ts +4 -4
- package/dist/types/element/src/align.d.ts +7 -0
- package/dist/types/{excalidraw/element → element/src}/binding.d.ts +24 -16
- package/dist/types/{excalidraw/element → element/src}/bounds.d.ts +9 -4
- package/dist/types/{excalidraw/element → element/src}/collision.d.ts +3 -3
- package/dist/types/{excalidraw/scene → element/src}/comparisons.d.ts +1 -1
- package/dist/types/{excalidraw/change.d.ts → element/src/delta.d.ts} +41 -36
- package/dist/types/{excalidraw → element/src}/distribute.d.ts +1 -1
- package/dist/types/{excalidraw/element → element/src}/dragElements.d.ts +5 -4
- package/dist/types/element/src/duplicate.d.ts +63 -0
- package/dist/types/{excalidraw/element → element/src}/elbowArrow.d.ts +1 -1
- package/dist/types/{excalidraw/element → element/src}/elementLink.d.ts +1 -1
- package/dist/types/element/src/embeddable.d.ts +10 -0
- package/dist/types/{excalidraw/element → element/src}/flowchart.d.ts +4 -3
- package/dist/types/{excalidraw → element/src}/fractionalIndex.d.ts +5 -2
- package/dist/types/{excalidraw → element/src}/frame.d.ts +8 -7
- package/dist/types/{excalidraw → element/src}/groups.d.ts +5 -5
- package/dist/types/{excalidraw/element → element/src}/heading.d.ts +1 -2
- package/dist/types/{excalidraw/element → element/src}/image.d.ts +2 -2
- package/dist/types/element/src/index.d.ts +16 -0
- package/dist/types/{excalidraw/element → element/src}/linearElementEditor.d.ts +16 -20
- package/dist/types/{excalidraw/element → element/src}/mutateElement.d.ts +11 -3
- package/dist/types/{excalidraw/element → element/src}/newElement.d.ts +4 -44
- package/dist/types/{excalidraw/renderer → element/src}/renderElement.d.ts +3 -3
- package/dist/types/{excalidraw/element → element/src}/resizeElements.d.ts +6 -6
- package/dist/types/{excalidraw/element → element/src}/resizeTest.d.ts +4 -4
- package/dist/types/{excalidraw/scene → element/src}/selection.d.ts +13 -2
- package/dist/types/element/src/shapes.d.ts +23 -0
- package/dist/types/{excalidraw/element → element/src}/showSelectedShapeActions.d.ts +1 -1
- package/dist/types/{excalidraw/element → element/src}/sizeHelpers.d.ts +1 -2
- package/dist/types/element/src/store.d.ts +227 -0
- package/dist/types/{excalidraw/element → element/src}/textElement.d.ts +8 -7
- package/dist/types/{excalidraw/element → element/src}/transformHandles.d.ts +7 -7
- package/dist/types/{excalidraw/element → element/src}/typeChecks.d.ts +5 -2
- package/dist/types/{excalidraw/element → element/src}/types.d.ts +9 -2
- package/dist/types/element/src/zindex.d.ts +7 -0
- package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +88 -103
- package/dist/types/excalidraw/actions/actionAlign.d.ts +15 -15
- package/dist/types/excalidraw/actions/actionBoundText.d.ts +64 -74
- package/dist/types/excalidraw/actions/actionCanvas.d.ts +608 -497
- package/dist/types/excalidraw/actions/actionClipboard.d.ts +188 -218
- package/dist/types/excalidraw/actions/actionCropEditor.d.ts +31 -36
- package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +89 -104
- package/dist/types/excalidraw/actions/actionDistribute.d.ts +7 -7
- package/dist/types/excalidraw/actions/actionDuplicateSelection.d.ts +5 -9
- package/dist/types/excalidraw/actions/actionElementLink.d.ts +34 -39
- package/dist/types/excalidraw/actions/actionElementLock.d.ts +65 -76
- package/dist/types/excalidraw/{element/embeddable.d.ts → actions/actionEmbeddable.d.ts} +31 -46
- package/dist/types/excalidraw/actions/actionExport.d.ts +342 -387
- package/dist/types/excalidraw/actions/actionFinalize.d.ts +52 -62
- package/dist/types/excalidraw/actions/actionFlip.d.ts +7 -7
- package/dist/types/excalidraw/actions/actionFrame.d.ts +234 -254
- package/dist/types/excalidraw/actions/actionGroup.d.ts +65 -75
- package/dist/types/excalidraw/actions/actionHistory.d.ts +2 -3
- package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +32 -37
- package/dist/types/excalidraw/actions/actionLink.d.ts +34 -39
- package/dist/types/excalidraw/actions/actionMenu.d.ts +91 -106
- package/dist/types/excalidraw/actions/actionNavigate.d.ts +59 -69
- package/dist/types/excalidraw/actions/actionProperties.d.ts +396 -471
- package/dist/types/excalidraw/actions/actionSelectAll.d.ts +33 -38
- package/dist/types/excalidraw/actions/actionStyles.d.ts +37 -42
- package/dist/types/excalidraw/actions/actionTextAutoResize.d.ts +3 -3
- package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +33 -38
- package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +33 -38
- package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +32 -209
- package/dist/types/excalidraw/actions/actionToggleShapeSwitch.d.ts +19 -0
- package/dist/types/excalidraw/actions/actionToggleStats.d.ts +32 -38
- package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +33 -39
- package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +33 -39
- package/dist/types/excalidraw/actions/actionZindex.d.ts +16 -16
- package/dist/types/excalidraw/actions/index.d.ts +1 -0
- package/dist/types/excalidraw/actions/manager.d.ts +2 -2
- package/dist/types/excalidraw/actions/shortcuts.d.ts +1 -1
- package/dist/types/excalidraw/actions/types.d.ts +5 -5
- package/dist/types/excalidraw/animated-trail.d.ts +7 -1
- package/dist/types/excalidraw/appState.d.ts +34 -33
- package/dist/types/excalidraw/charts.d.ts +1 -1
- package/dist/types/excalidraw/clipboard.d.ts +7 -7
- package/dist/types/excalidraw/components/Actions.d.ts +3 -3
- package/dist/types/excalidraw/components/App.d.ts +38 -20
- package/dist/types/excalidraw/components/Avatar.d.ts +1 -1
- package/dist/types/excalidraw/components/ButtonIcon.d.ts +1 -1
- package/dist/types/excalidraw/components/ColorPicker/ColorPicker.d.ts +4 -4
- package/dist/types/excalidraw/components/ColorPicker/HotkeyLabel.d.ts +1 -2
- package/dist/types/excalidraw/components/ColorPicker/Picker.d.ts +2 -2
- package/dist/types/excalidraw/components/ColorPicker/PickerColorList.d.ts +1 -1
- package/dist/types/excalidraw/components/ColorPicker/ShadeList.d.ts +1 -1
- package/dist/types/excalidraw/components/ColorPicker/colorPickerUtils.d.ts +3 -3
- package/dist/types/excalidraw/components/ColorPicker/keyboardNavHandlers.d.ts +1 -1
- package/dist/types/excalidraw/components/CommandPalette/CommandPalette.d.ts +1 -1
- package/dist/types/excalidraw/components/ConfirmDialog.d.ts +1 -1
- package/dist/types/excalidraw/components/ContextMenu.d.ts +2 -2
- package/dist/types/excalidraw/components/ConvertElementTypePopup.d.ts +49 -0
- package/dist/types/excalidraw/components/DarkModeToggle.d.ts +1 -1
- package/dist/types/excalidraw/components/DefaultSidebar.d.ts +2 -2
- package/dist/types/excalidraw/components/DialogActionButton.d.ts +1 -1
- package/dist/types/excalidraw/{element → components}/ElementCanvasButtons.d.ts +1 -1
- package/dist/types/excalidraw/components/ElementLinkDialog.d.ts +5 -4
- package/dist/types/excalidraw/components/EyeDropper.d.ts +1 -1
- package/dist/types/excalidraw/components/FixedSideContainer.d.ts +1 -1
- package/dist/types/excalidraw/components/FollowMode/FollowMode.d.ts +1 -1
- package/dist/types/excalidraw/components/FontPicker/FontPicker.d.ts +1 -1
- package/dist/types/excalidraw/components/FontPicker/FontPickerList.d.ts +3 -3
- package/dist/types/excalidraw/components/FontPicker/FontPickerTrigger.d.ts +1 -1
- package/dist/types/excalidraw/components/FontPicker/keyboardNavHandlers.d.ts +1 -1
- package/dist/types/excalidraw/components/HintViewer.d.ts +1 -1
- package/dist/types/excalidraw/components/IconPicker.d.ts +1 -1
- package/dist/types/excalidraw/components/ImageExportDialog.d.ts +2 -2
- package/dist/types/excalidraw/components/InitializeApp.d.ts +1 -1
- package/dist/types/excalidraw/components/Island.d.ts +1 -1
- package/dist/types/excalidraw/components/JSONExportDialog.d.ts +2 -2
- package/dist/types/excalidraw/components/LayerUI.d.ts +3 -3
- package/dist/types/excalidraw/components/LibraryMenuHeaderContent.d.ts +1 -1
- package/dist/types/excalidraw/components/LibraryMenuItems.d.ts +1 -1
- package/dist/types/excalidraw/components/LibraryMenuSection.d.ts +3 -3
- package/dist/types/excalidraw/components/LibraryUnit.d.ts +2 -2
- package/dist/types/excalidraw/components/LoadingMessage.d.ts +1 -1
- package/dist/types/excalidraw/components/MagicButton.d.ts +1 -1
- package/dist/types/excalidraw/components/MobileMenu.d.ts +3 -3
- package/dist/types/excalidraw/components/PasteChartDialog.d.ts +1 -1
- package/dist/types/excalidraw/components/PropertiesPopover.d.ts +1 -1
- package/dist/types/excalidraw/components/PublishLibrary.d.ts +1 -1
- package/dist/types/excalidraw/components/SVGLayer.d.ts +1 -1
- package/dist/types/excalidraw/components/Sidebar/SidebarTrigger.d.ts +1 -1
- package/dist/types/excalidraw/components/Sidebar/common.d.ts +1 -1
- package/dist/types/excalidraw/components/Stack.d.ts +1 -1
- package/dist/types/excalidraw/components/Stats/Angle.d.ts +2 -2
- package/dist/types/excalidraw/components/Stats/CanvasGrid.d.ts +1 -1
- package/dist/types/excalidraw/components/Stats/Collapsible.d.ts +2 -1
- package/dist/types/excalidraw/components/Stats/Dimension.d.ts +2 -2
- package/dist/types/excalidraw/components/Stats/DragInput.d.ts +3 -3
- package/dist/types/excalidraw/components/Stats/FontSize.d.ts +2 -2
- package/dist/types/excalidraw/components/Stats/MultiAngle.d.ts +2 -2
- package/dist/types/excalidraw/components/Stats/MultiDimension.d.ts +3 -3
- package/dist/types/excalidraw/components/Stats/MultiFontSize.d.ts +2 -2
- package/dist/types/excalidraw/components/Stats/MultiPosition.d.ts +2 -2
- package/dist/types/excalidraw/components/Stats/Position.d.ts +2 -2
- package/dist/types/excalidraw/components/Stats/index.d.ts +2 -2
- package/dist/types/excalidraw/components/Stats/utils.d.ts +4 -11
- package/dist/types/excalidraw/components/TTDDialog/TTDDialogTrigger.d.ts +1 -1
- package/dist/types/excalidraw/components/TTDDialog/common.d.ts +1 -1
- package/dist/types/excalidraw/components/TextField.d.ts +1 -1
- package/dist/types/excalidraw/components/Toast.d.ts +1 -1
- package/dist/types/excalidraw/components/ToolButton.d.ts +2 -2
- package/dist/types/excalidraw/components/Tooltip.d.ts +1 -1
- package/dist/types/excalidraw/components/UserList.d.ts +1 -1
- package/dist/types/excalidraw/components/canvases/InteractiveCanvas.d.ts +4 -3
- package/dist/types/excalidraw/components/canvases/NewElementCanvas.d.ts +2 -2
- package/dist/types/excalidraw/components/canvases/StaticCanvas.d.ts +3 -3
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenu.d.ts +1 -1
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItem.d.ts +2 -2
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemLink.d.ts +1 -1
- package/dist/types/excalidraw/components/hyperlink/Hyperlink.d.ts +5 -4
- package/dist/types/excalidraw/components/hyperlink/helpers.d.ts +2 -2
- package/dist/types/excalidraw/components/icons.d.ts +2 -1
- package/dist/types/excalidraw/components/main-menu/DefaultItems.d.ts +1 -1
- package/dist/types/excalidraw/components/main-menu/MainMenu.d.ts +4 -1
- package/dist/types/excalidraw/components/shapes.d.ts +62 -0
- package/dist/types/excalidraw/context/tunnels.d.ts +1 -1
- package/dist/types/excalidraw/data/EditorLocalStorage.d.ts +1 -1
- package/dist/types/excalidraw/data/blob.d.ts +4 -4
- package/dist/types/excalidraw/data/filesystem.d.ts +2 -2
- package/dist/types/excalidraw/data/index.d.ts +2 -2
- package/dist/types/excalidraw/data/json.d.ts +1 -1
- package/dist/types/excalidraw/data/library.d.ts +3 -3
- package/dist/types/excalidraw/data/reconcile.d.ts +2 -2
- package/dist/types/excalidraw/data/resave.d.ts +1 -1
- package/dist/types/excalidraw/data/restore.d.ts +1 -1
- package/dist/types/excalidraw/data/transform.d.ts +4 -4
- package/dist/types/excalidraw/data/types.d.ts +3 -3
- package/dist/types/excalidraw/editor-jotai.d.ts +6 -6
- package/dist/types/excalidraw/eraser/index.d.ts +14 -0
- package/dist/types/excalidraw/errors.d.ts +0 -3
- package/dist/types/excalidraw/fonts/Fonts.d.ts +3 -13
- package/dist/types/excalidraw/history.d.ts +15 -23
- package/dist/types/excalidraw/hooks/useEmitter.d.ts +1 -1
- package/dist/types/excalidraw/i18n.d.ts +1 -1
- package/dist/types/excalidraw/index.d.ts +16 -15
- package/dist/types/excalidraw/laser-trails.d.ts +1 -1
- package/dist/types/excalidraw/lasso/index.d.ts +15 -0
- package/dist/types/excalidraw/lasso/utils.d.ts +12 -0
- package/dist/types/excalidraw/renderer/helpers.d.ts +7 -2
- package/dist/types/excalidraw/renderer/staticSvgScene.d.ts +2 -2
- package/dist/types/excalidraw/scene/Renderer.d.ts +3 -3
- package/dist/types/excalidraw/scene/export.d.ts +1 -1
- package/dist/types/excalidraw/scene/index.d.ts +2 -2
- package/dist/types/excalidraw/scene/scroll.d.ts +1 -1
- package/dist/types/excalidraw/scene/scrollbars.d.ts +2 -3
- package/dist/types/excalidraw/scene/types.d.ts +6 -4
- package/dist/types/excalidraw/snapping.d.ts +5 -6
- package/dist/types/excalidraw/types.d.ts +31 -18
- package/dist/types/excalidraw/visualdebug.d.ts +2 -2
- package/dist/types/excalidraw/{element → wysiwyg}/textWysiwyg.d.ts +4 -2
- package/dist/types/math/{curve.d.ts → src/curve.d.ts} +2 -0
- package/dist/types/math/{point.d.ts → src/point.d.ts} +2 -2
- package/dist/types/math/{polygon.d.ts → src/polygon.d.ts} +1 -0
- package/dist/types/math/{segment.d.ts → src/segment.d.ts} +1 -1
- package/dist/types/math/{types.d.ts → src/types.d.ts} +1 -0
- package/dist/types/math/{vector.d.ts → src/vector.d.ts} +4 -0
- package/dist/types/utils/{bbox.d.ts → src/bbox.d.ts} +1 -1
- package/dist/types/utils/{collision.d.ts → src/collision.d.ts} +2 -3
- package/dist/types/utils/{export.d.ts → src/export.d.ts} +2 -2
- package/dist/types/utils/{index.d.ts → src/index.d.ts} +1 -1
- package/dist/types/utils/{geometry → src}/shape.d.ts +2 -15
- package/dist/types/utils/{withinBounds.d.ts → src/withinBounds.d.ts} +2 -2
- package/history.ts +70 -94
- package/package.json +16 -4
- package/dist/dev/chunk-3SN6HYVK.js.map +0 -7
- package/dist/dev/chunk-LMHBUWQS.js.map +0 -7
- package/dist/dev/chunk-OKSO7T74.js +0 -4132
- package/dist/dev/chunk-OKSO7T74.js.map +0 -7
- package/dist/prod/chunk-36CXSE6H.js +0 -34
- package/dist/prod/chunk-EIO257PC.js +0 -86
- package/dist/prod/data/image-N4WCURRR.js +0 -1
- package/dist/types/excalidraw/align.d.ts +0 -7
- package/dist/types/excalidraw/element/index.d.ts +0 -26
- package/dist/types/excalidraw/shapes.d.ts +0 -85
- package/dist/types/excalidraw/store.d.ts +0 -129
- package/dist/types/excalidraw/zindex.d.ts +0 -6
- package/dist/dev/data/{image-V26YBSDB.js.map → image-AYLHSOBV.js.map} +0 -0
- package/dist/dev/locales/{en-OZCJJ2HN.js.map → en-E3O5XSXJ.js.map} +0 -0
- package/dist/types/{excalidraw → common/src}/keys.d.ts +0 -0
- package/dist/types/{excalidraw → common/src}/queue.d.ts +0 -0
- package/dist/types/{excalidraw → common/src}/random.d.ts +0 -0
- package/dist/types/{excalidraw/data → common/src}/url.d.ts +0 -0
- package/dist/types/{excalidraw/element → element/src}/containerCache.d.ts +0 -0
- package/dist/types/{excalidraw/element → element/src}/cropElement.d.ts +0 -0
- package/dist/types/{excalidraw/element → element/src}/distance.d.ts +0 -0
- package/dist/types/{excalidraw/element → element/src}/sortElements.d.ts +0 -0
- package/dist/types/{excalidraw/element → element/src}/textMeasurements.d.ts +0 -0
- package/dist/types/{excalidraw/element → element/src}/textWrapping.d.ts +0 -0
- package/dist/types/{excalidraw/element → element/src}/utils.d.ts +1 -1
- /package/dist/types/math/{angle.d.ts → src/angle.d.ts} +0 -0
- /package/dist/types/math/{ellipse.d.ts → src/ellipse.d.ts} +0 -0
- /package/dist/types/math/{index.d.ts → src/index.d.ts} +0 -0
- /package/dist/types/math/{line.d.ts → src/line.d.ts} +0 -0
- /package/dist/types/math/{range.d.ts → src/range.d.ts} +0 -0
- /package/dist/types/math/{rectangle.d.ts → src/rectangle.d.ts} +0 -0
- /package/dist/types/math/{triangle.d.ts → src/triangle.d.ts} +0 -0
- /package/dist/types/math/{utils.d.ts → src/utils.d.ts} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{nh as a,oh as b,ph as c}from"../chunk-36CXSE6H.js";import"../chunk-G5N3DNGT.js";import"../chunk-SRAX5OIU.js";export{c as decodePngMetadata,b as encodePngMetadata,a as getTEXtChunk};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { ElementsMap, ExcalidrawElement } from "./element/types";
|
|
2
|
-
import type Scene from "./scene/Scene";
|
|
3
|
-
export interface Alignment {
|
|
4
|
-
position: "start" | "center" | "end";
|
|
5
|
-
axis: "x" | "y";
|
|
6
|
-
}
|
|
7
|
-
export declare const alignElements: (selectedElements: ExcalidrawElement[], elementsMap: ElementsMap, alignment: Alignment, scene: Scene) => ExcalidrawElement[];
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type { ExcalidrawElement, NonDeletedExcalidrawElement, NonDeleted } from "./types";
|
|
2
|
-
export { newElement, newTextElement, refreshTextDimensions, newLinearElement, newArrowElement, newImageElement, duplicateElement, } from "./newElement";
|
|
3
|
-
export { getElementAbsoluteCoords, getElementBounds, getCommonBounds, getDiamondPoints, getArrowheadPoints, getClosestElementBounds, } from "./bounds";
|
|
4
|
-
export { OMIT_SIDES_FOR_MULTIPLE_ELEMENTS, getTransformHandlesFromCoords, getTransformHandles, } from "./transformHandles";
|
|
5
|
-
export { resizeTest, getCursorForResizingElement, getElementWithTransformHandleType, getTransformHandleTypeFromCoords, } from "./resizeTest";
|
|
6
|
-
export { transformElements, getResizeOffsetXY, getResizeArrowDirection, } from "./resizeElements";
|
|
7
|
-
export { dragSelectedElements, getDragOffsetXY, dragNewElement, } from "./dragElements";
|
|
8
|
-
export { isTextElement, isExcalidrawElement } from "./typeChecks";
|
|
9
|
-
export { redrawTextBoundingBox, getTextFromElements } from "./textElement";
|
|
10
|
-
export { getPerfectElementSize, getLockedLinearCursorAlignSize, isInvisiblySmallElement, resizePerfectLineForNWHandler, getNormalizedDimensions, } from "./sizeHelpers";
|
|
11
|
-
export { showSelectedShapeActions } from "./showSelectedShapeActions";
|
|
12
|
-
/**
|
|
13
|
-
* @deprecated unsafe, use hashElementsVersion instead
|
|
14
|
-
*/
|
|
15
|
-
export declare const getSceneVersion: (elements: readonly ExcalidrawElement[]) => number;
|
|
16
|
-
/**
|
|
17
|
-
* Hashes elements' versionNonce (using djb2 algo). Order of elements matters.
|
|
18
|
-
*/
|
|
19
|
-
export declare const hashElementsVersion: (elements: readonly ExcalidrawElement[]) => number;
|
|
20
|
-
export declare const hashString: (s: string) => number;
|
|
21
|
-
export declare const getVisibleElements: (elements: readonly ExcalidrawElement[]) => readonly NonDeletedExcalidrawElement[];
|
|
22
|
-
export declare const getNonDeletedElements: <T extends ExcalidrawElement>(elements: readonly T[]) => readonly NonDeleted<T>[];
|
|
23
|
-
export declare const isNonDeletedElement: <T extends ExcalidrawElement>(element: T) => element is NonDeleted<T>;
|
|
24
|
-
export declare const clearElementsForDatabase: (elements: readonly ExcalidrawElement[]) => ExcalidrawElement[];
|
|
25
|
-
export declare const clearElementsForExport: (elements: readonly ExcalidrawElement[]) => ExcalidrawElement[];
|
|
26
|
-
export declare const clearElementsForLocalStorage: (elements: readonly ExcalidrawElement[]) => ExcalidrawElement[];
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import { type GlobalPoint, type LocalPoint } from "@excalidraw/math";
|
|
2
|
-
import { type GeometricShape } from "@excalidraw/utils/geometry/shape";
|
|
3
|
-
import type { Bounds } from "./element/bounds";
|
|
4
|
-
import type { ElementsMap, ExcalidrawElement, ExcalidrawLinearElement, NonDeleted } from "./element/types";
|
|
5
|
-
import type { Zoom } from "./types";
|
|
6
|
-
export declare const SHAPES: readonly [{
|
|
7
|
-
readonly icon: import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
readonly value: "selection";
|
|
9
|
-
readonly key: "v";
|
|
10
|
-
readonly numericKey: "1";
|
|
11
|
-
readonly fillable: true;
|
|
12
|
-
}, {
|
|
13
|
-
readonly icon: import("react/jsx-runtime").JSX.Element;
|
|
14
|
-
readonly value: "rectangle";
|
|
15
|
-
readonly key: "r";
|
|
16
|
-
readonly numericKey: "2";
|
|
17
|
-
readonly fillable: true;
|
|
18
|
-
}, {
|
|
19
|
-
readonly icon: import("react/jsx-runtime").JSX.Element;
|
|
20
|
-
readonly value: "diamond";
|
|
21
|
-
readonly key: "d";
|
|
22
|
-
readonly numericKey: "3";
|
|
23
|
-
readonly fillable: true;
|
|
24
|
-
}, {
|
|
25
|
-
readonly icon: import("react/jsx-runtime").JSX.Element;
|
|
26
|
-
readonly value: "ellipse";
|
|
27
|
-
readonly key: "o";
|
|
28
|
-
readonly numericKey: "4";
|
|
29
|
-
readonly fillable: true;
|
|
30
|
-
}, {
|
|
31
|
-
readonly icon: import("react/jsx-runtime").JSX.Element;
|
|
32
|
-
readonly value: "arrow";
|
|
33
|
-
readonly key: "a";
|
|
34
|
-
readonly numericKey: "5";
|
|
35
|
-
readonly fillable: true;
|
|
36
|
-
}, {
|
|
37
|
-
readonly icon: import("react/jsx-runtime").JSX.Element;
|
|
38
|
-
readonly value: "line";
|
|
39
|
-
readonly key: "l";
|
|
40
|
-
readonly numericKey: "6";
|
|
41
|
-
readonly fillable: true;
|
|
42
|
-
}, {
|
|
43
|
-
readonly icon: import("react/jsx-runtime").JSX.Element;
|
|
44
|
-
readonly value: "freedraw";
|
|
45
|
-
readonly key: readonly ["p", "x"];
|
|
46
|
-
readonly numericKey: "7";
|
|
47
|
-
readonly fillable: false;
|
|
48
|
-
}, {
|
|
49
|
-
readonly icon: import("react/jsx-runtime").JSX.Element;
|
|
50
|
-
readonly value: "text";
|
|
51
|
-
readonly key: "t";
|
|
52
|
-
readonly numericKey: "8";
|
|
53
|
-
readonly fillable: false;
|
|
54
|
-
}, {
|
|
55
|
-
readonly icon: import("react/jsx-runtime").JSX.Element;
|
|
56
|
-
readonly value: "image";
|
|
57
|
-
readonly key: null;
|
|
58
|
-
readonly numericKey: "9";
|
|
59
|
-
readonly fillable: false;
|
|
60
|
-
}, {
|
|
61
|
-
readonly icon: import("react/jsx-runtime").JSX.Element;
|
|
62
|
-
readonly value: "eraser";
|
|
63
|
-
readonly key: "e";
|
|
64
|
-
readonly numericKey: "0";
|
|
65
|
-
readonly fillable: false;
|
|
66
|
-
}];
|
|
67
|
-
export declare const findShapeByKey: (key: string) => "text" | "line" | "arrow" | "image" | "selection" | "rectangle" | "diamond" | "ellipse" | "freedraw" | "eraser" | null;
|
|
68
|
-
/**
|
|
69
|
-
* get the pure geometric shape of an excalidraw element
|
|
70
|
-
* which is then used for hit detection
|
|
71
|
-
*/
|
|
72
|
-
export declare const getElementShape: <Point extends GlobalPoint | LocalPoint>(element: ExcalidrawElement, elementsMap: ElementsMap) => GeometricShape<Point>;
|
|
73
|
-
export declare const getBoundTextShape: <Point extends GlobalPoint | LocalPoint>(element: ExcalidrawElement, elementsMap: ElementsMap) => GeometricShape<Point> | null;
|
|
74
|
-
export declare const getControlPointsForBezierCurve: <P extends GlobalPoint | LocalPoint>(element: NonDeleted<ExcalidrawLinearElement>, endPoint: P) => P[] | null;
|
|
75
|
-
export declare const getBezierXY: <P extends GlobalPoint | LocalPoint>(p0: P, p1: P, p2: P, p3: P, t: number) => P;
|
|
76
|
-
export declare const getBezierCurveLength: <P extends GlobalPoint | LocalPoint>(element: NonDeleted<ExcalidrawLinearElement>, endPoint: P) => number;
|
|
77
|
-
export declare const mapIntervalToBezierT: <P extends GlobalPoint | LocalPoint>(element: NonDeleted<ExcalidrawLinearElement>, endPoint: P, interval: number) => number;
|
|
78
|
-
/**
|
|
79
|
-
* Get the axis-aligned bounding box for a given element
|
|
80
|
-
*/
|
|
81
|
-
export declare const aabbForElement: (element: Readonly<ExcalidrawElement>, offset?: [number, number, number, number]) => Bounds;
|
|
82
|
-
export declare const pointInsideBounds: <P extends GlobalPoint | LocalPoint>(p: P, bounds: Bounds) => boolean;
|
|
83
|
-
export declare const aabbsOverlapping: (a: Bounds, b: Bounds) => boolean;
|
|
84
|
-
export declare const getCornerRadius: (x: number, element: ExcalidrawElement) => number;
|
|
85
|
-
export declare const isPathALoop: (points: ExcalidrawLinearElement["points"], zoomValue?: Zoom["value"]) => boolean;
|
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
import { AppStateChange, ElementsChange } from "./change";
|
|
2
|
-
import type { OrderedExcalidrawElement } from "./element/types";
|
|
3
|
-
import { Emitter } from "./emitter";
|
|
4
|
-
import type { AppState, ObservedAppState } from "./types";
|
|
5
|
-
import type { ValueOf } from "./utility-types";
|
|
6
|
-
export declare const getObservedAppState: (appState: AppState) => ObservedAppState;
|
|
7
|
-
export declare const CaptureUpdateAction: {
|
|
8
|
-
/**
|
|
9
|
-
* Immediately undoable.
|
|
10
|
-
*
|
|
11
|
-
* Use for updates which should be captured.
|
|
12
|
-
* Should be used for most of the local updates.
|
|
13
|
-
*
|
|
14
|
-
* These updates will _immediately_ make it to the local undo / redo stacks.
|
|
15
|
-
*/
|
|
16
|
-
readonly IMMEDIATELY: "IMMEDIATELY";
|
|
17
|
-
/**
|
|
18
|
-
* Never undoable.
|
|
19
|
-
*
|
|
20
|
-
* Use for updates which should never be recorded, such as remote updates
|
|
21
|
-
* or scene initialization.
|
|
22
|
-
*
|
|
23
|
-
* These updates will _never_ make it to the local undo / redo stacks.
|
|
24
|
-
*/
|
|
25
|
-
readonly NEVER: "NEVER";
|
|
26
|
-
/**
|
|
27
|
-
* Eventually undoable.
|
|
28
|
-
*
|
|
29
|
-
* Use for updates which should not be captured immediately - likely
|
|
30
|
-
* exceptions which are part of some async multi-step process. Otherwise, all
|
|
31
|
-
* such updates would end up being captured with the next
|
|
32
|
-
* `CaptureUpdateAction.IMMEDIATELY` - triggered either by the next `updateScene`
|
|
33
|
-
* or internally by the editor.
|
|
34
|
-
*
|
|
35
|
-
* These updates will _eventually_ make it to the local undo / redo stacks.
|
|
36
|
-
*/
|
|
37
|
-
readonly EVENTUALLY: "EVENTUALLY";
|
|
38
|
-
};
|
|
39
|
-
export type CaptureUpdateActionType = ValueOf<typeof CaptureUpdateAction>;
|
|
40
|
-
/**
|
|
41
|
-
* Represent an increment to the Store.
|
|
42
|
-
*/
|
|
43
|
-
declare class StoreIncrementEvent {
|
|
44
|
-
readonly elementsChange: ElementsChange;
|
|
45
|
-
readonly appStateChange: AppStateChange;
|
|
46
|
-
constructor(elementsChange: ElementsChange, appStateChange: AppStateChange);
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Store which captures the observed changes and emits them as `StoreIncrementEvent` events.
|
|
50
|
-
*
|
|
51
|
-
* @experimental this interface is experimental and subject to change.
|
|
52
|
-
*/
|
|
53
|
-
export interface IStore {
|
|
54
|
-
onStoreIncrementEmitter: Emitter<[StoreIncrementEvent]>;
|
|
55
|
-
get snapshot(): Snapshot;
|
|
56
|
-
set snapshot(snapshot: Snapshot);
|
|
57
|
-
/**
|
|
58
|
-
* Use to schedule update of the snapshot, useful on updates for which we don't need to calculate increments (i.e. remote updates).
|
|
59
|
-
*/
|
|
60
|
-
shouldUpdateSnapshot(): void;
|
|
61
|
-
/**
|
|
62
|
-
* Use to schedule calculation of a store increment.
|
|
63
|
-
*/
|
|
64
|
-
shouldCaptureIncrement(): void;
|
|
65
|
-
/**
|
|
66
|
-
* Based on the scheduled operation, either only updates store snapshot or also calculates increment and emits the result as a `StoreIncrementEvent`.
|
|
67
|
-
*
|
|
68
|
-
* @emits StoreIncrementEvent when increment is calculated.
|
|
69
|
-
*/
|
|
70
|
-
commit(elements: Map<string, OrderedExcalidrawElement> | undefined, appState: AppState | ObservedAppState | undefined): void;
|
|
71
|
-
/**
|
|
72
|
-
* Clears the store instance.
|
|
73
|
-
*/
|
|
74
|
-
clear(): void;
|
|
75
|
-
/**
|
|
76
|
-
* Filters out yet uncomitted elements from `nextElements`, which are part of in-progress local async actions (ephemerals) and thus were not yet commited to the snapshot.
|
|
77
|
-
*
|
|
78
|
-
* This is necessary in updates in which we receive reconciled elements, already containing elements which were not yet captured by the local store (i.e. collab).
|
|
79
|
-
*/
|
|
80
|
-
filterUncomittedElements(prevElements: Map<string, OrderedExcalidrawElement>, nextElements: Map<string, OrderedExcalidrawElement>): Map<string, OrderedExcalidrawElement>;
|
|
81
|
-
}
|
|
82
|
-
export declare class Store implements IStore {
|
|
83
|
-
readonly onStoreIncrementEmitter: Emitter<[StoreIncrementEvent]>;
|
|
84
|
-
private scheduledActions;
|
|
85
|
-
private _snapshot;
|
|
86
|
-
get snapshot(): Snapshot;
|
|
87
|
-
set snapshot(snapshot: Snapshot);
|
|
88
|
-
shouldCaptureIncrement: () => void;
|
|
89
|
-
shouldUpdateSnapshot: () => void;
|
|
90
|
-
private scheduleAction;
|
|
91
|
-
commit: (elements: Map<string, OrderedExcalidrawElement> | undefined, appState: AppState | ObservedAppState | undefined) => void;
|
|
92
|
-
captureIncrement: (elements: Map<string, OrderedExcalidrawElement> | undefined, appState: AppState | ObservedAppState | undefined) => void;
|
|
93
|
-
updateSnapshot: (elements: Map<string, OrderedExcalidrawElement> | undefined, appState: AppState | ObservedAppState | undefined) => void;
|
|
94
|
-
filterUncomittedElements: (prevElements: Map<string, OrderedExcalidrawElement>, nextElements: Map<string, OrderedExcalidrawElement>) => Map<string, OrderedExcalidrawElement>;
|
|
95
|
-
clear: () => void;
|
|
96
|
-
private satisfiesScheduledActionsInvariant;
|
|
97
|
-
}
|
|
98
|
-
export declare class Snapshot {
|
|
99
|
-
readonly elements: Map<string, OrderedExcalidrawElement>;
|
|
100
|
-
readonly appState: ObservedAppState;
|
|
101
|
-
readonly meta: {
|
|
102
|
-
didElementsChange: boolean;
|
|
103
|
-
didAppStateChange: boolean;
|
|
104
|
-
isEmpty?: boolean;
|
|
105
|
-
};
|
|
106
|
-
private constructor();
|
|
107
|
-
static empty(): Snapshot;
|
|
108
|
-
isEmpty(): boolean | undefined;
|
|
109
|
-
/**
|
|
110
|
-
* Efficiently clone the existing snapshot, only if we detected changes.
|
|
111
|
-
*
|
|
112
|
-
* @returns same instance if there are no changes detected, new instance otherwise.
|
|
113
|
-
*/
|
|
114
|
-
maybeClone(elements: Map<string, OrderedExcalidrawElement> | undefined, appState: AppState | ObservedAppState | undefined): Snapshot;
|
|
115
|
-
private maybeCreateAppStateSnapshot;
|
|
116
|
-
private detectChangedAppState;
|
|
117
|
-
private maybeCreateElementsSnapshot;
|
|
118
|
-
/**
|
|
119
|
-
* Detect if there any changed elements.
|
|
120
|
-
*
|
|
121
|
-
* NOTE: we shouldn't just use `sceneVersionNonce` instead, as we need to call this before the scene updates.
|
|
122
|
-
*/
|
|
123
|
-
private detectChangedElements;
|
|
124
|
-
/**
|
|
125
|
-
* Perform structural clone, cloning only elements that changed.
|
|
126
|
-
*/
|
|
127
|
-
private createElementsSnapshot;
|
|
128
|
-
}
|
|
129
|
-
export {};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { ExcalidrawElement } from "./element/types";
|
|
2
|
-
import type { AppState } from "./types";
|
|
3
|
-
export declare const moveOneLeft: (allElements: readonly ExcalidrawElement[], appState: AppState) => readonly ExcalidrawElement[];
|
|
4
|
-
export declare const moveOneRight: (allElements: readonly ExcalidrawElement[], appState: AppState) => readonly ExcalidrawElement[];
|
|
5
|
-
export declare const moveAllLeft: (allElements: readonly ExcalidrawElement[], appState: AppState) => readonly ExcalidrawElement[] | ExcalidrawElement[];
|
|
6
|
-
export declare const moveAllRight: (allElements: readonly ExcalidrawElement[], appState: AppState) => readonly ExcalidrawElement[] | ExcalidrawElement[];
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Curve, LineSegment } from "@excalidraw/math";
|
|
2
1
|
import { type GlobalPoint } from "@excalidraw/math";
|
|
2
|
+
import type { Curve, LineSegment } from "@excalidraw/math";
|
|
3
3
|
import type { ExcalidrawDiamondElement, ExcalidrawRectanguloidElement } from "./types";
|
|
4
4
|
/**
|
|
5
5
|
* Get the building components of a rectanguloid element in the form of
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|