@excalidraw/excalidraw 0.17.1-7441-e31f307 → 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-PJT4QCRY.js → chunk-LZCCI7PN.js} +4 -4
- package/dist/browser/excalidraw-assets/{image-KZSI6GAB.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 -6
- package/dist/index.css +0 -5796
- package/dist/index.js +0 -71305
- /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,145 @@
|
|
|
1
|
+
import { createElement as _createElement } from "react";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useEffect, useLayoutEffect, useRef, useState, forwardRef, useImperativeHandle, useCallback, } from "react";
|
|
4
|
+
import { Island } from "../Island";
|
|
5
|
+
import { atom, useSetAtom } from "jotai";
|
|
6
|
+
import { jotaiScope } from "../../jotai";
|
|
7
|
+
import { SidebarPropsContext, } from "./common";
|
|
8
|
+
import { SidebarHeader } from "./SidebarHeader";
|
|
9
|
+
import clsx from "clsx";
|
|
10
|
+
import { useDevice, useExcalidrawSetAppState } from "../App";
|
|
11
|
+
import { updateObject } from "../../utils";
|
|
12
|
+
import { KEYS } from "../../keys";
|
|
13
|
+
import { EVENT } from "../../constants";
|
|
14
|
+
import { SidebarTrigger } from "./SidebarTrigger";
|
|
15
|
+
import { SidebarTabTriggers } from "./SidebarTabTriggers";
|
|
16
|
+
import { SidebarTabTrigger } from "./SidebarTabTrigger";
|
|
17
|
+
import { SidebarTabs } from "./SidebarTabs";
|
|
18
|
+
import { SidebarTab } from "./SidebarTab";
|
|
19
|
+
import { useUIAppState } from "../../context/ui-appState";
|
|
20
|
+
import { useOutsideClick } from "../../hooks/useOutsideClick";
|
|
21
|
+
import "./Sidebar.scss";
|
|
22
|
+
/**
|
|
23
|
+
* Flags whether the currently rendered Sidebar is docked or not, for use
|
|
24
|
+
* in upstream components that need to act on this (e.g. LayerUI to shift the
|
|
25
|
+
* UI). We use an atom because of potential host app sidebars (for the default
|
|
26
|
+
* sidebar we could just read from appState.defaultSidebarDockedPreference).
|
|
27
|
+
*
|
|
28
|
+
* Since we can only render one Sidebar at a time, we can use a simple flag.
|
|
29
|
+
*/
|
|
30
|
+
export const isSidebarDockedAtom = atom(false);
|
|
31
|
+
export const SidebarInner = forwardRef(({ name, children, onDock, docked, className, ...rest }, ref) => {
|
|
32
|
+
if (import.meta.env.DEV && onDock && docked == null) {
|
|
33
|
+
console.warn("Sidebar: `docked` must be set when `onDock` is supplied for the sidebar to be user-dockable. To hide this message, either pass `docked` or remove `onDock`");
|
|
34
|
+
}
|
|
35
|
+
const setAppState = useExcalidrawSetAppState();
|
|
36
|
+
const setIsSidebarDockedAtom = useSetAtom(isSidebarDockedAtom, jotaiScope);
|
|
37
|
+
useLayoutEffect(() => {
|
|
38
|
+
setIsSidebarDockedAtom(!!docked);
|
|
39
|
+
return () => {
|
|
40
|
+
setIsSidebarDockedAtom(false);
|
|
41
|
+
};
|
|
42
|
+
}, [setIsSidebarDockedAtom, docked]);
|
|
43
|
+
const headerPropsRef = useRef({});
|
|
44
|
+
headerPropsRef.current.onCloseRequest = () => {
|
|
45
|
+
setAppState({ openSidebar: null });
|
|
46
|
+
};
|
|
47
|
+
headerPropsRef.current.onDock = (isDocked) => onDock?.(isDocked);
|
|
48
|
+
// renew the ref object if the following props change since we want to
|
|
49
|
+
// rerender. We can't pass down as component props manually because
|
|
50
|
+
// the <Sidebar.Header/> can be rendered upstream.
|
|
51
|
+
headerPropsRef.current = updateObject(headerPropsRef.current, {
|
|
52
|
+
docked,
|
|
53
|
+
// explicit prop to rerender on update
|
|
54
|
+
shouldRenderDockButton: !!onDock && docked != null,
|
|
55
|
+
});
|
|
56
|
+
const islandRef = useRef(null);
|
|
57
|
+
useImperativeHandle(ref, () => {
|
|
58
|
+
return islandRef.current;
|
|
59
|
+
});
|
|
60
|
+
const device = useDevice();
|
|
61
|
+
const closeLibrary = useCallback(() => {
|
|
62
|
+
const isDialogOpen = !!document.querySelector(".Dialog");
|
|
63
|
+
// Prevent closing if any dialog is open
|
|
64
|
+
if (isDialogOpen) {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
setAppState({ openSidebar: null });
|
|
68
|
+
}, [setAppState]);
|
|
69
|
+
useOutsideClick(islandRef, useCallback((event) => {
|
|
70
|
+
// If click on the library icon, do nothing so that LibraryButton
|
|
71
|
+
// can toggle library menu
|
|
72
|
+
if (event.target.closest(".sidebar-trigger")) {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
if (!docked || !device.editor.canFitSidebar) {
|
|
76
|
+
closeLibrary();
|
|
77
|
+
}
|
|
78
|
+
}, [closeLibrary, docked, device.editor.canFitSidebar]));
|
|
79
|
+
useEffect(() => {
|
|
80
|
+
const handleKeyDown = (event) => {
|
|
81
|
+
if (event.key === KEYS.ESCAPE &&
|
|
82
|
+
(!docked || !device.editor.canFitSidebar)) {
|
|
83
|
+
closeLibrary();
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
document.addEventListener(EVENT.KEYDOWN, handleKeyDown);
|
|
87
|
+
return () => {
|
|
88
|
+
document.removeEventListener(EVENT.KEYDOWN, handleKeyDown);
|
|
89
|
+
};
|
|
90
|
+
}, [closeLibrary, docked, device.editor.canFitSidebar]);
|
|
91
|
+
return (_jsx(Island, { ...rest, className: clsx("sidebar", { "sidebar--docked": docked }, className), ref: islandRef, children: _jsx(SidebarPropsContext.Provider, { value: headerPropsRef.current, children: children }) }));
|
|
92
|
+
});
|
|
93
|
+
SidebarInner.displayName = "SidebarInner";
|
|
94
|
+
export const Sidebar = Object.assign(forwardRef((props, ref) => {
|
|
95
|
+
const appState = useUIAppState();
|
|
96
|
+
const { onStateChange } = props;
|
|
97
|
+
const refPrevOpenSidebar = useRef(appState.openSidebar);
|
|
98
|
+
useEffect(() => {
|
|
99
|
+
if (
|
|
100
|
+
// closing sidebar
|
|
101
|
+
((!appState.openSidebar &&
|
|
102
|
+
refPrevOpenSidebar?.current?.name === props.name) ||
|
|
103
|
+
// opening current sidebar
|
|
104
|
+
(appState.openSidebar?.name === props.name &&
|
|
105
|
+
refPrevOpenSidebar?.current?.name !== props.name) ||
|
|
106
|
+
// switching tabs or switching to a different sidebar
|
|
107
|
+
refPrevOpenSidebar.current?.name === props.name) &&
|
|
108
|
+
appState.openSidebar !== refPrevOpenSidebar.current) {
|
|
109
|
+
onStateChange?.(appState.openSidebar?.name !== props.name
|
|
110
|
+
? null
|
|
111
|
+
: appState.openSidebar);
|
|
112
|
+
}
|
|
113
|
+
refPrevOpenSidebar.current = appState.openSidebar;
|
|
114
|
+
}, [appState.openSidebar, onStateChange, props.name]);
|
|
115
|
+
const [mounted, setMounted] = useState(false);
|
|
116
|
+
useLayoutEffect(() => {
|
|
117
|
+
setMounted(true);
|
|
118
|
+
return () => setMounted(false);
|
|
119
|
+
}, []);
|
|
120
|
+
// We want to render in the next tick (hence `mounted` flag) so that it's
|
|
121
|
+
// guaranteed to happen after unmount of the previous sidebar (in case the
|
|
122
|
+
// previous sidebar is mounted after the next one). This is necessary to
|
|
123
|
+
// prevent flicker of subcomponents that support fallbacks
|
|
124
|
+
// (e.g. SidebarHeader). This is because we're using flags to determine
|
|
125
|
+
// whether prefer the fallback component or not (otherwise both will render
|
|
126
|
+
// initially), and the flag won't be reset in time if the unmount order
|
|
127
|
+
// it not correct.
|
|
128
|
+
//
|
|
129
|
+
// Alternative, and more general solution would be to namespace the fallback
|
|
130
|
+
// HoC so that state is not shared between subcomponents when the wrapping
|
|
131
|
+
// component is of the same type (e.g. Sidebar -> SidebarHeader).
|
|
132
|
+
const shouldRender = mounted && appState.openSidebar?.name === props.name;
|
|
133
|
+
if (!shouldRender) {
|
|
134
|
+
return null;
|
|
135
|
+
}
|
|
136
|
+
return _createElement(SidebarInner, { ...props, ref: ref, key: props.name });
|
|
137
|
+
}), {
|
|
138
|
+
Header: SidebarHeader,
|
|
139
|
+
TabTriggers: SidebarTabTriggers,
|
|
140
|
+
TabTrigger: SidebarTabTrigger,
|
|
141
|
+
Tabs: SidebarTabs,
|
|
142
|
+
Tab: SidebarTab,
|
|
143
|
+
Trigger: SidebarTrigger,
|
|
144
|
+
});
|
|
145
|
+
Sidebar.displayName = "Sidebar";
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
@import "open-color/open-color";
|
|
2
|
+
@import "../../css/variables.module.scss";
|
|
3
|
+
|
|
4
|
+
.excalidraw {
|
|
5
|
+
.sidebar {
|
|
6
|
+
display: flex;
|
|
7
|
+
flex-direction: column;
|
|
8
|
+
position: absolute;
|
|
9
|
+
top: 0;
|
|
10
|
+
bottom: 0;
|
|
11
|
+
right: 0;
|
|
12
|
+
z-index: 5;
|
|
13
|
+
margin: 0;
|
|
14
|
+
padding: 0;
|
|
15
|
+
box-sizing: border-box;
|
|
16
|
+
|
|
17
|
+
background-color: var(--sidebar-bg-color);
|
|
18
|
+
box-shadow: var(--sidebar-shadow);
|
|
19
|
+
|
|
20
|
+
pointer-events: var(--ui-pointerEvents);
|
|
21
|
+
|
|
22
|
+
:root[dir="rtl"] & {
|
|
23
|
+
left: 0;
|
|
24
|
+
right: auto;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
&--docked {
|
|
28
|
+
box-shadow: none;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
overflow: hidden;
|
|
32
|
+
border-radius: 0;
|
|
33
|
+
width: calc(#{$right-sidebar-width} - var(--space-factor) * 2);
|
|
34
|
+
|
|
35
|
+
border-left: 1px solid var(--sidebar-border-color);
|
|
36
|
+
|
|
37
|
+
:root[dir="rtl"] & {
|
|
38
|
+
border-right: 1px solid var(--sidebar-border-color);
|
|
39
|
+
border-left: 0;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// ---------------------------- sidebar header ------------------------------
|
|
44
|
+
|
|
45
|
+
.sidebar__header {
|
|
46
|
+
box-sizing: border-box;
|
|
47
|
+
display: flex;
|
|
48
|
+
justify-content: space-between;
|
|
49
|
+
align-items: center;
|
|
50
|
+
width: 100%;
|
|
51
|
+
padding: 1rem 0.75rem;
|
|
52
|
+
position: relative;
|
|
53
|
+
|
|
54
|
+
&::after {
|
|
55
|
+
content: "";
|
|
56
|
+
width: calc(100% - 1.5rem);
|
|
57
|
+
height: 1px;
|
|
58
|
+
background: var(--sidebar-border-color);
|
|
59
|
+
position: absolute;
|
|
60
|
+
bottom: -1px;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.sidebar__header__buttons {
|
|
65
|
+
gap: 0;
|
|
66
|
+
display: flex;
|
|
67
|
+
align-items: center;
|
|
68
|
+
margin-left: auto;
|
|
69
|
+
|
|
70
|
+
button {
|
|
71
|
+
@include outlineButtonStyles;
|
|
72
|
+
--button-bg: transparent;
|
|
73
|
+
border: 0 !important;
|
|
74
|
+
|
|
75
|
+
width: var(--lg-button-size);
|
|
76
|
+
height: var(--lg-button-size);
|
|
77
|
+
padding: 0;
|
|
78
|
+
|
|
79
|
+
svg {
|
|
80
|
+
width: var(--lg-icon-size);
|
|
81
|
+
height: var(--lg-icon-size);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
&:hover {
|
|
85
|
+
background: var(--button-hover-bg, var(--island-bg-color));
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.sidebar__dock.selected {
|
|
90
|
+
svg {
|
|
91
|
+
stroke: var(--color-primary);
|
|
92
|
+
fill: var(--color-primary);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
// ---------------------------- sidebar tabs ------------------------------
|
|
98
|
+
|
|
99
|
+
.sidebar-tabs-root {
|
|
100
|
+
display: flex;
|
|
101
|
+
flex-direction: column;
|
|
102
|
+
flex: 1 1 auto;
|
|
103
|
+
padding: 1rem 0;
|
|
104
|
+
|
|
105
|
+
[role="tabpanel"] {
|
|
106
|
+
flex: 1;
|
|
107
|
+
outline: none;
|
|
108
|
+
|
|
109
|
+
flex: 1 1 auto;
|
|
110
|
+
display: flex;
|
|
111
|
+
flex-direction: column;
|
|
112
|
+
outline: none;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
[role="tabpanel"][data-state="inactive"] {
|
|
116
|
+
display: none !important;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
[role="tablist"] {
|
|
120
|
+
display: grid;
|
|
121
|
+
gap: 1rem;
|
|
122
|
+
grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.sidebar-tabs-root > .sidebar__header {
|
|
127
|
+
padding-top: 0;
|
|
128
|
+
padding-bottom: 1rem;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.sidebar-tab-trigger {
|
|
132
|
+
--button-width: auto;
|
|
133
|
+
--button-bg: transparent;
|
|
134
|
+
--button-hover-bg: transparent;
|
|
135
|
+
--button-active-bg: var(--color-primary);
|
|
136
|
+
--button-hover-color: var(--color-primary);
|
|
137
|
+
--button-hover-border: var(--color-primary);
|
|
138
|
+
|
|
139
|
+
&[data-state="active"] {
|
|
140
|
+
--button-bg: var(--color-primary);
|
|
141
|
+
--button-hover-bg: var(--color-primary-darker);
|
|
142
|
+
--button-hover-color: var(--color-icon-white);
|
|
143
|
+
--button-border: var(--color-primary);
|
|
144
|
+
color: var(--color-icon-white);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
// ---------------------------- default sidebar ------------------------------
|
|
149
|
+
|
|
150
|
+
.default-sidebar {
|
|
151
|
+
display: flex;
|
|
152
|
+
flex-direction: column;
|
|
153
|
+
|
|
154
|
+
.sidebar-triggers {
|
|
155
|
+
$padding: 2px;
|
|
156
|
+
$border: 1px;
|
|
157
|
+
display: flex;
|
|
158
|
+
gap: 0;
|
|
159
|
+
padding: $padding;
|
|
160
|
+
// offset by padding + border to vertically center the list with sibling
|
|
161
|
+
// buttons (both from top and bototm, due to flex layout)
|
|
162
|
+
margin-top: -#{$padding + $border};
|
|
163
|
+
margin-bottom: -#{$padding + $border};
|
|
164
|
+
border: $border solid var(--sidebar-border-color);
|
|
165
|
+
background: var(--default-bg-color);
|
|
166
|
+
border-radius: 0.625rem;
|
|
167
|
+
|
|
168
|
+
.sidebar-tab-trigger {
|
|
169
|
+
height: var(--lg-button-size);
|
|
170
|
+
width: var(--lg-button-size);
|
|
171
|
+
|
|
172
|
+
border: none;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import clsx from "clsx";
|
|
3
|
+
import { useContext } from "react";
|
|
4
|
+
import { t } from "../../i18n";
|
|
5
|
+
import { useDevice } from "../App";
|
|
6
|
+
import { SidebarPropsContext } from "./common";
|
|
7
|
+
import { CloseIcon, PinIcon } from "../icons";
|
|
8
|
+
import { Tooltip } from "../Tooltip";
|
|
9
|
+
import { Button } from "../Button";
|
|
10
|
+
export const SidebarHeader = ({ children, className, }) => {
|
|
11
|
+
const device = useDevice();
|
|
12
|
+
const props = useContext(SidebarPropsContext);
|
|
13
|
+
const renderDockButton = !!(device.editor.canFitSidebar && props.shouldRenderDockButton);
|
|
14
|
+
return (_jsxs("div", { className: clsx("sidebar__header", className), "data-testid": "sidebar-header", children: [children, _jsxs("div", { className: "sidebar__header__buttons", children: [renderDockButton && (_jsx(Tooltip, { label: t("labels.sidebarLock"), children: _jsx(Button, { onSelect: () => props.onDock?.(!props.docked), selected: !!props.docked, className: "sidebar__dock", "data-testid": "sidebar-dock", "aria-label": t("labels.sidebarLock"), children: PinIcon }) })), _jsx(Button, { "data-testid": "sidebar-close", className: "sidebar__close", onSelect: props.onCloseRequest, "aria-label": t("buttons.close"), children: CloseIcon })] })] }));
|
|
15
|
+
};
|
|
16
|
+
SidebarHeader.displayName = "SidebarHeader";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as RadixTabs from "@radix-ui/react-tabs";
|
|
3
|
+
export const SidebarTab = ({ tab, children, ...rest }) => {
|
|
4
|
+
return (_jsx(RadixTabs.Content, { ...rest, value: tab, children: children }));
|
|
5
|
+
};
|
|
6
|
+
SidebarTab.displayName = "SidebarTab";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as RadixTabs from "@radix-ui/react-tabs";
|
|
3
|
+
export const SidebarTabTrigger = ({ children, tab, onSelect, ...rest }) => {
|
|
4
|
+
return (_jsx(RadixTabs.Trigger, { value: tab, asChild: true, onSelect: onSelect, children: _jsx("button", { type: "button", className: `excalidraw-button sidebar-tab-trigger`, ...rest, children: children }) }));
|
|
5
|
+
};
|
|
6
|
+
SidebarTabTrigger.displayName = "SidebarTabTrigger";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as RadixTabs from "@radix-ui/react-tabs";
|
|
3
|
+
export const SidebarTabTriggers = ({ children, ...rest }) => {
|
|
4
|
+
return (_jsx(RadixTabs.List, { className: "sidebar-triggers", ...rest, children: children }));
|
|
5
|
+
};
|
|
6
|
+
SidebarTabTriggers.displayName = "SidebarTabTriggers";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as RadixTabs from "@radix-ui/react-tabs";
|
|
3
|
+
import { useUIAppState } from "../../context/ui-appState";
|
|
4
|
+
import { useExcalidrawSetAppState } from "../App";
|
|
5
|
+
export const SidebarTabs = ({ children, ...rest }) => {
|
|
6
|
+
const appState = useUIAppState();
|
|
7
|
+
const setAppState = useExcalidrawSetAppState();
|
|
8
|
+
if (!appState.openSidebar) {
|
|
9
|
+
return null;
|
|
10
|
+
}
|
|
11
|
+
const { name } = appState.openSidebar;
|
|
12
|
+
return (_jsx(RadixTabs.Root, { className: "sidebar-tabs-root", value: appState.openSidebar.tab, onValueChange: (tab) => setAppState((state) => ({
|
|
13
|
+
...state,
|
|
14
|
+
openSidebar: { ...state.openSidebar, name, tab },
|
|
15
|
+
})), ...rest, children: children }));
|
|
16
|
+
};
|
|
17
|
+
SidebarTabs.displayName = "SidebarTabs";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useExcalidrawSetAppState } from "../App";
|
|
3
|
+
import { useUIAppState } from "../../context/ui-appState";
|
|
4
|
+
import clsx from "clsx";
|
|
5
|
+
import "./SidebarTrigger.scss";
|
|
6
|
+
export const SidebarTrigger = ({ name, tab, icon, title, children, onToggle, className, style, }) => {
|
|
7
|
+
const setAppState = useExcalidrawSetAppState();
|
|
8
|
+
const appState = useUIAppState();
|
|
9
|
+
return (_jsxs("label", { title: title, className: "sidebar-trigger__label-element", children: [_jsx("input", { className: "ToolIcon_type_checkbox", type: "checkbox", onChange: (event) => {
|
|
10
|
+
document
|
|
11
|
+
.querySelector(".layer-ui__wrapper")
|
|
12
|
+
?.classList.remove("animate");
|
|
13
|
+
const isOpen = event.target.checked;
|
|
14
|
+
setAppState({ openSidebar: isOpen ? { name, tab } : null });
|
|
15
|
+
onToggle?.(isOpen);
|
|
16
|
+
}, checked: appState.openSidebar?.name === name, "aria-label": title, "aria-keyshortcuts": "0" }), _jsxs("div", { className: clsx("sidebar-trigger", className), style: style, children: [icon && _jsx("div", { children: icon }), children && _jsx("div", { className: "sidebar-trigger__label", children: children })] })] }));
|
|
17
|
+
};
|
|
18
|
+
SidebarTrigger.displayName = "SidebarTrigger";
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
@import "../../css/variables.module.scss";
|
|
2
|
+
|
|
3
|
+
.excalidraw {
|
|
4
|
+
.sidebar-trigger {
|
|
5
|
+
@include outlineButtonStyles;
|
|
6
|
+
@include filledButtonOnCanvas;
|
|
7
|
+
|
|
8
|
+
width: auto;
|
|
9
|
+
height: var(--lg-button-size);
|
|
10
|
+
|
|
11
|
+
display: flex;
|
|
12
|
+
align-items: center;
|
|
13
|
+
gap: 0.5rem;
|
|
14
|
+
|
|
15
|
+
line-height: 0;
|
|
16
|
+
|
|
17
|
+
font-size: 0.75rem;
|
|
18
|
+
letter-spacing: 0.4px;
|
|
19
|
+
|
|
20
|
+
svg {
|
|
21
|
+
width: var(--lg-icon-size);
|
|
22
|
+
height: var(--lg-icon-size);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
&__label-element {
|
|
26
|
+
align-self: flex-start;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.default-sidebar-trigger .sidebar-trigger__label {
|
|
31
|
+
display: block;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
&.excalidraw--mobile .default-sidebar-trigger .sidebar-trigger__label {
|
|
35
|
+
display: none;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import "./Spinner.scss";
|
|
4
|
+
const Spinner = ({ size = "1em", circleWidth = 8, synchronized = false, }) => {
|
|
5
|
+
const mountTime = React.useRef(Date.now());
|
|
6
|
+
const mountDelay = -(mountTime.current % 1600);
|
|
7
|
+
return (_jsx("div", { className: "Spinner", children: _jsx("svg", { viewBox: "0 0 100 100", style: {
|
|
8
|
+
width: size,
|
|
9
|
+
height: size,
|
|
10
|
+
// fix for remounting causing spinner flicker
|
|
11
|
+
["--spinner-delay"]: synchronized ? `${mountDelay}ms` : 0,
|
|
12
|
+
}, children: _jsx("circle", { cx: "50", cy: "50", r: 50 - circleWidth / 2, strokeWidth: circleWidth, fill: "none", strokeMiterlimit: "10" }) }) }));
|
|
13
|
+
};
|
|
14
|
+
export default Spinner;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
@import "open-color/open-color.scss";
|
|
2
|
+
|
|
3
|
+
$duration: 1.6s;
|
|
4
|
+
|
|
5
|
+
.excalidraw {
|
|
6
|
+
.Spinner {
|
|
7
|
+
display: flex;
|
|
8
|
+
align-items: center;
|
|
9
|
+
justify-content: center;
|
|
10
|
+
height: 100%;
|
|
11
|
+
margin-left: auto;
|
|
12
|
+
margin-right: auto;
|
|
13
|
+
|
|
14
|
+
--spinner-color: var(--icon-fill-color);
|
|
15
|
+
|
|
16
|
+
svg {
|
|
17
|
+
animation: rotate $duration linear infinite;
|
|
18
|
+
animation-delay: var(--spinner-delay);
|
|
19
|
+
transform-origin: center center;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
circle {
|
|
23
|
+
stroke: var(--spinner-color);
|
|
24
|
+
animation: dash $duration linear 0s infinite;
|
|
25
|
+
stroke-linecap: round;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
@keyframes rotate {
|
|
30
|
+
100% {
|
|
31
|
+
transform: rotate(360deg);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
@keyframes dash {
|
|
36
|
+
0% {
|
|
37
|
+
stroke-dasharray: 1, 300;
|
|
38
|
+
stroke-dashoffset: 0;
|
|
39
|
+
}
|
|
40
|
+
50% {
|
|
41
|
+
stroke-dasharray: 150, 300;
|
|
42
|
+
stroke-dashoffset: -200;
|
|
43
|
+
}
|
|
44
|
+
100% {
|
|
45
|
+
stroke-dasharray: 1, 300;
|
|
46
|
+
stroke-dashoffset: -280;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import "./Stack.scss";
|
|
3
|
+
import { forwardRef } from "react";
|
|
4
|
+
import clsx from "clsx";
|
|
5
|
+
const RowStack = forwardRef(({ children, gap, align, justifyContent, className, style }, ref) => {
|
|
6
|
+
return (_jsx("div", { className: clsx("Stack Stack_horizontal", className), style: {
|
|
7
|
+
"--gap": gap,
|
|
8
|
+
alignItems: align,
|
|
9
|
+
justifyContent,
|
|
10
|
+
...style,
|
|
11
|
+
}, ref: ref, children: children }));
|
|
12
|
+
});
|
|
13
|
+
const ColStack = forwardRef(({ children, gap, align, justifyContent, className, style }, ref) => {
|
|
14
|
+
return (_jsx("div", { className: clsx("Stack Stack_vertical", className), style: {
|
|
15
|
+
"--gap": gap,
|
|
16
|
+
justifyItems: align,
|
|
17
|
+
justifyContent,
|
|
18
|
+
...style,
|
|
19
|
+
}, ref: ref, children: children }));
|
|
20
|
+
});
|
|
21
|
+
export default {
|
|
22
|
+
Row: RowStack,
|
|
23
|
+
Col: ColStack,
|
|
24
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
.excalidraw {
|
|
2
|
+
.Stack {
|
|
3
|
+
--gap: 0;
|
|
4
|
+
display: grid;
|
|
5
|
+
gap: calc(var(--space-factor) * var(--gap));
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.Stack_vertical {
|
|
9
|
+
grid-template-columns: auto;
|
|
10
|
+
grid-auto-flow: row;
|
|
11
|
+
grid-auto-rows: min-content;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.Stack_horizontal {
|
|
15
|
+
grid-template-rows: auto;
|
|
16
|
+
grid-auto-flow: column;
|
|
17
|
+
grid-auto-columns: min-content;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { getCommonBounds } from "../element/bounds";
|
|
3
|
+
import { t } from "../i18n";
|
|
4
|
+
import { getTargetElements } from "../scene";
|
|
5
|
+
import { CloseIcon } from "./icons";
|
|
6
|
+
import { Island } from "./Island";
|
|
7
|
+
import "./Stats.scss";
|
|
8
|
+
export const Stats = (props) => {
|
|
9
|
+
const boundingBox = getCommonBounds(props.elements);
|
|
10
|
+
const selectedElements = getTargetElements(props.elements, props.appState);
|
|
11
|
+
const selectedBoundingBox = getCommonBounds(selectedElements);
|
|
12
|
+
return (_jsx("div", { className: "Stats", children: _jsxs(Island, { padding: 2, children: [_jsx("div", { className: "close", onClick: props.onClose, children: CloseIcon }), _jsx("h3", { children: t("stats.title") }), _jsx("table", { children: _jsxs("tbody", { children: [_jsx("tr", { children: _jsx("th", { colSpan: 2, children: t("stats.scene") }) }), _jsxs("tr", { children: [_jsx("td", { children: t("stats.elements") }), _jsx("td", { children: props.elements.length })] }), _jsxs("tr", { children: [_jsx("td", { children: t("stats.width") }), _jsx("td", { children: Math.round(boundingBox[2]) - Math.round(boundingBox[0]) })] }), _jsxs("tr", { children: [_jsx("td", { children: t("stats.height") }), _jsx("td", { children: Math.round(boundingBox[3]) - Math.round(boundingBox[1]) })] }), selectedElements.length === 1 && (_jsx("tr", { children: _jsx("th", { colSpan: 2, children: t("stats.element") }) })), selectedElements.length > 1 && (_jsxs(_Fragment, { children: [_jsx("tr", { children: _jsx("th", { colSpan: 2, children: t("stats.selected") }) }), _jsxs("tr", { children: [_jsx("td", { children: t("stats.elements") }), _jsx("td", { children: selectedElements.length })] })] })), selectedElements.length > 0 && (_jsxs(_Fragment, { children: [_jsxs("tr", { children: [_jsx("td", { children: "x" }), _jsx("td", { children: Math.round(selectedBoundingBox[0]) })] }), _jsxs("tr", { children: [_jsx("td", { children: "y" }), _jsx("td", { children: Math.round(selectedBoundingBox[1]) })] }), _jsxs("tr", { children: [_jsx("td", { children: t("stats.width") }), _jsx("td", { children: Math.round(selectedBoundingBox[2] - selectedBoundingBox[0]) })] }), _jsxs("tr", { children: [_jsx("td", { children: t("stats.height") }), _jsx("td", { children: Math.round(selectedBoundingBox[3] - selectedBoundingBox[1]) })] })] })), selectedElements.length === 1 && (_jsxs("tr", { children: [_jsx("td", { children: t("stats.angle") }), _jsx("td", { children: `${Math.round((selectedElements[0].angle * 180) / Math.PI)}°` })] })), props.renderCustomStats?.(props.elements, props.appState)] }) })] }) }));
|
|
13
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
@import "../css/variables.module.scss";
|
|
2
|
+
|
|
3
|
+
.excalidraw {
|
|
4
|
+
.Stats {
|
|
5
|
+
position: absolute;
|
|
6
|
+
top: 64px;
|
|
7
|
+
right: 12px;
|
|
8
|
+
font-size: 12px;
|
|
9
|
+
z-index: 10;
|
|
10
|
+
pointer-events: var(--ui-pointerEvents);
|
|
11
|
+
|
|
12
|
+
h3 {
|
|
13
|
+
margin: 0 24px 8px 0;
|
|
14
|
+
white-space: nowrap;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.close {
|
|
18
|
+
float: right;
|
|
19
|
+
height: 16px;
|
|
20
|
+
width: 16px;
|
|
21
|
+
cursor: pointer;
|
|
22
|
+
svg {
|
|
23
|
+
width: 100%;
|
|
24
|
+
height: 100%;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
table {
|
|
29
|
+
width: 100%;
|
|
30
|
+
th {
|
|
31
|
+
border-bottom: 1px solid var(--input-border-color);
|
|
32
|
+
padding: 4px;
|
|
33
|
+
}
|
|
34
|
+
tr {
|
|
35
|
+
td:nth-child(2) {
|
|
36
|
+
min-width: 24px;
|
|
37
|
+
text-align: right;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
:root[dir="rtl"] & {
|
|
43
|
+
left: 12px;
|
|
44
|
+
right: initial;
|
|
45
|
+
|
|
46
|
+
h3 {
|
|
47
|
+
margin: 0 0 8px 24px;
|
|
48
|
+
}
|
|
49
|
+
.close {
|
|
50
|
+
float: left;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import clsx from "clsx";
|
|
3
|
+
import "./Switch.scss";
|
|
4
|
+
export const Switch = ({ title, name, checked, onChange, disabled = false, }) => {
|
|
5
|
+
return (_jsx("div", { className: clsx("Switch", { toggled: checked, disabled }), children: _jsx("input", { name: name, id: name, title: title, type: "checkbox", checked: checked, disabled: disabled, onChange: () => onChange(!checked), onKeyDown: (event) => {
|
|
6
|
+
if (event.key === " ") {
|
|
7
|
+
onChange(!checked);
|
|
8
|
+
}
|
|
9
|
+
} }) }));
|
|
10
|
+
};
|