@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
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { isTextElement } from "../element";
|
|
2
|
+
import { newElementWith } from "../element/mutateElement";
|
|
3
|
+
import { measureText } from "../element/textElement";
|
|
4
|
+
import { getSelectedElements } from "../scene";
|
|
5
|
+
import { StoreAction } from "../store";
|
|
6
|
+
import { getFontString } from "../utils";
|
|
7
|
+
import { register } from "./register";
|
|
8
|
+
export const actionTextAutoResize = register({
|
|
9
|
+
name: "autoResize",
|
|
10
|
+
label: "labels.autoResize",
|
|
11
|
+
icon: null,
|
|
12
|
+
trackEvent: { category: "element" },
|
|
13
|
+
predicate: (elements, appState, _, app) => {
|
|
14
|
+
const selectedElements = getSelectedElements(elements, appState);
|
|
15
|
+
return (selectedElements.length === 1 &&
|
|
16
|
+
isTextElement(selectedElements[0]) &&
|
|
17
|
+
!selectedElements[0].autoResize);
|
|
18
|
+
},
|
|
19
|
+
perform: (elements, appState, _, app) => {
|
|
20
|
+
const selectedElements = getSelectedElements(elements, appState);
|
|
21
|
+
return {
|
|
22
|
+
appState,
|
|
23
|
+
elements: elements.map((element) => {
|
|
24
|
+
if (element.id === selectedElements[0].id && isTextElement(element)) {
|
|
25
|
+
const metrics = measureText(element.originalText, getFontString(element), element.lineHeight);
|
|
26
|
+
return newElementWith(element, {
|
|
27
|
+
autoResize: true,
|
|
28
|
+
width: metrics.width,
|
|
29
|
+
height: metrics.height,
|
|
30
|
+
text: element.originalText,
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
return element;
|
|
34
|
+
}),
|
|
35
|
+
storeAction: StoreAction.CAPTURE,
|
|
36
|
+
};
|
|
37
|
+
},
|
|
38
|
+
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { AppState } from "../types";
|
|
2
|
+
import type { AppState } from "../types";
|
|
3
3
|
export declare const actionToggleGridMode: {
|
|
4
4
|
name: "gridMode";
|
|
5
5
|
icon: JSX.Element;
|
|
@@ -66,7 +66,9 @@ export declare const actionToggleGridMode: {
|
|
|
66
66
|
currentItemTextAlign: string;
|
|
67
67
|
currentItemStartArrowhead: import("../element/types").Arrowhead | null;
|
|
68
68
|
currentItemEndArrowhead: import("../element/types").Arrowhead | null;
|
|
69
|
+
currentHoveredFontFamily: number | null;
|
|
69
70
|
currentItemRoundness: import("../element/types").StrokeRoundness;
|
|
71
|
+
currentItemArrowType: "sharp" | "round" | "elbow";
|
|
70
72
|
viewBackgroundColor: string;
|
|
71
73
|
scrollX: number;
|
|
72
74
|
scrollY: number;
|
|
@@ -79,7 +81,7 @@ export declare const actionToggleGridMode: {
|
|
|
79
81
|
value: import("../types").NormalizedZoomValue;
|
|
80
82
|
}>;
|
|
81
83
|
openMenu: "canvas" | "shape" | null;
|
|
82
|
-
openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | null;
|
|
84
|
+
openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | null;
|
|
83
85
|
openSidebar: {
|
|
84
86
|
name: string;
|
|
85
87
|
tab?: string | undefined;
|
|
@@ -143,7 +145,10 @@ export declare const actionToggleGridMode: {
|
|
|
143
145
|
isSpeaking?: boolean | undefined;
|
|
144
146
|
isMuted?: boolean | undefined;
|
|
145
147
|
}>>;
|
|
146
|
-
|
|
148
|
+
stats: {
|
|
149
|
+
open: boolean;
|
|
150
|
+
panels: number;
|
|
151
|
+
};
|
|
147
152
|
currentChartType: import("../element/types").ChartType;
|
|
148
153
|
pasteDialog: {
|
|
149
154
|
shown: false;
|
|
@@ -163,7 +168,7 @@ export declare const actionToggleGridMode: {
|
|
|
163
168
|
userToFollow: import("../types").UserToFollow | null;
|
|
164
169
|
followedBy: Set<import("../types").SocketId>;
|
|
165
170
|
};
|
|
166
|
-
storeAction:
|
|
171
|
+
storeAction: "none";
|
|
167
172
|
};
|
|
168
173
|
checked: (appState: AppState) => boolean;
|
|
169
174
|
predicate: (element: readonly import("../element/types").ExcalidrawElement[], appState: AppState, props: import("../types").ExcalidrawProps) => boolean;
|
|
@@ -64,7 +64,9 @@ export declare const actionToggleObjectsSnapMode: {
|
|
|
64
64
|
currentItemTextAlign: string;
|
|
65
65
|
currentItemStartArrowhead: import("../element/types").Arrowhead | null;
|
|
66
66
|
currentItemEndArrowhead: import("../element/types").Arrowhead | null;
|
|
67
|
+
currentHoveredFontFamily: number | null;
|
|
67
68
|
currentItemRoundness: import("../element/types").StrokeRoundness;
|
|
69
|
+
currentItemArrowType: "sharp" | "round" | "elbow";
|
|
68
70
|
viewBackgroundColor: string;
|
|
69
71
|
scrollX: number;
|
|
70
72
|
scrollY: number;
|
|
@@ -77,7 +79,7 @@ export declare const actionToggleObjectsSnapMode: {
|
|
|
77
79
|
value: import("../types").NormalizedZoomValue;
|
|
78
80
|
}>;
|
|
79
81
|
openMenu: "canvas" | "shape" | null;
|
|
80
|
-
openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | null;
|
|
82
|
+
openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | null;
|
|
81
83
|
openSidebar: {
|
|
82
84
|
name: string;
|
|
83
85
|
tab?: string | undefined;
|
|
@@ -141,7 +143,10 @@ export declare const actionToggleObjectsSnapMode: {
|
|
|
141
143
|
isSpeaking?: boolean | undefined;
|
|
142
144
|
isMuted?: boolean | undefined;
|
|
143
145
|
}>>;
|
|
144
|
-
|
|
146
|
+
stats: {
|
|
147
|
+
open: boolean;
|
|
148
|
+
panels: number;
|
|
149
|
+
};
|
|
145
150
|
currentChartType: import("../element/types").ChartType;
|
|
146
151
|
pasteDialog: {
|
|
147
152
|
shown: false;
|
|
@@ -161,7 +166,7 @@ export declare const actionToggleObjectsSnapMode: {
|
|
|
161
166
|
userToFollow: import("../types").UserToFollow | null;
|
|
162
167
|
followedBy: Set<import("../types").SocketId>;
|
|
163
168
|
};
|
|
164
|
-
storeAction:
|
|
169
|
+
storeAction: "none";
|
|
165
170
|
};
|
|
166
171
|
checked: (appState: Readonly<import("../types").AppState>) => boolean;
|
|
167
172
|
predicate: (elements: readonly import("../element/types").ExcalidrawElement[], appState: import("../types").AppState, appProps: import("../types").ExcalidrawProps) => boolean;
|
|
@@ -8,9 +8,13 @@ export declare const actionToggleStats: {
|
|
|
8
8
|
trackEvent: {
|
|
9
9
|
category: "menu";
|
|
10
10
|
};
|
|
11
|
+
keywords: string[];
|
|
11
12
|
perform(elements: readonly import("../element/types").OrderedExcalidrawElement[], appState: Readonly<import("../types").AppState>): {
|
|
12
13
|
appState: {
|
|
13
|
-
|
|
14
|
+
stats: {
|
|
15
|
+
open: boolean;
|
|
16
|
+
panels: number;
|
|
17
|
+
};
|
|
14
18
|
contextMenu: {
|
|
15
19
|
items: import("../components/ContextMenu").ContextMenuItems;
|
|
16
20
|
top: number;
|
|
@@ -63,7 +67,9 @@ export declare const actionToggleStats: {
|
|
|
63
67
|
currentItemTextAlign: string;
|
|
64
68
|
currentItemStartArrowhead: import("../element/types").Arrowhead | null;
|
|
65
69
|
currentItemEndArrowhead: import("../element/types").Arrowhead | null;
|
|
70
|
+
currentHoveredFontFamily: number | null;
|
|
66
71
|
currentItemRoundness: import("../element/types").StrokeRoundness;
|
|
72
|
+
currentItemArrowType: "sharp" | "round" | "elbow";
|
|
67
73
|
viewBackgroundColor: string;
|
|
68
74
|
scrollX: number;
|
|
69
75
|
scrollY: number;
|
|
@@ -76,7 +82,7 @@ export declare const actionToggleStats: {
|
|
|
76
82
|
value: import("../types").NormalizedZoomValue;
|
|
77
83
|
}>;
|
|
78
84
|
openMenu: "canvas" | "shape" | null;
|
|
79
|
-
openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | null;
|
|
85
|
+
openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | null;
|
|
80
86
|
openSidebar: {
|
|
81
87
|
name: string;
|
|
82
88
|
tab?: string | undefined;
|
|
@@ -161,7 +167,7 @@ export declare const actionToggleStats: {
|
|
|
161
167
|
userToFollow: import("../types").UserToFollow | null;
|
|
162
168
|
followedBy: Set<import("../types").SocketId>;
|
|
163
169
|
};
|
|
164
|
-
storeAction:
|
|
170
|
+
storeAction: "none";
|
|
165
171
|
};
|
|
166
172
|
checked: (appState: Readonly<import("../types").AppState>) => boolean;
|
|
167
173
|
keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
|
|
@@ -4,20 +4,21 @@ import { abacusIcon } from "../components/icons";
|
|
|
4
4
|
import { StoreAction } from "../store";
|
|
5
5
|
export const actionToggleStats = register({
|
|
6
6
|
name: "stats",
|
|
7
|
-
label: "stats.
|
|
7
|
+
label: "stats.fullTitle",
|
|
8
8
|
icon: abacusIcon,
|
|
9
9
|
paletteName: "Toggle stats",
|
|
10
10
|
viewMode: true,
|
|
11
11
|
trackEvent: { category: "menu" },
|
|
12
|
+
keywords: ["edit", "attributes", "customize"],
|
|
12
13
|
perform(elements, appState) {
|
|
13
14
|
return {
|
|
14
15
|
appState: {
|
|
15
16
|
...appState,
|
|
16
|
-
|
|
17
|
+
stats: { ...appState.stats, open: !this.checked(appState) },
|
|
17
18
|
},
|
|
18
19
|
storeAction: StoreAction.NONE,
|
|
19
20
|
};
|
|
20
21
|
},
|
|
21
|
-
checked: (appState) => appState.
|
|
22
|
+
checked: (appState) => appState.stats.open,
|
|
22
23
|
keyTest: (event) => !event[KEYS.CTRL_OR_CMD] && event.altKey && event.code === CODES.SLASH,
|
|
23
24
|
});
|
|
@@ -64,7 +64,9 @@ export declare const actionToggleViewMode: {
|
|
|
64
64
|
currentItemTextAlign: string;
|
|
65
65
|
currentItemStartArrowhead: import("../element/types").Arrowhead | null;
|
|
66
66
|
currentItemEndArrowhead: import("../element/types").Arrowhead | null;
|
|
67
|
+
currentHoveredFontFamily: number | null;
|
|
67
68
|
currentItemRoundness: import("../element/types").StrokeRoundness;
|
|
69
|
+
currentItemArrowType: "sharp" | "round" | "elbow";
|
|
68
70
|
viewBackgroundColor: string;
|
|
69
71
|
scrollX: number;
|
|
70
72
|
scrollY: number;
|
|
@@ -77,7 +79,7 @@ export declare const actionToggleViewMode: {
|
|
|
77
79
|
value: import("../types").NormalizedZoomValue;
|
|
78
80
|
}>;
|
|
79
81
|
openMenu: "canvas" | "shape" | null;
|
|
80
|
-
openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | null;
|
|
82
|
+
openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | null;
|
|
81
83
|
openSidebar: {
|
|
82
84
|
name: string;
|
|
83
85
|
tab?: string | undefined;
|
|
@@ -141,7 +143,10 @@ export declare const actionToggleViewMode: {
|
|
|
141
143
|
isSpeaking?: boolean | undefined;
|
|
142
144
|
isMuted?: boolean | undefined;
|
|
143
145
|
}>>;
|
|
144
|
-
|
|
146
|
+
stats: {
|
|
147
|
+
open: boolean;
|
|
148
|
+
panels: number;
|
|
149
|
+
};
|
|
145
150
|
currentChartType: import("../element/types").ChartType;
|
|
146
151
|
pasteDialog: {
|
|
147
152
|
shown: false;
|
|
@@ -162,7 +167,7 @@ export declare const actionToggleViewMode: {
|
|
|
162
167
|
userToFollow: import("../types").UserToFollow | null;
|
|
163
168
|
followedBy: Set<import("../types").SocketId>;
|
|
164
169
|
};
|
|
165
|
-
storeAction:
|
|
170
|
+
storeAction: "none";
|
|
166
171
|
};
|
|
167
172
|
checked: (appState: Readonly<import("../types").AppState>) => boolean;
|
|
168
173
|
predicate: (elements: readonly import("../element/types").ExcalidrawElement[], appState: import("../types").AppState, appProps: import("../types").ExcalidrawProps) => boolean;
|
|
@@ -64,7 +64,9 @@ export declare const actionToggleZenMode: {
|
|
|
64
64
|
currentItemTextAlign: string;
|
|
65
65
|
currentItemStartArrowhead: import("../element/types").Arrowhead | null;
|
|
66
66
|
currentItemEndArrowhead: import("../element/types").Arrowhead | null;
|
|
67
|
+
currentHoveredFontFamily: number | null;
|
|
67
68
|
currentItemRoundness: import("../element/types").StrokeRoundness;
|
|
69
|
+
currentItemArrowType: "sharp" | "round" | "elbow";
|
|
68
70
|
viewBackgroundColor: string;
|
|
69
71
|
scrollX: number;
|
|
70
72
|
scrollY: number;
|
|
@@ -77,7 +79,7 @@ export declare const actionToggleZenMode: {
|
|
|
77
79
|
value: import("../types").NormalizedZoomValue;
|
|
78
80
|
}>;
|
|
79
81
|
openMenu: "canvas" | "shape" | null;
|
|
80
|
-
openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | null;
|
|
82
|
+
openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | null;
|
|
81
83
|
openSidebar: {
|
|
82
84
|
name: string;
|
|
83
85
|
tab?: string | undefined;
|
|
@@ -141,7 +143,10 @@ export declare const actionToggleZenMode: {
|
|
|
141
143
|
isSpeaking?: boolean | undefined;
|
|
142
144
|
isMuted?: boolean | undefined;
|
|
143
145
|
}>>;
|
|
144
|
-
|
|
146
|
+
stats: {
|
|
147
|
+
open: boolean;
|
|
148
|
+
panels: number;
|
|
149
|
+
};
|
|
145
150
|
currentChartType: import("../element/types").ChartType;
|
|
146
151
|
pasteDialog: {
|
|
147
152
|
shown: false;
|
|
@@ -162,7 +167,7 @@ export declare const actionToggleZenMode: {
|
|
|
162
167
|
userToFollow: import("../types").UserToFollow | null;
|
|
163
168
|
followedBy: Set<import("../types").SocketId>;
|
|
164
169
|
};
|
|
165
|
-
storeAction:
|
|
170
|
+
storeAction: "none";
|
|
166
171
|
};
|
|
167
172
|
checked: (appState: Readonly<import("../types").AppState>) => boolean;
|
|
168
173
|
predicate: (elements: readonly import("../element/types").ExcalidrawElement[], appState: import("../types").AppState, appProps: import("../types").ExcalidrawProps) => boolean;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
export declare const actionSendBackward: {
|
|
3
3
|
name: "sendBackward";
|
|
4
4
|
label: string;
|
|
5
|
+
keywords: string[];
|
|
5
6
|
icon: JSX.Element;
|
|
6
7
|
trackEvent: {
|
|
7
8
|
category: "element";
|
|
@@ -9,7 +10,7 @@ export declare const actionSendBackward: {
|
|
|
9
10
|
perform: (elements: readonly import("../element/types").OrderedExcalidrawElement[], appState: Readonly<import("../types").AppState>) => {
|
|
10
11
|
elements: readonly import("../element/types").ExcalidrawElement[];
|
|
11
12
|
appState: Readonly<import("../types").AppState>;
|
|
12
|
-
storeAction:
|
|
13
|
+
storeAction: "capture";
|
|
13
14
|
};
|
|
14
15
|
keyPriority: number;
|
|
15
16
|
keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
|
|
@@ -20,6 +21,7 @@ export declare const actionSendBackward: {
|
|
|
20
21
|
export declare const actionBringForward: {
|
|
21
22
|
name: "bringForward";
|
|
22
23
|
label: string;
|
|
24
|
+
keywords: string[];
|
|
23
25
|
icon: JSX.Element;
|
|
24
26
|
trackEvent: {
|
|
25
27
|
category: "element";
|
|
@@ -27,7 +29,7 @@ export declare const actionBringForward: {
|
|
|
27
29
|
perform: (elements: readonly import("../element/types").OrderedExcalidrawElement[], appState: Readonly<import("../types").AppState>) => {
|
|
28
30
|
elements: readonly import("../element/types").ExcalidrawElement[];
|
|
29
31
|
appState: Readonly<import("../types").AppState>;
|
|
30
|
-
storeAction:
|
|
32
|
+
storeAction: "capture";
|
|
31
33
|
};
|
|
32
34
|
keyPriority: number;
|
|
33
35
|
keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
|
|
@@ -38,6 +40,7 @@ export declare const actionBringForward: {
|
|
|
38
40
|
export declare const actionSendToBack: {
|
|
39
41
|
name: "sendToBack";
|
|
40
42
|
label: string;
|
|
43
|
+
keywords: string[];
|
|
41
44
|
icon: JSX.Element;
|
|
42
45
|
trackEvent: {
|
|
43
46
|
category: "element";
|
|
@@ -45,7 +48,7 @@ export declare const actionSendToBack: {
|
|
|
45
48
|
perform: (elements: readonly import("../element/types").OrderedExcalidrawElement[], appState: Readonly<import("../types").AppState>) => {
|
|
46
49
|
elements: readonly import("../element/types").ExcalidrawElement[] | import("../element/types").ExcalidrawElement[];
|
|
47
50
|
appState: Readonly<import("../types").AppState>;
|
|
48
|
-
storeAction:
|
|
51
|
+
storeAction: "capture";
|
|
49
52
|
};
|
|
50
53
|
keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
|
|
51
54
|
PanelComponent: ({ updateData, appState }: import("./types").PanelComponentProps) => JSX.Element;
|
|
@@ -55,6 +58,7 @@ export declare const actionSendToBack: {
|
|
|
55
58
|
export declare const actionBringToFront: {
|
|
56
59
|
name: "bringToFront";
|
|
57
60
|
label: string;
|
|
61
|
+
keywords: string[];
|
|
58
62
|
icon: JSX.Element;
|
|
59
63
|
trackEvent: {
|
|
60
64
|
category: "element";
|
|
@@ -62,7 +66,7 @@ export declare const actionBringToFront: {
|
|
|
62
66
|
perform: (elements: readonly import("../element/types").OrderedExcalidrawElement[], appState: Readonly<import("../types").AppState>) => {
|
|
63
67
|
elements: readonly import("../element/types").ExcalidrawElement[] | import("../element/types").ExcalidrawElement[];
|
|
64
68
|
appState: Readonly<import("../types").AppState>;
|
|
65
|
-
storeAction:
|
|
69
|
+
storeAction: "capture";
|
|
66
70
|
};
|
|
67
71
|
keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
|
|
68
72
|
PanelComponent: ({ updateData, appState }: import("./types").PanelComponentProps) => JSX.Element;
|
|
@@ -10,6 +10,7 @@ import { StoreAction } from "../store";
|
|
|
10
10
|
export const actionSendBackward = register({
|
|
11
11
|
name: "sendBackward",
|
|
12
12
|
label: "labels.sendBackward",
|
|
13
|
+
keywords: ["move down", "zindex", "layer"],
|
|
13
14
|
icon: SendBackwardIcon,
|
|
14
15
|
trackEvent: { category: "element" },
|
|
15
16
|
perform: (elements, appState) => {
|
|
@@ -28,6 +29,7 @@ export const actionSendBackward = register({
|
|
|
28
29
|
export const actionBringForward = register({
|
|
29
30
|
name: "bringForward",
|
|
30
31
|
label: "labels.bringForward",
|
|
32
|
+
keywords: ["move up", "zindex", "layer"],
|
|
31
33
|
icon: BringForwardIcon,
|
|
32
34
|
trackEvent: { category: "element" },
|
|
33
35
|
perform: (elements, appState) => {
|
|
@@ -46,6 +48,7 @@ export const actionBringForward = register({
|
|
|
46
48
|
export const actionSendToBack = register({
|
|
47
49
|
name: "sendToBack",
|
|
48
50
|
label: "labels.sendToBack",
|
|
51
|
+
keywords: ["move down", "zindex", "layer"],
|
|
49
52
|
icon: SendToBackIcon,
|
|
50
53
|
trackEvent: { category: "element" },
|
|
51
54
|
perform: (elements, appState) => {
|
|
@@ -69,6 +72,7 @@ export const actionSendToBack = register({
|
|
|
69
72
|
export const actionBringToFront = register({
|
|
70
73
|
name: "bringToFront",
|
|
71
74
|
label: "labels.bringToFront",
|
|
75
|
+
keywords: ["move up", "zindex", "layer"],
|
|
72
76
|
icon: BringToFrontIcon,
|
|
73
77
|
trackEvent: { category: "element" },
|
|
74
78
|
perform: (elements, appState) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { Action, UpdaterFn, ActionName, ActionResult, PanelComponentProps, ActionSource } from "./types";
|
|
3
|
-
import { OrderedExcalidrawElement } from "../element/types";
|
|
4
|
-
import { AppClassProperties, AppState } from "../types";
|
|
2
|
+
import type { Action, UpdaterFn, ActionName, ActionResult, PanelComponentProps, ActionSource } from "./types";
|
|
3
|
+
import type { OrderedExcalidrawElement } from "../element/types";
|
|
4
|
+
import type { AppClassProperties, AppState } from "../types";
|
|
5
5
|
export declare class ActionManager {
|
|
6
6
|
actions: Record<ActionName, Action>;
|
|
7
7
|
updater: (actionResult: ActionResult | Promise<ActionResult>) => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Action } from "./types";
|
|
1
|
+
import type { Action } from "./types";
|
|
2
2
|
export declare let actions: readonly Action[];
|
|
3
3
|
export declare const register: <T extends Action>(action: T) => T & {
|
|
4
4
|
keyTest?: (unknown extends T["keyTest"] ? never : T["keyTest"]) | undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SubtypeOf } from "../utility-types";
|
|
2
|
-
import { ActionName } from "./types";
|
|
1
|
+
import type { SubtypeOf } from "../utility-types";
|
|
2
|
+
import type { ActionName } from "./types";
|
|
3
3
|
export type ShortcutName = SubtypeOf<ActionName, "toggleTheme" | "loadScene" | "clearCanvas" | "cut" | "copy" | "paste" | "copyStyles" | "pasteStyles" | "selectAll" | "deleteSelectedElements" | "duplicateSelection" | "sendBackward" | "bringForward" | "sendToBack" | "bringToFront" | "copyAsPng" | "copyAsSvg" | "group" | "ungroup" | "gridMode" | "zenMode" | "objectsSnapMode" | "stats" | "addToLibrary" | "viewMode" | "flipHorizontal" | "flipVertical" | "hyperlink" | "toggleElementLock" | "resetZoom" | "zoomOut" | "zoomIn" | "zoomToFit" | "zoomToFitSelectionInViewport" | "zoomToFitSelection" | "toggleEraserTool" | "toggleHandTool" | "setFrameAsActiveTool" | "saveFileToDisk" | "saveToActiveFile" | "toggleShortcuts"> | "saveScene" | "imageExport" | "commandPalette";
|
|
4
4
|
export declare const getShortcutFromShortcutName: (name: ShortcutName, idx?: number) => string;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { ExcalidrawElement, OrderedExcalidrawElement } from "../element/types";
|
|
3
|
-
import { AppClassProperties, AppState, ExcalidrawProps, BinaryFiles, UIAppState } from "../types";
|
|
4
|
-
import { MarkOptional } from "../utility-types";
|
|
5
|
-
import { StoreActionType } from "../store";
|
|
1
|
+
import type React from "react";
|
|
2
|
+
import type { ExcalidrawElement, OrderedExcalidrawElement } from "../element/types";
|
|
3
|
+
import type { AppClassProperties, AppState, ExcalidrawProps, BinaryFiles, UIAppState } from "../types";
|
|
4
|
+
import type { MarkOptional } from "../utility-types";
|
|
5
|
+
import type { StoreActionType } from "../store";
|
|
6
6
|
export type ActionSource = "ui" | "keyboard" | "contextMenu" | "api" | "commandPalette";
|
|
7
7
|
/** if false, the action should be prevented */
|
|
8
8
|
export type ActionResult = {
|
|
@@ -15,7 +15,7 @@ export type ActionResult = {
|
|
|
15
15
|
type ActionFn = (elements: readonly OrderedExcalidrawElement[], appState: Readonly<AppState>, formData: any, app: AppClassProperties) => ActionResult | Promise<ActionResult>;
|
|
16
16
|
export type UpdaterFn = (res: ActionResult) => void;
|
|
17
17
|
export type ActionFilterFn = (action: Action) => void;
|
|
18
|
-
export type ActionName = "copy" | "cut" | "paste" | "copyAsPng" | "copyAsSvg" | "copyText" | "sendBackward" | "bringForward" | "sendToBack" | "bringToFront" | "copyStyles" | "selectAll" | "pasteStyles" | "gridMode" | "zenMode" | "objectsSnapMode" | "stats" | "changeStrokeColor" | "changeBackgroundColor" | "changeFillStyle" | "changeStrokeWidth" | "changeStrokeShape" | "changeSloppiness" | "changeStrokeStyle" | "changeArrowhead" | "changeOpacity" | "changeFontSize" | "toggleCanvasMenu" | "toggleEditMenu" | "undo" | "redo" | "finalize" | "changeProjectName" | "changeExportBackground" | "changeExportEmbedScene" | "changeExportScale" | "saveToActiveFile" | "saveFileToDisk" | "loadScene" | "duplicateSelection" | "deleteSelectedElements" | "changeViewBackgroundColor" | "clearCanvas" | "zoomIn" | "zoomOut" | "resetZoom" | "zoomToFit" | "zoomToFitSelection" | "zoomToFitSelectionInViewport" | "changeFontFamily" | "changeTextAlign" | "changeVerticalAlign" | "toggleFullScreen" | "toggleShortcuts" | "group" | "ungroup" | "goToCollaborator" | "addToLibrary" | "changeRoundness" | "alignTop" | "alignBottom" | "alignLeft" | "alignRight" | "alignVerticallyCentered" | "alignHorizontallyCentered" | "distributeHorizontally" | "distributeVertically" | "flipHorizontal" | "flipVertical" | "viewMode" | "exportWithDarkMode" | "toggleTheme" | "increaseFontSize" | "decreaseFontSize" | "unbindText" | "hyperlink" | "bindText" | "unlockAllElements" | "toggleElementLock" | "toggleLinearEditor" | "toggleEraserTool" | "toggleHandTool" | "selectAllElementsInFrame" | "removeAllElementsFromFrame" | "updateFrameRendering" | "setFrameAsActiveTool" | "setEmbeddableAsActiveTool" | "createContainerFromText" | "wrapTextInContainer" | "commandPalette";
|
|
18
|
+
export type ActionName = "copy" | "cut" | "paste" | "copyAsPng" | "copyAsSvg" | "copyText" | "sendBackward" | "bringForward" | "sendToBack" | "bringToFront" | "copyStyles" | "selectAll" | "pasteStyles" | "gridMode" | "zenMode" | "objectsSnapMode" | "stats" | "changeStrokeColor" | "changeBackgroundColor" | "changeFillStyle" | "changeStrokeWidth" | "changeStrokeShape" | "changeSloppiness" | "changeStrokeStyle" | "changeArrowhead" | "changeArrowType" | "changeOpacity" | "changeFontSize" | "toggleCanvasMenu" | "toggleEditMenu" | "undo" | "redo" | "finalize" | "changeProjectName" | "changeExportBackground" | "changeExportEmbedScene" | "changeExportScale" | "saveToActiveFile" | "saveFileToDisk" | "loadScene" | "duplicateSelection" | "deleteSelectedElements" | "changeViewBackgroundColor" | "clearCanvas" | "zoomIn" | "zoomOut" | "resetZoom" | "zoomToFit" | "zoomToFitSelection" | "zoomToFitSelectionInViewport" | "changeFontFamily" | "changeTextAlign" | "changeVerticalAlign" | "toggleFullScreen" | "toggleShortcuts" | "group" | "ungroup" | "goToCollaborator" | "addToLibrary" | "changeRoundness" | "alignTop" | "alignBottom" | "alignLeft" | "alignRight" | "alignVerticallyCentered" | "alignHorizontallyCentered" | "distributeHorizontally" | "distributeVertically" | "flipHorizontal" | "flipVertical" | "viewMode" | "exportWithDarkMode" | "toggleTheme" | "increaseFontSize" | "decreaseFontSize" | "unbindText" | "hyperlink" | "bindText" | "unlockAllElements" | "toggleElementLock" | "toggleLinearEditor" | "toggleEraserTool" | "toggleHandTool" | "selectAllElementsInFrame" | "removeAllElementsFromFrame" | "updateFrameRendering" | "setFrameAsActiveTool" | "setEmbeddableAsActiveTool" | "createContainerFromText" | "wrapTextInContainer" | "commandPalette" | "autoResize" | "elementStats";
|
|
19
19
|
export type PanelComponentProps = {
|
|
20
20
|
elements: readonly ExcalidrawElement[];
|
|
21
21
|
appState: AppState;
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
// place here categories that you want to track. We want to track just a
|
|
2
2
|
// small subset of categories at a given time.
|
|
3
|
-
const ALLOWED_CATEGORIES_TO_TRACK = ["
|
|
3
|
+
const ALLOWED_CATEGORIES_TO_TRACK = new Set(["command_palette"]);
|
|
4
4
|
export const trackEvent = (category, action, label, value) => {
|
|
5
5
|
try {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
// comment out to debug locally
|
|
10
|
-
|| import.meta.env.PROD) {
|
|
6
|
+
if (typeof window === "undefined" ||
|
|
7
|
+
import.meta.env.VITE_WORKER_ID ||
|
|
8
|
+
import.meta.env.VITE_APP_ENABLE_TRACKING !== "true") {
|
|
11
9
|
return;
|
|
12
10
|
}
|
|
13
|
-
if (!ALLOWED_CATEGORIES_TO_TRACK.
|
|
11
|
+
if (!ALLOWED_CATEGORIES_TO_TRACK.has(category)) {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
if (import.meta.env.DEV) {
|
|
15
|
+
// comment out to debug in dev
|
|
14
16
|
return;
|
|
15
17
|
}
|
|
16
18
|
if (!import.meta.env.PROD) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { LaserPointerOptions } from "@excalidraw/laser-pointer";
|
|
2
|
-
import { AnimationFrameHandler } from "./animation-frame-handler";
|
|
1
|
+
import type { LaserPointerOptions } from "@excalidraw/laser-pointer";
|
|
2
|
+
import type { AnimationFrameHandler } from "./animation-frame-handler";
|
|
3
3
|
import type App from "./components/App";
|
|
4
4
|
export interface Trail {
|
|
5
5
|
start(container: SVGSVGElement): void;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { AppState, NormalizedZoomValue } from "./types";
|
|
1
|
+
import type { AppState, NormalizedZoomValue } from "./types";
|
|
2
2
|
export declare const getDefaultAppState: () => Omit<AppState, "offsetTop" | "offsetLeft" | "width" | "height">;
|
|
3
3
|
export declare const clearAppStateForLocalStorage: (appState: Partial<AppState>) => {
|
|
4
4
|
zenModeEnabled?: boolean | undefined;
|
|
5
5
|
objectsSnapModeEnabled?: boolean | undefined;
|
|
6
6
|
theme?: import("./element/types").Theme | undefined;
|
|
7
7
|
name?: string | null | undefined;
|
|
8
|
+
currentItemArrowType?: "sharp" | "round" | "elbow" | undefined;
|
|
8
9
|
showWelcomeScreen?: boolean | undefined;
|
|
9
10
|
activeTool?: ({
|
|
10
11
|
lastActiveTool: import("./types").ActiveTool | null;
|
|
@@ -56,7 +57,10 @@ export declare const clearAppStateForLocalStorage: (appState: Partial<AppState>)
|
|
|
56
57
|
[groupId: string]: boolean;
|
|
57
58
|
} | undefined;
|
|
58
59
|
editingGroupId?: string | null | undefined;
|
|
59
|
-
|
|
60
|
+
stats?: {
|
|
61
|
+
open: boolean;
|
|
62
|
+
panels: number;
|
|
63
|
+
} | undefined;
|
|
60
64
|
currentChartType?: import("./element/types").ChartType | undefined;
|
|
61
65
|
selectedLinearElement?: import("./element/linearElementEditor").LinearElementEditor | null | undefined;
|
|
62
66
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { COLOR_PALETTE } from "./colors";
|
|
2
|
-
import { DEFAULT_ELEMENT_PROPS, DEFAULT_FONT_FAMILY, DEFAULT_FONT_SIZE, DEFAULT_TEXT_ALIGN, EXPORT_SCALES, THEME, } from "./constants";
|
|
2
|
+
import { ARROW_TYPE, DEFAULT_ELEMENT_PROPS, DEFAULT_FONT_FAMILY, DEFAULT_FONT_SIZE, DEFAULT_TEXT_ALIGN, EXPORT_SCALES, STATS_PANELS, THEME, } from "./constants";
|
|
3
3
|
const defaultExportScale = EXPORT_SCALES.includes(devicePixelRatio)
|
|
4
4
|
? devicePixelRatio
|
|
5
5
|
: 1;
|
|
@@ -19,9 +19,11 @@ export const getDefaultAppState = () => {
|
|
|
19
19
|
currentItemStartArrowhead: null,
|
|
20
20
|
currentItemStrokeColor: DEFAULT_ELEMENT_PROPS.strokeColor,
|
|
21
21
|
currentItemRoundness: "round",
|
|
22
|
+
currentItemArrowType: ARROW_TYPE.round,
|
|
22
23
|
currentItemStrokeStyle: DEFAULT_ELEMENT_PROPS.strokeStyle,
|
|
23
24
|
currentItemStrokeWidth: DEFAULT_ELEMENT_PROPS.strokeWidth,
|
|
24
25
|
currentItemTextAlign: DEFAULT_TEXT_ALIGN,
|
|
26
|
+
currentHoveredFontFamily: null,
|
|
25
27
|
cursorButton: "up",
|
|
26
28
|
activeEmbeddable: null,
|
|
27
29
|
draggingElement: null,
|
|
@@ -67,7 +69,10 @@ export const getDefaultAppState = () => {
|
|
|
67
69
|
selectedElementsAreBeingDragged: false,
|
|
68
70
|
selectionElement: null,
|
|
69
71
|
shouldCacheIgnoreZoom: false,
|
|
70
|
-
|
|
72
|
+
stats: {
|
|
73
|
+
open: false,
|
|
74
|
+
panels: STATS_PANELS.generalStats | STATS_PANELS.elementProperties,
|
|
75
|
+
},
|
|
71
76
|
startBoundElement: null,
|
|
72
77
|
suggestedBindings: [],
|
|
73
78
|
frameRendering: { enabled: true, clip: true, name: true, outline: true },
|
|
@@ -113,6 +118,11 @@ const APP_STATE_STORAGE_CONF = ((config) => config)({
|
|
|
113
118
|
export: false,
|
|
114
119
|
server: false,
|
|
115
120
|
},
|
|
121
|
+
currentItemArrowType: {
|
|
122
|
+
browser: true,
|
|
123
|
+
export: false,
|
|
124
|
+
server: false,
|
|
125
|
+
},
|
|
116
126
|
currentItemOpacity: { browser: true, export: false, server: false },
|
|
117
127
|
currentItemRoughness: { browser: true, export: false, server: false },
|
|
118
128
|
currentItemStartArrowhead: { browser: true, export: false, server: false },
|
|
@@ -120,6 +130,7 @@ const APP_STATE_STORAGE_CONF = ((config) => config)({
|
|
|
120
130
|
currentItemStrokeStyle: { browser: true, export: false, server: false },
|
|
121
131
|
currentItemStrokeWidth: { browser: true, export: false, server: false },
|
|
122
132
|
currentItemTextAlign: { browser: true, export: false, server: false },
|
|
133
|
+
currentHoveredFontFamily: { browser: false, export: false, server: false },
|
|
123
134
|
cursorButton: { browser: true, export: false, server: false },
|
|
124
135
|
activeEmbeddable: { browser: false, export: false, server: false },
|
|
125
136
|
draggingElement: { browser: false, export: false, server: false },
|
|
@@ -171,7 +182,7 @@ const APP_STATE_STORAGE_CONF = ((config) => config)({
|
|
|
171
182
|
},
|
|
172
183
|
selectionElement: { browser: false, export: false, server: false },
|
|
173
184
|
shouldCacheIgnoreZoom: { browser: true, export: false, server: false },
|
|
174
|
-
|
|
185
|
+
stats: { browser: true, export: false, server: false },
|
|
175
186
|
startBoundElement: { browser: false, export: false, server: false },
|
|
176
187
|
suggestedBindings: { browser: false, export: false, server: false },
|
|
177
188
|
frameRendering: { browser: false, export: false, server: false },
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export default class BinaryHeap<T> {
|
|
2
|
+
private scoreFunction;
|
|
3
|
+
private content;
|
|
4
|
+
constructor(scoreFunction: (node: T) => number);
|
|
5
|
+
sinkDown(idx: number): void;
|
|
6
|
+
bubbleUp(idx: number): void;
|
|
7
|
+
push(node: T): void;
|
|
8
|
+
pop(): T | null;
|
|
9
|
+
remove(node: T): void;
|
|
10
|
+
size(): number;
|
|
11
|
+
rescoreElement(node: T): void;
|
|
12
|
+
}
|