@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,225 @@
|
|
|
1
|
+
import { LaserPointer } from "@excalidraw/laser-pointer";
|
|
2
|
+
import { sceneCoordsToViewportCoords } from "../../utils";
|
|
3
|
+
import { getClientColor } from "../../clients";
|
|
4
|
+
// decay time in milliseconds
|
|
5
|
+
const DECAY_TIME = 1000;
|
|
6
|
+
// length of line in points before it starts decaying
|
|
7
|
+
const DECAY_LENGTH = 50;
|
|
8
|
+
const average = (a, b) => (a + b) / 2;
|
|
9
|
+
function getSvgPathFromStroke(points, closed = true) {
|
|
10
|
+
const len = points.length;
|
|
11
|
+
if (len < 4) {
|
|
12
|
+
return ``;
|
|
13
|
+
}
|
|
14
|
+
let a = points[0];
|
|
15
|
+
let b = points[1];
|
|
16
|
+
const c = points[2];
|
|
17
|
+
let result = `M${a[0].toFixed(2)},${a[1].toFixed(2)} Q${b[0].toFixed(2)},${b[1].toFixed(2)} ${average(b[0], c[0]).toFixed(2)},${average(b[1], c[1]).toFixed(2)} T`;
|
|
18
|
+
for (let i = 2, max = len - 1; i < max; i++) {
|
|
19
|
+
a = points[i];
|
|
20
|
+
b = points[i + 1];
|
|
21
|
+
result += `${average(a[0], b[0]).toFixed(2)},${average(a[1], b[1]).toFixed(2)} `;
|
|
22
|
+
}
|
|
23
|
+
if (closed) {
|
|
24
|
+
result += "Z";
|
|
25
|
+
}
|
|
26
|
+
return result;
|
|
27
|
+
}
|
|
28
|
+
function easeOutCubic(t) {
|
|
29
|
+
return 1 - Math.pow(1 - t, 3);
|
|
30
|
+
}
|
|
31
|
+
function instantiateCollabolatorState() {
|
|
32
|
+
return {
|
|
33
|
+
currentPath: undefined,
|
|
34
|
+
finishedPaths: [],
|
|
35
|
+
lastPoint: [-10000, -10000],
|
|
36
|
+
svg: document.createElementNS("http://www.w3.org/2000/svg", "path"),
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
function instantiatePath() {
|
|
40
|
+
LaserPointer.constants.cornerDetectionMaxAngle = 70;
|
|
41
|
+
return new LaserPointer({
|
|
42
|
+
simplify: 0,
|
|
43
|
+
streamline: 0.4,
|
|
44
|
+
sizeMapping: (c) => {
|
|
45
|
+
const pt = DECAY_TIME;
|
|
46
|
+
const pl = DECAY_LENGTH;
|
|
47
|
+
const t = Math.max(0, 1 - (performance.now() - c.pressure) / pt);
|
|
48
|
+
const l = (pl - Math.min(pl, c.totalLength - c.currentIndex)) / pl;
|
|
49
|
+
return Math.min(easeOutCubic(l), easeOutCubic(t));
|
|
50
|
+
},
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
export class LaserPathManager {
|
|
54
|
+
app;
|
|
55
|
+
ownState;
|
|
56
|
+
collaboratorsState = new Map();
|
|
57
|
+
rafId;
|
|
58
|
+
isDrawing = false;
|
|
59
|
+
container;
|
|
60
|
+
constructor(app) {
|
|
61
|
+
this.app = app;
|
|
62
|
+
this.ownState = instantiateCollabolatorState();
|
|
63
|
+
}
|
|
64
|
+
destroy() {
|
|
65
|
+
this.stop();
|
|
66
|
+
this.isDrawing = false;
|
|
67
|
+
this.ownState = instantiateCollabolatorState();
|
|
68
|
+
this.collaboratorsState = new Map();
|
|
69
|
+
}
|
|
70
|
+
startPath(x, y) {
|
|
71
|
+
this.ownState.currentPath = instantiatePath();
|
|
72
|
+
this.ownState.currentPath.addPoint([x, y, performance.now()]);
|
|
73
|
+
this.updatePath(this.ownState);
|
|
74
|
+
}
|
|
75
|
+
addPointToPath(x, y) {
|
|
76
|
+
if (this.ownState.currentPath) {
|
|
77
|
+
this.ownState.currentPath?.addPoint([x, y, performance.now()]);
|
|
78
|
+
this.updatePath(this.ownState);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
endPath() {
|
|
82
|
+
if (this.ownState.currentPath) {
|
|
83
|
+
this.ownState.currentPath.close();
|
|
84
|
+
this.ownState.finishedPaths.push(this.ownState.currentPath);
|
|
85
|
+
this.updatePath(this.ownState);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
updatePath(state) {
|
|
89
|
+
this.isDrawing = true;
|
|
90
|
+
if (!this.isRunning) {
|
|
91
|
+
this.start();
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
isRunning = false;
|
|
95
|
+
start(svg) {
|
|
96
|
+
if (svg) {
|
|
97
|
+
this.container = svg;
|
|
98
|
+
this.container.appendChild(this.ownState.svg);
|
|
99
|
+
}
|
|
100
|
+
this.stop();
|
|
101
|
+
this.isRunning = true;
|
|
102
|
+
this.loop();
|
|
103
|
+
}
|
|
104
|
+
stop() {
|
|
105
|
+
this.isRunning = false;
|
|
106
|
+
if (this.rafId) {
|
|
107
|
+
cancelAnimationFrame(this.rafId);
|
|
108
|
+
}
|
|
109
|
+
this.rafId = undefined;
|
|
110
|
+
}
|
|
111
|
+
loop() {
|
|
112
|
+
this.rafId = requestAnimationFrame(this.loop.bind(this));
|
|
113
|
+
this.updateCollabolatorsState();
|
|
114
|
+
if (this.isDrawing) {
|
|
115
|
+
this.update();
|
|
116
|
+
}
|
|
117
|
+
else {
|
|
118
|
+
this.isRunning = false;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
draw(path) {
|
|
122
|
+
const stroke = path
|
|
123
|
+
.getStrokeOutline(path.options.size / this.app.state.zoom.value)
|
|
124
|
+
.map(([x, y]) => {
|
|
125
|
+
const result = sceneCoordsToViewportCoords({ sceneX: x, sceneY: y }, this.app.state);
|
|
126
|
+
return [result.x, result.y];
|
|
127
|
+
});
|
|
128
|
+
return getSvgPathFromStroke(stroke, true);
|
|
129
|
+
}
|
|
130
|
+
updateCollabolatorsState() {
|
|
131
|
+
if (!this.container || !this.app.state.collaborators.size) {
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
for (const [key, collabolator] of this.app.state.collaborators.entries()) {
|
|
135
|
+
if (!this.collaboratorsState.has(key)) {
|
|
136
|
+
const state = instantiateCollabolatorState();
|
|
137
|
+
this.container.appendChild(state.svg);
|
|
138
|
+
this.collaboratorsState.set(key, state);
|
|
139
|
+
this.updatePath(state);
|
|
140
|
+
}
|
|
141
|
+
const state = this.collaboratorsState.get(key);
|
|
142
|
+
if (collabolator.pointer && collabolator.pointer.tool === "laser") {
|
|
143
|
+
if (collabolator.button === "down" && state.currentPath === undefined) {
|
|
144
|
+
state.lastPoint = [collabolator.pointer.x, collabolator.pointer.y];
|
|
145
|
+
state.currentPath = instantiatePath();
|
|
146
|
+
state.currentPath.addPoint([
|
|
147
|
+
collabolator.pointer.x,
|
|
148
|
+
collabolator.pointer.y,
|
|
149
|
+
performance.now(),
|
|
150
|
+
]);
|
|
151
|
+
this.updatePath(state);
|
|
152
|
+
}
|
|
153
|
+
if (collabolator.button === "down" && state.currentPath !== undefined) {
|
|
154
|
+
if (collabolator.pointer.x !== state.lastPoint[0] ||
|
|
155
|
+
collabolator.pointer.y !== state.lastPoint[1]) {
|
|
156
|
+
state.lastPoint = [collabolator.pointer.x, collabolator.pointer.y];
|
|
157
|
+
state.currentPath.addPoint([
|
|
158
|
+
collabolator.pointer.x,
|
|
159
|
+
collabolator.pointer.y,
|
|
160
|
+
performance.now(),
|
|
161
|
+
]);
|
|
162
|
+
this.updatePath(state);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
if (collabolator.button === "up" && state.currentPath !== undefined) {
|
|
166
|
+
state.lastPoint = [collabolator.pointer.x, collabolator.pointer.y];
|
|
167
|
+
state.currentPath.addPoint([
|
|
168
|
+
collabolator.pointer.x,
|
|
169
|
+
collabolator.pointer.y,
|
|
170
|
+
performance.now(),
|
|
171
|
+
]);
|
|
172
|
+
state.currentPath.close();
|
|
173
|
+
state.finishedPaths.push(state.currentPath);
|
|
174
|
+
state.currentPath = undefined;
|
|
175
|
+
this.updatePath(state);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
update() {
|
|
181
|
+
if (!this.container) {
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
let somePathsExist = false;
|
|
185
|
+
for (const [key, state] of this.collaboratorsState.entries()) {
|
|
186
|
+
if (!this.app.state.collaborators.has(key)) {
|
|
187
|
+
state.svg.remove();
|
|
188
|
+
this.collaboratorsState.delete(key);
|
|
189
|
+
continue;
|
|
190
|
+
}
|
|
191
|
+
state.finishedPaths = state.finishedPaths.filter((path) => {
|
|
192
|
+
const lastPoint = path.originalPoints[path.originalPoints.length - 1];
|
|
193
|
+
return !(lastPoint && lastPoint[2] < performance.now() - DECAY_TIME);
|
|
194
|
+
});
|
|
195
|
+
let paths = state.finishedPaths.map((path) => this.draw(path)).join(" ");
|
|
196
|
+
if (state.currentPath) {
|
|
197
|
+
paths += ` ${this.draw(state.currentPath)}`;
|
|
198
|
+
}
|
|
199
|
+
if (paths.trim()) {
|
|
200
|
+
somePathsExist = true;
|
|
201
|
+
}
|
|
202
|
+
state.svg.setAttribute("d", paths);
|
|
203
|
+
state.svg.setAttribute("fill", getClientColor(key));
|
|
204
|
+
}
|
|
205
|
+
this.ownState.finishedPaths = this.ownState.finishedPaths.filter((path) => {
|
|
206
|
+
const lastPoint = path.originalPoints[path.originalPoints.length - 1];
|
|
207
|
+
return !(lastPoint && lastPoint[2] < performance.now() - DECAY_TIME);
|
|
208
|
+
});
|
|
209
|
+
let paths = this.ownState.finishedPaths
|
|
210
|
+
.map((path) => this.draw(path))
|
|
211
|
+
.join(" ");
|
|
212
|
+
if (this.ownState.currentPath) {
|
|
213
|
+
paths += ` ${this.draw(this.ownState.currentPath)}`;
|
|
214
|
+
}
|
|
215
|
+
paths = paths.trim();
|
|
216
|
+
if (paths) {
|
|
217
|
+
somePathsExist = true;
|
|
218
|
+
}
|
|
219
|
+
this.ownState.svg.setAttribute("d", paths);
|
|
220
|
+
this.ownState.svg.setAttribute("fill", "red");
|
|
221
|
+
if (!somePathsExist) {
|
|
222
|
+
this.isDrawing = false;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import "../ToolIcon.scss";
|
|
3
|
+
import clsx from "clsx";
|
|
4
|
+
import { laserPointerToolIcon } from "../icons";
|
|
5
|
+
const DEFAULT_SIZE = "small";
|
|
6
|
+
export const LaserPointerButton = (props) => {
|
|
7
|
+
return (_jsxs("label", { className: clsx("ToolIcon ToolIcon__LaserPointer", `ToolIcon_size_${DEFAULT_SIZE}`, {
|
|
8
|
+
"is-mobile": props.isMobile,
|
|
9
|
+
}), title: `${props.title}`, children: [_jsx("input", { className: "ToolIcon_type_checkbox", type: "checkbox", name: props.name, onChange: props.onChange, checked: props.checked, "aria-label": props.title, "data-testid": "toolbar-LaserPointer" }), _jsx("div", { className: "ToolIcon__icon", children: laserPointerToolIcon })] }));
|
|
10
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useRef } from "react";
|
|
3
|
+
import "./LaserToolOverlay.scss";
|
|
4
|
+
export const LaserToolOverlay = ({ manager }) => {
|
|
5
|
+
const svgRef = useRef(null);
|
|
6
|
+
useEffect(() => {
|
|
7
|
+
if (svgRef.current) {
|
|
8
|
+
manager.start(svgRef.current);
|
|
9
|
+
}
|
|
10
|
+
return () => {
|
|
11
|
+
manager.stop();
|
|
12
|
+
};
|
|
13
|
+
}, [manager]);
|
|
14
|
+
return (_jsx("div", { className: "LaserToolOverlay", children: _jsx("svg", { ref: svgRef, className: "LaserToolOverlayCanvas" }) }));
|
|
15
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
.excalidraw {
|
|
2
|
+
.LaserToolOverlay {
|
|
3
|
+
pointer-events: none;
|
|
4
|
+
width: 100vw;
|
|
5
|
+
height: 100vh;
|
|
6
|
+
position: fixed;
|
|
7
|
+
top: 0;
|
|
8
|
+
left: 0;
|
|
9
|
+
|
|
10
|
+
z-index: 2;
|
|
11
|
+
|
|
12
|
+
.LaserToolOverlayCanvas {
|
|
13
|
+
image-rendering: auto;
|
|
14
|
+
overflow: visible;
|
|
15
|
+
position: absolute;
|
|
16
|
+
top: 0;
|
|
17
|
+
left: 0;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import clsx from "clsx";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { CLASSES, DEFAULT_SIDEBAR, LIBRARY_SIDEBAR_WIDTH, TOOL_TYPE, } from "../constants";
|
|
5
|
+
import { showSelectedShapeActions } from "../element";
|
|
6
|
+
import { t } from "../i18n";
|
|
7
|
+
import { calculateScrollCenter } from "../scene";
|
|
8
|
+
import { capitalizeString, isShallowEqual } from "../utils";
|
|
9
|
+
import { SelectedShapeActions, ShapesSwitcher } from "./Actions";
|
|
10
|
+
import { ErrorDialog } from "./ErrorDialog";
|
|
11
|
+
import { ImageExportDialog } from "./ImageExportDialog";
|
|
12
|
+
import { FixedSideContainer } from "./FixedSideContainer";
|
|
13
|
+
import { HintViewer } from "./HintViewer";
|
|
14
|
+
import { Island } from "./Island";
|
|
15
|
+
import { LoadingMessage } from "./LoadingMessage";
|
|
16
|
+
import { LockButton } from "./LockButton";
|
|
17
|
+
import { MobileMenu } from "./MobileMenu";
|
|
18
|
+
import { PasteChartDialog } from "./PasteChartDialog";
|
|
19
|
+
import { Section } from "./Section";
|
|
20
|
+
import { HelpDialog } from "./HelpDialog";
|
|
21
|
+
import Stack from "./Stack";
|
|
22
|
+
import { UserList } from "./UserList";
|
|
23
|
+
import { JSONExportDialog } from "./JSONExportDialog";
|
|
24
|
+
import { PenModeButton } from "./PenModeButton";
|
|
25
|
+
import { trackEvent } from "../analytics";
|
|
26
|
+
import { useDevice } from "./App";
|
|
27
|
+
import { Stats } from "./Stats";
|
|
28
|
+
import { actionToggleStats } from "../actions/actionToggleStats";
|
|
29
|
+
import Footer from "./footer/Footer";
|
|
30
|
+
import { isSidebarDockedAtom } from "./Sidebar/Sidebar";
|
|
31
|
+
import { jotaiScope } from "../jotai";
|
|
32
|
+
import { Provider, useAtom, useAtomValue } from "jotai";
|
|
33
|
+
import MainMenu from "./main-menu/MainMenu";
|
|
34
|
+
import { ActiveConfirmDialog } from "./ActiveConfirmDialog";
|
|
35
|
+
import { OverwriteConfirmDialog } from "./OverwriteConfirm/OverwriteConfirm";
|
|
36
|
+
import { HandButton } from "./HandButton";
|
|
37
|
+
import { isHandToolActive } from "../appState";
|
|
38
|
+
import { TunnelsContext, useInitializeTunnels } from "../context/tunnels";
|
|
39
|
+
import { LibraryIcon } from "./icons";
|
|
40
|
+
import { UIAppStateContext } from "../context/ui-appState";
|
|
41
|
+
import { DefaultSidebar } from "./DefaultSidebar";
|
|
42
|
+
import { EyeDropper, activeEyeDropperAtom } from "./EyeDropper";
|
|
43
|
+
import "./LayerUI.scss";
|
|
44
|
+
import "./Toolbar.scss";
|
|
45
|
+
import { mutateElement } from "../element/mutateElement";
|
|
46
|
+
import { ShapeCache } from "../scene/ShapeCache";
|
|
47
|
+
import Scene from "../scene/Scene";
|
|
48
|
+
import { LaserPointerButton } from "./LaserTool/LaserPointerButton";
|
|
49
|
+
import { MagicSettings } from "./MagicSettings";
|
|
50
|
+
import { TTDDialog } from "./TTDDialog/TTDDialog";
|
|
51
|
+
const DefaultMainMenu = ({ UIOptions }) => {
|
|
52
|
+
return (_jsxs(MainMenu, { __fallback: true, children: [_jsx(MainMenu.DefaultItems.LoadScene, {}), _jsx(MainMenu.DefaultItems.SaveToActiveFile, {}), UIOptions.canvasActions.export && _jsx(MainMenu.DefaultItems.Export, {}), UIOptions.canvasActions.saveAsImage && (_jsx(MainMenu.DefaultItems.SaveAsImage, {})), _jsx(MainMenu.DefaultItems.Help, {}), _jsx(MainMenu.DefaultItems.ClearCanvas, {}), _jsx(MainMenu.Separator, {}), _jsx(MainMenu.Group, { title: "Excalidraw links", children: _jsx(MainMenu.DefaultItems.Socials, {}) }), _jsx(MainMenu.Separator, {}), _jsx(MainMenu.DefaultItems.ToggleTheme, {}), _jsx(MainMenu.DefaultItems.ChangeCanvasBackground, {})] }));
|
|
53
|
+
};
|
|
54
|
+
const DefaultOverwriteConfirmDialog = () => {
|
|
55
|
+
return (_jsxs(OverwriteConfirmDialog, { __fallback: true, children: [_jsx(OverwriteConfirmDialog.Actions.SaveToDisk, {}), _jsx(OverwriteConfirmDialog.Actions.ExportToImage, {})] }));
|
|
56
|
+
};
|
|
57
|
+
const LayerUI = ({ actionManager, appState, files, setAppState, elements, canvas, onLockToggle, onHandToolToggle, onPenModeToggle, showExitZenModeBtn, renderTopRightUI, renderCustomStats, UIOptions, onExportImage, renderWelcomeScreen, children, app, isCollaborating, openAIKey, isOpenAIKeyPersisted, onOpenAIAPIKeyChange, onMagicSettingsConfirm, }) => {
|
|
58
|
+
const device = useDevice();
|
|
59
|
+
const tunnels = useInitializeTunnels();
|
|
60
|
+
const [eyeDropperState, setEyeDropperState] = useAtom(activeEyeDropperAtom, jotaiScope);
|
|
61
|
+
const renderJSONExportDialog = () => {
|
|
62
|
+
if (!UIOptions.canvasActions.export) {
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
return (_jsx(JSONExportDialog, { elements: elements, appState: appState, files: files, actionManager: actionManager, exportOpts: UIOptions.canvasActions.export, canvas: canvas, setAppState: setAppState }));
|
|
66
|
+
};
|
|
67
|
+
const renderImageExportDialog = () => {
|
|
68
|
+
if (!UIOptions.canvasActions.saveAsImage ||
|
|
69
|
+
appState.openDialog?.name !== "imageExport") {
|
|
70
|
+
return null;
|
|
71
|
+
}
|
|
72
|
+
return (_jsx(ImageExportDialog, { elements: elements, appState: appState, files: files, actionManager: actionManager, onExportImage: onExportImage, onCloseRequest: () => setAppState({ openDialog: null }) }));
|
|
73
|
+
};
|
|
74
|
+
const renderCanvasActions = () => (_jsxs("div", { style: { position: "relative" }, children: [_jsx(tunnels.MainMenuTunnel.Out, {}), renderWelcomeScreen && _jsx(tunnels.WelcomeScreenMenuHintTunnel.Out, {})] }));
|
|
75
|
+
const renderSelectedShapeActions = () => (_jsx(Section, { heading: "selectedShapeActions", className: clsx("selected-shape-actions zen-mode-transition", {
|
|
76
|
+
"transition-left": appState.zenModeEnabled,
|
|
77
|
+
}), children: _jsx(Island, { className: CLASSES.SHAPE_ACTIONS_MENU, padding: 2, style: {
|
|
78
|
+
// we want to make sure this doesn't overflow so subtracting the
|
|
79
|
+
// approximate height of hamburgerMenu + footer
|
|
80
|
+
maxHeight: `${appState.height - 166}px`,
|
|
81
|
+
}, children: _jsx(SelectedShapeActions, { appState: appState, elements: elements, renderAction: actionManager.renderAction }) }) }));
|
|
82
|
+
const renderFixedSideContainer = () => {
|
|
83
|
+
const shouldRenderSelectedShapeActions = showSelectedShapeActions(appState, elements);
|
|
84
|
+
return (_jsx(FixedSideContainer, { side: "top", children: _jsxs("div", { className: "App-menu App-menu_top", children: [_jsxs(Stack.Col, { gap: 6, className: clsx("App-menu_top__left"), children: [renderCanvasActions(), shouldRenderSelectedShapeActions && renderSelectedShapeActions()] }), !appState.viewModeEnabled && (_jsx(Section, { heading: "shapes", className: "shapes-section", children: (heading) => (_jsxs("div", { style: { position: "relative" }, children: [renderWelcomeScreen && (_jsx(tunnels.WelcomeScreenToolbarHintTunnel.Out, {})), _jsx(Stack.Col, { gap: 4, align: "start", children: _jsxs(Stack.Row, { gap: 1, className: clsx("App-toolbar-container", {
|
|
85
|
+
"zen-mode": appState.zenModeEnabled,
|
|
86
|
+
}), children: [_jsxs(Island, { padding: 1, className: clsx("App-toolbar", {
|
|
87
|
+
"zen-mode": appState.zenModeEnabled,
|
|
88
|
+
}), children: [_jsx(HintViewer, { appState: appState, isMobile: device.editor.isMobile, device: device, app: app }), heading, _jsxs(Stack.Row, { gap: 1, children: [_jsx(PenModeButton, { zenModeEnabled: appState.zenModeEnabled, checked: appState.penMode, onChange: () => onPenModeToggle(null), title: t("toolBar.penMode"), penDetected: appState.penDetected }), _jsx(LockButton, { checked: appState.activeTool.locked, onChange: onLockToggle, title: t("toolBar.lock") }), _jsx("div", { className: "App-toolbar__divider" }), _jsx(HandButton, { checked: isHandToolActive(appState), onChange: () => onHandToolToggle(), title: t("toolBar.hand"), isMobile: true }), _jsx(ShapesSwitcher, { appState: appState, activeTool: appState.activeTool, UIOptions: UIOptions, app: app })] })] }), isCollaborating && (_jsx(Island, { style: {
|
|
89
|
+
marginLeft: 8,
|
|
90
|
+
alignSelf: "center",
|
|
91
|
+
height: "fit-content",
|
|
92
|
+
}, children: _jsx(LaserPointerButton, { title: t("toolBar.laser"), checked: appState.activeTool.type === TOOL_TYPE.laser, onChange: () => app.setActiveTool({ type: TOOL_TYPE.laser }), isMobile: true }) }))] }) })] })) })), _jsxs("div", { className: clsx("layer-ui__wrapper__top-right zen-mode-transition", {
|
|
93
|
+
"transition-right": appState.zenModeEnabled,
|
|
94
|
+
}), children: [appState.collaborators.size > 0 && (_jsx(UserList, { collaborators: appState.collaborators, userToFollow: appState.userToFollow?.socketId || null })), renderTopRightUI?.(device.editor.isMobile, appState), !appState.viewModeEnabled &&
|
|
95
|
+
// hide button when sidebar docked
|
|
96
|
+
(!isSidebarDocked ||
|
|
97
|
+
appState.openSidebar?.name !== DEFAULT_SIDEBAR.name) && (_jsx(tunnels.DefaultSidebarTriggerTunnel.Out, {}))] })] }) }));
|
|
98
|
+
};
|
|
99
|
+
const renderSidebars = () => {
|
|
100
|
+
return (_jsx(DefaultSidebar, { __fallback: true, onDock: (docked) => {
|
|
101
|
+
trackEvent("sidebar", `toggleDock (${docked ? "dock" : "undock"})`, `(${device.editor.isMobile ? "mobile" : "desktop"})`);
|
|
102
|
+
} }));
|
|
103
|
+
};
|
|
104
|
+
const isSidebarDocked = useAtomValue(isSidebarDockedAtom, jotaiScope);
|
|
105
|
+
const layerUIJSX = (_jsxs(_Fragment, { children: [children, _jsx(DefaultMainMenu, { UIOptions: UIOptions }), _jsx(DefaultSidebar.Trigger, { __fallback: true, icon: LibraryIcon, title: capitalizeString(t("toolBar.library")), onToggle: (open) => {
|
|
106
|
+
if (open) {
|
|
107
|
+
trackEvent("sidebar", `${DEFAULT_SIDEBAR.name} (open)`, `button (${device.editor.isMobile ? "mobile" : "desktop"})`);
|
|
108
|
+
}
|
|
109
|
+
}, tab: DEFAULT_SIDEBAR.defaultTab, children: t("toolBar.library") }), _jsx(DefaultOverwriteConfirmDialog, {}), appState.openDialog?.name === "ttd" && _jsx(TTDDialog, { __fallback: true }), appState.isLoading && _jsx(LoadingMessage, { delay: 250 }), appState.errorMessage && (_jsx(ErrorDialog, { onClose: () => setAppState({ errorMessage: null }), children: appState.errorMessage })), eyeDropperState && !device.editor.isMobile && (_jsx(EyeDropper, { colorPickerType: eyeDropperState.colorPickerType, onCancel: () => {
|
|
110
|
+
setEyeDropperState(null);
|
|
111
|
+
}, onChange: (colorPickerType, color, selectedElements, { altKey }) => {
|
|
112
|
+
if (colorPickerType !== "elementBackground" &&
|
|
113
|
+
colorPickerType !== "elementStroke") {
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
if (selectedElements.length) {
|
|
117
|
+
for (const element of selectedElements) {
|
|
118
|
+
mutateElement(element, {
|
|
119
|
+
[altKey && eyeDropperState.swapPreviewOnAlt
|
|
120
|
+
? colorPickerType === "elementBackground"
|
|
121
|
+
? "strokeColor"
|
|
122
|
+
: "backgroundColor"
|
|
123
|
+
: colorPickerType === "elementBackground"
|
|
124
|
+
? "backgroundColor"
|
|
125
|
+
: "strokeColor"]: color,
|
|
126
|
+
}, false);
|
|
127
|
+
ShapeCache.delete(element);
|
|
128
|
+
}
|
|
129
|
+
Scene.getScene(selectedElements[0])?.informMutation();
|
|
130
|
+
}
|
|
131
|
+
else if (colorPickerType === "elementBackground") {
|
|
132
|
+
setAppState({
|
|
133
|
+
currentItemBackgroundColor: color,
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
else {
|
|
137
|
+
setAppState({ currentItemStrokeColor: color });
|
|
138
|
+
}
|
|
139
|
+
}, onSelect: (color, event) => {
|
|
140
|
+
setEyeDropperState((state) => {
|
|
141
|
+
return state?.keepOpenOnAlt && event.altKey ? state : null;
|
|
142
|
+
});
|
|
143
|
+
eyeDropperState?.onSelect?.(color, event);
|
|
144
|
+
} })), appState.openDialog?.name === "help" && (_jsx(HelpDialog, { onClose: () => {
|
|
145
|
+
setAppState({ openDialog: null });
|
|
146
|
+
} })), appState.openDialog?.name === "settings" && (_jsx(MagicSettings, { openAIKey: openAIKey, isPersisted: isOpenAIKeyPersisted, onChange: onOpenAIAPIKeyChange, onConfirm: (apiKey, shouldPersist) => {
|
|
147
|
+
const source = appState.openDialog?.name === "settings"
|
|
148
|
+
? appState.openDialog?.source
|
|
149
|
+
: "settings";
|
|
150
|
+
setAppState({ openDialog: null }, () => {
|
|
151
|
+
onMagicSettingsConfirm(apiKey, shouldPersist, source);
|
|
152
|
+
});
|
|
153
|
+
}, onClose: () => {
|
|
154
|
+
setAppState({ openDialog: null });
|
|
155
|
+
} })), _jsx(ActiveConfirmDialog, {}), _jsx(tunnels.OverwriteConfirmDialogTunnel.Out, {}), renderImageExportDialog(), renderJSONExportDialog(), appState.pasteDialog.shown && (_jsx(PasteChartDialog, { setAppState: setAppState, appState: appState, onClose: () => setAppState({
|
|
156
|
+
pasteDialog: { shown: false, data: null },
|
|
157
|
+
}) })), device.editor.isMobile && (_jsx(MobileMenu, { app: app, appState: appState, elements: elements, actionManager: actionManager, renderJSONExportDialog: renderJSONExportDialog, renderImageExportDialog: renderImageExportDialog, setAppState: setAppState, onLockToggle: onLockToggle, onHandToolToggle: onHandToolToggle, onPenModeToggle: onPenModeToggle, renderTopRightUI: renderTopRightUI, renderCustomStats: renderCustomStats, renderSidebars: renderSidebars, device: device, renderWelcomeScreen: renderWelcomeScreen, UIOptions: UIOptions })), !device.editor.isMobile && (_jsxs(_Fragment, { children: [_jsxs("div", { className: "layer-ui__wrapper", style: appState.openSidebar &&
|
|
158
|
+
isSidebarDocked &&
|
|
159
|
+
device.editor.canFitSidebar
|
|
160
|
+
? { width: `calc(100% - ${LIBRARY_SIDEBAR_WIDTH}px)` }
|
|
161
|
+
: {}, children: [renderWelcomeScreen && _jsx(tunnels.WelcomeScreenCenterTunnel.Out, {}), renderFixedSideContainer(), _jsx(Footer, { appState: appState, actionManager: actionManager, showExitZenModeBtn: showExitZenModeBtn, renderWelcomeScreen: renderWelcomeScreen }), appState.showStats && (_jsx(Stats, { appState: appState, setAppState: setAppState, elements: elements, onClose: () => {
|
|
162
|
+
actionManager.executeAction(actionToggleStats);
|
|
163
|
+
}, renderCustomStats: renderCustomStats })), appState.scrolledOutside && (_jsx("button", { className: "scroll-back-to-content", onClick: () => {
|
|
164
|
+
setAppState((appState) => ({
|
|
165
|
+
...calculateScrollCenter(elements, appState),
|
|
166
|
+
}));
|
|
167
|
+
}, children: t("buttons.scrollBackToContent") }))] }), renderSidebars()] }))] }));
|
|
168
|
+
return (_jsx(UIAppStateContext.Provider, { value: appState, children: _jsx(Provider, { scope: tunnels.jotaiScope, children: _jsx(TunnelsContext.Provider, { value: tunnels, children: layerUIJSX }) }) }));
|
|
169
|
+
};
|
|
170
|
+
const stripIrrelevantAppStateProps = (appState) => {
|
|
171
|
+
const { suggestedBindings, startBoundElement, cursorButton, scrollX, scrollY, ...ret } = appState;
|
|
172
|
+
return ret;
|
|
173
|
+
};
|
|
174
|
+
const areEqual = (prevProps, nextProps) => {
|
|
175
|
+
// short-circuit early
|
|
176
|
+
if (prevProps.children !== nextProps.children) {
|
|
177
|
+
return false;
|
|
178
|
+
}
|
|
179
|
+
const { canvas: _pC, appState: prevAppState, ...prev } = prevProps;
|
|
180
|
+
const { canvas: _nC, appState: nextAppState, ...next } = nextProps;
|
|
181
|
+
return (isShallowEqual(
|
|
182
|
+
// asserting AppState because we're being passed the whole AppState
|
|
183
|
+
// but resolve to only the UI-relevant props
|
|
184
|
+
stripIrrelevantAppStateProps(prevAppState), stripIrrelevantAppStateProps(nextAppState), {
|
|
185
|
+
selectedElementIds: isShallowEqual,
|
|
186
|
+
selectedGroupIds: isShallowEqual,
|
|
187
|
+
}) && isShallowEqual(prev, next));
|
|
188
|
+
};
|
|
189
|
+
export default React.memo(LayerUI, areEqual);
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
@import "open-color/open-color";
|
|
2
|
+
@import "../css/variables.module.scss";
|
|
3
|
+
|
|
4
|
+
.excalidraw {
|
|
5
|
+
.layer-ui__wrapper.animate {
|
|
6
|
+
transition: width 0.1s ease-in-out;
|
|
7
|
+
}
|
|
8
|
+
.layer-ui__wrapper {
|
|
9
|
+
// when the rightside sidebar is docked, we need to resize the UI by its
|
|
10
|
+
// width, making the nested UI content shift to the left. To do this,
|
|
11
|
+
// we need the UI container to actually have dimensions set, but
|
|
12
|
+
// then we also need to disable pointer events else the canvas below
|
|
13
|
+
// wouldn't be interactive.
|
|
14
|
+
position: absolute;
|
|
15
|
+
width: 100%;
|
|
16
|
+
height: 100%;
|
|
17
|
+
pointer-events: none;
|
|
18
|
+
z-index: var(--zIndex-layerUI);
|
|
19
|
+
|
|
20
|
+
&__top-right {
|
|
21
|
+
display: flex;
|
|
22
|
+
gap: 0.75rem;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
&__footer {
|
|
26
|
+
width: 100%;
|
|
27
|
+
|
|
28
|
+
&-right {
|
|
29
|
+
z-index: 100;
|
|
30
|
+
display: flex;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.zen-mode-transition {
|
|
35
|
+
transition: transform 0.5s ease-in-out;
|
|
36
|
+
|
|
37
|
+
:root[dir="ltr"] &.transition-left {
|
|
38
|
+
transform: translate(-999px, 0);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
:root[dir="ltr"] &.transition-right {
|
|
42
|
+
transform: translate(999px, 0);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
:root[dir="rtl"] &.transition-left {
|
|
46
|
+
transform: translate(999px, 0);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
:root[dir="rtl"] &.transition-right {
|
|
50
|
+
transform: translate(-999px, 0);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
&.layer-ui__wrapper__footer-left--transition-bottom {
|
|
54
|
+
transform: translate(0, 92px);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.disable-zen-mode {
|
|
59
|
+
padding: 10px;
|
|
60
|
+
position: absolute;
|
|
61
|
+
bottom: 0;
|
|
62
|
+
[dir="ltr"] & {
|
|
63
|
+
right: 1rem;
|
|
64
|
+
}
|
|
65
|
+
[dir="rtl"] & {
|
|
66
|
+
left: 1rem;
|
|
67
|
+
}
|
|
68
|
+
opacity: 0;
|
|
69
|
+
visibility: hidden;
|
|
70
|
+
transition: visibility 0s linear 0s, opacity 0.5s;
|
|
71
|
+
|
|
72
|
+
font-family: var(--ui-font);
|
|
73
|
+
font-size: 0.75rem;
|
|
74
|
+
font-weight: 500;
|
|
75
|
+
line-height: 1;
|
|
76
|
+
|
|
77
|
+
border-radius: var(--border-radius-lg);
|
|
78
|
+
border: 1px solid var(--default-border-color);
|
|
79
|
+
background-color: var(--island-bg-color);
|
|
80
|
+
color: var(--text-primary-color);
|
|
81
|
+
|
|
82
|
+
&:hover {
|
|
83
|
+
background-color: var(--button-hover-bg);
|
|
84
|
+
}
|
|
85
|
+
&:active {
|
|
86
|
+
border-color: var(--color-primary);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
&--visible {
|
|
90
|
+
opacity: 1;
|
|
91
|
+
visibility: visible;
|
|
92
|
+
transition: visibility 0s linear 300ms, opacity 0.5s;
|
|
93
|
+
transition-delay: 0.8s;
|
|
94
|
+
|
|
95
|
+
pointer-events: var(--ui-pointerEvents);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.layer-ui__wrapper__footer-left,
|
|
100
|
+
.footer-center,
|
|
101
|
+
.layer-ui__wrapper__footer-right {
|
|
102
|
+
& > * {
|
|
103
|
+
pointer-events: var(--ui-pointerEvents);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.layer-ui__wrapper__footer-right {
|
|
108
|
+
margin-top: auto;
|
|
109
|
+
margin-bottom: auto;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|