@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,222 @@
|
|
|
1
|
+
import { COLOR_PALETTE } from "./colors";
|
|
2
|
+
import { DEFAULT_ELEMENT_PROPS, DEFAULT_FONT_FAMILY, DEFAULT_FONT_SIZE, DEFAULT_TEXT_ALIGN, EXPORT_SCALES, THEME, } from "./constants";
|
|
3
|
+
import { t } from "./i18n";
|
|
4
|
+
import { getDateTime } from "./utils";
|
|
5
|
+
const defaultExportScale = EXPORT_SCALES.includes(devicePixelRatio)
|
|
6
|
+
? devicePixelRatio
|
|
7
|
+
: 1;
|
|
8
|
+
export const getDefaultAppState = () => {
|
|
9
|
+
return {
|
|
10
|
+
showWelcomeScreen: false,
|
|
11
|
+
theme: THEME.LIGHT,
|
|
12
|
+
collaborators: new Map(),
|
|
13
|
+
currentChartType: "bar",
|
|
14
|
+
currentItemBackgroundColor: DEFAULT_ELEMENT_PROPS.backgroundColor,
|
|
15
|
+
currentItemEndArrowhead: "arrow",
|
|
16
|
+
currentItemFillStyle: DEFAULT_ELEMENT_PROPS.fillStyle,
|
|
17
|
+
currentItemFontFamily: DEFAULT_FONT_FAMILY,
|
|
18
|
+
currentItemFontSize: DEFAULT_FONT_SIZE,
|
|
19
|
+
currentItemOpacity: DEFAULT_ELEMENT_PROPS.opacity,
|
|
20
|
+
currentItemRoughness: DEFAULT_ELEMENT_PROPS.roughness,
|
|
21
|
+
currentItemStartArrowhead: null,
|
|
22
|
+
currentItemStrokeColor: DEFAULT_ELEMENT_PROPS.strokeColor,
|
|
23
|
+
currentItemRoundness: "round",
|
|
24
|
+
currentItemStrokeStyle: DEFAULT_ELEMENT_PROPS.strokeStyle,
|
|
25
|
+
currentItemStrokeWidth: DEFAULT_ELEMENT_PROPS.strokeWidth,
|
|
26
|
+
currentItemTextAlign: DEFAULT_TEXT_ALIGN,
|
|
27
|
+
cursorButton: "up",
|
|
28
|
+
activeEmbeddable: null,
|
|
29
|
+
draggingElement: null,
|
|
30
|
+
editingElement: null,
|
|
31
|
+
editingGroupId: null,
|
|
32
|
+
editingLinearElement: null,
|
|
33
|
+
activeTool: {
|
|
34
|
+
type: "selection",
|
|
35
|
+
customType: null,
|
|
36
|
+
locked: DEFAULT_ELEMENT_PROPS.locked,
|
|
37
|
+
lastActiveTool: null,
|
|
38
|
+
},
|
|
39
|
+
penMode: false,
|
|
40
|
+
penDetected: false,
|
|
41
|
+
errorMessage: null,
|
|
42
|
+
exportBackground: true,
|
|
43
|
+
exportScale: defaultExportScale,
|
|
44
|
+
exportEmbedScene: false,
|
|
45
|
+
exportWithDarkMode: false,
|
|
46
|
+
fileHandle: null,
|
|
47
|
+
gridSize: null,
|
|
48
|
+
isBindingEnabled: true,
|
|
49
|
+
defaultSidebarDockedPreference: false,
|
|
50
|
+
isLoading: false,
|
|
51
|
+
isResizing: false,
|
|
52
|
+
isRotating: false,
|
|
53
|
+
lastPointerDownWith: "mouse",
|
|
54
|
+
multiElement: null,
|
|
55
|
+
name: `${t("labels.untitled")}-${getDateTime()}`,
|
|
56
|
+
contextMenu: null,
|
|
57
|
+
openMenu: null,
|
|
58
|
+
openPopup: null,
|
|
59
|
+
openSidebar: null,
|
|
60
|
+
openDialog: null,
|
|
61
|
+
pasteDialog: { shown: false, data: null },
|
|
62
|
+
previousSelectedElementIds: {},
|
|
63
|
+
resizingElement: null,
|
|
64
|
+
scrolledOutside: false,
|
|
65
|
+
scrollX: 0,
|
|
66
|
+
scrollY: 0,
|
|
67
|
+
selectedElementIds: {},
|
|
68
|
+
selectedGroupIds: {},
|
|
69
|
+
selectedElementsAreBeingDragged: false,
|
|
70
|
+
selectionElement: null,
|
|
71
|
+
shouldCacheIgnoreZoom: false,
|
|
72
|
+
showStats: false,
|
|
73
|
+
startBoundElement: null,
|
|
74
|
+
suggestedBindings: [],
|
|
75
|
+
frameRendering: { enabled: true, clip: true, name: true, outline: true },
|
|
76
|
+
frameToHighlight: null,
|
|
77
|
+
editingFrame: null,
|
|
78
|
+
elementsToHighlight: null,
|
|
79
|
+
toast: null,
|
|
80
|
+
viewBackgroundColor: COLOR_PALETTE.white,
|
|
81
|
+
zenModeEnabled: false,
|
|
82
|
+
zoom: {
|
|
83
|
+
value: 1,
|
|
84
|
+
},
|
|
85
|
+
viewModeEnabled: false,
|
|
86
|
+
pendingImageElementId: null,
|
|
87
|
+
showHyperlinkPopup: false,
|
|
88
|
+
selectedLinearElement: null,
|
|
89
|
+
snapLines: [],
|
|
90
|
+
originSnapOffset: {
|
|
91
|
+
x: 0,
|
|
92
|
+
y: 0,
|
|
93
|
+
},
|
|
94
|
+
objectsSnapModeEnabled: false,
|
|
95
|
+
userToFollow: null,
|
|
96
|
+
followedBy: new Set(),
|
|
97
|
+
};
|
|
98
|
+
};
|
|
99
|
+
/**
|
|
100
|
+
* Config containing all AppState keys. Used to determine whether given state
|
|
101
|
+
* prop should be stripped when exporting to given storage type.
|
|
102
|
+
*/
|
|
103
|
+
const APP_STATE_STORAGE_CONF = ((config) => config)({
|
|
104
|
+
showWelcomeScreen: { browser: true, export: false, server: false },
|
|
105
|
+
theme: { browser: true, export: false, server: false },
|
|
106
|
+
collaborators: { browser: false, export: false, server: false },
|
|
107
|
+
currentChartType: { browser: true, export: false, server: false },
|
|
108
|
+
currentItemBackgroundColor: { browser: true, export: false, server: false },
|
|
109
|
+
currentItemEndArrowhead: { browser: true, export: false, server: false },
|
|
110
|
+
currentItemFillStyle: { browser: true, export: false, server: false },
|
|
111
|
+
currentItemFontFamily: { browser: true, export: false, server: false },
|
|
112
|
+
currentItemFontSize: { browser: true, export: false, server: false },
|
|
113
|
+
currentItemRoundness: {
|
|
114
|
+
browser: true,
|
|
115
|
+
export: false,
|
|
116
|
+
server: false,
|
|
117
|
+
},
|
|
118
|
+
currentItemOpacity: { browser: true, export: false, server: false },
|
|
119
|
+
currentItemRoughness: { browser: true, export: false, server: false },
|
|
120
|
+
currentItemStartArrowhead: { browser: true, export: false, server: false },
|
|
121
|
+
currentItemStrokeColor: { browser: true, export: false, server: false },
|
|
122
|
+
currentItemStrokeStyle: { browser: true, export: false, server: false },
|
|
123
|
+
currentItemStrokeWidth: { browser: true, export: false, server: false },
|
|
124
|
+
currentItemTextAlign: { browser: true, export: false, server: false },
|
|
125
|
+
cursorButton: { browser: true, export: false, server: false },
|
|
126
|
+
activeEmbeddable: { browser: false, export: false, server: false },
|
|
127
|
+
draggingElement: { browser: false, export: false, server: false },
|
|
128
|
+
editingElement: { browser: false, export: false, server: false },
|
|
129
|
+
editingGroupId: { browser: true, export: false, server: false },
|
|
130
|
+
editingLinearElement: { browser: false, export: false, server: false },
|
|
131
|
+
activeTool: { browser: true, export: false, server: false },
|
|
132
|
+
penMode: { browser: true, export: false, server: false },
|
|
133
|
+
penDetected: { browser: true, export: false, server: false },
|
|
134
|
+
errorMessage: { browser: false, export: false, server: false },
|
|
135
|
+
exportBackground: { browser: true, export: false, server: false },
|
|
136
|
+
exportEmbedScene: { browser: true, export: false, server: false },
|
|
137
|
+
exportScale: { browser: true, export: false, server: false },
|
|
138
|
+
exportWithDarkMode: { browser: true, export: false, server: false },
|
|
139
|
+
fileHandle: { browser: false, export: false, server: false },
|
|
140
|
+
gridSize: { browser: true, export: true, server: true },
|
|
141
|
+
height: { browser: false, export: false, server: false },
|
|
142
|
+
isBindingEnabled: { browser: false, export: false, server: false },
|
|
143
|
+
defaultSidebarDockedPreference: {
|
|
144
|
+
browser: true,
|
|
145
|
+
export: false,
|
|
146
|
+
server: false,
|
|
147
|
+
},
|
|
148
|
+
isLoading: { browser: false, export: false, server: false },
|
|
149
|
+
isResizing: { browser: false, export: false, server: false },
|
|
150
|
+
isRotating: { browser: false, export: false, server: false },
|
|
151
|
+
lastPointerDownWith: { browser: true, export: false, server: false },
|
|
152
|
+
multiElement: { browser: false, export: false, server: false },
|
|
153
|
+
name: { browser: true, export: false, server: false },
|
|
154
|
+
offsetLeft: { browser: false, export: false, server: false },
|
|
155
|
+
offsetTop: { browser: false, export: false, server: false },
|
|
156
|
+
contextMenu: { browser: false, export: false, server: false },
|
|
157
|
+
openMenu: { browser: true, export: false, server: false },
|
|
158
|
+
openPopup: { browser: false, export: false, server: false },
|
|
159
|
+
openSidebar: { browser: true, export: false, server: false },
|
|
160
|
+
openDialog: { browser: false, export: false, server: false },
|
|
161
|
+
pasteDialog: { browser: false, export: false, server: false },
|
|
162
|
+
previousSelectedElementIds: { browser: true, export: false, server: false },
|
|
163
|
+
resizingElement: { browser: false, export: false, server: false },
|
|
164
|
+
scrolledOutside: { browser: true, export: false, server: false },
|
|
165
|
+
scrollX: { browser: true, export: false, server: false },
|
|
166
|
+
scrollY: { browser: true, export: false, server: false },
|
|
167
|
+
selectedElementIds: { browser: true, export: false, server: false },
|
|
168
|
+
selectedGroupIds: { browser: true, export: false, server: false },
|
|
169
|
+
selectedElementsAreBeingDragged: {
|
|
170
|
+
browser: false,
|
|
171
|
+
export: false,
|
|
172
|
+
server: false,
|
|
173
|
+
},
|
|
174
|
+
selectionElement: { browser: false, export: false, server: false },
|
|
175
|
+
shouldCacheIgnoreZoom: { browser: true, export: false, server: false },
|
|
176
|
+
showStats: { browser: true, export: false, server: false },
|
|
177
|
+
startBoundElement: { browser: false, export: false, server: false },
|
|
178
|
+
suggestedBindings: { browser: false, export: false, server: false },
|
|
179
|
+
frameRendering: { browser: false, export: false, server: false },
|
|
180
|
+
frameToHighlight: { browser: false, export: false, server: false },
|
|
181
|
+
editingFrame: { browser: false, export: false, server: false },
|
|
182
|
+
elementsToHighlight: { browser: false, export: false, server: false },
|
|
183
|
+
toast: { browser: false, export: false, server: false },
|
|
184
|
+
viewBackgroundColor: { browser: true, export: true, server: true },
|
|
185
|
+
width: { browser: false, export: false, server: false },
|
|
186
|
+
zenModeEnabled: { browser: true, export: false, server: false },
|
|
187
|
+
zoom: { browser: true, export: false, server: false },
|
|
188
|
+
viewModeEnabled: { browser: false, export: false, server: false },
|
|
189
|
+
pendingImageElementId: { browser: false, export: false, server: false },
|
|
190
|
+
showHyperlinkPopup: { browser: false, export: false, server: false },
|
|
191
|
+
selectedLinearElement: { browser: true, export: false, server: false },
|
|
192
|
+
snapLines: { browser: false, export: false, server: false },
|
|
193
|
+
originSnapOffset: { browser: false, export: false, server: false },
|
|
194
|
+
objectsSnapModeEnabled: { browser: true, export: false, server: false },
|
|
195
|
+
userToFollow: { browser: false, export: false, server: false },
|
|
196
|
+
followedBy: { browser: false, export: false, server: false },
|
|
197
|
+
});
|
|
198
|
+
const _clearAppStateForStorage = (appState, exportType) => {
|
|
199
|
+
const stateForExport = {};
|
|
200
|
+
for (const key of Object.keys(appState)) {
|
|
201
|
+
const propConfig = APP_STATE_STORAGE_CONF[key];
|
|
202
|
+
if (propConfig?.[exportType]) {
|
|
203
|
+
const nextValue = appState[key];
|
|
204
|
+
// https://github.com/microsoft/TypeScript/issues/31445
|
|
205
|
+
stateForExport[key] = nextValue;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
return stateForExport;
|
|
209
|
+
};
|
|
210
|
+
export const clearAppStateForLocalStorage = (appState) => {
|
|
211
|
+
return _clearAppStateForStorage(appState, "browser");
|
|
212
|
+
};
|
|
213
|
+
export const cleanAppStateForExport = (appState) => {
|
|
214
|
+
return _clearAppStateForStorage(appState, "export");
|
|
215
|
+
};
|
|
216
|
+
export const clearAppStateForDatabase = (appState) => {
|
|
217
|
+
return _clearAppStateForStorage(appState, "server");
|
|
218
|
+
};
|
|
219
|
+
export const isEraserActive = ({ activeTool, }) => activeTool.type === "eraser";
|
|
220
|
+
export const isHandToolActive = ({ activeTool, }) => {
|
|
221
|
+
return activeTool.type === "hand";
|
|
222
|
+
};
|
|
@@ -0,0 +1,365 @@
|
|
|
1
|
+
import { COLOR_PALETTE, DEFAULT_CHART_COLOR_INDEX, getAllColorsSpecificShade, } from "./colors";
|
|
2
|
+
import { DEFAULT_FONT_FAMILY, DEFAULT_FONT_SIZE, VERTICAL_ALIGN, } from "./constants";
|
|
3
|
+
import { newElement, newLinearElement, newTextElement } from "./element";
|
|
4
|
+
import { randomId } from "./random";
|
|
5
|
+
const BAR_WIDTH = 32;
|
|
6
|
+
const BAR_GAP = 12;
|
|
7
|
+
const BAR_HEIGHT = 256;
|
|
8
|
+
const GRID_OPACITY = 50;
|
|
9
|
+
export const NOT_SPREADSHEET = "NOT_SPREADSHEET";
|
|
10
|
+
export const VALID_SPREADSHEET = "VALID_SPREADSHEET";
|
|
11
|
+
/**
|
|
12
|
+
* @private exported for testing
|
|
13
|
+
*/
|
|
14
|
+
export const tryParseNumber = (s) => {
|
|
15
|
+
const match = /^([-+]?)[$€£¥₩]?([-+]?)([\d.,]+)[%]?$/.exec(s);
|
|
16
|
+
if (!match) {
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
return parseFloat(`${(match[1] || match[2]) + match[3]}`.replace(/,/g, ""));
|
|
20
|
+
};
|
|
21
|
+
const isNumericColumn = (lines, columnIndex) => lines.slice(1).every((line) => tryParseNumber(line[columnIndex]) !== null);
|
|
22
|
+
/**
|
|
23
|
+
* @private exported for testing
|
|
24
|
+
*/
|
|
25
|
+
export const tryParseCells = (cells) => {
|
|
26
|
+
const numCols = cells[0].length;
|
|
27
|
+
if (numCols > 2) {
|
|
28
|
+
return { type: NOT_SPREADSHEET, reason: "More than 2 columns" };
|
|
29
|
+
}
|
|
30
|
+
if (numCols === 1) {
|
|
31
|
+
if (!isNumericColumn(cells, 0)) {
|
|
32
|
+
return { type: NOT_SPREADSHEET, reason: "Value is not numeric" };
|
|
33
|
+
}
|
|
34
|
+
const hasHeader = tryParseNumber(cells[0][0]) === null;
|
|
35
|
+
const values = (hasHeader ? cells.slice(1) : cells).map((line) => tryParseNumber(line[0]));
|
|
36
|
+
if (values.length < 2) {
|
|
37
|
+
return { type: NOT_SPREADSHEET, reason: "Less than two rows" };
|
|
38
|
+
}
|
|
39
|
+
return {
|
|
40
|
+
type: VALID_SPREADSHEET,
|
|
41
|
+
spreadsheet: {
|
|
42
|
+
title: hasHeader ? cells[0][0] : null,
|
|
43
|
+
labels: null,
|
|
44
|
+
values: values,
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
const labelColumnNumeric = isNumericColumn(cells, 0);
|
|
49
|
+
const valueColumnNumeric = isNumericColumn(cells, 1);
|
|
50
|
+
if (!labelColumnNumeric && !valueColumnNumeric) {
|
|
51
|
+
return { type: NOT_SPREADSHEET, reason: "Value is not numeric" };
|
|
52
|
+
}
|
|
53
|
+
const [labelColumnIndex, valueColumnIndex] = valueColumnNumeric
|
|
54
|
+
? [0, 1]
|
|
55
|
+
: [1, 0];
|
|
56
|
+
const hasHeader = tryParseNumber(cells[0][valueColumnIndex]) === null;
|
|
57
|
+
const rows = hasHeader ? cells.slice(1) : cells;
|
|
58
|
+
if (rows.length < 2) {
|
|
59
|
+
return { type: NOT_SPREADSHEET, reason: "Less than 2 rows" };
|
|
60
|
+
}
|
|
61
|
+
return {
|
|
62
|
+
type: VALID_SPREADSHEET,
|
|
63
|
+
spreadsheet: {
|
|
64
|
+
title: hasHeader ? cells[0][valueColumnIndex] : null,
|
|
65
|
+
labels: rows.map((row) => row[labelColumnIndex]),
|
|
66
|
+
values: rows.map((row) => tryParseNumber(row[valueColumnIndex])),
|
|
67
|
+
},
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
const transposeCells = (cells) => {
|
|
71
|
+
const nextCells = [];
|
|
72
|
+
for (let col = 0; col < cells[0].length; col++) {
|
|
73
|
+
const nextCellRow = [];
|
|
74
|
+
for (let row = 0; row < cells.length; row++) {
|
|
75
|
+
nextCellRow.push(cells[row][col]);
|
|
76
|
+
}
|
|
77
|
+
nextCells.push(nextCellRow);
|
|
78
|
+
}
|
|
79
|
+
return nextCells;
|
|
80
|
+
};
|
|
81
|
+
export const tryParseSpreadsheet = (text) => {
|
|
82
|
+
// Copy/paste from excel, spreadsheets, tsv, csv.
|
|
83
|
+
// For now we only accept 2 columns with an optional header
|
|
84
|
+
// Check for tab separated values
|
|
85
|
+
let lines = text
|
|
86
|
+
.trim()
|
|
87
|
+
.split("\n")
|
|
88
|
+
.map((line) => line.trim().split("\t"));
|
|
89
|
+
// Check for comma separated files
|
|
90
|
+
if (lines.length && lines[0].length !== 2) {
|
|
91
|
+
lines = text
|
|
92
|
+
.trim()
|
|
93
|
+
.split("\n")
|
|
94
|
+
.map((line) => line.trim().split(","));
|
|
95
|
+
}
|
|
96
|
+
if (lines.length === 0) {
|
|
97
|
+
return { type: NOT_SPREADSHEET, reason: "No values" };
|
|
98
|
+
}
|
|
99
|
+
const numColsFirstLine = lines[0].length;
|
|
100
|
+
const isSpreadsheet = lines.every((line) => line.length === numColsFirstLine);
|
|
101
|
+
if (!isSpreadsheet) {
|
|
102
|
+
return {
|
|
103
|
+
type: NOT_SPREADSHEET,
|
|
104
|
+
reason: "All rows don't have same number of columns",
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
const result = tryParseCells(lines);
|
|
108
|
+
if (result.type !== VALID_SPREADSHEET) {
|
|
109
|
+
const transposedResults = tryParseCells(transposeCells(lines));
|
|
110
|
+
if (transposedResults.type === VALID_SPREADSHEET) {
|
|
111
|
+
return transposedResults;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
return result;
|
|
115
|
+
};
|
|
116
|
+
const bgColors = getAllColorsSpecificShade(DEFAULT_CHART_COLOR_INDEX);
|
|
117
|
+
// Put all the common properties here so when the whole chart is selected
|
|
118
|
+
// the properties dialog shows the correct selected values
|
|
119
|
+
const commonProps = {
|
|
120
|
+
fillStyle: "hachure",
|
|
121
|
+
fontFamily: DEFAULT_FONT_FAMILY,
|
|
122
|
+
fontSize: DEFAULT_FONT_SIZE,
|
|
123
|
+
opacity: 100,
|
|
124
|
+
roughness: 1,
|
|
125
|
+
strokeColor: COLOR_PALETTE.black,
|
|
126
|
+
roundness: null,
|
|
127
|
+
strokeStyle: "solid",
|
|
128
|
+
strokeWidth: 1,
|
|
129
|
+
verticalAlign: VERTICAL_ALIGN.MIDDLE,
|
|
130
|
+
locked: false,
|
|
131
|
+
};
|
|
132
|
+
const getChartDimensions = (spreadsheet) => {
|
|
133
|
+
const chartWidth = (BAR_WIDTH + BAR_GAP) * spreadsheet.values.length + BAR_GAP;
|
|
134
|
+
const chartHeight = BAR_HEIGHT + BAR_GAP * 2;
|
|
135
|
+
return { chartWidth, chartHeight };
|
|
136
|
+
};
|
|
137
|
+
const chartXLabels = (spreadsheet, x, y, groupId, backgroundColor) => {
|
|
138
|
+
return (spreadsheet.labels?.map((label, index) => {
|
|
139
|
+
return newTextElement({
|
|
140
|
+
groupIds: [groupId],
|
|
141
|
+
backgroundColor,
|
|
142
|
+
...commonProps,
|
|
143
|
+
text: label.length > 8 ? `${label.slice(0, 5)}...` : label,
|
|
144
|
+
x: x + index * (BAR_WIDTH + BAR_GAP) + BAR_GAP * 2,
|
|
145
|
+
y: y + BAR_GAP / 2,
|
|
146
|
+
width: BAR_WIDTH,
|
|
147
|
+
angle: 5.87,
|
|
148
|
+
fontSize: 16,
|
|
149
|
+
textAlign: "center",
|
|
150
|
+
verticalAlign: "top",
|
|
151
|
+
});
|
|
152
|
+
}) || []);
|
|
153
|
+
};
|
|
154
|
+
const chartYLabels = (spreadsheet, x, y, groupId, backgroundColor) => {
|
|
155
|
+
const minYLabel = newTextElement({
|
|
156
|
+
groupIds: [groupId],
|
|
157
|
+
backgroundColor,
|
|
158
|
+
...commonProps,
|
|
159
|
+
x: x - BAR_GAP,
|
|
160
|
+
y: y - BAR_GAP,
|
|
161
|
+
text: "0",
|
|
162
|
+
textAlign: "right",
|
|
163
|
+
});
|
|
164
|
+
const maxYLabel = newTextElement({
|
|
165
|
+
groupIds: [groupId],
|
|
166
|
+
backgroundColor,
|
|
167
|
+
...commonProps,
|
|
168
|
+
x: x - BAR_GAP,
|
|
169
|
+
y: y - BAR_HEIGHT - minYLabel.height / 2,
|
|
170
|
+
text: Math.max(...spreadsheet.values).toLocaleString(),
|
|
171
|
+
textAlign: "right",
|
|
172
|
+
});
|
|
173
|
+
return [minYLabel, maxYLabel];
|
|
174
|
+
};
|
|
175
|
+
const chartLines = (spreadsheet, x, y, groupId, backgroundColor) => {
|
|
176
|
+
const { chartWidth, chartHeight } = getChartDimensions(spreadsheet);
|
|
177
|
+
const xLine = newLinearElement({
|
|
178
|
+
backgroundColor,
|
|
179
|
+
groupIds: [groupId],
|
|
180
|
+
...commonProps,
|
|
181
|
+
type: "line",
|
|
182
|
+
x,
|
|
183
|
+
y,
|
|
184
|
+
startArrowhead: null,
|
|
185
|
+
endArrowhead: null,
|
|
186
|
+
width: chartWidth,
|
|
187
|
+
points: [
|
|
188
|
+
[0, 0],
|
|
189
|
+
[chartWidth, 0],
|
|
190
|
+
],
|
|
191
|
+
});
|
|
192
|
+
const yLine = newLinearElement({
|
|
193
|
+
backgroundColor,
|
|
194
|
+
groupIds: [groupId],
|
|
195
|
+
...commonProps,
|
|
196
|
+
type: "line",
|
|
197
|
+
x,
|
|
198
|
+
y,
|
|
199
|
+
startArrowhead: null,
|
|
200
|
+
endArrowhead: null,
|
|
201
|
+
height: chartHeight,
|
|
202
|
+
points: [
|
|
203
|
+
[0, 0],
|
|
204
|
+
[0, -chartHeight],
|
|
205
|
+
],
|
|
206
|
+
});
|
|
207
|
+
const maxLine = newLinearElement({
|
|
208
|
+
backgroundColor,
|
|
209
|
+
groupIds: [groupId],
|
|
210
|
+
...commonProps,
|
|
211
|
+
type: "line",
|
|
212
|
+
x,
|
|
213
|
+
y: y - BAR_HEIGHT - BAR_GAP,
|
|
214
|
+
startArrowhead: null,
|
|
215
|
+
endArrowhead: null,
|
|
216
|
+
strokeStyle: "dotted",
|
|
217
|
+
width: chartWidth,
|
|
218
|
+
opacity: GRID_OPACITY,
|
|
219
|
+
points: [
|
|
220
|
+
[0, 0],
|
|
221
|
+
[chartWidth, 0],
|
|
222
|
+
],
|
|
223
|
+
});
|
|
224
|
+
return [xLine, yLine, maxLine];
|
|
225
|
+
};
|
|
226
|
+
// For the maths behind it https://excalidraw.com/#json=6320864370884608,O_5xfD-Agh32tytHpRJx1g
|
|
227
|
+
const chartBaseElements = (spreadsheet, x, y, groupId, backgroundColor, debug) => {
|
|
228
|
+
const { chartWidth, chartHeight } = getChartDimensions(spreadsheet);
|
|
229
|
+
const title = spreadsheet.title
|
|
230
|
+
? newTextElement({
|
|
231
|
+
backgroundColor,
|
|
232
|
+
groupIds: [groupId],
|
|
233
|
+
...commonProps,
|
|
234
|
+
text: spreadsheet.title,
|
|
235
|
+
x: x + chartWidth / 2,
|
|
236
|
+
y: y - BAR_HEIGHT - BAR_GAP * 2 - DEFAULT_FONT_SIZE,
|
|
237
|
+
roundness: null,
|
|
238
|
+
textAlign: "center",
|
|
239
|
+
})
|
|
240
|
+
: null;
|
|
241
|
+
const debugRect = debug
|
|
242
|
+
? newElement({
|
|
243
|
+
backgroundColor,
|
|
244
|
+
groupIds: [groupId],
|
|
245
|
+
...commonProps,
|
|
246
|
+
type: "rectangle",
|
|
247
|
+
x,
|
|
248
|
+
y: y - chartHeight,
|
|
249
|
+
width: chartWidth,
|
|
250
|
+
height: chartHeight,
|
|
251
|
+
strokeColor: COLOR_PALETTE.black,
|
|
252
|
+
fillStyle: "solid",
|
|
253
|
+
opacity: 6,
|
|
254
|
+
})
|
|
255
|
+
: null;
|
|
256
|
+
return [
|
|
257
|
+
...(debugRect ? [debugRect] : []),
|
|
258
|
+
...(title ? [title] : []),
|
|
259
|
+
...chartXLabels(spreadsheet, x, y, groupId, backgroundColor),
|
|
260
|
+
...chartYLabels(spreadsheet, x, y, groupId, backgroundColor),
|
|
261
|
+
...chartLines(spreadsheet, x, y, groupId, backgroundColor),
|
|
262
|
+
];
|
|
263
|
+
};
|
|
264
|
+
const chartTypeBar = (spreadsheet, x, y) => {
|
|
265
|
+
const max = Math.max(...spreadsheet.values);
|
|
266
|
+
const groupId = randomId();
|
|
267
|
+
const backgroundColor = bgColors[Math.floor(Math.random() * bgColors.length)];
|
|
268
|
+
const bars = spreadsheet.values.map((value, index) => {
|
|
269
|
+
const barHeight = (value / max) * BAR_HEIGHT;
|
|
270
|
+
return newElement({
|
|
271
|
+
backgroundColor,
|
|
272
|
+
groupIds: [groupId],
|
|
273
|
+
...commonProps,
|
|
274
|
+
type: "rectangle",
|
|
275
|
+
x: x + index * (BAR_WIDTH + BAR_GAP) + BAR_GAP,
|
|
276
|
+
y: y - barHeight - BAR_GAP,
|
|
277
|
+
width: BAR_WIDTH,
|
|
278
|
+
height: barHeight,
|
|
279
|
+
});
|
|
280
|
+
});
|
|
281
|
+
return [
|
|
282
|
+
...bars,
|
|
283
|
+
...chartBaseElements(spreadsheet, x, y, groupId, backgroundColor, import.meta.env.DEV),
|
|
284
|
+
];
|
|
285
|
+
};
|
|
286
|
+
const chartTypeLine = (spreadsheet, x, y) => {
|
|
287
|
+
const max = Math.max(...spreadsheet.values);
|
|
288
|
+
const groupId = randomId();
|
|
289
|
+
const backgroundColor = bgColors[Math.floor(Math.random() * bgColors.length)];
|
|
290
|
+
let index = 0;
|
|
291
|
+
const points = [];
|
|
292
|
+
for (const value of spreadsheet.values) {
|
|
293
|
+
const cx = index * (BAR_WIDTH + BAR_GAP);
|
|
294
|
+
const cy = -(value / max) * BAR_HEIGHT;
|
|
295
|
+
points.push([cx, cy]);
|
|
296
|
+
index++;
|
|
297
|
+
}
|
|
298
|
+
const maxX = Math.max(...points.map((element) => element[0]));
|
|
299
|
+
const maxY = Math.max(...points.map((element) => element[1]));
|
|
300
|
+
const minX = Math.min(...points.map((element) => element[0]));
|
|
301
|
+
const minY = Math.min(...points.map((element) => element[1]));
|
|
302
|
+
const line = newLinearElement({
|
|
303
|
+
backgroundColor,
|
|
304
|
+
groupIds: [groupId],
|
|
305
|
+
...commonProps,
|
|
306
|
+
type: "line",
|
|
307
|
+
x: x + BAR_GAP + BAR_WIDTH / 2,
|
|
308
|
+
y: y - BAR_GAP,
|
|
309
|
+
startArrowhead: null,
|
|
310
|
+
endArrowhead: null,
|
|
311
|
+
height: maxY - minY,
|
|
312
|
+
width: maxX - minX,
|
|
313
|
+
strokeWidth: 2,
|
|
314
|
+
points: points,
|
|
315
|
+
});
|
|
316
|
+
const dots = spreadsheet.values.map((value, index) => {
|
|
317
|
+
const cx = index * (BAR_WIDTH + BAR_GAP) + BAR_GAP / 2;
|
|
318
|
+
const cy = -(value / max) * BAR_HEIGHT + BAR_GAP / 2;
|
|
319
|
+
return newElement({
|
|
320
|
+
backgroundColor,
|
|
321
|
+
groupIds: [groupId],
|
|
322
|
+
...commonProps,
|
|
323
|
+
fillStyle: "solid",
|
|
324
|
+
strokeWidth: 2,
|
|
325
|
+
type: "ellipse",
|
|
326
|
+
x: x + cx + BAR_WIDTH / 2,
|
|
327
|
+
y: y + cy - BAR_GAP * 2,
|
|
328
|
+
width: BAR_GAP,
|
|
329
|
+
height: BAR_GAP,
|
|
330
|
+
});
|
|
331
|
+
});
|
|
332
|
+
const lines = spreadsheet.values.map((value, index) => {
|
|
333
|
+
const cx = index * (BAR_WIDTH + BAR_GAP) + BAR_GAP / 2;
|
|
334
|
+
const cy = (value / max) * BAR_HEIGHT + BAR_GAP / 2 + BAR_GAP;
|
|
335
|
+
return newLinearElement({
|
|
336
|
+
backgroundColor,
|
|
337
|
+
groupIds: [groupId],
|
|
338
|
+
...commonProps,
|
|
339
|
+
type: "line",
|
|
340
|
+
x: x + cx + BAR_WIDTH / 2 + BAR_GAP / 2,
|
|
341
|
+
y: y - cy,
|
|
342
|
+
startArrowhead: null,
|
|
343
|
+
endArrowhead: null,
|
|
344
|
+
height: cy,
|
|
345
|
+
strokeStyle: "dotted",
|
|
346
|
+
opacity: GRID_OPACITY,
|
|
347
|
+
points: [
|
|
348
|
+
[0, 0],
|
|
349
|
+
[0, cy],
|
|
350
|
+
],
|
|
351
|
+
});
|
|
352
|
+
});
|
|
353
|
+
return [
|
|
354
|
+
...chartBaseElements(spreadsheet, x, y, groupId, backgroundColor, import.meta.env.DEV),
|
|
355
|
+
line,
|
|
356
|
+
...lines,
|
|
357
|
+
...dots,
|
|
358
|
+
];
|
|
359
|
+
};
|
|
360
|
+
export const renderSpreadsheet = (chartType, spreadsheet, x, y) => {
|
|
361
|
+
if (chartType === "line") {
|
|
362
|
+
return chartTypeLine(spreadsheet, x, y);
|
|
363
|
+
}
|
|
364
|
+
return chartTypeBar(spreadsheet, x, y);
|
|
365
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
function hashToInteger(id) {
|
|
2
|
+
let hash = 0;
|
|
3
|
+
if (id.length === 0) {
|
|
4
|
+
return hash;
|
|
5
|
+
}
|
|
6
|
+
for (let i = 0; i < id.length; i++) {
|
|
7
|
+
const char = id.charCodeAt(i);
|
|
8
|
+
hash = (hash << 5) - hash + char;
|
|
9
|
+
}
|
|
10
|
+
return hash;
|
|
11
|
+
}
|
|
12
|
+
export const getClientColor = (
|
|
13
|
+
/**
|
|
14
|
+
* any uniquely identifying key, such as user id or socket id
|
|
15
|
+
*/
|
|
16
|
+
id) => {
|
|
17
|
+
// to get more even distribution in case `id` is not uniformly distributed to
|
|
18
|
+
// begin with, we hash it
|
|
19
|
+
const hash = Math.abs(hashToInteger(id));
|
|
20
|
+
// we want to get a multiple of 10 number in the range of 0-360 (in other
|
|
21
|
+
// words a hue value of step size 10). There are 37 such values including 0.
|
|
22
|
+
const hue = (hash % 37) * 10;
|
|
23
|
+
const saturation = 100;
|
|
24
|
+
const lightness = 83;
|
|
25
|
+
return `hsl(${hue}, ${saturation}%, ${lightness}%)`;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* returns first char, capitalized
|
|
29
|
+
*/
|
|
30
|
+
export const getNameInitial = (name) => {
|
|
31
|
+
// first char can be a surrogate pair, hence using codePointAt
|
|
32
|
+
const firstCodePoint = name?.trim()?.codePointAt(0);
|
|
33
|
+
return (firstCodePoint ? String.fromCodePoint(firstCodePoint) : "?").toUpperCase();
|
|
34
|
+
};
|