@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,15 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import "./ButtonIcon.scss";
|
|
3
|
+
interface ButtonIconProps {
|
|
4
|
+
icon: JSX.Element;
|
|
5
|
+
title: string;
|
|
6
|
+
className?: string;
|
|
7
|
+
testId?: string;
|
|
8
|
+
/** if not supplied, defaults to value identity check */
|
|
9
|
+
active?: boolean;
|
|
10
|
+
/** include standalone style (could interfere with parent styles) */
|
|
11
|
+
standalone?: boolean;
|
|
12
|
+
onClick: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
|
|
13
|
+
}
|
|
14
|
+
export declare const ButtonIcon: import("react").ForwardRefExoticComponent<ButtonIconProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import clsx from "clsx";
|
|
4
|
+
import "./ButtonIcon.scss";
|
|
5
|
+
export const ButtonIcon = forwardRef((props, ref) => {
|
|
6
|
+
const { title, className, testId, active, standalone, icon, onClick } = props;
|
|
7
|
+
return (_jsx("button", { type: "button", ref: ref, title: title, "data-testid": testId, className: clsx(className, { standalone, active }), onClick: onClick, children: icon }, title));
|
|
8
|
+
});
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import clsx from "clsx";
|
|
3
|
+
import { ButtonIcon } from "./ButtonIcon";
|
|
3
4
|
// TODO: It might be "clever" to add option.icon to the existing component <ButtonSelect />
|
|
4
|
-
export const ButtonIconSelect = (props) => (_jsx("div", { className: "buttonList
|
|
5
|
-
active: option.active ?? props.value === option.value,
|
|
6
|
-
}), "data-testid": option.testId, title: option.text, children: option.icon }, option.text)) : (_jsxs("label", { className: clsx({ active: props.value === option.value }), title: option.text, children: [_jsx("input", { type: "radio", name: props.group, onChange: () => props.onChange(option.value), checked: props.value === option.value, "data-testid": option.testId }), option.icon] }, option.text))) }));
|
|
5
|
+
export const ButtonIconSelect = (props) => (_jsx("div", { className: "buttonList", children: props.options.map((option) => props.type === "button" ? (_jsx(ButtonIcon, { icon: option.icon, title: option.text, testId: option.testId, active: option.active ?? props.value === option.value, onClick: (event) => props.onClick(option.value, event) }, option.text)) : (_jsxs("label", { className: clsx({ active: props.value === option.value }), title: option.text, children: [_jsx("input", { type: "radio", name: props.group, onChange: () => props.onChange(option.value), checked: props.value === option.value, "data-testid": option.testId }), option.icon] }, option.text))) }));
|
|
@@ -6,5 +6,5 @@ export const CheckboxItem = ({ children, checked, onChange, className }) => {
|
|
|
6
6
|
return (_jsxs("div", { className: clsx("Checkbox", className, { "is-checked": checked }), onClick: (event) => {
|
|
7
7
|
onChange(!checked, event);
|
|
8
8
|
event.currentTarget.querySelector(".Checkbox-box").focus();
|
|
9
|
-
}, children: [_jsx("button", { className: "Checkbox-box", role: "checkbox", "aria-checked": checked, children: checkIcon }), _jsx("div", { className: "Checkbox-label", children: children })] }));
|
|
9
|
+
}, children: [_jsx("button", { type: "button", className: "Checkbox-box", role: "checkbox", "aria-checked": checked, children: checkIcon }), _jsx("div", { className: "Checkbox-label", children: children })] }));
|
|
10
10
|
};
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
|
|
|
2
2
|
import { useCallback, useEffect, useRef, useState } from "react";
|
|
3
3
|
import { getColor } from "./ColorPicker";
|
|
4
4
|
import { useAtom } from "jotai";
|
|
5
|
-
import { activeColorPickerSectionAtom
|
|
5
|
+
import { activeColorPickerSectionAtom } from "./colorPickerUtils";
|
|
6
6
|
import { eyeDropperIcon } from "../icons";
|
|
7
7
|
import { jotaiScope } from "../../jotai";
|
|
8
8
|
import { KEYS } from "../../keys";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { ExcalidrawElement } from "../../element/types";
|
|
3
|
-
import { AppState } from "../../types";
|
|
4
|
-
import { ColorPickerType } from "./colorPickerUtils";
|
|
5
|
-
import { ColorTuple, ColorPaletteCustom } from "../../colors";
|
|
2
|
+
import type { ExcalidrawElement } from "../../element/types";
|
|
3
|
+
import type { AppState } from "../../types";
|
|
4
|
+
import type { ColorPickerType } from "./colorPickerUtils";
|
|
5
|
+
import type { ColorTuple, ColorPaletteCustom } from "../../colors";
|
|
6
6
|
import "./ColorPicker.scss";
|
|
7
7
|
export declare const getColor: (color: string) => string | null;
|
|
8
8
|
interface ColorPickerProps {
|
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { isTransparent } from "../../utils";
|
|
3
3
|
import { TopPicks } from "./TopPicks";
|
|
4
|
+
import { ButtonSeparator } from "../ButtonSeparator";
|
|
4
5
|
import { Picker } from "./Picker";
|
|
5
6
|
import * as Popover from "@radix-ui/react-popover";
|
|
6
7
|
import { useAtom } from "jotai";
|
|
7
|
-
import { activeColorPickerSectionAtom
|
|
8
|
-
import {
|
|
8
|
+
import { activeColorPickerSectionAtom } from "./colorPickerUtils";
|
|
9
|
+
import { useExcalidrawContainer } from "../App";
|
|
9
10
|
import { COLOR_PALETTE } from "../../colors";
|
|
10
11
|
import PickerHeading from "./PickerHeading";
|
|
11
12
|
import { t } from "../../i18n";
|
|
12
13
|
import clsx from "clsx";
|
|
14
|
+
import { useRef } from "react";
|
|
13
15
|
import { jotaiScope } from "../../jotai";
|
|
14
16
|
import { ColorInput } from "./ColorInput";
|
|
15
|
-
import { useRef } from "react";
|
|
16
17
|
import { activeEyeDropperAtom } from "../EyeDropper";
|
|
18
|
+
import { PropertiesPopover } from "../PropertiesPopover";
|
|
17
19
|
import "./ColorPicker.scss";
|
|
18
20
|
const isValidColor = (color) => {
|
|
19
21
|
const style = new Option().style;
|
|
@@ -34,10 +36,9 @@ export const getColor = (color) => {
|
|
|
34
36
|
: null;
|
|
35
37
|
};
|
|
36
38
|
const ColorPickerPopupContent = ({ type, color, onChange, label, elements, palette = COLOR_PALETTE, updateData, }) => {
|
|
39
|
+
const { container } = useExcalidrawContainer();
|
|
37
40
|
const [, setActiveColorPickerSection] = useAtom(activeColorPickerSectionAtom);
|
|
38
41
|
const [eyeDropperState, setEyeDropperState] = useAtom(activeEyeDropperAtom, jotaiScope);
|
|
39
|
-
const { container } = useExcalidrawContainer();
|
|
40
|
-
const device = useDevice();
|
|
41
42
|
const colorInputJSX = (_jsxs("div", { children: [_jsx(PickerHeading, { children: t("colorPicker.hexCode") }), _jsx(ColorInput, { color: color, label: label, onChange: (color) => {
|
|
42
43
|
onChange(color);
|
|
43
44
|
}, colorPickerType: type })] }));
|
|
@@ -47,92 +48,59 @@ const ColorPickerPopupContent = ({ type, color, onChange, label, elements, palet
|
|
|
47
48
|
?.querySelector(".color-picker-content")
|
|
48
49
|
?.focus();
|
|
49
50
|
};
|
|
50
|
-
return (_jsx(
|
|
51
|
-
|
|
51
|
+
return (_jsx(PropertiesPopover, { container: container, style: { maxWidth: "208px" }, onFocusOutside: (event) => {
|
|
52
|
+
// refocus due to eye dropper
|
|
53
|
+
focusPickerContent();
|
|
54
|
+
event.preventDefault();
|
|
55
|
+
}, onPointerDownOutside: (event) => {
|
|
56
|
+
if (eyeDropperState) {
|
|
57
|
+
// prevent from closing if we click outside the popover
|
|
58
|
+
// while eyedropping (e.g. click when clicking the sidebar;
|
|
59
|
+
// the eye-dropper-backdrop is prevented downstream)
|
|
52
60
|
event.preventDefault();
|
|
53
|
-
}
|
|
61
|
+
}
|
|
62
|
+
}, onClose: () => {
|
|
63
|
+
updateData({ openPopup: null });
|
|
64
|
+
setActiveColorPickerSection(null);
|
|
65
|
+
}, children: palette ? (_jsx(Picker, { palette: palette, color: color, onChange: (changedColor) => {
|
|
66
|
+
onChange(changedColor);
|
|
67
|
+
}, onEyeDropperToggle: (force) => {
|
|
68
|
+
setEyeDropperState((state) => {
|
|
69
|
+
if (force) {
|
|
70
|
+
state = state || {
|
|
71
|
+
keepOpenOnAlt: true,
|
|
72
|
+
onSelect: onChange,
|
|
73
|
+
colorPickerType: type,
|
|
74
|
+
};
|
|
75
|
+
state.keepOpenOnAlt = true;
|
|
76
|
+
return state;
|
|
77
|
+
}
|
|
78
|
+
return force === false || state
|
|
79
|
+
? null
|
|
80
|
+
: {
|
|
81
|
+
keepOpenOnAlt: false,
|
|
82
|
+
onSelect: onChange,
|
|
83
|
+
colorPickerType: type,
|
|
84
|
+
};
|
|
85
|
+
});
|
|
86
|
+
}, onEscape: (event) => {
|
|
54
87
|
if (eyeDropperState) {
|
|
55
|
-
|
|
56
|
-
// while eyedropping (e.g. click when clicking the sidebar;
|
|
57
|
-
// the eye-dropper-backdrop is prevented downstream)
|
|
58
|
-
event.preventDefault();
|
|
88
|
+
setEyeDropperState(null);
|
|
59
89
|
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
// prevents focusing the trigger
|
|
63
|
-
e.preventDefault();
|
|
64
|
-
// return focus to excalidraw container unless
|
|
65
|
-
// user focuses an interactive element, such as a button, or
|
|
66
|
-
// enters the text editor by clicking on canvas with the text tool
|
|
67
|
-
if (container && !isInteractive(document.activeElement)) {
|
|
68
|
-
container.focus();
|
|
90
|
+
else {
|
|
91
|
+
updateData({ openPopup: null });
|
|
69
92
|
}
|
|
70
|
-
|
|
71
|
-
setActiveColorPickerSection(null);
|
|
72
|
-
}, side: device.editor.isMobile && !device.viewport.isLandscape
|
|
73
|
-
? "bottom"
|
|
74
|
-
: "right", align: device.editor.isMobile && !device.viewport.isLandscape
|
|
75
|
-
? "center"
|
|
76
|
-
: "start", alignOffset: -16, sideOffset: 20, style: {
|
|
77
|
-
zIndex: "var(--zIndex-layerUI)",
|
|
78
|
-
backgroundColor: "var(--popup-bg-color)",
|
|
79
|
-
maxWidth: "208px",
|
|
80
|
-
maxHeight: window.innerHeight,
|
|
81
|
-
padding: "12px",
|
|
82
|
-
borderRadius: "8px",
|
|
83
|
-
boxSizing: "border-box",
|
|
84
|
-
overflowY: "auto",
|
|
85
|
-
boxShadow: "0px 7px 14px rgba(0, 0, 0, 0.05), 0px 0px 3.12708px rgba(0, 0, 0, 0.0798), 0px 0px 0.931014px rgba(0, 0, 0, 0.1702)",
|
|
86
|
-
}, children: [palette ? (_jsx(Picker, { palette: palette, color: color, onChange: (changedColor) => {
|
|
87
|
-
onChange(changedColor);
|
|
88
|
-
}, onEyeDropperToggle: (force) => {
|
|
89
|
-
setEyeDropperState((state) => {
|
|
90
|
-
if (force) {
|
|
91
|
-
state = state || {
|
|
92
|
-
keepOpenOnAlt: true,
|
|
93
|
-
onSelect: onChange,
|
|
94
|
-
colorPickerType: type,
|
|
95
|
-
};
|
|
96
|
-
state.keepOpenOnAlt = true;
|
|
97
|
-
return state;
|
|
98
|
-
}
|
|
99
|
-
return force === false || state
|
|
100
|
-
? null
|
|
101
|
-
: {
|
|
102
|
-
keepOpenOnAlt: false,
|
|
103
|
-
onSelect: onChange,
|
|
104
|
-
colorPickerType: type,
|
|
105
|
-
};
|
|
106
|
-
});
|
|
107
|
-
}, onEscape: (event) => {
|
|
108
|
-
if (eyeDropperState) {
|
|
109
|
-
setEyeDropperState(null);
|
|
110
|
-
}
|
|
111
|
-
else if (isWritableElement(event.target)) {
|
|
112
|
-
focusPickerContent();
|
|
113
|
-
}
|
|
114
|
-
else {
|
|
115
|
-
updateData({ openPopup: null });
|
|
116
|
-
}
|
|
117
|
-
}, label: label, type: type, elements: elements, updateData: updateData, children: colorInputJSX })) : (colorInputJSX), _jsx(Popover.Arrow, { width: 20, height: 10, style: {
|
|
118
|
-
fill: "var(--popup-bg-color)",
|
|
119
|
-
filter: "drop-shadow(rgba(0, 0, 0, 0.05) 0px 3px 2px)",
|
|
120
|
-
} })] }) }));
|
|
93
|
+
}, label: label, type: type, elements: elements, updateData: updateData, children: colorInputJSX })) : (colorInputJSX) }));
|
|
121
94
|
};
|
|
122
95
|
const ColorPickerTrigger = ({ label, color, type, }) => {
|
|
123
|
-
return (_jsx(Popover.Trigger, { type: "button", className: clsx("color-picker__button active-color", {
|
|
96
|
+
return (_jsx(Popover.Trigger, { type: "button", className: clsx("color-picker__button active-color properties-trigger", {
|
|
124
97
|
"is-transparent": color === "transparent" || !color,
|
|
125
98
|
}), "aria-label": label, style: color ? { "--swatch-color": color } : undefined, title: type === "elementStroke"
|
|
126
99
|
? t("labels.showStroke")
|
|
127
100
|
: t("labels.showBackground"), children: _jsx("div", { className: "color-picker__button-outline" }) }));
|
|
128
101
|
};
|
|
129
102
|
export const ColorPicker = ({ type, color, onChange, label, elements, palette = COLOR_PALETTE, topPicks, updateData, appState, }) => {
|
|
130
|
-
return (_jsx("div", { children: _jsxs("div", { role: "dialog", "aria-modal": "true", className: "color-picker-container", children: [_jsx(TopPicks, { activeColor: color, onChange: onChange, type: type, topPicks: topPicks }), _jsx(
|
|
131
|
-
width: 1,
|
|
132
|
-
height: "100%",
|
|
133
|
-
backgroundColor: "var(--default-border-color)",
|
|
134
|
-
margin: "0 auto",
|
|
135
|
-
} }), _jsxs(Popover.Root, { open: appState.openPopup === type, onOpenChange: (open) => {
|
|
103
|
+
return (_jsx("div", { children: _jsxs("div", { role: "dialog", "aria-modal": "true", className: "color-picker-container", children: [_jsx(TopPicks, { activeColor: color, onChange: onChange, type: type, topPicks: topPicks }), _jsx(ButtonSeparator, {}), _jsxs(Popover.Root, { open: appState.openPopup === type, onOpenChange: (open) => {
|
|
136
104
|
updateData({ openPopup: open ? type : null });
|
|
137
105
|
}, children: [_jsx(ColorPickerTrigger, { color: color, label: label, type: type }), appState.openPopup === type && (_jsx(ColorPickerPopupContent, { type: type, color: color, onChange: onChange, label: label, elements: elements, palette: palette, updateData: updateData }))] })] }) }));
|
|
138
106
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { ExcalidrawElement } from "../../element/types";
|
|
3
|
-
import { ColorPickerType } from "./colorPickerUtils";
|
|
4
|
-
import { ColorPaletteCustom } from "../../colors";
|
|
2
|
+
import type { ExcalidrawElement } from "../../element/types";
|
|
3
|
+
import type { ColorPickerType } from "./colorPickerUtils";
|
|
4
|
+
import type { ColorPaletteCustom } from "../../colors";
|
|
5
5
|
interface PickerProps {
|
|
6
6
|
color: string;
|
|
7
7
|
onChange: (color: string) => void;
|
|
@@ -80,7 +80,7 @@ export const Picker = ({ color, onChange, label, type, elements, palette, update
|
|
|
80
80
|
event.preventDefault();
|
|
81
81
|
event.stopPropagation();
|
|
82
82
|
}
|
|
83
|
-
}, className: "color-picker-content",
|
|
83
|
+
}, className: "color-picker-content properties-content",
|
|
84
84
|
// to allow focusing by clicking but not by tabbing
|
|
85
85
|
tabIndex: -1, children: [!!customColors.length && (_jsxs("div", { children: [_jsx(PickerHeading, { children: t("colorPicker.mostUsedCustomColors") }), _jsx(CustomColorList, { colors: customColors, color: color, label: t("colorPicker.mostUsedCustomColors"), onChange: onChange })] })), _jsxs("div", { children: [_jsx(PickerHeading, { children: t("colorPicker.colors") }), _jsx(PickerColorList, { color: color, label: label, palette: palette, onChange: onChange, activeShade: activeShade })] }), _jsxs("div", { children: [_jsx(PickerHeading, { children: t("colorPicker.shades") }), _jsx(ShadeList, { hex: color, onChange: onChange, palette: palette })] }), children] }) }));
|
|
86
86
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ExcalidrawElement } from "../../element/types";
|
|
2
|
-
import { ColorPickerColor, ColorPaletteCustom } from "../../colors";
|
|
1
|
+
import type { ExcalidrawElement } from "../../element/types";
|
|
2
|
+
import type { ColorPickerColor, ColorPaletteCustom } from "../../colors";
|
|
3
3
|
export declare const getColorNameAndShadeFromColor: ({ palette, color, }: {
|
|
4
4
|
palette: ColorPaletteCustom;
|
|
5
5
|
color: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { atom } from "jotai";
|
|
2
|
-
import { MAX_CUSTOM_COLORS_USED_IN_CANVAS
|
|
2
|
+
import { MAX_CUSTOM_COLORS_USED_IN_CANVAS } from "../../colors";
|
|
3
3
|
export const getColorNameAndShadeFromColor = ({ palette, color, }) => {
|
|
4
4
|
for (const [colorName, colorVal] of Object.entries(palette)) {
|
|
5
5
|
if (Array.isArray(colorVal)) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { ColorPaletteCustom } from "../../colors";
|
|
3
|
-
import { ActiveColorPickerSectionAtomType } from "./colorPickerUtils";
|
|
2
|
+
import type { ColorPaletteCustom } from "../../colors";
|
|
3
|
+
import type { ActiveColorPickerSectionAtomType } from "./colorPickerUtils";
|
|
4
4
|
interface ColorPickerKeyNavHandlerProps {
|
|
5
5
|
event: React.KeyboardEvent;
|
|
6
6
|
activeColorPickerSection: ActiveColorPickerSectionAtomType;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { KEYS } from "../../keys";
|
|
2
|
-
import { COLORS_PER_ROW, COLOR_PALETTE
|
|
2
|
+
import { COLORS_PER_ROW, COLOR_PALETTE } from "../../colors";
|
|
3
3
|
import { colorPickerHotkeyBindings, getColorNameAndShadeFromColor, } from "./colorPickerUtils";
|
|
4
4
|
const arrowHandler = (eventKey, currentIndex, length) => {
|
|
5
5
|
const rows = Math.ceil(length / COLORS_PER_ROW);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { CommandPaletteItem } from "./types";
|
|
2
|
+
import type { CommandPaletteItem } from "./types";
|
|
3
3
|
import * as defaultItems from "./defaultCommandPaletteItems";
|
|
4
4
|
import "./CommandPalette.scss";
|
|
5
5
|
export declare const DEFAULT_CATEGORIES: {
|
|
@@ -7,7 +7,7 @@ import { TextField } from "../TextField";
|
|
|
7
7
|
import clsx from "clsx";
|
|
8
8
|
import { getSelectedElements } from "../../scene";
|
|
9
9
|
import { t } from "../../i18n";
|
|
10
|
-
import { getShortcutFromShortcutName
|
|
10
|
+
import { getShortcutFromShortcutName } from "../../actions/shortcuts";
|
|
11
11
|
import { DEFAULT_SIDEBAR, EVENT } from "../../constants";
|
|
12
12
|
import { LockedIcon, UnlockedIcon, clockIcon, searchIcon, boltIcon, bucketFillIcon, ExportImageIcon, mermaidLogoIcon, brainIconThin, LibraryIcon, } from "../icons";
|
|
13
13
|
import fuzzy from "fuzzy";
|
|
@@ -164,10 +164,10 @@ function CommandPaletteInner({ customCommandPaletteItems, }) {
|
|
|
164
164
|
actionManager.actions.deleteSelectedElements,
|
|
165
165
|
actionManager.actions.copyStyles,
|
|
166
166
|
actionManager.actions.pasteStyles,
|
|
167
|
+
actionManager.actions.bringToFront,
|
|
168
|
+
actionManager.actions.bringForward,
|
|
167
169
|
actionManager.actions.sendBackward,
|
|
168
170
|
actionManager.actions.sendToBack,
|
|
169
|
-
actionManager.actions.bringForward,
|
|
170
|
-
actionManager.actions.bringToFront,
|
|
171
171
|
actionManager.actions.alignTop,
|
|
172
172
|
actionManager.actions.alignBottom,
|
|
173
173
|
actionManager.actions.alignLeft,
|
|
@@ -416,7 +416,7 @@ function CommandPaletteInner({ customCommandPaletteItems, }) {
|
|
|
416
416
|
...command,
|
|
417
417
|
icon: command.icon || boltIcon,
|
|
418
418
|
order: command.order ?? getCategoryOrder(command.category),
|
|
419
|
-
haystack: `${deburr(command.label)} ${command.keywords?.join(" ") || ""}`,
|
|
419
|
+
haystack: `${deburr(command.label.toLocaleLowerCase())} ${command.keywords?.join(" ") || ""}`,
|
|
420
420
|
};
|
|
421
421
|
});
|
|
422
422
|
setAllCommands(allCommands);
|
|
@@ -584,7 +584,7 @@ function CommandPaletteInner({ customCommandPaletteItems, }) {
|
|
|
584
584
|
setCurrentCommand(showLastUsed ? lastUsed : matchingCommands[0] || null);
|
|
585
585
|
return;
|
|
586
586
|
}
|
|
587
|
-
const _query = deburr(commandSearch.replace(/[
|
|
587
|
+
const _query = deburr(commandSearch.toLocaleLowerCase().replace(/[<>_| -]/g, ""));
|
|
588
588
|
matchingCommands = fuzzy
|
|
589
589
|
.filter(_query, matchingCommands, {
|
|
590
590
|
extract: (command) => command.haystack,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { CommandPaletteItem } from "./types";
|
|
1
|
+
import type { CommandPaletteItem } from "./types";
|
|
2
2
|
export declare const toggleTheme: CommandPaletteItem;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { ActionManager } from "../../actions/manager";
|
|
3
|
-
import { Action } from "../../actions/types";
|
|
4
|
-
import { UIAppState } from "../../types";
|
|
2
|
+
import type { ActionManager } from "../../actions/manager";
|
|
3
|
+
import type { Action } from "../../actions/types";
|
|
4
|
+
import type { UIAppState } from "../../types";
|
|
5
5
|
export type CommandPaletteItem = {
|
|
6
6
|
label: string;
|
|
7
7
|
/** additional keywords to match against
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "./ContextMenu.scss";
|
|
2
|
-
import { Action } from "../actions/types";
|
|
3
|
-
import { ActionManager } from "../actions/manager";
|
|
2
|
+
import type { Action } from "../actions/types";
|
|
3
|
+
import type { ActionManager } from "../actions/manager";
|
|
4
4
|
import React from "react";
|
|
5
5
|
export type ContextMenuItem = typeof CONTEXT_MENU_SEPARATOR | Action;
|
|
6
6
|
export type ContextMenuItems = (ContextMenuItem | false | null | undefined)[];
|
|
@@ -3,7 +3,7 @@ import clsx from "clsx";
|
|
|
3
3
|
import { Popover } from "./Popover";
|
|
4
4
|
import { t } from "../i18n";
|
|
5
5
|
import "./ContextMenu.scss";
|
|
6
|
-
import { getShortcutFromShortcutName
|
|
6
|
+
import { getShortcutFromShortcutName } from "../actions/shortcuts";
|
|
7
7
|
import { useExcalidrawAppState, useExcalidrawElements } from "./App";
|
|
8
8
|
import React from "react";
|
|
9
9
|
export const CONTEXT_MENU_SEPARATOR = "separator";
|
|
@@ -46,7 +46,7 @@ export const ContextMenu = React.memo(({ actionManager, items, top, left, onClos
|
|
|
46
46
|
onClose(() => {
|
|
47
47
|
actionManager.executeAction(item, "contextMenu");
|
|
48
48
|
});
|
|
49
|
-
}, children: _jsxs("button", { className: clsx("context-menu-item", {
|
|
49
|
+
}, children: _jsxs("button", { type: "button", className: clsx("context-menu-item", {
|
|
50
50
|
dangerous: actionName === "deleteSelectedElements",
|
|
51
51
|
checkmark: item.checked?.(appState),
|
|
52
52
|
}), children: [_jsx("div", { className: "context-menu-item__label", children: label }), _jsx("kbd", { className: "context-menu-item__shortcut", children: actionName
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { MarkOptional } from "../utility-types";
|
|
3
|
-
import { SidebarProps, SidebarTriggerProps } from "./Sidebar/common";
|
|
2
|
+
import type { MarkOptional } from "../utility-types";
|
|
3
|
+
import type { SidebarProps, SidebarTriggerProps } from "./Sidebar/common";
|
|
4
4
|
export declare const DefaultSidebar: import("react").FC<Omit<MarkOptional<Omit<{
|
|
5
5
|
name: string;
|
|
6
6
|
children: import("react").ReactNode;
|
|
@@ -72,5 +72,5 @@ export const Dialog = (props) => {
|
|
|
72
72
|
};
|
|
73
73
|
return (_jsx(Modal, { className: clsx("Dialog", props.className, {
|
|
74
74
|
"Dialog--fullscreen": isFullscreen,
|
|
75
|
-
}), labelledBy: "dialog-title", maxWidth: getDialogSize(props.size), onCloseRequest: onClose, closeOnClickOutside: props.closeOnClickOutside, children: _jsxs(Island, { ref: setIslandNode, children: [props.title && (_jsx("h2", { id: `${id}-dialog-title`, className: "Dialog__title", children: _jsx("span", { className: "Dialog__titleContent", children: props.title }) })), isFullscreen && (_jsx("button", { className: "Dialog__close", onClick: onClose, title: t("buttons.close"), "aria-label": t("buttons.close"), children: CloseIcon })), _jsx("div", { className: "Dialog__content", children: props.children })] }) }));
|
|
75
|
+
}), labelledBy: "dialog-title", maxWidth: getDialogSize(props.size), onCloseRequest: onClose, closeOnClickOutside: props.closeOnClickOutside, children: _jsxs(Island, { ref: setIslandNode, children: [props.title && (_jsx("h2", { id: `${id}-dialog-title`, className: "Dialog__title", children: _jsx("span", { className: "Dialog__titleContent", children: props.title }) })), isFullscreen && (_jsx("button", { className: "Dialog__close", onClick: onClose, title: t("buttons.close"), "aria-label": t("buttons.close"), type: "button", children: CloseIcon })), _jsx("div", { className: "Dialog__content", children: props.children })] }) }));
|
|
76
76
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import "./EyeDropper.scss";
|
|
3
|
-
import { ColorPickerType } from "./ColorPicker/colorPickerUtils";
|
|
4
|
-
import { ExcalidrawElement } from "../element/types";
|
|
3
|
+
import type { ColorPickerType } from "./ColorPicker/colorPickerUtils";
|
|
4
|
+
import type { ExcalidrawElement } from "../element/types";
|
|
5
5
|
export type EyeDropperProperties = {
|
|
6
6
|
keepOpenOnAlt: boolean;
|
|
7
7
|
swapPreviewOnAlt?: boolean;
|
|
@@ -2,6 +2,6 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { CloseIcon } from "../icons";
|
|
3
3
|
import "./FollowMode.scss";
|
|
4
4
|
const FollowMode = ({ height, width, userToFollow, onDisconnect, }) => {
|
|
5
|
-
return (_jsx("div", { className: "follow-mode", style: { width, height }, children: _jsxs("div", { className: "follow-mode__badge", children: [_jsxs("div", { className: "follow-mode__badge__label", children: ["Following", " ", _jsx("span", { className: "follow-mode__badge__username", title: userToFollow.username, children: userToFollow.username })] }), _jsx("button", { onClick: onDisconnect, className: "follow-mode__disconnect-btn", children: CloseIcon })] }) }));
|
|
5
|
+
return (_jsx("div", { className: "follow-mode", style: { width, height }, children: _jsxs("div", { className: "follow-mode__badge", children: [_jsxs("div", { className: "follow-mode__badge__label", children: ["Following", " ", _jsx("span", { className: "follow-mode__badge__username", title: userToFollow.username, children: userToFollow.username })] }), _jsx("button", { type: "button", onClick: onDisconnect, className: "follow-mode__disconnect-btn", children: CloseIcon })] }) }));
|
|
6
6
|
};
|
|
7
7
|
export default FollowMode;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { FontFamilyValues } from "../../element/types";
|
|
3
|
+
import "./FontPicker.scss";
|
|
4
|
+
export declare const DEFAULT_FONTS: {
|
|
5
|
+
value: number;
|
|
6
|
+
icon: JSX.Element;
|
|
7
|
+
text: string;
|
|
8
|
+
testId: string;
|
|
9
|
+
}[];
|
|
10
|
+
export declare const isDefaultFont: (fontFamily: number | null) => boolean;
|
|
11
|
+
interface FontPickerProps {
|
|
12
|
+
isOpened: boolean;
|
|
13
|
+
selectedFontFamily: FontFamilyValues | null;
|
|
14
|
+
hoveredFontFamily: FontFamilyValues | null;
|
|
15
|
+
onSelect: (fontFamily: FontFamilyValues) => void;
|
|
16
|
+
onHover: (fontFamily: FontFamilyValues) => void;
|
|
17
|
+
onLeave: () => void;
|
|
18
|
+
onPopupChange: (open: boolean) => void;
|
|
19
|
+
}
|
|
20
|
+
export declare const FontPicker: React.MemoExoticComponent<({ isOpened, selectedFontFamily, hoveredFontFamily, onSelect, onHover, onLeave, onPopupChange, }: FontPickerProps) => JSX.Element>;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React, { useCallback, useMemo } from "react";
|
|
3
|
+
import * as Popover from "@radix-ui/react-popover";
|
|
4
|
+
import { FontPickerList } from "./FontPickerList";
|
|
5
|
+
import { FontPickerTrigger } from "./FontPickerTrigger";
|
|
6
|
+
import { ButtonIconSelect } from "../ButtonIconSelect";
|
|
7
|
+
import { FontFamilyCodeIcon, FontFamilyNormalIcon, FreedrawIcon, } from "../icons";
|
|
8
|
+
import { ButtonSeparator } from "../ButtonSeparator";
|
|
9
|
+
import { FONT_FAMILY } from "../../constants";
|
|
10
|
+
import { t } from "../../i18n";
|
|
11
|
+
import "./FontPicker.scss";
|
|
12
|
+
export const DEFAULT_FONTS = [
|
|
13
|
+
{
|
|
14
|
+
value: FONT_FAMILY.Excalifont,
|
|
15
|
+
icon: FreedrawIcon,
|
|
16
|
+
text: t("labels.handDrawn"),
|
|
17
|
+
testId: "font-family-handrawn",
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
value: FONT_FAMILY.Nunito,
|
|
21
|
+
icon: FontFamilyNormalIcon,
|
|
22
|
+
text: t("labels.normal"),
|
|
23
|
+
testId: "font-family-normal",
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
value: FONT_FAMILY["Comic Shanns"],
|
|
27
|
+
icon: FontFamilyCodeIcon,
|
|
28
|
+
text: t("labels.code"),
|
|
29
|
+
testId: "font-family-code",
|
|
30
|
+
},
|
|
31
|
+
];
|
|
32
|
+
const defaultFontFamilies = new Set(DEFAULT_FONTS.map((x) => x.value));
|
|
33
|
+
export const isDefaultFont = (fontFamily) => {
|
|
34
|
+
if (!fontFamily) {
|
|
35
|
+
return false;
|
|
36
|
+
}
|
|
37
|
+
return defaultFontFamilies.has(fontFamily);
|
|
38
|
+
};
|
|
39
|
+
export const FontPicker = React.memo(({ isOpened, selectedFontFamily, hoveredFontFamily, onSelect, onHover, onLeave, onPopupChange, }) => {
|
|
40
|
+
const defaultFonts = useMemo(() => DEFAULT_FONTS, []);
|
|
41
|
+
const onSelectCallback = useCallback((value) => {
|
|
42
|
+
if (value) {
|
|
43
|
+
onSelect(value);
|
|
44
|
+
}
|
|
45
|
+
}, [onSelect]);
|
|
46
|
+
return (_jsxs("div", { role: "dialog", "aria-modal": "true", className: "FontPicker__container", children: [_jsx(ButtonIconSelect, { type: "button", options: defaultFonts, value: selectedFontFamily, onClick: onSelectCallback }), _jsx(ButtonSeparator, {}), _jsxs(Popover.Root, { open: isOpened, onOpenChange: onPopupChange, children: [_jsx(FontPickerTrigger, { selectedFontFamily: selectedFontFamily }), isOpened && (_jsx(FontPickerList, { selectedFontFamily: selectedFontFamily, hoveredFontFamily: hoveredFontFamily, onSelect: onSelectCallback, onHover: onHover, onLeave: onLeave, onOpen: () => onPopupChange(true), onClose: () => onPopupChange(false) }))] })] }));
|
|
47
|
+
}, (prev, next) => prev.isOpened === next.isOpened &&
|
|
48
|
+
prev.selectedFontFamily === next.selectedFontFamily &&
|
|
49
|
+
prev.hoveredFontFamily === next.hoveredFontFamily);
|