@zsviczian/excalidraw 0.17.1-obsidian-42 → 0.17.1-obsidian-44
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/dist/excalidraw.development.js +6747 -0
- package/dist/excalidraw.production.min.js +2 -0
- package/dist/excalidraw.production.min.js.LICENSE.txt +55 -0
- package/dist/styles.development.css +6708 -0
- package/dist/styles.production.css +65 -0
- package/package.json +1 -1
- package/types/excalidraw/actions/actionAddToLibrary.d.ts +575 -0
- package/types/excalidraw/actions/actionAlign.d.ts +108 -0
- package/types/excalidraw/actions/actionBoundText.d.ts +420 -0
- package/types/excalidraw/actions/actionCanvas.d.ts +2802 -0
- package/types/excalidraw/actions/actionClipboard.d.ts +1436 -0
- package/types/excalidraw/actions/actionDeleteSelected.d.ts +609 -0
- package/types/excalidraw/actions/actionDistribute.d.ts +34 -0
- package/types/excalidraw/actions/actionDuplicateSelection.d.ts +21 -0
- package/types/excalidraw/actions/actionElementLock.d.ts +408 -0
- package/types/excalidraw/actions/actionExport.d.ts +1794 -0
- package/types/excalidraw/actions/actionFinalize.d.ts +389 -0
- package/types/excalidraw/actions/actionFlip.d.ts +34 -0
- package/types/excalidraw/actions/actionFrame.d.ts +815 -0
- package/types/excalidraw/actions/actionGroup.d.ts +418 -0
- package/types/excalidraw/actions/actionHistory.d.ts +7 -0
- package/types/excalidraw/actions/actionLinearEditor.d.ts +205 -0
- package/types/excalidraw/actions/actionLink.d.ts +205 -0
- package/types/excalidraw/actions/actionMenu.d.ts +598 -0
- package/types/excalidraw/actions/actionNavigate.d.ts +394 -0
- package/types/excalidraw/actions/actionProperties.d.ts +3006 -0
- package/types/excalidraw/actions/actionSelectAll.d.ts +204 -0
- package/types/excalidraw/actions/actionStyles.d.ts +218 -0
- package/types/excalidraw/actions/actionTextAutoResize.d.ts +17 -0
- package/types/excalidraw/actions/actionToggleGridMode.d.ts +207 -0
- package/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +205 -0
- package/types/excalidraw/actions/actionToggleStats.d.ts +205 -0
- package/types/excalidraw/actions/actionToggleViewMode.d.ts +206 -0
- package/types/excalidraw/actions/actionToggleZenMode.d.ts +206 -0
- package/types/excalidraw/actions/actionZindex.d.ts +74 -0
- package/types/excalidraw/actions/index.d.ts +25 -0
- package/types/excalidraw/actions/manager.d.ts +21 -0
- package/types/excalidraw/actions/register.d.ts +5 -0
- package/types/excalidraw/actions/shortcuts.d.ts +4 -0
- package/types/excalidraw/actions/types.d.ts +47 -0
- package/types/excalidraw/align.d.ts +6 -0
- package/types/excalidraw/analytics.d.ts +1 -0
- package/types/excalidraw/animated-trail.d.ts +33 -0
- package/types/excalidraw/animation-frame-handler.d.ts +16 -0
- package/types/excalidraw/appState.d.ts +89 -0
- package/types/excalidraw/binaryheap.d.ts +12 -0
- package/types/excalidraw/change.d.ts +191 -0
- package/types/excalidraw/charts.d.ts +27 -0
- package/types/excalidraw/clients.d.ts +14 -0
- package/types/excalidraw/clipboard.d.ts +44 -0
- package/types/excalidraw/colors.d.ts +61 -0
- package/types/excalidraw/components/Actions.d.ts +34 -0
- package/types/excalidraw/components/ActiveConfirmDialog.d.ts +4 -0
- package/types/excalidraw/components/App.d.ts +527 -0
- package/types/excalidraw/components/Avatar.d.ts +11 -0
- package/types/excalidraw/components/BraveMeasureTextError.d.ts +2 -0
- package/types/excalidraw/components/Button.d.ts +17 -0
- package/types/excalidraw/components/ButtonIcon.d.ts +14 -0
- package/types/excalidraw/components/ButtonIconCycle.d.ts +10 -0
- package/types/excalidraw/components/ButtonIconSelect.d.ts +19 -0
- package/types/excalidraw/components/ButtonSelect.d.ts +9 -0
- package/types/excalidraw/components/ButtonSeparator.d.ts +1 -0
- package/types/excalidraw/components/Card.d.ts +6 -0
- package/types/excalidraw/components/CheckboxItem.d.ts +8 -0
- package/types/excalidraw/components/ColorPicker/ColorInput.d.ts +9 -0
- package/types/excalidraw/components/ColorPicker/ColorPicker.d.ts +19 -0
- package/types/excalidraw/components/ColorPicker/CustomColorList.d.ts +8 -0
- package/types/excalidraw/components/ColorPicker/HotkeyLabel.d.ts +8 -0
- package/types/excalidraw/components/ColorPicker/Picker.d.ts +18 -0
- package/types/excalidraw/components/ColorPicker/PickerColorList.d.ts +10 -0
- package/types/excalidraw/components/ColorPicker/PickerHeading.d.ts +5 -0
- package/types/excalidraw/components/ColorPicker/ShadeList.d.ts +8 -0
- package/types/excalidraw/components/ColorPicker/TopPicks.d.ts +9 -0
- package/types/excalidraw/components/ColorPicker/colorPickerUtils.d.ts +21 -0
- package/types/excalidraw/components/ColorPicker/keyboardNavHandlers.d.ts +20 -0
- package/types/excalidraw/components/CommandPalette/CommandPalette.d.ts +18 -0
- package/types/excalidraw/components/CommandPalette/defaultCommandPaletteItems.d.ts +2 -0
- package/types/excalidraw/components/CommandPalette/types.d.ts +25 -0
- package/types/excalidraw/components/ConfirmDialog.d.ts +10 -0
- package/types/excalidraw/components/ContextMenu.d.ts +16 -0
- package/types/excalidraw/components/DarkModeToggle.d.ts +7 -0
- package/types/excalidraw/components/DefaultSidebar.d.ts +29 -0
- package/types/excalidraw/components/DiagramToCodePlugin/DiagramToCodePlugin.d.ts +4 -0
- package/types/excalidraw/components/Dialog.d.ts +13 -0
- package/types/excalidraw/components/DialogActionButton.d.ts +10 -0
- package/types/excalidraw/components/ErrorDialog.d.ts +5 -0
- package/types/excalidraw/components/ExcalidrawLogo.d.ts +15 -0
- package/types/excalidraw/components/EyeDropper.d.ts +27 -0
- package/types/excalidraw/components/FilledButton.d.ts +18 -0
- package/types/excalidraw/components/FixedSideContainer.d.ts +9 -0
- package/types/excalidraw/components/FollowMode/FollowMode.d.ts +10 -0
- package/types/excalidraw/components/FontPicker/FontPicker.d.ts +21 -0
- package/types/excalidraw/components/FontPicker/FontPickerList.d.ts +25 -0
- package/types/excalidraw/components/FontPicker/FontPickerTrigger.d.ts +6 -0
- package/types/excalidraw/components/FontPicker/keyboardNavHandlers.d.ts +13 -0
- package/types/excalidraw/components/HandButton.d.ts +10 -0
- package/types/excalidraw/components/HelpButton.d.ts +7 -0
- package/types/excalidraw/components/HelpDialog.d.ts +4 -0
- package/types/excalidraw/components/HintViewer.d.ts +10 -0
- package/types/excalidraw/components/IconPicker.d.ts +14 -0
- package/types/excalidraw/components/ImageExportDialog.d.ts +14 -0
- package/types/excalidraw/components/InitializeApp.d.ts +10 -0
- package/types/excalidraw/components/InlineIcon.d.ts +3 -0
- package/types/excalidraw/components/Island.d.ts +10 -0
- package/types/excalidraw/components/JSONExportDialog.d.ts +15 -0
- package/types/excalidraw/components/LaserPointerButton.d.ts +10 -0
- package/types/excalidraw/components/LayerUI.d.ts +30 -0
- package/types/excalidraw/components/LibraryMenu.d.ts +24 -0
- package/types/excalidraw/components/LibraryMenuBrowseButton.d.ts +7 -0
- package/types/excalidraw/components/LibraryMenuControlButtons.d.ts +9 -0
- package/types/excalidraw/components/LibraryMenuHeaderContent.d.ts +17 -0
- package/types/excalidraw/components/LibraryMenuItems.d.ts +14 -0
- package/types/excalidraw/components/LibraryMenuSection.d.ts +23 -0
- package/types/excalidraw/components/LibraryUnit.d.ts +14 -0
- package/types/excalidraw/components/LoadingMessage.d.ts +5 -0
- package/types/excalidraw/components/LockButton.d.ts +10 -0
- package/types/excalidraw/components/MagicButton.d.ts +9 -0
- package/types/excalidraw/components/MagicSettings.d.ts +8 -0
- package/types/excalidraw/components/MobileMenu.d.ts +24 -0
- package/types/excalidraw/components/Modal.d.ts +14 -0
- package/types/excalidraw/components/OverwriteConfirm/OverwriteConfirm.d.ts +17 -0
- package/types/excalidraw/components/OverwriteConfirm/OverwriteConfirmActions.d.ts +17 -0
- package/types/excalidraw/components/OverwriteConfirm/OverwriteConfirmState.d.ts +22 -0
- package/types/excalidraw/components/Paragraph.d.ts +4 -0
- package/types/excalidraw/components/PasteChartDialog.d.ts +8 -0
- package/types/excalidraw/components/PenModeButton.d.ts +12 -0
- package/types/excalidraw/components/Popover.d.ts +15 -0
- package/types/excalidraw/components/ProjectName.d.ts +10 -0
- package/types/excalidraw/components/PropertiesPopover.d.ts +15 -0
- package/types/excalidraw/components/PublishLibrary.d.ts +16 -0
- package/types/excalidraw/components/QuickSearch.d.ts +9 -0
- package/types/excalidraw/components/RadioGroup.d.ts +13 -0
- package/types/excalidraw/components/SVGLayer.d.ts +7 -0
- package/types/excalidraw/components/ScrollableList.d.ts +8 -0
- package/types/excalidraw/components/Section.d.ts +6 -0
- package/types/excalidraw/components/ShareableLinkDialog.d.ts +7 -0
- package/types/excalidraw/components/Sidebar/Sidebar.d.ts +76 -0
- package/types/excalidraw/components/Sidebar/SidebarHeader.d.ts +7 -0
- package/types/excalidraw/components/Sidebar/SidebarTab.d.ts +8 -0
- package/types/excalidraw/components/Sidebar/SidebarTabTrigger.d.ts +9 -0
- package/types/excalidraw/components/Sidebar/SidebarTabTriggers.d.ts +6 -0
- package/types/excalidraw/components/Sidebar/SidebarTabs.d.ts +6 -0
- package/types/excalidraw/components/Sidebar/SidebarTrigger.d.ts +6 -0
- package/types/excalidraw/components/Sidebar/common.d.ts +33 -0
- package/types/excalidraw/components/Spinner.d.ts +8 -0
- package/types/excalidraw/components/Stack.d.ts +16 -0
- package/types/excalidraw/components/Stats/Angle.d.ts +11 -0
- package/types/excalidraw/components/Stats/CanvasGrid.d.ts +10 -0
- package/types/excalidraw/components/Stats/CanvasGridSize.d.ts +10 -0
- package/types/excalidraw/components/Stats/Collapsible.d.ts +8 -0
- package/types/excalidraw/components/Stats/Dimension.d.ts +11 -0
- package/types/excalidraw/components/Stats/DragInput.d.ts +34 -0
- package/types/excalidraw/components/Stats/FontSize.d.ts +11 -0
- package/types/excalidraw/components/Stats/MultiAngle.d.ts +11 -0
- package/types/excalidraw/components/Stats/MultiDimension.d.ts +14 -0
- package/types/excalidraw/components/Stats/MultiFontSize.d.ts +12 -0
- package/types/excalidraw/components/Stats/MultiPosition.d.ts +14 -0
- package/types/excalidraw/components/Stats/Position.d.ts +12 -0
- package/types/excalidraw/components/Stats/index.d.ts +35 -0
- package/types/excalidraw/components/Stats/utils.d.ts +26 -0
- package/types/excalidraw/components/Stats.d.ts +11 -0
- package/types/excalidraw/components/Switch.d.ts +9 -0
- package/types/excalidraw/components/TTDDialog/MermaidToExcalidraw.d.ts +14 -0
- package/types/excalidraw/components/TTDDialog/TTDDialog.d.ts +29 -0
- package/types/excalidraw/components/TTDDialog/TTDDialogInput.d.ts +9 -0
- package/types/excalidraw/components/TTDDialog/TTDDialogOutput.d.ts +7 -0
- package/types/excalidraw/components/TTDDialog/TTDDialogPanel.d.ts +17 -0
- package/types/excalidraw/components/TTDDialog/TTDDialogPanels.d.ts +4 -0
- package/types/excalidraw/components/TTDDialog/TTDDialogSubmitShortcut.d.ts +1 -0
- package/types/excalidraw/components/TTDDialog/TTDDialogTab.d.ts +7 -0
- package/types/excalidraw/components/TTDDialog/TTDDialogTabTrigger.d.ts +8 -0
- package/types/excalidraw/components/TTDDialog/TTDDialogTabTriggers.d.ts +6 -0
- package/types/excalidraw/components/TTDDialog/TTDDialogTabs.d.ts +11 -0
- package/types/excalidraw/components/TTDDialog/TTDDialogTrigger.d.ts +8 -0
- package/types/excalidraw/components/TTDDialog/common.d.ts +32 -0
- package/types/excalidraw/components/TextField.d.ts +19 -0
- package/types/excalidraw/components/Toast.d.ts +9 -0
- package/types/excalidraw/components/ToolButton.d.ts +49 -0
- package/types/excalidraw/components/Tooltip.d.ts +18 -0
- package/types/excalidraw/components/Trans.d.ts +9 -0
- package/types/excalidraw/components/UserList.d.ts +18 -0
- package/types/excalidraw/components/canvases/InteractiveCanvas.d.ts +29 -0
- package/types/excalidraw/components/canvases/NewElementCanvas.d.ts +14 -0
- package/types/excalidraw/components/canvases/StaticCanvas.d.ts +19 -0
- package/types/excalidraw/components/canvases/index.d.ts +3 -0
- package/types/excalidraw/components/dropdownMenu/DropdownMenu.d.ts +86 -0
- package/types/excalidraw/components/dropdownMenu/DropdownMenuContent.d.ts +15 -0
- package/types/excalidraw/components/dropdownMenu/DropdownMenuGroup.d.ts +11 -0
- package/types/excalidraw/components/dropdownMenu/DropdownMenuItem.d.ts +45 -0
- package/types/excalidraw/components/dropdownMenu/DropdownMenuItemContent.d.ts +7 -0
- package/types/excalidraw/components/dropdownMenu/DropdownMenuItemContentRadio.d.ts +17 -0
- package/types/excalidraw/components/dropdownMenu/DropdownMenuItemCustom.d.ts +7 -0
- package/types/excalidraw/components/dropdownMenu/DropdownMenuItemLink.d.ts +15 -0
- package/types/excalidraw/components/dropdownMenu/DropdownMenuSeparator.d.ts +5 -0
- package/types/excalidraw/components/dropdownMenu/DropdownMenuTrigger.d.ts +10 -0
- package/types/excalidraw/components/dropdownMenu/common.d.ts +6 -0
- package/types/excalidraw/components/dropdownMenu/dropdownMenuUtils.d.ts +3 -0
- package/types/excalidraw/components/footer/Footer.d.ts +12 -0
- package/types/excalidraw/components/footer/FooterCenter.d.ts +8 -0
- package/types/excalidraw/components/hoc/withInternalFallback.d.ts +4 -0
- package/types/excalidraw/components/hyperlink/Hyperlink.d.ts +18 -0
- package/types/excalidraw/components/hyperlink/helpers.d.ts +7 -0
- package/types/excalidraw/components/icons.d.ts +211 -0
- package/types/excalidraw/components/live-collaboration/LiveCollaborationTrigger.d.ts +9 -0
- package/types/excalidraw/components/main-menu/DefaultItems.d.ts +58 -0
- package/types/excalidraw/components/main-menu/MainMenu.d.ts +80 -0
- package/types/excalidraw/components/welcome-screen/WelcomeScreen.Center.d.ts +59 -0
- package/types/excalidraw/components/welcome-screen/WelcomeScreen.Hints.d.ts +19 -0
- package/types/excalidraw/components/welcome-screen/WelcomeScreen.d.ts +86 -0
- package/types/excalidraw/constants.d.ts +314 -0
- package/types/excalidraw/context/tunnels.d.ts +20 -0
- package/types/excalidraw/context/ui-appState.d.ts +4 -0
- package/types/excalidraw/cursor.d.ts +6 -0
- package/types/excalidraw/data/EditorLocalStorage.d.ts +8 -0
- package/types/excalidraw/data/ai/types.d.ts +242 -0
- package/types/excalidraw/data/blob.d.ts +49 -0
- package/types/excalidraw/data/encode.d.ts +53 -0
- package/types/excalidraw/data/encryption.d.ts +9 -0
- package/types/excalidraw/data/filesystem.d.ts +20 -0
- package/types/excalidraw/data/image.d.ts +15 -0
- package/types/excalidraw/data/index.d.ts +22 -0
- package/types/excalidraw/data/json.d.ts +16 -0
- package/types/excalidraw/data/library.d.ts +106 -0
- package/types/excalidraw/data/magic.d.ts +23 -0
- package/types/excalidraw/data/reconcile.d.ts +6 -0
- package/types/excalidraw/data/resave.d.ts +5 -0
- package/types/excalidraw/data/restore.d.ts +21 -0
- package/types/excalidraw/data/transform.d.ts +81 -0
- package/types/excalidraw/data/types.d.ts +45 -0
- package/types/excalidraw/data/url.d.ts +8 -0
- package/types/excalidraw/deburr.d.ts +1 -0
- package/types/excalidraw/dist/excalidraw.development.d.ts +2 -0
- package/types/excalidraw/dist/excalidraw.production.min.d.ts +1 -0
- package/types/excalidraw/distribute.d.ts +6 -0
- package/types/excalidraw/element/ElementCanvasButtons.d.ts +7 -0
- package/types/excalidraw/element/binding.d.ts +97 -0
- package/types/excalidraw/element/bounds.d.ts +74 -0
- package/types/excalidraw/element/collision.d.ts +16 -0
- package/types/excalidraw/element/containerCache.d.ts +11 -0
- package/types/excalidraw/element/dragElements.d.ts +32 -0
- package/types/excalidraw/element/embeddable.d.ts +211 -0
- package/types/excalidraw/element/flowchart.d.ts +25 -0
- package/types/excalidraw/element/heading.d.ts +11 -0
- package/types/excalidraw/element/image.d.ts +32 -0
- package/types/excalidraw/element/index.d.ts +26 -0
- package/types/excalidraw/element/linearElementEditor.d.ts +344 -0
- package/types/excalidraw/element/mutateElement.d.ts +11 -0
- package/types/excalidraw/element/newElement.d.ts +106 -0
- package/types/excalidraw/element/resizeElements.d.ts +17 -0
- package/types/excalidraw/element/resizeTest.d.ts +14 -0
- package/types/excalidraw/element/routing.d.ts +10 -0
- package/types/excalidraw/element/showSelectedShapeActions.d.ts +3 -0
- package/types/excalidraw/element/sizeHelpers.d.ts +40 -0
- package/types/excalidraw/element/sortElements.d.ts +2 -0
- package/types/excalidraw/element/textElement.d.ts +70 -0
- package/types/excalidraw/element/textWysiwyg.d.ts +22 -0
- package/types/excalidraw/element/transformHandles.d.ts +54 -0
- package/types/excalidraw/element/typeChecks.d.ts +42 -0
- package/types/excalidraw/element/types.d.ts +253 -0
- package/types/excalidraw/emitter.d.ts +16 -0
- package/types/excalidraw/entry.d.ts +1 -0
- package/types/excalidraw/env.d.cts +1 -0
- package/types/excalidraw/env.d.ts +1 -0
- package/types/excalidraw/errors.d.ts +16 -0
- package/types/excalidraw/fonts/ExcalidrawFont.d.ts +21 -0
- package/types/excalidraw/fonts/index.d.ts +83 -0
- package/types/excalidraw/fonts/metadata.d.ts +35 -0
- package/types/excalidraw/fractionalIndex.d.ts +48 -0
- package/types/excalidraw/frame.d.ts +63 -0
- package/types/excalidraw/ga.d.ts +63 -0
- package/types/excalidraw/gadirections.d.ts +8 -0
- package/types/excalidraw/galines.d.ts +22 -0
- package/types/excalidraw/gapoints.d.ts +7 -0
- package/types/excalidraw/gatransforms.d.ts +10 -0
- package/types/excalidraw/gesture.d.ts +6 -0
- package/types/excalidraw/groups.d.ts +33 -0
- package/types/excalidraw/history.d.ts +40 -0
- package/types/excalidraw/hooks/useCallbackRefState.d.ts +1 -0
- package/types/excalidraw/hooks/useCopiedIndicator.d.ts +5 -0
- package/types/excalidraw/hooks/useCreatePortalContainer.d.ts +7 -0
- package/types/excalidraw/hooks/useEmitter.d.ts +2 -0
- package/types/excalidraw/hooks/useLibraryItemSvg.d.ts +11 -0
- package/types/excalidraw/hooks/useOutsideClick.d.ts +19 -0
- package/types/excalidraw/hooks/useScrollPosition.d.ts +1 -0
- package/types/excalidraw/hooks/useStable.d.ts +1 -0
- package/types/excalidraw/hooks/useStableCallback.d.ts +4 -0
- package/types/excalidraw/hooks/useTransition.d.ts +2 -0
- package/types/excalidraw/i18n.d.ts +24 -0
- package/types/excalidraw/index-node.d.ts +1 -0
- package/types/excalidraw/index.d.ts +61 -0
- package/types/excalidraw/jotai.d.ts +34 -0
- package/types/excalidraw/keys.d.ts +82 -0
- package/types/excalidraw/laser-trails.d.ts +20 -0
- package/types/excalidraw/main.d.ts +2 -0
- package/types/excalidraw/math.d.ts +79 -0
- package/types/excalidraw/mermaid.d.ts +2 -0
- package/types/excalidraw/obsidianUtils.d.ts +17 -0
- package/types/excalidraw/points.d.ts +7 -0
- package/types/excalidraw/polyfill.d.ts +2 -0
- package/types/excalidraw/publicPath.d.ts +1 -0
- package/types/excalidraw/queue.d.ts +9 -0
- package/types/excalidraw/random.d.ts +4 -0
- package/types/excalidraw/reactUtils.d.ts +14 -0
- package/types/excalidraw/renderer/easingFunctions.d.ts +6 -0
- package/types/excalidraw/renderer/helpers.d.ts +13 -0
- package/types/excalidraw/renderer/interactiveScene.d.ts +20 -0
- package/types/excalidraw/renderer/renderElement.d.ts +27 -0
- package/types/excalidraw/renderer/renderNewElementScene.d.ts +7 -0
- package/types/excalidraw/renderer/renderSnaps.d.ts +2 -0
- package/types/excalidraw/renderer/roundRect.d.ts +11 -0
- package/types/excalidraw/renderer/staticScene.d.ts +11 -0
- package/types/excalidraw/renderer/staticSvgScene.d.ts +5 -0
- package/types/excalidraw/scene/Fonts.d.ts +19 -0
- package/types/excalidraw/scene/Renderer.d.ts +28 -0
- package/types/excalidraw/scene/Scene.d.ts +78 -0
- package/types/excalidraw/scene/Shape.d.ts +17 -0
- package/types/excalidraw/scene/ShapeCache.d.ts +25 -0
- package/types/excalidraw/scene/comparisons.d.ts +11 -0
- package/types/excalidraw/scene/export.d.ts +29 -0
- package/types/excalidraw/scene/index.d.ts +4 -0
- package/types/excalidraw/scene/normalize.d.ts +4 -0
- package/types/excalidraw/scene/scroll.d.ts +17 -0
- package/types/excalidraw/scene/scrollbars.d.ts +12 -0
- package/types/excalidraw/scene/selection.d.ts +32 -0
- package/types/excalidraw/scene/types.d.ts +112 -0
- package/types/excalidraw/scene/zoom.d.ts +12 -0
- package/types/excalidraw/shapes.d.ts +70 -0
- package/types/excalidraw/snapping.d.ts +109 -0
- package/types/excalidraw/store.d.ts +129 -0
- package/types/excalidraw/types.d.ts +700 -0
- package/types/excalidraw/utility-types.d.ts +31 -0
- package/types/excalidraw/utils.d.ts +243 -0
- package/types/excalidraw/visualdebug.d.ts +34 -0
- package/types/excalidraw/webpack.dev.config.d.ts +81 -0
- package/types/excalidraw/webpack.prod.config.d.ts +97 -0
- package/types/excalidraw/zindex.d.ts +6 -0
- package/types/utils/bbox.d.ts +11 -0
- package/types/utils/collision.d.ts +4 -0
- package/types/utils/export.d.ts +44 -0
- package/types/utils/geometry/geometry.d.ts +89 -0
- package/types/utils/geometry/shape.d.ts +56 -0
- package/types/utils/index.d.ts +4 -0
- package/types/utils/withinBounds.d.ts +19 -0
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { ElementsMap, ExcalidrawElement, ExcalidrawElementType, ExcalidrawTextContainer, ExcalidrawTextElement, ExcalidrawTextElementWithContainer, FontString, NonDeletedExcalidrawElement } from "./types";
|
|
2
|
+
import type { MaybeTransformHandleType } from "./transformHandles";
|
|
3
|
+
import type { AppState } from "../types";
|
|
4
|
+
import type { ExtractSetType } from "../utility-types";
|
|
5
|
+
export declare const normalizeText: (text: string) => string;
|
|
6
|
+
export declare const redrawTextBoundingBox: (textElement: ExcalidrawTextElement, container: ExcalidrawElement | null, elementsMap: ElementsMap, informMutation?: boolean) => void;
|
|
7
|
+
export declare const bindTextToShapeAfterDuplication: (newElements: ExcalidrawElement[], oldElements: ExcalidrawElement[], oldIdToDuplicatedId: Map<ExcalidrawElement["id"], ExcalidrawElement["id"]>) => void;
|
|
8
|
+
export declare const handleBindTextResize: (container: NonDeletedExcalidrawElement, elementsMap: ElementsMap, transformHandleType: MaybeTransformHandleType, shouldMaintainAspectRatio?: boolean) => void;
|
|
9
|
+
export declare const computeBoundTextPosition: (container: ExcalidrawElement, boundTextElement: ExcalidrawTextElementWithContainer, elementsMap: ElementsMap) => {
|
|
10
|
+
x: number;
|
|
11
|
+
y: number;
|
|
12
|
+
};
|
|
13
|
+
export declare const measureText: (text: string, font: FontString, lineHeight: ExcalidrawTextElement["lineHeight"]) => {
|
|
14
|
+
width: number;
|
|
15
|
+
height: number;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* To get unitless line-height (if unknown) we can calculate it by dividing
|
|
19
|
+
* height-per-line by fontSize.
|
|
20
|
+
*/
|
|
21
|
+
export declare const detectLineHeight: (textElement: ExcalidrawTextElement) => number & {
|
|
22
|
+
_brand: "unitlessLineHeight";
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* We calculate the line height from the font size and the unitless line height,
|
|
26
|
+
* aligning with the W3C spec.
|
|
27
|
+
*/
|
|
28
|
+
export declare const getLineHeightInPx: (fontSize: ExcalidrawTextElement["fontSize"], lineHeight: ExcalidrawTextElement["lineHeight"]) => number;
|
|
29
|
+
export declare const getApproxMinLineHeight: (fontSize: ExcalidrawTextElement["fontSize"], lineHeight: ExcalidrawTextElement["lineHeight"]) => number;
|
|
30
|
+
export declare const getTextWidth: (text: string, font: FontString, forceAdvanceWidth?: true) => number;
|
|
31
|
+
export declare const getTextHeight: (text: string, fontSize: number, lineHeight: ExcalidrawTextElement["lineHeight"]) => number;
|
|
32
|
+
export declare const parseTokens: (text: string) => string[];
|
|
33
|
+
export declare const wrapText: (text: string, font: FontString, maxWidth: number) => string;
|
|
34
|
+
export declare const charWidth: {
|
|
35
|
+
calculate: (char: string, font: FontString) => number;
|
|
36
|
+
getCache: (font: FontString) => number[];
|
|
37
|
+
};
|
|
38
|
+
export declare const getApproxMinLineWidth: (font: FontString, lineHeight: ExcalidrawTextElement["lineHeight"]) => number;
|
|
39
|
+
export declare const getMinCharWidth: (font: FontString) => number;
|
|
40
|
+
export declare const getMaxCharWidth: (font: FontString) => number;
|
|
41
|
+
export declare const getBoundTextElementId: (container: ExcalidrawElement | null) => string | null;
|
|
42
|
+
export declare const getBoundTextElement: (element: ExcalidrawElement | null, elementsMap: ElementsMap) => ExcalidrawTextElementWithContainer | null;
|
|
43
|
+
export declare const getContainerElement: (element: ExcalidrawTextElement | null, elementsMap: ElementsMap) => ExcalidrawTextContainer | null;
|
|
44
|
+
export declare const getContainerCenter: (container: ExcalidrawElement, appState: AppState, elementsMap: ElementsMap) => {
|
|
45
|
+
x: number;
|
|
46
|
+
y: number;
|
|
47
|
+
};
|
|
48
|
+
export declare const getContainerCoords: (container: NonDeletedExcalidrawElement) => {
|
|
49
|
+
x: number;
|
|
50
|
+
y: number;
|
|
51
|
+
};
|
|
52
|
+
export declare const getTextElementAngle: (textElement: ExcalidrawTextElement, container: ExcalidrawTextContainer | null) => number;
|
|
53
|
+
export declare const getBoundTextElementPosition: (container: ExcalidrawElement, boundTextElement: ExcalidrawTextElementWithContainer, elementsMap: ElementsMap) => {
|
|
54
|
+
x: number;
|
|
55
|
+
y: number;
|
|
56
|
+
} | undefined;
|
|
57
|
+
export declare const shouldAllowVerticalAlign: (selectedElements: NonDeletedExcalidrawElement[], elementsMap: ElementsMap) => boolean;
|
|
58
|
+
export declare const suppportsHorizontalAlign: (selectedElements: NonDeletedExcalidrawElement[], elementsMap: ElementsMap) => boolean;
|
|
59
|
+
declare const VALID_CONTAINER_TYPES: Set<string>;
|
|
60
|
+
export declare const isValidTextContainer: (element: {
|
|
61
|
+
type: ExcalidrawElementType;
|
|
62
|
+
}) => boolean;
|
|
63
|
+
export declare const computeContainerDimensionForBoundText: (dimension: number, containerType: ExtractSetType<typeof VALID_CONTAINER_TYPES>, legacy?: boolean) => number;
|
|
64
|
+
export declare const getBoundTextMaxWidth: (container: ExcalidrawElement, boundTextElement: ExcalidrawTextElement | null) => number;
|
|
65
|
+
export declare const getBoundTextMaxHeight: (container: ExcalidrawElement, boundTextElement: ExcalidrawTextElementWithContainer) => number;
|
|
66
|
+
export declare const isMeasureTextSupported: () => boolean;
|
|
67
|
+
export declare const getMinTextElementWidth: (font: FontString, lineHeight: ExcalidrawTextElement["lineHeight"]) => number;
|
|
68
|
+
/** retrieves text from text elements and concatenates to a single string */
|
|
69
|
+
export declare const getTextFromElements: (elements: readonly ExcalidrawElement[], separator?: string) => string;
|
|
70
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ExcalidrawElement, ExcalidrawTextElement } from "./types";
|
|
2
|
+
import type App from "../components/App";
|
|
3
|
+
export declare const textWysiwyg: ({ id, onChange, onSubmit, getViewportCoords, element, canvas, excalidrawContainer, app, autoSelect, }: {
|
|
4
|
+
id: ExcalidrawElement["id"];
|
|
5
|
+
/**
|
|
6
|
+
* textWysiwyg only deals with `originalText`
|
|
7
|
+
*
|
|
8
|
+
* Note: `text`, which can be wrapped and therefore different from `originalText`,
|
|
9
|
+
* is derived from `originalText`
|
|
10
|
+
*/
|
|
11
|
+
onChange?: ((nextOriginalText: string) => void) | undefined;
|
|
12
|
+
onSubmit: (data: {
|
|
13
|
+
viaKeyboard: boolean;
|
|
14
|
+
nextOriginalText: string;
|
|
15
|
+
}) => void;
|
|
16
|
+
getViewportCoords: (x: number, y: number) => [number, number];
|
|
17
|
+
element: ExcalidrawTextElement;
|
|
18
|
+
canvas: HTMLCanvasElement;
|
|
19
|
+
excalidrawContainer: HTMLDivElement | null;
|
|
20
|
+
app: App;
|
|
21
|
+
autoSelect?: boolean | undefined;
|
|
22
|
+
}) => void;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { ElementsMap, ExcalidrawElement, NonDeletedExcalidrawElement, PointerType } from "./types";
|
|
2
|
+
import type { Bounds } from "./bounds";
|
|
3
|
+
import type { Device, InteractiveCanvasAppState, Zoom } from "../types";
|
|
4
|
+
export type TransformHandleDirection = "n" | "s" | "w" | "e" | "nw" | "ne" | "sw" | "se";
|
|
5
|
+
export type TransformHandleType = TransformHandleDirection | "rotation";
|
|
6
|
+
export type TransformHandle = Bounds;
|
|
7
|
+
export type TransformHandles = Partial<{
|
|
8
|
+
[T in TransformHandleType]: TransformHandle;
|
|
9
|
+
}>;
|
|
10
|
+
export type MaybeTransformHandleType = TransformHandleType | false;
|
|
11
|
+
export declare const DEFAULT_OMIT_SIDES: {
|
|
12
|
+
e: boolean;
|
|
13
|
+
s: boolean;
|
|
14
|
+
n: boolean;
|
|
15
|
+
w: boolean;
|
|
16
|
+
};
|
|
17
|
+
export declare const OMIT_SIDES_FOR_MULTIPLE_ELEMENTS: {
|
|
18
|
+
e: boolean;
|
|
19
|
+
s: boolean;
|
|
20
|
+
n: boolean;
|
|
21
|
+
w: boolean;
|
|
22
|
+
};
|
|
23
|
+
export declare const OMIT_SIDES_FOR_FRAME: {
|
|
24
|
+
e: boolean;
|
|
25
|
+
s: boolean;
|
|
26
|
+
n: boolean;
|
|
27
|
+
w: boolean;
|
|
28
|
+
rotation: boolean;
|
|
29
|
+
};
|
|
30
|
+
export declare const canResizeFromSides: (device: Device) => boolean;
|
|
31
|
+
export declare const getOmitSidesForDevice: (device: Device) => {};
|
|
32
|
+
export declare const getTransformHandlesFromCoords: ([x1, y1, x2, y2, cx, cy]: [number, number, number, number, number, number], angle: number, zoom: Zoom, pointerType: PointerType, omitSides?: {
|
|
33
|
+
s?: boolean | undefined;
|
|
34
|
+
e?: boolean | undefined;
|
|
35
|
+
w?: boolean | undefined;
|
|
36
|
+
n?: boolean | undefined;
|
|
37
|
+
nw?: boolean | undefined;
|
|
38
|
+
ne?: boolean | undefined;
|
|
39
|
+
sw?: boolean | undefined;
|
|
40
|
+
se?: boolean | undefined;
|
|
41
|
+
rotation?: boolean | undefined;
|
|
42
|
+
}, margin?: number) => TransformHandles;
|
|
43
|
+
export declare const getTransformHandles: (element: ExcalidrawElement, zoom: Zoom, elementsMap: ElementsMap, pointerType?: PointerType, omitSides?: {
|
|
44
|
+
s?: boolean | undefined;
|
|
45
|
+
e?: boolean | undefined;
|
|
46
|
+
w?: boolean | undefined;
|
|
47
|
+
n?: boolean | undefined;
|
|
48
|
+
nw?: boolean | undefined;
|
|
49
|
+
ne?: boolean | undefined;
|
|
50
|
+
sw?: boolean | undefined;
|
|
51
|
+
se?: boolean | undefined;
|
|
52
|
+
rotation?: boolean | undefined;
|
|
53
|
+
}) => TransformHandles;
|
|
54
|
+
export declare const shouldShowBoundingBox: (elements: readonly NonDeletedExcalidrawElement[], appState: InteractiveCanvasAppState) => boolean;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { LineSegment } from "../../utils";
|
|
2
|
+
import type { ElementOrToolType } from "../types";
|
|
3
|
+
import type { MarkNonNullable } from "../utility-types";
|
|
4
|
+
import type { Bounds } from "./bounds";
|
|
5
|
+
import type { ExcalidrawElement, ExcalidrawTextElement, ExcalidrawEmbeddableElement, ExcalidrawLinearElement, ExcalidrawBindableElement, ExcalidrawFreeDrawElement, InitializedExcalidrawImageElement, ExcalidrawImageElement, ExcalidrawTextElementWithContainer, ExcalidrawTextContainer, ExcalidrawFrameElement, RoundnessType, ExcalidrawFrameLikeElement, ExcalidrawElementType, ExcalidrawIframeElement, ExcalidrawIframeLikeElement, ExcalidrawMagicFrameElement, ExcalidrawArrowElement, ExcalidrawElbowArrowElement, PointBinding, FixedPointBinding, ExcalidrawFlowchartNodeElement } from "./types";
|
|
6
|
+
export declare const isInitializedImageElement: (element: ExcalidrawElement | null) => element is InitializedExcalidrawImageElement;
|
|
7
|
+
export declare const isImageElement: (element: ExcalidrawElement | null) => element is ExcalidrawImageElement;
|
|
8
|
+
export declare const isEmbeddableElement: (element: ExcalidrawElement | null | undefined) => element is ExcalidrawEmbeddableElement;
|
|
9
|
+
export declare const isIframeElement: (element: ExcalidrawElement | null) => element is ExcalidrawIframeElement;
|
|
10
|
+
export declare const isIframeLikeElement: (element: ExcalidrawElement | null) => element is ExcalidrawIframeLikeElement;
|
|
11
|
+
export declare const isTextElement: (element: ExcalidrawElement | null) => element is ExcalidrawTextElement;
|
|
12
|
+
export declare const isFrameElement: (element: ExcalidrawElement | null) => element is ExcalidrawFrameElement;
|
|
13
|
+
export declare const isMagicFrameElement: (element: ExcalidrawElement | null) => element is ExcalidrawMagicFrameElement;
|
|
14
|
+
export declare const isFrameLikeElement: (element: ExcalidrawElement | null) => element is ExcalidrawFrameLikeElement;
|
|
15
|
+
export declare const isFreeDrawElement: (element?: ExcalidrawElement | null) => element is ExcalidrawFreeDrawElement;
|
|
16
|
+
export declare const isFreeDrawElementType: (elementType: ExcalidrawElementType) => boolean;
|
|
17
|
+
export declare const isLinearElement: (element?: ExcalidrawElement | null) => element is ExcalidrawLinearElement;
|
|
18
|
+
export declare const isArrowElement: (element?: ExcalidrawElement | null) => element is ExcalidrawArrowElement;
|
|
19
|
+
export declare const isElbowArrow: (element?: ExcalidrawElement) => element is ExcalidrawElbowArrowElement;
|
|
20
|
+
export declare const isLinearElementType: (elementType: ElementOrToolType) => boolean;
|
|
21
|
+
export declare const isBindingElement: (element?: ExcalidrawElement | null, includeLocked?: boolean) => element is ExcalidrawLinearElement;
|
|
22
|
+
export declare const isBindingElementType: (elementType: ElementOrToolType) => boolean;
|
|
23
|
+
export declare const isBindableElement: (element: ExcalidrawElement | null | undefined, includeLocked?: boolean) => element is ExcalidrawBindableElement;
|
|
24
|
+
export declare const isRectanguloidElement: (element?: ExcalidrawElement | null) => element is ExcalidrawBindableElement;
|
|
25
|
+
export declare const isRectangularElement: (element?: ExcalidrawElement | null) => element is ExcalidrawBindableElement;
|
|
26
|
+
export declare const isTextBindableContainer: (element: ExcalidrawElement | null, includeLocked?: boolean) => element is ExcalidrawTextContainer;
|
|
27
|
+
export declare const isExcalidrawElement: (element: any) => element is ExcalidrawElement;
|
|
28
|
+
export declare const isFlowchartNodeElement: (element: ExcalidrawElement) => element is ExcalidrawFlowchartNodeElement;
|
|
29
|
+
export declare const hasBoundTextElement: (element: ExcalidrawElement | null) => element is MarkNonNullable<ExcalidrawBindableElement, "boundElements">;
|
|
30
|
+
export declare const isBoundToContainer: (element: ExcalidrawElement | null) => element is ExcalidrawTextElementWithContainer;
|
|
31
|
+
export declare const isUsingAdaptiveRadius: (type: string) => boolean;
|
|
32
|
+
export declare const isUsingProportionalRadius: (type: string) => boolean;
|
|
33
|
+
export declare const canApplyRoundnessTypeToElement: (roundnessType: RoundnessType, element: ExcalidrawElement) => boolean;
|
|
34
|
+
export declare const getDefaultRoundnessTypeForElement: (element: ExcalidrawElement) => {
|
|
35
|
+
type: 2;
|
|
36
|
+
} | {
|
|
37
|
+
type: 3;
|
|
38
|
+
} | null;
|
|
39
|
+
export declare const isFixedPointBinding: (binding: PointBinding) => binding is FixedPointBinding;
|
|
40
|
+
export declare const isPoint: (point: unknown) => point is readonly [number, number];
|
|
41
|
+
export declare const isBounds: (box: unknown) => box is Bounds;
|
|
42
|
+
export declare const isLineSegment: (segment: unknown) => segment is LineSegment;
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
import type { Point } from "../types";
|
|
2
|
+
import type { FONT_FAMILY, ROUNDNESS, TEXT_ALIGN, THEME, VERTICAL_ALIGN } from "../constants";
|
|
3
|
+
import type { MakeBrand, MarkNonNullable, Merge, ValueOf } from "../utility-types";
|
|
4
|
+
export type ChartType = "bar" | "line";
|
|
5
|
+
export type FillStyle = "hachure" | "cross-hatch" | "solid" | "zigzag";
|
|
6
|
+
export type FontFamilyKeys = keyof typeof FONT_FAMILY;
|
|
7
|
+
export type FontFamilyValues = typeof FONT_FAMILY[FontFamilyKeys];
|
|
8
|
+
export type Theme = typeof THEME[keyof typeof THEME];
|
|
9
|
+
export type FontString = string & {
|
|
10
|
+
_brand: "fontString";
|
|
11
|
+
};
|
|
12
|
+
export type GroupId = string;
|
|
13
|
+
export type PointerType = "mouse" | "pen" | "touch";
|
|
14
|
+
export type StrokeRoundness = "round" | "sharp";
|
|
15
|
+
export type RoundnessType = ValueOf<typeof ROUNDNESS>;
|
|
16
|
+
export type StrokeStyle = "solid" | "dashed" | "dotted";
|
|
17
|
+
export type TextAlign = typeof TEXT_ALIGN[keyof typeof TEXT_ALIGN];
|
|
18
|
+
type VerticalAlignKeys = keyof typeof VERTICAL_ALIGN;
|
|
19
|
+
export type VerticalAlign = typeof VERTICAL_ALIGN[VerticalAlignKeys];
|
|
20
|
+
export type FractionalIndex = string & {
|
|
21
|
+
_brand: "franctionalIndex";
|
|
22
|
+
};
|
|
23
|
+
export type BoundElement = Readonly<{
|
|
24
|
+
id: ExcalidrawLinearElement["id"];
|
|
25
|
+
type: "arrow" | "text";
|
|
26
|
+
}>;
|
|
27
|
+
type _ExcalidrawElementBase = Readonly<{
|
|
28
|
+
id: string;
|
|
29
|
+
x: number;
|
|
30
|
+
y: number;
|
|
31
|
+
strokeColor: string;
|
|
32
|
+
backgroundColor: string;
|
|
33
|
+
fillStyle: FillStyle;
|
|
34
|
+
strokeWidth: number;
|
|
35
|
+
strokeStyle: StrokeStyle;
|
|
36
|
+
roundness: null | {
|
|
37
|
+
type: RoundnessType;
|
|
38
|
+
value?: number;
|
|
39
|
+
};
|
|
40
|
+
roughness: number;
|
|
41
|
+
opacity: number;
|
|
42
|
+
width: number;
|
|
43
|
+
height: number;
|
|
44
|
+
angle: number;
|
|
45
|
+
/** Random integer used to seed shape generation so that the roughjs shape
|
|
46
|
+
doesn't differ across renders. */
|
|
47
|
+
seed: number;
|
|
48
|
+
/** Integer that is sequentially incremented on each change. Used to reconcile
|
|
49
|
+
elements during collaboration or when saving to server. */
|
|
50
|
+
version: number;
|
|
51
|
+
/** Random integer that is regenerated on each change.
|
|
52
|
+
Used for deterministic reconciliation of updates during collaboration,
|
|
53
|
+
in case the versions (see above) are identical. */
|
|
54
|
+
versionNonce: number;
|
|
55
|
+
/** String in a fractional form defined by https://github.com/rocicorp/fractional-indexing.
|
|
56
|
+
Used for ordering in multiplayer scenarios, such as during reconciliation or undo / redo.
|
|
57
|
+
Always kept in sync with the array order by `syncMovedIndices` and `syncInvalidIndices`.
|
|
58
|
+
Could be null, i.e. for new elements which were not yet assigned to the scene. */
|
|
59
|
+
index: FractionalIndex | null;
|
|
60
|
+
isDeleted: boolean;
|
|
61
|
+
/** List of groups the element belongs to.
|
|
62
|
+
Ordered from deepest to shallowest. */
|
|
63
|
+
groupIds: readonly GroupId[];
|
|
64
|
+
frameId: string | null;
|
|
65
|
+
/** other elements that are bound to this element */
|
|
66
|
+
boundElements: readonly BoundElement[] | null;
|
|
67
|
+
/** epoch (ms) timestamp of last element update */
|
|
68
|
+
updated: number;
|
|
69
|
+
link: string | null;
|
|
70
|
+
locked: boolean;
|
|
71
|
+
customData?: Record<string, any>;
|
|
72
|
+
}>;
|
|
73
|
+
export type ExcalidrawSelectionElement = _ExcalidrawElementBase & {
|
|
74
|
+
type: "selection";
|
|
75
|
+
};
|
|
76
|
+
export type ExcalidrawRectangleElement = _ExcalidrawElementBase & {
|
|
77
|
+
type: "rectangle";
|
|
78
|
+
};
|
|
79
|
+
export type ExcalidrawDiamondElement = _ExcalidrawElementBase & {
|
|
80
|
+
type: "diamond";
|
|
81
|
+
};
|
|
82
|
+
export type ExcalidrawEllipseElement = _ExcalidrawElementBase & {
|
|
83
|
+
type: "ellipse";
|
|
84
|
+
};
|
|
85
|
+
export type ExcalidrawEmbeddableElement = _ExcalidrawElementBase & Readonly<{
|
|
86
|
+
type: "embeddable";
|
|
87
|
+
scale: [number, number];
|
|
88
|
+
}>;
|
|
89
|
+
export type MagicGenerationData = {
|
|
90
|
+
status: "pending";
|
|
91
|
+
} | {
|
|
92
|
+
status: "done";
|
|
93
|
+
html: string;
|
|
94
|
+
} | {
|
|
95
|
+
status: "error";
|
|
96
|
+
message?: string;
|
|
97
|
+
code: "ERR_GENERATION_INTERRUPTED" | string;
|
|
98
|
+
};
|
|
99
|
+
export type ExcalidrawIframeElement = _ExcalidrawElementBase & Readonly<{
|
|
100
|
+
type: "iframe";
|
|
101
|
+
customData?: {
|
|
102
|
+
generationData?: MagicGenerationData;
|
|
103
|
+
};
|
|
104
|
+
scale: [number, number];
|
|
105
|
+
}>;
|
|
106
|
+
export type ExcalidrawIframeLikeElement = ExcalidrawIframeElement | ExcalidrawEmbeddableElement;
|
|
107
|
+
export type IframeData = ({
|
|
108
|
+
intrinsicSize: {
|
|
109
|
+
w: number;
|
|
110
|
+
h: number;
|
|
111
|
+
};
|
|
112
|
+
error?: Error;
|
|
113
|
+
sandbox?: {
|
|
114
|
+
allowSameOrigin?: boolean;
|
|
115
|
+
};
|
|
116
|
+
} & ({
|
|
117
|
+
type: "video" | "generic";
|
|
118
|
+
link: string;
|
|
119
|
+
} | {
|
|
120
|
+
type: "document";
|
|
121
|
+
srcdoc: (theme: Theme) => string;
|
|
122
|
+
}));
|
|
123
|
+
export type ExcalidrawImageElement = _ExcalidrawElementBase & Readonly<{
|
|
124
|
+
type: "image";
|
|
125
|
+
fileId: FileId | null;
|
|
126
|
+
/** whether respective file is persisted */
|
|
127
|
+
status: "pending" | "saved" | "error";
|
|
128
|
+
/** X and Y scale factors <-1, 1>, used for image axis flipping */
|
|
129
|
+
scale: [number, number];
|
|
130
|
+
}>;
|
|
131
|
+
export type InitializedExcalidrawImageElement = MarkNonNullable<ExcalidrawImageElement, "fileId">;
|
|
132
|
+
export type ExcalidrawFrameElement = _ExcalidrawElementBase & {
|
|
133
|
+
type: "frame";
|
|
134
|
+
name: string | null;
|
|
135
|
+
};
|
|
136
|
+
export type ExcalidrawMagicFrameElement = _ExcalidrawElementBase & {
|
|
137
|
+
type: "magicframe";
|
|
138
|
+
name: string | null;
|
|
139
|
+
};
|
|
140
|
+
export type ExcalidrawFrameLikeElement = ExcalidrawFrameElement | ExcalidrawMagicFrameElement;
|
|
141
|
+
/**
|
|
142
|
+
* These are elements that don't have any additional properties.
|
|
143
|
+
*/
|
|
144
|
+
export type ExcalidrawGenericElement = ExcalidrawSelectionElement | ExcalidrawRectangleElement | ExcalidrawDiamondElement | ExcalidrawEllipseElement;
|
|
145
|
+
export type ExcalidrawFlowchartNodeElement = ExcalidrawRectangleElement | ExcalidrawDiamondElement | ExcalidrawEllipseElement;
|
|
146
|
+
/**
|
|
147
|
+
* ExcalidrawElement should be JSON serializable and (eventually) contain
|
|
148
|
+
* no computed data. The list of all ExcalidrawElements should be shareable
|
|
149
|
+
* between peers and contain no state local to the peer.
|
|
150
|
+
*/
|
|
151
|
+
export type ExcalidrawElement = ExcalidrawGenericElement | ExcalidrawTextElement | ExcalidrawLinearElement | ExcalidrawFreeDrawElement | ExcalidrawImageElement | ExcalidrawFrameElement | ExcalidrawMagicFrameElement | ExcalidrawIframeElement | ExcalidrawEmbeddableElement;
|
|
152
|
+
export type ExcalidrawNonSelectionElement = Exclude<ExcalidrawElement, ExcalidrawSelectionElement>;
|
|
153
|
+
export type Ordered<TElement extends ExcalidrawElement> = TElement & {
|
|
154
|
+
index: FractionalIndex;
|
|
155
|
+
};
|
|
156
|
+
export type OrderedExcalidrawElement = Ordered<ExcalidrawElement>;
|
|
157
|
+
export type NonDeleted<TElement extends ExcalidrawElement> = TElement & {
|
|
158
|
+
isDeleted: boolean;
|
|
159
|
+
};
|
|
160
|
+
export type NonDeletedExcalidrawElement = NonDeleted<ExcalidrawElement>;
|
|
161
|
+
export type ExcalidrawTextElement = _ExcalidrawElementBase & Readonly<{
|
|
162
|
+
type: "text";
|
|
163
|
+
fontSize: number;
|
|
164
|
+
fontFamily: FontFamilyValues;
|
|
165
|
+
text: string;
|
|
166
|
+
rawText: string;
|
|
167
|
+
textAlign: TextAlign;
|
|
168
|
+
verticalAlign: VerticalAlign;
|
|
169
|
+
containerId: ExcalidrawGenericElement["id"] | null;
|
|
170
|
+
originalText: string;
|
|
171
|
+
/**
|
|
172
|
+
* If `true` the width will fit the text. If `false`, the text will
|
|
173
|
+
* wrap to fit the width.
|
|
174
|
+
*
|
|
175
|
+
* @default true
|
|
176
|
+
*/
|
|
177
|
+
autoResize: boolean;
|
|
178
|
+
/**
|
|
179
|
+
* Unitless line height (aligned to W3C). To get line height in px, multiply
|
|
180
|
+
* with font size (using `getLineHeightInPx` helper).
|
|
181
|
+
*/
|
|
182
|
+
lineHeight: number & {
|
|
183
|
+
_brand: "unitlessLineHeight";
|
|
184
|
+
};
|
|
185
|
+
}>;
|
|
186
|
+
export type ExcalidrawBindableElement = ExcalidrawRectangleElement | ExcalidrawDiamondElement | ExcalidrawEllipseElement | ExcalidrawTextElement | ExcalidrawImageElement | ExcalidrawIframeElement | ExcalidrawEmbeddableElement | ExcalidrawFrameElement | ExcalidrawMagicFrameElement;
|
|
187
|
+
export type ExcalidrawTextContainer = ExcalidrawRectangleElement | ExcalidrawDiamondElement | ExcalidrawEllipseElement | ExcalidrawArrowElement;
|
|
188
|
+
export type ExcalidrawTextElementWithContainer = {
|
|
189
|
+
containerId: ExcalidrawTextContainer["id"];
|
|
190
|
+
} & ExcalidrawTextElement;
|
|
191
|
+
export type FixedPoint = [number, number];
|
|
192
|
+
export type PointBinding = {
|
|
193
|
+
elementId: ExcalidrawBindableElement["id"];
|
|
194
|
+
focus: number;
|
|
195
|
+
gap: number;
|
|
196
|
+
fixedPoint: FixedPoint | null;
|
|
197
|
+
};
|
|
198
|
+
export type FixedPointBinding = Merge<PointBinding, {
|
|
199
|
+
fixedPoint: FixedPoint;
|
|
200
|
+
}>;
|
|
201
|
+
export type Arrowhead = "arrow" | "bar" | "dot" | "circle" | "circle_outline" | "triangle" | "triangle_outline" | "diamond" | "diamond_outline";
|
|
202
|
+
export type ExcalidrawLinearElement = _ExcalidrawElementBase & Readonly<{
|
|
203
|
+
type: "line" | "arrow";
|
|
204
|
+
points: readonly Point[];
|
|
205
|
+
lastCommittedPoint: Point | null;
|
|
206
|
+
startBinding: PointBinding | null;
|
|
207
|
+
endBinding: PointBinding | null;
|
|
208
|
+
startArrowhead: Arrowhead | null;
|
|
209
|
+
endArrowhead: Arrowhead | null;
|
|
210
|
+
}>;
|
|
211
|
+
export type ExcalidrawArrowElement = ExcalidrawLinearElement & Readonly<{
|
|
212
|
+
type: "arrow";
|
|
213
|
+
elbowed: boolean;
|
|
214
|
+
}>;
|
|
215
|
+
export type ExcalidrawElbowArrowElement = Merge<ExcalidrawArrowElement, {
|
|
216
|
+
elbowed: true;
|
|
217
|
+
startBinding: FixedPointBinding | null;
|
|
218
|
+
endBinding: FixedPointBinding | null;
|
|
219
|
+
}>;
|
|
220
|
+
export type ExcalidrawFreeDrawElement = _ExcalidrawElementBase & Readonly<{
|
|
221
|
+
type: "freedraw";
|
|
222
|
+
points: readonly Point[];
|
|
223
|
+
pressures: readonly number[];
|
|
224
|
+
simulatePressure: boolean;
|
|
225
|
+
lastCommittedPoint: Point | null;
|
|
226
|
+
}>;
|
|
227
|
+
export type FileId = string & {
|
|
228
|
+
_brand: "FileId";
|
|
229
|
+
};
|
|
230
|
+
export type ExcalidrawElementType = ExcalidrawElement["type"];
|
|
231
|
+
/**
|
|
232
|
+
* Map of excalidraw elements.
|
|
233
|
+
* Unspecified whether deleted or non-deleted.
|
|
234
|
+
* Can be a subset of Scene elements.
|
|
235
|
+
*/
|
|
236
|
+
export type ElementsMap = Map<ExcalidrawElement["id"], ExcalidrawElement>;
|
|
237
|
+
/**
|
|
238
|
+
* Map of non-deleted elements.
|
|
239
|
+
* Can be a subset of Scene elements.
|
|
240
|
+
*/
|
|
241
|
+
export type NonDeletedElementsMap = Map<ExcalidrawElement["id"], NonDeletedExcalidrawElement> & MakeBrand<"NonDeletedElementsMap">;
|
|
242
|
+
/**
|
|
243
|
+
* Map of all excalidraw Scene elements, including deleted.
|
|
244
|
+
* Not a subset. Use this type when you need access to current Scene elements.
|
|
245
|
+
*/
|
|
246
|
+
export type SceneElementsMap = Map<ExcalidrawElement["id"], Ordered<ExcalidrawElement>> & MakeBrand<"SceneElementsMap">;
|
|
247
|
+
/**
|
|
248
|
+
* Map of all non-deleted Scene elements.
|
|
249
|
+
* Not a subset. Use this type when you need access to current Scene elements.
|
|
250
|
+
*/
|
|
251
|
+
export type NonDeletedSceneElementsMap = Map<ExcalidrawElement["id"], Ordered<NonDeletedExcalidrawElement>> & MakeBrand<"NonDeletedSceneElementsMap">;
|
|
252
|
+
export type ElementsMapOrArray = readonly ExcalidrawElement[] | Readonly<ElementsMap>;
|
|
253
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { UnsubscribeCallback } from "./types";
|
|
2
|
+
type Subscriber<T extends any[]> = (...payload: T) => void;
|
|
3
|
+
export declare class Emitter<T extends any[] = []> {
|
|
4
|
+
subscribers: Subscriber<T>[];
|
|
5
|
+
/**
|
|
6
|
+
* Attaches subscriber
|
|
7
|
+
*
|
|
8
|
+
* @returns unsubscribe function
|
|
9
|
+
*/
|
|
10
|
+
on(...handlers: Subscriber<T>[] | Subscriber<T>[][]): UnsubscribeCallback;
|
|
11
|
+
once(...handlers: Subscriber<T>[] | Subscriber<T>[][]): UnsubscribeCallback;
|
|
12
|
+
off(...handlers: Subscriber<T>[] | Subscriber<T>[][]): void;
|
|
13
|
+
trigger(...payload: T): this;
|
|
14
|
+
clear(): void;
|
|
15
|
+
}
|
|
16
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./index";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function parseEnvVariables(filepath: any): {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function parseEnvVariables(filepath: any): {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
type CANVAS_ERROR_NAMES = "CANVAS_ERROR" | "CANVAS_POSSIBLY_TOO_BIG";
|
|
2
|
+
export declare class CanvasError extends Error {
|
|
3
|
+
constructor(message?: string, name?: CANVAS_ERROR_NAMES);
|
|
4
|
+
}
|
|
5
|
+
export declare class AbortError extends DOMException {
|
|
6
|
+
constructor(message?: string);
|
|
7
|
+
}
|
|
8
|
+
type ImageSceneDataErrorCode = "IMAGE_NOT_CONTAINS_SCENE_DATA" | "IMAGE_SCENE_DATA_ERROR";
|
|
9
|
+
export declare class ImageSceneDataError extends Error {
|
|
10
|
+
code: ImageSceneDataErrorCode;
|
|
11
|
+
constructor(message?: string, code?: ImageSceneDataErrorCode);
|
|
12
|
+
}
|
|
13
|
+
export declare class InvalidFractionalIndexError extends Error {
|
|
14
|
+
code: "ELEMENT_HAS_INVALID_INDEX";
|
|
15
|
+
}
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface Font {
|
|
2
|
+
urls: URL[];
|
|
3
|
+
fontFace: FontFace;
|
|
4
|
+
getContent(): Promise<string>;
|
|
5
|
+
}
|
|
6
|
+
export declare const UNPKG_PROD_URL: string;
|
|
7
|
+
export declare class ExcalidrawFont implements Font {
|
|
8
|
+
readonly urls: URL[];
|
|
9
|
+
readonly fontFace: FontFace;
|
|
10
|
+
constructor(family: string, uri: string, descriptors?: FontFaceDescriptors);
|
|
11
|
+
/**
|
|
12
|
+
* Tries to fetch woff2 content, based on the registered urls.
|
|
13
|
+
* Returns last defined url in case of errors.
|
|
14
|
+
*
|
|
15
|
+
* Note: uses browser APIs for base64 encoding - use dataurl outside the browser environment.
|
|
16
|
+
*/
|
|
17
|
+
getContent(): Promise<string>;
|
|
18
|
+
private static createUrls;
|
|
19
|
+
private static getFormat;
|
|
20
|
+
private static normalizeBaseUrl;
|
|
21
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import type Scene from "../scene/Scene";
|
|
2
|
+
import type { ValueOf } from "../utility-types";
|
|
3
|
+
import type { ExcalidrawElement, ExcalidrawTextElement, FontFamilyValues } from "../element/types";
|
|
4
|
+
import { FONT_FAMILY } from "../constants";
|
|
5
|
+
import { type FontMetadata } from "./metadata";
|
|
6
|
+
import { type Font } from "./ExcalidrawFont";
|
|
7
|
+
export declare class Fonts {
|
|
8
|
+
static readonly loadedFontsCache: Set<string>;
|
|
9
|
+
private static _registered;
|
|
10
|
+
private static _initialized;
|
|
11
|
+
static get registered(): Map<number, {
|
|
12
|
+
metadata: FontMetadata;
|
|
13
|
+
fonts: Font[];
|
|
14
|
+
}>;
|
|
15
|
+
get registered(): Map<number, {
|
|
16
|
+
metadata: FontMetadata;
|
|
17
|
+
fonts: Font[];
|
|
18
|
+
}>;
|
|
19
|
+
private readonly scene;
|
|
20
|
+
constructor({ scene }: {
|
|
21
|
+
scene: Scene;
|
|
22
|
+
});
|
|
23
|
+
/**
|
|
24
|
+
* if we load a (new) font, it's likely that text elements using it have
|
|
25
|
+
* already been rendered using a fallback font. Thus, we want invalidate
|
|
26
|
+
* their shapes and rerender. See #637.
|
|
27
|
+
*
|
|
28
|
+
* Invalidates text elements and rerenders scene, provided that at least one
|
|
29
|
+
* of the supplied fontFaces has not already been processed.
|
|
30
|
+
*/
|
|
31
|
+
onLoaded: (fontFaces: readonly FontFace[]) => false | undefined;
|
|
32
|
+
/**
|
|
33
|
+
* Load font faces for a given scene and trigger scene update.
|
|
34
|
+
*/
|
|
35
|
+
loadSceneFonts: () => Promise<FontFace[]>;
|
|
36
|
+
/**
|
|
37
|
+
* Gets all the font families for the given scene.
|
|
38
|
+
*/
|
|
39
|
+
getSceneFontFamilies: () => number[];
|
|
40
|
+
/**
|
|
41
|
+
* Load font faces for passed elements - use when the scene is unavailable (i.e. export).
|
|
42
|
+
*/
|
|
43
|
+
static loadFontsForElements: (elements: readonly ExcalidrawElement[]) => Promise<FontFace[]>;
|
|
44
|
+
private static loadFontFaces;
|
|
45
|
+
/**
|
|
46
|
+
* WARN: should be called just once on init, even across multiple instances.
|
|
47
|
+
*/
|
|
48
|
+
private static init;
|
|
49
|
+
private static getFontFamilies;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Register a new font.
|
|
53
|
+
*
|
|
54
|
+
* @param family font family
|
|
55
|
+
* @param metadata font metadata
|
|
56
|
+
* @param params array of the rest of the FontFace parameters [uri: string, descriptors: FontFaceDescriptors?] ,
|
|
57
|
+
*/
|
|
58
|
+
export declare function register(//zsviczian (changed from private to export)
|
|
59
|
+
this: Fonts | {
|
|
60
|
+
registered: Map<ValueOf<typeof FONT_FAMILY>, {
|
|
61
|
+
metadata: FontMetadata;
|
|
62
|
+
fonts: Font[];
|
|
63
|
+
}>;
|
|
64
|
+
}, family: string, metadata: FontMetadata, ...params: Array<{
|
|
65
|
+
uri: string;
|
|
66
|
+
descriptors?: FontFaceDescriptors;
|
|
67
|
+
}>): Map<number, {
|
|
68
|
+
metadata: FontMetadata;
|
|
69
|
+
fonts: Font[];
|
|
70
|
+
}> | Map<number, {
|
|
71
|
+
metadata: FontMetadata;
|
|
72
|
+
fonts: Font[];
|
|
73
|
+
}>;
|
|
74
|
+
/**
|
|
75
|
+
* Calculates vertical offset for a text with alphabetic baseline.
|
|
76
|
+
*/
|
|
77
|
+
export declare const getVerticalOffset: (fontFamily: ExcalidrawTextElement["fontFamily"], fontSize: ExcalidrawTextElement["fontSize"], lineHeightPx: number) => number;
|
|
78
|
+
/**
|
|
79
|
+
* Gets line height forr a selected family.
|
|
80
|
+
*/
|
|
81
|
+
export declare const getLineHeight: (fontFamily: FontFamilyValues) => number & {
|
|
82
|
+
_brand: "unitlessLineHeight";
|
|
83
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Encapsulates font metrics with additional font metadata.
|
|
3
|
+
* */
|
|
4
|
+
export interface FontMetadata {
|
|
5
|
+
/** for head & hhea metrics read the woff2 with https://fontdrop.info/ */
|
|
6
|
+
metrics: {
|
|
7
|
+
/** head.unitsPerEm metric */
|
|
8
|
+
unitsPerEm: 1000 | 1024 | 2048;
|
|
9
|
+
/** hhea.ascender metric */
|
|
10
|
+
ascender: number;
|
|
11
|
+
/** hhea.descender metric */
|
|
12
|
+
descender: number;
|
|
13
|
+
/** harcoded unitless line-height, https://github.com/excalidraw/excalidraw/pull/6360#issuecomment-1477635971 */
|
|
14
|
+
lineHeight: number;
|
|
15
|
+
};
|
|
16
|
+
/** element to be displayed as an icon */
|
|
17
|
+
icon: JSX.Element;
|
|
18
|
+
/** flag to indicate a deprecated font */
|
|
19
|
+
deprecated?: true;
|
|
20
|
+
/** flag to indicate a server-side only font */
|
|
21
|
+
serverSide?: true;
|
|
22
|
+
/** flag to indiccate a local-only font */
|
|
23
|
+
local?: true;
|
|
24
|
+
}
|
|
25
|
+
export declare const FONT_METADATA: Record<number, FontMetadata>;
|
|
26
|
+
/** Unicode ranges */
|
|
27
|
+
export declare const RANGES: {
|
|
28
|
+
LATIN: string;
|
|
29
|
+
LATIN_EXT: string;
|
|
30
|
+
CYRILIC_EXT: string;
|
|
31
|
+
CYRILIC: string;
|
|
32
|
+
VIETNAMESE: string;
|
|
33
|
+
};
|
|
34
|
+
/** local protocol to skip the local font from registering or inlining */
|
|
35
|
+
export declare const LOCAL_FONT_PROTOCOL = "local:";
|