@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,40 @@
|
|
|
1
|
+
import { KEYS } from "../keys";
|
|
2
|
+
import { register } from "./register";
|
|
3
|
+
import { selectGroupsForSelectedElements } from "../groups";
|
|
4
|
+
import { getNonDeletedElements, isTextElement } from "../element";
|
|
5
|
+
import { isLinearElement } from "../element/typeChecks";
|
|
6
|
+
import { LinearElementEditor } from "../element/linearElementEditor";
|
|
7
|
+
import { excludeElementsInFramesFromSelection } from "../scene/selection";
|
|
8
|
+
export const actionSelectAll = register({
|
|
9
|
+
name: "selectAll",
|
|
10
|
+
trackEvent: { category: "canvas" },
|
|
11
|
+
perform: (elements, appState, value, app) => {
|
|
12
|
+
if (appState.editingLinearElement) {
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
const selectedElementIds = excludeElementsInFramesFromSelection(elements.filter((element) => !element.isDeleted &&
|
|
16
|
+
!(isTextElement(element) && element.containerId) &&
|
|
17
|
+
!element.locked)).reduce((map, element) => {
|
|
18
|
+
map[element.id] = true;
|
|
19
|
+
return map;
|
|
20
|
+
}, {});
|
|
21
|
+
return {
|
|
22
|
+
appState: {
|
|
23
|
+
...appState,
|
|
24
|
+
...selectGroupsForSelectedElements({
|
|
25
|
+
editingGroupId: null,
|
|
26
|
+
selectedElementIds,
|
|
27
|
+
}, getNonDeletedElements(elements), appState, app),
|
|
28
|
+
selectedLinearElement:
|
|
29
|
+
// single linear element selected
|
|
30
|
+
Object.keys(selectedElementIds).length === 1 &&
|
|
31
|
+
isLinearElement(elements[0])
|
|
32
|
+
? new LinearElementEditor(elements[0], app.scene)
|
|
33
|
+
: null,
|
|
34
|
+
},
|
|
35
|
+
commitToHistory: true,
|
|
36
|
+
};
|
|
37
|
+
},
|
|
38
|
+
contextItemLabel: "labels.selectAll",
|
|
39
|
+
keyTest: (event) => event[KEYS.CTRL_OR_CMD] && event.key === KEYS.A,
|
|
40
|
+
});
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { isTextElement, isExcalidrawElement, redrawTextBoundingBox, } from "../element";
|
|
2
|
+
import { CODES, KEYS } from "../keys";
|
|
3
|
+
import { t } from "../i18n";
|
|
4
|
+
import { register } from "./register";
|
|
5
|
+
import { newElementWith } from "../element/mutateElement";
|
|
6
|
+
import { DEFAULT_FONT_SIZE, DEFAULT_FONT_FAMILY, DEFAULT_TEXT_ALIGN, } from "../constants";
|
|
7
|
+
import { getBoundTextElement, getDefaultLineHeight, } from "../element/textElement";
|
|
8
|
+
import { hasBoundTextElement, canApplyRoundnessTypeToElement, getDefaultRoundnessTypeForElement, isFrameLikeElement, isArrowElement, } from "../element/typeChecks";
|
|
9
|
+
import { getSelectedElements } from "../scene";
|
|
10
|
+
// `copiedStyles` is exported only for tests.
|
|
11
|
+
export let copiedStyles = "{}";
|
|
12
|
+
export const actionCopyStyles = register({
|
|
13
|
+
name: "copyStyles",
|
|
14
|
+
trackEvent: { category: "element" },
|
|
15
|
+
perform: (elements, appState) => {
|
|
16
|
+
const elementsCopied = [];
|
|
17
|
+
const element = elements.find((el) => appState.selectedElementIds[el.id]);
|
|
18
|
+
elementsCopied.push(element);
|
|
19
|
+
if (element && hasBoundTextElement(element)) {
|
|
20
|
+
const boundTextElement = getBoundTextElement(element);
|
|
21
|
+
elementsCopied.push(boundTextElement);
|
|
22
|
+
}
|
|
23
|
+
if (element) {
|
|
24
|
+
copiedStyles = JSON.stringify(elementsCopied);
|
|
25
|
+
}
|
|
26
|
+
return {
|
|
27
|
+
appState: {
|
|
28
|
+
...appState,
|
|
29
|
+
toast: { message: t("toast.copyStyles") },
|
|
30
|
+
},
|
|
31
|
+
commitToHistory: false,
|
|
32
|
+
};
|
|
33
|
+
},
|
|
34
|
+
contextItemLabel: "labels.copyStyles",
|
|
35
|
+
keyTest: (event) => event[KEYS.CTRL_OR_CMD] && event.altKey && event.code === CODES.C,
|
|
36
|
+
});
|
|
37
|
+
export const actionPasteStyles = register({
|
|
38
|
+
name: "pasteStyles",
|
|
39
|
+
trackEvent: { category: "element" },
|
|
40
|
+
perform: (elements, appState) => {
|
|
41
|
+
const elementsCopied = JSON.parse(copiedStyles);
|
|
42
|
+
const pastedElement = elementsCopied[0];
|
|
43
|
+
const boundTextElement = elementsCopied[1];
|
|
44
|
+
if (!isExcalidrawElement(pastedElement)) {
|
|
45
|
+
return { elements, commitToHistory: false };
|
|
46
|
+
}
|
|
47
|
+
const selectedElements = getSelectedElements(elements, appState, {
|
|
48
|
+
includeBoundTextElement: true,
|
|
49
|
+
});
|
|
50
|
+
const selectedElementIds = selectedElements.map((element) => element.id);
|
|
51
|
+
return {
|
|
52
|
+
elements: elements.map((element) => {
|
|
53
|
+
if (selectedElementIds.includes(element.id)) {
|
|
54
|
+
let elementStylesToCopyFrom = pastedElement;
|
|
55
|
+
if (isTextElement(element) && element.containerId) {
|
|
56
|
+
elementStylesToCopyFrom = boundTextElement;
|
|
57
|
+
}
|
|
58
|
+
if (!elementStylesToCopyFrom) {
|
|
59
|
+
return element;
|
|
60
|
+
}
|
|
61
|
+
let newElement = newElementWith(element, {
|
|
62
|
+
backgroundColor: elementStylesToCopyFrom?.backgroundColor,
|
|
63
|
+
strokeWidth: elementStylesToCopyFrom?.strokeWidth,
|
|
64
|
+
strokeColor: elementStylesToCopyFrom?.strokeColor,
|
|
65
|
+
strokeStyle: elementStylesToCopyFrom?.strokeStyle,
|
|
66
|
+
fillStyle: elementStylesToCopyFrom?.fillStyle,
|
|
67
|
+
opacity: elementStylesToCopyFrom?.opacity,
|
|
68
|
+
roughness: elementStylesToCopyFrom?.roughness,
|
|
69
|
+
roundness: elementStylesToCopyFrom.roundness
|
|
70
|
+
? canApplyRoundnessTypeToElement(elementStylesToCopyFrom.roundness.type, element)
|
|
71
|
+
? elementStylesToCopyFrom.roundness
|
|
72
|
+
: getDefaultRoundnessTypeForElement(element)
|
|
73
|
+
: null,
|
|
74
|
+
});
|
|
75
|
+
if (isTextElement(newElement)) {
|
|
76
|
+
const fontSize = elementStylesToCopyFrom.fontSize ||
|
|
77
|
+
DEFAULT_FONT_SIZE;
|
|
78
|
+
const fontFamily = elementStylesToCopyFrom.fontFamily ||
|
|
79
|
+
DEFAULT_FONT_FAMILY;
|
|
80
|
+
newElement = newElementWith(newElement, {
|
|
81
|
+
fontSize,
|
|
82
|
+
fontFamily,
|
|
83
|
+
textAlign: elementStylesToCopyFrom.textAlign ||
|
|
84
|
+
DEFAULT_TEXT_ALIGN,
|
|
85
|
+
lineHeight: elementStylesToCopyFrom.lineHeight ||
|
|
86
|
+
getDefaultLineHeight(fontFamily),
|
|
87
|
+
});
|
|
88
|
+
let container = null;
|
|
89
|
+
if (newElement.containerId) {
|
|
90
|
+
container =
|
|
91
|
+
selectedElements.find((element) => isTextElement(newElement) &&
|
|
92
|
+
element.id === newElement.containerId) || null;
|
|
93
|
+
}
|
|
94
|
+
redrawTextBoundingBox(newElement, container);
|
|
95
|
+
}
|
|
96
|
+
if (newElement.type === "arrow" &&
|
|
97
|
+
isArrowElement(elementStylesToCopyFrom)) {
|
|
98
|
+
newElement = newElementWith(newElement, {
|
|
99
|
+
startArrowhead: elementStylesToCopyFrom.startArrowhead,
|
|
100
|
+
endArrowhead: elementStylesToCopyFrom.endArrowhead,
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
if (isFrameLikeElement(element)) {
|
|
104
|
+
newElement = newElementWith(newElement, {
|
|
105
|
+
roundness: null,
|
|
106
|
+
backgroundColor: "transparent",
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
return newElement;
|
|
110
|
+
}
|
|
111
|
+
return element;
|
|
112
|
+
}),
|
|
113
|
+
commitToHistory: true,
|
|
114
|
+
};
|
|
115
|
+
},
|
|
116
|
+
contextItemLabel: "labels.pasteStyles",
|
|
117
|
+
keyTest: (event) => event[KEYS.CTRL_OR_CMD] && event.altKey && event.code === CODES.V,
|
|
118
|
+
});
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { CODES, KEYS } from "../keys";
|
|
2
|
+
import { register } from "./register";
|
|
3
|
+
import { GRID_SIZE } from "../constants";
|
|
4
|
+
export const actionToggleGridMode = register({
|
|
5
|
+
name: "gridMode",
|
|
6
|
+
viewMode: true,
|
|
7
|
+
trackEvent: {
|
|
8
|
+
category: "canvas",
|
|
9
|
+
predicate: (appState) => !appState.gridSize,
|
|
10
|
+
},
|
|
11
|
+
perform(elements, appState) {
|
|
12
|
+
return {
|
|
13
|
+
appState: {
|
|
14
|
+
...appState,
|
|
15
|
+
gridSize: this.checked(appState) ? null : GRID_SIZE,
|
|
16
|
+
objectsSnapModeEnabled: false,
|
|
17
|
+
},
|
|
18
|
+
commitToHistory: false,
|
|
19
|
+
};
|
|
20
|
+
},
|
|
21
|
+
checked: (appState) => appState.gridSize !== null,
|
|
22
|
+
predicate: (element, appState, props) => {
|
|
23
|
+
return typeof props.gridModeEnabled === "undefined";
|
|
24
|
+
},
|
|
25
|
+
contextItemLabel: "labels.showGrid",
|
|
26
|
+
keyTest: (event) => event[KEYS.CTRL_OR_CMD] && event.code === CODES.QUOTE,
|
|
27
|
+
});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { CODES, KEYS } from "../keys";
|
|
2
|
+
import { register } from "./register";
|
|
3
|
+
export const actionToggleObjectsSnapMode = register({
|
|
4
|
+
name: "objectsSnapMode",
|
|
5
|
+
viewMode: true,
|
|
6
|
+
trackEvent: {
|
|
7
|
+
category: "canvas",
|
|
8
|
+
predicate: (appState) => !appState.objectsSnapModeEnabled,
|
|
9
|
+
},
|
|
10
|
+
perform(elements, appState) {
|
|
11
|
+
return {
|
|
12
|
+
appState: {
|
|
13
|
+
...appState,
|
|
14
|
+
objectsSnapModeEnabled: !this.checked(appState),
|
|
15
|
+
gridSize: null,
|
|
16
|
+
},
|
|
17
|
+
commitToHistory: false,
|
|
18
|
+
};
|
|
19
|
+
},
|
|
20
|
+
checked: (appState) => appState.objectsSnapModeEnabled,
|
|
21
|
+
predicate: (elements, appState, appProps) => {
|
|
22
|
+
return typeof appProps.objectsSnapModeEnabled === "undefined";
|
|
23
|
+
},
|
|
24
|
+
contextItemLabel: "buttons.objectsSnapMode",
|
|
25
|
+
keyTest: (event) => !event[KEYS.CTRL_OR_CMD] && event.altKey && event.code === CODES.S,
|
|
26
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { register } from "./register";
|
|
2
|
+
import { CODES, KEYS } from "../keys";
|
|
3
|
+
export const actionToggleStats = register({
|
|
4
|
+
name: "stats",
|
|
5
|
+
viewMode: true,
|
|
6
|
+
trackEvent: { category: "menu" },
|
|
7
|
+
perform(elements, appState) {
|
|
8
|
+
return {
|
|
9
|
+
appState: {
|
|
10
|
+
...appState,
|
|
11
|
+
showStats: !this.checked(appState),
|
|
12
|
+
},
|
|
13
|
+
commitToHistory: false,
|
|
14
|
+
};
|
|
15
|
+
},
|
|
16
|
+
checked: (appState) => appState.showStats,
|
|
17
|
+
contextItemLabel: "stats.title",
|
|
18
|
+
keyTest: (event) => !event[KEYS.CTRL_OR_CMD] && event.altKey && event.code === CODES.SLASH,
|
|
19
|
+
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { CODES, KEYS } from "../keys";
|
|
2
|
+
import { register } from "./register";
|
|
3
|
+
export const actionToggleViewMode = register({
|
|
4
|
+
name: "viewMode",
|
|
5
|
+
viewMode: true,
|
|
6
|
+
trackEvent: {
|
|
7
|
+
category: "canvas",
|
|
8
|
+
predicate: (appState) => !appState.viewModeEnabled,
|
|
9
|
+
},
|
|
10
|
+
perform(elements, appState) {
|
|
11
|
+
return {
|
|
12
|
+
appState: {
|
|
13
|
+
...appState,
|
|
14
|
+
viewModeEnabled: !this.checked(appState),
|
|
15
|
+
},
|
|
16
|
+
commitToHistory: false,
|
|
17
|
+
};
|
|
18
|
+
},
|
|
19
|
+
checked: (appState) => appState.viewModeEnabled,
|
|
20
|
+
predicate: (elements, appState, appProps) => {
|
|
21
|
+
return typeof appProps.viewModeEnabled === "undefined";
|
|
22
|
+
},
|
|
23
|
+
contextItemLabel: "labels.viewMode",
|
|
24
|
+
keyTest: (event) => !event[KEYS.CTRL_OR_CMD] && event.altKey && event.code === CODES.R,
|
|
25
|
+
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { CODES, KEYS } from "../keys";
|
|
2
|
+
import { register } from "./register";
|
|
3
|
+
export const actionToggleZenMode = register({
|
|
4
|
+
name: "zenMode",
|
|
5
|
+
viewMode: true,
|
|
6
|
+
trackEvent: {
|
|
7
|
+
category: "canvas",
|
|
8
|
+
predicate: (appState) => !appState.zenModeEnabled,
|
|
9
|
+
},
|
|
10
|
+
perform(elements, appState) {
|
|
11
|
+
return {
|
|
12
|
+
appState: {
|
|
13
|
+
...appState,
|
|
14
|
+
zenModeEnabled: !this.checked(appState),
|
|
15
|
+
},
|
|
16
|
+
commitToHistory: false,
|
|
17
|
+
};
|
|
18
|
+
},
|
|
19
|
+
checked: (appState) => appState.zenModeEnabled,
|
|
20
|
+
predicate: (elements, appState, appProps) => {
|
|
21
|
+
return typeof appProps.zenModeEnabled === "undefined";
|
|
22
|
+
},
|
|
23
|
+
contextItemLabel: "buttons.zenMode",
|
|
24
|
+
keyTest: (event) => !event[KEYS.CTRL_OR_CMD] && event.altKey && event.code === CODES.Z,
|
|
25
|
+
});
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { moveOneLeft, moveOneRight, moveAllLeft, moveAllRight, } from "../zindex";
|
|
3
|
+
import { KEYS, CODES } from "../keys";
|
|
4
|
+
import { t } from "../i18n";
|
|
5
|
+
import { getShortcutKey } from "../utils";
|
|
6
|
+
import { register } from "./register";
|
|
7
|
+
import { BringForwardIcon, BringToFrontIcon, SendBackwardIcon, SendToBackIcon, } from "../components/icons";
|
|
8
|
+
import { isDarwin } from "../constants";
|
|
9
|
+
export const actionSendBackward = register({
|
|
10
|
+
name: "sendBackward",
|
|
11
|
+
trackEvent: { category: "element" },
|
|
12
|
+
perform: (elements, appState) => {
|
|
13
|
+
return {
|
|
14
|
+
elements: moveOneLeft(elements, appState),
|
|
15
|
+
appState,
|
|
16
|
+
commitToHistory: true,
|
|
17
|
+
};
|
|
18
|
+
},
|
|
19
|
+
contextItemLabel: "labels.sendBackward",
|
|
20
|
+
keyPriority: 40,
|
|
21
|
+
keyTest: (event) => event[KEYS.CTRL_OR_CMD] &&
|
|
22
|
+
!event.shiftKey &&
|
|
23
|
+
event.code === CODES.BRACKET_LEFT,
|
|
24
|
+
PanelComponent: ({ updateData, appState }) => (_jsx("button", { type: "button", className: "zIndexButton", onClick: () => updateData(null), title: `${t("labels.sendBackward")} — ${getShortcutKey("CtrlOrCmd+[")}`, children: SendBackwardIcon })),
|
|
25
|
+
});
|
|
26
|
+
export const actionBringForward = register({
|
|
27
|
+
name: "bringForward",
|
|
28
|
+
trackEvent: { category: "element" },
|
|
29
|
+
perform: (elements, appState) => {
|
|
30
|
+
return {
|
|
31
|
+
elements: moveOneRight(elements, appState),
|
|
32
|
+
appState,
|
|
33
|
+
commitToHistory: true,
|
|
34
|
+
};
|
|
35
|
+
},
|
|
36
|
+
contextItemLabel: "labels.bringForward",
|
|
37
|
+
keyPriority: 40,
|
|
38
|
+
keyTest: (event) => event[KEYS.CTRL_OR_CMD] &&
|
|
39
|
+
!event.shiftKey &&
|
|
40
|
+
event.code === CODES.BRACKET_RIGHT,
|
|
41
|
+
PanelComponent: ({ updateData, appState }) => (_jsx("button", { type: "button", className: "zIndexButton", onClick: () => updateData(null), title: `${t("labels.bringForward")} — ${getShortcutKey("CtrlOrCmd+]")}`, children: BringForwardIcon })),
|
|
42
|
+
});
|
|
43
|
+
export const actionSendToBack = register({
|
|
44
|
+
name: "sendToBack",
|
|
45
|
+
trackEvent: { category: "element" },
|
|
46
|
+
perform: (elements, appState) => {
|
|
47
|
+
return {
|
|
48
|
+
elements: moveAllLeft(elements, appState),
|
|
49
|
+
appState,
|
|
50
|
+
commitToHistory: true,
|
|
51
|
+
};
|
|
52
|
+
},
|
|
53
|
+
contextItemLabel: "labels.sendToBack",
|
|
54
|
+
keyTest: (event) => isDarwin
|
|
55
|
+
? event[KEYS.CTRL_OR_CMD] &&
|
|
56
|
+
event.altKey &&
|
|
57
|
+
event.code === CODES.BRACKET_LEFT
|
|
58
|
+
: event[KEYS.CTRL_OR_CMD] &&
|
|
59
|
+
event.shiftKey &&
|
|
60
|
+
event.code === CODES.BRACKET_LEFT,
|
|
61
|
+
PanelComponent: ({ updateData, appState }) => (_jsx("button", { type: "button", className: "zIndexButton", onClick: () => updateData(null), title: `${t("labels.sendToBack")} — ${isDarwin
|
|
62
|
+
? getShortcutKey("CtrlOrCmd+Alt+[")
|
|
63
|
+
: getShortcutKey("CtrlOrCmd+Shift+[")}`, children: SendToBackIcon })),
|
|
64
|
+
});
|
|
65
|
+
export const actionBringToFront = register({
|
|
66
|
+
name: "bringToFront",
|
|
67
|
+
trackEvent: { category: "element" },
|
|
68
|
+
perform: (elements, appState) => {
|
|
69
|
+
return {
|
|
70
|
+
elements: moveAllRight(elements, appState),
|
|
71
|
+
appState,
|
|
72
|
+
commitToHistory: true,
|
|
73
|
+
};
|
|
74
|
+
},
|
|
75
|
+
contextItemLabel: "labels.bringToFront",
|
|
76
|
+
keyTest: (event) => isDarwin
|
|
77
|
+
? event[KEYS.CTRL_OR_CMD] &&
|
|
78
|
+
event.altKey &&
|
|
79
|
+
event.code === CODES.BRACKET_RIGHT
|
|
80
|
+
: event[KEYS.CTRL_OR_CMD] &&
|
|
81
|
+
event.shiftKey &&
|
|
82
|
+
event.code === CODES.BRACKET_RIGHT,
|
|
83
|
+
PanelComponent: ({ updateData, appState }) => (_jsx("button", { type: "button", className: "zIndexButton", onClick: (event) => updateData(null), title: `${t("labels.bringToFront")} — ${isDarwin
|
|
84
|
+
? getShortcutKey("CtrlOrCmd+Alt+]")
|
|
85
|
+
: getShortcutKey("CtrlOrCmd+Shift+]")}`, children: BringToFrontIcon })),
|
|
86
|
+
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export { actionDeleteSelected } from "./actionDeleteSelected";
|
|
2
|
+
export { actionBringForward, actionBringToFront, actionSendBackward, actionSendToBack, } from "./actionZindex";
|
|
3
|
+
export { actionSelectAll } from "./actionSelectAll";
|
|
4
|
+
export { actionDuplicateSelection } from "./actionDuplicateSelection";
|
|
5
|
+
export { actionChangeStrokeColor, actionChangeBackgroundColor, actionChangeStrokeWidth, actionChangeFillStyle, actionChangeSloppiness, actionChangeOpacity, actionChangeFontSize, actionChangeFontFamily, actionChangeTextAlign, actionChangeVerticalAlign, } from "./actionProperties";
|
|
6
|
+
export { actionChangeViewBackgroundColor, actionClearCanvas, actionZoomIn, actionZoomOut, actionResetZoom, actionZoomToFit, actionToggleTheme, } from "./actionCanvas";
|
|
7
|
+
export { actionFinalize } from "./actionFinalize";
|
|
8
|
+
export { actionChangeProjectName, actionChangeExportBackground, actionSaveToActiveFile, actionSaveFileToDisk, actionLoadScene, } from "./actionExport";
|
|
9
|
+
export { actionCopyStyles, actionPasteStyles } from "./actionStyles";
|
|
10
|
+
export { actionToggleCanvasMenu, actionToggleEditMenu, actionShortcuts, } from "./actionMenu";
|
|
11
|
+
export { actionGroup, actionUngroup } from "./actionGroup";
|
|
12
|
+
export { actionGoToCollaborator } from "./actionNavigate";
|
|
13
|
+
export { actionAddToLibrary } from "./actionAddToLibrary";
|
|
14
|
+
export { actionAlignTop, actionAlignBottom, actionAlignLeft, actionAlignRight, actionAlignVerticallyCentered, actionAlignHorizontallyCentered, } from "./actionAlign";
|
|
15
|
+
export { distributeHorizontally, distributeVertically, } from "./actionDistribute";
|
|
16
|
+
export { actionFlipHorizontal, actionFlipVertical } from "./actionFlip";
|
|
17
|
+
export { actionCopy, actionCut, actionCopyAsPng, actionCopyAsSvg, copyText, } from "./actionClipboard";
|
|
18
|
+
export { actionToggleGridMode } from "./actionToggleGridMode";
|
|
19
|
+
export { actionToggleZenMode } from "./actionToggleZenMode";
|
|
20
|
+
export { actionToggleObjectsSnapMode } from "./actionToggleObjectsSnapMode";
|
|
21
|
+
export { actionToggleStats } from "./actionToggleStats";
|
|
22
|
+
export { actionUnbindText, actionBindText } from "./actionBoundText";
|
|
23
|
+
export { actionLink } from "../element/Hyperlink";
|
|
24
|
+
export { actionToggleElementLock } from "./actionElementLock";
|
|
25
|
+
export { actionToggleLinearEditor } from "./actionLinearEditor";
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { trackEvent } from "../analytics";
|
|
3
|
+
const trackAction = (action, source, appState, elements, app, value) => {
|
|
4
|
+
if (action.trackEvent) {
|
|
5
|
+
try {
|
|
6
|
+
if (typeof action.trackEvent === "object") {
|
|
7
|
+
const shouldTrack = action.trackEvent.predicate
|
|
8
|
+
? action.trackEvent.predicate(appState, elements, value)
|
|
9
|
+
: true;
|
|
10
|
+
if (shouldTrack) {
|
|
11
|
+
trackEvent(action.trackEvent.category, action.trackEvent.action || action.name, `${source} (${app.device.editor.isMobile ? "mobile" : "desktop"})`);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
catch (error) {
|
|
16
|
+
console.error("error while logging action:", error);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
export class ActionManager {
|
|
21
|
+
actions = {};
|
|
22
|
+
updater;
|
|
23
|
+
getAppState;
|
|
24
|
+
getElementsIncludingDeleted;
|
|
25
|
+
app;
|
|
26
|
+
constructor(updater, getAppState, getElementsIncludingDeleted, app) {
|
|
27
|
+
this.updater = (actionResult) => {
|
|
28
|
+
if (actionResult && "then" in actionResult) {
|
|
29
|
+
actionResult.then((actionResult) => {
|
|
30
|
+
return updater(actionResult);
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
return updater(actionResult);
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
this.getAppState = getAppState;
|
|
38
|
+
this.getElementsIncludingDeleted = getElementsIncludingDeleted;
|
|
39
|
+
this.app = app;
|
|
40
|
+
}
|
|
41
|
+
registerAction(action) {
|
|
42
|
+
this.actions[action.name] = action;
|
|
43
|
+
}
|
|
44
|
+
registerAll(actions) {
|
|
45
|
+
actions.forEach((action) => this.registerAction(action));
|
|
46
|
+
}
|
|
47
|
+
handleKeyDown(event) {
|
|
48
|
+
const canvasActions = this.app.props.UIOptions.canvasActions;
|
|
49
|
+
const data = Object.values(this.actions)
|
|
50
|
+
.sort((a, b) => (b.keyPriority || 0) - (a.keyPriority || 0))
|
|
51
|
+
.filter((action) => (action.name in canvasActions
|
|
52
|
+
? canvasActions[action.name]
|
|
53
|
+
: true) &&
|
|
54
|
+
action.keyTest &&
|
|
55
|
+
action.keyTest(event, this.getAppState(), this.getElementsIncludingDeleted(), this.app));
|
|
56
|
+
if (data.length !== 1) {
|
|
57
|
+
if (data.length > 1) {
|
|
58
|
+
console.warn("Canceling as multiple actions match this shortcut", data);
|
|
59
|
+
}
|
|
60
|
+
return false;
|
|
61
|
+
}
|
|
62
|
+
const action = data[0];
|
|
63
|
+
if (this.getAppState().viewModeEnabled && action.viewMode !== true) {
|
|
64
|
+
return false;
|
|
65
|
+
}
|
|
66
|
+
const elements = this.getElementsIncludingDeleted();
|
|
67
|
+
const appState = this.getAppState();
|
|
68
|
+
const value = null;
|
|
69
|
+
trackAction(action, "keyboard", appState, elements, this.app, null);
|
|
70
|
+
event.preventDefault();
|
|
71
|
+
event.stopPropagation();
|
|
72
|
+
this.updater(data[0].perform(elements, appState, value, this.app));
|
|
73
|
+
return true;
|
|
74
|
+
}
|
|
75
|
+
executeAction(action, source = "api", value = null) {
|
|
76
|
+
const elements = this.getElementsIncludingDeleted();
|
|
77
|
+
const appState = this.getAppState();
|
|
78
|
+
trackAction(action, source, appState, elements, this.app, value);
|
|
79
|
+
this.updater(action.perform(elements, appState, value, this.app));
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* @param data additional data sent to the PanelComponent
|
|
83
|
+
*/
|
|
84
|
+
renderAction = (name, data) => {
|
|
85
|
+
const canvasActions = this.app.props.UIOptions.canvasActions;
|
|
86
|
+
if (this.actions[name] &&
|
|
87
|
+
"PanelComponent" in this.actions[name] &&
|
|
88
|
+
(name in canvasActions
|
|
89
|
+
? canvasActions[name]
|
|
90
|
+
: true)) {
|
|
91
|
+
const action = this.actions[name];
|
|
92
|
+
const PanelComponent = action.PanelComponent;
|
|
93
|
+
PanelComponent.displayName = "PanelComponent";
|
|
94
|
+
const elements = this.getElementsIncludingDeleted();
|
|
95
|
+
const appState = this.getAppState();
|
|
96
|
+
const updateData = (formState) => {
|
|
97
|
+
trackAction(action, "ui", appState, elements, this.app, formState);
|
|
98
|
+
this.updater(action.perform(this.getElementsIncludingDeleted(), this.getAppState(), formState, this.app));
|
|
99
|
+
};
|
|
100
|
+
return (_jsx(PanelComponent, { elements: this.getElementsIncludingDeleted(), appState: this.getAppState(), updateData: updateData, appProps: this.app.props, app: this.app, data: data }));
|
|
101
|
+
}
|
|
102
|
+
return null;
|
|
103
|
+
};
|
|
104
|
+
isActionEnabled = (action) => {
|
|
105
|
+
const elements = this.getElementsIncludingDeleted();
|
|
106
|
+
const appState = this.getAppState();
|
|
107
|
+
return (!action.predicate ||
|
|
108
|
+
action.predicate(elements, appState, this.app.props, this.app));
|
|
109
|
+
};
|
|
110
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { isDarwin } from "../constants";
|
|
2
|
+
import { t } from "../i18n";
|
|
3
|
+
import { getShortcutKey } from "../utils";
|
|
4
|
+
const shortcutMap = {
|
|
5
|
+
toggleTheme: [getShortcutKey("Shift+Alt+D")],
|
|
6
|
+
saveScene: [getShortcutKey("CtrlOrCmd+S")],
|
|
7
|
+
loadScene: [getShortcutKey("CtrlOrCmd+O")],
|
|
8
|
+
clearCanvas: [getShortcutKey("CtrlOrCmd+Delete")],
|
|
9
|
+
imageExport: [getShortcutKey("CtrlOrCmd+Shift+E")],
|
|
10
|
+
cut: [getShortcutKey("CtrlOrCmd+X")],
|
|
11
|
+
copy: [getShortcutKey("CtrlOrCmd+C")],
|
|
12
|
+
paste: [getShortcutKey("CtrlOrCmd+V")],
|
|
13
|
+
copyStyles: [getShortcutKey("CtrlOrCmd+Alt+C")],
|
|
14
|
+
pasteStyles: [getShortcutKey("CtrlOrCmd+Alt+V")],
|
|
15
|
+
selectAll: [getShortcutKey("CtrlOrCmd+A")],
|
|
16
|
+
deleteSelectedElements: [getShortcutKey("Delete")],
|
|
17
|
+
duplicateSelection: [
|
|
18
|
+
getShortcutKey("CtrlOrCmd+D"),
|
|
19
|
+
getShortcutKey(`Alt+${t("helpDialog.drag")}`),
|
|
20
|
+
],
|
|
21
|
+
sendBackward: [getShortcutKey("CtrlOrCmd+[")],
|
|
22
|
+
bringForward: [getShortcutKey("CtrlOrCmd+]")],
|
|
23
|
+
sendToBack: [
|
|
24
|
+
isDarwin
|
|
25
|
+
? getShortcutKey("CtrlOrCmd+Alt+[")
|
|
26
|
+
: getShortcutKey("CtrlOrCmd+Shift+["),
|
|
27
|
+
],
|
|
28
|
+
bringToFront: [
|
|
29
|
+
isDarwin
|
|
30
|
+
? getShortcutKey("CtrlOrCmd+Alt+]")
|
|
31
|
+
: getShortcutKey("CtrlOrCmd+Shift+]"),
|
|
32
|
+
],
|
|
33
|
+
copyAsPng: [getShortcutKey("Shift+Alt+C")],
|
|
34
|
+
copyAsSvg: [],
|
|
35
|
+
group: [getShortcutKey("CtrlOrCmd+G")],
|
|
36
|
+
ungroup: [getShortcutKey("CtrlOrCmd+Shift+G")],
|
|
37
|
+
gridMode: [getShortcutKey("CtrlOrCmd+'")],
|
|
38
|
+
zenMode: [getShortcutKey("Alt+Z")],
|
|
39
|
+
objectsSnapMode: [getShortcutKey("Alt+S")],
|
|
40
|
+
stats: [getShortcutKey("Alt+/")],
|
|
41
|
+
addToLibrary: [],
|
|
42
|
+
flipHorizontal: [getShortcutKey("Shift+H")],
|
|
43
|
+
flipVertical: [getShortcutKey("Shift+V")],
|
|
44
|
+
viewMode: [getShortcutKey("Alt+R")],
|
|
45
|
+
hyperlink: [getShortcutKey("CtrlOrCmd+K")],
|
|
46
|
+
toggleElementLock: [getShortcutKey("CtrlOrCmd+Shift+L")],
|
|
47
|
+
};
|
|
48
|
+
export const getShortcutFromShortcutName = (name) => {
|
|
49
|
+
const shortcuts = shortcutMap[name];
|
|
50
|
+
// if multiple shortcuts available, take the first one
|
|
51
|
+
return shortcuts && shortcuts.length > 0 ? shortcuts[0] : "";
|
|
52
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { newElementWith } from "./element/mutateElement";
|
|
2
|
+
import { getCommonBoundingBox } from "./element/bounds";
|
|
3
|
+
import { getMaximumGroups } from "./groups";
|
|
4
|
+
export const alignElements = (selectedElements, alignment) => {
|
|
5
|
+
const groups = getMaximumGroups(selectedElements);
|
|
6
|
+
const selectionBoundingBox = getCommonBoundingBox(selectedElements);
|
|
7
|
+
return groups.flatMap((group) => {
|
|
8
|
+
const translation = calculateTranslation(group, selectionBoundingBox, alignment);
|
|
9
|
+
return group.map((element) => newElementWith(element, {
|
|
10
|
+
x: element.x + translation.x,
|
|
11
|
+
y: element.y + translation.y,
|
|
12
|
+
}));
|
|
13
|
+
});
|
|
14
|
+
};
|
|
15
|
+
const calculateTranslation = (group, selectionBoundingBox, { axis, position }) => {
|
|
16
|
+
const groupBoundingBox = getCommonBoundingBox(group);
|
|
17
|
+
const [min, max] = axis === "x" ? ["minX", "maxX"] : ["minY", "maxY"];
|
|
18
|
+
const noTranslation = { x: 0, y: 0 };
|
|
19
|
+
if (position === "start") {
|
|
20
|
+
return {
|
|
21
|
+
...noTranslation,
|
|
22
|
+
[axis]: selectionBoundingBox[min] - groupBoundingBox[min],
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
else if (position === "end") {
|
|
26
|
+
return {
|
|
27
|
+
...noTranslation,
|
|
28
|
+
[axis]: selectionBoundingBox[max] - groupBoundingBox[max],
|
|
29
|
+
};
|
|
30
|
+
} // else if (position === "center") {
|
|
31
|
+
return {
|
|
32
|
+
...noTranslation,
|
|
33
|
+
[axis]: (selectionBoundingBox[min] + selectionBoundingBox[max]) / 2 -
|
|
34
|
+
(groupBoundingBox[min] + groupBoundingBox[max]) / 2,
|
|
35
|
+
};
|
|
36
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// place here categories that you want to track. We want to track just a
|
|
2
|
+
// small subset of categories at a given time.
|
|
3
|
+
const ALLOWED_CATEGORIES_TO_TRACK = ["ai"];
|
|
4
|
+
export const trackEvent = (category, action, label, value) => {
|
|
5
|
+
try {
|
|
6
|
+
// prettier-ignore
|
|
7
|
+
if (typeof window === "undefined"
|
|
8
|
+
|| import.meta.env.VITE_WORKER_ID
|
|
9
|
+
// comment out to debug locally
|
|
10
|
+
|| import.meta.env.PROD) {
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
if (!ALLOWED_CATEGORIES_TO_TRACK.includes(category)) {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
if (!import.meta.env.PROD) {
|
|
17
|
+
console.info("trackEvent", { category, action, label, value });
|
|
18
|
+
}
|
|
19
|
+
if (window.sa_event) {
|
|
20
|
+
window.sa_event(action, {
|
|
21
|
+
category,
|
|
22
|
+
label,
|
|
23
|
+
value,
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
catch (error) {
|
|
28
|
+
console.error("error during analytics", error);
|
|
29
|
+
}
|
|
30
|
+
};
|