@excalidraw/excalidraw 0.17.1-7441-0269e5a → 0.17.1-7441-4c9a6f4
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/browser/excalidraw-assets/{chunk-V52YQ6TH.js → chunk-LZCCI7PN.js} +1181 -1675
- package/dist/browser/excalidraw-assets/{image-MZHH7VY4.js → image-CG4AV2NT.js} +1 -1
- package/dist/browser/excalidraw-assets/{image-2MHILQWB.css → image-EO7USLQY.css} +1 -1
- package/dist/browser/index.css +1 -1
- package/dist/browser/index.js +1 -1
- package/dist/packages/excalidraw/actions/actionAddToLibrary.js +59 -0
- package/dist/packages/excalidraw/actions/actionAlign.js +124 -0
- package/dist/packages/excalidraw/actions/actionBoundText.js +213 -0
- package/dist/packages/excalidraw/actions/actionCanvas.js +354 -0
- package/dist/packages/excalidraw/actions/actionClipboard.js +221 -0
- package/dist/packages/excalidraw/actions/actionDeleteSelected.js +129 -0
- package/dist/packages/excalidraw/actions/actionDistribute.js +56 -0
- package/dist/packages/excalidraw/actions/actionDuplicateSelection.js +181 -0
- package/dist/packages/excalidraw/actions/actionElementLock.js +89 -0
- package/dist/packages/excalidraw/actions/actionExport.js +195 -0
- package/dist/packages/excalidraw/actions/actionFinalize.js +150 -0
- package/dist/packages/excalidraw/actions/actionFlip.js +52 -0
- package/dist/packages/excalidraw/actions/actionFrame.js +113 -0
- package/dist/packages/excalidraw/actions/actionGroup.js +162 -0
- package/dist/packages/excalidraw/actions/actionHistory.js +57 -0
- package/dist/packages/excalidraw/actions/actionLinearEditor.js +41 -0
- package/dist/packages/excalidraw/actions/actionMenu.js +53 -0
- package/dist/packages/excalidraw/actions/actionNavigate.js +43 -0
- package/dist/packages/excalidraw/actions/actionProperties.js +683 -0
- package/dist/packages/excalidraw/actions/actionSelectAll.js +40 -0
- package/dist/packages/excalidraw/actions/actionStyles.js +118 -0
- package/dist/packages/excalidraw/actions/actionToggleGridMode.js +27 -0
- package/dist/packages/excalidraw/actions/actionToggleObjectsSnapMode.js +26 -0
- package/dist/packages/excalidraw/actions/actionToggleStats.js +19 -0
- package/dist/packages/excalidraw/actions/actionToggleViewMode.js +25 -0
- package/dist/packages/excalidraw/actions/actionToggleZenMode.js +25 -0
- package/dist/packages/excalidraw/actions/actionZindex.js +86 -0
- package/dist/packages/excalidraw/actions/index.js +25 -0
- package/dist/packages/excalidraw/actions/manager.js +110 -0
- package/dist/packages/excalidraw/actions/register.js +5 -0
- package/dist/packages/excalidraw/actions/shortcuts.js +52 -0
- package/dist/packages/excalidraw/align.js +36 -0
- package/dist/packages/excalidraw/analytics.js +30 -0
- package/dist/packages/excalidraw/appState.js +222 -0
- package/dist/packages/excalidraw/charts.js +365 -0
- package/dist/packages/excalidraw/clients.js +34 -0
- package/dist/packages/excalidraw/clipboard.js +351 -0
- package/dist/packages/excalidraw/colors.js +124 -0
- package/dist/packages/excalidraw/components/Actions.js +127 -0
- package/dist/packages/excalidraw/components/Actions.scss +92 -0
- package/dist/packages/excalidraw/components/ActiveConfirmDialog.js +22 -0
- package/dist/packages/excalidraw/components/App.js +6177 -0
- package/dist/packages/excalidraw/components/Avatar.js +15 -0
- package/dist/packages/excalidraw/components/Avatar.scss +7 -0
- package/dist/packages/excalidraw/components/BraveMeasureTextError.js +6 -0
- package/dist/packages/excalidraw/components/Button.js +14 -0
- package/dist/packages/excalidraw/components/Button.scss +7 -0
- package/dist/packages/excalidraw/components/ButtonIconCycle.js +11 -0
- package/dist/packages/excalidraw/components/ButtonIconSelect.js +6 -0
- package/dist/packages/excalidraw/components/ButtonSelect.js +3 -0
- package/dist/packages/excalidraw/components/Card.js +14 -0
- package/dist/packages/excalidraw/components/Card.scss +57 -0
- package/dist/packages/excalidraw/components/CheckboxItem.js +10 -0
- package/dist/packages/excalidraw/components/CheckboxItem.scss +91 -0
- package/dist/packages/excalidraw/components/ColorPicker/ColorInput.js +67 -0
- package/dist/packages/excalidraw/components/ColorPicker/ColorPicker.js +138 -0
- package/dist/packages/excalidraw/components/ColorPicker/ColorPicker.scss +441 -0
- package/dist/packages/excalidraw/components/ColorPicker/CustomColorList.js +24 -0
- package/dist/packages/excalidraw/components/ColorPicker/HotkeyLabel.js +8 -0
- package/dist/packages/excalidraw/components/ColorPicker/Picker.js +86 -0
- package/dist/packages/excalidraw/components/ColorPicker/PickerColorList.js +33 -0
- package/dist/packages/excalidraw/components/ColorPicker/PickerHeading.js +3 -0
- package/dist/packages/excalidraw/components/ColorPicker/ShadeList.js +44 -0
- package/dist/packages/excalidraw/components/ColorPicker/TopPicks.js +27 -0
- package/dist/packages/excalidraw/components/ColorPicker/colorPickerUtils.js +83 -0
- package/dist/packages/excalidraw/components/ColorPicker/keyboardNavHandlers.js +174 -0
- package/dist/packages/excalidraw/components/ConfirmDialog.js +27 -0
- package/dist/packages/excalidraw/components/ConfirmDialog.scss +11 -0
- package/dist/packages/excalidraw/components/ContextMenu.js +56 -0
- package/dist/packages/excalidraw/components/ContextMenu.scss +98 -0
- package/dist/packages/excalidraw/components/DarkModeToggle.js +16 -0
- package/dist/packages/excalidraw/components/DefaultSidebar.js +48 -0
- package/dist/packages/excalidraw/components/Dialog.js +74 -0
- package/dist/packages/excalidraw/components/Dialog.scss +48 -0
- package/dist/packages/excalidraw/components/DialogActionButton.js +9 -0
- package/dist/packages/excalidraw/components/DialogActionButton.scss +47 -0
- package/dist/packages/excalidraw/components/ErrorDialog.js +18 -0
- package/dist/packages/excalidraw/components/ExcalidrawLogo.js +7 -0
- package/dist/packages/excalidraw/components/ExcalidrawLogo.scss +73 -0
- package/dist/packages/excalidraw/components/ExportDialog.scss +129 -0
- package/dist/packages/excalidraw/components/EyeDropper.js +130 -0
- package/dist/packages/excalidraw/components/EyeDropper.scss +48 -0
- package/dist/packages/excalidraw/components/FilledButton.js +7 -0
- package/dist/packages/excalidraw/components/FilledButton.scss +191 -0
- package/dist/packages/excalidraw/components/FixedSideContainer.js +4 -0
- package/dist/packages/excalidraw/components/FixedSideContainer.scss +40 -0
- package/dist/packages/excalidraw/components/FollowMode/FollowMode.js +7 -0
- package/dist/packages/excalidraw/components/FollowMode/FollowMode.scss +59 -0
- package/dist/packages/excalidraw/components/HandButton.js +9 -0
- package/dist/packages/excalidraw/components/HelpButton.js +4 -0
- package/dist/packages/excalidraw/components/HelpDialog.js +79 -0
- package/dist/packages/excalidraw/components/HelpDialog.scss +130 -0
- package/dist/packages/excalidraw/components/HintViewer.js +97 -0
- package/dist/packages/excalidraw/components/HintViewer.scss +37 -0
- package/dist/packages/excalidraw/components/IconPicker.js +99 -0
- package/dist/packages/excalidraw/components/IconPicker.scss +143 -0
- package/dist/packages/excalidraw/components/ImageExportDialog.js +127 -0
- package/dist/packages/excalidraw/components/ImageExportDialog.scss +173 -0
- package/dist/packages/excalidraw/components/InitializeApp.js +16 -0
- package/dist/packages/excalidraw/components/InlineIcon.js +10 -0
- package/dist/packages/excalidraw/components/Island.js +5 -0
- package/dist/packages/excalidraw/components/Island.scss +16 -0
- package/dist/packages/excalidraw/components/JSONExportDialog.js +35 -0
- package/dist/packages/excalidraw/components/LaserTool/LaserPathManager.js +225 -0
- package/dist/packages/excalidraw/components/LaserTool/LaserPointerButton.js +10 -0
- package/dist/packages/excalidraw/components/LaserTool/LaserTool.js +15 -0
- package/dist/packages/excalidraw/components/LaserTool/LaserToolOverlay.scss +20 -0
- package/dist/packages/excalidraw/components/LayerUI.js +189 -0
- package/dist/packages/excalidraw/components/LayerUI.scss +112 -0
- package/dist/packages/excalidraw/components/LibraryMenu.js +99 -0
- package/dist/packages/excalidraw/components/LibraryMenu.scss +150 -0
- package/dist/packages/excalidraw/components/LibraryMenuBrowseButton.js +8 -0
- package/dist/packages/excalidraw/components/LibraryMenuControlButtons.js +6 -0
- package/dist/packages/excalidraw/components/LibraryMenuHeaderContent.js +126 -0
- package/dist/packages/excalidraw/components/LibraryMenuItems.js +138 -0
- package/dist/packages/excalidraw/components/LibraryMenuItems.scss +99 -0
- package/dist/packages/excalidraw/components/LibraryMenuSection.js +21 -0
- package/dist/packages/excalidraw/components/LibraryUnit.js +52 -0
- package/dist/packages/excalidraw/components/LibraryUnit.scss +185 -0
- package/dist/packages/excalidraw/components/LoadingMessage.js +24 -0
- package/dist/packages/excalidraw/components/LockButton.js +14 -0
- package/dist/packages/excalidraw/components/MagicButton.js +9 -0
- package/dist/packages/excalidraw/components/MagicSettings.js +46 -0
- package/dist/packages/excalidraw/components/MagicSettings.scss +18 -0
- package/dist/packages/excalidraw/components/MobileMenu.js +45 -0
- package/dist/packages/excalidraw/components/Modal.js +23 -0
- package/dist/packages/excalidraw/components/Modal.scss +121 -0
- package/dist/packages/excalidraw/components/OverwriteConfirm/OverwriteConfirm.js +31 -0
- package/dist/packages/excalidraw/components/OverwriteConfirm/OverwriteConfirm.scss +126 -0
- package/dist/packages/excalidraw/components/OverwriteConfirm/OverwriteConfirmActions.js +32 -0
- package/dist/packages/excalidraw/components/OverwriteConfirm/OverwriteConfirmState.js +19 -0
- package/dist/packages/excalidraw/components/Paragraph.js +4 -0
- package/dist/packages/excalidraw/components/PasteChartDialog.js +63 -0
- package/dist/packages/excalidraw/components/PasteChartDialog.scss +46 -0
- package/dist/packages/excalidraw/components/PenModeButton.js +13 -0
- package/dist/packages/excalidraw/components/Popover.js +111 -0
- package/dist/packages/excalidraw/components/Popover.scss +8 -0
- package/dist/packages/excalidraw/components/ProjectName.js +30 -0
- package/dist/packages/excalidraw/components/ProjectName.scss +25 -0
- package/dist/packages/excalidraw/components/PublishLibrary.js +214 -0
- package/dist/packages/excalidraw/components/PublishLibrary.scss +172 -0
- package/dist/packages/excalidraw/components/RadioGroup.js +8 -0
- package/dist/packages/excalidraw/components/RadioGroup.scss +91 -0
- package/dist/packages/excalidraw/components/Section.js +8 -0
- package/dist/packages/excalidraw/components/ShareableLinkDialog.js +33 -0
- package/dist/packages/excalidraw/components/ShareableLinkDialog.scss +91 -0
- package/dist/packages/excalidraw/components/Sidebar/Sidebar.js +145 -0
- package/dist/packages/excalidraw/components/Sidebar/Sidebar.scss +176 -0
- package/dist/packages/excalidraw/components/Sidebar/SidebarHeader.js +16 -0
- package/dist/packages/excalidraw/components/Sidebar/SidebarTab.js +6 -0
- package/dist/packages/excalidraw/components/Sidebar/SidebarTabTrigger.js +6 -0
- package/dist/packages/excalidraw/components/Sidebar/SidebarTabTriggers.js +6 -0
- package/dist/packages/excalidraw/components/Sidebar/SidebarTabs.js +17 -0
- package/dist/packages/excalidraw/components/Sidebar/SidebarTrigger.js +18 -0
- package/dist/packages/excalidraw/components/Sidebar/SidebarTrigger.scss +37 -0
- package/dist/packages/excalidraw/components/Sidebar/common.js +2 -0
- package/dist/packages/excalidraw/components/Spinner.js +14 -0
- package/dist/packages/excalidraw/components/Spinner.scss +49 -0
- package/dist/packages/excalidraw/components/Stack.js +24 -0
- package/dist/packages/excalidraw/components/Stack.scss +19 -0
- package/dist/packages/excalidraw/components/Stats.js +13 -0
- package/dist/packages/excalidraw/components/Stats.scss +54 -0
- package/dist/packages/excalidraw/components/Switch.js +10 -0
- package/dist/packages/excalidraw/components/Switch.scss +118 -0
- package/dist/packages/excalidraw/components/TTDDialog/MermaidToExcalidraw.js +58 -0
- package/dist/packages/excalidraw/components/TTDDialog/MermaidToExcalidraw.scss +10 -0
- package/dist/packages/excalidraw/components/TTDDialog/TTDDialog.js +194 -0
- package/dist/packages/excalidraw/components/TTDDialog/TTDDialog.scss +315 -0
- package/dist/packages/excalidraw/components/TTDDialog/TTDDialogInput.js +28 -0
- package/dist/packages/excalidraw/components/TTDDialog/TTDDialogOutput.js +8 -0
- package/dist/packages/excalidraw/components/TTDDialog/TTDDialogPanel.js +11 -0
- package/dist/packages/excalidraw/components/TTDDialog/TTDDialogPanels.js +4 -0
- package/dist/packages/excalidraw/components/TTDDialog/TTDDialogSubmitShortcut.js +5 -0
- package/dist/packages/excalidraw/components/TTDDialog/TTDDialogTab.js +6 -0
- package/dist/packages/excalidraw/components/TTDDialog/TTDDialogTabTrigger.js +6 -0
- package/dist/packages/excalidraw/components/TTDDialog/TTDDialogTabTriggers.js +6 -0
- package/dist/packages/excalidraw/components/TTDDialog/TTDDialogTabs.js +39 -0
- package/dist/packages/excalidraw/components/TTDDialog/TTDDialogTrigger.js +16 -0
- package/dist/packages/excalidraw/components/TTDDialog/common.js +88 -0
- package/dist/packages/excalidraw/components/TextField.js +25 -0
- package/dist/packages/excalidraw/components/TextField.scss +109 -0
- package/dist/packages/excalidraw/components/TextInput.scss +7 -0
- package/dist/packages/excalidraw/components/Toast.js +30 -0
- package/dist/packages/excalidraw/components/Toast.scss +49 -0
- package/dist/packages/excalidraw/components/ToolButton.js +72 -0
- package/dist/packages/excalidraw/components/ToolIcon.scss +184 -0
- package/dist/packages/excalidraw/components/Toolbar.scss +50 -0
- package/dist/packages/excalidraw/components/Tooltip.js +60 -0
- package/dist/packages/excalidraw/components/Tooltip.scss +47 -0
- package/dist/packages/excalidraw/components/Trans.js +139 -0
- package/dist/packages/excalidraw/components/UserList.js +96 -0
- package/dist/packages/excalidraw/components/UserList.scss +136 -0
- package/dist/packages/excalidraw/components/canvases/InteractiveCanvas.js +120 -0
- package/dist/packages/excalidraw/components/canvases/StaticCanvas.js +85 -0
- package/dist/packages/excalidraw/components/canvases/index.js +3 -0
- package/dist/packages/excalidraw/components/dropdownMenu/DropdownMenu.js +24 -0
- package/dist/packages/excalidraw/components/dropdownMenu/DropdownMenu.scss +148 -0
- package/dist/packages/excalidraw/components/dropdownMenu/DropdownMenuContent.js +21 -0
- package/dist/packages/excalidraw/components/dropdownMenu/DropdownMenuGroup.js +6 -0
- package/dist/packages/excalidraw/components/dropdownMenu/DropdownMenuItem.js +23 -0
- package/dist/packages/excalidraw/components/dropdownMenu/DropdownMenuItemContent.js +7 -0
- package/dist/packages/excalidraw/components/dropdownMenu/DropdownMenuItemCustom.js +5 -0
- package/dist/packages/excalidraw/components/dropdownMenu/DropdownMenuItemLink.js +9 -0
- package/dist/packages/excalidraw/components/dropdownMenu/DropdownMenuSeparator.js +8 -0
- package/dist/packages/excalidraw/components/dropdownMenu/DropdownMenuTrigger.js +12 -0
- package/dist/packages/excalidraw/components/dropdownMenu/common.js +20 -0
- package/dist/packages/excalidraw/components/dropdownMenu/dropdownMenuUtils.js +27 -0
- package/dist/packages/excalidraw/components/footer/Footer.js +25 -0
- package/dist/packages/excalidraw/components/footer/FooterCenter.js +14 -0
- package/dist/packages/excalidraw/components/footer/FooterCenter.scss +11 -0
- package/dist/packages/excalidraw/components/hoc/withInternalFallback.js +57 -0
- package/dist/packages/excalidraw/components/icons.js +220 -0
- package/dist/packages/excalidraw/components/live-collaboration/LiveCollaborationTrigger.js +13 -0
- package/dist/packages/excalidraw/components/live-collaboration/LiveCollaborationTrigger.scss +72 -0
- package/dist/packages/excalidraw/components/main-menu/DefaultItems.js +116 -0
- package/dist/packages/excalidraw/components/main-menu/DefaultItems.scss +21 -0
- package/dist/packages/excalidraw/components/main-menu/MainMenu.js +36 -0
- package/dist/packages/excalidraw/components/welcome-screen/WelcomeScreen.Center.js +69 -0
- package/dist/packages/excalidraw/components/welcome-screen/WelcomeScreen.Hints.js +20 -0
- package/dist/packages/excalidraw/components/welcome-screen/WelcomeScreen.js +11 -0
- package/dist/packages/excalidraw/components/welcome-screen/WelcomeScreen.scss +285 -0
- package/dist/packages/excalidraw/constants.js +312 -0
- package/dist/packages/excalidraw/context/tunnels.js +21 -0
- package/dist/packages/excalidraw/context/ui-appState.js +3 -0
- package/dist/packages/excalidraw/css/app.scss +39 -0
- package/dist/packages/excalidraw/css/styles.scss +757 -0
- package/dist/packages/excalidraw/css/theme.scss +252 -0
- package/dist/packages/excalidraw/css/variables.module.scss +174 -0
- package/dist/packages/excalidraw/cursor.js +72 -0
- package/dist/packages/excalidraw/data/EditorLocalStorage.js +42 -0
- package/dist/packages/excalidraw/data/ai/types.js +1 -0
- package/dist/packages/excalidraw/data/blob.js +378 -0
- package/dist/packages/excalidraw/data/encode.js +231 -0
- package/dist/packages/excalidraw/data/encryption.js +53 -0
- package/dist/packages/excalidraw/data/filesystem.js +65 -0
- package/dist/packages/excalidraw/data/image.js +91 -0
- package/dist/packages/excalidraw/data/index.js +120 -0
- package/dist/packages/excalidraw/data/json.js +93 -0
- package/dist/packages/excalidraw/data/library.js +376 -0
- package/dist/packages/excalidraw/data/magic.js +73 -0
- package/dist/packages/excalidraw/data/resave.js +22 -0
- package/dist/packages/excalidraw/data/restore.js +438 -0
- package/dist/packages/excalidraw/data/transform.js +442 -0
- package/dist/packages/excalidraw/data/types.js +1 -0
- package/dist/packages/excalidraw/data/url.js +30 -0
- package/dist/packages/excalidraw/distribute.js +58 -0
- package/dist/packages/excalidraw/element/ElementCanvasButtons.js +31 -0
- package/dist/packages/excalidraw/element/ElementCanvasButtons.scss +14 -0
- package/dist/packages/excalidraw/element/Hyperlink.js +350 -0
- package/dist/packages/excalidraw/element/Hyperlink.scss +70 -0
- package/dist/packages/excalidraw/element/binding.js +412 -0
- package/dist/packages/excalidraw/element/bounds.js +613 -0
- package/dist/packages/excalidraw/element/collision.js +727 -0
- package/dist/packages/excalidraw/element/dragElements.js +119 -0
- package/dist/packages/excalidraw/element/embeddable.js +305 -0
- package/dist/packages/excalidraw/element/image.js +91 -0
- package/dist/packages/excalidraw/element/index.js +24 -0
- package/dist/packages/excalidraw/element/linearElementEditor.js +867 -0
- package/dist/packages/excalidraw/element/mutateElement.js +112 -0
- package/dist/packages/excalidraw/element/newElement.js +389 -0
- package/dist/packages/excalidraw/element/resizeElements.js +597 -0
- package/dist/packages/excalidraw/element/resizeTest.js +95 -0
- package/dist/packages/excalidraw/element/showSelectedShapeActions.js +9 -0
- package/dist/packages/excalidraw/element/sizeHelpers.js +131 -0
- package/dist/packages/excalidraw/element/sortElements.js +104 -0
- package/dist/packages/excalidraw/element/textElement.js +716 -0
- package/dist/packages/excalidraw/element/textWysiwyg.js +500 -0
- package/dist/packages/excalidraw/element/transformHandles.js +155 -0
- package/dist/packages/excalidraw/element/typeChecks.js +141 -0
- package/dist/packages/excalidraw/element/types.js +1 -0
- package/dist/packages/excalidraw/emitter.js +36 -0
- package/dist/packages/excalidraw/errors.js +20 -0
- package/dist/packages/excalidraw/frame.js +373 -0
- package/dist/packages/excalidraw/ga.js +268 -0
- package/dist/packages/excalidraw/gadirections.js +18 -0
- package/dist/packages/excalidraw/galines.js +32 -0
- package/dist/packages/excalidraw/gapoints.js +30 -0
- package/dist/packages/excalidraw/gatransforms.js +23 -0
- package/dist/packages/excalidraw/gesture.js +9 -0
- package/dist/packages/excalidraw/groups.js +225 -0
- package/dist/packages/excalidraw/history.js +190 -0
- package/dist/packages/excalidraw/hooks/useCallbackRefState.js +6 -0
- package/dist/packages/excalidraw/hooks/useCreatePortalContainer.js +32 -0
- package/dist/packages/excalidraw/hooks/useLibraryItemSvg.js +62 -0
- package/dist/packages/excalidraw/hooks/useOutsideClick.js +67 -0
- package/dist/packages/excalidraw/hooks/useScrollPosition.js +23 -0
- package/dist/packages/excalidraw/hooks/useStable.js +6 -0
- package/dist/packages/excalidraw/hooks/useTransition.js +7 -0
- package/dist/packages/excalidraw/i18n.js +137 -0
- package/dist/packages/excalidraw/index-node.d.ts +1 -0
- package/dist/packages/excalidraw/index-node.js +73 -0
- package/{types → dist/packages}/excalidraw/index.d.ts +1 -1
- package/dist/packages/excalidraw/index.js +116 -0
- package/dist/packages/excalidraw/jotai.js +18 -0
- package/dist/packages/excalidraw/keys.js +84 -0
- package/dist/packages/excalidraw/locales/ar-SA.json +525 -0
- package/dist/packages/excalidraw/locales/az-AZ.json +525 -0
- package/dist/packages/excalidraw/locales/bg-BG.json +525 -0
- package/dist/packages/excalidraw/locales/bn-BD.json +525 -0
- package/dist/packages/excalidraw/locales/ca-ES.json +525 -0
- package/dist/packages/excalidraw/locales/cs-CZ.json +525 -0
- package/dist/packages/excalidraw/locales/da-DK.json +525 -0
- package/dist/packages/excalidraw/locales/de-DE.json +525 -0
- package/dist/packages/excalidraw/locales/el-GR.json +525 -0
- package/dist/packages/excalidraw/locales/en.json +535 -0
- package/dist/packages/excalidraw/locales/es-ES.json +525 -0
- package/dist/packages/excalidraw/locales/eu-ES.json +525 -0
- package/dist/packages/excalidraw/locales/fa-IR.json +525 -0
- package/dist/packages/excalidraw/locales/fi-FI.json +525 -0
- package/dist/packages/excalidraw/locales/fr-FR.json +525 -0
- package/dist/packages/excalidraw/locales/gl-ES.json +525 -0
- package/dist/packages/excalidraw/locales/he-IL.json +525 -0
- package/dist/packages/excalidraw/locales/hi-IN.json +525 -0
- package/dist/packages/excalidraw/locales/hu-HU.json +525 -0
- package/dist/packages/excalidraw/locales/id-ID.json +525 -0
- package/dist/packages/excalidraw/locales/it-IT.json +525 -0
- package/dist/packages/excalidraw/locales/ja-JP.json +525 -0
- package/dist/packages/excalidraw/locales/kaa.json +525 -0
- package/dist/packages/excalidraw/locales/kab-KAB.json +525 -0
- package/dist/packages/excalidraw/locales/kk-KZ.json +525 -0
- package/dist/packages/excalidraw/locales/km-KH.json +525 -0
- package/dist/packages/excalidraw/locales/ko-KR.json +525 -0
- package/dist/packages/excalidraw/locales/ku-TR.json +525 -0
- package/dist/packages/excalidraw/locales/lt-LT.json +525 -0
- package/dist/packages/excalidraw/locales/lv-LV.json +525 -0
- package/dist/packages/excalidraw/locales/mr-IN.json +525 -0
- package/dist/packages/excalidraw/locales/my-MM.json +525 -0
- package/dist/packages/excalidraw/locales/nb-NO.json +525 -0
- package/dist/packages/excalidraw/locales/nl-NL.json +525 -0
- package/dist/packages/excalidraw/locales/nn-NO.json +525 -0
- package/dist/packages/excalidraw/locales/oc-FR.json +525 -0
- package/dist/packages/excalidraw/locales/pa-IN.json +525 -0
- package/dist/packages/excalidraw/locales/percentages.json +56 -0
- package/dist/packages/excalidraw/locales/pl-PL.json +525 -0
- package/dist/packages/excalidraw/locales/pt-BR.json +525 -0
- package/dist/packages/excalidraw/locales/pt-PT.json +525 -0
- package/dist/packages/excalidraw/locales/ro-RO.json +525 -0
- package/dist/packages/excalidraw/locales/ru-RU.json +525 -0
- package/dist/packages/excalidraw/locales/si-LK.json +525 -0
- package/dist/packages/excalidraw/locales/sk-SK.json +525 -0
- package/dist/packages/excalidraw/locales/sl-SI.json +525 -0
- package/dist/packages/excalidraw/locales/sv-SE.json +525 -0
- package/dist/packages/excalidraw/locales/ta-IN.json +525 -0
- package/dist/packages/excalidraw/locales/th-TH.json +525 -0
- package/dist/packages/excalidraw/locales/tr-TR.json +525 -0
- package/dist/packages/excalidraw/locales/uk-UA.json +525 -0
- package/dist/packages/excalidraw/locales/vi-VN.json +525 -0
- package/dist/packages/excalidraw/locales/zh-CN.json +525 -0
- package/dist/packages/excalidraw/locales/zh-HK.json +525 -0
- package/dist/packages/excalidraw/locales/zh-TW.json +525 -0
- package/dist/packages/excalidraw/math.js +364 -0
- package/dist/packages/excalidraw/points.js +38 -0
- package/dist/packages/excalidraw/polyfill.js +32 -0
- package/dist/packages/excalidraw/random.js +11 -0
- package/dist/packages/excalidraw/renderer/renderElement.js +871 -0
- package/dist/packages/excalidraw/renderer/renderScene.js +859 -0
- package/dist/packages/excalidraw/renderer/renderSnaps.js +114 -0
- package/dist/packages/excalidraw/renderer/roundRect.js +28 -0
- package/dist/packages/excalidraw/scene/Fonts.js +71 -0
- package/dist/packages/excalidraw/scene/Renderer.js +65 -0
- package/dist/packages/excalidraw/scene/Scene.js +230 -0
- package/dist/packages/excalidraw/scene/Shape.js +322 -0
- package/dist/packages/excalidraw/scene/ShapeCache.js +42 -0
- package/dist/packages/excalidraw/scene/comparisons.js +67 -0
- package/dist/packages/excalidraw/scene/export.js +304 -0
- package/dist/packages/excalidraw/scene/index.js +5 -0
- package/dist/packages/excalidraw/scene/scroll.js +35 -0
- package/dist/packages/excalidraw/scene/scrollbars.js +85 -0
- package/dist/packages/excalidraw/scene/selection.js +134 -0
- package/dist/packages/excalidraw/scene/types.js +1 -0
- package/dist/packages/excalidraw/scene/zoom.js +22 -0
- package/dist/packages/excalidraw/shapes.js +84 -0
- package/dist/packages/excalidraw/snapping.js +838 -0
- package/dist/packages/excalidraw/types.js +6 -0
- package/dist/packages/excalidraw/utility-types.js +1 -0
- package/dist/packages/excalidraw/utils.js +668 -0
- package/dist/packages/excalidraw/zindex.js +349 -0
- package/dist/packages/utils/bbox.js +42 -0
- package/dist/packages/utils/export.js +109 -0
- package/dist/packages/utils/withinBounds.js +125 -0
- package/dist/public/fonts/Assistant-Bold.woff2 +0 -0
- package/dist/public/fonts/Assistant-Medium.woff2 +0 -0
- package/dist/public/fonts/Assistant-Regular.woff2 +0 -0
- package/dist/public/fonts/Assistant-SemiBold.woff2 +0 -0
- package/dist/public/fonts/Cascadia.ttf +0 -0
- package/dist/public/fonts/Cascadia.woff2 +0 -0
- package/dist/public/fonts/FG_Virgil.ttf +0 -0
- package/dist/public/fonts/FG_Virgil.woff2 +0 -0
- package/dist/public/fonts/Virgil.woff2 +0 -0
- package/dist/public/fonts/fonts.css +38 -0
- package/package.json +8 -5
- package/dist/index.css +0 -5796
- package/dist/index.js +0 -71898
- /package/{types → dist/packages}/excalidraw/actions/actionAddToLibrary.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/actions/actionAlign.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/actions/actionBoundText.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/actions/actionCanvas.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/actions/actionClipboard.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/actions/actionDeleteSelected.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/actions/actionDistribute.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/actions/actionDuplicateSelection.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/actions/actionElementLock.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/actions/actionExport.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/actions/actionFinalize.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/actions/actionFlip.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/actions/actionFrame.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/actions/actionGroup.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/actions/actionHistory.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/actions/actionLinearEditor.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/actions/actionMenu.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/actions/actionNavigate.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/actions/actionProperties.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/actions/actionSelectAll.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/actions/actionStyles.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/actions/actionToggleGridMode.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/actions/actionToggleStats.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/actions/actionToggleViewMode.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/actions/actionToggleZenMode.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/actions/actionZindex.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/actions/index.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/actions/manager.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/actions/register.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/actions/shortcuts.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/actions/types.d.ts +0 -0
- /package/{types/excalidraw/index-node.d.ts → dist/packages/excalidraw/actions/types.js} +0 -0
- /package/{types → dist/packages}/excalidraw/align.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/analytics.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/appState.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/charts.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/clients.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/clipboard.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/colors.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/Actions.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/ActiveConfirmDialog.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/App.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/Avatar.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/BraveMeasureTextError.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/Button.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/ButtonIconCycle.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/ButtonIconSelect.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/ButtonSelect.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/Card.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/CheckboxItem.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/ColorPicker/ColorInput.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/ColorPicker/ColorPicker.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/ColorPicker/CustomColorList.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/ColorPicker/HotkeyLabel.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/ColorPicker/Picker.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/ColorPicker/PickerColorList.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/ColorPicker/PickerHeading.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/ColorPicker/ShadeList.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/ColorPicker/TopPicks.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/ColorPicker/colorPickerUtils.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/ColorPicker/keyboardNavHandlers.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/ConfirmDialog.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/ContextMenu.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/DarkModeToggle.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/DefaultSidebar.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/Dialog.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/DialogActionButton.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/ErrorDialog.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/ExcalidrawLogo.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/EyeDropper.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/FilledButton.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/FixedSideContainer.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/FollowMode/FollowMode.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/HandButton.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/HelpButton.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/HelpDialog.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/HintViewer.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/IconPicker.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/ImageExportDialog.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/InitializeApp.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/InlineIcon.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/Island.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/JSONExportDialog.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/LaserTool/LaserPathManager.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/LaserTool/LaserPointerButton.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/LaserTool/LaserTool.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/LayerUI.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/LibraryMenu.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/LibraryMenuBrowseButton.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/LibraryMenuControlButtons.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/LibraryMenuHeaderContent.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/LibraryMenuItems.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/LibraryMenuSection.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/LibraryUnit.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/LoadingMessage.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/LockButton.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/MagicButton.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/MagicSettings.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/MobileMenu.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/Modal.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/OverwriteConfirm/OverwriteConfirm.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/OverwriteConfirm/OverwriteConfirmActions.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/OverwriteConfirm/OverwriteConfirmState.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/Paragraph.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/PasteChartDialog.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/PenModeButton.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/Popover.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/ProjectName.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/PublishLibrary.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/RadioGroup.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/Section.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/ShareableLinkDialog.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/Sidebar/Sidebar.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/Sidebar/SidebarHeader.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/Sidebar/SidebarTab.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/Sidebar/SidebarTabTrigger.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/Sidebar/SidebarTabTriggers.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/Sidebar/SidebarTabs.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/Sidebar/SidebarTrigger.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/Sidebar/common.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/Spinner.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/Stack.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/Stats.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/Switch.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/TTDDialog/MermaidToExcalidraw.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/TTDDialog/TTDDialog.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/TTDDialog/TTDDialogInput.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/TTDDialog/TTDDialogOutput.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/TTDDialog/TTDDialogPanel.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/TTDDialog/TTDDialogPanels.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/TTDDialog/TTDDialogSubmitShortcut.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/TTDDialog/TTDDialogTab.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/TTDDialog/TTDDialogTabTrigger.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/TTDDialog/TTDDialogTabTriggers.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/TTDDialog/TTDDialogTabs.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/TTDDialog/TTDDialogTrigger.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/TTDDialog/common.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/TextField.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/Toast.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/ToolButton.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/Tooltip.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/Trans.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/UserList.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/canvases/InteractiveCanvas.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/canvases/StaticCanvas.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/canvases/index.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/dropdownMenu/DropdownMenu.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/dropdownMenu/DropdownMenuContent.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/dropdownMenu/DropdownMenuGroup.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/dropdownMenu/DropdownMenuItem.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/dropdownMenu/DropdownMenuItemContent.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/dropdownMenu/DropdownMenuItemCustom.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/dropdownMenu/DropdownMenuItemLink.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/dropdownMenu/DropdownMenuSeparator.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/dropdownMenu/DropdownMenuTrigger.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/dropdownMenu/common.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/dropdownMenu/dropdownMenuUtils.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/footer/Footer.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/footer/FooterCenter.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/hoc/withInternalFallback.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/icons.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/live-collaboration/LiveCollaborationTrigger.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/main-menu/DefaultItems.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/main-menu/MainMenu.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/welcome-screen/WelcomeScreen.Center.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/welcome-screen/WelcomeScreen.Hints.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/welcome-screen/WelcomeScreen.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/constants.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/context/tunnels.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/context/ui-appState.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/cursor.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/data/EditorLocalStorage.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/data/ai/types.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/data/blob.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/data/encode.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/data/encryption.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/data/filesystem.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/data/image.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/data/index.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/data/json.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/data/library.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/data/magic.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/data/resave.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/data/restore.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/data/transform.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/data/types.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/data/url.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/distribute.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/element/ElementCanvasButtons.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/element/Hyperlink.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/element/binding.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/element/bounds.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/element/collision.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/element/dragElements.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/element/embeddable.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/element/image.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/element/index.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/element/linearElementEditor.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/element/mutateElement.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/element/newElement.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/element/resizeElements.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/element/resizeTest.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/element/showSelectedShapeActions.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/element/sizeHelpers.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/element/sortElements.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/element/textElement.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/element/textWysiwyg.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/element/transformHandles.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/element/typeChecks.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/element/types.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/emitter.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/errors.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/frame.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/ga.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/gadirections.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/galines.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/gapoints.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/gatransforms.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/gesture.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/groups.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/history.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/hooks/useCallbackRefState.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/hooks/useCreatePortalContainer.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/hooks/useLibraryItemSvg.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/hooks/useOutsideClick.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/hooks/useScrollPosition.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/hooks/useStable.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/hooks/useTransition.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/i18n.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/jotai.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/keys.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/math.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/points.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/polyfill.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/random.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/renderer/renderElement.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/renderer/renderScene.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/renderer/renderSnaps.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/renderer/roundRect.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/scene/Fonts.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/scene/Renderer.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/scene/Scene.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/scene/Shape.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/scene/ShapeCache.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/scene/comparisons.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/scene/export.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/scene/index.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/scene/scroll.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/scene/scrollbars.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/scene/selection.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/scene/types.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/scene/zoom.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/shapes.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/snapping.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/types.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/utility-types.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/utils.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/zindex.d.ts +0 -0
- /package/{types → dist/packages}/utils/bbox.d.ts +0 -0
- /package/{types → dist/packages}/utils/export.d.ts +0 -0
- /package/{types → dist/packages}/utils/withinBounds.d.ts +0 -0
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { getSelectedElements, isSomeElementSelected } from "../scene";
|
|
3
|
+
import { KEYS } from "../keys";
|
|
4
|
+
import { ToolButton } from "../components/ToolButton";
|
|
5
|
+
import { t } from "../i18n";
|
|
6
|
+
import { register } from "./register";
|
|
7
|
+
import { getNonDeletedElements } from "../element";
|
|
8
|
+
import { newElementWith } from "../element/mutateElement";
|
|
9
|
+
import { getElementsInGroup } from "../groups";
|
|
10
|
+
import { LinearElementEditor } from "../element/linearElementEditor";
|
|
11
|
+
import { fixBindingsAfterDeletion } from "../element/binding";
|
|
12
|
+
import { isBoundToContainer, isFrameLikeElement } from "../element/typeChecks";
|
|
13
|
+
import { updateActiveTool } from "../utils";
|
|
14
|
+
import { TrashIcon } from "../components/icons";
|
|
15
|
+
const deleteSelectedElements = (elements, appState) => {
|
|
16
|
+
const framesToBeDeleted = new Set(getSelectedElements(elements.filter((el) => isFrameLikeElement(el)), appState).map((el) => el.id));
|
|
17
|
+
return {
|
|
18
|
+
elements: elements.map((el) => {
|
|
19
|
+
if (appState.selectedElementIds[el.id]) {
|
|
20
|
+
return newElementWith(el, { isDeleted: true });
|
|
21
|
+
}
|
|
22
|
+
if (el.frameId && framesToBeDeleted.has(el.frameId)) {
|
|
23
|
+
return newElementWith(el, { isDeleted: true });
|
|
24
|
+
}
|
|
25
|
+
if (isBoundToContainer(el) &&
|
|
26
|
+
appState.selectedElementIds[el.containerId]) {
|
|
27
|
+
return newElementWith(el, { isDeleted: true });
|
|
28
|
+
}
|
|
29
|
+
return el;
|
|
30
|
+
}),
|
|
31
|
+
appState: {
|
|
32
|
+
...appState,
|
|
33
|
+
selectedElementIds: {},
|
|
34
|
+
selectedGroupIds: {},
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
const handleGroupEditingState = (appState, elements) => {
|
|
39
|
+
if (appState.editingGroupId) {
|
|
40
|
+
const siblingElements = getElementsInGroup(getNonDeletedElements(elements), appState.editingGroupId);
|
|
41
|
+
if (siblingElements.length) {
|
|
42
|
+
return {
|
|
43
|
+
...appState,
|
|
44
|
+
selectedElementIds: { [siblingElements[0].id]: true },
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return appState;
|
|
49
|
+
};
|
|
50
|
+
export const actionDeleteSelected = register({
|
|
51
|
+
name: "deleteSelectedElements",
|
|
52
|
+
trackEvent: { category: "element", action: "delete" },
|
|
53
|
+
perform: (elements, appState) => {
|
|
54
|
+
if (appState.editingLinearElement) {
|
|
55
|
+
const { elementId, selectedPointsIndices, startBindingElement, endBindingElement, } = appState.editingLinearElement;
|
|
56
|
+
const element = LinearElementEditor.getElement(elementId);
|
|
57
|
+
if (!element) {
|
|
58
|
+
return false;
|
|
59
|
+
}
|
|
60
|
+
// case: no point selected → do nothing, as deleting the whole element
|
|
61
|
+
// is most likely a mistake, where you wanted to delete a specific point
|
|
62
|
+
// but failed to select it (or you thought it's selected, while it was
|
|
63
|
+
// only in a hover state)
|
|
64
|
+
if (selectedPointsIndices == null) {
|
|
65
|
+
return false;
|
|
66
|
+
}
|
|
67
|
+
// case: deleting last remaining point
|
|
68
|
+
if (element.points.length < 2) {
|
|
69
|
+
const nextElements = elements.map((el) => {
|
|
70
|
+
if (el.id === element.id) {
|
|
71
|
+
return newElementWith(el, { isDeleted: true });
|
|
72
|
+
}
|
|
73
|
+
return el;
|
|
74
|
+
});
|
|
75
|
+
const nextAppState = handleGroupEditingState(appState, nextElements);
|
|
76
|
+
return {
|
|
77
|
+
elements: nextElements,
|
|
78
|
+
appState: {
|
|
79
|
+
...nextAppState,
|
|
80
|
+
editingLinearElement: null,
|
|
81
|
+
},
|
|
82
|
+
commitToHistory: false,
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
// We cannot do this inside `movePoint` because it is also called
|
|
86
|
+
// when deleting the uncommitted point (which hasn't caused any binding)
|
|
87
|
+
const binding = {
|
|
88
|
+
startBindingElement: selectedPointsIndices?.includes(0)
|
|
89
|
+
? null
|
|
90
|
+
: startBindingElement,
|
|
91
|
+
endBindingElement: selectedPointsIndices?.includes(element.points.length - 1)
|
|
92
|
+
? null
|
|
93
|
+
: endBindingElement,
|
|
94
|
+
};
|
|
95
|
+
LinearElementEditor.deletePoints(element, selectedPointsIndices);
|
|
96
|
+
return {
|
|
97
|
+
elements,
|
|
98
|
+
appState: {
|
|
99
|
+
...appState,
|
|
100
|
+
editingLinearElement: {
|
|
101
|
+
...appState.editingLinearElement,
|
|
102
|
+
...binding,
|
|
103
|
+
selectedPointsIndices: selectedPointsIndices?.[0] > 0
|
|
104
|
+
? [selectedPointsIndices[0] - 1]
|
|
105
|
+
: [0],
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
commitToHistory: true,
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
let { elements: nextElements, appState: nextAppState } = deleteSelectedElements(elements, appState);
|
|
112
|
+
fixBindingsAfterDeletion(nextElements, elements.filter(({ id }) => appState.selectedElementIds[id]));
|
|
113
|
+
nextAppState = handleGroupEditingState(nextAppState, nextElements);
|
|
114
|
+
return {
|
|
115
|
+
elements: nextElements,
|
|
116
|
+
appState: {
|
|
117
|
+
...nextAppState,
|
|
118
|
+
activeTool: updateActiveTool(appState, { type: "selection" }),
|
|
119
|
+
multiElement: null,
|
|
120
|
+
activeEmbeddable: null,
|
|
121
|
+
},
|
|
122
|
+
commitToHistory: isSomeElementSelected(getNonDeletedElements(elements), appState),
|
|
123
|
+
};
|
|
124
|
+
},
|
|
125
|
+
contextItemLabel: "labels.delete",
|
|
126
|
+
keyTest: (event, appState, elements) => (event.key === KEYS.BACKSPACE || event.key === KEYS.DELETE) &&
|
|
127
|
+
!event[KEYS.CTRL_OR_CMD],
|
|
128
|
+
PanelComponent: ({ elements, appState, updateData }) => (_jsx(ToolButton, { type: "button", icon: TrashIcon, title: t("labels.delete"), "aria-label": t("labels.delete"), onClick: () => updateData(null), visible: isSomeElementSelected(getNonDeletedElements(elements), appState) })),
|
|
129
|
+
});
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { DistributeHorizontallyIcon, DistributeVerticallyIcon, } from "../components/icons";
|
|
3
|
+
import { ToolButton } from "../components/ToolButton";
|
|
4
|
+
import { distributeElements } from "../distribute";
|
|
5
|
+
import { getNonDeletedElements } from "../element";
|
|
6
|
+
import { isFrameLikeElement } from "../element/typeChecks";
|
|
7
|
+
import { updateFrameMembershipOfSelectedElements } from "../frame";
|
|
8
|
+
import { t } from "../i18n";
|
|
9
|
+
import { CODES, KEYS } from "../keys";
|
|
10
|
+
import { isSomeElementSelected } from "../scene";
|
|
11
|
+
import { arrayToMap, getShortcutKey } from "../utils";
|
|
12
|
+
import { register } from "./register";
|
|
13
|
+
const enableActionGroup = (appState, app) => {
|
|
14
|
+
const selectedElements = app.scene.getSelectedElements(appState);
|
|
15
|
+
return (selectedElements.length > 1 &&
|
|
16
|
+
// TODO enable distributing frames when implemented properly
|
|
17
|
+
!selectedElements.some((el) => isFrameLikeElement(el)));
|
|
18
|
+
};
|
|
19
|
+
const distributeSelectedElements = (elements, appState, app, distribution) => {
|
|
20
|
+
const selectedElements = app.scene.getSelectedElements(appState);
|
|
21
|
+
const updatedElements = distributeElements(selectedElements, distribution);
|
|
22
|
+
const updatedElementsMap = arrayToMap(updatedElements);
|
|
23
|
+
return updateFrameMembershipOfSelectedElements(elements.map((element) => updatedElementsMap.get(element.id) || element), appState, app);
|
|
24
|
+
};
|
|
25
|
+
export const distributeHorizontally = register({
|
|
26
|
+
name: "distributeHorizontally",
|
|
27
|
+
trackEvent: { category: "element" },
|
|
28
|
+
perform: (elements, appState, _, app) => {
|
|
29
|
+
return {
|
|
30
|
+
appState,
|
|
31
|
+
elements: distributeSelectedElements(elements, appState, app, {
|
|
32
|
+
space: "between",
|
|
33
|
+
axis: "x",
|
|
34
|
+
}),
|
|
35
|
+
commitToHistory: true,
|
|
36
|
+
};
|
|
37
|
+
},
|
|
38
|
+
keyTest: (event) => !event[KEYS.CTRL_OR_CMD] && event.altKey && event.code === CODES.H,
|
|
39
|
+
PanelComponent: ({ elements, appState, updateData, app }) => (_jsx(ToolButton, { hidden: !enableActionGroup(appState, app), type: "button", icon: DistributeHorizontallyIcon, onClick: () => updateData(null), title: `${t("labels.distributeHorizontally")} — ${getShortcutKey("Alt+H")}`, "aria-label": t("labels.distributeHorizontally"), visible: isSomeElementSelected(getNonDeletedElements(elements), appState) })),
|
|
40
|
+
});
|
|
41
|
+
export const distributeVertically = register({
|
|
42
|
+
name: "distributeVertically",
|
|
43
|
+
trackEvent: { category: "element" },
|
|
44
|
+
perform: (elements, appState, _, app) => {
|
|
45
|
+
return {
|
|
46
|
+
appState,
|
|
47
|
+
elements: distributeSelectedElements(elements, appState, app, {
|
|
48
|
+
space: "between",
|
|
49
|
+
axis: "y",
|
|
50
|
+
}),
|
|
51
|
+
commitToHistory: true,
|
|
52
|
+
};
|
|
53
|
+
},
|
|
54
|
+
keyTest: (event) => !event[KEYS.CTRL_OR_CMD] && event.altKey && event.code === CODES.V,
|
|
55
|
+
PanelComponent: ({ elements, appState, updateData, app }) => (_jsx(ToolButton, { hidden: !enableActionGroup(appState, app), type: "button", icon: DistributeVerticallyIcon, onClick: () => updateData(null), title: `${t("labels.distributeVertically")} — ${getShortcutKey("Alt+V")}`, "aria-label": t("labels.distributeVertically"), visible: isSomeElementSelected(getNonDeletedElements(elements), appState) })),
|
|
56
|
+
});
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { KEYS } from "../keys";
|
|
3
|
+
import { register } from "./register";
|
|
4
|
+
import { duplicateElement, getNonDeletedElements } from "../element";
|
|
5
|
+
import { isSomeElementSelected } from "../scene";
|
|
6
|
+
import { ToolButton } from "../components/ToolButton";
|
|
7
|
+
import { t } from "../i18n";
|
|
8
|
+
import { arrayToMap, getShortcutKey } from "../utils";
|
|
9
|
+
import { LinearElementEditor } from "../element/linearElementEditor";
|
|
10
|
+
import { selectGroupsForSelectedElements, getSelectedGroupForElement, getElementsInGroup, } from "../groups";
|
|
11
|
+
import { fixBindingsAfterDuplication } from "../element/binding";
|
|
12
|
+
import { GRID_SIZE } from "../constants";
|
|
13
|
+
import { bindTextToShapeAfterDuplication, getBoundTextElement, } from "../element/textElement";
|
|
14
|
+
import { isBoundToContainer, isFrameLikeElement } from "../element/typeChecks";
|
|
15
|
+
import { normalizeElementOrder } from "../element/sortElements";
|
|
16
|
+
import { DuplicateIcon } from "../components/icons";
|
|
17
|
+
import { bindElementsToFramesAfterDuplication, getFrameChildren, } from "../frame";
|
|
18
|
+
import { excludeElementsInFramesFromSelection, getSelectedElements, } from "../scene/selection";
|
|
19
|
+
export const actionDuplicateSelection = register({
|
|
20
|
+
name: "duplicateSelection",
|
|
21
|
+
trackEvent: { category: "element" },
|
|
22
|
+
perform: (elements, appState) => {
|
|
23
|
+
// duplicate selected point(s) if editing a line
|
|
24
|
+
if (appState.editingLinearElement) {
|
|
25
|
+
const ret = LinearElementEditor.duplicateSelectedPoints(appState);
|
|
26
|
+
if (!ret) {
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
return {
|
|
30
|
+
elements,
|
|
31
|
+
appState: ret.appState,
|
|
32
|
+
commitToHistory: true,
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
return {
|
|
36
|
+
...duplicateElements(elements, appState),
|
|
37
|
+
commitToHistory: true,
|
|
38
|
+
};
|
|
39
|
+
},
|
|
40
|
+
contextItemLabel: "labels.duplicateSelection",
|
|
41
|
+
keyTest: (event) => event[KEYS.CTRL_OR_CMD] && event.key === KEYS.D,
|
|
42
|
+
PanelComponent: ({ elements, appState, updateData }) => (_jsx(ToolButton, { type: "button", icon: DuplicateIcon, title: `${t("labels.duplicateSelection")} — ${getShortcutKey("CtrlOrCmd+D")}`, "aria-label": t("labels.duplicateSelection"), onClick: () => updateData(null), visible: isSomeElementSelected(getNonDeletedElements(elements), appState) })),
|
|
43
|
+
});
|
|
44
|
+
const duplicateElements = (elements, appState) => {
|
|
45
|
+
// ---------------------------------------------------------------------------
|
|
46
|
+
// step (1)
|
|
47
|
+
const sortedElements = normalizeElementOrder(elements);
|
|
48
|
+
const groupIdMap = new Map();
|
|
49
|
+
const newElements = [];
|
|
50
|
+
const oldElements = [];
|
|
51
|
+
const oldIdToDuplicatedId = new Map();
|
|
52
|
+
const duplicateAndOffsetElement = (element) => {
|
|
53
|
+
const newElement = duplicateElement(appState.editingGroupId, groupIdMap, element, {
|
|
54
|
+
x: element.x + GRID_SIZE / 2,
|
|
55
|
+
y: element.y + GRID_SIZE / 2,
|
|
56
|
+
});
|
|
57
|
+
oldIdToDuplicatedId.set(element.id, newElement.id);
|
|
58
|
+
oldElements.push(element);
|
|
59
|
+
newElements.push(newElement);
|
|
60
|
+
return newElement;
|
|
61
|
+
};
|
|
62
|
+
const idsOfElementsToDuplicate = arrayToMap(getSelectedElements(sortedElements, appState, {
|
|
63
|
+
includeBoundTextElement: true,
|
|
64
|
+
includeElementsInFrames: true,
|
|
65
|
+
}));
|
|
66
|
+
// Ids of elements that have already been processed so we don't push them
|
|
67
|
+
// into the array twice if we end up backtracking when retrieving
|
|
68
|
+
// discontiguous group of elements (can happen due to a bug, or in edge
|
|
69
|
+
// cases such as a group containing deleted elements which were not selected).
|
|
70
|
+
//
|
|
71
|
+
// This is not enough to prevent duplicates, so we do a second loop afterwards
|
|
72
|
+
// to remove them.
|
|
73
|
+
//
|
|
74
|
+
// For convenience we mark even the newly created ones even though we don't
|
|
75
|
+
// loop over them.
|
|
76
|
+
const processedIds = new Map();
|
|
77
|
+
const markAsProcessed = (elements) => {
|
|
78
|
+
for (const element of elements) {
|
|
79
|
+
processedIds.set(element.id, true);
|
|
80
|
+
}
|
|
81
|
+
return elements;
|
|
82
|
+
};
|
|
83
|
+
const elementsWithClones = [];
|
|
84
|
+
let index = -1;
|
|
85
|
+
while (++index < sortedElements.length) {
|
|
86
|
+
const element = sortedElements[index];
|
|
87
|
+
if (processedIds.get(element.id)) {
|
|
88
|
+
continue;
|
|
89
|
+
}
|
|
90
|
+
const boundTextElement = getBoundTextElement(element);
|
|
91
|
+
const isElementAFrameLike = isFrameLikeElement(element);
|
|
92
|
+
if (idsOfElementsToDuplicate.get(element.id)) {
|
|
93
|
+
// if a group or a container/bound-text or frame, duplicate atomically
|
|
94
|
+
if (element.groupIds.length || boundTextElement || isElementAFrameLike) {
|
|
95
|
+
const groupId = getSelectedGroupForElement(appState, element);
|
|
96
|
+
if (groupId) {
|
|
97
|
+
// TODO:
|
|
98
|
+
// remove `.flatMap...`
|
|
99
|
+
// if the elements in a frame are grouped when the frame is grouped
|
|
100
|
+
const groupElements = getElementsInGroup(sortedElements, groupId).flatMap((element) => isFrameLikeElement(element)
|
|
101
|
+
? [...getFrameChildren(elements, element.id), element]
|
|
102
|
+
: [element]);
|
|
103
|
+
elementsWithClones.push(...markAsProcessed([
|
|
104
|
+
...groupElements,
|
|
105
|
+
...groupElements.map((element) => duplicateAndOffsetElement(element)),
|
|
106
|
+
]));
|
|
107
|
+
continue;
|
|
108
|
+
}
|
|
109
|
+
if (boundTextElement) {
|
|
110
|
+
elementsWithClones.push(...markAsProcessed([
|
|
111
|
+
element,
|
|
112
|
+
boundTextElement,
|
|
113
|
+
duplicateAndOffsetElement(element),
|
|
114
|
+
duplicateAndOffsetElement(boundTextElement),
|
|
115
|
+
]));
|
|
116
|
+
continue;
|
|
117
|
+
}
|
|
118
|
+
if (isElementAFrameLike) {
|
|
119
|
+
const elementsInFrame = getFrameChildren(sortedElements, element.id);
|
|
120
|
+
elementsWithClones.push(...markAsProcessed([
|
|
121
|
+
...elementsInFrame,
|
|
122
|
+
element,
|
|
123
|
+
...elementsInFrame.map((e) => duplicateAndOffsetElement(e)),
|
|
124
|
+
duplicateAndOffsetElement(element),
|
|
125
|
+
]));
|
|
126
|
+
continue;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
// since elements in frames have a lower z-index than the frame itself,
|
|
130
|
+
// they will be looped first and if their frames are selected as well,
|
|
131
|
+
// they will have been copied along with the frame atomically in the
|
|
132
|
+
// above branch, so we must skip those elements here
|
|
133
|
+
//
|
|
134
|
+
// now, for elements do not belong any frames or elements whose frames
|
|
135
|
+
// are selected (or elements that are left out from the above
|
|
136
|
+
// steps for whatever reason) we (should at least) duplicate them here
|
|
137
|
+
if (!element.frameId || !idsOfElementsToDuplicate.has(element.frameId)) {
|
|
138
|
+
elementsWithClones.push(...markAsProcessed([element, duplicateAndOffsetElement(element)]));
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
else {
|
|
142
|
+
elementsWithClones.push(...markAsProcessed([element]));
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
// step (2)
|
|
146
|
+
// second pass to remove duplicates. We loop from the end as it's likelier
|
|
147
|
+
// that the last elements are in the correct order (contiguous or otherwise).
|
|
148
|
+
// Thus we need to reverse as the last step (3).
|
|
149
|
+
const finalElementsReversed = [];
|
|
150
|
+
const finalElementIds = new Map();
|
|
151
|
+
index = elementsWithClones.length;
|
|
152
|
+
while (--index >= 0) {
|
|
153
|
+
const element = elementsWithClones[index];
|
|
154
|
+
if (!finalElementIds.get(element.id)) {
|
|
155
|
+
finalElementIds.set(element.id, true);
|
|
156
|
+
finalElementsReversed.push(element);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
// step (3)
|
|
160
|
+
const finalElements = finalElementsReversed.reverse();
|
|
161
|
+
// ---------------------------------------------------------------------------
|
|
162
|
+
bindTextToShapeAfterDuplication(elementsWithClones, oldElements, oldIdToDuplicatedId);
|
|
163
|
+
fixBindingsAfterDuplication(elementsWithClones, oldElements, oldIdToDuplicatedId);
|
|
164
|
+
bindElementsToFramesAfterDuplication(finalElements, oldElements, oldIdToDuplicatedId);
|
|
165
|
+
const nextElementsToSelect = excludeElementsInFramesFromSelection(newElements);
|
|
166
|
+
return {
|
|
167
|
+
elements: finalElements,
|
|
168
|
+
appState: {
|
|
169
|
+
...appState,
|
|
170
|
+
...selectGroupsForSelectedElements({
|
|
171
|
+
editingGroupId: appState.editingGroupId,
|
|
172
|
+
selectedElementIds: nextElementsToSelect.reduce((acc, element) => {
|
|
173
|
+
if (!isBoundToContainer(element)) {
|
|
174
|
+
acc[element.id] = true;
|
|
175
|
+
}
|
|
176
|
+
return acc;
|
|
177
|
+
}, {}),
|
|
178
|
+
}, getNonDeletedElements(finalElements), appState, null),
|
|
179
|
+
},
|
|
180
|
+
};
|
|
181
|
+
};
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { newElementWith } from "../element/mutateElement";
|
|
2
|
+
import { isFrameLikeElement } from "../element/typeChecks";
|
|
3
|
+
import { KEYS } from "../keys";
|
|
4
|
+
import { arrayToMap } from "../utils";
|
|
5
|
+
import { register } from "./register";
|
|
6
|
+
const shouldLock = (elements) => elements.every((el) => !el.locked);
|
|
7
|
+
export const actionToggleElementLock = register({
|
|
8
|
+
name: "toggleElementLock",
|
|
9
|
+
trackEvent: { category: "element" },
|
|
10
|
+
predicate: (elements, appState, _, app) => {
|
|
11
|
+
const selectedElements = app.scene.getSelectedElements(appState);
|
|
12
|
+
return !selectedElements.some((element) => element.locked && element.frameId);
|
|
13
|
+
},
|
|
14
|
+
perform: (elements, appState, _, app) => {
|
|
15
|
+
const selectedElements = app.scene.getSelectedElements({
|
|
16
|
+
selectedElementIds: appState.selectedElementIds,
|
|
17
|
+
includeBoundTextElement: true,
|
|
18
|
+
includeElementsInFrames: true,
|
|
19
|
+
});
|
|
20
|
+
if (!selectedElements.length) {
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
23
|
+
const nextLockState = shouldLock(selectedElements);
|
|
24
|
+
const selectedElementsMap = arrayToMap(selectedElements);
|
|
25
|
+
return {
|
|
26
|
+
elements: elements.map((element) => {
|
|
27
|
+
if (!selectedElementsMap.has(element.id)) {
|
|
28
|
+
return element;
|
|
29
|
+
}
|
|
30
|
+
return newElementWith(element, { locked: nextLockState });
|
|
31
|
+
}),
|
|
32
|
+
appState: {
|
|
33
|
+
...appState,
|
|
34
|
+
selectedLinearElement: nextLockState
|
|
35
|
+
? null
|
|
36
|
+
: appState.selectedLinearElement,
|
|
37
|
+
},
|
|
38
|
+
commitToHistory: true,
|
|
39
|
+
};
|
|
40
|
+
},
|
|
41
|
+
contextItemLabel: (elements, appState, app) => {
|
|
42
|
+
const selected = app.scene.getSelectedElements({
|
|
43
|
+
selectedElementIds: appState.selectedElementIds,
|
|
44
|
+
includeBoundTextElement: false,
|
|
45
|
+
});
|
|
46
|
+
if (selected.length === 1 && !isFrameLikeElement(selected[0])) {
|
|
47
|
+
return selected[0].locked
|
|
48
|
+
? "labels.elementLock.unlock"
|
|
49
|
+
: "labels.elementLock.lock";
|
|
50
|
+
}
|
|
51
|
+
return shouldLock(selected)
|
|
52
|
+
? "labels.elementLock.lockAll"
|
|
53
|
+
: "labels.elementLock.unlockAll";
|
|
54
|
+
},
|
|
55
|
+
keyTest: (event, appState, elements, app) => {
|
|
56
|
+
return (event.key.toLocaleLowerCase() === KEYS.L &&
|
|
57
|
+
event[KEYS.CTRL_OR_CMD] &&
|
|
58
|
+
event.shiftKey &&
|
|
59
|
+
app.scene.getSelectedElements({
|
|
60
|
+
selectedElementIds: appState.selectedElementIds,
|
|
61
|
+
includeBoundTextElement: false,
|
|
62
|
+
}).length > 0);
|
|
63
|
+
},
|
|
64
|
+
});
|
|
65
|
+
export const actionUnlockAllElements = register({
|
|
66
|
+
name: "unlockAllElements",
|
|
67
|
+
trackEvent: { category: "canvas" },
|
|
68
|
+
viewMode: false,
|
|
69
|
+
predicate: (elements) => {
|
|
70
|
+
return elements.some((element) => element.locked);
|
|
71
|
+
},
|
|
72
|
+
perform: (elements, appState) => {
|
|
73
|
+
const lockedElements = elements.filter((el) => el.locked);
|
|
74
|
+
return {
|
|
75
|
+
elements: elements.map((element) => {
|
|
76
|
+
if (element.locked) {
|
|
77
|
+
return newElementWith(element, { locked: false });
|
|
78
|
+
}
|
|
79
|
+
return element;
|
|
80
|
+
}),
|
|
81
|
+
appState: {
|
|
82
|
+
...appState,
|
|
83
|
+
selectedElementIds: Object.fromEntries(lockedElements.map((el) => [el.id, true])),
|
|
84
|
+
},
|
|
85
|
+
commitToHistory: true,
|
|
86
|
+
};
|
|
87
|
+
},
|
|
88
|
+
contextItemLabel: "labels.elementLock.unlockAll",
|
|
89
|
+
});
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { questionCircle, saveAs } from "../components/icons";
|
|
3
|
+
import { ProjectName } from "../components/ProjectName";
|
|
4
|
+
import { ToolButton } from "../components/ToolButton";
|
|
5
|
+
import { Tooltip } from "../components/Tooltip";
|
|
6
|
+
import { DarkModeToggle } from "../components/DarkModeToggle";
|
|
7
|
+
import { loadFromJSON, saveAsJSON } from "../data";
|
|
8
|
+
import { resaveAsImageWithScene } from "../data/resave";
|
|
9
|
+
import { t } from "../i18n";
|
|
10
|
+
import { useDevice } from "../components/App";
|
|
11
|
+
import { KEYS } from "../keys";
|
|
12
|
+
import { register } from "./register";
|
|
13
|
+
import { CheckboxItem } from "../components/CheckboxItem";
|
|
14
|
+
import { getExportSize } from "../scene/export";
|
|
15
|
+
import { DEFAULT_EXPORT_PADDING, EXPORT_SCALES, THEME } from "../constants";
|
|
16
|
+
import { getSelectedElements, isSomeElementSelected } from "../scene";
|
|
17
|
+
import { getNonDeletedElements } from "../element";
|
|
18
|
+
import { isImageFileHandle } from "../data/blob";
|
|
19
|
+
import { nativeFileSystemSupported } from "../data/filesystem";
|
|
20
|
+
import "../components/ToolIcon.scss";
|
|
21
|
+
export const actionChangeProjectName = register({
|
|
22
|
+
name: "changeProjectName",
|
|
23
|
+
trackEvent: false,
|
|
24
|
+
perform: (_elements, appState, value) => {
|
|
25
|
+
return { appState: { ...appState, name: value }, commitToHistory: false };
|
|
26
|
+
},
|
|
27
|
+
PanelComponent: ({ appState, updateData, appProps, data }) => (_jsx(ProjectName, { label: t("labels.fileTitle"), value: appState.name || "Unnamed", onChange: (name) => updateData(name), isNameEditable: typeof appProps.name === "undefined" && !appState.viewModeEnabled, ignoreFocus: data?.ignoreFocus ?? false })),
|
|
28
|
+
});
|
|
29
|
+
export const actionChangeExportScale = register({
|
|
30
|
+
name: "changeExportScale",
|
|
31
|
+
trackEvent: { category: "export", action: "scale" },
|
|
32
|
+
perform: (_elements, appState, value) => {
|
|
33
|
+
return {
|
|
34
|
+
appState: { ...appState, exportScale: value },
|
|
35
|
+
commitToHistory: false,
|
|
36
|
+
};
|
|
37
|
+
},
|
|
38
|
+
PanelComponent: ({ elements: allElements, appState, updateData }) => {
|
|
39
|
+
const elements = getNonDeletedElements(allElements);
|
|
40
|
+
const exportSelected = isSomeElementSelected(elements, appState);
|
|
41
|
+
const exportedElements = exportSelected
|
|
42
|
+
? getSelectedElements(elements, appState)
|
|
43
|
+
: elements;
|
|
44
|
+
return (_jsx(_Fragment, { children: EXPORT_SCALES.map((s) => {
|
|
45
|
+
const [width, height] = getExportSize(exportedElements, DEFAULT_EXPORT_PADDING, s);
|
|
46
|
+
const scaleButtonTitle = `${t("imageExportDialog.label.scale")} ${s}x (${width}x${height})`;
|
|
47
|
+
return (_jsx(ToolButton, { size: "small", type: "radio", icon: `${s}x`, name: "export-canvas-scale", title: scaleButtonTitle, "aria-label": scaleButtonTitle, id: "export-canvas-scale", checked: s === appState.exportScale, onChange: () => updateData(s) }, s));
|
|
48
|
+
}) }));
|
|
49
|
+
},
|
|
50
|
+
});
|
|
51
|
+
export const actionChangeExportBackground = register({
|
|
52
|
+
name: "changeExportBackground",
|
|
53
|
+
trackEvent: { category: "export", action: "toggleBackground" },
|
|
54
|
+
perform: (_elements, appState, value) => {
|
|
55
|
+
return {
|
|
56
|
+
appState: { ...appState, exportBackground: value },
|
|
57
|
+
commitToHistory: false,
|
|
58
|
+
};
|
|
59
|
+
},
|
|
60
|
+
PanelComponent: ({ appState, updateData }) => (_jsx(CheckboxItem, { checked: appState.exportBackground, onChange: (checked) => updateData(checked), children: t("imageExportDialog.label.withBackground") })),
|
|
61
|
+
});
|
|
62
|
+
export const actionChangeExportEmbedScene = register({
|
|
63
|
+
name: "changeExportEmbedScene",
|
|
64
|
+
trackEvent: { category: "export", action: "embedScene" },
|
|
65
|
+
perform: (_elements, appState, value) => {
|
|
66
|
+
return {
|
|
67
|
+
appState: { ...appState, exportEmbedScene: value },
|
|
68
|
+
commitToHistory: false,
|
|
69
|
+
};
|
|
70
|
+
},
|
|
71
|
+
PanelComponent: ({ appState, updateData }) => (_jsxs(CheckboxItem, { checked: appState.exportEmbedScene, onChange: (checked) => updateData(checked), children: [t("imageExportDialog.label.embedScene"), _jsx(Tooltip, { label: t("imageExportDialog.tooltip.embedScene"), long: true, children: _jsx("div", { className: "excalidraw-tooltip-icon", children: questionCircle }) })] })),
|
|
72
|
+
});
|
|
73
|
+
export const actionSaveToActiveFile = register({
|
|
74
|
+
name: "saveToActiveFile",
|
|
75
|
+
trackEvent: { category: "export" },
|
|
76
|
+
predicate: (elements, appState, props, app) => {
|
|
77
|
+
return (!!app.props.UIOptions.canvasActions.saveToActiveFile &&
|
|
78
|
+
!!appState.fileHandle &&
|
|
79
|
+
!appState.viewModeEnabled);
|
|
80
|
+
},
|
|
81
|
+
perform: async (elements, appState, value, app) => {
|
|
82
|
+
const fileHandleExists = !!appState.fileHandle;
|
|
83
|
+
try {
|
|
84
|
+
const { fileHandle } = isImageFileHandle(appState.fileHandle)
|
|
85
|
+
? await resaveAsImageWithScene(elements, appState, app.files)
|
|
86
|
+
: await saveAsJSON(elements, appState, app.files);
|
|
87
|
+
return {
|
|
88
|
+
commitToHistory: false,
|
|
89
|
+
appState: {
|
|
90
|
+
...appState,
|
|
91
|
+
fileHandle,
|
|
92
|
+
toast: fileHandleExists
|
|
93
|
+
? {
|
|
94
|
+
message: fileHandle?.name
|
|
95
|
+
? t("toast.fileSavedToFilename").replace("{filename}", `"${fileHandle.name}"`)
|
|
96
|
+
: t("toast.fileSaved"),
|
|
97
|
+
}
|
|
98
|
+
: null,
|
|
99
|
+
},
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
catch (error) {
|
|
103
|
+
if (error?.name !== "AbortError") {
|
|
104
|
+
console.error(error);
|
|
105
|
+
}
|
|
106
|
+
else {
|
|
107
|
+
console.warn(error);
|
|
108
|
+
}
|
|
109
|
+
return { commitToHistory: false };
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
keyTest: (event) => event.key === KEYS.S && event[KEYS.CTRL_OR_CMD] && !event.shiftKey,
|
|
113
|
+
});
|
|
114
|
+
export const actionSaveFileToDisk = register({
|
|
115
|
+
name: "saveFileToDisk",
|
|
116
|
+
viewMode: true,
|
|
117
|
+
trackEvent: { category: "export" },
|
|
118
|
+
perform: async (elements, appState, value, app) => {
|
|
119
|
+
try {
|
|
120
|
+
const { fileHandle } = await saveAsJSON(elements, {
|
|
121
|
+
...appState,
|
|
122
|
+
fileHandle: null,
|
|
123
|
+
}, app.files);
|
|
124
|
+
return {
|
|
125
|
+
commitToHistory: false,
|
|
126
|
+
appState: {
|
|
127
|
+
...appState,
|
|
128
|
+
openDialog: null,
|
|
129
|
+
fileHandle,
|
|
130
|
+
toast: { message: t("toast.fileSaved") },
|
|
131
|
+
},
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
catch (error) {
|
|
135
|
+
if (error?.name !== "AbortError") {
|
|
136
|
+
console.error(error);
|
|
137
|
+
}
|
|
138
|
+
else {
|
|
139
|
+
console.warn(error);
|
|
140
|
+
}
|
|
141
|
+
return { commitToHistory: false };
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
keyTest: (event) => event.key === KEYS.S && event.shiftKey && event[KEYS.CTRL_OR_CMD],
|
|
145
|
+
PanelComponent: ({ updateData }) => (_jsx(ToolButton, { type: "button", icon: saveAs, title: t("buttons.saveAs"), "aria-label": t("buttons.saveAs"), showAriaLabel: useDevice().editor.isMobile, hidden: !nativeFileSystemSupported, onClick: () => updateData(null), "data-testid": "save-as-button" })),
|
|
146
|
+
});
|
|
147
|
+
export const actionLoadScene = register({
|
|
148
|
+
name: "loadScene",
|
|
149
|
+
trackEvent: { category: "export" },
|
|
150
|
+
predicate: (elements, appState, props, app) => {
|
|
151
|
+
return (!!app.props.UIOptions.canvasActions.loadScene && !appState.viewModeEnabled);
|
|
152
|
+
},
|
|
153
|
+
perform: async (elements, appState, _, app) => {
|
|
154
|
+
try {
|
|
155
|
+
const { elements: loadedElements, appState: loadedAppState, files, } = await loadFromJSON(appState, elements);
|
|
156
|
+
return {
|
|
157
|
+
elements: loadedElements,
|
|
158
|
+
appState: loadedAppState,
|
|
159
|
+
files,
|
|
160
|
+
commitToHistory: true,
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
catch (error) {
|
|
164
|
+
if (error?.name === "AbortError") {
|
|
165
|
+
console.warn(error);
|
|
166
|
+
return false;
|
|
167
|
+
}
|
|
168
|
+
return {
|
|
169
|
+
elements,
|
|
170
|
+
appState: { ...appState, errorMessage: error.message },
|
|
171
|
+
files: app.files,
|
|
172
|
+
commitToHistory: false,
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
},
|
|
176
|
+
keyTest: (event) => event[KEYS.CTRL_OR_CMD] && event.key === KEYS.O,
|
|
177
|
+
});
|
|
178
|
+
export const actionExportWithDarkMode = register({
|
|
179
|
+
name: "exportWithDarkMode",
|
|
180
|
+
trackEvent: { category: "export", action: "toggleTheme" },
|
|
181
|
+
perform: (_elements, appState, value) => {
|
|
182
|
+
return {
|
|
183
|
+
appState: { ...appState, exportWithDarkMode: value },
|
|
184
|
+
commitToHistory: false,
|
|
185
|
+
};
|
|
186
|
+
},
|
|
187
|
+
PanelComponent: ({ appState, updateData }) => (_jsx("div", { style: {
|
|
188
|
+
display: "flex",
|
|
189
|
+
justifyContent: "flex-end",
|
|
190
|
+
marginTop: "-45px",
|
|
191
|
+
marginBottom: "10px",
|
|
192
|
+
}, children: _jsx(DarkModeToggle, { value: appState.exportWithDarkMode ? THEME.DARK : THEME.LIGHT, onChange: (theme) => {
|
|
193
|
+
updateData(theme === THEME.DARK);
|
|
194
|
+
}, title: t("imageExportDialog.label.darkMode") }) })),
|
|
195
|
+
});
|