@excalidraw/excalidraw 0.17.1-d9bbf1e → 0.17.1-e63dd02
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/dist/browser/dev/excalidraw-assets-dev/CascadiaCode-Regular-TMZI7IJ5.woff2 +0 -0
- package/dist/browser/dev/excalidraw-assets-dev/ComicShanns-Regular-6TOETDFT.woff2 +0 -0
- package/dist/browser/dev/excalidraw-assets-dev/Excalifont-Regular-CPKEUDVM.woff2 +0 -0
- package/dist/browser/dev/excalidraw-assets-dev/LiberationSans-Regular-ZQD73GJM.woff2 +0 -0
- package/dist/browser/dev/excalidraw-assets-dev/Virgil-Regular-YHAB2VGJ.woff2 +0 -0
- package/dist/browser/dev/excalidraw-assets-dev/{chunk-XOM7LNOU.js → chunk-IT7T3AIK.js} +49 -8
- package/dist/browser/dev/excalidraw-assets-dev/chunk-IT7T3AIK.js.map +7 -0
- package/dist/browser/dev/excalidraw-assets-dev/{chunk-BLEB3M62.js → chunk-RNHSD5AR.js} +7668 -2142
- package/dist/browser/dev/excalidraw-assets-dev/chunk-RNHSD5AR.js.map +7 -0
- package/dist/browser/dev/excalidraw-assets-dev/{dist-ITJNUBZF.js → dist-DNSPZDOZ.js} +66 -32
- package/dist/browser/dev/excalidraw-assets-dev/dist-DNSPZDOZ.js.map +7 -0
- package/dist/browser/dev/excalidraw-assets-dev/{en-TR4QLF5E.js → en-XV7OZCPP.js} +8 -2
- package/dist/browser/dev/excalidraw-assets-dev/{image-ZGDDRBEN.js → image-77HZYGLG.js} +2 -2
- package/dist/browser/dev/excalidraw-assets-dev/{image-O66MQ7WQ.css → image-WDHYGKKP.css} +1 -1
- package/dist/browser/dev/excalidraw-assets-dev/{image-O66MQ7WQ.css.map → image-WDHYGKKP.css.map} +2 -2
- package/dist/browser/dev/index.css +610 -180
- package/dist/browser/dev/index.css.map +3 -3
- package/dist/browser/dev/index.js +13306 -8006
- package/dist/browser/dev/index.js.map +4 -4
- package/dist/browser/prod/excalidraw-assets/CascadiaCode-Regular-TMZI7IJ5.woff2 +0 -0
- package/dist/browser/prod/excalidraw-assets/ComicShanns-Regular-6TOETDFT.woff2 +0 -0
- package/dist/browser/prod/excalidraw-assets/Excalifont-Regular-CPKEUDVM.woff2 +0 -0
- package/dist/browser/prod/excalidraw-assets/LiberationSans-Regular-ZQD73GJM.woff2 +0 -0
- package/dist/browser/prod/excalidraw-assets/Virgil-Regular-YHAB2VGJ.woff2 +0 -0
- package/dist/browser/prod/excalidraw-assets/chunk-OYEADJSR.js +63 -0
- package/dist/browser/prod/excalidraw-assets/{chunk-5SYIAZGL.js → chunk-PDYFZJMS.js} +5 -5
- package/dist/browser/prod/excalidraw-assets/dist-NLUQPPQQ.js +7 -0
- package/dist/browser/prod/excalidraw-assets/en-YVAVVILW.js +1 -0
- package/dist/browser/prod/excalidraw-assets/image-X3GFZHNN.js +1 -0
- package/dist/browser/prod/index.css +1 -1
- package/dist/browser/prod/index.js +70 -51
- package/dist/dev/CascadiaCode-Regular-TMZI7IJ5.woff2 +0 -0
- package/dist/dev/ComicShanns-Regular-6TOETDFT.woff2 +0 -0
- package/dist/dev/Excalifont-Regular-CPKEUDVM.woff2 +0 -0
- package/dist/dev/LiberationSans-Regular-ZQD73GJM.woff2 +0 -0
- package/dist/dev/Virgil-Regular-YHAB2VGJ.woff2 +0 -0
- package/dist/dev/{en-XW4JO6VX.json → en-YNVBSAIL.json} +42 -7
- package/dist/dev/index.css +610 -180
- package/dist/dev/index.css.map +3 -3
- package/dist/dev/index.js +22165 -16833
- package/dist/dev/index.js.map +4 -4
- package/dist/excalidraw/actions/actionAddToLibrary.d.ts +24 -9
- package/dist/excalidraw/actions/actionAlign.d.ts +8 -8
- package/dist/excalidraw/actions/actionBoundText.d.ts +20 -10
- package/dist/excalidraw/actions/actionBoundText.js +3 -1
- package/dist/excalidraw/actions/actionCanvas.d.ts +100 -40
- package/dist/excalidraw/actions/actionCanvas.js +1 -1
- package/dist/excalidraw/actions/actionClipboard.d.ts +62 -26
- package/dist/excalidraw/actions/actionDeleteSelected.d.ts +28 -12
- package/dist/excalidraw/actions/actionDeleteSelected.js +24 -5
- package/dist/excalidraw/actions/actionDistribute.d.ts +4 -4
- package/dist/excalidraw/actions/actionDuplicateSelection.d.ts +3 -3
- package/dist/excalidraw/actions/actionDuplicateSelection.js +1 -2
- package/dist/excalidraw/actions/actionElementLock.d.ts +17 -7
- package/dist/excalidraw/actions/actionExport.d.ts +75 -30
- package/dist/excalidraw/actions/actionFinalize.d.ts +17 -7
- package/dist/excalidraw/actions/actionFinalize.js +2 -2
- package/dist/excalidraw/actions/actionFlip.d.ts +4 -4
- package/dist/excalidraw/actions/actionFlip.js +2 -2
- package/dist/excalidraw/actions/actionFrame.d.ts +338 -10
- package/dist/excalidraw/actions/actionGroup.d.ts +324 -4
- package/dist/excalidraw/actions/actionHistory.d.ts +3 -3
- package/dist/excalidraw/actions/actionHistory.js +8 -8
- package/dist/excalidraw/actions/actionLinearEditor.d.ts +12 -5
- package/dist/excalidraw/actions/actionLinearEditor.js +21 -5
- package/dist/excalidraw/actions/actionLink.d.ts +8 -3
- package/dist/excalidraw/actions/actionMenu.d.ts +24 -9
- package/dist/excalidraw/actions/actionNavigate.d.ts +17 -7
- package/dist/excalidraw/actions/actionProperties.d.ts +476 -82
- package/dist/excalidraw/actions/actionProperties.js +384 -59
- package/dist/excalidraw/actions/actionSelectAll.d.ts +9 -4
- package/dist/excalidraw/actions/actionStyles.d.ts +12 -4
- package/dist/excalidraw/actions/actionStyles.js +3 -2
- package/dist/excalidraw/actions/actionTextAutoResize.d.ts +17 -0
- package/dist/excalidraw/actions/actionTextAutoResize.js +38 -0
- package/dist/excalidraw/actions/actionToggleGridMode.d.ts +9 -4
- package/dist/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +8 -3
- package/dist/excalidraw/actions/actionToggleStats.d.ts +9 -3
- package/dist/excalidraw/actions/actionToggleStats.js +4 -3
- package/dist/excalidraw/actions/actionToggleViewMode.d.ts +8 -3
- package/dist/excalidraw/actions/actionToggleZenMode.d.ts +8 -3
- package/dist/excalidraw/actions/actionZindex.d.ts +8 -4
- package/dist/excalidraw/actions/actionZindex.js +4 -0
- package/dist/excalidraw/actions/manager.d.ts +3 -3
- package/dist/excalidraw/actions/register.d.ts +1 -1
- package/dist/excalidraw/actions/shortcuts.d.ts +2 -2
- package/dist/excalidraw/actions/types.d.ts +6 -6
- package/dist/excalidraw/align.d.ts +1 -1
- package/dist/excalidraw/analytics.js +9 -7
- package/dist/excalidraw/animated-trail.d.ts +2 -2
- package/dist/excalidraw/appState.d.ts +6 -2
- package/dist/excalidraw/appState.js +14 -3
- package/dist/excalidraw/binaryheap.d.ts +12 -0
- package/dist/excalidraw/binaryheap.js +93 -0
- package/dist/excalidraw/change.d.ts +6 -5
- package/dist/excalidraw/change.js +20 -11
- package/dist/excalidraw/charts.d.ts +1 -1
- package/dist/excalidraw/charts.js +0 -10
- package/dist/excalidraw/clients.d.ts +2 -2
- package/dist/excalidraw/clients.js +1 -1
- package/dist/excalidraw/clipboard.d.ts +3 -3
- package/dist/excalidraw/colors.d.ts +1 -1
- package/dist/excalidraw/components/Actions.d.ts +3 -3
- package/dist/excalidraw/components/Actions.js +14 -9
- package/dist/excalidraw/components/App.d.ts +14 -17
- package/dist/excalidraw/components/App.js +356 -217
- package/dist/excalidraw/components/ButtonIcon.d.ts +15 -0
- package/dist/excalidraw/components/ButtonIcon.js +8 -0
- package/dist/excalidraw/components/ButtonIconSelect.js +2 -3
- package/dist/excalidraw/components/ButtonSeparator.d.ts +2 -0
- package/dist/excalidraw/components/ButtonSeparator.js +7 -0
- package/dist/excalidraw/components/CheckboxItem.js +1 -1
- package/dist/excalidraw/components/ColorPicker/ColorInput.d.ts +1 -1
- package/dist/excalidraw/components/ColorPicker/ColorInput.js +1 -1
- package/dist/excalidraw/components/ColorPicker/ColorPicker.d.ts +4 -4
- package/dist/excalidraw/components/ColorPicker/ColorPicker.js +48 -80
- package/dist/excalidraw/components/ColorPicker/Picker.d.ts +3 -3
- package/dist/excalidraw/components/ColorPicker/Picker.js +1 -1
- package/dist/excalidraw/components/ColorPicker/PickerColorList.d.ts +1 -1
- package/dist/excalidraw/components/ColorPicker/PickerHeading.d.ts +1 -1
- package/dist/excalidraw/components/ColorPicker/ShadeList.d.ts +1 -1
- package/dist/excalidraw/components/ColorPicker/TopPicks.d.ts +1 -1
- package/dist/excalidraw/components/ColorPicker/colorPickerUtils.d.ts +2 -2
- package/dist/excalidraw/components/ColorPicker/colorPickerUtils.js +1 -1
- package/dist/excalidraw/components/ColorPicker/keyboardNavHandlers.d.ts +2 -2
- package/dist/excalidraw/components/ColorPicker/keyboardNavHandlers.js +1 -1
- package/dist/excalidraw/components/CommandPalette/CommandPalette.d.ts +1 -1
- package/dist/excalidraw/components/CommandPalette/CommandPalette.js +5 -5
- package/dist/excalidraw/components/CommandPalette/defaultCommandPaletteItems.d.ts +1 -1
- package/dist/excalidraw/components/CommandPalette/types.d.ts +3 -3
- package/dist/excalidraw/components/ConfirmDialog.d.ts +1 -1
- package/dist/excalidraw/components/ContextMenu.d.ts +2 -2
- package/dist/excalidraw/components/ContextMenu.js +2 -2
- package/dist/excalidraw/components/DarkModeToggle.d.ts +1 -1
- package/dist/excalidraw/components/DefaultSidebar.d.ts +2 -2
- package/dist/excalidraw/components/Dialog.js +1 -1
- package/dist/excalidraw/components/DialogActionButton.d.ts +1 -1
- package/dist/excalidraw/components/EyeDropper.d.ts +2 -2
- package/dist/excalidraw/components/FollowMode/FollowMode.d.ts +1 -1
- package/dist/excalidraw/components/FollowMode/FollowMode.js +1 -1
- package/dist/excalidraw/components/FontPicker/FontPicker.d.ts +21 -0
- package/dist/excalidraw/components/FontPicker/FontPicker.js +49 -0
- package/dist/excalidraw/components/FontPicker/FontPickerList.d.ts +25 -0
- package/dist/excalidraw/components/FontPicker/FontPickerList.js +119 -0
- package/dist/excalidraw/components/FontPicker/FontPickerTrigger.d.ts +7 -0
- package/dist/excalidraw/components/FontPicker/FontPickerTrigger.js +13 -0
- package/dist/excalidraw/components/FontPicker/keyboardNavHandlers.d.ts +14 -0
- package/dist/excalidraw/components/FontPicker/keyboardNavHandlers.js +38 -0
- package/dist/excalidraw/components/HelpDialog.js +2 -2
- package/dist/excalidraw/components/HintViewer.d.ts +1 -1
- package/dist/excalidraw/components/HintViewer.js +6 -3
- package/dist/excalidraw/components/IconPicker.js +2 -2
- package/dist/excalidraw/components/ImageExportDialog.d.ts +1 -1
- package/dist/excalidraw/components/InitializeApp.d.ts +2 -2
- package/dist/excalidraw/components/JSONExportDialog.d.ts +3 -3
- package/dist/excalidraw/components/LayerUI.d.ts +4 -4
- package/dist/excalidraw/components/LayerUI.js +10 -7
- package/dist/excalidraw/components/LibraryMenu.d.ts +2 -2
- package/dist/excalidraw/components/LibraryMenuBrowseButton.d.ts +1 -1
- package/dist/excalidraw/components/LibraryMenuControlButtons.d.ts +1 -1
- package/dist/excalidraw/components/LibraryMenuHeaderContent.d.ts +2 -2
- package/dist/excalidraw/components/LibraryMenuItems.d.ts +1 -1
- package/dist/excalidraw/components/LibraryMenuSection.d.ts +5 -4
- package/dist/excalidraw/components/LibraryUnit.d.ts +2 -2
- package/dist/excalidraw/components/LoadingMessage.d.ts +1 -1
- package/dist/excalidraw/components/MagicSettings.js +2 -2
- package/dist/excalidraw/components/MobileMenu.d.ts +3 -3
- package/dist/excalidraw/components/MobileMenu.js +2 -6
- package/dist/excalidraw/components/Modal.d.ts +1 -1
- package/dist/excalidraw/components/OverwriteConfirm/OverwriteConfirmState.d.ts +1 -1
- package/dist/excalidraw/components/PasteChartDialog.d.ts +1 -1
- package/dist/excalidraw/components/PasteChartDialog.js +1 -1
- package/dist/excalidraw/components/PropertiesPopover.d.ts +15 -0
- package/dist/excalidraw/components/PropertiesPopover.js +31 -0
- package/dist/excalidraw/components/PublishLibrary.d.ts +1 -1
- package/dist/excalidraw/components/QuickSearch.d.ts +9 -0
- package/dist/excalidraw/components/QuickSearch.js +8 -0
- package/dist/excalidraw/components/SVGLayer.d.ts +1 -1
- package/dist/excalidraw/components/ScrollableList.d.ts +9 -0
- package/dist/excalidraw/components/ScrollableList.js +8 -0
- package/dist/excalidraw/components/Sidebar/Sidebar.js +1 -1
- package/dist/excalidraw/components/Sidebar/SidebarTab.d.ts +1 -1
- package/dist/excalidraw/components/Sidebar/SidebarTabTrigger.d.ts +1 -1
- package/dist/excalidraw/components/Sidebar/SidebarTrigger.d.ts +1 -1
- package/dist/excalidraw/components/Sidebar/common.d.ts +1 -1
- package/dist/excalidraw/components/Stats/Angle.d.ts +12 -0
- package/dist/excalidraw/components/Stats/Angle.js +53 -0
- package/dist/excalidraw/components/Stats/Collapsible.d.ts +9 -0
- package/dist/excalidraw/components/Stats/Collapsible.js +12 -0
- package/dist/excalidraw/components/Stats/Dimension.d.ts +12 -0
- package/dist/excalidraw/components/Stats/Dimension.js +68 -0
- package/dist/excalidraw/components/Stats/DragInput.d.ts +32 -0
- package/dist/excalidraw/components/Stats/DragInput.js +174 -0
- package/dist/excalidraw/components/Stats/FontSize.d.ts +12 -0
- package/dist/excalidraw/components/Stats/FontSize.js +50 -0
- package/dist/excalidraw/components/Stats/MultiAngle.d.ts +12 -0
- package/dist/excalidraw/components/Stats/MultiAngle.js +66 -0
- package/dist/excalidraw/components/Stats/MultiDimension.d.ts +15 -0
- package/dist/excalidraw/components/Stats/MultiDimension.js +199 -0
- package/dist/excalidraw/components/Stats/MultiFontSize.d.ts +13 -0
- package/dist/excalidraw/components/Stats/MultiFontSize.js +72 -0
- package/dist/excalidraw/components/Stats/MultiPosition.d.ts +15 -0
- package/dist/excalidraw/components/Stats/MultiPosition.js +101 -0
- package/dist/excalidraw/components/Stats/Position.d.ts +13 -0
- package/dist/excalidraw/components/Stats/Position.js +40 -0
- package/dist/excalidraw/components/Stats/index.d.ts +16 -0
- package/dist/excalidraw/components/Stats/index.js +79 -0
- package/dist/excalidraw/components/Stats/utils.d.ts +26 -0
- package/dist/excalidraw/components/Stats/utils.js +162 -0
- package/dist/excalidraw/components/TTDDialog/MermaidToExcalidraw.d.ts +1 -1
- package/dist/excalidraw/components/TTDDialog/TTDDialog.js +2 -2
- package/dist/excalidraw/components/TTDDialog/TTDDialogInput.d.ts +1 -1
- package/dist/excalidraw/components/TTDDialog/TTDDialogPanel.d.ts +1 -1
- package/dist/excalidraw/components/TTDDialog/TTDDialogPanels.d.ts +1 -1
- package/dist/excalidraw/components/TTDDialog/TTDDialogTabs.d.ts +1 -1
- package/dist/excalidraw/components/TTDDialog/TTDDialogTrigger.d.ts +1 -1
- package/dist/excalidraw/components/TTDDialog/common.d.ts +5 -5
- package/dist/excalidraw/components/TTDDialog/common.js +3 -7
- package/dist/excalidraw/components/TextField.d.ts +1 -1
- package/dist/excalidraw/components/Toast.d.ts +1 -1
- package/dist/excalidraw/components/ToolButton.d.ts +3 -2
- package/dist/excalidraw/components/Trans.d.ts +1 -1
- package/dist/excalidraw/components/UserList.d.ts +1 -1
- package/dist/excalidraw/components/UserList.js +22 -22
- package/dist/excalidraw/components/canvases/InteractiveCanvas.d.ts +3 -2
- package/dist/excalidraw/components/canvases/InteractiveCanvas.js +4 -2
- package/dist/excalidraw/components/canvases/StaticCanvas.d.ts +2 -2
- package/dist/excalidraw/components/canvases/StaticCanvas.js +3 -2
- package/dist/excalidraw/components/dropdownMenu/DropdownMenu.d.ts +12 -3
- package/dist/excalidraw/components/dropdownMenu/DropdownMenuItem.d.ts +24 -4
- package/dist/excalidraw/components/dropdownMenu/DropdownMenuItem.js +55 -14
- package/dist/excalidraw/components/dropdownMenu/DropdownMenuItemContent.d.ts +2 -1
- package/dist/excalidraw/components/dropdownMenu/DropdownMenuItemContent.js +2 -2
- package/dist/excalidraw/components/dropdownMenu/common.d.ts +1 -1
- package/dist/excalidraw/components/dropdownMenu/common.js +3 -2
- package/dist/excalidraw/components/footer/Footer.d.ts +2 -2
- package/dist/excalidraw/components/hyperlink/Hyperlink.d.ts +2 -2
- package/dist/excalidraw/components/hyperlink/helpers.d.ts +3 -3
- package/dist/excalidraw/components/icons.d.ts +10 -2
- package/dist/excalidraw/components/icons.js +29 -6
- package/dist/excalidraw/components/main-menu/MainMenu.d.ts +12 -3
- package/dist/excalidraw/components/welcome-screen/WelcomeScreen.Center.js +2 -2
- package/dist/excalidraw/components/welcome-screen/WelcomeScreen.Hints.js +3 -3
- package/dist/excalidraw/constants.d.ts +24 -3
- package/dist/excalidraw/constants.js +28 -4
- package/dist/excalidraw/context/ui-appState.d.ts +1 -1
- package/dist/excalidraw/cursor.d.ts +1 -1
- package/dist/excalidraw/data/EditorLocalStorage.d.ts +2 -2
- package/dist/excalidraw/data/blob.d.ts +5 -5
- package/dist/excalidraw/data/filesystem.d.ts +2 -1
- package/dist/excalidraw/data/index.d.ts +4 -4
- package/dist/excalidraw/data/json.d.ts +3 -3
- package/dist/excalidraw/data/library.d.ts +3 -3
- package/dist/excalidraw/data/magic.d.ts +3 -3
- package/dist/excalidraw/data/reconcile.d.ts +3 -3
- package/dist/excalidraw/data/reconcile.js +18 -1
- package/dist/excalidraw/data/resave.d.ts +2 -2
- package/dist/excalidraw/data/restore.d.ts +3 -3
- package/dist/excalidraw/data/restore.js +58 -9
- package/dist/excalidraw/data/transform.d.ts +3 -3
- package/dist/excalidraw/data/transform.js +8 -5
- package/dist/excalidraw/data/types.d.ts +3 -3
- package/dist/excalidraw/element/ElementCanvasButtons.d.ts +1 -1
- package/dist/excalidraw/element/binding.d.ts +29 -10
- package/dist/excalidraw/element/binding.js +303 -71
- package/dist/excalidraw/element/bounds.d.ts +3 -3
- package/dist/excalidraw/element/collision.d.ts +4 -4
- package/dist/excalidraw/element/collision.js +5 -2
- package/dist/excalidraw/element/containerCache.d.ts +1 -1
- package/dist/excalidraw/element/dragElements.d.ts +6 -6
- package/dist/excalidraw/element/dragElements.js +39 -5
- package/dist/excalidraw/element/embeddable.d.ts +11 -6
- package/dist/excalidraw/element/heading.d.ts +11 -0
- package/dist/excalidraw/element/heading.js +81 -0
- package/dist/excalidraw/element/image.d.ts +2 -2
- package/dist/excalidraw/element/index.d.ts +2 -2
- package/dist/excalidraw/element/index.js +1 -1
- package/dist/excalidraw/element/linearElementEditor.d.ts +27 -16
- package/dist/excalidraw/element/linearElementEditor.js +133 -56
- package/dist/excalidraw/element/mutateElement.d.ts +3 -3
- package/dist/excalidraw/element/mutateElement.js +5 -3
- package/dist/excalidraw/element/newElement.d.ts +12 -10
- package/dist/excalidraw/element/newElement.js +31 -16
- package/dist/excalidraw/element/resizeElements.d.ts +15 -6
- package/dist/excalidraw/element/resizeElements.js +122 -46
- package/dist/excalidraw/element/resizeTest.d.ts +4 -4
- package/dist/excalidraw/element/resizeTest.js +2 -4
- package/dist/excalidraw/element/routing.d.ts +13 -0
- package/dist/excalidraw/element/routing.js +641 -0
- package/dist/excalidraw/element/showSelectedShapeActions.d.ts +2 -2
- package/dist/excalidraw/element/sizeHelpers.d.ts +2 -2
- package/dist/excalidraw/element/sortElements.d.ts +1 -1
- package/dist/excalidraw/element/textElement.d.ts +6 -28
- package/dist/excalidraw/element/textElement.js +64 -112
- package/dist/excalidraw/element/textWysiwyg.d.ts +12 -6
- package/dist/excalidraw/element/textWysiwyg.js +75 -62
- package/dist/excalidraw/element/transformHandles.d.ts +3 -3
- package/dist/excalidraw/element/transformHandles.js +7 -12
- package/dist/excalidraw/element/typeChecks.d.ts +7 -4
- package/dist/excalidraw/element/typeChecks.js +17 -0
- package/dist/excalidraw/element/types.d.ts +22 -4
- package/dist/excalidraw/emitter.d.ts +1 -1
- package/dist/excalidraw/fonts/ExcalidrawFont.d.ts +21 -0
- package/dist/excalidraw/fonts/ExcalidrawFont.js +112 -0
- package/dist/excalidraw/fonts/index.d.ts +58 -0
- package/dist/excalidraw/fonts/index.js +240 -0
- package/dist/excalidraw/fonts/metadata.d.ts +36 -0
- package/dist/excalidraw/fonts/metadata.js +91 -0
- package/dist/excalidraw/fractionalIndex.d.ts +12 -5
- package/dist/excalidraw/fractionalIndex.js +40 -10
- package/dist/excalidraw/frame.d.ts +4 -4
- package/dist/excalidraw/frame.js +3 -3
- package/dist/excalidraw/gatransforms.d.ts +1 -1
- package/dist/excalidraw/gesture.d.ts +1 -1
- package/dist/excalidraw/groups.d.ts +4 -4
- package/dist/excalidraw/history.d.ts +8 -7
- package/dist/excalidraw/history.js +8 -8
- package/dist/excalidraw/hooks/useEmitter.d.ts +1 -1
- package/dist/excalidraw/hooks/useLibraryItemSvg.d.ts +1 -1
- package/dist/excalidraw/i18n.d.ts +1 -1
- package/dist/excalidraw/index.d.ts +2 -2
- package/dist/excalidraw/index.js +3 -3
- package/dist/excalidraw/jotai.d.ts +1 -1
- package/dist/excalidraw/laser-trails.d.ts +3 -2
- package/dist/excalidraw/locales/en.json +42 -7
- package/dist/excalidraw/math.d.ts +47 -2
- package/dist/excalidraw/math.js +116 -0
- package/dist/excalidraw/mermaid.d.ts +2 -0
- package/dist/excalidraw/mermaid.js +29 -0
- package/dist/excalidraw/points.d.ts +1 -1
- package/dist/excalidraw/queue.d.ts +1 -1
- package/dist/excalidraw/renderer/helpers.d.ts +2 -2
- package/dist/excalidraw/renderer/interactiveScene.d.ts +2 -2
- package/dist/excalidraw/renderer/interactiveScene.js +64 -22
- package/dist/excalidraw/renderer/renderElement.d.ts +6 -4
- package/dist/excalidraw/renderer/renderElement.js +78 -58
- package/dist/excalidraw/renderer/renderSnaps.d.ts +1 -1
- package/dist/excalidraw/renderer/staticScene.d.ts +1 -1
- package/dist/excalidraw/renderer/staticSvgScene.d.ts +4 -4
- package/dist/excalidraw/renderer/staticSvgScene.js +2 -1
- package/dist/excalidraw/scene/Renderer.d.ts +4 -4
- package/dist/excalidraw/scene/Renderer.js +2 -3
- package/dist/excalidraw/scene/Scene.d.ts +16 -7
- package/dist/excalidraw/scene/Scene.js +26 -11
- package/dist/excalidraw/scene/Shape.d.ts +1 -1
- package/dist/excalidraw/scene/Shape.js +56 -5
- package/dist/excalidraw/scene/ShapeCache.d.ts +4 -4
- package/dist/excalidraw/scene/comparisons.d.ts +3 -2
- package/dist/excalidraw/scene/comparisons.js +1 -1
- package/dist/excalidraw/scene/export.d.ts +4 -3
- package/dist/excalidraw/scene/export.js +34 -36
- package/dist/excalidraw/scene/scroll.d.ts +2 -2
- package/dist/excalidraw/scene/scrollbars.d.ts +3 -3
- package/dist/excalidraw/scene/selection.d.ts +2 -2
- package/dist/excalidraw/scene/types.d.ts +6 -8
- package/dist/excalidraw/scene/zoom.d.ts +1 -1
- package/dist/excalidraw/shapes.d.ts +8 -0
- package/dist/excalidraw/shapes.js +57 -0
- package/dist/excalidraw/snapping.d.ts +4 -4
- package/dist/excalidraw/snapping.js +2 -1
- package/dist/excalidraw/store.d.ts +34 -4
- package/dist/excalidraw/store.js +27 -0
- package/dist/excalidraw/types.d.ts +32 -21
- package/dist/excalidraw/utils.d.ts +15 -5
- package/dist/excalidraw/utils.js +22 -0
- package/dist/excalidraw/zindex.d.ts +2 -2
- package/dist/prod/CascadiaCode-Regular-TMZI7IJ5.woff2 +0 -0
- package/dist/prod/ComicShanns-Regular-6TOETDFT.woff2 +0 -0
- package/dist/prod/Excalifont-Regular-CPKEUDVM.woff2 +0 -0
- package/dist/prod/LiberationSans-Regular-ZQD73GJM.woff2 +0 -0
- package/dist/prod/Virgil-Regular-YHAB2VGJ.woff2 +0 -0
- package/dist/prod/{en-XW4JO6VX.json → en-YNVBSAIL.json} +42 -7
- package/dist/prod/index.css +1 -1
- package/dist/prod/index.js +49 -53
- package/dist/utils/bbox.d.ts +2 -2
- package/dist/utils/collision.d.ts +1 -1
- package/dist/utils/export.d.ts +4 -3
- package/dist/utils/export.js +2 -1
- package/dist/utils/geometry/geometry.d.ts +3 -2
- package/dist/utils/geometry/geometry.js +5 -1
- package/dist/utils/geometry/shape.d.ts +1 -1
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +1 -0
- package/dist/utils/withinBounds.d.ts +1 -1
- package/history.ts +13 -6
- package/package.json +2 -2
- package/dist/browser/dev/Cascadia-CYPE3OJC.woff2 +0 -0
- package/dist/browser/dev/Virgil-UZN6MUT6.woff2 +0 -0
- package/dist/browser/dev/excalidraw-assets-dev/chunk-BLEB3M62.js.map +0 -7
- package/dist/browser/dev/excalidraw-assets-dev/chunk-XOM7LNOU.js.map +0 -7
- package/dist/browser/dev/excalidraw-assets-dev/dist-ITJNUBZF.js.map +0 -7
- package/dist/browser/prod/Cascadia-CYPE3OJC.woff2 +0 -0
- package/dist/browser/prod/Virgil-UZN6MUT6.woff2 +0 -0
- package/dist/browser/prod/excalidraw-assets/chunk-UWBW5SR2.js +0 -55
- package/dist/browser/prod/excalidraw-assets/dist-54276HPL.js +0 -6
- package/dist/browser/prod/excalidraw-assets/en-7GPZE2Y2.js +0 -1
- package/dist/browser/prod/excalidraw-assets/image-35KQQ5EN.js +0 -1
- package/dist/dev/Cascadia-CYPE3OJC.woff2 +0 -0
- package/dist/dev/Virgil-UZN6MUT6.woff2 +0 -0
- package/dist/excalidraw/components/Stats.d.ts +0 -11
- package/dist/excalidraw/components/Stats.js +0 -13
- package/dist/excalidraw/scene/Fonts.d.ts +0 -21
- package/dist/excalidraw/scene/Fonts.js +0 -72
- package/dist/prod/Cascadia-CYPE3OJC.woff2 +0 -0
- package/dist/prod/Virgil-UZN6MUT6.woff2 +0 -0
- /package/dist/browser/dev/{Assistant-Bold-ZDZZ6JHA.woff2 → excalidraw-assets-dev/Assistant-Bold-ZDZZ6JHA.woff2} +0 -0
- /package/dist/browser/dev/{Assistant-Medium-DZ25RZU3.woff2 → excalidraw-assets-dev/Assistant-Medium-DZ25RZU3.woff2} +0 -0
- /package/dist/browser/dev/{Assistant-Regular-PLF2XOGW.woff2 → excalidraw-assets-dev/Assistant-Regular-PLF2XOGW.woff2} +0 -0
- /package/dist/browser/dev/{Assistant-SemiBold-CZ5MX6FK.woff2 → excalidraw-assets-dev/Assistant-SemiBold-CZ5MX6FK.woff2} +0 -0
- /package/dist/browser/dev/excalidraw-assets-dev/{en-TR4QLF5E.js.map → en-XV7OZCPP.js.map} +0 -0
- /package/dist/browser/dev/excalidraw-assets-dev/{image-ZGDDRBEN.js.map → image-77HZYGLG.js.map} +0 -0
- /package/dist/browser/prod/{Assistant-Bold-ZDZZ6JHA.woff2 → excalidraw-assets/Assistant-Bold-ZDZZ6JHA.woff2} +0 -0
- /package/dist/browser/prod/{Assistant-Medium-DZ25RZU3.woff2 → excalidraw-assets/Assistant-Medium-DZ25RZU3.woff2} +0 -0
- /package/dist/browser/prod/{Assistant-Regular-PLF2XOGW.woff2 → excalidraw-assets/Assistant-Regular-PLF2XOGW.woff2} +0 -0
- /package/dist/browser/prod/{Assistant-SemiBold-CZ5MX6FK.woff2 → excalidraw-assets/Assistant-SemiBold-CZ5MX6FK.woff2} +0 -0
|
@@ -1,22 +1,63 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useRef } from "react";
|
|
2
3
|
import { getDropdownMenuItemClassName, useHandleDropdownMenuItemClick, } from "./common";
|
|
3
4
|
import MenuItemContent from "./DropdownMenuItemContent";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
import { useExcalidrawAppState } from "../App";
|
|
6
|
+
import { THEME } from "../../constants";
|
|
7
|
+
const DropdownMenuItem = ({ icon, value, order, children, shortcut, className, hovered, selected, textStyle, onSelect, onClick, ...rest }) => {
|
|
8
|
+
const handleClick = useHandleDropdownMenuItemClick(onClick, onSelect);
|
|
9
|
+
const ref = useRef(null);
|
|
10
|
+
useEffect(() => {
|
|
11
|
+
if (hovered) {
|
|
12
|
+
if (order === 0) {
|
|
13
|
+
// scroll into the first item differently, so it's visible what is above (i.e. group title)
|
|
14
|
+
ref.current?.scrollIntoView({ block: "end" });
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
ref.current?.scrollIntoView({ block: "nearest" });
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}, [hovered, order]);
|
|
21
|
+
return (_jsx("button", { ...rest, ref: ref, value: value, onClick: handleClick, className: getDropdownMenuItemClassName(className, selected, hovered), title: rest.title ?? rest["aria-label"], children: _jsx(MenuItemContent, { textStyle: textStyle, icon: icon, shortcut: shortcut, children: children }) }));
|
|
7
22
|
};
|
|
8
23
|
DropdownMenuItem.displayName = "DropdownMenuItem";
|
|
9
|
-
export const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
24
|
+
export const DropDownMenuItemBadgeType = {
|
|
25
|
+
GREEN: "green",
|
|
26
|
+
RED: "red",
|
|
27
|
+
BLUE: "blue",
|
|
28
|
+
};
|
|
29
|
+
export const DropDownMenuItemBadge = ({ type = DropDownMenuItemBadgeType.BLUE, children, }) => {
|
|
30
|
+
const { theme } = useExcalidrawAppState();
|
|
31
|
+
const style = {
|
|
32
|
+
display: "inline-flex",
|
|
33
|
+
marginLeft: "auto",
|
|
34
|
+
padding: "2px 4px",
|
|
35
|
+
borderRadius: 6,
|
|
36
|
+
fontSize: 9,
|
|
37
|
+
fontFamily: "Cascadia, monospace",
|
|
38
|
+
border: theme === THEME.LIGHT ? "1.5px solid white" : "none",
|
|
39
|
+
};
|
|
40
|
+
switch (type) {
|
|
41
|
+
case DropDownMenuItemBadgeType.GREEN:
|
|
42
|
+
Object.assign(style, {
|
|
43
|
+
backgroundColor: "var(--background-color-badge)",
|
|
44
|
+
color: "var(--color-badge)",
|
|
45
|
+
});
|
|
46
|
+
break;
|
|
47
|
+
case DropDownMenuItemBadgeType.RED:
|
|
48
|
+
Object.assign(style, {
|
|
49
|
+
backgroundColor: "pink",
|
|
50
|
+
color: "darkred",
|
|
51
|
+
});
|
|
52
|
+
break;
|
|
53
|
+
case DropDownMenuItemBadgeType.BLUE:
|
|
54
|
+
default:
|
|
55
|
+
Object.assign(style, {
|
|
56
|
+
background: "var(--color-promo)",
|
|
57
|
+
color: "var(--color-surface-lowest)",
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
return (_jsx("div", { className: "DropDownMenuItemBadge", style: style, children: children }));
|
|
20
61
|
};
|
|
21
62
|
DropDownMenuItemBadge.displayName = "DropdownMenuItemBadge";
|
|
22
63
|
DropdownMenuItem.Badge = DropDownMenuItemBadge;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
declare const MenuItemContent: ({ icon, shortcut, children, }: {
|
|
2
|
+
declare const MenuItemContent: ({ textStyle, icon, shortcut, children, }: {
|
|
3
3
|
icon?: JSX.Element | undefined;
|
|
4
4
|
shortcut?: string | undefined;
|
|
5
|
+
textStyle?: import("react").CSSProperties | undefined;
|
|
5
6
|
children: React.ReactNode;
|
|
6
7
|
}) => JSX.Element;
|
|
7
8
|
export default MenuItemContent;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useDevice } from "../App";
|
|
3
|
-
const MenuItemContent = ({ icon, shortcut, children, }) => {
|
|
3
|
+
const MenuItemContent = ({ textStyle, icon, shortcut, children, }) => {
|
|
4
4
|
const device = useDevice();
|
|
5
|
-
return (_jsxs(_Fragment, { children: [_jsx("div", { className: "dropdown-menu-item__icon", children: icon }), _jsx("div", { className: "dropdown-menu-item__text", children: children }), shortcut && !device.editor.isMobile && (_jsx("div", { className: "dropdown-menu-item__shortcut", children: shortcut }))] }));
|
|
5
|
+
return (_jsxs(_Fragment, { children: [icon && _jsx("div", { className: "dropdown-menu-item__icon", children: icon }), _jsx("div", { style: textStyle, className: "dropdown-menu-item__text", children: children }), shortcut && !device.editor.isMobile && (_jsx("div", { className: "dropdown-menu-item__shortcut", children: shortcut }))] }));
|
|
6
6
|
};
|
|
7
7
|
export default MenuItemContent;
|
|
@@ -2,5 +2,5 @@ import React from "react";
|
|
|
2
2
|
export declare const DropdownMenuContentPropsContext: React.Context<{
|
|
3
3
|
onSelect?: ((event: Event) => void) | undefined;
|
|
4
4
|
}>;
|
|
5
|
-
export declare const getDropdownMenuItemClassName: (className?: string, selected?: boolean) => string;
|
|
5
|
+
export declare const getDropdownMenuItemClassName: (className?: string, selected?: boolean, hovered?: boolean) => string;
|
|
6
6
|
export declare const useHandleDropdownMenuItemClick: (origOnClick: React.MouseEventHandler<HTMLAnchorElement | HTMLButtonElement> | undefined, onSelect: ((event: Event) => void) | undefined) => (event: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement, MouseEvent>) => void;
|
|
@@ -2,8 +2,9 @@ import React, { useContext } from "react";
|
|
|
2
2
|
import { EVENT } from "../../constants";
|
|
3
3
|
import { composeEventHandlers } from "../../utils";
|
|
4
4
|
export const DropdownMenuContentPropsContext = React.createContext({});
|
|
5
|
-
export const getDropdownMenuItemClassName = (className = "", selected = false) => {
|
|
6
|
-
return `dropdown-menu-item dropdown-menu-item-base ${className}
|
|
5
|
+
export const getDropdownMenuItemClassName = (className = "", selected = false, hovered = false) => {
|
|
6
|
+
return `dropdown-menu-item dropdown-menu-item-base ${className}
|
|
7
|
+
${selected ? "dropdown-menu-item--selected" : ""} ${hovered ? "dropdown-menu-item--hovered" : ""}`.trim();
|
|
7
8
|
};
|
|
8
9
|
export const useHandleDropdownMenuItemClick = (origOnClick, onSelect) => {
|
|
9
10
|
const DropdownMenuContentProps = useContext(DropdownMenuContentPropsContext);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { ActionManager } from "../../actions/manager";
|
|
3
|
-
import { UIAppState } from "../../types";
|
|
2
|
+
import type { ActionManager } from "../../actions/manager";
|
|
3
|
+
import type { UIAppState } from "../../types";
|
|
4
4
|
declare const Footer: {
|
|
5
5
|
({ appState, actionManager, showExitZenModeBtn, renderWelcomeScreen, }: {
|
|
6
6
|
appState: UIAppState;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { AppState, ExcalidrawProps, UIAppState } from "../../types";
|
|
3
|
-
import { ElementsMap, ExcalidrawEmbeddableElement, NonDeletedExcalidrawElement } from "../../element/types";
|
|
2
|
+
import type { AppState, ExcalidrawProps, UIAppState } from "../../types";
|
|
3
|
+
import type { ElementsMap, ExcalidrawEmbeddableElement, NonDeletedExcalidrawElement } from "../../element/types";
|
|
4
4
|
import "./Hyperlink.scss";
|
|
5
5
|
export declare const Hyperlink: ({ element, elementsMap, setAppState, onLinkOpen, setToast, updateEmbedValidationStatus, }: {
|
|
6
6
|
element: NonDeletedExcalidrawElement;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Bounds } from "../../element/bounds";
|
|
2
|
-
import { ElementsMap, NonDeletedExcalidrawElement } from "../../element/types";
|
|
3
|
-
import { AppState, UIAppState } from "../../types";
|
|
1
|
+
import type { Bounds } from "../../element/bounds";
|
|
2
|
+
import type { ElementsMap, NonDeletedExcalidrawElement } from "../../element/types";
|
|
3
|
+
import type { AppState, UIAppState } from "../../types";
|
|
4
4
|
export declare const EXTERNAL_LINK_IMG: HTMLImageElement;
|
|
5
5
|
export declare const getLinkHandleFromCoords: ([x1, y1, x2, y2]: Bounds, angle: number, appState: Pick<UIAppState, "zoom">) => Bounds;
|
|
6
6
|
export declare const isPointHittingLinkIcon: (element: NonDeletedExcalidrawElement, elementsMap: ElementsMap, appState: AppState, [x, y]: readonly [number, number]) => boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { Theme } from "../element/types";
|
|
2
|
+
import type { Theme } from "../element/types";
|
|
3
3
|
export declare const iconFillColor: (theme: Theme) => string;
|
|
4
4
|
type Opts = {
|
|
5
5
|
width?: number;
|
|
@@ -140,6 +140,7 @@ export declare const FontSizeMediumIcon: JSX.Element;
|
|
|
140
140
|
export declare const FontSizeLargeIcon: JSX.Element;
|
|
141
141
|
export declare const FontSizeExtraLargeIcon: JSX.Element;
|
|
142
142
|
export declare const fontSizeIcon: JSX.Element;
|
|
143
|
+
export declare const FontFamilyHeadingIcon: JSX.Element;
|
|
143
144
|
export declare const FontFamilyNormalIcon: JSX.Element;
|
|
144
145
|
export declare const FontFamilyCodeIcon: JSX.Element;
|
|
145
146
|
export declare const TextAlignLeftIcon: JSX.Element;
|
|
@@ -154,6 +155,7 @@ export declare const TextAlignBottomIcon: React.MemoExoticComponent<({ theme }:
|
|
|
154
155
|
export declare const TextAlignMiddleIcon: React.MemoExoticComponent<({ theme }: {
|
|
155
156
|
theme: Theme;
|
|
156
157
|
}) => JSX.Element>;
|
|
158
|
+
export declare const angleIcon: JSX.Element;
|
|
157
159
|
export declare const publishIcon: JSX.Element;
|
|
158
160
|
export declare const eraser: JSX.Element;
|
|
159
161
|
export declare const handIcon: JSX.Element;
|
|
@@ -195,7 +197,13 @@ export declare const pngIcon: JSX.Element;
|
|
|
195
197
|
export declare const magnetIcon: JSX.Element;
|
|
196
198
|
export declare const coffeeIcon: JSX.Element;
|
|
197
199
|
export declare const DeviceDesktopIcon: JSX.Element;
|
|
198
|
-
export declare const
|
|
200
|
+
export declare const loginIcon: JSX.Element;
|
|
199
201
|
export declare const youtubeIcon: JSX.Element;
|
|
200
202
|
export declare const gridIcon: JSX.Element;
|
|
203
|
+
export declare const lineEditorIcon: JSX.Element;
|
|
204
|
+
export declare const sharpArrowIcon: JSX.Element;
|
|
205
|
+
export declare const elbowArrowIcon: JSX.Element;
|
|
206
|
+
export declare const roundArrowIcon: JSX.Element;
|
|
207
|
+
export declare const collapseDownIcon: JSX.Element;
|
|
208
|
+
export declare const collapseUpIcon: JSX.Element;
|
|
201
209
|
export {};
|
|
@@ -121,10 +121,22 @@ export const shareWindows = createIcon(_jsxs(_Fragment, { children: [_jsx("path"
|
|
|
121
121
|
// Icon imported form Storybook
|
|
122
122
|
// Storybook is licensed under MIT https://github.com/storybookjs/storybook/blob/next/LICENSE
|
|
123
123
|
export const resetZoom = createIcon(_jsx("path", { stroke: "currentColor", strokeWidth: "40", fill: "currentColor", d: "M148 560a318 318 0 0 0 522 110 316 316 0 0 0 0-450 316 316 0 0 0-450 0c-11 11-21 22-30 34v4h47c25 0 46 21 46 46s-21 45-46 45H90c-13 0-25-6-33-14-9-9-14-20-14-33V156c0-25 20-45 45-45s45 20 45 45v32l1 1a401 401 0 0 1 623 509l212 212a42 42 0 0 1-59 59L698 757A401 401 0 0 1 65 570a42 42 0 0 1 83-10z" }), { width: 1024 });
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
export const
|
|
127
|
-
export const
|
|
124
|
+
const arrowBarToTopJSX = (_jsxs("g", { strokeWidth: 1.5, children: [_jsx("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }), _jsx("path", { d: "M12 10l0 10" }), _jsx("path", { d: "M12 10l4 4" }), _jsx("path", { d: "M12 10l-4 4" }), _jsx("path", { d: "M4 4l16 0" })] }));
|
|
125
|
+
const arrownNarrowUpJSX = (_jsxs("g", { strokeWidth: 1.5, children: [_jsx("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }), _jsx("path", { d: "M12 5l0 14" }), _jsx("path", { d: "M16 9l-4 -4" }), _jsx("path", { d: "M8 9l4 -4" })] }));
|
|
126
|
+
export const BringForwardIcon = createIcon(arrownNarrowUpJSX, tablerIconProps);
|
|
127
|
+
export const SendBackwardIcon = createIcon(arrownNarrowUpJSX, {
|
|
128
|
+
...tablerIconProps,
|
|
129
|
+
style: {
|
|
130
|
+
transform: "rotate(180deg)",
|
|
131
|
+
},
|
|
132
|
+
});
|
|
133
|
+
export const BringToFrontIcon = createIcon(arrowBarToTopJSX, tablerIconProps);
|
|
134
|
+
export const SendToBackIcon = createIcon(arrowBarToTopJSX, {
|
|
135
|
+
...tablerIconProps,
|
|
136
|
+
style: {
|
|
137
|
+
transform: "rotate(180deg)",
|
|
138
|
+
},
|
|
139
|
+
});
|
|
128
140
|
//
|
|
129
141
|
// Align action icons created from scratch to match those of z-index actions
|
|
130
142
|
// Note: vertical align icons are flipped so the larger item is always the
|
|
@@ -189,6 +201,7 @@ export const FontSizeMediumIcon = createIcon(_jsxs(_Fragment, { children: [_jsx(
|
|
|
189
201
|
export const FontSizeLargeIcon = createIcon(_jsxs(_Fragment, { children: [_jsx("g", { clipPath: "url(#a)", children: _jsx("path", { d: "M5.833 3.333v13.334h8.334", stroke: "currentColor", strokeWidth: "1.25", strokeLinecap: "round", strokeLinejoin: "round" }) }), _jsx("defs", { children: _jsx("clipPath", { id: "a", children: _jsx("path", { fill: "#fff", d: "M0 0h20v20H0z" }) }) })] }), modifiedTablerIconProps);
|
|
190
202
|
export const FontSizeExtraLargeIcon = createIcon(_jsx(_Fragment, { children: _jsx("path", { d: "m1.667 3.333 6.666 13.334M8.333 3.333 1.667 16.667M11.667 3.333v13.334h6.666", stroke: "currentColor", strokeWidth: "1.25", strokeLinecap: "round", strokeLinejoin: "round" }) }), modifiedTablerIconProps);
|
|
191
203
|
export const fontSizeIcon = createIcon(_jsxs("g", { strokeWidth: 1.25, children: [_jsx("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }), _jsx("path", { d: "M3 7v-2h13v2" }), _jsx("path", { d: "M10 5v14" }), _jsx("path", { d: "M12 19h-4" }), _jsx("path", { d: "M15 13v-1h6v1" }), _jsx("path", { d: "M18 12v7" }), _jsx("path", { d: "M17 19h2" })] }), tablerIconProps);
|
|
204
|
+
export const FontFamilyHeadingIcon = createIcon(_jsx(_Fragment, { children: _jsxs("g", { stroke: "currentColor", strokeWidth: "1.25", strokeLinecap: "round", strokeLinejoin: "round", children: [_jsx("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }), _jsx("path", { d: "M7 12h10" }), _jsx("path", { d: "M7 5v14" }), _jsx("path", { d: "M17 5v14" }), _jsx("path", { d: "M15 19h4" }), _jsx("path", { d: "M15 5h4" }), _jsx("path", { d: "M5 19h4" }), _jsx("path", { d: "M5 5h4" })] }) }), tablerIconProps);
|
|
192
205
|
export const FontFamilyNormalIcon = createIcon(_jsx(_Fragment, { children: _jsx("g", { stroke: "currentColor", strokeWidth: "1.25", strokeLinecap: "round", strokeLinejoin: "round", children: _jsx("path", { d: "M5.833 16.667v-10a3.333 3.333 0 0 1 3.334-3.334h1.666a3.333 3.333 0 0 1 3.334 3.334v10M5.833 10.833h8.334" }) }) }), modifiedTablerIconProps);
|
|
193
206
|
export const FontFamilyCodeIcon = createIcon(_jsxs(_Fragment, { children: [_jsx("g", { clipPath: "url(#a)", stroke: "currentColor", strokeWidth: "1.25", strokeLinecap: "round", strokeLinejoin: "round", children: _jsx("path", { d: "M5.833 6.667 2.5 10l3.333 3.333M14.167 6.667 17.5 10l-3.333 3.333M11.667 3.333 8.333 16.667" }) }), _jsx("defs", { children: _jsx("clipPath", { id: "a", children: _jsx("path", { fill: "#fff", d: "M0 0h20v20H0z" }) }) })] }), modifiedTablerIconProps);
|
|
194
207
|
export const TextAlignLeftIcon = createIcon(_jsxs("g", { stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, children: [_jsx("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }), _jsx("line", { x1: "4", y1: "8", x2: "20", y2: "8" }), _jsx("line", { x1: "4", y1: "12", x2: "12", y2: "12" }), _jsx("line", { x1: "4", y1: "16", x2: "16", y2: "16" })] }), tablerIconProps);
|
|
@@ -200,6 +213,7 @@ export const TextAlignTopIcon = React.memo(({ theme }) => createIcon(_jsxs("g",
|
|
|
200
213
|
export const TextAlignBottomIcon = React.memo(({ theme }) => createIcon(_jsxs("g", { strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round", children: [_jsx("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }), _jsx("line", { x1: "4", y1: "20", x2: "20", y2: "20" }), _jsx("rect", { x: "9", y: "4", width: "6", height: "12", rx: "2" })] }), tablerIconProps));
|
|
201
214
|
// tabler-icons: layout-align-middle
|
|
202
215
|
export const TextAlignMiddleIcon = React.memo(({ theme }) => createIcon(_jsxs("g", { strokeWidth: "1.5", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round", children: [_jsx("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }), _jsx("line", { x1: "4", y1: "12", x2: "9", y2: "12" }), _jsx("line", { x1: "15", y1: "12", x2: "20", y2: "12" }), _jsx("rect", { x: "9", y: "6", width: "6", height: "12", rx: "2" })] }), tablerIconProps));
|
|
216
|
+
export const angleIcon = createIcon(_jsxs("g", { children: [_jsx("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }), _jsx("path", { d: "M21 19h-18l9 -15" }), _jsx("path", { d: "M20.615 15.171h.015" }), _jsx("path", { d: "M19.515 11.771h.015" }), _jsx("path", { d: "M17.715 8.671h.015" }), _jsx("path", { d: "M15.415 5.971h.015" })] }), tablerIconProps);
|
|
203
217
|
export const publishIcon = createIcon(_jsx("path", { d: "M537.6 226.6c4.1-10.7 6.4-22.4 6.4-34.6 0-53-43-96-96-96-19.7 0-38.1 6-53.3 16.2C367 64.2 315.3 32 256 32c-88.4 0-160 71.6-160 160 0 2.7.1 5.4.2 8.1C40.2 219.8 0 273.2 0 336c0 79.5 64.5 144 144 144h368c70.7 0 128-57.3 128-128 0-61.9-44-113.6-102.4-125.4zM393.4 288H328v112c0 8.8-7.2 16-16 16h-48c-8.8 0-16-7.2-16-16V288h-65.4c-14.3 0-21.4-17.2-11.3-27.3l105.4-105.4c6.2-6.2 16.4-6.2 22.6 0l105.4 105.4c10.1 10.1 2.9 27.3-11.3 27.3z", fill: "currentColor" }), { width: 640, height: 512 });
|
|
204
218
|
export const eraser = createIcon(_jsx("path", { d: "M480 416C497.7 416 512 430.3 512 448C512 465.7 497.7 480 480 480H150.6C133.7 480 117.4 473.3 105.4 461.3L25.37 381.3C.3786 356.3 .3786 315.7 25.37 290.7L258.7 57.37C283.7 32.38 324.3 32.38 349.3 57.37L486.6 194.7C511.6 219.7 511.6 260.3 486.6 285.3L355.9 416H480zM265.4 416L332.7 348.7L195.3 211.3L70.63 336L150.6 416L265.4 416z" }));
|
|
205
219
|
export const handIcon = createIcon(_jsxs("g", { strokeWidth: 1.25, children: [_jsx("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }), _jsx("path", { d: "M8 13v-7.5a1.5 1.5 0 0 1 3 0v6.5" }), _jsx("path", { d: "M11 5.5v-2a1.5 1.5 0 1 1 3 0v8.5" }), _jsx("path", { d: "M14 5.5a1.5 1.5 0 0 1 3 0v6.5" }), _jsx("path", { d: "M17 7.5a1.5 1.5 0 0 1 3 0v8.5a6 6 0 0 1 -6 6h-2h.208a6 6 0 0 1 -5.012 -2.7a69.74 69.74 0 0 1 -.196 -.3c-.312 -.479 -1.407 -2.388 -3.286 -5.728a1.5 1.5 0 0 1 .536 -2.022a1.867 1.867 0 0 1 2.28 .28l1.47 1.47" })] }), tablerIconProps);
|
|
@@ -241,7 +255,16 @@ export const pngIcon = createIcon(_jsxs("g", { strokeWidth: 1.25, children: [_js
|
|
|
241
255
|
export const magnetIcon = createIcon(_jsxs("g", { strokeWidth: 1.25, children: [_jsx("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }), _jsx("path", { d: "M4 13v-8a2 2 0 0 1 2 -2h1a2 2 0 0 1 2 2v8a2 2 0 0 0 6 0v-8a2 2 0 0 1 2 -2h1a2 2 0 0 1 2 2v8a8 8 0 0 1 -16 0" }), _jsx("path", { d: "M4 8l5 0" }), _jsx("path", { d: "M15 8l4 0" })] }), tablerIconProps);
|
|
242
256
|
export const coffeeIcon = createIcon(_jsxs("g", { strokeWidth: 1.25, children: [_jsx("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }), _jsx("path", { d: "M3 14c.83 .642 2.077 1.017 3.5 1c1.423 .017 2.67 -.358 3.5 -1c.83 -.642 2.077 -1.017 3.5 -1c1.423 -.017 2.67 .358 3.5 1" }), _jsx("path", { d: "M8 3a2.4 2.4 0 0 0 -1 2a2.4 2.4 0 0 0 1 2" }), _jsx("path", { d: "M12 3a2.4 2.4 0 0 0 -1 2a2.4 2.4 0 0 0 1 2" }), _jsx("path", { d: "M3 10h14v5a6 6 0 0 1 -6 6h-2a6 6 0 0 1 -6 -6v-5z" }), _jsx("path", { d: "M16.746 16.726a3 3 0 1 0 .252 -5.555" })] }), tablerIconProps);
|
|
243
257
|
export const DeviceDesktopIcon = createIcon(_jsxs("g", { stroke: "currentColor", children: [_jsx("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }), _jsx("path", { d: "M3 5a1 1 0 0 1 1-1h16a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1h-16a1 1 0 0 1-1-1v-10zM7 20h10M9 16v4M15 16v4" })] }), { ...tablerIconProps, strokeWidth: 1.5 });
|
|
244
|
-
//
|
|
245
|
-
export const
|
|
258
|
+
// login
|
|
259
|
+
export const loginIcon = createIcon(_jsxs("g", { strokeWidth: 1.5, children: [_jsx("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }), _jsx("path", { d: "M15 8v-2a2 2 0 0 0 -2 -2h-7a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h7a2 2 0 0 0 2 -2v-2" }), _jsx("path", { d: "M21 12h-13l3 -3" }), _jsx("path", { d: "M11 15l-3 -3" })] }), tablerIconProps);
|
|
246
260
|
export const youtubeIcon = createIcon(_jsxs("g", { children: [_jsx("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }), _jsx("path", { d: "M2 8a4 4 0 0 1 4 -4h12a4 4 0 0 1 4 4v8a4 4 0 0 1 -4 4h-12a4 4 0 0 1 -4 -4v-8z" }), _jsx("path", { d: "M10 9l5 3l-5 3z" })] }), tablerIconProps);
|
|
247
261
|
export const gridIcon = createIcon(_jsxs("g", { strokeWidth: 1.5, children: [_jsx("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }), _jsx("path", { d: "M3 6h18" }), _jsx("path", { d: "M3 12h18" }), _jsx("path", { d: "M3 18h18" }), _jsx("path", { d: "M6 3v18" }), _jsx("path", { d: "M12 3v18" }), _jsx("path", { d: "M18 3v18" })] }), tablerIconProps);
|
|
262
|
+
export const lineEditorIcon = createIcon(_jsxs("g", { strokeWidth: 1.5, children: [_jsx("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }), _jsx("path", { d: "M17 3m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v2a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z" }), _jsx("path", { d: "M3 17m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v2a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z" }), _jsx("path", { d: "M17 5c-6.627 0 -12 5.373 -12 12" })] }), tablerIconProps);
|
|
263
|
+
// arrow-up-right (modified)
|
|
264
|
+
export const sharpArrowIcon = createIcon(_jsxs("g", { children: [_jsx("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }), _jsx("path", { d: "M6 18l12 -12" }), _jsx("path", { d: "M18 10v-4h-4" })] }), tablerIconProps);
|
|
265
|
+
// arrow-guide (modified)
|
|
266
|
+
export const elbowArrowIcon = createIcon(_jsxs("g", { children: [_jsx("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }), _jsx("path", { d: "M4,19L10,19C11.097,19 12,18.097 12,17L12,9C12,7.903 12.903,7 14,7L21,7" }), _jsx("path", { d: "M18 4l3 3l-3 3" })] }), tablerIconProps);
|
|
267
|
+
// arrow-ramp-right-2 (heavily modified)
|
|
268
|
+
export const roundArrowIcon = createIcon(_jsxs("g", { children: [_jsx("path", { d: "M16,12L20,9L16,6" }), _jsx("path", { d: "M6 20c0 -6.075 4.925 -11 11 -11h3" })] }), tablerIconProps);
|
|
269
|
+
export const collapseDownIcon = createIcon(_jsxs("g", { children: [_jsx("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }), _jsx("path", { d: "M6 9l6 6l6 -6" })] }), tablerIconProps);
|
|
270
|
+
export const collapseUpIcon = createIcon(_jsxs("g", { children: [_jsx("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }), _jsx("path", { d: "M6 15l6 -6l6 6" })] }), tablerIconProps);
|
|
@@ -19,17 +19,26 @@ declare const MainMenu: React.FC<{
|
|
|
19
19
|
displayName: string;
|
|
20
20
|
};
|
|
21
21
|
Item: {
|
|
22
|
-
({ icon,
|
|
22
|
+
({ icon, value, order, children, shortcut, className, hovered, selected, textStyle, onSelect, onClick, ...rest }: {
|
|
23
23
|
icon?: JSX.Element | undefined;
|
|
24
|
-
|
|
24
|
+
value?: string | number | undefined;
|
|
25
|
+
order?: number | undefined;
|
|
26
|
+
onSelect?: ((event: Event) => void) | undefined;
|
|
25
27
|
children: React.ReactNode;
|
|
26
28
|
shortcut?: string | undefined;
|
|
29
|
+
hovered?: boolean | undefined;
|
|
27
30
|
selected?: boolean | undefined;
|
|
31
|
+
textStyle?: React.CSSProperties | undefined;
|
|
28
32
|
className?: string | undefined;
|
|
29
33
|
} & Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "onSelect">): JSX.Element;
|
|
30
34
|
displayName: string;
|
|
31
35
|
Badge: {
|
|
32
|
-
({ children, }: {
|
|
36
|
+
({ type, children, }: {
|
|
37
|
+
type?: import("../../utility-types").ValueOf<{
|
|
38
|
+
readonly GREEN: "green";
|
|
39
|
+
readonly RED: "red";
|
|
40
|
+
readonly BLUE: "blue";
|
|
41
|
+
}> | undefined;
|
|
33
42
|
children: React.ReactNode;
|
|
34
43
|
}): JSX.Element;
|
|
35
44
|
displayName: string;
|
|
@@ -26,11 +26,11 @@ const Center = ({ children }) => {
|
|
|
26
26
|
};
|
|
27
27
|
Center.displayName = "Center";
|
|
28
28
|
const Logo = ({ children }) => {
|
|
29
|
-
return (_jsx("div", { className: "welcome-screen-center__logo
|
|
29
|
+
return (_jsx("div", { className: "welcome-screen-center__logo excalifont welcome-screen-decor", children: children || _jsx(ExcalidrawLogo, { withText: true }) }));
|
|
30
30
|
};
|
|
31
31
|
Logo.displayName = "Logo";
|
|
32
32
|
const Heading = ({ children }) => {
|
|
33
|
-
return (_jsx("div", { className: "welcome-screen-center__heading welcome-screen-decor
|
|
33
|
+
return (_jsx("div", { className: "welcome-screen-center__heading welcome-screen-decor excalifont", children: children }));
|
|
34
34
|
};
|
|
35
35
|
Heading.displayName = "Heading";
|
|
36
36
|
const Menu = ({ children }) => {
|
|
@@ -4,17 +4,17 @@ import { useTunnels } from "../../context/tunnels";
|
|
|
4
4
|
import { WelcomeScreenHelpArrow, WelcomeScreenMenuArrow, WelcomeScreenTopToolbarArrow, } from "../icons";
|
|
5
5
|
const MenuHint = ({ children }) => {
|
|
6
6
|
const { WelcomeScreenMenuHintTunnel } = useTunnels();
|
|
7
|
-
return (_jsx(WelcomeScreenMenuHintTunnel.In, { children: _jsxs("div", { className: "
|
|
7
|
+
return (_jsx(WelcomeScreenMenuHintTunnel.In, { children: _jsxs("div", { className: "excalifont welcome-screen-decor welcome-screen-decor-hint welcome-screen-decor-hint--menu", children: [WelcomeScreenMenuArrow, _jsx("div", { className: "welcome-screen-decor-hint__label", children: children || t("welcomeScreen.defaults.menuHint") })] }) }));
|
|
8
8
|
};
|
|
9
9
|
MenuHint.displayName = "MenuHint";
|
|
10
10
|
const ToolbarHint = ({ children }) => {
|
|
11
11
|
const { WelcomeScreenToolbarHintTunnel } = useTunnels();
|
|
12
|
-
return (_jsx(WelcomeScreenToolbarHintTunnel.In, { children: _jsxs("div", { className: "
|
|
12
|
+
return (_jsx(WelcomeScreenToolbarHintTunnel.In, { children: _jsxs("div", { className: "excalifont welcome-screen-decor welcome-screen-decor-hint welcome-screen-decor-hint--toolbar", children: [_jsx("div", { className: "welcome-screen-decor-hint__label", children: children || t("welcomeScreen.defaults.toolbarHint") }), WelcomeScreenTopToolbarArrow] }) }));
|
|
13
13
|
};
|
|
14
14
|
ToolbarHint.displayName = "ToolbarHint";
|
|
15
15
|
const HelpHint = ({ children }) => {
|
|
16
16
|
const { WelcomeScreenHelpHintTunnel } = useTunnels();
|
|
17
|
-
return (_jsx(WelcomeScreenHelpHintTunnel.In, { children: _jsxs("div", { className: "
|
|
17
|
+
return (_jsx(WelcomeScreenHelpHintTunnel.In, { children: _jsxs("div", { className: "excalifont welcome-screen-decor welcome-screen-decor-hint welcome-screen-decor-hint--help", children: [_jsx("div", { children: children || t("welcomeScreen.defaults.helpHint") }), WelcomeScreenHelpArrow] }) }));
|
|
18
18
|
};
|
|
19
19
|
HelpHint.displayName = "HelpHint";
|
|
20
20
|
export { HelpHint, MenuHint, ToolbarHint };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AppProps } from "./types";
|
|
2
|
-
import { ExcalidrawElement, FontFamilyValues } from "./element/types";
|
|
1
|
+
import type { AppProps, AppState } from "./types";
|
|
2
|
+
import type { ExcalidrawElement, FontFamilyValues } from "./element/types";
|
|
3
3
|
export declare const isDarwin: boolean;
|
|
4
4
|
export declare const isWindows: boolean;
|
|
5
5
|
export declare const isAndroid: boolean;
|
|
@@ -10,6 +10,7 @@ export declare const isIOS: boolean;
|
|
|
10
10
|
export declare const isBrave: () => boolean;
|
|
11
11
|
export declare const supportsResizeObserver: boolean;
|
|
12
12
|
export declare const APP_NAME = "Excalidraw";
|
|
13
|
+
export declare const TEXT_AUTOWRAP_THRESHOLD = 36;
|
|
13
14
|
export declare const DRAGGING_THRESHOLD = 10;
|
|
14
15
|
export declare const LINE_CONFIRM_THRESHOLD = 8;
|
|
15
16
|
export declare const ELEMENT_SHIFT_TRANSLATE_AMOUNT = 5;
|
|
@@ -85,11 +86,23 @@ export declare const ENV: {
|
|
|
85
86
|
export declare const CLASSES: {
|
|
86
87
|
SHAPE_ACTIONS_MENU: string;
|
|
87
88
|
};
|
|
89
|
+
/**
|
|
90
|
+
* // TODO: shouldn't be really `const`, likely neither have integers as values, due to value for the custom fonts, which should likely be some hash.
|
|
91
|
+
*
|
|
92
|
+
* Let's think this through and consider:
|
|
93
|
+
* - https://developer.mozilla.org/en-US/docs/Web/CSS/generic-family
|
|
94
|
+
* - https://drafts.csswg.org/css-fonts-4/#font-family-prop
|
|
95
|
+
* - https://learn.microsoft.com/en-us/typography/opentype/spec/ibmfc
|
|
96
|
+
*/
|
|
88
97
|
export declare const FONT_FAMILY: {
|
|
89
98
|
Virgil: number;
|
|
90
99
|
Helvetica: number;
|
|
91
100
|
Cascadia: number;
|
|
92
|
-
|
|
101
|
+
Excalifont: number;
|
|
102
|
+
Nunito: number;
|
|
103
|
+
"Lilita One": number;
|
|
104
|
+
"Comic Shanns": number;
|
|
105
|
+
"Liberation Sans": number;
|
|
93
106
|
};
|
|
94
107
|
export declare const THEME: {
|
|
95
108
|
readonly LIGHT: "light";
|
|
@@ -279,3 +292,11 @@ export declare const EDITOR_LS_KEYS: {
|
|
|
279
292
|
* where filename is optional and we can't retrieve name from app state
|
|
280
293
|
*/
|
|
281
294
|
export declare const DEFAULT_FILENAME = "Untitled";
|
|
295
|
+
export declare const STATS_PANELS: {
|
|
296
|
+
readonly generalStats: 1;
|
|
297
|
+
readonly elementProperties: 2;
|
|
298
|
+
};
|
|
299
|
+
export declare const MIN_WIDTH_OR_HEIGHT = 1;
|
|
300
|
+
export declare const ARROW_TYPE: {
|
|
301
|
+
[T in AppState["currentItemArrowType"]]: T;
|
|
302
|
+
};
|
|
@@ -15,6 +15,11 @@ export const isIOS = /iPad|iPhone/.test(navigator.platform) ||
|
|
|
15
15
|
export const isBrave = () => navigator.brave?.isBrave?.name === "isBrave";
|
|
16
16
|
export const supportsResizeObserver = typeof window !== "undefined" && "ResizeObserver" in window;
|
|
17
17
|
export const APP_NAME = "Excalidraw";
|
|
18
|
+
// distance when creating text before it's considered `autoResize: false`
|
|
19
|
+
// we're using higher threshold so that clicks that end up being drags
|
|
20
|
+
// don't unintentionally create text elements that are wrapped to a few chars
|
|
21
|
+
// (happens a lot with fast clicks with the text tool)
|
|
22
|
+
export const TEXT_AUTOWRAP_THRESHOLD = 36; // px
|
|
18
23
|
export const DRAGGING_THRESHOLD = 10; // px
|
|
19
24
|
export const LINE_CONFIRM_THRESHOLD = 8; // px
|
|
20
25
|
export const ELEMENT_SHIFT_TRANSLATE_AMOUNT = 5;
|
|
@@ -94,12 +99,24 @@ export const ENV = {
|
|
|
94
99
|
export const CLASSES = {
|
|
95
100
|
SHAPE_ACTIONS_MENU: "App-menu__left",
|
|
96
101
|
};
|
|
97
|
-
|
|
102
|
+
/**
|
|
103
|
+
* // TODO: shouldn't be really `const`, likely neither have integers as values, due to value for the custom fonts, which should likely be some hash.
|
|
104
|
+
*
|
|
105
|
+
* Let's think this through and consider:
|
|
106
|
+
* - https://developer.mozilla.org/en-US/docs/Web/CSS/generic-family
|
|
107
|
+
* - https://drafts.csswg.org/css-fonts-4/#font-family-prop
|
|
108
|
+
* - https://learn.microsoft.com/en-us/typography/opentype/spec/ibmfc
|
|
109
|
+
*/
|
|
98
110
|
export const FONT_FAMILY = {
|
|
99
111
|
Virgil: 1,
|
|
100
112
|
Helvetica: 2,
|
|
101
113
|
Cascadia: 3,
|
|
102
|
-
Assistant
|
|
114
|
+
// leave 4 unused as it was historically used for Assistant (which we don't use anymore) or custom font (Obsidian)
|
|
115
|
+
Excalifont: 5,
|
|
116
|
+
Nunito: 6,
|
|
117
|
+
"Lilita One": 7,
|
|
118
|
+
"Comic Shanns": 8,
|
|
119
|
+
"Liberation Sans": 9,
|
|
103
120
|
};
|
|
104
121
|
export const THEME = {
|
|
105
122
|
LIGHT: "light",
|
|
@@ -123,7 +140,7 @@ export const FRAME_STYLE = {
|
|
|
123
140
|
export const WINDOWS_EMOJI_FALLBACK_FONT = "Segoe UI Emoji";
|
|
124
141
|
export const MIN_FONT_SIZE = 1;
|
|
125
142
|
export const DEFAULT_FONT_SIZE = 20;
|
|
126
|
-
export const DEFAULT_FONT_FAMILY = FONT_FAMILY.
|
|
143
|
+
export const DEFAULT_FONT_FAMILY = FONT_FAMILY.Excalifont;
|
|
127
144
|
export const DEFAULT_TEXT_ALIGN = "left";
|
|
128
145
|
export const DEFAULT_VERTICAL_ALIGN = "top";
|
|
129
146
|
export const DEFAULT_VERSION = "{version}";
|
|
@@ -226,7 +243,7 @@ export const MAX_DECIMALS_FOR_SVG_EXPORT = 2;
|
|
|
226
243
|
export const EXPORT_SCALES = [1, 2, 3];
|
|
227
244
|
export const DEFAULT_EXPORT_PADDING = 10; // px
|
|
228
245
|
export const DEFAULT_MAX_IMAGE_WIDTH_OR_HEIGHT = 1440;
|
|
229
|
-
export const MAX_ALLOWED_FILE_BYTES =
|
|
246
|
+
export const MAX_ALLOWED_FILE_BYTES = 4 * 1024 * 1024;
|
|
230
247
|
export const SVG_NS = "http://www.w3.org/2000/svg";
|
|
231
248
|
export const ENCRYPTION_KEY_BITS = 128;
|
|
232
249
|
export const VERSIONS = {
|
|
@@ -329,3 +346,10 @@ export const EDITOR_LS_KEYS = {
|
|
|
329
346
|
* where filename is optional and we can't retrieve name from app state
|
|
330
347
|
*/
|
|
331
348
|
export const DEFAULT_FILENAME = "Untitled";
|
|
349
|
+
export const STATS_PANELS = { generalStats: 1, elementProperties: 2 };
|
|
350
|
+
export const MIN_WIDTH_OR_HEIGHT = 1;
|
|
351
|
+
export const ARROW_TYPE = {
|
|
352
|
+
sharp: "sharp",
|
|
353
|
+
round: "round",
|
|
354
|
+
elbow: "elbow",
|
|
355
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AppState } from "./types";
|
|
1
|
+
import type { AppState } from "./types";
|
|
2
2
|
export declare const resetCursor: (interactiveCanvas: HTMLCanvasElement | null) => void;
|
|
3
3
|
export declare const setCursor: (interactiveCanvas: HTMLCanvasElement | null, cursor: string) => void;
|
|
4
4
|
export declare const setEraserCursor: (interactiveCanvas: HTMLCanvasElement | null, theme: AppState["theme"]) => void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { EDITOR_LS_KEYS } from "../constants";
|
|
2
|
-
import { JSONValue } from "../types";
|
|
1
|
+
import type { EDITOR_LS_KEYS } from "../constants";
|
|
2
|
+
import type { JSONValue } from "../types";
|
|
3
3
|
export declare class EditorLocalStorage {
|
|
4
4
|
static has(key: typeof EDITOR_LS_KEYS[keyof typeof EDITOR_LS_KEYS]): boolean;
|
|
5
5
|
static get<T extends JSONValue>(key: typeof EDITOR_LS_KEYS[keyof typeof EDITOR_LS_KEYS]): T | null;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { IMAGE_MIME_TYPES, MIME_TYPES } from "../constants";
|
|
2
|
-
import { ExcalidrawElement, FileId } from "../element/types";
|
|
3
|
-
import { AppState, DataURL, LibraryItem } from "../types";
|
|
4
|
-
import { ValueOf } from "../utility-types";
|
|
5
|
-
import { FileSystemHandle } from "./filesystem";
|
|
6
|
-
import { ImportedLibraryData } from "./types";
|
|
2
|
+
import type { ExcalidrawElement, FileId } from "../element/types";
|
|
3
|
+
import type { AppState, DataURL, LibraryItem } from "../types";
|
|
4
|
+
import type { ValueOf } from "../utility-types";
|
|
5
|
+
import type { FileSystemHandle } from "./filesystem";
|
|
6
|
+
import type { ImportedLibraryData } from "./types";
|
|
7
7
|
export declare const getMimeType: (blob: Blob | string) => string;
|
|
8
8
|
export declare const getFileHandleType: (handle: FileSystemHandle | null) => string | null;
|
|
9
9
|
export declare const isImageFileHandleType: (type: string | null) => type is "png" | "svg";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { FileSystemHandle
|
|
1
|
+
import type { FileSystemHandle } from "browser-fs-access";
|
|
2
|
+
import { supported as nativeFileSystemSupported } from "browser-fs-access";
|
|
2
3
|
import { MIME_TYPES } from "../constants";
|
|
3
4
|
type FILE_EXTENSION = Exclude<keyof typeof MIME_TYPES, "binary">;
|
|
4
5
|
export declare const fileOpen: <M extends boolean | undefined = false>(opts: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ExcalidrawElement, ExcalidrawFrameLikeElement, NonDeletedExcalidrawElement } from "../element/types";
|
|
2
|
-
import { ExportType } from "../scene/types";
|
|
3
|
-
import { AppState, BinaryFiles } from "../types";
|
|
4
|
-
import { FileSystemHandle } from "./filesystem";
|
|
1
|
+
import type { ExcalidrawElement, ExcalidrawFrameLikeElement, NonDeletedExcalidrawElement } from "../element/types";
|
|
2
|
+
import type { ExportType } from "../scene/types";
|
|
3
|
+
import type { AppState, BinaryFiles } from "../types";
|
|
4
|
+
import type { FileSystemHandle } from "./filesystem";
|
|
5
5
|
export { loadFromBlob } from "./blob";
|
|
6
6
|
export { loadFromJSON, saveAsJSON } from "./json";
|
|
7
7
|
export type ExportedElements = readonly NonDeletedExcalidrawElement[] & {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ExcalidrawElement } from "../element/types";
|
|
2
|
-
import { AppState, BinaryFiles, LibraryItems } from "../types";
|
|
3
|
-
import { ImportedDataState, ImportedLibraryData } from "./types";
|
|
1
|
+
import type { ExcalidrawElement } from "../element/types";
|
|
2
|
+
import type { AppState, BinaryFiles, LibraryItems } from "../types";
|
|
3
|
+
import type { ImportedDataState, ImportedLibraryData } from "./types";
|
|
4
4
|
export declare const serializeAsJSON: (elements: readonly ExcalidrawElement[], appState: Partial<AppState>, files: BinaryFiles, type: "local" | "database") => string;
|
|
5
5
|
export declare const saveAsJSON: (elements: readonly ExcalidrawElement[], appState: AppState, files: BinaryFiles, name?: string) => Promise<{
|
|
6
6
|
fileHandle: import("browser-fs-access").FileSystemHandle | null;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { LibraryItems, ExcalidrawImperativeAPI, LibraryItemsSource, LibraryItems_anyVersion } from "../types";
|
|
1
|
+
import type { LibraryItems, ExcalidrawImperativeAPI, LibraryItemsSource, LibraryItems_anyVersion } from "../types";
|
|
2
2
|
import type App from "../components/App";
|
|
3
|
-
import { ExcalidrawElement } from "../element/types";
|
|
4
|
-
import { MaybePromise } from "../utility-types";
|
|
3
|
+
import type { ExcalidrawElement } from "../element/types";
|
|
4
|
+
import type { MaybePromise } from "../utility-types";
|
|
5
5
|
export type LibraryPersistedData = {
|
|
6
6
|
libraryItems: LibraryItems;
|
|
7
7
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Theme } from "../element/types";
|
|
2
|
-
import { DataURL } from "../types";
|
|
3
|
-
import { OpenAIOutput } from "./ai/types";
|
|
1
|
+
import type { Theme } from "../element/types";
|
|
2
|
+
import type { DataURL } from "../types";
|
|
3
|
+
import type { OpenAIOutput } from "./ai/types";
|
|
4
4
|
export type MagicCacheData = {
|
|
5
5
|
status: "pending";
|
|
6
6
|
} | {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { OrderedExcalidrawElement } from "../element/types";
|
|
2
|
-
import { AppState } from "../types";
|
|
3
|
-
import { MakeBrand } from "../utility-types";
|
|
1
|
+
import type { OrderedExcalidrawElement } from "../element/types";
|
|
2
|
+
import type { AppState } from "../types";
|
|
3
|
+
import type { MakeBrand } from "../utility-types";
|
|
4
4
|
export type ReconciledExcalidrawElement = OrderedExcalidrawElement & MakeBrand<"ReconciledElement">;
|
|
5
5
|
export type RemoteExcalidrawElement = OrderedExcalidrawElement & MakeBrand<"RemoteExcalidrawElement">;
|
|
6
6
|
export declare const reconcileElements: (localElements: readonly OrderedExcalidrawElement[], remoteElements: readonly RemoteExcalidrawElement[], localAppState: AppState) => ReconciledExcalidrawElement[];
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ENV } from "../constants";
|
|
2
|
+
import { orderByFractionalIndex, syncInvalidIndices, validateFractionalIndices, } from "../fractionalIndex";
|
|
2
3
|
import { arrayToMap } from "../utils";
|
|
3
4
|
const shouldDiscardRemoteElement = (localAppState, local, remote) => {
|
|
4
5
|
if (local &&
|
|
@@ -43,6 +44,22 @@ export const reconcileElements = (localElements, remoteElements, localAppState)
|
|
|
43
44
|
}
|
|
44
45
|
}
|
|
45
46
|
const orderedElements = orderByFractionalIndex(reconciledElements);
|
|
47
|
+
if (import.meta.env.DEV ||
|
|
48
|
+
import.meta.env.MODE === ENV.TEST ||
|
|
49
|
+
window?.DEBUG_FRACTIONAL_INDICES) {
|
|
50
|
+
const elements = syncInvalidIndices(
|
|
51
|
+
// create new instances due to the mutation
|
|
52
|
+
orderedElements.map((x) => ({ ...x })));
|
|
53
|
+
validateFractionalIndices(elements, {
|
|
54
|
+
// throw in dev & test only, to remain functional on `DEBUG_FRACTIONAL_INDICES`
|
|
55
|
+
shouldThrow: import.meta.env.DEV || import.meta.env.MODE === ENV.TEST,
|
|
56
|
+
includeBoundTextValidation: true,
|
|
57
|
+
reconciliationContext: {
|
|
58
|
+
localElements,
|
|
59
|
+
remoteElements,
|
|
60
|
+
},
|
|
61
|
+
});
|
|
62
|
+
}
|
|
46
63
|
// de-duplicate indices
|
|
47
64
|
syncInvalidIndices(orderedElements);
|
|
48
65
|
return orderedElements;
|