@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,25 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { DropDownMenuItemBadgeType } from "../dropdownMenu/DropdownMenuItem";
|
|
3
|
+
import { type FontFamilyValues } from "../../element/types";
|
|
4
|
+
import type { ValueOf } from "../../utility-types";
|
|
5
|
+
export interface FontDescriptor {
|
|
6
|
+
value: number;
|
|
7
|
+
icon: JSX.Element;
|
|
8
|
+
text: string;
|
|
9
|
+
deprecated?: true;
|
|
10
|
+
badge?: {
|
|
11
|
+
type: ValueOf<typeof DropDownMenuItemBadgeType>;
|
|
12
|
+
placeholder: string;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
interface FontPickerListProps {
|
|
16
|
+
selectedFontFamily: FontFamilyValues | null;
|
|
17
|
+
hoveredFontFamily: FontFamilyValues | null;
|
|
18
|
+
onSelect: (value: number) => void;
|
|
19
|
+
onHover: (value: number) => void;
|
|
20
|
+
onLeave: () => void;
|
|
21
|
+
onOpen: () => void;
|
|
22
|
+
onClose: () => void;
|
|
23
|
+
}
|
|
24
|
+
export declare const FontPickerList: React.MemoExoticComponent<({ selectedFontFamily, hoveredFontFamily, onSelect, onHover, onLeave, onOpen, onClose, }: FontPickerListProps) => JSX.Element>;
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React, { useMemo, useState, useRef, useEffect, useCallback, } from "react";
|
|
3
|
+
import { useApp, useAppProps, useExcalidrawContainer } from "../App";
|
|
4
|
+
import { PropertiesPopover } from "../PropertiesPopover";
|
|
5
|
+
import { QuickSearch } from "../QuickSearch";
|
|
6
|
+
import { ScrollableList } from "../ScrollableList";
|
|
7
|
+
import DropdownMenuGroup from "../dropdownMenu/DropdownMenuGroup";
|
|
8
|
+
import DropdownMenuItem, { DropDownMenuItemBadgeType, DropDownMenuItemBadge, } from "../dropdownMenu/DropdownMenuItem";
|
|
9
|
+
import { arrayToList, debounce, getFontFamilyString } from "../../utils";
|
|
10
|
+
import { t } from "../../i18n";
|
|
11
|
+
import { fontPickerKeyHandler } from "./keyboardNavHandlers";
|
|
12
|
+
import { Fonts } from "../../fonts";
|
|
13
|
+
export const FontPickerList = React.memo(({ selectedFontFamily, hoveredFontFamily, onSelect, onHover, onLeave, onOpen, onClose, }) => {
|
|
14
|
+
const { container } = useExcalidrawContainer();
|
|
15
|
+
const { fonts } = useApp();
|
|
16
|
+
const { showDeprecatedFonts } = useAppProps();
|
|
17
|
+
const [searchTerm, setSearchTerm] = useState("");
|
|
18
|
+
const inputRef = useRef(null);
|
|
19
|
+
const allFonts = useMemo(() => Array.from(Fonts.registered.entries())
|
|
20
|
+
.filter(([_, { metadata }]) => !metadata.serverSide)
|
|
21
|
+
.map(([familyId, { metadata, fonts }]) => {
|
|
22
|
+
const fontDescriptor = {
|
|
23
|
+
value: familyId,
|
|
24
|
+
icon: metadata.icon,
|
|
25
|
+
text: fonts[0].fontFace.family,
|
|
26
|
+
};
|
|
27
|
+
if (metadata.deprecated) {
|
|
28
|
+
Object.assign(fontDescriptor, {
|
|
29
|
+
deprecated: metadata.deprecated,
|
|
30
|
+
badge: {
|
|
31
|
+
type: DropDownMenuItemBadgeType.RED,
|
|
32
|
+
placeholder: t("fontList.badge.old"),
|
|
33
|
+
},
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
return fontDescriptor;
|
|
37
|
+
})
|
|
38
|
+
.sort((a, b) => a.text.toLowerCase() > b.text.toLowerCase() ? 1 : -1), []);
|
|
39
|
+
const sceneFamilies = useMemo(() => new Set(fonts.getSceneFontFamilies()),
|
|
40
|
+
// cache per selected font family, so hover re-render won't mess it up
|
|
41
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
42
|
+
[selectedFontFamily]);
|
|
43
|
+
const sceneFonts = useMemo(() => allFonts.filter((font) => sceneFamilies.has(font.value)), // always show all the fonts in the scene, even those that were deprecated
|
|
44
|
+
[allFonts, sceneFamilies]);
|
|
45
|
+
const availableFonts = useMemo(() => allFonts.filter((font) => !sceneFamilies.has(font.value) &&
|
|
46
|
+
(showDeprecatedFonts || !font.deprecated)), [allFonts, sceneFamilies, showDeprecatedFonts]);
|
|
47
|
+
const filteredFonts = useMemo(() => arrayToList([...sceneFonts, ...availableFonts].filter((font) => font.text?.toLowerCase().includes(searchTerm))), [sceneFonts, availableFonts, searchTerm]);
|
|
48
|
+
const hoveredFont = useMemo(() => {
|
|
49
|
+
let font;
|
|
50
|
+
if (hoveredFontFamily) {
|
|
51
|
+
font = filteredFonts.find((font) => font.value === hoveredFontFamily);
|
|
52
|
+
}
|
|
53
|
+
else if (selectedFontFamily) {
|
|
54
|
+
font = filteredFonts.find((font) => font.value === selectedFontFamily);
|
|
55
|
+
}
|
|
56
|
+
if (!font && searchTerm) {
|
|
57
|
+
if (filteredFonts[0]?.value) {
|
|
58
|
+
// hover first element on search
|
|
59
|
+
onHover(filteredFonts[0].value);
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
// re-render cache on no results
|
|
63
|
+
onLeave();
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return font;
|
|
67
|
+
}, [
|
|
68
|
+
hoveredFontFamily,
|
|
69
|
+
selectedFontFamily,
|
|
70
|
+
searchTerm,
|
|
71
|
+
filteredFonts,
|
|
72
|
+
onHover,
|
|
73
|
+
onLeave,
|
|
74
|
+
]);
|
|
75
|
+
const onKeyDown = useCallback((event) => {
|
|
76
|
+
const handled = fontPickerKeyHandler({
|
|
77
|
+
event,
|
|
78
|
+
inputRef,
|
|
79
|
+
hoveredFont,
|
|
80
|
+
filteredFonts,
|
|
81
|
+
onSelect,
|
|
82
|
+
onHover,
|
|
83
|
+
onClose,
|
|
84
|
+
});
|
|
85
|
+
if (handled) {
|
|
86
|
+
event.preventDefault();
|
|
87
|
+
event.stopPropagation();
|
|
88
|
+
}
|
|
89
|
+
}, [hoveredFont, filteredFonts, onSelect, onHover, onClose]);
|
|
90
|
+
useEffect(() => {
|
|
91
|
+
onOpen();
|
|
92
|
+
return () => {
|
|
93
|
+
onClose();
|
|
94
|
+
};
|
|
95
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
96
|
+
}, []);
|
|
97
|
+
const sceneFilteredFonts = useMemo(() => filteredFonts.filter((font) => sceneFamilies.has(font.value)), [filteredFonts, sceneFamilies]);
|
|
98
|
+
const availableFilteredFonts = useMemo(() => filteredFonts.filter((font) => !sceneFamilies.has(font.value)), [filteredFonts, sceneFamilies]);
|
|
99
|
+
const renderFont = (font, index) => (_jsxs(DropdownMenuItem, { icon: font.icon, value: font.value, order: index, textStyle: {
|
|
100
|
+
fontFamily: getFontFamilyString({ fontFamily: font.value }),
|
|
101
|
+
}, hovered: font.value === hoveredFont?.value, selected: font.value === selectedFontFamily,
|
|
102
|
+
// allow to tab between search and selected font
|
|
103
|
+
tabIndex: font.value === selectedFontFamily ? 0 : -1, onClick: (e) => {
|
|
104
|
+
onSelect(Number(e.currentTarget.value));
|
|
105
|
+
}, onMouseMove: () => {
|
|
106
|
+
if (hoveredFont?.value !== font.value) {
|
|
107
|
+
onHover(font.value);
|
|
108
|
+
}
|
|
109
|
+
}, children: [font.text, font.badge && (_jsx(DropDownMenuItemBadge, { type: font.badge.type, children: font.badge.placeholder }))] }, font.value));
|
|
110
|
+
const groups = [];
|
|
111
|
+
if (sceneFilteredFonts.length) {
|
|
112
|
+
groups.push(_jsx(DropdownMenuGroup, { title: t("fontList.sceneFonts"), children: sceneFilteredFonts.map(renderFont) }, "group_1"));
|
|
113
|
+
}
|
|
114
|
+
if (availableFilteredFonts.length) {
|
|
115
|
+
groups.push(_jsx(DropdownMenuGroup, { title: t("fontList.availableFonts"), children: availableFilteredFonts.map((font, index) => renderFont(font, index + sceneFilteredFonts.length)) }, "group_2"));
|
|
116
|
+
}
|
|
117
|
+
return (_jsxs(PropertiesPopover, { className: "properties-content", container: container, style: { width: "15rem" }, onClose: onClose, onPointerLeave: onLeave, onKeyDown: onKeyDown, children: [_jsx(QuickSearch, { ref: inputRef, placeholder: t("quickSearch.placeholder"), onChange: debounce(setSearchTerm, 20) }), _jsx(ScrollableList, { className: "dropdown-menu fonts manual-hover", placeholder: t("fontList.empty"), children: groups.length ? groups : null })] }));
|
|
118
|
+
}, (prev, next) => prev.selectedFontFamily === next.selectedFontFamily &&
|
|
119
|
+
prev.hoveredFontFamily === next.hoveredFontFamily);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { FontFamilyValues } from "../../element/types";
|
|
3
|
+
interface FontPickerTriggerProps {
|
|
4
|
+
selectedFontFamily: FontFamilyValues | null;
|
|
5
|
+
}
|
|
6
|
+
export declare const FontPickerTrigger: ({ selectedFontFamily, }: FontPickerTriggerProps) => JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as Popover from "@radix-ui/react-popover";
|
|
3
|
+
import { useMemo } from "react";
|
|
4
|
+
import { ButtonIcon } from "../ButtonIcon";
|
|
5
|
+
import { TextIcon } from "../icons";
|
|
6
|
+
import { t } from "../../i18n";
|
|
7
|
+
import { isDefaultFont } from "./FontPicker";
|
|
8
|
+
export const FontPickerTrigger = ({ selectedFontFamily, }) => {
|
|
9
|
+
const isTriggerActive = useMemo(() => Boolean(selectedFontFamily && !isDefaultFont(selectedFontFamily)), [selectedFontFamily]);
|
|
10
|
+
return (_jsx(Popover.Trigger, { asChild: true, children: _jsx("div", { children: _jsx(ButtonIcon, { standalone: true, icon: TextIcon, title: t("labels.showFonts"), className: "properties-trigger", testId: "font-family-show-fonts", active: isTriggerActive,
|
|
11
|
+
// no-op
|
|
12
|
+
onClick: () => { } }) }) }));
|
|
13
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { Node } from "../../utils";
|
|
3
|
+
import { type FontDescriptor } from "./FontPickerList";
|
|
4
|
+
interface FontPickerKeyNavHandlerProps {
|
|
5
|
+
event: React.KeyboardEvent<HTMLDivElement>;
|
|
6
|
+
inputRef: React.RefObject<HTMLInputElement>;
|
|
7
|
+
hoveredFont: Node<FontDescriptor> | undefined;
|
|
8
|
+
filteredFonts: Node<FontDescriptor>[];
|
|
9
|
+
onClose: () => void;
|
|
10
|
+
onSelect: (value: number) => void;
|
|
11
|
+
onHover: (value: number) => void;
|
|
12
|
+
}
|
|
13
|
+
export declare const fontPickerKeyHandler: ({ event, inputRef, hoveredFont, filteredFonts, onClose, onSelect, onHover, }: FontPickerKeyNavHandlerProps) => true | undefined;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { KEYS } from "../../keys";
|
|
2
|
+
export const fontPickerKeyHandler = ({ event, inputRef, hoveredFont, filteredFonts, onClose, onSelect, onHover, }) => {
|
|
3
|
+
if (!event[KEYS.CTRL_OR_CMD] &&
|
|
4
|
+
event.shiftKey &&
|
|
5
|
+
event.key.toLowerCase() === KEYS.F) {
|
|
6
|
+
// refocus input on the popup trigger shortcut
|
|
7
|
+
inputRef.current?.focus();
|
|
8
|
+
return true;
|
|
9
|
+
}
|
|
10
|
+
if (event.key === KEYS.ESCAPE) {
|
|
11
|
+
onClose();
|
|
12
|
+
return true;
|
|
13
|
+
}
|
|
14
|
+
if (event.key === KEYS.ENTER) {
|
|
15
|
+
if (hoveredFont?.value) {
|
|
16
|
+
onSelect(hoveredFont.value);
|
|
17
|
+
}
|
|
18
|
+
return true;
|
|
19
|
+
}
|
|
20
|
+
if (event.key === KEYS.ARROW_DOWN) {
|
|
21
|
+
if (hoveredFont?.next) {
|
|
22
|
+
onHover(hoveredFont.next.value);
|
|
23
|
+
}
|
|
24
|
+
else if (filteredFonts[0]?.value) {
|
|
25
|
+
onHover(filteredFonts[0].value);
|
|
26
|
+
}
|
|
27
|
+
return true;
|
|
28
|
+
}
|
|
29
|
+
if (event.key === KEYS.ARROW_UP) {
|
|
30
|
+
if (hoveredFont?.prev) {
|
|
31
|
+
onHover(hoveredFont.prev.value);
|
|
32
|
+
}
|
|
33
|
+
else if (filteredFonts[filteredFonts.length - 1]?.value) {
|
|
34
|
+
onHover(filteredFonts[filteredFonts.length - 1].value);
|
|
35
|
+
}
|
|
36
|
+
return true;
|
|
37
|
+
}
|
|
38
|
+
};
|
|
@@ -57,7 +57,7 @@ export const HelpDialog = ({ onClose }) => {
|
|
|
57
57
|
t("helpDialog.click"),
|
|
58
58
|
t("helpDialog.click"),
|
|
59
59
|
t("helpDialog.click"),
|
|
60
|
-
], isOr: false }), _jsx(Shortcut, { label: t("toolBar.lock"), shortcuts: [KEYS.Q] }), _jsx(Shortcut, { label: t("helpDialog.preventBinding"), shortcuts: [getShortcutKey("CtrlOrCmd")] }), _jsx(Shortcut, { label: t("toolBar.link"), shortcuts: [getShortcutKey("CtrlOrCmd+K")] })] }), _jsxs(ShortcutIsland, { className: "HelpDialog__island--view", caption: t("helpDialog.view"), children: [_jsx(Shortcut, { label: t("buttons.zoomIn"), shortcuts: [getShortcutKey("CtrlOrCmd++")] }), _jsx(Shortcut, { label: t("buttons.zoomOut"), shortcuts: [getShortcutKey("CtrlOrCmd+-")] }), _jsx(Shortcut, { label: t("buttons.resetZoom"), shortcuts: [getShortcutKey("CtrlOrCmd+0")] }), _jsx(Shortcut, { label: t("helpDialog.zoomToFit"), shortcuts: ["Shift+1"] }), _jsx(Shortcut, { label: t("helpDialog.zoomToSelection"), shortcuts: ["Shift+2"] }), _jsx(Shortcut, { label: t("helpDialog.movePageUpDown"), shortcuts: ["PgUp/PgDn"] }), _jsx(Shortcut, { label: t("helpDialog.movePageLeftRight"), shortcuts: ["Shift+PgUp/PgDn"] }), _jsx(Shortcut, { label: t("buttons.zenMode"), shortcuts: [getShortcutKey("Alt+Z")] }), _jsx(Shortcut, { label: t("buttons.objectsSnapMode"), shortcuts: [getShortcutKey("Alt+S")] }), _jsx(Shortcut, { label: t("labels.toggleGrid"), shortcuts: [getShortcutKey("CtrlOrCmd+'")] }), _jsx(Shortcut, { label: t("labels.viewMode"), shortcuts: [getShortcutKey("Alt+R")] }), _jsx(Shortcut, { label: t("labels.toggleTheme"), shortcuts: [getShortcutKey("Alt+Shift+D")] }), _jsx(Shortcut, { label: t("stats.
|
|
60
|
+
], isOr: false }), _jsx(Shortcut, { label: t("toolBar.lock"), shortcuts: [KEYS.Q] }), _jsx(Shortcut, { label: t("helpDialog.preventBinding"), shortcuts: [getShortcutKey("CtrlOrCmd")] }), _jsx(Shortcut, { label: t("toolBar.link"), shortcuts: [getShortcutKey("CtrlOrCmd+K")] })] }), _jsxs(ShortcutIsland, { className: "HelpDialog__island--view", caption: t("helpDialog.view"), children: [_jsx(Shortcut, { label: t("buttons.zoomIn"), shortcuts: [getShortcutKey("CtrlOrCmd++")] }), _jsx(Shortcut, { label: t("buttons.zoomOut"), shortcuts: [getShortcutKey("CtrlOrCmd+-")] }), _jsx(Shortcut, { label: t("buttons.resetZoom"), shortcuts: [getShortcutKey("CtrlOrCmd+0")] }), _jsx(Shortcut, { label: t("helpDialog.zoomToFit"), shortcuts: ["Shift+1"] }), _jsx(Shortcut, { label: t("helpDialog.zoomToSelection"), shortcuts: ["Shift+2"] }), _jsx(Shortcut, { label: t("helpDialog.movePageUpDown"), shortcuts: ["PgUp/PgDn"] }), _jsx(Shortcut, { label: t("helpDialog.movePageLeftRight"), shortcuts: ["Shift+PgUp/PgDn"] }), _jsx(Shortcut, { label: t("buttons.zenMode"), shortcuts: [getShortcutKey("Alt+Z")] }), _jsx(Shortcut, { label: t("buttons.objectsSnapMode"), shortcuts: [getShortcutKey("Alt+S")] }), _jsx(Shortcut, { label: t("labels.toggleGrid"), shortcuts: [getShortcutKey("CtrlOrCmd+'")] }), _jsx(Shortcut, { label: t("labels.viewMode"), shortcuts: [getShortcutKey("Alt+R")] }), _jsx(Shortcut, { label: t("labels.toggleTheme"), shortcuts: [getShortcutKey("Alt+Shift+D")] }), _jsx(Shortcut, { label: t("stats.fullTitle"), shortcuts: [getShortcutKey("Alt+/")] }), _jsx(Shortcut, { label: t("commandPalette.title"), shortcuts: isFirefox
|
|
61
61
|
? [getShortcutFromShortcutName("commandPalette")]
|
|
62
62
|
: [
|
|
63
63
|
getShortcutFromShortcutName("commandPalette"),
|
|
@@ -81,5 +81,5 @@ export const HelpDialog = ({ onClose }) => {
|
|
|
81
81
|
getShortcutKey("CtrlOrCmd+Y"),
|
|
82
82
|
getShortcutKey("CtrlOrCmd+Shift+Z"),
|
|
83
83
|
]
|
|
84
|
-
: [getShortcutKey("CtrlOrCmd+Shift+Z")] }), _jsx(Shortcut, { label: t("labels.group"), shortcuts: [getShortcutKey("CtrlOrCmd+G")] }), _jsx(Shortcut, { label: t("labels.ungroup"), shortcuts: [getShortcutKey("CtrlOrCmd+Shift+G")] }), _jsx(Shortcut, { label: t("labels.flipHorizontal"), shortcuts: [getShortcutKey("Shift+H")] }), _jsx(Shortcut, { label: t("labels.flipVertical"), shortcuts: [getShortcutKey("Shift+V")] }), _jsx(Shortcut, { label: t("labels.showStroke"), shortcuts: [getShortcutKey("S")] }), _jsx(Shortcut, { label: t("labels.showBackground"), shortcuts: [getShortcutKey("G")] }), _jsx(Shortcut, { label: t("labels.decreaseFontSize"), shortcuts: [getShortcutKey("CtrlOrCmd+Shift+<")] }), _jsx(Shortcut, { label: t("labels.increaseFontSize"), shortcuts: [getShortcutKey("CtrlOrCmd+Shift+>")] })] })] })] }) }));
|
|
84
|
+
: [getShortcutKey("CtrlOrCmd+Shift+Z")] }), _jsx(Shortcut, { label: t("labels.group"), shortcuts: [getShortcutKey("CtrlOrCmd+G")] }), _jsx(Shortcut, { label: t("labels.ungroup"), shortcuts: [getShortcutKey("CtrlOrCmd+Shift+G")] }), _jsx(Shortcut, { label: t("labels.flipHorizontal"), shortcuts: [getShortcutKey("Shift+H")] }), _jsx(Shortcut, { label: t("labels.flipVertical"), shortcuts: [getShortcutKey("Shift+V")] }), _jsx(Shortcut, { label: t("labels.showStroke"), shortcuts: [getShortcutKey("S")] }), _jsx(Shortcut, { label: t("labels.showBackground"), shortcuts: [getShortcutKey("G")] }), _jsx(Shortcut, { label: t("labels.showFonts"), shortcuts: [getShortcutKey("Shift+F")] }), _jsx(Shortcut, { label: t("labels.decreaseFontSize"), shortcuts: [getShortcutKey("CtrlOrCmd+Shift+<")] }), _jsx(Shortcut, { label: t("labels.increaseFontSize"), shortcuts: [getShortcutKey("CtrlOrCmd+Shift+>")] })] })] })] }) }));
|
|
85
85
|
};
|
|
@@ -14,10 +14,13 @@ const getHints = ({ appState, isMobile, device, app }) => {
|
|
|
14
14
|
return t("hints.eraserRevert");
|
|
15
15
|
}
|
|
16
16
|
if (activeTool.type === "arrow" || activeTool.type === "line") {
|
|
17
|
-
if (
|
|
18
|
-
return t("hints.
|
|
17
|
+
if (multiMode) {
|
|
18
|
+
return t("hints.linearElementMulti");
|
|
19
19
|
}
|
|
20
|
-
|
|
20
|
+
if (activeTool.type === "arrow") {
|
|
21
|
+
return t("hints.arrowTool", { arrowShortcut: getShortcutKey("A") });
|
|
22
|
+
}
|
|
23
|
+
return t("hints.linearElement");
|
|
21
24
|
}
|
|
22
25
|
if (activeTool.type === "freedraw") {
|
|
23
26
|
return t("hints.freeDraw");
|
|
@@ -72,7 +72,7 @@ function Picker({ options, value, label, onChange, onClose, }) {
|
|
|
72
72
|
event.nativeEvent.stopImmediatePropagation();
|
|
73
73
|
event.stopPropagation();
|
|
74
74
|
};
|
|
75
|
-
return (_jsx("div", { className: `picker`, role: "dialog", "aria-modal": "true", "aria-label": label, onKeyDown: handleKeyDown, children: _jsx("div", { className: "picker-content", ref: rGallery, children: options.map((option, i) => (_jsxs("button", { className: clsx("picker-option", {
|
|
75
|
+
return (_jsx("div", { className: `picker`, role: "dialog", "aria-modal": "true", "aria-label": label, onKeyDown: handleKeyDown, children: _jsx("div", { className: "picker-content", ref: rGallery, children: options.map((option, i) => (_jsxs("button", { type: "button", className: clsx("picker-option", {
|
|
76
76
|
active: value === option.value,
|
|
77
77
|
}), onClick: (event) => {
|
|
78
78
|
event.currentTarget.focus();
|
|
@@ -92,7 +92,7 @@ export function IconPicker({ value, label, options, onChange, group = "", }) {
|
|
|
92
92
|
const [isActive, setActive] = React.useState(false);
|
|
93
93
|
const rPickerButton = React.useRef(null);
|
|
94
94
|
const isRTL = getLanguage().rtl;
|
|
95
|
-
return (_jsxs("div", { children: [_jsx("button", { name: group, className: isActive ? "active" : "", "aria-label": label, onClick: () => setActive(!isActive), ref: rPickerButton, children: options.find((option) => option.value === value)?.icon }), _jsx(React.Suspense, { fallback: "", children: isActive ? (_jsxs(_Fragment, { children: [_jsx(Popover, { onCloseRequest: (event) => event.target !== rPickerButton.current && setActive(false), ...(isRTL ? { right: 5.5 } : { left: -5.5 }), children: _jsx(Picker, { options: options.filter((opt) => opt.showInPicker !== false), value: value, label: label, onChange: onChange, onClose: () => {
|
|
95
|
+
return (_jsxs("div", { children: [_jsx("button", { name: group, type: "button", className: isActive ? "active" : "", "aria-label": label, onClick: () => setActive(!isActive), ref: rPickerButton, children: options.find((option) => option.value === value)?.icon }), _jsx(React.Suspense, { fallback: "", children: isActive ? (_jsxs(_Fragment, { children: [_jsx(Popover, { onCloseRequest: (event) => event.target !== rPickerButton.current && setActive(false), ...(isRTL ? { right: 5.5 } : { left: -5.5 }), children: _jsx(Picker, { options: options.filter((opt) => opt.showInPicker !== false), value: value, label: label, onChange: onChange, onClose: () => {
|
|
96
96
|
setActive(false);
|
|
97
97
|
rPickerButton.current?.focus();
|
|
98
98
|
} }) }), _jsx("div", { className: "picker-triangle" })] })) : null })] }));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { ActionManager } from "../actions/manager";
|
|
3
3
|
import type { AppClassProperties, BinaryFiles, UIAppState } from "../types";
|
|
4
|
-
import { NonDeletedExcalidrawElement } from "../element/types";
|
|
4
|
+
import type { NonDeletedExcalidrawElement } from "../element/types";
|
|
5
5
|
import "./ImageExportDialog.scss";
|
|
6
6
|
export declare const ErrorCanvasPreview: () => JSX.Element;
|
|
7
7
|
export declare const ImageExportDialog: ({ elements, appState, files, actionManager, onExportImage, onCloseRequest, name, }: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { Language } from "../i18n";
|
|
3
|
-
import { Theme } from "../element/types";
|
|
2
|
+
import type { Language } from "../i18n";
|
|
3
|
+
import type { Theme } from "../element/types";
|
|
4
4
|
interface Props {
|
|
5
5
|
langCode: Language["code"];
|
|
6
6
|
children: React.ReactElement;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { NonDeletedExcalidrawElement } from "../element/types";
|
|
3
|
-
import { ExportOpts, BinaryFiles, UIAppState } from "../types";
|
|
2
|
+
import type { NonDeletedExcalidrawElement } from "../element/types";
|
|
3
|
+
import type { ExportOpts, BinaryFiles, UIAppState } from "../types";
|
|
4
4
|
import "./ExportDialog.scss";
|
|
5
|
-
import { ActionManager } from "../actions/manager";
|
|
5
|
+
import type { ActionManager } from "../actions/manager";
|
|
6
6
|
export type ExportCB = (elements: readonly NonDeletedExcalidrawElement[], scale?: number) => void;
|
|
7
7
|
export declare const JSONExportDialog: ({ elements, appState, files, actionManager, exportOpts, canvas, setAppState, }: {
|
|
8
8
|
elements: readonly NonDeletedExcalidrawElement[];
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { ActionManager } from "../actions/manager";
|
|
3
|
-
import { NonDeletedExcalidrawElement } from "../element/types";
|
|
4
|
-
import { Language } from "../i18n";
|
|
5
|
-
import { AppProps, AppState, ExcalidrawProps, BinaryFiles, UIAppState, AppClassProperties } from "../types";
|
|
2
|
+
import type { ActionManager } from "../actions/manager";
|
|
3
|
+
import type { NonDeletedExcalidrawElement } from "../element/types";
|
|
4
|
+
import type { Language } from "../i18n";
|
|
5
|
+
import type { AppProps, AppState, ExcalidrawProps, BinaryFiles, UIAppState, AppClassProperties } from "../types";
|
|
6
6
|
import "./LayerUI.scss";
|
|
7
7
|
import "./Toolbar.scss";
|
|
8
8
|
interface LayerUIProps {
|
|
@@ -24,8 +24,6 @@ import { JSONExportDialog } from "./JSONExportDialog";
|
|
|
24
24
|
import { PenModeButton } from "./PenModeButton";
|
|
25
25
|
import { trackEvent } from "../analytics";
|
|
26
26
|
import { useDevice } from "./App";
|
|
27
|
-
import { Stats } from "./Stats";
|
|
28
|
-
import { actionToggleStats } from "../actions/actionToggleStats";
|
|
29
27
|
import Footer from "./footer/Footer";
|
|
30
28
|
import { isSidebarDockedAtom } from "./Sidebar/Sidebar";
|
|
31
29
|
import { jotaiScope } from "../jotai";
|
|
@@ -48,6 +46,8 @@ import Scene from "../scene/Scene";
|
|
|
48
46
|
import { LaserPointerButton } from "./LaserPointerButton";
|
|
49
47
|
import { MagicSettings } from "./MagicSettings";
|
|
50
48
|
import { TTDDialog } from "./TTDDialog/TTDDialog";
|
|
49
|
+
import { Stats } from "./Stats";
|
|
50
|
+
import { actionToggleStats } from "../actions";
|
|
51
51
|
const DefaultMainMenu = ({ UIOptions }) => {
|
|
52
52
|
return (_jsxs(MainMenu, { __fallback: true, children: [_jsx(MainMenu.DefaultItems.LoadScene, {}), _jsx(MainMenu.DefaultItems.SaveToActiveFile, {}), UIOptions.canvasActions.export && _jsx(MainMenu.DefaultItems.Export, {}), UIOptions.canvasActions.saveAsImage && (_jsx(MainMenu.DefaultItems.SaveAsImage, {})), _jsx(MainMenu.DefaultItems.Help, {}), _jsx(MainMenu.DefaultItems.ClearCanvas, {}), _jsx(MainMenu.Separator, {}), _jsx(MainMenu.Group, { title: "Excalidraw links", children: _jsx(MainMenu.DefaultItems.Socials, {}) }), _jsx(MainMenu.Separator, {}), _jsx(MainMenu.DefaultItems.ToggleTheme, {}), _jsx(MainMenu.DefaultItems.ChangeCanvasBackground, {})] }));
|
|
53
53
|
};
|
|
@@ -81,6 +81,9 @@ const LayerUI = ({ actionManager, appState, files, setAppState, elements, canvas
|
|
|
81
81
|
}, children: _jsx(SelectedShapeActions, { appState: appState, elementsMap: app.scene.getNonDeletedElementsMap(), renderAction: actionManager.renderAction }) }) }));
|
|
82
82
|
const renderFixedSideContainer = () => {
|
|
83
83
|
const shouldRenderSelectedShapeActions = showSelectedShapeActions(appState, elements);
|
|
84
|
+
const shouldShowStats = appState.stats.open &&
|
|
85
|
+
!appState.zenModeEnabled &&
|
|
86
|
+
!appState.viewModeEnabled;
|
|
84
87
|
return (_jsx(FixedSideContainer, { side: "top", children: _jsxs("div", { className: "App-menu App-menu_top", children: [_jsxs(Stack.Col, { gap: 6, className: clsx("App-menu_top__left"), children: [renderCanvasActions(), shouldRenderSelectedShapeActions && renderSelectedShapeActions()] }), !appState.viewModeEnabled && (_jsx(Section, { heading: "shapes", className: "shapes-section", children: (heading) => (_jsxs("div", { style: { position: "relative" }, children: [renderWelcomeScreen && (_jsx(tunnels.WelcomeScreenToolbarHintTunnel.Out, {})), _jsx(Stack.Col, { gap: 4, align: "start", children: _jsxs(Stack.Row, { gap: 1, className: clsx("App-toolbar-container", {
|
|
85
88
|
"zen-mode": appState.zenModeEnabled,
|
|
86
89
|
}), children: [_jsxs(Island, { padding: 1, className: clsx("App-toolbar", {
|
|
@@ -94,7 +97,9 @@ const LayerUI = ({ actionManager, appState, files, setAppState, elements, canvas
|
|
|
94
97
|
}), children: [appState.collaborators.size > 0 && (_jsx(UserList, { collaborators: appState.collaborators, userToFollow: appState.userToFollow?.socketId || null })), renderTopRightUI?.(device.editor.isMobile, appState), !appState.viewModeEnabled &&
|
|
95
98
|
// hide button when sidebar docked
|
|
96
99
|
(!isSidebarDocked ||
|
|
97
|
-
appState.openSidebar?.name !== DEFAULT_SIDEBAR.name) && (_jsx(tunnels.DefaultSidebarTriggerTunnel.Out, {}))
|
|
100
|
+
appState.openSidebar?.name !== DEFAULT_SIDEBAR.name) && (_jsx(tunnels.DefaultSidebarTriggerTunnel.Out, {})), shouldShowStats && (_jsx(Stats, { scene: app.scene, onClose: () => {
|
|
101
|
+
actionManager.executeAction(actionToggleStats);
|
|
102
|
+
}, renderCustomStats: renderCustomStats }))] })] }) }));
|
|
98
103
|
};
|
|
99
104
|
const renderSidebars = () => {
|
|
100
105
|
return (_jsx(DefaultSidebar, { __fallback: true, onDock: (docked) => {
|
|
@@ -126,7 +131,7 @@ const LayerUI = ({ actionManager, appState, files, setAppState, elements, canvas
|
|
|
126
131
|
}, false);
|
|
127
132
|
ShapeCache.delete(element);
|
|
128
133
|
}
|
|
129
|
-
Scene.getScene(selectedElements[0])?.
|
|
134
|
+
Scene.getScene(selectedElements[0])?.triggerUpdate();
|
|
130
135
|
}
|
|
131
136
|
else if (colorPickerType === "elementBackground") {
|
|
132
137
|
setAppState({
|
|
@@ -158,9 +163,7 @@ const LayerUI = ({ actionManager, appState, files, setAppState, elements, canvas
|
|
|
158
163
|
isSidebarDocked &&
|
|
159
164
|
device.editor.canFitSidebar
|
|
160
165
|
? { width: `calc(100% - ${LIBRARY_SIDEBAR_WIDTH}px)` }
|
|
161
|
-
: {}, children: [renderWelcomeScreen && _jsx(tunnels.WelcomeScreenCenterTunnel.Out, {}), renderFixedSideContainer(), _jsx(Footer, { appState: appState, actionManager: actionManager, showExitZenModeBtn: showExitZenModeBtn, renderWelcomeScreen: renderWelcomeScreen }), appState.
|
|
162
|
-
actionManager.executeAction(actionToggleStats);
|
|
163
|
-
}, renderCustomStats: renderCustomStats })), appState.scrolledOutside && (_jsx("button", { className: "scroll-back-to-content", onClick: () => {
|
|
166
|
+
: {}, children: [renderWelcomeScreen && _jsx(tunnels.WelcomeScreenCenterTunnel.Out, {}), renderFixedSideContainer(), _jsx(Footer, { appState: appState, actionManager: actionManager, showExitZenModeBtn: showExitZenModeBtn, renderWelcomeScreen: renderWelcomeScreen }), appState.scrolledOutside && (_jsx("button", { type: "button", className: "scroll-back-to-content", onClick: () => {
|
|
164
167
|
setAppState((appState) => ({
|
|
165
168
|
...calculateScrollCenter(elements, appState),
|
|
166
169
|
}));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import Library from "../data/library";
|
|
3
|
-
import { LibraryItems, LibraryItem, ExcalidrawProps, UIAppState } from "../types";
|
|
2
|
+
import type Library from "../data/library";
|
|
3
|
+
import type { LibraryItems, LibraryItem, ExcalidrawProps, UIAppState } from "../types";
|
|
4
4
|
import "./LibraryMenu.scss";
|
|
5
5
|
export declare const isLibraryMenuOpenAtom: import("jotai").PrimitiveAtom<boolean> & {
|
|
6
6
|
init: boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { ExcalidrawProps, UIAppState } from "../types";
|
|
2
|
+
import type { ExcalidrawProps, UIAppState } from "../types";
|
|
3
3
|
declare const LibraryMenuBrowseButton: ({ theme, id, libraryReturnUrl, }: {
|
|
4
4
|
libraryReturnUrl: ExcalidrawProps["libraryReturnUrl"];
|
|
5
5
|
theme: UIAppState["theme"];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { ExcalidrawProps, UIAppState } from "../types";
|
|
2
|
+
import type { ExcalidrawProps, UIAppState } from "../types";
|
|
3
3
|
export declare const LibraryMenuControlButtons: ({ libraryReturnUrl, theme, id, style, children, className, }: {
|
|
4
4
|
libraryReturnUrl: ExcalidrawProps["libraryReturnUrl"];
|
|
5
5
|
theme: UIAppState["theme"];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { LibraryItem, UIAppState } from "../types";
|
|
3
|
-
import Library from "../data/library";
|
|
2
|
+
import type { LibraryItem, UIAppState } from "../types";
|
|
3
|
+
import type Library from "../data/library";
|
|
4
4
|
export declare const LibraryDropdownMenuButton: React.FC<{
|
|
5
5
|
setAppState: React.Component<any, UIAppState>["setState"];
|
|
6
6
|
selectedItems: LibraryItem["id"][];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { ExcalidrawProps, LibraryItem, LibraryItems, UIAppState } from "../types";
|
|
2
|
+
import type { ExcalidrawProps, LibraryItem, LibraryItems, UIAppState } from "../types";
|
|
3
3
|
import "./LibraryMenuItems.scss";
|
|
4
4
|
export default function LibraryMenuItems({ isLoading, libraryItems, onAddToLibrary, onInsertLibraryItems, pendingElements, theme, id, libraryReturnUrl, onSelectItems, selectedItems, }: {
|
|
5
5
|
isLoading: boolean;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import type { LibraryItem } from "../types";
|
|
4
|
+
import type { ExcalidrawElement, NonDeleted } from "../element/types";
|
|
5
|
+
import type { SvgCache } from "../hooks/useLibraryItemSvg";
|
|
5
6
|
type LibraryOrPendingItem = (LibraryItem | /* pending library item */ {
|
|
6
7
|
id: null;
|
|
7
8
|
elements: readonly NonDeleted<ExcalidrawElement>[];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { LibraryItem } from "../types";
|
|
2
|
+
import type { LibraryItem } from "../types";
|
|
3
3
|
import "./LibraryUnit.scss";
|
|
4
|
-
import { SvgCache } from "../hooks/useLibraryItemSvg";
|
|
4
|
+
import type { SvgCache } from "../hooks/useLibraryItemSvg";
|
|
5
5
|
export declare const LibraryUnit: import("react").MemoExoticComponent<({ id, elements, isPending, onClick, selected, onToggle, onDrag, svgCache, }: {
|
|
6
6
|
id: LibraryItem["id"] | /** for pending item */ null;
|
|
7
7
|
elements?: readonly import("../element/types").NonDeleted<import("../element/types").ExcalidrawElement>[] | undefined;
|
|
@@ -33,8 +33,8 @@ export const MagicSettings = (props) => {
|
|
|
33
33
|
marginLeft: "1rem",
|
|
34
34
|
fontSize: 14,
|
|
35
35
|
borderRadius: "12px",
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
background: "var(--color-promo)",
|
|
37
|
+
color: "var(--color-surface-lowest)",
|
|
38
38
|
}, children: "Experimental" })] }), className: "MagicSettings", autofocus: false, children: _jsx(TTDDialogTabs, { dialog: "settings", tab: appState.openDialog.tab, children: _jsxs(TTDDialogTab
|
|
39
39
|
// className="ttd-dialog-content"
|
|
40
40
|
, {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { AppClassProperties, AppProps, AppState, Device, ExcalidrawProps, UIAppState } from "../types";
|
|
3
|
-
import { ActionManager } from "../actions/manager";
|
|
4
|
-
import { NonDeletedExcalidrawElement } from "../element/types";
|
|
2
|
+
import type { AppClassProperties, AppProps, AppState, Device, ExcalidrawProps, UIAppState } from "../types";
|
|
3
|
+
import type { ActionManager } from "../actions/manager";
|
|
4
|
+
import type { NonDeletedExcalidrawElement } from "../element/types";
|
|
5
5
|
type MobileMenuProps = {
|
|
6
6
|
appState: UIAppState;
|
|
7
7
|
actionManager: ActionManager;
|
|
@@ -11,8 +11,6 @@ import { Section } from "./Section";
|
|
|
11
11
|
import { SCROLLBAR_WIDTH, SCROLLBAR_MARGIN } from "../scene/scrollbars";
|
|
12
12
|
import { LockButton } from "./LockButton";
|
|
13
13
|
import { PenModeButton } from "./PenModeButton";
|
|
14
|
-
import { Stats } from "./Stats";
|
|
15
|
-
import { actionToggleStats } from "../actions";
|
|
16
14
|
import { HandButton } from "./HandButton";
|
|
17
15
|
import { isHandToolActive } from "../appState";
|
|
18
16
|
import { useTunnels } from "../context/tunnels";
|
|
@@ -27,9 +25,7 @@ export const MobileMenu = ({ appState, elements, actionManager, setAppState, onL
|
|
|
27
25
|
}
|
|
28
26
|
return (_jsxs("div", { className: "App-toolbar-content", children: [_jsx(MainMenuTunnel.Out, {}), actionManager.renderAction("toggleEditMenu"), actionManager.renderAction("undo"), actionManager.renderAction("redo"), actionManager.renderAction(appState.multiElement ? "finalize" : "duplicateSelection"), actionManager.renderAction("deleteSelectedElements")] }));
|
|
29
27
|
};
|
|
30
|
-
return (_jsxs(_Fragment, { children: [renderSidebars(), !appState.viewModeEnabled && renderToolbar(),
|
|
31
|
-
actionManager.executeAction(actionToggleStats);
|
|
32
|
-
}, renderCustomStats: renderCustomStats })), _jsx("div", { className: "App-bottom-bar", style: {
|
|
28
|
+
return (_jsxs(_Fragment, { children: [renderSidebars(), !appState.viewModeEnabled && renderToolbar(), _jsx("div", { className: "App-bottom-bar", style: {
|
|
33
29
|
marginBottom: SCROLLBAR_WIDTH + SCROLLBAR_MARGIN * 2,
|
|
34
30
|
marginLeft: SCROLLBAR_WIDTH + SCROLLBAR_MARGIN * 2,
|
|
35
31
|
marginRight: SCROLLBAR_WIDTH + SCROLLBAR_MARGIN * 2,
|
|
@@ -37,7 +33,7 @@ export const MobileMenu = ({ appState, elements, actionManager, setAppState, onL
|
|
|
37
33
|
!appState.viewModeEnabled &&
|
|
38
34
|
showSelectedShapeActions(appState, elements) ? (_jsx(Section, { className: "App-mobile-menu", heading: "selectedShapeActions", children: _jsx(SelectedShapeActions, { appState: appState, elementsMap: app.scene.getNonDeletedElementsMap(), renderAction: actionManager.renderAction }) })) : null, _jsxs("footer", { className: "App-toolbar", children: [renderAppToolbar(), appState.scrolledOutside &&
|
|
39
35
|
!appState.openMenu &&
|
|
40
|
-
!appState.openSidebar && (_jsx("button", { className: "scroll-back-to-content", onClick: () => {
|
|
36
|
+
!appState.openSidebar && (_jsx("button", { type: "button", className: "scroll-back-to-content", onClick: () => {
|
|
41
37
|
setAppState((appState) => ({
|
|
42
38
|
...calculateScrollCenter(elements, appState),
|
|
43
39
|
}));
|
|
@@ -35,7 +35,7 @@ const ChartPreviewBtn = (props) => {
|
|
|
35
35
|
previewNode.replaceChildren();
|
|
36
36
|
};
|
|
37
37
|
}, [props.spreadsheet, props.chartType, props.selected]);
|
|
38
|
-
return (_jsx("button", { className: "ChartPreview", onClick: () => {
|
|
38
|
+
return (_jsx("button", { type: "button", className: "ChartPreview", onClick: () => {
|
|
39
39
|
if (chartElements) {
|
|
40
40
|
props.onClick(props.chartType, chartElements);
|
|
41
41
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React, { type ReactNode } from "react";
|
|
2
|
+
import * as Popover from "@radix-ui/react-popover";
|
|
3
|
+
interface PropertiesPopoverProps {
|
|
4
|
+
className?: string;
|
|
5
|
+
container: HTMLDivElement | null;
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
style?: object;
|
|
8
|
+
onClose: () => void;
|
|
9
|
+
onKeyDown?: React.KeyboardEventHandler<HTMLDivElement>;
|
|
10
|
+
onPointerLeave?: React.PointerEventHandler<HTMLDivElement>;
|
|
11
|
+
onFocusOutside?: Popover.DismissableLayerProps["onFocusOutside"];
|
|
12
|
+
onPointerDownOutside?: Popover.DismissableLayerProps["onPointerDownOutside"];
|
|
13
|
+
}
|
|
14
|
+
export declare const PropertiesPopover: React.ForwardRefExoticComponent<PropertiesPopoverProps & React.RefAttributes<HTMLDivElement>>;
|
|
15
|
+
export {};
|