@excalidraw/excalidraw 0.17.1-7441-0269e5a → 0.17.1-7441-4c9a6f4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/excalidraw-assets/{chunk-V52YQ6TH.js → chunk-LZCCI7PN.js} +1181 -1675
- package/dist/browser/excalidraw-assets/{image-MZHH7VY4.js → image-CG4AV2NT.js} +1 -1
- package/dist/browser/excalidraw-assets/{image-2MHILQWB.css → image-EO7USLQY.css} +1 -1
- package/dist/browser/index.css +1 -1
- package/dist/browser/index.js +1 -1
- package/dist/packages/excalidraw/actions/actionAddToLibrary.js +59 -0
- package/dist/packages/excalidraw/actions/actionAlign.js +124 -0
- package/dist/packages/excalidraw/actions/actionBoundText.js +213 -0
- package/dist/packages/excalidraw/actions/actionCanvas.js +354 -0
- package/dist/packages/excalidraw/actions/actionClipboard.js +221 -0
- package/dist/packages/excalidraw/actions/actionDeleteSelected.js +129 -0
- package/dist/packages/excalidraw/actions/actionDistribute.js +56 -0
- package/dist/packages/excalidraw/actions/actionDuplicateSelection.js +181 -0
- package/dist/packages/excalidraw/actions/actionElementLock.js +89 -0
- package/dist/packages/excalidraw/actions/actionExport.js +195 -0
- package/dist/packages/excalidraw/actions/actionFinalize.js +150 -0
- package/dist/packages/excalidraw/actions/actionFlip.js +52 -0
- package/dist/packages/excalidraw/actions/actionFrame.js +113 -0
- package/dist/packages/excalidraw/actions/actionGroup.js +162 -0
- package/dist/packages/excalidraw/actions/actionHistory.js +57 -0
- package/dist/packages/excalidraw/actions/actionLinearEditor.js +41 -0
- package/dist/packages/excalidraw/actions/actionMenu.js +53 -0
- package/dist/packages/excalidraw/actions/actionNavigate.js +43 -0
- package/dist/packages/excalidraw/actions/actionProperties.js +683 -0
- package/dist/packages/excalidraw/actions/actionSelectAll.js +40 -0
- package/dist/packages/excalidraw/actions/actionStyles.js +118 -0
- package/dist/packages/excalidraw/actions/actionToggleGridMode.js +27 -0
- package/dist/packages/excalidraw/actions/actionToggleObjectsSnapMode.js +26 -0
- package/dist/packages/excalidraw/actions/actionToggleStats.js +19 -0
- package/dist/packages/excalidraw/actions/actionToggleViewMode.js +25 -0
- package/dist/packages/excalidraw/actions/actionToggleZenMode.js +25 -0
- package/dist/packages/excalidraw/actions/actionZindex.js +86 -0
- package/dist/packages/excalidraw/actions/index.js +25 -0
- package/dist/packages/excalidraw/actions/manager.js +110 -0
- package/dist/packages/excalidraw/actions/register.js +5 -0
- package/dist/packages/excalidraw/actions/shortcuts.js +52 -0
- package/dist/packages/excalidraw/align.js +36 -0
- package/dist/packages/excalidraw/analytics.js +30 -0
- package/dist/packages/excalidraw/appState.js +222 -0
- package/dist/packages/excalidraw/charts.js +365 -0
- package/dist/packages/excalidraw/clients.js +34 -0
- package/dist/packages/excalidraw/clipboard.js +351 -0
- package/dist/packages/excalidraw/colors.js +124 -0
- package/dist/packages/excalidraw/components/Actions.js +127 -0
- package/dist/packages/excalidraw/components/Actions.scss +92 -0
- package/dist/packages/excalidraw/components/ActiveConfirmDialog.js +22 -0
- package/dist/packages/excalidraw/components/App.js +6177 -0
- package/dist/packages/excalidraw/components/Avatar.js +15 -0
- package/dist/packages/excalidraw/components/Avatar.scss +7 -0
- package/dist/packages/excalidraw/components/BraveMeasureTextError.js +6 -0
- package/dist/packages/excalidraw/components/Button.js +14 -0
- package/dist/packages/excalidraw/components/Button.scss +7 -0
- package/dist/packages/excalidraw/components/ButtonIconCycle.js +11 -0
- package/dist/packages/excalidraw/components/ButtonIconSelect.js +6 -0
- package/dist/packages/excalidraw/components/ButtonSelect.js +3 -0
- package/dist/packages/excalidraw/components/Card.js +14 -0
- package/dist/packages/excalidraw/components/Card.scss +57 -0
- package/dist/packages/excalidraw/components/CheckboxItem.js +10 -0
- package/dist/packages/excalidraw/components/CheckboxItem.scss +91 -0
- package/dist/packages/excalidraw/components/ColorPicker/ColorInput.js +67 -0
- package/dist/packages/excalidraw/components/ColorPicker/ColorPicker.js +138 -0
- package/dist/packages/excalidraw/components/ColorPicker/ColorPicker.scss +441 -0
- package/dist/packages/excalidraw/components/ColorPicker/CustomColorList.js +24 -0
- package/dist/packages/excalidraw/components/ColorPicker/HotkeyLabel.js +8 -0
- package/dist/packages/excalidraw/components/ColorPicker/Picker.js +86 -0
- package/dist/packages/excalidraw/components/ColorPicker/PickerColorList.js +33 -0
- package/dist/packages/excalidraw/components/ColorPicker/PickerHeading.js +3 -0
- package/dist/packages/excalidraw/components/ColorPicker/ShadeList.js +44 -0
- package/dist/packages/excalidraw/components/ColorPicker/TopPicks.js +27 -0
- package/dist/packages/excalidraw/components/ColorPicker/colorPickerUtils.js +83 -0
- package/dist/packages/excalidraw/components/ColorPicker/keyboardNavHandlers.js +174 -0
- package/dist/packages/excalidraw/components/ConfirmDialog.js +27 -0
- package/dist/packages/excalidraw/components/ConfirmDialog.scss +11 -0
- package/dist/packages/excalidraw/components/ContextMenu.js +56 -0
- package/dist/packages/excalidraw/components/ContextMenu.scss +98 -0
- package/dist/packages/excalidraw/components/DarkModeToggle.js +16 -0
- package/dist/packages/excalidraw/components/DefaultSidebar.js +48 -0
- package/dist/packages/excalidraw/components/Dialog.js +74 -0
- package/dist/packages/excalidraw/components/Dialog.scss +48 -0
- package/dist/packages/excalidraw/components/DialogActionButton.js +9 -0
- package/dist/packages/excalidraw/components/DialogActionButton.scss +47 -0
- package/dist/packages/excalidraw/components/ErrorDialog.js +18 -0
- package/dist/packages/excalidraw/components/ExcalidrawLogo.js +7 -0
- package/dist/packages/excalidraw/components/ExcalidrawLogo.scss +73 -0
- package/dist/packages/excalidraw/components/ExportDialog.scss +129 -0
- package/dist/packages/excalidraw/components/EyeDropper.js +130 -0
- package/dist/packages/excalidraw/components/EyeDropper.scss +48 -0
- package/dist/packages/excalidraw/components/FilledButton.js +7 -0
- package/dist/packages/excalidraw/components/FilledButton.scss +191 -0
- package/dist/packages/excalidraw/components/FixedSideContainer.js +4 -0
- package/dist/packages/excalidraw/components/FixedSideContainer.scss +40 -0
- package/dist/packages/excalidraw/components/FollowMode/FollowMode.js +7 -0
- package/dist/packages/excalidraw/components/FollowMode/FollowMode.scss +59 -0
- package/dist/packages/excalidraw/components/HandButton.js +9 -0
- package/dist/packages/excalidraw/components/HelpButton.js +4 -0
- package/dist/packages/excalidraw/components/HelpDialog.js +79 -0
- package/dist/packages/excalidraw/components/HelpDialog.scss +130 -0
- package/dist/packages/excalidraw/components/HintViewer.js +97 -0
- package/dist/packages/excalidraw/components/HintViewer.scss +37 -0
- package/dist/packages/excalidraw/components/IconPicker.js +99 -0
- package/dist/packages/excalidraw/components/IconPicker.scss +143 -0
- package/dist/packages/excalidraw/components/ImageExportDialog.js +127 -0
- package/dist/packages/excalidraw/components/ImageExportDialog.scss +173 -0
- package/dist/packages/excalidraw/components/InitializeApp.js +16 -0
- package/dist/packages/excalidraw/components/InlineIcon.js +10 -0
- package/dist/packages/excalidraw/components/Island.js +5 -0
- package/dist/packages/excalidraw/components/Island.scss +16 -0
- package/dist/packages/excalidraw/components/JSONExportDialog.js +35 -0
- package/dist/packages/excalidraw/components/LaserTool/LaserPathManager.js +225 -0
- package/dist/packages/excalidraw/components/LaserTool/LaserPointerButton.js +10 -0
- package/dist/packages/excalidraw/components/LaserTool/LaserTool.js +15 -0
- package/dist/packages/excalidraw/components/LaserTool/LaserToolOverlay.scss +20 -0
- package/dist/packages/excalidraw/components/LayerUI.js +189 -0
- package/dist/packages/excalidraw/components/LayerUI.scss +112 -0
- package/dist/packages/excalidraw/components/LibraryMenu.js +99 -0
- package/dist/packages/excalidraw/components/LibraryMenu.scss +150 -0
- package/dist/packages/excalidraw/components/LibraryMenuBrowseButton.js +8 -0
- package/dist/packages/excalidraw/components/LibraryMenuControlButtons.js +6 -0
- package/dist/packages/excalidraw/components/LibraryMenuHeaderContent.js +126 -0
- package/dist/packages/excalidraw/components/LibraryMenuItems.js +138 -0
- package/dist/packages/excalidraw/components/LibraryMenuItems.scss +99 -0
- package/dist/packages/excalidraw/components/LibraryMenuSection.js +21 -0
- package/dist/packages/excalidraw/components/LibraryUnit.js +52 -0
- package/dist/packages/excalidraw/components/LibraryUnit.scss +185 -0
- package/dist/packages/excalidraw/components/LoadingMessage.js +24 -0
- package/dist/packages/excalidraw/components/LockButton.js +14 -0
- package/dist/packages/excalidraw/components/MagicButton.js +9 -0
- package/dist/packages/excalidraw/components/MagicSettings.js +46 -0
- package/dist/packages/excalidraw/components/MagicSettings.scss +18 -0
- package/dist/packages/excalidraw/components/MobileMenu.js +45 -0
- package/dist/packages/excalidraw/components/Modal.js +23 -0
- package/dist/packages/excalidraw/components/Modal.scss +121 -0
- package/dist/packages/excalidraw/components/OverwriteConfirm/OverwriteConfirm.js +31 -0
- package/dist/packages/excalidraw/components/OverwriteConfirm/OverwriteConfirm.scss +126 -0
- package/dist/packages/excalidraw/components/OverwriteConfirm/OverwriteConfirmActions.js +32 -0
- package/dist/packages/excalidraw/components/OverwriteConfirm/OverwriteConfirmState.js +19 -0
- package/dist/packages/excalidraw/components/Paragraph.js +4 -0
- package/dist/packages/excalidraw/components/PasteChartDialog.js +63 -0
- package/dist/packages/excalidraw/components/PasteChartDialog.scss +46 -0
- package/dist/packages/excalidraw/components/PenModeButton.js +13 -0
- package/dist/packages/excalidraw/components/Popover.js +111 -0
- package/dist/packages/excalidraw/components/Popover.scss +8 -0
- package/dist/packages/excalidraw/components/ProjectName.js +30 -0
- package/dist/packages/excalidraw/components/ProjectName.scss +25 -0
- package/dist/packages/excalidraw/components/PublishLibrary.js +214 -0
- package/dist/packages/excalidraw/components/PublishLibrary.scss +172 -0
- package/dist/packages/excalidraw/components/RadioGroup.js +8 -0
- package/dist/packages/excalidraw/components/RadioGroup.scss +91 -0
- package/dist/packages/excalidraw/components/Section.js +8 -0
- package/dist/packages/excalidraw/components/ShareableLinkDialog.js +33 -0
- package/dist/packages/excalidraw/components/ShareableLinkDialog.scss +91 -0
- package/dist/packages/excalidraw/components/Sidebar/Sidebar.js +145 -0
- package/dist/packages/excalidraw/components/Sidebar/Sidebar.scss +176 -0
- package/dist/packages/excalidraw/components/Sidebar/SidebarHeader.js +16 -0
- package/dist/packages/excalidraw/components/Sidebar/SidebarTab.js +6 -0
- package/dist/packages/excalidraw/components/Sidebar/SidebarTabTrigger.js +6 -0
- package/dist/packages/excalidraw/components/Sidebar/SidebarTabTriggers.js +6 -0
- package/dist/packages/excalidraw/components/Sidebar/SidebarTabs.js +17 -0
- package/dist/packages/excalidraw/components/Sidebar/SidebarTrigger.js +18 -0
- package/dist/packages/excalidraw/components/Sidebar/SidebarTrigger.scss +37 -0
- package/dist/packages/excalidraw/components/Sidebar/common.js +2 -0
- package/dist/packages/excalidraw/components/Spinner.js +14 -0
- package/dist/packages/excalidraw/components/Spinner.scss +49 -0
- package/dist/packages/excalidraw/components/Stack.js +24 -0
- package/dist/packages/excalidraw/components/Stack.scss +19 -0
- package/dist/packages/excalidraw/components/Stats.js +13 -0
- package/dist/packages/excalidraw/components/Stats.scss +54 -0
- package/dist/packages/excalidraw/components/Switch.js +10 -0
- package/dist/packages/excalidraw/components/Switch.scss +118 -0
- package/dist/packages/excalidraw/components/TTDDialog/MermaidToExcalidraw.js +58 -0
- package/dist/packages/excalidraw/components/TTDDialog/MermaidToExcalidraw.scss +10 -0
- package/dist/packages/excalidraw/components/TTDDialog/TTDDialog.js +194 -0
- package/dist/packages/excalidraw/components/TTDDialog/TTDDialog.scss +315 -0
- package/dist/packages/excalidraw/components/TTDDialog/TTDDialogInput.js +28 -0
- package/dist/packages/excalidraw/components/TTDDialog/TTDDialogOutput.js +8 -0
- package/dist/packages/excalidraw/components/TTDDialog/TTDDialogPanel.js +11 -0
- package/dist/packages/excalidraw/components/TTDDialog/TTDDialogPanels.js +4 -0
- package/dist/packages/excalidraw/components/TTDDialog/TTDDialogSubmitShortcut.js +5 -0
- package/dist/packages/excalidraw/components/TTDDialog/TTDDialogTab.js +6 -0
- package/dist/packages/excalidraw/components/TTDDialog/TTDDialogTabTrigger.js +6 -0
- package/dist/packages/excalidraw/components/TTDDialog/TTDDialogTabTriggers.js +6 -0
- package/dist/packages/excalidraw/components/TTDDialog/TTDDialogTabs.js +39 -0
- package/dist/packages/excalidraw/components/TTDDialog/TTDDialogTrigger.js +16 -0
- package/dist/packages/excalidraw/components/TTDDialog/common.js +88 -0
- package/dist/packages/excalidraw/components/TextField.js +25 -0
- package/dist/packages/excalidraw/components/TextField.scss +109 -0
- package/dist/packages/excalidraw/components/TextInput.scss +7 -0
- package/dist/packages/excalidraw/components/Toast.js +30 -0
- package/dist/packages/excalidraw/components/Toast.scss +49 -0
- package/dist/packages/excalidraw/components/ToolButton.js +72 -0
- package/dist/packages/excalidraw/components/ToolIcon.scss +184 -0
- package/dist/packages/excalidraw/components/Toolbar.scss +50 -0
- package/dist/packages/excalidraw/components/Tooltip.js +60 -0
- package/dist/packages/excalidraw/components/Tooltip.scss +47 -0
- package/dist/packages/excalidraw/components/Trans.js +139 -0
- package/dist/packages/excalidraw/components/UserList.js +96 -0
- package/dist/packages/excalidraw/components/UserList.scss +136 -0
- package/dist/packages/excalidraw/components/canvases/InteractiveCanvas.js +120 -0
- package/dist/packages/excalidraw/components/canvases/StaticCanvas.js +85 -0
- package/dist/packages/excalidraw/components/canvases/index.js +3 -0
- package/dist/packages/excalidraw/components/dropdownMenu/DropdownMenu.js +24 -0
- package/dist/packages/excalidraw/components/dropdownMenu/DropdownMenu.scss +148 -0
- package/dist/packages/excalidraw/components/dropdownMenu/DropdownMenuContent.js +21 -0
- package/dist/packages/excalidraw/components/dropdownMenu/DropdownMenuGroup.js +6 -0
- package/dist/packages/excalidraw/components/dropdownMenu/DropdownMenuItem.js +23 -0
- package/dist/packages/excalidraw/components/dropdownMenu/DropdownMenuItemContent.js +7 -0
- package/dist/packages/excalidraw/components/dropdownMenu/DropdownMenuItemCustom.js +5 -0
- package/dist/packages/excalidraw/components/dropdownMenu/DropdownMenuItemLink.js +9 -0
- package/dist/packages/excalidraw/components/dropdownMenu/DropdownMenuSeparator.js +8 -0
- package/dist/packages/excalidraw/components/dropdownMenu/DropdownMenuTrigger.js +12 -0
- package/dist/packages/excalidraw/components/dropdownMenu/common.js +20 -0
- package/dist/packages/excalidraw/components/dropdownMenu/dropdownMenuUtils.js +27 -0
- package/dist/packages/excalidraw/components/footer/Footer.js +25 -0
- package/dist/packages/excalidraw/components/footer/FooterCenter.js +14 -0
- package/dist/packages/excalidraw/components/footer/FooterCenter.scss +11 -0
- package/dist/packages/excalidraw/components/hoc/withInternalFallback.js +57 -0
- package/dist/packages/excalidraw/components/icons.js +220 -0
- package/dist/packages/excalidraw/components/live-collaboration/LiveCollaborationTrigger.js +13 -0
- package/dist/packages/excalidraw/components/live-collaboration/LiveCollaborationTrigger.scss +72 -0
- package/dist/packages/excalidraw/components/main-menu/DefaultItems.js +116 -0
- package/dist/packages/excalidraw/components/main-menu/DefaultItems.scss +21 -0
- package/dist/packages/excalidraw/components/main-menu/MainMenu.js +36 -0
- package/dist/packages/excalidraw/components/welcome-screen/WelcomeScreen.Center.js +69 -0
- package/dist/packages/excalidraw/components/welcome-screen/WelcomeScreen.Hints.js +20 -0
- package/dist/packages/excalidraw/components/welcome-screen/WelcomeScreen.js +11 -0
- package/dist/packages/excalidraw/components/welcome-screen/WelcomeScreen.scss +285 -0
- package/dist/packages/excalidraw/constants.js +312 -0
- package/dist/packages/excalidraw/context/tunnels.js +21 -0
- package/dist/packages/excalidraw/context/ui-appState.js +3 -0
- package/dist/packages/excalidraw/css/app.scss +39 -0
- package/dist/packages/excalidraw/css/styles.scss +757 -0
- package/dist/packages/excalidraw/css/theme.scss +252 -0
- package/dist/packages/excalidraw/css/variables.module.scss +174 -0
- package/dist/packages/excalidraw/cursor.js +72 -0
- package/dist/packages/excalidraw/data/EditorLocalStorage.js +42 -0
- package/dist/packages/excalidraw/data/ai/types.js +1 -0
- package/dist/packages/excalidraw/data/blob.js +378 -0
- package/dist/packages/excalidraw/data/encode.js +231 -0
- package/dist/packages/excalidraw/data/encryption.js +53 -0
- package/dist/packages/excalidraw/data/filesystem.js +65 -0
- package/dist/packages/excalidraw/data/image.js +91 -0
- package/dist/packages/excalidraw/data/index.js +120 -0
- package/dist/packages/excalidraw/data/json.js +93 -0
- package/dist/packages/excalidraw/data/library.js +376 -0
- package/dist/packages/excalidraw/data/magic.js +73 -0
- package/dist/packages/excalidraw/data/resave.js +22 -0
- package/dist/packages/excalidraw/data/restore.js +438 -0
- package/dist/packages/excalidraw/data/transform.js +442 -0
- package/dist/packages/excalidraw/data/types.js +1 -0
- package/dist/packages/excalidraw/data/url.js +30 -0
- package/dist/packages/excalidraw/distribute.js +58 -0
- package/dist/packages/excalidraw/element/ElementCanvasButtons.js +31 -0
- package/dist/packages/excalidraw/element/ElementCanvasButtons.scss +14 -0
- package/dist/packages/excalidraw/element/Hyperlink.js +350 -0
- package/dist/packages/excalidraw/element/Hyperlink.scss +70 -0
- package/dist/packages/excalidraw/element/binding.js +412 -0
- package/dist/packages/excalidraw/element/bounds.js +613 -0
- package/dist/packages/excalidraw/element/collision.js +727 -0
- package/dist/packages/excalidraw/element/dragElements.js +119 -0
- package/dist/packages/excalidraw/element/embeddable.js +305 -0
- package/dist/packages/excalidraw/element/image.js +91 -0
- package/dist/packages/excalidraw/element/index.js +24 -0
- package/dist/packages/excalidraw/element/linearElementEditor.js +867 -0
- package/dist/packages/excalidraw/element/mutateElement.js +112 -0
- package/dist/packages/excalidraw/element/newElement.js +389 -0
- package/dist/packages/excalidraw/element/resizeElements.js +597 -0
- package/dist/packages/excalidraw/element/resizeTest.js +95 -0
- package/dist/packages/excalidraw/element/showSelectedShapeActions.js +9 -0
- package/dist/packages/excalidraw/element/sizeHelpers.js +131 -0
- package/dist/packages/excalidraw/element/sortElements.js +104 -0
- package/dist/packages/excalidraw/element/textElement.js +716 -0
- package/dist/packages/excalidraw/element/textWysiwyg.js +500 -0
- package/dist/packages/excalidraw/element/transformHandles.js +155 -0
- package/dist/packages/excalidraw/element/typeChecks.js +141 -0
- package/dist/packages/excalidraw/element/types.js +1 -0
- package/dist/packages/excalidraw/emitter.js +36 -0
- package/dist/packages/excalidraw/errors.js +20 -0
- package/dist/packages/excalidraw/frame.js +373 -0
- package/dist/packages/excalidraw/ga.js +268 -0
- package/dist/packages/excalidraw/gadirections.js +18 -0
- package/dist/packages/excalidraw/galines.js +32 -0
- package/dist/packages/excalidraw/gapoints.js +30 -0
- package/dist/packages/excalidraw/gatransforms.js +23 -0
- package/dist/packages/excalidraw/gesture.js +9 -0
- package/dist/packages/excalidraw/groups.js +225 -0
- package/dist/packages/excalidraw/history.js +190 -0
- package/dist/packages/excalidraw/hooks/useCallbackRefState.js +6 -0
- package/dist/packages/excalidraw/hooks/useCreatePortalContainer.js +32 -0
- package/dist/packages/excalidraw/hooks/useLibraryItemSvg.js +62 -0
- package/dist/packages/excalidraw/hooks/useOutsideClick.js +67 -0
- package/dist/packages/excalidraw/hooks/useScrollPosition.js +23 -0
- package/dist/packages/excalidraw/hooks/useStable.js +6 -0
- package/dist/packages/excalidraw/hooks/useTransition.js +7 -0
- package/dist/packages/excalidraw/i18n.js +137 -0
- package/dist/packages/excalidraw/index-node.d.ts +1 -0
- package/dist/packages/excalidraw/index-node.js +73 -0
- package/{types → dist/packages}/excalidraw/index.d.ts +1 -1
- package/dist/packages/excalidraw/index.js +116 -0
- package/dist/packages/excalidraw/jotai.js +18 -0
- package/dist/packages/excalidraw/keys.js +84 -0
- package/dist/packages/excalidraw/locales/ar-SA.json +525 -0
- package/dist/packages/excalidraw/locales/az-AZ.json +525 -0
- package/dist/packages/excalidraw/locales/bg-BG.json +525 -0
- package/dist/packages/excalidraw/locales/bn-BD.json +525 -0
- package/dist/packages/excalidraw/locales/ca-ES.json +525 -0
- package/dist/packages/excalidraw/locales/cs-CZ.json +525 -0
- package/dist/packages/excalidraw/locales/da-DK.json +525 -0
- package/dist/packages/excalidraw/locales/de-DE.json +525 -0
- package/dist/packages/excalidraw/locales/el-GR.json +525 -0
- package/dist/packages/excalidraw/locales/en.json +535 -0
- package/dist/packages/excalidraw/locales/es-ES.json +525 -0
- package/dist/packages/excalidraw/locales/eu-ES.json +525 -0
- package/dist/packages/excalidraw/locales/fa-IR.json +525 -0
- package/dist/packages/excalidraw/locales/fi-FI.json +525 -0
- package/dist/packages/excalidraw/locales/fr-FR.json +525 -0
- package/dist/packages/excalidraw/locales/gl-ES.json +525 -0
- package/dist/packages/excalidraw/locales/he-IL.json +525 -0
- package/dist/packages/excalidraw/locales/hi-IN.json +525 -0
- package/dist/packages/excalidraw/locales/hu-HU.json +525 -0
- package/dist/packages/excalidraw/locales/id-ID.json +525 -0
- package/dist/packages/excalidraw/locales/it-IT.json +525 -0
- package/dist/packages/excalidraw/locales/ja-JP.json +525 -0
- package/dist/packages/excalidraw/locales/kaa.json +525 -0
- package/dist/packages/excalidraw/locales/kab-KAB.json +525 -0
- package/dist/packages/excalidraw/locales/kk-KZ.json +525 -0
- package/dist/packages/excalidraw/locales/km-KH.json +525 -0
- package/dist/packages/excalidraw/locales/ko-KR.json +525 -0
- package/dist/packages/excalidraw/locales/ku-TR.json +525 -0
- package/dist/packages/excalidraw/locales/lt-LT.json +525 -0
- package/dist/packages/excalidraw/locales/lv-LV.json +525 -0
- package/dist/packages/excalidraw/locales/mr-IN.json +525 -0
- package/dist/packages/excalidraw/locales/my-MM.json +525 -0
- package/dist/packages/excalidraw/locales/nb-NO.json +525 -0
- package/dist/packages/excalidraw/locales/nl-NL.json +525 -0
- package/dist/packages/excalidraw/locales/nn-NO.json +525 -0
- package/dist/packages/excalidraw/locales/oc-FR.json +525 -0
- package/dist/packages/excalidraw/locales/pa-IN.json +525 -0
- package/dist/packages/excalidraw/locales/percentages.json +56 -0
- package/dist/packages/excalidraw/locales/pl-PL.json +525 -0
- package/dist/packages/excalidraw/locales/pt-BR.json +525 -0
- package/dist/packages/excalidraw/locales/pt-PT.json +525 -0
- package/dist/packages/excalidraw/locales/ro-RO.json +525 -0
- package/dist/packages/excalidraw/locales/ru-RU.json +525 -0
- package/dist/packages/excalidraw/locales/si-LK.json +525 -0
- package/dist/packages/excalidraw/locales/sk-SK.json +525 -0
- package/dist/packages/excalidraw/locales/sl-SI.json +525 -0
- package/dist/packages/excalidraw/locales/sv-SE.json +525 -0
- package/dist/packages/excalidraw/locales/ta-IN.json +525 -0
- package/dist/packages/excalidraw/locales/th-TH.json +525 -0
- package/dist/packages/excalidraw/locales/tr-TR.json +525 -0
- package/dist/packages/excalidraw/locales/uk-UA.json +525 -0
- package/dist/packages/excalidraw/locales/vi-VN.json +525 -0
- package/dist/packages/excalidraw/locales/zh-CN.json +525 -0
- package/dist/packages/excalidraw/locales/zh-HK.json +525 -0
- package/dist/packages/excalidraw/locales/zh-TW.json +525 -0
- package/dist/packages/excalidraw/math.js +364 -0
- package/dist/packages/excalidraw/points.js +38 -0
- package/dist/packages/excalidraw/polyfill.js +32 -0
- package/dist/packages/excalidraw/random.js +11 -0
- package/dist/packages/excalidraw/renderer/renderElement.js +871 -0
- package/dist/packages/excalidraw/renderer/renderScene.js +859 -0
- package/dist/packages/excalidraw/renderer/renderSnaps.js +114 -0
- package/dist/packages/excalidraw/renderer/roundRect.js +28 -0
- package/dist/packages/excalidraw/scene/Fonts.js +71 -0
- package/dist/packages/excalidraw/scene/Renderer.js +65 -0
- package/dist/packages/excalidraw/scene/Scene.js +230 -0
- package/dist/packages/excalidraw/scene/Shape.js +322 -0
- package/dist/packages/excalidraw/scene/ShapeCache.js +42 -0
- package/dist/packages/excalidraw/scene/comparisons.js +67 -0
- package/dist/packages/excalidraw/scene/export.js +304 -0
- package/dist/packages/excalidraw/scene/index.js +5 -0
- package/dist/packages/excalidraw/scene/scroll.js +35 -0
- package/dist/packages/excalidraw/scene/scrollbars.js +85 -0
- package/dist/packages/excalidraw/scene/selection.js +134 -0
- package/dist/packages/excalidraw/scene/types.js +1 -0
- package/dist/packages/excalidraw/scene/zoom.js +22 -0
- package/dist/packages/excalidraw/shapes.js +84 -0
- package/dist/packages/excalidraw/snapping.js +838 -0
- package/dist/packages/excalidraw/types.js +6 -0
- package/dist/packages/excalidraw/utility-types.js +1 -0
- package/dist/packages/excalidraw/utils.js +668 -0
- package/dist/packages/excalidraw/zindex.js +349 -0
- package/dist/packages/utils/bbox.js +42 -0
- package/dist/packages/utils/export.js +109 -0
- package/dist/packages/utils/withinBounds.js +125 -0
- package/dist/public/fonts/Assistant-Bold.woff2 +0 -0
- package/dist/public/fonts/Assistant-Medium.woff2 +0 -0
- package/dist/public/fonts/Assistant-Regular.woff2 +0 -0
- package/dist/public/fonts/Assistant-SemiBold.woff2 +0 -0
- package/dist/public/fonts/Cascadia.ttf +0 -0
- package/dist/public/fonts/Cascadia.woff2 +0 -0
- package/dist/public/fonts/FG_Virgil.ttf +0 -0
- package/dist/public/fonts/FG_Virgil.woff2 +0 -0
- package/dist/public/fonts/Virgil.woff2 +0 -0
- package/dist/public/fonts/fonts.css +38 -0
- package/package.json +8 -5
- package/dist/index.css +0 -5796
- package/dist/index.js +0 -71898
- /package/{types → dist/packages}/excalidraw/actions/actionAddToLibrary.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/actions/actionAlign.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/actions/actionBoundText.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/actions/actionCanvas.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/actions/actionClipboard.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/actions/actionDeleteSelected.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/actions/actionDistribute.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/actions/actionDuplicateSelection.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/actions/actionElementLock.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/actions/actionExport.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/actions/actionFinalize.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/actions/actionFlip.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/actions/actionFrame.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/actions/actionGroup.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/actions/actionHistory.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/actions/actionLinearEditor.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/actions/actionMenu.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/actions/actionNavigate.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/actions/actionProperties.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/actions/actionSelectAll.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/actions/actionStyles.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/actions/actionToggleGridMode.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/actions/actionToggleStats.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/actions/actionToggleViewMode.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/actions/actionToggleZenMode.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/actions/actionZindex.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/actions/index.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/actions/manager.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/actions/register.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/actions/shortcuts.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/actions/types.d.ts +0 -0
- /package/{types/excalidraw/index-node.d.ts → dist/packages/excalidraw/actions/types.js} +0 -0
- /package/{types → dist/packages}/excalidraw/align.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/analytics.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/appState.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/charts.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/clients.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/clipboard.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/colors.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/Actions.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/ActiveConfirmDialog.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/App.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/Avatar.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/BraveMeasureTextError.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/Button.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/ButtonIconCycle.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/ButtonIconSelect.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/ButtonSelect.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/Card.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/CheckboxItem.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/ColorPicker/ColorInput.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/ColorPicker/ColorPicker.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/ColorPicker/CustomColorList.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/ColorPicker/HotkeyLabel.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/ColorPicker/Picker.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/ColorPicker/PickerColorList.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/ColorPicker/PickerHeading.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/ColorPicker/ShadeList.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/ColorPicker/TopPicks.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/ColorPicker/colorPickerUtils.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/ColorPicker/keyboardNavHandlers.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/ConfirmDialog.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/ContextMenu.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/DarkModeToggle.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/DefaultSidebar.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/Dialog.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/DialogActionButton.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/ErrorDialog.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/ExcalidrawLogo.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/EyeDropper.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/FilledButton.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/FixedSideContainer.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/FollowMode/FollowMode.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/HandButton.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/HelpButton.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/HelpDialog.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/HintViewer.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/IconPicker.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/ImageExportDialog.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/InitializeApp.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/InlineIcon.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/Island.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/JSONExportDialog.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/LaserTool/LaserPathManager.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/LaserTool/LaserPointerButton.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/LaserTool/LaserTool.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/LayerUI.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/LibraryMenu.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/LibraryMenuBrowseButton.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/LibraryMenuControlButtons.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/LibraryMenuHeaderContent.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/LibraryMenuItems.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/LibraryMenuSection.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/LibraryUnit.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/LoadingMessage.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/LockButton.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/MagicButton.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/MagicSettings.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/MobileMenu.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/Modal.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/OverwriteConfirm/OverwriteConfirm.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/OverwriteConfirm/OverwriteConfirmActions.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/OverwriteConfirm/OverwriteConfirmState.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/Paragraph.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/PasteChartDialog.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/PenModeButton.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/Popover.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/ProjectName.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/PublishLibrary.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/RadioGroup.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/Section.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/ShareableLinkDialog.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/Sidebar/Sidebar.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/Sidebar/SidebarHeader.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/Sidebar/SidebarTab.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/Sidebar/SidebarTabTrigger.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/Sidebar/SidebarTabTriggers.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/Sidebar/SidebarTabs.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/Sidebar/SidebarTrigger.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/Sidebar/common.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/Spinner.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/Stack.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/Stats.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/Switch.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/TTDDialog/MermaidToExcalidraw.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/TTDDialog/TTDDialog.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/TTDDialog/TTDDialogInput.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/TTDDialog/TTDDialogOutput.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/TTDDialog/TTDDialogPanel.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/TTDDialog/TTDDialogPanels.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/TTDDialog/TTDDialogSubmitShortcut.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/TTDDialog/TTDDialogTab.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/TTDDialog/TTDDialogTabTrigger.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/TTDDialog/TTDDialogTabTriggers.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/TTDDialog/TTDDialogTabs.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/TTDDialog/TTDDialogTrigger.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/TTDDialog/common.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/TextField.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/Toast.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/ToolButton.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/Tooltip.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/Trans.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/UserList.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/canvases/InteractiveCanvas.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/canvases/StaticCanvas.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/canvases/index.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/dropdownMenu/DropdownMenu.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/dropdownMenu/DropdownMenuContent.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/dropdownMenu/DropdownMenuGroup.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/dropdownMenu/DropdownMenuItem.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/dropdownMenu/DropdownMenuItemContent.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/dropdownMenu/DropdownMenuItemCustom.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/dropdownMenu/DropdownMenuItemLink.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/dropdownMenu/DropdownMenuSeparator.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/dropdownMenu/DropdownMenuTrigger.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/dropdownMenu/common.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/dropdownMenu/dropdownMenuUtils.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/footer/Footer.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/footer/FooterCenter.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/hoc/withInternalFallback.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/icons.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/live-collaboration/LiveCollaborationTrigger.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/main-menu/DefaultItems.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/main-menu/MainMenu.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/welcome-screen/WelcomeScreen.Center.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/welcome-screen/WelcomeScreen.Hints.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/welcome-screen/WelcomeScreen.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/constants.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/context/tunnels.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/context/ui-appState.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/cursor.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/data/EditorLocalStorage.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/data/ai/types.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/data/blob.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/data/encode.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/data/encryption.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/data/filesystem.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/data/image.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/data/index.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/data/json.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/data/library.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/data/magic.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/data/resave.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/data/restore.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/data/transform.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/data/types.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/data/url.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/distribute.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/element/ElementCanvasButtons.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/element/Hyperlink.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/element/binding.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/element/bounds.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/element/collision.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/element/dragElements.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/element/embeddable.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/element/image.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/element/index.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/element/linearElementEditor.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/element/mutateElement.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/element/newElement.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/element/resizeElements.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/element/resizeTest.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/element/showSelectedShapeActions.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/element/sizeHelpers.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/element/sortElements.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/element/textElement.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/element/textWysiwyg.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/element/transformHandles.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/element/typeChecks.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/element/types.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/emitter.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/errors.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/frame.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/ga.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/gadirections.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/galines.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/gapoints.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/gatransforms.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/gesture.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/groups.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/history.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/hooks/useCallbackRefState.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/hooks/useCreatePortalContainer.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/hooks/useLibraryItemSvg.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/hooks/useOutsideClick.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/hooks/useScrollPosition.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/hooks/useStable.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/hooks/useTransition.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/i18n.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/jotai.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/keys.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/math.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/points.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/polyfill.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/random.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/renderer/renderElement.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/renderer/renderScene.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/renderer/renderSnaps.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/renderer/roundRect.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/scene/Fonts.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/scene/Renderer.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/scene/Scene.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/scene/Shape.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/scene/ShapeCache.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/scene/comparisons.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/scene/export.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/scene/index.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/scene/scroll.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/scene/scrollbars.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/scene/selection.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/scene/types.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/scene/zoom.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/shapes.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/snapping.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/types.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/utility-types.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/utils.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/zindex.d.ts +0 -0
- /package/{types → dist/packages}/utils/bbox.d.ts +0 -0
- /package/{types → dist/packages}/utils/export.d.ts +0 -0
- /package/{types → dist/packages}/utils/withinBounds.d.ts +0 -0
|
@@ -0,0 +1,349 @@
|
|
|
1
|
+
import { bumpVersion } from "./element/mutateElement";
|
|
2
|
+
import { isFrameLikeElement } from "./element/typeChecks";
|
|
3
|
+
import { getElementsInGroup } from "./groups";
|
|
4
|
+
import { getSelectedElements } from "./scene";
|
|
5
|
+
import Scene from "./scene/Scene";
|
|
6
|
+
import { arrayToMap, findIndex, findLastIndex } from "./utils";
|
|
7
|
+
const isOfTargetFrame = (element, frameId) => {
|
|
8
|
+
return element.frameId === frameId || element.id === frameId;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Returns indices of elements to move based on selected elements.
|
|
12
|
+
* Includes contiguous deleted elements that are between two selected elements,
|
|
13
|
+
* e.g.: [0 (selected), 1 (deleted), 2 (deleted), 3 (selected)]
|
|
14
|
+
*
|
|
15
|
+
* Specified elements (elementsToBeMoved) take precedence over
|
|
16
|
+
* appState.selectedElementsIds
|
|
17
|
+
*/
|
|
18
|
+
const getIndicesToMove = (elements, appState, elementsToBeMoved) => {
|
|
19
|
+
let selectedIndices = [];
|
|
20
|
+
let deletedIndices = [];
|
|
21
|
+
let includeDeletedIndex = null;
|
|
22
|
+
let index = -1;
|
|
23
|
+
const selectedElementIds = arrayToMap(elementsToBeMoved
|
|
24
|
+
? elementsToBeMoved
|
|
25
|
+
: getSelectedElements(elements, appState, {
|
|
26
|
+
includeBoundTextElement: true,
|
|
27
|
+
includeElementsInFrames: true,
|
|
28
|
+
}));
|
|
29
|
+
while (++index < elements.length) {
|
|
30
|
+
const element = elements[index];
|
|
31
|
+
if (selectedElementIds.get(element.id)) {
|
|
32
|
+
if (deletedIndices.length) {
|
|
33
|
+
selectedIndices = selectedIndices.concat(deletedIndices);
|
|
34
|
+
deletedIndices = [];
|
|
35
|
+
}
|
|
36
|
+
selectedIndices.push(index);
|
|
37
|
+
includeDeletedIndex = index + 1;
|
|
38
|
+
}
|
|
39
|
+
else if (element.isDeleted && includeDeletedIndex === index) {
|
|
40
|
+
includeDeletedIndex = index + 1;
|
|
41
|
+
deletedIndices.push(index);
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
deletedIndices = [];
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return selectedIndices;
|
|
48
|
+
};
|
|
49
|
+
const toContiguousGroups = (array) => {
|
|
50
|
+
let cursor = 0;
|
|
51
|
+
return array.reduce((acc, value, index) => {
|
|
52
|
+
if (index > 0 && array[index - 1] !== value - 1) {
|
|
53
|
+
cursor = ++cursor;
|
|
54
|
+
}
|
|
55
|
+
(acc[cursor] || (acc[cursor] = [])).push(value);
|
|
56
|
+
return acc;
|
|
57
|
+
}, []);
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* @returns index of target element, consindering tightly-bound elements
|
|
61
|
+
* (currently non-linear elements bound to a container) as a one unit.
|
|
62
|
+
* If no binding present, returns `undefined`.
|
|
63
|
+
*/
|
|
64
|
+
const getTargetIndexAccountingForBinding = (nextElement, elements, direction) => {
|
|
65
|
+
if ("containerId" in nextElement && nextElement.containerId) {
|
|
66
|
+
if (direction === "left") {
|
|
67
|
+
const containerElement = Scene.getScene(nextElement).getElement(nextElement.containerId);
|
|
68
|
+
if (containerElement) {
|
|
69
|
+
return elements.indexOf(containerElement);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
return elements.indexOf(nextElement);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
const boundElementId = nextElement.boundElements?.find((binding) => binding.type !== "arrow")?.id;
|
|
78
|
+
if (boundElementId) {
|
|
79
|
+
if (direction === "left") {
|
|
80
|
+
return elements.indexOf(nextElement);
|
|
81
|
+
}
|
|
82
|
+
const boundTextElement = Scene.getScene(nextElement).getElement(boundElementId);
|
|
83
|
+
if (boundTextElement) {
|
|
84
|
+
return elements.indexOf(boundTextElement);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
const getContiguousFrameRangeElements = (allElements, frameId) => {
|
|
90
|
+
let rangeStart = -1;
|
|
91
|
+
let rangeEnd = -1;
|
|
92
|
+
allElements.forEach((element, index) => {
|
|
93
|
+
if (isOfTargetFrame(element, frameId)) {
|
|
94
|
+
if (rangeStart === -1) {
|
|
95
|
+
rangeStart = index;
|
|
96
|
+
}
|
|
97
|
+
rangeEnd = index;
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
if (rangeStart === -1) {
|
|
101
|
+
return [];
|
|
102
|
+
}
|
|
103
|
+
return allElements.slice(rangeStart, rangeEnd + 1);
|
|
104
|
+
};
|
|
105
|
+
/**
|
|
106
|
+
* Returns next candidate index that's available to be moved to. Currently that
|
|
107
|
+
* is a non-deleted element, and not inside a group (unless we're editing it).
|
|
108
|
+
*/
|
|
109
|
+
const getTargetIndex = (appState, elements, boundaryIndex, direction,
|
|
110
|
+
/**
|
|
111
|
+
* Frame id if moving frame children.
|
|
112
|
+
* If whole frame (including all children) is being moved, supply `null`.
|
|
113
|
+
*/
|
|
114
|
+
containingFrame) => {
|
|
115
|
+
const sourceElement = elements[boundaryIndex];
|
|
116
|
+
const indexFilter = (element) => {
|
|
117
|
+
if (element.isDeleted) {
|
|
118
|
+
return false;
|
|
119
|
+
}
|
|
120
|
+
if (containingFrame) {
|
|
121
|
+
return element.frameId === containingFrame;
|
|
122
|
+
}
|
|
123
|
+
// if we're editing group, find closest sibling irrespective of whether
|
|
124
|
+
// there's a different-group element between them (for legacy reasons)
|
|
125
|
+
if (appState.editingGroupId) {
|
|
126
|
+
return element.groupIds.includes(appState.editingGroupId);
|
|
127
|
+
}
|
|
128
|
+
return true;
|
|
129
|
+
};
|
|
130
|
+
const candidateIndex = direction === "left"
|
|
131
|
+
? findLastIndex(elements, (el) => indexFilter(el), Math.max(0, boundaryIndex - 1))
|
|
132
|
+
: findIndex(elements, (el) => indexFilter(el), boundaryIndex + 1);
|
|
133
|
+
const nextElement = elements[candidateIndex];
|
|
134
|
+
if (!nextElement) {
|
|
135
|
+
return -1;
|
|
136
|
+
}
|
|
137
|
+
if (appState.editingGroupId) {
|
|
138
|
+
if (
|
|
139
|
+
// candidate element is a sibling in current editing group → return
|
|
140
|
+
sourceElement?.groupIds.join("") === nextElement?.groupIds.join("")) {
|
|
141
|
+
return (getTargetIndexAccountingForBinding(nextElement, elements, direction) ??
|
|
142
|
+
candidateIndex);
|
|
143
|
+
}
|
|
144
|
+
else if (!nextElement?.groupIds.includes(appState.editingGroupId)) {
|
|
145
|
+
// candidate element is outside current editing group → prevent
|
|
146
|
+
return -1;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
if (!containingFrame &&
|
|
150
|
+
(nextElement.frameId || isFrameLikeElement(nextElement))) {
|
|
151
|
+
const frameElements = getContiguousFrameRangeElements(elements, nextElement.frameId || nextElement.id);
|
|
152
|
+
return direction === "left"
|
|
153
|
+
? elements.indexOf(frameElements[0])
|
|
154
|
+
: elements.indexOf(frameElements[frameElements.length - 1]);
|
|
155
|
+
}
|
|
156
|
+
if (!nextElement.groupIds.length) {
|
|
157
|
+
return (getTargetIndexAccountingForBinding(nextElement, elements, direction) ??
|
|
158
|
+
candidateIndex);
|
|
159
|
+
}
|
|
160
|
+
const siblingGroupId = appState.editingGroupId
|
|
161
|
+
? nextElement.groupIds[nextElement.groupIds.indexOf(appState.editingGroupId) - 1]
|
|
162
|
+
: nextElement.groupIds[nextElement.groupIds.length - 1];
|
|
163
|
+
const elementsInSiblingGroup = getElementsInGroup(elements, siblingGroupId);
|
|
164
|
+
if (elementsInSiblingGroup.length) {
|
|
165
|
+
// assumes getElementsInGroup() returned elements are sorted
|
|
166
|
+
// by zIndex (ascending)
|
|
167
|
+
return direction === "left"
|
|
168
|
+
? elements.indexOf(elementsInSiblingGroup[0])
|
|
169
|
+
: elements.indexOf(elementsInSiblingGroup[elementsInSiblingGroup.length - 1]);
|
|
170
|
+
}
|
|
171
|
+
return candidateIndex;
|
|
172
|
+
};
|
|
173
|
+
const getTargetElementsMap = (elements, indices) => {
|
|
174
|
+
return indices.reduce((acc, index) => {
|
|
175
|
+
const element = elements[index];
|
|
176
|
+
acc[element.id] = element;
|
|
177
|
+
return acc;
|
|
178
|
+
}, {});
|
|
179
|
+
};
|
|
180
|
+
const shiftElementsByOne = (elements, appState, direction) => {
|
|
181
|
+
const indicesToMove = getIndicesToMove(elements, appState);
|
|
182
|
+
const targetElementsMap = getTargetElementsMap(elements, indicesToMove);
|
|
183
|
+
let groupedIndices = toContiguousGroups(indicesToMove);
|
|
184
|
+
if (direction === "right") {
|
|
185
|
+
groupedIndices = groupedIndices.reverse();
|
|
186
|
+
}
|
|
187
|
+
const selectedFrames = new Set(indicesToMove
|
|
188
|
+
.filter((idx) => isFrameLikeElement(elements[idx]))
|
|
189
|
+
.map((idx) => elements[idx].id));
|
|
190
|
+
groupedIndices.forEach((indices, i) => {
|
|
191
|
+
const leadingIndex = indices[0];
|
|
192
|
+
const trailingIndex = indices[indices.length - 1];
|
|
193
|
+
const boundaryIndex = direction === "left" ? leadingIndex : trailingIndex;
|
|
194
|
+
const containingFrame = indices.some((idx) => {
|
|
195
|
+
const el = elements[idx];
|
|
196
|
+
return el.frameId && selectedFrames.has(el.frameId);
|
|
197
|
+
})
|
|
198
|
+
? null
|
|
199
|
+
: elements[boundaryIndex]?.frameId;
|
|
200
|
+
const targetIndex = getTargetIndex(appState, elements, boundaryIndex, direction, containingFrame);
|
|
201
|
+
if (targetIndex === -1 || boundaryIndex === targetIndex) {
|
|
202
|
+
return;
|
|
203
|
+
}
|
|
204
|
+
const leadingElements = direction === "left"
|
|
205
|
+
? elements.slice(0, targetIndex)
|
|
206
|
+
: elements.slice(0, leadingIndex);
|
|
207
|
+
const targetElements = elements.slice(leadingIndex, trailingIndex + 1);
|
|
208
|
+
const displacedElements = direction === "left"
|
|
209
|
+
? elements.slice(targetIndex, leadingIndex)
|
|
210
|
+
: elements.slice(trailingIndex + 1, targetIndex + 1);
|
|
211
|
+
const trailingElements = direction === "left"
|
|
212
|
+
? elements.slice(trailingIndex + 1)
|
|
213
|
+
: elements.slice(targetIndex + 1);
|
|
214
|
+
elements =
|
|
215
|
+
direction === "left"
|
|
216
|
+
? [
|
|
217
|
+
...leadingElements,
|
|
218
|
+
...targetElements,
|
|
219
|
+
...displacedElements,
|
|
220
|
+
...trailingElements,
|
|
221
|
+
]
|
|
222
|
+
: [
|
|
223
|
+
...leadingElements,
|
|
224
|
+
...displacedElements,
|
|
225
|
+
...targetElements,
|
|
226
|
+
...trailingElements,
|
|
227
|
+
];
|
|
228
|
+
});
|
|
229
|
+
return elements.map((element) => {
|
|
230
|
+
if (targetElementsMap[element.id]) {
|
|
231
|
+
return bumpVersion(element);
|
|
232
|
+
}
|
|
233
|
+
return element;
|
|
234
|
+
});
|
|
235
|
+
};
|
|
236
|
+
const shiftElementsToEnd = (elements, appState, direction, containingFrame, elementsToBeMoved) => {
|
|
237
|
+
const indicesToMove = getIndicesToMove(elements, appState, elementsToBeMoved);
|
|
238
|
+
const targetElementsMap = getTargetElementsMap(elements, indicesToMove);
|
|
239
|
+
const displacedElements = [];
|
|
240
|
+
let leadingIndex;
|
|
241
|
+
let trailingIndex;
|
|
242
|
+
if (direction === "left") {
|
|
243
|
+
if (containingFrame) {
|
|
244
|
+
leadingIndex = findIndex(elements, (el) => isOfTargetFrame(el, containingFrame));
|
|
245
|
+
}
|
|
246
|
+
else if (appState.editingGroupId) {
|
|
247
|
+
const groupElements = getElementsInGroup(elements, appState.editingGroupId);
|
|
248
|
+
if (!groupElements.length) {
|
|
249
|
+
return elements;
|
|
250
|
+
}
|
|
251
|
+
leadingIndex = elements.indexOf(groupElements[0]);
|
|
252
|
+
}
|
|
253
|
+
else {
|
|
254
|
+
leadingIndex = 0;
|
|
255
|
+
}
|
|
256
|
+
trailingIndex = indicesToMove[indicesToMove.length - 1];
|
|
257
|
+
}
|
|
258
|
+
else {
|
|
259
|
+
if (containingFrame) {
|
|
260
|
+
trailingIndex = findLastIndex(elements, (el) => isOfTargetFrame(el, containingFrame));
|
|
261
|
+
}
|
|
262
|
+
else if (appState.editingGroupId) {
|
|
263
|
+
const groupElements = getElementsInGroup(elements, appState.editingGroupId);
|
|
264
|
+
if (!groupElements.length) {
|
|
265
|
+
return elements;
|
|
266
|
+
}
|
|
267
|
+
trailingIndex = elements.indexOf(groupElements[groupElements.length - 1]);
|
|
268
|
+
}
|
|
269
|
+
else {
|
|
270
|
+
trailingIndex = elements.length - 1;
|
|
271
|
+
}
|
|
272
|
+
leadingIndex = indicesToMove[0];
|
|
273
|
+
}
|
|
274
|
+
if (leadingIndex === -1) {
|
|
275
|
+
leadingIndex = 0;
|
|
276
|
+
}
|
|
277
|
+
for (let index = leadingIndex; index < trailingIndex + 1; index++) {
|
|
278
|
+
if (!indicesToMove.includes(index)) {
|
|
279
|
+
displacedElements.push(elements[index]);
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
const targetElements = Object.values(targetElementsMap).map((element) => {
|
|
283
|
+
return bumpVersion(element);
|
|
284
|
+
});
|
|
285
|
+
const leadingElements = elements.slice(0, leadingIndex);
|
|
286
|
+
const trailingElements = elements.slice(trailingIndex + 1);
|
|
287
|
+
return direction === "left"
|
|
288
|
+
? [
|
|
289
|
+
...leadingElements,
|
|
290
|
+
...targetElements,
|
|
291
|
+
...displacedElements,
|
|
292
|
+
...trailingElements,
|
|
293
|
+
]
|
|
294
|
+
: [
|
|
295
|
+
...leadingElements,
|
|
296
|
+
...displacedElements,
|
|
297
|
+
...targetElements,
|
|
298
|
+
...trailingElements,
|
|
299
|
+
];
|
|
300
|
+
};
|
|
301
|
+
function shiftElementsAccountingForFrames(allElements, appState, direction, shiftFunction) {
|
|
302
|
+
const elementsToMove = arrayToMap(getSelectedElements(allElements, appState, {
|
|
303
|
+
includeBoundTextElement: true,
|
|
304
|
+
includeElementsInFrames: true,
|
|
305
|
+
}));
|
|
306
|
+
const frameAwareContiguousElementsToMove = { regularElements: [], frameChildren: new Map() };
|
|
307
|
+
const fullySelectedFrames = new Set();
|
|
308
|
+
for (const element of allElements) {
|
|
309
|
+
if (elementsToMove.has(element.id) && isFrameLikeElement(element)) {
|
|
310
|
+
fullySelectedFrames.add(element.id);
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
for (const element of allElements) {
|
|
314
|
+
if (elementsToMove.has(element.id)) {
|
|
315
|
+
if (isFrameLikeElement(element) ||
|
|
316
|
+
(element.frameId && fullySelectedFrames.has(element.frameId))) {
|
|
317
|
+
frameAwareContiguousElementsToMove.regularElements.push(element);
|
|
318
|
+
}
|
|
319
|
+
else if (!element.frameId) {
|
|
320
|
+
frameAwareContiguousElementsToMove.regularElements.push(element);
|
|
321
|
+
}
|
|
322
|
+
else {
|
|
323
|
+
const frameChildren = frameAwareContiguousElementsToMove.frameChildren.get(element.frameId) || [];
|
|
324
|
+
frameChildren.push(element);
|
|
325
|
+
frameAwareContiguousElementsToMove.frameChildren.set(element.frameId, frameChildren);
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
let nextElements = allElements;
|
|
330
|
+
const frameChildrenSets = Array.from(frameAwareContiguousElementsToMove.frameChildren.entries());
|
|
331
|
+
for (const [frameId, children] of frameChildrenSets) {
|
|
332
|
+
nextElements = shiftFunction(allElements, appState, direction, frameId, children);
|
|
333
|
+
}
|
|
334
|
+
return shiftFunction(nextElements, appState, direction, null, frameAwareContiguousElementsToMove.regularElements);
|
|
335
|
+
}
|
|
336
|
+
// public API
|
|
337
|
+
// -----------------------------------------------------------------------------
|
|
338
|
+
export const moveOneLeft = (allElements, appState) => {
|
|
339
|
+
return shiftElementsByOne(allElements, appState, "left");
|
|
340
|
+
};
|
|
341
|
+
export const moveOneRight = (allElements, appState) => {
|
|
342
|
+
return shiftElementsByOne(allElements, appState, "right");
|
|
343
|
+
};
|
|
344
|
+
export const moveAllLeft = (allElements, appState) => {
|
|
345
|
+
return shiftElementsAccountingForFrames(allElements, appState, "left", shiftElementsToEnd);
|
|
346
|
+
};
|
|
347
|
+
export const moveAllRight = (allElements, appState) => {
|
|
348
|
+
return shiftElementsAccountingForFrames(allElements, appState, "right", shiftElementsToEnd);
|
|
349
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export function getBBox(line) {
|
|
2
|
+
return [
|
|
3
|
+
Math.min(line[0][0], line[1][0]),
|
|
4
|
+
Math.min(line[0][1], line[1][1]),
|
|
5
|
+
Math.max(line[0][0], line[1][0]),
|
|
6
|
+
Math.max(line[0][1], line[1][1]),
|
|
7
|
+
];
|
|
8
|
+
}
|
|
9
|
+
export function crossProduct(a, b) {
|
|
10
|
+
return a[0] * b[1] - b[0] * a[1];
|
|
11
|
+
}
|
|
12
|
+
export function doBBoxesIntersect(a, b) {
|
|
13
|
+
return a[0] <= b[2] && a[2] >= b[0] && a[1] <= b[3] && a[3] >= b[1];
|
|
14
|
+
}
|
|
15
|
+
export function translate(a, b) {
|
|
16
|
+
return [a[0] - b[0], a[1] - b[1]];
|
|
17
|
+
}
|
|
18
|
+
const EPSILON = 0.000001;
|
|
19
|
+
export function isPointOnLine(l, p) {
|
|
20
|
+
const p1 = translate(l[1], l[0]);
|
|
21
|
+
const p2 = translate(p, l[0]);
|
|
22
|
+
const r = crossProduct(p1, p2);
|
|
23
|
+
return Math.abs(r) < EPSILON;
|
|
24
|
+
}
|
|
25
|
+
export function isPointRightOfLine(l, p) {
|
|
26
|
+
const p1 = translate(l[1], l[0]);
|
|
27
|
+
const p2 = translate(p, l[0]);
|
|
28
|
+
return crossProduct(p1, p2) < 0;
|
|
29
|
+
}
|
|
30
|
+
export function isLineSegmentTouchingOrCrossingLine(a, b) {
|
|
31
|
+
return (isPointOnLine(a, b[0]) ||
|
|
32
|
+
isPointOnLine(a, b[1]) ||
|
|
33
|
+
(isPointRightOfLine(a, b[0])
|
|
34
|
+
? !isPointRightOfLine(a, b[1])
|
|
35
|
+
: isPointRightOfLine(a, b[1])));
|
|
36
|
+
}
|
|
37
|
+
// https://martin-thoma.com/how-to-check-if-two-line-segments-intersect/
|
|
38
|
+
export function doLineSegmentsIntersect(a, b) {
|
|
39
|
+
return (doBBoxesIntersect(getBBox(a), getBBox(b)) &&
|
|
40
|
+
isLineSegmentTouchingOrCrossingLine(a, b) &&
|
|
41
|
+
isLineSegmentTouchingOrCrossingLine(b, a));
|
|
42
|
+
}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { exportToCanvas as _exportToCanvas, exportToSvg as _exportToSvg, } from "../excalidraw/scene/export";
|
|
2
|
+
import { getDefaultAppState } from "../excalidraw/appState";
|
|
3
|
+
import { restore } from "../excalidraw/data/restore";
|
|
4
|
+
import { MIME_TYPES } from "../excalidraw/constants";
|
|
5
|
+
import { encodePngMetadata } from "../excalidraw/data/image";
|
|
6
|
+
import { serializeAsJSON } from "../excalidraw/data/json";
|
|
7
|
+
import { copyBlobToClipboardAsPng, copyTextToSystemClipboard, copyToClipboard, } from "../excalidraw/clipboard";
|
|
8
|
+
export { MIME_TYPES };
|
|
9
|
+
export const exportToCanvas = ({ elements, appState, files, maxWidthOrHeight, getDimensions, exportPadding, exportingFrame, }) => {
|
|
10
|
+
const { elements: restoredElements, appState: restoredAppState } = restore({ elements, appState }, null, null);
|
|
11
|
+
const { exportBackground, viewBackgroundColor } = restoredAppState;
|
|
12
|
+
return _exportToCanvas(restoredElements, { ...restoredAppState, offsetTop: 0, offsetLeft: 0, width: 0, height: 0 }, files || {}, { exportBackground, exportPadding, viewBackgroundColor, exportingFrame }, (width, height) => {
|
|
13
|
+
const canvas = document.createElement("canvas");
|
|
14
|
+
if (maxWidthOrHeight) {
|
|
15
|
+
if (typeof getDimensions === "function") {
|
|
16
|
+
console.warn("`getDimensions()` is ignored when `maxWidthOrHeight` is supplied.");
|
|
17
|
+
}
|
|
18
|
+
const max = Math.max(width, height);
|
|
19
|
+
// if content is less then maxWidthOrHeight, fallback on supplied scale
|
|
20
|
+
const scale = maxWidthOrHeight < max
|
|
21
|
+
? maxWidthOrHeight / max
|
|
22
|
+
: appState?.exportScale ?? 1;
|
|
23
|
+
canvas.width = width * scale;
|
|
24
|
+
canvas.height = height * scale;
|
|
25
|
+
return {
|
|
26
|
+
canvas,
|
|
27
|
+
scale,
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
const ret = getDimensions?.(width, height) || { width, height };
|
|
31
|
+
canvas.width = ret.width;
|
|
32
|
+
canvas.height = ret.height;
|
|
33
|
+
return {
|
|
34
|
+
canvas,
|
|
35
|
+
scale: ret.scale ?? 1,
|
|
36
|
+
};
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
export const exportToBlob = async (opts) => {
|
|
40
|
+
let { mimeType = MIME_TYPES.png, quality } = opts;
|
|
41
|
+
if (mimeType === MIME_TYPES.png && typeof quality === "number") {
|
|
42
|
+
console.warn(`"quality" will be ignored for "${MIME_TYPES.png}" mimeType`);
|
|
43
|
+
}
|
|
44
|
+
// typo in MIME type (should be "jpeg")
|
|
45
|
+
if (mimeType === "image/jpg") {
|
|
46
|
+
mimeType = MIME_TYPES.jpg;
|
|
47
|
+
}
|
|
48
|
+
if (mimeType === MIME_TYPES.jpg && !opts.appState?.exportBackground) {
|
|
49
|
+
console.warn(`Defaulting "exportBackground" to "true" for "${MIME_TYPES.jpg}" mimeType`);
|
|
50
|
+
opts = {
|
|
51
|
+
...opts,
|
|
52
|
+
appState: { ...opts.appState, exportBackground: true },
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
const canvas = await exportToCanvas(opts);
|
|
56
|
+
quality = quality ? quality : /image\/jpe?g/.test(mimeType) ? 0.92 : 0.8;
|
|
57
|
+
return new Promise((resolve, reject) => {
|
|
58
|
+
canvas.toBlob(async (blob) => {
|
|
59
|
+
if (!blob) {
|
|
60
|
+
return reject(new Error("couldn't export to blob"));
|
|
61
|
+
}
|
|
62
|
+
if (blob &&
|
|
63
|
+
mimeType === MIME_TYPES.png &&
|
|
64
|
+
opts.appState?.exportEmbedScene) {
|
|
65
|
+
blob = await encodePngMetadata({
|
|
66
|
+
blob,
|
|
67
|
+
metadata: serializeAsJSON(
|
|
68
|
+
// NOTE as long as we're using the Scene hack, we need to ensure
|
|
69
|
+
// we pass the original, uncloned elements when serializing
|
|
70
|
+
// so that we keep ids stable
|
|
71
|
+
opts.elements, opts.appState, opts.files || {}, "local"),
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
resolve(blob);
|
|
75
|
+
}, mimeType, quality);
|
|
76
|
+
});
|
|
77
|
+
};
|
|
78
|
+
export const exportToSvg = async ({ elements, appState = getDefaultAppState(), files = {}, exportPadding, renderEmbeddables, exportingFrame, }) => {
|
|
79
|
+
const { elements: restoredElements, appState: restoredAppState } = restore({ elements, appState }, null, null);
|
|
80
|
+
const exportAppState = {
|
|
81
|
+
...restoredAppState,
|
|
82
|
+
exportPadding,
|
|
83
|
+
};
|
|
84
|
+
return _exportToSvg(restoredElements, exportAppState, files, {
|
|
85
|
+
exportingFrame,
|
|
86
|
+
renderEmbeddables,
|
|
87
|
+
});
|
|
88
|
+
};
|
|
89
|
+
export const exportToClipboard = async (opts) => {
|
|
90
|
+
if (opts.type === "svg") {
|
|
91
|
+
const svg = await exportToSvg(opts);
|
|
92
|
+
await copyTextToSystemClipboard(svg.outerHTML);
|
|
93
|
+
}
|
|
94
|
+
else if (opts.type === "png") {
|
|
95
|
+
await copyBlobToClipboardAsPng(exportToBlob(opts));
|
|
96
|
+
}
|
|
97
|
+
else if (opts.type === "json") {
|
|
98
|
+
await copyToClipboard(opts.elements, opts.files);
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
throw new Error("Invalid export type");
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
export * from "./bbox";
|
|
105
|
+
export { elementsOverlappingBBox, isElementInsideBBox, elementPartiallyOverlapsWithOrContainsBBox, } from "./withinBounds";
|
|
106
|
+
export { serializeAsJSON, serializeLibraryAsJSON, } from "../excalidraw/data/json";
|
|
107
|
+
export { loadFromBlob, loadSceneOrLibraryFromBlob, loadLibraryFromBlob, } from "../excalidraw/data/blob";
|
|
108
|
+
export { getFreeDrawSvgPath } from "../excalidraw/renderer/renderElement";
|
|
109
|
+
export { mergeLibraryItems } from "../excalidraw/data/library";
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { isArrowElement, isExcalidrawElement, isFreeDrawElement, isLinearElement, isTextElement, } from "../excalidraw/element/typeChecks";
|
|
2
|
+
import { isValueInRange, rotatePoint } from "../excalidraw/math";
|
|
3
|
+
import { getElementBounds } from "../excalidraw/element/bounds";
|
|
4
|
+
/** @returns vertices relative to element's top-left [0,0] position */
|
|
5
|
+
const getNonLinearElementRelativePoints = (element) => {
|
|
6
|
+
if (element.type === "diamond") {
|
|
7
|
+
return [
|
|
8
|
+
[element.width / 2, 0],
|
|
9
|
+
[element.width, element.height / 2],
|
|
10
|
+
[element.width / 2, element.height],
|
|
11
|
+
[0, element.height / 2],
|
|
12
|
+
];
|
|
13
|
+
}
|
|
14
|
+
return [
|
|
15
|
+
[0, 0],
|
|
16
|
+
[0 + element.width, 0],
|
|
17
|
+
[0 + element.width, element.height],
|
|
18
|
+
[0, element.height],
|
|
19
|
+
];
|
|
20
|
+
};
|
|
21
|
+
/** @returns vertices relative to element's top-left [0,0] position */
|
|
22
|
+
const getElementRelativePoints = (element) => {
|
|
23
|
+
if (isLinearElement(element) || isFreeDrawElement(element)) {
|
|
24
|
+
return element.points;
|
|
25
|
+
}
|
|
26
|
+
return getNonLinearElementRelativePoints(element);
|
|
27
|
+
};
|
|
28
|
+
const getMinMaxPoints = (points) => {
|
|
29
|
+
const ret = points.reduce((limits, [x, y]) => {
|
|
30
|
+
limits.minY = Math.min(limits.minY, y);
|
|
31
|
+
limits.minX = Math.min(limits.minX, x);
|
|
32
|
+
limits.maxX = Math.max(limits.maxX, x);
|
|
33
|
+
limits.maxY = Math.max(limits.maxY, y);
|
|
34
|
+
return limits;
|
|
35
|
+
}, {
|
|
36
|
+
minX: Infinity,
|
|
37
|
+
minY: Infinity,
|
|
38
|
+
maxX: -Infinity,
|
|
39
|
+
maxY: -Infinity,
|
|
40
|
+
cx: 0,
|
|
41
|
+
cy: 0,
|
|
42
|
+
});
|
|
43
|
+
ret.cx = (ret.maxX + ret.minX) / 2;
|
|
44
|
+
ret.cy = (ret.maxY + ret.minY) / 2;
|
|
45
|
+
return ret;
|
|
46
|
+
};
|
|
47
|
+
const getRotatedBBox = (element) => {
|
|
48
|
+
const points = getElementRelativePoints(element);
|
|
49
|
+
const { cx, cy } = getMinMaxPoints(points);
|
|
50
|
+
const centerPoint = [cx, cy];
|
|
51
|
+
const rotatedPoints = points.map((point) => rotatePoint([point[0], point[1]], centerPoint, element.angle));
|
|
52
|
+
const { minX, minY, maxX, maxY } = getMinMaxPoints(rotatedPoints);
|
|
53
|
+
return [
|
|
54
|
+
minX + element.x,
|
|
55
|
+
minY + element.y,
|
|
56
|
+
maxX + element.x,
|
|
57
|
+
maxY + element.y,
|
|
58
|
+
];
|
|
59
|
+
};
|
|
60
|
+
export const isElementInsideBBox = (element, bbox, eitherDirection = false) => {
|
|
61
|
+
const elementBBox = getRotatedBBox(element);
|
|
62
|
+
const elementInsideBbox = bbox[0] <= elementBBox[0] &&
|
|
63
|
+
bbox[2] >= elementBBox[2] &&
|
|
64
|
+
bbox[1] <= elementBBox[1] &&
|
|
65
|
+
bbox[3] >= elementBBox[3];
|
|
66
|
+
if (!eitherDirection) {
|
|
67
|
+
return elementInsideBbox;
|
|
68
|
+
}
|
|
69
|
+
if (elementInsideBbox) {
|
|
70
|
+
return true;
|
|
71
|
+
}
|
|
72
|
+
return (elementBBox[0] <= bbox[0] &&
|
|
73
|
+
elementBBox[2] >= bbox[2] &&
|
|
74
|
+
elementBBox[1] <= bbox[1] &&
|
|
75
|
+
elementBBox[3] >= bbox[3]);
|
|
76
|
+
};
|
|
77
|
+
export const elementPartiallyOverlapsWithOrContainsBBox = (element, bbox) => {
|
|
78
|
+
const elementBBox = getRotatedBBox(element);
|
|
79
|
+
return ((isValueInRange(elementBBox[0], bbox[0], bbox[2]) ||
|
|
80
|
+
isValueInRange(bbox[0], elementBBox[0], elementBBox[2])) &&
|
|
81
|
+
(isValueInRange(elementBBox[1], bbox[1], bbox[3]) ||
|
|
82
|
+
isValueInRange(bbox[1], elementBBox[1], elementBBox[3])));
|
|
83
|
+
};
|
|
84
|
+
export const elementsOverlappingBBox = ({ elements, bounds, type, errorMargin = 0, }) => {
|
|
85
|
+
if (isExcalidrawElement(bounds)) {
|
|
86
|
+
bounds = getElementBounds(bounds);
|
|
87
|
+
}
|
|
88
|
+
const adjustedBBox = [
|
|
89
|
+
bounds[0] - errorMargin,
|
|
90
|
+
bounds[1] - errorMargin,
|
|
91
|
+
bounds[2] + errorMargin,
|
|
92
|
+
bounds[3] + errorMargin,
|
|
93
|
+
];
|
|
94
|
+
const includedElementSet = new Set();
|
|
95
|
+
for (const element of elements) {
|
|
96
|
+
if (includedElementSet.has(element.id)) {
|
|
97
|
+
continue;
|
|
98
|
+
}
|
|
99
|
+
const isOverlaping = type === "overlap"
|
|
100
|
+
? elementPartiallyOverlapsWithOrContainsBBox(element, adjustedBBox)
|
|
101
|
+
: type === "inside"
|
|
102
|
+
? isElementInsideBBox(element, adjustedBBox)
|
|
103
|
+
: isElementInsideBBox(element, adjustedBBox, true);
|
|
104
|
+
if (isOverlaping) {
|
|
105
|
+
includedElementSet.add(element.id);
|
|
106
|
+
if (element.boundElements) {
|
|
107
|
+
for (const boundElement of element.boundElements) {
|
|
108
|
+
includedElementSet.add(boundElement.id);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
if (isTextElement(element) && element.containerId) {
|
|
112
|
+
includedElementSet.add(element.containerId);
|
|
113
|
+
}
|
|
114
|
+
if (isArrowElement(element)) {
|
|
115
|
+
if (element.startBinding) {
|
|
116
|
+
includedElementSet.add(element.startBinding.elementId);
|
|
117
|
+
}
|
|
118
|
+
if (element.endBinding) {
|
|
119
|
+
includedElementSet.add(element.endBinding?.elementId);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
return elements.filter((element) => includedElementSet.has(element.id));
|
|
125
|
+
};
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/* http://www.eaglefonts.com/fg-virgil-ttf-131249.htm */
|
|
2
|
+
@font-face {
|
|
3
|
+
font-family: "Virgil";
|
|
4
|
+
src: url("Virgil.woff2");
|
|
5
|
+
font-display: swap;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
/* https://github.com/microsoft/cascadia-code */
|
|
9
|
+
@font-face {
|
|
10
|
+
font-family: "Cascadia";
|
|
11
|
+
src: url("Cascadia.woff2");
|
|
12
|
+
font-display: swap;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
@font-face {
|
|
16
|
+
font-family: "Assistant";
|
|
17
|
+
src: url("Assistant-Regular.woff2");
|
|
18
|
+
font-display: swap;
|
|
19
|
+
font-weight: 400;
|
|
20
|
+
}
|
|
21
|
+
@font-face {
|
|
22
|
+
font-family: "Assistant";
|
|
23
|
+
src: url("Assistant-Medium.woff2");
|
|
24
|
+
font-display: swap;
|
|
25
|
+
font-weight: 500;
|
|
26
|
+
}
|
|
27
|
+
@font-face {
|
|
28
|
+
font-family: "Assistant";
|
|
29
|
+
src: url("Assistant-SemiBold.woff2");
|
|
30
|
+
font-display: swap;
|
|
31
|
+
font-weight: 600;
|
|
32
|
+
}
|
|
33
|
+
@font-face {
|
|
34
|
+
font-family: "Assistant";
|
|
35
|
+
src: url("Assistant-Bold.woff2");
|
|
36
|
+
font-display: swap;
|
|
37
|
+
font-weight: 700;
|
|
38
|
+
}
|