@excalidraw/excalidraw 0.17.1-d9bbf1e → 0.17.1-e63dd02
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/CHANGELOG.md +4 -0
- package/dist/browser/dev/excalidraw-assets-dev/CascadiaCode-Regular-TMZI7IJ5.woff2 +0 -0
- package/dist/browser/dev/excalidraw-assets-dev/ComicShanns-Regular-6TOETDFT.woff2 +0 -0
- package/dist/browser/dev/excalidraw-assets-dev/Excalifont-Regular-CPKEUDVM.woff2 +0 -0
- package/dist/browser/dev/excalidraw-assets-dev/LiberationSans-Regular-ZQD73GJM.woff2 +0 -0
- package/dist/browser/dev/excalidraw-assets-dev/Virgil-Regular-YHAB2VGJ.woff2 +0 -0
- package/dist/browser/dev/excalidraw-assets-dev/{chunk-XOM7LNOU.js → chunk-IT7T3AIK.js} +49 -8
- package/dist/browser/dev/excalidraw-assets-dev/chunk-IT7T3AIK.js.map +7 -0
- package/dist/browser/dev/excalidraw-assets-dev/{chunk-BLEB3M62.js → chunk-RNHSD5AR.js} +7668 -2142
- package/dist/browser/dev/excalidraw-assets-dev/chunk-RNHSD5AR.js.map +7 -0
- package/dist/browser/dev/excalidraw-assets-dev/{dist-ITJNUBZF.js → dist-DNSPZDOZ.js} +66 -32
- package/dist/browser/dev/excalidraw-assets-dev/dist-DNSPZDOZ.js.map +7 -0
- package/dist/browser/dev/excalidraw-assets-dev/{en-TR4QLF5E.js → en-XV7OZCPP.js} +8 -2
- package/dist/browser/dev/excalidraw-assets-dev/{image-ZGDDRBEN.js → image-77HZYGLG.js} +2 -2
- package/dist/browser/dev/excalidraw-assets-dev/{image-O66MQ7WQ.css → image-WDHYGKKP.css} +1 -1
- package/dist/browser/dev/excalidraw-assets-dev/{image-O66MQ7WQ.css.map → image-WDHYGKKP.css.map} +2 -2
- package/dist/browser/dev/index.css +610 -180
- package/dist/browser/dev/index.css.map +3 -3
- package/dist/browser/dev/index.js +13306 -8006
- package/dist/browser/dev/index.js.map +4 -4
- package/dist/browser/prod/excalidraw-assets/CascadiaCode-Regular-TMZI7IJ5.woff2 +0 -0
- package/dist/browser/prod/excalidraw-assets/ComicShanns-Regular-6TOETDFT.woff2 +0 -0
- package/dist/browser/prod/excalidraw-assets/Excalifont-Regular-CPKEUDVM.woff2 +0 -0
- package/dist/browser/prod/excalidraw-assets/LiberationSans-Regular-ZQD73GJM.woff2 +0 -0
- package/dist/browser/prod/excalidraw-assets/Virgil-Regular-YHAB2VGJ.woff2 +0 -0
- package/dist/browser/prod/excalidraw-assets/chunk-OYEADJSR.js +63 -0
- package/dist/browser/prod/excalidraw-assets/{chunk-5SYIAZGL.js → chunk-PDYFZJMS.js} +5 -5
- package/dist/browser/prod/excalidraw-assets/dist-NLUQPPQQ.js +7 -0
- package/dist/browser/prod/excalidraw-assets/en-YVAVVILW.js +1 -0
- package/dist/browser/prod/excalidraw-assets/image-X3GFZHNN.js +1 -0
- package/dist/browser/prod/index.css +1 -1
- package/dist/browser/prod/index.js +70 -51
- package/dist/dev/CascadiaCode-Regular-TMZI7IJ5.woff2 +0 -0
- package/dist/dev/ComicShanns-Regular-6TOETDFT.woff2 +0 -0
- package/dist/dev/Excalifont-Regular-CPKEUDVM.woff2 +0 -0
- package/dist/dev/LiberationSans-Regular-ZQD73GJM.woff2 +0 -0
- package/dist/dev/Virgil-Regular-YHAB2VGJ.woff2 +0 -0
- package/dist/dev/{en-XW4JO6VX.json → en-YNVBSAIL.json} +42 -7
- package/dist/dev/index.css +610 -180
- package/dist/dev/index.css.map +3 -3
- package/dist/dev/index.js +22165 -16833
- package/dist/dev/index.js.map +4 -4
- package/dist/excalidraw/actions/actionAddToLibrary.d.ts +24 -9
- package/dist/excalidraw/actions/actionAlign.d.ts +8 -8
- package/dist/excalidraw/actions/actionBoundText.d.ts +20 -10
- package/dist/excalidraw/actions/actionBoundText.js +3 -1
- package/dist/excalidraw/actions/actionCanvas.d.ts +100 -40
- package/dist/excalidraw/actions/actionCanvas.js +1 -1
- package/dist/excalidraw/actions/actionClipboard.d.ts +62 -26
- package/dist/excalidraw/actions/actionDeleteSelected.d.ts +28 -12
- package/dist/excalidraw/actions/actionDeleteSelected.js +24 -5
- package/dist/excalidraw/actions/actionDistribute.d.ts +4 -4
- package/dist/excalidraw/actions/actionDuplicateSelection.d.ts +3 -3
- package/dist/excalidraw/actions/actionDuplicateSelection.js +1 -2
- package/dist/excalidraw/actions/actionElementLock.d.ts +17 -7
- package/dist/excalidraw/actions/actionExport.d.ts +75 -30
- package/dist/excalidraw/actions/actionFinalize.d.ts +17 -7
- package/dist/excalidraw/actions/actionFinalize.js +2 -2
- package/dist/excalidraw/actions/actionFlip.d.ts +4 -4
- package/dist/excalidraw/actions/actionFlip.js +2 -2
- package/dist/excalidraw/actions/actionFrame.d.ts +338 -10
- package/dist/excalidraw/actions/actionGroup.d.ts +324 -4
- package/dist/excalidraw/actions/actionHistory.d.ts +3 -3
- package/dist/excalidraw/actions/actionHistory.js +8 -8
- package/dist/excalidraw/actions/actionLinearEditor.d.ts +12 -5
- package/dist/excalidraw/actions/actionLinearEditor.js +21 -5
- package/dist/excalidraw/actions/actionLink.d.ts +8 -3
- package/dist/excalidraw/actions/actionMenu.d.ts +24 -9
- package/dist/excalidraw/actions/actionNavigate.d.ts +17 -7
- package/dist/excalidraw/actions/actionProperties.d.ts +476 -82
- package/dist/excalidraw/actions/actionProperties.js +384 -59
- package/dist/excalidraw/actions/actionSelectAll.d.ts +9 -4
- package/dist/excalidraw/actions/actionStyles.d.ts +12 -4
- package/dist/excalidraw/actions/actionStyles.js +3 -2
- package/dist/excalidraw/actions/actionTextAutoResize.d.ts +17 -0
- package/dist/excalidraw/actions/actionTextAutoResize.js +38 -0
- package/dist/excalidraw/actions/actionToggleGridMode.d.ts +9 -4
- package/dist/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +8 -3
- package/dist/excalidraw/actions/actionToggleStats.d.ts +9 -3
- package/dist/excalidraw/actions/actionToggleStats.js +4 -3
- package/dist/excalidraw/actions/actionToggleViewMode.d.ts +8 -3
- package/dist/excalidraw/actions/actionToggleZenMode.d.ts +8 -3
- package/dist/excalidraw/actions/actionZindex.d.ts +8 -4
- package/dist/excalidraw/actions/actionZindex.js +4 -0
- package/dist/excalidraw/actions/manager.d.ts +3 -3
- package/dist/excalidraw/actions/register.d.ts +1 -1
- package/dist/excalidraw/actions/shortcuts.d.ts +2 -2
- package/dist/excalidraw/actions/types.d.ts +6 -6
- package/dist/excalidraw/align.d.ts +1 -1
- package/dist/excalidraw/analytics.js +9 -7
- package/dist/excalidraw/animated-trail.d.ts +2 -2
- package/dist/excalidraw/appState.d.ts +6 -2
- package/dist/excalidraw/appState.js +14 -3
- package/dist/excalidraw/binaryheap.d.ts +12 -0
- package/dist/excalidraw/binaryheap.js +93 -0
- package/dist/excalidraw/change.d.ts +6 -5
- package/dist/excalidraw/change.js +20 -11
- package/dist/excalidraw/charts.d.ts +1 -1
- package/dist/excalidraw/charts.js +0 -10
- package/dist/excalidraw/clients.d.ts +2 -2
- package/dist/excalidraw/clients.js +1 -1
- package/dist/excalidraw/clipboard.d.ts +3 -3
- package/dist/excalidraw/colors.d.ts +1 -1
- package/dist/excalidraw/components/Actions.d.ts +3 -3
- package/dist/excalidraw/components/Actions.js +14 -9
- package/dist/excalidraw/components/App.d.ts +14 -17
- package/dist/excalidraw/components/App.js +356 -217
- package/dist/excalidraw/components/ButtonIcon.d.ts +15 -0
- package/dist/excalidraw/components/ButtonIcon.js +8 -0
- package/dist/excalidraw/components/ButtonIconSelect.js +2 -3
- package/dist/excalidraw/components/ButtonSeparator.d.ts +2 -0
- package/dist/excalidraw/components/ButtonSeparator.js +7 -0
- package/dist/excalidraw/components/CheckboxItem.js +1 -1
- package/dist/excalidraw/components/ColorPicker/ColorInput.d.ts +1 -1
- package/dist/excalidraw/components/ColorPicker/ColorInput.js +1 -1
- package/dist/excalidraw/components/ColorPicker/ColorPicker.d.ts +4 -4
- package/dist/excalidraw/components/ColorPicker/ColorPicker.js +48 -80
- package/dist/excalidraw/components/ColorPicker/Picker.d.ts +3 -3
- package/dist/excalidraw/components/ColorPicker/Picker.js +1 -1
- package/dist/excalidraw/components/ColorPicker/PickerColorList.d.ts +1 -1
- package/dist/excalidraw/components/ColorPicker/PickerHeading.d.ts +1 -1
- package/dist/excalidraw/components/ColorPicker/ShadeList.d.ts +1 -1
- package/dist/excalidraw/components/ColorPicker/TopPicks.d.ts +1 -1
- package/dist/excalidraw/components/ColorPicker/colorPickerUtils.d.ts +2 -2
- package/dist/excalidraw/components/ColorPicker/colorPickerUtils.js +1 -1
- package/dist/excalidraw/components/ColorPicker/keyboardNavHandlers.d.ts +2 -2
- package/dist/excalidraw/components/ColorPicker/keyboardNavHandlers.js +1 -1
- package/dist/excalidraw/components/CommandPalette/CommandPalette.d.ts +1 -1
- package/dist/excalidraw/components/CommandPalette/CommandPalette.js +5 -5
- package/dist/excalidraw/components/CommandPalette/defaultCommandPaletteItems.d.ts +1 -1
- package/dist/excalidraw/components/CommandPalette/types.d.ts +3 -3
- package/dist/excalidraw/components/ConfirmDialog.d.ts +1 -1
- package/dist/excalidraw/components/ContextMenu.d.ts +2 -2
- package/dist/excalidraw/components/ContextMenu.js +2 -2
- package/dist/excalidraw/components/DarkModeToggle.d.ts +1 -1
- package/dist/excalidraw/components/DefaultSidebar.d.ts +2 -2
- package/dist/excalidraw/components/Dialog.js +1 -1
- package/dist/excalidraw/components/DialogActionButton.d.ts +1 -1
- package/dist/excalidraw/components/EyeDropper.d.ts +2 -2
- package/dist/excalidraw/components/FollowMode/FollowMode.d.ts +1 -1
- package/dist/excalidraw/components/FollowMode/FollowMode.js +1 -1
- package/dist/excalidraw/components/FontPicker/FontPicker.d.ts +21 -0
- package/dist/excalidraw/components/FontPicker/FontPicker.js +49 -0
- package/dist/excalidraw/components/FontPicker/FontPickerList.d.ts +25 -0
- package/dist/excalidraw/components/FontPicker/FontPickerList.js +119 -0
- package/dist/excalidraw/components/FontPicker/FontPickerTrigger.d.ts +7 -0
- package/dist/excalidraw/components/FontPicker/FontPickerTrigger.js +13 -0
- package/dist/excalidraw/components/FontPicker/keyboardNavHandlers.d.ts +14 -0
- package/dist/excalidraw/components/FontPicker/keyboardNavHandlers.js +38 -0
- package/dist/excalidraw/components/HelpDialog.js +2 -2
- package/dist/excalidraw/components/HintViewer.d.ts +1 -1
- package/dist/excalidraw/components/HintViewer.js +6 -3
- package/dist/excalidraw/components/IconPicker.js +2 -2
- package/dist/excalidraw/components/ImageExportDialog.d.ts +1 -1
- package/dist/excalidraw/components/InitializeApp.d.ts +2 -2
- package/dist/excalidraw/components/JSONExportDialog.d.ts +3 -3
- package/dist/excalidraw/components/LayerUI.d.ts +4 -4
- package/dist/excalidraw/components/LayerUI.js +10 -7
- package/dist/excalidraw/components/LibraryMenu.d.ts +2 -2
- package/dist/excalidraw/components/LibraryMenuBrowseButton.d.ts +1 -1
- package/dist/excalidraw/components/LibraryMenuControlButtons.d.ts +1 -1
- package/dist/excalidraw/components/LibraryMenuHeaderContent.d.ts +2 -2
- package/dist/excalidraw/components/LibraryMenuItems.d.ts +1 -1
- package/dist/excalidraw/components/LibraryMenuSection.d.ts +5 -4
- package/dist/excalidraw/components/LibraryUnit.d.ts +2 -2
- package/dist/excalidraw/components/LoadingMessage.d.ts +1 -1
- package/dist/excalidraw/components/MagicSettings.js +2 -2
- package/dist/excalidraw/components/MobileMenu.d.ts +3 -3
- package/dist/excalidraw/components/MobileMenu.js +2 -6
- package/dist/excalidraw/components/Modal.d.ts +1 -1
- package/dist/excalidraw/components/OverwriteConfirm/OverwriteConfirmState.d.ts +1 -1
- package/dist/excalidraw/components/PasteChartDialog.d.ts +1 -1
- package/dist/excalidraw/components/PasteChartDialog.js +1 -1
- package/dist/excalidraw/components/PropertiesPopover.d.ts +15 -0
- package/dist/excalidraw/components/PropertiesPopover.js +31 -0
- package/dist/excalidraw/components/PublishLibrary.d.ts +1 -1
- package/dist/excalidraw/components/QuickSearch.d.ts +9 -0
- package/dist/excalidraw/components/QuickSearch.js +8 -0
- package/dist/excalidraw/components/SVGLayer.d.ts +1 -1
- package/dist/excalidraw/components/ScrollableList.d.ts +9 -0
- package/dist/excalidraw/components/ScrollableList.js +8 -0
- package/dist/excalidraw/components/Sidebar/Sidebar.js +1 -1
- package/dist/excalidraw/components/Sidebar/SidebarTab.d.ts +1 -1
- package/dist/excalidraw/components/Sidebar/SidebarTabTrigger.d.ts +1 -1
- package/dist/excalidraw/components/Sidebar/SidebarTrigger.d.ts +1 -1
- package/dist/excalidraw/components/Sidebar/common.d.ts +1 -1
- package/dist/excalidraw/components/Stats/Angle.d.ts +12 -0
- package/dist/excalidraw/components/Stats/Angle.js +53 -0
- package/dist/excalidraw/components/Stats/Collapsible.d.ts +9 -0
- package/dist/excalidraw/components/Stats/Collapsible.js +12 -0
- package/dist/excalidraw/components/Stats/Dimension.d.ts +12 -0
- package/dist/excalidraw/components/Stats/Dimension.js +68 -0
- package/dist/excalidraw/components/Stats/DragInput.d.ts +32 -0
- package/dist/excalidraw/components/Stats/DragInput.js +174 -0
- package/dist/excalidraw/components/Stats/FontSize.d.ts +12 -0
- package/dist/excalidraw/components/Stats/FontSize.js +50 -0
- package/dist/excalidraw/components/Stats/MultiAngle.d.ts +12 -0
- package/dist/excalidraw/components/Stats/MultiAngle.js +66 -0
- package/dist/excalidraw/components/Stats/MultiDimension.d.ts +15 -0
- package/dist/excalidraw/components/Stats/MultiDimension.js +199 -0
- package/dist/excalidraw/components/Stats/MultiFontSize.d.ts +13 -0
- package/dist/excalidraw/components/Stats/MultiFontSize.js +72 -0
- package/dist/excalidraw/components/Stats/MultiPosition.d.ts +15 -0
- package/dist/excalidraw/components/Stats/MultiPosition.js +101 -0
- package/dist/excalidraw/components/Stats/Position.d.ts +13 -0
- package/dist/excalidraw/components/Stats/Position.js +40 -0
- package/dist/excalidraw/components/Stats/index.d.ts +16 -0
- package/dist/excalidraw/components/Stats/index.js +79 -0
- package/dist/excalidraw/components/Stats/utils.d.ts +26 -0
- package/dist/excalidraw/components/Stats/utils.js +162 -0
- package/dist/excalidraw/components/TTDDialog/MermaidToExcalidraw.d.ts +1 -1
- package/dist/excalidraw/components/TTDDialog/TTDDialog.js +2 -2
- package/dist/excalidraw/components/TTDDialog/TTDDialogInput.d.ts +1 -1
- package/dist/excalidraw/components/TTDDialog/TTDDialogPanel.d.ts +1 -1
- package/dist/excalidraw/components/TTDDialog/TTDDialogPanels.d.ts +1 -1
- package/dist/excalidraw/components/TTDDialog/TTDDialogTabs.d.ts +1 -1
- package/dist/excalidraw/components/TTDDialog/TTDDialogTrigger.d.ts +1 -1
- package/dist/excalidraw/components/TTDDialog/common.d.ts +5 -5
- package/dist/excalidraw/components/TTDDialog/common.js +3 -7
- package/dist/excalidraw/components/TextField.d.ts +1 -1
- package/dist/excalidraw/components/Toast.d.ts +1 -1
- package/dist/excalidraw/components/ToolButton.d.ts +3 -2
- package/dist/excalidraw/components/Trans.d.ts +1 -1
- package/dist/excalidraw/components/UserList.d.ts +1 -1
- package/dist/excalidraw/components/UserList.js +22 -22
- package/dist/excalidraw/components/canvases/InteractiveCanvas.d.ts +3 -2
- package/dist/excalidraw/components/canvases/InteractiveCanvas.js +4 -2
- package/dist/excalidraw/components/canvases/StaticCanvas.d.ts +2 -2
- package/dist/excalidraw/components/canvases/StaticCanvas.js +3 -2
- package/dist/excalidraw/components/dropdownMenu/DropdownMenu.d.ts +12 -3
- package/dist/excalidraw/components/dropdownMenu/DropdownMenuItem.d.ts +24 -4
- package/dist/excalidraw/components/dropdownMenu/DropdownMenuItem.js +55 -14
- package/dist/excalidraw/components/dropdownMenu/DropdownMenuItemContent.d.ts +2 -1
- package/dist/excalidraw/components/dropdownMenu/DropdownMenuItemContent.js +2 -2
- package/dist/excalidraw/components/dropdownMenu/common.d.ts +1 -1
- package/dist/excalidraw/components/dropdownMenu/common.js +3 -2
- package/dist/excalidraw/components/footer/Footer.d.ts +2 -2
- package/dist/excalidraw/components/hyperlink/Hyperlink.d.ts +2 -2
- package/dist/excalidraw/components/hyperlink/helpers.d.ts +3 -3
- package/dist/excalidraw/components/icons.d.ts +10 -2
- package/dist/excalidraw/components/icons.js +29 -6
- package/dist/excalidraw/components/main-menu/MainMenu.d.ts +12 -3
- package/dist/excalidraw/components/welcome-screen/WelcomeScreen.Center.js +2 -2
- package/dist/excalidraw/components/welcome-screen/WelcomeScreen.Hints.js +3 -3
- package/dist/excalidraw/constants.d.ts +24 -3
- package/dist/excalidraw/constants.js +28 -4
- package/dist/excalidraw/context/ui-appState.d.ts +1 -1
- package/dist/excalidraw/cursor.d.ts +1 -1
- package/dist/excalidraw/data/EditorLocalStorage.d.ts +2 -2
- package/dist/excalidraw/data/blob.d.ts +5 -5
- package/dist/excalidraw/data/filesystem.d.ts +2 -1
- package/dist/excalidraw/data/index.d.ts +4 -4
- package/dist/excalidraw/data/json.d.ts +3 -3
- package/dist/excalidraw/data/library.d.ts +3 -3
- package/dist/excalidraw/data/magic.d.ts +3 -3
- package/dist/excalidraw/data/reconcile.d.ts +3 -3
- package/dist/excalidraw/data/reconcile.js +18 -1
- package/dist/excalidraw/data/resave.d.ts +2 -2
- package/dist/excalidraw/data/restore.d.ts +3 -3
- package/dist/excalidraw/data/restore.js +58 -9
- package/dist/excalidraw/data/transform.d.ts +3 -3
- package/dist/excalidraw/data/transform.js +8 -5
- package/dist/excalidraw/data/types.d.ts +3 -3
- package/dist/excalidraw/element/ElementCanvasButtons.d.ts +1 -1
- package/dist/excalidraw/element/binding.d.ts +29 -10
- package/dist/excalidraw/element/binding.js +303 -71
- package/dist/excalidraw/element/bounds.d.ts +3 -3
- package/dist/excalidraw/element/collision.d.ts +4 -4
- package/dist/excalidraw/element/collision.js +5 -2
- package/dist/excalidraw/element/containerCache.d.ts +1 -1
- package/dist/excalidraw/element/dragElements.d.ts +6 -6
- package/dist/excalidraw/element/dragElements.js +39 -5
- package/dist/excalidraw/element/embeddable.d.ts +11 -6
- package/dist/excalidraw/element/heading.d.ts +11 -0
- package/dist/excalidraw/element/heading.js +81 -0
- package/dist/excalidraw/element/image.d.ts +2 -2
- package/dist/excalidraw/element/index.d.ts +2 -2
- package/dist/excalidraw/element/index.js +1 -1
- package/dist/excalidraw/element/linearElementEditor.d.ts +27 -16
- package/dist/excalidraw/element/linearElementEditor.js +133 -56
- package/dist/excalidraw/element/mutateElement.d.ts +3 -3
- package/dist/excalidraw/element/mutateElement.js +5 -3
- package/dist/excalidraw/element/newElement.d.ts +12 -10
- package/dist/excalidraw/element/newElement.js +31 -16
- package/dist/excalidraw/element/resizeElements.d.ts +15 -6
- package/dist/excalidraw/element/resizeElements.js +122 -46
- package/dist/excalidraw/element/resizeTest.d.ts +4 -4
- package/dist/excalidraw/element/resizeTest.js +2 -4
- package/dist/excalidraw/element/routing.d.ts +13 -0
- package/dist/excalidraw/element/routing.js +641 -0
- package/dist/excalidraw/element/showSelectedShapeActions.d.ts +2 -2
- package/dist/excalidraw/element/sizeHelpers.d.ts +2 -2
- package/dist/excalidraw/element/sortElements.d.ts +1 -1
- package/dist/excalidraw/element/textElement.d.ts +6 -28
- package/dist/excalidraw/element/textElement.js +64 -112
- package/dist/excalidraw/element/textWysiwyg.d.ts +12 -6
- package/dist/excalidraw/element/textWysiwyg.js +75 -62
- package/dist/excalidraw/element/transformHandles.d.ts +3 -3
- package/dist/excalidraw/element/transformHandles.js +7 -12
- package/dist/excalidraw/element/typeChecks.d.ts +7 -4
- package/dist/excalidraw/element/typeChecks.js +17 -0
- package/dist/excalidraw/element/types.d.ts +22 -4
- package/dist/excalidraw/emitter.d.ts +1 -1
- package/dist/excalidraw/fonts/ExcalidrawFont.d.ts +21 -0
- package/dist/excalidraw/fonts/ExcalidrawFont.js +112 -0
- package/dist/excalidraw/fonts/index.d.ts +58 -0
- package/dist/excalidraw/fonts/index.js +240 -0
- package/dist/excalidraw/fonts/metadata.d.ts +36 -0
- package/dist/excalidraw/fonts/metadata.js +91 -0
- package/dist/excalidraw/fractionalIndex.d.ts +12 -5
- package/dist/excalidraw/fractionalIndex.js +40 -10
- package/dist/excalidraw/frame.d.ts +4 -4
- package/dist/excalidraw/frame.js +3 -3
- package/dist/excalidraw/gatransforms.d.ts +1 -1
- package/dist/excalidraw/gesture.d.ts +1 -1
- package/dist/excalidraw/groups.d.ts +4 -4
- package/dist/excalidraw/history.d.ts +8 -7
- package/dist/excalidraw/history.js +8 -8
- package/dist/excalidraw/hooks/useEmitter.d.ts +1 -1
- package/dist/excalidraw/hooks/useLibraryItemSvg.d.ts +1 -1
- package/dist/excalidraw/i18n.d.ts +1 -1
- package/dist/excalidraw/index.d.ts +2 -2
- package/dist/excalidraw/index.js +3 -3
- package/dist/excalidraw/jotai.d.ts +1 -1
- package/dist/excalidraw/laser-trails.d.ts +3 -2
- package/dist/excalidraw/locales/en.json +42 -7
- package/dist/excalidraw/math.d.ts +47 -2
- package/dist/excalidraw/math.js +116 -0
- package/dist/excalidraw/mermaid.d.ts +2 -0
- package/dist/excalidraw/mermaid.js +29 -0
- package/dist/excalidraw/points.d.ts +1 -1
- package/dist/excalidraw/queue.d.ts +1 -1
- package/dist/excalidraw/renderer/helpers.d.ts +2 -2
- package/dist/excalidraw/renderer/interactiveScene.d.ts +2 -2
- package/dist/excalidraw/renderer/interactiveScene.js +64 -22
- package/dist/excalidraw/renderer/renderElement.d.ts +6 -4
- package/dist/excalidraw/renderer/renderElement.js +78 -58
- package/dist/excalidraw/renderer/renderSnaps.d.ts +1 -1
- package/dist/excalidraw/renderer/staticScene.d.ts +1 -1
- package/dist/excalidraw/renderer/staticSvgScene.d.ts +4 -4
- package/dist/excalidraw/renderer/staticSvgScene.js +2 -1
- package/dist/excalidraw/scene/Renderer.d.ts +4 -4
- package/dist/excalidraw/scene/Renderer.js +2 -3
- package/dist/excalidraw/scene/Scene.d.ts +16 -7
- package/dist/excalidraw/scene/Scene.js +26 -11
- package/dist/excalidraw/scene/Shape.d.ts +1 -1
- package/dist/excalidraw/scene/Shape.js +56 -5
- package/dist/excalidraw/scene/ShapeCache.d.ts +4 -4
- package/dist/excalidraw/scene/comparisons.d.ts +3 -2
- package/dist/excalidraw/scene/comparisons.js +1 -1
- package/dist/excalidraw/scene/export.d.ts +4 -3
- package/dist/excalidraw/scene/export.js +34 -36
- package/dist/excalidraw/scene/scroll.d.ts +2 -2
- package/dist/excalidraw/scene/scrollbars.d.ts +3 -3
- package/dist/excalidraw/scene/selection.d.ts +2 -2
- package/dist/excalidraw/scene/types.d.ts +6 -8
- package/dist/excalidraw/scene/zoom.d.ts +1 -1
- package/dist/excalidraw/shapes.d.ts +8 -0
- package/dist/excalidraw/shapes.js +57 -0
- package/dist/excalidraw/snapping.d.ts +4 -4
- package/dist/excalidraw/snapping.js +2 -1
- package/dist/excalidraw/store.d.ts +34 -4
- package/dist/excalidraw/store.js +27 -0
- package/dist/excalidraw/types.d.ts +32 -21
- package/dist/excalidraw/utils.d.ts +15 -5
- package/dist/excalidraw/utils.js +22 -0
- package/dist/excalidraw/zindex.d.ts +2 -2
- package/dist/prod/CascadiaCode-Regular-TMZI7IJ5.woff2 +0 -0
- package/dist/prod/ComicShanns-Regular-6TOETDFT.woff2 +0 -0
- package/dist/prod/Excalifont-Regular-CPKEUDVM.woff2 +0 -0
- package/dist/prod/LiberationSans-Regular-ZQD73GJM.woff2 +0 -0
- package/dist/prod/Virgil-Regular-YHAB2VGJ.woff2 +0 -0
- package/dist/prod/{en-XW4JO6VX.json → en-YNVBSAIL.json} +42 -7
- package/dist/prod/index.css +1 -1
- package/dist/prod/index.js +49 -53
- package/dist/utils/bbox.d.ts +2 -2
- package/dist/utils/collision.d.ts +1 -1
- package/dist/utils/export.d.ts +4 -3
- package/dist/utils/export.js +2 -1
- package/dist/utils/geometry/geometry.d.ts +3 -2
- package/dist/utils/geometry/geometry.js +5 -1
- package/dist/utils/geometry/shape.d.ts +1 -1
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +1 -0
- package/dist/utils/withinBounds.d.ts +1 -1
- package/history.ts +13 -6
- package/package.json +2 -2
- package/dist/browser/dev/Cascadia-CYPE3OJC.woff2 +0 -0
- package/dist/browser/dev/Virgil-UZN6MUT6.woff2 +0 -0
- package/dist/browser/dev/excalidraw-assets-dev/chunk-BLEB3M62.js.map +0 -7
- package/dist/browser/dev/excalidraw-assets-dev/chunk-XOM7LNOU.js.map +0 -7
- package/dist/browser/dev/excalidraw-assets-dev/dist-ITJNUBZF.js.map +0 -7
- package/dist/browser/prod/Cascadia-CYPE3OJC.woff2 +0 -0
- package/dist/browser/prod/Virgil-UZN6MUT6.woff2 +0 -0
- package/dist/browser/prod/excalidraw-assets/chunk-UWBW5SR2.js +0 -55
- package/dist/browser/prod/excalidraw-assets/dist-54276HPL.js +0 -6
- package/dist/browser/prod/excalidraw-assets/en-7GPZE2Y2.js +0 -1
- package/dist/browser/prod/excalidraw-assets/image-35KQQ5EN.js +0 -1
- package/dist/dev/Cascadia-CYPE3OJC.woff2 +0 -0
- package/dist/dev/Virgil-UZN6MUT6.woff2 +0 -0
- package/dist/excalidraw/components/Stats.d.ts +0 -11
- package/dist/excalidraw/components/Stats.js +0 -13
- package/dist/excalidraw/scene/Fonts.d.ts +0 -21
- package/dist/excalidraw/scene/Fonts.js +0 -72
- package/dist/prod/Cascadia-CYPE3OJC.woff2 +0 -0
- package/dist/prod/Virgil-UZN6MUT6.woff2 +0 -0
- /package/dist/browser/dev/{Assistant-Bold-ZDZZ6JHA.woff2 → excalidraw-assets-dev/Assistant-Bold-ZDZZ6JHA.woff2} +0 -0
- /package/dist/browser/dev/{Assistant-Medium-DZ25RZU3.woff2 → excalidraw-assets-dev/Assistant-Medium-DZ25RZU3.woff2} +0 -0
- /package/dist/browser/dev/{Assistant-Regular-PLF2XOGW.woff2 → excalidraw-assets-dev/Assistant-Regular-PLF2XOGW.woff2} +0 -0
- /package/dist/browser/dev/{Assistant-SemiBold-CZ5MX6FK.woff2 → excalidraw-assets-dev/Assistant-SemiBold-CZ5MX6FK.woff2} +0 -0
- /package/dist/browser/dev/excalidraw-assets-dev/{en-TR4QLF5E.js.map → en-XV7OZCPP.js.map} +0 -0
- /package/dist/browser/dev/excalidraw-assets-dev/{image-ZGDDRBEN.js.map → image-77HZYGLG.js.map} +0 -0
- /package/dist/browser/prod/{Assistant-Bold-ZDZZ6JHA.woff2 → excalidraw-assets/Assistant-Bold-ZDZZ6JHA.woff2} +0 -0
- /package/dist/browser/prod/{Assistant-Medium-DZ25RZU3.woff2 → excalidraw-assets/Assistant-Medium-DZ25RZU3.woff2} +0 -0
- /package/dist/browser/prod/{Assistant-Regular-PLF2XOGW.woff2 → excalidraw-assets/Assistant-Regular-PLF2XOGW.woff2} +0 -0
- /package/dist/browser/prod/{Assistant-SemiBold-CZ5MX6FK.woff2 → excalidraw-assets/Assistant-SemiBold-CZ5MX6FK.woff2} +0 -0
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { AppStateChange, ElementsChange } from "./change";
|
|
2
|
-
import { SceneElementsMap } from "./element/types";
|
|
1
|
+
import type { AppStateChange, ElementsChange } from "./change";
|
|
2
|
+
import type { SceneElementsMap } from "./element/types";
|
|
3
3
|
import { Emitter } from "./emitter";
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
4
|
+
import type Scene from "./scene/Scene";
|
|
5
|
+
import type { Snapshot } from "./store";
|
|
6
|
+
import type { AppState } from "./types";
|
|
6
7
|
export declare class HistoryChangedEvent {
|
|
7
8
|
readonly isUndoStackEmpty: boolean;
|
|
8
9
|
readonly isRedoStackEmpty: boolean;
|
|
@@ -19,8 +20,8 @@ export declare class History {
|
|
|
19
20
|
* Record a local change which will go into the history
|
|
20
21
|
*/
|
|
21
22
|
record(elementsChange: ElementsChange, appStateChange: AppStateChange): void;
|
|
22
|
-
undo(elements: SceneElementsMap, appState: AppState, snapshot: Readonly<Snapshot
|
|
23
|
-
redo(elements: SceneElementsMap, appState: AppState, snapshot: Readonly<Snapshot
|
|
23
|
+
undo(elements: SceneElementsMap, appState: AppState, snapshot: Readonly<Snapshot>, scene: Scene): void | [SceneElementsMap, AppState];
|
|
24
|
+
redo(elements: SceneElementsMap, appState: AppState, snapshot: Readonly<Snapshot>, scene: Scene): void | [SceneElementsMap, AppState];
|
|
24
25
|
private perform;
|
|
25
26
|
private static pop;
|
|
26
27
|
private static push;
|
|
@@ -31,7 +32,7 @@ export declare class HistoryEntry {
|
|
|
31
32
|
private constructor();
|
|
32
33
|
static create(appStateChange: AppStateChange, elementsChange: ElementsChange): HistoryEntry;
|
|
33
34
|
inverse(): HistoryEntry;
|
|
34
|
-
applyTo(elements: SceneElementsMap, appState: AppState, snapshot: Readonly<Snapshot
|
|
35
|
+
applyTo(elements: SceneElementsMap, appState: AppState, snapshot: Readonly<Snapshot>, scene: Scene): [SceneElementsMap, AppState, boolean];
|
|
35
36
|
/**
|
|
36
37
|
* Apply latest (remote) changes to the history entry, creates new instance of `HistoryEntry`.
|
|
37
38
|
*/
|
|
@@ -38,13 +38,13 @@ export class History {
|
|
|
38
38
|
this.onHistoryChangedEmitter.trigger(new HistoryChangedEvent(this.isUndoStackEmpty, this.isRedoStackEmpty));
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
|
-
undo(elements, appState, snapshot) {
|
|
42
|
-
return this.perform(elements, appState, snapshot, () => History.pop(this.undoStack), (entry) => History.push(this.redoStack, entry, elements));
|
|
41
|
+
undo(elements, appState, snapshot, scene) {
|
|
42
|
+
return this.perform(elements, appState, snapshot, () => History.pop(this.undoStack), (entry) => History.push(this.redoStack, entry, elements), scene);
|
|
43
43
|
}
|
|
44
|
-
redo(elements, appState, snapshot) {
|
|
45
|
-
return this.perform(elements, appState, snapshot, () => History.pop(this.redoStack), (entry) => History.push(this.undoStack, entry, elements));
|
|
44
|
+
redo(elements, appState, snapshot, scene) {
|
|
45
|
+
return this.perform(elements, appState, snapshot, () => History.pop(this.redoStack), (entry) => History.push(this.undoStack, entry, elements), scene);
|
|
46
46
|
}
|
|
47
|
-
perform(elements, appState, snapshot, pop, push) {
|
|
47
|
+
perform(elements, appState, snapshot, pop, push, scene) {
|
|
48
48
|
try {
|
|
49
49
|
let historyEntry = pop();
|
|
50
50
|
if (historyEntry === null) {
|
|
@@ -57,7 +57,7 @@ export class History {
|
|
|
57
57
|
while (historyEntry) {
|
|
58
58
|
try {
|
|
59
59
|
[nextElements, nextAppState, containsVisibleChange] =
|
|
60
|
-
historyEntry.applyTo(nextElements, nextAppState, snapshot);
|
|
60
|
+
historyEntry.applyTo(nextElements, nextAppState, snapshot, scene);
|
|
61
61
|
}
|
|
62
62
|
finally {
|
|
63
63
|
// make sure to always push / pop, even if the increment is corrupted
|
|
@@ -104,8 +104,8 @@ export class HistoryEntry {
|
|
|
104
104
|
inverse() {
|
|
105
105
|
return new HistoryEntry(this.appStateChange.inverse(), this.elementsChange.inverse());
|
|
106
106
|
}
|
|
107
|
-
applyTo(elements, appState, snapshot) {
|
|
108
|
-
const [nextElements, elementsContainVisibleChange] = this.elementsChange.applyTo(elements, snapshot.elements);
|
|
107
|
+
applyTo(elements, appState, snapshot, scene) {
|
|
108
|
+
const [nextElements, elementsContainVisibleChange] = this.elementsChange.applyTo(elements, snapshot.elements, scene);
|
|
109
109
|
const [nextAppState, appStateContainsVisibleChange] = this.appStateChange.applyTo(appState, nextElements);
|
|
110
110
|
const appliedVisibleChanges = elementsContainVisibleChange || appStateContainsVisibleChange;
|
|
111
111
|
return [nextElements, nextAppState, appliedVisibleChanges];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Emitter } from "../emitter";
|
|
1
|
+
import type { Emitter } from "../emitter";
|
|
2
2
|
export declare const useEmitter: <TEvent extends unknown>(emitter: Emitter<[TEvent]>, initialState: TEvent) => TEvent;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import "./css/app.scss";
|
|
3
3
|
import "./css/styles.scss";
|
|
4
|
-
import "
|
|
5
|
-
import { ExcalidrawProps } from "./types";
|
|
4
|
+
import "./fonts/assets/fonts.css";
|
|
5
|
+
import type { ExcalidrawProps } from "./types";
|
|
6
6
|
import Footer from "./components/footer/FooterCenter";
|
|
7
7
|
import MainMenu from "./components/main-menu/MainMenu";
|
|
8
8
|
import WelcomeScreen from "./components/welcome-screen/WelcomeScreen";
|
package/dist/excalidraw/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import App from "./components/App";
|
|
|
5
5
|
import { isShallowEqual } from "./utils";
|
|
6
6
|
import "./css/app.scss";
|
|
7
7
|
import "./css/styles.scss";
|
|
8
|
-
import "
|
|
8
|
+
import "./fonts/assets/fonts.css";
|
|
9
9
|
import polyfill from "./polyfill";
|
|
10
10
|
import { defaultLang } from "./i18n";
|
|
11
11
|
import { DEFAULT_UI_OPTIONS } from "./constants";
|
|
@@ -17,7 +17,7 @@ import WelcomeScreen from "./components/welcome-screen/WelcomeScreen";
|
|
|
17
17
|
import LiveCollaborationTrigger from "./components/live-collaboration/LiveCollaborationTrigger";
|
|
18
18
|
polyfill();
|
|
19
19
|
const ExcalidrawBase = (props) => {
|
|
20
|
-
const { onChange, initialData, excalidrawAPI, isCollaborating = false, onPointerUpdate, renderTopRightUI, langCode = defaultLang.code, viewModeEnabled, zenModeEnabled, gridModeEnabled, libraryReturnUrl, theme, name, renderCustomStats, onPaste, detectScroll = true, handleKeyboardGlobally = false, onLibraryChange, autoFocus = false, generateIdForFile, onLinkOpen, onPointerDown, onPointerUp, onScrollChange, children, validateEmbeddable, renderEmbeddable, aiEnabled, } = props;
|
|
20
|
+
const { onChange, initialData, excalidrawAPI, isCollaborating = false, onPointerUpdate, renderTopRightUI, langCode = defaultLang.code, viewModeEnabled, zenModeEnabled, gridModeEnabled, libraryReturnUrl, theme, name, renderCustomStats, onPaste, detectScroll = true, handleKeyboardGlobally = false, onLibraryChange, autoFocus = false, generateIdForFile, onLinkOpen, onPointerDown, onPointerUp, onScrollChange, children, validateEmbeddable, renderEmbeddable, aiEnabled, showDeprecatedFonts, } = props;
|
|
21
21
|
const canvasActions = props.UIOptions?.canvasActions;
|
|
22
22
|
// FIXME normalize/set defaults in parent component so that the memo resolver
|
|
23
23
|
// compares the same values
|
|
@@ -60,7 +60,7 @@ const ExcalidrawBase = (props) => {
|
|
|
60
60
|
document.removeEventListener("touchmove", handleTouchMove);
|
|
61
61
|
};
|
|
62
62
|
}, []);
|
|
63
|
-
return (_jsx(Provider, { unstable_createStore: () => jotaiStore, scope: jotaiScope, children: _jsx(InitializeApp, { langCode: langCode, theme: theme, children: _jsx(App, { onChange: onChange, initialData: initialData, excalidrawAPI: excalidrawAPI, isCollaborating: isCollaborating, onPointerUpdate: onPointerUpdate, renderTopRightUI: renderTopRightUI, langCode: langCode, viewModeEnabled: viewModeEnabled, zenModeEnabled: zenModeEnabled, gridModeEnabled: gridModeEnabled, libraryReturnUrl: libraryReturnUrl, theme: theme, name: name, renderCustomStats: renderCustomStats, UIOptions: UIOptions, onPaste: onPaste, detectScroll: detectScroll, handleKeyboardGlobally: handleKeyboardGlobally, onLibraryChange: onLibraryChange, autoFocus: autoFocus, generateIdForFile: generateIdForFile, onLinkOpen: onLinkOpen, onPointerDown: onPointerDown, onPointerUp: onPointerUp, onScrollChange: onScrollChange, validateEmbeddable: validateEmbeddable, renderEmbeddable: renderEmbeddable, aiEnabled: aiEnabled !== false, children: children }) }) }));
|
|
63
|
+
return (_jsx(Provider, { unstable_createStore: () => jotaiStore, scope: jotaiScope, children: _jsx(InitializeApp, { langCode: langCode, theme: theme, children: _jsx(App, { onChange: onChange, initialData: initialData, excalidrawAPI: excalidrawAPI, isCollaborating: isCollaborating, onPointerUpdate: onPointerUpdate, renderTopRightUI: renderTopRightUI, langCode: langCode, viewModeEnabled: viewModeEnabled, zenModeEnabled: zenModeEnabled, gridModeEnabled: gridModeEnabled, libraryReturnUrl: libraryReturnUrl, theme: theme, name: name, renderCustomStats: renderCustomStats, UIOptions: UIOptions, onPaste: onPaste, detectScroll: detectScroll, handleKeyboardGlobally: handleKeyboardGlobally, onLibraryChange: onLibraryChange, autoFocus: autoFocus, generateIdForFile: generateIdForFile, onLinkOpen: onLinkOpen, onPointerDown: onPointerDown, onPointerUp: onPointerUp, onScrollChange: onScrollChange, validateEmbeddable: validateEmbeddable, renderEmbeddable: renderEmbeddable, aiEnabled: aiEnabled !== false, showDeprecatedFonts: showDeprecatedFonts, children: children }) }) }));
|
|
64
64
|
};
|
|
65
65
|
const areEqual = (prevProps, nextProps) => {
|
|
66
66
|
// short-circuit early
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { Trail } from "./animated-trail";
|
|
2
|
+
import { AnimatedTrail } from "./animated-trail";
|
|
3
|
+
import type { AnimationFrameHandler } from "./animation-frame-handler";
|
|
3
4
|
import type App from "./components/App";
|
|
4
5
|
export declare class LaserTrails implements Trail {
|
|
5
6
|
private animationFrameHandler;
|
|
@@ -46,6 +46,10 @@
|
|
|
46
46
|
"arrowhead_triangle_outline": "Triangle (outline)",
|
|
47
47
|
"arrowhead_diamond": "Diamond",
|
|
48
48
|
"arrowhead_diamond_outline": "Diamond (outline)",
|
|
49
|
+
"arrowtypes": "Arrow type",
|
|
50
|
+
"arrowtype_sharp": "Sharp arrow",
|
|
51
|
+
"arrowtype_round": "Curved arrow",
|
|
52
|
+
"arrowtype_elbowed": "Elbow arrow",
|
|
49
53
|
"fontSize": "Font size",
|
|
50
54
|
"fontFamily": "Font family",
|
|
51
55
|
"addWatermark": "Add \"Made with Excalidraw\"",
|
|
@@ -109,6 +113,7 @@
|
|
|
109
113
|
"share": "Share",
|
|
110
114
|
"showStroke": "Show stroke color picker",
|
|
111
115
|
"showBackground": "Show background color picker",
|
|
116
|
+
"showFonts": "Show font picker",
|
|
112
117
|
"toggleTheme": "Toggle light/dark theme",
|
|
113
118
|
"theme": "Theme",
|
|
114
119
|
"personalLib": "Personal Library",
|
|
@@ -129,7 +134,7 @@
|
|
|
129
134
|
},
|
|
130
135
|
"lineEditor": {
|
|
131
136
|
"edit": "Edit line",
|
|
132
|
-
"
|
|
137
|
+
"editArrow": "Edit arrow"
|
|
133
138
|
},
|
|
134
139
|
"elementLock": {
|
|
135
140
|
"lock": "Lock",
|
|
@@ -148,7 +153,9 @@
|
|
|
148
153
|
"discordChat": "Discord chat",
|
|
149
154
|
"zoomToFitViewport": "Zoom to fit in viewport",
|
|
150
155
|
"zoomToFitSelection": "Zoom to fit selection",
|
|
151
|
-
"zoomToFit": "Zoom to fit all elements"
|
|
156
|
+
"zoomToFit": "Zoom to fit all elements",
|
|
157
|
+
"installPWA": "Install Excalidraw locally (PWA)",
|
|
158
|
+
"autoResize": "Enable text auto-resizing"
|
|
152
159
|
},
|
|
153
160
|
"library": {
|
|
154
161
|
"noItems": "No items added yet...",
|
|
@@ -268,6 +275,22 @@
|
|
|
268
275
|
"mermaidToExcalidraw": "Mermaid to Excalidraw",
|
|
269
276
|
"magicSettings": "AI settings"
|
|
270
277
|
},
|
|
278
|
+
"element": {
|
|
279
|
+
"rectangle": "Rectangle",
|
|
280
|
+
"diamond": "Diamond",
|
|
281
|
+
"ellipse": "Ellipse",
|
|
282
|
+
"arrow": "Arrow",
|
|
283
|
+
"line": "Line",
|
|
284
|
+
"freedraw": "Freedraw",
|
|
285
|
+
"text": "Text",
|
|
286
|
+
"image": "Image",
|
|
287
|
+
"group": "Group",
|
|
288
|
+
"frame": "Frame",
|
|
289
|
+
"magicframe": "Wireframe to code",
|
|
290
|
+
"embeddable": "Web Embed",
|
|
291
|
+
"selection": "Selection",
|
|
292
|
+
"iframe": "IFrame"
|
|
293
|
+
},
|
|
271
294
|
"headings": {
|
|
272
295
|
"canvasActions": "Canvas actions",
|
|
273
296
|
"selectedShapeActions": "Selected shape actions",
|
|
@@ -276,6 +299,7 @@
|
|
|
276
299
|
"hints": {
|
|
277
300
|
"canvasPanning": "To move canvas, hold mouse wheel or spacebar while dragging, or use the hand tool",
|
|
278
301
|
"linearElement": "Click to start multiple points, drag for single line",
|
|
302
|
+
"arrowTool": "Click to start multiple points, drag for single line. Press {{arrowShortcut}} again to change arrow type.",
|
|
279
303
|
"freeDraw": "Click and drag, release when you're finished",
|
|
280
304
|
"text": "Tip: you can also add text by double-clicking anywhere with the selection tool",
|
|
281
305
|
"embeddable": "Click-drag to create a website embed",
|
|
@@ -441,7 +465,10 @@
|
|
|
441
465
|
"scene": "Scene",
|
|
442
466
|
"selected": "Selected",
|
|
443
467
|
"storage": "Storage",
|
|
444
|
-
"
|
|
468
|
+
"fullTitle": "Stats & Element properties",
|
|
469
|
+
"title": "Stats",
|
|
470
|
+
"generalStats": "General stats",
|
|
471
|
+
"elementProperties": "Element properties",
|
|
445
472
|
"total": "Total",
|
|
446
473
|
"version": "Version",
|
|
447
474
|
"versionCopy": "Click to copy",
|
|
@@ -536,11 +563,19 @@
|
|
|
536
563
|
"syntax": "Mermaid Syntax",
|
|
537
564
|
"preview": "Preview"
|
|
538
565
|
},
|
|
539
|
-
"
|
|
540
|
-
"
|
|
541
|
-
|
|
542
|
-
|
|
566
|
+
"quickSearch": {
|
|
567
|
+
"placeholder": "Quick search"
|
|
568
|
+
},
|
|
569
|
+
"fontList": {
|
|
570
|
+
"badge": {
|
|
571
|
+
"old": "old"
|
|
543
572
|
},
|
|
573
|
+
"sceneFonts": "In this scene",
|
|
574
|
+
"availableFonts": "Available fonts",
|
|
575
|
+
"empty": "No fonts found"
|
|
576
|
+
},
|
|
577
|
+
"userList": {
|
|
578
|
+
"empty": "No users found",
|
|
544
579
|
"hint": {
|
|
545
580
|
"text": "Click on user to follow",
|
|
546
581
|
"followStatus": "You're currently following this user",
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { Point, Zoom } from "./types";
|
|
2
|
-
import { ExcalidrawElement, ExcalidrawLinearElement, NonDeleted } from "./element/types";
|
|
1
|
+
import type { Point, Zoom } from "./types";
|
|
2
|
+
import type { ExcalidrawElement, ExcalidrawLinearElement, NonDeleted } from "./element/types";
|
|
3
|
+
import type { Bounds } from "./element/bounds";
|
|
3
4
|
export declare const rotate: (x: number, y: number, cx: number, cy: number, angle: number) => [number, number];
|
|
4
5
|
export declare const rotatePoint: (point: readonly [number, number], center: readonly [number, number], angle: number) => [number, number];
|
|
5
6
|
export declare const adjustXYWithRotation: (sides: {
|
|
@@ -14,6 +15,7 @@ export declare const getPointOnAPath: (point: readonly [number, number], path: P
|
|
|
14
15
|
segment: number;
|
|
15
16
|
} | null;
|
|
16
17
|
export declare const distance2d: (x1: number, y1: number, x2: number, y2: number) => number;
|
|
18
|
+
export declare const distanceSq2d: (p1: readonly [number, number], p2: readonly [number, number]) => number;
|
|
17
19
|
export declare const centerPoint: (a: readonly [number, number], b: readonly [number, number]) => readonly [number, number];
|
|
18
20
|
export declare const isPathALoop: (points: ExcalidrawLinearElement["points"], zoomValue?: Zoom["value"]) => boolean;
|
|
19
21
|
export declare const isPointInPolygon: (points: Point[], x: number, y: number) => boolean;
|
|
@@ -28,6 +30,49 @@ export declare const getBezierCurveLength: (element: NonDeleted<ExcalidrawLinear
|
|
|
28
30
|
export declare const mapIntervalToBezierT: (element: NonDeleted<ExcalidrawLinearElement>, endPoint: readonly [number, number], interval: number) => number;
|
|
29
31
|
export declare const arePointsEqual: (p1: readonly [number, number], p2: readonly [number, number]) => boolean;
|
|
30
32
|
export declare const isRightAngle: (angle: number) => boolean;
|
|
33
|
+
export declare const radianToDegree: (r: number) => number;
|
|
34
|
+
export declare const degreeToRadian: (d: number) => number;
|
|
31
35
|
export declare const rangesOverlap: ([a0, a1]: [number, number], [b0, b1]: [number, number]) => boolean;
|
|
32
36
|
export declare const rangeIntersection: (rangeA: [number, number], rangeB: [number, number]) => [number, number] | null;
|
|
33
37
|
export declare const isValueInRange: (value: number, min: number, max: number) => boolean;
|
|
38
|
+
export declare const translatePoint: (p: readonly [number, number], v: import("../utils/geometry/shape").Point) => readonly [number, number];
|
|
39
|
+
export declare const scaleVector: (v: import("../utils/geometry/shape").Point, scalar: number) => import("../utils/geometry/shape").Point;
|
|
40
|
+
export declare const pointToVector: (p: readonly [number, number], origin?: readonly [number, number]) => import("../utils/geometry/shape").Point;
|
|
41
|
+
export declare const scalePointFromOrigin: (p: readonly [number, number], mid: readonly [number, number], multiplier: number) => readonly [number, number];
|
|
42
|
+
export declare const PointInTriangle: (pt: readonly [number, number], v1: readonly [number, number], v2: readonly [number, number], v3: readonly [number, number]) => boolean;
|
|
43
|
+
export declare const magnitudeSq: (vector: import("../utils/geometry/shape").Point) => number;
|
|
44
|
+
export declare const magnitude: (vector: import("../utils/geometry/shape").Point) => number;
|
|
45
|
+
export declare const normalize: (vector: import("../utils/geometry/shape").Point) => import("../utils/geometry/shape").Point;
|
|
46
|
+
export declare const addVectors: (vec1: readonly [number, number], vec2: readonly [number, number]) => import("../utils/geometry/shape").Point;
|
|
47
|
+
export declare const subtractVectors: (vec1: readonly [number, number], vec2: readonly [number, number]) => import("../utils/geometry/shape").Point;
|
|
48
|
+
export declare const pointInsideBounds: (p: readonly [number, number], bounds: Bounds) => boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Get the axis-aligned bounding box for a given element
|
|
51
|
+
*/
|
|
52
|
+
export declare const aabbForElement: (element: Readonly<ExcalidrawElement>, offset?: [number, number, number, number]) => Bounds;
|
|
53
|
+
type PolarCoords = [number, number];
|
|
54
|
+
/**
|
|
55
|
+
* Return the polar coordinates for the given carthesian point represented by
|
|
56
|
+
* (x, y) for the center point 0,0 where the first number returned is the radius,
|
|
57
|
+
* the second is the angle in radians.
|
|
58
|
+
*/
|
|
59
|
+
export declare const carthesian2Polar: ([x, y]: readonly [number, number]) => PolarCoords;
|
|
60
|
+
/**
|
|
61
|
+
* Angles are in radians and centered on 0, 0. Zero radians on a 1 radius circle
|
|
62
|
+
* corresponds to (1, 0) carthesian coordinates (point), i.e. to the "right".
|
|
63
|
+
*/
|
|
64
|
+
type SymmetricArc = {
|
|
65
|
+
radius: number;
|
|
66
|
+
startAngle: number;
|
|
67
|
+
endAngle: number;
|
|
68
|
+
};
|
|
69
|
+
/**
|
|
70
|
+
* Determines if a carthesian point lies on a symmetric arc, i.e. an arc which
|
|
71
|
+
* is part of a circle contour centered on 0, 0.
|
|
72
|
+
*/
|
|
73
|
+
export declare const isPointOnSymmetricArc: ({ radius: arcRadius, startAngle, endAngle }: SymmetricArc, point: readonly [number, number]) => boolean;
|
|
74
|
+
export declare const getCenterForBounds: (bounds: Bounds) => readonly [number, number];
|
|
75
|
+
export declare const getCenterForElement: (element: ExcalidrawElement) => readonly [number, number];
|
|
76
|
+
export declare const aabbsOverlapping: (a: Bounds, b: Bounds) => boolean;
|
|
77
|
+
export declare const clamp: (value: number, min: number, max: number) => number;
|
|
78
|
+
export {};
|
package/dist/excalidraw/math.js
CHANGED
|
@@ -102,6 +102,11 @@ export const distance2d = (x1, y1, x2, y2) => {
|
|
|
102
102
|
const yd = y2 - y1;
|
|
103
103
|
return Math.hypot(xd, yd);
|
|
104
104
|
};
|
|
105
|
+
export const distanceSq2d = (p1, p2) => {
|
|
106
|
+
const xd = p2[0] - p1[0];
|
|
107
|
+
const yd = p2[1] - p1[1];
|
|
108
|
+
return xd * xd + yd * yd;
|
|
109
|
+
};
|
|
105
110
|
export const centerPoint = (a, b) => {
|
|
106
111
|
return [(a[0] + b[0]) / 2, (a[1] + b[1]) / 2];
|
|
107
112
|
};
|
|
@@ -338,6 +343,12 @@ export const isRightAngle = (angle) => {
|
|
|
338
343
|
// angle, which we can check with modulo after rounding.
|
|
339
344
|
return Math.round((angle / Math.PI) * 10000) % 5000 === 0;
|
|
340
345
|
};
|
|
346
|
+
export const radianToDegree = (r) => {
|
|
347
|
+
return (r * 180) / Math.PI;
|
|
348
|
+
};
|
|
349
|
+
export const degreeToRadian = (d) => {
|
|
350
|
+
return (d / 180) * Math.PI;
|
|
351
|
+
};
|
|
341
352
|
// Given two ranges, return if the two ranges overlap with each other
|
|
342
353
|
// e.g. [1, 3] overlaps with [2, 4] while [1, 3] does not overlap with [4, 5]
|
|
343
354
|
export const rangesOverlap = ([a0, a1], [b0, b1]) => {
|
|
@@ -362,3 +373,108 @@ export const rangeIntersection = (rangeA, rangeB) => {
|
|
|
362
373
|
export const isValueInRange = (value, min, max) => {
|
|
363
374
|
return value >= min && value <= max;
|
|
364
375
|
};
|
|
376
|
+
export const translatePoint = (p, v) => [
|
|
377
|
+
p[0] + v[0],
|
|
378
|
+
p[1] + v[1],
|
|
379
|
+
];
|
|
380
|
+
export const scaleVector = (v, scalar) => [
|
|
381
|
+
v[0] * scalar,
|
|
382
|
+
v[1] * scalar,
|
|
383
|
+
];
|
|
384
|
+
export const pointToVector = (p, origin = [0, 0]) => [
|
|
385
|
+
p[0] - origin[0],
|
|
386
|
+
p[1] - origin[1],
|
|
387
|
+
];
|
|
388
|
+
export const scalePointFromOrigin = (p, mid, multiplier) => translatePoint(mid, scaleVector(pointToVector(p, mid), multiplier));
|
|
389
|
+
const triangleSign = (p1, p2, p3) => (p1[0] - p3[0]) * (p2[1] - p3[1]) - (p2[0] - p3[0]) * (p1[1] - p3[1]);
|
|
390
|
+
export const PointInTriangle = (pt, v1, v2, v3) => {
|
|
391
|
+
const d1 = triangleSign(pt, v1, v2);
|
|
392
|
+
const d2 = triangleSign(pt, v2, v3);
|
|
393
|
+
const d3 = triangleSign(pt, v3, v1);
|
|
394
|
+
const has_neg = d1 < 0 || d2 < 0 || d3 < 0;
|
|
395
|
+
const has_pos = d1 > 0 || d2 > 0 || d3 > 0;
|
|
396
|
+
return !(has_neg && has_pos);
|
|
397
|
+
};
|
|
398
|
+
export const magnitudeSq = (vector) => vector[0] * vector[0] + vector[1] * vector[1];
|
|
399
|
+
export const magnitude = (vector) => Math.sqrt(magnitudeSq(vector));
|
|
400
|
+
export const normalize = (vector) => {
|
|
401
|
+
const m = magnitude(vector);
|
|
402
|
+
return [vector[0] / m, vector[1] / m];
|
|
403
|
+
};
|
|
404
|
+
export const addVectors = (vec1, vec2) => [vec1[0] + vec2[0], vec1[1] + vec2[1]];
|
|
405
|
+
export const subtractVectors = (vec1, vec2) => [vec1[0] - vec2[0], vec1[1] - vec2[1]];
|
|
406
|
+
export const pointInsideBounds = (p, bounds) => p[0] > bounds[0] && p[0] < bounds[2] && p[1] > bounds[1] && p[1] < bounds[3];
|
|
407
|
+
/**
|
|
408
|
+
* Get the axis-aligned bounding box for a given element
|
|
409
|
+
*/
|
|
410
|
+
export const aabbForElement = (element, offset) => {
|
|
411
|
+
const bbox = {
|
|
412
|
+
minX: element.x,
|
|
413
|
+
minY: element.y,
|
|
414
|
+
maxX: element.x + element.width,
|
|
415
|
+
maxY: element.y + element.height,
|
|
416
|
+
midX: element.x + element.width / 2,
|
|
417
|
+
midY: element.y + element.height / 2,
|
|
418
|
+
};
|
|
419
|
+
const center = [bbox.midX, bbox.midY];
|
|
420
|
+
const [topLeftX, topLeftY] = rotatePoint([bbox.minX, bbox.minY], center, element.angle);
|
|
421
|
+
const [topRightX, topRightY] = rotatePoint([bbox.maxX, bbox.minY], center, element.angle);
|
|
422
|
+
const [bottomRightX, bottomRightY] = rotatePoint([bbox.maxX, bbox.maxY], center, element.angle);
|
|
423
|
+
const [bottomLeftX, bottomLeftY] = rotatePoint([bbox.minX, bbox.maxY], center, element.angle);
|
|
424
|
+
const bounds = [
|
|
425
|
+
Math.min(topLeftX, topRightX, bottomRightX, bottomLeftX),
|
|
426
|
+
Math.min(topLeftY, topRightY, bottomRightY, bottomLeftY),
|
|
427
|
+
Math.max(topLeftX, topRightX, bottomRightX, bottomLeftX),
|
|
428
|
+
Math.max(topLeftY, topRightY, bottomRightY, bottomLeftY),
|
|
429
|
+
];
|
|
430
|
+
if (offset) {
|
|
431
|
+
const [topOffset, rightOffset, downOffset, leftOffset] = offset;
|
|
432
|
+
return [
|
|
433
|
+
bounds[0] - leftOffset,
|
|
434
|
+
bounds[1] - topOffset,
|
|
435
|
+
bounds[2] + rightOffset,
|
|
436
|
+
bounds[3] + downOffset,
|
|
437
|
+
];
|
|
438
|
+
}
|
|
439
|
+
return bounds;
|
|
440
|
+
};
|
|
441
|
+
/**
|
|
442
|
+
* Return the polar coordinates for the given carthesian point represented by
|
|
443
|
+
* (x, y) for the center point 0,0 where the first number returned is the radius,
|
|
444
|
+
* the second is the angle in radians.
|
|
445
|
+
*/
|
|
446
|
+
export const carthesian2Polar = ([x, y]) => [
|
|
447
|
+
Math.hypot(x, y),
|
|
448
|
+
Math.atan2(y, x),
|
|
449
|
+
];
|
|
450
|
+
/**
|
|
451
|
+
* Determines if a carthesian point lies on a symmetric arc, i.e. an arc which
|
|
452
|
+
* is part of a circle contour centered on 0, 0.
|
|
453
|
+
*/
|
|
454
|
+
export const isPointOnSymmetricArc = ({ radius: arcRadius, startAngle, endAngle }, point) => {
|
|
455
|
+
const [radius, angle] = carthesian2Polar(point);
|
|
456
|
+
return startAngle < endAngle
|
|
457
|
+
? Math.abs(radius - arcRadius) < 0.0000001 &&
|
|
458
|
+
startAngle <= angle &&
|
|
459
|
+
endAngle >= angle
|
|
460
|
+
: startAngle <= angle || endAngle >= angle;
|
|
461
|
+
};
|
|
462
|
+
export const getCenterForBounds = (bounds) => [
|
|
463
|
+
bounds[0] + (bounds[2] - bounds[0]) / 2,
|
|
464
|
+
bounds[1] + (bounds[3] - bounds[1]) / 2,
|
|
465
|
+
];
|
|
466
|
+
export const getCenterForElement = (element) => [
|
|
467
|
+
element.x + element.width / 2,
|
|
468
|
+
element.y + element.height / 2,
|
|
469
|
+
];
|
|
470
|
+
export const aabbsOverlapping = (a, b) => pointInsideBounds([a[0], a[1]], b) ||
|
|
471
|
+
pointInsideBounds([a[2], a[1]], b) ||
|
|
472
|
+
pointInsideBounds([a[2], a[3]], b) ||
|
|
473
|
+
pointInsideBounds([a[0], a[3]], b) ||
|
|
474
|
+
pointInsideBounds([b[0], b[1]], a) ||
|
|
475
|
+
pointInsideBounds([b[2], b[1]], a) ||
|
|
476
|
+
pointInsideBounds([b[2], b[3]], a) ||
|
|
477
|
+
pointInsideBounds([b[0], b[3]], a);
|
|
478
|
+
export const clamp = (value, min, max) => {
|
|
479
|
+
return Math.min(Math.max(value, min), max);
|
|
480
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/** heuristically checks whether the text may be a mermaid diagram definition */
|
|
2
|
+
export const isMaybeMermaidDefinition = (text) => {
|
|
3
|
+
const chartTypes = [
|
|
4
|
+
"flowchart",
|
|
5
|
+
"graph",
|
|
6
|
+
"sequenceDiagram",
|
|
7
|
+
"classDiagram",
|
|
8
|
+
"stateDiagram",
|
|
9
|
+
"stateDiagram-v2",
|
|
10
|
+
"erDiagram",
|
|
11
|
+
"journey",
|
|
12
|
+
"gantt",
|
|
13
|
+
"pie",
|
|
14
|
+
"quadrantChart",
|
|
15
|
+
"requirementDiagram",
|
|
16
|
+
"gitGraph",
|
|
17
|
+
"C4Context",
|
|
18
|
+
"mindmap",
|
|
19
|
+
"timeline",
|
|
20
|
+
"zenuml",
|
|
21
|
+
"sankey",
|
|
22
|
+
"xychart",
|
|
23
|
+
"block",
|
|
24
|
+
];
|
|
25
|
+
const re = new RegExp(`^(?:%%{.*?}%%[\\s\\n]*)?\\b(?:${chartTypes
|
|
26
|
+
.map((x) => `\\s*${x}(-beta)?`)
|
|
27
|
+
.join("|")})\\b`);
|
|
28
|
+
return re.test(text.trim());
|
|
29
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { StaticCanvasAppState, AppState } from "../types";
|
|
2
|
-
import { StaticCanvasRenderConfig } from "../scene/types";
|
|
1
|
+
import type { StaticCanvasAppState, AppState } from "../types";
|
|
2
|
+
import type { StaticCanvasRenderConfig } from "../scene/types";
|
|
3
3
|
export declare const fillCircle: (context: CanvasRenderingContext2D, cx: number, cy: number, radius: number, stroke?: boolean) => void;
|
|
4
4
|
export declare const getNormalizedCanvasDimensions: (canvas: HTMLCanvasElement, scale: number) => [number, number];
|
|
5
5
|
export declare const bootstrapCanvas: ({ canvas, scale, normalizedWidth, normalizedHeight, theme, isExporting, viewBackgroundColor, }: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { InteractiveSceneRenderConfig, RenderableElementsMap } from "../scene/types";
|
|
1
|
+
import type { InteractiveSceneRenderConfig, RenderableElementsMap } from "../scene/types";
|
|
2
2
|
/** throttled to animation framerate */
|
|
3
3
|
export declare const renderInteractiveSceneThrottled: {
|
|
4
4
|
(config: InteractiveSceneRenderConfig): void;
|
|
@@ -9,7 +9,7 @@ export declare const renderInteractiveSceneThrottled: {
|
|
|
9
9
|
* Interactive scene is the ui-canvas where we render bounding boxes, selections
|
|
10
10
|
* and other ui stuff.
|
|
11
11
|
*/
|
|
12
|
-
export declare const renderInteractiveScene: <U extends ({ canvas, elementsMap, visibleElements, selectedElements, scale, appState, renderConfig, device, }: InteractiveSceneRenderConfig) => {
|
|
12
|
+
export declare const renderInteractiveScene: <U extends ({ canvas, elementsMap, visibleElements, selectedElements, allElementsMap, scale, appState, renderConfig, device, }: InteractiveSceneRenderConfig) => {
|
|
13
13
|
atLeastOneVisibleElement: boolean;
|
|
14
14
|
elementsMap: RenderableElementsMap;
|
|
15
15
|
scrollBars?: undefined;
|