@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,119 @@
|
|
|
1
|
+
import { updateBoundElements } from "./binding";
|
|
2
|
+
import { getCommonBounds } from "./bounds";
|
|
3
|
+
import { mutateElement } from "./mutateElement";
|
|
4
|
+
import { getPerfectElementSize } from "./sizeHelpers";
|
|
5
|
+
import { getBoundTextElement } from "./textElement";
|
|
6
|
+
import { isSelectedViaGroup } from "../groups";
|
|
7
|
+
import { getGridPoint } from "../math";
|
|
8
|
+
import { isArrowElement, isBoundToContainer, isFrameLikeElement, } from "./typeChecks";
|
|
9
|
+
export const dragSelectedElements = (pointerDownState, selectedElements, offset, appState, scene, snapOffset, gridSize) => {
|
|
10
|
+
// we do not want a frame and its elements to be selected at the same time
|
|
11
|
+
// but when it happens (due to some bug), we want to avoid updating element
|
|
12
|
+
// in the frame twice, hence the use of set
|
|
13
|
+
const elementsToUpdate = new Set(selectedElements);
|
|
14
|
+
const frames = selectedElements
|
|
15
|
+
.filter((e) => isFrameLikeElement(e))
|
|
16
|
+
.map((f) => f.id);
|
|
17
|
+
if (frames.length > 0) {
|
|
18
|
+
const elementsInFrames = scene
|
|
19
|
+
.getNonDeletedElements()
|
|
20
|
+
.filter((e) => !isBoundToContainer(e))
|
|
21
|
+
.filter((e) => e.frameId !== null)
|
|
22
|
+
.filter((e) => frames.includes(e.frameId));
|
|
23
|
+
elementsInFrames.forEach((element) => elementsToUpdate.add(element));
|
|
24
|
+
}
|
|
25
|
+
const commonBounds = getCommonBounds(Array.from(elementsToUpdate).map((el) => pointerDownState.originalElements.get(el.id) ?? el));
|
|
26
|
+
const adjustedOffset = calculateOffset(commonBounds, offset, snapOffset, gridSize);
|
|
27
|
+
elementsToUpdate.forEach((element) => {
|
|
28
|
+
updateElementCoords(pointerDownState, element, adjustedOffset);
|
|
29
|
+
// update coords of bound text only if we're dragging the container directly
|
|
30
|
+
// (we don't drag the group that it's part of)
|
|
31
|
+
if (
|
|
32
|
+
// Don't update coords of arrow label since we calculate its position during render
|
|
33
|
+
!isArrowElement(element) &&
|
|
34
|
+
// container isn't part of any group
|
|
35
|
+
// (perf optim so we don't check `isSelectedViaGroup()` in every case)
|
|
36
|
+
(!element.groupIds.length ||
|
|
37
|
+
// container is part of a group, but we're dragging the container directly
|
|
38
|
+
(appState.editingGroupId && !isSelectedViaGroup(appState, element)))) {
|
|
39
|
+
const textElement = getBoundTextElement(element);
|
|
40
|
+
if (textElement) {
|
|
41
|
+
updateElementCoords(pointerDownState, textElement, adjustedOffset);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
updateBoundElements(element, {
|
|
45
|
+
simultaneouslyUpdated: Array.from(elementsToUpdate),
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
const calculateOffset = (commonBounds, dragOffset, snapOffset, gridSize) => {
|
|
50
|
+
const [x, y] = commonBounds;
|
|
51
|
+
let nextX = x + dragOffset.x + snapOffset.x;
|
|
52
|
+
let nextY = y + dragOffset.y + snapOffset.y;
|
|
53
|
+
if (snapOffset.x === 0 || snapOffset.y === 0) {
|
|
54
|
+
const [nextGridX, nextGridY] = getGridPoint(x + dragOffset.x, y + dragOffset.y, gridSize);
|
|
55
|
+
if (snapOffset.x === 0) {
|
|
56
|
+
nextX = nextGridX;
|
|
57
|
+
}
|
|
58
|
+
if (snapOffset.y === 0) {
|
|
59
|
+
nextY = nextGridY;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return {
|
|
63
|
+
x: nextX - x,
|
|
64
|
+
y: nextY - y,
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
const updateElementCoords = (pointerDownState, element, dragOffset) => {
|
|
68
|
+
const originalElement = pointerDownState.originalElements.get(element.id) ?? element;
|
|
69
|
+
const nextX = originalElement.x + dragOffset.x;
|
|
70
|
+
const nextY = originalElement.y + dragOffset.y;
|
|
71
|
+
mutateElement(element, {
|
|
72
|
+
x: nextX,
|
|
73
|
+
y: nextY,
|
|
74
|
+
});
|
|
75
|
+
};
|
|
76
|
+
export const getDragOffsetXY = (selectedElements, x, y) => {
|
|
77
|
+
const [x1, y1] = getCommonBounds(selectedElements);
|
|
78
|
+
return [x - x1, y - y1];
|
|
79
|
+
};
|
|
80
|
+
export const dragNewElement = (draggingElement, elementType, originX, originY, x, y, width, height, shouldMaintainAspectRatio, shouldResizeFromCenter,
|
|
81
|
+
/** whether to keep given aspect ratio when `isResizeWithSidesSameLength` is
|
|
82
|
+
true */
|
|
83
|
+
widthAspectRatio, originOffset = null) => {
|
|
84
|
+
if (shouldMaintainAspectRatio && draggingElement.type !== "selection") {
|
|
85
|
+
if (widthAspectRatio) {
|
|
86
|
+
height = width / widthAspectRatio;
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
// Depending on where the cursor is at (x, y) relative to where the starting point is
|
|
90
|
+
// (originX, originY), we use ONLY width or height to control size increase.
|
|
91
|
+
// This allows the cursor to always "stick" to one of the sides of the bounding box.
|
|
92
|
+
if (Math.abs(y - originY) > Math.abs(x - originX)) {
|
|
93
|
+
({ width, height } = getPerfectElementSize(elementType, height, x < originX ? -width : width));
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
({ width, height } = getPerfectElementSize(elementType, width, y < originY ? -height : height));
|
|
97
|
+
}
|
|
98
|
+
if (height < 0) {
|
|
99
|
+
height = -height;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
let newX = x < originX ? originX - width : originX;
|
|
104
|
+
let newY = y < originY ? originY - height : originY;
|
|
105
|
+
if (shouldResizeFromCenter) {
|
|
106
|
+
width += width;
|
|
107
|
+
height += height;
|
|
108
|
+
newX = originX - width / 2;
|
|
109
|
+
newY = originY - height / 2;
|
|
110
|
+
}
|
|
111
|
+
if (width !== 0 && height !== 0) {
|
|
112
|
+
mutateElement(draggingElement, {
|
|
113
|
+
x: newX + (originOffset?.x ?? 0),
|
|
114
|
+
y: newY + (originOffset?.y ?? 0),
|
|
115
|
+
width,
|
|
116
|
+
height,
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
};
|
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
import { register } from "../actions/register";
|
|
2
|
+
import { FONT_FAMILY, VERTICAL_ALIGN } from "../constants";
|
|
3
|
+
import { t } from "../i18n";
|
|
4
|
+
import { getFontString, updateActiveTool } from "../utils";
|
|
5
|
+
import { setCursorForShape } from "../cursor";
|
|
6
|
+
import { newTextElement } from "./newElement";
|
|
7
|
+
import { getContainerElement, wrapText } from "./textElement";
|
|
8
|
+
import { isFrameLikeElement, isIframeElement, isIframeLikeElement, } from "./typeChecks";
|
|
9
|
+
const embeddedLinkCache = new Map();
|
|
10
|
+
const RE_YOUTUBE = /^(?:http(?:s)?:\/\/)?(?:www\.)?youtu(?:be\.com|\.be)\/(embed\/|watch\?v=|shorts\/|playlist\?list=|embed\/videoseries\?list=)?([a-zA-Z0-9_-]+)(?:\?t=|&t=|\?start=|&start=)?([a-zA-Z0-9_-]+)?[^\s]*$/;
|
|
11
|
+
const RE_VIMEO = /^(?:http(?:s)?:\/\/)?(?:(?:w){3}.)?(?:player\.)?vimeo\.com\/(?:video\/)?([^?\s]+)(?:\?.*)?$/;
|
|
12
|
+
const RE_FIGMA = /^https:\/\/(?:www\.)?figma\.com/;
|
|
13
|
+
const RE_GH_GIST = /^https:\/\/gist\.github\.com/;
|
|
14
|
+
const RE_GH_GIST_EMBED = /^<script[\s\S]*?\ssrc=["'](https:\/\/gist.github.com\/.*?)\.js["']/i;
|
|
15
|
+
// not anchored to start to allow <blockquote> twitter embeds
|
|
16
|
+
const RE_TWITTER = /(?:http(?:s)?:\/\/)?(?:(?:w){3}.)?twitter.com/;
|
|
17
|
+
const RE_TWITTER_EMBED = /^<blockquote[\s\S]*?\shref=["'](https:\/\/twitter.com\/[^"']*)/i;
|
|
18
|
+
const RE_VALTOWN = /^https:\/\/(?:www\.)?val.town\/(v|embed)\/[a-zA-Z_$][0-9a-zA-Z_$]+\.[a-zA-Z_$][0-9a-zA-Z_$]+/;
|
|
19
|
+
const RE_GENERIC_EMBED = /^<(?:iframe|blockquote)[\s\S]*?\s(?:src|href)=["']([^"']*)["'][\s\S]*?>$/i;
|
|
20
|
+
const RE_GIPHY = /giphy.com\/(?:clips|embed|gifs)\/[a-zA-Z0-9]*?-?([a-zA-Z0-9]+)(?:[^a-zA-Z0-9]|$)/;
|
|
21
|
+
const ALLOWED_DOMAINS = new Set([
|
|
22
|
+
"youtube.com",
|
|
23
|
+
"youtu.be",
|
|
24
|
+
"vimeo.com",
|
|
25
|
+
"player.vimeo.com",
|
|
26
|
+
"figma.com",
|
|
27
|
+
"link.excalidraw.com",
|
|
28
|
+
"gist.github.com",
|
|
29
|
+
"twitter.com",
|
|
30
|
+
"*.simplepdf.eu",
|
|
31
|
+
"stackblitz.com",
|
|
32
|
+
"val.town",
|
|
33
|
+
"giphy.com",
|
|
34
|
+
"dddice.com",
|
|
35
|
+
]);
|
|
36
|
+
export const createSrcDoc = (body) => {
|
|
37
|
+
return `<html><body>${body}</body></html>`;
|
|
38
|
+
};
|
|
39
|
+
export const getEmbedLink = (link) => {
|
|
40
|
+
if (!link) {
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
if (embeddedLinkCache.has(link)) {
|
|
44
|
+
return embeddedLinkCache.get(link);
|
|
45
|
+
}
|
|
46
|
+
const originalLink = link;
|
|
47
|
+
let type = "generic";
|
|
48
|
+
let aspectRatio = { w: 560, h: 840 };
|
|
49
|
+
const ytLink = link.match(RE_YOUTUBE);
|
|
50
|
+
if (ytLink?.[2]) {
|
|
51
|
+
const time = ytLink[3] ? `&start=${ytLink[3]}` : ``;
|
|
52
|
+
const isPortrait = link.includes("shorts");
|
|
53
|
+
type = "video";
|
|
54
|
+
switch (ytLink[1]) {
|
|
55
|
+
case "embed/":
|
|
56
|
+
case "watch?v=":
|
|
57
|
+
case "shorts/":
|
|
58
|
+
link = `https://www.youtube.com/embed/${ytLink[2]}?enablejsapi=1${time}`;
|
|
59
|
+
break;
|
|
60
|
+
case "playlist?list=":
|
|
61
|
+
case "embed/videoseries?list=":
|
|
62
|
+
link = `https://www.youtube.com/embed/videoseries?list=${ytLink[2]}&enablejsapi=1${time}`;
|
|
63
|
+
break;
|
|
64
|
+
default:
|
|
65
|
+
link = `https://www.youtube.com/embed/${ytLink[2]}?enablejsapi=1${time}`;
|
|
66
|
+
break;
|
|
67
|
+
}
|
|
68
|
+
aspectRatio = isPortrait ? { w: 315, h: 560 } : { w: 560, h: 315 };
|
|
69
|
+
embeddedLinkCache.set(originalLink, {
|
|
70
|
+
link,
|
|
71
|
+
intrinsicSize: aspectRatio,
|
|
72
|
+
type,
|
|
73
|
+
});
|
|
74
|
+
return { link, intrinsicSize: aspectRatio, type };
|
|
75
|
+
}
|
|
76
|
+
const vimeoLink = link.match(RE_VIMEO);
|
|
77
|
+
if (vimeoLink?.[1]) {
|
|
78
|
+
const target = vimeoLink?.[1];
|
|
79
|
+
const warning = !/^\d+$/.test(target)
|
|
80
|
+
? t("toast.unrecognizedLinkFormat")
|
|
81
|
+
: undefined;
|
|
82
|
+
type = "video";
|
|
83
|
+
link = `https://player.vimeo.com/video/${target}?api=1`;
|
|
84
|
+
aspectRatio = { w: 560, h: 315 };
|
|
85
|
+
//warning deliberately ommited so it is displayed only once per link
|
|
86
|
+
//same link next time will be served from cache
|
|
87
|
+
embeddedLinkCache.set(originalLink, {
|
|
88
|
+
link,
|
|
89
|
+
intrinsicSize: aspectRatio,
|
|
90
|
+
type,
|
|
91
|
+
});
|
|
92
|
+
return { link, intrinsicSize: aspectRatio, type, warning };
|
|
93
|
+
}
|
|
94
|
+
const figmaLink = link.match(RE_FIGMA);
|
|
95
|
+
if (figmaLink) {
|
|
96
|
+
type = "generic";
|
|
97
|
+
link = `https://www.figma.com/embed?embed_host=share&url=${encodeURIComponent(link)}`;
|
|
98
|
+
aspectRatio = { w: 550, h: 550 };
|
|
99
|
+
embeddedLinkCache.set(originalLink, {
|
|
100
|
+
link,
|
|
101
|
+
intrinsicSize: aspectRatio,
|
|
102
|
+
type,
|
|
103
|
+
});
|
|
104
|
+
return { link, intrinsicSize: aspectRatio, type };
|
|
105
|
+
}
|
|
106
|
+
const valLink = link.match(RE_VALTOWN);
|
|
107
|
+
if (valLink) {
|
|
108
|
+
link =
|
|
109
|
+
valLink[1] === "embed" ? valLink[0] : valLink[0].replace("/v", "/embed");
|
|
110
|
+
embeddedLinkCache.set(originalLink, {
|
|
111
|
+
link,
|
|
112
|
+
intrinsicSize: aspectRatio,
|
|
113
|
+
type,
|
|
114
|
+
});
|
|
115
|
+
return { link, intrinsicSize: aspectRatio, type };
|
|
116
|
+
}
|
|
117
|
+
if (RE_TWITTER.test(link)) {
|
|
118
|
+
let ret;
|
|
119
|
+
// assume embed code
|
|
120
|
+
if (/<blockquote/.test(link)) {
|
|
121
|
+
const srcDoc = createSrcDoc(link);
|
|
122
|
+
ret = {
|
|
123
|
+
type: "document",
|
|
124
|
+
srcdoc: () => srcDoc,
|
|
125
|
+
intrinsicSize: { w: 480, h: 480 },
|
|
126
|
+
};
|
|
127
|
+
// assume regular tweet url
|
|
128
|
+
}
|
|
129
|
+
else {
|
|
130
|
+
ret = {
|
|
131
|
+
type: "document",
|
|
132
|
+
srcdoc: (theme) => createSrcDoc(`<blockquote class="twitter-tweet" data-dnt="true" data-theme="${theme}"><a href="${link}"></a></blockquote> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>`),
|
|
133
|
+
intrinsicSize: { w: 480, h: 480 },
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
embeddedLinkCache.set(originalLink, ret);
|
|
137
|
+
return ret;
|
|
138
|
+
}
|
|
139
|
+
if (RE_GH_GIST.test(link)) {
|
|
140
|
+
let ret;
|
|
141
|
+
// assume embed code
|
|
142
|
+
if (/<script>/.test(link)) {
|
|
143
|
+
const srcDoc = createSrcDoc(link);
|
|
144
|
+
ret = {
|
|
145
|
+
type: "document",
|
|
146
|
+
srcdoc: () => srcDoc,
|
|
147
|
+
intrinsicSize: { w: 550, h: 720 },
|
|
148
|
+
};
|
|
149
|
+
// assume regular url
|
|
150
|
+
}
|
|
151
|
+
else {
|
|
152
|
+
ret = {
|
|
153
|
+
type: "document",
|
|
154
|
+
srcdoc: () => createSrcDoc(`
|
|
155
|
+
<script src="${link}.js"></script>
|
|
156
|
+
<style type="text/css">
|
|
157
|
+
* { margin: 0px; }
|
|
158
|
+
table, .gist { height: 100%; }
|
|
159
|
+
.gist .gist-file { height: calc(100vh - 2px); padding: 0px; display: grid; grid-template-rows: 1fr auto; }
|
|
160
|
+
</style>
|
|
161
|
+
`),
|
|
162
|
+
intrinsicSize: { w: 550, h: 720 },
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
embeddedLinkCache.set(link, ret);
|
|
166
|
+
return ret;
|
|
167
|
+
}
|
|
168
|
+
embeddedLinkCache.set(link, { link, intrinsicSize: aspectRatio, type });
|
|
169
|
+
return { link, intrinsicSize: aspectRatio, type };
|
|
170
|
+
};
|
|
171
|
+
export const isIframeLikeOrItsLabel = (element) => {
|
|
172
|
+
if (isIframeLikeElement(element)) {
|
|
173
|
+
return true;
|
|
174
|
+
}
|
|
175
|
+
if (element.type === "text") {
|
|
176
|
+
const container = getContainerElement(element);
|
|
177
|
+
if (container && isFrameLikeElement(container)) {
|
|
178
|
+
return true;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
return false;
|
|
182
|
+
};
|
|
183
|
+
export const createPlaceholderEmbeddableLabel = (element) => {
|
|
184
|
+
let text;
|
|
185
|
+
if (isIframeElement(element)) {
|
|
186
|
+
text = "IFrame element";
|
|
187
|
+
}
|
|
188
|
+
else {
|
|
189
|
+
text =
|
|
190
|
+
!element.link || element?.link === "" ? "Empty Web-Embed" : element.link;
|
|
191
|
+
}
|
|
192
|
+
const fontSize = Math.max(Math.min(element.width / 2, element.width / text.length), element.width / 30);
|
|
193
|
+
const fontFamily = FONT_FAMILY.Helvetica;
|
|
194
|
+
const fontString = getFontString({
|
|
195
|
+
fontSize,
|
|
196
|
+
fontFamily,
|
|
197
|
+
});
|
|
198
|
+
return newTextElement({
|
|
199
|
+
x: element.x + element.width / 2,
|
|
200
|
+
y: element.y + element.height / 2,
|
|
201
|
+
strokeColor: element.strokeColor !== "transparent" ? element.strokeColor : "black",
|
|
202
|
+
backgroundColor: "transparent",
|
|
203
|
+
fontFamily,
|
|
204
|
+
fontSize,
|
|
205
|
+
text: wrapText(text, fontString, element.width - 20),
|
|
206
|
+
textAlign: "center",
|
|
207
|
+
verticalAlign: VERTICAL_ALIGN.MIDDLE,
|
|
208
|
+
angle: element.angle ?? 0,
|
|
209
|
+
});
|
|
210
|
+
};
|
|
211
|
+
export const actionSetEmbeddableAsActiveTool = register({
|
|
212
|
+
name: "setEmbeddableAsActiveTool",
|
|
213
|
+
trackEvent: { category: "toolbar" },
|
|
214
|
+
perform: (elements, appState, _, app) => {
|
|
215
|
+
const nextActiveTool = updateActiveTool(appState, {
|
|
216
|
+
type: "embeddable",
|
|
217
|
+
});
|
|
218
|
+
setCursorForShape(app.canvas, {
|
|
219
|
+
...appState,
|
|
220
|
+
activeTool: nextActiveTool,
|
|
221
|
+
});
|
|
222
|
+
return {
|
|
223
|
+
elements,
|
|
224
|
+
appState: {
|
|
225
|
+
...appState,
|
|
226
|
+
activeTool: updateActiveTool(appState, {
|
|
227
|
+
type: "embeddable",
|
|
228
|
+
}),
|
|
229
|
+
},
|
|
230
|
+
commitToHistory: false,
|
|
231
|
+
};
|
|
232
|
+
},
|
|
233
|
+
});
|
|
234
|
+
const validateHostname = (url,
|
|
235
|
+
/** using a Set assumes it already contains normalized bare domains */
|
|
236
|
+
allowedHostnames) => {
|
|
237
|
+
try {
|
|
238
|
+
const { hostname } = new URL(url);
|
|
239
|
+
const bareDomain = hostname.replace(/^www\./, "");
|
|
240
|
+
const bareDomainWithFirstSubdomainWildcarded = bareDomain.replace(/^([^.]+)/, "*");
|
|
241
|
+
if (allowedHostnames instanceof Set) {
|
|
242
|
+
return (ALLOWED_DOMAINS.has(bareDomain) ||
|
|
243
|
+
ALLOWED_DOMAINS.has(bareDomainWithFirstSubdomainWildcarded));
|
|
244
|
+
}
|
|
245
|
+
if (bareDomain === allowedHostnames.replace(/^www\./, "")) {
|
|
246
|
+
return true;
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
catch (error) {
|
|
250
|
+
// ignore
|
|
251
|
+
}
|
|
252
|
+
return false;
|
|
253
|
+
};
|
|
254
|
+
export const extractSrc = (htmlString) => {
|
|
255
|
+
const twitterMatch = htmlString.match(RE_TWITTER_EMBED);
|
|
256
|
+
if (twitterMatch && twitterMatch.length === 2) {
|
|
257
|
+
return twitterMatch[1];
|
|
258
|
+
}
|
|
259
|
+
const gistMatch = htmlString.match(RE_GH_GIST_EMBED);
|
|
260
|
+
if (gistMatch && gistMatch.length === 2) {
|
|
261
|
+
return gistMatch[1];
|
|
262
|
+
}
|
|
263
|
+
if (RE_GIPHY.test(htmlString)) {
|
|
264
|
+
return `https://giphy.com/embed/${RE_GIPHY.exec(htmlString)[1]}`;
|
|
265
|
+
}
|
|
266
|
+
const match = htmlString.match(RE_GENERIC_EMBED);
|
|
267
|
+
if (match && match.length === 2) {
|
|
268
|
+
return match[1];
|
|
269
|
+
}
|
|
270
|
+
return htmlString;
|
|
271
|
+
};
|
|
272
|
+
export const embeddableURLValidator = (url, validateEmbeddable) => {
|
|
273
|
+
if (!url) {
|
|
274
|
+
return false;
|
|
275
|
+
}
|
|
276
|
+
if (validateEmbeddable != null) {
|
|
277
|
+
if (typeof validateEmbeddable === "function") {
|
|
278
|
+
const ret = validateEmbeddable(url);
|
|
279
|
+
// if return value is undefined, leave validation to default
|
|
280
|
+
if (typeof ret === "boolean") {
|
|
281
|
+
return ret;
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
else if (typeof validateEmbeddable === "boolean") {
|
|
285
|
+
return validateEmbeddable;
|
|
286
|
+
}
|
|
287
|
+
else if (validateEmbeddable instanceof RegExp) {
|
|
288
|
+
return validateEmbeddable.test(url);
|
|
289
|
+
}
|
|
290
|
+
else if (Array.isArray(validateEmbeddable)) {
|
|
291
|
+
for (const domain of validateEmbeddable) {
|
|
292
|
+
if (domain instanceof RegExp) {
|
|
293
|
+
if (url.match(domain)) {
|
|
294
|
+
return true;
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
else if (validateHostname(url, domain)) {
|
|
298
|
+
return true;
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
return false;
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
return validateHostname(url, ALLOWED_DOMAINS);
|
|
305
|
+
};
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
// -----------------------------------------------------------------------------
|
|
2
|
+
// ExcalidrawImageElement & related helpers
|
|
3
|
+
// -----------------------------------------------------------------------------
|
|
4
|
+
import { MIME_TYPES, SVG_NS } from "../constants";
|
|
5
|
+
import { t } from "../i18n";
|
|
6
|
+
import { isInitializedImageElement } from "./typeChecks";
|
|
7
|
+
export const loadHTMLImageElement = (dataURL) => {
|
|
8
|
+
return new Promise((resolve, reject) => {
|
|
9
|
+
const image = new Image();
|
|
10
|
+
image.onload = () => {
|
|
11
|
+
resolve(image);
|
|
12
|
+
};
|
|
13
|
+
image.onerror = (error) => {
|
|
14
|
+
reject(error);
|
|
15
|
+
};
|
|
16
|
+
image.src = dataURL;
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
/** NOTE: updates cache even if already populated with given image. Thus,
|
|
20
|
+
* you should filter out the images upstream if you want to optimize this. */
|
|
21
|
+
export const updateImageCache = async ({ fileIds, files, imageCache, }) => {
|
|
22
|
+
const updatedFiles = new Map();
|
|
23
|
+
const erroredFiles = new Map();
|
|
24
|
+
await Promise.all(fileIds.reduce((promises, fileId) => {
|
|
25
|
+
const fileData = files[fileId];
|
|
26
|
+
if (fileData && !updatedFiles.has(fileId)) {
|
|
27
|
+
updatedFiles.set(fileId, true);
|
|
28
|
+
return promises.concat((async () => {
|
|
29
|
+
try {
|
|
30
|
+
if (fileData.mimeType === MIME_TYPES.binary) {
|
|
31
|
+
throw new Error("Only images can be added to ImageCache");
|
|
32
|
+
}
|
|
33
|
+
const imagePromise = loadHTMLImageElement(fileData.dataURL);
|
|
34
|
+
const data = {
|
|
35
|
+
image: imagePromise,
|
|
36
|
+
mimeType: fileData.mimeType,
|
|
37
|
+
};
|
|
38
|
+
// store the promise immediately to indicate there's an in-progress
|
|
39
|
+
// initialization
|
|
40
|
+
imageCache.set(fileId, data);
|
|
41
|
+
const image = await imagePromise;
|
|
42
|
+
imageCache.set(fileId, { ...data, image });
|
|
43
|
+
}
|
|
44
|
+
catch (error) {
|
|
45
|
+
erroredFiles.set(fileId, true);
|
|
46
|
+
}
|
|
47
|
+
})());
|
|
48
|
+
}
|
|
49
|
+
return promises;
|
|
50
|
+
}, []));
|
|
51
|
+
return {
|
|
52
|
+
imageCache,
|
|
53
|
+
/** includes errored files because they cache was updated nonetheless */
|
|
54
|
+
updatedFiles,
|
|
55
|
+
/** files that failed when creating HTMLImageElement */
|
|
56
|
+
erroredFiles,
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
export const getInitializedImageElements = (elements) => elements.filter((element) => isInitializedImageElement(element));
|
|
60
|
+
export const isHTMLSVGElement = (node) => {
|
|
61
|
+
// lower-casing due to XML/HTML convention differences
|
|
62
|
+
// https://johnresig.com/blog/nodename-case-sensitivity
|
|
63
|
+
return node?.nodeName.toLowerCase() === "svg";
|
|
64
|
+
};
|
|
65
|
+
export const normalizeSVG = async (SVGString) => {
|
|
66
|
+
const doc = new DOMParser().parseFromString(SVGString, MIME_TYPES.svg);
|
|
67
|
+
const svg = doc.querySelector("svg");
|
|
68
|
+
const errorNode = doc.querySelector("parsererror");
|
|
69
|
+
if (errorNode || !isHTMLSVGElement(svg)) {
|
|
70
|
+
throw new Error(t("errors.invalidSVGString"));
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
if (!svg.hasAttribute("xmlns")) {
|
|
74
|
+
svg.setAttribute("xmlns", SVG_NS);
|
|
75
|
+
}
|
|
76
|
+
if (!svg.hasAttribute("width") || !svg.hasAttribute("height")) {
|
|
77
|
+
const viewBox = svg.getAttribute("viewBox");
|
|
78
|
+
let width = svg.getAttribute("width") || "50";
|
|
79
|
+
let height = svg.getAttribute("height") || "50";
|
|
80
|
+
if (viewBox) {
|
|
81
|
+
const match = viewBox.match(/\d+ +\d+ +(\d+) +(\d+)/);
|
|
82
|
+
if (match) {
|
|
83
|
+
[, width, height] = match;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
svg.setAttribute("width", width);
|
|
87
|
+
svg.setAttribute("height", height);
|
|
88
|
+
}
|
|
89
|
+
return svg.outerHTML;
|
|
90
|
+
}
|
|
91
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { isInvisiblySmallElement } from "./sizeHelpers";
|
|
2
|
+
import { isLinearElementType } from "./typeChecks";
|
|
3
|
+
export { newElement, newTextElement, updateTextElement, refreshTextDimensions, newLinearElement, newImageElement, duplicateElement, } from "./newElement";
|
|
4
|
+
export { getElementAbsoluteCoords, getElementBounds, getCommonBounds, getDiamondPoints, getArrowheadPoints, getClosestElementBounds, } from "./bounds";
|
|
5
|
+
export { OMIT_SIDES_FOR_MULTIPLE_ELEMENTS, getTransformHandlesFromCoords, getTransformHandles, } from "./transformHandles";
|
|
6
|
+
export { hitTest, isHittingElementBoundingBoxWithoutHittingElement, } from "./collision";
|
|
7
|
+
export { resizeTest, getCursorForResizingElement, getElementWithTransformHandleType, getTransformHandleTypeFromCoords, } from "./resizeTest";
|
|
8
|
+
export { transformElements, getResizeOffsetXY, getResizeArrowDirection, } from "./resizeElements";
|
|
9
|
+
export { dragSelectedElements, getDragOffsetXY, dragNewElement, } from "./dragElements";
|
|
10
|
+
export { isTextElement, isExcalidrawElement } from "./typeChecks";
|
|
11
|
+
export { textWysiwyg } from "./textWysiwyg";
|
|
12
|
+
export { redrawTextBoundingBox } from "./textElement";
|
|
13
|
+
export { getPerfectElementSize, getLockedLinearCursorAlignSize, isInvisiblySmallElement, resizePerfectLineForNWHandler, getNormalizedDimensions, } from "./sizeHelpers";
|
|
14
|
+
export { showSelectedShapeActions } from "./showSelectedShapeActions";
|
|
15
|
+
export const getSceneVersion = (elements) => elements.reduce((acc, el) => acc + el.version, 0);
|
|
16
|
+
export const getVisibleElements = (elements) => elements.filter((el) => !el.isDeleted && !isInvisiblySmallElement(el));
|
|
17
|
+
export const getNonDeletedElements = (elements) => elements.filter((element) => !element.isDeleted);
|
|
18
|
+
export const isNonDeletedElement = (element) => !element.isDeleted;
|
|
19
|
+
const _clearElements = (elements) => getNonDeletedElements(elements).map((element) => isLinearElementType(element.type)
|
|
20
|
+
? { ...element, lastCommittedPoint: null }
|
|
21
|
+
: element);
|
|
22
|
+
export const clearElementsForDatabase = (elements) => _clearElements(elements);
|
|
23
|
+
export const clearElementsForExport = (elements) => _clearElements(elements);
|
|
24
|
+
export const clearElementsForLocalStorage = (elements) => _clearElements(elements);
|