@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,190 @@
|
|
|
1
|
+
import { isLinearElement } from "./element/typeChecks";
|
|
2
|
+
import { deepCopyElement } from "./element/newElement";
|
|
3
|
+
const clearAppStatePropertiesForHistory = (appState) => {
|
|
4
|
+
return {
|
|
5
|
+
selectedElementIds: appState.selectedElementIds,
|
|
6
|
+
selectedGroupIds: appState.selectedGroupIds,
|
|
7
|
+
viewBackgroundColor: appState.viewBackgroundColor,
|
|
8
|
+
editingLinearElement: appState.editingLinearElement,
|
|
9
|
+
editingGroupId: appState.editingGroupId,
|
|
10
|
+
name: appState.name,
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
class History {
|
|
14
|
+
elementCache = new Map();
|
|
15
|
+
recording = true;
|
|
16
|
+
stateHistory = [];
|
|
17
|
+
redoStack = [];
|
|
18
|
+
lastEntry = null;
|
|
19
|
+
hydrateHistoryEntry({ appState, elements, }) {
|
|
20
|
+
return {
|
|
21
|
+
appState: JSON.parse(appState),
|
|
22
|
+
elements: elements.map((dehydratedExcalidrawElement) => {
|
|
23
|
+
const element = this.elementCache
|
|
24
|
+
.get(dehydratedExcalidrawElement.id)
|
|
25
|
+
?.get(dehydratedExcalidrawElement.versionNonce);
|
|
26
|
+
if (!element) {
|
|
27
|
+
throw new Error(`Element not found: ${dehydratedExcalidrawElement.id}:${dehydratedExcalidrawElement.versionNonce}`);
|
|
28
|
+
}
|
|
29
|
+
return element;
|
|
30
|
+
}),
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
dehydrateHistoryEntry({ appState, elements, }) {
|
|
34
|
+
return {
|
|
35
|
+
appState: JSON.stringify(appState),
|
|
36
|
+
elements: elements.map((element) => {
|
|
37
|
+
if (!this.elementCache.has(element.id)) {
|
|
38
|
+
this.elementCache.set(element.id, new Map());
|
|
39
|
+
}
|
|
40
|
+
const versions = this.elementCache.get(element.id);
|
|
41
|
+
if (!versions.has(element.versionNonce)) {
|
|
42
|
+
versions.set(element.versionNonce, deepCopyElement(element));
|
|
43
|
+
}
|
|
44
|
+
return {
|
|
45
|
+
id: element.id,
|
|
46
|
+
versionNonce: element.versionNonce,
|
|
47
|
+
};
|
|
48
|
+
}),
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
getSnapshotForTest() {
|
|
52
|
+
return {
|
|
53
|
+
recording: this.recording,
|
|
54
|
+
stateHistory: this.stateHistory.map((dehydratedHistoryEntry) => this.hydrateHistoryEntry(dehydratedHistoryEntry)),
|
|
55
|
+
redoStack: this.redoStack.map((dehydratedHistoryEntry) => this.hydrateHistoryEntry(dehydratedHistoryEntry)),
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
clear() {
|
|
59
|
+
this.stateHistory.length = 0;
|
|
60
|
+
this.redoStack.length = 0;
|
|
61
|
+
this.lastEntry = null;
|
|
62
|
+
this.elementCache.clear();
|
|
63
|
+
}
|
|
64
|
+
generateEntry = (appState, elements) => this.dehydrateHistoryEntry({
|
|
65
|
+
appState: clearAppStatePropertiesForHistory(appState),
|
|
66
|
+
elements: elements.reduce((elements, element) => {
|
|
67
|
+
if (isLinearElement(element) &&
|
|
68
|
+
appState.multiElement &&
|
|
69
|
+
appState.multiElement.id === element.id) {
|
|
70
|
+
// don't store multi-point arrow if still has only one point
|
|
71
|
+
if (appState.multiElement &&
|
|
72
|
+
appState.multiElement.id === element.id &&
|
|
73
|
+
element.points.length < 2) {
|
|
74
|
+
return elements;
|
|
75
|
+
}
|
|
76
|
+
elements.push({
|
|
77
|
+
...element,
|
|
78
|
+
// don't store last point if not committed
|
|
79
|
+
points: element.lastCommittedPoint !==
|
|
80
|
+
element.points[element.points.length - 1]
|
|
81
|
+
? element.points.slice(0, -1)
|
|
82
|
+
: element.points,
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
elements.push(element);
|
|
87
|
+
}
|
|
88
|
+
return elements;
|
|
89
|
+
}, []),
|
|
90
|
+
});
|
|
91
|
+
shouldCreateEntry(nextEntry) {
|
|
92
|
+
const { lastEntry } = this;
|
|
93
|
+
if (!lastEntry) {
|
|
94
|
+
return true;
|
|
95
|
+
}
|
|
96
|
+
if (nextEntry.elements.length !== lastEntry.elements.length) {
|
|
97
|
+
return true;
|
|
98
|
+
}
|
|
99
|
+
// loop from right to left as changes are likelier to happen on new elements
|
|
100
|
+
for (let i = nextEntry.elements.length - 1; i > -1; i--) {
|
|
101
|
+
const prev = nextEntry.elements[i];
|
|
102
|
+
const next = lastEntry.elements[i];
|
|
103
|
+
if (!prev ||
|
|
104
|
+
!next ||
|
|
105
|
+
prev.id !== next.id ||
|
|
106
|
+
prev.versionNonce !== next.versionNonce) {
|
|
107
|
+
return true;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
// note: this is safe because entry's appState is guaranteed no excess props
|
|
111
|
+
let key;
|
|
112
|
+
for (key in nextEntry.appState) {
|
|
113
|
+
if (key === "editingLinearElement") {
|
|
114
|
+
if (nextEntry.appState[key]?.elementId ===
|
|
115
|
+
lastEntry.appState[key]?.elementId) {
|
|
116
|
+
continue;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
if (key === "selectedElementIds" || key === "selectedGroupIds") {
|
|
120
|
+
continue;
|
|
121
|
+
}
|
|
122
|
+
if (nextEntry.appState[key] !== lastEntry.appState[key]) {
|
|
123
|
+
return true;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
return false;
|
|
127
|
+
}
|
|
128
|
+
pushEntry(appState, elements) {
|
|
129
|
+
const newEntryDehydrated = this.generateEntry(appState, elements);
|
|
130
|
+
const newEntry = this.hydrateHistoryEntry(newEntryDehydrated);
|
|
131
|
+
if (newEntry) {
|
|
132
|
+
if (!this.shouldCreateEntry(newEntry)) {
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
this.stateHistory.push(newEntryDehydrated);
|
|
136
|
+
this.lastEntry = newEntry;
|
|
137
|
+
// As a new entry was pushed, we invalidate the redo stack
|
|
138
|
+
this.clearRedoStack();
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
clearRedoStack() {
|
|
142
|
+
this.redoStack.splice(0, this.redoStack.length);
|
|
143
|
+
}
|
|
144
|
+
redoOnce() {
|
|
145
|
+
if (this.redoStack.length === 0) {
|
|
146
|
+
return null;
|
|
147
|
+
}
|
|
148
|
+
const entryToRestore = this.redoStack.pop();
|
|
149
|
+
if (entryToRestore !== undefined) {
|
|
150
|
+
this.stateHistory.push(entryToRestore);
|
|
151
|
+
return this.hydrateHistoryEntry(entryToRestore);
|
|
152
|
+
}
|
|
153
|
+
return null;
|
|
154
|
+
}
|
|
155
|
+
undoOnce() {
|
|
156
|
+
if (this.stateHistory.length === 1) {
|
|
157
|
+
return null;
|
|
158
|
+
}
|
|
159
|
+
const currentEntry = this.stateHistory.pop();
|
|
160
|
+
const entryToRestore = this.stateHistory[this.stateHistory.length - 1];
|
|
161
|
+
if (currentEntry !== undefined) {
|
|
162
|
+
this.redoStack.push(currentEntry);
|
|
163
|
+
return this.hydrateHistoryEntry(entryToRestore);
|
|
164
|
+
}
|
|
165
|
+
return null;
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Updates history's `lastEntry` to latest app state. This is necessary
|
|
169
|
+
* when doing undo/redo which itself doesn't commit to history, but updates
|
|
170
|
+
* app state in a way that would break `shouldCreateEntry` which relies on
|
|
171
|
+
* `lastEntry` to reflect last comittable history state.
|
|
172
|
+
* We can't update `lastEntry` from within history when calling undo/redo
|
|
173
|
+
* because the action potentially mutates appState/elements before storing
|
|
174
|
+
* it.
|
|
175
|
+
*/
|
|
176
|
+
setCurrentState(appState, elements) {
|
|
177
|
+
this.lastEntry = this.hydrateHistoryEntry(this.generateEntry(appState, elements));
|
|
178
|
+
}
|
|
179
|
+
// Suspicious that this is called so many places. Seems error-prone.
|
|
180
|
+
resumeRecording() {
|
|
181
|
+
this.recording = true;
|
|
182
|
+
}
|
|
183
|
+
record(state, elements) {
|
|
184
|
+
if (this.recording) {
|
|
185
|
+
this.pushEntry(state, elements);
|
|
186
|
+
this.recording = false;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
export default History;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { useState, useLayoutEffect } from "react";
|
|
2
|
+
import { useDevice, useExcalidrawContainer } from "../components/App";
|
|
3
|
+
import { useUIAppState } from "../context/ui-appState";
|
|
4
|
+
export const useCreatePortalContainer = (opts) => {
|
|
5
|
+
const [div, setDiv] = useState(null);
|
|
6
|
+
const device = useDevice();
|
|
7
|
+
const { theme } = useUIAppState();
|
|
8
|
+
const { container: excalidrawContainer } = useExcalidrawContainer();
|
|
9
|
+
useLayoutEffect(() => {
|
|
10
|
+
if (div) {
|
|
11
|
+
div.className = "";
|
|
12
|
+
div.classList.add("excalidraw", ...(opts?.className?.split(/\s+/) || []));
|
|
13
|
+
div.classList.toggle("excalidraw--mobile", device.editor.isMobile);
|
|
14
|
+
div.classList.toggle("theme--dark", theme === "dark");
|
|
15
|
+
}
|
|
16
|
+
}, [div, theme, device.editor.isMobile, opts?.className]);
|
|
17
|
+
useLayoutEffect(() => {
|
|
18
|
+
const container = opts?.parentSelector
|
|
19
|
+
? excalidrawContainer?.querySelector(opts.parentSelector)
|
|
20
|
+
: document.body;
|
|
21
|
+
if (!container) {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
const div = document.createElement("div");
|
|
25
|
+
container.appendChild(div);
|
|
26
|
+
setDiv(div);
|
|
27
|
+
return () => {
|
|
28
|
+
container.removeChild(div);
|
|
29
|
+
};
|
|
30
|
+
}, [excalidrawContainer, opts?.parentSelector]);
|
|
31
|
+
return div;
|
|
32
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { atom, useAtom } from "jotai";
|
|
2
|
+
import { useEffect, useState } from "react";
|
|
3
|
+
import { COLOR_PALETTE } from "../colors";
|
|
4
|
+
import { jotaiScope } from "../jotai";
|
|
5
|
+
import { exportToSvg } from "../../utils/export";
|
|
6
|
+
export const libraryItemSvgsCache = atom(new Map());
|
|
7
|
+
const exportLibraryItemToSvg = async (elements) => {
|
|
8
|
+
return await exportToSvg({
|
|
9
|
+
elements,
|
|
10
|
+
appState: {
|
|
11
|
+
exportBackground: false,
|
|
12
|
+
viewBackgroundColor: COLOR_PALETTE.white,
|
|
13
|
+
},
|
|
14
|
+
files: null,
|
|
15
|
+
renderEmbeddables: false,
|
|
16
|
+
});
|
|
17
|
+
};
|
|
18
|
+
export const useLibraryItemSvg = (id, elements, svgCache) => {
|
|
19
|
+
const [svg, setSvg] = useState();
|
|
20
|
+
useEffect(() => {
|
|
21
|
+
if (elements) {
|
|
22
|
+
if (id) {
|
|
23
|
+
// Try to load cached svg
|
|
24
|
+
const cachedSvg = svgCache.get(id);
|
|
25
|
+
if (cachedSvg) {
|
|
26
|
+
setSvg(cachedSvg);
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
// When there is no svg in cache export it and save to cache
|
|
30
|
+
(async () => {
|
|
31
|
+
const exportedSvg = await exportLibraryItemToSvg(elements);
|
|
32
|
+
exportedSvg.querySelector(".style-fonts")?.remove();
|
|
33
|
+
if (exportedSvg) {
|
|
34
|
+
svgCache.set(id, exportedSvg);
|
|
35
|
+
setSvg(exportedSvg);
|
|
36
|
+
}
|
|
37
|
+
})();
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
// When we have no id (usualy selected items from canvas) just export the svg
|
|
42
|
+
(async () => {
|
|
43
|
+
const exportedSvg = await exportLibraryItemToSvg(elements);
|
|
44
|
+
setSvg(exportedSvg);
|
|
45
|
+
})();
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}, [id, elements, svgCache, setSvg]);
|
|
49
|
+
return svg;
|
|
50
|
+
};
|
|
51
|
+
export const useLibraryCache = () => {
|
|
52
|
+
const [svgCache] = useAtom(libraryItemSvgsCache, jotaiScope);
|
|
53
|
+
const clearLibraryCache = () => svgCache.clear();
|
|
54
|
+
const deleteItemsFromLibraryCache = (items) => {
|
|
55
|
+
items.forEach((item) => svgCache.delete(item));
|
|
56
|
+
};
|
|
57
|
+
return {
|
|
58
|
+
clearLibraryCache,
|
|
59
|
+
deleteItemsFromLibraryCache,
|
|
60
|
+
svgCache,
|
|
61
|
+
};
|
|
62
|
+
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { useEffect } from "react";
|
|
2
|
+
import { EVENT } from "../constants";
|
|
3
|
+
export function useOutsideClick(ref,
|
|
4
|
+
/** if performance is of concern, memoize the callback */
|
|
5
|
+
callback,
|
|
6
|
+
/**
|
|
7
|
+
* Optional callback which is called on every click.
|
|
8
|
+
*
|
|
9
|
+
* Should return `true` if click should be considered as inside the container,
|
|
10
|
+
* and `false` if it falls outside and should call the `callback`.
|
|
11
|
+
*
|
|
12
|
+
* Returning `true` overrides the default behavior and `callback` won't be
|
|
13
|
+
* called.
|
|
14
|
+
*
|
|
15
|
+
* Returning `undefined` will fallback to the default behavior.
|
|
16
|
+
*/
|
|
17
|
+
isInside) {
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
function onOutsideClick(event) {
|
|
20
|
+
const _event = event;
|
|
21
|
+
if (!ref.current) {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
const isInsideOverride = isInside?.(_event, ref.current);
|
|
25
|
+
if (isInsideOverride === true) {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
else if (isInsideOverride === false) {
|
|
29
|
+
return callback(_event);
|
|
30
|
+
}
|
|
31
|
+
// clicked element is in the descenendant of the target container
|
|
32
|
+
if (ref.current.contains(_event.target) ||
|
|
33
|
+
// target is detached from DOM (happens when the element is removed
|
|
34
|
+
// on a pointerup event fired *before* this handler's pointerup is
|
|
35
|
+
// dispatched)
|
|
36
|
+
!document.documentElement.contains(_event.target)) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
const isClickOnRadixPortal = _event.target.closest("[data-radix-portal]") ||
|
|
40
|
+
// when radix popup is in "modal" mode, it disables pointer events on
|
|
41
|
+
// the `body` element, so the target element is going to be the `html`
|
|
42
|
+
// (note: this won't work if we selectively re-enable pointer events on
|
|
43
|
+
// specific elements as we do with navbar or excalidraw UI elements)
|
|
44
|
+
(_event.target === document.documentElement &&
|
|
45
|
+
document.body.style.pointerEvents === "none");
|
|
46
|
+
// if clicking on radix portal, assume it's a popup that
|
|
47
|
+
// should be considered as part of the UI. Obviously this is a terrible
|
|
48
|
+
// hack you can end up click on radix popups that outside the tree,
|
|
49
|
+
// but it works for most cases and the downside is minimal for now
|
|
50
|
+
if (isClickOnRadixPortal) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
// clicking on a container that ignores outside clicks
|
|
54
|
+
if (_event.target.closest("[data-prevent-outside-click]")) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
callback(_event);
|
|
58
|
+
}
|
|
59
|
+
// note: don't use `click` because it often reports incorrect `event.target`
|
|
60
|
+
document.addEventListener(EVENT.POINTER_DOWN, onOutsideClick);
|
|
61
|
+
document.addEventListener(EVENT.TOUCH_START, onOutsideClick);
|
|
62
|
+
return () => {
|
|
63
|
+
document.removeEventListener(EVENT.POINTER_DOWN, onOutsideClick);
|
|
64
|
+
document.removeEventListener(EVENT.TOUCH_START, onOutsideClick);
|
|
65
|
+
};
|
|
66
|
+
}, [ref, callback, isInside]);
|
|
67
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { useEffect } from "react";
|
|
2
|
+
import { atom, useAtom } from "jotai";
|
|
3
|
+
import throttle from "lodash.throttle";
|
|
4
|
+
const scrollPositionAtom = atom(0);
|
|
5
|
+
export const useScrollPosition = (elementRef) => {
|
|
6
|
+
const [scrollPosition, setScrollPosition] = useAtom(scrollPositionAtom);
|
|
7
|
+
useEffect(() => {
|
|
8
|
+
const { current: element } = elementRef;
|
|
9
|
+
if (!element) {
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
const handleScroll = throttle(() => {
|
|
13
|
+
const { scrollTop } = element;
|
|
14
|
+
setScrollPosition(scrollTop);
|
|
15
|
+
}, 200);
|
|
16
|
+
element.addEventListener("scroll", handleScroll);
|
|
17
|
+
return () => {
|
|
18
|
+
handleScroll.cancel();
|
|
19
|
+
element.removeEventListener("scroll", handleScroll);
|
|
20
|
+
};
|
|
21
|
+
}, [elementRef, setScrollPosition]);
|
|
22
|
+
return scrollPosition;
|
|
23
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React, { useCallback } from "react";
|
|
2
|
+
/** noop polyfill for v17. Subset of API available */
|
|
3
|
+
function useTransitionPolyfill() {
|
|
4
|
+
const startTransition = useCallback((callback) => callback(), []);
|
|
5
|
+
return [false, startTransition];
|
|
6
|
+
}
|
|
7
|
+
export const useTransition = React.useTransition || useTransitionPolyfill;
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import fallbackLangData from "./locales/en.json";
|
|
2
|
+
import percentages from "./locales/percentages.json";
|
|
3
|
+
import { jotaiScope, jotaiStore } from "./jotai";
|
|
4
|
+
import { atom, useAtomValue } from "jotai";
|
|
5
|
+
const COMPLETION_THRESHOLD = 85;
|
|
6
|
+
export const defaultLang = { code: "en", label: "English" };
|
|
7
|
+
export const languages = [
|
|
8
|
+
defaultLang,
|
|
9
|
+
...[
|
|
10
|
+
{ code: "ar-SA", label: "العربية", rtl: true },
|
|
11
|
+
{ code: "bg-BG", label: "Български" },
|
|
12
|
+
{ code: "ca-ES", label: "Català" },
|
|
13
|
+
{ code: "cs-CZ", label: "Česky" },
|
|
14
|
+
{ code: "de-DE", label: "Deutsch" },
|
|
15
|
+
{ code: "el-GR", label: "Ελληνικά" },
|
|
16
|
+
{ code: "es-ES", label: "Español" },
|
|
17
|
+
{ code: "eu-ES", label: "Euskara" },
|
|
18
|
+
{ code: "fa-IR", label: "فارسی", rtl: true },
|
|
19
|
+
{ code: "fi-FI", label: "Suomi" },
|
|
20
|
+
{ code: "fr-FR", label: "Français" },
|
|
21
|
+
{ code: "gl-ES", label: "Galego" },
|
|
22
|
+
{ code: "he-IL", label: "עברית", rtl: true },
|
|
23
|
+
{ code: "hi-IN", label: "हिन्दी" },
|
|
24
|
+
{ code: "hu-HU", label: "Magyar" },
|
|
25
|
+
{ code: "id-ID", label: "Bahasa Indonesia" },
|
|
26
|
+
{ code: "it-IT", label: "Italiano" },
|
|
27
|
+
{ code: "ja-JP", label: "日本語" },
|
|
28
|
+
{ code: "kab-KAB", label: "Taqbaylit" },
|
|
29
|
+
{ code: "kk-KZ", label: "Қазақ тілі" },
|
|
30
|
+
{ code: "ko-KR", label: "한국어" },
|
|
31
|
+
{ code: "ku-TR", label: "Kurdî" },
|
|
32
|
+
{ code: "lt-LT", label: "Lietuvių" },
|
|
33
|
+
{ code: "lv-LV", label: "Latviešu" },
|
|
34
|
+
{ code: "my-MM", label: "Burmese" },
|
|
35
|
+
{ code: "nb-NO", label: "Norsk bokmål" },
|
|
36
|
+
{ code: "nl-NL", label: "Nederlands" },
|
|
37
|
+
{ code: "nn-NO", label: "Norsk nynorsk" },
|
|
38
|
+
{ code: "oc-FR", label: "Occitan" },
|
|
39
|
+
{ code: "pa-IN", label: "ਪੰਜਾਬੀ" },
|
|
40
|
+
{ code: "pl-PL", label: "Polski" },
|
|
41
|
+
{ code: "pt-BR", label: "Português Brasileiro" },
|
|
42
|
+
{ code: "pt-PT", label: "Português" },
|
|
43
|
+
{ code: "ro-RO", label: "Română" },
|
|
44
|
+
{ code: "ru-RU", label: "Русский" },
|
|
45
|
+
{ code: "sk-SK", label: "Slovenčina" },
|
|
46
|
+
{ code: "sv-SE", label: "Svenska" },
|
|
47
|
+
{ code: "sl-SI", label: "Slovenščina" },
|
|
48
|
+
{ code: "tr-TR", label: "Türkçe" },
|
|
49
|
+
{ code: "uk-UA", label: "Українська" },
|
|
50
|
+
{ code: "zh-CN", label: "简体中文" },
|
|
51
|
+
{ code: "zh-TW", label: "繁體中文" },
|
|
52
|
+
{ code: "vi-VN", label: "Tiếng Việt" },
|
|
53
|
+
{ code: "mr-IN", label: "मराठी" },
|
|
54
|
+
]
|
|
55
|
+
.filter((lang) => percentages[lang.code] >=
|
|
56
|
+
COMPLETION_THRESHOLD)
|
|
57
|
+
.sort((left, right) => (left.label > right.label ? 1 : -1)),
|
|
58
|
+
];
|
|
59
|
+
const TEST_LANG_CODE = "__test__";
|
|
60
|
+
if (import.meta.env.DEV) {
|
|
61
|
+
languages.unshift({ code: TEST_LANG_CODE, label: "test language" }, {
|
|
62
|
+
code: `${TEST_LANG_CODE}.rtl`,
|
|
63
|
+
label: "\u{202a}test language (rtl)\u{202c}",
|
|
64
|
+
rtl: true,
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
let currentLang = defaultLang;
|
|
68
|
+
let currentLangData = {};
|
|
69
|
+
export const setLanguage = async (lang) => {
|
|
70
|
+
currentLang = lang;
|
|
71
|
+
document.documentElement.dir = currentLang.rtl ? "rtl" : "ltr";
|
|
72
|
+
document.documentElement.lang = currentLang.code;
|
|
73
|
+
if (lang.code.startsWith(TEST_LANG_CODE)) {
|
|
74
|
+
currentLangData = {};
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
try {
|
|
78
|
+
currentLangData = await import(`./locales/${currentLang.code}.json`);
|
|
79
|
+
}
|
|
80
|
+
catch (error) {
|
|
81
|
+
console.error(`Failed to load language ${lang.code}:`, error.message);
|
|
82
|
+
currentLangData = fallbackLangData;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
jotaiStore.set(editorLangCodeAtom, lang.code);
|
|
86
|
+
};
|
|
87
|
+
export const getLanguage = () => currentLang;
|
|
88
|
+
const findPartsForData = (data, parts) => {
|
|
89
|
+
for (let index = 0; index < parts.length; ++index) {
|
|
90
|
+
const part = parts[index];
|
|
91
|
+
if (data[part] === undefined) {
|
|
92
|
+
return undefined;
|
|
93
|
+
}
|
|
94
|
+
data = data[part];
|
|
95
|
+
}
|
|
96
|
+
if (typeof data !== "string") {
|
|
97
|
+
return undefined;
|
|
98
|
+
}
|
|
99
|
+
return data;
|
|
100
|
+
};
|
|
101
|
+
export const t = (path, replacement, fallback) => {
|
|
102
|
+
if (currentLang.code.startsWith(TEST_LANG_CODE)) {
|
|
103
|
+
const name = replacement
|
|
104
|
+
? `${path}(${JSON.stringify(replacement).slice(1, -1)})`
|
|
105
|
+
: path;
|
|
106
|
+
return `\u{202a}[[${name}]]\u{202c}`;
|
|
107
|
+
}
|
|
108
|
+
const parts = path.split(".");
|
|
109
|
+
let translation = findPartsForData(currentLangData, parts) ||
|
|
110
|
+
findPartsForData(fallbackLangData, parts) ||
|
|
111
|
+
fallback;
|
|
112
|
+
if (translation === undefined) {
|
|
113
|
+
const errorMessage = `Can't find translation for ${path}`;
|
|
114
|
+
// in production, don't blow up the app on a missing translation key
|
|
115
|
+
if (import.meta.env.PROD) {
|
|
116
|
+
console.warn(errorMessage);
|
|
117
|
+
return "";
|
|
118
|
+
}
|
|
119
|
+
throw new Error(errorMessage);
|
|
120
|
+
}
|
|
121
|
+
if (replacement) {
|
|
122
|
+
for (const key in replacement) {
|
|
123
|
+
translation = translation.replace(`{{${key}}}`, String(replacement[key]));
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
return translation;
|
|
127
|
+
};
|
|
128
|
+
/** @private atom used solely to rerender components using `useI18n` hook */
|
|
129
|
+
const editorLangCodeAtom = atom(defaultLang.code);
|
|
130
|
+
// Should be used in components that fall under these cases:
|
|
131
|
+
// - component is rendered as an <Excalidraw> child
|
|
132
|
+
// - component is rendered internally by <Excalidraw>, but the component
|
|
133
|
+
// is memoized w/o being updated on `langCode`, `AppState`, or `UIAppState`
|
|
134
|
+
export const useI18n = () => {
|
|
135
|
+
const langCode = useAtomValue(editorLangCodeAtom, jotaiScope);
|
|
136
|
+
return { t, langCode };
|
|
137
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { exportToCanvas } from "./scene/export";
|
|
2
|
+
import { getDefaultAppState } from "./appState";
|
|
3
|
+
const { registerFont, createCanvas } = require("canvas");
|
|
4
|
+
const elements = [
|
|
5
|
+
{
|
|
6
|
+
id: "eVzaxG3YnHhqjEmD7NdYo",
|
|
7
|
+
type: "diamond",
|
|
8
|
+
x: 519,
|
|
9
|
+
y: 199,
|
|
10
|
+
width: 113,
|
|
11
|
+
height: 115,
|
|
12
|
+
strokeColor: "#000000",
|
|
13
|
+
backgroundColor: "transparent",
|
|
14
|
+
fillStyle: "hachure",
|
|
15
|
+
strokeWidth: 1,
|
|
16
|
+
roughness: 1,
|
|
17
|
+
opacity: 100,
|
|
18
|
+
seed: 749612521,
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
id: "7W-iw5pEBPTU3eaCaLtFo",
|
|
22
|
+
type: "ellipse",
|
|
23
|
+
x: 552,
|
|
24
|
+
y: 238,
|
|
25
|
+
width: 49,
|
|
26
|
+
height: 44,
|
|
27
|
+
strokeColor: "#000000",
|
|
28
|
+
backgroundColor: "transparent",
|
|
29
|
+
fillStyle: "hachure",
|
|
30
|
+
strokeWidth: 1,
|
|
31
|
+
roughness: 1,
|
|
32
|
+
opacity: 100,
|
|
33
|
+
seed: 952056308,
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
id: "kqKI231mvTrcsYo2DkUsR",
|
|
37
|
+
type: "text",
|
|
38
|
+
x: 557.5,
|
|
39
|
+
y: 317.5,
|
|
40
|
+
width: 43,
|
|
41
|
+
height: 31,
|
|
42
|
+
strokeColor: "#000000",
|
|
43
|
+
backgroundColor: "transparent",
|
|
44
|
+
fillStyle: "hachure",
|
|
45
|
+
strokeWidth: 1,
|
|
46
|
+
roughness: 1,
|
|
47
|
+
opacity: 100,
|
|
48
|
+
seed: 1683771448,
|
|
49
|
+
text: "test",
|
|
50
|
+
font: "20px Virgil",
|
|
51
|
+
baseline: 22,
|
|
52
|
+
},
|
|
53
|
+
];
|
|
54
|
+
registerFont("./public/Virgil.woff2", { family: "Virgil" });
|
|
55
|
+
registerFont("./public/Cascadia.woff2", { family: "Cascadia" });
|
|
56
|
+
const canvas = exportToCanvas(elements, {
|
|
57
|
+
...getDefaultAppState(),
|
|
58
|
+
offsetTop: 0,
|
|
59
|
+
offsetLeft: 0,
|
|
60
|
+
width: 0,
|
|
61
|
+
height: 0,
|
|
62
|
+
}, {}, // files
|
|
63
|
+
{
|
|
64
|
+
exportBackground: true,
|
|
65
|
+
viewBackgroundColor: "#ffffff",
|
|
66
|
+
}, createCanvas);
|
|
67
|
+
const fs = require("fs");
|
|
68
|
+
const out = fs.createWriteStream("test.png");
|
|
69
|
+
const stream = canvas.createPNGStream();
|
|
70
|
+
stream.pipe(out);
|
|
71
|
+
out.on("finish", () => {
|
|
72
|
+
console.info("test.png was created.");
|
|
73
|
+
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import "./css/app.scss";
|
|
3
3
|
import "./css/styles.scss";
|
|
4
|
-
import "../../public/fonts.css";
|
|
4
|
+
import "../../public/fonts/fonts.css";
|
|
5
5
|
import { ExcalidrawProps } from "./types";
|
|
6
6
|
import Footer from "./components/footer/FooterCenter";
|
|
7
7
|
import MainMenu from "./components/main-menu/MainMenu";
|