@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,118 @@
|
|
|
1
|
+
@import "../css/variables.module.scss";
|
|
2
|
+
|
|
3
|
+
.excalidraw {
|
|
4
|
+
--Switch-disabled-color: var(--color-border-outline);
|
|
5
|
+
--Switch-disabled-toggled-background: var(--color-border-outline-variant);
|
|
6
|
+
--Switch-disabled-border: var(--color-border-outline-variant);
|
|
7
|
+
--Switch-track-background: var(--island-bg-color);
|
|
8
|
+
--Switch-thumb-background: var(--color-on-surface);
|
|
9
|
+
--Switch-hover-background: var(--color-brand-hover);
|
|
10
|
+
--Switch-active-background: var(--color-brand-active);
|
|
11
|
+
|
|
12
|
+
.Switch {
|
|
13
|
+
position: relative;
|
|
14
|
+
box-sizing: border-box;
|
|
15
|
+
|
|
16
|
+
width: 40px;
|
|
17
|
+
height: 20px;
|
|
18
|
+
border-radius: 12px;
|
|
19
|
+
|
|
20
|
+
transition-property: background, border;
|
|
21
|
+
transition-duration: 150ms;
|
|
22
|
+
transition-timing-function: ease-out;
|
|
23
|
+
|
|
24
|
+
background: var(--Switch-track-background);
|
|
25
|
+
border: 1px solid var(--Switch-disabled-color);
|
|
26
|
+
|
|
27
|
+
&:hover {
|
|
28
|
+
background: var(--Switch-track-background);
|
|
29
|
+
border: 1px solid var(--Switch-hover-background);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
&:active {
|
|
33
|
+
border: 1px solid var(--Switch-active-background);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
&.toggled {
|
|
37
|
+
background: var(--color-primary);
|
|
38
|
+
border: 1px solid var(--color-primary);
|
|
39
|
+
|
|
40
|
+
&:hover {
|
|
41
|
+
background: var(--color-primary-darker);
|
|
42
|
+
border: 1px solid var(--color-primary-darker);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
&.disabled {
|
|
47
|
+
background: var(--Switch-track-background);
|
|
48
|
+
border: 1px solid var(--Switch-disabled-border);
|
|
49
|
+
|
|
50
|
+
&.toggled {
|
|
51
|
+
background: var(--Switch-disabled-toggled-background);
|
|
52
|
+
border: 1px solid var(--Switch-disabled-toggled-background);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
&:before {
|
|
57
|
+
content: "";
|
|
58
|
+
box-sizing: border-box;
|
|
59
|
+
display: block;
|
|
60
|
+
pointer-events: none;
|
|
61
|
+
position: absolute;
|
|
62
|
+
|
|
63
|
+
border-radius: 100%;
|
|
64
|
+
transition: all 150ms ease-out;
|
|
65
|
+
|
|
66
|
+
width: 10px;
|
|
67
|
+
height: 10px;
|
|
68
|
+
top: 4px;
|
|
69
|
+
left: 4px;
|
|
70
|
+
|
|
71
|
+
background: var(--Switch-thumb-background);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
&:active:before {
|
|
75
|
+
width: 12px;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
&.toggled:before {
|
|
79
|
+
width: 14px;
|
|
80
|
+
height: 14px;
|
|
81
|
+
left: 22px;
|
|
82
|
+
top: 2px;
|
|
83
|
+
|
|
84
|
+
background: var(--Switch-track-background);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
&.toggled:active:before {
|
|
88
|
+
width: 16px;
|
|
89
|
+
left: 20px;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
&.disabled:before {
|
|
93
|
+
background: var(--Switch-disabled-color);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
&.disabled.toggled:before {
|
|
97
|
+
background: var(--Switch-disabled-color);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
& input {
|
|
101
|
+
width: 100%;
|
|
102
|
+
height: 100%;
|
|
103
|
+
margin: 0;
|
|
104
|
+
|
|
105
|
+
border-radius: 12px;
|
|
106
|
+
|
|
107
|
+
-webkit-appearance: none;
|
|
108
|
+
-moz-appearance: none;
|
|
109
|
+
appearance: none;
|
|
110
|
+
|
|
111
|
+
cursor: pointer;
|
|
112
|
+
|
|
113
|
+
&:disabled {
|
|
114
|
+
cursor: unset;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useState, useRef, useEffect, useDeferredValue } from "react";
|
|
3
|
+
import { useApp } from "../App";
|
|
4
|
+
import { ArrowRightIcon } from "../icons";
|
|
5
|
+
import "./MermaidToExcalidraw.scss";
|
|
6
|
+
import { t } from "../../i18n";
|
|
7
|
+
import Trans from "../Trans";
|
|
8
|
+
import { convertMermaidToExcalidraw, insertToEditor, saveMermaidDataToStorage, } from "./common";
|
|
9
|
+
import { TTDDialogPanels } from "./TTDDialogPanels";
|
|
10
|
+
import { TTDDialogPanel } from "./TTDDialogPanel";
|
|
11
|
+
import { TTDDialogInput } from "./TTDDialogInput";
|
|
12
|
+
import { TTDDialogOutput } from "./TTDDialogOutput";
|
|
13
|
+
import { EditorLocalStorage } from "../../data/EditorLocalStorage";
|
|
14
|
+
import { EDITOR_LS_KEYS } from "../../constants";
|
|
15
|
+
import { debounce } from "../../utils";
|
|
16
|
+
import { TTDDialogSubmitShortcut } from "./TTDDialogSubmitShortcut";
|
|
17
|
+
const MERMAID_EXAMPLE = "flowchart TD\n A[Christmas] -->|Get money| B(Go shopping)\n B --> C{Let me think}\n C -->|One| D[Laptop]\n C -->|Two| E[iPhone]\n C -->|Three| F[Car]";
|
|
18
|
+
const debouncedSaveMermaidDefinition = debounce(saveMermaidDataToStorage, 300);
|
|
19
|
+
const MermaidToExcalidraw = ({ mermaidToExcalidrawLib, }) => {
|
|
20
|
+
const [text, setText] = useState(() => EditorLocalStorage.get(EDITOR_LS_KEYS.MERMAID_TO_EXCALIDRAW) ||
|
|
21
|
+
MERMAID_EXAMPLE);
|
|
22
|
+
const deferredText = useDeferredValue(text.trim());
|
|
23
|
+
const [error, setError] = useState(null);
|
|
24
|
+
const canvasRef = useRef(null);
|
|
25
|
+
const data = useRef({ elements: [], files: null });
|
|
26
|
+
const app = useApp();
|
|
27
|
+
useEffect(() => {
|
|
28
|
+
convertMermaidToExcalidraw({
|
|
29
|
+
canvasRef,
|
|
30
|
+
data,
|
|
31
|
+
mermaidToExcalidrawLib,
|
|
32
|
+
setError,
|
|
33
|
+
mermaidDefinition: deferredText,
|
|
34
|
+
}).catch(() => { });
|
|
35
|
+
debouncedSaveMermaidDefinition(deferredText);
|
|
36
|
+
}, [deferredText, mermaidToExcalidrawLib]);
|
|
37
|
+
useEffect(() => () => {
|
|
38
|
+
debouncedSaveMermaidDefinition.flush();
|
|
39
|
+
}, []);
|
|
40
|
+
const onInsertToEditor = () => {
|
|
41
|
+
insertToEditor({
|
|
42
|
+
app,
|
|
43
|
+
data,
|
|
44
|
+
text,
|
|
45
|
+
shouldSaveMermaidDataToStorage: true,
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
return (_jsxs(_Fragment, { children: [_jsx("div", { className: "ttd-dialog-desc", children: _jsx(Trans, { i18nKey: "mermaid.description", flowchartLink: (el) => (_jsx("a", { href: "https://mermaid.js.org/syntax/flowchart.html", children: el })), sequenceLink: (el) => (_jsx("a", { href: "https://mermaid.js.org/syntax/sequenceDiagram.html", children: el })), classLink: (el) => (_jsx("a", { href: "https://mermaid.js.org/syntax/classDiagram.html", children: el })) }) }), _jsxs(TTDDialogPanels, { children: [_jsx(TTDDialogPanel, { label: t("mermaid.syntax"), children: _jsx(TTDDialogInput, { input: text, placeholder: "Write Mermaid diagram defintion here...", onChange: (event) => setText(event.target.value), onKeyboardSubmit: () => {
|
|
49
|
+
onInsertToEditor();
|
|
50
|
+
} }) }), _jsx(TTDDialogPanel, { label: t("mermaid.preview"), panelAction: {
|
|
51
|
+
action: () => {
|
|
52
|
+
onInsertToEditor();
|
|
53
|
+
},
|
|
54
|
+
label: t("mermaid.button"),
|
|
55
|
+
icon: ArrowRightIcon,
|
|
56
|
+
}, renderSubmitShortcut: () => _jsx(TTDDialogSubmitShortcut, {}), children: _jsx(TTDDialogOutput, { canvasRef: canvasRef, loaded: mermaidToExcalidrawLib.loaded, error: error }) })] })] }));
|
|
57
|
+
};
|
|
58
|
+
export default MermaidToExcalidraw;
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Dialog } from "../Dialog";
|
|
3
|
+
import { useApp, useExcalidrawSetAppState } from "../App";
|
|
4
|
+
import MermaidToExcalidraw from "./MermaidToExcalidraw";
|
|
5
|
+
import TTDDialogTabs from "./TTDDialogTabs";
|
|
6
|
+
import { useEffect, useRef, useState } from "react";
|
|
7
|
+
import { useUIAppState } from "../../context/ui-appState";
|
|
8
|
+
import { withInternalFallback } from "../hoc/withInternalFallback";
|
|
9
|
+
import { TTDDialogTabTriggers } from "./TTDDialogTabTriggers";
|
|
10
|
+
import { TTDDialogTabTrigger } from "./TTDDialogTabTrigger";
|
|
11
|
+
import { TTDDialogTab } from "./TTDDialogTab";
|
|
12
|
+
import { t } from "../../i18n";
|
|
13
|
+
import { TTDDialogInput } from "./TTDDialogInput";
|
|
14
|
+
import { TTDDialogOutput } from "./TTDDialogOutput";
|
|
15
|
+
import { TTDDialogPanel } from "./TTDDialogPanel";
|
|
16
|
+
import { TTDDialogPanels } from "./TTDDialogPanels";
|
|
17
|
+
import { convertMermaidToExcalidraw, insertToEditor, saveMermaidDataToStorage, } from "./common";
|
|
18
|
+
import { ArrowRightIcon } from "../icons";
|
|
19
|
+
import "./TTDDialog.scss";
|
|
20
|
+
import { isFiniteNumber } from "../../utils";
|
|
21
|
+
import { atom, useAtom } from "jotai";
|
|
22
|
+
import { trackEvent } from "../../analytics";
|
|
23
|
+
import { InlineIcon } from "../InlineIcon";
|
|
24
|
+
import { TTDDialogSubmitShortcut } from "./TTDDialogSubmitShortcut";
|
|
25
|
+
const MIN_PROMPT_LENGTH = 3;
|
|
26
|
+
const MAX_PROMPT_LENGTH = 1000;
|
|
27
|
+
const rateLimitsAtom = atom(null);
|
|
28
|
+
const ttdGenerationAtom = atom(null);
|
|
29
|
+
export const TTDDialog = (props) => {
|
|
30
|
+
const appState = useUIAppState();
|
|
31
|
+
if (appState.openDialog?.name !== "ttd") {
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
34
|
+
return _jsx(TTDDialogBase, { ...props, tab: appState.openDialog.tab });
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Text to diagram (TTD) dialog
|
|
38
|
+
*/
|
|
39
|
+
export const TTDDialogBase = withInternalFallback("TTDDialogBase", ({ tab, ...rest }) => {
|
|
40
|
+
const app = useApp();
|
|
41
|
+
const setAppState = useExcalidrawSetAppState();
|
|
42
|
+
const someRandomDivRef = useRef(null);
|
|
43
|
+
const [ttdGeneration, setTtdGeneration] = useAtom(ttdGenerationAtom);
|
|
44
|
+
const [text, setText] = useState(ttdGeneration?.prompt ?? "");
|
|
45
|
+
const prompt = text.trim();
|
|
46
|
+
const handleTextChange = (event) => {
|
|
47
|
+
setText(event.target.value);
|
|
48
|
+
setTtdGeneration((s) => ({
|
|
49
|
+
generatedResponse: s?.generatedResponse ?? null,
|
|
50
|
+
prompt: event.target.value,
|
|
51
|
+
}));
|
|
52
|
+
};
|
|
53
|
+
const [onTextSubmitInProgess, setOnTextSubmitInProgess] = useState(false);
|
|
54
|
+
const [rateLimits, setRateLimits] = useAtom(rateLimitsAtom);
|
|
55
|
+
const onGenerate = async () => {
|
|
56
|
+
if (prompt.length > MAX_PROMPT_LENGTH ||
|
|
57
|
+
prompt.length < MIN_PROMPT_LENGTH ||
|
|
58
|
+
onTextSubmitInProgess ||
|
|
59
|
+
rateLimits?.rateLimitRemaining === 0 ||
|
|
60
|
+
// means this is not a text-to-diagram dialog (needed for TS only)
|
|
61
|
+
"__fallback" in rest) {
|
|
62
|
+
if (prompt.length < MIN_PROMPT_LENGTH) {
|
|
63
|
+
setError(new Error(`Prompt is too short (min ${MIN_PROMPT_LENGTH} characters)`));
|
|
64
|
+
}
|
|
65
|
+
if (prompt.length > MAX_PROMPT_LENGTH) {
|
|
66
|
+
setError(new Error(`Prompt is too long (max ${MAX_PROMPT_LENGTH} characters)`));
|
|
67
|
+
}
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
try {
|
|
71
|
+
setOnTextSubmitInProgess(true);
|
|
72
|
+
trackEvent("ai", "generate", "ttd");
|
|
73
|
+
const { generatedResponse, error, rateLimit, rateLimitRemaining } = await rest.onTextSubmit(prompt);
|
|
74
|
+
if (typeof generatedResponse === "string") {
|
|
75
|
+
setTtdGeneration((s) => ({
|
|
76
|
+
generatedResponse,
|
|
77
|
+
prompt: s?.prompt ?? null,
|
|
78
|
+
}));
|
|
79
|
+
}
|
|
80
|
+
if (isFiniteNumber(rateLimit) && isFiniteNumber(rateLimitRemaining)) {
|
|
81
|
+
setRateLimits({ rateLimit, rateLimitRemaining });
|
|
82
|
+
}
|
|
83
|
+
if (error) {
|
|
84
|
+
setError(error);
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
if (!generatedResponse) {
|
|
88
|
+
setError(new Error("Generation failed"));
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
try {
|
|
92
|
+
await convertMermaidToExcalidraw({
|
|
93
|
+
canvasRef: someRandomDivRef,
|
|
94
|
+
data,
|
|
95
|
+
mermaidToExcalidrawLib,
|
|
96
|
+
setError,
|
|
97
|
+
mermaidDefinition: generatedResponse,
|
|
98
|
+
});
|
|
99
|
+
trackEvent("ai", "mermaid parse success", "ttd");
|
|
100
|
+
}
|
|
101
|
+
catch (error) {
|
|
102
|
+
console.info(`%cTTD mermaid render errror: ${error.message}`, "color: red");
|
|
103
|
+
console.info(`>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\nTTD mermaid definition render errror: ${error.message}`, "color: yellow");
|
|
104
|
+
trackEvent("ai", "mermaid parse failed", "ttd");
|
|
105
|
+
setError(new Error("Generated an invalid diagram :(. You may also try a different prompt."));
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
catch (error) {
|
|
109
|
+
let message = error.message;
|
|
110
|
+
if (!message || message === "Failed to fetch") {
|
|
111
|
+
message = "Request failed";
|
|
112
|
+
}
|
|
113
|
+
setError(new Error(message));
|
|
114
|
+
}
|
|
115
|
+
finally {
|
|
116
|
+
setOnTextSubmitInProgess(false);
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
const refOnGenerate = useRef(onGenerate);
|
|
120
|
+
refOnGenerate.current = onGenerate;
|
|
121
|
+
const [mermaidToExcalidrawLib, setMermaidToExcalidrawLib] = useState({
|
|
122
|
+
loaded: false,
|
|
123
|
+
api: import("@excalidraw/mermaid-to-excalidraw"),
|
|
124
|
+
});
|
|
125
|
+
useEffect(() => {
|
|
126
|
+
const fn = async () => {
|
|
127
|
+
await mermaidToExcalidrawLib.api;
|
|
128
|
+
setMermaidToExcalidrawLib((prev) => ({ ...prev, loaded: true }));
|
|
129
|
+
};
|
|
130
|
+
fn();
|
|
131
|
+
}, [mermaidToExcalidrawLib.api]);
|
|
132
|
+
const data = useRef({ elements: [], files: null });
|
|
133
|
+
const [error, setError] = useState(null);
|
|
134
|
+
return (_jsx(Dialog, { className: "ttd-dialog", onCloseRequest: () => {
|
|
135
|
+
app.setOpenDialog(null);
|
|
136
|
+
}, size: 1200, title: false, ...rest, autofocus: false, children: _jsxs(TTDDialogTabs, { dialog: "ttd", tab: tab, children: ["__fallback" in rest && rest.__fallback ? (_jsx("p", { className: "dialog-mermaid-title", children: t("mermaid.title") })) : (_jsxs(TTDDialogTabTriggers, { children: [_jsx(TTDDialogTabTrigger, { tab: "text-to-diagram", children: _jsxs("div", { style: { display: "flex", alignItems: "center" }, children: [t("labels.textToDiagram"), _jsx("div", { style: {
|
|
137
|
+
display: "flex",
|
|
138
|
+
alignItems: "center",
|
|
139
|
+
justifyContent: "center",
|
|
140
|
+
padding: "1px 6px",
|
|
141
|
+
marginLeft: "10px",
|
|
142
|
+
fontSize: 10,
|
|
143
|
+
borderRadius: "12px",
|
|
144
|
+
background: "pink",
|
|
145
|
+
color: "#000",
|
|
146
|
+
}, children: "AI Beta" })] }) }), _jsx(TTDDialogTabTrigger, { tab: "mermaid", children: "Mermaid" })] })), _jsx(TTDDialogTab, { className: "ttd-dialog-content", tab: "mermaid", children: _jsx(MermaidToExcalidraw, { mermaidToExcalidrawLib: mermaidToExcalidrawLib }) }), !("__fallback" in rest) && (_jsxs(TTDDialogTab, { className: "ttd-dialog-content", tab: "text-to-diagram", children: [_jsx("div", { className: "ttd-dialog-desc", children: "Currently we use Mermaid as a middle step, so you'll get best results if you describe a diagram, workflow, flow chart, and similar." }), _jsxs(TTDDialogPanels, { children: [_jsx(TTDDialogPanel, { label: t("labels.prompt"), panelAction: {
|
|
147
|
+
action: onGenerate,
|
|
148
|
+
label: "Generate",
|
|
149
|
+
icon: ArrowRightIcon,
|
|
150
|
+
}, onTextSubmitInProgess: onTextSubmitInProgess, panelActionDisabled: prompt.length > MAX_PROMPT_LENGTH ||
|
|
151
|
+
rateLimits?.rateLimitRemaining === 0, renderTopRight: () => {
|
|
152
|
+
if (!rateLimits) {
|
|
153
|
+
return null;
|
|
154
|
+
}
|
|
155
|
+
return (_jsxs("div", { className: "ttd-dialog-rate-limit", style: {
|
|
156
|
+
fontSize: 12,
|
|
157
|
+
marginLeft: "auto",
|
|
158
|
+
color: rateLimits.rateLimitRemaining === 0
|
|
159
|
+
? "var(--color-danger)"
|
|
160
|
+
: undefined,
|
|
161
|
+
}, children: [rateLimits.rateLimitRemaining, " requests left today"] }));
|
|
162
|
+
}, renderSubmitShortcut: () => _jsx(TTDDialogSubmitShortcut, {}), renderBottomRight: () => {
|
|
163
|
+
if (typeof ttdGeneration?.generatedResponse === "string") {
|
|
164
|
+
return (_jsxs("div", { className: "excalidraw-link", style: { marginLeft: "auto", fontSize: 14 }, onClick: () => {
|
|
165
|
+
if (typeof ttdGeneration?.generatedResponse ===
|
|
166
|
+
"string") {
|
|
167
|
+
saveMermaidDataToStorage(ttdGeneration.generatedResponse);
|
|
168
|
+
setAppState({
|
|
169
|
+
openDialog: { name: "ttd", tab: "mermaid" },
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
}, children: ["View as Mermaid", _jsx(InlineIcon, { icon: ArrowRightIcon })] }));
|
|
173
|
+
}
|
|
174
|
+
const ratio = prompt.length / MAX_PROMPT_LENGTH;
|
|
175
|
+
if (ratio > 0.8) {
|
|
176
|
+
return (_jsxs("div", { style: {
|
|
177
|
+
marginLeft: "auto",
|
|
178
|
+
fontSize: 12,
|
|
179
|
+
fontFamily: "monospace",
|
|
180
|
+
color: ratio > 1 ? "var(--color-danger)" : undefined,
|
|
181
|
+
}, children: ["Length: ", prompt.length, "/", MAX_PROMPT_LENGTH] }));
|
|
182
|
+
}
|
|
183
|
+
return null;
|
|
184
|
+
}, children: _jsx(TTDDialogInput, { onChange: handleTextChange, input: text, placeholder: "Describe what you want to see...", onKeyboardSubmit: () => {
|
|
185
|
+
refOnGenerate.current();
|
|
186
|
+
} }) }), _jsx(TTDDialogPanel, { label: "Preview", panelAction: {
|
|
187
|
+
action: () => {
|
|
188
|
+
console.info("Panel action clicked");
|
|
189
|
+
insertToEditor({ app, data });
|
|
190
|
+
},
|
|
191
|
+
label: "Insert",
|
|
192
|
+
icon: ArrowRightIcon,
|
|
193
|
+
}, children: _jsx(TTDDialogOutput, { canvasRef: someRandomDivRef, error: error, loaded: mermaidToExcalidrawLib.loaded }) })] })] }))] }) }));
|
|
194
|
+
});
|
|
@@ -0,0 +1,315 @@
|
|
|
1
|
+
@import "../../css/variables.module.scss";
|
|
2
|
+
|
|
3
|
+
$verticalBreakpoint: 861px;
|
|
4
|
+
|
|
5
|
+
.excalidraw {
|
|
6
|
+
.Modal.Dialog.ttd-dialog {
|
|
7
|
+
padding: 1.25rem;
|
|
8
|
+
|
|
9
|
+
&.Dialog--fullscreen {
|
|
10
|
+
margin-top: 0;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.Island {
|
|
14
|
+
padding-inline: 0 !important;
|
|
15
|
+
height: 100%;
|
|
16
|
+
display: flex;
|
|
17
|
+
flex-direction: column;
|
|
18
|
+
flex: 1 1 auto;
|
|
19
|
+
box-shadow: none;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.Modal__content {
|
|
23
|
+
height: auto;
|
|
24
|
+
max-height: 100%;
|
|
25
|
+
|
|
26
|
+
@media screen and (min-width: $verticalBreakpoint) {
|
|
27
|
+
max-height: 750px;
|
|
28
|
+
height: 100%;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.Dialog__content {
|
|
33
|
+
flex: 1 1 auto;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.ttd-dialog-desc {
|
|
38
|
+
font-size: 15px;
|
|
39
|
+
font-style: italic;
|
|
40
|
+
font-weight: 500;
|
|
41
|
+
margin-bottom: 1.5rem;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.ttd-dialog-tabs-root {
|
|
45
|
+
width: 100%;
|
|
46
|
+
height: 100%;
|
|
47
|
+
display: flex;
|
|
48
|
+
flex-direction: column;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.ttd-dialog-tab-trigger {
|
|
52
|
+
color: var(--color-on-surface);
|
|
53
|
+
font-size: 0.875rem;
|
|
54
|
+
margin: 0;
|
|
55
|
+
padding: 0 1rem;
|
|
56
|
+
background-color: transparent;
|
|
57
|
+
border: 0;
|
|
58
|
+
height: 2.875rem;
|
|
59
|
+
font-weight: 600;
|
|
60
|
+
font-family: inherit;
|
|
61
|
+
letter-spacing: 0.4px;
|
|
62
|
+
|
|
63
|
+
&[data-state="active"] {
|
|
64
|
+
border-bottom: 2px solid var(--color-primary);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.ttd-dialog-triggers {
|
|
69
|
+
border-bottom: 1px solid var(--color-surface-high);
|
|
70
|
+
margin-bottom: 1.5rem;
|
|
71
|
+
padding-inline: 2.5rem;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.ttd-dialog-content {
|
|
75
|
+
padding-inline: 2.5rem;
|
|
76
|
+
height: 100%;
|
|
77
|
+
display: flex;
|
|
78
|
+
flex-direction: column;
|
|
79
|
+
|
|
80
|
+
&[hidden] {
|
|
81
|
+
display: none;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.ttd-dialog-input {
|
|
86
|
+
width: auto;
|
|
87
|
+
height: 10rem;
|
|
88
|
+
resize: none;
|
|
89
|
+
border-radius: var(--border-radius-lg);
|
|
90
|
+
border: 1px solid var(--dialog-border-color);
|
|
91
|
+
white-space: pre-wrap;
|
|
92
|
+
padding: 0.85rem;
|
|
93
|
+
box-sizing: border-box;
|
|
94
|
+
font-family: monospace;
|
|
95
|
+
|
|
96
|
+
@media screen and (min-width: $verticalBreakpoint) {
|
|
97
|
+
width: 100%;
|
|
98
|
+
height: 100%;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.ttd-dialog-output-wrapper {
|
|
103
|
+
display: flex;
|
|
104
|
+
align-items: center;
|
|
105
|
+
justify-content: center;
|
|
106
|
+
padding: 0.85rem;
|
|
107
|
+
box-sizing: border-box;
|
|
108
|
+
flex-grow: 1;
|
|
109
|
+
position: relative;
|
|
110
|
+
|
|
111
|
+
background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAMUlEQVQ4T2NkYGAQYcAP3uCTZhw1gGGYhAGBZIA/nYDCgBDAm9BGDWAAJyRCgLaBCAAgXwixzAS0pgAAAABJRU5ErkJggg==")
|
|
112
|
+
left center;
|
|
113
|
+
border-radius: var(--border-radius-lg);
|
|
114
|
+
border: 1px solid var(--dialog-border-color);
|
|
115
|
+
|
|
116
|
+
height: 400px;
|
|
117
|
+
width: auto;
|
|
118
|
+
|
|
119
|
+
@media screen and (min-width: $verticalBreakpoint) {
|
|
120
|
+
width: 100%;
|
|
121
|
+
// acts as min-height
|
|
122
|
+
height: 200px;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
canvas {
|
|
126
|
+
max-width: 100%;
|
|
127
|
+
max-height: 100%;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.ttd-dialog-output-canvas-container {
|
|
132
|
+
display: flex;
|
|
133
|
+
width: 100%;
|
|
134
|
+
height: 100%;
|
|
135
|
+
align-items: center;
|
|
136
|
+
justify-content: center;
|
|
137
|
+
flex-grow: 1;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.ttd-dialog-output-error {
|
|
141
|
+
color: red;
|
|
142
|
+
font-weight: 800;
|
|
143
|
+
font-size: 30px;
|
|
144
|
+
word-break: break-word;
|
|
145
|
+
overflow: auto;
|
|
146
|
+
max-height: 100%;
|
|
147
|
+
height: 100%;
|
|
148
|
+
width: 100%;
|
|
149
|
+
text-align: center;
|
|
150
|
+
position: absolute;
|
|
151
|
+
z-index: 10;
|
|
152
|
+
|
|
153
|
+
p {
|
|
154
|
+
font-weight: 500;
|
|
155
|
+
font-family: Cascadia;
|
|
156
|
+
text-align: left;
|
|
157
|
+
white-space: pre-wrap;
|
|
158
|
+
font-size: 0.875rem;
|
|
159
|
+
padding: 0 10px;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.ttd-dialog-panels {
|
|
164
|
+
height: 100%;
|
|
165
|
+
|
|
166
|
+
@media screen and (min-width: $verticalBreakpoint) {
|
|
167
|
+
display: grid;
|
|
168
|
+
grid-template-columns: 1fr 1fr;
|
|
169
|
+
gap: 4rem;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.ttd-dialog-panel {
|
|
174
|
+
display: flex;
|
|
175
|
+
flex-direction: column;
|
|
176
|
+
width: 100%;
|
|
177
|
+
|
|
178
|
+
&__header {
|
|
179
|
+
display: flex;
|
|
180
|
+
margin: 0px 4px 4px 4px;
|
|
181
|
+
align-items: center;
|
|
182
|
+
gap: 1rem;
|
|
183
|
+
|
|
184
|
+
label {
|
|
185
|
+
font-size: 14px;
|
|
186
|
+
font-style: normal;
|
|
187
|
+
font-weight: 600;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
&:first-child {
|
|
192
|
+
.ttd-dialog-panel-button-container:not(.invisible) {
|
|
193
|
+
margin-bottom: 4rem;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
@media screen and (min-width: $verticalBreakpoint) {
|
|
198
|
+
.ttd-dialog-panel-button-container:not(.invisible) {
|
|
199
|
+
margin-bottom: 0.5rem !important;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
textarea {
|
|
204
|
+
height: 100%;
|
|
205
|
+
resize: none;
|
|
206
|
+
border-radius: var(--border-radius-lg);
|
|
207
|
+
border: 1px solid var(--dialog-border-color);
|
|
208
|
+
white-space: pre-wrap;
|
|
209
|
+
padding: 0.85rem;
|
|
210
|
+
box-sizing: border-box;
|
|
211
|
+
width: 100%;
|
|
212
|
+
font-family: monospace;
|
|
213
|
+
|
|
214
|
+
@media screen and (max-width: $verticalBreakpoint) {
|
|
215
|
+
width: auto;
|
|
216
|
+
height: 10rem;
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
.ttd-dialog-panel-button-container {
|
|
222
|
+
margin-top: 1rem;
|
|
223
|
+
margin-bottom: 0.5rem;
|
|
224
|
+
|
|
225
|
+
&.invisible {
|
|
226
|
+
.ttd-dialog-panel-button {
|
|
227
|
+
display: none;
|
|
228
|
+
|
|
229
|
+
@media screen and (min-width: $verticalBreakpoint) {
|
|
230
|
+
display: block;
|
|
231
|
+
visibility: hidden;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
.ttd-dialog-panel-button {
|
|
238
|
+
&.excalidraw-button {
|
|
239
|
+
font-family: inherit;
|
|
240
|
+
font-weight: 600;
|
|
241
|
+
height: 2.5rem;
|
|
242
|
+
|
|
243
|
+
font-size: 12px;
|
|
244
|
+
color: $oc-white;
|
|
245
|
+
background-color: var(--color-primary);
|
|
246
|
+
width: 100%;
|
|
247
|
+
|
|
248
|
+
&:hover {
|
|
249
|
+
background-color: var(--color-primary-darker);
|
|
250
|
+
}
|
|
251
|
+
&:active {
|
|
252
|
+
background-color: var(--color-primary-darkest);
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
&:disabled {
|
|
256
|
+
opacity: 0.5;
|
|
257
|
+
cursor: not-allowed;
|
|
258
|
+
|
|
259
|
+
&:hover {
|
|
260
|
+
background-color: var(--color-primary);
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
@media screen and (min-width: $verticalBreakpoint) {
|
|
265
|
+
width: auto;
|
|
266
|
+
min-width: 7.5rem;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
@at-root .excalidraw.theme--dark#{&} {
|
|
270
|
+
color: var(--color-gray-100);
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
position: relative;
|
|
275
|
+
|
|
276
|
+
div {
|
|
277
|
+
display: contents;
|
|
278
|
+
|
|
279
|
+
&.invisible {
|
|
280
|
+
visibility: hidden;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
&.Spinner {
|
|
284
|
+
display: flex !important;
|
|
285
|
+
position: absolute;
|
|
286
|
+
inset: 0;
|
|
287
|
+
|
|
288
|
+
--spinner-color: white;
|
|
289
|
+
|
|
290
|
+
@at-root .excalidraw.theme--dark#{&} {
|
|
291
|
+
--spinner-color: var(--color-gray-100);
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
span {
|
|
296
|
+
padding-left: 0.5rem;
|
|
297
|
+
display: flex;
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
.ttd-dialog-submit-shortcut {
|
|
303
|
+
margin-inline-start: 0.5rem;
|
|
304
|
+
font-size: 0.625rem;
|
|
305
|
+
opacity: 0.6;
|
|
306
|
+
display: flex;
|
|
307
|
+
gap: 0.125rem;
|
|
308
|
+
|
|
309
|
+
&__key {
|
|
310
|
+
border: 1px solid gray;
|
|
311
|
+
padding: 2px 3px;
|
|
312
|
+
border-radius: 4px;
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
}
|