tldraw 3.16.0-internal.a478398270c6 → 3.16.0-internal.f8b97f0c414f
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-cjs/index.d.ts +471 -130
- package/dist-cjs/index.js +58 -15
- package/dist-cjs/index.js.map +2 -2
- package/dist-cjs/lib/Tldraw.js +12 -2
- package/dist-cjs/lib/Tldraw.js.map +2 -2
- package/dist-cjs/lib/TldrawImage.js +5 -2
- package/dist-cjs/lib/TldrawImage.js.map +3 -3
- package/dist-cjs/lib/canvas/TldrawCropHandles.js +1 -1
- package/dist-cjs/lib/canvas/TldrawCropHandles.js.map +2 -2
- package/dist-cjs/lib/canvas/TldrawHandles.js +1 -1
- package/dist-cjs/lib/canvas/TldrawHandles.js.map +2 -2
- package/dist-cjs/lib/canvas/TldrawOverlays.js +1 -1
- package/dist-cjs/lib/canvas/TldrawOverlays.js.map +2 -2
- package/dist-cjs/lib/canvas/TldrawScribble.js +1 -1
- package/dist-cjs/lib/canvas/TldrawScribble.js.map +2 -2
- package/dist-cjs/lib/canvas/TldrawSelectionForeground.js +279 -271
- package/dist-cjs/lib/canvas/TldrawSelectionForeground.js.map +2 -2
- package/dist-cjs/lib/defaultExternalContentHandlers.js +6 -4
- package/dist-cjs/lib/defaultExternalContentHandlers.js.map +2 -2
- package/dist-cjs/lib/shapes/arrow/ArrowShapeUtil.js +27 -44
- package/dist-cjs/lib/shapes/arrow/ArrowShapeUtil.js.map +2 -2
- package/dist-cjs/lib/shapes/arrow/arrowLabel.js +22 -4
- package/dist-cjs/lib/shapes/arrow/arrowLabel.js.map +3 -3
- package/dist-cjs/lib/shapes/arrow/arrowTargetState.js +1 -1
- package/dist-cjs/lib/shapes/arrow/arrowTargetState.js.map +2 -2
- package/dist-cjs/lib/shapes/arrow/elbow/ElbowArrowDebug.js +3 -3
- package/dist-cjs/lib/shapes/arrow/elbow/ElbowArrowDebug.js.map +1 -1
- package/dist-cjs/lib/shapes/arrow/elbow/elbowArrowSnapLines.js.map +1 -1
- package/dist-cjs/lib/shapes/arrow/toolStates/Pointing.js +3 -0
- package/dist-cjs/lib/shapes/arrow/toolStates/Pointing.js.map +2 -2
- package/dist-cjs/lib/shapes/bookmark/BookmarkShapeUtil.js +4 -4
- package/dist-cjs/lib/shapes/bookmark/BookmarkShapeUtil.js.map +2 -2
- package/dist-cjs/lib/shapes/draw/DrawShapeUtil.js +3 -6
- package/dist-cjs/lib/shapes/draw/DrawShapeUtil.js.map +2 -2
- package/dist-cjs/lib/shapes/embed/EmbedShapeUtil.js +1 -1
- package/dist-cjs/lib/shapes/embed/EmbedShapeUtil.js.map +1 -1
- package/dist-cjs/lib/shapes/frame/FrameShapeTool.js.map +1 -1
- package/dist-cjs/lib/shapes/frame/FrameShapeUtil.js +25 -18
- package/dist-cjs/lib/shapes/frame/FrameShapeUtil.js.map +2 -2
- package/dist-cjs/lib/shapes/frame/components/FrameHeading.js +1 -1
- package/dist-cjs/lib/shapes/frame/components/FrameHeading.js.map +2 -2
- package/dist-cjs/lib/shapes/frame/components/FrameLabelInput.js +2 -2
- package/dist-cjs/lib/shapes/frame/components/FrameLabelInput.js.map +2 -2
- package/dist-cjs/lib/shapes/geo/GeoShapeUtil.js +3 -2
- package/dist-cjs/lib/shapes/geo/GeoShapeUtil.js.map +2 -2
- package/dist-cjs/lib/shapes/geo/components/GeoShapeBody.js +2 -1
- package/dist-cjs/lib/shapes/geo/components/GeoShapeBody.js.map +2 -2
- package/dist-cjs/lib/shapes/highlight/HighlightShapeUtil.js +5 -4
- package/dist-cjs/lib/shapes/highlight/HighlightShapeUtil.js.map +2 -2
- package/dist-cjs/lib/shapes/image/ImageShapeUtil.js +6 -3
- package/dist-cjs/lib/shapes/image/ImageShapeUtil.js.map +2 -2
- package/dist-cjs/lib/shapes/line/LineShapeUtil.js +20 -5
- package/dist-cjs/lib/shapes/line/LineShapeUtil.js.map +2 -2
- package/dist-cjs/lib/shapes/note/NoteShapeUtil.js +8 -6
- package/dist-cjs/lib/shapes/note/NoteShapeUtil.js.map +2 -2
- package/dist-cjs/lib/shapes/shared/HyperlinkButton.js +4 -4
- package/dist-cjs/lib/shapes/shared/HyperlinkButton.js.map +2 -2
- package/dist-cjs/lib/shapes/shared/PathBuilder.js +21 -3
- package/dist-cjs/lib/shapes/shared/PathBuilder.js.map +2 -2
- package/dist-cjs/lib/shapes/shared/PlainTextLabel.js +2 -3
- package/dist-cjs/lib/shapes/shared/PlainTextLabel.js.map +2 -2
- package/dist-cjs/lib/shapes/shared/RichTextLabel.js +5 -2
- package/dist-cjs/lib/shapes/shared/RichTextLabel.js.map +2 -2
- package/dist-cjs/lib/shapes/shared/ShapeFill.js +4 -4
- package/dist-cjs/lib/shapes/shared/ShapeFill.js.map +2 -2
- package/dist-cjs/lib/shapes/shared/SvgTextLabel.js +4 -3
- package/dist-cjs/lib/shapes/shared/SvgTextLabel.js.map +2 -2
- package/dist-cjs/lib/shapes/shared/crop.js +1 -0
- package/dist-cjs/lib/shapes/shared/crop.js.map +2 -2
- package/dist-cjs/lib/shapes/shared/freehand/svg.js.map +2 -2
- package/dist-cjs/lib/shapes/shared/useEditablePlainText.js +3 -4
- package/dist-cjs/lib/shapes/shared/useEditablePlainText.js.map +2 -2
- package/dist-cjs/lib/shapes/shared/useEditableRichText.js.map +2 -2
- package/dist-cjs/lib/shapes/shared/useImageOrVideoAsset.js +0 -2
- package/dist-cjs/lib/shapes/shared/useImageOrVideoAsset.js.map +2 -2
- package/dist-cjs/lib/shapes/shared/usePrefersReducedMotion.js +10 -1
- package/dist-cjs/lib/shapes/shared/usePrefersReducedMotion.js.map +2 -2
- package/dist-cjs/lib/shapes/text/PlainTextArea.js +2 -2
- package/dist-cjs/lib/shapes/text/PlainTextArea.js.map +2 -2
- package/dist-cjs/lib/shapes/text/RichTextArea.js +3 -3
- package/dist-cjs/lib/shapes/text/RichTextArea.js.map +2 -2
- package/dist-cjs/lib/shapes/text/TextShapeUtil.js +7 -13
- package/dist-cjs/lib/shapes/text/TextShapeUtil.js.map +2 -2
- package/dist-cjs/lib/shapes/video/VideoShapeUtil.js +3 -3
- package/dist-cjs/lib/shapes/video/VideoShapeUtil.js.map +1 -1
- package/dist-cjs/lib/styles.js.map +2 -2
- package/dist-cjs/lib/tools/EraserTool/childStates/Erasing.js +25 -1
- package/dist-cjs/lib/tools/EraserTool/childStates/Erasing.js.map +2 -2
- package/dist-cjs/lib/tools/EraserTool/childStates/Pointing.js +12 -0
- package/dist-cjs/lib/tools/EraserTool/childStates/Pointing.js.map +2 -2
- package/dist-cjs/lib/tools/SelectTool/childStates/Crop/children/PointingCrop.js +7 -1
- package/dist-cjs/lib/tools/SelectTool/childStates/Crop/children/PointingCrop.js.map +2 -2
- package/dist-cjs/lib/tools/SelectTool/childStates/DraggingHandle.js +43 -22
- package/dist-cjs/lib/tools/SelectTool/childStates/DraggingHandle.js.map +2 -2
- package/dist-cjs/lib/tools/SelectTool/childStates/Idle.js +2 -15
- package/dist-cjs/lib/tools/SelectTool/childStates/Idle.js.map +2 -2
- package/dist-cjs/lib/tools/SelectTool/childStates/PointingShape.js +5 -0
- package/dist-cjs/lib/tools/SelectTool/childStates/PointingShape.js.map +2 -2
- package/dist-cjs/lib/tools/SelectTool/childStates/Resizing.js +8 -0
- package/dist-cjs/lib/tools/SelectTool/childStates/Resizing.js.map +2 -2
- package/dist-cjs/lib/tools/SelectTool/childStates/Rotating.js +8 -0
- package/dist-cjs/lib/tools/SelectTool/childStates/Rotating.js.map +2 -2
- package/dist-cjs/lib/tools/SelectTool/childStates/Translating.js +8 -0
- package/dist-cjs/lib/tools/SelectTool/childStates/Translating.js.map +2 -2
- package/dist-cjs/lib/tools/selection-logic/getHitShapeOnCanvasPointerDown.js.map +2 -2
- package/dist-cjs/lib/ui/TldrawUi.js +27 -12
- package/dist-cjs/lib/ui/TldrawUi.js.map +3 -3
- package/dist-cjs/lib/ui/components/A11y.js +15 -13
- package/dist-cjs/lib/ui/components/A11y.js.map +2 -2
- package/dist-cjs/lib/ui/components/AccessibilityMenu.js +35 -0
- package/dist-cjs/lib/ui/components/AccessibilityMenu.js.map +7 -0
- package/dist-cjs/lib/ui/components/ActionsMenu/DefaultActionsMenu.js +12 -3
- package/dist-cjs/lib/ui/components/ActionsMenu/DefaultActionsMenu.js.map +2 -2
- package/dist-cjs/lib/ui/components/{FollowingIndicator.js → DefaultFollowingIndicator.js} +6 -6
- package/dist-cjs/lib/ui/components/DefaultFollowingIndicator.js.map +7 -0
- package/dist-cjs/lib/ui/components/DefaultMenuPanel.js +3 -2
- package/dist-cjs/lib/ui/components/DefaultMenuPanel.js.map +2 -2
- package/dist-cjs/lib/ui/components/EditLinkDialog.js +11 -1
- package/dist-cjs/lib/ui/components/EditLinkDialog.js.map +2 -2
- package/dist-cjs/lib/ui/components/KeyboardShortcutsDialog/DefaultKeyboardShortcutsDialogContent.js +57 -7
- package/dist-cjs/lib/ui/components/KeyboardShortcutsDialog/DefaultKeyboardShortcutsDialogContent.js.map +2 -2
- package/dist-cjs/lib/ui/components/MainMenu/DefaultMainMenuContent.js +3 -2
- package/dist-cjs/lib/ui/components/MainMenu/DefaultMainMenuContent.js.map +2 -2
- package/dist-cjs/lib/ui/components/Minimap/MinimapManager.js +4 -4
- package/dist-cjs/lib/ui/components/Minimap/MinimapManager.js.map +2 -2
- package/dist-cjs/lib/ui/components/MobileStylePanel.js +5 -3
- package/dist-cjs/lib/ui/components/MobileStylePanel.js.map +2 -2
- package/dist-cjs/lib/ui/components/NavigationPanel/DefaultNavigationPanel.js +4 -5
- package/dist-cjs/lib/ui/components/NavigationPanel/DefaultNavigationPanel.js.map +2 -2
- package/dist-cjs/lib/ui/components/PageMenu/DefaultPageMenu.js +3 -2
- package/dist-cjs/lib/ui/components/PageMenu/DefaultPageMenu.js.map +2 -2
- package/dist-cjs/lib/ui/components/SharePanel/PeopleMenuItem.js +3 -2
- package/dist-cjs/lib/ui/components/SharePanel/PeopleMenuItem.js.map +2 -2
- package/dist-cjs/lib/ui/components/SharePanel/UserPresenceColorPicker.js +2 -2
- package/dist-cjs/lib/ui/components/SharePanel/UserPresenceColorPicker.js.map +2 -2
- package/dist-cjs/lib/ui/components/Spinner.js +2 -25
- package/dist-cjs/lib/ui/components/Spinner.js.map +2 -2
- package/dist-cjs/lib/ui/components/StylePanel/DefaultStylePanel.js +11 -4
- package/dist-cjs/lib/ui/components/StylePanel/DefaultStylePanel.js.map +2 -2
- package/dist-cjs/lib/ui/components/StylePanel/DefaultStylePanelContent.js +249 -278
- package/dist-cjs/lib/ui/components/StylePanel/DefaultStylePanelContent.js.map +2 -2
- package/dist-cjs/lib/ui/components/{primitives/TldrawUiButtonPicker.js → StylePanel/StylePanelButtonPicker.js} +52 -54
- package/dist-cjs/lib/ui/components/StylePanel/StylePanelButtonPicker.js.map +7 -0
- package/dist-cjs/lib/ui/components/StylePanel/StylePanelContext.js +68 -0
- package/dist-cjs/lib/ui/components/StylePanel/StylePanelContext.js.map +7 -0
- package/dist-cjs/lib/ui/components/StylePanel/{DoubleDropdownPicker.js → StylePanelDoubleDropdownPicker.js} +26 -25
- package/dist-cjs/lib/ui/components/StylePanel/StylePanelDoubleDropdownPicker.js.map +7 -0
- package/dist-cjs/lib/ui/components/StylePanel/{DropdownPicker.js → StylePanelDropdownPicker.js} +47 -43
- package/dist-cjs/lib/ui/components/StylePanel/StylePanelDropdownPicker.js.map +7 -0
- package/dist-cjs/lib/ui/components/StylePanel/StylePanelSubheading.js +28 -0
- package/dist-cjs/lib/ui/components/StylePanel/StylePanelSubheading.js.map +7 -0
- package/dist-cjs/lib/ui/components/Toolbar/AltTextEditor.js +3 -2
- package/dist-cjs/lib/ui/components/Toolbar/AltTextEditor.js.map +2 -2
- package/dist-cjs/lib/ui/components/Toolbar/DefaultImageToolbar.js +21 -7
- package/dist-cjs/lib/ui/components/Toolbar/DefaultImageToolbar.js.map +3 -3
- package/dist-cjs/lib/ui/components/Toolbar/DefaultImageToolbarContent.js +39 -10
- package/dist-cjs/lib/ui/components/Toolbar/DefaultImageToolbarContent.js.map +2 -2
- package/dist-cjs/lib/ui/components/Toolbar/DefaultToolbar.js +66 -21
- package/dist-cjs/lib/ui/components/Toolbar/DefaultToolbar.js.map +3 -3
- package/dist-cjs/lib/ui/components/Toolbar/DefaultVideoToolbarContent.js +15 -3
- package/dist-cjs/lib/ui/components/Toolbar/DefaultVideoToolbarContent.js.map +2 -2
- package/dist-cjs/lib/ui/components/Toolbar/LinkEditor.js +3 -3
- package/dist-cjs/lib/ui/components/Toolbar/LinkEditor.js.map +2 -2
- package/dist-cjs/lib/ui/components/Toolbar/OverflowingToolbar.js +189 -80
- package/dist-cjs/lib/ui/components/Toolbar/OverflowingToolbar.js.map +3 -3
- package/dist-cjs/lib/ui/components/Toolbar/ToggleToolLockedButton.js +5 -4
- package/dist-cjs/lib/ui/components/Toolbar/ToggleToolLockedButton.js.map +2 -2
- package/dist-cjs/lib/ui/components/menu-items.js +22 -0
- package/dist-cjs/lib/ui/components/menu-items.js.map +2 -2
- package/dist-cjs/lib/ui/components/primitives/Button/TldrawUiButtonIcon.js.map +2 -2
- package/dist-cjs/lib/ui/components/primitives/TldrawUiContextualToolbar.js +11 -2
- package/dist-cjs/lib/ui/components/primitives/TldrawUiContextualToolbar.js.map +2 -2
- package/dist-cjs/lib/ui/components/primitives/TldrawUiDialog.js +1 -1
- package/dist-cjs/lib/ui/components/primitives/TldrawUiDialog.js.map +2 -2
- package/dist-cjs/lib/ui/components/primitives/TldrawUiIcon.js +35 -1
- package/dist-cjs/lib/ui/components/primitives/TldrawUiIcon.js.map +2 -2
- package/dist-cjs/lib/ui/components/primitives/TldrawUiInput.js +2 -2
- package/dist-cjs/lib/ui/components/primitives/TldrawUiInput.js.map +2 -2
- package/dist-cjs/lib/ui/components/primitives/TldrawUiPopover.js +3 -2
- package/dist-cjs/lib/ui/components/primitives/TldrawUiPopover.js.map +3 -3
- package/dist-cjs/lib/ui/components/primitives/TldrawUiSlider.js +23 -6
- package/dist-cjs/lib/ui/components/primitives/TldrawUiSlider.js.map +2 -2
- package/dist-cjs/lib/ui/components/primitives/TldrawUiToolbar.js +33 -7
- package/dist-cjs/lib/ui/components/primitives/TldrawUiToolbar.js.map +2 -2
- package/dist-cjs/lib/ui/components/primitives/TldrawUiTooltip.js +294 -0
- package/dist-cjs/lib/ui/components/primitives/TldrawUiTooltip.js.map +7 -0
- package/dist-cjs/lib/ui/components/primitives/layout.js +76 -0
- package/dist-cjs/lib/ui/components/primitives/layout.js.map +7 -0
- package/dist-cjs/lib/ui/components/primitives/menus/TldrawUiMenuCheckboxItem.js.map +2 -2
- package/dist-cjs/lib/ui/components/primitives/menus/TldrawUiMenuContext.js.map +2 -2
- package/dist-cjs/lib/ui/components/primitives/menus/TldrawUiMenuGroup.js +25 -12
- package/dist-cjs/lib/ui/components/primitives/menus/TldrawUiMenuGroup.js.map +2 -2
- package/dist-cjs/lib/ui/components/primitives/menus/TldrawUiMenuItem.js +154 -22
- package/dist-cjs/lib/ui/components/primitives/menus/TldrawUiMenuItem.js.map +2 -2
- package/dist-cjs/lib/ui/context/TldrawUiContextProvider.js +3 -2
- package/dist-cjs/lib/ui/context/TldrawUiContextProvider.js.map +2 -2
- package/dist-cjs/lib/ui/context/actions.js +79 -17
- package/dist-cjs/lib/ui/context/actions.js.map +2 -2
- package/dist-cjs/lib/ui/context/components.js +2 -0
- package/dist-cjs/lib/ui/context/components.js.map +2 -2
- package/dist-cjs/lib/ui/context/events.js.map +2 -2
- package/dist-cjs/lib/ui/hooks/menu-hooks.js.map +2 -2
- package/dist-cjs/lib/ui/hooks/useClipboardEvents.js +1 -1
- package/dist-cjs/lib/ui/hooks/useClipboardEvents.js.map +2 -2
- package/dist-cjs/lib/ui/hooks/useExportAs.js +3 -2
- package/dist-cjs/lib/ui/hooks/useExportAs.js.map +2 -2
- package/dist-cjs/lib/ui/hooks/useKeyboardShortcuts.js +2 -2
- package/dist-cjs/lib/ui/hooks/useKeyboardShortcuts.js.map +2 -2
- package/dist-cjs/lib/ui/hooks/useTools.js +94 -9
- package/dist-cjs/lib/ui/hooks/useTools.js.map +2 -2
- package/dist-cjs/lib/ui/hooks/useTranslation/TLUiTranslationKey.js.map +1 -1
- package/dist-cjs/lib/ui/hooks/useTranslation/defaultTranslation.js +13 -0
- package/dist-cjs/lib/ui/hooks/useTranslation/defaultTranslation.js.map +2 -2
- package/dist-cjs/lib/ui/kbd-utils.js +11 -4
- package/dist-cjs/lib/ui/kbd-utils.js.map +2 -2
- package/dist-cjs/lib/ui/version.js +3 -3
- package/dist-cjs/lib/ui/version.js.map +1 -1
- package/dist-cjs/lib/utils/excalidraw/putExcalidrawContent.js +1 -1
- package/dist-cjs/lib/utils/excalidraw/putExcalidrawContent.js.map +2 -2
- package/dist-cjs/lib/utils/export/copyAs.js +1 -2
- package/dist-cjs/lib/utils/export/copyAs.js.map +2 -2
- package/dist-cjs/lib/utils/export/export.js +0 -20
- package/dist-cjs/lib/utils/export/export.js.map +2 -2
- package/dist-cjs/lib/utils/export/exportAs.js +1 -2
- package/dist-cjs/lib/utils/export/exportAs.js.map +2 -2
- package/dist-cjs/lib/utils/tldr/buildFromV1Document.js +3 -2
- package/dist-cjs/lib/utils/tldr/buildFromV1Document.js.map +2 -2
- package/dist-esm/index.d.mts +471 -130
- package/dist-esm/index.mjs +107 -32
- package/dist-esm/index.mjs.map +2 -2
- package/dist-esm/lib/Tldraw.mjs +14 -4
- package/dist-esm/lib/Tldraw.mjs.map +2 -2
- package/dist-esm/lib/TldrawImage.mjs +5 -2
- package/dist-esm/lib/TldrawImage.mjs.map +2 -2
- package/dist-esm/lib/canvas/TldrawCropHandles.mjs +1 -1
- package/dist-esm/lib/canvas/TldrawCropHandles.mjs.map +2 -2
- package/dist-esm/lib/canvas/TldrawHandles.mjs +1 -1
- package/dist-esm/lib/canvas/TldrawHandles.mjs.map +2 -2
- package/dist-esm/lib/canvas/TldrawOverlays.mjs +1 -1
- package/dist-esm/lib/canvas/TldrawOverlays.mjs.map +2 -2
- package/dist-esm/lib/canvas/TldrawScribble.mjs +1 -1
- package/dist-esm/lib/canvas/TldrawScribble.mjs.map +2 -2
- package/dist-esm/lib/canvas/TldrawSelectionForeground.mjs +279 -271
- package/dist-esm/lib/canvas/TldrawSelectionForeground.mjs.map +2 -2
- package/dist-esm/lib/defaultExternalContentHandlers.mjs +6 -4
- package/dist-esm/lib/defaultExternalContentHandlers.mjs.map +2 -2
- package/dist-esm/lib/shapes/arrow/ArrowShapeUtil.mjs +30 -44
- package/dist-esm/lib/shapes/arrow/ArrowShapeUtil.mjs.map +2 -2
- package/dist-esm/lib/shapes/arrow/arrowLabel.mjs +25 -5
- package/dist-esm/lib/shapes/arrow/arrowLabel.mjs.map +3 -3
- package/dist-esm/lib/shapes/arrow/arrowTargetState.mjs +1 -1
- package/dist-esm/lib/shapes/arrow/arrowTargetState.mjs.map +2 -2
- package/dist-esm/lib/shapes/arrow/elbow/ElbowArrowDebug.mjs +3 -3
- package/dist-esm/lib/shapes/arrow/elbow/ElbowArrowDebug.mjs.map +1 -1
- package/dist-esm/lib/shapes/arrow/elbow/elbowArrowSnapLines.mjs.map +1 -1
- package/dist-esm/lib/shapes/arrow/toolStates/Pointing.mjs +3 -0
- package/dist-esm/lib/shapes/arrow/toolStates/Pointing.mjs.map +2 -2
- package/dist-esm/lib/shapes/bookmark/BookmarkShapeUtil.mjs +5 -5
- package/dist-esm/lib/shapes/bookmark/BookmarkShapeUtil.mjs.map +2 -2
- package/dist-esm/lib/shapes/draw/DrawShapeUtil.mjs +4 -6
- package/dist-esm/lib/shapes/draw/DrawShapeUtil.mjs.map +2 -2
- package/dist-esm/lib/shapes/embed/EmbedShapeUtil.mjs +1 -1
- package/dist-esm/lib/shapes/embed/EmbedShapeUtil.mjs.map +1 -1
- package/dist-esm/lib/shapes/frame/FrameShapeTool.mjs.map +1 -1
- package/dist-esm/lib/shapes/frame/FrameShapeUtil.mjs +26 -18
- package/dist-esm/lib/shapes/frame/FrameShapeUtil.mjs.map +2 -2
- package/dist-esm/lib/shapes/frame/components/FrameHeading.mjs +1 -1
- package/dist-esm/lib/shapes/frame/components/FrameHeading.mjs.map +2 -2
- package/dist-esm/lib/shapes/frame/components/FrameLabelInput.mjs +3 -3
- package/dist-esm/lib/shapes/frame/components/FrameLabelInput.mjs.map +2 -2
- package/dist-esm/lib/shapes/geo/GeoShapeUtil.mjs +4 -2
- package/dist-esm/lib/shapes/geo/GeoShapeUtil.mjs.map +2 -2
- package/dist-esm/lib/shapes/geo/components/GeoShapeBody.mjs +2 -1
- package/dist-esm/lib/shapes/geo/components/GeoShapeBody.mjs.map +2 -2
- package/dist-esm/lib/shapes/highlight/HighlightShapeUtil.mjs +6 -4
- package/dist-esm/lib/shapes/highlight/HighlightShapeUtil.mjs.map +2 -2
- package/dist-esm/lib/shapes/image/ImageShapeUtil.mjs +6 -3
- package/dist-esm/lib/shapes/image/ImageShapeUtil.mjs.map +2 -2
- package/dist-esm/lib/shapes/line/LineShapeUtil.mjs +21 -5
- package/dist-esm/lib/shapes/line/LineShapeUtil.mjs.map +2 -2
- package/dist-esm/lib/shapes/note/NoteShapeUtil.mjs +9 -6
- package/dist-esm/lib/shapes/note/NoteShapeUtil.mjs.map +2 -2
- package/dist-esm/lib/shapes/shared/HyperlinkButton.mjs +5 -5
- package/dist-esm/lib/shapes/shared/HyperlinkButton.mjs.map +2 -2
- package/dist-esm/lib/shapes/shared/PathBuilder.mjs +22 -3
- package/dist-esm/lib/shapes/shared/PathBuilder.mjs.map +2 -2
- package/dist-esm/lib/shapes/shared/PlainTextLabel.mjs +2 -3
- package/dist-esm/lib/shapes/shared/PlainTextLabel.mjs.map +2 -2
- package/dist-esm/lib/shapes/shared/RichTextLabel.mjs +5 -2
- package/dist-esm/lib/shapes/shared/RichTextLabel.mjs.map +2 -2
- package/dist-esm/lib/shapes/shared/ShapeFill.mjs +5 -4
- package/dist-esm/lib/shapes/shared/ShapeFill.mjs.map +2 -2
- package/dist-esm/lib/shapes/shared/SvgTextLabel.mjs +4 -3
- package/dist-esm/lib/shapes/shared/SvgTextLabel.mjs.map +2 -2
- package/dist-esm/lib/shapes/shared/crop.mjs +1 -0
- package/dist-esm/lib/shapes/shared/crop.mjs.map +2 -2
- package/dist-esm/lib/shapes/shared/freehand/svg.mjs.map +2 -2
- package/dist-esm/lib/shapes/shared/useEditablePlainText.mjs +4 -5
- package/dist-esm/lib/shapes/shared/useEditablePlainText.mjs.map +2 -2
- package/dist-esm/lib/shapes/shared/useEditableRichText.mjs.map +2 -2
- package/dist-esm/lib/shapes/shared/useImageOrVideoAsset.mjs +0 -2
- package/dist-esm/lib/shapes/shared/useImageOrVideoAsset.mjs.map +2 -2
- package/dist-esm/lib/shapes/shared/usePrefersReducedMotion.mjs +10 -1
- package/dist-esm/lib/shapes/shared/usePrefersReducedMotion.mjs.map +2 -2
- package/dist-esm/lib/shapes/text/PlainTextArea.mjs +3 -3
- package/dist-esm/lib/shapes/text/PlainTextArea.mjs.map +2 -2
- package/dist-esm/lib/shapes/text/RichTextArea.mjs +3 -4
- package/dist-esm/lib/shapes/text/RichTextArea.mjs.map +2 -2
- package/dist-esm/lib/shapes/text/TextShapeUtil.mjs +8 -13
- package/dist-esm/lib/shapes/text/TextShapeUtil.mjs.map +2 -2
- package/dist-esm/lib/shapes/video/VideoShapeUtil.mjs +3 -3
- package/dist-esm/lib/shapes/video/VideoShapeUtil.mjs.map +1 -1
- package/dist-esm/lib/styles.mjs.map +2 -2
- package/dist-esm/lib/tools/EraserTool/childStates/Erasing.mjs +26 -1
- package/dist-esm/lib/tools/EraserTool/childStates/Erasing.mjs.map +2 -2
- package/dist-esm/lib/tools/EraserTool/childStates/Pointing.mjs +13 -0
- package/dist-esm/lib/tools/EraserTool/childStates/Pointing.mjs.map +2 -2
- package/dist-esm/lib/tools/SelectTool/childStates/Crop/children/PointingCrop.mjs +7 -1
- package/dist-esm/lib/tools/SelectTool/childStates/Crop/children/PointingCrop.mjs.map +2 -2
- package/dist-esm/lib/tools/SelectTool/childStates/DraggingHandle.mjs +43 -22
- package/dist-esm/lib/tools/SelectTool/childStates/DraggingHandle.mjs.map +2 -2
- package/dist-esm/lib/tools/SelectTool/childStates/Idle.mjs +2 -15
- package/dist-esm/lib/tools/SelectTool/childStates/Idle.mjs.map +2 -2
- package/dist-esm/lib/tools/SelectTool/childStates/PointingShape.mjs +5 -0
- package/dist-esm/lib/tools/SelectTool/childStates/PointingShape.mjs.map +2 -2
- package/dist-esm/lib/tools/SelectTool/childStates/Resizing.mjs +8 -0
- package/dist-esm/lib/tools/SelectTool/childStates/Resizing.mjs.map +2 -2
- package/dist-esm/lib/tools/SelectTool/childStates/Rotating.mjs +8 -0
- package/dist-esm/lib/tools/SelectTool/childStates/Rotating.mjs.map +2 -2
- package/dist-esm/lib/tools/SelectTool/childStates/Translating.mjs +8 -0
- package/dist-esm/lib/tools/SelectTool/childStates/Translating.mjs.map +2 -2
- package/dist-esm/lib/tools/selection-logic/getHitShapeOnCanvasPointerDown.mjs.map +2 -2
- package/dist-esm/lib/ui/TldrawUi.mjs +29 -14
- package/dist-esm/lib/ui/TldrawUi.mjs.map +3 -3
- package/dist-esm/lib/ui/components/A11y.mjs +16 -14
- package/dist-esm/lib/ui/components/A11y.mjs.map +2 -2
- package/dist-esm/lib/ui/components/AccessibilityMenu.mjs +19 -0
- package/dist-esm/lib/ui/components/AccessibilityMenu.mjs.map +7 -0
- package/dist-esm/lib/ui/components/ActionsMenu/DefaultActionsMenu.mjs +12 -3
- package/dist-esm/lib/ui/components/ActionsMenu/DefaultActionsMenu.mjs.map +2 -2
- package/dist-esm/lib/ui/components/{FollowingIndicator.mjs → DefaultFollowingIndicator.mjs} +3 -3
- package/dist-esm/lib/ui/components/DefaultFollowingIndicator.mjs.map +7 -0
- package/dist-esm/lib/ui/components/DefaultMenuPanel.mjs +3 -2
- package/dist-esm/lib/ui/components/DefaultMenuPanel.mjs.map +2 -2
- package/dist-esm/lib/ui/components/EditLinkDialog.mjs +11 -1
- package/dist-esm/lib/ui/components/EditLinkDialog.mjs.map +2 -2
- package/dist-esm/lib/ui/components/KeyboardShortcutsDialog/DefaultKeyboardShortcutsDialogContent.mjs +57 -7
- package/dist-esm/lib/ui/components/KeyboardShortcutsDialog/DefaultKeyboardShortcutsDialogContent.mjs.map +2 -2
- package/dist-esm/lib/ui/components/MainMenu/DefaultMainMenuContent.mjs +3 -3
- package/dist-esm/lib/ui/components/MainMenu/DefaultMainMenuContent.mjs.map +2 -2
- package/dist-esm/lib/ui/components/Minimap/MinimapManager.mjs +4 -4
- package/dist-esm/lib/ui/components/Minimap/MinimapManager.mjs.map +2 -2
- package/dist-esm/lib/ui/components/MobileStylePanel.mjs +6 -3
- package/dist-esm/lib/ui/components/MobileStylePanel.mjs.map +2 -2
- package/dist-esm/lib/ui/components/NavigationPanel/DefaultNavigationPanel.mjs +4 -5
- package/dist-esm/lib/ui/components/NavigationPanel/DefaultNavigationPanel.mjs.map +2 -2
- package/dist-esm/lib/ui/components/PageMenu/DefaultPageMenu.mjs +4 -3
- package/dist-esm/lib/ui/components/PageMenu/DefaultPageMenu.mjs.map +2 -2
- package/dist-esm/lib/ui/components/SharePanel/PeopleMenuItem.mjs +3 -2
- package/dist-esm/lib/ui/components/SharePanel/PeopleMenuItem.mjs.map +2 -2
- package/dist-esm/lib/ui/components/SharePanel/UserPresenceColorPicker.mjs +2 -2
- package/dist-esm/lib/ui/components/SharePanel/UserPresenceColorPicker.mjs.map +2 -2
- package/dist-esm/lib/ui/components/Spinner.mjs +3 -26
- package/dist-esm/lib/ui/components/Spinner.mjs.map +2 -2
- package/dist-esm/lib/ui/components/StylePanel/DefaultStylePanel.mjs +16 -5
- package/dist-esm/lib/ui/components/StylePanel/DefaultStylePanel.mjs.map +2 -2
- package/dist-esm/lib/ui/components/StylePanel/DefaultStylePanelContent.mjs +251 -282
- package/dist-esm/lib/ui/components/StylePanel/DefaultStylePanelContent.mjs.map +2 -2
- package/dist-esm/lib/ui/components/StylePanel/StylePanelButtonPicker.mjs +126 -0
- package/dist-esm/lib/ui/components/StylePanel/StylePanelButtonPicker.mjs.map +7 -0
- package/dist-esm/lib/ui/components/StylePanel/StylePanelContext.mjs +48 -0
- package/dist-esm/lib/ui/components/StylePanel/StylePanelContext.mjs.map +7 -0
- package/dist-esm/lib/ui/components/StylePanel/{DoubleDropdownPicker.mjs → StylePanelDoubleDropdownPicker.mjs} +23 -22
- package/dist-esm/lib/ui/components/StylePanel/StylePanelDoubleDropdownPicker.mjs.map +7 -0
- package/dist-esm/lib/ui/components/StylePanel/{DropdownPicker.mjs → StylePanelDropdownPicker.mjs} +44 -40
- package/dist-esm/lib/ui/components/StylePanel/StylePanelDropdownPicker.mjs.map +7 -0
- package/dist-esm/lib/ui/components/StylePanel/StylePanelSubheading.mjs +8 -0
- package/dist-esm/lib/ui/components/StylePanel/StylePanelSubheading.mjs.map +7 -0
- package/dist-esm/lib/ui/components/Toolbar/AltTextEditor.mjs +3 -2
- package/dist-esm/lib/ui/components/Toolbar/AltTextEditor.mjs.map +2 -2
- package/dist-esm/lib/ui/components/Toolbar/DefaultImageToolbar.mjs +23 -9
- package/dist-esm/lib/ui/components/Toolbar/DefaultImageToolbar.mjs.map +3 -3
- package/dist-esm/lib/ui/components/Toolbar/DefaultImageToolbarContent.mjs +39 -10
- package/dist-esm/lib/ui/components/Toolbar/DefaultImageToolbarContent.mjs.map +2 -2
- package/dist-esm/lib/ui/components/Toolbar/DefaultToolbar.mjs +56 -21
- package/dist-esm/lib/ui/components/Toolbar/DefaultToolbar.mjs.map +2 -2
- package/dist-esm/lib/ui/components/Toolbar/DefaultVideoToolbarContent.mjs +15 -3
- package/dist-esm/lib/ui/components/Toolbar/DefaultVideoToolbarContent.mjs.map +2 -2
- package/dist-esm/lib/ui/components/Toolbar/LinkEditor.mjs +3 -3
- package/dist-esm/lib/ui/components/Toolbar/LinkEditor.mjs.map +2 -2
- package/dist-esm/lib/ui/components/Toolbar/OverflowingToolbar.mjs +192 -81
- package/dist-esm/lib/ui/components/Toolbar/OverflowingToolbar.mjs.map +3 -3
- package/dist-esm/lib/ui/components/Toolbar/ToggleToolLockedButton.mjs +5 -4
- package/dist-esm/lib/ui/components/Toolbar/ToggleToolLockedButton.mjs.map +2 -2
- package/dist-esm/lib/ui/components/menu-items.mjs +22 -0
- package/dist-esm/lib/ui/components/menu-items.mjs.map +2 -2
- package/dist-esm/lib/ui/components/primitives/Button/TldrawUiButtonIcon.mjs.map +2 -2
- package/dist-esm/lib/ui/components/primitives/TldrawUiContextualToolbar.mjs +12 -3
- package/dist-esm/lib/ui/components/primitives/TldrawUiContextualToolbar.mjs.map +2 -2
- package/dist-esm/lib/ui/components/primitives/TldrawUiDialog.mjs +1 -1
- package/dist-esm/lib/ui/components/primitives/TldrawUiDialog.mjs.map +2 -2
- package/dist-esm/lib/ui/components/primitives/TldrawUiIcon.mjs +36 -2
- package/dist-esm/lib/ui/components/primitives/TldrawUiIcon.mjs.map +2 -2
- package/dist-esm/lib/ui/components/primitives/TldrawUiInput.mjs +3 -3
- package/dist-esm/lib/ui/components/primitives/TldrawUiInput.mjs.map +2 -2
- package/dist-esm/lib/ui/components/primitives/TldrawUiPopover.mjs +3 -2
- package/dist-esm/lib/ui/components/primitives/TldrawUiPopover.mjs.map +2 -2
- package/dist-esm/lib/ui/components/primitives/TldrawUiSlider.mjs +23 -6
- package/dist-esm/lib/ui/components/primitives/TldrawUiSlider.mjs.map +2 -2
- package/dist-esm/lib/ui/components/primitives/TldrawUiToolbar.mjs +33 -7
- package/dist-esm/lib/ui/components/primitives/TldrawUiToolbar.mjs.map +2 -2
- package/dist-esm/lib/ui/components/primitives/TldrawUiTooltip.mjs +272 -0
- package/dist-esm/lib/ui/components/primitives/TldrawUiTooltip.mjs.map +7 -0
- package/dist-esm/lib/ui/components/primitives/layout.mjs +46 -0
- package/dist-esm/lib/ui/components/primitives/layout.mjs.map +7 -0
- package/dist-esm/lib/ui/components/primitives/menus/TldrawUiMenuCheckboxItem.mjs.map +2 -2
- package/dist-esm/lib/ui/components/primitives/menus/TldrawUiMenuContext.mjs.map +2 -2
- package/dist-esm/lib/ui/components/primitives/menus/TldrawUiMenuGroup.mjs +25 -12
- package/dist-esm/lib/ui/components/primitives/menus/TldrawUiMenuGroup.mjs.map +2 -2
- package/dist-esm/lib/ui/components/primitives/menus/TldrawUiMenuItem.mjs +162 -24
- package/dist-esm/lib/ui/components/primitives/menus/TldrawUiMenuItem.mjs.map +2 -2
- package/dist-esm/lib/ui/context/TldrawUiContextProvider.mjs +3 -2
- package/dist-esm/lib/ui/context/TldrawUiContextProvider.mjs.map +2 -2
- package/dist-esm/lib/ui/context/actions.mjs +79 -17
- package/dist-esm/lib/ui/context/actions.mjs.map +2 -2
- package/dist-esm/lib/ui/context/components.mjs +2 -0
- package/dist-esm/lib/ui/context/components.mjs.map +2 -2
- package/dist-esm/lib/ui/context/events.mjs.map +2 -2
- package/dist-esm/lib/ui/hooks/menu-hooks.mjs.map +2 -2
- package/dist-esm/lib/ui/hooks/useClipboardEvents.mjs +2 -2
- package/dist-esm/lib/ui/hooks/useClipboardEvents.mjs.map +2 -2
- package/dist-esm/lib/ui/hooks/useExportAs.mjs +3 -2
- package/dist-esm/lib/ui/hooks/useExportAs.mjs.map +2 -2
- package/dist-esm/lib/ui/hooks/useKeyboardShortcuts.mjs +2 -2
- package/dist-esm/lib/ui/hooks/useKeyboardShortcuts.mjs.map +2 -2
- package/dist-esm/lib/ui/hooks/useTools.mjs +102 -10
- package/dist-esm/lib/ui/hooks/useTools.mjs.map +2 -2
- package/dist-esm/lib/ui/hooks/useTranslation/defaultTranslation.mjs +13 -0
- package/dist-esm/lib/ui/hooks/useTranslation/defaultTranslation.mjs.map +2 -2
- package/dist-esm/lib/ui/kbd-utils.mjs +11 -4
- package/dist-esm/lib/ui/kbd-utils.mjs.map +2 -2
- package/dist-esm/lib/ui/version.mjs +3 -3
- package/dist-esm/lib/ui/version.mjs.map +1 -1
- package/dist-esm/lib/utils/excalidraw/putExcalidrawContent.mjs +1 -1
- package/dist-esm/lib/utils/excalidraw/putExcalidrawContent.mjs.map +2 -2
- package/dist-esm/lib/utils/export/copyAs.mjs +1 -2
- package/dist-esm/lib/utils/export/copyAs.mjs.map +2 -2
- package/dist-esm/lib/utils/export/export.mjs +0 -20
- package/dist-esm/lib/utils/export/export.mjs.map +2 -2
- package/dist-esm/lib/utils/export/exportAs.mjs +1 -2
- package/dist-esm/lib/utils/export/exportAs.mjs.map +2 -2
- package/dist-esm/lib/utils/tldr/buildFromV1Document.mjs +3 -2
- package/dist-esm/lib/utils/tldr/buildFromV1Document.mjs.map +2 -2
- package/package.json +12 -34
- package/src/index.ts +80 -24
- package/src/lib/Tldraw.tsx +15 -2
- package/src/lib/TldrawImage.tsx +6 -2
- package/src/lib/canvas/TldrawCropHandles.tsx +3 -1
- package/src/lib/canvas/TldrawHandles.tsx +5 -1
- package/src/lib/canvas/TldrawOverlays.tsx +1 -1
- package/src/lib/canvas/TldrawScribble.tsx +1 -1
- package/src/lib/canvas/TldrawSelectionForeground.tsx +5 -1
- package/src/lib/defaultExternalContentHandlers.ts +14 -5
- package/src/lib/shapes/arrow/ArrowShapeOptions.test.ts +2 -1
- package/src/lib/shapes/arrow/ArrowShapeTool.test.ts +6 -5
- package/src/lib/shapes/arrow/ArrowShapeUtil.test.ts +53 -11
- package/src/lib/shapes/arrow/ArrowShapeUtil.tsx +30 -46
- package/src/lib/shapes/arrow/arrowLabel.ts +31 -3
- package/src/lib/shapes/arrow/arrowTargetState.ts +3 -2
- package/src/lib/shapes/arrow/elbow/ElbowArrowDebug.tsx +3 -3
- package/src/lib/shapes/arrow/elbow/elbowArrowSnapLines.tsx +2 -2
- package/src/lib/shapes/arrow/toolStates/Pointing.tsx +3 -0
- package/src/lib/shapes/bookmark/BookmarkShapeUtil.tsx +5 -5
- package/src/lib/shapes/draw/DrawShapeTool.test.ts +0 -5
- package/src/lib/shapes/draw/DrawShapeUtil.tsx +4 -7
- package/src/lib/shapes/embed/EmbedShapeUtil.tsx +1 -1
- package/src/lib/shapes/frame/FrameShapeTool.ts +1 -1
- package/src/lib/shapes/frame/FrameShapeUtil.tsx +35 -21
- package/src/lib/shapes/frame/components/FrameHeading.tsx +1 -1
- package/src/lib/shapes/frame/components/FrameLabelInput.tsx +3 -3
- package/src/lib/shapes/geo/GeoShapeUtil.tsx +4 -2
- package/src/lib/shapes/geo/components/GeoShapeBody.tsx +2 -2
- package/src/lib/shapes/highlight/HighlightShapeUtil.tsx +7 -4
- package/src/lib/shapes/image/ImageShapeUtil.tsx +6 -3
- package/src/lib/shapes/line/LineShapeUtil.test.tsx +8 -7
- package/src/lib/shapes/line/LineShapeUtil.tsx +25 -6
- package/src/lib/shapes/line/__snapshots__/LineShapeUtil.test.tsx.snap +2 -2
- package/src/lib/shapes/note/NoteShapeTool.test.ts +2 -1
- package/src/lib/shapes/note/NoteShapeUtil.tsx +11 -4
- package/src/lib/shapes/shared/HyperlinkButton.tsx +5 -5
- package/src/lib/shapes/shared/PathBuilder.test.tsx +1 -1
- package/src/lib/shapes/shared/PathBuilder.tsx +35 -1
- package/src/lib/shapes/shared/PlainTextLabel.tsx +3 -7
- package/src/lib/shapes/shared/RichTextLabel.tsx +6 -1
- package/src/lib/shapes/shared/ShapeFill.tsx +5 -4
- package/src/lib/shapes/shared/SvgTextLabel.tsx +4 -2
- package/src/lib/shapes/shared/crop.ts +1 -0
- package/src/lib/shapes/shared/freehand/svg.ts +2 -0
- package/src/lib/shapes/shared/useEditablePlainText.ts +12 -12
- package/src/lib/shapes/shared/useEditableRichText.ts +7 -3
- package/src/lib/shapes/shared/useImageOrVideoAsset.ts +0 -7
- package/src/lib/shapes/shared/usePrefersReducedMotion.tsx +11 -1
- package/src/lib/shapes/text/PlainTextArea.tsx +3 -3
- package/src/lib/shapes/text/RichTextArea.tsx +3 -4
- package/src/lib/shapes/text/TextShapeTool.test.ts +6 -5
- package/src/lib/shapes/text/TextShapeUtil.tsx +8 -14
- package/src/lib/shapes/video/VideoShapeUtil.tsx +3 -3
- package/src/lib/styles.tsx +3 -1
- package/src/lib/tools/EraserTool/childStates/Erasing.ts +34 -1
- package/src/lib/tools/EraserTool/childStates/Pointing.ts +20 -0
- package/src/lib/tools/SelectTool/childStates/Crop/children/PointingCrop.ts +8 -1
- package/src/lib/tools/SelectTool/childStates/DraggingHandle.tsx +54 -30
- package/src/lib/tools/SelectTool/childStates/Idle.ts +2 -24
- package/src/lib/tools/SelectTool/childStates/PointingShape.ts +7 -0
- package/src/lib/tools/SelectTool/childStates/Resizing.ts +12 -1
- package/src/lib/tools/SelectTool/childStates/Rotating.ts +11 -0
- package/src/lib/tools/SelectTool/childStates/Translating.ts +11 -1
- package/src/lib/tools/selection-logic/getHitShapeOnCanvasPointerDown.ts +1 -0
- package/src/lib/ui/TldrawUi.tsx +33 -12
- package/src/lib/ui/components/A11y.tsx +17 -15
- package/src/lib/ui/components/AccessibilityMenu.tsx +20 -0
- package/src/lib/ui/components/ActionsMenu/DefaultActionsMenu.tsx +15 -3
- package/src/lib/ui/components/{FollowingIndicator.tsx → DefaultFollowingIndicator.tsx} +2 -1
- package/src/lib/ui/components/DefaultMenuPanel.tsx +4 -3
- package/src/lib/ui/components/EditLinkDialog.tsx +16 -6
- package/src/lib/ui/components/KeyboardShortcutsDialog/DefaultKeyboardShortcutsDialogContent.tsx +46 -6
- package/src/lib/ui/components/MainMenu/DefaultMainMenuContent.tsx +4 -2
- package/src/lib/ui/components/Minimap/MinimapManager.ts +4 -4
- package/src/lib/ui/components/MobileStylePanel.tsx +9 -6
- package/src/lib/ui/components/NavigationPanel/DefaultNavigationPanel.tsx +4 -5
- package/src/lib/ui/components/PageMenu/DefaultPageMenu.tsx +5 -4
- package/src/lib/ui/components/SharePanel/PeopleMenuItem.tsx +4 -3
- package/src/lib/ui/components/SharePanel/UserPresenceColorPicker.tsx +3 -3
- package/src/lib/ui/components/Spinner.tsx +2 -24
- package/src/lib/ui/components/StylePanel/DefaultStylePanel.tsx +28 -12
- package/src/lib/ui/components/StylePanel/DefaultStylePanelContent.tsx +261 -342
- package/src/lib/ui/components/{primitives/TldrawUiButtonPicker.tsx → StylePanel/StylePanelButtonPicker.tsx} +66 -48
- package/src/lib/ui/components/StylePanel/StylePanelContext.tsx +63 -0
- package/src/lib/ui/components/StylePanel/{DoubleDropdownPicker.tsx → StylePanelDoubleDropdownPicker.tsx} +31 -22
- package/src/lib/ui/components/StylePanel/StylePanelDropdownPicker.tsx +119 -0
- package/src/lib/ui/components/StylePanel/StylePanelSubheading.tsx +9 -0
- package/src/lib/ui/components/Toolbar/AltTextEditor.tsx +5 -4
- package/src/lib/ui/components/Toolbar/DefaultImageToolbar.tsx +25 -9
- package/src/lib/ui/components/Toolbar/DefaultImageToolbarContent.tsx +33 -16
- package/src/lib/ui/components/Toolbar/DefaultToolbar.tsx +55 -23
- package/src/lib/ui/components/Toolbar/DefaultVideoToolbarContent.tsx +12 -4
- package/src/lib/ui/components/Toolbar/LinkEditor.tsx +5 -5
- package/src/lib/ui/components/Toolbar/OverflowingToolbar.tsx +212 -61
- package/src/lib/ui/components/Toolbar/ToggleToolLockedButton.tsx +17 -12
- package/src/lib/ui/components/menu-items.tsx +25 -0
- package/src/lib/ui/components/primitives/Button/TldrawUiButtonIcon.tsx +2 -2
- package/src/lib/ui/components/primitives/TldrawUiContextualToolbar.tsx +8 -3
- package/src/lib/ui/components/primitives/TldrawUiDialog.tsx +1 -1
- package/src/lib/ui/components/primitives/TldrawUiIcon.tsx +41 -3
- package/src/lib/ui/components/primitives/TldrawUiInput.tsx +3 -3
- package/src/lib/ui/components/primitives/TldrawUiPopover.tsx +4 -2
- package/src/lib/ui/components/primitives/TldrawUiSlider.tsx +54 -29
- package/src/lib/ui/components/primitives/TldrawUiToolbar.tsx +59 -12
- package/src/lib/ui/components/primitives/TldrawUiTooltip.tsx +365 -0
- package/src/lib/ui/components/primitives/layout.tsx +107 -0
- package/src/lib/ui/components/primitives/menus/TldrawUiMenuCheckboxItem.tsx +2 -2
- package/src/lib/ui/components/primitives/menus/TldrawUiMenuContext.tsx +0 -1
- package/src/lib/ui/components/primitives/menus/TldrawUiMenuGroup.tsx +29 -16
- package/src/lib/ui/components/primitives/menus/TldrawUiMenuItem.tsx +224 -23
- package/src/lib/ui/context/TldrawUiContextProvider.tsx +23 -20
- package/src/lib/ui/context/actions.tsx +81 -18
- package/src/lib/ui/context/components.tsx +3 -0
- package/src/lib/ui/context/events.tsx +7 -3
- package/src/lib/ui/hooks/menu-hooks.ts +1 -0
- package/src/lib/ui/hooks/useClipboardEvents.ts +2 -2
- package/src/lib/ui/hooks/useExportAs.ts +3 -2
- package/src/lib/ui/hooks/useKeyboardShortcuts.ts +3 -2
- package/src/lib/ui/hooks/useTools.tsx +142 -11
- package/src/lib/ui/hooks/useTranslation/TLUiTranslationKey.ts +13 -0
- package/src/lib/ui/hooks/useTranslation/defaultTranslation.ts +13 -0
- package/src/lib/ui/kbd-utils.ts +12 -4
- package/src/lib/ui/version.ts +3 -3
- package/src/lib/ui.css +432 -315
- package/src/lib/utils/excalidraw/__snapshots__/putExcalidrawContent.test.tsx.snap +21 -7
- package/src/lib/utils/excalidraw/putExcalidrawContent.ts +7 -7
- package/src/lib/utils/export/copyAs.ts +1 -24
- package/src/lib/utils/export/export.ts +0 -36
- package/src/lib/utils/export/exportAs.ts +1 -32
- package/src/lib/utils/tldr/__snapshots__/buildFromV1Document.test.ts.snap +28 -7
- package/src/lib/utils/tldr/buildFromV1Document.ts +2 -1
- package/src/test/A11y.test.tsx +3 -2
- package/src/test/ClickManager.test.ts +7 -6
- package/src/test/Editor.test.tsx +56 -28
- package/src/test/EraserTool.test.ts +184 -13
- package/src/test/HandTool.test.ts +10 -9
- package/src/test/HighlightShape.test.ts +2 -1
- package/src/test/SelectTool.test.ts +40 -13
- package/src/test/TLUserPreferences.test.ts +4 -3
- package/src/test/TestEditor.ts +13 -15
- package/src/test/TldrawEditor.test.tsx +26 -19
- package/src/test/ZoomTool.test.ts +7 -6
- package/src/test/__snapshots__/drawing.test.ts.snap +2 -2
- package/src/test/__snapshots__/groups.test.tsx.snap +6 -6
- package/src/test/__snapshots__/resizing.test.ts.snap +2 -2
- package/src/test/arrows-megabus.test.tsx +17 -10
- package/src/test/bindings.test.tsx +24 -37
- package/src/test/bookmark-shapes.test.ts +1 -8
- package/src/test/commands/__snapshots__/getSvgString.test.ts.snap +23 -7
- package/src/test/commands/__snapshots__/packShapes.test.ts.snap +8 -8
- package/src/test/commands/__snapshots__/zoomToFit.test.ts.snap +2 -2
- package/src/test/commands/alignShapes.test.tsx +25 -24
- package/src/test/commands/animationSpeed.test.ts +2 -1
- package/src/test/commands/centerOnPoint.test.ts +3 -2
- package/src/test/commands/clipboard.test.ts +3 -2
- package/src/test/commands/createShapes.test.ts +2 -1
- package/src/test/commands/deletePage.test.ts +84 -1
- package/src/test/commands/deleteShapes.test.ts +2 -1
- package/src/test/commands/distributeShapes.test.tsx +11 -10
- package/src/test/commands/getSvgString.test.ts +2 -1
- package/src/test/commands/packShapes.test.ts +5 -4
- package/src/test/commands/putContent.test.ts +1 -0
- package/src/test/commands/resizeShape.test.ts +2 -1
- package/src/test/commands/rotateShapes.test.ts +7 -6
- package/src/test/commands/setCamera.test.ts +4 -3
- package/src/test/commands/setCurrentPage.test.ts +3 -2
- package/src/test/commands/stackShapes.test.ts +11 -10
- package/src/test/commands/stretch.test.tsx +13 -12
- package/src/test/commands/updateShapes.test.ts +9 -5
- package/src/test/createDeepLink.test.tsx +2 -1
- package/src/test/cropping.test.ts +3 -2
- package/src/test/custom-clipping.test.ts +442 -0
- package/src/test/customSnapping.test.tsx +55 -41
- package/src/test/drawing.test.ts +2 -1
- package/src/test/flipShapes.test.ts +4 -3
- package/src/test/frames.test.ts +25 -24
- package/src/test/getCulledShapes.test.tsx +80 -4
- package/src/test/groups.test.tsx +6 -4
- package/src/test/handleDeepLink.test.tsx +2 -1
- package/src/test/inner-outer-margin.test.ts +315 -0
- package/src/test/maxShapes.test.ts +3 -2
- package/src/test/modifiers.test.ts +5 -4
- package/src/test/navigation.test.ts +264 -9
- package/src/test/panning.test.ts +2 -1
- package/src/test/perf/perf.test.ts +2 -1
- package/src/test/registerDeepLinkListener.test.tsx +10 -9
- package/src/test/resizing.test.ts +39 -38
- package/src/test/select.test.tsx +4 -3
- package/src/test/selection-omnibus.test.ts +11 -10
- package/src/test/shapeutils.test.ts +398 -48
- package/src/test/translating.test.ts +12 -11
- package/tldraw.css +759 -630
- package/dist-cjs/lib/ui/components/FollowingIndicator.js.map +0 -7
- package/dist-cjs/lib/ui/components/StylePanel/DoubleDropdownPicker.js.map +0 -7
- package/dist-cjs/lib/ui/components/StylePanel/DropdownPicker.js.map +0 -7
- package/dist-cjs/lib/ui/components/primitives/TldrawUiButtonPicker.js.map +0 -7
- package/dist-esm/lib/ui/components/FollowingIndicator.mjs.map +0 -7
- package/dist-esm/lib/ui/components/StylePanel/DoubleDropdownPicker.mjs.map +0 -7
- package/dist-esm/lib/ui/components/StylePanel/DropdownPicker.mjs.map +0 -7
- package/dist-esm/lib/ui/components/primitives/TldrawUiButtonPicker.mjs +0 -113
- package/dist-esm/lib/ui/components/primitives/TldrawUiButtonPicker.mjs.map +0 -7
- package/src/lib/ui/components/StylePanel/DropdownPicker.tsx +0 -109
package/dist-cjs/index.d.ts
CHANGED
|
@@ -13,11 +13,13 @@ import { CSSProperties } from 'react';
|
|
|
13
13
|
import { Editor } from '@tldraw/editor';
|
|
14
14
|
import { Extension } from '@tiptap/core';
|
|
15
15
|
import { Extensions } from '@tiptap/core';
|
|
16
|
+
import { ForwardRefExoticComponent } from 'react';
|
|
16
17
|
import { Geometry2d } from '@tldraw/editor';
|
|
17
18
|
import { Geometry2dFilters } from '@tldraw/editor';
|
|
18
19
|
import { Geometry2dOptions } from '@tldraw/editor';
|
|
19
20
|
import { Group2d } from '@tldraw/editor';
|
|
20
21
|
import { HandleSnapGeometry } from '@tldraw/editor';
|
|
22
|
+
import { HTMLAttributes } from 'react';
|
|
21
23
|
import { IndexKey } from '@tldraw/editor';
|
|
22
24
|
import { JsonObject } from '@tldraw/editor';
|
|
23
25
|
import { JSX as JSX_2 } from 'react/jsx-runtime';
|
|
@@ -37,6 +39,7 @@ import { ReadonlySharedStyleMap } from '@tldraw/editor';
|
|
|
37
39
|
import { RecordProps } from '@tldraw/editor';
|
|
38
40
|
import { Rectangle2d } from '@tldraw/editor';
|
|
39
41
|
import { RecursivePartial } from '@tldraw/editor';
|
|
42
|
+
import { RefAttributes } from 'react';
|
|
40
43
|
import { RefObject } from 'react';
|
|
41
44
|
import { Result } from '@tldraw/editor';
|
|
42
45
|
import { RichTextFontVisitorState } from '@tldraw/editor';
|
|
@@ -65,7 +68,6 @@ import { TLClickEventInfo } from '@tldraw/editor';
|
|
|
65
68
|
import { TLContent } from '@tldraw/editor';
|
|
66
69
|
import { TLCropInfo } from '@tldraw/editor';
|
|
67
70
|
import { TLDefaultColorStyle } from '@tldraw/editor';
|
|
68
|
-
import { TLDefaultColorTheme } from '@tldraw/editor';
|
|
69
71
|
import { TLDefaultColorThemeColor } from '@tldraw/editor';
|
|
70
72
|
import { TLDefaultDashStyle } from '@tldraw/editor';
|
|
71
73
|
import { TLDefaultFillStyle } from '@tldraw/editor';
|
|
@@ -148,6 +150,9 @@ export declare interface A11yProviderProps {
|
|
|
148
150
|
children: React.ReactNode;
|
|
149
151
|
}
|
|
150
152
|
|
|
153
|
+
/** @public @react */
|
|
154
|
+
export declare function AccessibilityMenu(): JSX_2.Element;
|
|
155
|
+
|
|
151
156
|
/** @public */
|
|
152
157
|
export declare interface ActionsProviderProps {
|
|
153
158
|
overrides?(editor: Editor, actions: TLUiActionsContextType, helpers: TLUiOverrideHelpers): TLUiActionsContextType;
|
|
@@ -187,9 +192,6 @@ export declare class ArrowBindingUtil extends BindingUtil<TLArrowBinding> {
|
|
|
187
192
|
/** @public @react */
|
|
188
193
|
export declare function ArrowDownToolbarItem(): JSX_2.Element;
|
|
189
194
|
|
|
190
|
-
/** @public @react */
|
|
191
|
-
export declare function ArrowheadStylePickerSet({ styles }: StylePickerSetProps): JSX_2.Element | null;
|
|
192
|
-
|
|
193
195
|
/** @public @react */
|
|
194
196
|
export declare function ArrowLeftToolbarItem(): JSX_2.Element;
|
|
195
197
|
|
|
@@ -304,7 +306,6 @@ export declare class ArrowShapeUtil extends ShapeUtil<TLArrowShape> {
|
|
|
304
306
|
canEdit(): boolean;
|
|
305
307
|
canBind({ toShapeType }: TLShapeUtilCanBindOpts<TLArrowShape>): boolean;
|
|
306
308
|
canSnap(): boolean;
|
|
307
|
-
canTabTo(shape: TLArrowShape): boolean;
|
|
308
309
|
hideResizeHandles(): boolean;
|
|
309
310
|
hideRotateHandle(): boolean;
|
|
310
311
|
hideSelectionBoundsBg(): boolean;
|
|
@@ -355,7 +356,6 @@ export declare class ArrowShapeUtil extends ShapeUtil<TLArrowShape> {
|
|
|
355
356
|
component(shape: TLArrowShape): JSX_2.Element | null;
|
|
356
357
|
indicator(shape: TLArrowShape): JSX_2.Element | null;
|
|
357
358
|
onEditStart(shape: TLArrowShape): void;
|
|
358
|
-
onEditEnd(shape: TLArrowShape): void;
|
|
359
359
|
toSvg(shape: TLArrowShape, ctx: SvgExportContext): JSX_2.Element;
|
|
360
360
|
getCanvasSvgDefs(): TLShapeUtilCanvasSvgDef[];
|
|
361
361
|
getInterpolatedProps(startShape: TLArrowShape, endShape: TLArrowShape, progress: number): TLArrowShapeProps;
|
|
@@ -496,9 +496,6 @@ export declare function CloudToolbarItem(): JSX_2.Element;
|
|
|
496
496
|
/** @public @react */
|
|
497
497
|
export declare function ColorSchemeMenu(): JSX_2.Element;
|
|
498
498
|
|
|
499
|
-
/** @public @react */
|
|
500
|
-
export declare function CommonStylePickerSet({ styles, theme }: ThemeStylePickerSetProps): JSX_2.Element;
|
|
501
|
-
|
|
502
499
|
/**
|
|
503
500
|
* Contains the size within the given box size
|
|
504
501
|
*
|
|
@@ -530,14 +527,6 @@ export declare function ConvertToEmbedMenuItem(): JSX_2.Element | null;
|
|
|
530
527
|
*/
|
|
531
528
|
export declare function copyAs(editor: Editor, ids: TLShapeId[], opts: CopyAsOptions): Promise<void>;
|
|
532
529
|
|
|
533
|
-
/**
|
|
534
|
-
* @deprecated The format parameter is now part of the opts object.
|
|
535
|
-
* @public
|
|
536
|
-
*/
|
|
537
|
-
export declare function copyAs(editor: Editor, ids: TLShapeId[], format: TLCopyType, opts?: TLImageExportOptions & {
|
|
538
|
-
format?: undefined;
|
|
539
|
-
}): Promise<void>;
|
|
540
|
-
|
|
541
530
|
/** @public @react */
|
|
542
531
|
export declare function CopyAsMenuGroup(): JSX_2.Element;
|
|
543
532
|
|
|
@@ -849,6 +838,9 @@ export declare let defaultEditorAssetUrls: TLEditorAssetUrls;
|
|
|
849
838
|
/** @public */
|
|
850
839
|
export declare type DefaultEmbedDefinitionType = (typeof DEFAULT_EMBED_DEFINITIONS)[number]['type'];
|
|
851
840
|
|
|
841
|
+
/** @public @react */
|
|
842
|
+
export declare function DefaultFollowingIndicator(): JSX_2.Element | null;
|
|
843
|
+
|
|
852
844
|
/** @public */
|
|
853
845
|
export declare const DefaultFontFaces: TLDefaultFonts;
|
|
854
846
|
|
|
@@ -915,7 +907,7 @@ export declare const DefaultHelpMenu: NamedExoticComponent<TLUiHelpMenuProps>;
|
|
|
915
907
|
export declare function DefaultHelpMenuContent(): JSX_2.Element;
|
|
916
908
|
|
|
917
909
|
/** @public @react */
|
|
918
|
-
export declare
|
|
910
|
+
export declare function DefaultImageToolbar({ children }: TLUiImageToolbarProps): JSX_2.Element | null;
|
|
919
911
|
|
|
920
912
|
/** @public @react */
|
|
921
913
|
export declare const DefaultImageToolbarContent: NamedExoticComponent<DefaultImageToolbarContentProps>;
|
|
@@ -992,7 +984,7 @@ export declare function DefaultSharePanel(): JSX_2.Element;
|
|
|
992
984
|
export declare const DefaultStylePanel: NamedExoticComponent<TLUiStylePanelProps>;
|
|
993
985
|
|
|
994
986
|
/** @public @react */
|
|
995
|
-
export declare function DefaultStylePanelContent(
|
|
987
|
+
export declare function DefaultStylePanelContent(): JSX_2.Element;
|
|
996
988
|
|
|
997
989
|
/** @public @react */
|
|
998
990
|
export declare const DefaultToasts: NamedExoticComponent<object>;
|
|
@@ -1013,6 +1005,11 @@ export declare function DefaultToolbarContent(): JSX_2.Element;
|
|
|
1013
1005
|
/** @public */
|
|
1014
1006
|
export declare interface DefaultToolbarProps {
|
|
1015
1007
|
children?: ReactNode;
|
|
1008
|
+
orientation?: 'horizontal' | 'vertical';
|
|
1009
|
+
minItems?: number;
|
|
1010
|
+
minSizePx?: number;
|
|
1011
|
+
maxItems?: number;
|
|
1012
|
+
maxSizePx?: number;
|
|
1016
1013
|
}
|
|
1017
1014
|
|
|
1018
1015
|
/** @public */
|
|
@@ -1112,7 +1109,6 @@ export declare class DrawShapeUtil extends ShapeUtil<TLDrawShape> {
|
|
|
1112
1109
|
static props: RecordProps<TLDrawShape>;
|
|
1113
1110
|
static migrations: TLPropsMigrations;
|
|
1114
1111
|
options: DrawShapeOptions;
|
|
1115
|
-
canTabTo(): boolean;
|
|
1116
1112
|
hideResizeHandles(shape: TLDrawShape): boolean;
|
|
1117
1113
|
hideRotateHandle(shape: TLDrawShape): boolean;
|
|
1118
1114
|
hideSelectionBoundsFg(shape: TLDrawShape): boolean;
|
|
@@ -1481,12 +1477,6 @@ export declare interface ExampleDialogProps {
|
|
|
1481
1477
|
*/
|
|
1482
1478
|
export declare function exportAs(editor: Editor, ids: TLShapeId[], opts: ExportAsOptions): Promise<void>;
|
|
1483
1479
|
|
|
1484
|
-
/**
|
|
1485
|
-
* @deprecated The format & name parameters are now part of the opts object.
|
|
1486
|
-
* @public
|
|
1487
|
-
*/
|
|
1488
|
-
export declare function exportAs(editor: Editor, ids: TLShapeId[], format?: TLExportType, name?: string, opts?: TLImageExportOptions): Promise<void>;
|
|
1489
|
-
|
|
1490
1480
|
/** @public */
|
|
1491
1481
|
export declare interface ExportAsOptions extends TLImageExportOptions {
|
|
1492
1482
|
/** {@inheritdoc @tldraw/editor#TLImageExportOptions.format} */
|
|
@@ -1498,23 +1488,6 @@ export declare interface ExportAsOptions extends TLImageExportOptions {
|
|
|
1498
1488
|
/** @public @react */
|
|
1499
1489
|
export declare function ExportFileContentSubMenu(): JSX_2.Element;
|
|
1500
1490
|
|
|
1501
|
-
/**
|
|
1502
|
-
* Export the given shapes as a blob.
|
|
1503
|
-
* @param editor - The editor instance.
|
|
1504
|
-
* @param ids - The ids of the shapes to export.
|
|
1505
|
-
* @param format - The format to export as.
|
|
1506
|
-
* @param opts - Rendering options.
|
|
1507
|
-
* @returns A promise that resolves to a blob.
|
|
1508
|
-
* @deprecated Use {@link @tldraw/editor#Editor.toImage} instead.
|
|
1509
|
-
* @public
|
|
1510
|
-
*/
|
|
1511
|
-
export declare function exportToBlob({ editor, ids, format, opts, }: {
|
|
1512
|
-
editor: Editor;
|
|
1513
|
-
format: TLExportType;
|
|
1514
|
-
ids: TLShapeId[];
|
|
1515
|
-
opts?: TLImageExportOptions;
|
|
1516
|
-
}): Promise<Blob>;
|
|
1517
|
-
|
|
1518
1491
|
/** @public @react */
|
|
1519
1492
|
export declare function ExtrasGroup(): JSX_2.Element;
|
|
1520
1493
|
|
|
@@ -1555,7 +1528,7 @@ export declare interface FrameShapeOptions {
|
|
|
1555
1528
|
export declare class FrameShapeTool extends BaseBoxShapeTool {
|
|
1556
1529
|
static id: string;
|
|
1557
1530
|
static initial: string;
|
|
1558
|
-
shapeType:
|
|
1531
|
+
shapeType: "frame";
|
|
1559
1532
|
onCreate(shape: null | TLShape): void;
|
|
1560
1533
|
}
|
|
1561
1534
|
|
|
@@ -1571,6 +1544,7 @@ export declare class FrameShapeUtil extends BaseBoxShapeUtil<TLFrameShape> {
|
|
|
1571
1544
|
canEdit(): boolean;
|
|
1572
1545
|
canResize(): boolean;
|
|
1573
1546
|
canResizeChildren(): boolean;
|
|
1547
|
+
isExportBoundsContainer(): boolean;
|
|
1574
1548
|
getDefaultProps(): TLFrameShape['props'];
|
|
1575
1549
|
getAriaDescriptor(shape: TLFrameShape): string;
|
|
1576
1550
|
getGeometry(shape: TLFrameShape): Geometry2d;
|
|
@@ -1579,6 +1553,7 @@ export declare class FrameShapeUtil extends BaseBoxShapeUtil<TLFrameShape> {
|
|
|
1579
1553
|
toSvg(shape: TLFrameShape, ctx: SvgExportContext): JSX_2.Element;
|
|
1580
1554
|
indicator(shape: TLFrameShape): JSX_2.Element;
|
|
1581
1555
|
providesBackgroundForChildren(): boolean;
|
|
1556
|
+
getClipPath(shape: TLFrameShape): Vec[];
|
|
1582
1557
|
canReceiveNewChildrenOfType(shape: TLShape): boolean;
|
|
1583
1558
|
onResize(shape: any, info: TLResizeInfo<any>): any;
|
|
1584
1559
|
getInterpolatedProps(startShape: TLFrameShape, endShape: TLFrameShape, t: number): TLFrameShapeProps;
|
|
@@ -1727,9 +1702,6 @@ export declare class GeoShapeUtil extends BaseBoxShapeUtil<TLGeoShape> {
|
|
|
1727
1702
|
getInterpolatedProps(startShape: TLGeoShape, endShape: TLGeoShape, t: number): TLGeoShapeProps;
|
|
1728
1703
|
}
|
|
1729
1704
|
|
|
1730
|
-
/** @public @react */
|
|
1731
|
-
export declare function GeoStylePickerSet({ styles }: StylePickerSetProps): JSX_2.Element | null;
|
|
1732
|
-
|
|
1733
1705
|
/** @public */
|
|
1734
1706
|
export declare function getArrowBindings(editor: Editor, shape: TLArrowShape): TLArrowBindings;
|
|
1735
1707
|
|
|
@@ -1742,6 +1714,9 @@ export declare function getArrowTerminalsInArrowSpace(editor: Editor, shape: TLA
|
|
|
1742
1714
|
start: Vec;
|
|
1743
1715
|
};
|
|
1744
1716
|
|
|
1717
|
+
/** @public */
|
|
1718
|
+
export declare function getAssetInfo(file: File, options: TLDefaultExternalContentHandlerOpts, assetId?: TLAssetId): Promise<TLImageAsset | TLVideoAsset>;
|
|
1719
|
+
|
|
1745
1720
|
/** @public */
|
|
1746
1721
|
export declare function getCropBox<T extends ShapeWithCrop>(shape: T, info: TLCropInfo<T>, opts?: CropBoxOptions): {
|
|
1747
1722
|
id: TLShapeId;
|
|
@@ -1763,9 +1738,35 @@ export declare function getDefaultCrop(): TLShapeCrop;
|
|
|
1763
1738
|
*/
|
|
1764
1739
|
export declare function getEmbedInfo(definitions: readonly TLEmbedDefinition[], inputUrl: string): TLEmbedResult;
|
|
1765
1740
|
|
|
1741
|
+
/** @public */
|
|
1742
|
+
export declare function getHitShapeOnCanvasPointerDown(editor: Editor, hitLabels?: boolean): TLShape | undefined;
|
|
1743
|
+
|
|
1766
1744
|
/** @public */
|
|
1767
1745
|
export declare function getMediaAssetInfoPartial(file: File, assetId: TLAssetId, isImageType: boolean, isVideoType: boolean, maxImageDimension?: number): Promise<TLImageAsset | TLVideoAsset>;
|
|
1768
1746
|
|
|
1747
|
+
/**
|
|
1748
|
+
* ## getStrokePoints
|
|
1749
|
+
*
|
|
1750
|
+
* Get an array of points as objects with an adjusted point, pressure, vector, distance, and
|
|
1751
|
+
* runningLength.
|
|
1752
|
+
*
|
|
1753
|
+
* @param points - An array of points (as `[x, y, pressure]` or `{x, y, pressure}`). Pressure is
|
|
1754
|
+
* optional in both cases.
|
|
1755
|
+
* @param options - An object with options.
|
|
1756
|
+
* @public
|
|
1757
|
+
*/
|
|
1758
|
+
export declare function getStrokePoints(rawInputPoints: VecLike[], options?: StrokeOptions): StrokePoint[];
|
|
1759
|
+
|
|
1760
|
+
/**
|
|
1761
|
+
* Turn an array of stroke points into a path of quadradic curves.
|
|
1762
|
+
*
|
|
1763
|
+
* @param points - The stroke points returned from perfect-freehand
|
|
1764
|
+
* @param closed - Whether the shape is closed
|
|
1765
|
+
*
|
|
1766
|
+
* @public
|
|
1767
|
+
*/
|
|
1768
|
+
export declare function getSvgPathFromStrokePoints(points: StrokePoint[], closed?: boolean): string;
|
|
1769
|
+
|
|
1769
1770
|
/**
|
|
1770
1771
|
* Original (uncropped) width and height of shape.
|
|
1771
1772
|
*
|
|
@@ -1799,6 +1800,9 @@ export declare class HandTool extends StateNode {
|
|
|
1799
1800
|
/** @public @react */
|
|
1800
1801
|
export declare function HandToolbarItem(): JSX_2.Element;
|
|
1801
1802
|
|
|
1803
|
+
/** @public @react */
|
|
1804
|
+
export declare function HeartToolbarItem(): JSX_2.Element;
|
|
1805
|
+
|
|
1802
1806
|
/** @public @react */
|
|
1803
1807
|
export declare function HexagonToolbarItem(): JSX_2.Element;
|
|
1804
1808
|
|
|
@@ -1830,7 +1834,6 @@ export declare class HighlightShapeUtil extends ShapeUtil<TLHighlightShape> {
|
|
|
1830
1834
|
static props: RecordProps<TLHighlightShape>;
|
|
1831
1835
|
static migrations: TLPropsMigrations;
|
|
1832
1836
|
options: HighlightShapeOptions;
|
|
1833
|
-
canTabTo(): boolean;
|
|
1834
1837
|
hideResizeHandles(shape: TLHighlightShape): boolean;
|
|
1835
1838
|
hideRotateHandle(shape: TLHighlightShape): boolean;
|
|
1836
1839
|
hideSelectionBoundsFg(shape: TLHighlightShape): boolean;
|
|
@@ -1859,6 +1862,7 @@ export declare class ImageShapeUtil extends BaseBoxShapeUtil<TLImageShape> {
|
|
|
1859
1862
|
static migrations: TLPropsMigrations;
|
|
1860
1863
|
isAspectRatioLocked(): boolean;
|
|
1861
1864
|
canCrop(): boolean;
|
|
1865
|
+
isExportBoundsContainer(): boolean;
|
|
1862
1866
|
getDefaultProps(): TLImageShape['props'];
|
|
1863
1867
|
getGeometry(shape: TLImageShape): Geometry2d;
|
|
1864
1868
|
getAriaDescriptor(shape: TLImageShape): string;
|
|
@@ -1907,7 +1911,6 @@ export declare class LineShapeUtil extends ShapeUtil<TLLineShape> {
|
|
|
1907
1911
|
static type: "line";
|
|
1908
1912
|
static props: RecordProps<TLLineShape>;
|
|
1909
1913
|
static migrations: TLPropsMigrations;
|
|
1910
|
-
canTabTo(): boolean;
|
|
1911
1914
|
hideResizeHandles(): boolean;
|
|
1912
1915
|
hideRotateHandle(): boolean;
|
|
1913
1916
|
hideSelectionBoundsFg(): boolean;
|
|
@@ -1955,6 +1958,34 @@ export declare class LineShapeUtil extends ShapeUtil<TLLineShape> {
|
|
|
1955
1958
|
typeName: "shape";
|
|
1956
1959
|
x: number;
|
|
1957
1960
|
y: number;
|
|
1961
|
+
};
|
|
1962
|
+
onHandleDragStart(shape: TLLineShape, { handle }: TLHandleDragInfo<TLLineShape>): {
|
|
1963
|
+
id: TLShapeId;
|
|
1964
|
+
index: IndexKey;
|
|
1965
|
+
isLocked: boolean;
|
|
1966
|
+
meta: JsonObject;
|
|
1967
|
+
opacity: TLOpacityType;
|
|
1968
|
+
parentId: TLParentId;
|
|
1969
|
+
props: {
|
|
1970
|
+
color: TLDefaultColorStyle;
|
|
1971
|
+
dash: TLDefaultDashStyle;
|
|
1972
|
+
points: {
|
|
1973
|
+
[x: string]: {
|
|
1974
|
+
id: IndexKey;
|
|
1975
|
+
index: IndexKey;
|
|
1976
|
+
x: number;
|
|
1977
|
+
y: number;
|
|
1978
|
+
} | TLLineShapePoint;
|
|
1979
|
+
};
|
|
1980
|
+
scale: number;
|
|
1981
|
+
size: TLDefaultSizeStyle;
|
|
1982
|
+
spline: TLLineShapeSplineStyle;
|
|
1983
|
+
};
|
|
1984
|
+
rotation: number;
|
|
1985
|
+
type: "line";
|
|
1986
|
+
typeName: "shape";
|
|
1987
|
+
x: number;
|
|
1988
|
+
y: number;
|
|
1958
1989
|
} | undefined;
|
|
1959
1990
|
component(shape: TLLineShape): JSX_2.Element;
|
|
1960
1991
|
indicator(shape: TLLineShape): JSX_2.Element;
|
|
@@ -1968,6 +1999,9 @@ export declare function LineToolbarItem(): JSX_2.Element;
|
|
|
1968
1999
|
|
|
1969
2000
|
/* Excluded from this release type: LineToPathBuilderCommand */
|
|
1970
2001
|
|
|
2002
|
+
/** @public @react */
|
|
2003
|
+
export declare function LockGroup(): JSX_2.Element;
|
|
2004
|
+
|
|
1971
2005
|
/** @public @react */
|
|
1972
2006
|
export declare function MiscMenuGroup(): JSX_2.Element;
|
|
1973
2007
|
|
|
@@ -2079,21 +2113,57 @@ export declare class NoteShapeUtil extends ShapeUtil<TLNoteShape> {
|
|
|
2079
2113
|
/** @public @react */
|
|
2080
2114
|
export declare function NoteToolbarItem(): JSX_2.Element;
|
|
2081
2115
|
|
|
2116
|
+
/**
|
|
2117
|
+
* Checks if a file is allowed to be uploaded. If it is not, it will show a toast explaining why to the user.
|
|
2118
|
+
*
|
|
2119
|
+
* @param file - The file to check
|
|
2120
|
+
* @param options - The options for the external content handler
|
|
2121
|
+
* @returns True if the file is allowed, false otherwise
|
|
2122
|
+
* @public
|
|
2123
|
+
*/
|
|
2124
|
+
export declare function notifyIfFileNotAllowed(file: File, options: TLDefaultExternalContentHandlerOpts): boolean;
|
|
2125
|
+
|
|
2082
2126
|
/** @public @react */
|
|
2083
2127
|
export declare function OfflineIndicator(): JSX_2.Element;
|
|
2084
2128
|
|
|
2085
|
-
/**
|
|
2086
|
-
|
|
2129
|
+
/**
|
|
2130
|
+
* A helper method to use in {@link TLUiToolItem#onDragStart} to create a shape by dragging it from
|
|
2131
|
+
* the toolbar.
|
|
2132
|
+
* @public
|
|
2133
|
+
*/
|
|
2134
|
+
export declare function onDragFromToolbarToCreateShape(editor: Editor, info: TLPointerEventInfo, opts: OnDragFromToolbarToCreateShapesOpts): void;
|
|
2135
|
+
|
|
2136
|
+
/**
|
|
2137
|
+
* Options for {@link onDragFromToolbarToCreateShape}.
|
|
2138
|
+
* @public
|
|
2139
|
+
*/
|
|
2140
|
+
export declare interface OnDragFromToolbarToCreateShapesOpts {
|
|
2141
|
+
/**
|
|
2142
|
+
* Create the shape being dragged. You don't need to worry about positioning it, as it'll be
|
|
2143
|
+
* immediately updated with the correct position.
|
|
2144
|
+
*/
|
|
2145
|
+
createShape(id: TLShapeId): void;
|
|
2146
|
+
/**
|
|
2147
|
+
* Called once the drag interaction has finished.
|
|
2148
|
+
*/
|
|
2149
|
+
onDragEnd?(id: TLShapeId): void;
|
|
2150
|
+
}
|
|
2087
2151
|
|
|
2088
2152
|
/** @public @react */
|
|
2089
2153
|
export declare function OvalToolbarItem(): JSX_2.Element;
|
|
2090
2154
|
|
|
2091
2155
|
/** @public @react */
|
|
2092
|
-
export declare function OverflowingToolbar({ children }: OverflowingToolbarProps): JSX_2.Element;
|
|
2156
|
+
export declare function OverflowingToolbar({ children, orientation, sizingParentClassName, minItems, minSizePx, maxItems, maxSizePx, }: OverflowingToolbarProps): JSX_2.Element;
|
|
2093
2157
|
|
|
2094
2158
|
/** @public */
|
|
2095
2159
|
export declare interface OverflowingToolbarProps {
|
|
2096
2160
|
children: React.ReactNode;
|
|
2161
|
+
orientation: 'horizontal' | 'vertical';
|
|
2162
|
+
sizingParentClassName: string;
|
|
2163
|
+
minItems: number;
|
|
2164
|
+
minSizePx: number;
|
|
2165
|
+
maxItems: number;
|
|
2166
|
+
maxSizePx: number;
|
|
2097
2167
|
}
|
|
2098
2168
|
|
|
2099
2169
|
/** @public @react */
|
|
@@ -2150,6 +2220,7 @@ export declare class PathBuilder {
|
|
|
2150
2220
|
circularArcTo(radius: number, largeArcFlag: boolean, sweepFlag: boolean, x2: number, y2: number, opts?: PathBuilderCommandOpts): this;
|
|
2151
2221
|
arcTo(rx: number, ry: number, largeArcFlag: boolean, sweepFlag: boolean, xAxisRotationRadians: number, x2: number, y2: number, opts?: PathBuilderCommandOpts): this;
|
|
2152
2222
|
cubicBezierTo(x: number, y: number, cp1X: number, cp1Y: number, cp2X: number, cp2Y: number, opts?: PathBuilderCommandOpts): this;
|
|
2223
|
+
private cubicBezierToWithResolution;
|
|
2153
2224
|
close(): this;
|
|
2154
2225
|
toD(opts?: PathBuilderToDOpts): string;
|
|
2155
2226
|
toSvg(opts: PathBuilderOpts): JSX_2.Element;
|
|
@@ -2247,7 +2318,11 @@ export declare const PlainTextLabel: React_3.NamedExoticComponent<PlainTextLabel
|
|
|
2247
2318
|
/** @public */
|
|
2248
2319
|
export declare interface PlainTextLabelProps {
|
|
2249
2320
|
shapeId: TLShapeId;
|
|
2250
|
-
type:
|
|
2321
|
+
type: Extract<TLShape, {
|
|
2322
|
+
props: {
|
|
2323
|
+
text: string;
|
|
2324
|
+
};
|
|
2325
|
+
}>['type'];
|
|
2251
2326
|
font: TLDefaultFontStyle;
|
|
2252
2327
|
fontSize: number;
|
|
2253
2328
|
lineHeight: number;
|
|
@@ -2389,7 +2464,11 @@ export declare const RichTextLabel: React_3.NamedExoticComponent<RichTextLabelPr
|
|
|
2389
2464
|
/** @public */
|
|
2390
2465
|
export declare interface RichTextLabelProps {
|
|
2391
2466
|
shapeId: TLShapeId;
|
|
2392
|
-
type:
|
|
2467
|
+
type: Extract<TLShape, {
|
|
2468
|
+
props: {
|
|
2469
|
+
richText: TLRichText;
|
|
2470
|
+
};
|
|
2471
|
+
}>['type'];
|
|
2393
2472
|
font: TLDefaultFontStyle;
|
|
2394
2473
|
fontSize: number;
|
|
2395
2474
|
lineHeight: number;
|
|
@@ -2415,7 +2494,7 @@ export declare interface RichTextLabelProps {
|
|
|
2415
2494
|
*
|
|
2416
2495
|
* @public @react
|
|
2417
2496
|
*/
|
|
2418
|
-
export declare function RichTextSVG({ bounds, richText, fontSize, font, align, verticalAlign, wrap, labelColor, padding, }: RichTextSVGProps): JSX_2.Element;
|
|
2497
|
+
export declare function RichTextSVG({ bounds, richText, fontSize, font, align, verticalAlign, wrap, labelColor, padding, showTextOutline, }: RichTextSVGProps): JSX_2.Element;
|
|
2419
2498
|
|
|
2420
2499
|
/** @public */
|
|
2421
2500
|
export declare interface RichTextSVGProps {
|
|
@@ -2428,6 +2507,7 @@ export declare interface RichTextSVGProps {
|
|
|
2428
2507
|
wrap?: boolean;
|
|
2429
2508
|
labelColor: string;
|
|
2430
2509
|
padding: number;
|
|
2510
|
+
showTextOutline?: boolean;
|
|
2431
2511
|
}
|
|
2432
2512
|
|
|
2433
2513
|
/** @public @react */
|
|
@@ -2468,9 +2548,6 @@ export declare interface SolidPathBuilderOpts extends BasePathBuilderOpts {
|
|
|
2468
2548
|
|
|
2469
2549
|
/* Excluded from this release type: Spinner */
|
|
2470
2550
|
|
|
2471
|
-
/** @public @react */
|
|
2472
|
-
export declare function SplineStylePickerSet({ styles }: StylePickerSetProps): JSX_2.Element | null;
|
|
2473
|
-
|
|
2474
2551
|
/** @public @react */
|
|
2475
2552
|
export declare function StackMenuItems(): JSX_2.Element;
|
|
2476
2553
|
|
|
@@ -2480,14 +2557,175 @@ export declare function StarToolbarItem(): JSX_2.Element;
|
|
|
2480
2557
|
/** @public */
|
|
2481
2558
|
export declare const STROKE_SIZES: Record<TLDefaultSizeStyle, number>;
|
|
2482
2559
|
|
|
2560
|
+
/**
|
|
2561
|
+
* The options object for `getStroke` or `getStrokePoints`.
|
|
2562
|
+
*
|
|
2563
|
+
* @public
|
|
2564
|
+
*/
|
|
2565
|
+
export declare interface StrokeOptions {
|
|
2566
|
+
/** The base size (diameter) of the stroke. */
|
|
2567
|
+
size?: number;
|
|
2568
|
+
/** The effect of pressure on the stroke's size. */
|
|
2569
|
+
thinning?: number;
|
|
2570
|
+
/** How much to soften the stroke's edges. */
|
|
2571
|
+
smoothing?: number;
|
|
2572
|
+
streamline?: number;
|
|
2573
|
+
/** An easing function to apply to each point's pressure. */
|
|
2574
|
+
easing?(pressure: number): number;
|
|
2575
|
+
/** Whether to simulate pressure based on velocity. */
|
|
2576
|
+
simulatePressure?: boolean;
|
|
2577
|
+
/** Cap, taper and easing for the start of the line. */
|
|
2578
|
+
start?: {
|
|
2579
|
+
cap?: boolean;
|
|
2580
|
+
easing?(distance: number): number;
|
|
2581
|
+
taper?: boolean | number;
|
|
2582
|
+
};
|
|
2583
|
+
/** Cap, taper and easing for the end of the line. */
|
|
2584
|
+
end?: {
|
|
2585
|
+
cap?: boolean;
|
|
2586
|
+
easing?(distance: number): number;
|
|
2587
|
+
taper?: boolean | number;
|
|
2588
|
+
};
|
|
2589
|
+
/** Whether to handle the points as a completed stroke. */
|
|
2590
|
+
last?: boolean;
|
|
2591
|
+
}
|
|
2592
|
+
|
|
2593
|
+
/**
|
|
2594
|
+
* The points returned by `getStrokePoints`, and the input for `getStrokeOutlinePoints`
|
|
2595
|
+
*
|
|
2596
|
+
* @public
|
|
2597
|
+
*/
|
|
2598
|
+
export declare interface StrokePoint {
|
|
2599
|
+
point: Vec;
|
|
2600
|
+
input: Vec;
|
|
2601
|
+
vector: Vec;
|
|
2602
|
+
pressure: number;
|
|
2603
|
+
distance: number;
|
|
2604
|
+
runningLength: number;
|
|
2605
|
+
radius: number;
|
|
2606
|
+
}
|
|
2607
|
+
|
|
2608
|
+
/** @public @react */
|
|
2609
|
+
export declare function StylePanelArrowheadPicker(): JSX_2.Element | null;
|
|
2610
|
+
|
|
2611
|
+
/** @public @react */
|
|
2612
|
+
export declare function StylePanelArrowKindPicker(): JSX_2.Element | null;
|
|
2613
|
+
|
|
2614
|
+
/** @public */
|
|
2615
|
+
export declare const StylePanelButtonPicker: <T extends string>(props: StylePanelButtonPickerProps<T>) => ReactElement;
|
|
2616
|
+
|
|
2617
|
+
/** @public */
|
|
2618
|
+
export declare interface StylePanelButtonPickerProps<T extends string> {
|
|
2619
|
+
title: string;
|
|
2620
|
+
uiType: string;
|
|
2621
|
+
style: StyleProp<T>;
|
|
2622
|
+
value: SharedStyle<T>;
|
|
2623
|
+
items: StyleValuesForUi<T>;
|
|
2624
|
+
onValueChange?(style: StyleProp<T>, value: T): void;
|
|
2625
|
+
onHistoryMark?(id: string): void;
|
|
2626
|
+
}
|
|
2627
|
+
|
|
2628
|
+
/** @public @react */
|
|
2629
|
+
export declare function StylePanelColorPicker(): JSX_2.Element | null;
|
|
2630
|
+
|
|
2631
|
+
/** @public */
|
|
2632
|
+
export declare interface StylePanelContext {
|
|
2633
|
+
styles: ReadonlySharedStyleMap;
|
|
2634
|
+
showUiLabels: boolean;
|
|
2635
|
+
onHistoryMark(id: string): void;
|
|
2636
|
+
onValueChange<T>(style: StyleProp<T>, value: T): void;
|
|
2637
|
+
}
|
|
2638
|
+
|
|
2639
|
+
/** @public @react */
|
|
2640
|
+
export declare function StylePanelContextProvider({ children, styles }: StylePanelContextProviderProps): JSX_2.Element;
|
|
2641
|
+
|
|
2483
2642
|
/** @public */
|
|
2484
|
-
export declare interface
|
|
2643
|
+
export declare interface StylePanelContextProviderProps {
|
|
2644
|
+
children: React.ReactNode;
|
|
2485
2645
|
styles: ReadonlySharedStyleMap;
|
|
2486
2646
|
}
|
|
2487
2647
|
|
|
2648
|
+
/** @public @react */
|
|
2649
|
+
export declare function StylePanelDashPicker(): JSX_2.Element | null;
|
|
2650
|
+
|
|
2651
|
+
/** @public @react */
|
|
2652
|
+
export declare const StylePanelDoubleDropdownPicker: <T extends string>(props: StylePanelDoubleDropdownPickerProps<T>) => React_2.JSX.Element;
|
|
2653
|
+
|
|
2654
|
+
/** @public */
|
|
2655
|
+
export declare interface StylePanelDoubleDropdownPickerProps<T extends string> {
|
|
2656
|
+
uiTypeA: string;
|
|
2657
|
+
uiTypeB: string;
|
|
2658
|
+
label: Exclude<string, TLUiTranslationKey> | TLUiTranslationKey;
|
|
2659
|
+
labelA: Exclude<string, TLUiTranslationKey> | TLUiTranslationKey;
|
|
2660
|
+
labelB: Exclude<string, TLUiTranslationKey> | TLUiTranslationKey;
|
|
2661
|
+
itemsA: StyleValuesForUi<T>;
|
|
2662
|
+
itemsB: StyleValuesForUi<T>;
|
|
2663
|
+
styleA: StyleProp<T>;
|
|
2664
|
+
styleB: StyleProp<T>;
|
|
2665
|
+
valueA: SharedStyle<T>;
|
|
2666
|
+
valueB: SharedStyle<T>;
|
|
2667
|
+
onValueChange?(style: StyleProp<T>, value: T): void;
|
|
2668
|
+
}
|
|
2669
|
+
|
|
2670
|
+
/** @public @react */
|
|
2671
|
+
export declare const StylePanelDropdownPicker: <T extends string>(props: StylePanelDropdownPickerProps<T>) => React_2.JSX.Element;
|
|
2672
|
+
|
|
2673
|
+
/** @public */
|
|
2674
|
+
export declare interface StylePanelDropdownPickerProps<T extends string> {
|
|
2675
|
+
id: string;
|
|
2676
|
+
label?: Exclude<string, TLUiTranslationKey> | TLUiTranslationKey;
|
|
2677
|
+
uiType: string;
|
|
2678
|
+
stylePanelType: string;
|
|
2679
|
+
style: StyleProp<T>;
|
|
2680
|
+
value: SharedStyle<T>;
|
|
2681
|
+
items: StyleValuesForUi<T>;
|
|
2682
|
+
type: 'icon' | 'menu' | 'tool';
|
|
2683
|
+
onValueChange?(style: StyleProp<T>, value: T): void;
|
|
2684
|
+
}
|
|
2685
|
+
|
|
2686
|
+
/** @public @react */
|
|
2687
|
+
export declare function StylePanelFillPicker(): JSX_2.Element | null;
|
|
2688
|
+
|
|
2689
|
+
/** @public @react */
|
|
2690
|
+
export declare function StylePanelFontPicker(): JSX_2.Element | null;
|
|
2691
|
+
|
|
2692
|
+
/** @public @react */
|
|
2693
|
+
export declare function StylePanelGeoShapePicker(): JSX_2.Element | null;
|
|
2694
|
+
|
|
2695
|
+
/** @public @react */
|
|
2696
|
+
export declare function StylePanelLabelAlignPicker(): JSX_2.Element | null;
|
|
2697
|
+
|
|
2698
|
+
/** @public @react */
|
|
2699
|
+
export declare function StylePanelOpacityPicker(): JSX_2.Element | null;
|
|
2700
|
+
|
|
2701
|
+
/** @public @react */
|
|
2702
|
+
export declare function StylePanelSection({ children }: StylePanelSectionProps): JSX_2.Element;
|
|
2703
|
+
|
|
2704
|
+
/** @public */
|
|
2705
|
+
export declare interface StylePanelSectionProps {
|
|
2706
|
+
children: React_3.ReactNode;
|
|
2707
|
+
}
|
|
2708
|
+
|
|
2709
|
+
/** @public @react */
|
|
2710
|
+
export declare function StylePanelSizePicker(): JSX_2.Element | null;
|
|
2711
|
+
|
|
2712
|
+
/** @public @react */
|
|
2713
|
+
export declare function StylePanelSplinePicker(): JSX_2.Element | null;
|
|
2714
|
+
|
|
2715
|
+
/** @public @react */
|
|
2716
|
+
export declare function StylePanelSubheading({ children }: StylePanelSubheadingProps): JSX_2.Element;
|
|
2717
|
+
|
|
2718
|
+
/** @public */
|
|
2719
|
+
export declare interface StylePanelSubheadingProps {
|
|
2720
|
+
children: React.ReactNode;
|
|
2721
|
+
}
|
|
2722
|
+
|
|
2723
|
+
/** @public @react */
|
|
2724
|
+
export declare function StylePanelTextAlignPicker(): JSX_2.Element | null;
|
|
2725
|
+
|
|
2488
2726
|
/** @public */
|
|
2489
2727
|
export declare type StyleValuesForUi<T> = readonly {
|
|
2490
|
-
readonly icon: string;
|
|
2728
|
+
readonly icon: string | TLUiIconJsx;
|
|
2491
2729
|
readonly value: T;
|
|
2492
2730
|
}[];
|
|
2493
2731
|
|
|
@@ -2524,12 +2762,6 @@ export declare interface TextAreaProps {
|
|
|
2524
2762
|
*/
|
|
2525
2763
|
export declare const TextDirection: Extension<any, any>;
|
|
2526
2764
|
|
|
2527
|
-
/**
|
|
2528
|
-
* @deprecated Use `PlainTextLabel` instead.
|
|
2529
|
-
* @public
|
|
2530
|
-
*/
|
|
2531
|
-
export declare const TextLabel: React_3.NamedExoticComponent<PlainTextLabelProps>;
|
|
2532
|
-
|
|
2533
2765
|
/** @public */
|
|
2534
2766
|
export declare interface TextShapeOptions {
|
|
2535
2767
|
/** How much addition padding should be added to the horizontal geometry of the shape when binding to an arrow? */
|
|
@@ -2607,18 +2839,9 @@ export declare class TextShapeUtil extends ShapeUtil<TLTextShape> {
|
|
|
2607
2839
|
} | undefined;
|
|
2608
2840
|
}
|
|
2609
2841
|
|
|
2610
|
-
/** @public @react */
|
|
2611
|
-
export declare function TextStylePickerSet({ theme, styles }: ThemeStylePickerSetProps): JSX_2.Element | null;
|
|
2612
|
-
|
|
2613
2842
|
/** @public @react */
|
|
2614
2843
|
export declare function TextToolbarItem(): JSX_2.Element;
|
|
2615
2844
|
|
|
2616
|
-
/** @public */
|
|
2617
|
-
export declare interface ThemeStylePickerSetProps {
|
|
2618
|
-
styles: ReadonlySharedStyleMap;
|
|
2619
|
-
theme: TLDefaultColorTheme;
|
|
2620
|
-
}
|
|
2621
|
-
|
|
2622
2845
|
/**
|
|
2623
2846
|
* Default extensions for the TipTap editor.
|
|
2624
2847
|
*
|
|
@@ -2744,6 +2967,17 @@ export declare interface TldrawBaseProps extends TldrawUiProps, TldrawEditorBase
|
|
|
2744
2967
|
embeds?: TLEmbedDefinition[];
|
|
2745
2968
|
}
|
|
2746
2969
|
|
|
2970
|
+
/** @public @react */
|
|
2971
|
+
export declare function TldrawCropHandles({ size, width, height, hideAlternateHandles, }: TldrawCropHandlesProps): JSX_2.Element;
|
|
2972
|
+
|
|
2973
|
+
/** @public */
|
|
2974
|
+
export declare interface TldrawCropHandlesProps {
|
|
2975
|
+
size: number;
|
|
2976
|
+
width: number;
|
|
2977
|
+
height: number;
|
|
2978
|
+
hideAlternateHandles: boolean;
|
|
2979
|
+
}
|
|
2980
|
+
|
|
2747
2981
|
/** @public */
|
|
2748
2982
|
export declare interface TldrawFile {
|
|
2749
2983
|
tldrawFileFormatVersion: number;
|
|
@@ -2864,8 +3098,12 @@ export declare function TldrawUiButtonIcon({ icon, small, invertIcon }: TLUiButt
|
|
|
2864
3098
|
/** @public @react */
|
|
2865
3099
|
export declare function TldrawUiButtonLabel({ children }: TLUiButtonLabelProps): JSX_2.Element;
|
|
2866
3100
|
|
|
2867
|
-
/**
|
|
2868
|
-
|
|
3101
|
+
/**
|
|
3102
|
+
* A column, usually of UI controls like buttons, select dropdown, checkboxes, etc.
|
|
3103
|
+
*
|
|
3104
|
+
* @public @react
|
|
3105
|
+
*/
|
|
3106
|
+
export declare const TldrawUiColumn: ForwardRefExoticComponent<TLUiLayoutProps & RefAttributes<HTMLDivElement>>;
|
|
2869
3107
|
|
|
2870
3108
|
/** @public @react */
|
|
2871
3109
|
export declare function TldrawUiComponentsProvider({ overrides, children, }: TLUiComponentsProviderProps): JSX_2.Element;
|
|
@@ -2929,9 +3167,19 @@ export declare function TldrawUiDropdownMenuTrigger({ children, ...rest }: TLUiD
|
|
|
2929
3167
|
/** @public @react */
|
|
2930
3168
|
export declare function TldrawUiEventsProvider({ onEvent, children }: EventsProviderProps): JSX_2.Element;
|
|
2931
3169
|
|
|
3170
|
+
/**
|
|
3171
|
+
* A tight grid 4 elements wide, usually of UI controls like buttons, select dropdown, checkboxes,
|
|
3172
|
+
* etc.
|
|
3173
|
+
*
|
|
3174
|
+
* @public @react */
|
|
3175
|
+
export declare const TldrawUiGrid: ForwardRefExoticComponent<TLUiLayoutProps & RefAttributes<HTMLDivElement>>;
|
|
3176
|
+
|
|
2932
3177
|
/** @public @react */
|
|
2933
3178
|
export declare const TldrawUiIcon: NamedExoticComponent<TLUiIconProps>;
|
|
2934
3179
|
|
|
3180
|
+
/** @public @react */
|
|
3181
|
+
export declare function TldrawUiInFrontOfTheCanvas(): JSX_2.Element;
|
|
3182
|
+
|
|
2935
3183
|
/** @public @react */
|
|
2936
3184
|
export declare const TldrawUiInput: React_2.ForwardRefExoticComponent<TLUiInputProps & React_2.RefAttributes<HTMLInputElement>>;
|
|
2937
3185
|
|
|
@@ -2954,7 +3202,7 @@ export declare function TldrawUiMenuContextProvider({ type, sourceId, children,
|
|
|
2954
3202
|
export declare function TldrawUiMenuGroup({ id, label, className, children }: TLUiMenuGroupProps): boolean | JSX_2.Element | Iterable<ReactNode> | null | number | string | undefined;
|
|
2955
3203
|
|
|
2956
3204
|
/** @public @react */
|
|
2957
|
-
export declare function TldrawUiMenuItem<TranslationKey extends string = string, IconType extends string = string>({ disabled, spinner, readonlyOk, id, kbd, label, icon, iconLeft, onSelect, noClose, isSelected, }: TLUiMenuItemProps<TranslationKey, IconType>): JSX_2.Element | null;
|
|
3205
|
+
export declare function TldrawUiMenuItem<TranslationKey extends string = string, IconType extends string = string>({ disabled, spinner, readonlyOk, id, kbd, label, icon, iconLeft, onSelect, noClose, isSelected, onDragStart, }: TLUiMenuItemProps<TranslationKey, IconType>): JSX_2.Element | null;
|
|
2958
3206
|
|
|
2959
3207
|
/** @public @react */
|
|
2960
3208
|
export declare function TldrawUiMenuSubmenu<Translation extends string = string>({ id, disabled, label, size, children, }: TLUiMenuSubmenuProps<Translation>): boolean | JSX_2.Element | Iterable<ReactNode> | null | number | string | undefined;
|
|
@@ -2962,8 +3210,24 @@ export declare function TldrawUiMenuSubmenu<Translation extends string = string>
|
|
|
2962
3210
|
/** @public @react */
|
|
2963
3211
|
export declare function TldrawUiMenuToolItem({ toolId, ...rest }: TLUiMenuToolItemProps): JSX_2.Element | null;
|
|
2964
3212
|
|
|
3213
|
+
/** @public */
|
|
3214
|
+
export declare interface TldrawUiOrientationContext {
|
|
3215
|
+
orientation: 'horizontal' | 'vertical';
|
|
3216
|
+
tooltipSide: 'bottom' | 'left' | 'right' | 'top';
|
|
3217
|
+
}
|
|
3218
|
+
|
|
2965
3219
|
/** @public @react */
|
|
2966
|
-
export declare function
|
|
3220
|
+
export declare function TldrawUiOrientationProvider({ children, orientation, tooltipSide, }: TldrawUiOrientationProviderProps): JSX_2.Element;
|
|
3221
|
+
|
|
3222
|
+
/** @public */
|
|
3223
|
+
export declare interface TldrawUiOrientationProviderProps {
|
|
3224
|
+
children: ReactNode;
|
|
3225
|
+
orientation: 'horizontal' | 'vertical';
|
|
3226
|
+
tooltipSide?: 'bottom' | 'left' | 'right' | 'top';
|
|
3227
|
+
}
|
|
3228
|
+
|
|
3229
|
+
/** @public @react */
|
|
3230
|
+
export declare function TldrawUiPopover({ id, children, onOpenChange, open, className }: TLUiPopoverProps): JSX_2.Element;
|
|
2967
3231
|
|
|
2968
3232
|
/** @public @react */
|
|
2969
3233
|
export declare function TldrawUiPopoverContent({ side, children, align, sideOffset, alignOffset, disableEscapeKeyDown, autoFocusFirstButton, }: TLUiPopoverContentProps): JSX_2.Element;
|
|
@@ -2993,6 +3257,13 @@ export declare interface TldrawUiProps extends TLUiContextProviderProps {
|
|
|
2993
3257
|
assetUrls?: TLUiAssetUrlOverrides;
|
|
2994
3258
|
}
|
|
2995
3259
|
|
|
3260
|
+
/**
|
|
3261
|
+
* A row, usually of UI controls like buttons, select dropdown, checkboxes, etc.
|
|
3262
|
+
*
|
|
3263
|
+
* @public @react
|
|
3264
|
+
*/
|
|
3265
|
+
export declare const TldrawUiRow: ForwardRefExoticComponent<TLUiLayoutProps & RefAttributes<HTMLDivElement>>;
|
|
3266
|
+
|
|
2996
3267
|
/** @public @react */
|
|
2997
3268
|
export declare const TldrawUiSlider: React_3.ForwardRefExoticComponent<TLUiSliderProps & React_3.RefAttributes<HTMLDivElement>>;
|
|
2998
3269
|
|
|
@@ -3006,10 +3277,32 @@ export declare const TldrawUiToolbar: React_3.ForwardRefExoticComponent<TLUiTool
|
|
|
3006
3277
|
export declare const TldrawUiToolbarButton: React_3.ForwardRefExoticComponent<TLUiToolbarButtonProps & React_3.RefAttributes<HTMLButtonElement>>;
|
|
3007
3278
|
|
|
3008
3279
|
/** @public @react */
|
|
3009
|
-
export declare const TldrawUiToolbarToggleGroup: ({ children, className, type, ...props }: TLUiToolbarToggleGroupProps) => JSX_2.Element;
|
|
3280
|
+
export declare const TldrawUiToolbarToggleGroup: ({ children, className, type, asChild, ...props }: TLUiToolbarToggleGroupProps) => JSX_2.Element;
|
|
3281
|
+
|
|
3282
|
+
/** @public @react */
|
|
3283
|
+
export declare const TldrawUiToolbarToggleItem: ({ children, className, type, value, tooltip, ...props }: TLUiToolbarToggleItemProps) => JSX_2.Element;
|
|
3010
3284
|
|
|
3011
3285
|
/** @public @react */
|
|
3012
|
-
export declare const
|
|
3286
|
+
export declare const TldrawUiTooltip: React_3.ForwardRefExoticComponent<TldrawUiTooltipProps & React_3.RefAttributes<HTMLButtonElement>>;
|
|
3287
|
+
|
|
3288
|
+
/** @public */
|
|
3289
|
+
export declare interface TldrawUiTooltipProps {
|
|
3290
|
+
children: React_3.ReactNode;
|
|
3291
|
+
content?: React_3.ReactNode | string;
|
|
3292
|
+
side?: 'bottom' | 'left' | 'right' | 'top';
|
|
3293
|
+
sideOffset?: number;
|
|
3294
|
+
disabled?: boolean;
|
|
3295
|
+
showOnMobile?: boolean;
|
|
3296
|
+
delayDuration?: number;
|
|
3297
|
+
}
|
|
3298
|
+
|
|
3299
|
+
/** @public @react */
|
|
3300
|
+
export declare function TldrawUiTooltipProvider({ children }: TldrawUiTooltipProviderProps): JSX_2.Element;
|
|
3301
|
+
|
|
3302
|
+
/** @public */
|
|
3303
|
+
export declare interface TldrawUiTooltipProviderProps {
|
|
3304
|
+
children: React_3.ReactNode;
|
|
3305
|
+
}
|
|
3013
3306
|
|
|
3014
3307
|
/* Excluded from this release type: TldrawUiTranslationProvider */
|
|
3015
3308
|
|
|
@@ -3124,7 +3417,7 @@ export declare interface TLUiA11yContextType {
|
|
|
3124
3417
|
|
|
3125
3418
|
/** @public */
|
|
3126
3419
|
export declare interface TLUiActionItem<TransationKey extends string = string, IconType extends string = string> {
|
|
3127
|
-
icon?: IconType;
|
|
3420
|
+
icon?: IconType | React_2.ReactElement;
|
|
3128
3421
|
id: string;
|
|
3129
3422
|
kbd?: string;
|
|
3130
3423
|
label?: {
|
|
@@ -3132,6 +3425,7 @@ export declare interface TLUiActionItem<TransationKey extends string = string, I
|
|
|
3132
3425
|
} | TransationKey;
|
|
3133
3426
|
readonlyOk?: boolean;
|
|
3134
3427
|
checkbox?: boolean;
|
|
3428
|
+
isRequiredA11yAction?: boolean;
|
|
3135
3429
|
onSelect(source: TLUiEventSource): Promise<void> | void;
|
|
3136
3430
|
}
|
|
3137
3431
|
|
|
@@ -3160,7 +3454,7 @@ export declare interface TLUiButtonCheckProps {
|
|
|
3160
3454
|
|
|
3161
3455
|
/** @public */
|
|
3162
3456
|
export declare interface TLUiButtonIconProps {
|
|
3163
|
-
icon: string;
|
|
3457
|
+
icon: string | TLUiIconJsx;
|
|
3164
3458
|
small?: boolean;
|
|
3165
3459
|
invertIcon?: boolean;
|
|
3166
3460
|
}
|
|
@@ -3170,18 +3464,6 @@ export declare interface TLUiButtonLabelProps {
|
|
|
3170
3464
|
children?: ReactNode;
|
|
3171
3465
|
}
|
|
3172
3466
|
|
|
3173
|
-
/** @public */
|
|
3174
|
-
export declare interface TLUiButtonPickerProps<T extends string> {
|
|
3175
|
-
title: string;
|
|
3176
|
-
uiType: string;
|
|
3177
|
-
style: StyleProp<T>;
|
|
3178
|
-
value: SharedStyle<T>;
|
|
3179
|
-
items: StyleValuesForUi<T>;
|
|
3180
|
-
theme: TLDefaultColorTheme;
|
|
3181
|
-
onValueChange(style: StyleProp<T>, value: T): void;
|
|
3182
|
-
onHistoryMark?(id: string): void;
|
|
3183
|
-
}
|
|
3184
|
-
|
|
3185
3467
|
/** @public */
|
|
3186
3468
|
export declare interface TLUiButtonProps extends React_2.HTMLAttributes<HTMLButtonElement> {
|
|
3187
3469
|
disabled?: boolean;
|
|
@@ -3216,6 +3498,7 @@ export declare interface TLUiComponents {
|
|
|
3216
3498
|
Dialogs?: ComponentType | null;
|
|
3217
3499
|
Toasts?: ComponentType | null;
|
|
3218
3500
|
A11y?: ComponentType | null;
|
|
3501
|
+
FollowingIndicator?: ComponentType | null;
|
|
3219
3502
|
}
|
|
3220
3503
|
|
|
3221
3504
|
/** @public */
|
|
@@ -3474,8 +3757,12 @@ export declare interface TLUiEventMap {
|
|
|
3474
3757
|
'delete-shapes': null;
|
|
3475
3758
|
'select-all-shapes': null;
|
|
3476
3759
|
'select-none-shapes': null;
|
|
3477
|
-
'rotate-ccw':
|
|
3478
|
-
|
|
3760
|
+
'rotate-ccw': {
|
|
3761
|
+
fine: boolean;
|
|
3762
|
+
};
|
|
3763
|
+
'rotate-cw': {
|
|
3764
|
+
fine: boolean;
|
|
3765
|
+
};
|
|
3479
3766
|
'zoom-in': {
|
|
3480
3767
|
towardsCursor: boolean;
|
|
3481
3768
|
};
|
|
@@ -3518,6 +3805,8 @@ export declare interface TLUiEventMap {
|
|
|
3518
3805
|
'toggle-paste-at-cursor': null;
|
|
3519
3806
|
'toggle-lock': null;
|
|
3520
3807
|
'toggle-reduce-motion': null;
|
|
3808
|
+
'toggle-keyboard-shortcuts': null;
|
|
3809
|
+
'toggle-ui-labels': null;
|
|
3521
3810
|
'toggle-edge-scrolling': null;
|
|
3522
3811
|
'color-scheme': {
|
|
3523
3812
|
value: string;
|
|
@@ -3535,13 +3824,17 @@ export declare interface TLUiEventMap {
|
|
|
3535
3824
|
'flatten-to-image': null;
|
|
3536
3825
|
'a11y-repeat-shape-announce': null;
|
|
3537
3826
|
'open-url': {
|
|
3538
|
-
|
|
3827
|
+
destinationUrl: string;
|
|
3539
3828
|
};
|
|
3540
3829
|
'open-context-menu': null;
|
|
3541
3830
|
'adjust-shape-styles': null;
|
|
3542
3831
|
'copy-link': null;
|
|
3832
|
+
'drag-tool': {
|
|
3833
|
+
id: string;
|
|
3834
|
+
};
|
|
3543
3835
|
'image-replace': null;
|
|
3544
3836
|
'video-replace': null;
|
|
3837
|
+
'open-kbd-shortcuts': null;
|
|
3545
3838
|
'rich-text': {
|
|
3546
3839
|
operation: 'bold' | 'bulletList' | 'heading' | 'link-edit' | 'link-remove' | 'link-visit' | 'link' | 'strike';
|
|
3547
3840
|
};
|
|
@@ -3561,9 +3854,12 @@ export declare interface TLUiHelpMenuProps {
|
|
|
3561
3854
|
children?: ReactNode;
|
|
3562
3855
|
}
|
|
3563
3856
|
|
|
3857
|
+
/** @public */
|
|
3858
|
+
export declare type TLUiIconJsx = ReactElement<React.HTMLAttributes<HTMLDivElement>>;
|
|
3859
|
+
|
|
3564
3860
|
/** @public */
|
|
3565
3861
|
export declare interface TLUiIconProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3566
|
-
icon: Exclude<string, TLUiIconType> | TLUiIconType;
|
|
3862
|
+
icon: Exclude<string, TLUiIconType> | TLUiIconJsx | TLUiIconType;
|
|
3567
3863
|
label: string;
|
|
3568
3864
|
small?: boolean;
|
|
3569
3865
|
color?: string;
|
|
@@ -3622,6 +3918,13 @@ export declare type TLUiKeyboardShortcutsDialogProps = TLUiDialogProps & {
|
|
|
3622
3918
|
children?: ReactNode;
|
|
3623
3919
|
};
|
|
3624
3920
|
|
|
3921
|
+
/** @public */
|
|
3922
|
+
export declare interface TLUiLayoutProps extends HTMLAttributes<HTMLDivElement> {
|
|
3923
|
+
children: ReactNode;
|
|
3924
|
+
tooltipSide?: 'bottom' | 'left' | 'right' | 'top';
|
|
3925
|
+
asChild?: boolean;
|
|
3926
|
+
}
|
|
3927
|
+
|
|
3625
3928
|
/** @public */
|
|
3626
3929
|
export declare interface TLUiMainMenuProps {
|
|
3627
3930
|
children?: ReactNode;
|
|
@@ -3639,7 +3942,7 @@ export declare type TLUiMenuActionItemProps = {
|
|
|
3639
3942
|
|
|
3640
3943
|
/** @public */
|
|
3641
3944
|
export declare interface TLUiMenuCheckboxItemProps<TranslationKey extends string = string, IconType extends string = string> {
|
|
3642
|
-
icon?: IconType;
|
|
3945
|
+
icon?: IconType | TLUiIconJsx;
|
|
3643
3946
|
id: string;
|
|
3644
3947
|
kbd?: string;
|
|
3645
3948
|
title?: string;
|
|
@@ -3661,7 +3964,7 @@ export declare interface TLUiMenuContextProviderProps {
|
|
|
3661
3964
|
}
|
|
3662
3965
|
|
|
3663
3966
|
/** @public */
|
|
3664
|
-
export declare type TLUiMenuContextType = 'context-menu' | 'helper-buttons' | 'icons' | 'keyboard-shortcuts' | 'menu' | '
|
|
3967
|
+
export declare type TLUiMenuContextType = 'context-menu' | 'helper-buttons' | 'icons' | 'keyboard-shortcuts' | 'menu' | 'small-icons' | 'toolbar-overflow' | 'toolbar';
|
|
3665
3968
|
|
|
3666
3969
|
/** @public */
|
|
3667
3970
|
export declare interface TLUiMenuGroupProps<TranslationKey extends string = string> {
|
|
@@ -3682,11 +3985,11 @@ export declare interface TLUiMenuItemProps<TranslationKey extends string = strin
|
|
|
3682
3985
|
/**
|
|
3683
3986
|
* The icon to display on the item. Icons are only shown in certain menu types.
|
|
3684
3987
|
*/
|
|
3685
|
-
icon?: IconType;
|
|
3988
|
+
icon?: IconType | TLUiIconJsx;
|
|
3686
3989
|
/**
|
|
3687
3990
|
* An icon to display to the left of the menu item.
|
|
3688
3991
|
*/
|
|
3689
|
-
iconLeft?: IconType;
|
|
3992
|
+
iconLeft?: IconType | TLUiIconJsx;
|
|
3690
3993
|
/**
|
|
3691
3994
|
* The keyboard shortcut to display on the item.
|
|
3692
3995
|
*/
|
|
@@ -3721,6 +4024,10 @@ export declare interface TLUiMenuItemProps<TranslationKey extends string = strin
|
|
|
3721
4024
|
* Whether the item is selected.
|
|
3722
4025
|
*/
|
|
3723
4026
|
isSelected?: boolean;
|
|
4027
|
+
/**
|
|
4028
|
+
* The function to call when the item is dragged. If this is provided, the item will be draggable.
|
|
4029
|
+
*/
|
|
4030
|
+
onDragStart?(source: TLUiEventSource, info: TLPointerEventInfo): void;
|
|
3724
4031
|
}
|
|
3725
4032
|
|
|
3726
4033
|
/** @public */
|
|
@@ -3766,6 +4073,7 @@ export declare interface TLUiPopoverProps {
|
|
|
3766
4073
|
open?: boolean;
|
|
3767
4074
|
children: React_3.ReactNode;
|
|
3768
4075
|
onOpenChange?(isOpen: boolean): void;
|
|
4076
|
+
className?: string;
|
|
3769
4077
|
}
|
|
3770
4078
|
|
|
3771
4079
|
/** @public */
|
|
@@ -3791,18 +4099,15 @@ export declare interface TLUiSliderProps {
|
|
|
3791
4099
|
label: string;
|
|
3792
4100
|
title: string;
|
|
3793
4101
|
onValueChange(value: number): void;
|
|
3794
|
-
onHistoryMark(id: string): void;
|
|
4102
|
+
onHistoryMark?(id: string): void;
|
|
3795
4103
|
'data-testid'?: string;
|
|
3796
|
-
|
|
3797
|
-
|
|
3798
|
-
/** @public */
|
|
3799
|
-
export declare interface TLUiStylePanelContentProps {
|
|
3800
|
-
styles: ReturnType<typeof useRelevantStyles>;
|
|
4104
|
+
ariaValueModifier?: number;
|
|
3801
4105
|
}
|
|
3802
4106
|
|
|
3803
4107
|
/** @public */
|
|
3804
4108
|
export declare interface TLUiStylePanelProps {
|
|
3805
4109
|
isMobile?: boolean;
|
|
4110
|
+
styles?: null | ReadonlySharedStyleMap;
|
|
3806
4111
|
children?: ReactNode;
|
|
3807
4112
|
}
|
|
3808
4113
|
|
|
@@ -3850,6 +4155,7 @@ export declare interface TLUiToolbarButtonProps extends React_3.HTMLAttributes<H
|
|
|
3850
4155
|
disabled?: boolean;
|
|
3851
4156
|
isActive?: boolean;
|
|
3852
4157
|
type: 'icon' | 'menu' | 'tool';
|
|
4158
|
+
tooltip?: string;
|
|
3853
4159
|
}
|
|
3854
4160
|
|
|
3855
4161
|
/** @public */
|
|
@@ -3858,6 +4164,8 @@ export declare interface TLUiToolbarProps extends React_3.HTMLAttributes<HTMLDiv
|
|
|
3858
4164
|
className?: string;
|
|
3859
4165
|
dir?: 'ltr' | 'rtl';
|
|
3860
4166
|
label: string;
|
|
4167
|
+
orientation?: 'grid' | 'horizontal' | 'vertical';
|
|
4168
|
+
tooltipSide?: 'bottom' | 'left' | 'right' | 'top';
|
|
3861
4169
|
}
|
|
3862
4170
|
|
|
3863
4171
|
/** @public */
|
|
@@ -3865,8 +4173,10 @@ export declare interface TLUiToolbarToggleGroupProps extends React_3.HTMLAttribu
|
|
|
3865
4173
|
children?: React_3.ReactNode;
|
|
3866
4174
|
className?: string;
|
|
3867
4175
|
dir?: 'ltr' | 'rtl';
|
|
4176
|
+
value: any;
|
|
3868
4177
|
defaultValue?: any;
|
|
3869
4178
|
type: 'multiple' | 'single';
|
|
4179
|
+
asChild?: boolean;
|
|
3870
4180
|
}
|
|
3871
4181
|
|
|
3872
4182
|
/** @public */
|
|
@@ -3875,6 +4185,7 @@ export declare interface TLUiToolbarToggleItemProps extends React_3.HTMLAttribut
|
|
|
3875
4185
|
className?: string;
|
|
3876
4186
|
type: 'icon' | 'tool';
|
|
3877
4187
|
value: string;
|
|
4188
|
+
tooltip?: string;
|
|
3878
4189
|
}
|
|
3879
4190
|
|
|
3880
4191
|
/** @public */
|
|
@@ -3882,8 +4193,9 @@ export declare interface TLUiToolItem<TranslationKey extends string = string, Ic
|
|
|
3882
4193
|
id: string;
|
|
3883
4194
|
label: TranslationKey;
|
|
3884
4195
|
shortcutsLabel?: TranslationKey;
|
|
3885
|
-
icon: IconType;
|
|
4196
|
+
icon: IconType | TLUiIconJsx;
|
|
3886
4197
|
onSelect(source: TLUiEventSource): void;
|
|
4198
|
+
onDragStart?(source: TLUiEventSource, info: TLPointerEventInfo): void;
|
|
3887
4199
|
/**
|
|
3888
4200
|
* The keyboard shortcut for this tool. This is a string that can be a single key,
|
|
3889
4201
|
* or a combination of keys.
|
|
@@ -3919,7 +4231,7 @@ export declare interface TLUiTranslation {
|
|
|
3919
4231
|
export declare type TLUiTranslationContextType = TLUiTranslation;
|
|
3920
4232
|
|
|
3921
4233
|
/** @public */
|
|
3922
|
-
export declare type TLUiTranslationKey = 'a11y.adjust-shape-styles' | 'a11y.enlarge-shape' | 'a11y.enter-leave-container' | 'a11y.move-shape-faster' | 'a11y.move-shape' | 'a11y.multiple-shapes' | 'a11y.open-context-menu' | 'a11y.pan-camera' | 'a11y.repeat-shape' | 'a11y.select-shape-direction' | 'a11y.select-shape' | 'a11y.shape-image' | 'a11y.shape-index' | 'a11y.shape-video' | 'a11y.shrink-shape' | 'a11y.skip-to-main-content' | 'a11y.status' | 'action.align-bottom' | 'action.align-center-horizontal.short' | 'action.align-center-horizontal' | 'action.align-center-vertical.short' | 'action.align-center-vertical' | 'action.align-left' | 'action.align-right' | 'action.align-top' | 'action.back-to-content' | 'action.bring-forward' | 'action.bring-to-front' | 'action.convert-to-bookmark' | 'action.convert-to-embed' | 'action.copy-as-png.short' | 'action.copy-as-png' | 'action.copy-as-svg.short' | 'action.copy-as-svg' | 'action.copy' | 'action.cut' | 'action.delete' | 'action.distribute-horizontal.short' | 'action.distribute-horizontal' | 'action.distribute-vertical.short' | 'action.distribute-vertical' | 'action.download-original' | 'action.duplicate' | 'action.edit-link' | 'action.exit-pen-mode' | 'action.export-all-as-png.short' | 'action.export-all-as-png' | 'action.export-all-as-svg.short' | 'action.export-all-as-svg' | 'action.export-as-png.short' | 'action.export-as-png' | 'action.export-as-svg.short' | 'action.export-as-svg' | 'action.fit-frame-to-content' | 'action.flatten-to-image' | 'action.flip-horizontal.short' | 'action.flip-horizontal' | 'action.flip-vertical.short' | 'action.flip-vertical' | 'action.fork-project-on-tldraw' | 'action.fork-project' | 'action.group' | 'action.insert-embed' | 'action.insert-media' | 'action.leave-shared-project' | 'action.new-project' | 'action.new-shared-project' | 'action.open-cursor-chat' | 'action.open-embed-link' | 'action.open-file' | 'action.pack' | 'action.paste-error-description' | 'action.paste-error-title' | 'action.paste' | 'action.print' | 'action.redo' | 'action.remove-frame' | 'action.rename' | 'action.rotate-ccw' | 'action.rotate-cw' | 'action.save-copy' | 'action.select-all' | 'action.select-none' | 'action.send-backward' | 'action.send-to-back' | 'action.share-project' | 'action.stack-horizontal.short' | 'action.stack-horizontal' | 'action.stack-vertical.short' | 'action.stack-vertical' | 'action.stop-following' | 'action.stretch-horizontal.short' | 'action.stretch-horizontal' | 'action.stretch-vertical.short' | 'action.stretch-vertical' | 'action.toggle-auto-size' | 'action.toggle-dark-mode.menu' | 'action.toggle-dark-mode' | 'action.toggle-debug-mode.menu' | 'action.toggle-debug-mode' | 'action.toggle-dynamic-size-mode.menu' | 'action.toggle-dynamic-size-mode' | 'action.toggle-edge-scrolling.menu' | 'action.toggle-edge-scrolling' | 'action.toggle-focus-mode.menu' | 'action.toggle-focus-mode' | 'action.toggle-grid.menu' | 'action.toggle-grid' | 'action.toggle-lock' | 'action.toggle-paste-at-cursor.menu' | 'action.toggle-paste-at-cursor' | 'action.toggle-reduce-motion.menu' | 'action.toggle-reduce-motion' | 'action.toggle-snap-mode.menu' | 'action.toggle-snap-mode' | 'action.toggle-tool-lock.menu' | 'action.toggle-tool-lock' | 'action.toggle-transparent.context-menu' | 'action.toggle-transparent.menu' | 'action.toggle-transparent' | 'action.toggle-wrap-mode.menu' | 'action.toggle-wrap-mode' | 'action.undo' | 'action.ungroup' | 'action.unlock-all' | 'action.zoom-in' | 'action.zoom-out' | 'action.zoom-to-100' | 'action.zoom-to-fit' | 'action.zoom-to-selection' | 'actions-menu.title' | 'align-style.end' | 'align-style.justify' | 'align-style.middle' | 'align-style.start' | 'app.loading' | 'arrow-kind-style.arc' | 'arrow-kind-style.elbow' | 'arrowheadEnd-style.arrow' | 'arrowheadEnd-style.bar' | 'arrowheadEnd-style.diamond' | 'arrowheadEnd-style.dot' | 'arrowheadEnd-style.inverted' | 'arrowheadEnd-style.none' | 'arrowheadEnd-style.pipe' | 'arrowheadEnd-style.square' | 'arrowheadEnd-style.triangle' | 'arrowheadStart-style.arrow' | 'arrowheadStart-style.bar' | 'arrowheadStart-style.diamond' | 'arrowheadStart-style.dot' | 'arrowheadStart-style.inverted' | 'arrowheadStart-style.none' | 'arrowheadStart-style.pipe' | 'arrowheadStart-style.square' | 'arrowheadStart-style.triangle' | 'assets.files.amount-too-many' | 'assets.files.size-too-big' | 'assets.files.type-not-allowed' | 'assets.files.upload-failed' | 'assets.url.failed' | 'color-style.black' | 'color-style.blue' | 'color-style.green' | 'color-style.grey' | 'color-style.light-blue' | 'color-style.light-green' | 'color-style.light-red' | 'color-style.light-violet' | 'color-style.orange' | 'color-style.red' | 'color-style.violet' | 'color-style.white' | 'color-style.yellow' | 'context-menu.arrange' | 'context-menu.copy-as' | 'context-menu.edit' | 'context-menu.export-all-as' | 'context-menu.export-as' | 'context-menu.move-to-page' | 'context-menu.reorder' | 'context-menu.title' | 'context.pages.new-page' | 'cursor-chat.type-to-chat' | 'dash-style.dashed' | 'dash-style.dotted' | 'dash-style.draw' | 'dash-style.solid' | 'document-name-menu.copy-link' | 'document.default-name' | 'edit-link-dialog.cancel' | 'edit-link-dialog.clear' | 'edit-link-dialog.detail' | 'edit-link-dialog.external-link' | 'edit-link-dialog.invalid-url' | 'edit-link-dialog.save' | 'edit-link-dialog.title' | 'edit-link-dialog.url' | 'embed-dialog.back' | 'embed-dialog.cancel' | 'embed-dialog.create' | 'embed-dialog.instruction' | 'embed-dialog.invalid-url' | 'embed-dialog.title' | 'embed-dialog.url' | 'file-system.confirm-clear.cancel' | 'file-system.confirm-clear.continue' | 'file-system.confirm-clear.description' | 'file-system.confirm-clear.dont-show-again' | 'file-system.confirm-clear.title' | 'file-system.confirm-open.cancel' | 'file-system.confirm-open.description' | 'file-system.confirm-open.dont-show-again' | 'file-system.confirm-open.open' | 'file-system.confirm-open.title' | 'file-system.file-open-error.file-format-version-too-new' | 'file-system.file-open-error.generic-corrupted-file' | 'file-system.file-open-error.not-a-tldraw-file' | 'file-system.file-open-error.title' | 'file-system.shared-document-file-open-error.description' | 'file-system.shared-document-file-open-error.title' | 'fill-style.fill' | 'fill-style.none' | 'fill-style.pattern' | 'fill-style.semi' | 'fill-style.solid' | 'focus-mode.toggle-focus-mode' | 'font-style.draw' | 'font-style.mono' | 'font-style.sans' | 'font-style.serif' | 'geo-style.arrow-down' | 'geo-style.arrow-left' | 'geo-style.arrow-right' | 'geo-style.arrow-up' | 'geo-style.check-box' | 'geo-style.cloud' | 'geo-style.diamond' | 'geo-style.ellipse' | 'geo-style.heart' | 'geo-style.hexagon' | 'geo-style.octagon' | 'geo-style.oval' | 'geo-style.pentagon' | 'geo-style.rectangle' | 'geo-style.rhombus' | 'geo-style.star' | 'geo-style.trapezoid' | 'geo-style.triangle' | 'geo-style.x-box' | 'handle.crop.bottom-left' | 'handle.crop.bottom-right' | 'handle.crop.bottom' | 'handle.crop.left' | 'handle.crop.right' | 'handle.crop.top-left' | 'handle.crop.top-right' | 'handle.crop.top' | 'handle.resize-bottom-left' | 'handle.resize-bottom-right' | 'handle.resize-bottom' | 'handle.resize-left' | 'handle.resize-right' | 'handle.resize-top-left' | 'handle.resize-top-right' | 'handle.resize-top' | 'handle.rotate.bottom_left_rotate' | 'handle.rotate.bottom_right_rotate' | 'handle.rotate.mobile_rotate' | 'handle.rotate.top_left_rotate' | 'handle.rotate.top_right_rotate' | 'help-menu.about' | 'help-menu.discord' | 'help-menu.github' | 'help-menu.import-tldr-file' | 'help-menu.keyboard-shortcuts' | 'help-menu.privacy' | 'help-menu.terms' | 'help-menu.title' | 'help-menu.twitter' | 'menu.copy-as' | 'menu.edit' | 'menu.export-as' | 'menu.file' | 'menu.language' | 'menu.preferences' | 'menu.theme' | 'menu.title' | 'menu.view' | 'navigation-zone.minimap' | 'navigation-zone.title' | 'navigation-zone.toggle-minimap' | 'navigation-zone.zoom' | 'opacity-style.0.1' | 'opacity-style.0.25' | 'opacity-style.0.5' | 'opacity-style.0.75' | 'opacity-style.1' | 'page-menu.create-new-page' | 'page-menu.edit-done' | 'page-menu.edit-start' | 'page-menu.go-to-page' | 'page-menu.max-page-count-reached' | 'page-menu.new-page-initial-name' | 'page-menu.submenu.delete' | 'page-menu.submenu.duplicate-page' | 'page-menu.submenu.move-down' | 'page-menu.submenu.move-up' | 'page-menu.submenu.rename' | 'page-menu.submenu.title' | 'page-menu.title' | 'people-menu.anonymous-user' | 'people-menu.avatar-color' | 'people-menu.change-color' | 'people-menu.change-name' | 'people-menu.follow' | 'people-menu.following' | 'people-menu.invite' | 'people-menu.leading' | 'people-menu.title' | 'people-menu.user' | 'share-menu.copied' | 'share-menu.copy-link-note' | 'share-menu.copy-link' | 'share-menu.copy-readonly-link-note' | 'share-menu.copy-readonly-link' | 'share-menu.create-snapshot-link' | 'share-menu.creating-project' | 'share-menu.fork-note' | 'share-menu.offline-note' | 'share-menu.project-too-large' | 'share-menu.save-note' | 'share-menu.share-project' | 'share-menu.snapshot-link-note' | 'share-menu.title' | 'share-menu.upload-failed' | 'sharing.confirm-leave.cancel' | 'sharing.confirm-leave.description' | 'sharing.confirm-leave.dont-show-again' | 'sharing.confirm-leave.leave' | 'sharing.confirm-leave.title' | 'shortcuts-dialog.a11y' | 'shortcuts-dialog.collaboration' | 'shortcuts-dialog.edit' | 'shortcuts-dialog.file' | 'shortcuts-dialog.preferences' | 'shortcuts-dialog.text-formatting' | 'shortcuts-dialog.title' | 'shortcuts-dialog.tools' | 'shortcuts-dialog.transform' | 'shortcuts-dialog.view' | 'size-style.l' | 'size-style.m' | 'size-style.s' | 'size-style.xl' | 'spline-style.cubic' | 'spline-style.line' | 'status.offline' | 'style-panel.align' | 'style-panel.arrow-kind' | 'style-panel.arrowhead-end' | 'style-panel.arrowhead-start' | 'style-panel.arrowheads' | 'style-panel.color' | 'style-panel.dash' | 'style-panel.fill' | 'style-panel.font' | 'style-panel.geo' | 'style-panel.label-align' | 'style-panel.mixed' | 'style-panel.opacity' | 'style-panel.position' | 'style-panel.size' | 'style-panel.spline' | 'style-panel.title' | 'style-panel.vertical-align' | 'theme.dark' | 'theme.light' | 'theme.system' | 'toast.close' | 'toast.error.copy-fail.desc' | 'toast.error.copy-fail.title' | 'toast.error.export-fail.desc' | 'toast.error.export-fail.title' | 'toast.error' | 'toast.info' | 'toast.success' | 'toast.warning' | 'tool-panel.more' | 'tool-panel.title' | 'tool.arrow-down' | 'tool.arrow-left' | 'tool.arrow-right' | 'tool.arrow-up' | 'tool.arrow' | 'tool.aspect-ratio.circle' | 'tool.aspect-ratio.landscape' | 'tool.aspect-ratio.original' | 'tool.aspect-ratio.portrait' | 'tool.aspect-ratio.square' | 'tool.aspect-ratio.wide' | 'tool.aspect-ratio' | 'tool.bookmark' | 'tool.check-box' | 'tool.cloud' | 'tool.diamond' | 'tool.draw' | 'tool.ellipse' | 'tool.embed' | 'tool.eraser' | 'tool.flip-horz' | 'tool.flip-vert' | 'tool.frame' | 'tool.hand' | 'tool.heart' | 'tool.hexagon' | 'tool.highlight' | 'tool.image-crop' | 'tool.image-toolbar-title' | 'tool.image-zoom' | 'tool.laser' | 'tool.line' | 'tool.media-alt-text-confirm' | 'tool.media-alt-text-desc' | 'tool.media-alt-text' | 'tool.media' | 'tool.note' | 'tool.octagon' | 'tool.oval' | 'tool.pentagon' | 'tool.pointer-down' | 'tool.rectangle' | 'tool.replace-media' | 'tool.rhombus' | 'tool.rich-text-bold' | 'tool.rich-text-bulletList' | 'tool.rich-text-code' | 'tool.rich-text-header' | 'tool.rich-text-highlight' | 'tool.rich-text-italic' | 'tool.rich-text-link-remove' | 'tool.rich-text-link-visit' | 'tool.rich-text-link' | 'tool.rich-text-orderedList' | 'tool.rich-text-strikethrough' | 'tool.rich-text-toolbar-title' | 'tool.rotate-cw' | 'tool.select' | 'tool.star' | 'tool.text' | 'tool.trapezoid' | 'tool.triangle' | 'tool.x-box' | 'ui.checked' | 'ui.close' | 'ui.unchecked' | 'verticalAlign-style.end' | 'verticalAlign-style.middle' | 'verticalAlign-style.start' | 'vscode.file-open.backup-failed' | 'vscode.file-open.backup-saved' | 'vscode.file-open.backup' | 'vscode.file-open.desc' | 'vscode.file-open.dont-show-again' | 'vscode.file-open.open';
|
|
4234
|
+
export declare type TLUiTranslationKey = 'a11y.adjust-shape-styles' | 'a11y.enlarge-shape' | 'a11y.enter-leave-container' | 'a11y.move-shape-faster' | 'a11y.move-shape' | 'a11y.multiple-shapes' | 'a11y.open-context-menu' | 'a11y.open-keyboard-shortcuts' | 'a11y.pan-camera' | 'a11y.repeat-shape' | 'a11y.rotate-shape-ccw-fine' | 'a11y.rotate-shape-ccw' | 'a11y.rotate-shape-cw-fine' | 'a11y.rotate-shape-cw' | 'a11y.select-shape-direction' | 'a11y.select-shape' | 'a11y.shape-image' | 'a11y.shape-index' | 'a11y.shape-video' | 'a11y.shrink-shape' | 'a11y.skip-to-main-content' | 'a11y.status' | 'action.align-bottom' | 'action.align-center-horizontal.short' | 'action.align-center-horizontal' | 'action.align-center-vertical.short' | 'action.align-center-vertical' | 'action.align-left' | 'action.align-right' | 'action.align-top' | 'action.back-to-content' | 'action.bring-forward' | 'action.bring-to-front' | 'action.convert-to-bookmark' | 'action.convert-to-embed' | 'action.copy-as-png.short' | 'action.copy-as-png' | 'action.copy-as-svg.short' | 'action.copy-as-svg' | 'action.copy' | 'action.cut' | 'action.delete' | 'action.distribute-horizontal.short' | 'action.distribute-horizontal' | 'action.distribute-vertical.short' | 'action.distribute-vertical' | 'action.download-original' | 'action.duplicate' | 'action.edit-link' | 'action.exit-pen-mode' | 'action.export-all-as-png.short' | 'action.export-all-as-png' | 'action.export-all-as-svg.short' | 'action.export-all-as-svg' | 'action.export-as-png.short' | 'action.export-as-png' | 'action.export-as-svg.short' | 'action.export-as-svg' | 'action.fit-frame-to-content' | 'action.flatten-to-image' | 'action.flip-horizontal.short' | 'action.flip-horizontal' | 'action.flip-vertical.short' | 'action.flip-vertical' | 'action.fork-project-on-tldraw' | 'action.fork-project' | 'action.group' | 'action.insert-embed' | 'action.insert-media' | 'action.leave-shared-project' | 'action.new-project' | 'action.new-shared-project' | 'action.open-cursor-chat' | 'action.open-embed-link' | 'action.open-file' | 'action.open-kbd-shortcuts' | 'action.pack' | 'action.paste-error-description' | 'action.paste-error-title' | 'action.paste' | 'action.print' | 'action.redo' | 'action.remove-frame' | 'action.rename' | 'action.rotate-ccw' | 'action.rotate-cw' | 'action.save-copy' | 'action.select-all' | 'action.select-none' | 'action.send-backward' | 'action.send-to-back' | 'action.share-project' | 'action.stack-horizontal.short' | 'action.stack-horizontal' | 'action.stack-vertical.short' | 'action.stack-vertical' | 'action.stop-following' | 'action.stretch-horizontal.short' | 'action.stretch-horizontal' | 'action.stretch-vertical.short' | 'action.stretch-vertical' | 'action.toggle-auto-size' | 'action.toggle-dark-mode.menu' | 'action.toggle-dark-mode' | 'action.toggle-debug-mode.menu' | 'action.toggle-debug-mode' | 'action.toggle-dynamic-size-mode.menu' | 'action.toggle-dynamic-size-mode' | 'action.toggle-edge-scrolling.menu' | 'action.toggle-edge-scrolling' | 'action.toggle-focus-mode.menu' | 'action.toggle-focus-mode' | 'action.toggle-grid.menu' | 'action.toggle-grid' | 'action.toggle-keyboard-shortcuts.menu' | 'action.toggle-keyboard-shortcuts' | 'action.toggle-lock' | 'action.toggle-paste-at-cursor.menu' | 'action.toggle-paste-at-cursor' | 'action.toggle-reduce-motion.menu' | 'action.toggle-reduce-motion' | 'action.toggle-snap-mode.menu' | 'action.toggle-snap-mode' | 'action.toggle-tool-lock.menu' | 'action.toggle-tool-lock' | 'action.toggle-transparent.context-menu' | 'action.toggle-transparent.menu' | 'action.toggle-transparent' | 'action.toggle-ui-labels.menu' | 'action.toggle-ui-labels' | 'action.toggle-wrap-mode.menu' | 'action.toggle-wrap-mode' | 'action.undo' | 'action.ungroup' | 'action.unlock-all' | 'action.zoom-in' | 'action.zoom-out' | 'action.zoom-to-100' | 'action.zoom-to-fit' | 'action.zoom-to-selection' | 'actions-menu.title' | 'align-style.end' | 'align-style.justify' | 'align-style.middle' | 'align-style.start' | 'app.loading' | 'arrow-kind-style.arc' | 'arrow-kind-style.elbow' | 'arrowheadEnd-style.arrow' | 'arrowheadEnd-style.bar' | 'arrowheadEnd-style.diamond' | 'arrowheadEnd-style.dot' | 'arrowheadEnd-style.inverted' | 'arrowheadEnd-style.none' | 'arrowheadEnd-style.pipe' | 'arrowheadEnd-style.square' | 'arrowheadEnd-style.triangle' | 'arrowheadStart-style.arrow' | 'arrowheadStart-style.bar' | 'arrowheadStart-style.diamond' | 'arrowheadStart-style.dot' | 'arrowheadStart-style.inverted' | 'arrowheadStart-style.none' | 'arrowheadStart-style.pipe' | 'arrowheadStart-style.square' | 'arrowheadStart-style.triangle' | 'assets.files.amount-too-many' | 'assets.files.size-too-big' | 'assets.files.type-not-allowed' | 'assets.files.upload-failed' | 'assets.url.failed' | 'color-style.black' | 'color-style.blue' | 'color-style.green' | 'color-style.grey' | 'color-style.light-blue' | 'color-style.light-green' | 'color-style.light-red' | 'color-style.light-violet' | 'color-style.orange' | 'color-style.red' | 'color-style.violet' | 'color-style.white' | 'color-style.yellow' | 'context-menu.arrange' | 'context-menu.copy-as' | 'context-menu.edit' | 'context-menu.export-all-as' | 'context-menu.export-as' | 'context-menu.move-to-page' | 'context-menu.reorder' | 'context-menu.title' | 'context.pages.new-page' | 'cursor-chat.type-to-chat' | 'dash-style.dashed' | 'dash-style.dotted' | 'dash-style.draw' | 'dash-style.solid' | 'document-name-menu.copy-link' | 'document.default-name' | 'edit-link-dialog.cancel' | 'edit-link-dialog.clear' | 'edit-link-dialog.detail' | 'edit-link-dialog.external-link' | 'edit-link-dialog.invalid-url' | 'edit-link-dialog.save' | 'edit-link-dialog.title' | 'edit-link-dialog.url' | 'embed-dialog.back' | 'embed-dialog.cancel' | 'embed-dialog.create' | 'embed-dialog.instruction' | 'embed-dialog.invalid-url' | 'embed-dialog.title' | 'embed-dialog.url' | 'file-system.confirm-clear.cancel' | 'file-system.confirm-clear.continue' | 'file-system.confirm-clear.description' | 'file-system.confirm-clear.dont-show-again' | 'file-system.confirm-clear.title' | 'file-system.confirm-open.cancel' | 'file-system.confirm-open.description' | 'file-system.confirm-open.dont-show-again' | 'file-system.confirm-open.open' | 'file-system.confirm-open.title' | 'file-system.file-open-error.file-format-version-too-new' | 'file-system.file-open-error.generic-corrupted-file' | 'file-system.file-open-error.not-a-tldraw-file' | 'file-system.file-open-error.title' | 'file-system.shared-document-file-open-error.description' | 'file-system.shared-document-file-open-error.title' | 'fill-style.fill' | 'fill-style.none' | 'fill-style.pattern' | 'fill-style.semi' | 'fill-style.solid' | 'focus-mode.toggle-focus-mode' | 'font-style.draw' | 'font-style.mono' | 'font-style.sans' | 'font-style.serif' | 'geo-style.arrow-down' | 'geo-style.arrow-left' | 'geo-style.arrow-right' | 'geo-style.arrow-up' | 'geo-style.check-box' | 'geo-style.cloud' | 'geo-style.diamond' | 'geo-style.ellipse' | 'geo-style.heart' | 'geo-style.hexagon' | 'geo-style.octagon' | 'geo-style.oval' | 'geo-style.pentagon' | 'geo-style.rectangle' | 'geo-style.rhombus-2' | 'geo-style.rhombus' | 'geo-style.star' | 'geo-style.trapezoid' | 'geo-style.triangle' | 'geo-style.x-box' | 'handle.crop.bottom-left' | 'handle.crop.bottom-right' | 'handle.crop.bottom' | 'handle.crop.left' | 'handle.crop.right' | 'handle.crop.top-left' | 'handle.crop.top-right' | 'handle.crop.top' | 'handle.resize-bottom-left' | 'handle.resize-bottom-right' | 'handle.resize-bottom' | 'handle.resize-left' | 'handle.resize-right' | 'handle.resize-top-left' | 'handle.resize-top-right' | 'handle.resize-top' | 'handle.rotate.bottom_left_rotate' | 'handle.rotate.bottom_right_rotate' | 'handle.rotate.mobile_rotate' | 'handle.rotate.top_left_rotate' | 'handle.rotate.top_right_rotate' | 'help-menu.about' | 'help-menu.discord' | 'help-menu.github' | 'help-menu.import-tldr-file' | 'help-menu.keyboard-shortcuts' | 'help-menu.privacy' | 'help-menu.terms' | 'help-menu.title' | 'help-menu.twitter' | 'menu.accessibility' | 'menu.copy-as' | 'menu.edit' | 'menu.export-as' | 'menu.file' | 'menu.language' | 'menu.preferences' | 'menu.theme' | 'menu.title' | 'menu.view' | 'navigation-zone.minimap' | 'navigation-zone.title' | 'navigation-zone.toggle-minimap' | 'navigation-zone.zoom' | 'opacity-style.0.1' | 'opacity-style.0.25' | 'opacity-style.0.5' | 'opacity-style.0.75' | 'opacity-style.1' | 'page-menu.create-new-page' | 'page-menu.edit-done' | 'page-menu.edit-start' | 'page-menu.go-to-page' | 'page-menu.max-page-count-reached' | 'page-menu.new-page-initial-name' | 'page-menu.submenu.delete' | 'page-menu.submenu.duplicate-page' | 'page-menu.submenu.move-down' | 'page-menu.submenu.move-up' | 'page-menu.submenu.rename' | 'page-menu.submenu.title' | 'page-menu.title' | 'people-menu.anonymous-user' | 'people-menu.avatar-color' | 'people-menu.change-color' | 'people-menu.change-name' | 'people-menu.follow' | 'people-menu.following' | 'people-menu.invite' | 'people-menu.leading' | 'people-menu.title' | 'people-menu.user' | 'share-menu.copied' | 'share-menu.copy-link-note' | 'share-menu.copy-link' | 'share-menu.copy-readonly-link-note' | 'share-menu.copy-readonly-link' | 'share-menu.create-snapshot-link' | 'share-menu.creating-project' | 'share-menu.fork-note' | 'share-menu.offline-note' | 'share-menu.project-too-large' | 'share-menu.save-note' | 'share-menu.share-project' | 'share-menu.snapshot-link-note' | 'share-menu.title' | 'share-menu.upload-failed' | 'sharing.confirm-leave.cancel' | 'sharing.confirm-leave.description' | 'sharing.confirm-leave.dont-show-again' | 'sharing.confirm-leave.leave' | 'sharing.confirm-leave.title' | 'shortcuts-dialog.a11y' | 'shortcuts-dialog.collaboration' | 'shortcuts-dialog.edit' | 'shortcuts-dialog.file' | 'shortcuts-dialog.preferences' | 'shortcuts-dialog.text-formatting' | 'shortcuts-dialog.title' | 'shortcuts-dialog.tools' | 'shortcuts-dialog.transform' | 'shortcuts-dialog.view' | 'size-style.l' | 'size-style.m' | 'size-style.s' | 'size-style.xl' | 'spline-style.cubic' | 'spline-style.line' | 'status.offline' | 'style-panel.align' | 'style-panel.arrow-kind' | 'style-panel.arrowhead-end' | 'style-panel.arrowhead-start' | 'style-panel.arrowheads' | 'style-panel.color' | 'style-panel.dash' | 'style-panel.fill' | 'style-panel.font' | 'style-panel.geo' | 'style-panel.label-align' | 'style-panel.mixed' | 'style-panel.opacity' | 'style-panel.position' | 'style-panel.size' | 'style-panel.spline' | 'style-panel.title' | 'style-panel.vertical-align' | 'theme.dark' | 'theme.light' | 'theme.system' | 'toast.close' | 'toast.error.copy-fail.desc' | 'toast.error.copy-fail.title' | 'toast.error.export-fail.desc' | 'toast.error.export-fail.title' | 'toast.error' | 'toast.info' | 'toast.success' | 'toast.warning' | 'tool-panel.more' | 'tool-panel.title' | 'tool.arrow-down' | 'tool.arrow-left' | 'tool.arrow-right' | 'tool.arrow-up' | 'tool.arrow' | 'tool.aspect-ratio.circle' | 'tool.aspect-ratio.landscape' | 'tool.aspect-ratio.original' | 'tool.aspect-ratio.portrait' | 'tool.aspect-ratio.square' | 'tool.aspect-ratio.wide' | 'tool.aspect-ratio' | 'tool.bookmark' | 'tool.check-box' | 'tool.cloud' | 'tool.diamond' | 'tool.draw' | 'tool.ellipse' | 'tool.embed' | 'tool.eraser' | 'tool.flip-horz' | 'tool.flip-vert' | 'tool.frame' | 'tool.hand' | 'tool.heart' | 'tool.hexagon' | 'tool.highlight' | 'tool.image-crop-confirm' | 'tool.image-crop' | 'tool.image-toolbar-title' | 'tool.image-zoom' | 'tool.laser' | 'tool.line' | 'tool.media-alt-text-confirm' | 'tool.media-alt-text-desc' | 'tool.media-alt-text' | 'tool.media' | 'tool.note' | 'tool.octagon' | 'tool.oval' | 'tool.pentagon' | 'tool.pointer-down' | 'tool.rectangle' | 'tool.replace-media' | 'tool.rhombus' | 'tool.rich-text-bold' | 'tool.rich-text-bulletList' | 'tool.rich-text-code' | 'tool.rich-text-header' | 'tool.rich-text-highlight' | 'tool.rich-text-italic' | 'tool.rich-text-link-remove' | 'tool.rich-text-link-visit' | 'tool.rich-text-link' | 'tool.rich-text-orderedList' | 'tool.rich-text-strikethrough' | 'tool.rich-text-toolbar-title' | 'tool.rotate-cw' | 'tool.select' | 'tool.star' | 'tool.text' | 'tool.trapezoid' | 'tool.triangle' | 'tool.x-box' | 'ui.checked' | 'ui.close' | 'ui.unchecked' | 'verticalAlign-style.end' | 'verticalAlign-style.middle' | 'verticalAlign-style.start' | 'vscode.file-open.backup-failed' | 'vscode.file-open.backup-saved' | 'vscode.file-open.backup' | 'vscode.file-open.desc' | 'vscode.file-open.dont-show-again' | 'vscode.file-open.open';
|
|
3923
4235
|
|
|
3924
4236
|
/** @public */
|
|
3925
4237
|
export declare interface TLUiTranslationProviderProps {
|
|
@@ -4031,6 +4343,9 @@ export declare function ToggleFocusModeItem(): JSX_2.Element;
|
|
|
4031
4343
|
/** @public @react */
|
|
4032
4344
|
export declare function ToggleGridItem(): JSX_2.Element;
|
|
4033
4345
|
|
|
4346
|
+
/** @public @react */
|
|
4347
|
+
export declare function ToggleKeyboardShortcutsItem(): JSX_2.Element;
|
|
4348
|
+
|
|
4034
4349
|
/** @public @react */
|
|
4035
4350
|
export declare function ToggleLockMenuItem(): JSX_2.Element | null;
|
|
4036
4351
|
|
|
@@ -4043,12 +4358,23 @@ export declare function ToggleReduceMotionItem(): JSX_2.Element;
|
|
|
4043
4358
|
/** @public @react */
|
|
4044
4359
|
export declare function ToggleSnapModeItem(): JSX_2.Element;
|
|
4045
4360
|
|
|
4361
|
+
/** @public @react */
|
|
4362
|
+
export declare function ToggleToolLockedButton({ activeToolId }: ToggleToolLockedButtonProps): JSX_2.Element | null;
|
|
4363
|
+
|
|
4364
|
+
/** @public */
|
|
4365
|
+
export declare interface ToggleToolLockedButtonProps {
|
|
4366
|
+
activeToolId?: string;
|
|
4367
|
+
}
|
|
4368
|
+
|
|
4046
4369
|
/** @public @react */
|
|
4047
4370
|
export declare function ToggleToolLockItem(): JSX_2.Element;
|
|
4048
4371
|
|
|
4049
4372
|
/** @public @react */
|
|
4050
4373
|
export declare function ToggleTransparentBgMenuItem(): JSX_2.Element;
|
|
4051
4374
|
|
|
4375
|
+
/** @public @react */
|
|
4376
|
+
export declare function ToggleUiLabelsItem(): JSX_2.Element;
|
|
4377
|
+
|
|
4052
4378
|
/** @public @react */
|
|
4053
4379
|
export declare function ToggleWrapModeItem(): JSX_2.Element;
|
|
4054
4380
|
|
|
@@ -4087,13 +4413,6 @@ export declare function useA11y(): TLUiA11yContextType;
|
|
|
4087
4413
|
/** @public */
|
|
4088
4414
|
export declare function useActions(): TLUiActionsContextType;
|
|
4089
4415
|
|
|
4090
|
-
/**
|
|
4091
|
-
* @deprecated Use {@link useImageOrVideoAsset} instead.
|
|
4092
|
-
*
|
|
4093
|
-
* @public
|
|
4094
|
-
*/
|
|
4095
|
-
export declare const useAsset: typeof useImageOrVideoAsset;
|
|
4096
|
-
|
|
4097
4416
|
/* Excluded from this release type: useAssetUrls */
|
|
4098
4417
|
|
|
4099
4418
|
/** @public */
|
|
@@ -4148,7 +4467,11 @@ export declare function useDefaultHelpers(): {
|
|
|
4148
4467
|
copy: (source: TLUiEventSource) => Promise<void>;
|
|
4149
4468
|
copyAs: (ids: TLShapeId[], format?: TLCopyType) => void;
|
|
4150
4469
|
cut: (source: TLUiEventSource) => Promise<void>;
|
|
4151
|
-
exportAs: (ids: TLShapeId[],
|
|
4470
|
+
exportAs: (ids: TLShapeId[], opts?: {
|
|
4471
|
+
format?: TLExportType;
|
|
4472
|
+
name?: string;
|
|
4473
|
+
scale?: number;
|
|
4474
|
+
}) => void;
|
|
4152
4475
|
getEmbedDefinition: (url: string) => TLEmbedResult;
|
|
4153
4476
|
insertMedia: () => Promise<void>;
|
|
4154
4477
|
isMobile: boolean;
|
|
@@ -4165,12 +4488,16 @@ export declare function useDefaultHelpers(): {
|
|
|
4165
4488
|
export declare function useDialogs(): TLUiDialogsContextType;
|
|
4166
4489
|
|
|
4167
4490
|
/** @public */
|
|
4168
|
-
export declare function useEditablePlainText(shapeId: TLShapeId, type:
|
|
4491
|
+
export declare function useEditablePlainText(shapeId: TLShapeId, type: Extract<TLShape, {
|
|
4492
|
+
props: {
|
|
4493
|
+
text: string;
|
|
4494
|
+
};
|
|
4495
|
+
}>['type'], text?: string): {
|
|
4169
4496
|
handleBlur: () => void;
|
|
4170
4497
|
handleChange: ({ plaintext }: {
|
|
4171
4498
|
plaintext: string;
|
|
4172
4499
|
}) => void;
|
|
4173
|
-
handleDoubleClick: (e:
|
|
4500
|
+
handleDoubleClick: (e: React_3.MouseEvent) => void;
|
|
4174
4501
|
handleFocus: () => void;
|
|
4175
4502
|
handleInputPointerDown: (e: React_3.PointerEvent) => void;
|
|
4176
4503
|
handleKeyDown: (e: KeyboardEvent) => void;
|
|
@@ -4182,12 +4509,16 @@ export declare function useEditablePlainText(shapeId: TLShapeId, type: string, t
|
|
|
4182
4509
|
};
|
|
4183
4510
|
|
|
4184
4511
|
/** @public */
|
|
4185
|
-
export declare function useEditableRichText(shapeId: TLShapeId, type:
|
|
4512
|
+
export declare function useEditableRichText(shapeId: TLShapeId, type: Extract<TLShape, {
|
|
4513
|
+
props: {
|
|
4514
|
+
richText: TLRichText;
|
|
4515
|
+
};
|
|
4516
|
+
}>['type'], richText?: TLRichText): {
|
|
4186
4517
|
handleBlur: () => void;
|
|
4187
4518
|
handleChange: ({ richText }: {
|
|
4188
4519
|
richText: TLRichText;
|
|
4189
4520
|
}) => void;
|
|
4190
|
-
handleDoubleClick: (e:
|
|
4521
|
+
handleDoubleClick: (e: React.MouseEvent) => void;
|
|
4191
4522
|
handleFocus: () => void;
|
|
4192
4523
|
handleInputPointerDown: (e: React.PointerEvent) => void;
|
|
4193
4524
|
handleKeyDown: (e: KeyboardEvent) => void;
|
|
@@ -4198,14 +4529,12 @@ export declare function useEditableRichText(shapeId: TLShapeId, type: string, ri
|
|
|
4198
4529
|
rInput: RefObject<HTMLDivElement>;
|
|
4199
4530
|
};
|
|
4200
4531
|
|
|
4201
|
-
/**
|
|
4202
|
-
* @deprecated Use `useEditablePlainText` instead.
|
|
4203
|
-
* @public
|
|
4204
|
-
*/
|
|
4205
|
-
export declare const useEditableText: typeof useEditablePlainText;
|
|
4206
|
-
|
|
4207
4532
|
/** @public */
|
|
4208
|
-
export declare function useExportAs(): (ids: TLShapeId[],
|
|
4533
|
+
export declare function useExportAs(): (ids: TLShapeId[], opts?: {
|
|
4534
|
+
format?: TLExportType;
|
|
4535
|
+
name?: string;
|
|
4536
|
+
scale?: number;
|
|
4537
|
+
}) => void;
|
|
4209
4538
|
|
|
4210
4539
|
/**
|
|
4211
4540
|
* This is a handy helper hook that resolves an asset to an optimized URL for a given shape, or its
|
|
@@ -4279,9 +4608,15 @@ export declare const useSelectedShapesAnnouncer: () => void;
|
|
|
4279
4608
|
/** @public */
|
|
4280
4609
|
export declare function useShowCollaborationUi(): boolean;
|
|
4281
4610
|
|
|
4611
|
+
/** @public */
|
|
4612
|
+
export declare function useStylePanelContext(): StylePanelContext;
|
|
4613
|
+
|
|
4282
4614
|
/** @public */
|
|
4283
4615
|
export declare function useTldrawUiComponents(): TLUiComponents;
|
|
4284
4616
|
|
|
4617
|
+
/** @public */
|
|
4618
|
+
export declare function useTldrawUiOrientation(): TldrawUiOrientationContext;
|
|
4619
|
+
|
|
4285
4620
|
/** @public */
|
|
4286
4621
|
export declare function useToasts(): TLUiToastsContextType;
|
|
4287
4622
|
|
|
@@ -4305,6 +4640,12 @@ export declare function useTranslation(): (id?: Exclude<string, TLUiTranslationK
|
|
|
4305
4640
|
/** @public */
|
|
4306
4641
|
export declare function useUiEvents(): TLUiEventContextType;
|
|
4307
4642
|
|
|
4643
|
+
/**
|
|
4644
|
+
* Returns true if the number of UNLOCKED selected shapes is at least min or at most max.
|
|
4645
|
+
* @public
|
|
4646
|
+
*/
|
|
4647
|
+
export declare function useUnlockedSelectedShapesCount(min?: number, max?: number): boolean | number;
|
|
4648
|
+
|
|
4308
4649
|
/** @public */
|
|
4309
4650
|
export declare interface VideoShapeOptions {
|
|
4310
4651
|
/**
|