@excalidraw/excalidraw 0.18.0-432a46e → 0.18.0-6fc8502
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dev/{chunk-ZG3EI5XS.js → chunk-H7XJ5UVD.js} +2 -2
- package/dist/dev/{chunk-ZG3EI5XS.js.map → chunk-H7XJ5UVD.js.map} +1 -1
- package/dist/dev/{chunk-S7W4OWSF.js → chunk-KYBDXI6F.js} +417 -120
- package/dist/dev/chunk-KYBDXI6F.js.map +7 -0
- package/dist/dev/{chunk-LMHBUWQS.js → chunk-X3RYHLJU.js} +2 -1
- package/dist/dev/chunk-X3RYHLJU.js.map +7 -0
- package/dist/dev/data/{image-5HAY2PCR.js → image-NKFINVKH.js} +3 -3
- package/dist/dev/index.css +43 -46
- package/dist/dev/index.css.map +2 -2
- package/dist/dev/index.js +508 -99
- package/dist/dev/index.js.map +4 -4
- package/dist/dev/locales/{en-OZCJJ2HN.js → en-CKWC2GMK.js} +2 -2
- package/dist/dev/subset-shared.chunk.js +1 -1
- package/dist/dev/subset-worker.chunk.js +1 -1
- package/dist/prod/chunk-CAN5RS4P.js +31 -0
- package/dist/prod/{chunk-6U3AYISY.js → chunk-IUH5AXLB.js} +1 -1
- package/dist/prod/{chunk-U24AOZ3B.js → chunk-KJYFYP64.js} +1 -1
- package/dist/prod/data/image-5XD47O4X.js +1 -0
- package/dist/prod/index.css +1 -1
- package/dist/prod/index.js +14 -14
- package/dist/prod/locales/{en-B4ZKOASM.js → en-SBO6ZHT2.js} +1 -1
- package/dist/prod/subset-shared.chunk.js +1 -1
- package/dist/prod/subset-worker.chunk.js +1 -1
- package/dist/types/{packages/common → common}/src/colors.d.ts +1 -0
- package/dist/types/{packages/common → common}/src/constants.d.ts +1 -0
- package/dist/types/{packages/common → common}/src/utils.d.ts +1 -0
- package/dist/types/{packages/element → element}/src/binding.d.ts +2 -1
- package/dist/types/{packages/element → element}/src/bounds.d.ts +5 -0
- package/dist/types/{packages/element → element}/src/heading.d.ts +0 -1
- package/dist/types/{packages/excalidraw → excalidraw}/actions/actionAddToLibrary.d.ts +3 -0
- package/dist/types/{packages/excalidraw → excalidraw}/actions/actionBoundText.d.ts +2 -0
- package/dist/types/{packages/excalidraw → excalidraw}/actions/actionCanvas.d.ts +192 -3
- package/dist/types/{packages/excalidraw → excalidraw}/actions/actionClipboard.d.ts +6 -0
- package/dist/types/{packages/excalidraw → excalidraw}/actions/actionCropEditor.d.ts +1 -0
- package/dist/types/{packages/excalidraw → excalidraw}/actions/actionDeleteSelected.d.ts +3 -0
- package/dist/types/{packages/excalidraw → excalidraw}/actions/actionElementLink.d.ts +1 -0
- package/dist/types/{packages/excalidraw → excalidraw}/actions/actionElementLock.d.ts +2 -1
- package/dist/types/{packages/excalidraw → excalidraw}/actions/actionEmbeddable.d.ts +1 -0
- package/dist/types/{packages/excalidraw → excalidraw}/actions/actionExport.d.ts +9 -0
- package/dist/types/{packages/excalidraw → excalidraw}/actions/actionFinalize.d.ts +2 -0
- package/dist/types/{packages/excalidraw → excalidraw}/actions/actionFrame.d.ts +4 -0
- package/dist/types/{packages/excalidraw → excalidraw}/actions/actionGroup.d.ts +2 -0
- package/dist/types/{packages/excalidraw → excalidraw}/actions/actionLinearEditor.d.ts +1 -0
- package/dist/types/{packages/excalidraw → excalidraw}/actions/actionLink.d.ts +1 -0
- package/dist/types/{packages/excalidraw → excalidraw}/actions/actionMenu.d.ts +3 -0
- package/dist/types/{packages/excalidraw → excalidraw}/actions/actionNavigate.d.ts +2 -0
- package/dist/types/{packages/excalidraw → excalidraw}/actions/actionProperties.d.ts +15 -0
- package/dist/types/{packages/excalidraw → excalidraw}/actions/actionSelectAll.d.ts +1 -0
- package/dist/types/{packages/excalidraw → excalidraw}/actions/actionStyles.d.ts +1 -0
- package/dist/types/{packages/excalidraw → excalidraw}/actions/actionToggleGridMode.d.ts +1 -0
- package/dist/types/{packages/excalidraw → excalidraw}/actions/actionToggleObjectsSnapMode.d.ts +1 -0
- package/dist/types/{packages/excalidraw → excalidraw}/actions/actionToggleSearchMenu.d.ts +2 -0
- package/dist/types/{packages/excalidraw → excalidraw}/actions/actionToggleStats.d.ts +1 -1
- package/dist/types/{packages/excalidraw → excalidraw}/actions/actionToggleViewMode.d.ts +1 -1
- package/dist/types/{packages/excalidraw → excalidraw}/actions/actionToggleZenMode.d.ts +1 -1
- package/dist/types/{packages/excalidraw → excalidraw}/actions/types.d.ts +1 -1
- package/dist/types/{packages/excalidraw → excalidraw}/animated-trail.d.ts +7 -1
- package/dist/types/{packages/excalidraw → excalidraw}/appState.d.ts +1 -0
- package/dist/types/{packages/excalidraw → excalidraw}/components/App.d.ts +6 -1
- package/dist/types/excalidraw/components/ColorPicker/HotkeyLabel.d.ts +7 -0
- package/dist/types/{packages/excalidraw → excalidraw}/components/ColorPicker/colorPickerUtils.d.ts +1 -1
- package/dist/types/{packages/excalidraw → excalidraw}/components/icons.d.ts +1 -0
- package/dist/types/excalidraw/lasso/index.d.ts +15 -0
- package/dist/types/excalidraw/lasso/utils.d.ts +13 -0
- package/dist/types/{packages/excalidraw → excalidraw}/types.d.ts +2 -1
- package/dist/types/{packages/math → math}/src/polygon.d.ts +1 -0
- package/dist/types/{packages/math → math}/src/segment.d.ts +1 -1
- package/package.json +19 -2
- package/dist/dev/chunk-LMHBUWQS.js.map +0 -7
- package/dist/dev/chunk-S7W4OWSF.js.map +0 -7
- package/dist/prod/chunk-LRITYP5X.js +0 -31
- package/dist/prod/data/image-W3GRS73V.js +0 -1
- package/dist/types/excalidraw-app/app_constants.d.ts +0 -44
- package/dist/types/packages/excalidraw/components/ColorPicker/HotkeyLabel.d.ts +0 -8
- package/dist/types/packages/excalidraw/tests/fixtures/diagramFixture.d.ts +0 -504
- package/dist/types/packages/excalidraw/tests/fixtures/elementFixture.d.ts +0 -7
- package/dist/types/packages/excalidraw/tests/helpers/api.d.ts +0 -89
- package/dist/types/packages/excalidraw/tests/helpers/colorize.d.ts +0 -2
- package/dist/types/packages/excalidraw/tests/helpers/mocks.d.ts +0 -5
- package/dist/types/packages/excalidraw/tests/helpers/polyfills.d.ts +0 -36
- package/dist/types/packages/excalidraw/tests/helpers/ui.d.ts +0 -189
- package/dist/types/packages/excalidraw/tests/queries/dom.d.ts +0 -2
- package/dist/types/packages/excalidraw/tests/queries/toolQueries.d.ts +0 -2
- package/dist/types/packages/excalidraw/tests/test-utils.d.ts +0 -139
- /package/dist/dev/data/{image-5HAY2PCR.js.map → image-NKFINVKH.js.map} +0 -0
- /package/dist/dev/locales/{en-OZCJJ2HN.js.map → en-CKWC2GMK.js.map} +0 -0
- /package/dist/types/{packages/common → common}/src/binary-heap.d.ts +0 -0
- /package/dist/types/{packages/common → common}/src/font-metadata.d.ts +0 -0
- /package/dist/types/{packages/common → common}/src/index.d.ts +0 -0
- /package/dist/types/{packages/common → common}/src/keys.d.ts +0 -0
- /package/dist/types/{packages/common → common}/src/points.d.ts +0 -0
- /package/dist/types/{packages/common → common}/src/promise-pool.d.ts +0 -0
- /package/dist/types/{packages/common → common}/src/queue.d.ts +0 -0
- /package/dist/types/{packages/common → common}/src/random.d.ts +0 -0
- /package/dist/types/{packages/common → common}/src/url.d.ts +0 -0
- /package/dist/types/{packages/common → common}/src/utility-types.d.ts +0 -0
- /package/dist/types/{packages/element → element}/src/Shape.d.ts +0 -0
- /package/dist/types/{packages/element → element}/src/ShapeCache.d.ts +0 -0
- /package/dist/types/{packages/element → element}/src/align.d.ts +0 -0
- /package/dist/types/{packages/element → element}/src/collision.d.ts +0 -0
- /package/dist/types/{packages/element → element}/src/comparisons.d.ts +0 -0
- /package/dist/types/{packages/element → element}/src/containerCache.d.ts +0 -0
- /package/dist/types/{packages/element → element}/src/cropElement.d.ts +0 -0
- /package/dist/types/{packages/element → element}/src/distance.d.ts +0 -0
- /package/dist/types/{packages/element → element}/src/distribute.d.ts +0 -0
- /package/dist/types/{packages/element → element}/src/dragElements.d.ts +0 -0
- /package/dist/types/{packages/element → element}/src/duplicate.d.ts +0 -0
- /package/dist/types/{packages/element → element}/src/elbowArrow.d.ts +0 -0
- /package/dist/types/{packages/element → element}/src/elementLink.d.ts +0 -0
- /package/dist/types/{packages/element → element}/src/embeddable.d.ts +0 -0
- /package/dist/types/{packages/element → element}/src/flowchart.d.ts +0 -0
- /package/dist/types/{packages/element → element}/src/fractionalIndex.d.ts +0 -0
- /package/dist/types/{packages/element → element}/src/frame.d.ts +0 -0
- /package/dist/types/{packages/element → element}/src/groups.d.ts +0 -0
- /package/dist/types/{packages/element → element}/src/image.d.ts +0 -0
- /package/dist/types/{packages/element → element}/src/index.d.ts +0 -0
- /package/dist/types/{packages/element → element}/src/linearElementEditor.d.ts +0 -0
- /package/dist/types/{packages/element → element}/src/mutateElement.d.ts +0 -0
- /package/dist/types/{packages/element → element}/src/newElement.d.ts +0 -0
- /package/dist/types/{packages/element → element}/src/renderElement.d.ts +0 -0
- /package/dist/types/{packages/element → element}/src/resizeElements.d.ts +0 -0
- /package/dist/types/{packages/element → element}/src/resizeTest.d.ts +0 -0
- /package/dist/types/{packages/element → element}/src/selection.d.ts +0 -0
- /package/dist/types/{packages/element → element}/src/shapes.d.ts +0 -0
- /package/dist/types/{packages/element → element}/src/showSelectedShapeActions.d.ts +0 -0
- /package/dist/types/{packages/element → element}/src/sizeHelpers.d.ts +0 -0
- /package/dist/types/{packages/element → element}/src/sortElements.d.ts +0 -0
- /package/dist/types/{packages/element → element}/src/textElement.d.ts +0 -0
- /package/dist/types/{packages/element → element}/src/textMeasurements.d.ts +0 -0
- /package/dist/types/{packages/element → element}/src/textWrapping.d.ts +0 -0
- /package/dist/types/{packages/element → element}/src/transformHandles.d.ts +0 -0
- /package/dist/types/{packages/element → element}/src/typeChecks.d.ts +0 -0
- /package/dist/types/{packages/element → element}/src/types.d.ts +0 -0
- /package/dist/types/{packages/element → element}/src/utils.d.ts +0 -0
- /package/dist/types/{packages/element → element}/src/zindex.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/actions/actionAlign.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/actions/actionDistribute.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/actions/actionDuplicateSelection.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/actions/actionFlip.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/actions/actionHistory.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/actions/actionTextAutoResize.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/actions/actionZindex.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/actions/index.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/actions/manager.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/actions/register.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/actions/shortcuts.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/analytics.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/animation-frame-handler.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/change.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/charts.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/clients.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/clipboard.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/Actions.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/ActiveConfirmDialog.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/Avatar.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/BraveMeasureTextError.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/Button.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/ButtonIcon.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/ButtonIconCycle.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/ButtonIconSelect.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/ButtonSelect.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/ButtonSeparator.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/Card.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/CheckboxItem.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/ColorPicker/ColorInput.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/ColorPicker/ColorPicker.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/ColorPicker/CustomColorList.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/ColorPicker/Picker.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/ColorPicker/PickerColorList.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/ColorPicker/PickerHeading.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/ColorPicker/ShadeList.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/ColorPicker/TopPicks.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/ColorPicker/keyboardNavHandlers.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/CommandPalette/CommandPalette.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/CommandPalette/defaultCommandPaletteItems.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/CommandPalette/types.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/ConfirmDialog.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/ContextMenu.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/DarkModeToggle.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/DefaultSidebar.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/DiagramToCodePlugin/DiagramToCodePlugin.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/Dialog.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/DialogActionButton.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/ElementCanvasButtons.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/ElementLinkDialog.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/ErrorDialog.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/ExcalidrawLogo.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/EyeDropper.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/FilledButton.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/FixedSideContainer.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/FollowMode/FollowMode.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/FontPicker/FontPicker.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/FontPicker/FontPickerList.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/FontPicker/FontPickerTrigger.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/FontPicker/keyboardNavHandlers.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/HandButton.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/HelpButton.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/HelpDialog.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/HintViewer.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/IconPicker.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/ImageExportDialog.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/InitializeApp.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/InlineIcon.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/Island.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/JSONExportDialog.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/LaserPointerButton.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/LayerUI.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/LibraryMenu.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/LibraryMenuBrowseButton.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/LibraryMenuControlButtons.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/LibraryMenuHeaderContent.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/LibraryMenuItems.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/LibraryMenuSection.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/LibraryUnit.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/LoadingMessage.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/LockButton.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/MagicButton.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/MobileMenu.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/Modal.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/OverwriteConfirm/OverwriteConfirm.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/OverwriteConfirm/OverwriteConfirmActions.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/OverwriteConfirm/OverwriteConfirmState.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/Paragraph.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/PasteChartDialog.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/PenModeButton.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/Popover.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/ProjectName.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/PropertiesPopover.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/PublishLibrary.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/QuickSearch.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/RadioGroup.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/Range.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/SVGLayer.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/ScrollableList.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/SearchMenu.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/Section.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/ShareableLinkDialog.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/Sidebar/Sidebar.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/Sidebar/SidebarHeader.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/Sidebar/SidebarTab.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/Sidebar/SidebarTabTrigger.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/Sidebar/SidebarTabTriggers.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/Sidebar/SidebarTabs.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/Sidebar/SidebarTrigger.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/Sidebar/common.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/Spinner.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/Stack.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/Stats/Angle.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/Stats/CanvasGrid.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/Stats/Collapsible.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/Stats/Dimension.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/Stats/DragInput.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/Stats/FontSize.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/Stats/MultiAngle.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/Stats/MultiDimension.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/Stats/MultiFontSize.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/Stats/MultiPosition.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/Stats/Position.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/Stats/index.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/Stats/utils.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/Switch.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/TTDDialog/MermaidToExcalidraw.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/TTDDialog/TTDDialog.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/TTDDialog/TTDDialogInput.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/TTDDialog/TTDDialogOutput.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/TTDDialog/TTDDialogPanel.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/TTDDialog/TTDDialogPanels.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/TTDDialog/TTDDialogSubmitShortcut.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/TTDDialog/TTDDialogTab.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/TTDDialog/TTDDialogTabTrigger.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/TTDDialog/TTDDialogTabTriggers.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/TTDDialog/TTDDialogTabs.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/TTDDialog/TTDDialogTrigger.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/TTDDialog/common.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/TextField.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/Toast.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/ToolButton.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/Tooltip.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/Trans.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/UserList.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/canvases/InteractiveCanvas.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/canvases/NewElementCanvas.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/canvases/StaticCanvas.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/canvases/index.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/dropdownMenu/DropdownMenu.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/dropdownMenu/DropdownMenuContent.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/dropdownMenu/DropdownMenuGroup.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/dropdownMenu/DropdownMenuItem.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/dropdownMenu/DropdownMenuItemContent.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/dropdownMenu/DropdownMenuItemContentRadio.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/dropdownMenu/DropdownMenuItemCustom.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/dropdownMenu/DropdownMenuItemLink.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/dropdownMenu/DropdownMenuSeparator.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/dropdownMenu/DropdownMenuTrigger.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/dropdownMenu/common.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/dropdownMenu/dropdownMenuUtils.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/footer/Footer.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/footer/FooterCenter.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/hoc/withInternalFallback.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/hyperlink/Hyperlink.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/hyperlink/helpers.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/live-collaboration/LiveCollaborationTrigger.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/main-menu/DefaultItems.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/main-menu/MainMenu.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/shapes.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/welcome-screen/WelcomeScreen.Center.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/welcome-screen/WelcomeScreen.Hints.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/components/welcome-screen/WelcomeScreen.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/context/tunnels.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/context/ui-appState.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/cursor.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/data/EditorLocalStorage.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/data/ai/types.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/data/blob.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/data/encode.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/data/encryption.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/data/filesystem.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/data/image.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/data/index.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/data/json.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/data/library.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/data/reconcile.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/data/resave.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/data/restore.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/data/transform.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/data/types.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/deburr.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/editor-jotai.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/emitter.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/errors.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/fonts/Cascadia/index.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/fonts/ComicShanns/index.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/fonts/Emoji/index.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/fonts/ExcalidrawFontFace.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/fonts/Excalifont/index.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/fonts/Fonts.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/fonts/Helvetica/index.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/fonts/Liberation/index.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/fonts/Lilita/index.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/fonts/Nunito/index.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/fonts/Virgil/index.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/fonts/Xiaolai/index.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/fonts/index.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/gesture.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/history.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/hooks/useCallbackRefState.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/hooks/useCopiedIndicator.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/hooks/useCreatePortalContainer.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/hooks/useEmitter.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/hooks/useLibraryItemSvg.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/hooks/useOutsideClick.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/hooks/useScrollPosition.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/hooks/useStable.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/hooks/useStableCallback.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/hooks/useTransition.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/i18n.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/index-node.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/index.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/laser-trails.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/mermaid.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/polyfill.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/reactUtils.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/renderer/helpers.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/renderer/interactiveScene.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/renderer/renderNewElementScene.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/renderer/renderSnaps.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/renderer/roundRect.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/renderer/staticScene.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/renderer/staticSvgScene.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/scene/Renderer.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/scene/Scene.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/scene/export.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/scene/index.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/scene/normalize.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/scene/scroll.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/scene/scrollbars.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/scene/types.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/scene/zoom.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/snapping.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/store.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/subset/harfbuzz/harfbuzz-bindings.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/subset/harfbuzz/harfbuzz-loader.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/subset/harfbuzz/harfbuzz-wasm.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/subset/subset-main.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/subset/subset-shared.chunk.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/subset/subset-worker.chunk.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/subset/woff2/woff2-bindings.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/subset/woff2/woff2-loader.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/subset/woff2/woff2-wasm.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/visualdebug.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/workers.d.ts +0 -0
- /package/dist/types/{packages/excalidraw → excalidraw}/wysiwyg/textWysiwyg.d.ts +0 -0
- /package/dist/types/{packages/math → math}/src/angle.d.ts +0 -0
- /package/dist/types/{packages/math → math}/src/curve.d.ts +0 -0
- /package/dist/types/{packages/math → math}/src/ellipse.d.ts +0 -0
- /package/dist/types/{packages/math → math}/src/index.d.ts +0 -0
- /package/dist/types/{packages/math → math}/src/line.d.ts +0 -0
- /package/dist/types/{packages/math → math}/src/point.d.ts +0 -0
- /package/dist/types/{packages/math → math}/src/range.d.ts +0 -0
- /package/dist/types/{packages/math → math}/src/rectangle.d.ts +0 -0
- /package/dist/types/{packages/math → math}/src/triangle.d.ts +0 -0
- /package/dist/types/{packages/math → math}/src/types.d.ts +0 -0
- /package/dist/types/{packages/math → math}/src/utils.d.ts +0 -0
- /package/dist/types/{packages/math → math}/src/vector.d.ts +0 -0
- /package/dist/types/{packages/utils → utils}/src/bbox.d.ts +0 -0
- /package/dist/types/{packages/utils → utils}/src/collision.d.ts +0 -0
- /package/dist/types/{packages/utils → utils}/src/export.d.ts +0 -0
- /package/dist/types/{packages/utils → utils}/src/index.d.ts +0 -0
- /package/dist/types/{packages/utils → utils}/src/shape.d.ts +0 -0
- /package/dist/types/{packages/utils → utils}/src/withinBounds.d.ts +0 -0
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,
|
|
@@ -169,7 +170,8 @@ import {
|
|
|
169
170
|
findIndex,
|
|
170
171
|
findLastIndex,
|
|
171
172
|
fixBindingsAfterDeletion,
|
|
172
|
-
|
|
173
|
+
fixDuplicatedBindingsAfterDuplication,
|
|
174
|
+
fixReversedBindings,
|
|
173
175
|
focusNearestParent,
|
|
174
176
|
frameAndChildrenSelectedTogether,
|
|
175
177
|
generateIdFromFile,
|
|
@@ -197,6 +199,7 @@ import {
|
|
|
197
199
|
getDraggedElementsBounds,
|
|
198
200
|
getElementAbsoluteCoords,
|
|
199
201
|
getElementBounds,
|
|
202
|
+
getElementLineSegments,
|
|
200
203
|
getElementShape,
|
|
201
204
|
getElementsInGroup,
|
|
202
205
|
getElementsInNewFrame,
|
|
@@ -340,6 +343,8 @@ import {
|
|
|
340
343
|
isValidTextContainer,
|
|
341
344
|
isWindows,
|
|
342
345
|
isWritableElement,
|
|
346
|
+
lineSegment,
|
|
347
|
+
lineSegmentIntersectionPoints,
|
|
343
348
|
loadFromBlob,
|
|
344
349
|
loadFromJSON,
|
|
345
350
|
loadHTMLImageElement,
|
|
@@ -382,6 +387,8 @@ import {
|
|
|
382
387
|
pointFromPair,
|
|
383
388
|
pointOnLineSegment,
|
|
384
389
|
pointRotateRads,
|
|
390
|
+
polygonFromPoints,
|
|
391
|
+
polygonIncludesPointNonZero,
|
|
385
392
|
preventUnload,
|
|
386
393
|
promiseTry,
|
|
387
394
|
queryFocusableElements,
|
|
@@ -453,13 +460,13 @@ import {
|
|
|
453
460
|
viewportCoordsToSceneCoords,
|
|
454
461
|
wrapEvent,
|
|
455
462
|
wrapText
|
|
456
|
-
} from "./chunk-
|
|
463
|
+
} from "./chunk-KYBDXI6F.js";
|
|
457
464
|
import {
|
|
458
465
|
define_import_meta_env_default
|
|
459
|
-
} from "./chunk-
|
|
466
|
+
} from "./chunk-H7XJ5UVD.js";
|
|
460
467
|
import {
|
|
461
468
|
en_default
|
|
462
|
-
} from "./chunk-
|
|
469
|
+
} from "./chunk-X3RYHLJU.js";
|
|
463
470
|
import {
|
|
464
471
|
percentages_default
|
|
465
472
|
} from "./chunk-MFAYKRVR.js";
|
|
@@ -734,11 +741,18 @@ var duplicateElements = (opts) => {
|
|
|
734
741
|
copyElements(element)
|
|
735
742
|
);
|
|
736
743
|
}
|
|
737
|
-
|
|
744
|
+
fixDuplicatedBindingsAfterDuplication(
|
|
738
745
|
newElements,
|
|
739
746
|
oldIdToDuplicatedId,
|
|
740
747
|
duplicatedElementsMap
|
|
741
748
|
);
|
|
749
|
+
if (reverseOrder) {
|
|
750
|
+
fixReversedBindings(
|
|
751
|
+
_idsOfElementsToDuplicate,
|
|
752
|
+
elementsWithClones,
|
|
753
|
+
oldIdToDuplicatedId
|
|
754
|
+
);
|
|
755
|
+
}
|
|
742
756
|
bindElementsToFramesAfterDuplication(
|
|
743
757
|
elementsWithClones,
|
|
744
758
|
oldElements,
|
|
@@ -2887,7 +2901,7 @@ var globImport_locales_json = __glob({
|
|
|
2887
2901
|
"./locales/da-DK.json": () => import("./locales/da-DK-N76F4QAJ.js"),
|
|
2888
2902
|
"./locales/de-DE.json": () => import("./locales/de-DE-DMRXZ2SZ.js"),
|
|
2889
2903
|
"./locales/el-GR.json": () => import("./locales/el-GR-HIKPLEXI.js"),
|
|
2890
|
-
"./locales/en.json": () => import("./locales/en-
|
|
2904
|
+
"./locales/en.json": () => import("./locales/en-CKWC2GMK.js"),
|
|
2891
2905
|
"./locales/es-ES.json": () => import("./locales/es-ES-AQYVXC32.js"),
|
|
2892
2906
|
"./locales/eu-ES.json": () => import("./locales/eu-ES-3TOEU5DE.js"),
|
|
2893
2907
|
"./locales/fa-IR.json": () => import("./locales/fa-IR-527GAKUP.js"),
|
|
@@ -4601,6 +4615,23 @@ var SelectionIcon = createIcon(
|
|
|
4601
4615
|
] }),
|
|
4602
4616
|
{ fill: "none", width: 22, height: 22, strokeWidth: 1.25 }
|
|
4603
4617
|
);
|
|
4618
|
+
var LassoIcon = createIcon(
|
|
4619
|
+
/* @__PURE__ */ jsxs(
|
|
4620
|
+
"g",
|
|
4621
|
+
{
|
|
4622
|
+
stroke: "currentColor",
|
|
4623
|
+
strokeLinecap: "round",
|
|
4624
|
+
strokeLinejoin: "round",
|
|
4625
|
+
strokeWidth: 1.5,
|
|
4626
|
+
children: [
|
|
4627
|
+
/* @__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" }),
|
|
4628
|
+
/* @__PURE__ */ jsx("path", { d: "M5 15m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0" }),
|
|
4629
|
+
/* @__PURE__ */ jsx("path", { d: "M5 17c0 1.42 .316 2.805 1 4" })
|
|
4630
|
+
]
|
|
4631
|
+
}
|
|
4632
|
+
),
|
|
4633
|
+
{ fill: "none", width: 22, height: 22, strokeWidth: 1.25 }
|
|
4634
|
+
);
|
|
4604
4635
|
var RectangleIcon = createIcon(
|
|
4605
4636
|
/* @__PURE__ */ jsxs("g", { strokeWidth: "1.5", children: [
|
|
4606
4637
|
/* @__PURE__ */ jsx("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }),
|
|
@@ -4713,7 +4744,7 @@ var TrashIcon = createIcon(
|
|
|
4713
4744
|
modifiedTablerIconProps
|
|
4714
4745
|
);
|
|
4715
4746
|
var EmbedIcon = createIcon(
|
|
4716
|
-
/* @__PURE__ */ jsxs("g", { strokeWidth: "1.
|
|
4747
|
+
/* @__PURE__ */ jsxs("g", { strokeWidth: "1.5", children: [
|
|
4717
4748
|
/* @__PURE__ */ jsx("polyline", { points: "12 16 18 10 12 4" }),
|
|
4718
4749
|
/* @__PURE__ */ jsx("polyline", { points: "8 4 2 10 8 16" })
|
|
4719
4750
|
] }),
|
|
@@ -7984,27 +8015,38 @@ var getMostUsedCustomColors = (elements, type, palette2) => {
|
|
|
7984
8015
|
var activeColorPickerSectionAtom = atom(null);
|
|
7985
8016
|
var calculateContrast = (r, g, b) => {
|
|
7986
8017
|
const yiq = (r * 299 + g * 587 + b * 114) / 1e3;
|
|
7987
|
-
return yiq
|
|
7988
|
-
};
|
|
7989
|
-
var
|
|
7990
|
-
if (
|
|
7991
|
-
|
|
7992
|
-
|
|
7993
|
-
|
|
7994
|
-
|
|
8018
|
+
return yiq;
|
|
8019
|
+
};
|
|
8020
|
+
var isColorDark = (color, threshold = 160) => {
|
|
8021
|
+
if (!color) {
|
|
8022
|
+
return true;
|
|
8023
|
+
}
|
|
8024
|
+
if (color === "transparent") {
|
|
8025
|
+
return false;
|
|
8026
|
+
}
|
|
8027
|
+
if (!color.startsWith("#")) {
|
|
8028
|
+
const node = document.createElement("div");
|
|
8029
|
+
node.style.color = color;
|
|
8030
|
+
if (node.style.color) {
|
|
8031
|
+
node.style.position = "absolute";
|
|
8032
|
+
node.style.visibility = "hidden";
|
|
8033
|
+
node.style.width = "0";
|
|
8034
|
+
node.style.height = "0";
|
|
8035
|
+
document.body.appendChild(node);
|
|
8036
|
+
const computedColor = getComputedStyle(node).color;
|
|
8037
|
+
document.body.removeChild(node);
|
|
8038
|
+
const rgb = computedColor.replace(/^(rgb|rgba)\(/, "").replace(/\)$/, "").replace(/\s/g, "").split(",");
|
|
7995
8039
|
const r2 = parseInt(rgb[0]);
|
|
7996
8040
|
const g2 = parseInt(rgb[1]);
|
|
7997
8041
|
const b2 = parseInt(rgb[2]);
|
|
7998
|
-
return calculateContrast(r2, g2, b2);
|
|
8042
|
+
return calculateContrast(r2, g2, b2) < threshold;
|
|
7999
8043
|
}
|
|
8044
|
+
return true;
|
|
8000
8045
|
}
|
|
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);
|
|
8046
|
+
const r = parseInt(color.slice(1, 3), 16);
|
|
8047
|
+
const g = parseInt(color.slice(3, 5), 16);
|
|
8048
|
+
const b = parseInt(color.slice(5, 7), 16);
|
|
8049
|
+
return calculateContrast(r, g, b) < threshold;
|
|
8008
8050
|
};
|
|
8009
8051
|
|
|
8010
8052
|
// components/ColorPicker/ColorInput.tsx
|
|
@@ -8123,7 +8165,6 @@ import { jsxs as jsxs6 } from "react/jsx-runtime";
|
|
|
8123
8165
|
var HotkeyLabel = ({
|
|
8124
8166
|
color,
|
|
8125
8167
|
keyLabel,
|
|
8126
|
-
isCustomColor: isCustomColor2 = false,
|
|
8127
8168
|
isShade = false
|
|
8128
8169
|
}) => {
|
|
8129
8170
|
return /* @__PURE__ */ jsxs6(
|
|
@@ -8131,7 +8172,7 @@ var HotkeyLabel = ({
|
|
|
8131
8172
|
{
|
|
8132
8173
|
className: "color-picker__button__hotkey-label",
|
|
8133
8174
|
style: {
|
|
8134
|
-
color:
|
|
8175
|
+
color: isColorDark(color) ? "#fff" : "#000"
|
|
8135
8176
|
},
|
|
8136
8177
|
children: [
|
|
8137
8178
|
isShade && "\u21E7",
|
|
@@ -8167,7 +8208,7 @@ var CustomColorList = ({
|
|
|
8167
8208
|
tabIndex: -1,
|
|
8168
8209
|
type: "button",
|
|
8169
8210
|
className: clsx8(
|
|
8170
|
-
"color-picker__button color-picker__button--large",
|
|
8211
|
+
"color-picker__button color-picker__button--large has-outline",
|
|
8171
8212
|
{
|
|
8172
8213
|
active: color === c,
|
|
8173
8214
|
"is-transparent": c === "transparent" || !c
|
|
@@ -8182,7 +8223,7 @@ var CustomColorList = ({
|
|
|
8182
8223
|
style: { "--swatch-color": c },
|
|
8183
8224
|
children: [
|
|
8184
8225
|
/* @__PURE__ */ jsx14("div", { className: "color-picker__button-outline" }),
|
|
8185
|
-
/* @__PURE__ */ jsx14(HotkeyLabel_default, { color: c, keyLabel: i + 1
|
|
8226
|
+
/* @__PURE__ */ jsx14(HotkeyLabel_default, { color: c, keyLabel: i + 1 })
|
|
8186
8227
|
]
|
|
8187
8228
|
},
|
|
8188
8229
|
i
|
|
@@ -8229,7 +8270,7 @@ var PickerColorList = ({
|
|
|
8229
8270
|
tabIndex: -1,
|
|
8230
8271
|
type: "button",
|
|
8231
8272
|
className: clsx9(
|
|
8232
|
-
"color-picker__button color-picker__button--large",
|
|
8273
|
+
"color-picker__button color-picker__button--large has-outline",
|
|
8233
8274
|
{
|
|
8234
8275
|
active: colorObj?.colorName === key,
|
|
8235
8276
|
"is-transparent": color2 === "transparent" || !color2
|
|
@@ -8288,7 +8329,7 @@ var ShadeList = ({ hex, onChange, palette: palette2 }) => {
|
|
|
8288
8329
|
tabIndex: -1,
|
|
8289
8330
|
type: "button",
|
|
8290
8331
|
className: clsx10(
|
|
8291
|
-
"color-picker__button color-picker__button--large",
|
|
8332
|
+
"color-picker__button color-picker__button--large has-outline",
|
|
8292
8333
|
{ active: i === shade }
|
|
8293
8334
|
),
|
|
8294
8335
|
"aria-label": "Shade",
|
|
@@ -8683,7 +8724,11 @@ var TopPicks = ({
|
|
|
8683
8724
|
{
|
|
8684
8725
|
className: clsx11("color-picker__button", {
|
|
8685
8726
|
active: color === activeColor,
|
|
8686
|
-
"is-transparent": color === "transparent" || !color
|
|
8727
|
+
"is-transparent": color === "transparent" || !color,
|
|
8728
|
+
"has-outline": !isColorDark(
|
|
8729
|
+
color,
|
|
8730
|
+
COLOR_OUTLINE_CONTRAST_THRESHOLD
|
|
8731
|
+
)
|
|
8687
8732
|
}),
|
|
8688
8733
|
style: { "--swatch-color": color },
|
|
8689
8734
|
type: "button",
|
|
@@ -8810,7 +8855,8 @@ var ColorPickerTrigger = ({
|
|
|
8810
8855
|
{
|
|
8811
8856
|
type: "button",
|
|
8812
8857
|
className: clsx12("color-picker__button active-color properties-trigger", {
|
|
8813
|
-
"is-transparent": color === "transparent" || !color
|
|
8858
|
+
"is-transparent": color === "transparent" || !color,
|
|
8859
|
+
"has-outline": !isColorDark(color, COLOR_OUTLINE_CONTRAST_THRESHOLD)
|
|
8814
8860
|
}),
|
|
8815
8861
|
"aria-label": label,
|
|
8816
8862
|
style: color ? { "--swatch-color": color } : void 0,
|
|
@@ -11284,7 +11330,6 @@ import { jsx as jsx35, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
|
11284
11330
|
var actionChangeViewBackgroundColor = register({
|
|
11285
11331
|
name: "changeViewBackgroundColor",
|
|
11286
11332
|
label: "labels.canvasBackground",
|
|
11287
|
-
paletteName: "Change canvas background color",
|
|
11288
11333
|
trackEvent: false,
|
|
11289
11334
|
predicate: (elements, appState, props, app) => {
|
|
11290
11335
|
return !!app.props.UIOptions.canvasActions.changeViewBackgroundColor && !appState.viewModeEnabled;
|
|
@@ -11316,7 +11361,6 @@ var actionChangeViewBackgroundColor = register({
|
|
|
11316
11361
|
var actionClearCanvas = register({
|
|
11317
11362
|
name: "clearCanvas",
|
|
11318
11363
|
label: "labels.clearCanvas",
|
|
11319
|
-
paletteName: "Clear canvas",
|
|
11320
11364
|
icon: TrashIcon,
|
|
11321
11365
|
trackEvent: { category: "canvas" },
|
|
11322
11366
|
predicate: (elements, appState, props, app) => {
|
|
@@ -11668,10 +11712,39 @@ var actionToggleEraserTool = register({
|
|
|
11668
11712
|
},
|
|
11669
11713
|
keyTest: (event) => event.key === KEYS.E
|
|
11670
11714
|
});
|
|
11715
|
+
var actionToggleLassoTool = register({
|
|
11716
|
+
name: "toggleLassoTool",
|
|
11717
|
+
label: "toolBar.lasso",
|
|
11718
|
+
icon: LassoIcon,
|
|
11719
|
+
trackEvent: { category: "toolbar" },
|
|
11720
|
+
perform: (elements, appState, _, app) => {
|
|
11721
|
+
let activeTool;
|
|
11722
|
+
if (appState.activeTool.type !== "lasso") {
|
|
11723
|
+
activeTool = updateActiveTool(appState, {
|
|
11724
|
+
type: "lasso",
|
|
11725
|
+
fromSelection: false
|
|
11726
|
+
});
|
|
11727
|
+
setCursor(app.interactiveCanvas, CURSOR_TYPE.CROSSHAIR);
|
|
11728
|
+
} else {
|
|
11729
|
+
activeTool = updateActiveTool(appState, {
|
|
11730
|
+
type: "selection"
|
|
11731
|
+
});
|
|
11732
|
+
}
|
|
11733
|
+
return {
|
|
11734
|
+
appState: {
|
|
11735
|
+
...appState,
|
|
11736
|
+
selectedElementIds: {},
|
|
11737
|
+
selectedGroupIds: {},
|
|
11738
|
+
activeEmbeddable: null,
|
|
11739
|
+
activeTool
|
|
11740
|
+
},
|
|
11741
|
+
captureUpdate: CaptureUpdateAction.NEVER
|
|
11742
|
+
};
|
|
11743
|
+
}
|
|
11744
|
+
});
|
|
11671
11745
|
var actionToggleHandTool = register({
|
|
11672
11746
|
name: "toggleHandTool",
|
|
11673
11747
|
label: "toolBar.hand",
|
|
11674
|
-
paletteName: "Toggle hand tool",
|
|
11675
11748
|
trackEvent: { category: "toolbar" },
|
|
11676
11749
|
icon: handIcon,
|
|
11677
11750
|
viewMode: false,
|
|
@@ -12729,7 +12802,7 @@ var exportCanvas = async (type, elements, appState, files, {
|
|
|
12729
12802
|
let blob = canvasToBlob(tempCanvas);
|
|
12730
12803
|
if (appState.exportEmbedScene) {
|
|
12731
12804
|
blob = blob.then(
|
|
12732
|
-
(blob2) => import("./data/image-
|
|
12805
|
+
(blob2) => import("./data/image-NKFINVKH.js").then(
|
|
12733
12806
|
({ encodePngMetadata: encodePngMetadata2 }) => encodePngMetadata2({
|
|
12734
12807
|
blob: blob2,
|
|
12735
12808
|
metadata: serializeAsJSON(elements, appState, files, "local")
|
|
@@ -13176,7 +13249,7 @@ var actionPasteStyles = register({
|
|
|
13176
13249
|
|
|
13177
13250
|
// ../element/src/showSelectedShapeActions.ts
|
|
13178
13251
|
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)
|
|
13252
|
+
!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
13253
|
);
|
|
13181
13254
|
|
|
13182
13255
|
// actions/actionMenu.tsx
|
|
@@ -14660,7 +14733,6 @@ var actionToggleZenMode = register({
|
|
|
14660
14733
|
name: "zenMode",
|
|
14661
14734
|
label: "buttons.zenMode",
|
|
14662
14735
|
icon: coffeeIcon,
|
|
14663
|
-
paletteName: "Toggle zen mode",
|
|
14664
14736
|
viewMode: true,
|
|
14665
14737
|
trackEvent: {
|
|
14666
14738
|
category: "canvas",
|
|
@@ -14714,7 +14786,6 @@ var actionToggleStats = register({
|
|
|
14714
14786
|
name: "stats",
|
|
14715
14787
|
label: "stats.fullTitle",
|
|
14716
14788
|
icon: abacusIcon,
|
|
14717
|
-
paletteName: "Toggle stats",
|
|
14718
14789
|
viewMode: true,
|
|
14719
14790
|
trackEvent: { category: "menu" },
|
|
14720
14791
|
keywords: ["edit", "attributes", "customize"],
|
|
@@ -14875,8 +14946,8 @@ var actionWrapTextInContainer = register({
|
|
|
14875
14946
|
trackEvent: { category: "element" },
|
|
14876
14947
|
predicate: (elements, appState, _, app) => {
|
|
14877
14948
|
const selectedElements = app.scene.getSelectedElements(appState);
|
|
14878
|
-
const
|
|
14879
|
-
return selectedElements.length > 0 &&
|
|
14949
|
+
const someTextElements = selectedElements.some((el) => isTextElement(el));
|
|
14950
|
+
return selectedElements.length > 0 && someTextElements;
|
|
14880
14951
|
},
|
|
14881
14952
|
perform: (elements, appState, _, app) => {
|
|
14882
14953
|
const selectedElements = app.scene.getSelectedElements(appState);
|
|
@@ -15413,7 +15484,6 @@ var actionToggleElementLock = register({
|
|
|
15413
15484
|
});
|
|
15414
15485
|
var actionUnlockAllElements = register({
|
|
15415
15486
|
name: "unlockAllElements",
|
|
15416
|
-
paletteName: "Unlock all elements",
|
|
15417
15487
|
trackEvent: { category: "canvas" },
|
|
15418
15488
|
viewMode: false,
|
|
15419
15489
|
icon: UnlockedIcon,
|
|
@@ -18792,7 +18862,7 @@ var canChangeStrokeColor = (appState, targetElements) => {
|
|
|
18792
18862
|
break;
|
|
18793
18863
|
}
|
|
18794
18864
|
}
|
|
18795
|
-
return hasStrokeColor(appState.activeTool.type) &&
|
|
18865
|
+
return hasStrokeColor(appState.activeTool.type) && commonSelectedType !== "image" && commonSelectedType !== "frame" && commonSelectedType !== "magicframe" || targetElements.some((element) => hasStrokeColor(element.type));
|
|
18796
18866
|
};
|
|
18797
18867
|
var canChangeBackgroundColor = (appState, targetElements) => {
|
|
18798
18868
|
return hasBackground(appState.activeTool.type) || targetElements.some((element) => hasBackground(element.type));
|
|
@@ -18905,6 +18975,7 @@ var ShapesSwitcher = ({
|
|
|
18905
18975
|
const [isExtraToolsMenuOpen, setIsExtraToolsMenuOpen] = useState20(false);
|
|
18906
18976
|
const frameToolSelected = activeTool.type === "frame";
|
|
18907
18977
|
const laserToolSelected = activeTool.type === "laser";
|
|
18978
|
+
const lassoToolSelected = activeTool.type === "lasso";
|
|
18908
18979
|
const embeddableToolSelected = activeTool.type === "embeddable";
|
|
18909
18980
|
const { TTDDialogTriggerTunnel } = useTunnels();
|
|
18910
18981
|
return /* @__PURE__ */ jsxs39(Fragment10, { children: [
|
|
@@ -18932,6 +19003,13 @@ var ShapesSwitcher = ({
|
|
|
18932
19003
|
if (!appState.penDetected && pointerType === "pen") {
|
|
18933
19004
|
app.togglePenMode(true);
|
|
18934
19005
|
}
|
|
19006
|
+
if (value === "selection") {
|
|
19007
|
+
if (appState.activeTool.type === "selection") {
|
|
19008
|
+
app.setActiveTool({ type: "lasso" });
|
|
19009
|
+
} else {
|
|
19010
|
+
app.setActiveTool({ type: "selection" });
|
|
19011
|
+
}
|
|
19012
|
+
}
|
|
18935
19013
|
},
|
|
18936
19014
|
onChange: ({ pointerType }) => {
|
|
18937
19015
|
if (appState.activeTool.type !== value) {
|
|
@@ -18956,14 +19034,14 @@ var ShapesSwitcher = ({
|
|
|
18956
19034
|
DropdownMenu_default.Trigger,
|
|
18957
19035
|
{
|
|
18958
19036
|
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
|
|
19037
|
+
"App-toolbar__extra-tools-trigger--selected": frameToolSelected || embeddableToolSelected || lassoToolSelected || // in collab we're already highlighting the laser button
|
|
18960
19038
|
// outside toolbar, so let's not highlight extra-tools button
|
|
18961
19039
|
// on top of it
|
|
18962
19040
|
laserToolSelected && !app.props.isCollaborating
|
|
18963
19041
|
}),
|
|
18964
19042
|
onToggle: () => setIsExtraToolsMenuOpen(!isExtraToolsMenuOpen),
|
|
18965
19043
|
title: t("toolBar.extraTools"),
|
|
18966
|
-
children: extraToolsIcon
|
|
19044
|
+
children: frameToolSelected ? frameToolIcon : embeddableToolSelected ? EmbedIcon : laserToolSelected && !app.props.isCollaborating ? laserPointerToolIcon : lassoToolSelected ? LassoIcon : extraToolsIcon
|
|
18967
19045
|
}
|
|
18968
19046
|
),
|
|
18969
19047
|
/* @__PURE__ */ jsxs39(
|
|
@@ -19005,6 +19083,16 @@ var ShapesSwitcher = ({
|
|
|
19005
19083
|
children: t("toolBar.laser")
|
|
19006
19084
|
}
|
|
19007
19085
|
),
|
|
19086
|
+
/* @__PURE__ */ jsx69(
|
|
19087
|
+
DropdownMenu_default.Item,
|
|
19088
|
+
{
|
|
19089
|
+
onSelect: () => app.setActiveTool({ type: "lasso" }),
|
|
19090
|
+
icon: LassoIcon,
|
|
19091
|
+
"data-testid": "toolbar-lasso",
|
|
19092
|
+
selected: lassoToolSelected,
|
|
19093
|
+
children: t("toolBar.lasso")
|
|
19094
|
+
}
|
|
19095
|
+
),
|
|
19008
19096
|
/* @__PURE__ */ jsx69("div", { style: { margin: "6px 0", fontSize: 14, fontWeight: 600 }, children: "Generate" }),
|
|
19009
19097
|
app.props.aiEnabled !== false && /* @__PURE__ */ jsx69(TTDDialogTriggerTunnel.Out, {}),
|
|
19010
19098
|
/* @__PURE__ */ jsx69(
|
|
@@ -19315,7 +19403,8 @@ function CommandPaletteInner({
|
|
|
19315
19403
|
);
|
|
19316
19404
|
const toolCommands = [
|
|
19317
19405
|
actionManager.actions.toggleHandTool,
|
|
19318
|
-
actionManager.actions.setFrameAsActiveTool
|
|
19406
|
+
actionManager.actions.setFrameAsActiveTool,
|
|
19407
|
+
actionManager.actions.toggleLassoTool
|
|
19319
19408
|
].map((action) => actionToCommand(action, DEFAULT_CATEGORIES.tools));
|
|
19320
19409
|
const editorCommands = [
|
|
19321
19410
|
actionManager.actions.undo,
|
|
@@ -20436,7 +20525,6 @@ var actionTextAutoResize = register({
|
|
|
20436
20525
|
var actionToggleViewMode = register({
|
|
20437
20526
|
name: "viewMode",
|
|
20438
20527
|
label: "labels.viewMode",
|
|
20439
|
-
paletteName: "Toggle view mode",
|
|
20440
20528
|
icon: eyeIcon,
|
|
20441
20529
|
viewMode: true,
|
|
20442
20530
|
trackEvent: {
|
|
@@ -21812,7 +21900,13 @@ var bindLinearElementToElement = (linearElement, start2, end, elementStore, elem
|
|
|
21812
21900
|
newPoints[0][1] = -delta;
|
|
21813
21901
|
newPoints[endPointIndex][1] += delta;
|
|
21814
21902
|
}
|
|
21815
|
-
Object.assign(
|
|
21903
|
+
Object.assign(
|
|
21904
|
+
linearElement,
|
|
21905
|
+
LinearElementEditor.getNormalizedPoints({
|
|
21906
|
+
...linearElement,
|
|
21907
|
+
points: newPoints
|
|
21908
|
+
})
|
|
21909
|
+
);
|
|
21816
21910
|
return {
|
|
21817
21911
|
linearElement,
|
|
21818
21912
|
startBoundElement,
|
|
@@ -23273,8 +23367,19 @@ var AnimatedTrail = class {
|
|
|
23273
23367
|
__publicField(this, "pastTrails", []);
|
|
23274
23368
|
__publicField(this, "container");
|
|
23275
23369
|
__publicField(this, "trailElement");
|
|
23370
|
+
__publicField(this, "trailAnimation");
|
|
23276
23371
|
this.animationFrameHandler.register(this, this.onFrame.bind(this));
|
|
23277
23372
|
this.trailElement = document.createElementNS(SVG_NS, "path");
|
|
23373
|
+
if (this.options.animateTrail) {
|
|
23374
|
+
this.trailAnimation = document.createElementNS(SVG_NS, "animate");
|
|
23375
|
+
this.trailAnimation.setAttribute("attributeName", "stroke-dashoffset");
|
|
23376
|
+
this.trailElement.setAttribute("stroke-dasharray", "7 7");
|
|
23377
|
+
this.trailElement.setAttribute("stroke-dashoffset", "10");
|
|
23378
|
+
this.trailAnimation.setAttribute("from", "0");
|
|
23379
|
+
this.trailAnimation.setAttribute("to", `-14`);
|
|
23380
|
+
this.trailAnimation.setAttribute("dur", "0.3s");
|
|
23381
|
+
this.trailElement.appendChild(this.trailAnimation);
|
|
23382
|
+
}
|
|
23278
23383
|
}
|
|
23279
23384
|
get hasCurrentTrail() {
|
|
23280
23385
|
return !!this.currentTrail;
|
|
@@ -23321,8 +23426,21 @@ var AnimatedTrail = class {
|
|
|
23321
23426
|
this.update();
|
|
23322
23427
|
}
|
|
23323
23428
|
}
|
|
23429
|
+
getCurrentTrail() {
|
|
23430
|
+
return this.currentTrail;
|
|
23431
|
+
}
|
|
23432
|
+
clearTrails() {
|
|
23433
|
+
this.pastTrails = [];
|
|
23434
|
+
this.currentTrail = void 0;
|
|
23435
|
+
this.update();
|
|
23436
|
+
}
|
|
23324
23437
|
update() {
|
|
23438
|
+
this.pastTrails = [];
|
|
23325
23439
|
this.start();
|
|
23440
|
+
if (this.trailAnimation) {
|
|
23441
|
+
this.trailAnimation.setAttribute("begin", "indefinite");
|
|
23442
|
+
this.trailAnimation.setAttribute("repeatCount", "indefinite");
|
|
23443
|
+
}
|
|
23326
23444
|
}
|
|
23327
23445
|
onFrame() {
|
|
23328
23446
|
const paths = [];
|
|
@@ -23341,19 +23459,31 @@ var AnimatedTrail = class {
|
|
|
23341
23459
|
}
|
|
23342
23460
|
const svgPaths = paths.join(" ").trim();
|
|
23343
23461
|
this.trailElement.setAttribute("d", svgPaths);
|
|
23344
|
-
this.
|
|
23345
|
-
|
|
23346
|
-
|
|
23347
|
-
|
|
23462
|
+
if (this.trailAnimation) {
|
|
23463
|
+
this.trailElement.setAttribute(
|
|
23464
|
+
"fill",
|
|
23465
|
+
(this.options.fill ?? (() => "black"))(this)
|
|
23466
|
+
);
|
|
23467
|
+
this.trailElement.setAttribute(
|
|
23468
|
+
"stroke",
|
|
23469
|
+
(this.options.stroke ?? (() => "black"))(this)
|
|
23470
|
+
);
|
|
23471
|
+
} else {
|
|
23472
|
+
this.trailElement.setAttribute(
|
|
23473
|
+
"fill",
|
|
23474
|
+
(this.options.fill ?? (() => "black"))(this)
|
|
23475
|
+
);
|
|
23476
|
+
}
|
|
23348
23477
|
}
|
|
23349
23478
|
drawTrail(trail, state) {
|
|
23350
|
-
const
|
|
23479
|
+
const _stroke = trail.getStrokeOutline(trail.options.size / state.zoom.value).map(([x, y]) => {
|
|
23351
23480
|
const result = sceneCoordsToViewportCoords(
|
|
23352
23481
|
{ sceneX: x, sceneY: y },
|
|
23353
23482
|
state
|
|
23354
23483
|
);
|
|
23355
23484
|
return [result.x, result.y];
|
|
23356
23485
|
});
|
|
23486
|
+
const stroke = this.trailAnimation ? _stroke.slice(0, _stroke.length / 2) : _stroke;
|
|
23357
23487
|
return getSvgPathFromStroke(stroke, true);
|
|
23358
23488
|
}
|
|
23359
23489
|
};
|
|
@@ -24011,6 +24141,206 @@ var isMaybeMermaidDefinition = (text) => {
|
|
|
24011
24141
|
return re.test(text.trim());
|
|
24012
24142
|
};
|
|
24013
24143
|
|
|
24144
|
+
// lasso/utils.ts
|
|
24145
|
+
import { simplify } from "points-on-curve";
|
|
24146
|
+
var getLassoSelectedElementIds = (input) => {
|
|
24147
|
+
const {
|
|
24148
|
+
lassoPath,
|
|
24149
|
+
elements,
|
|
24150
|
+
elementsSegments,
|
|
24151
|
+
intersectedElements,
|
|
24152
|
+
enclosedElements,
|
|
24153
|
+
simplifyDistance
|
|
24154
|
+
} = input;
|
|
24155
|
+
let path = lassoPath;
|
|
24156
|
+
if (simplifyDistance) {
|
|
24157
|
+
path = simplify(lassoPath, simplifyDistance);
|
|
24158
|
+
}
|
|
24159
|
+
enclosedElements.clear();
|
|
24160
|
+
for (const element of elements) {
|
|
24161
|
+
if (!intersectedElements.has(element.id) && !enclosedElements.has(element.id)) {
|
|
24162
|
+
const enclosed = enclosureTest(path, element, elementsSegments);
|
|
24163
|
+
if (enclosed) {
|
|
24164
|
+
enclosedElements.add(element.id);
|
|
24165
|
+
} else {
|
|
24166
|
+
const intersects = intersectionTest(path, element, elementsSegments);
|
|
24167
|
+
if (intersects) {
|
|
24168
|
+
intersectedElements.add(element.id);
|
|
24169
|
+
}
|
|
24170
|
+
}
|
|
24171
|
+
}
|
|
24172
|
+
}
|
|
24173
|
+
const results = [...intersectedElements, ...enclosedElements];
|
|
24174
|
+
return {
|
|
24175
|
+
selectedElementIds: results
|
|
24176
|
+
};
|
|
24177
|
+
};
|
|
24178
|
+
var enclosureTest = (lassoPath, element, elementsSegments) => {
|
|
24179
|
+
const lassoPolygon = polygonFromPoints(lassoPath);
|
|
24180
|
+
const segments = elementsSegments.get(element.id);
|
|
24181
|
+
if (!segments) {
|
|
24182
|
+
return false;
|
|
24183
|
+
}
|
|
24184
|
+
return segments.some((segment) => {
|
|
24185
|
+
return segment.some(
|
|
24186
|
+
(point) => polygonIncludesPointNonZero(point, lassoPolygon)
|
|
24187
|
+
);
|
|
24188
|
+
});
|
|
24189
|
+
};
|
|
24190
|
+
var intersectionTest = (lassoPath, element, elementsSegments) => {
|
|
24191
|
+
const elementSegments = elementsSegments.get(element.id);
|
|
24192
|
+
if (!elementSegments) {
|
|
24193
|
+
return false;
|
|
24194
|
+
}
|
|
24195
|
+
const lassoSegments = lassoPath.reduce((acc, point, index) => {
|
|
24196
|
+
if (index === 0) {
|
|
24197
|
+
return acc;
|
|
24198
|
+
}
|
|
24199
|
+
acc.push(lineSegment(lassoPath[index - 1], point));
|
|
24200
|
+
return acc;
|
|
24201
|
+
}, []);
|
|
24202
|
+
return lassoSegments.some(
|
|
24203
|
+
(lassoSegment) => elementSegments.some(
|
|
24204
|
+
(elementSegment) => (
|
|
24205
|
+
// introduce a bit of tolerance to account for roughness and simplification of paths
|
|
24206
|
+
lineSegmentIntersectionPoints(lassoSegment, elementSegment, 1) !== null
|
|
24207
|
+
)
|
|
24208
|
+
)
|
|
24209
|
+
);
|
|
24210
|
+
};
|
|
24211
|
+
|
|
24212
|
+
// lasso/index.ts
|
|
24213
|
+
var LassoTrail = class extends AnimatedTrail {
|
|
24214
|
+
constructor(animationFrameHandler, app) {
|
|
24215
|
+
super(animationFrameHandler, app, {
|
|
24216
|
+
animateTrail: true,
|
|
24217
|
+
streamline: 0.4,
|
|
24218
|
+
sizeMapping: (c) => {
|
|
24219
|
+
const DECAY_TIME = Infinity;
|
|
24220
|
+
const DECAY_LENGTH = 5e3;
|
|
24221
|
+
const t2 = Math.max(
|
|
24222
|
+
0,
|
|
24223
|
+
1 - (performance.now() - c.pressure) / DECAY_TIME
|
|
24224
|
+
);
|
|
24225
|
+
const l = (DECAY_LENGTH - Math.min(DECAY_LENGTH, c.totalLength - c.currentIndex)) / DECAY_LENGTH;
|
|
24226
|
+
return Math.min(easeOut(l), easeOut(t2));
|
|
24227
|
+
},
|
|
24228
|
+
fill: () => "rgba(105,101,219,0.05)",
|
|
24229
|
+
stroke: () => "rgba(105,101,219)"
|
|
24230
|
+
});
|
|
24231
|
+
__publicField(this, "intersectedElements", /* @__PURE__ */ new Set());
|
|
24232
|
+
__publicField(this, "enclosedElements", /* @__PURE__ */ new Set());
|
|
24233
|
+
__publicField(this, "elementsSegments", null);
|
|
24234
|
+
__publicField(this, "keepPreviousSelection", false);
|
|
24235
|
+
__publicField(this, "selectElementsFromIds", (ids) => {
|
|
24236
|
+
this.app.setState((prevState) => {
|
|
24237
|
+
const nextSelectedElementIds = ids.reduce((acc, id) => {
|
|
24238
|
+
acc[id] = true;
|
|
24239
|
+
return acc;
|
|
24240
|
+
}, {});
|
|
24241
|
+
if (this.keepPreviousSelection) {
|
|
24242
|
+
for (const id of Object.keys(prevState.selectedElementIds)) {
|
|
24243
|
+
nextSelectedElementIds[id] = true;
|
|
24244
|
+
}
|
|
24245
|
+
}
|
|
24246
|
+
for (const [id] of Object.entries(nextSelectedElementIds)) {
|
|
24247
|
+
const element = this.app.scene.getNonDeletedElement(id);
|
|
24248
|
+
if (element && isTextElement(element)) {
|
|
24249
|
+
const container = getContainerElement(
|
|
24250
|
+
element,
|
|
24251
|
+
this.app.scene.getNonDeletedElementsMap()
|
|
24252
|
+
);
|
|
24253
|
+
if (container) {
|
|
24254
|
+
nextSelectedElementIds[container.id] = true;
|
|
24255
|
+
delete nextSelectedElementIds[element.id];
|
|
24256
|
+
}
|
|
24257
|
+
}
|
|
24258
|
+
}
|
|
24259
|
+
for (const [id] of Object.entries(nextSelectedElementIds)) {
|
|
24260
|
+
const element = this.app.scene.getNonDeletedElement(id);
|
|
24261
|
+
if (element && isFrameLikeElement(element)) {
|
|
24262
|
+
const elementsInFrame = getFrameChildren(
|
|
24263
|
+
this.app.scene.getNonDeletedElementsMap(),
|
|
24264
|
+
element.id
|
|
24265
|
+
);
|
|
24266
|
+
for (const child of elementsInFrame) {
|
|
24267
|
+
delete nextSelectedElementIds[child.id];
|
|
24268
|
+
}
|
|
24269
|
+
}
|
|
24270
|
+
}
|
|
24271
|
+
const nextSelection = selectGroupsForSelectedElements(
|
|
24272
|
+
{
|
|
24273
|
+
editingGroupId: prevState.editingGroupId,
|
|
24274
|
+
selectedElementIds: nextSelectedElementIds
|
|
24275
|
+
},
|
|
24276
|
+
this.app.scene.getNonDeletedElements(),
|
|
24277
|
+
prevState,
|
|
24278
|
+
this.app
|
|
24279
|
+
);
|
|
24280
|
+
const selectedIds = [...Object.keys(nextSelection.selectedElementIds)];
|
|
24281
|
+
const selectedGroupIds = [...Object.keys(nextSelection.selectedGroupIds)];
|
|
24282
|
+
return {
|
|
24283
|
+
selectedElementIds: nextSelection.selectedElementIds,
|
|
24284
|
+
selectedGroupIds: nextSelection.selectedGroupIds,
|
|
24285
|
+
selectedLinearElement: selectedIds.length === 1 && !selectedGroupIds.length && isLinearElement(this.app.scene.getNonDeletedElement(selectedIds[0])) ? new LinearElementEditor(
|
|
24286
|
+
this.app.scene.getNonDeletedElement(
|
|
24287
|
+
selectedIds[0]
|
|
24288
|
+
)
|
|
24289
|
+
) : null
|
|
24290
|
+
};
|
|
24291
|
+
});
|
|
24292
|
+
});
|
|
24293
|
+
__publicField(this, "addPointToPath", (x, y, keepPreviousSelection = false) => {
|
|
24294
|
+
super.addPointToPath(x, y);
|
|
24295
|
+
this.keepPreviousSelection = keepPreviousSelection;
|
|
24296
|
+
this.updateSelection();
|
|
24297
|
+
});
|
|
24298
|
+
__publicField(this, "updateSelection", () => {
|
|
24299
|
+
const lassoPath = super.getCurrentTrail()?.originalPoints?.map((p) => pointFrom(p[0], p[1]));
|
|
24300
|
+
if (!this.elementsSegments) {
|
|
24301
|
+
this.elementsSegments = /* @__PURE__ */ new Map();
|
|
24302
|
+
const visibleElementsMap = arrayToMap(this.app.visibleElements);
|
|
24303
|
+
for (const element of this.app.visibleElements) {
|
|
24304
|
+
const segments = getElementLineSegments(element, visibleElementsMap);
|
|
24305
|
+
this.elementsSegments.set(element.id, segments);
|
|
24306
|
+
}
|
|
24307
|
+
}
|
|
24308
|
+
if (lassoPath) {
|
|
24309
|
+
const { selectedElementIds } = getLassoSelectedElementIds({
|
|
24310
|
+
lassoPath,
|
|
24311
|
+
elements: this.app.visibleElements,
|
|
24312
|
+
elementsSegments: this.elementsSegments,
|
|
24313
|
+
intersectedElements: this.intersectedElements,
|
|
24314
|
+
enclosedElements: this.enclosedElements,
|
|
24315
|
+
simplifyDistance: 5 / this.app.state.zoom.value
|
|
24316
|
+
});
|
|
24317
|
+
this.selectElementsFromIds(selectedElementIds);
|
|
24318
|
+
}
|
|
24319
|
+
});
|
|
24320
|
+
}
|
|
24321
|
+
startPath(x, y, keepPreviousSelection = false) {
|
|
24322
|
+
this.endPath();
|
|
24323
|
+
super.startPath(x, y);
|
|
24324
|
+
this.intersectedElements.clear();
|
|
24325
|
+
this.enclosedElements.clear();
|
|
24326
|
+
this.keepPreviousSelection = keepPreviousSelection;
|
|
24327
|
+
if (!this.keepPreviousSelection) {
|
|
24328
|
+
this.app.setState({
|
|
24329
|
+
selectedElementIds: {},
|
|
24330
|
+
selectedGroupIds: {},
|
|
24331
|
+
selectedLinearElement: null
|
|
24332
|
+
});
|
|
24333
|
+
}
|
|
24334
|
+
}
|
|
24335
|
+
endPath() {
|
|
24336
|
+
super.endPath();
|
|
24337
|
+
super.clearTrails();
|
|
24338
|
+
this.intersectedElements.clear();
|
|
24339
|
+
this.enclosedElements.clear();
|
|
24340
|
+
this.elementsSegments = null;
|
|
24341
|
+
}
|
|
24342
|
+
};
|
|
24343
|
+
|
|
24014
24344
|
// components/BraveMeasureTextError.tsx
|
|
24015
24345
|
import { jsx as jsx77, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
24016
24346
|
var BraveMeasureTextError = () => {
|
|
@@ -24471,13 +24801,13 @@ var getHints = ({
|
|
|
24471
24801
|
}
|
|
24472
24802
|
if (activeTool.type === "selection") {
|
|
24473
24803
|
if (appState.selectionElement && !selectedElements.length && !appState.editingTextElement && !appState.editingLinearElement) {
|
|
24474
|
-
return t("hints.deepBoxSelect");
|
|
24804
|
+
return [t("hints.deepBoxSelect")];
|
|
24475
24805
|
}
|
|
24476
24806
|
if (isGridModeEnabled(app) && appState.selectedElementsAreBeingDragged) {
|
|
24477
24807
|
return t("hints.disableSnapping");
|
|
24478
24808
|
}
|
|
24479
24809
|
if (!selectedElements.length && !isMobile) {
|
|
24480
|
-
return t("hints.canvasPanning");
|
|
24810
|
+
return [t("hints.canvasPanning")];
|
|
24481
24811
|
}
|
|
24482
24812
|
if (selectedElements.length === 1) {
|
|
24483
24813
|
if (isLinearElement(selectedElements[0])) {
|
|
@@ -29169,7 +29499,15 @@ var StatsInner = memo5(
|
|
|
29169
29499
|
/* @__PURE__ */ jsx131("div", { children: t("stats.height") }),
|
|
29170
29500
|
/* @__PURE__ */ jsx131("div", { children: round(unCroppedDimension.height, 2) })
|
|
29171
29501
|
] }),
|
|
29172
|
-
/* @__PURE__ */ jsx131(
|
|
29502
|
+
/* @__PURE__ */ jsx131(
|
|
29503
|
+
StatsRow,
|
|
29504
|
+
{
|
|
29505
|
+
heading: true,
|
|
29506
|
+
"data-testid": "stats-element-type",
|
|
29507
|
+
style: { margin: "0.3125rem 0" },
|
|
29508
|
+
children: appState.croppingElementId ? t("labels.imageCropping") : t(`element.${singleElement.type}`)
|
|
29509
|
+
}
|
|
29510
|
+
),
|
|
29173
29511
|
/* @__PURE__ */ jsx131(StatsRow, { children: /* @__PURE__ */ jsx131(
|
|
29174
29512
|
Position_default,
|
|
29175
29513
|
{
|
|
@@ -31400,32 +31738,35 @@ var StaticCanvas = (props) => {
|
|
|
31400
31738
|
});
|
|
31401
31739
|
return /* @__PURE__ */ jsx144("div", { className: "excalidraw__canvas-wrapper", ref: wrapperRef });
|
|
31402
31740
|
};
|
|
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
|
-
|
|
31741
|
+
var getRelevantAppStateProps2 = (appState) => {
|
|
31742
|
+
const relevantAppStateProps = {
|
|
31743
|
+
zoom: appState.zoom,
|
|
31744
|
+
scrollX: appState.scrollX,
|
|
31745
|
+
scrollY: appState.scrollY,
|
|
31746
|
+
width: appState.width,
|
|
31747
|
+
height: appState.height,
|
|
31748
|
+
viewModeEnabled: appState.viewModeEnabled,
|
|
31749
|
+
openDialog: appState.openDialog,
|
|
31750
|
+
hoveredElementIds: appState.hoveredElementIds,
|
|
31751
|
+
offsetLeft: appState.offsetLeft,
|
|
31752
|
+
offsetTop: appState.offsetTop,
|
|
31753
|
+
theme: appState.theme,
|
|
31754
|
+
pendingImageElementId: appState.pendingImageElementId,
|
|
31755
|
+
shouldCacheIgnoreZoom: appState.shouldCacheIgnoreZoom,
|
|
31756
|
+
viewBackgroundColor: appState.viewBackgroundColor,
|
|
31757
|
+
exportScale: appState.exportScale,
|
|
31758
|
+
selectedElementsAreBeingDragged: appState.selectedElementsAreBeingDragged,
|
|
31759
|
+
gridSize: appState.gridSize,
|
|
31760
|
+
gridStep: appState.gridStep,
|
|
31761
|
+
frameRendering: appState.frameRendering,
|
|
31762
|
+
selectedElementIds: appState.selectedElementIds,
|
|
31763
|
+
frameToHighlight: appState.frameToHighlight,
|
|
31764
|
+
editingGroupId: appState.editingGroupId,
|
|
31765
|
+
currentHoveredFontFamily: appState.currentHoveredFontFamily,
|
|
31766
|
+
croppingElementId: appState.croppingElementId
|
|
31767
|
+
};
|
|
31768
|
+
return relevantAppStateProps;
|
|
31769
|
+
};
|
|
31429
31770
|
var areEqual4 = (prevProps, nextProps) => {
|
|
31430
31771
|
if (prevProps.sceneNonce !== nextProps.sceneNonce || prevProps.scale !== nextProps.scale || // we need to memoize on elementsMap because they may have renewed
|
|
31431
31772
|
// even if sceneNonce didn't change (e.g. we filter elements out based
|
|
@@ -31712,6 +32053,7 @@ var App = class _App extends React43.Component {
|
|
|
31712
32053
|
},
|
|
31713
32054
|
fill: () => this.state.theme === THEME.LIGHT ? "rgba(0, 0, 0, 0.2)" : "rgba(255, 255, 255, 0.2)"
|
|
31714
32055
|
}));
|
|
32056
|
+
__publicField(this, "lassoTrail", new LassoTrail(this.animationFrameHandler, this));
|
|
31715
32057
|
__publicField(this, "onChangeEmitter", new Emitter());
|
|
31716
32058
|
__publicField(this, "onPointerDownEmitter", new Emitter());
|
|
31717
32059
|
__publicField(this, "onPointerUpEmitter", new Emitter());
|
|
@@ -33337,7 +33679,7 @@ var App = class _App extends React43.Component {
|
|
|
33337
33679
|
if (event.key === KEYS.SPACE) {
|
|
33338
33680
|
if (this.state.viewModeEnabled || this.state.openDialog?.name === "elementLinkSelector") {
|
|
33339
33681
|
setCursor(this.interactiveCanvas, CURSOR_TYPE.GRAB);
|
|
33340
|
-
} else if (this.state.activeTool.type === "selection") {
|
|
33682
|
+
} else if (this.state.activeTool.type === "selection" || this.state.activeTool.type === "lasso") {
|
|
33341
33683
|
resetCursor(this.interactiveCanvas);
|
|
33342
33684
|
} else {
|
|
33343
33685
|
setCursorForShape(this.interactiveCanvas, this.state);
|
|
@@ -33421,7 +33763,7 @@ var App = class _App extends React43.Component {
|
|
|
33421
33763
|
__publicField(this, "isToolSupported", (tool) => {
|
|
33422
33764
|
return this.props.UIOptions.tools?.[tool] !== false;
|
|
33423
33765
|
});
|
|
33424
|
-
__publicField(this, "setActiveTool", (tool) => {
|
|
33766
|
+
__publicField(this, "setActiveTool", (tool, keepSelection = false) => {
|
|
33425
33767
|
if (!this.isToolSupported(tool.type)) {
|
|
33426
33768
|
console.warn(
|
|
33427
33769
|
`"${tool.type}" tool is disabled via "UIOptions.canvasActions.tools.${tool.type}"`
|
|
@@ -33457,7 +33799,19 @@ var App = class _App extends React43.Component {
|
|
|
33457
33799
|
if (nextActiveTool.type === "freedraw") {
|
|
33458
33800
|
this.store.shouldCaptureIncrement();
|
|
33459
33801
|
}
|
|
33460
|
-
if (nextActiveTool.type
|
|
33802
|
+
if (nextActiveTool.type === "lasso") {
|
|
33803
|
+
return {
|
|
33804
|
+
...prevState,
|
|
33805
|
+
activeTool: nextActiveTool,
|
|
33806
|
+
...keepSelection ? {} : {
|
|
33807
|
+
selectedElementIds: makeNextSelectedElementIds({}, prevState),
|
|
33808
|
+
selectedGroupIds: makeNextSelectedElementIds({}, prevState),
|
|
33809
|
+
editingGroupId: null,
|
|
33810
|
+
multiElement: null
|
|
33811
|
+
},
|
|
33812
|
+
...commonResets
|
|
33813
|
+
};
|
|
33814
|
+
} else if (nextActiveTool.type !== "selection") {
|
|
33461
33815
|
return {
|
|
33462
33816
|
...prevState,
|
|
33463
33817
|
activeTool: nextActiveTool,
|
|
@@ -34458,11 +34812,17 @@ var App = class _App extends React43.Component {
|
|
|
34458
34812
|
if (this.handleSelectionOnPointerDown(event, pointerDownState)) {
|
|
34459
34813
|
return;
|
|
34460
34814
|
}
|
|
34461
|
-
const allowOnPointerDown = !this.state.penMode || event.pointerType !== "touch" || this.state.activeTool.type === "selection" || this.state.activeTool.type === "text" || this.state.activeTool.type === "image";
|
|
34815
|
+
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
34816
|
if (!allowOnPointerDown) {
|
|
34463
34817
|
return;
|
|
34464
34818
|
}
|
|
34465
|
-
if (this.state.activeTool.type === "
|
|
34819
|
+
if (this.state.activeTool.type === "lasso") {
|
|
34820
|
+
this.lassoTrail.startPath(
|
|
34821
|
+
pointerDownState.origin.x,
|
|
34822
|
+
pointerDownState.origin.y,
|
|
34823
|
+
event.shiftKey
|
|
34824
|
+
);
|
|
34825
|
+
} else if (this.state.activeTool.type === "text") {
|
|
34466
34826
|
this.handleTextOnPointerDown(event, pointerDownState);
|
|
34467
34827
|
} else if (this.state.activeTool.type === "arrow" || this.state.activeTool.type === "line") {
|
|
34468
34828
|
this.handleLinearElementOnPointerDown(
|
|
@@ -34690,7 +35050,7 @@ var App = class _App extends React43.Component {
|
|
|
34690
35050
|
return true;
|
|
34691
35051
|
});
|
|
34692
35052
|
__publicField(this, "clearSelectionIfNotUsingSelection", () => {
|
|
34693
|
-
if (this.state.activeTool.type !== "selection") {
|
|
35053
|
+
if (this.state.activeTool.type !== "selection" && this.state.activeTool.type !== "lasso") {
|
|
34694
35054
|
this.setState({
|
|
34695
35055
|
selectedElementIds: makeNextSelectedElementIds({}, this.state),
|
|
34696
35056
|
selectedGroupIds: {},
|
|
@@ -35899,7 +36259,7 @@ var App = class _App extends React43.Component {
|
|
|
35899
36259
|
width: distance(pointerDownState.origin.x, pointerCoords.x),
|
|
35900
36260
|
height: distance(pointerDownState.origin.y, pointerCoords.y),
|
|
35901
36261
|
shouldMaintainAspectRatio: shouldMaintainAspectRatio(event),
|
|
35902
|
-
shouldResizeFromCenter:
|
|
36262
|
+
shouldResizeFromCenter: false,
|
|
35903
36263
|
zoom: this.state.zoom.value,
|
|
35904
36264
|
informMutation
|
|
35905
36265
|
});
|
|
@@ -36863,7 +37223,11 @@ var App = class _App extends React43.Component {
|
|
|
36863
37223
|
/* @__PURE__ */ jsx147(
|
|
36864
37224
|
SVGLayer,
|
|
36865
37225
|
{
|
|
36866
|
-
trails: [
|
|
37226
|
+
trails: [
|
|
37227
|
+
this.laserTrails,
|
|
37228
|
+
this.eraserTrail,
|
|
37229
|
+
this.lassoTrail
|
|
37230
|
+
]
|
|
36867
37231
|
}
|
|
36868
37232
|
),
|
|
36869
37233
|
selectedElements.length === 1 && this.state.openDialog?.name !== "elementLinkSelector" && this.state.showHyperlinkPopup && /* @__PURE__ */ jsx147(
|
|
@@ -38296,7 +38660,7 @@ var App = class _App extends React43.Component {
|
|
|
38296
38660
|
(element) => this.isASelectedElement(element)
|
|
38297
38661
|
);
|
|
38298
38662
|
const isSelectingPointsInLineEditor = this.state.editingLinearElement && event.shiftKey && this.state.editingLinearElement.elementId === pointerDownState.hit.element?.id;
|
|
38299
|
-
if ((hasHitASelectedElement || pointerDownState.hit.hasHitCommonBoundingBoxOfSelectedElements) && !isSelectingPointsInLineEditor) {
|
|
38663
|
+
if ((hasHitASelectedElement || pointerDownState.hit.hasHitCommonBoundingBoxOfSelectedElements) && !isSelectingPointsInLineEditor && this.state.activeTool.type !== "lasso") {
|
|
38300
38664
|
const selectedElements = this.scene.getSelectedElements(this.state);
|
|
38301
38665
|
if (selectedElements.every((element) => element.locked)) {
|
|
38302
38666
|
return;
|
|
@@ -38445,23 +38809,28 @@ var App = class _App extends React43.Component {
|
|
|
38445
38809
|
includeBoundTextElement: true,
|
|
38446
38810
|
includeElementsInFrames: true
|
|
38447
38811
|
});
|
|
38448
|
-
if (hitElement &&
|
|
38812
|
+
if (hitElement && // hit element may not end up being selected
|
|
38813
|
+
// if we're alt-dragging a common bounding box
|
|
38814
|
+
// over the hit element
|
|
38815
|
+
pointerDownState.hit.wasAddedToSelection && !selectedElements2.find((el) => el.id === hitElement.id)) {
|
|
38449
38816
|
selectedElements2.push(hitElement);
|
|
38450
38817
|
}
|
|
38818
|
+
const idsOfElementsToDuplicate = new Map(
|
|
38819
|
+
selectedElements2.map((el) => [el.id, el])
|
|
38820
|
+
);
|
|
38451
38821
|
const { newElements: clonedElements, elementsWithClones } = duplicateElements({
|
|
38452
38822
|
type: "in-place",
|
|
38453
38823
|
elements,
|
|
38454
38824
|
appState: this.state,
|
|
38455
38825
|
randomizeSeed: true,
|
|
38456
|
-
idsOfElementsToDuplicate
|
|
38457
|
-
selectedElements2.map((el) => [el.id, el])
|
|
38458
|
-
),
|
|
38826
|
+
idsOfElementsToDuplicate,
|
|
38459
38827
|
overrides: (el) => {
|
|
38460
38828
|
const origEl = pointerDownState.originalElements.get(el.id);
|
|
38461
38829
|
if (origEl) {
|
|
38462
38830
|
return {
|
|
38463
38831
|
x: origEl.x,
|
|
38464
|
-
y: origEl.y
|
|
38832
|
+
y: origEl.y,
|
|
38833
|
+
seed: origEl.seed
|
|
38465
38834
|
};
|
|
38466
38835
|
}
|
|
38467
38836
|
return {};
|
|
@@ -38478,7 +38847,14 @@ var App = class _App extends React43.Component {
|
|
|
38478
38847
|
const nextSceneElements = syncMovedIndices(
|
|
38479
38848
|
mappedNewSceneElements || elementsWithClones,
|
|
38480
38849
|
arrayToMap(clonedElements)
|
|
38481
|
-
)
|
|
38850
|
+
).map((el) => {
|
|
38851
|
+
if (idsOfElementsToDuplicate.has(el.id)) {
|
|
38852
|
+
return newElementWith(el, {
|
|
38853
|
+
seed: randomInteger()
|
|
38854
|
+
});
|
|
38855
|
+
}
|
|
38856
|
+
return el;
|
|
38857
|
+
});
|
|
38482
38858
|
this.scene.replaceAllElements(nextSceneElements);
|
|
38483
38859
|
this.maybeCacheVisibleGaps(event, selectedElements2, true);
|
|
38484
38860
|
this.maybeCacheReferenceSnapPoints(event, selectedElements2, true);
|
|
@@ -38489,7 +38865,37 @@ var App = class _App extends React43.Component {
|
|
|
38489
38865
|
if (this.state.selectionElement) {
|
|
38490
38866
|
pointerDownState.lastCoords.x = pointerCoords.x;
|
|
38491
38867
|
pointerDownState.lastCoords.y = pointerCoords.y;
|
|
38492
|
-
|
|
38868
|
+
if (event.altKey) {
|
|
38869
|
+
this.setActiveTool(
|
|
38870
|
+
{ type: "lasso", fromSelection: true },
|
|
38871
|
+
event.shiftKey
|
|
38872
|
+
);
|
|
38873
|
+
this.lassoTrail.startPath(
|
|
38874
|
+
pointerDownState.origin.x,
|
|
38875
|
+
pointerDownState.origin.y,
|
|
38876
|
+
event.shiftKey
|
|
38877
|
+
);
|
|
38878
|
+
this.setAppState({
|
|
38879
|
+
selectionElement: null
|
|
38880
|
+
});
|
|
38881
|
+
} else {
|
|
38882
|
+
this.maybeDragNewGenericElement(pointerDownState, event);
|
|
38883
|
+
}
|
|
38884
|
+
} else if (this.state.activeTool.type === "lasso") {
|
|
38885
|
+
if (!event.altKey && this.state.activeTool.fromSelection) {
|
|
38886
|
+
this.setActiveTool({ type: "selection" });
|
|
38887
|
+
this.createGenericElementOnPointerDown("selection", pointerDownState);
|
|
38888
|
+
pointerDownState.lastCoords.x = pointerCoords.x;
|
|
38889
|
+
pointerDownState.lastCoords.y = pointerCoords.y;
|
|
38890
|
+
this.maybeDragNewGenericElement(pointerDownState, event);
|
|
38891
|
+
this.lassoTrail.endPath();
|
|
38892
|
+
} else {
|
|
38893
|
+
this.lassoTrail.addPointToPath(
|
|
38894
|
+
pointerCoords.x,
|
|
38895
|
+
pointerCoords.y,
|
|
38896
|
+
event.shiftKey
|
|
38897
|
+
);
|
|
38898
|
+
}
|
|
38493
38899
|
} else {
|
|
38494
38900
|
const newElement2 = this.state.newElement;
|
|
38495
38901
|
if (!newElement2) {
|
|
@@ -38687,6 +39093,7 @@ var App = class _App extends React43.Component {
|
|
|
38687
39093
|
snapLines: updateStable(prevState.snapLines, []),
|
|
38688
39094
|
originSnapOffset: null
|
|
38689
39095
|
}));
|
|
39096
|
+
this.lassoTrail.endPath();
|
|
38690
39097
|
this.lastPointerMoveCoords = null;
|
|
38691
39098
|
SnapCache.setReferenceSnapPoints(null);
|
|
38692
39099
|
SnapCache.setVisibleGaps(null);
|
|
@@ -39219,7 +39626,8 @@ var App = class _App extends React43.Component {
|
|
|
39219
39626
|
}
|
|
39220
39627
|
}
|
|
39221
39628
|
if (
|
|
39222
|
-
// not
|
|
39629
|
+
// do not clear selection if lasso is active
|
|
39630
|
+
this.state.activeTool.type !== "lasso" && // not elbow midpoint dragged
|
|
39223
39631
|
!(hitElement && isElbowArrow(hitElement)) && // not dragged
|
|
39224
39632
|
!pointerDownState.drag.hasOccurred && // not resized
|
|
39225
39633
|
!this.state.isResizing && // only hitting the bounding box of the previous hit element
|
|
@@ -39285,7 +39693,8 @@ var App = class _App extends React43.Component {
|
|
|
39285
39693
|
this.laserTrails.endPath();
|
|
39286
39694
|
return;
|
|
39287
39695
|
}
|
|
39288
|
-
if (!activeTool.locked && activeTool.type !== "freedraw"
|
|
39696
|
+
if (!activeTool.locked && activeTool.type !== "freedraw" && (activeTool.type !== "lasso" || // if lasso is turned on but from selection => reset to selection
|
|
39697
|
+
activeTool.type === "lasso" && activeTool.fromSelection)) {
|
|
39289
39698
|
resetCursor(this.interactiveCanvas);
|
|
39290
39699
|
this.setState({
|
|
39291
39700
|
newElement: null,
|