@excalidraw/excalidraw 0.18.0-432a46e → 0.18.0-6fc8502
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-ZG3EI5XS.js → chunk-H7XJ5UVD.js} +2 -2
- package/dist/dev/{chunk-ZG3EI5XS.js.map → chunk-H7XJ5UVD.js.map} +1 -1
- package/dist/dev/{chunk-S7W4OWSF.js → chunk-KYBDXI6F.js} +417 -120
- package/dist/dev/chunk-KYBDXI6F.js.map +7 -0
- package/dist/dev/{chunk-LMHBUWQS.js → chunk-X3RYHLJU.js} +2 -1
- package/dist/dev/chunk-X3RYHLJU.js.map +7 -0
- package/dist/dev/data/{image-5HAY2PCR.js → image-NKFINVKH.js} +3 -3
- package/dist/dev/index.css +43 -46
- package/dist/dev/index.css.map +2 -2
- package/dist/dev/index.js +508 -99
- package/dist/dev/index.js.map +4 -4
- package/dist/dev/locales/{en-OZCJJ2HN.js → en-CKWC2GMK.js} +2 -2
- package/dist/dev/subset-shared.chunk.js +1 -1
- package/dist/dev/subset-worker.chunk.js +1 -1
- package/dist/prod/chunk-CAN5RS4P.js +31 -0
- package/dist/prod/{chunk-6U3AYISY.js → chunk-IUH5AXLB.js} +1 -1
- package/dist/prod/{chunk-U24AOZ3B.js → chunk-KJYFYP64.js} +1 -1
- package/dist/prod/data/image-5XD47O4X.js +1 -0
- package/dist/prod/index.css +1 -1
- package/dist/prod/index.js +14 -14
- package/dist/prod/locales/{en-B4ZKOASM.js → en-SBO6ZHT2.js} +1 -1
- 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 +1 -0
- package/dist/types/{packages/common → common}/src/utils.d.ts +1 -0
- package/dist/types/{packages/element → element}/src/binding.d.ts +2 -1
- package/dist/types/{packages/element → element}/src/bounds.d.ts +5 -0
- package/dist/types/{packages/element → element}/src/heading.d.ts +0 -1
- package/dist/types/{packages/excalidraw → excalidraw}/actions/actionAddToLibrary.d.ts +3 -0
- package/dist/types/{packages/excalidraw → excalidraw}/actions/actionBoundText.d.ts +2 -0
- package/dist/types/{packages/excalidraw → excalidraw}/actions/actionCanvas.d.ts +192 -3
- package/dist/types/{packages/excalidraw → excalidraw}/actions/actionClipboard.d.ts +6 -0
- package/dist/types/{packages/excalidraw → excalidraw}/actions/actionCropEditor.d.ts +1 -0
- package/dist/types/{packages/excalidraw → excalidraw}/actions/actionDeleteSelected.d.ts +3 -0
- package/dist/types/{packages/excalidraw → excalidraw}/actions/actionElementLink.d.ts +1 -0
- package/dist/types/{packages/excalidraw → excalidraw}/actions/actionElementLock.d.ts +2 -1
- package/dist/types/{packages/excalidraw → excalidraw}/actions/actionEmbeddable.d.ts +1 -0
- package/dist/types/{packages/excalidraw → excalidraw}/actions/actionExport.d.ts +9 -0
- package/dist/types/{packages/excalidraw → excalidraw}/actions/actionFinalize.d.ts +2 -0
- package/dist/types/{packages/excalidraw → excalidraw}/actions/actionFrame.d.ts +4 -0
- package/dist/types/{packages/excalidraw → excalidraw}/actions/actionGroup.d.ts +2 -0
- package/dist/types/{packages/excalidraw → excalidraw}/actions/actionLinearEditor.d.ts +1 -0
- package/dist/types/{packages/excalidraw → excalidraw}/actions/actionLink.d.ts +1 -0
- package/dist/types/{packages/excalidraw → excalidraw}/actions/actionMenu.d.ts +3 -0
- package/dist/types/{packages/excalidraw → excalidraw}/actions/actionNavigate.d.ts +2 -0
- package/dist/types/{packages/excalidraw → excalidraw}/actions/actionProperties.d.ts +15 -0
- package/dist/types/{packages/excalidraw → excalidraw}/actions/actionSelectAll.d.ts +1 -0
- package/dist/types/{packages/excalidraw → excalidraw}/actions/actionStyles.d.ts +1 -0
- package/dist/types/{packages/excalidraw → excalidraw}/actions/actionToggleGridMode.d.ts +1 -0
- package/dist/types/{packages/excalidraw → excalidraw}/actions/actionToggleObjectsSnapMode.d.ts +1 -0
- package/dist/types/{packages/excalidraw → excalidraw}/actions/actionToggleSearchMenu.d.ts +2 -0
- package/dist/types/{packages/excalidraw → excalidraw}/actions/actionToggleStats.d.ts +1 -1
- package/dist/types/{packages/excalidraw → excalidraw}/actions/actionToggleViewMode.d.ts +1 -1
- package/dist/types/{packages/excalidraw → excalidraw}/actions/actionToggleZenMode.d.ts +1 -1
- package/dist/types/{packages/excalidraw → excalidraw}/actions/types.d.ts +1 -1
- package/dist/types/{packages/excalidraw → excalidraw}/animated-trail.d.ts +7 -1
- package/dist/types/{packages/excalidraw → excalidraw}/appState.d.ts +1 -0
- package/dist/types/{packages/excalidraw → excalidraw}/components/App.d.ts +6 -1
- package/dist/types/excalidraw/components/ColorPicker/HotkeyLabel.d.ts +7 -0
- package/dist/types/{packages/excalidraw → excalidraw}/components/ColorPicker/colorPickerUtils.d.ts +1 -1
- package/dist/types/{packages/excalidraw → excalidraw}/components/icons.d.ts +1 -0
- package/dist/types/excalidraw/lasso/index.d.ts +15 -0
- package/dist/types/excalidraw/lasso/utils.d.ts +13 -0
- package/dist/types/{packages/excalidraw → excalidraw}/types.d.ts +2 -1
- package/dist/types/{packages/math → math}/src/polygon.d.ts +1 -0
- package/dist/types/{packages/math → math}/src/segment.d.ts +1 -1
- package/package.json +19 -2
- package/dist/dev/chunk-LMHBUWQS.js.map +0 -7
- package/dist/dev/chunk-S7W4OWSF.js.map +0 -7
- package/dist/prod/chunk-LRITYP5X.js +0 -31
- package/dist/prod/data/image-W3GRS73V.js +0 -1
- package/dist/types/excalidraw-app/app_constants.d.ts +0 -44
- package/dist/types/packages/excalidraw/components/ColorPicker/HotkeyLabel.d.ts +0 -8
- 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/dev/data/{image-5HAY2PCR.js.map → image-NKFINVKH.js.map} +0 -0
- /package/dist/dev/locales/{en-OZCJJ2HN.js.map → en-CKWC2GMK.js.map} +0 -0
- /package/dist/types/{packages/common → common}/src/binary-heap.d.ts +0 -0
- /package/dist/types/{packages/common → common}/src/font-metadata.d.ts +0 -0
- /package/dist/types/{packages/common → common}/src/index.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/common → common}/src/utility-types.d.ts +0 -0
- /package/dist/types/{packages/element → element}/src/Shape.d.ts +0 -0
- /package/dist/types/{packages/element → element}/src/ShapeCache.d.ts +0 -0
- /package/dist/types/{packages/element → element}/src/align.d.ts +0 -0
- /package/dist/types/{packages/element → element}/src/collision.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/cropElement.d.ts +0 -0
- /package/dist/types/{packages/element → element}/src/distance.d.ts +0 -0
- /package/dist/types/{packages/element → element}/src/distribute.d.ts +0 -0
- /package/dist/types/{packages/element → element}/src/dragElements.d.ts +0 -0
- /package/dist/types/{packages/element → element}/src/duplicate.d.ts +0 -0
- /package/dist/types/{packages/element → element}/src/elbowArrow.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/flowchart.d.ts +0 -0
- /package/dist/types/{packages/element → element}/src/fractionalIndex.d.ts +0 -0
- /package/dist/types/{packages/element → element}/src/frame.d.ts +0 -0
- /package/dist/types/{packages/element → element}/src/groups.d.ts +0 -0
- /package/dist/types/{packages/element → element}/src/image.d.ts +0 -0
- /package/dist/types/{packages/element → element}/src/index.d.ts +0 -0
- /package/dist/types/{packages/element → element}/src/linearElementEditor.d.ts +0 -0
- /package/dist/types/{packages/element → element}/src/mutateElement.d.ts +0 -0
- /package/dist/types/{packages/element → element}/src/newElement.d.ts +0 -0
- /package/dist/types/{packages/element → element}/src/renderElement.d.ts +0 -0
- /package/dist/types/{packages/element → element}/src/resizeElements.d.ts +0 -0
- /package/dist/types/{packages/element → element}/src/resizeTest.d.ts +0 -0
- /package/dist/types/{packages/element → element}/src/selection.d.ts +0 -0
- /package/dist/types/{packages/element → element}/src/shapes.d.ts +0 -0
- /package/dist/types/{packages/element → element}/src/showSelectedShapeActions.d.ts +0 -0
- /package/dist/types/{packages/element → element}/src/sizeHelpers.d.ts +0 -0
- /package/dist/types/{packages/element → element}/src/sortElements.d.ts +0 -0
- /package/dist/types/{packages/element → element}/src/textElement.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/element → element}/src/transformHandles.d.ts +0 -0
- /package/dist/types/{packages/element → element}/src/typeChecks.d.ts +0 -0
- /package/dist/types/{packages/element → element}/src/types.d.ts +0 -0
- /package/dist/types/{packages/element → element}/src/utils.d.ts +0 -0
- /package/dist/types/{packages/element → element}/src/zindex.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/actionHistory.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/index.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}/change.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}/clipboard.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/Actions.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/ButtonIcon.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/ButtonIconCycle.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/ButtonIconSelect.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/ButtonSelect.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/ColorInput.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/ColorPicker/ColorPicker.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/ColorPicker/CustomColorList.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/ColorPicker/Picker.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/ColorPicker/PickerColorList.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/ColorPicker/PickerHeading.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/ColorPicker/ShadeList.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/ColorPicker/TopPicks.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/ColorPicker/keyboardNavHandlers.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/CommandPalette/CommandPalette.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/ElementLinkDialog.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/ErrorDialog.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/ExcalidrawLogo.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/FontPicker.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/FontPickerTrigger.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/InlineIcon.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/LayerUI.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/LibraryMenuSection.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/MobileMenu.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/Popover.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/ProjectName.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/PropertiesPopover.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/Range.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/Angle.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/Stats/CanvasGrid.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/Stats/Collapsible.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/Stats/Dimension.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/Stats/DragInput.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/Stats/FontSize.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/Stats/MultiAngle.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/Stats/MultiDimension.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/Stats/MultiFontSize.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/Stats/MultiPosition.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/Stats/Position.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/Stats/index.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/Stats/utils.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/TTDDialogTrigger.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/TTDDialog/common.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/TextField.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/InteractiveCanvas.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/DropdownMenu.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/dropdownMenu/DropdownMenuContent.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/hyperlink/Hyperlink.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/hyperlink/helpers.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/shapes.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/blob.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/reconcile.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/data/resave.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/data/restore.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/data/transform.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/data/types.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/deburr.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/editor-jotai.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/emitter.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/Fonts.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}/history.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/useEmitter.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/hooks/useLibraryItemSvg.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}/index.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/helpers.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/staticScene.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/renderer/staticSvgScene.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/scene/Renderer.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/scene/Scene.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/scene/export.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/scene/index.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/scrollbars.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/scene/types.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/scene/zoom.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/snapping.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/store.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}/visualdebug.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/workers.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/wysiwyg/textWysiwyg.d.ts +0 -0
- /package/dist/types/{packages/math → math}/src/angle.d.ts +0 -0
- /package/dist/types/{packages/math → math}/src/curve.d.ts +0 -0
- /package/dist/types/{packages/math → math}/src/ellipse.d.ts +0 -0
- /package/dist/types/{packages/math → math}/src/index.d.ts +0 -0
- /package/dist/types/{packages/math → math}/src/line.d.ts +0 -0
- /package/dist/types/{packages/math → math}/src/point.d.ts +0 -0
- /package/dist/types/{packages/math → math}/src/range.d.ts +0 -0
- /package/dist/types/{packages/math → math}/src/rectangle.d.ts +0 -0
- /package/dist/types/{packages/math → math}/src/triangle.d.ts +0 -0
- /package/dist/types/{packages/math → math}/src/types.d.ts +0 -0
- /package/dist/types/{packages/math → math}/src/utils.d.ts +0 -0
- /package/dist/types/{packages/math → math}/src/vector.d.ts +0 -0
- /package/dist/types/{packages/utils → utils}/src/bbox.d.ts +0 -0
- /package/dist/types/{packages/utils → utils}/src/collision.d.ts +0 -0
- /package/dist/types/{packages/utils → utils}/src/export.d.ts +0 -0
- /package/dist/types/{packages/utils → utils}/src/index.d.ts +0 -0
- /package/dist/types/{packages/utils → utils}/src/shape.d.ts +0 -0
- /package/dist/types/{packages/utils → utils}/src/withinBounds.d.ts +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
define_import_meta_env_default
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-H7XJ5UVD.js";
|
|
4
4
|
import {
|
|
5
5
|
__publicField
|
|
6
6
|
} from "./chunk-XDFCUUT6.js";
|
|
@@ -103,6 +103,7 @@ var BinaryHeap = class {
|
|
|
103
103
|
|
|
104
104
|
// ../common/src/colors.ts
|
|
105
105
|
import oc from "open-color";
|
|
106
|
+
var COLOR_OUTLINE_CONTRAST_THRESHOLD = 240;
|
|
106
107
|
var pick = (source, keys) => {
|
|
107
108
|
return keys.reduce((acc, key) => {
|
|
108
109
|
if (key in source) {
|
|
@@ -479,6 +480,7 @@ var LIBRARY_DISABLED_TYPES = /* @__PURE__ */ new Set([
|
|
|
479
480
|
]);
|
|
480
481
|
var TOOL_TYPE = {
|
|
481
482
|
selection: "selection",
|
|
483
|
+
lasso: "lasso",
|
|
482
484
|
rectangle: "rectangle",
|
|
483
485
|
diamond: "diamond",
|
|
484
486
|
ellipse: "ellipse",
|
|
@@ -935,9 +937,9 @@ var distanceToLineSegment = (point, line2) => {
|
|
|
935
937
|
const dy = y - yy;
|
|
936
938
|
return Math.sqrt(dx * dx + dy * dy);
|
|
937
939
|
};
|
|
938
|
-
function lineSegmentIntersectionPoints(l, s) {
|
|
940
|
+
function lineSegmentIntersectionPoints(l, s, threshold) {
|
|
939
941
|
const candidate = linesIntersectAt(line(l[0], l[1]), line(s[0], s[1]));
|
|
940
|
-
if (!candidate || !pointOnLineSegment(candidate, s) || !pointOnLineSegment(candidate, l)) {
|
|
942
|
+
if (!candidate || !pointOnLineSegment(candidate, s, threshold) || !pointOnLineSegment(candidate, l, threshold)) {
|
|
941
943
|
return null;
|
|
942
944
|
}
|
|
943
945
|
return candidate;
|
|
@@ -1131,6 +1133,27 @@ var polygonIncludesPoint = (point, polygon2) => {
|
|
|
1131
1133
|
}
|
|
1132
1134
|
return inside;
|
|
1133
1135
|
};
|
|
1136
|
+
var polygonIncludesPointNonZero = (point, polygon2) => {
|
|
1137
|
+
const [x, y] = point;
|
|
1138
|
+
let windingNumber = 0;
|
|
1139
|
+
for (let i = 0; i < polygon2.length; i++) {
|
|
1140
|
+
const j = (i + 1) % polygon2.length;
|
|
1141
|
+
const [xi, yi] = polygon2[i];
|
|
1142
|
+
const [xj, yj] = polygon2[j];
|
|
1143
|
+
if (yi <= y) {
|
|
1144
|
+
if (yj > y) {
|
|
1145
|
+
if ((xj - xi) * (y - yi) - (x - xi) * (yj - yi) > 0) {
|
|
1146
|
+
windingNumber++;
|
|
1147
|
+
}
|
|
1148
|
+
}
|
|
1149
|
+
} else if (yj <= y) {
|
|
1150
|
+
if ((xj - xi) * (y - yi) - (x - xi) * (yj - yi) < 0) {
|
|
1151
|
+
windingNumber--;
|
|
1152
|
+
}
|
|
1153
|
+
}
|
|
1154
|
+
}
|
|
1155
|
+
return windingNumber !== 0;
|
|
1156
|
+
};
|
|
1134
1157
|
var pointOnPolygon = (p, poly, threshold = PRECISION) => {
|
|
1135
1158
|
let on = false;
|
|
1136
1159
|
for (let i = 0, l = poly.length - 1; i < l; i++) {
|
|
@@ -1469,7 +1492,8 @@ var updateActiveTool = (appState, data) => {
|
|
|
1469
1492
|
lastActiveTool: data.lastActiveToolBeforeEraser === void 0 ? appState.activeTool.lastActiveTool : data.lastActiveToolBeforeEraser,
|
|
1470
1493
|
type: data.type,
|
|
1471
1494
|
customType: null,
|
|
1472
|
-
locked: data.locked ?? appState.activeTool.locked
|
|
1495
|
+
locked: data.locked ?? appState.activeTool.locked,
|
|
1496
|
+
fromSelection: data.fromSelection ?? false
|
|
1473
1497
|
};
|
|
1474
1498
|
};
|
|
1475
1499
|
var getShortcutKey = (shortcut) => {
|
|
@@ -2107,6 +2131,9 @@ var pointInEllipse = (p, ellipse2) => {
|
|
|
2107
2131
|
return rotatedPointX / halfWidth * (rotatedPointX / halfWidth) + rotatedPointY / halfHeight * (rotatedPointY / halfHeight) <= 1;
|
|
2108
2132
|
};
|
|
2109
2133
|
|
|
2134
|
+
// ../element/src/bounds.ts
|
|
2135
|
+
import { pointsOnBezierCurves as pointsOnBezierCurves2 } from "points-on-curve";
|
|
2136
|
+
|
|
2110
2137
|
// ../element/src/ShapeCache.ts
|
|
2111
2138
|
import { RoughGenerator } from "roughjs/bin/generator";
|
|
2112
2139
|
|
|
@@ -2903,19 +2930,6 @@ var HEADING_RIGHT = [1, 0];
|
|
|
2903
2930
|
var HEADING_DOWN = [0, 1];
|
|
2904
2931
|
var HEADING_LEFT = [-1, 0];
|
|
2905
2932
|
var HEADING_UP = [0, -1];
|
|
2906
|
-
var headingForDiamond = (a, b) => {
|
|
2907
|
-
const angle = radiansToDegrees(
|
|
2908
|
-
normalizeRadians(Math.atan2(b[1] - a[1], b[0] - a[0]))
|
|
2909
|
-
);
|
|
2910
|
-
if (angle >= 315 || angle < 45) {
|
|
2911
|
-
return HEADING_UP;
|
|
2912
|
-
} else if (angle >= 45 && angle < 135) {
|
|
2913
|
-
return HEADING_RIGHT;
|
|
2914
|
-
} else if (angle >= 135 && angle < 225) {
|
|
2915
|
-
return HEADING_DOWN;
|
|
2916
|
-
}
|
|
2917
|
-
return HEADING_LEFT;
|
|
2918
|
-
};
|
|
2919
2933
|
var vectorToHeading = (vec) => {
|
|
2920
2934
|
const [x, y] = vec;
|
|
2921
2935
|
const absX = Math.abs(x);
|
|
@@ -2933,69 +2947,135 @@ var headingForPoint = (p, o) => vectorToHeading(vectorFromPoint(p, o));
|
|
|
2933
2947
|
var headingForPointIsHorizontal = (p, o) => headingIsHorizontal(headingForPoint(p, o));
|
|
2934
2948
|
var compareHeading = (a, b) => a[0] === b[0] && a[1] === b[1];
|
|
2935
2949
|
var headingIsHorizontal = (a) => compareHeading(a, HEADING_RIGHT) || compareHeading(a, HEADING_LEFT);
|
|
2936
|
-
var
|
|
2937
|
-
const SEARCH_CONE_MULTIPLIER = 2;
|
|
2950
|
+
var headingForPointFromDiamondElement = (element, aabb, point) => {
|
|
2938
2951
|
const midPoint = getCenterForBounds(aabb);
|
|
2939
|
-
if (
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
return HEADING_UP;
|
|
2944
|
-
} else if (p[0] > element.x + element.width) {
|
|
2945
|
-
return HEADING_RIGHT;
|
|
2946
|
-
} else if (p[1] > element.y + element.height) {
|
|
2947
|
-
return HEADING_DOWN;
|
|
2948
|
-
}
|
|
2949
|
-
const top = pointRotateRads(
|
|
2950
|
-
pointScaleFromOrigin(
|
|
2951
|
-
pointFrom(element.x + element.width / 2, element.y),
|
|
2952
|
-
midPoint,
|
|
2953
|
-
SEARCH_CONE_MULTIPLIER
|
|
2954
|
-
),
|
|
2955
|
-
midPoint,
|
|
2956
|
-
element.angle
|
|
2952
|
+
if (isDevEnv() || isTestEnv()) {
|
|
2953
|
+
invariant(
|
|
2954
|
+
element.width > 0 && element.height > 0,
|
|
2955
|
+
"Diamond element has no width or height"
|
|
2957
2956
|
);
|
|
2958
|
-
|
|
2959
|
-
|
|
2960
|
-
|
|
2961
|
-
midPoint,
|
|
2962
|
-
SEARCH_CONE_MULTIPLIER
|
|
2963
|
-
),
|
|
2964
|
-
midPoint,
|
|
2965
|
-
element.angle
|
|
2957
|
+
invariant(
|
|
2958
|
+
!pointsEqual(midPoint, point),
|
|
2959
|
+
"The point is too close to the element mid point to determine heading"
|
|
2966
2960
|
);
|
|
2967
|
-
|
|
2968
|
-
|
|
2969
|
-
|
|
2970
|
-
|
|
2971
|
-
|
|
2961
|
+
}
|
|
2962
|
+
const SHRINK = 0.95;
|
|
2963
|
+
const top = pointFromVector(
|
|
2964
|
+
vectorScale(
|
|
2965
|
+
vectorFromPoint(
|
|
2966
|
+
pointRotateRads(
|
|
2967
|
+
pointFrom(element.x + element.width / 2, element.y),
|
|
2968
|
+
midPoint,
|
|
2969
|
+
element.angle
|
|
2970
|
+
),
|
|
2971
|
+
midPoint
|
|
2972
2972
|
),
|
|
2973
|
-
|
|
2974
|
-
|
|
2975
|
-
|
|
2976
|
-
|
|
2977
|
-
|
|
2978
|
-
|
|
2979
|
-
|
|
2980
|
-
|
|
2973
|
+
SHRINK
|
|
2974
|
+
),
|
|
2975
|
+
midPoint
|
|
2976
|
+
);
|
|
2977
|
+
const right = pointFromVector(
|
|
2978
|
+
vectorScale(
|
|
2979
|
+
vectorFromPoint(
|
|
2980
|
+
pointRotateRads(
|
|
2981
|
+
pointFrom(
|
|
2982
|
+
element.x + element.width,
|
|
2983
|
+
element.y + element.height / 2
|
|
2984
|
+
),
|
|
2985
|
+
midPoint,
|
|
2986
|
+
element.angle
|
|
2987
|
+
),
|
|
2988
|
+
midPoint
|
|
2981
2989
|
),
|
|
2982
|
-
|
|
2983
|
-
|
|
2984
|
-
|
|
2985
|
-
|
|
2986
|
-
|
|
2987
|
-
|
|
2988
|
-
|
|
2989
|
-
|
|
2990
|
-
|
|
2991
|
-
|
|
2992
|
-
|
|
2993
|
-
|
|
2994
|
-
|
|
2995
|
-
|
|
2996
|
-
|
|
2997
|
-
|
|
2998
|
-
|
|
2990
|
+
SHRINK
|
|
2991
|
+
),
|
|
2992
|
+
midPoint
|
|
2993
|
+
);
|
|
2994
|
+
const bottom = pointFromVector(
|
|
2995
|
+
vectorScale(
|
|
2996
|
+
vectorFromPoint(
|
|
2997
|
+
pointRotateRads(
|
|
2998
|
+
pointFrom(
|
|
2999
|
+
element.x + element.width / 2,
|
|
3000
|
+
element.y + element.height
|
|
3001
|
+
),
|
|
3002
|
+
midPoint,
|
|
3003
|
+
element.angle
|
|
3004
|
+
),
|
|
3005
|
+
midPoint
|
|
3006
|
+
),
|
|
3007
|
+
SHRINK
|
|
3008
|
+
),
|
|
3009
|
+
midPoint
|
|
3010
|
+
);
|
|
3011
|
+
const left = pointFromVector(
|
|
3012
|
+
vectorScale(
|
|
3013
|
+
vectorFromPoint(
|
|
3014
|
+
pointRotateRads(
|
|
3015
|
+
pointFrom(element.x, element.y + element.height / 2),
|
|
3016
|
+
midPoint,
|
|
3017
|
+
element.angle
|
|
3018
|
+
),
|
|
3019
|
+
midPoint
|
|
3020
|
+
),
|
|
3021
|
+
SHRINK
|
|
3022
|
+
),
|
|
3023
|
+
midPoint
|
|
3024
|
+
);
|
|
3025
|
+
if (vectorCross(vectorFromPoint(point, top), vectorFromPoint(top, right)) <= 0 && vectorCross(vectorFromPoint(point, top), vectorFromPoint(top, left)) > 0) {
|
|
3026
|
+
return headingForPoint(top, midPoint);
|
|
3027
|
+
} else if (vectorCross(
|
|
3028
|
+
vectorFromPoint(point, right),
|
|
3029
|
+
vectorFromPoint(right, bottom)
|
|
3030
|
+
) <= 0 && vectorCross(vectorFromPoint(point, right), vectorFromPoint(right, top)) > 0) {
|
|
3031
|
+
return headingForPoint(right, midPoint);
|
|
3032
|
+
} else if (vectorCross(
|
|
3033
|
+
vectorFromPoint(point, bottom),
|
|
3034
|
+
vectorFromPoint(bottom, left)
|
|
3035
|
+
) <= 0 && vectorCross(
|
|
3036
|
+
vectorFromPoint(point, bottom),
|
|
3037
|
+
vectorFromPoint(bottom, right)
|
|
3038
|
+
) > 0) {
|
|
3039
|
+
return headingForPoint(bottom, midPoint);
|
|
3040
|
+
} else if (vectorCross(vectorFromPoint(point, left), vectorFromPoint(left, top)) <= 0 && vectorCross(vectorFromPoint(point, left), vectorFromPoint(left, bottom)) > 0) {
|
|
3041
|
+
return headingForPoint(left, midPoint);
|
|
3042
|
+
}
|
|
3043
|
+
if (vectorCross(
|
|
3044
|
+
vectorFromPoint(point, midPoint),
|
|
3045
|
+
vectorFromPoint(top, midPoint)
|
|
3046
|
+
) <= 0 && vectorCross(
|
|
3047
|
+
vectorFromPoint(point, midPoint),
|
|
3048
|
+
vectorFromPoint(right, midPoint)
|
|
3049
|
+
) > 0) {
|
|
3050
|
+
const p2 = element.width > element.height ? top : right;
|
|
3051
|
+
return headingForPoint(p2, midPoint);
|
|
3052
|
+
} else if (vectorCross(
|
|
3053
|
+
vectorFromPoint(point, midPoint),
|
|
3054
|
+
vectorFromPoint(right, midPoint)
|
|
3055
|
+
) <= 0 && vectorCross(
|
|
3056
|
+
vectorFromPoint(point, midPoint),
|
|
3057
|
+
vectorFromPoint(bottom, midPoint)
|
|
3058
|
+
) > 0) {
|
|
3059
|
+
const p2 = element.width > element.height ? bottom : right;
|
|
3060
|
+
return headingForPoint(p2, midPoint);
|
|
3061
|
+
} else if (vectorCross(
|
|
3062
|
+
vectorFromPoint(point, midPoint),
|
|
3063
|
+
vectorFromPoint(bottom, midPoint)
|
|
3064
|
+
) <= 0 && vectorCross(
|
|
3065
|
+
vectorFromPoint(point, midPoint),
|
|
3066
|
+
vectorFromPoint(left, midPoint)
|
|
3067
|
+
) > 0) {
|
|
3068
|
+
const p2 = element.width > element.height ? bottom : left;
|
|
3069
|
+
return headingForPoint(p2, midPoint);
|
|
3070
|
+
}
|
|
3071
|
+
const p = element.width > element.height ? top : left;
|
|
3072
|
+
return headingForPoint(p, midPoint);
|
|
3073
|
+
};
|
|
3074
|
+
var headingForPointFromElement = (element, aabb, p) => {
|
|
3075
|
+
const SEARCH_CONE_MULTIPLIER = 2;
|
|
3076
|
+
const midPoint = getCenterForBounds(aabb);
|
|
3077
|
+
if (element.type === "diamond") {
|
|
3078
|
+
return headingForPointFromDiamondElement(element, aabb, p);
|
|
2999
3079
|
}
|
|
3000
3080
|
const topLeft = pointScaleFromOrigin(
|
|
3001
3081
|
pointFrom(aabb[0], aabb[1]),
|
|
@@ -3910,7 +3990,7 @@ var getLinearElementEdgeCoors = (linearElement, startOrEnd, elementsMap) => {
|
|
|
3910
3990
|
)
|
|
3911
3991
|
);
|
|
3912
3992
|
};
|
|
3913
|
-
var
|
|
3993
|
+
var fixDuplicatedBindingsAfterDuplication = (newElements, oldIdToDuplicatedId, duplicatedElementsMap) => {
|
|
3914
3994
|
for (const element of newElements) {
|
|
3915
3995
|
if ("boundElements" in element && element.boundElements) {
|
|
3916
3996
|
Object.assign(element, {
|
|
@@ -3966,6 +4046,151 @@ var fixBindingsAfterDuplication = (newElements, oldIdToDuplicatedId, duplicatedE
|
|
|
3966
4046
|
}
|
|
3967
4047
|
}
|
|
3968
4048
|
};
|
|
4049
|
+
var fixReversedBindingsForBindables = (original, duplicate, originalElements, elementsWithClones, oldIdToDuplicatedId) => {
|
|
4050
|
+
original.boundElements?.forEach((binding, idx) => {
|
|
4051
|
+
if (binding.type !== "arrow") {
|
|
4052
|
+
return;
|
|
4053
|
+
}
|
|
4054
|
+
const oldArrow = elementsWithClones.find((el) => el.id === binding.id);
|
|
4055
|
+
if (!isBindingElement(oldArrow)) {
|
|
4056
|
+
return;
|
|
4057
|
+
}
|
|
4058
|
+
if (originalElements.has(binding.id)) {
|
|
4059
|
+
const newArrowId = oldIdToDuplicatedId.get(binding.id) ?? binding.id;
|
|
4060
|
+
const newArrow = elementsWithClones.find(
|
|
4061
|
+
(el) => el.id === newArrowId
|
|
4062
|
+
);
|
|
4063
|
+
mutateElement(newArrow, {
|
|
4064
|
+
startBinding: oldArrow.startBinding?.elementId === binding.id ? {
|
|
4065
|
+
...oldArrow.startBinding,
|
|
4066
|
+
elementId: duplicate.id
|
|
4067
|
+
} : newArrow.startBinding,
|
|
4068
|
+
endBinding: oldArrow.endBinding?.elementId === binding.id ? {
|
|
4069
|
+
...oldArrow.endBinding,
|
|
4070
|
+
elementId: duplicate.id
|
|
4071
|
+
} : newArrow.endBinding
|
|
4072
|
+
});
|
|
4073
|
+
mutateElement(duplicate, {
|
|
4074
|
+
boundElements: [
|
|
4075
|
+
...(duplicate.boundElements ?? []).filter(
|
|
4076
|
+
(el) => el.id !== binding.id && el.id !== newArrowId
|
|
4077
|
+
),
|
|
4078
|
+
{
|
|
4079
|
+
type: "arrow",
|
|
4080
|
+
id: newArrowId
|
|
4081
|
+
}
|
|
4082
|
+
]
|
|
4083
|
+
});
|
|
4084
|
+
} else {
|
|
4085
|
+
mutateElement(oldArrow, {
|
|
4086
|
+
startBinding: oldArrow.startBinding?.elementId === original.id ? {
|
|
4087
|
+
...oldArrow.startBinding,
|
|
4088
|
+
elementId: duplicate.id
|
|
4089
|
+
} : oldArrow.startBinding,
|
|
4090
|
+
endBinding: oldArrow.endBinding?.elementId === original.id ? {
|
|
4091
|
+
...oldArrow.endBinding,
|
|
4092
|
+
elementId: duplicate.id
|
|
4093
|
+
} : oldArrow.endBinding
|
|
4094
|
+
});
|
|
4095
|
+
mutateElement(duplicate, {
|
|
4096
|
+
boundElements: [
|
|
4097
|
+
...duplicate.boundElements ?? [],
|
|
4098
|
+
{
|
|
4099
|
+
type: "arrow",
|
|
4100
|
+
id: oldArrow.id
|
|
4101
|
+
}
|
|
4102
|
+
]
|
|
4103
|
+
});
|
|
4104
|
+
mutateElement(original, {
|
|
4105
|
+
boundElements: original.boundElements?.filter((_, i) => i !== idx) ?? null
|
|
4106
|
+
});
|
|
4107
|
+
}
|
|
4108
|
+
});
|
|
4109
|
+
};
|
|
4110
|
+
var fixReversedBindingsForArrows = (original, duplicate, originalElements, bindingProp, oldIdToDuplicatedId, elementsWithClones) => {
|
|
4111
|
+
const oldBindableId = original[bindingProp]?.elementId;
|
|
4112
|
+
if (oldBindableId) {
|
|
4113
|
+
if (originalElements.has(oldBindableId)) {
|
|
4114
|
+
const newBindableId = oldIdToDuplicatedId.get(oldBindableId) ?? oldBindableId;
|
|
4115
|
+
const newBindable = elementsWithClones.find(
|
|
4116
|
+
(el) => el.id === newBindableId
|
|
4117
|
+
);
|
|
4118
|
+
mutateElement(duplicate, {
|
|
4119
|
+
[bindingProp]: {
|
|
4120
|
+
...original[bindingProp],
|
|
4121
|
+
elementId: newBindableId
|
|
4122
|
+
}
|
|
4123
|
+
});
|
|
4124
|
+
mutateElement(newBindable, {
|
|
4125
|
+
boundElements: [
|
|
4126
|
+
...(newBindable.boundElements ?? []).filter(
|
|
4127
|
+
(el) => el.id !== original.id && el.id !== duplicate.id
|
|
4128
|
+
),
|
|
4129
|
+
{
|
|
4130
|
+
id: duplicate.id,
|
|
4131
|
+
type: "arrow"
|
|
4132
|
+
}
|
|
4133
|
+
]
|
|
4134
|
+
});
|
|
4135
|
+
} else {
|
|
4136
|
+
const originalBindable = elementsWithClones.find(
|
|
4137
|
+
(el) => el.id === oldBindableId
|
|
4138
|
+
);
|
|
4139
|
+
if (originalBindable) {
|
|
4140
|
+
mutateElement(duplicate, {
|
|
4141
|
+
[bindingProp]: original[bindingProp]
|
|
4142
|
+
});
|
|
4143
|
+
mutateElement(original, {
|
|
4144
|
+
[bindingProp]: null
|
|
4145
|
+
});
|
|
4146
|
+
mutateElement(originalBindable, {
|
|
4147
|
+
boundElements: [
|
|
4148
|
+
...originalBindable.boundElements?.filter(
|
|
4149
|
+
(el) => el.id !== original.id
|
|
4150
|
+
) ?? [],
|
|
4151
|
+
{
|
|
4152
|
+
id: duplicate.id,
|
|
4153
|
+
type: "arrow"
|
|
4154
|
+
}
|
|
4155
|
+
]
|
|
4156
|
+
});
|
|
4157
|
+
}
|
|
4158
|
+
}
|
|
4159
|
+
}
|
|
4160
|
+
};
|
|
4161
|
+
var fixReversedBindings = (originalElements, elementsWithClones, oldIdToDuplicatedId) => {
|
|
4162
|
+
for (const original of originalElements.values()) {
|
|
4163
|
+
const duplicate = elementsWithClones.find(
|
|
4164
|
+
(el) => el.id === oldIdToDuplicatedId.get(original.id)
|
|
4165
|
+
);
|
|
4166
|
+
if (isBindableElement(original) && isBindableElement(duplicate)) {
|
|
4167
|
+
fixReversedBindingsForBindables(
|
|
4168
|
+
original,
|
|
4169
|
+
duplicate,
|
|
4170
|
+
originalElements,
|
|
4171
|
+
elementsWithClones,
|
|
4172
|
+
oldIdToDuplicatedId
|
|
4173
|
+
);
|
|
4174
|
+
} else if (isArrowElement(original) && isArrowElement(duplicate)) {
|
|
4175
|
+
fixReversedBindingsForArrows(
|
|
4176
|
+
original,
|
|
4177
|
+
duplicate,
|
|
4178
|
+
originalElements,
|
|
4179
|
+
"startBinding",
|
|
4180
|
+
oldIdToDuplicatedId,
|
|
4181
|
+
elementsWithClones
|
|
4182
|
+
);
|
|
4183
|
+
fixReversedBindingsForArrows(
|
|
4184
|
+
original,
|
|
4185
|
+
duplicate,
|
|
4186
|
+
originalElements,
|
|
4187
|
+
"endBinding",
|
|
4188
|
+
oldIdToDuplicatedId,
|
|
4189
|
+
elementsWithClones
|
|
4190
|
+
);
|
|
4191
|
+
}
|
|
4192
|
+
}
|
|
4193
|
+
};
|
|
3969
4194
|
var fixBindingsAfterDeletion = (sceneElements, deletedElements) => {
|
|
3970
4195
|
const elements = arrayToMap(sceneElements);
|
|
3971
4196
|
for (const element of deletedElements) {
|
|
@@ -8308,6 +8533,7 @@ var _LinearElementEditor = class _LinearElementEditor {
|
|
|
8308
8533
|
this.elementId = element.id;
|
|
8309
8534
|
if (!pointsEqual(element.points[0], pointFrom(0, 0))) {
|
|
8310
8535
|
console.error("Linear element is not normalized", Error().stack);
|
|
8536
|
+
_LinearElementEditor.normalizePoints(element);
|
|
8311
8537
|
}
|
|
8312
8538
|
this.selectedPointsIndices = null;
|
|
8313
8539
|
this.lastUncommittedPoint = null;
|
|
@@ -11463,40 +11689,62 @@ var getElementAbsoluteCoords = (element, elementsMap, includeBoundText = false)
|
|
|
11463
11689
|
];
|
|
11464
11690
|
};
|
|
11465
11691
|
var getElementLineSegments = (element, elementsMap) => {
|
|
11692
|
+
const shape = getElementShape(element, elementsMap);
|
|
11466
11693
|
const [x1, y1, x2, y2, cx, cy] = getElementAbsoluteCoords(
|
|
11467
11694
|
element,
|
|
11468
11695
|
elementsMap
|
|
11469
11696
|
);
|
|
11470
11697
|
const center = pointFrom(cx, cy);
|
|
11471
|
-
if (
|
|
11472
|
-
const
|
|
11698
|
+
if (shape.type === "polycurve") {
|
|
11699
|
+
const curves = shape.data;
|
|
11700
|
+
const points = curves.map((curve2) => pointsOnBezierCurves2(curve2, 10)).flat();
|
|
11473
11701
|
let i = 0;
|
|
11474
|
-
|
|
11702
|
+
const segments = [];
|
|
11703
|
+
while (i < points.length - 1) {
|
|
11475
11704
|
segments.push(
|
|
11476
11705
|
lineSegment(
|
|
11477
|
-
|
|
11478
|
-
|
|
11479
|
-
element.points[i][0] + element.x,
|
|
11480
|
-
element.points[i][1] + element.y
|
|
11481
|
-
),
|
|
11482
|
-
center,
|
|
11483
|
-
element.angle
|
|
11484
|
-
),
|
|
11485
|
-
pointRotateRads(
|
|
11486
|
-
pointFrom(
|
|
11487
|
-
element.points[i + 1][0] + element.x,
|
|
11488
|
-
element.points[i + 1][1] + element.y
|
|
11489
|
-
),
|
|
11490
|
-
center,
|
|
11491
|
-
element.angle
|
|
11492
|
-
)
|
|
11706
|
+
pointFrom(points[i][0], points[i][1]),
|
|
11707
|
+
pointFrom(points[i + 1][0], points[i + 1][1])
|
|
11493
11708
|
)
|
|
11494
11709
|
);
|
|
11495
11710
|
i++;
|
|
11496
11711
|
}
|
|
11497
11712
|
return segments;
|
|
11713
|
+
} else if (shape.type === "polyline") {
|
|
11714
|
+
return shape.data;
|
|
11715
|
+
} else if (_isRectanguloidElement(element)) {
|
|
11716
|
+
const [sides, corners] = deconstructRectanguloidElement(element);
|
|
11717
|
+
const cornerSegments = corners.map((corner) => getSegmentsOnCurve(corner, center, element.angle)).flat();
|
|
11718
|
+
const rotatedSides = getRotatedSides(sides, center, element.angle);
|
|
11719
|
+
return [...rotatedSides, ...cornerSegments];
|
|
11720
|
+
} else if (element.type === "diamond") {
|
|
11721
|
+
const [sides, corners] = deconstructDiamondElement(element);
|
|
11722
|
+
const cornerSegments = corners.map((corner) => getSegmentsOnCurve(corner, center, element.angle)).flat();
|
|
11723
|
+
const rotatedSides = getRotatedSides(sides, center, element.angle);
|
|
11724
|
+
return [...rotatedSides, ...cornerSegments];
|
|
11725
|
+
} else if (shape.type === "polygon") {
|
|
11726
|
+
if (isTextElement(element)) {
|
|
11727
|
+
const container = getContainerElement(element, elementsMap);
|
|
11728
|
+
if (container && isLinearElement(container)) {
|
|
11729
|
+
const segments2 = [
|
|
11730
|
+
lineSegment(pointFrom(x1, y1), pointFrom(x2, y1)),
|
|
11731
|
+
lineSegment(pointFrom(x2, y1), pointFrom(x2, y2)),
|
|
11732
|
+
lineSegment(pointFrom(x2, y2), pointFrom(x1, y2)),
|
|
11733
|
+
lineSegment(pointFrom(x1, y2), pointFrom(x1, y1))
|
|
11734
|
+
];
|
|
11735
|
+
return segments2;
|
|
11736
|
+
}
|
|
11737
|
+
}
|
|
11738
|
+
const points = shape.data;
|
|
11739
|
+
const segments = [];
|
|
11740
|
+
for (let i = 0; i < points.length - 1; i++) {
|
|
11741
|
+
segments.push(lineSegment(points[i], points[i + 1]));
|
|
11742
|
+
}
|
|
11743
|
+
return segments;
|
|
11744
|
+
} else if (shape.type === "ellipse") {
|
|
11745
|
+
return getSegmentsOnEllipse(element);
|
|
11498
11746
|
}
|
|
11499
|
-
const [nw, ne, sw, se,
|
|
11747
|
+
const [nw, ne, sw, se, , , w, e] = [
|
|
11500
11748
|
[x1, y1],
|
|
11501
11749
|
[x2, y1],
|
|
11502
11750
|
[x1, y2],
|
|
@@ -11506,26 +11754,6 @@ var getElementLineSegments = (element, elementsMap) => {
|
|
|
11506
11754
|
[x1, cy],
|
|
11507
11755
|
[x2, cy]
|
|
11508
11756
|
].map((point) => pointRotateRads(point, center, element.angle));
|
|
11509
|
-
if (element.type === "diamond") {
|
|
11510
|
-
return [
|
|
11511
|
-
lineSegment(n, w),
|
|
11512
|
-
lineSegment(n, e),
|
|
11513
|
-
lineSegment(s, w),
|
|
11514
|
-
lineSegment(s, e)
|
|
11515
|
-
];
|
|
11516
|
-
}
|
|
11517
|
-
if (element.type === "ellipse") {
|
|
11518
|
-
return [
|
|
11519
|
-
lineSegment(n, w),
|
|
11520
|
-
lineSegment(n, e),
|
|
11521
|
-
lineSegment(s, w),
|
|
11522
|
-
lineSegment(s, e),
|
|
11523
|
-
lineSegment(n, w),
|
|
11524
|
-
lineSegment(n, e),
|
|
11525
|
-
lineSegment(s, w),
|
|
11526
|
-
lineSegment(s, e)
|
|
11527
|
-
];
|
|
11528
|
-
}
|
|
11529
11757
|
return [
|
|
11530
11758
|
lineSegment(nw, ne),
|
|
11531
11759
|
lineSegment(sw, se),
|
|
@@ -11537,6 +11765,63 @@ var getElementLineSegments = (element, elementsMap) => {
|
|
|
11537
11765
|
lineSegment(se, w)
|
|
11538
11766
|
];
|
|
11539
11767
|
};
|
|
11768
|
+
var _isRectanguloidElement = (element) => {
|
|
11769
|
+
return element != null && (element.type === "rectangle" || element.type === "image" || element.type === "iframe" || element.type === "embeddable" || element.type === "frame" || element.type === "magicframe" || element.type === "text" && !element.containerId);
|
|
11770
|
+
};
|
|
11771
|
+
var getRotatedSides = (sides, center, angle) => {
|
|
11772
|
+
return sides.map((side) => {
|
|
11773
|
+
return lineSegment(
|
|
11774
|
+
pointRotateRads(side[0], center, angle),
|
|
11775
|
+
pointRotateRads(side[1], center, angle)
|
|
11776
|
+
);
|
|
11777
|
+
});
|
|
11778
|
+
};
|
|
11779
|
+
var getSegmentsOnCurve = (curve2, center, angle) => {
|
|
11780
|
+
const points = pointsOnBezierCurves2(curve2, 10);
|
|
11781
|
+
let i = 0;
|
|
11782
|
+
const segments = [];
|
|
11783
|
+
while (i < points.length - 1) {
|
|
11784
|
+
segments.push(
|
|
11785
|
+
lineSegment(
|
|
11786
|
+
pointRotateRads(
|
|
11787
|
+
pointFrom(points[i][0], points[i][1]),
|
|
11788
|
+
center,
|
|
11789
|
+
angle
|
|
11790
|
+
),
|
|
11791
|
+
pointRotateRads(
|
|
11792
|
+
pointFrom(points[i + 1][0], points[i + 1][1]),
|
|
11793
|
+
center,
|
|
11794
|
+
angle
|
|
11795
|
+
)
|
|
11796
|
+
)
|
|
11797
|
+
);
|
|
11798
|
+
i++;
|
|
11799
|
+
}
|
|
11800
|
+
return segments;
|
|
11801
|
+
};
|
|
11802
|
+
var getSegmentsOnEllipse = (ellipse2) => {
|
|
11803
|
+
const center = pointFrom(
|
|
11804
|
+
ellipse2.x + ellipse2.width / 2,
|
|
11805
|
+
ellipse2.y + ellipse2.height / 2
|
|
11806
|
+
);
|
|
11807
|
+
const a = ellipse2.width / 2;
|
|
11808
|
+
const b = ellipse2.height / 2;
|
|
11809
|
+
const segments = [];
|
|
11810
|
+
const points = [];
|
|
11811
|
+
const n = 90;
|
|
11812
|
+
const deltaT = Math.PI * 2 / n;
|
|
11813
|
+
for (let i = 0; i < n; i++) {
|
|
11814
|
+
const t = i * deltaT;
|
|
11815
|
+
const x = center[0] + a * Math.cos(t);
|
|
11816
|
+
const y = center[1] + b * Math.sin(t);
|
|
11817
|
+
points.push(pointRotateRads(pointFrom(x, y), center, ellipse2.angle));
|
|
11818
|
+
}
|
|
11819
|
+
for (let i = 0; i < points.length - 1; i++) {
|
|
11820
|
+
segments.push(lineSegment(points[i], points[i + 1]));
|
|
11821
|
+
}
|
|
11822
|
+
segments.push(lineSegment(points[points.length - 1], points[0]));
|
|
11823
|
+
return segments;
|
|
11824
|
+
};
|
|
11540
11825
|
var getDiamondPoints = (element) => {
|
|
11541
11826
|
const topX = Math.floor(element.width / 2) + 1;
|
|
11542
11827
|
const topY = 0;
|
|
@@ -12145,6 +12430,7 @@ var getDefaultAppState = () => {
|
|
|
12145
12430
|
type: "selection",
|
|
12146
12431
|
customType: null,
|
|
12147
12432
|
locked: DEFAULT_ELEMENT_PROPS.locked,
|
|
12433
|
+
fromSelection: false,
|
|
12148
12434
|
lastActiveTool: null
|
|
12149
12435
|
},
|
|
12150
12436
|
penMode: false,
|
|
@@ -17109,6 +17395,7 @@ var getExportSize = (elements, exportPadding, scale) => {
|
|
|
17109
17395
|
// data/restore.ts
|
|
17110
17396
|
var AllowedExcalidrawActiveTools = {
|
|
17111
17397
|
selection: true,
|
|
17398
|
+
lasso: true,
|
|
17112
17399
|
text: true,
|
|
17113
17400
|
rectangle: true,
|
|
17114
17401
|
diamond: true,
|
|
@@ -17187,7 +17474,7 @@ var restoreElementWithProperties = (element, extra) => {
|
|
|
17187
17474
|
if ("customData" in element || "customData" in extra) {
|
|
17188
17475
|
base.customData = "customData" in extra ? extra.customData : element.customData;
|
|
17189
17476
|
}
|
|
17190
|
-
|
|
17477
|
+
const ret = {
|
|
17191
17478
|
// spread the original element properties to not lose unknown ones
|
|
17192
17479
|
// for forward-compatibility
|
|
17193
17480
|
...element,
|
|
@@ -17196,6 +17483,9 @@ var restoreElementWithProperties = (element, extra) => {
|
|
|
17196
17483
|
...getNormalizedDimensions(base),
|
|
17197
17484
|
...extra
|
|
17198
17485
|
};
|
|
17486
|
+
delete ret.strokeSharpness;
|
|
17487
|
+
delete ret.boundElementIds;
|
|
17488
|
+
return ret;
|
|
17199
17489
|
};
|
|
17200
17490
|
var restoreElement = (element) => {
|
|
17201
17491
|
element = { ...element };
|
|
@@ -17593,7 +17883,7 @@ var parseFileContents = async (blob) => {
|
|
|
17593
17883
|
let contents;
|
|
17594
17884
|
if (blob.type === MIME_TYPES.png) {
|
|
17595
17885
|
try {
|
|
17596
|
-
return await (await import("./data/image-
|
|
17886
|
+
return await (await import("./data/image-NKFINVKH.js")).decodePngMetadata(blob);
|
|
17597
17887
|
} catch (error) {
|
|
17598
17888
|
if (error.message === "INVALID") {
|
|
17599
17889
|
throw new ImageSceneDataError(
|
|
@@ -17982,6 +18272,7 @@ var decodePngMetadata = async (blob) => {
|
|
|
17982
18272
|
};
|
|
17983
18273
|
|
|
17984
18274
|
export {
|
|
18275
|
+
COLOR_OUTLINE_CONTRAST_THRESHOLD,
|
|
17985
18276
|
MAX_CUSTOM_COLORS_USED_IN_CANVAS,
|
|
17986
18277
|
COLORS_PER_ROW,
|
|
17987
18278
|
DEFAULT_CHART_COLOR_INDEX,
|
|
@@ -18105,7 +18396,11 @@ export {
|
|
|
18105
18396
|
pointRotateRads,
|
|
18106
18397
|
pointCenter,
|
|
18107
18398
|
pointDistance,
|
|
18399
|
+
lineSegment,
|
|
18108
18400
|
pointOnLineSegment,
|
|
18401
|
+
lineSegmentIntersectionPoints,
|
|
18402
|
+
polygonFromPoints,
|
|
18403
|
+
polygonIncludesPointNonZero,
|
|
18109
18404
|
rangeInclusive,
|
|
18110
18405
|
rangesOverlap,
|
|
18111
18406
|
rangeIntersection,
|
|
@@ -18249,7 +18544,8 @@ export {
|
|
|
18249
18544
|
updateBoundElements,
|
|
18250
18545
|
bindPointToSnapToElementOutline,
|
|
18251
18546
|
calculateFixedPointForElbowArrowBinding,
|
|
18252
|
-
|
|
18547
|
+
fixDuplicatedBindingsAfterDuplication,
|
|
18548
|
+
fixReversedBindings,
|
|
18253
18549
|
fixBindingsAfterDeletion,
|
|
18254
18550
|
maxBindingGap,
|
|
18255
18551
|
bindingProperties,
|
|
@@ -18348,6 +18644,7 @@ export {
|
|
|
18348
18644
|
getFreeDrawSvgPath,
|
|
18349
18645
|
ShapeCache,
|
|
18350
18646
|
getElementAbsoluteCoords,
|
|
18647
|
+
getElementLineSegments,
|
|
18351
18648
|
getElementBounds,
|
|
18352
18649
|
getCommonBounds,
|
|
18353
18650
|
getDraggedElementsBounds,
|
|
@@ -18439,4 +18736,4 @@ export {
|
|
|
18439
18736
|
createFile,
|
|
18440
18737
|
normalizeFile
|
|
18441
18738
|
};
|
|
18442
|
-
//# sourceMappingURL=chunk-
|
|
18739
|
+
//# sourceMappingURL=chunk-KYBDXI6F.js.map
|