@excalidraw/excalidraw 0.17.1-7441-e31f307 → 0.17.1-7441-4c9a6f4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/excalidraw-assets/{chunk-PJT4QCRY.js → chunk-LZCCI7PN.js} +4 -4
- package/dist/browser/excalidraw-assets/{image-KZSI6GAB.js → image-CG4AV2NT.js} +1 -1
- package/dist/browser/excalidraw-assets/{image-2MHILQWB.css → image-EO7USLQY.css} +1 -1
- package/dist/browser/index.css +1 -1
- package/dist/browser/index.js +1 -1
- package/dist/packages/excalidraw/actions/actionAddToLibrary.js +59 -0
- package/dist/packages/excalidraw/actions/actionAlign.js +124 -0
- package/dist/packages/excalidraw/actions/actionBoundText.js +213 -0
- package/dist/packages/excalidraw/actions/actionCanvas.js +354 -0
- package/dist/packages/excalidraw/actions/actionClipboard.js +221 -0
- package/dist/packages/excalidraw/actions/actionDeleteSelected.js +129 -0
- package/dist/packages/excalidraw/actions/actionDistribute.js +56 -0
- package/dist/packages/excalidraw/actions/actionDuplicateSelection.js +181 -0
- package/dist/packages/excalidraw/actions/actionElementLock.js +89 -0
- package/dist/packages/excalidraw/actions/actionExport.js +195 -0
- package/dist/packages/excalidraw/actions/actionFinalize.js +150 -0
- package/dist/packages/excalidraw/actions/actionFlip.js +52 -0
- package/dist/packages/excalidraw/actions/actionFrame.js +113 -0
- package/dist/packages/excalidraw/actions/actionGroup.js +162 -0
- package/dist/packages/excalidraw/actions/actionHistory.js +57 -0
- package/dist/packages/excalidraw/actions/actionLinearEditor.js +41 -0
- package/dist/packages/excalidraw/actions/actionMenu.js +53 -0
- package/dist/packages/excalidraw/actions/actionNavigate.js +43 -0
- package/dist/packages/excalidraw/actions/actionProperties.js +683 -0
- package/dist/packages/excalidraw/actions/actionSelectAll.js +40 -0
- package/dist/packages/excalidraw/actions/actionStyles.js +118 -0
- package/dist/packages/excalidraw/actions/actionToggleGridMode.js +27 -0
- package/dist/packages/excalidraw/actions/actionToggleObjectsSnapMode.js +26 -0
- package/dist/packages/excalidraw/actions/actionToggleStats.js +19 -0
- package/dist/packages/excalidraw/actions/actionToggleViewMode.js +25 -0
- package/dist/packages/excalidraw/actions/actionToggleZenMode.js +25 -0
- package/dist/packages/excalidraw/actions/actionZindex.js +86 -0
- package/dist/packages/excalidraw/actions/index.js +25 -0
- package/dist/packages/excalidraw/actions/manager.js +110 -0
- package/dist/packages/excalidraw/actions/register.js +5 -0
- package/dist/packages/excalidraw/actions/shortcuts.js +52 -0
- package/dist/packages/excalidraw/align.js +36 -0
- package/dist/packages/excalidraw/analytics.js +30 -0
- package/dist/packages/excalidraw/appState.js +222 -0
- package/dist/packages/excalidraw/charts.js +365 -0
- package/dist/packages/excalidraw/clients.js +34 -0
- package/dist/packages/excalidraw/clipboard.js +351 -0
- package/dist/packages/excalidraw/colors.js +124 -0
- package/dist/packages/excalidraw/components/Actions.js +127 -0
- package/dist/packages/excalidraw/components/Actions.scss +92 -0
- package/dist/packages/excalidraw/components/ActiveConfirmDialog.js +22 -0
- package/dist/packages/excalidraw/components/App.js +6177 -0
- package/dist/packages/excalidraw/components/Avatar.js +15 -0
- package/dist/packages/excalidraw/components/Avatar.scss +7 -0
- package/dist/packages/excalidraw/components/BraveMeasureTextError.js +6 -0
- package/dist/packages/excalidraw/components/Button.js +14 -0
- package/dist/packages/excalidraw/components/Button.scss +7 -0
- package/dist/packages/excalidraw/components/ButtonIconCycle.js +11 -0
- package/dist/packages/excalidraw/components/ButtonIconSelect.js +6 -0
- package/dist/packages/excalidraw/components/ButtonSelect.js +3 -0
- package/dist/packages/excalidraw/components/Card.js +14 -0
- package/dist/packages/excalidraw/components/Card.scss +57 -0
- package/dist/packages/excalidraw/components/CheckboxItem.js +10 -0
- package/dist/packages/excalidraw/components/CheckboxItem.scss +91 -0
- package/dist/packages/excalidraw/components/ColorPicker/ColorInput.js +67 -0
- package/dist/packages/excalidraw/components/ColorPicker/ColorPicker.js +138 -0
- package/dist/packages/excalidraw/components/ColorPicker/ColorPicker.scss +441 -0
- package/dist/packages/excalidraw/components/ColorPicker/CustomColorList.js +24 -0
- package/dist/packages/excalidraw/components/ColorPicker/HotkeyLabel.js +8 -0
- package/dist/packages/excalidraw/components/ColorPicker/Picker.js +86 -0
- package/dist/packages/excalidraw/components/ColorPicker/PickerColorList.js +33 -0
- package/dist/packages/excalidraw/components/ColorPicker/PickerHeading.js +3 -0
- package/dist/packages/excalidraw/components/ColorPicker/ShadeList.js +44 -0
- package/dist/packages/excalidraw/components/ColorPicker/TopPicks.js +27 -0
- package/dist/packages/excalidraw/components/ColorPicker/colorPickerUtils.js +83 -0
- package/dist/packages/excalidraw/components/ColorPicker/keyboardNavHandlers.js +174 -0
- package/dist/packages/excalidraw/components/ConfirmDialog.js +27 -0
- package/dist/packages/excalidraw/components/ConfirmDialog.scss +11 -0
- package/dist/packages/excalidraw/components/ContextMenu.js +56 -0
- package/dist/packages/excalidraw/components/ContextMenu.scss +98 -0
- package/dist/packages/excalidraw/components/DarkModeToggle.js +16 -0
- package/dist/packages/excalidraw/components/DefaultSidebar.js +48 -0
- package/dist/packages/excalidraw/components/Dialog.js +74 -0
- package/dist/packages/excalidraw/components/Dialog.scss +48 -0
- package/dist/packages/excalidraw/components/DialogActionButton.js +9 -0
- package/dist/packages/excalidraw/components/DialogActionButton.scss +47 -0
- package/dist/packages/excalidraw/components/ErrorDialog.js +18 -0
- package/dist/packages/excalidraw/components/ExcalidrawLogo.js +7 -0
- package/dist/packages/excalidraw/components/ExcalidrawLogo.scss +73 -0
- package/dist/packages/excalidraw/components/ExportDialog.scss +129 -0
- package/dist/packages/excalidraw/components/EyeDropper.js +130 -0
- package/dist/packages/excalidraw/components/EyeDropper.scss +48 -0
- package/dist/packages/excalidraw/components/FilledButton.js +7 -0
- package/dist/packages/excalidraw/components/FilledButton.scss +191 -0
- package/dist/packages/excalidraw/components/FixedSideContainer.js +4 -0
- package/dist/packages/excalidraw/components/FixedSideContainer.scss +40 -0
- package/dist/packages/excalidraw/components/FollowMode/FollowMode.js +7 -0
- package/dist/packages/excalidraw/components/FollowMode/FollowMode.scss +59 -0
- package/dist/packages/excalidraw/components/HandButton.js +9 -0
- package/dist/packages/excalidraw/components/HelpButton.js +4 -0
- package/dist/packages/excalidraw/components/HelpDialog.js +79 -0
- package/dist/packages/excalidraw/components/HelpDialog.scss +130 -0
- package/dist/packages/excalidraw/components/HintViewer.js +97 -0
- package/dist/packages/excalidraw/components/HintViewer.scss +37 -0
- package/dist/packages/excalidraw/components/IconPicker.js +99 -0
- package/dist/packages/excalidraw/components/IconPicker.scss +143 -0
- package/dist/packages/excalidraw/components/ImageExportDialog.js +127 -0
- package/dist/packages/excalidraw/components/ImageExportDialog.scss +173 -0
- package/dist/packages/excalidraw/components/InitializeApp.js +16 -0
- package/dist/packages/excalidraw/components/InlineIcon.js +10 -0
- package/dist/packages/excalidraw/components/Island.js +5 -0
- package/dist/packages/excalidraw/components/Island.scss +16 -0
- package/dist/packages/excalidraw/components/JSONExportDialog.js +35 -0
- package/dist/packages/excalidraw/components/LaserTool/LaserPathManager.js +225 -0
- package/dist/packages/excalidraw/components/LaserTool/LaserPointerButton.js +10 -0
- package/dist/packages/excalidraw/components/LaserTool/LaserTool.js +15 -0
- package/dist/packages/excalidraw/components/LaserTool/LaserToolOverlay.scss +20 -0
- package/dist/packages/excalidraw/components/LayerUI.js +189 -0
- package/dist/packages/excalidraw/components/LayerUI.scss +112 -0
- package/dist/packages/excalidraw/components/LibraryMenu.js +99 -0
- package/dist/packages/excalidraw/components/LibraryMenu.scss +150 -0
- package/dist/packages/excalidraw/components/LibraryMenuBrowseButton.js +8 -0
- package/dist/packages/excalidraw/components/LibraryMenuControlButtons.js +6 -0
- package/dist/packages/excalidraw/components/LibraryMenuHeaderContent.js +126 -0
- package/dist/packages/excalidraw/components/LibraryMenuItems.js +138 -0
- package/dist/packages/excalidraw/components/LibraryMenuItems.scss +99 -0
- package/dist/packages/excalidraw/components/LibraryMenuSection.js +21 -0
- package/dist/packages/excalidraw/components/LibraryUnit.js +52 -0
- package/dist/packages/excalidraw/components/LibraryUnit.scss +185 -0
- package/dist/packages/excalidraw/components/LoadingMessage.js +24 -0
- package/dist/packages/excalidraw/components/LockButton.js +14 -0
- package/dist/packages/excalidraw/components/MagicButton.js +9 -0
- package/dist/packages/excalidraw/components/MagicSettings.js +46 -0
- package/dist/packages/excalidraw/components/MagicSettings.scss +18 -0
- package/dist/packages/excalidraw/components/MobileMenu.js +45 -0
- package/dist/packages/excalidraw/components/Modal.js +23 -0
- package/dist/packages/excalidraw/components/Modal.scss +121 -0
- package/dist/packages/excalidraw/components/OverwriteConfirm/OverwriteConfirm.js +31 -0
- package/dist/packages/excalidraw/components/OverwriteConfirm/OverwriteConfirm.scss +126 -0
- package/dist/packages/excalidraw/components/OverwriteConfirm/OverwriteConfirmActions.js +32 -0
- package/dist/packages/excalidraw/components/OverwriteConfirm/OverwriteConfirmState.js +19 -0
- package/dist/packages/excalidraw/components/Paragraph.js +4 -0
- package/dist/packages/excalidraw/components/PasteChartDialog.js +63 -0
- package/dist/packages/excalidraw/components/PasteChartDialog.scss +46 -0
- package/dist/packages/excalidraw/components/PenModeButton.js +13 -0
- package/dist/packages/excalidraw/components/Popover.js +111 -0
- package/dist/packages/excalidraw/components/Popover.scss +8 -0
- package/dist/packages/excalidraw/components/ProjectName.js +30 -0
- package/dist/packages/excalidraw/components/ProjectName.scss +25 -0
- package/dist/packages/excalidraw/components/PublishLibrary.js +214 -0
- package/dist/packages/excalidraw/components/PublishLibrary.scss +172 -0
- package/dist/packages/excalidraw/components/RadioGroup.js +8 -0
- package/dist/packages/excalidraw/components/RadioGroup.scss +91 -0
- package/dist/packages/excalidraw/components/Section.js +8 -0
- package/dist/packages/excalidraw/components/ShareableLinkDialog.js +33 -0
- package/dist/packages/excalidraw/components/ShareableLinkDialog.scss +91 -0
- package/dist/packages/excalidraw/components/Sidebar/Sidebar.js +145 -0
- package/dist/packages/excalidraw/components/Sidebar/Sidebar.scss +176 -0
- package/dist/packages/excalidraw/components/Sidebar/SidebarHeader.js +16 -0
- package/dist/packages/excalidraw/components/Sidebar/SidebarTab.js +6 -0
- package/dist/packages/excalidraw/components/Sidebar/SidebarTabTrigger.js +6 -0
- package/dist/packages/excalidraw/components/Sidebar/SidebarTabTriggers.js +6 -0
- package/dist/packages/excalidraw/components/Sidebar/SidebarTabs.js +17 -0
- package/dist/packages/excalidraw/components/Sidebar/SidebarTrigger.js +18 -0
- package/dist/packages/excalidraw/components/Sidebar/SidebarTrigger.scss +37 -0
- package/dist/packages/excalidraw/components/Sidebar/common.js +2 -0
- package/dist/packages/excalidraw/components/Spinner.js +14 -0
- package/dist/packages/excalidraw/components/Spinner.scss +49 -0
- package/dist/packages/excalidraw/components/Stack.js +24 -0
- package/dist/packages/excalidraw/components/Stack.scss +19 -0
- package/dist/packages/excalidraw/components/Stats.js +13 -0
- package/dist/packages/excalidraw/components/Stats.scss +54 -0
- package/dist/packages/excalidraw/components/Switch.js +10 -0
- package/dist/packages/excalidraw/components/Switch.scss +118 -0
- package/dist/packages/excalidraw/components/TTDDialog/MermaidToExcalidraw.js +58 -0
- package/dist/packages/excalidraw/components/TTDDialog/MermaidToExcalidraw.scss +10 -0
- package/dist/packages/excalidraw/components/TTDDialog/TTDDialog.js +194 -0
- package/dist/packages/excalidraw/components/TTDDialog/TTDDialog.scss +315 -0
- package/dist/packages/excalidraw/components/TTDDialog/TTDDialogInput.js +28 -0
- package/dist/packages/excalidraw/components/TTDDialog/TTDDialogOutput.js +8 -0
- package/dist/packages/excalidraw/components/TTDDialog/TTDDialogPanel.js +11 -0
- package/dist/packages/excalidraw/components/TTDDialog/TTDDialogPanels.js +4 -0
- package/dist/packages/excalidraw/components/TTDDialog/TTDDialogSubmitShortcut.js +5 -0
- package/dist/packages/excalidraw/components/TTDDialog/TTDDialogTab.js +6 -0
- package/dist/packages/excalidraw/components/TTDDialog/TTDDialogTabTrigger.js +6 -0
- package/dist/packages/excalidraw/components/TTDDialog/TTDDialogTabTriggers.js +6 -0
- package/dist/packages/excalidraw/components/TTDDialog/TTDDialogTabs.js +39 -0
- package/dist/packages/excalidraw/components/TTDDialog/TTDDialogTrigger.js +16 -0
- package/dist/packages/excalidraw/components/TTDDialog/common.js +88 -0
- package/dist/packages/excalidraw/components/TextField.js +25 -0
- package/dist/packages/excalidraw/components/TextField.scss +109 -0
- package/dist/packages/excalidraw/components/TextInput.scss +7 -0
- package/dist/packages/excalidraw/components/Toast.js +30 -0
- package/dist/packages/excalidraw/components/Toast.scss +49 -0
- package/dist/packages/excalidraw/components/ToolButton.js +72 -0
- package/dist/packages/excalidraw/components/ToolIcon.scss +184 -0
- package/dist/packages/excalidraw/components/Toolbar.scss +50 -0
- package/dist/packages/excalidraw/components/Tooltip.js +60 -0
- package/dist/packages/excalidraw/components/Tooltip.scss +47 -0
- package/dist/packages/excalidraw/components/Trans.js +139 -0
- package/dist/packages/excalidraw/components/UserList.js +96 -0
- package/dist/packages/excalidraw/components/UserList.scss +136 -0
- package/dist/packages/excalidraw/components/canvases/InteractiveCanvas.js +120 -0
- package/dist/packages/excalidraw/components/canvases/StaticCanvas.js +85 -0
- package/dist/packages/excalidraw/components/canvases/index.js +3 -0
- package/dist/packages/excalidraw/components/dropdownMenu/DropdownMenu.js +24 -0
- package/dist/packages/excalidraw/components/dropdownMenu/DropdownMenu.scss +148 -0
- package/dist/packages/excalidraw/components/dropdownMenu/DropdownMenuContent.js +21 -0
- package/dist/packages/excalidraw/components/dropdownMenu/DropdownMenuGroup.js +6 -0
- package/dist/packages/excalidraw/components/dropdownMenu/DropdownMenuItem.js +23 -0
- package/dist/packages/excalidraw/components/dropdownMenu/DropdownMenuItemContent.js +7 -0
- package/dist/packages/excalidraw/components/dropdownMenu/DropdownMenuItemCustom.js +5 -0
- package/dist/packages/excalidraw/components/dropdownMenu/DropdownMenuItemLink.js +9 -0
- package/dist/packages/excalidraw/components/dropdownMenu/DropdownMenuSeparator.js +8 -0
- package/dist/packages/excalidraw/components/dropdownMenu/DropdownMenuTrigger.js +12 -0
- package/dist/packages/excalidraw/components/dropdownMenu/common.js +20 -0
- package/dist/packages/excalidraw/components/dropdownMenu/dropdownMenuUtils.js +27 -0
- package/dist/packages/excalidraw/components/footer/Footer.js +25 -0
- package/dist/packages/excalidraw/components/footer/FooterCenter.js +14 -0
- package/dist/packages/excalidraw/components/footer/FooterCenter.scss +11 -0
- package/dist/packages/excalidraw/components/hoc/withInternalFallback.js +57 -0
- package/dist/packages/excalidraw/components/icons.js +220 -0
- package/dist/packages/excalidraw/components/live-collaboration/LiveCollaborationTrigger.js +13 -0
- package/dist/packages/excalidraw/components/live-collaboration/LiveCollaborationTrigger.scss +72 -0
- package/dist/packages/excalidraw/components/main-menu/DefaultItems.js +116 -0
- package/dist/packages/excalidraw/components/main-menu/DefaultItems.scss +21 -0
- package/dist/packages/excalidraw/components/main-menu/MainMenu.js +36 -0
- package/dist/packages/excalidraw/components/welcome-screen/WelcomeScreen.Center.js +69 -0
- package/dist/packages/excalidraw/components/welcome-screen/WelcomeScreen.Hints.js +20 -0
- package/dist/packages/excalidraw/components/welcome-screen/WelcomeScreen.js +11 -0
- package/dist/packages/excalidraw/components/welcome-screen/WelcomeScreen.scss +285 -0
- package/dist/packages/excalidraw/constants.js +312 -0
- package/dist/packages/excalidraw/context/tunnels.js +21 -0
- package/dist/packages/excalidraw/context/ui-appState.js +3 -0
- package/dist/packages/excalidraw/css/app.scss +39 -0
- package/dist/packages/excalidraw/css/styles.scss +757 -0
- package/dist/packages/excalidraw/css/theme.scss +252 -0
- package/dist/packages/excalidraw/css/variables.module.scss +174 -0
- package/dist/packages/excalidraw/cursor.js +72 -0
- package/dist/packages/excalidraw/data/EditorLocalStorage.js +42 -0
- package/dist/packages/excalidraw/data/ai/types.js +1 -0
- package/dist/packages/excalidraw/data/blob.js +378 -0
- package/dist/packages/excalidraw/data/encode.js +231 -0
- package/dist/packages/excalidraw/data/encryption.js +53 -0
- package/dist/packages/excalidraw/data/filesystem.js +65 -0
- package/dist/packages/excalidraw/data/image.js +91 -0
- package/dist/packages/excalidraw/data/index.js +120 -0
- package/dist/packages/excalidraw/data/json.js +93 -0
- package/dist/packages/excalidraw/data/library.js +376 -0
- package/dist/packages/excalidraw/data/magic.js +73 -0
- package/dist/packages/excalidraw/data/resave.js +22 -0
- package/dist/packages/excalidraw/data/restore.js +438 -0
- package/dist/packages/excalidraw/data/transform.js +442 -0
- package/dist/packages/excalidraw/data/types.js +1 -0
- package/dist/packages/excalidraw/data/url.js +30 -0
- package/dist/packages/excalidraw/distribute.js +58 -0
- package/dist/packages/excalidraw/element/ElementCanvasButtons.js +31 -0
- package/dist/packages/excalidraw/element/ElementCanvasButtons.scss +14 -0
- package/dist/packages/excalidraw/element/Hyperlink.js +350 -0
- package/dist/packages/excalidraw/element/Hyperlink.scss +70 -0
- package/dist/packages/excalidraw/element/binding.js +412 -0
- package/dist/packages/excalidraw/element/bounds.js +613 -0
- package/dist/packages/excalidraw/element/collision.js +727 -0
- package/dist/packages/excalidraw/element/dragElements.js +119 -0
- package/dist/packages/excalidraw/element/embeddable.js +305 -0
- package/dist/packages/excalidraw/element/image.js +91 -0
- package/dist/packages/excalidraw/element/index.js +24 -0
- package/dist/packages/excalidraw/element/linearElementEditor.js +867 -0
- package/dist/packages/excalidraw/element/mutateElement.js +112 -0
- package/dist/packages/excalidraw/element/newElement.js +389 -0
- package/dist/packages/excalidraw/element/resizeElements.js +597 -0
- package/dist/packages/excalidraw/element/resizeTest.js +95 -0
- package/dist/packages/excalidraw/element/showSelectedShapeActions.js +9 -0
- package/dist/packages/excalidraw/element/sizeHelpers.js +131 -0
- package/dist/packages/excalidraw/element/sortElements.js +104 -0
- package/dist/packages/excalidraw/element/textElement.js +716 -0
- package/dist/packages/excalidraw/element/textWysiwyg.js +500 -0
- package/dist/packages/excalidraw/element/transformHandles.js +155 -0
- package/dist/packages/excalidraw/element/typeChecks.js +141 -0
- package/dist/packages/excalidraw/element/types.js +1 -0
- package/dist/packages/excalidraw/emitter.js +36 -0
- package/dist/packages/excalidraw/errors.js +20 -0
- package/dist/packages/excalidraw/frame.js +373 -0
- package/dist/packages/excalidraw/ga.js +268 -0
- package/dist/packages/excalidraw/gadirections.js +18 -0
- package/dist/packages/excalidraw/galines.js +32 -0
- package/dist/packages/excalidraw/gapoints.js +30 -0
- package/dist/packages/excalidraw/gatransforms.js +23 -0
- package/dist/packages/excalidraw/gesture.js +9 -0
- package/dist/packages/excalidraw/groups.js +225 -0
- package/dist/packages/excalidraw/history.js +190 -0
- package/dist/packages/excalidraw/hooks/useCallbackRefState.js +6 -0
- package/dist/packages/excalidraw/hooks/useCreatePortalContainer.js +32 -0
- package/dist/packages/excalidraw/hooks/useLibraryItemSvg.js +62 -0
- package/dist/packages/excalidraw/hooks/useOutsideClick.js +67 -0
- package/dist/packages/excalidraw/hooks/useScrollPosition.js +23 -0
- package/dist/packages/excalidraw/hooks/useStable.js +6 -0
- package/dist/packages/excalidraw/hooks/useTransition.js +7 -0
- package/dist/packages/excalidraw/i18n.js +137 -0
- package/dist/packages/excalidraw/index-node.d.ts +1 -0
- package/dist/packages/excalidraw/index-node.js +73 -0
- package/{types → dist/packages}/excalidraw/index.d.ts +1 -1
- package/dist/packages/excalidraw/index.js +116 -0
- package/dist/packages/excalidraw/jotai.js +18 -0
- package/dist/packages/excalidraw/keys.js +84 -0
- package/dist/packages/excalidraw/locales/ar-SA.json +525 -0
- package/dist/packages/excalidraw/locales/az-AZ.json +525 -0
- package/dist/packages/excalidraw/locales/bg-BG.json +525 -0
- package/dist/packages/excalidraw/locales/bn-BD.json +525 -0
- package/dist/packages/excalidraw/locales/ca-ES.json +525 -0
- package/dist/packages/excalidraw/locales/cs-CZ.json +525 -0
- package/dist/packages/excalidraw/locales/da-DK.json +525 -0
- package/dist/packages/excalidraw/locales/de-DE.json +525 -0
- package/dist/packages/excalidraw/locales/el-GR.json +525 -0
- package/dist/packages/excalidraw/locales/en.json +535 -0
- package/dist/packages/excalidraw/locales/es-ES.json +525 -0
- package/dist/packages/excalidraw/locales/eu-ES.json +525 -0
- package/dist/packages/excalidraw/locales/fa-IR.json +525 -0
- package/dist/packages/excalidraw/locales/fi-FI.json +525 -0
- package/dist/packages/excalidraw/locales/fr-FR.json +525 -0
- package/dist/packages/excalidraw/locales/gl-ES.json +525 -0
- package/dist/packages/excalidraw/locales/he-IL.json +525 -0
- package/dist/packages/excalidraw/locales/hi-IN.json +525 -0
- package/dist/packages/excalidraw/locales/hu-HU.json +525 -0
- package/dist/packages/excalidraw/locales/id-ID.json +525 -0
- package/dist/packages/excalidraw/locales/it-IT.json +525 -0
- package/dist/packages/excalidraw/locales/ja-JP.json +525 -0
- package/dist/packages/excalidraw/locales/kaa.json +525 -0
- package/dist/packages/excalidraw/locales/kab-KAB.json +525 -0
- package/dist/packages/excalidraw/locales/kk-KZ.json +525 -0
- package/dist/packages/excalidraw/locales/km-KH.json +525 -0
- package/dist/packages/excalidraw/locales/ko-KR.json +525 -0
- package/dist/packages/excalidraw/locales/ku-TR.json +525 -0
- package/dist/packages/excalidraw/locales/lt-LT.json +525 -0
- package/dist/packages/excalidraw/locales/lv-LV.json +525 -0
- package/dist/packages/excalidraw/locales/mr-IN.json +525 -0
- package/dist/packages/excalidraw/locales/my-MM.json +525 -0
- package/dist/packages/excalidraw/locales/nb-NO.json +525 -0
- package/dist/packages/excalidraw/locales/nl-NL.json +525 -0
- package/dist/packages/excalidraw/locales/nn-NO.json +525 -0
- package/dist/packages/excalidraw/locales/oc-FR.json +525 -0
- package/dist/packages/excalidraw/locales/pa-IN.json +525 -0
- package/dist/packages/excalidraw/locales/percentages.json +56 -0
- package/dist/packages/excalidraw/locales/pl-PL.json +525 -0
- package/dist/packages/excalidraw/locales/pt-BR.json +525 -0
- package/dist/packages/excalidraw/locales/pt-PT.json +525 -0
- package/dist/packages/excalidraw/locales/ro-RO.json +525 -0
- package/dist/packages/excalidraw/locales/ru-RU.json +525 -0
- package/dist/packages/excalidraw/locales/si-LK.json +525 -0
- package/dist/packages/excalidraw/locales/sk-SK.json +525 -0
- package/dist/packages/excalidraw/locales/sl-SI.json +525 -0
- package/dist/packages/excalidraw/locales/sv-SE.json +525 -0
- package/dist/packages/excalidraw/locales/ta-IN.json +525 -0
- package/dist/packages/excalidraw/locales/th-TH.json +525 -0
- package/dist/packages/excalidraw/locales/tr-TR.json +525 -0
- package/dist/packages/excalidraw/locales/uk-UA.json +525 -0
- package/dist/packages/excalidraw/locales/vi-VN.json +525 -0
- package/dist/packages/excalidraw/locales/zh-CN.json +525 -0
- package/dist/packages/excalidraw/locales/zh-HK.json +525 -0
- package/dist/packages/excalidraw/locales/zh-TW.json +525 -0
- package/dist/packages/excalidraw/math.js +364 -0
- package/dist/packages/excalidraw/points.js +38 -0
- package/dist/packages/excalidraw/polyfill.js +32 -0
- package/dist/packages/excalidraw/random.js +11 -0
- package/dist/packages/excalidraw/renderer/renderElement.js +871 -0
- package/dist/packages/excalidraw/renderer/renderScene.js +859 -0
- package/dist/packages/excalidraw/renderer/renderSnaps.js +114 -0
- package/dist/packages/excalidraw/renderer/roundRect.js +28 -0
- package/dist/packages/excalidraw/scene/Fonts.js +71 -0
- package/dist/packages/excalidraw/scene/Renderer.js +65 -0
- package/dist/packages/excalidraw/scene/Scene.js +230 -0
- package/dist/packages/excalidraw/scene/Shape.js +322 -0
- package/dist/packages/excalidraw/scene/ShapeCache.js +42 -0
- package/dist/packages/excalidraw/scene/comparisons.js +67 -0
- package/dist/packages/excalidraw/scene/export.js +304 -0
- package/dist/packages/excalidraw/scene/index.js +5 -0
- package/dist/packages/excalidraw/scene/scroll.js +35 -0
- package/dist/packages/excalidraw/scene/scrollbars.js +85 -0
- package/dist/packages/excalidraw/scene/selection.js +134 -0
- package/dist/packages/excalidraw/scene/types.js +1 -0
- package/dist/packages/excalidraw/scene/zoom.js +22 -0
- package/dist/packages/excalidraw/shapes.js +84 -0
- package/dist/packages/excalidraw/snapping.js +838 -0
- package/dist/packages/excalidraw/types.js +6 -0
- package/dist/packages/excalidraw/utility-types.js +1 -0
- package/dist/packages/excalidraw/utils.js +668 -0
- package/dist/packages/excalidraw/zindex.js +349 -0
- package/dist/packages/utils/bbox.js +42 -0
- package/dist/packages/utils/export.js +109 -0
- package/dist/packages/utils/withinBounds.js +125 -0
- package/dist/public/fonts/Assistant-Bold.woff2 +0 -0
- package/dist/public/fonts/Assistant-Medium.woff2 +0 -0
- package/dist/public/fonts/Assistant-Regular.woff2 +0 -0
- package/dist/public/fonts/Assistant-SemiBold.woff2 +0 -0
- package/dist/public/fonts/Cascadia.ttf +0 -0
- package/dist/public/fonts/Cascadia.woff2 +0 -0
- package/dist/public/fonts/FG_Virgil.ttf +0 -0
- package/dist/public/fonts/FG_Virgil.woff2 +0 -0
- package/dist/public/fonts/Virgil.woff2 +0 -0
- package/dist/public/fonts/fonts.css +38 -0
- package/package.json +8 -6
- package/dist/index.css +0 -5796
- package/dist/index.js +0 -71305
- /package/{types → dist/packages}/excalidraw/actions/actionAddToLibrary.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/actions/actionAlign.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/actions/actionBoundText.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/actions/actionCanvas.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/actions/actionClipboard.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/actions/actionDeleteSelected.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/actions/actionDistribute.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/actions/actionDuplicateSelection.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/actions/actionElementLock.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/actions/actionExport.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/actions/actionFinalize.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/actions/actionFlip.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/actions/actionFrame.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/actions/actionGroup.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/actions/actionHistory.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/actions/actionLinearEditor.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/actions/actionMenu.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/actions/actionNavigate.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/actions/actionProperties.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/actions/actionSelectAll.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/actions/actionStyles.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/actions/actionToggleGridMode.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/actions/actionToggleStats.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/actions/actionToggleViewMode.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/actions/actionToggleZenMode.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/actions/actionZindex.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/actions/index.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/actions/manager.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/actions/register.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/actions/shortcuts.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/actions/types.d.ts +0 -0
- /package/{types/excalidraw/index-node.d.ts → dist/packages/excalidraw/actions/types.js} +0 -0
- /package/{types → dist/packages}/excalidraw/align.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/analytics.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/appState.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/charts.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/clients.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/clipboard.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/colors.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/Actions.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/ActiveConfirmDialog.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/App.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/Avatar.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/BraveMeasureTextError.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/Button.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/ButtonIconCycle.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/ButtonIconSelect.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/ButtonSelect.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/Card.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/CheckboxItem.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/ColorPicker/ColorInput.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/ColorPicker/ColorPicker.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/ColorPicker/CustomColorList.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/ColorPicker/HotkeyLabel.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/ColorPicker/Picker.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/ColorPicker/PickerColorList.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/ColorPicker/PickerHeading.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/ColorPicker/ShadeList.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/ColorPicker/TopPicks.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/ColorPicker/colorPickerUtils.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/ColorPicker/keyboardNavHandlers.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/ConfirmDialog.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/ContextMenu.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/DarkModeToggle.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/DefaultSidebar.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/Dialog.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/DialogActionButton.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/ErrorDialog.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/ExcalidrawLogo.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/EyeDropper.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/FilledButton.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/FixedSideContainer.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/FollowMode/FollowMode.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/HandButton.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/HelpButton.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/HelpDialog.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/HintViewer.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/IconPicker.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/ImageExportDialog.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/InitializeApp.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/InlineIcon.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/Island.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/JSONExportDialog.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/LaserTool/LaserPathManager.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/LaserTool/LaserPointerButton.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/LaserTool/LaserTool.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/LayerUI.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/LibraryMenu.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/LibraryMenuBrowseButton.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/LibraryMenuControlButtons.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/LibraryMenuHeaderContent.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/LibraryMenuItems.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/LibraryMenuSection.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/LibraryUnit.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/LoadingMessage.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/LockButton.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/MagicButton.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/MagicSettings.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/MobileMenu.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/Modal.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/OverwriteConfirm/OverwriteConfirm.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/OverwriteConfirm/OverwriteConfirmActions.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/OverwriteConfirm/OverwriteConfirmState.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/Paragraph.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/PasteChartDialog.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/PenModeButton.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/Popover.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/ProjectName.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/PublishLibrary.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/RadioGroup.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/Section.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/ShareableLinkDialog.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/Sidebar/Sidebar.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/Sidebar/SidebarHeader.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/Sidebar/SidebarTab.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/Sidebar/SidebarTabTrigger.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/Sidebar/SidebarTabTriggers.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/Sidebar/SidebarTabs.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/Sidebar/SidebarTrigger.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/Sidebar/common.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/Spinner.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/Stack.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/Stats.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/Switch.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/TTDDialog/MermaidToExcalidraw.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/TTDDialog/TTDDialog.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/TTDDialog/TTDDialogInput.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/TTDDialog/TTDDialogOutput.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/TTDDialog/TTDDialogPanel.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/TTDDialog/TTDDialogPanels.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/TTDDialog/TTDDialogSubmitShortcut.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/TTDDialog/TTDDialogTab.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/TTDDialog/TTDDialogTabTrigger.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/TTDDialog/TTDDialogTabTriggers.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/TTDDialog/TTDDialogTabs.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/TTDDialog/TTDDialogTrigger.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/TTDDialog/common.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/TextField.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/Toast.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/ToolButton.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/Tooltip.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/Trans.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/UserList.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/canvases/InteractiveCanvas.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/canvases/StaticCanvas.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/canvases/index.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/dropdownMenu/DropdownMenu.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/dropdownMenu/DropdownMenuContent.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/dropdownMenu/DropdownMenuGroup.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/dropdownMenu/DropdownMenuItem.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/dropdownMenu/DropdownMenuItemContent.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/dropdownMenu/DropdownMenuItemCustom.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/dropdownMenu/DropdownMenuItemLink.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/dropdownMenu/DropdownMenuSeparator.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/dropdownMenu/DropdownMenuTrigger.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/dropdownMenu/common.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/dropdownMenu/dropdownMenuUtils.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/footer/Footer.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/footer/FooterCenter.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/hoc/withInternalFallback.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/icons.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/live-collaboration/LiveCollaborationTrigger.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/main-menu/DefaultItems.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/main-menu/MainMenu.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/welcome-screen/WelcomeScreen.Center.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/welcome-screen/WelcomeScreen.Hints.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/components/welcome-screen/WelcomeScreen.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/constants.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/context/tunnels.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/context/ui-appState.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/cursor.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/data/EditorLocalStorage.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/data/ai/types.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/data/blob.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/data/encode.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/data/encryption.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/data/filesystem.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/data/image.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/data/index.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/data/json.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/data/library.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/data/magic.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/data/resave.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/data/restore.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/data/transform.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/data/types.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/data/url.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/distribute.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/element/ElementCanvasButtons.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/element/Hyperlink.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/element/binding.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/element/bounds.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/element/collision.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/element/dragElements.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/element/embeddable.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/element/image.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/element/index.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/element/linearElementEditor.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/element/mutateElement.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/element/newElement.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/element/resizeElements.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/element/resizeTest.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/element/showSelectedShapeActions.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/element/sizeHelpers.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/element/sortElements.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/element/textElement.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/element/textWysiwyg.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/element/transformHandles.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/element/typeChecks.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/element/types.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/emitter.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/errors.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/frame.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/ga.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/gadirections.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/galines.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/gapoints.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/gatransforms.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/gesture.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/groups.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/history.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/hooks/useCallbackRefState.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/hooks/useCreatePortalContainer.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/hooks/useLibraryItemSvg.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/hooks/useOutsideClick.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/hooks/useScrollPosition.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/hooks/useStable.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/hooks/useTransition.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/i18n.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/jotai.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/keys.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/math.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/points.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/polyfill.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/random.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/renderer/renderElement.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/renderer/renderScene.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/renderer/renderSnaps.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/renderer/roundRect.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/scene/Fonts.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/scene/Renderer.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/scene/Scene.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/scene/Shape.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/scene/ShapeCache.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/scene/comparisons.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/scene/export.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/scene/index.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/scene/scroll.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/scene/scrollbars.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/scene/selection.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/scene/types.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/scene/zoom.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/shapes.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/snapping.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/types.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/utility-types.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/utils.d.ts +0 -0
- /package/{types → dist/packages}/excalidraw/zindex.d.ts +0 -0
- /package/{types → dist/packages}/utils/bbox.d.ts +0 -0
- /package/{types → dist/packages}/utils/export.d.ts +0 -0
- /package/{types → dist/packages}/utils/withinBounds.d.ts +0 -0
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This is a 2D Projective Geometric Algebra implementation.
|
|
3
|
+
*
|
|
4
|
+
* For wider context on geometric algebra visit see https://bivector.net.
|
|
5
|
+
*
|
|
6
|
+
* For this specific algebra see cheatsheet https://bivector.net/2DPGA.pdf.
|
|
7
|
+
*
|
|
8
|
+
* Converted from generator written by enki, with a ton of added on top.
|
|
9
|
+
*
|
|
10
|
+
* This library uses 8-vectors to represent points, directions and lines
|
|
11
|
+
* in 2D space.
|
|
12
|
+
*
|
|
13
|
+
* An array `[a, b, c, d, e, f, g, h]` represents a n(8)vector:
|
|
14
|
+
* a + b*e0 + c*e1 + d*e2 + e*e01 + f*e20 + g*e12 + h*e012
|
|
15
|
+
*
|
|
16
|
+
* See GAPoint, GALine, GADirection and GATransform modules for common
|
|
17
|
+
* operations.
|
|
18
|
+
*/
|
|
19
|
+
export const point = (x, y) => [0, 0, 0, 0, y, x, 1, 0];
|
|
20
|
+
export const origin = () => [0, 0, 0, 0, 0, 0, 1, 0];
|
|
21
|
+
export const direction = (x, y) => {
|
|
22
|
+
const norm = Math.hypot(x, y); // same as `inorm(direction(x, y))`
|
|
23
|
+
return [0, 0, 0, 0, y / norm, x / norm, 0, 0];
|
|
24
|
+
};
|
|
25
|
+
export const offset = (x, y) => [
|
|
26
|
+
0,
|
|
27
|
+
0,
|
|
28
|
+
0,
|
|
29
|
+
0,
|
|
30
|
+
y,
|
|
31
|
+
x,
|
|
32
|
+
0,
|
|
33
|
+
0,
|
|
34
|
+
];
|
|
35
|
+
// These are labels for what each number in an nvector represents
|
|
36
|
+
const NVECTOR_BASE = ["1", "e0", "e1", "e2", "e01", "e20", "e12", "e012"];
|
|
37
|
+
// Used to represent points, lines and transformations
|
|
38
|
+
export const nvector = (value = 0, index = 0) => {
|
|
39
|
+
const result = [0, 0, 0, 0, 0, 0, 0, 0];
|
|
40
|
+
if (index < 0 || index > 7) {
|
|
41
|
+
throw new Error(`Expected \`index\` between 0 and 7, got \`${index}\``);
|
|
42
|
+
}
|
|
43
|
+
if (value !== 0) {
|
|
44
|
+
result[index] = value;
|
|
45
|
+
}
|
|
46
|
+
return result;
|
|
47
|
+
};
|
|
48
|
+
const STRING_EPSILON = 0.000001;
|
|
49
|
+
export const toString = (nvector) => {
|
|
50
|
+
const result = nvector
|
|
51
|
+
.map((value, index) => Math.abs(value) > STRING_EPSILON
|
|
52
|
+
? value.toFixed(7).replace(/(\.|0+)$/, "") +
|
|
53
|
+
(index > 0 ? NVECTOR_BASE[index] : "")
|
|
54
|
+
: null)
|
|
55
|
+
.filter((representation) => representation != null)
|
|
56
|
+
.join(" + ");
|
|
57
|
+
return result === "" ? "0" : result;
|
|
58
|
+
};
|
|
59
|
+
// Reverse the order of the basis blades.
|
|
60
|
+
export const reverse = (nvector) => [
|
|
61
|
+
nvector[0],
|
|
62
|
+
nvector[1],
|
|
63
|
+
nvector[2],
|
|
64
|
+
nvector[3],
|
|
65
|
+
-nvector[4],
|
|
66
|
+
-nvector[5],
|
|
67
|
+
-nvector[6],
|
|
68
|
+
-nvector[7],
|
|
69
|
+
];
|
|
70
|
+
// Poincare duality operator.
|
|
71
|
+
export const dual = (nvector) => [
|
|
72
|
+
nvector[7],
|
|
73
|
+
nvector[6],
|
|
74
|
+
nvector[5],
|
|
75
|
+
nvector[4],
|
|
76
|
+
nvector[3],
|
|
77
|
+
nvector[2],
|
|
78
|
+
nvector[1],
|
|
79
|
+
nvector[0],
|
|
80
|
+
];
|
|
81
|
+
// Clifford Conjugation
|
|
82
|
+
export const conjugate = (nvector) => [
|
|
83
|
+
nvector[0],
|
|
84
|
+
-nvector[1],
|
|
85
|
+
-nvector[2],
|
|
86
|
+
-nvector[3],
|
|
87
|
+
-nvector[4],
|
|
88
|
+
-nvector[5],
|
|
89
|
+
-nvector[6],
|
|
90
|
+
nvector[7],
|
|
91
|
+
];
|
|
92
|
+
// Main involution
|
|
93
|
+
export const involute = (nvector) => [
|
|
94
|
+
nvector[0],
|
|
95
|
+
-nvector[1],
|
|
96
|
+
-nvector[2],
|
|
97
|
+
-nvector[3],
|
|
98
|
+
nvector[4],
|
|
99
|
+
nvector[5],
|
|
100
|
+
nvector[6],
|
|
101
|
+
-nvector[7],
|
|
102
|
+
];
|
|
103
|
+
// Multivector addition
|
|
104
|
+
export const add = (a, b) => {
|
|
105
|
+
if (isNumber(b)) {
|
|
106
|
+
return [a[0] + b, a[1], a[2], a[3], a[4], a[5], a[6], a[7]];
|
|
107
|
+
}
|
|
108
|
+
return [
|
|
109
|
+
a[0] + b[0],
|
|
110
|
+
a[1] + b[1],
|
|
111
|
+
a[2] + b[2],
|
|
112
|
+
a[3] + b[3],
|
|
113
|
+
a[4] + b[4],
|
|
114
|
+
a[5] + b[5],
|
|
115
|
+
a[6] + b[6],
|
|
116
|
+
a[7] + b[7],
|
|
117
|
+
];
|
|
118
|
+
};
|
|
119
|
+
// Multivector subtraction
|
|
120
|
+
export const sub = (a, b) => {
|
|
121
|
+
if (isNumber(b)) {
|
|
122
|
+
return [a[0] - b, a[1], a[2], a[3], a[4], a[5], a[6], a[7]];
|
|
123
|
+
}
|
|
124
|
+
return [
|
|
125
|
+
a[0] - b[0],
|
|
126
|
+
a[1] - b[1],
|
|
127
|
+
a[2] - b[2],
|
|
128
|
+
a[3] - b[3],
|
|
129
|
+
a[4] - b[4],
|
|
130
|
+
a[5] - b[5],
|
|
131
|
+
a[6] - b[6],
|
|
132
|
+
a[7] - b[7],
|
|
133
|
+
];
|
|
134
|
+
};
|
|
135
|
+
// The geometric product.
|
|
136
|
+
export const mul = (a, b) => {
|
|
137
|
+
if (isNumber(b)) {
|
|
138
|
+
return [
|
|
139
|
+
a[0] * b,
|
|
140
|
+
a[1] * b,
|
|
141
|
+
a[2] * b,
|
|
142
|
+
a[3] * b,
|
|
143
|
+
a[4] * b,
|
|
144
|
+
a[5] * b,
|
|
145
|
+
a[6] * b,
|
|
146
|
+
a[7] * b,
|
|
147
|
+
];
|
|
148
|
+
}
|
|
149
|
+
return [
|
|
150
|
+
mulScalar(a, b),
|
|
151
|
+
b[1] * a[0] +
|
|
152
|
+
b[0] * a[1] -
|
|
153
|
+
b[4] * a[2] +
|
|
154
|
+
b[5] * a[3] +
|
|
155
|
+
b[2] * a[4] -
|
|
156
|
+
b[3] * a[5] -
|
|
157
|
+
b[7] * a[6] -
|
|
158
|
+
b[6] * a[7],
|
|
159
|
+
b[2] * a[0] + b[0] * a[2] - b[6] * a[3] + b[3] * a[6],
|
|
160
|
+
b[3] * a[0] + b[6] * a[2] + b[0] * a[3] - b[2] * a[6],
|
|
161
|
+
b[4] * a[0] +
|
|
162
|
+
b[2] * a[1] -
|
|
163
|
+
b[1] * a[2] +
|
|
164
|
+
b[7] * a[3] +
|
|
165
|
+
b[0] * a[4] +
|
|
166
|
+
b[6] * a[5] -
|
|
167
|
+
b[5] * a[6] +
|
|
168
|
+
b[3] * a[7],
|
|
169
|
+
b[5] * a[0] -
|
|
170
|
+
b[3] * a[1] +
|
|
171
|
+
b[7] * a[2] +
|
|
172
|
+
b[1] * a[3] -
|
|
173
|
+
b[6] * a[4] +
|
|
174
|
+
b[0] * a[5] +
|
|
175
|
+
b[4] * a[6] +
|
|
176
|
+
b[2] * a[7],
|
|
177
|
+
b[6] * a[0] + b[3] * a[2] - b[2] * a[3] + b[0] * a[6],
|
|
178
|
+
b[7] * a[0] +
|
|
179
|
+
b[6] * a[1] +
|
|
180
|
+
b[5] * a[2] +
|
|
181
|
+
b[4] * a[3] +
|
|
182
|
+
b[3] * a[4] +
|
|
183
|
+
b[2] * a[5] +
|
|
184
|
+
b[1] * a[6] +
|
|
185
|
+
b[0] * a[7],
|
|
186
|
+
];
|
|
187
|
+
};
|
|
188
|
+
export const mulScalar = (a, b) => b[0] * a[0] + b[2] * a[2] + b[3] * a[3] - b[6] * a[6];
|
|
189
|
+
// The outer/exterior/wedge product.
|
|
190
|
+
export const meet = (a, b) => [
|
|
191
|
+
b[0] * a[0],
|
|
192
|
+
b[1] * a[0] + b[0] * a[1],
|
|
193
|
+
b[2] * a[0] + b[0] * a[2],
|
|
194
|
+
b[3] * a[0] + b[0] * a[3],
|
|
195
|
+
b[4] * a[0] + b[2] * a[1] - b[1] * a[2] + b[0] * a[4],
|
|
196
|
+
b[5] * a[0] - b[3] * a[1] + b[1] * a[3] + b[0] * a[5],
|
|
197
|
+
b[6] * a[0] + b[3] * a[2] - b[2] * a[3] + b[0] * a[6],
|
|
198
|
+
b[7] * a[0] +
|
|
199
|
+
b[6] * a[1] +
|
|
200
|
+
b[5] * a[2] +
|
|
201
|
+
b[4] * a[3] +
|
|
202
|
+
b[3] * a[4] +
|
|
203
|
+
b[2] * a[5] +
|
|
204
|
+
b[1] * a[6],
|
|
205
|
+
];
|
|
206
|
+
// The regressive product.
|
|
207
|
+
export const join = (a, b) => [
|
|
208
|
+
joinScalar(a, b),
|
|
209
|
+
a[1] * b[7] + a[4] * b[5] - a[5] * b[4] + a[7] * b[1],
|
|
210
|
+
a[2] * b[7] - a[4] * b[6] + a[6] * b[4] + a[7] * b[2],
|
|
211
|
+
a[3] * b[7] + a[5] * b[6] - a[6] * b[5] + a[7] * b[3],
|
|
212
|
+
a[4] * b[7] + a[7] * b[4],
|
|
213
|
+
a[5] * b[7] + a[7] * b[5],
|
|
214
|
+
a[6] * b[7] + a[7] * b[6],
|
|
215
|
+
a[7] * b[7],
|
|
216
|
+
];
|
|
217
|
+
export const joinScalar = (a, b) => a[0] * b[7] +
|
|
218
|
+
a[1] * b[6] +
|
|
219
|
+
a[2] * b[5] +
|
|
220
|
+
a[3] * b[4] +
|
|
221
|
+
a[4] * b[3] +
|
|
222
|
+
a[5] * b[2] +
|
|
223
|
+
a[6] * b[1] +
|
|
224
|
+
a[7] * b[0];
|
|
225
|
+
// The inner product.
|
|
226
|
+
export const dot = (a, b) => [
|
|
227
|
+
b[0] * a[0] + b[2] * a[2] + b[3] * a[3] - b[6] * a[6],
|
|
228
|
+
b[1] * a[0] +
|
|
229
|
+
b[0] * a[1] -
|
|
230
|
+
b[4] * a[2] +
|
|
231
|
+
b[5] * a[3] +
|
|
232
|
+
b[2] * a[4] -
|
|
233
|
+
b[3] * a[5] -
|
|
234
|
+
b[7] * a[6] -
|
|
235
|
+
b[6] * a[7],
|
|
236
|
+
b[2] * a[0] + b[0] * a[2] - b[6] * a[3] + b[3] * a[6],
|
|
237
|
+
b[3] * a[0] + b[6] * a[2] + b[0] * a[3] - b[2] * a[6],
|
|
238
|
+
b[4] * a[0] + b[7] * a[3] + b[0] * a[4] + b[3] * a[7],
|
|
239
|
+
b[5] * a[0] + b[7] * a[2] + b[0] * a[5] + b[2] * a[7],
|
|
240
|
+
b[6] * a[0] + b[0] * a[6],
|
|
241
|
+
b[7] * a[0] + b[0] * a[7],
|
|
242
|
+
];
|
|
243
|
+
export const norm = (a) => Math.sqrt(Math.abs(a[0] * a[0] - a[2] * a[2] - a[3] * a[3] + a[6] * a[6]));
|
|
244
|
+
export const inorm = (a) => Math.sqrt(Math.abs(a[7] * a[7] - a[5] * a[5] - a[4] * a[4] + a[1] * a[1]));
|
|
245
|
+
export const normalized = (a) => {
|
|
246
|
+
const n = norm(a);
|
|
247
|
+
if (n === 0 || n === 1) {
|
|
248
|
+
return a;
|
|
249
|
+
}
|
|
250
|
+
const sign = a[6] < 0 ? -1 : 1;
|
|
251
|
+
return mul(a, sign / n);
|
|
252
|
+
};
|
|
253
|
+
export const inormalized = (a) => {
|
|
254
|
+
const n = inorm(a);
|
|
255
|
+
if (n === 0 || n === 1) {
|
|
256
|
+
return a;
|
|
257
|
+
}
|
|
258
|
+
return mul(a, 1 / n);
|
|
259
|
+
};
|
|
260
|
+
const isNumber = (a) => typeof a === "number";
|
|
261
|
+
export const E0 = nvector(1, 1);
|
|
262
|
+
export const E1 = nvector(1, 2);
|
|
263
|
+
export const E2 = nvector(1, 3);
|
|
264
|
+
export const E01 = nvector(1, 4);
|
|
265
|
+
export const E20 = nvector(1, 5);
|
|
266
|
+
export const E12 = nvector(1, 6);
|
|
267
|
+
export const E012 = nvector(1, 7);
|
|
268
|
+
export const I = E012;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as GA from "./ga";
|
|
2
|
+
/**
|
|
3
|
+
* A direction is stored as an array `[0, 0, 0, 0, y, x, 0, 0]` representing
|
|
4
|
+
* vector `(x, y)`.
|
|
5
|
+
*/
|
|
6
|
+
export const from = (point) => [
|
|
7
|
+
0,
|
|
8
|
+
0,
|
|
9
|
+
0,
|
|
10
|
+
0,
|
|
11
|
+
point[4],
|
|
12
|
+
point[5],
|
|
13
|
+
0,
|
|
14
|
+
0,
|
|
15
|
+
];
|
|
16
|
+
export const fromTo = (from, to) => GA.inormalized([0, 0, 0, 0, to[4] - from[4], to[5] - from[5], 0, 0]);
|
|
17
|
+
export const orthogonal = (direction) => GA.inormalized([0, 0, 0, 0, -direction[5], direction[4], 0, 0]);
|
|
18
|
+
export const orthogonalToLine = (line) => GA.mul(line, GA.I);
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as GA from "./ga";
|
|
2
|
+
/**
|
|
3
|
+
* A line is stored as an array `[0, c, a, b, 0, 0, 0, 0]` representing:
|
|
4
|
+
* c * e0 + a * e1 + b*e2
|
|
5
|
+
*
|
|
6
|
+
* This maps to a standard formula `a * x + b * y + c`.
|
|
7
|
+
*
|
|
8
|
+
* `(-b, a)` corresponds to a 2D vector parallel to the line. The lines
|
|
9
|
+
* have a natural orientation, corresponding to that vector.
|
|
10
|
+
*
|
|
11
|
+
* The magnitude ("norm") of the line is `sqrt(a ^ 2 + b ^ 2)`.
|
|
12
|
+
* `c / norm(line)` is the oriented distance from line to origin.
|
|
13
|
+
*/
|
|
14
|
+
// Returns line with direction (x, y) through origin
|
|
15
|
+
export const vector = (x, y) => GA.normalized([0, 0, -y, x, 0, 0, 0, 0]);
|
|
16
|
+
// For equation ax + by + c = 0.
|
|
17
|
+
export const equation = (a, b, c) => GA.normalized([0, c, a, b, 0, 0, 0, 0]);
|
|
18
|
+
export const through = (from, to) => GA.normalized(GA.join(to, from));
|
|
19
|
+
export const orthogonal = (line, point) => GA.dot(line, point);
|
|
20
|
+
// Returns a line perpendicular to the line through `against` and `intersection`
|
|
21
|
+
// going through `intersection`.
|
|
22
|
+
export const orthogonalThrough = (against, intersection) => orthogonal(through(against, intersection), intersection);
|
|
23
|
+
export const parallel = (line, distance) => {
|
|
24
|
+
const result = line.slice();
|
|
25
|
+
result[1] -= distance;
|
|
26
|
+
return result;
|
|
27
|
+
};
|
|
28
|
+
export const parallelThrough = (line, point) => orthogonal(orthogonal(point, line), point);
|
|
29
|
+
export const distance = (line1, line2) => GA.inorm(GA.meet(line1, line2));
|
|
30
|
+
export const angle = (line1, line2) => Math.acos(GA.dot(line1, line2)[0]);
|
|
31
|
+
// The orientation of the line
|
|
32
|
+
export const sign = (line) => Math.sign(line[1]);
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as GA from "./ga";
|
|
2
|
+
import * as GALine from "./galines";
|
|
3
|
+
import { join } from "./ga";
|
|
4
|
+
export const from = ([x, y]) => [
|
|
5
|
+
0,
|
|
6
|
+
0,
|
|
7
|
+
0,
|
|
8
|
+
0,
|
|
9
|
+
y,
|
|
10
|
+
x,
|
|
11
|
+
1,
|
|
12
|
+
0,
|
|
13
|
+
];
|
|
14
|
+
export const toTuple = (point) => [point[5], point[4]];
|
|
15
|
+
export const abs = (point) => [
|
|
16
|
+
0,
|
|
17
|
+
0,
|
|
18
|
+
0,
|
|
19
|
+
0,
|
|
20
|
+
Math.abs(point[4]),
|
|
21
|
+
Math.abs(point[5]),
|
|
22
|
+
1,
|
|
23
|
+
0,
|
|
24
|
+
];
|
|
25
|
+
export const intersect = (line1, line2) => GA.normalized(GA.meet(line1, line2));
|
|
26
|
+
// Projects `point` onto the `line`.
|
|
27
|
+
// The returned point is the closest point on the `line` to the `point`.
|
|
28
|
+
export const project = (point, line) => intersect(GALine.orthogonal(line, point), line);
|
|
29
|
+
export const distance = (point1, point2) => GA.norm(join(point1, point2));
|
|
30
|
+
export const distanceToLine = (point, line) => GA.joinScalar(point, line);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as GA from "./ga";
|
|
2
|
+
import * as GADirection from "./gadirections";
|
|
3
|
+
/**
|
|
4
|
+
* TODO: docs
|
|
5
|
+
*/
|
|
6
|
+
export const rotation = (pivot, angle) => GA.add(GA.mul(pivot, Math.sin(angle / 2)), Math.cos(angle / 2));
|
|
7
|
+
export const translation = (direction) => [
|
|
8
|
+
1,
|
|
9
|
+
0,
|
|
10
|
+
0,
|
|
11
|
+
0,
|
|
12
|
+
-(0.5 * direction[5]),
|
|
13
|
+
0.5 * direction[4],
|
|
14
|
+
0,
|
|
15
|
+
0,
|
|
16
|
+
];
|
|
17
|
+
export const translationOrthogonal = (direction, distance) => {
|
|
18
|
+
const scale = 0.5 * distance;
|
|
19
|
+
return [1, 0, 0, 0, scale * direction[4], scale * direction[5], 0, 0];
|
|
20
|
+
};
|
|
21
|
+
export const translationAlong = (line, distance) => GA.add(GA.mul(GADirection.orthogonalToLine(line), 0.5 * distance), 1);
|
|
22
|
+
export const compose = (motor1, motor2) => GA.mul(motor2, motor1);
|
|
23
|
+
export const apply = (motor, nvector) => GA.normalized(GA.mul(GA.mul(motor, nvector), GA.reverse(motor)));
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export const getCenter = (pointers) => {
|
|
2
|
+
const allCoords = Array.from(pointers.values());
|
|
3
|
+
return {
|
|
4
|
+
x: sum(allCoords, (coords) => coords.x) / allCoords.length,
|
|
5
|
+
y: sum(allCoords, (coords) => coords.y) / allCoords.length,
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
export const getDistance = ([a, b]) => Math.hypot(a.x - b.x, a.y - b.y);
|
|
9
|
+
const sum = (array, mapper) => array.reduce((acc, item) => acc + mapper(item), 0);
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
import { getSelectedElements } from "./scene";
|
|
2
|
+
import { getBoundTextElement } from "./element/textElement";
|
|
3
|
+
import { makeNextSelectedElementIds } from "./scene/selection";
|
|
4
|
+
export const selectGroup = (groupId, appState, elements) => {
|
|
5
|
+
const elementsInGroup = elements.reduce((acc, element) => {
|
|
6
|
+
if (element.groupIds.includes(groupId)) {
|
|
7
|
+
acc[element.id] = true;
|
|
8
|
+
}
|
|
9
|
+
return acc;
|
|
10
|
+
}, {});
|
|
11
|
+
if (Object.keys(elementsInGroup).length < 2) {
|
|
12
|
+
if (appState.selectedGroupIds[groupId] ||
|
|
13
|
+
appState.editingGroupId === groupId) {
|
|
14
|
+
return {
|
|
15
|
+
selectedElementIds: appState.selectedElementIds,
|
|
16
|
+
selectedGroupIds: { ...appState.selectedGroupIds, [groupId]: false },
|
|
17
|
+
editingGroupId: null,
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
return appState;
|
|
21
|
+
}
|
|
22
|
+
return {
|
|
23
|
+
editingGroupId: appState.editingGroupId,
|
|
24
|
+
selectedGroupIds: { ...appState.selectedGroupIds, [groupId]: true },
|
|
25
|
+
selectedElementIds: {
|
|
26
|
+
...appState.selectedElementIds,
|
|
27
|
+
...elementsInGroup,
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
export const selectGroupsForSelectedElements = (function () {
|
|
32
|
+
let lastSelectedElements = null;
|
|
33
|
+
let lastElements = null;
|
|
34
|
+
let lastReturnValue = null;
|
|
35
|
+
const _selectGroups = (selectedElements, elements, appState, prevAppState) => {
|
|
36
|
+
if (lastReturnValue !== undefined &&
|
|
37
|
+
elements === lastElements &&
|
|
38
|
+
selectedElements === lastSelectedElements &&
|
|
39
|
+
appState.editingGroupId === lastReturnValue?.editingGroupId) {
|
|
40
|
+
return lastReturnValue;
|
|
41
|
+
}
|
|
42
|
+
const selectedGroupIds = {};
|
|
43
|
+
// Gather all the groups withing selected elements
|
|
44
|
+
for (const selectedElement of selectedElements) {
|
|
45
|
+
let groupIds = selectedElement.groupIds;
|
|
46
|
+
if (appState.editingGroupId) {
|
|
47
|
+
// handle the case where a group is nested within a group
|
|
48
|
+
const indexOfEditingGroup = groupIds.indexOf(appState.editingGroupId);
|
|
49
|
+
if (indexOfEditingGroup > -1) {
|
|
50
|
+
groupIds = groupIds.slice(0, indexOfEditingGroup);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
if (groupIds.length > 0) {
|
|
54
|
+
const lastSelectedGroup = groupIds[groupIds.length - 1];
|
|
55
|
+
selectedGroupIds[lastSelectedGroup] = true;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
// Gather all the elements within selected groups
|
|
59
|
+
const groupElementsIndex = {};
|
|
60
|
+
const selectedElementIdsInGroups = elements.reduce((acc, element) => {
|
|
61
|
+
const groupId = element.groupIds.find((id) => selectedGroupIds[id]);
|
|
62
|
+
if (groupId) {
|
|
63
|
+
acc[element.id] = true;
|
|
64
|
+
// Populate the index
|
|
65
|
+
if (!Array.isArray(groupElementsIndex[groupId])) {
|
|
66
|
+
groupElementsIndex[groupId] = [element.id];
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
groupElementsIndex[groupId].push(element.id);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return acc;
|
|
73
|
+
}, {});
|
|
74
|
+
for (const groupId of Object.keys(groupElementsIndex)) {
|
|
75
|
+
// If there is one element in the group, and the group is selected or it's being edited, it's not a group
|
|
76
|
+
if (groupElementsIndex[groupId].length < 2) {
|
|
77
|
+
if (selectedGroupIds[groupId]) {
|
|
78
|
+
selectedGroupIds[groupId] = false;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
lastElements = elements;
|
|
83
|
+
lastSelectedElements = selectedElements;
|
|
84
|
+
lastReturnValue = {
|
|
85
|
+
editingGroupId: appState.editingGroupId,
|
|
86
|
+
selectedGroupIds,
|
|
87
|
+
selectedElementIds: makeNextSelectedElementIds({
|
|
88
|
+
...appState.selectedElementIds,
|
|
89
|
+
...selectedElementIdsInGroups,
|
|
90
|
+
}, prevAppState),
|
|
91
|
+
};
|
|
92
|
+
return lastReturnValue;
|
|
93
|
+
};
|
|
94
|
+
/**
|
|
95
|
+
* When you select an element, you often want to actually select the whole group it's in, unless
|
|
96
|
+
* you're currently editing that group.
|
|
97
|
+
*/
|
|
98
|
+
const selectGroupsForSelectedElements = (appState, elements, prevAppState,
|
|
99
|
+
/**
|
|
100
|
+
* supply null in cases where you don't have access to App instance and
|
|
101
|
+
* you don't care about optimizing selectElements retrieval
|
|
102
|
+
*/
|
|
103
|
+
app) => {
|
|
104
|
+
const selectedElements = app
|
|
105
|
+
? app.scene.getSelectedElements({
|
|
106
|
+
selectedElementIds: appState.selectedElementIds,
|
|
107
|
+
// supplying elements explicitly in case we're passed non-state elements
|
|
108
|
+
elements,
|
|
109
|
+
})
|
|
110
|
+
: getSelectedElements(elements, appState);
|
|
111
|
+
if (!selectedElements.length) {
|
|
112
|
+
return {
|
|
113
|
+
selectedGroupIds: {},
|
|
114
|
+
editingGroupId: null,
|
|
115
|
+
selectedElementIds: makeNextSelectedElementIds(appState.selectedElementIds, prevAppState),
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
return _selectGroups(selectedElements, elements, appState, prevAppState);
|
|
119
|
+
};
|
|
120
|
+
selectGroupsForSelectedElements.clearCache = () => {
|
|
121
|
+
lastElements = null;
|
|
122
|
+
lastSelectedElements = null;
|
|
123
|
+
lastReturnValue = null;
|
|
124
|
+
};
|
|
125
|
+
return selectGroupsForSelectedElements;
|
|
126
|
+
})();
|
|
127
|
+
/**
|
|
128
|
+
* If the element's group is selected, don't render an individual
|
|
129
|
+
* selection border around it.
|
|
130
|
+
*/
|
|
131
|
+
export const isSelectedViaGroup = (appState, element) => getSelectedGroupForElement(appState, element) != null;
|
|
132
|
+
export const getSelectedGroupForElement = (appState, element) => element.groupIds
|
|
133
|
+
.filter((groupId) => groupId !== appState.editingGroupId)
|
|
134
|
+
.find((groupId) => appState.selectedGroupIds[groupId]);
|
|
135
|
+
export const getSelectedGroupIds = (appState) => Object.entries(appState.selectedGroupIds)
|
|
136
|
+
.filter(([groupId, isSelected]) => isSelected)
|
|
137
|
+
.map(([groupId, isSelected]) => groupId);
|
|
138
|
+
// given a list of elements, return the the actual group ids that should be selected
|
|
139
|
+
// or used to update the elements
|
|
140
|
+
export const selectGroupsFromGivenElements = (elements, appState) => {
|
|
141
|
+
let nextAppState = {
|
|
142
|
+
...appState,
|
|
143
|
+
selectedGroupIds: {},
|
|
144
|
+
};
|
|
145
|
+
for (const element of elements) {
|
|
146
|
+
let groupIds = element.groupIds;
|
|
147
|
+
if (appState.editingGroupId) {
|
|
148
|
+
const indexOfEditingGroup = groupIds.indexOf(appState.editingGroupId);
|
|
149
|
+
if (indexOfEditingGroup > -1) {
|
|
150
|
+
groupIds = groupIds.slice(0, indexOfEditingGroup);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
if (groupIds.length > 0) {
|
|
154
|
+
const groupId = groupIds[groupIds.length - 1];
|
|
155
|
+
nextAppState = {
|
|
156
|
+
...nextAppState,
|
|
157
|
+
...selectGroup(groupId, nextAppState, elements),
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
return nextAppState.selectedGroupIds;
|
|
162
|
+
};
|
|
163
|
+
export const editGroupForSelectedElement = (appState, element) => {
|
|
164
|
+
return {
|
|
165
|
+
...appState,
|
|
166
|
+
editingGroupId: element.groupIds.length ? element.groupIds[0] : null,
|
|
167
|
+
selectedGroupIds: {},
|
|
168
|
+
selectedElementIds: {
|
|
169
|
+
[element.id]: true,
|
|
170
|
+
},
|
|
171
|
+
};
|
|
172
|
+
};
|
|
173
|
+
export const isElementInGroup = (element, groupId) => element.groupIds.includes(groupId);
|
|
174
|
+
export const getElementsInGroup = (elements, groupId) => elements.filter((element) => isElementInGroup(element, groupId));
|
|
175
|
+
export const getSelectedGroupIdForElement = (element, selectedGroupIds) => element.groupIds.find((groupId) => selectedGroupIds[groupId]);
|
|
176
|
+
export const getNewGroupIdsForDuplication = (groupIds, editingGroupId, mapper) => {
|
|
177
|
+
const copy = [...groupIds];
|
|
178
|
+
const positionOfEditingGroupId = editingGroupId
|
|
179
|
+
? groupIds.indexOf(editingGroupId)
|
|
180
|
+
: -1;
|
|
181
|
+
const endIndex = positionOfEditingGroupId > -1 ? positionOfEditingGroupId : groupIds.length;
|
|
182
|
+
for (let index = 0; index < endIndex; index++) {
|
|
183
|
+
copy[index] = mapper(copy[index]);
|
|
184
|
+
}
|
|
185
|
+
return copy;
|
|
186
|
+
};
|
|
187
|
+
export const addToGroup = (prevGroupIds, newGroupId, editingGroupId) => {
|
|
188
|
+
// insert before the editingGroupId, or push to the end.
|
|
189
|
+
const groupIds = [...prevGroupIds];
|
|
190
|
+
const positionOfEditingGroupId = editingGroupId
|
|
191
|
+
? groupIds.indexOf(editingGroupId)
|
|
192
|
+
: -1;
|
|
193
|
+
const positionToInsert = positionOfEditingGroupId > -1 ? positionOfEditingGroupId : groupIds.length;
|
|
194
|
+
groupIds.splice(positionToInsert, 0, newGroupId);
|
|
195
|
+
return groupIds;
|
|
196
|
+
};
|
|
197
|
+
export const removeFromSelectedGroups = (groupIds, selectedGroupIds) => groupIds.filter((groupId) => !selectedGroupIds[groupId]);
|
|
198
|
+
export const getMaximumGroups = (elements) => {
|
|
199
|
+
const groups = new Map();
|
|
200
|
+
elements.forEach((element) => {
|
|
201
|
+
const groupId = element.groupIds.length === 0
|
|
202
|
+
? element.id
|
|
203
|
+
: element.groupIds[element.groupIds.length - 1];
|
|
204
|
+
const currentGroupMembers = groups.get(groupId) || [];
|
|
205
|
+
// Include bound text if present when grouping
|
|
206
|
+
const boundTextElement = getBoundTextElement(element);
|
|
207
|
+
if (boundTextElement) {
|
|
208
|
+
currentGroupMembers.push(boundTextElement);
|
|
209
|
+
}
|
|
210
|
+
groups.set(groupId, [...currentGroupMembers, element]);
|
|
211
|
+
});
|
|
212
|
+
return Array.from(groups.values());
|
|
213
|
+
};
|
|
214
|
+
export const elementsAreInSameGroup = (elements) => {
|
|
215
|
+
const allGroups = elements.flatMap((element) => element.groupIds);
|
|
216
|
+
const groupCount = new Map();
|
|
217
|
+
let maxGroup = 0;
|
|
218
|
+
for (const group of allGroups) {
|
|
219
|
+
groupCount.set(group, (groupCount.get(group) ?? 0) + 1);
|
|
220
|
+
if (groupCount.get(group) > maxGroup) {
|
|
221
|
+
maxGroup = groupCount.get(group);
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
return maxGroup === elements.length;
|
|
225
|
+
};
|