@excalidraw/excalidraw 0.18.0-432a46e → 0.18.0-4e0441e
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/chunk-CP5DND7P.js +7 -0
- package/dist/dev/chunk-CP5DND7P.js.map +7 -0
- package/dist/dev/{chunk-LMHBUWQS.js → chunk-LLUJPE5U.js} +62 -29
- package/dist/dev/chunk-LLUJPE5U.js.map +7 -0
- package/dist/dev/chunk-YMRX7R7U.js +5671 -0
- package/dist/dev/chunk-YMRX7R7U.js.map +7 -0
- package/dist/dev/data/{image-5HAY2PCR.js → image-L23D26XS.js} +3 -3
- package/dist/dev/index.css +997 -521
- package/dist/dev/index.css.map +3 -3
- package/dist/dev/index.js +13994 -12296
- package/dist/dev/index.js.map +4 -4
- package/dist/dev/locales/{en-OZCJJ2HN.js → en-YSPYSBUR.js} +4 -2
- package/dist/dev/subset-shared.chunk.js +1 -1
- package/dist/dev/subset-worker.chunk.js +1 -1
- package/dist/prod/chunk-A66AFZZU.js +7 -0
- package/dist/prod/chunk-HT4FKTIQ.js +4 -0
- package/dist/prod/chunk-RSFMSEP5.js +12 -0
- package/dist/prod/data/image-NWF7UX55.js +1 -0
- package/dist/prod/index.css +1 -1
- package/dist/prod/index.js +25 -17
- package/dist/prod/locales/en-SFRQHD7K.js +1 -0
- package/dist/prod/subset-shared.chunk.js +1 -1
- package/dist/prod/subset-worker.chunk.js +1 -1
- package/dist/types/{packages/common → common}/src/colors.d.ts +1 -0
- package/dist/types/{packages/common → common}/src/constants.d.ts +47 -7
- package/dist/types/{packages/excalidraw → common/src}/emitter.d.ts +1 -1
- package/dist/types/{packages/common → common}/src/font-metadata.d.ts +4 -2
- package/dist/types/{packages/common → common}/src/index.d.ts +1 -0
- package/dist/types/{packages/common → common}/src/utility-types.d.ts +5 -0
- package/dist/types/{packages/common → common}/src/utils.d.ts +21 -2
- package/dist/types/{packages/excalidraw/scene → element/src}/Scene.d.ts +16 -15
- package/dist/types/element/src/align.d.ts +8 -0
- package/dist/types/{packages/element → element}/src/binding.d.ts +26 -15
- package/dist/types/{packages/element → element}/src/bounds.d.ts +19 -6
- package/dist/types/element/src/collision.d.ts +32 -0
- package/dist/types/{packages/element → element}/src/cropElement.d.ts +1 -1
- package/dist/types/{packages/excalidraw/change.d.ts → element/src/delta.d.ts} +77 -40
- package/dist/types/element/src/distance.d.ts +3 -0
- package/dist/types/{packages/element → element}/src/distribute.d.ts +2 -1
- package/dist/types/{packages/element → element}/src/dragElements.d.ts +3 -2
- package/dist/types/{packages/element → element}/src/duplicate.d.ts +10 -13
- package/dist/types/{packages/element → element}/src/elbowArrow.d.ts +1 -1
- package/dist/types/{packages/element → element}/src/flowchart.d.ts +3 -2
- package/dist/types/{packages/element → element}/src/fractionalIndex.d.ts +9 -3
- package/dist/types/{packages/element → element}/src/frame.d.ts +5 -4
- package/dist/types/{packages/element → element}/src/groups.d.ts +1 -0
- package/dist/types/{packages/element → element}/src/heading.d.ts +0 -1
- package/dist/types/element/src/index.d.ts +58 -0
- package/dist/types/{packages/element → element}/src/linearElementEditor.d.ts +23 -36
- package/dist/types/{packages/element → element}/src/mutateElement.d.ts +11 -3
- package/dist/types/{packages/element → element}/src/newElement.d.ts +4 -3
- package/dist/types/element/src/positionElementsOnGrid.d.ts +2 -0
- package/dist/types/{packages/element → element}/src/renderElement.d.ts +4 -1
- package/dist/types/{packages/element → element}/src/resizeElements.d.ts +5 -4
- package/dist/types/{packages/element → element}/src/selection.d.ts +11 -5
- package/dist/types/element/src/shape.d.ts +42 -0
- package/dist/types/{packages/element → element}/src/sizeHelpers.d.ts +2 -2
- package/dist/types/element/src/store.d.ts +237 -0
- package/dist/types/{packages/element → element}/src/textElement.d.ts +5 -3
- package/dist/types/{packages/element → element}/src/transformHandles.d.ts +1 -1
- package/dist/types/{packages/element → element}/src/typeChecks.d.ts +19 -1
- package/dist/types/{packages/element → element}/src/types.d.ts +15 -2
- package/dist/types/element/src/utils.d.ts +31 -0
- package/dist/types/{packages/element → element}/src/zindex.d.ts +1 -1
- package/dist/types/{packages/excalidraw → excalidraw}/actions/actionAddToLibrary.d.ts +60 -54
- package/dist/types/{packages/excalidraw → excalidraw}/actions/actionBoundText.d.ts +40 -36
- package/dist/types/{packages/excalidraw → excalidraw}/actions/actionCanvas.d.ts +431 -228
- package/dist/types/{packages/excalidraw → excalidraw}/actions/actionClipboard.d.ts +120 -106
- package/dist/types/{packages/excalidraw → excalidraw}/actions/actionCropEditor.d.ts +20 -18
- package/dist/types/{packages/excalidraw → excalidraw}/actions/actionDeleteSelected.d.ts +60 -53
- package/dist/types/{packages/excalidraw → excalidraw}/actions/actionElementLink.d.ts +19 -17
- package/dist/types/{packages/excalidraw → excalidraw}/actions/actionElementLock.d.ts +55 -53
- package/dist/types/{packages/excalidraw → excalidraw}/actions/actionEmbeddable.d.ts +20 -18
- package/dist/types/{packages/excalidraw → excalidraw}/actions/actionExport.d.ts +190 -172
- package/dist/types/{packages/excalidraw → excalidraw}/actions/actionFinalize.d.ts +87 -42
- package/dist/types/{packages/excalidraw → excalidraw}/actions/actionFrame.d.ts +127 -119
- package/dist/types/{packages/excalidraw → excalidraw}/actions/actionGroup.d.ts +40 -36
- package/dist/types/{packages/excalidraw → excalidraw}/actions/actionHistory.d.ts +1 -2
- package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +718 -0
- package/dist/types/{packages/excalidraw → excalidraw}/actions/actionLink.d.ts +19 -17
- package/dist/types/excalidraw/actions/actionMenu.d.ts +184 -0
- package/dist/types/{packages/excalidraw → excalidraw}/actions/actionNavigate.d.ts +40 -36
- package/dist/types/{packages/excalidraw → excalidraw}/actions/actionProperties.d.ts +320 -273
- package/dist/types/{packages/excalidraw → excalidraw}/actions/actionSelectAll.d.ts +20 -18
- package/dist/types/{packages/excalidraw → excalidraw}/actions/actionStyles.d.ts +20 -18
- package/dist/types/{packages/excalidraw → excalidraw}/actions/actionToggleGridMode.d.ts +20 -18
- package/dist/types/{packages/excalidraw → excalidraw}/actions/actionToggleObjectsSnapMode.d.ts +20 -18
- package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +187 -0
- package/dist/types/excalidraw/actions/actionToggleShapeSwitch.d.ts +19 -0
- package/dist/types/{packages/excalidraw → excalidraw}/actions/actionToggleStats.d.ts +20 -19
- package/dist/types/{packages/excalidraw → excalidraw}/actions/actionToggleViewMode.d.ts +20 -19
- package/dist/types/{packages/excalidraw → excalidraw}/actions/actionToggleZenMode.d.ts +20 -19
- package/dist/types/{packages/excalidraw → excalidraw}/actions/index.d.ts +2 -2
- package/dist/types/{packages/excalidraw → excalidraw}/actions/types.d.ts +4 -3
- package/dist/types/{packages/excalidraw → excalidraw}/animated-trail.d.ts +7 -1
- package/dist/types/{packages/excalidraw → excalidraw}/appState.d.ts +24 -10
- package/dist/types/excalidraw/clipboard.d.ts +129 -0
- package/dist/types/{packages/excalidraw → excalidraw}/components/Actions.d.ts +17 -7
- package/dist/types/{packages/excalidraw → excalidraw}/components/App.d.ts +43 -25
- package/dist/types/{packages/excalidraw → excalidraw}/components/ButtonIcon.d.ts +1 -0
- package/dist/types/{packages/excalidraw → excalidraw}/components/ColorPicker/ColorInput.d.ts +2 -1
- package/dist/types/{packages/excalidraw → excalidraw}/components/ColorPicker/ColorPicker.d.ts +6 -1
- package/dist/types/{packages/excalidraw → excalidraw}/components/ColorPicker/CustomColorList.d.ts +1 -1
- package/dist/types/excalidraw/components/ColorPicker/HotkeyLabel.d.ts +7 -0
- package/dist/types/{packages/excalidraw → excalidraw}/components/ColorPicker/Picker.d.ts +4 -3
- package/dist/types/{packages/excalidraw → excalidraw}/components/ColorPicker/PickerColorList.d.ts +3 -3
- package/dist/types/excalidraw/components/ColorPicker/ShadeList.d.ts +9 -0
- package/dist/types/{packages/excalidraw → excalidraw}/components/ColorPicker/TopPicks.d.ts +1 -1
- package/dist/types/{packages/excalidraw → excalidraw}/components/ColorPicker/colorPickerUtils.d.ts +2 -2
- package/dist/types/{packages/excalidraw → excalidraw}/components/ColorPicker/keyboardNavHandlers.d.ts +1 -1
- package/dist/types/{packages/excalidraw → excalidraw}/components/CommandPalette/CommandPalette.d.ts +1 -0
- package/dist/types/excalidraw/components/ConvertElementTypePopup.d.ts +23 -0
- package/dist/types/{packages/excalidraw → excalidraw}/components/ElementLinkDialog.d.ts +4 -3
- package/dist/types/excalidraw/components/Ellipsify.d.ts +4 -0
- package/dist/types/{packages/excalidraw → excalidraw}/components/ExcalidrawLogo.d.ts +1 -1
- package/dist/types/{packages/excalidraw → excalidraw}/components/FontPicker/FontPicker.d.ts +2 -1
- package/dist/types/excalidraw/components/FontPicker/FontPickerTrigger.d.ts +8 -0
- package/dist/types/excalidraw/components/InlineIcon.d.ts +5 -0
- package/dist/types/{packages/excalidraw → excalidraw}/components/LayerUI.d.ts +2 -1
- package/dist/types/{packages/excalidraw → excalidraw}/components/LibraryMenuSection.d.ts +1 -1
- package/dist/types/{packages/excalidraw → excalidraw}/components/MobileMenu.d.ts +3 -5
- package/dist/types/excalidraw/components/MobileToolBar.d.ts +11 -0
- package/dist/types/{packages/excalidraw → excalidraw}/components/Popover.d.ts +2 -1
- package/dist/types/{packages/excalidraw → excalidraw}/components/PropertiesPopover.d.ts +1 -0
- package/dist/types/{packages/excalidraw/components/ButtonIconSelect.d.ts → excalidraw/components/RadioSelection.d.ts} +1 -1
- package/dist/types/excalidraw/components/Range.d.ts +8 -0
- package/dist/types/{packages/excalidraw → excalidraw}/components/Stats/Angle.d.ts +1 -1
- package/dist/types/{packages/excalidraw → excalidraw}/components/Stats/CanvasGrid.d.ts +1 -1
- package/dist/types/{packages/excalidraw → excalidraw}/components/Stats/Collapsible.d.ts +2 -1
- package/dist/types/{packages/excalidraw → excalidraw}/components/Stats/Dimension.d.ts +1 -1
- package/dist/types/{packages/excalidraw → excalidraw}/components/Stats/DragInput.d.ts +12 -2
- package/dist/types/{packages/excalidraw → excalidraw}/components/Stats/FontSize.d.ts +1 -1
- package/dist/types/{packages/excalidraw → excalidraw}/components/Stats/MultiAngle.d.ts +1 -1
- package/dist/types/{packages/excalidraw → excalidraw}/components/Stats/MultiDimension.d.ts +1 -1
- package/dist/types/{packages/excalidraw → excalidraw}/components/Stats/MultiFontSize.d.ts +1 -1
- package/dist/types/{packages/excalidraw → excalidraw}/components/Stats/MultiPosition.d.ts +1 -1
- package/dist/types/{packages/excalidraw → excalidraw}/components/Stats/Position.d.ts +1 -1
- package/dist/types/{packages/excalidraw → excalidraw}/components/Stats/utils.d.ts +4 -11
- package/dist/types/{packages/excalidraw → excalidraw}/components/TTDDialog/TTDDialogTrigger.d.ts +1 -2
- package/dist/types/{packages/excalidraw → excalidraw}/components/TextField.d.ts +1 -0
- package/dist/types/excalidraw/components/ToolPopover.d.ts +25 -0
- package/dist/types/excalidraw/components/UnlockPopup.d.ts +8 -0
- package/dist/types/{packages/excalidraw → excalidraw}/components/canvases/InteractiveCanvas.d.ts +1 -0
- package/dist/types/{packages/excalidraw → excalidraw}/components/dropdownMenu/DropdownMenu.d.ts +4 -2
- package/dist/types/{packages/excalidraw → excalidraw}/components/dropdownMenu/DropdownMenuContent.d.ts +2 -1
- package/dist/types/{packages/excalidraw → excalidraw}/components/hyperlink/Hyperlink.d.ts +3 -2
- package/dist/types/{packages/excalidraw → excalidraw}/components/hyperlink/helpers.d.ts +2 -1
- package/dist/types/{packages/excalidraw → excalidraw}/components/icons.d.ts +9 -0
- package/dist/types/excalidraw/components/shapes.d.ts +190 -0
- package/dist/types/{packages/excalidraw → excalidraw}/data/blob.d.ts +3 -7
- package/dist/types/{packages/excalidraw → excalidraw}/data/reconcile.d.ts +1 -0
- package/dist/types/{packages/excalidraw → excalidraw}/data/restore.d.ts +6 -1
- package/dist/types/{packages/excalidraw → excalidraw}/data/transform.d.ts +1 -1
- package/dist/types/{packages/excalidraw → excalidraw}/data/types.d.ts +4 -1
- package/dist/types/{packages/excalidraw → excalidraw}/editor-jotai.d.ts +6 -6
- package/dist/types/excalidraw/eraser/index.d.ts +12 -0
- package/dist/types/{packages/excalidraw → excalidraw}/fonts/Fonts.d.ts +1 -1
- package/dist/types/excalidraw/history.d.ts +48 -0
- package/dist/types/{packages/excalidraw → excalidraw}/hooks/useEmitter.d.ts +1 -1
- package/dist/types/{packages/excalidraw → excalidraw}/hooks/useLibraryItemSvg.d.ts +1 -1
- package/dist/types/excalidraw/hooks/useTextEditorFocus.d.ts +14 -0
- package/dist/types/{packages/excalidraw → excalidraw}/index.d.ts +11 -10
- package/dist/types/excalidraw/lasso/index.d.ts +16 -0
- package/dist/types/excalidraw/lasso/utils.d.ts +13 -0
- package/dist/types/excalidraw/renderer/helpers.d.ts +18 -0
- package/dist/types/excalidraw/renderer/staticScene.d.ts +14 -0
- package/dist/types/{packages/excalidraw → excalidraw}/scene/Renderer.d.ts +1 -2
- package/dist/types/excalidraw/scene/index.d.ts +4 -0
- package/dist/types/{packages/excalidraw → excalidraw}/scene/scrollbars.d.ts +2 -3
- package/dist/types/{packages/excalidraw → excalidraw}/scene/types.d.ts +2 -0
- package/dist/types/excalidraw/shortcut.d.ts +1 -0
- package/dist/types/{packages/excalidraw → excalidraw}/snapping.d.ts +2 -2
- package/dist/types/{packages/excalidraw → excalidraw}/types.d.ts +48 -17
- package/dist/types/{packages/excalidraw → excalidraw}/wysiwyg/textWysiwyg.d.ts +3 -1
- package/dist/types/{packages/math → math}/src/angle.d.ts +2 -0
- package/dist/types/math/src/constants.d.ts +3 -0
- package/dist/types/math/src/curve.d.ts +74 -0
- package/dist/types/{packages/math → math}/src/index.d.ts +1 -0
- package/dist/types/{packages/math → math}/src/point.d.ts +1 -1
- package/dist/types/{packages/math → math}/src/polygon.d.ts +1 -0
- package/dist/types/{packages/math → math}/src/rectangle.d.ts +2 -0
- package/dist/types/{packages/math → math}/src/segment.d.ts +2 -1
- package/dist/types/{packages/math → math}/src/types.d.ts +1 -0
- package/dist/types/{packages/math → math}/src/vector.d.ts +8 -2
- package/dist/types/{packages/utils → utils}/src/bbox.d.ts +1 -1
- package/dist/types/{packages/utils → utils}/src/index.d.ts +1 -1
- package/dist/types/{packages/utils → utils}/src/withinBounds.d.ts +1 -1
- package/history.ts +146 -109
- package/package.json +31 -11
- package/dist/dev/chunk-LMHBUWQS.js.map +0 -7
- package/dist/dev/chunk-S7W4OWSF.js +0 -18442
- package/dist/dev/chunk-S7W4OWSF.js.map +0 -7
- package/dist/dev/chunk-ZG3EI5XS.js +0 -7
- package/dist/dev/chunk-ZG3EI5XS.js.map +0 -7
- package/dist/prod/chunk-6U3AYISY.js +0 -12
- package/dist/prod/chunk-LRITYP5X.js +0 -31
- package/dist/prod/chunk-U24AOZ3B.js +0 -7
- package/dist/prod/data/image-W3GRS73V.js +0 -1
- package/dist/prod/locales/en-B4ZKOASM.js +0 -1
- package/dist/types/excalidraw-app/app_constants.d.ts +0 -44
- package/dist/types/packages/element/src/Shape.d.ts +0 -17
- package/dist/types/packages/element/src/ShapeCache.d.ts +0 -25
- package/dist/types/packages/element/src/align.d.ts +0 -7
- package/dist/types/packages/element/src/collision.d.ts +0 -26
- package/dist/types/packages/element/src/distance.d.ts +0 -3
- package/dist/types/packages/element/src/index.d.ts +0 -16
- package/dist/types/packages/element/src/shapes.d.ts +0 -23
- package/dist/types/packages/element/src/utils.d.ts +0 -21
- package/dist/types/packages/excalidraw/actions/actionLinearEditor.d.ts +0 -192
- package/dist/types/packages/excalidraw/actions/actionMenu.d.ts +0 -554
- package/dist/types/packages/excalidraw/actions/actionToggleSearchMenu.d.ts +0 -357
- package/dist/types/packages/excalidraw/clipboard.d.ts +0 -66
- package/dist/types/packages/excalidraw/components/ButtonSelect.d.ts +0 -9
- package/dist/types/packages/excalidraw/components/ColorPicker/HotkeyLabel.d.ts +0 -8
- package/dist/types/packages/excalidraw/components/ColorPicker/ShadeList.d.ts +0 -8
- package/dist/types/packages/excalidraw/components/FontPicker/FontPickerTrigger.d.ts +0 -6
- package/dist/types/packages/excalidraw/components/InlineIcon.d.ts +0 -3
- package/dist/types/packages/excalidraw/components/Range.d.ts +0 -8
- package/dist/types/packages/excalidraw/components/shapes.d.ts +0 -62
- package/dist/types/packages/excalidraw/history.d.ts +0 -40
- package/dist/types/packages/excalidraw/renderer/helpers.d.ts +0 -13
- package/dist/types/packages/excalidraw/renderer/staticScene.d.ts +0 -11
- package/dist/types/packages/excalidraw/scene/index.d.ts +0 -4
- package/dist/types/packages/excalidraw/store.d.ts +0 -129
- package/dist/types/packages/excalidraw/tests/fixtures/diagramFixture.d.ts +0 -504
- package/dist/types/packages/excalidraw/tests/fixtures/elementFixture.d.ts +0 -7
- package/dist/types/packages/excalidraw/tests/helpers/api.d.ts +0 -89
- package/dist/types/packages/excalidraw/tests/helpers/colorize.d.ts +0 -2
- package/dist/types/packages/excalidraw/tests/helpers/mocks.d.ts +0 -5
- package/dist/types/packages/excalidraw/tests/helpers/polyfills.d.ts +0 -36
- package/dist/types/packages/excalidraw/tests/helpers/ui.d.ts +0 -189
- package/dist/types/packages/excalidraw/tests/queries/dom.d.ts +0 -2
- package/dist/types/packages/excalidraw/tests/queries/toolQueries.d.ts +0 -2
- package/dist/types/packages/excalidraw/tests/test-utils.d.ts +0 -139
- package/dist/types/packages/excalidraw/visualdebug.d.ts +0 -41
- package/dist/types/packages/math/src/curve.d.ts +0 -40
- package/dist/types/packages/utils/src/collision.d.ts +0 -8
- /package/dist/dev/data/{image-5HAY2PCR.js.map → image-L23D26XS.js.map} +0 -0
- /package/dist/dev/locales/{en-OZCJJ2HN.js.map → en-YSPYSBUR.js.map} +0 -0
- /package/dist/types/{packages/common → common}/src/binary-heap.d.ts +0 -0
- /package/dist/types/{packages/common → common}/src/keys.d.ts +0 -0
- /package/dist/types/{packages/common → common}/src/points.d.ts +0 -0
- /package/dist/types/{packages/common → common}/src/promise-pool.d.ts +0 -0
- /package/dist/types/{packages/common → common}/src/queue.d.ts +0 -0
- /package/dist/types/{packages/common → common}/src/random.d.ts +0 -0
- /package/dist/types/{packages/common → common}/src/url.d.ts +0 -0
- /package/dist/types/{packages/element → element}/src/comparisons.d.ts +0 -0
- /package/dist/types/{packages/element → element}/src/containerCache.d.ts +0 -0
- /package/dist/types/{packages/element → element}/src/elementLink.d.ts +0 -0
- /package/dist/types/{packages/element → element}/src/embeddable.d.ts +0 -0
- /package/dist/types/{packages/element → element}/src/image.d.ts +0 -0
- /package/dist/types/{packages/element → element}/src/resizeTest.d.ts +0 -0
- /package/dist/types/{packages/element → element}/src/showSelectedShapeActions.d.ts +0 -0
- /package/dist/types/{packages/element → element}/src/sortElements.d.ts +0 -0
- /package/dist/types/{packages/element → element}/src/textMeasurements.d.ts +0 -0
- /package/dist/types/{packages/element → element}/src/textWrapping.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/actions/actionAlign.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/actions/actionDistribute.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/actions/actionDuplicateSelection.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/actions/actionFlip.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/actions/actionTextAutoResize.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/actions/actionZindex.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/actions/manager.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/actions/register.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/actions/shortcuts.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/analytics.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/animation-frame-handler.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/charts.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/clients.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/ActiveConfirmDialog.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/Avatar.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/BraveMeasureTextError.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/Button.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/ButtonIconCycle.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/ButtonSeparator.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/Card.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/CheckboxItem.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/ColorPicker/PickerHeading.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/CommandPalette/defaultCommandPaletteItems.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/CommandPalette/types.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/ConfirmDialog.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/ContextMenu.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/DarkModeToggle.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/DefaultSidebar.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/DiagramToCodePlugin/DiagramToCodePlugin.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/Dialog.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/DialogActionButton.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/ElementCanvasButtons.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/ErrorDialog.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/EyeDropper.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/FilledButton.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/FixedSideContainer.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/FollowMode/FollowMode.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/FontPicker/FontPickerList.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/FontPicker/keyboardNavHandlers.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/HandButton.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/HelpButton.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/HelpDialog.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/HintViewer.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/IconPicker.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/ImageExportDialog.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/InitializeApp.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/Island.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/JSONExportDialog.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/LaserPointerButton.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/LibraryMenu.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/LibraryMenuBrowseButton.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/LibraryMenuControlButtons.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/LibraryMenuHeaderContent.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/LibraryMenuItems.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/LibraryUnit.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/LoadingMessage.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/LockButton.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/MagicButton.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/Modal.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/OverwriteConfirm/OverwriteConfirm.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/OverwriteConfirm/OverwriteConfirmActions.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/OverwriteConfirm/OverwriteConfirmState.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/Paragraph.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/PasteChartDialog.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/PenModeButton.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/ProjectName.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/PublishLibrary.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/QuickSearch.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/RadioGroup.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/SVGLayer.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/ScrollableList.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/SearchMenu.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/Section.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/ShareableLinkDialog.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/Sidebar/Sidebar.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/Sidebar/SidebarHeader.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/Sidebar/SidebarTab.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/Sidebar/SidebarTabTrigger.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/Sidebar/SidebarTabTriggers.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/Sidebar/SidebarTabs.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/Sidebar/SidebarTrigger.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/Sidebar/common.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/Spinner.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/Stack.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/Stats/index.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/Switch.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/TTDDialog/MermaidToExcalidraw.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/TTDDialog/TTDDialog.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/TTDDialog/TTDDialogInput.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/TTDDialog/TTDDialogOutput.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/TTDDialog/TTDDialogPanel.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/TTDDialog/TTDDialogPanels.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/TTDDialog/TTDDialogSubmitShortcut.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/TTDDialog/TTDDialogTab.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/TTDDialog/TTDDialogTabTrigger.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/TTDDialog/TTDDialogTabTriggers.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/TTDDialog/TTDDialogTabs.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/TTDDialog/common.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/Toast.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/ToolButton.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/Tooltip.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/Trans.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/UserList.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/canvases/NewElementCanvas.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/canvases/StaticCanvas.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/canvases/index.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/dropdownMenu/DropdownMenuGroup.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/dropdownMenu/DropdownMenuItem.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/dropdownMenu/DropdownMenuItemContent.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/dropdownMenu/DropdownMenuItemContentRadio.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/dropdownMenu/DropdownMenuItemCustom.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/dropdownMenu/DropdownMenuItemLink.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/dropdownMenu/DropdownMenuSeparator.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/dropdownMenu/DropdownMenuTrigger.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/dropdownMenu/common.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/dropdownMenu/dropdownMenuUtils.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/footer/Footer.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/footer/FooterCenter.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/hoc/withInternalFallback.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/live-collaboration/LiveCollaborationTrigger.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/main-menu/DefaultItems.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/main-menu/MainMenu.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/welcome-screen/WelcomeScreen.Center.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/welcome-screen/WelcomeScreen.Hints.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/welcome-screen/WelcomeScreen.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/context/tunnels.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/context/ui-appState.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/cursor.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/data/EditorLocalStorage.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/data/ai/types.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/data/encode.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/data/encryption.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/data/filesystem.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/data/image.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/data/index.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/data/json.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/data/library.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/data/resave.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/deburr.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/errors.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/fonts/Cascadia/index.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/fonts/ComicShanns/index.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/fonts/Emoji/index.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/fonts/ExcalidrawFontFace.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/fonts/Excalifont/index.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/fonts/Helvetica/index.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/fonts/Liberation/index.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/fonts/Lilita/index.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/fonts/Nunito/index.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/fonts/Virgil/index.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/fonts/Xiaolai/index.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/fonts/index.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/gesture.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/hooks/useCallbackRefState.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/hooks/useCopiedIndicator.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/hooks/useCreatePortalContainer.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/hooks/useOutsideClick.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/hooks/useScrollPosition.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/hooks/useStable.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/hooks/useStableCallback.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/hooks/useTransition.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/i18n.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/index-node.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/laser-trails.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/mermaid.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/polyfill.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/reactUtils.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/renderer/interactiveScene.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/renderer/renderNewElementScene.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/renderer/renderSnaps.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/renderer/roundRect.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/renderer/staticSvgScene.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/scene/export.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/scene/normalize.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/scene/scroll.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/scene/zoom.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/subset/harfbuzz/harfbuzz-bindings.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/subset/harfbuzz/harfbuzz-loader.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/subset/harfbuzz/harfbuzz-wasm.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/subset/subset-main.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/subset/subset-shared.chunk.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/subset/subset-worker.chunk.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/subset/woff2/woff2-bindings.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/subset/woff2/woff2-loader.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/subset/woff2/woff2-wasm.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/workers.d.ts +0 -0
- /package/dist/types/{packages/math → math}/src/ellipse.d.ts +0 -0
- /package/dist/types/{packages/math → math}/src/line.d.ts +0 -0
- /package/dist/types/{packages/math → math}/src/range.d.ts +0 -0
- /package/dist/types/{packages/math → math}/src/triangle.d.ts +0 -0
- /package/dist/types/{packages/math → math}/src/utils.d.ts +0 -0
- /package/dist/types/{packages/utils → utils}/src/export.d.ts +0 -0
- /package/dist/types/{packages/utils → utils}/src/shape.d.ts +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { MarkOptional } from "@excalidraw/common/utility-types";
|
|
2
|
-
import type { ExcalidrawImageElement, ExcalidrawTextElement, ExcalidrawLinearElement, ExcalidrawGenericElement, NonDeleted, TextAlign, VerticalAlign, Arrowhead, ExcalidrawFreeDrawElement, FontFamilyValues, ExcalidrawTextContainer, ExcalidrawFrameElement, ExcalidrawEmbeddableElement, ExcalidrawMagicFrameElement, ExcalidrawIframeElement, ElementsMap, ExcalidrawArrowElement,
|
|
2
|
+
import type { ExcalidrawImageElement, ExcalidrawTextElement, ExcalidrawLinearElement, ExcalidrawGenericElement, NonDeleted, TextAlign, VerticalAlign, Arrowhead, ExcalidrawFreeDrawElement, FontFamilyValues, ExcalidrawTextContainer, ExcalidrawFrameElement, ExcalidrawEmbeddableElement, ExcalidrawMagicFrameElement, ExcalidrawIframeElement, ElementsMap, ExcalidrawArrowElement, ExcalidrawElbowArrowElement, ExcalidrawLineElement } from "./types";
|
|
3
3
|
export type ElementConstructorOpts = MarkOptional<Omit<ExcalidrawGenericElement, "id" | "type" | "isDeleted" | "updated">, "width" | "height" | "angle" | "groupIds" | "frameId" | "index" | "boundElements" | "seed" | "version" | "versionNonce" | "link" | "strokeStyle" | "fillStyle" | "strokeColor" | "backgroundColor" | "roughness" | "strokeWidth" | "roundness" | "locked" | "opacity" | "customData">;
|
|
4
4
|
export declare const newElement: (opts: {
|
|
5
5
|
type: ExcalidrawGenericElement["type"];
|
|
@@ -43,6 +43,7 @@ export declare const newFreeDrawElement: (opts: {
|
|
|
43
43
|
export declare const newLinearElement: (opts: {
|
|
44
44
|
type: ExcalidrawLinearElement["type"];
|
|
45
45
|
points?: ExcalidrawLinearElement["points"];
|
|
46
|
+
polygon?: ExcalidrawLineElement["polygon"];
|
|
46
47
|
} & ElementConstructorOpts) => NonDeleted<ExcalidrawLinearElement>;
|
|
47
48
|
export declare const newArrowElement: <T extends boolean>(opts: {
|
|
48
49
|
type: ExcalidrawArrowElement["type"];
|
|
@@ -50,8 +51,8 @@ export declare const newArrowElement: <T extends boolean>(opts: {
|
|
|
50
51
|
endArrowhead?: Arrowhead | null | undefined;
|
|
51
52
|
points?: readonly import("@excalidraw/math").LocalPoint[] | undefined;
|
|
52
53
|
elbowed?: T | undefined;
|
|
53
|
-
fixedSegments?: FixedSegment[] | null | undefined;
|
|
54
|
-
} & Omit<Omit<ExcalidrawGenericElement, "id" | "isDeleted" | "updated" | "type">, "link" | "
|
|
54
|
+
fixedSegments?: readonly import("./types").FixedSegment[] | null | undefined;
|
|
55
|
+
} & Omit<Omit<ExcalidrawGenericElement, "id" | "isDeleted" | "updated" | "type">, "link" | "strokeColor" | "backgroundColor" | "fillStyle" | "strokeWidth" | "strokeStyle" | "roundness" | "roughness" | "opacity" | "width" | "height" | "angle" | "seed" | "version" | "versionNonce" | "index" | "groupIds" | "frameId" | "boundElements" | "locked" | "customData"> & Partial<Pick<Omit<ExcalidrawGenericElement, "id" | "isDeleted" | "updated" | "type">, "link" | "strokeColor" | "backgroundColor" | "fillStyle" | "strokeWidth" | "strokeStyle" | "roundness" | "roughness" | "opacity" | "width" | "height" | "angle" | "seed" | "version" | "versionNonce" | "index" | "groupIds" | "frameId" | "boundElements" | "locked" | "customData">>) => T extends true ? NonDeleted<ExcalidrawElbowArrowElement> : NonDeleted<ExcalidrawArrowElement>;
|
|
55
56
|
export declare const newImageElement: (opts: {
|
|
56
57
|
type: ExcalidrawImageElement["type"];
|
|
57
58
|
status?: ExcalidrawImageElement["status"];
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { type GlobalPoint } from "@excalidraw/math";
|
|
1
2
|
import type { AppState, StaticCanvasAppState, InteractiveCanvasAppState, ElementsPendingErasure, PendingExcalidrawElements } from "@excalidraw/excalidraw/types";
|
|
2
3
|
import type { StaticCanvasRenderConfig, RenderableElementsMap, InteractiveCanvasRenderConfig } from "@excalidraw/excalidraw/scene/types";
|
|
3
|
-
import type { ExcalidrawElement, ExcalidrawTextElement, NonDeletedExcalidrawElement, ExcalidrawFreeDrawElement, ExcalidrawImageElement, ExcalidrawFrameLikeElement, NonDeletedSceneElementsMap } from "./types";
|
|
4
|
+
import type { ExcalidrawElement, ExcalidrawTextElement, NonDeletedExcalidrawElement, ExcalidrawFreeDrawElement, ExcalidrawImageElement, ExcalidrawFrameLikeElement, NonDeletedSceneElementsMap, ElementsMap } from "./types";
|
|
4
5
|
import type { RoughCanvas } from "roughjs/bin/canvas";
|
|
5
6
|
export declare const IMAGE_INVERT_FILTER = "invert(100%) hue-rotate(180deg) saturate(1.25)";
|
|
6
7
|
export declare const getRenderOpacity: (element: ExcalidrawElement, containingFrame: ExcalidrawFrameLikeElement | null, elementsPendingErasure: ElementsPendingErasure, pendingNodes: Readonly<PendingExcalidrawElements> | null, globalAlpha?: number) => number;
|
|
@@ -26,3 +27,5 @@ export declare const pathsCache: WeakMap<ExcalidrawFreeDrawElement, Path2D>;
|
|
|
26
27
|
export declare function generateFreeDrawShape(element: ExcalidrawFreeDrawElement): Path2D;
|
|
27
28
|
export declare function getFreeDrawPath2D(element: ExcalidrawFreeDrawElement): Path2D | undefined;
|
|
28
29
|
export declare function getFreeDrawSvgPath(element: ExcalidrawFreeDrawElement): string;
|
|
30
|
+
export declare function getFreedrawOutlineAsSegments(element: ExcalidrawFreeDrawElement, points: [number, number][], elementsMap: ElementsMap): import("@excalidraw/math").LineSegment<GlobalPoint>[];
|
|
31
|
+
export declare function getFreedrawOutlinePoints(element: ExcalidrawFreeDrawElement): [number, number][];
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { type LocalPoint } from "@excalidraw/math";
|
|
2
|
-
import type Scene from "@excalidraw/excalidraw/scene/Scene";
|
|
3
2
|
import type { PointerDownState } from "@excalidraw/excalidraw/types";
|
|
3
|
+
import type { Scene } from "./Scene";
|
|
4
4
|
import type { BoundingBox } from "./bounds";
|
|
5
5
|
import type { MaybeTransformHandleType, TransformHandleDirection } from "./transformHandles";
|
|
6
|
-
import type { ExcalidrawLinearElement, ExcalidrawTextElement, NonDeletedExcalidrawElement, NonDeleted, ExcalidrawElement, ElementsMap
|
|
7
|
-
export declare const transformElements: (originalElements: PointerDownState["originalElements"], transformHandleType: MaybeTransformHandleType, selectedElements: readonly NonDeletedExcalidrawElement[],
|
|
6
|
+
import type { ExcalidrawLinearElement, ExcalidrawTextElement, NonDeletedExcalidrawElement, NonDeleted, ExcalidrawElement, ElementsMap } from "./types";
|
|
7
|
+
export declare const transformElements: (originalElements: PointerDownState["originalElements"], transformHandleType: MaybeTransformHandleType, selectedElements: readonly NonDeletedExcalidrawElement[], scene: Scene, shouldRotateWithDiscreteAngle: boolean, shouldResizeFromCenter: boolean, shouldMaintainAspectRatio: boolean, pointerX: number, pointerY: number, centerX: number, centerY: number) => boolean;
|
|
8
8
|
export declare const rescalePointsInElement: (element: NonDeletedExcalidrawElement, width: number, height: number, normalizePoints: boolean) => {
|
|
9
9
|
points: LocalPoint[];
|
|
10
10
|
} | {
|
|
@@ -13,9 +13,10 @@ export declare const rescalePointsInElement: (element: NonDeletedExcalidrawEleme
|
|
|
13
13
|
export declare const measureFontSizeFromWidth: (element: NonDeleted<ExcalidrawTextElement>, elementsMap: ElementsMap, nextWidth: number) => {
|
|
14
14
|
size: number;
|
|
15
15
|
} | null;
|
|
16
|
+
export declare const resizeSingleTextElement: (origElement: NonDeleted<ExcalidrawTextElement>, element: NonDeleted<ExcalidrawTextElement>, scene: Scene, transformHandleType: TransformHandleDirection, shouldResizeFromCenter: boolean, nextWidth: number, nextHeight: number) => void;
|
|
16
17
|
export declare const getResizeOffsetXY: (transformHandleType: MaybeTransformHandleType, selectedElements: NonDeletedExcalidrawElement[], elementsMap: ElementsMap, x: number, y: number) => [number, number];
|
|
17
18
|
export declare const getResizeArrowDirection: (transformHandleType: MaybeTransformHandleType, element: NonDeleted<ExcalidrawLinearElement>) => "origin" | "end";
|
|
18
|
-
export declare const resizeSingleElement: (nextWidth: number, nextHeight: number, latestElement: ExcalidrawElement, origElement: ExcalidrawElement,
|
|
19
|
+
export declare const resizeSingleElement: (nextWidth: number, nextHeight: number, latestElement: ExcalidrawElement, origElement: ExcalidrawElement, originalElementsMap: ElementsMap, scene: Scene, handleDirection: TransformHandleDirection, { shouldInformMutation, shouldMaintainAspectRatio, shouldResizeFromCenter, }?: {
|
|
19
20
|
shouldMaintainAspectRatio?: boolean | undefined;
|
|
20
21
|
shouldResizeFromCenter?: boolean | undefined;
|
|
21
22
|
shouldInformMutation?: boolean | undefined;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { AppState, InteractiveCanvasAppState } from "@excalidraw/excalidraw/types";
|
|
2
|
+
import { LinearElementEditor } from "./linearElementEditor";
|
|
2
3
|
import type { ElementsMap, ElementsMapOrArray, ExcalidrawElement, NonDeletedExcalidrawElement } from "./types";
|
|
3
4
|
/**
|
|
4
5
|
* Frames and their containing elements are not to be selected at the same time.
|
|
@@ -13,11 +14,6 @@ export declare const isSomeElementSelected: {
|
|
|
13
14
|
(elements: readonly NonDeletedExcalidrawElement[], appState: Pick<AppState, "selectedElementIds">): boolean;
|
|
14
15
|
clearCache(): void;
|
|
15
16
|
};
|
|
16
|
-
/**
|
|
17
|
-
* Returns common attribute (picked by `getAttribute` callback) of selected
|
|
18
|
-
* elements. If elements don't share the same value, returns `null`.
|
|
19
|
-
*/
|
|
20
|
-
export declare const getCommonAttributeOfSelectedElements: <T>(elements: readonly NonDeletedExcalidrawElement[], appState: Pick<AppState, "selectedElementIds">, getAttribute: (element: ExcalidrawElement) => T) => T | null;
|
|
21
17
|
export declare const getSelectedElements: (elements: ElementsMapOrArray, appState: Pick<InteractiveCanvasAppState, "selectedElementIds">, opts?: {
|
|
22
18
|
includeBoundTextElement?: boolean;
|
|
23
19
|
includeElementsInFrames?: boolean;
|
|
@@ -30,3 +26,13 @@ export declare const getTargetElements: (elements: ElementsMapOrArray, appState:
|
|
|
30
26
|
export declare const makeNextSelectedElementIds: (nextSelectedElementIds: AppState["selectedElementIds"], prevState: Pick<AppState, "selectedElementIds">) => Readonly<{
|
|
31
27
|
[id: string]: true;
|
|
32
28
|
}>;
|
|
29
|
+
export declare const getSelectionStateForElements: (targetElements: readonly ExcalidrawElement[], allElements: readonly NonDeletedExcalidrawElement[], appState: AppState) => {
|
|
30
|
+
editingGroupId: string | null;
|
|
31
|
+
selectedElementIds: Readonly<{
|
|
32
|
+
[id: string]: true;
|
|
33
|
+
}>;
|
|
34
|
+
selectedGroupIds: {
|
|
35
|
+
[groupId: string]: boolean;
|
|
36
|
+
};
|
|
37
|
+
selectedLinearElement: LinearElementEditor | null;
|
|
38
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { type GeometricShape } from "@excalidraw/utils/shape";
|
|
2
|
+
import { type LocalPoint } from "@excalidraw/math";
|
|
3
|
+
import type { GlobalPoint } from "@excalidraw/math";
|
|
4
|
+
import type { AppState, EmbedsValidationStatus } from "@excalidraw/excalidraw/types";
|
|
5
|
+
import type { ElementShape, ElementShapes } from "@excalidraw/excalidraw/scene/types";
|
|
6
|
+
import type { ExcalidrawElement, ExcalidrawLinearElement, ExcalidrawFreeDrawElement, ElementsMap, ExcalidrawLineElement } from "./types";
|
|
7
|
+
import type { Drawable, Options } from "roughjs/bin/core";
|
|
8
|
+
export declare class ShapeCache {
|
|
9
|
+
private static rg;
|
|
10
|
+
private static cache;
|
|
11
|
+
/**
|
|
12
|
+
* Retrieves shape from cache if available. Use this only if shape
|
|
13
|
+
* is optional and you have a fallback in case it's not cached.
|
|
14
|
+
*/
|
|
15
|
+
static get: <T extends ExcalidrawElement>(element: T) => T["type"] extends keyof ElementShapes ? ElementShapes[T["type"]] | undefined : ElementShape | undefined;
|
|
16
|
+
static set: <T extends ExcalidrawElement>(element: T, shape: T["type"] extends keyof ElementShapes ? ElementShapes[T["type"]] : Drawable) => WeakMap<ExcalidrawElement, ElementShape>;
|
|
17
|
+
static delete: (element: ExcalidrawElement) => boolean;
|
|
18
|
+
static destroy: () => void;
|
|
19
|
+
/**
|
|
20
|
+
* Generates & caches shape for element if not already cached, otherwise
|
|
21
|
+
* returns cached shape.
|
|
22
|
+
*/
|
|
23
|
+
static generateElementShape: <T extends ExcalidrawLinearElement | import("./types").ExcalidrawRectangleElement | import("./types").ExcalidrawDiamondElement | import("./types").ExcalidrawEllipseElement | import("./types").ExcalidrawEmbeddableElement | import("./types").ExcalidrawIframeElement | import("./types").ExcalidrawImageElement | import("./types").ExcalidrawFrameElement | import("./types").ExcalidrawMagicFrameElement | import("./types").ExcalidrawTextElement | ExcalidrawFreeDrawElement | import("./types").ExcalidrawArrowElement>(element: T, renderConfig: {
|
|
24
|
+
isExporting: boolean;
|
|
25
|
+
canvasBackgroundColor: AppState["viewBackgroundColor"];
|
|
26
|
+
embedsValidationStatus: EmbedsValidationStatus;
|
|
27
|
+
} | null) => ((T["type"] extends keyof ElementShapes ? ElementShapes[T["type"]] | undefined : ElementShape | undefined) & ({} | null)) | (T["type"] extends keyof ElementShapes ? ElementShapes[T["type"]] : Drawable | null);
|
|
28
|
+
}
|
|
29
|
+
export declare const generateRoughOptions: (element: ExcalidrawElement, continuousPath?: boolean) => Options;
|
|
30
|
+
export declare const generateLinearCollisionShape: (element: ExcalidrawLinearElement | ExcalidrawFreeDrawElement) => {
|
|
31
|
+
op: string;
|
|
32
|
+
data: number[];
|
|
33
|
+
}[];
|
|
34
|
+
/**
|
|
35
|
+
* get the pure geometric shape of an excalidraw elementw
|
|
36
|
+
* which is then used for hit detection
|
|
37
|
+
*/
|
|
38
|
+
export declare const getElementShape: <Point extends GlobalPoint | LocalPoint>(element: ExcalidrawElement, elementsMap: ElementsMap) => GeometricShape<Point>;
|
|
39
|
+
export declare const toggleLinePolygonState: (element: ExcalidrawLineElement, nextPolygonState: boolean) => {
|
|
40
|
+
polygon: ExcalidrawLineElement["polygon"];
|
|
41
|
+
points: ExcalidrawLineElement["points"];
|
|
42
|
+
} | null;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { AppState, Offsets, Zoom } from "@excalidraw/excalidraw/types";
|
|
2
2
|
import type { ElementsMap, ExcalidrawElement } from "./types";
|
|
3
|
+
export declare const INVISIBLY_SMALL_ELEMENT_SIZE = 0.1;
|
|
3
4
|
export declare const isInvisiblySmallElement: (element: ExcalidrawElement) => boolean;
|
|
4
5
|
export declare const isElementInViewport: (element: ExcalidrawElement, width: number, height: number, viewTransformations: {
|
|
5
6
|
zoom: Zoom;
|
|
@@ -22,11 +23,10 @@ export declare const getPerfectElementSize: (elementType: AppState["activeTool"]
|
|
|
22
23
|
width: number;
|
|
23
24
|
height: number;
|
|
24
25
|
};
|
|
25
|
-
export declare const getLockedLinearCursorAlignSize: (originX: number, originY: number, x: number, y: number) => {
|
|
26
|
+
export declare const getLockedLinearCursorAlignSize: (originX: number, originY: number, x: number, y: number, customAngle?: number) => {
|
|
26
27
|
width: number;
|
|
27
28
|
height: number;
|
|
28
29
|
};
|
|
29
|
-
export declare const resizePerfectLineForNWHandler: (element: ExcalidrawElement, x: number, y: number) => void;
|
|
30
30
|
export declare const getNormalizedDimensions: (element: Pick<ExcalidrawElement, "width" | "height" | "x" | "y">) => {
|
|
31
31
|
width: ExcalidrawElement["width"];
|
|
32
32
|
height: ExcalidrawElement["height"];
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
import { Emitter } from "@excalidraw/common";
|
|
2
|
+
import type App from "@excalidraw/excalidraw/components/App";
|
|
3
|
+
import type { DTO, ValueOf } from "@excalidraw/common/utility-types";
|
|
4
|
+
import type { AppState, ObservedAppState } from "@excalidraw/excalidraw/types";
|
|
5
|
+
import { ElementsDelta, AppStateDelta } from "./delta";
|
|
6
|
+
import type { ApplyToOptions } from "./delta";
|
|
7
|
+
import type { ExcalidrawElement, OrderedExcalidrawElement, SceneElementsMap } from "./types";
|
|
8
|
+
export declare const CaptureUpdateAction: {
|
|
9
|
+
/**
|
|
10
|
+
* Immediately undoable.
|
|
11
|
+
*
|
|
12
|
+
* Use for updates which should be captured.
|
|
13
|
+
* Should be used for most of the local updates, except ephemerals such as dragging or resizing.
|
|
14
|
+
*
|
|
15
|
+
* These updates will _immediately_ make it to the local undo / redo stacks.
|
|
16
|
+
*/
|
|
17
|
+
readonly IMMEDIATELY: "IMMEDIATELY";
|
|
18
|
+
/**
|
|
19
|
+
* Never undoable.
|
|
20
|
+
*
|
|
21
|
+
* Use for updates which should never be recorded, such as remote updates
|
|
22
|
+
* or scene initialization.
|
|
23
|
+
*
|
|
24
|
+
* These updates will _never_ make it to the local undo / redo stacks.
|
|
25
|
+
*/
|
|
26
|
+
readonly NEVER: "NEVER";
|
|
27
|
+
/**
|
|
28
|
+
* Eventually undoable.
|
|
29
|
+
*
|
|
30
|
+
* Use for updates which should not be captured immediately - likely
|
|
31
|
+
* exceptions which are part of some async multi-step process. Otherwise, all
|
|
32
|
+
* such updates would end up being captured with the next
|
|
33
|
+
* `CaptureUpdateAction.IMMEDIATELY` - triggered either by the next `updateScene`
|
|
34
|
+
* or internally by the editor.
|
|
35
|
+
*
|
|
36
|
+
* These updates will _eventually_ make it to the local undo / redo stacks.
|
|
37
|
+
*/
|
|
38
|
+
readonly EVENTUALLY: "EVENTUALLY";
|
|
39
|
+
};
|
|
40
|
+
export type CaptureUpdateActionType = ValueOf<typeof CaptureUpdateAction>;
|
|
41
|
+
/**
|
|
42
|
+
* Store which captures the observed changes and emits them as `StoreIncrement` events.
|
|
43
|
+
*/
|
|
44
|
+
export declare class Store {
|
|
45
|
+
private readonly app;
|
|
46
|
+
readonly onDurableIncrementEmitter: Emitter<[DurableIncrement]>;
|
|
47
|
+
readonly onStoreIncrementEmitter: Emitter<[DurableIncrement | EphemeralIncrement]>;
|
|
48
|
+
private scheduledMacroActions;
|
|
49
|
+
private scheduledMicroActions;
|
|
50
|
+
private _snapshot;
|
|
51
|
+
get snapshot(): StoreSnapshot;
|
|
52
|
+
set snapshot(snapshot: StoreSnapshot);
|
|
53
|
+
constructor(app: App);
|
|
54
|
+
scheduleAction(action: CaptureUpdateActionType): void;
|
|
55
|
+
/**
|
|
56
|
+
* Use to schedule a delta calculation, which will consquentially be emitted as `DurableStoreIncrement` and pushed in the undo stack.
|
|
57
|
+
*/
|
|
58
|
+
scheduleCapture(): void;
|
|
59
|
+
/**
|
|
60
|
+
* Schedule special "micro" actions, to-be executed before the next commit, before it executes a scheduled "macro" action.
|
|
61
|
+
*/
|
|
62
|
+
scheduleMicroAction(params: {
|
|
63
|
+
action: CaptureUpdateActionType;
|
|
64
|
+
elements: readonly ExcalidrawElement[] | undefined;
|
|
65
|
+
appState: AppState | ObservedAppState | undefined;
|
|
66
|
+
} | {
|
|
67
|
+
action: typeof CaptureUpdateAction.IMMEDIATELY;
|
|
68
|
+
change: StoreChange;
|
|
69
|
+
delta: StoreDelta;
|
|
70
|
+
} | {
|
|
71
|
+
action: typeof CaptureUpdateAction.NEVER | typeof CaptureUpdateAction.EVENTUALLY;
|
|
72
|
+
change: StoreChange;
|
|
73
|
+
}): void;
|
|
74
|
+
/**
|
|
75
|
+
* Performs the incoming `CaptureUpdateAction` and emits the corresponding `StoreIncrement`.
|
|
76
|
+
* Emits `DurableStoreIncrement` when action is "capture", emits `EphemeralStoreIncrement` otherwise.
|
|
77
|
+
*
|
|
78
|
+
* @emits StoreIncrement
|
|
79
|
+
*/
|
|
80
|
+
commit(elements: SceneElementsMap | undefined, appState: AppState | ObservedAppState | undefined): void;
|
|
81
|
+
/**
|
|
82
|
+
* Clears the store instance.
|
|
83
|
+
*/
|
|
84
|
+
clear(): void;
|
|
85
|
+
/**
|
|
86
|
+
* Performs delta & change calculation and emits a durable increment.
|
|
87
|
+
*
|
|
88
|
+
* @emits StoreIncrement.
|
|
89
|
+
*/
|
|
90
|
+
private emitDurableIncrement;
|
|
91
|
+
/**
|
|
92
|
+
* Performs change calculation and emits an ephemeral increment.
|
|
93
|
+
*
|
|
94
|
+
* @emits EphemeralStoreIncrement
|
|
95
|
+
*/
|
|
96
|
+
private emitEphemeralIncrement;
|
|
97
|
+
private applyChangeToSnapshot;
|
|
98
|
+
/**
|
|
99
|
+
* Clones the snapshot if there are changes detected.
|
|
100
|
+
*/
|
|
101
|
+
private maybeCloneSnapshot;
|
|
102
|
+
private flushMicroActions;
|
|
103
|
+
private processAction;
|
|
104
|
+
/**
|
|
105
|
+
* Returns the scheduled macro action.
|
|
106
|
+
*/
|
|
107
|
+
private getScheduledMacroAction;
|
|
108
|
+
/**
|
|
109
|
+
* Ensures that the scheduled actions invariant is satisfied.
|
|
110
|
+
*/
|
|
111
|
+
private satisfiesScheduledActionsInvariant;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Repsents a change to the store containing changed elements and appState.
|
|
115
|
+
*/
|
|
116
|
+
export declare class StoreChange {
|
|
117
|
+
readonly elements: Record<string, OrderedExcalidrawElement>;
|
|
118
|
+
readonly appState: Partial<ObservedAppState>;
|
|
119
|
+
private constructor();
|
|
120
|
+
static create(prevSnapshot: StoreSnapshot, nextSnapshot: StoreSnapshot): StoreChange;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Encpasulates any change to the store (durable or ephemeral).
|
|
124
|
+
*/
|
|
125
|
+
export declare abstract class StoreIncrement {
|
|
126
|
+
readonly type: "durable" | "ephemeral";
|
|
127
|
+
readonly change: StoreChange;
|
|
128
|
+
protected constructor(type: "durable" | "ephemeral", change: StoreChange);
|
|
129
|
+
static isDurable(increment: StoreIncrement): increment is DurableIncrement;
|
|
130
|
+
static isEphemeral(increment: StoreIncrement): increment is EphemeralIncrement;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Represents a durable change to the store.
|
|
134
|
+
*/
|
|
135
|
+
export declare class DurableIncrement extends StoreIncrement {
|
|
136
|
+
readonly change: StoreChange;
|
|
137
|
+
readonly delta: StoreDelta;
|
|
138
|
+
constructor(change: StoreChange, delta: StoreDelta);
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Represents an ephemeral change to the store.
|
|
142
|
+
*/
|
|
143
|
+
export declare class EphemeralIncrement extends StoreIncrement {
|
|
144
|
+
readonly change: StoreChange;
|
|
145
|
+
constructor(change: StoreChange);
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Represents a captured delta by the Store.
|
|
149
|
+
*/
|
|
150
|
+
export declare class StoreDelta {
|
|
151
|
+
readonly id: string;
|
|
152
|
+
readonly elements: ElementsDelta;
|
|
153
|
+
readonly appState: AppStateDelta;
|
|
154
|
+
protected constructor(id: string, elements: ElementsDelta, appState: AppStateDelta);
|
|
155
|
+
/**
|
|
156
|
+
* Create a new instance of `StoreDelta`.
|
|
157
|
+
*/
|
|
158
|
+
static create(elements: ElementsDelta, appState: AppStateDelta, opts?: {
|
|
159
|
+
id: string;
|
|
160
|
+
}): StoreDelta;
|
|
161
|
+
/**
|
|
162
|
+
* Calculate the delta between the previous and next snapshot.
|
|
163
|
+
*/
|
|
164
|
+
static calculate(prevSnapshot: StoreSnapshot, nextSnapshot: StoreSnapshot): StoreDelta;
|
|
165
|
+
/**
|
|
166
|
+
* Restore a store delta instance from a DTO.
|
|
167
|
+
*/
|
|
168
|
+
static restore(storeDeltaDTO: DTO<StoreDelta>): StoreDelta;
|
|
169
|
+
/**
|
|
170
|
+
* Parse and load the delta from the remote payload.
|
|
171
|
+
*/
|
|
172
|
+
static load({ id, elements: { added, removed, updated }, appState: { delta: appStateDelta }, }: DTO<StoreDelta>): StoreDelta;
|
|
173
|
+
/**
|
|
174
|
+
* Squash the passed deltas into the aggregated delta instance.
|
|
175
|
+
*/
|
|
176
|
+
static squash(...deltas: StoreDelta[]): StoreDelta;
|
|
177
|
+
/**
|
|
178
|
+
* Inverse store delta, creates new instance of `StoreDelta`.
|
|
179
|
+
*/
|
|
180
|
+
static inverse(delta: StoreDelta): StoreDelta;
|
|
181
|
+
/**
|
|
182
|
+
* Apply the delta to the passed elements and appState, does not modify the snapshot.
|
|
183
|
+
*/
|
|
184
|
+
static applyTo(delta: StoreDelta, elements: SceneElementsMap, appState: AppState, options?: ApplyToOptions): [SceneElementsMap, AppState, boolean];
|
|
185
|
+
/**
|
|
186
|
+
* Apply latest (remote) changes to the delta, creates new instance of `StoreDelta`.
|
|
187
|
+
*/
|
|
188
|
+
static applyLatestChanges(delta: StoreDelta, prevElements: SceneElementsMap, nextElements: SceneElementsMap, modifierOptions?: "deleted" | "inserted"): StoreDelta;
|
|
189
|
+
static empty(): StoreDelta;
|
|
190
|
+
isEmpty(): boolean;
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Represents a snapshot of the captured or updated changes in the store,
|
|
194
|
+
* used for producing deltas and emitting `DurableStoreIncrement`s.
|
|
195
|
+
*/
|
|
196
|
+
export declare class StoreSnapshot {
|
|
197
|
+
readonly elements: SceneElementsMap;
|
|
198
|
+
readonly appState: ObservedAppState;
|
|
199
|
+
readonly metadata: {
|
|
200
|
+
didElementsChange: boolean;
|
|
201
|
+
didAppStateChange: boolean;
|
|
202
|
+
isEmpty?: boolean;
|
|
203
|
+
};
|
|
204
|
+
private _lastChangedElementsHash;
|
|
205
|
+
private _lastChangedAppStateHash;
|
|
206
|
+
private constructor();
|
|
207
|
+
static create(elements: SceneElementsMap, appState: AppState | ObservedAppState, metadata?: {
|
|
208
|
+
didElementsChange: boolean;
|
|
209
|
+
didAppStateChange: boolean;
|
|
210
|
+
}): StoreSnapshot;
|
|
211
|
+
static empty(): StoreSnapshot;
|
|
212
|
+
getChangedElements(prevSnapshot: StoreSnapshot): Record<string, OrderedExcalidrawElement>;
|
|
213
|
+
getChangedAppState(prevSnapshot: StoreSnapshot): Partial<ObservedAppState>;
|
|
214
|
+
isEmpty(): boolean | undefined;
|
|
215
|
+
/**
|
|
216
|
+
* Apply the change and return a new snapshot instance.
|
|
217
|
+
*/
|
|
218
|
+
applyChange(change: StoreChange): StoreSnapshot;
|
|
219
|
+
/**
|
|
220
|
+
* Efficiently clone the existing snapshot, only if we detected changes.
|
|
221
|
+
*
|
|
222
|
+
* @returns same instance if there are no changes detected, new instance otherwise.
|
|
223
|
+
*/
|
|
224
|
+
maybeClone(action: CaptureUpdateActionType, elements: SceneElementsMap | undefined, appState: AppState | ObservedAppState | undefined): StoreSnapshot;
|
|
225
|
+
private maybeCreateAppStateSnapshot;
|
|
226
|
+
private maybeCreateElementsSnapshot;
|
|
227
|
+
private detectChangedAppState;
|
|
228
|
+
/**
|
|
229
|
+
* Detect if there are any changed elements.
|
|
230
|
+
*/
|
|
231
|
+
private detectChangedElements;
|
|
232
|
+
/**
|
|
233
|
+
* Perform structural clone, deep cloning only elements that changed.
|
|
234
|
+
*/
|
|
235
|
+
private createElementsSnapshot;
|
|
236
|
+
}
|
|
237
|
+
export declare const getObservedAppState: (appState: AppState | ObservedAppState) => ObservedAppState;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import { type Radians } from "@excalidraw/math";
|
|
1
2
|
import type { AppState } from "@excalidraw/excalidraw/types";
|
|
2
3
|
import type { ExtractSetType } from "@excalidraw/common/utility-types";
|
|
4
|
+
import type { Scene } from "./Scene";
|
|
3
5
|
import type { MaybeTransformHandleType } from "./transformHandles";
|
|
4
6
|
import type { ElementsMap, ExcalidrawElement, ExcalidrawElementType, ExcalidrawTextContainer, ExcalidrawTextElement, ExcalidrawTextElementWithContainer, NonDeletedExcalidrawElement } from "./types";
|
|
5
|
-
export declare const redrawTextBoundingBox: (textElement: ExcalidrawTextElement, container: ExcalidrawElement | null,
|
|
6
|
-
export declare const handleBindTextResize: (container: NonDeletedExcalidrawElement,
|
|
7
|
+
export declare const redrawTextBoundingBox: (textElement: ExcalidrawTextElement, container: ExcalidrawElement | null, scene: Scene) => void;
|
|
8
|
+
export declare const handleBindTextResize: (container: NonDeletedExcalidrawElement, scene: Scene, transformHandleType: MaybeTransformHandleType, shouldMaintainAspectRatio?: boolean) => void;
|
|
7
9
|
export declare const computeBoundTextPosition: (container: ExcalidrawElement, boundTextElement: ExcalidrawTextElementWithContainer, elementsMap: ElementsMap) => {
|
|
8
10
|
x: number;
|
|
9
11
|
y: number;
|
|
@@ -19,7 +21,7 @@ export declare const getContainerCoords: (container: NonDeletedExcalidrawElement
|
|
|
19
21
|
x: number;
|
|
20
22
|
y: number;
|
|
21
23
|
};
|
|
22
|
-
export declare const getTextElementAngle: (textElement: ExcalidrawTextElement, container: ExcalidrawTextContainer | null) =>
|
|
24
|
+
export declare const getTextElementAngle: (textElement: ExcalidrawTextElement, container: ExcalidrawTextContainer | null) => 0 | Radians;
|
|
23
25
|
export declare const getBoundTextElementPosition: (container: ExcalidrawElement, boundTextElement: ExcalidrawTextElementWithContainer, elementsMap: ElementsMap) => {
|
|
24
26
|
x: number;
|
|
25
27
|
y: number;
|
|
@@ -52,4 +52,4 @@ export declare const getTransformHandles: (element: ExcalidrawElement, zoom: Zoo
|
|
|
52
52
|
se?: boolean | undefined;
|
|
53
53
|
rotation?: boolean | undefined;
|
|
54
54
|
}) => TransformHandles;
|
|
55
|
-
export declare const
|
|
55
|
+
export declare const hasBoundingBox: (elements: readonly NonDeletedExcalidrawElement[], appState: InteractiveCanvasAppState) => boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ElementOrToolType } from "@excalidraw/excalidraw/types";
|
|
2
2
|
import type { MarkNonNullable } from "@excalidraw/common/utility-types";
|
|
3
3
|
import type { Bounds } from "./bounds";
|
|
4
|
-
import type { ExcalidrawElement, ExcalidrawTextElement, ExcalidrawEmbeddableElement, ExcalidrawLinearElement, ExcalidrawBindableElement, ExcalidrawFreeDrawElement, InitializedExcalidrawImageElement, ExcalidrawImageElement, ExcalidrawTextElementWithContainer, ExcalidrawTextContainer, ExcalidrawFrameElement, RoundnessType, ExcalidrawFrameLikeElement, ExcalidrawElementType, ExcalidrawIframeElement, ExcalidrawIframeLikeElement, ExcalidrawMagicFrameElement, ExcalidrawArrowElement, ExcalidrawElbowArrowElement, PointBinding, FixedPointBinding, ExcalidrawFlowchartNodeElement } from "./types";
|
|
4
|
+
import type { ExcalidrawElement, ExcalidrawTextElement, ExcalidrawEmbeddableElement, ExcalidrawLinearElement, ExcalidrawBindableElement, ExcalidrawFreeDrawElement, InitializedExcalidrawImageElement, ExcalidrawImageElement, ExcalidrawTextElementWithContainer, ExcalidrawTextContainer, ExcalidrawFrameElement, RoundnessType, ExcalidrawFrameLikeElement, ExcalidrawElementType, ExcalidrawIframeElement, ExcalidrawIframeLikeElement, ExcalidrawMagicFrameElement, ExcalidrawArrowElement, ExcalidrawElbowArrowElement, ExcalidrawLineElement, PointBinding, FixedPointBinding, ExcalidrawFlowchartNodeElement, ExcalidrawLinearElementSubType } from "./types";
|
|
5
5
|
export declare const isInitializedImageElement: (element: ExcalidrawElement | null) => element is InitializedExcalidrawImageElement;
|
|
6
6
|
export declare const isImageElement: (element: ExcalidrawElement | null) => element is ExcalidrawImageElement;
|
|
7
7
|
export declare const isEmbeddableElement: (element: ExcalidrawElement | null | undefined) => element is ExcalidrawEmbeddableElement;
|
|
@@ -14,8 +14,15 @@ export declare const isFrameLikeElement: (element: ExcalidrawElement | null) =>
|
|
|
14
14
|
export declare const isFreeDrawElement: (element?: ExcalidrawElement | null) => element is ExcalidrawFreeDrawElement;
|
|
15
15
|
export declare const isFreeDrawElementType: (elementType: ExcalidrawElementType) => boolean;
|
|
16
16
|
export declare const isLinearElement: (element?: ExcalidrawElement | null) => element is ExcalidrawLinearElement;
|
|
17
|
+
export declare const isLineElement: (element?: ExcalidrawElement | null) => element is ExcalidrawLineElement;
|
|
17
18
|
export declare const isArrowElement: (element?: ExcalidrawElement | null) => element is ExcalidrawArrowElement;
|
|
18
19
|
export declare const isElbowArrow: (element?: ExcalidrawElement) => element is ExcalidrawElbowArrowElement;
|
|
20
|
+
/**
|
|
21
|
+
* sharp or curved arrow, but not elbow
|
|
22
|
+
*/
|
|
23
|
+
export declare const isSimpleArrow: (element?: ExcalidrawElement) => element is ExcalidrawArrowElement;
|
|
24
|
+
export declare const isSharpArrow: (element?: ExcalidrawElement) => element is ExcalidrawArrowElement;
|
|
25
|
+
export declare const isCurvedArrow: (element?: ExcalidrawElement) => element is ExcalidrawArrowElement;
|
|
19
26
|
export declare const isLinearElementType: (elementType: ElementOrToolType) => boolean;
|
|
20
27
|
export declare const isBindingElement: (element?: ExcalidrawElement | null, includeLocked?: boolean) => element is ExcalidrawLinearElement;
|
|
21
28
|
export declare const isBindingElementType: (elementType: ElementOrToolType) => boolean;
|
|
@@ -27,6 +34,7 @@ export declare const isExcalidrawElement: (element: any) => element is Excalidra
|
|
|
27
34
|
export declare const isFlowchartNodeElement: (element: ExcalidrawElement) => element is ExcalidrawFlowchartNodeElement;
|
|
28
35
|
export declare const hasBoundTextElement: (element: ExcalidrawElement | null) => element is MarkNonNullable<ExcalidrawBindableElement, "boundElements">;
|
|
29
36
|
export declare const isBoundToContainer: (element: ExcalidrawElement | null) => element is ExcalidrawTextElementWithContainer;
|
|
37
|
+
export declare const isArrowBoundToElement: (element: ExcalidrawArrowElement) => boolean;
|
|
30
38
|
export declare const isUsingAdaptiveRadius: (type: string) => boolean;
|
|
31
39
|
export declare const isUsingProportionalRadius: (type: string) => boolean;
|
|
32
40
|
export declare const canApplyRoundnessTypeToElement: (roundnessType: RoundnessType, element: ExcalidrawElement) => boolean;
|
|
@@ -37,3 +45,13 @@ export declare const getDefaultRoundnessTypeForElement: (element: ExcalidrawElem
|
|
|
37
45
|
} | null;
|
|
38
46
|
export declare const isFixedPointBinding: (binding: PointBinding | FixedPointBinding) => binding is FixedPointBinding;
|
|
39
47
|
export declare const isBounds: (box: unknown) => box is Bounds;
|
|
48
|
+
export declare const getLinearElementSubType: (element: ExcalidrawLinearElement) => ExcalidrawLinearElementSubType;
|
|
49
|
+
/**
|
|
50
|
+
* Checks if current element points meet all the conditions for polygon=true
|
|
51
|
+
* (this isn't a element type check, for that use isLineElement).
|
|
52
|
+
*
|
|
53
|
+
* If you want to check if points *can* be turned into a polygon, use
|
|
54
|
+
* canBecomePolygon(points).
|
|
55
|
+
*/
|
|
56
|
+
export declare const isValidPolygon: (points: ExcalidrawLineElement["points"]) => boolean;
|
|
57
|
+
export declare const canBecomePolygon: (points: ExcalidrawLineElement["points"]) => boolean;
|
|
@@ -151,7 +151,7 @@ export type ExcalidrawFrameLikeElement = ExcalidrawFrameElement | ExcalidrawMagi
|
|
|
151
151
|
*/
|
|
152
152
|
export type ExcalidrawGenericElement = ExcalidrawSelectionElement | ExcalidrawRectangleElement | ExcalidrawDiamondElement | ExcalidrawEllipseElement;
|
|
153
153
|
export type ExcalidrawFlowchartNodeElement = ExcalidrawRectangleElement | ExcalidrawDiamondElement | ExcalidrawEllipseElement;
|
|
154
|
-
export type ExcalidrawRectanguloidElement = ExcalidrawRectangleElement | ExcalidrawImageElement | ExcalidrawTextElement | ExcalidrawFreeDrawElement | ExcalidrawIframeLikeElement | ExcalidrawFrameLikeElement | ExcalidrawEmbeddableElement;
|
|
154
|
+
export type ExcalidrawRectanguloidElement = ExcalidrawRectangleElement | ExcalidrawImageElement | ExcalidrawTextElement | ExcalidrawFreeDrawElement | ExcalidrawIframeLikeElement | ExcalidrawFrameLikeElement | ExcalidrawEmbeddableElement | ExcalidrawSelectionElement;
|
|
155
155
|
/**
|
|
156
156
|
* ExcalidrawElement should be JSON serializable and (eventually) contain
|
|
157
157
|
* no computed data. The list of all ExcalidrawElements should be shareable
|
|
@@ -205,6 +205,11 @@ export type PointBinding = {
|
|
|
205
205
|
export type FixedPointBinding = Merge<PointBinding, {
|
|
206
206
|
fixedPoint: FixedPoint;
|
|
207
207
|
}>;
|
|
208
|
+
type Index = number;
|
|
209
|
+
export type PointsPositionUpdates = Map<Index, {
|
|
210
|
+
point: LocalPoint;
|
|
211
|
+
isDragging?: boolean;
|
|
212
|
+
}>;
|
|
208
213
|
export type Arrowhead = "arrow" | "bar" | "dot" | "circle" | "circle_outline" | "triangle" | "triangle_outline" | "diamond" | "diamond_outline" | "crowfoot_one" | "crowfoot_many" | "crowfoot_one_or_many";
|
|
209
214
|
export type ExcalidrawLinearElement = _ExcalidrawElementBase & Readonly<{
|
|
210
215
|
type: "line" | "arrow";
|
|
@@ -215,10 +220,14 @@ export type ExcalidrawLinearElement = _ExcalidrawElementBase & Readonly<{
|
|
|
215
220
|
startArrowhead: Arrowhead | null;
|
|
216
221
|
endArrowhead: Arrowhead | null;
|
|
217
222
|
}>;
|
|
223
|
+
export type ExcalidrawLineElement = ExcalidrawLinearElement & Readonly<{
|
|
224
|
+
type: "line";
|
|
225
|
+
polygon: boolean;
|
|
226
|
+
}>;
|
|
218
227
|
export type FixedSegment = {
|
|
219
228
|
start: LocalPoint;
|
|
220
229
|
end: LocalPoint;
|
|
221
|
-
index:
|
|
230
|
+
index: Index;
|
|
222
231
|
};
|
|
223
232
|
export type ExcalidrawArrowElement = ExcalidrawLinearElement & Readonly<{
|
|
224
233
|
type: "arrow";
|
|
@@ -279,4 +288,8 @@ export type SceneElementsMap = Map<ExcalidrawElement["id"], Ordered<ExcalidrawEl
|
|
|
279
288
|
*/
|
|
280
289
|
export type NonDeletedSceneElementsMap = Map<ExcalidrawElement["id"], Ordered<NonDeletedExcalidrawElement>> & MakeBrand<"NonDeletedSceneElementsMap">;
|
|
281
290
|
export type ElementsMapOrArray = readonly ExcalidrawElement[] | Readonly<ElementsMap>;
|
|
291
|
+
export type ExcalidrawLinearElementSubType = "line" | "sharpArrow" | "curvedArrow" | "elbowArrow";
|
|
292
|
+
export type ConvertibleGenericTypes = "rectangle" | "diamond" | "ellipse";
|
|
293
|
+
export type ConvertibleLinearTypes = ExcalidrawLinearElementSubType;
|
|
294
|
+
export type ConvertibleTypes = ConvertibleGenericTypes | ConvertibleLinearTypes;
|
|
282
295
|
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type GlobalPoint } from "@excalidraw/math";
|
|
2
|
+
import type { Curve, LineSegment } from "@excalidraw/math";
|
|
3
|
+
import type { Zoom } from "@excalidraw/excalidraw/types";
|
|
4
|
+
import type { ExcalidrawDiamondElement, ExcalidrawElement, ExcalidrawFreeDrawElement, ExcalidrawLinearElement, ExcalidrawRectanguloidElement } from "./types";
|
|
5
|
+
/**
|
|
6
|
+
* Returns the **rotated** components of freedraw, line or arrow elements.
|
|
7
|
+
*
|
|
8
|
+
* @param element The linear element to deconstruct
|
|
9
|
+
* @returns The rotated in components.
|
|
10
|
+
*/
|
|
11
|
+
export declare function deconstructLinearOrFreeDrawElement(element: ExcalidrawLinearElement | ExcalidrawFreeDrawElement): [LineSegment<GlobalPoint>[], Curve<GlobalPoint>[]];
|
|
12
|
+
/**
|
|
13
|
+
* Get the building components of a rectanguloid element in the form of
|
|
14
|
+
* line segments and curves **unrotated**.
|
|
15
|
+
*
|
|
16
|
+
* @param element Target rectanguloid element
|
|
17
|
+
* @param offset Optional offset to expand the rectanguloid shape
|
|
18
|
+
* @returns Tuple of **unrotated** line segments (0) and curves (1)
|
|
19
|
+
*/
|
|
20
|
+
export declare function deconstructRectanguloidElement(element: ExcalidrawRectanguloidElement, offset?: number): [LineSegment<GlobalPoint>[], Curve<GlobalPoint>[]];
|
|
21
|
+
/**
|
|
22
|
+
* Get the **unrotated** building components of a diamond element
|
|
23
|
+
* in the form of line segments and curves as a tuple, in this order.
|
|
24
|
+
*
|
|
25
|
+
* @param element The element to deconstruct
|
|
26
|
+
* @param offset An optional offset
|
|
27
|
+
* @returns Tuple of line **unrotated** segments (0) and curves (1)
|
|
28
|
+
*/
|
|
29
|
+
export declare function deconstructDiamondElement(element: ExcalidrawDiamondElement, offset?: number): [LineSegment<GlobalPoint>[], Curve<GlobalPoint>[]];
|
|
30
|
+
export declare const isPathALoop: (points: ExcalidrawLinearElement["points"], zoomValue?: Zoom["value"]) => boolean;
|
|
31
|
+
export declare const getCornerRadius: (x: number, element: ExcalidrawElement) => number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AppState } from "@excalidraw/excalidraw/types";
|
|
2
|
-
import type Scene from "
|
|
2
|
+
import type { Scene } from "./Scene";
|
|
3
3
|
import type { ExcalidrawElement } from "./types";
|
|
4
4
|
export declare const moveOneLeft: (allElements: readonly ExcalidrawElement[], appState: AppState, scene: Scene) => readonly ExcalidrawElement[];
|
|
5
5
|
export declare const moveOneRight: (allElements: readonly ExcalidrawElement[], appState: AppState, scene: Scene) => readonly ExcalidrawElement[];
|