@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,83 @@
|
|
|
1
|
+
import { atom } from "jotai";
|
|
2
|
+
import { MAX_CUSTOM_COLORS_USED_IN_CANVAS, } from "../../colors";
|
|
3
|
+
export const getColorNameAndShadeFromColor = ({ palette, color, }) => {
|
|
4
|
+
for (const [colorName, colorVal] of Object.entries(palette)) {
|
|
5
|
+
if (Array.isArray(colorVal)) {
|
|
6
|
+
const shade = colorVal.indexOf(color);
|
|
7
|
+
if (shade > -1) {
|
|
8
|
+
return { colorName: colorName, shade };
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
else if (colorVal === color) {
|
|
12
|
+
return { colorName: colorName, shade: null };
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
return null;
|
|
16
|
+
};
|
|
17
|
+
export const colorPickerHotkeyBindings = [
|
|
18
|
+
["q", "w", "e", "r", "t"],
|
|
19
|
+
["a", "s", "d", "f", "g"],
|
|
20
|
+
["z", "x", "c", "v", "b"],
|
|
21
|
+
].flat();
|
|
22
|
+
export const isCustomColor = ({ color, palette, }) => {
|
|
23
|
+
const paletteValues = Object.values(palette).flat();
|
|
24
|
+
return !paletteValues.includes(color);
|
|
25
|
+
};
|
|
26
|
+
export const getMostUsedCustomColors = (elements, type, palette) => {
|
|
27
|
+
const elementColorTypeMap = {
|
|
28
|
+
elementBackground: "backgroundColor",
|
|
29
|
+
elementStroke: "strokeColor",
|
|
30
|
+
};
|
|
31
|
+
const colors = elements.filter((element) => {
|
|
32
|
+
if (element.isDeleted) {
|
|
33
|
+
return false;
|
|
34
|
+
}
|
|
35
|
+
const color = element[elementColorTypeMap[type]];
|
|
36
|
+
return isCustomColor({ color, palette });
|
|
37
|
+
});
|
|
38
|
+
const colorCountMap = new Map();
|
|
39
|
+
colors.forEach((element) => {
|
|
40
|
+
const color = element[elementColorTypeMap[type]];
|
|
41
|
+
if (colorCountMap.has(color)) {
|
|
42
|
+
colorCountMap.set(color, colorCountMap.get(color) + 1);
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
colorCountMap.set(color, 1);
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
return [...colorCountMap.entries()]
|
|
49
|
+
.sort((a, b) => b[1] - a[1])
|
|
50
|
+
.map((c) => c[0])
|
|
51
|
+
.slice(0, MAX_CUSTOM_COLORS_USED_IN_CANVAS);
|
|
52
|
+
};
|
|
53
|
+
export const activeColorPickerSectionAtom = atom(null);
|
|
54
|
+
const calculateContrast = (r, g, b) => {
|
|
55
|
+
const yiq = (r * 299 + g * 587 + b * 114) / 1000;
|
|
56
|
+
return yiq >= 160 ? "black" : "white";
|
|
57
|
+
};
|
|
58
|
+
// inspiration from https://stackoverflow.com/a/11868398
|
|
59
|
+
export const getContrastYIQ = (bgHex, isCustomColor) => {
|
|
60
|
+
if (isCustomColor) {
|
|
61
|
+
const style = new Option().style;
|
|
62
|
+
style.color = bgHex;
|
|
63
|
+
if (style.color) {
|
|
64
|
+
const rgb = style.color
|
|
65
|
+
.replace(/^(rgb|rgba)\(/, "")
|
|
66
|
+
.replace(/\)$/, "")
|
|
67
|
+
.replace(/\s/g, "")
|
|
68
|
+
.split(",");
|
|
69
|
+
const r = parseInt(rgb[0]);
|
|
70
|
+
const g = parseInt(rgb[1]);
|
|
71
|
+
const b = parseInt(rgb[2]);
|
|
72
|
+
return calculateContrast(r, g, b);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
// TODO: ? is this wanted?
|
|
76
|
+
if (bgHex === "transparent") {
|
|
77
|
+
return "black";
|
|
78
|
+
}
|
|
79
|
+
const r = parseInt(bgHex.substring(1, 3), 16);
|
|
80
|
+
const g = parseInt(bgHex.substring(3, 5), 16);
|
|
81
|
+
const b = parseInt(bgHex.substring(5, 7), 16);
|
|
82
|
+
return calculateContrast(r, g, b);
|
|
83
|
+
};
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import { KEYS } from "../../keys";
|
|
2
|
+
import { COLORS_PER_ROW, COLOR_PALETTE, } from "../../colors";
|
|
3
|
+
import { colorPickerHotkeyBindings, getColorNameAndShadeFromColor, } from "./colorPickerUtils";
|
|
4
|
+
const arrowHandler = (eventKey, currentIndex, length) => {
|
|
5
|
+
const rows = Math.ceil(length / COLORS_PER_ROW);
|
|
6
|
+
currentIndex = currentIndex ?? -1;
|
|
7
|
+
switch (eventKey) {
|
|
8
|
+
case "ArrowLeft": {
|
|
9
|
+
const prevIndex = currentIndex - 1;
|
|
10
|
+
return prevIndex < 0 ? length - 1 : prevIndex;
|
|
11
|
+
}
|
|
12
|
+
case "ArrowRight": {
|
|
13
|
+
return (currentIndex + 1) % length;
|
|
14
|
+
}
|
|
15
|
+
case "ArrowDown": {
|
|
16
|
+
const nextIndex = currentIndex + COLORS_PER_ROW;
|
|
17
|
+
return nextIndex >= length ? currentIndex % COLORS_PER_ROW : nextIndex;
|
|
18
|
+
}
|
|
19
|
+
case "ArrowUp": {
|
|
20
|
+
const prevIndex = currentIndex - COLORS_PER_ROW;
|
|
21
|
+
const newIndex = prevIndex < 0 ? COLORS_PER_ROW * rows + prevIndex : prevIndex;
|
|
22
|
+
return newIndex >= length ? undefined : newIndex;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* @returns true if the event was handled
|
|
28
|
+
*/
|
|
29
|
+
const hotkeyHandler = ({ e, colorObj, onChange, palette, customColors, setActiveColorPickerSection, activeShade, }) => {
|
|
30
|
+
if (colorObj?.shade != null) {
|
|
31
|
+
// shift + numpad is extremely messed up on windows apparently
|
|
32
|
+
if (["Digit1", "Digit2", "Digit3", "Digit4", "Digit5"].includes(e.code) &&
|
|
33
|
+
e.shiftKey) {
|
|
34
|
+
const newShade = Number(e.code.slice(-1)) - 1;
|
|
35
|
+
onChange(palette[colorObj.colorName][newShade]);
|
|
36
|
+
setActiveColorPickerSection("shades");
|
|
37
|
+
return true;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
if (["1", "2", "3", "4", "5"].includes(e.key)) {
|
|
41
|
+
const c = customColors[Number(e.key) - 1];
|
|
42
|
+
if (c) {
|
|
43
|
+
onChange(customColors[Number(e.key) - 1]);
|
|
44
|
+
setActiveColorPickerSection("custom");
|
|
45
|
+
return true;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
if (colorPickerHotkeyBindings.includes(e.key)) {
|
|
49
|
+
const index = colorPickerHotkeyBindings.indexOf(e.key);
|
|
50
|
+
const paletteKey = Object.keys(palette)[index];
|
|
51
|
+
const paletteValue = palette[paletteKey];
|
|
52
|
+
const r = Array.isArray(paletteValue)
|
|
53
|
+
? paletteValue[activeShade]
|
|
54
|
+
: paletteValue;
|
|
55
|
+
onChange(r);
|
|
56
|
+
setActiveColorPickerSection("baseColors");
|
|
57
|
+
return true;
|
|
58
|
+
}
|
|
59
|
+
return false;
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* @returns true if the event was handled
|
|
63
|
+
*/
|
|
64
|
+
export const colorPickerKeyNavHandler = ({ event, activeColorPickerSection, palette, color, onChange, customColors, setActiveColorPickerSection, updateData, activeShade, onEyeDropperToggle, onEscape, }) => {
|
|
65
|
+
if (event[KEYS.CTRL_OR_CMD]) {
|
|
66
|
+
return false;
|
|
67
|
+
}
|
|
68
|
+
if (event.key === KEYS.ESCAPE) {
|
|
69
|
+
onEscape(event);
|
|
70
|
+
return true;
|
|
71
|
+
}
|
|
72
|
+
// checkt using `key` to ignore combos with Alt modifier
|
|
73
|
+
if (event.key === KEYS.ALT) {
|
|
74
|
+
onEyeDropperToggle(true);
|
|
75
|
+
return true;
|
|
76
|
+
}
|
|
77
|
+
if (event.key === KEYS.I) {
|
|
78
|
+
onEyeDropperToggle();
|
|
79
|
+
return true;
|
|
80
|
+
}
|
|
81
|
+
const colorObj = getColorNameAndShadeFromColor({ color, palette });
|
|
82
|
+
if (event.key === KEYS.TAB) {
|
|
83
|
+
const sectionsMap = {
|
|
84
|
+
custom: !!customColors.length,
|
|
85
|
+
baseColors: true,
|
|
86
|
+
shades: colorObj?.shade != null,
|
|
87
|
+
hex: true,
|
|
88
|
+
};
|
|
89
|
+
const sections = Object.entries(sectionsMap).reduce((acc, [key, value]) => {
|
|
90
|
+
if (value) {
|
|
91
|
+
acc.push(key);
|
|
92
|
+
}
|
|
93
|
+
return acc;
|
|
94
|
+
}, []);
|
|
95
|
+
const activeSectionIndex = sections.indexOf(activeColorPickerSection);
|
|
96
|
+
const indexOffset = event.shiftKey ? -1 : 1;
|
|
97
|
+
const nextSectionIndex = activeSectionIndex + indexOffset > sections.length - 1
|
|
98
|
+
? 0
|
|
99
|
+
: activeSectionIndex + indexOffset < 0
|
|
100
|
+
? sections.length - 1
|
|
101
|
+
: activeSectionIndex + indexOffset;
|
|
102
|
+
const nextSection = sections[nextSectionIndex];
|
|
103
|
+
if (nextSection) {
|
|
104
|
+
setActiveColorPickerSection(nextSection);
|
|
105
|
+
}
|
|
106
|
+
if (nextSection === "custom") {
|
|
107
|
+
onChange(customColors[0]);
|
|
108
|
+
}
|
|
109
|
+
else if (nextSection === "baseColors") {
|
|
110
|
+
const baseColorName = Object.entries(palette).find(([name, shades]) => {
|
|
111
|
+
if (Array.isArray(shades)) {
|
|
112
|
+
return shades.includes(color);
|
|
113
|
+
}
|
|
114
|
+
else if (shades === color) {
|
|
115
|
+
return name;
|
|
116
|
+
}
|
|
117
|
+
return null;
|
|
118
|
+
});
|
|
119
|
+
if (!baseColorName) {
|
|
120
|
+
onChange(COLOR_PALETTE.black);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
event.preventDefault();
|
|
124
|
+
event.stopPropagation();
|
|
125
|
+
return true;
|
|
126
|
+
}
|
|
127
|
+
if (hotkeyHandler({
|
|
128
|
+
e: event,
|
|
129
|
+
colorObj,
|
|
130
|
+
onChange,
|
|
131
|
+
palette,
|
|
132
|
+
customColors,
|
|
133
|
+
setActiveColorPickerSection,
|
|
134
|
+
activeShade,
|
|
135
|
+
})) {
|
|
136
|
+
return true;
|
|
137
|
+
}
|
|
138
|
+
if (activeColorPickerSection === "shades") {
|
|
139
|
+
if (colorObj) {
|
|
140
|
+
const { shade } = colorObj;
|
|
141
|
+
const newShade = arrowHandler(event.key, shade, COLORS_PER_ROW);
|
|
142
|
+
if (newShade !== undefined) {
|
|
143
|
+
onChange(palette[colorObj.colorName][newShade]);
|
|
144
|
+
return true;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
if (activeColorPickerSection === "baseColors") {
|
|
149
|
+
if (colorObj) {
|
|
150
|
+
const { colorName } = colorObj;
|
|
151
|
+
const colorNames = Object.keys(palette);
|
|
152
|
+
const indexOfColorName = colorNames.indexOf(colorName);
|
|
153
|
+
const newColorIndex = arrowHandler(event.key, indexOfColorName, colorNames.length);
|
|
154
|
+
if (newColorIndex !== undefined) {
|
|
155
|
+
const newColorName = colorNames[newColorIndex];
|
|
156
|
+
const newColorNameValue = palette[newColorName];
|
|
157
|
+
onChange(Array.isArray(newColorNameValue)
|
|
158
|
+
? newColorNameValue[activeShade]
|
|
159
|
+
: newColorNameValue);
|
|
160
|
+
return true;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
if (activeColorPickerSection === "custom") {
|
|
165
|
+
const indexOfColor = customColors.indexOf(color);
|
|
166
|
+
const newColorIndex = arrowHandler(event.key, indexOfColor, customColors.length);
|
|
167
|
+
if (newColorIndex !== undefined) {
|
|
168
|
+
const newColor = customColors[newColorIndex];
|
|
169
|
+
onChange(newColor);
|
|
170
|
+
return true;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
return false;
|
|
174
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { t } from "../i18n";
|
|
3
|
+
import { Dialog } from "./Dialog";
|
|
4
|
+
import "./ConfirmDialog.scss";
|
|
5
|
+
import DialogActionButton from "./DialogActionButton";
|
|
6
|
+
import { useSetAtom } from "jotai";
|
|
7
|
+
import { isLibraryMenuOpenAtom } from "./LibraryMenu";
|
|
8
|
+
import { useExcalidrawContainer, useExcalidrawSetAppState } from "./App";
|
|
9
|
+
import { jotaiScope } from "../jotai";
|
|
10
|
+
const ConfirmDialog = (props) => {
|
|
11
|
+
const { onConfirm, onCancel, children, confirmText = t("buttons.confirm"), cancelText = t("buttons.cancel"), className = "", ...rest } = props;
|
|
12
|
+
const setAppState = useExcalidrawSetAppState();
|
|
13
|
+
const setIsLibraryMenuOpen = useSetAtom(isLibraryMenuOpenAtom, jotaiScope);
|
|
14
|
+
const { container } = useExcalidrawContainer();
|
|
15
|
+
return (_jsxs(Dialog, { onCloseRequest: onCancel, size: "small", ...rest, className: `confirm-dialog ${className}`, children: [children, _jsxs("div", { className: "confirm-dialog-buttons", children: [_jsx(DialogActionButton, { label: cancelText, onClick: () => {
|
|
16
|
+
setAppState({ openMenu: null });
|
|
17
|
+
setIsLibraryMenuOpen(false);
|
|
18
|
+
onCancel();
|
|
19
|
+
container?.focus();
|
|
20
|
+
} }), _jsx(DialogActionButton, { label: confirmText, onClick: () => {
|
|
21
|
+
setAppState({ openMenu: null });
|
|
22
|
+
setIsLibraryMenuOpen(false);
|
|
23
|
+
onConfirm();
|
|
24
|
+
container?.focus();
|
|
25
|
+
}, actionType: "danger" })] })] }));
|
|
26
|
+
};
|
|
27
|
+
export default ConfirmDialog;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import clsx from "clsx";
|
|
3
|
+
import { Popover } from "./Popover";
|
|
4
|
+
import { t } from "../i18n";
|
|
5
|
+
import "./ContextMenu.scss";
|
|
6
|
+
import { getShortcutFromShortcutName, } from "../actions/shortcuts";
|
|
7
|
+
import { useExcalidrawAppState, useExcalidrawElements } from "./App";
|
|
8
|
+
import React from "react";
|
|
9
|
+
export const CONTEXT_MENU_SEPARATOR = "separator";
|
|
10
|
+
export const ContextMenu = React.memo(({ actionManager, items, top, left, onClose }) => {
|
|
11
|
+
const appState = useExcalidrawAppState();
|
|
12
|
+
const elements = useExcalidrawElements();
|
|
13
|
+
const filteredItems = items.reduce((acc, item) => {
|
|
14
|
+
if (item &&
|
|
15
|
+
(item === CONTEXT_MENU_SEPARATOR ||
|
|
16
|
+
!item.predicate ||
|
|
17
|
+
item.predicate(elements, appState, actionManager.app.props, actionManager.app))) {
|
|
18
|
+
acc.push(item);
|
|
19
|
+
}
|
|
20
|
+
return acc;
|
|
21
|
+
}, []);
|
|
22
|
+
return (_jsx(Popover, { onCloseRequest: () => {
|
|
23
|
+
onClose();
|
|
24
|
+
}, top: top, left: left, fitInViewport: true, offsetLeft: appState.offsetLeft, offsetTop: appState.offsetTop, viewportWidth: appState.width, viewportHeight: appState.height, children: _jsx("ul", { className: "context-menu", onContextMenu: (event) => event.preventDefault(), children: filteredItems.map((item, idx) => {
|
|
25
|
+
if (item === CONTEXT_MENU_SEPARATOR) {
|
|
26
|
+
if (!filteredItems[idx - 1] ||
|
|
27
|
+
filteredItems[idx - 1] === CONTEXT_MENU_SEPARATOR) {
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
return _jsx("hr", { className: "context-menu-item-separator" }, idx);
|
|
31
|
+
}
|
|
32
|
+
const actionName = item.name;
|
|
33
|
+
let label = "";
|
|
34
|
+
if (item.contextItemLabel) {
|
|
35
|
+
if (typeof item.contextItemLabel === "function") {
|
|
36
|
+
label = t(item.contextItemLabel(elements, appState, actionManager.app));
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
label = t(item.contextItemLabel);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return (_jsx("li", { "data-testid": actionName, onClick: () => {
|
|
43
|
+
// we need update state before executing the action in case
|
|
44
|
+
// the action uses the appState it's being passed (that still
|
|
45
|
+
// contains a defined contextMenu) to return the next state.
|
|
46
|
+
onClose(() => {
|
|
47
|
+
actionManager.executeAction(item, "contextMenu");
|
|
48
|
+
});
|
|
49
|
+
}, children: _jsxs("button", { className: clsx("context-menu-item", {
|
|
50
|
+
dangerous: actionName === "deleteSelectedElements",
|
|
51
|
+
checkmark: item.checked?.(appState),
|
|
52
|
+
}), children: [_jsx("div", { className: "context-menu-item__label", children: label }), _jsx("kbd", { className: "context-menu-item__shortcut", children: actionName
|
|
53
|
+
? getShortcutFromShortcutName(actionName)
|
|
54
|
+
: "" })] }) }, idx));
|
|
55
|
+
}) }) }));
|
|
56
|
+
});
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
@import "../css/variables.module.scss";
|
|
2
|
+
|
|
3
|
+
.excalidraw {
|
|
4
|
+
.context-menu {
|
|
5
|
+
position: relative;
|
|
6
|
+
border-radius: 4px;
|
|
7
|
+
box-shadow: 0 3px 10px transparentize($oc-black, 0.8);
|
|
8
|
+
padding: 0;
|
|
9
|
+
list-style: none;
|
|
10
|
+
user-select: none;
|
|
11
|
+
margin: -0.25rem 0 0 0.125rem;
|
|
12
|
+
padding: 0.5rem 0;
|
|
13
|
+
background-color: var(--popup-secondary-bg-color);
|
|
14
|
+
border: 1px solid var(--button-gray-3);
|
|
15
|
+
cursor: default;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.context-menu button {
|
|
19
|
+
color: var(--popup-text-color);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.context-menu-item {
|
|
23
|
+
position: relative;
|
|
24
|
+
width: 100%;
|
|
25
|
+
min-width: 9.5rem;
|
|
26
|
+
margin: 0;
|
|
27
|
+
padding: 0.25rem 1rem 0.25rem 1.25rem;
|
|
28
|
+
text-align: start;
|
|
29
|
+
border-radius: 0;
|
|
30
|
+
background-color: transparent;
|
|
31
|
+
border: none;
|
|
32
|
+
white-space: nowrap;
|
|
33
|
+
font-family: inherit;
|
|
34
|
+
|
|
35
|
+
display: grid;
|
|
36
|
+
grid-template-columns: 1fr 0.2fr;
|
|
37
|
+
align-items: center;
|
|
38
|
+
|
|
39
|
+
&.checkmark::before {
|
|
40
|
+
position: absolute;
|
|
41
|
+
left: 6px;
|
|
42
|
+
margin-bottom: 1px;
|
|
43
|
+
content: "\2713";
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
&.dangerous {
|
|
47
|
+
.context-menu-item__label {
|
|
48
|
+
color: $oc-red-7;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.context-menu-item__label {
|
|
53
|
+
justify-self: start;
|
|
54
|
+
margin-inline-end: 20px;
|
|
55
|
+
}
|
|
56
|
+
.context-menu-item__shortcut {
|
|
57
|
+
justify-self: end;
|
|
58
|
+
opacity: 0.6;
|
|
59
|
+
font-family: inherit;
|
|
60
|
+
font-size: 0.7rem;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.context-menu-item:hover {
|
|
65
|
+
color: var(--popup-bg-color);
|
|
66
|
+
background-color: var(--select-highlight-color);
|
|
67
|
+
|
|
68
|
+
&.dangerous {
|
|
69
|
+
.context-menu-item__label {
|
|
70
|
+
color: var(--popup-bg-color);
|
|
71
|
+
}
|
|
72
|
+
background-color: $oc-red-6;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.context-menu-item:focus {
|
|
77
|
+
z-index: 1;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
@include isMobile {
|
|
81
|
+
.context-menu-item {
|
|
82
|
+
display: block;
|
|
83
|
+
|
|
84
|
+
.context-menu-item__label {
|
|
85
|
+
margin-inline-end: 0;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.context-menu-item__shortcut {
|
|
89
|
+
display: none;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.context-menu-item-separator {
|
|
95
|
+
border: none;
|
|
96
|
+
border-top: 1px solid $oc-gray-5;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import "./ToolIcon.scss";
|
|
3
|
+
import { t } from "../i18n";
|
|
4
|
+
import { ToolButton } from "./ToolButton";
|
|
5
|
+
import { THEME } from "../constants";
|
|
6
|
+
// We chose to use only explicit toggle and not a third option for system value,
|
|
7
|
+
// but this could be added in the future.
|
|
8
|
+
export const DarkModeToggle = (props) => {
|
|
9
|
+
const title = props.title ||
|
|
10
|
+
(props.value === "dark" ? t("buttons.lightMode") : t("buttons.darkMode"));
|
|
11
|
+
return (_jsx(ToolButton, { type: "icon", icon: props.value === THEME.LIGHT ? ICONS.MOON : ICONS.SUN, title: title, "aria-label": title, onClick: () => props.onChange(props.value === THEME.DARK ? THEME.LIGHT : THEME.DARK), "data-testid": "toggle-dark-mode" }));
|
|
12
|
+
};
|
|
13
|
+
const ICONS = {
|
|
14
|
+
SUN: (_jsx("svg", { width: "512", height: "512", className: "rtl-mirror", viewBox: "0 0 512 512", children: _jsx("path", { fill: "currentColor", d: "M256 160c-52.9 0-96 43.1-96 96s43.1 96 96 96 96-43.1 96-96-43.1-96-96-96zm246.4 80.5l-94.7-47.3 33.5-100.4c4.5-13.6-8.4-26.5-21.9-21.9l-100.4 33.5-47.4-94.8c-6.4-12.8-24.6-12.8-31 0l-47.3 94.7L92.7 70.8c-13.6-4.5-26.5 8.4-21.9 21.9l33.5 100.4-94.7 47.4c-12.8 6.4-12.8 24.6 0 31l94.7 47.3-33.5 100.5c-4.5 13.6 8.4 26.5 21.9 21.9l100.4-33.5 47.3 94.7c6.4 12.8 24.6 12.8 31 0l47.3-94.7 100.4 33.5c13.6 4.5 26.5-8.4 21.9-21.9l-33.5-100.4 94.7-47.3c13-6.5 13-24.7.2-31.1zm-155.9 106c-49.9 49.9-131.1 49.9-181 0-49.9-49.9-49.9-131.1 0-181 49.9-49.9 131.1-49.9 181 0 49.9 49.9 49.9 131.1 0 181z" }) })),
|
|
15
|
+
MOON: (_jsx("svg", { width: "512", height: "512", className: "rtl-mirror", viewBox: "0 0 512 512", children: _jsx("path", { fill: "currentColor", d: "M283.211 512c78.962 0 151.079-35.925 198.857-94.792 7.068-8.708-.639-21.43-11.562-19.35-124.203 23.654-238.262-71.576-238.262-196.954 0-72.222 38.662-138.635 101.498-174.394 9.686-5.512 7.25-20.197-3.756-22.23A258.156 258.156 0 0 0 283.211 0c-141.309 0-256 114.511-256 256 0 141.309 114.511 256 256 256z" }) })),
|
|
16
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { createElement as _createElement } from "react";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import clsx from "clsx";
|
|
4
|
+
import { DEFAULT_SIDEBAR, LIBRARY_SIDEBAR_TAB } from "../constants";
|
|
5
|
+
import { useTunnels } from "../context/tunnels";
|
|
6
|
+
import { useUIAppState } from "../context/ui-appState";
|
|
7
|
+
import { t } from "../i18n";
|
|
8
|
+
import { composeEventHandlers } from "../utils";
|
|
9
|
+
import { useExcalidrawSetAppState } from "./App";
|
|
10
|
+
import { withInternalFallback } from "./hoc/withInternalFallback";
|
|
11
|
+
import { LibraryMenu } from "./LibraryMenu";
|
|
12
|
+
import { Sidebar } from "./Sidebar/Sidebar";
|
|
13
|
+
const DefaultSidebarTrigger = withInternalFallback("DefaultSidebarTrigger", (props) => {
|
|
14
|
+
const { DefaultSidebarTriggerTunnel } = useTunnels();
|
|
15
|
+
return (_jsx(DefaultSidebarTriggerTunnel.In, { children: _jsx(Sidebar.Trigger, { ...props, className: "default-sidebar-trigger", name: DEFAULT_SIDEBAR.name }) }));
|
|
16
|
+
});
|
|
17
|
+
DefaultSidebarTrigger.displayName = "DefaultSidebarTrigger";
|
|
18
|
+
const DefaultTabTriggers = ({ children, ...rest }) => {
|
|
19
|
+
const { DefaultSidebarTabTriggersTunnel } = useTunnels();
|
|
20
|
+
return (_jsx(DefaultSidebarTabTriggersTunnel.In, { children: _jsx(Sidebar.TabTriggers, { ...rest, children: children }) }));
|
|
21
|
+
};
|
|
22
|
+
DefaultTabTriggers.displayName = "DefaultTabTriggers";
|
|
23
|
+
export const DefaultSidebar = Object.assign(withInternalFallback("DefaultSidebar", ({ children, className, onDock, docked, ...rest }) => {
|
|
24
|
+
const appState = useUIAppState();
|
|
25
|
+
const setAppState = useExcalidrawSetAppState();
|
|
26
|
+
const { DefaultSidebarTabTriggersTunnel } = useTunnels();
|
|
27
|
+
return (_createElement(Sidebar, { ...rest, name: "default", key: "default", className: clsx("default-sidebar", className), docked: docked ?? appState.defaultSidebarDockedPreference, onDock:
|
|
28
|
+
// `onDock=false` disables docking.
|
|
29
|
+
// if `docked` passed, but no onDock passed, disable manual docking.
|
|
30
|
+
onDock === false || (!onDock && docked != null)
|
|
31
|
+
? undefined
|
|
32
|
+
: // compose to allow the host app to listen on default behavior
|
|
33
|
+
composeEventHandlers(onDock, (docked) => {
|
|
34
|
+
setAppState({ defaultSidebarDockedPreference: docked });
|
|
35
|
+
}) },
|
|
36
|
+
_jsxs(Sidebar.Tabs, { children: [_jsxs(Sidebar.Header, { children: [rest.__fallback && (_jsx("div", { style: {
|
|
37
|
+
color: "var(--color-primary)",
|
|
38
|
+
fontSize: "1.2em",
|
|
39
|
+
fontWeight: "bold",
|
|
40
|
+
textOverflow: "ellipsis",
|
|
41
|
+
overflow: "hidden",
|
|
42
|
+
whiteSpace: "nowrap",
|
|
43
|
+
paddingRight: "1em",
|
|
44
|
+
}, children: t("toolBar.library") })), _jsx(DefaultSidebarTabTriggersTunnel.Out, {})] }), _jsx(Sidebar.Tab, { tab: LIBRARY_SIDEBAR_TAB, children: _jsx(LibraryMenu, {}) }), children] })));
|
|
45
|
+
}), {
|
|
46
|
+
Trigger: DefaultSidebarTrigger,
|
|
47
|
+
TabTriggers: DefaultTabTriggers,
|
|
48
|
+
});
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import clsx from "clsx";
|
|
3
|
+
import { useEffect, useState } from "react";
|
|
4
|
+
import { useCallbackRefState } from "../hooks/useCallbackRefState";
|
|
5
|
+
import { t } from "../i18n";
|
|
6
|
+
import { useExcalidrawContainer, useDevice, useExcalidrawSetAppState, } from "./App";
|
|
7
|
+
import { KEYS } from "../keys";
|
|
8
|
+
import "./Dialog.scss";
|
|
9
|
+
import { back, CloseIcon } from "./icons";
|
|
10
|
+
import { Island } from "./Island";
|
|
11
|
+
import { Modal } from "./Modal";
|
|
12
|
+
import { queryFocusableElements } from "../utils";
|
|
13
|
+
import { useSetAtom } from "jotai";
|
|
14
|
+
import { isLibraryMenuOpenAtom } from "./LibraryMenu";
|
|
15
|
+
import { jotaiScope } from "../jotai";
|
|
16
|
+
function getDialogSize(size) {
|
|
17
|
+
if (size && typeof size === "number") {
|
|
18
|
+
return size;
|
|
19
|
+
}
|
|
20
|
+
switch (size) {
|
|
21
|
+
case "small":
|
|
22
|
+
return 550;
|
|
23
|
+
case "wide":
|
|
24
|
+
return 1024;
|
|
25
|
+
case "regular":
|
|
26
|
+
default:
|
|
27
|
+
return 800;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
export const Dialog = (props) => {
|
|
31
|
+
const [islandNode, setIslandNode] = useCallbackRefState();
|
|
32
|
+
const [lastActiveElement] = useState(document.activeElement);
|
|
33
|
+
const { id } = useExcalidrawContainer();
|
|
34
|
+
const isFullscreen = useDevice().viewport.isMobile;
|
|
35
|
+
useEffect(() => {
|
|
36
|
+
if (!islandNode) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
const focusableElements = queryFocusableElements(islandNode);
|
|
40
|
+
if (focusableElements.length > 0 && props.autofocus !== false) {
|
|
41
|
+
// If there's an element other than close, focus it.
|
|
42
|
+
(focusableElements[1] || focusableElements[0]).focus();
|
|
43
|
+
}
|
|
44
|
+
const handleKeyDown = (event) => {
|
|
45
|
+
if (event.key === KEYS.TAB) {
|
|
46
|
+
const focusableElements = queryFocusableElements(islandNode);
|
|
47
|
+
const { activeElement } = document;
|
|
48
|
+
const currentIndex = focusableElements.findIndex((element) => element === activeElement);
|
|
49
|
+
if (currentIndex === 0 && event.shiftKey) {
|
|
50
|
+
focusableElements[focusableElements.length - 1].focus();
|
|
51
|
+
event.preventDefault();
|
|
52
|
+
}
|
|
53
|
+
else if (currentIndex === focusableElements.length - 1 &&
|
|
54
|
+
!event.shiftKey) {
|
|
55
|
+
focusableElements[0].focus();
|
|
56
|
+
event.preventDefault();
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
islandNode.addEventListener("keydown", handleKeyDown);
|
|
61
|
+
return () => islandNode.removeEventListener("keydown", handleKeyDown);
|
|
62
|
+
}, [islandNode, props.autofocus]);
|
|
63
|
+
const setAppState = useExcalidrawSetAppState();
|
|
64
|
+
const setIsLibraryMenuOpen = useSetAtom(isLibraryMenuOpenAtom, jotaiScope);
|
|
65
|
+
const onClose = () => {
|
|
66
|
+
setAppState({ openMenu: null });
|
|
67
|
+
setIsLibraryMenuOpen(false);
|
|
68
|
+
lastActiveElement.focus();
|
|
69
|
+
props.onCloseRequest();
|
|
70
|
+
};
|
|
71
|
+
return (_jsx(Modal, { className: clsx("Dialog", props.className, {
|
|
72
|
+
"Dialog--fullscreen": isFullscreen,
|
|
73
|
+
}), labelledBy: "dialog-title", maxWidth: getDialogSize(props.size), onCloseRequest: onClose, closeOnClickOutside: props.closeOnClickOutside, children: _jsxs(Island, { ref: setIslandNode, children: [props.title && (_jsx("h2", { id: `${id}-dialog-title`, className: "Dialog__title", children: _jsx("span", { className: "Dialog__titleContent", children: props.title }) })), _jsx("button", { className: "Dialog__close", onClick: onClose, title: t("buttons.close"), "aria-label": t("buttons.close"), children: isFullscreen ? back : CloseIcon }), _jsx("div", { className: "Dialog__content", children: props.children })] }) }));
|
|
74
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
@import "../css/variables.module.scss";
|
|
2
|
+
|
|
3
|
+
.excalidraw {
|
|
4
|
+
.Dialog {
|
|
5
|
+
user-select: text;
|
|
6
|
+
cursor: auto;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.Dialog__title {
|
|
10
|
+
margin: 0;
|
|
11
|
+
text-align: left;
|
|
12
|
+
font-size: 1.25rem;
|
|
13
|
+
border-bottom: 1px solid var(--dialog-border-color);
|
|
14
|
+
padding: 0 0 0.75rem;
|
|
15
|
+
margin-bottom: 1.5rem;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.Dialog__close {
|
|
19
|
+
color: var(--color-gray-40);
|
|
20
|
+
margin: 0;
|
|
21
|
+
position: absolute;
|
|
22
|
+
top: 0.75rem;
|
|
23
|
+
right: 0.5rem;
|
|
24
|
+
border: 0;
|
|
25
|
+
background-color: transparent;
|
|
26
|
+
line-height: 0;
|
|
27
|
+
cursor: pointer;
|
|
28
|
+
|
|
29
|
+
&:hover {
|
|
30
|
+
color: var(--color-gray-60);
|
|
31
|
+
}
|
|
32
|
+
&:active {
|
|
33
|
+
color: var(--color-gray-40);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
svg {
|
|
37
|
+
width: 1.5rem;
|
|
38
|
+
height: 1.5rem;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.Dialog--fullscreen {
|
|
43
|
+
.Dialog__close {
|
|
44
|
+
top: 1.25rem;
|
|
45
|
+
right: 1.25rem;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import clsx from "clsx";
|
|
3
|
+
import "./DialogActionButton.scss";
|
|
4
|
+
import Spinner from "./Spinner";
|
|
5
|
+
const DialogActionButton = ({ label, onClick, className, children, actionType, type = "button", isLoading, ...rest }) => {
|
|
6
|
+
const cs = actionType ? `Dialog__action-button--${actionType}` : "";
|
|
7
|
+
return (_jsxs("button", { className: clsx("Dialog__action-button", cs, className), type: type, "aria-label": label, onClick: onClick, ...rest, children: [children && (_jsx("div", { style: isLoading ? { visibility: "hidden" } : {}, children: children })), _jsx("div", { style: isLoading ? { visibility: "hidden" } : {}, children: label }), isLoading && (_jsx("div", { style: { position: "absolute", inset: 0 }, children: _jsx(Spinner, {}) }))] }));
|
|
8
|
+
};
|
|
9
|
+
export default DialogActionButton;
|