@excalidraw/excalidraw 0.18.0-432a46e → 0.18.0-58f7d33
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-KKJLIRJU.js} +2 -2
- package/dist/dev/{chunk-ZG3EI5XS.js.map → chunk-KKJLIRJU.js.map} +1 -1
- package/dist/dev/{chunk-S7W4OWSF.js → chunk-LEJJ2YZY.js} +461 -192
- package/dist/dev/chunk-LEJJ2YZY.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-U2IPNUKJ.js} +3 -3
- package/dist/dev/index.css +43 -46
- package/dist/dev/index.css.map +2 -2
- package/dist/dev/index.js +678 -190
- 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-6U3AYISY.js → chunk-IUH5AXLB.js} +1 -1
- package/dist/prod/{chunk-U24AOZ3B.js → chunk-QUX7WTVH.js} +1 -1
- package/dist/prod/chunk-RQK6WG4F.js +33 -0
- package/dist/prod/data/image-UQDATCXC.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 +3 -0
- package/dist/types/{packages/common → common}/src/utils.d.ts +5 -1
- 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/collision.d.ts +1 -1
- package/dist/types/{packages/element → element}/src/heading.d.ts +0 -1
- package/dist/types/{packages/element → element}/src/textElement.d.ts +2 -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 +9 -4
- 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/eraser/index.d.ts +14 -0
- package/dist/types/excalidraw/lasso/index.d.ts +15 -0
- package/dist/types/excalidraw/lasso/utils.d.ts +12 -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/dist/types/{packages/math → math}/src/types.d.ts +1 -0
- 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-U2IPNUKJ.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/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/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/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
package/dist/dev/index.js
CHANGED
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
CODES,
|
|
14
14
|
COLORS_PER_ROW,
|
|
15
15
|
COLOR_CHARCOAL_BLACK,
|
|
16
|
+
COLOR_OUTLINE_CONTRAST_THRESHOLD,
|
|
16
17
|
COLOR_PALETTE,
|
|
17
18
|
COLOR_VOICE_CALL,
|
|
18
19
|
COLOR_WHITE,
|
|
@@ -88,6 +89,7 @@ import {
|
|
|
88
89
|
STATS_PANELS,
|
|
89
90
|
STROKE_WIDTH,
|
|
90
91
|
SVGStringToFile,
|
|
92
|
+
SVG_DOCUMENT_PREAMBLE,
|
|
91
93
|
SVG_NS,
|
|
92
94
|
Scene_default,
|
|
93
95
|
ShapeCache,
|
|
@@ -169,7 +171,8 @@ import {
|
|
|
169
171
|
findIndex,
|
|
170
172
|
findLastIndex,
|
|
171
173
|
fixBindingsAfterDeletion,
|
|
172
|
-
|
|
174
|
+
fixDuplicatedBindingsAfterDuplication,
|
|
175
|
+
fixReversedBindings,
|
|
173
176
|
focusNearestParent,
|
|
174
177
|
frameAndChildrenSelectedTogether,
|
|
175
178
|
generateIdFromFile,
|
|
@@ -197,6 +200,7 @@ import {
|
|
|
197
200
|
getDraggedElementsBounds,
|
|
198
201
|
getElementAbsoluteCoords,
|
|
199
202
|
getElementBounds,
|
|
203
|
+
getElementLineSegments,
|
|
200
204
|
getElementShape,
|
|
201
205
|
getElementsInGroup,
|
|
202
206
|
getElementsInNewFrame,
|
|
@@ -340,6 +344,8 @@ import {
|
|
|
340
344
|
isValidTextContainer,
|
|
341
345
|
isWindows,
|
|
342
346
|
isWritableElement,
|
|
347
|
+
lineSegment,
|
|
348
|
+
lineSegmentIntersectionPoints,
|
|
343
349
|
loadFromBlob,
|
|
344
350
|
loadFromJSON,
|
|
345
351
|
loadHTMLImageElement,
|
|
@@ -382,6 +388,8 @@ import {
|
|
|
382
388
|
pointFromPair,
|
|
383
389
|
pointOnLineSegment,
|
|
384
390
|
pointRotateRads,
|
|
391
|
+
polygonFromPoints,
|
|
392
|
+
polygonIncludesPointNonZero,
|
|
385
393
|
preventUnload,
|
|
386
394
|
promiseTry,
|
|
387
395
|
queryFocusableElements,
|
|
@@ -426,6 +434,7 @@ import {
|
|
|
426
434
|
shouldMaintainAspectRatio,
|
|
427
435
|
shouldResizeFromCenter,
|
|
428
436
|
shouldRotateWithDiscreteAngle,
|
|
437
|
+
shouldTestInside,
|
|
429
438
|
supportsResizeObserver,
|
|
430
439
|
suppportsHorizontalAlign,
|
|
431
440
|
syncInvalidIndices,
|
|
@@ -453,13 +462,13 @@ import {
|
|
|
453
462
|
viewportCoordsToSceneCoords,
|
|
454
463
|
wrapEvent,
|
|
455
464
|
wrapText
|
|
456
|
-
} from "./chunk-
|
|
465
|
+
} from "./chunk-LEJJ2YZY.js";
|
|
457
466
|
import {
|
|
458
467
|
define_import_meta_env_default
|
|
459
|
-
} from "./chunk-
|
|
468
|
+
} from "./chunk-KKJLIRJU.js";
|
|
460
469
|
import {
|
|
461
470
|
en_default
|
|
462
|
-
} from "./chunk-
|
|
471
|
+
} from "./chunk-X3RYHLJU.js";
|
|
463
472
|
import {
|
|
464
473
|
percentages_default
|
|
465
474
|
} from "./chunk-MFAYKRVR.js";
|
|
@@ -734,11 +743,18 @@ var duplicateElements = (opts) => {
|
|
|
734
743
|
copyElements(element)
|
|
735
744
|
);
|
|
736
745
|
}
|
|
737
|
-
|
|
746
|
+
fixDuplicatedBindingsAfterDuplication(
|
|
738
747
|
newElements,
|
|
739
748
|
oldIdToDuplicatedId,
|
|
740
749
|
duplicatedElementsMap
|
|
741
750
|
);
|
|
751
|
+
if (reverseOrder) {
|
|
752
|
+
fixReversedBindings(
|
|
753
|
+
_idsOfElementsToDuplicate,
|
|
754
|
+
elementsWithClones,
|
|
755
|
+
oldIdToDuplicatedId
|
|
756
|
+
);
|
|
757
|
+
}
|
|
742
758
|
bindElementsToFramesAfterDuplication(
|
|
743
759
|
elementsWithClones,
|
|
744
760
|
oldElements,
|
|
@@ -2887,7 +2903,7 @@ var globImport_locales_json = __glob({
|
|
|
2887
2903
|
"./locales/da-DK.json": () => import("./locales/da-DK-N76F4QAJ.js"),
|
|
2888
2904
|
"./locales/de-DE.json": () => import("./locales/de-DE-DMRXZ2SZ.js"),
|
|
2889
2905
|
"./locales/el-GR.json": () => import("./locales/el-GR-HIKPLEXI.js"),
|
|
2890
|
-
"./locales/en.json": () => import("./locales/en-
|
|
2906
|
+
"./locales/en.json": () => import("./locales/en-CKWC2GMK.js"),
|
|
2891
2907
|
"./locales/es-ES.json": () => import("./locales/es-ES-AQYVXC32.js"),
|
|
2892
2908
|
"./locales/eu-ES.json": () => import("./locales/eu-ES-3TOEU5DE.js"),
|
|
2893
2909
|
"./locales/fa-IR.json": () => import("./locales/fa-IR-527GAKUP.js"),
|
|
@@ -4601,6 +4617,23 @@ var SelectionIcon = createIcon(
|
|
|
4601
4617
|
] }),
|
|
4602
4618
|
{ fill: "none", width: 22, height: 22, strokeWidth: 1.25 }
|
|
4603
4619
|
);
|
|
4620
|
+
var LassoIcon = createIcon(
|
|
4621
|
+
/* @__PURE__ */ jsxs(
|
|
4622
|
+
"g",
|
|
4623
|
+
{
|
|
4624
|
+
stroke: "currentColor",
|
|
4625
|
+
strokeLinecap: "round",
|
|
4626
|
+
strokeLinejoin: "round",
|
|
4627
|
+
strokeWidth: 1.5,
|
|
4628
|
+
children: [
|
|
4629
|
+
/* @__PURE__ */ jsx("path", { d: "M4.028 13.252c-.657 -.972 -1.028 -2.078 -1.028 -3.252c0 -3.866 4.03 -7 9 -7s9 3.134 9 7s-4.03 7 -9 7c-1.913 0 -3.686 -.464 -5.144 -1.255" }),
|
|
4630
|
+
/* @__PURE__ */ jsx("path", { d: "M5 15m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0" }),
|
|
4631
|
+
/* @__PURE__ */ jsx("path", { d: "M5 17c0 1.42 .316 2.805 1 4" })
|
|
4632
|
+
]
|
|
4633
|
+
}
|
|
4634
|
+
),
|
|
4635
|
+
{ fill: "none", width: 22, height: 22, strokeWidth: 1.25 }
|
|
4636
|
+
);
|
|
4604
4637
|
var RectangleIcon = createIcon(
|
|
4605
4638
|
/* @__PURE__ */ jsxs("g", { strokeWidth: "1.5", children: [
|
|
4606
4639
|
/* @__PURE__ */ jsx("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }),
|
|
@@ -4713,7 +4746,7 @@ var TrashIcon = createIcon(
|
|
|
4713
4746
|
modifiedTablerIconProps
|
|
4714
4747
|
);
|
|
4715
4748
|
var EmbedIcon = createIcon(
|
|
4716
|
-
/* @__PURE__ */ jsxs("g", { strokeWidth: "1.
|
|
4749
|
+
/* @__PURE__ */ jsxs("g", { strokeWidth: "1.5", children: [
|
|
4717
4750
|
/* @__PURE__ */ jsx("polyline", { points: "12 16 18 10 12 4" }),
|
|
4718
4751
|
/* @__PURE__ */ jsx("polyline", { points: "8 4 2 10 8 16" })
|
|
4719
4752
|
] }),
|
|
@@ -7984,27 +8017,38 @@ var getMostUsedCustomColors = (elements, type, palette2) => {
|
|
|
7984
8017
|
var activeColorPickerSectionAtom = atom(null);
|
|
7985
8018
|
var calculateContrast = (r, g, b) => {
|
|
7986
8019
|
const yiq = (r * 299 + g * 587 + b * 114) / 1e3;
|
|
7987
|
-
return yiq
|
|
7988
|
-
};
|
|
7989
|
-
var
|
|
7990
|
-
if (
|
|
7991
|
-
|
|
7992
|
-
|
|
7993
|
-
|
|
7994
|
-
|
|
8020
|
+
return yiq;
|
|
8021
|
+
};
|
|
8022
|
+
var isColorDark = (color, threshold = 160) => {
|
|
8023
|
+
if (!color) {
|
|
8024
|
+
return true;
|
|
8025
|
+
}
|
|
8026
|
+
if (color === "transparent") {
|
|
8027
|
+
return false;
|
|
8028
|
+
}
|
|
8029
|
+
if (!color.startsWith("#")) {
|
|
8030
|
+
const node = document.createElement("div");
|
|
8031
|
+
node.style.color = color;
|
|
8032
|
+
if (node.style.color) {
|
|
8033
|
+
node.style.position = "absolute";
|
|
8034
|
+
node.style.visibility = "hidden";
|
|
8035
|
+
node.style.width = "0";
|
|
8036
|
+
node.style.height = "0";
|
|
8037
|
+
document.body.appendChild(node);
|
|
8038
|
+
const computedColor = getComputedStyle(node).color;
|
|
8039
|
+
document.body.removeChild(node);
|
|
8040
|
+
const rgb = computedColor.replace(/^(rgb|rgba)\(/, "").replace(/\)$/, "").replace(/\s/g, "").split(",");
|
|
7995
8041
|
const r2 = parseInt(rgb[0]);
|
|
7996
8042
|
const g2 = parseInt(rgb[1]);
|
|
7997
8043
|
const b2 = parseInt(rgb[2]);
|
|
7998
|
-
return calculateContrast(r2, g2, b2);
|
|
8044
|
+
return calculateContrast(r2, g2, b2) < threshold;
|
|
7999
8045
|
}
|
|
8046
|
+
return true;
|
|
8000
8047
|
}
|
|
8001
|
-
|
|
8002
|
-
|
|
8003
|
-
|
|
8004
|
-
|
|
8005
|
-
const g = parseInt(bgHex.substring(3, 5), 16);
|
|
8006
|
-
const b = parseInt(bgHex.substring(5, 7), 16);
|
|
8007
|
-
return calculateContrast(r, g, b);
|
|
8048
|
+
const r = parseInt(color.slice(1, 3), 16);
|
|
8049
|
+
const g = parseInt(color.slice(3, 5), 16);
|
|
8050
|
+
const b = parseInt(color.slice(5, 7), 16);
|
|
8051
|
+
return calculateContrast(r, g, b) < threshold;
|
|
8008
8052
|
};
|
|
8009
8053
|
|
|
8010
8054
|
// components/ColorPicker/ColorInput.tsx
|
|
@@ -8123,7 +8167,6 @@ import { jsxs as jsxs6 } from "react/jsx-runtime";
|
|
|
8123
8167
|
var HotkeyLabel = ({
|
|
8124
8168
|
color,
|
|
8125
8169
|
keyLabel,
|
|
8126
|
-
isCustomColor: isCustomColor2 = false,
|
|
8127
8170
|
isShade = false
|
|
8128
8171
|
}) => {
|
|
8129
8172
|
return /* @__PURE__ */ jsxs6(
|
|
@@ -8131,7 +8174,7 @@ var HotkeyLabel = ({
|
|
|
8131
8174
|
{
|
|
8132
8175
|
className: "color-picker__button__hotkey-label",
|
|
8133
8176
|
style: {
|
|
8134
|
-
color:
|
|
8177
|
+
color: isColorDark(color) ? "#fff" : "#000"
|
|
8135
8178
|
},
|
|
8136
8179
|
children: [
|
|
8137
8180
|
isShade && "\u21E7",
|
|
@@ -8167,7 +8210,7 @@ var CustomColorList = ({
|
|
|
8167
8210
|
tabIndex: -1,
|
|
8168
8211
|
type: "button",
|
|
8169
8212
|
className: clsx8(
|
|
8170
|
-
"color-picker__button color-picker__button--large",
|
|
8213
|
+
"color-picker__button color-picker__button--large has-outline",
|
|
8171
8214
|
{
|
|
8172
8215
|
active: color === c,
|
|
8173
8216
|
"is-transparent": c === "transparent" || !c
|
|
@@ -8182,7 +8225,7 @@ var CustomColorList = ({
|
|
|
8182
8225
|
style: { "--swatch-color": c },
|
|
8183
8226
|
children: [
|
|
8184
8227
|
/* @__PURE__ */ jsx14("div", { className: "color-picker__button-outline" }),
|
|
8185
|
-
/* @__PURE__ */ jsx14(HotkeyLabel_default, { color: c, keyLabel: i + 1
|
|
8228
|
+
/* @__PURE__ */ jsx14(HotkeyLabel_default, { color: c, keyLabel: i + 1 })
|
|
8186
8229
|
]
|
|
8187
8230
|
},
|
|
8188
8231
|
i
|
|
@@ -8229,7 +8272,7 @@ var PickerColorList = ({
|
|
|
8229
8272
|
tabIndex: -1,
|
|
8230
8273
|
type: "button",
|
|
8231
8274
|
className: clsx9(
|
|
8232
|
-
"color-picker__button color-picker__button--large",
|
|
8275
|
+
"color-picker__button color-picker__button--large has-outline",
|
|
8233
8276
|
{
|
|
8234
8277
|
active: colorObj?.colorName === key,
|
|
8235
8278
|
"is-transparent": color2 === "transparent" || !color2
|
|
@@ -8288,7 +8331,7 @@ var ShadeList = ({ hex, onChange, palette: palette2 }) => {
|
|
|
8288
8331
|
tabIndex: -1,
|
|
8289
8332
|
type: "button",
|
|
8290
8333
|
className: clsx10(
|
|
8291
|
-
"color-picker__button color-picker__button--large",
|
|
8334
|
+
"color-picker__button color-picker__button--large has-outline",
|
|
8292
8335
|
{ active: i === shade }
|
|
8293
8336
|
),
|
|
8294
8337
|
"aria-label": "Shade",
|
|
@@ -8683,7 +8726,11 @@ var TopPicks = ({
|
|
|
8683
8726
|
{
|
|
8684
8727
|
className: clsx11("color-picker__button", {
|
|
8685
8728
|
active: color === activeColor,
|
|
8686
|
-
"is-transparent": color === "transparent" || !color
|
|
8729
|
+
"is-transparent": color === "transparent" || !color,
|
|
8730
|
+
"has-outline": !isColorDark(
|
|
8731
|
+
color,
|
|
8732
|
+
COLOR_OUTLINE_CONTRAST_THRESHOLD
|
|
8733
|
+
)
|
|
8687
8734
|
}),
|
|
8688
8735
|
style: { "--swatch-color": color },
|
|
8689
8736
|
type: "button",
|
|
@@ -8810,7 +8857,8 @@ var ColorPickerTrigger = ({
|
|
|
8810
8857
|
{
|
|
8811
8858
|
type: "button",
|
|
8812
8859
|
className: clsx12("color-picker__button active-color properties-trigger", {
|
|
8813
|
-
"is-transparent": color === "transparent" || !color
|
|
8860
|
+
"is-transparent": color === "transparent" || !color,
|
|
8861
|
+
"has-outline": !isColorDark(color, COLOR_OUTLINE_CONTRAST_THRESHOLD)
|
|
8814
8862
|
}),
|
|
8815
8863
|
"aria-label": label,
|
|
8816
8864
|
style: color ? { "--swatch-color": color } : void 0,
|
|
@@ -11284,7 +11332,6 @@ import { jsx as jsx35, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
|
11284
11332
|
var actionChangeViewBackgroundColor = register({
|
|
11285
11333
|
name: "changeViewBackgroundColor",
|
|
11286
11334
|
label: "labels.canvasBackground",
|
|
11287
|
-
paletteName: "Change canvas background color",
|
|
11288
11335
|
trackEvent: false,
|
|
11289
11336
|
predicate: (elements, appState, props, app) => {
|
|
11290
11337
|
return !!app.props.UIOptions.canvasActions.changeViewBackgroundColor && !appState.viewModeEnabled;
|
|
@@ -11316,7 +11363,6 @@ var actionChangeViewBackgroundColor = register({
|
|
|
11316
11363
|
var actionClearCanvas = register({
|
|
11317
11364
|
name: "clearCanvas",
|
|
11318
11365
|
label: "labels.clearCanvas",
|
|
11319
|
-
paletteName: "Clear canvas",
|
|
11320
11366
|
icon: TrashIcon,
|
|
11321
11367
|
trackEvent: { category: "canvas" },
|
|
11322
11368
|
predicate: (elements, appState, props, app) => {
|
|
@@ -11668,10 +11714,39 @@ var actionToggleEraserTool = register({
|
|
|
11668
11714
|
},
|
|
11669
11715
|
keyTest: (event) => event.key === KEYS.E
|
|
11670
11716
|
});
|
|
11717
|
+
var actionToggleLassoTool = register({
|
|
11718
|
+
name: "toggleLassoTool",
|
|
11719
|
+
label: "toolBar.lasso",
|
|
11720
|
+
icon: LassoIcon,
|
|
11721
|
+
trackEvent: { category: "toolbar" },
|
|
11722
|
+
perform: (elements, appState, _, app) => {
|
|
11723
|
+
let activeTool;
|
|
11724
|
+
if (appState.activeTool.type !== "lasso") {
|
|
11725
|
+
activeTool = updateActiveTool(appState, {
|
|
11726
|
+
type: "lasso",
|
|
11727
|
+
fromSelection: false
|
|
11728
|
+
});
|
|
11729
|
+
setCursor(app.interactiveCanvas, CURSOR_TYPE.CROSSHAIR);
|
|
11730
|
+
} else {
|
|
11731
|
+
activeTool = updateActiveTool(appState, {
|
|
11732
|
+
type: "selection"
|
|
11733
|
+
});
|
|
11734
|
+
}
|
|
11735
|
+
return {
|
|
11736
|
+
appState: {
|
|
11737
|
+
...appState,
|
|
11738
|
+
selectedElementIds: {},
|
|
11739
|
+
selectedGroupIds: {},
|
|
11740
|
+
activeEmbeddable: null,
|
|
11741
|
+
activeTool
|
|
11742
|
+
},
|
|
11743
|
+
captureUpdate: CaptureUpdateAction.NEVER
|
|
11744
|
+
};
|
|
11745
|
+
}
|
|
11746
|
+
});
|
|
11671
11747
|
var actionToggleHandTool = register({
|
|
11672
11748
|
name: "toggleHandTool",
|
|
11673
11749
|
label: "toolBar.hand",
|
|
11674
|
-
paletteName: "Toggle hand tool",
|
|
11675
11750
|
trackEvent: { category: "toolbar" },
|
|
11676
11751
|
icon: handIcon,
|
|
11677
11752
|
viewMode: false,
|
|
@@ -12699,7 +12774,9 @@ var exportCanvas = async (type, elements, appState, files, {
|
|
|
12699
12774
|
if (type === "svg") {
|
|
12700
12775
|
return fileSave(
|
|
12701
12776
|
svgPromise.then((svg) => {
|
|
12702
|
-
return new Blob([svg.outerHTML], {
|
|
12777
|
+
return new Blob([SVG_DOCUMENT_PREAMBLE + svg.outerHTML], {
|
|
12778
|
+
type: MIME_TYPES.svg
|
|
12779
|
+
});
|
|
12703
12780
|
}),
|
|
12704
12781
|
{
|
|
12705
12782
|
description: "Export to SVG",
|
|
@@ -12729,7 +12806,7 @@ var exportCanvas = async (type, elements, appState, files, {
|
|
|
12729
12806
|
let blob = canvasToBlob(tempCanvas);
|
|
12730
12807
|
if (appState.exportEmbedScene) {
|
|
12731
12808
|
blob = blob.then(
|
|
12732
|
-
(blob2) => import("./data/image-
|
|
12809
|
+
(blob2) => import("./data/image-U2IPNUKJ.js").then(
|
|
12733
12810
|
({ encodePngMetadata: encodePngMetadata2 }) => encodePngMetadata2({
|
|
12734
12811
|
blob: blob2,
|
|
12735
12812
|
metadata: serializeAsJSON(elements, appState, files, "local")
|
|
@@ -13176,7 +13253,7 @@ var actionPasteStyles = register({
|
|
|
13176
13253
|
|
|
13177
13254
|
// ../element/src/showSelectedShapeActions.ts
|
|
13178
13255
|
var showSelectedShapeActions = (appState, elements) => Boolean(
|
|
13179
|
-
!appState.viewModeEnabled && appState.openDialog?.name !== "elementLinkSelector" && (appState.activeTool.type !== "custom" && (appState.editingTextElement || appState.activeTool.type !== "selection" && appState.activeTool.type !== "eraser" && appState.activeTool.type !== "hand" && appState.activeTool.type !== "laser") || getSelectedElements(elements, appState).length)
|
|
13256
|
+
!appState.viewModeEnabled && appState.openDialog?.name !== "elementLinkSelector" && (appState.activeTool.type !== "custom" && (appState.editingTextElement || appState.activeTool.type !== "selection" && appState.activeTool.type !== "lasso" && appState.activeTool.type !== "eraser" && appState.activeTool.type !== "hand" && appState.activeTool.type !== "laser") || getSelectedElements(elements, appState).length)
|
|
13180
13257
|
);
|
|
13181
13258
|
|
|
13182
13259
|
// actions/actionMenu.tsx
|
|
@@ -14660,7 +14737,6 @@ var actionToggleZenMode = register({
|
|
|
14660
14737
|
name: "zenMode",
|
|
14661
14738
|
label: "buttons.zenMode",
|
|
14662
14739
|
icon: coffeeIcon,
|
|
14663
|
-
paletteName: "Toggle zen mode",
|
|
14664
14740
|
viewMode: true,
|
|
14665
14741
|
trackEvent: {
|
|
14666
14742
|
category: "canvas",
|
|
@@ -14714,7 +14790,6 @@ var actionToggleStats = register({
|
|
|
14714
14790
|
name: "stats",
|
|
14715
14791
|
label: "stats.fullTitle",
|
|
14716
14792
|
icon: abacusIcon,
|
|
14717
|
-
paletteName: "Toggle stats",
|
|
14718
14793
|
viewMode: true,
|
|
14719
14794
|
trackEvent: { category: "menu" },
|
|
14720
14795
|
keywords: ["edit", "attributes", "customize"],
|
|
@@ -14821,7 +14896,8 @@ var actionBindText = register({
|
|
|
14821
14896
|
containerId: container.id,
|
|
14822
14897
|
verticalAlign: VERTICAL_ALIGN.MIDDLE,
|
|
14823
14898
|
textAlign: TEXT_ALIGN.CENTER,
|
|
14824
|
-
autoResize: true
|
|
14899
|
+
autoResize: true,
|
|
14900
|
+
angle: isArrowElement(container) ? 0 : container?.angle ?? 0
|
|
14825
14901
|
});
|
|
14826
14902
|
mutateElement(container, {
|
|
14827
14903
|
boundElements: (container.boundElements || []).concat({
|
|
@@ -14875,8 +14951,8 @@ var actionWrapTextInContainer = register({
|
|
|
14875
14951
|
trackEvent: { category: "element" },
|
|
14876
14952
|
predicate: (elements, appState, _, app) => {
|
|
14877
14953
|
const selectedElements = app.scene.getSelectedElements(appState);
|
|
14878
|
-
const
|
|
14879
|
-
return selectedElements.length > 0 &&
|
|
14954
|
+
const someTextElements = selectedElements.some((el) => isTextElement(el));
|
|
14955
|
+
return selectedElements.length > 0 && someTextElements;
|
|
14880
14956
|
},
|
|
14881
14957
|
perform: (elements, appState, _, app) => {
|
|
14882
14958
|
const selectedElements = app.scene.getSelectedElements(appState);
|
|
@@ -15413,7 +15489,6 @@ var actionToggleElementLock = register({
|
|
|
15413
15489
|
});
|
|
15414
15490
|
var actionUnlockAllElements = register({
|
|
15415
15491
|
name: "unlockAllElements",
|
|
15416
|
-
paletteName: "Unlock all elements",
|
|
15417
15492
|
trackEvent: { category: "canvas" },
|
|
15418
15493
|
viewMode: false,
|
|
15419
15494
|
icon: UnlockedIcon,
|
|
@@ -18792,7 +18867,7 @@ var canChangeStrokeColor = (appState, targetElements) => {
|
|
|
18792
18867
|
break;
|
|
18793
18868
|
}
|
|
18794
18869
|
}
|
|
18795
|
-
return hasStrokeColor(appState.activeTool.type) &&
|
|
18870
|
+
return hasStrokeColor(appState.activeTool.type) && commonSelectedType !== "image" && commonSelectedType !== "frame" && commonSelectedType !== "magicframe" || targetElements.some((element) => hasStrokeColor(element.type));
|
|
18796
18871
|
};
|
|
18797
18872
|
var canChangeBackgroundColor = (appState, targetElements) => {
|
|
18798
18873
|
return hasBackground(appState.activeTool.type) || targetElements.some((element) => hasBackground(element.type));
|
|
@@ -18905,6 +18980,7 @@ var ShapesSwitcher = ({
|
|
|
18905
18980
|
const [isExtraToolsMenuOpen, setIsExtraToolsMenuOpen] = useState20(false);
|
|
18906
18981
|
const frameToolSelected = activeTool.type === "frame";
|
|
18907
18982
|
const laserToolSelected = activeTool.type === "laser";
|
|
18983
|
+
const lassoToolSelected = activeTool.type === "lasso";
|
|
18908
18984
|
const embeddableToolSelected = activeTool.type === "embeddable";
|
|
18909
18985
|
const { TTDDialogTriggerTunnel } = useTunnels();
|
|
18910
18986
|
return /* @__PURE__ */ jsxs39(Fragment10, { children: [
|
|
@@ -18932,6 +19008,13 @@ var ShapesSwitcher = ({
|
|
|
18932
19008
|
if (!appState.penDetected && pointerType === "pen") {
|
|
18933
19009
|
app.togglePenMode(true);
|
|
18934
19010
|
}
|
|
19011
|
+
if (value === "selection") {
|
|
19012
|
+
if (appState.activeTool.type === "selection") {
|
|
19013
|
+
app.setActiveTool({ type: "lasso" });
|
|
19014
|
+
} else {
|
|
19015
|
+
app.setActiveTool({ type: "selection" });
|
|
19016
|
+
}
|
|
19017
|
+
}
|
|
18935
19018
|
},
|
|
18936
19019
|
onChange: ({ pointerType }) => {
|
|
18937
19020
|
if (appState.activeTool.type !== value) {
|
|
@@ -18956,14 +19039,14 @@ var ShapesSwitcher = ({
|
|
|
18956
19039
|
DropdownMenu_default.Trigger,
|
|
18957
19040
|
{
|
|
18958
19041
|
className: clsx31("App-toolbar__extra-tools-trigger", {
|
|
18959
|
-
"App-toolbar__extra-tools-trigger--selected": frameToolSelected || embeddableToolSelected || // in collab we're already highlighting the laser button
|
|
19042
|
+
"App-toolbar__extra-tools-trigger--selected": frameToolSelected || embeddableToolSelected || lassoToolSelected || // in collab we're already highlighting the laser button
|
|
18960
19043
|
// outside toolbar, so let's not highlight extra-tools button
|
|
18961
19044
|
// on top of it
|
|
18962
19045
|
laserToolSelected && !app.props.isCollaborating
|
|
18963
19046
|
}),
|
|
18964
19047
|
onToggle: () => setIsExtraToolsMenuOpen(!isExtraToolsMenuOpen),
|
|
18965
19048
|
title: t("toolBar.extraTools"),
|
|
18966
|
-
children: extraToolsIcon
|
|
19049
|
+
children: frameToolSelected ? frameToolIcon : embeddableToolSelected ? EmbedIcon : laserToolSelected && !app.props.isCollaborating ? laserPointerToolIcon : lassoToolSelected ? LassoIcon : extraToolsIcon
|
|
18967
19050
|
}
|
|
18968
19051
|
),
|
|
18969
19052
|
/* @__PURE__ */ jsxs39(
|
|
@@ -19005,6 +19088,16 @@ var ShapesSwitcher = ({
|
|
|
19005
19088
|
children: t("toolBar.laser")
|
|
19006
19089
|
}
|
|
19007
19090
|
),
|
|
19091
|
+
/* @__PURE__ */ jsx69(
|
|
19092
|
+
DropdownMenu_default.Item,
|
|
19093
|
+
{
|
|
19094
|
+
onSelect: () => app.setActiveTool({ type: "lasso" }),
|
|
19095
|
+
icon: LassoIcon,
|
|
19096
|
+
"data-testid": "toolbar-lasso",
|
|
19097
|
+
selected: lassoToolSelected,
|
|
19098
|
+
children: t("toolBar.lasso")
|
|
19099
|
+
}
|
|
19100
|
+
),
|
|
19008
19101
|
/* @__PURE__ */ jsx69("div", { style: { margin: "6px 0", fontSize: 14, fontWeight: 600 }, children: "Generate" }),
|
|
19009
19102
|
app.props.aiEnabled !== false && /* @__PURE__ */ jsx69(TTDDialogTriggerTunnel.Out, {}),
|
|
19010
19103
|
/* @__PURE__ */ jsx69(
|
|
@@ -19315,7 +19408,8 @@ function CommandPaletteInner({
|
|
|
19315
19408
|
);
|
|
19316
19409
|
const toolCommands = [
|
|
19317
19410
|
actionManager.actions.toggleHandTool,
|
|
19318
|
-
actionManager.actions.setFrameAsActiveTool
|
|
19411
|
+
actionManager.actions.setFrameAsActiveTool,
|
|
19412
|
+
actionManager.actions.toggleLassoTool
|
|
19319
19413
|
].map((action) => actionToCommand(action, DEFAULT_CATEGORIES.tools));
|
|
19320
19414
|
const editorCommands = [
|
|
19321
19415
|
actionManager.actions.undo,
|
|
@@ -20436,7 +20530,6 @@ var actionTextAutoResize = register({
|
|
|
20436
20530
|
var actionToggleViewMode = register({
|
|
20437
20531
|
name: "viewMode",
|
|
20438
20532
|
label: "labels.viewMode",
|
|
20439
|
-
paletteName: "Toggle view mode",
|
|
20440
20533
|
icon: eyeIcon,
|
|
20441
20534
|
viewMode: true,
|
|
20442
20535
|
trackEvent: {
|
|
@@ -21812,7 +21905,13 @@ var bindLinearElementToElement = (linearElement, start2, end, elementStore, elem
|
|
|
21812
21905
|
newPoints[0][1] = -delta;
|
|
21813
21906
|
newPoints[endPointIndex][1] += delta;
|
|
21814
21907
|
}
|
|
21815
|
-
Object.assign(
|
|
21908
|
+
Object.assign(
|
|
21909
|
+
linearElement,
|
|
21910
|
+
LinearElementEditor.getNormalizedPoints({
|
|
21911
|
+
...linearElement,
|
|
21912
|
+
points: newPoints
|
|
21913
|
+
})
|
|
21914
|
+
);
|
|
21816
21915
|
return {
|
|
21817
21916
|
linearElement,
|
|
21818
21917
|
startBoundElement,
|
|
@@ -23273,8 +23372,19 @@ var AnimatedTrail = class {
|
|
|
23273
23372
|
__publicField(this, "pastTrails", []);
|
|
23274
23373
|
__publicField(this, "container");
|
|
23275
23374
|
__publicField(this, "trailElement");
|
|
23375
|
+
__publicField(this, "trailAnimation");
|
|
23276
23376
|
this.animationFrameHandler.register(this, this.onFrame.bind(this));
|
|
23277
23377
|
this.trailElement = document.createElementNS(SVG_NS, "path");
|
|
23378
|
+
if (this.options.animateTrail) {
|
|
23379
|
+
this.trailAnimation = document.createElementNS(SVG_NS, "animate");
|
|
23380
|
+
this.trailAnimation.setAttribute("attributeName", "stroke-dashoffset");
|
|
23381
|
+
this.trailElement.setAttribute("stroke-dasharray", "7 7");
|
|
23382
|
+
this.trailElement.setAttribute("stroke-dashoffset", "10");
|
|
23383
|
+
this.trailAnimation.setAttribute("from", "0");
|
|
23384
|
+
this.trailAnimation.setAttribute("to", `-14`);
|
|
23385
|
+
this.trailAnimation.setAttribute("dur", "0.3s");
|
|
23386
|
+
this.trailElement.appendChild(this.trailAnimation);
|
|
23387
|
+
}
|
|
23278
23388
|
}
|
|
23279
23389
|
get hasCurrentTrail() {
|
|
23280
23390
|
return !!this.currentTrail;
|
|
@@ -23321,8 +23431,21 @@ var AnimatedTrail = class {
|
|
|
23321
23431
|
this.update();
|
|
23322
23432
|
}
|
|
23323
23433
|
}
|
|
23434
|
+
getCurrentTrail() {
|
|
23435
|
+
return this.currentTrail;
|
|
23436
|
+
}
|
|
23437
|
+
clearTrails() {
|
|
23438
|
+
this.pastTrails = [];
|
|
23439
|
+
this.currentTrail = void 0;
|
|
23440
|
+
this.update();
|
|
23441
|
+
}
|
|
23324
23442
|
update() {
|
|
23443
|
+
this.pastTrails = [];
|
|
23325
23444
|
this.start();
|
|
23445
|
+
if (this.trailAnimation) {
|
|
23446
|
+
this.trailAnimation.setAttribute("begin", "indefinite");
|
|
23447
|
+
this.trailAnimation.setAttribute("repeatCount", "indefinite");
|
|
23448
|
+
}
|
|
23326
23449
|
}
|
|
23327
23450
|
onFrame() {
|
|
23328
23451
|
const paths = [];
|
|
@@ -23341,19 +23464,31 @@ var AnimatedTrail = class {
|
|
|
23341
23464
|
}
|
|
23342
23465
|
const svgPaths = paths.join(" ").trim();
|
|
23343
23466
|
this.trailElement.setAttribute("d", svgPaths);
|
|
23344
|
-
this.
|
|
23345
|
-
|
|
23346
|
-
|
|
23347
|
-
|
|
23467
|
+
if (this.trailAnimation) {
|
|
23468
|
+
this.trailElement.setAttribute(
|
|
23469
|
+
"fill",
|
|
23470
|
+
(this.options.fill ?? (() => "black"))(this)
|
|
23471
|
+
);
|
|
23472
|
+
this.trailElement.setAttribute(
|
|
23473
|
+
"stroke",
|
|
23474
|
+
(this.options.stroke ?? (() => "black"))(this)
|
|
23475
|
+
);
|
|
23476
|
+
} else {
|
|
23477
|
+
this.trailElement.setAttribute(
|
|
23478
|
+
"fill",
|
|
23479
|
+
(this.options.fill ?? (() => "black"))(this)
|
|
23480
|
+
);
|
|
23481
|
+
}
|
|
23348
23482
|
}
|
|
23349
23483
|
drawTrail(trail, state) {
|
|
23350
|
-
const
|
|
23484
|
+
const _stroke = trail.getStrokeOutline(trail.options.size / state.zoom.value).map(([x, y]) => {
|
|
23351
23485
|
const result = sceneCoordsToViewportCoords(
|
|
23352
23486
|
{ sceneX: x, sceneY: y },
|
|
23353
23487
|
state
|
|
23354
23488
|
);
|
|
23355
23489
|
return [result.x, result.y];
|
|
23356
23490
|
});
|
|
23491
|
+
const stroke = this.trailAnimation ? _stroke.slice(0, _stroke.length / 2) : _stroke;
|
|
23357
23492
|
return getSvgPathFromStroke(stroke, true);
|
|
23358
23493
|
}
|
|
23359
23494
|
};
|
|
@@ -24011,6 +24146,358 @@ var isMaybeMermaidDefinition = (text) => {
|
|
|
24011
24146
|
return re.test(text.trim());
|
|
24012
24147
|
};
|
|
24013
24148
|
|
|
24149
|
+
// lasso/utils.ts
|
|
24150
|
+
import { simplify } from "points-on-curve";
|
|
24151
|
+
var getLassoSelectedElementIds = (input) => {
|
|
24152
|
+
const {
|
|
24153
|
+
lassoPath,
|
|
24154
|
+
elements,
|
|
24155
|
+
elementsSegments,
|
|
24156
|
+
intersectedElements,
|
|
24157
|
+
enclosedElements,
|
|
24158
|
+
simplifyDistance
|
|
24159
|
+
} = input;
|
|
24160
|
+
let path = lassoPath;
|
|
24161
|
+
if (simplifyDistance) {
|
|
24162
|
+
path = simplify(lassoPath, simplifyDistance);
|
|
24163
|
+
}
|
|
24164
|
+
enclosedElements.clear();
|
|
24165
|
+
for (const element of elements) {
|
|
24166
|
+
if (!intersectedElements.has(element.id) && !enclosedElements.has(element.id)) {
|
|
24167
|
+
const enclosed = enclosureTest(path, element, elementsSegments);
|
|
24168
|
+
if (enclosed) {
|
|
24169
|
+
enclosedElements.add(element.id);
|
|
24170
|
+
} else {
|
|
24171
|
+
const intersects = intersectionTest(path, element, elementsSegments);
|
|
24172
|
+
if (intersects) {
|
|
24173
|
+
intersectedElements.add(element.id);
|
|
24174
|
+
}
|
|
24175
|
+
}
|
|
24176
|
+
}
|
|
24177
|
+
}
|
|
24178
|
+
const results = [...intersectedElements, ...enclosedElements];
|
|
24179
|
+
return {
|
|
24180
|
+
selectedElementIds: results
|
|
24181
|
+
};
|
|
24182
|
+
};
|
|
24183
|
+
var enclosureTest = (lassoPath, element, elementsSegments) => {
|
|
24184
|
+
const lassoPolygon = polygonFromPoints(lassoPath);
|
|
24185
|
+
const segments = elementsSegments.get(element.id);
|
|
24186
|
+
if (!segments) {
|
|
24187
|
+
return false;
|
|
24188
|
+
}
|
|
24189
|
+
return segments.some((segment) => {
|
|
24190
|
+
return segment.some(
|
|
24191
|
+
(point) => polygonIncludesPointNonZero(point, lassoPolygon)
|
|
24192
|
+
);
|
|
24193
|
+
});
|
|
24194
|
+
};
|
|
24195
|
+
var intersectionTest = (lassoPath, element, elementsSegments) => {
|
|
24196
|
+
const elementSegments = elementsSegments.get(element.id);
|
|
24197
|
+
if (!elementSegments) {
|
|
24198
|
+
return false;
|
|
24199
|
+
}
|
|
24200
|
+
const lassoSegments = lassoPath.reduce((acc, point, index) => {
|
|
24201
|
+
if (index === 0) {
|
|
24202
|
+
return acc;
|
|
24203
|
+
}
|
|
24204
|
+
acc.push(lineSegment(lassoPath[index - 1], point));
|
|
24205
|
+
return acc;
|
|
24206
|
+
}, []);
|
|
24207
|
+
return lassoSegments.some(
|
|
24208
|
+
(lassoSegment) => elementSegments.some(
|
|
24209
|
+
(elementSegment) => (
|
|
24210
|
+
// introduce a bit of tolerance to account for roughness and simplification of paths
|
|
24211
|
+
lineSegmentIntersectionPoints(lassoSegment, elementSegment, 1) !== null
|
|
24212
|
+
)
|
|
24213
|
+
)
|
|
24214
|
+
);
|
|
24215
|
+
};
|
|
24216
|
+
|
|
24217
|
+
// lasso/index.ts
|
|
24218
|
+
var LassoTrail = class extends AnimatedTrail {
|
|
24219
|
+
constructor(animationFrameHandler, app) {
|
|
24220
|
+
super(animationFrameHandler, app, {
|
|
24221
|
+
animateTrail: true,
|
|
24222
|
+
streamline: 0.4,
|
|
24223
|
+
sizeMapping: (c) => {
|
|
24224
|
+
const DECAY_TIME = Infinity;
|
|
24225
|
+
const DECAY_LENGTH = 5e3;
|
|
24226
|
+
const t2 = Math.max(
|
|
24227
|
+
0,
|
|
24228
|
+
1 - (performance.now() - c.pressure) / DECAY_TIME
|
|
24229
|
+
);
|
|
24230
|
+
const l = (DECAY_LENGTH - Math.min(DECAY_LENGTH, c.totalLength - c.currentIndex)) / DECAY_LENGTH;
|
|
24231
|
+
return Math.min(easeOut(l), easeOut(t2));
|
|
24232
|
+
},
|
|
24233
|
+
fill: () => "rgba(105,101,219,0.05)",
|
|
24234
|
+
stroke: () => "rgba(105,101,219)"
|
|
24235
|
+
});
|
|
24236
|
+
__publicField(this, "intersectedElements", /* @__PURE__ */ new Set());
|
|
24237
|
+
__publicField(this, "enclosedElements", /* @__PURE__ */ new Set());
|
|
24238
|
+
__publicField(this, "elementsSegments", null);
|
|
24239
|
+
__publicField(this, "keepPreviousSelection", false);
|
|
24240
|
+
__publicField(this, "selectElementsFromIds", (ids) => {
|
|
24241
|
+
this.app.setState((prevState) => {
|
|
24242
|
+
const nextSelectedElementIds = ids.reduce((acc, id) => {
|
|
24243
|
+
acc[id] = true;
|
|
24244
|
+
return acc;
|
|
24245
|
+
}, {});
|
|
24246
|
+
if (this.keepPreviousSelection) {
|
|
24247
|
+
for (const id of Object.keys(prevState.selectedElementIds)) {
|
|
24248
|
+
nextSelectedElementIds[id] = true;
|
|
24249
|
+
}
|
|
24250
|
+
}
|
|
24251
|
+
for (const [id] of Object.entries(nextSelectedElementIds)) {
|
|
24252
|
+
const element = this.app.scene.getNonDeletedElement(id);
|
|
24253
|
+
if (element && isTextElement(element)) {
|
|
24254
|
+
const container = getContainerElement(
|
|
24255
|
+
element,
|
|
24256
|
+
this.app.scene.getNonDeletedElementsMap()
|
|
24257
|
+
);
|
|
24258
|
+
if (container) {
|
|
24259
|
+
nextSelectedElementIds[container.id] = true;
|
|
24260
|
+
delete nextSelectedElementIds[element.id];
|
|
24261
|
+
}
|
|
24262
|
+
}
|
|
24263
|
+
}
|
|
24264
|
+
for (const [id] of Object.entries(nextSelectedElementIds)) {
|
|
24265
|
+
const element = this.app.scene.getNonDeletedElement(id);
|
|
24266
|
+
if (element && isFrameLikeElement(element)) {
|
|
24267
|
+
const elementsInFrame = getFrameChildren(
|
|
24268
|
+
this.app.scene.getNonDeletedElementsMap(),
|
|
24269
|
+
element.id
|
|
24270
|
+
);
|
|
24271
|
+
for (const child of elementsInFrame) {
|
|
24272
|
+
delete nextSelectedElementIds[child.id];
|
|
24273
|
+
}
|
|
24274
|
+
}
|
|
24275
|
+
}
|
|
24276
|
+
const nextSelection = selectGroupsForSelectedElements(
|
|
24277
|
+
{
|
|
24278
|
+
editingGroupId: prevState.editingGroupId,
|
|
24279
|
+
selectedElementIds: nextSelectedElementIds
|
|
24280
|
+
},
|
|
24281
|
+
this.app.scene.getNonDeletedElements(),
|
|
24282
|
+
prevState,
|
|
24283
|
+
this.app
|
|
24284
|
+
);
|
|
24285
|
+
const selectedIds = [...Object.keys(nextSelection.selectedElementIds)];
|
|
24286
|
+
const selectedGroupIds = [...Object.keys(nextSelection.selectedGroupIds)];
|
|
24287
|
+
return {
|
|
24288
|
+
selectedElementIds: nextSelection.selectedElementIds,
|
|
24289
|
+
selectedGroupIds: nextSelection.selectedGroupIds,
|
|
24290
|
+
selectedLinearElement: selectedIds.length === 1 && !selectedGroupIds.length && isLinearElement(this.app.scene.getNonDeletedElement(selectedIds[0])) ? new LinearElementEditor(
|
|
24291
|
+
this.app.scene.getNonDeletedElement(
|
|
24292
|
+
selectedIds[0]
|
|
24293
|
+
)
|
|
24294
|
+
) : null
|
|
24295
|
+
};
|
|
24296
|
+
});
|
|
24297
|
+
});
|
|
24298
|
+
__publicField(this, "addPointToPath", (x, y, keepPreviousSelection = false) => {
|
|
24299
|
+
super.addPointToPath(x, y);
|
|
24300
|
+
this.keepPreviousSelection = keepPreviousSelection;
|
|
24301
|
+
this.updateSelection();
|
|
24302
|
+
});
|
|
24303
|
+
__publicField(this, "updateSelection", () => {
|
|
24304
|
+
const lassoPath = super.getCurrentTrail()?.originalPoints?.map((p) => pointFrom(p[0], p[1]));
|
|
24305
|
+
if (!this.elementsSegments) {
|
|
24306
|
+
this.elementsSegments = /* @__PURE__ */ new Map();
|
|
24307
|
+
const visibleElementsMap = arrayToMap(this.app.visibleElements);
|
|
24308
|
+
for (const element of this.app.visibleElements) {
|
|
24309
|
+
const segments = getElementLineSegments(element, visibleElementsMap);
|
|
24310
|
+
this.elementsSegments.set(element.id, segments);
|
|
24311
|
+
}
|
|
24312
|
+
}
|
|
24313
|
+
if (lassoPath) {
|
|
24314
|
+
const { selectedElementIds } = getLassoSelectedElementIds({
|
|
24315
|
+
lassoPath,
|
|
24316
|
+
elements: this.app.visibleElements,
|
|
24317
|
+
elementsSegments: this.elementsSegments,
|
|
24318
|
+
intersectedElements: this.intersectedElements,
|
|
24319
|
+
enclosedElements: this.enclosedElements,
|
|
24320
|
+
simplifyDistance: 5 / this.app.state.zoom.value
|
|
24321
|
+
});
|
|
24322
|
+
this.selectElementsFromIds(selectedElementIds);
|
|
24323
|
+
}
|
|
24324
|
+
});
|
|
24325
|
+
}
|
|
24326
|
+
startPath(x, y, keepPreviousSelection = false) {
|
|
24327
|
+
this.endPath();
|
|
24328
|
+
super.startPath(x, y);
|
|
24329
|
+
this.intersectedElements.clear();
|
|
24330
|
+
this.enclosedElements.clear();
|
|
24331
|
+
this.keepPreviousSelection = keepPreviousSelection;
|
|
24332
|
+
if (!this.keepPreviousSelection) {
|
|
24333
|
+
this.app.setState({
|
|
24334
|
+
selectedElementIds: {},
|
|
24335
|
+
selectedGroupIds: {},
|
|
24336
|
+
selectedLinearElement: null
|
|
24337
|
+
});
|
|
24338
|
+
}
|
|
24339
|
+
}
|
|
24340
|
+
endPath() {
|
|
24341
|
+
super.endPath();
|
|
24342
|
+
super.clearTrails();
|
|
24343
|
+
this.intersectedElements.clear();
|
|
24344
|
+
this.enclosedElements.clear();
|
|
24345
|
+
this.elementsSegments = null;
|
|
24346
|
+
}
|
|
24347
|
+
};
|
|
24348
|
+
|
|
24349
|
+
// eraser/index.ts
|
|
24350
|
+
var POINTS_ON_TRAIL = 2;
|
|
24351
|
+
var EraserTrail = class extends AnimatedTrail {
|
|
24352
|
+
constructor(animationFrameHandler, app) {
|
|
24353
|
+
super(animationFrameHandler, app, {
|
|
24354
|
+
streamline: 0.2,
|
|
24355
|
+
size: 5,
|
|
24356
|
+
keepHead: true,
|
|
24357
|
+
sizeMapping: (c) => {
|
|
24358
|
+
const DECAY_TIME = 200;
|
|
24359
|
+
const DECAY_LENGTH = 10;
|
|
24360
|
+
const t2 = Math.max(
|
|
24361
|
+
0,
|
|
24362
|
+
1 - (performance.now() - c.pressure) / DECAY_TIME
|
|
24363
|
+
);
|
|
24364
|
+
const l = (DECAY_LENGTH - Math.min(DECAY_LENGTH, c.totalLength - c.currentIndex)) / DECAY_LENGTH;
|
|
24365
|
+
return Math.min(easeOut(l), easeOut(t2));
|
|
24366
|
+
},
|
|
24367
|
+
fill: () => app.state.theme === THEME.LIGHT ? "rgba(0, 0, 0, 0.2)" : "rgba(255, 255, 255, 0.2)"
|
|
24368
|
+
});
|
|
24369
|
+
__publicField(this, "elementsToErase", /* @__PURE__ */ new Set());
|
|
24370
|
+
__publicField(this, "groupsToErase", /* @__PURE__ */ new Set());
|
|
24371
|
+
__publicField(this, "segmentsCache", /* @__PURE__ */ new Map());
|
|
24372
|
+
__publicField(this, "geometricShapesCache", /* @__PURE__ */ new Map());
|
|
24373
|
+
}
|
|
24374
|
+
startPath(x, y) {
|
|
24375
|
+
this.endPath();
|
|
24376
|
+
super.startPath(x, y);
|
|
24377
|
+
this.elementsToErase.clear();
|
|
24378
|
+
}
|
|
24379
|
+
addPointToPath(x, y, restore2 = false) {
|
|
24380
|
+
super.addPointToPath(x, y);
|
|
24381
|
+
const elementsToEraser = this.updateElementsToBeErased(restore2);
|
|
24382
|
+
return elementsToEraser;
|
|
24383
|
+
}
|
|
24384
|
+
updateElementsToBeErased(restoreToErase) {
|
|
24385
|
+
let eraserPath = super.getCurrentTrail()?.originalPoints?.map((p) => pointFrom(p[0], p[1])) || [];
|
|
24386
|
+
eraserPath = eraserPath?.slice(eraserPath.length - POINTS_ON_TRAIL);
|
|
24387
|
+
const visibleElementsMap = arrayToMap(this.app.visibleElements);
|
|
24388
|
+
const pathSegments = eraserPath.reduce((acc, point, index) => {
|
|
24389
|
+
if (index === 0) {
|
|
24390
|
+
return acc;
|
|
24391
|
+
}
|
|
24392
|
+
acc.push(lineSegment(eraserPath[index - 1], point));
|
|
24393
|
+
return acc;
|
|
24394
|
+
}, []);
|
|
24395
|
+
if (pathSegments.length === 0) {
|
|
24396
|
+
return [];
|
|
24397
|
+
}
|
|
24398
|
+
for (const element of this.app.visibleElements) {
|
|
24399
|
+
if (restoreToErase && this.elementsToErase.has(element.id)) {
|
|
24400
|
+
const intersects = eraserTest(
|
|
24401
|
+
pathSegments,
|
|
24402
|
+
element,
|
|
24403
|
+
this.segmentsCache,
|
|
24404
|
+
this.geometricShapesCache,
|
|
24405
|
+
visibleElementsMap,
|
|
24406
|
+
this.app
|
|
24407
|
+
);
|
|
24408
|
+
if (intersects) {
|
|
24409
|
+
const shallowestGroupId = element.groupIds.at(-1);
|
|
24410
|
+
if (this.groupsToErase.has(shallowestGroupId)) {
|
|
24411
|
+
const elementsInGroup = getElementsInGroup(
|
|
24412
|
+
this.app.scene.getNonDeletedElementsMap(),
|
|
24413
|
+
shallowestGroupId
|
|
24414
|
+
);
|
|
24415
|
+
for (const elementInGroup of elementsInGroup) {
|
|
24416
|
+
this.elementsToErase.delete(elementInGroup.id);
|
|
24417
|
+
}
|
|
24418
|
+
this.groupsToErase.delete(shallowestGroupId);
|
|
24419
|
+
}
|
|
24420
|
+
if (isBoundToContainer(element)) {
|
|
24421
|
+
this.elementsToErase.delete(element.containerId);
|
|
24422
|
+
}
|
|
24423
|
+
if (hasBoundTextElement(element)) {
|
|
24424
|
+
const boundText = getBoundTextElementId(element);
|
|
24425
|
+
if (boundText) {
|
|
24426
|
+
this.elementsToErase.delete(boundText);
|
|
24427
|
+
}
|
|
24428
|
+
}
|
|
24429
|
+
this.elementsToErase.delete(element.id);
|
|
24430
|
+
}
|
|
24431
|
+
} else if (!restoreToErase && !this.elementsToErase.has(element.id)) {
|
|
24432
|
+
const intersects = eraserTest(
|
|
24433
|
+
pathSegments,
|
|
24434
|
+
element,
|
|
24435
|
+
this.segmentsCache,
|
|
24436
|
+
this.geometricShapesCache,
|
|
24437
|
+
visibleElementsMap,
|
|
24438
|
+
this.app
|
|
24439
|
+
);
|
|
24440
|
+
if (intersects) {
|
|
24441
|
+
const shallowestGroupId = element.groupIds.at(-1);
|
|
24442
|
+
if (!this.groupsToErase.has(shallowestGroupId)) {
|
|
24443
|
+
const elementsInGroup = getElementsInGroup(
|
|
24444
|
+
this.app.scene.getNonDeletedElementsMap(),
|
|
24445
|
+
shallowestGroupId
|
|
24446
|
+
);
|
|
24447
|
+
for (const elementInGroup of elementsInGroup) {
|
|
24448
|
+
this.elementsToErase.add(elementInGroup.id);
|
|
24449
|
+
}
|
|
24450
|
+
this.groupsToErase.add(shallowestGroupId);
|
|
24451
|
+
}
|
|
24452
|
+
if (hasBoundTextElement(element)) {
|
|
24453
|
+
const boundText = getBoundTextElementId(element);
|
|
24454
|
+
if (boundText) {
|
|
24455
|
+
this.elementsToErase.add(boundText);
|
|
24456
|
+
}
|
|
24457
|
+
}
|
|
24458
|
+
if (isBoundToContainer(element)) {
|
|
24459
|
+
this.elementsToErase.add(element.containerId);
|
|
24460
|
+
}
|
|
24461
|
+
this.elementsToErase.add(element.id);
|
|
24462
|
+
}
|
|
24463
|
+
}
|
|
24464
|
+
}
|
|
24465
|
+
return Array.from(this.elementsToErase);
|
|
24466
|
+
}
|
|
24467
|
+
endPath() {
|
|
24468
|
+
super.endPath();
|
|
24469
|
+
super.clearTrails();
|
|
24470
|
+
this.elementsToErase.clear();
|
|
24471
|
+
this.groupsToErase.clear();
|
|
24472
|
+
this.segmentsCache.clear();
|
|
24473
|
+
}
|
|
24474
|
+
};
|
|
24475
|
+
var eraserTest = (pathSegments, element, elementsSegments, shapesCache = /* @__PURE__ */ new Map(), visibleElementsMap = /* @__PURE__ */ new Map(), app) => {
|
|
24476
|
+
let shape = shapesCache.get(element.id);
|
|
24477
|
+
if (!shape) {
|
|
24478
|
+
shape = getElementShape(element, visibleElementsMap);
|
|
24479
|
+
shapesCache.set(element.id, shape);
|
|
24480
|
+
}
|
|
24481
|
+
const lastPoint = pathSegments[pathSegments.length - 1][1];
|
|
24482
|
+
if (shouldTestInside(element) && isPointInShape(lastPoint, shape)) {
|
|
24483
|
+
return true;
|
|
24484
|
+
}
|
|
24485
|
+
let elementSegments = elementsSegments.get(element.id);
|
|
24486
|
+
if (!elementSegments) {
|
|
24487
|
+
elementSegments = getElementLineSegments(element, visibleElementsMap);
|
|
24488
|
+
elementsSegments.set(element.id, elementSegments);
|
|
24489
|
+
}
|
|
24490
|
+
return pathSegments.some(
|
|
24491
|
+
(pathSegment) => elementSegments?.some(
|
|
24492
|
+
(elementSegment) => lineSegmentIntersectionPoints(
|
|
24493
|
+
pathSegment,
|
|
24494
|
+
elementSegment,
|
|
24495
|
+
app.getElementHitThreshold()
|
|
24496
|
+
) !== null
|
|
24497
|
+
)
|
|
24498
|
+
);
|
|
24499
|
+
};
|
|
24500
|
+
|
|
24014
24501
|
// components/BraveMeasureTextError.tsx
|
|
24015
24502
|
import { jsx as jsx77, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
24016
24503
|
var BraveMeasureTextError = () => {
|
|
@@ -24471,13 +24958,13 @@ var getHints = ({
|
|
|
24471
24958
|
}
|
|
24472
24959
|
if (activeTool.type === "selection") {
|
|
24473
24960
|
if (appState.selectionElement && !selectedElements.length && !appState.editingTextElement && !appState.editingLinearElement) {
|
|
24474
|
-
return t("hints.deepBoxSelect");
|
|
24961
|
+
return [t("hints.deepBoxSelect")];
|
|
24475
24962
|
}
|
|
24476
24963
|
if (isGridModeEnabled(app) && appState.selectedElementsAreBeingDragged) {
|
|
24477
24964
|
return t("hints.disableSnapping");
|
|
24478
24965
|
}
|
|
24479
24966
|
if (!selectedElements.length && !isMobile) {
|
|
24480
|
-
return t("hints.canvasPanning");
|
|
24967
|
+
return [t("hints.canvasPanning")];
|
|
24481
24968
|
}
|
|
24482
24969
|
if (selectedElements.length === 1) {
|
|
24483
24970
|
if (isLinearElement(selectedElements[0])) {
|
|
@@ -29169,7 +29656,15 @@ var StatsInner = memo5(
|
|
|
29169
29656
|
/* @__PURE__ */ jsx131("div", { children: t("stats.height") }),
|
|
29170
29657
|
/* @__PURE__ */ jsx131("div", { children: round(unCroppedDimension.height, 2) })
|
|
29171
29658
|
] }),
|
|
29172
|
-
/* @__PURE__ */ jsx131(
|
|
29659
|
+
/* @__PURE__ */ jsx131(
|
|
29660
|
+
StatsRow,
|
|
29661
|
+
{
|
|
29662
|
+
heading: true,
|
|
29663
|
+
"data-testid": "stats-element-type",
|
|
29664
|
+
style: { margin: "0.3125rem 0" },
|
|
29665
|
+
children: appState.croppingElementId ? t("labels.imageCropping") : t(`element.${singleElement.type}`)
|
|
29666
|
+
}
|
|
29667
|
+
),
|
|
29173
29668
|
/* @__PURE__ */ jsx131(StatsRow, { children: /* @__PURE__ */ jsx131(
|
|
29174
29669
|
Position_default,
|
|
29175
29670
|
{
|
|
@@ -31400,32 +31895,35 @@ var StaticCanvas = (props) => {
|
|
|
31400
31895
|
});
|
|
31401
31896
|
return /* @__PURE__ */ jsx144("div", { className: "excalidraw__canvas-wrapper", ref: wrapperRef });
|
|
31402
31897
|
};
|
|
31403
|
-
var getRelevantAppStateProps2 = (appState) =>
|
|
31404
|
-
|
|
31405
|
-
|
|
31406
|
-
|
|
31407
|
-
|
|
31408
|
-
|
|
31409
|
-
|
|
31410
|
-
|
|
31411
|
-
|
|
31412
|
-
|
|
31413
|
-
|
|
31414
|
-
|
|
31415
|
-
|
|
31416
|
-
|
|
31417
|
-
|
|
31418
|
-
|
|
31419
|
-
|
|
31420
|
-
|
|
31421
|
-
|
|
31422
|
-
|
|
31423
|
-
|
|
31424
|
-
|
|
31425
|
-
|
|
31426
|
-
|
|
31427
|
-
|
|
31428
|
-
|
|
31898
|
+
var getRelevantAppStateProps2 = (appState) => {
|
|
31899
|
+
const relevantAppStateProps = {
|
|
31900
|
+
zoom: appState.zoom,
|
|
31901
|
+
scrollX: appState.scrollX,
|
|
31902
|
+
scrollY: appState.scrollY,
|
|
31903
|
+
width: appState.width,
|
|
31904
|
+
height: appState.height,
|
|
31905
|
+
viewModeEnabled: appState.viewModeEnabled,
|
|
31906
|
+
openDialog: appState.openDialog,
|
|
31907
|
+
hoveredElementIds: appState.hoveredElementIds,
|
|
31908
|
+
offsetLeft: appState.offsetLeft,
|
|
31909
|
+
offsetTop: appState.offsetTop,
|
|
31910
|
+
theme: appState.theme,
|
|
31911
|
+
pendingImageElementId: appState.pendingImageElementId,
|
|
31912
|
+
shouldCacheIgnoreZoom: appState.shouldCacheIgnoreZoom,
|
|
31913
|
+
viewBackgroundColor: appState.viewBackgroundColor,
|
|
31914
|
+
exportScale: appState.exportScale,
|
|
31915
|
+
selectedElementsAreBeingDragged: appState.selectedElementsAreBeingDragged,
|
|
31916
|
+
gridSize: appState.gridSize,
|
|
31917
|
+
gridStep: appState.gridStep,
|
|
31918
|
+
frameRendering: appState.frameRendering,
|
|
31919
|
+
selectedElementIds: appState.selectedElementIds,
|
|
31920
|
+
frameToHighlight: appState.frameToHighlight,
|
|
31921
|
+
editingGroupId: appState.editingGroupId,
|
|
31922
|
+
currentHoveredFontFamily: appState.currentHoveredFontFamily,
|
|
31923
|
+
croppingElementId: appState.croppingElementId
|
|
31924
|
+
};
|
|
31925
|
+
return relevantAppStateProps;
|
|
31926
|
+
};
|
|
31429
31927
|
var areEqual4 = (prevProps, nextProps) => {
|
|
31430
31928
|
if (prevProps.sceneNonce !== nextProps.sceneNonce || prevProps.scale !== nextProps.scale || // we need to memoize on elementsMap because they may have renewed
|
|
31431
31929
|
// even if sceneNonce didn't change (e.g. we filter elements out based
|
|
@@ -31699,19 +32197,8 @@ var App = class _App extends React43.Component {
|
|
|
31699
32197
|
__publicField(this, "lastViewportPosition", { x: 0, y: 0 });
|
|
31700
32198
|
__publicField(this, "animationFrameHandler", new AnimationFrameHandler());
|
|
31701
32199
|
__publicField(this, "laserTrails", new LaserTrails(this.animationFrameHandler, this));
|
|
31702
|
-
__publicField(this, "eraserTrail", new
|
|
31703
|
-
|
|
31704
|
-
size: 5,
|
|
31705
|
-
keepHead: true,
|
|
31706
|
-
sizeMapping: (c) => {
|
|
31707
|
-
const DECAY_TIME = 200;
|
|
31708
|
-
const DECAY_LENGTH = 10;
|
|
31709
|
-
const t2 = Math.max(0, 1 - (performance.now() - c.pressure) / DECAY_TIME);
|
|
31710
|
-
const l = (DECAY_LENGTH - Math.min(DECAY_LENGTH, c.totalLength - c.currentIndex)) / DECAY_LENGTH;
|
|
31711
|
-
return Math.min(easeOut(l), easeOut(t2));
|
|
31712
|
-
},
|
|
31713
|
-
fill: () => this.state.theme === THEME.LIGHT ? "rgba(0, 0, 0, 0.2)" : "rgba(255, 255, 255, 0.2)"
|
|
31714
|
-
}));
|
|
32200
|
+
__publicField(this, "eraserTrail", new EraserTrail(this.animationFrameHandler, this));
|
|
32201
|
+
__publicField(this, "lassoTrail", new LassoTrail(this.animationFrameHandler, this));
|
|
31715
32202
|
__publicField(this, "onChangeEmitter", new Emitter());
|
|
31716
32203
|
__publicField(this, "onPointerDownEmitter", new Emitter());
|
|
31717
32204
|
__publicField(this, "onPointerUpEmitter", new Emitter());
|
|
@@ -33337,7 +33824,7 @@ var App = class _App extends React43.Component {
|
|
|
33337
33824
|
if (event.key === KEYS.SPACE) {
|
|
33338
33825
|
if (this.state.viewModeEnabled || this.state.openDialog?.name === "elementLinkSelector") {
|
|
33339
33826
|
setCursor(this.interactiveCanvas, CURSOR_TYPE.GRAB);
|
|
33340
|
-
} else if (this.state.activeTool.type === "selection") {
|
|
33827
|
+
} else if (this.state.activeTool.type === "selection" || this.state.activeTool.type === "lasso") {
|
|
33341
33828
|
resetCursor(this.interactiveCanvas);
|
|
33342
33829
|
} else {
|
|
33343
33830
|
setCursorForShape(this.interactiveCanvas, this.state);
|
|
@@ -33421,7 +33908,7 @@ var App = class _App extends React43.Component {
|
|
|
33421
33908
|
__publicField(this, "isToolSupported", (tool) => {
|
|
33422
33909
|
return this.props.UIOptions.tools?.[tool] !== false;
|
|
33423
33910
|
});
|
|
33424
|
-
__publicField(this, "setActiveTool", (tool) => {
|
|
33911
|
+
__publicField(this, "setActiveTool", (tool, keepSelection = false) => {
|
|
33425
33912
|
if (!this.isToolSupported(tool.type)) {
|
|
33426
33913
|
console.warn(
|
|
33427
33914
|
`"${tool.type}" tool is disabled via "UIOptions.canvasActions.tools.${tool.type}"`
|
|
@@ -33457,7 +33944,19 @@ var App = class _App extends React43.Component {
|
|
|
33457
33944
|
if (nextActiveTool.type === "freedraw") {
|
|
33458
33945
|
this.store.shouldCaptureIncrement();
|
|
33459
33946
|
}
|
|
33460
|
-
if (nextActiveTool.type
|
|
33947
|
+
if (nextActiveTool.type === "lasso") {
|
|
33948
|
+
return {
|
|
33949
|
+
...prevState,
|
|
33950
|
+
activeTool: nextActiveTool,
|
|
33951
|
+
...keepSelection ? {} : {
|
|
33952
|
+
selectedElementIds: makeNextSelectedElementIds({}, prevState),
|
|
33953
|
+
selectedGroupIds: makeNextSelectedElementIds({}, prevState),
|
|
33954
|
+
editingGroupId: null,
|
|
33955
|
+
multiElement: null
|
|
33956
|
+
},
|
|
33957
|
+
...commonResets
|
|
33958
|
+
};
|
|
33959
|
+
} else if (nextActiveTool.type !== "selection") {
|
|
33461
33960
|
return {
|
|
33462
33961
|
...prevState,
|
|
33463
33962
|
activeTool: nextActiveTool,
|
|
@@ -33611,7 +34110,7 @@ var App = class _App extends React43.Component {
|
|
|
33611
34110
|
x: sceneX,
|
|
33612
34111
|
y: sceneY
|
|
33613
34112
|
});
|
|
33614
|
-
const element = existingTextElement
|
|
34113
|
+
const element = existingTextElement || newTextElement({
|
|
33615
34114
|
x: parentCenterPosition ? parentCenterPosition.elementCenterX : sceneX,
|
|
33616
34115
|
y: parentCenterPosition ? parentCenterPosition.elementCenterY : sceneY,
|
|
33617
34116
|
strokeColor: this.state.currentItemStrokeColor,
|
|
@@ -33629,7 +34128,7 @@ var App = class _App extends React43.Component {
|
|
|
33629
34128
|
containerId: shouldBindToContainer ? container?.id : void 0,
|
|
33630
34129
|
groupIds: container?.groupIds ?? [],
|
|
33631
34130
|
lineHeight,
|
|
33632
|
-
angle: container
|
|
34131
|
+
angle: container ? isArrowElement(container) ? 0 : container.angle : 0,
|
|
33633
34132
|
frameId: topLayerFrame ? topLayerFrame.id : null
|
|
33634
34133
|
});
|
|
33635
34134
|
if (!existingTextElement && shouldBindToContainer && container) {
|
|
@@ -34247,80 +34746,14 @@ var App = class _App extends React43.Component {
|
|
|
34247
34746
|
}));
|
|
34248
34747
|
}
|
|
34249
34748
|
});
|
|
34250
|
-
__publicField(this, "handleEraser", (event,
|
|
34251
|
-
this.eraserTrail.addPointToPath(
|
|
34252
|
-
|
|
34253
|
-
|
|
34254
|
-
|
|
34255
|
-
const processElements = (elements) => {
|
|
34256
|
-
for (const element of elements) {
|
|
34257
|
-
if (element.locked) {
|
|
34258
|
-
return;
|
|
34259
|
-
}
|
|
34260
|
-
if (event.altKey) {
|
|
34261
|
-
if (this.elementsPendingErasure.delete(element.id)) {
|
|
34262
|
-
didChange = true;
|
|
34263
|
-
}
|
|
34264
|
-
} else if (!this.elementsPendingErasure.has(element.id)) {
|
|
34265
|
-
didChange = true;
|
|
34266
|
-
this.elementsPendingErasure.add(element.id);
|
|
34267
|
-
}
|
|
34268
|
-
if (didChange && element.groupIds?.length) {
|
|
34269
|
-
const shallowestGroupId = element.groupIds.at(-1);
|
|
34270
|
-
if (!processedGroups.has(shallowestGroupId)) {
|
|
34271
|
-
processedGroups.add(shallowestGroupId);
|
|
34272
|
-
const elems = getElementsInGroup(
|
|
34273
|
-
nonDeletedElements,
|
|
34274
|
-
shallowestGroupId
|
|
34275
|
-
);
|
|
34276
|
-
for (const elem of elems) {
|
|
34277
|
-
if (event.altKey) {
|
|
34278
|
-
this.elementsPendingErasure.delete(elem.id);
|
|
34279
|
-
} else {
|
|
34280
|
-
this.elementsPendingErasure.add(elem.id);
|
|
34281
|
-
}
|
|
34282
|
-
}
|
|
34283
|
-
}
|
|
34284
|
-
}
|
|
34285
|
-
}
|
|
34286
|
-
};
|
|
34287
|
-
const distance2 = pointDistance(
|
|
34288
|
-
pointFrom(pointerDownState.lastCoords.x, pointerDownState.lastCoords.y),
|
|
34289
|
-
pointFrom(scenePointer.x, scenePointer.y)
|
|
34749
|
+
__publicField(this, "handleEraser", (event, scenePointer) => {
|
|
34750
|
+
const elementsToErase = this.eraserTrail.addPointToPath(
|
|
34751
|
+
scenePointer.x,
|
|
34752
|
+
scenePointer.y,
|
|
34753
|
+
event.altKey
|
|
34290
34754
|
);
|
|
34291
|
-
|
|
34292
|
-
|
|
34293
|
-
let samplingInterval = 0;
|
|
34294
|
-
while (samplingInterval <= distance2) {
|
|
34295
|
-
const hitElements = this.getElementsAtPosition(p.x, p.y);
|
|
34296
|
-
processElements(hitElements);
|
|
34297
|
-
if (samplingInterval === distance2) {
|
|
34298
|
-
break;
|
|
34299
|
-
}
|
|
34300
|
-
samplingInterval = Math.min(samplingInterval + threshold, distance2);
|
|
34301
|
-
const distanceRatio = samplingInterval / distance2;
|
|
34302
|
-
const nextX = (1 - distanceRatio) * p.x + distanceRatio * scenePointer.x;
|
|
34303
|
-
const nextY = (1 - distanceRatio) * p.y + distanceRatio * scenePointer.y;
|
|
34304
|
-
p.x = nextX;
|
|
34305
|
-
p.y = nextY;
|
|
34306
|
-
}
|
|
34307
|
-
pointerDownState.lastCoords.x = scenePointer.x;
|
|
34308
|
-
pointerDownState.lastCoords.y = scenePointer.y;
|
|
34309
|
-
if (didChange) {
|
|
34310
|
-
for (const element of this.scene.getNonDeletedElements()) {
|
|
34311
|
-
if (isBoundToContainer(element) && (this.elementsPendingErasure.has(element.id) || this.elementsPendingErasure.has(element.containerId))) {
|
|
34312
|
-
if (event.altKey) {
|
|
34313
|
-
this.elementsPendingErasure.delete(element.id);
|
|
34314
|
-
this.elementsPendingErasure.delete(element.containerId);
|
|
34315
|
-
} else {
|
|
34316
|
-
this.elementsPendingErasure.add(element.id);
|
|
34317
|
-
this.elementsPendingErasure.add(element.containerId);
|
|
34318
|
-
}
|
|
34319
|
-
}
|
|
34320
|
-
}
|
|
34321
|
-
this.elementsPendingErasure = new Set(this.elementsPendingErasure);
|
|
34322
|
-
this.triggerRender();
|
|
34323
|
-
}
|
|
34755
|
+
this.elementsPendingErasure = new Set(elementsToErase);
|
|
34756
|
+
this.triggerRender();
|
|
34324
34757
|
});
|
|
34325
34758
|
// set touch moving for mobile context menu
|
|
34326
34759
|
__publicField(this, "handleTouchMove", (event) => {
|
|
@@ -34458,11 +34891,17 @@ var App = class _App extends React43.Component {
|
|
|
34458
34891
|
if (this.handleSelectionOnPointerDown(event, pointerDownState)) {
|
|
34459
34892
|
return;
|
|
34460
34893
|
}
|
|
34461
|
-
const allowOnPointerDown = !this.state.penMode || event.pointerType !== "touch" || this.state.activeTool.type === "selection" || this.state.activeTool.type === "text" || this.state.activeTool.type === "image";
|
|
34894
|
+
const allowOnPointerDown = !this.state.penMode || event.pointerType !== "touch" || this.state.activeTool.type === "selection" || this.state.activeTool.type === "lasso" || this.state.activeTool.type === "text" || this.state.activeTool.type === "image";
|
|
34462
34895
|
if (!allowOnPointerDown) {
|
|
34463
34896
|
return;
|
|
34464
34897
|
}
|
|
34465
|
-
if (this.state.activeTool.type === "
|
|
34898
|
+
if (this.state.activeTool.type === "lasso") {
|
|
34899
|
+
this.lassoTrail.startPath(
|
|
34900
|
+
pointerDownState.origin.x,
|
|
34901
|
+
pointerDownState.origin.y,
|
|
34902
|
+
event.shiftKey
|
|
34903
|
+
);
|
|
34904
|
+
} else if (this.state.activeTool.type === "text") {
|
|
34466
34905
|
this.handleTextOnPointerDown(event, pointerDownState);
|
|
34467
34906
|
} else if (this.state.activeTool.type === "arrow" || this.state.activeTool.type === "line") {
|
|
34468
34907
|
this.handleLinearElementOnPointerDown(
|
|
@@ -34690,7 +35129,7 @@ var App = class _App extends React43.Component {
|
|
|
34690
35129
|
return true;
|
|
34691
35130
|
});
|
|
34692
35131
|
__publicField(this, "clearSelectionIfNotUsingSelection", () => {
|
|
34693
|
-
if (this.state.activeTool.type !== "selection") {
|
|
35132
|
+
if (this.state.activeTool.type !== "selection" && this.state.activeTool.type !== "lasso") {
|
|
34694
35133
|
this.setState({
|
|
34695
35134
|
selectedElementIds: makeNextSelectedElementIds({}, this.state),
|
|
34696
35135
|
selectedGroupIds: {},
|
|
@@ -35899,7 +36338,7 @@ var App = class _App extends React43.Component {
|
|
|
35899
36338
|
width: distance(pointerDownState.origin.x, pointerCoords.x),
|
|
35900
36339
|
height: distance(pointerDownState.origin.y, pointerCoords.y),
|
|
35901
36340
|
shouldMaintainAspectRatio: shouldMaintainAspectRatio(event),
|
|
35902
|
-
shouldResizeFromCenter:
|
|
36341
|
+
shouldResizeFromCenter: false,
|
|
35903
36342
|
zoom: this.state.zoom.value,
|
|
35904
36343
|
informMutation
|
|
35905
36344
|
});
|
|
@@ -36863,7 +37302,11 @@ var App = class _App extends React43.Component {
|
|
|
36863
37302
|
/* @__PURE__ */ jsx147(
|
|
36864
37303
|
SVGLayer,
|
|
36865
37304
|
{
|
|
36866
|
-
trails: [
|
|
37305
|
+
trails: [
|
|
37306
|
+
this.laserTrails,
|
|
37307
|
+
this.lassoTrail,
|
|
37308
|
+
this.eraserTrail
|
|
37309
|
+
]
|
|
36867
37310
|
}
|
|
36868
37311
|
),
|
|
36869
37312
|
selectedElements.length === 1 && this.state.openDialog?.name !== "elementLinkSelector" && this.state.showHyperlinkPopup && /* @__PURE__ */ jsx147(
|
|
@@ -38193,7 +38636,7 @@ var App = class _App extends React43.Component {
|
|
|
38193
38636
|
return;
|
|
38194
38637
|
}
|
|
38195
38638
|
if (isEraserActive(this.state)) {
|
|
38196
|
-
this.handleEraser(event,
|
|
38639
|
+
this.handleEraser(event, pointerCoords);
|
|
38197
38640
|
return;
|
|
38198
38641
|
}
|
|
38199
38642
|
if (this.state.activeTool.type === "laser") {
|
|
@@ -38296,7 +38739,7 @@ var App = class _App extends React43.Component {
|
|
|
38296
38739
|
(element) => this.isASelectedElement(element)
|
|
38297
38740
|
);
|
|
38298
38741
|
const isSelectingPointsInLineEditor = this.state.editingLinearElement && event.shiftKey && this.state.editingLinearElement.elementId === pointerDownState.hit.element?.id;
|
|
38299
|
-
if ((hasHitASelectedElement || pointerDownState.hit.hasHitCommonBoundingBoxOfSelectedElements) && !isSelectingPointsInLineEditor) {
|
|
38742
|
+
if ((hasHitASelectedElement || pointerDownState.hit.hasHitCommonBoundingBoxOfSelectedElements) && !isSelectingPointsInLineEditor && this.state.activeTool.type !== "lasso") {
|
|
38300
38743
|
const selectedElements = this.scene.getSelectedElements(this.state);
|
|
38301
38744
|
if (selectedElements.every((element) => element.locked)) {
|
|
38302
38745
|
return;
|
|
@@ -38445,23 +38888,28 @@ var App = class _App extends React43.Component {
|
|
|
38445
38888
|
includeBoundTextElement: true,
|
|
38446
38889
|
includeElementsInFrames: true
|
|
38447
38890
|
});
|
|
38448
|
-
if (hitElement &&
|
|
38891
|
+
if (hitElement && // hit element may not end up being selected
|
|
38892
|
+
// if we're alt-dragging a common bounding box
|
|
38893
|
+
// over the hit element
|
|
38894
|
+
pointerDownState.hit.wasAddedToSelection && !selectedElements2.find((el) => el.id === hitElement.id)) {
|
|
38449
38895
|
selectedElements2.push(hitElement);
|
|
38450
38896
|
}
|
|
38897
|
+
const idsOfElementsToDuplicate = new Map(
|
|
38898
|
+
selectedElements2.map((el) => [el.id, el])
|
|
38899
|
+
);
|
|
38451
38900
|
const { newElements: clonedElements, elementsWithClones } = duplicateElements({
|
|
38452
38901
|
type: "in-place",
|
|
38453
38902
|
elements,
|
|
38454
38903
|
appState: this.state,
|
|
38455
38904
|
randomizeSeed: true,
|
|
38456
|
-
idsOfElementsToDuplicate
|
|
38457
|
-
selectedElements2.map((el) => [el.id, el])
|
|
38458
|
-
),
|
|
38905
|
+
idsOfElementsToDuplicate,
|
|
38459
38906
|
overrides: (el) => {
|
|
38460
38907
|
const origEl = pointerDownState.originalElements.get(el.id);
|
|
38461
38908
|
if (origEl) {
|
|
38462
38909
|
return {
|
|
38463
38910
|
x: origEl.x,
|
|
38464
|
-
y: origEl.y
|
|
38911
|
+
y: origEl.y,
|
|
38912
|
+
seed: origEl.seed
|
|
38465
38913
|
};
|
|
38466
38914
|
}
|
|
38467
38915
|
return {};
|
|
@@ -38478,7 +38926,14 @@ var App = class _App extends React43.Component {
|
|
|
38478
38926
|
const nextSceneElements = syncMovedIndices(
|
|
38479
38927
|
mappedNewSceneElements || elementsWithClones,
|
|
38480
38928
|
arrayToMap(clonedElements)
|
|
38481
|
-
)
|
|
38929
|
+
).map((el) => {
|
|
38930
|
+
if (idsOfElementsToDuplicate.has(el.id)) {
|
|
38931
|
+
return newElementWith(el, {
|
|
38932
|
+
seed: randomInteger()
|
|
38933
|
+
});
|
|
38934
|
+
}
|
|
38935
|
+
return el;
|
|
38936
|
+
});
|
|
38482
38937
|
this.scene.replaceAllElements(nextSceneElements);
|
|
38483
38938
|
this.maybeCacheVisibleGaps(event, selectedElements2, true);
|
|
38484
38939
|
this.maybeCacheReferenceSnapPoints(event, selectedElements2, true);
|
|
@@ -38489,7 +38944,37 @@ var App = class _App extends React43.Component {
|
|
|
38489
38944
|
if (this.state.selectionElement) {
|
|
38490
38945
|
pointerDownState.lastCoords.x = pointerCoords.x;
|
|
38491
38946
|
pointerDownState.lastCoords.y = pointerCoords.y;
|
|
38492
|
-
|
|
38947
|
+
if (event.altKey) {
|
|
38948
|
+
this.setActiveTool(
|
|
38949
|
+
{ type: "lasso", fromSelection: true },
|
|
38950
|
+
event.shiftKey
|
|
38951
|
+
);
|
|
38952
|
+
this.lassoTrail.startPath(
|
|
38953
|
+
pointerDownState.origin.x,
|
|
38954
|
+
pointerDownState.origin.y,
|
|
38955
|
+
event.shiftKey
|
|
38956
|
+
);
|
|
38957
|
+
this.setAppState({
|
|
38958
|
+
selectionElement: null
|
|
38959
|
+
});
|
|
38960
|
+
} else {
|
|
38961
|
+
this.maybeDragNewGenericElement(pointerDownState, event);
|
|
38962
|
+
}
|
|
38963
|
+
} else if (this.state.activeTool.type === "lasso") {
|
|
38964
|
+
if (!event.altKey && this.state.activeTool.fromSelection) {
|
|
38965
|
+
this.setActiveTool({ type: "selection" });
|
|
38966
|
+
this.createGenericElementOnPointerDown("selection", pointerDownState);
|
|
38967
|
+
pointerDownState.lastCoords.x = pointerCoords.x;
|
|
38968
|
+
pointerDownState.lastCoords.y = pointerCoords.y;
|
|
38969
|
+
this.maybeDragNewGenericElement(pointerDownState, event);
|
|
38970
|
+
this.lassoTrail.endPath();
|
|
38971
|
+
} else {
|
|
38972
|
+
this.lassoTrail.addPointToPath(
|
|
38973
|
+
pointerCoords.x,
|
|
38974
|
+
pointerCoords.y,
|
|
38975
|
+
event.shiftKey
|
|
38976
|
+
);
|
|
38977
|
+
}
|
|
38493
38978
|
} else {
|
|
38494
38979
|
const newElement2 = this.state.newElement;
|
|
38495
38980
|
if (!newElement2) {
|
|
@@ -38687,6 +39172,7 @@ var App = class _App extends React43.Component {
|
|
|
38687
39172
|
snapLines: updateStable(prevState.snapLines, []),
|
|
38688
39173
|
originSnapOffset: null
|
|
38689
39174
|
}));
|
|
39175
|
+
this.lassoTrail.endPath();
|
|
38690
39176
|
this.lastPointerMoveCoords = null;
|
|
38691
39177
|
SnapCache.setReferenceSnapPoints(null);
|
|
38692
39178
|
SnapCache.setVisibleGaps(null);
|
|
@@ -39219,7 +39705,8 @@ var App = class _App extends React43.Component {
|
|
|
39219
39705
|
}
|
|
39220
39706
|
}
|
|
39221
39707
|
if (
|
|
39222
|
-
// not
|
|
39708
|
+
// do not clear selection if lasso is active
|
|
39709
|
+
this.state.activeTool.type !== "lasso" && // not elbow midpoint dragged
|
|
39223
39710
|
!(hitElement && isElbowArrow(hitElement)) && // not dragged
|
|
39224
39711
|
!pointerDownState.drag.hasOccurred && // not resized
|
|
39225
39712
|
!this.state.isResizing && // only hitting the bounding box of the previous hit element
|
|
@@ -39285,7 +39772,8 @@ var App = class _App extends React43.Component {
|
|
|
39285
39772
|
this.laserTrails.endPath();
|
|
39286
39773
|
return;
|
|
39287
39774
|
}
|
|
39288
|
-
if (!activeTool.locked && activeTool.type !== "freedraw"
|
|
39775
|
+
if (!activeTool.locked && activeTool.type !== "freedraw" && (activeTool.type !== "lasso" || // if lasso is turned on but from selection => reset to selection
|
|
39776
|
+
activeTool.type === "lasso" && activeTool.fromSelection)) {
|
|
39289
39777
|
resetCursor(this.interactiveCanvas);
|
|
39290
39778
|
this.setState({
|
|
39291
39779
|
newElement: null,
|