tldraw 4.6.0-next.20de11b7e238 → 4.6.0-next.241e87d4700a
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 +449 -151
- package/dist-cjs/index.js +29 -13
- package/dist-cjs/index.js.map +3 -3
- package/dist-cjs/lib/Tldraw.js +40 -0
- package/dist-cjs/lib/Tldraw.js.map +2 -2
- package/dist-cjs/lib/assets/BookmarkAssetUtil.js +39 -0
- package/dist-cjs/lib/assets/BookmarkAssetUtil.js.map +7 -0
- package/dist-cjs/lib/assets/ImageAssetUtil.js +81 -0
- package/dist-cjs/lib/assets/ImageAssetUtil.js.map +7 -0
- package/dist-cjs/lib/assets/VideoAssetUtil.js +69 -0
- package/dist-cjs/lib/assets/VideoAssetUtil.js.map +7 -0
- package/dist-cjs/lib/{ui/components/SharePanel/PeopleMenuMore.js → defaultAssetUtils.js} +9 -9
- package/dist-cjs/lib/defaultAssetUtils.js.map +7 -0
- package/dist-cjs/lib/defaultEmbedDefinitions.js +25 -0
- package/dist-cjs/lib/defaultEmbedDefinitions.js.map +2 -2
- package/dist-cjs/lib/defaultExternalContentHandlers.js +37 -110
- package/dist-cjs/lib/defaultExternalContentHandlers.js.map +3 -3
- package/dist-cjs/lib/defaultSideEffects.js +5 -1
- package/dist-cjs/lib/defaultSideEffects.js.map +2 -2
- package/dist-cjs/lib/shapes/arrow/ArrowShapeUtil.js +112 -56
- package/dist-cjs/lib/shapes/arrow/ArrowShapeUtil.js.map +2 -2
- package/dist-cjs/lib/shapes/arrow/arrow-types.js.map +1 -1
- package/dist-cjs/lib/shapes/arrow/arrowLabel.js +18 -13
- package/dist-cjs/lib/shapes/arrow/arrowLabel.js.map +2 -2
- package/dist-cjs/lib/shapes/arrow/curved-arrow.js +8 -5
- package/dist-cjs/lib/shapes/arrow/curved-arrow.js.map +2 -2
- package/dist-cjs/lib/shapes/arrow/elbow/getElbowArrowInfo.js +21 -6
- package/dist-cjs/lib/shapes/arrow/elbow/getElbowArrowInfo.js.map +2 -2
- package/dist-cjs/lib/shapes/arrow/getArrowInfo.js +8 -4
- package/dist-cjs/lib/shapes/arrow/getArrowInfo.js.map +2 -2
- package/dist-cjs/lib/shapes/arrow/shared.js +0 -7
- package/dist-cjs/lib/shapes/arrow/shared.js.map +2 -2
- package/dist-cjs/lib/shapes/arrow/straight-arrow.js +6 -3
- package/dist-cjs/lib/shapes/arrow/straight-arrow.js.map +2 -2
- package/dist-cjs/lib/shapes/bookmark/BookmarkShapeUtil.js +10 -2
- package/dist-cjs/lib/shapes/bookmark/BookmarkShapeUtil.js.map +2 -2
- package/dist-cjs/lib/shapes/draw/DrawShapeUtil.js +74 -32
- package/dist-cjs/lib/shapes/draw/DrawShapeUtil.js.map +2 -2
- package/dist-cjs/lib/shapes/draw/getPath.js +2 -1
- package/dist-cjs/lib/shapes/draw/getPath.js.map +2 -2
- package/dist-cjs/lib/shapes/draw/toolStates/Drawing.js +13 -5
- package/dist-cjs/lib/shapes/draw/toolStates/Drawing.js.map +2 -2
- package/dist-cjs/lib/shapes/embed/EmbedShapeUtil.js +21 -8
- package/dist-cjs/lib/shapes/embed/EmbedShapeUtil.js.map +2 -2
- package/dist-cjs/lib/shapes/frame/FrameShapeUtil.js +36 -25
- package/dist-cjs/lib/shapes/frame/FrameShapeUtil.js.map +2 -2
- package/dist-cjs/lib/shapes/geo/{components/GeoShapeBody.js → GeoShapeBody.js} +20 -13
- package/dist-cjs/lib/shapes/geo/GeoShapeBody.js.map +7 -0
- package/dist-cjs/lib/shapes/geo/GeoShapeUtil.js +266 -157
- package/dist-cjs/lib/shapes/geo/GeoShapeUtil.js.map +2 -2
- package/dist-cjs/lib/shapes/geo/getGeoShapePath.js +7 -5
- package/dist-cjs/lib/shapes/geo/getGeoShapePath.js.map +2 -2
- package/dist-cjs/lib/shapes/highlight/HighlightShapeUtil.js +52 -41
- package/dist-cjs/lib/shapes/highlight/HighlightShapeUtil.js.map +2 -2
- package/dist-cjs/lib/shapes/image/ImageShapeUtil.js +26 -2
- package/dist-cjs/lib/shapes/image/ImageShapeUtil.js.map +2 -2
- package/dist-cjs/lib/shapes/line/LineShapeUtil.js +40 -16
- package/dist-cjs/lib/shapes/line/LineShapeUtil.js.map +2 -2
- package/dist-cjs/lib/shapes/note/NoteShapeUtil.js +195 -149
- package/dist-cjs/lib/shapes/note/NoteShapeUtil.js.map +2 -2
- package/dist-cjs/lib/shapes/note/noteHelpers.js +32 -31
- package/dist-cjs/lib/shapes/note/noteHelpers.js.map +2 -2
- package/dist-cjs/lib/shapes/note/toolStates/Pointing.js +14 -3
- package/dist-cjs/lib/shapes/note/toolStates/Pointing.js.map +2 -2
- package/dist-cjs/lib/shapes/shared/PathBuilder.js +14 -1
- package/dist-cjs/lib/shapes/shared/PathBuilder.js.map +2 -2
- package/dist-cjs/lib/shapes/shared/PatternFill.js +61 -0
- package/dist-cjs/lib/shapes/shared/PatternFill.js.map +7 -0
- package/dist-cjs/lib/shapes/shared/PlainTextLabel.js +7 -7
- package/dist-cjs/lib/shapes/shared/PlainTextLabel.js.map +2 -2
- package/dist-cjs/lib/shapes/shared/RichTextLabel.js +14 -14
- package/dist-cjs/lib/shapes/shared/RichTextLabel.js.map +2 -2
- package/dist-cjs/lib/shapes/shared/SvgTextLabel.js +6 -6
- package/dist-cjs/lib/shapes/shared/SvgTextLabel.js.map +2 -2
- package/dist-cjs/lib/shapes/shared/default-shape-constants.js +23 -18
- package/dist-cjs/lib/shapes/shared/default-shape-constants.js.map +2 -2
- package/dist-cjs/lib/shapes/shared/{useDefaultColorTheme.js → defaultFills.js} +11 -9
- package/dist-cjs/lib/shapes/shared/defaultFills.js.map +7 -0
- package/dist-cjs/lib/shapes/shared/defaultFonts.js +15 -1
- package/dist-cjs/lib/shapes/shared/defaultFonts.js.map +2 -2
- package/dist-cjs/lib/shapes/shared/defaultStyleDefs.js +23 -14
- package/dist-cjs/lib/shapes/shared/defaultStyleDefs.js.map +2 -2
- package/dist-cjs/lib/shapes/shared/getDisplayValues.js +39 -0
- package/dist-cjs/lib/shapes/shared/getDisplayValues.js.map +7 -0
- package/dist-cjs/lib/shapes/text/TextShapeUtil.js +50 -25
- package/dist-cjs/lib/shapes/text/TextShapeUtil.js.map +2 -2
- package/dist-cjs/lib/shapes/text/toolStates/Idle.js +1 -1
- package/dist-cjs/lib/shapes/text/toolStates/Idle.js.map +2 -2
- package/dist-cjs/lib/shapes/video/VideoShapeUtil.js +25 -3
- package/dist-cjs/lib/shapes/video/VideoShapeUtil.js.map +2 -2
- package/dist-cjs/lib/styles.js +51 -15
- package/dist-cjs/lib/styles.js.map +2 -2
- package/dist-cjs/lib/tools/EraserTool/childStates/Erasing.js +1 -0
- package/dist-cjs/lib/tools/EraserTool/childStates/Erasing.js.map +2 -2
- package/dist-cjs/lib/tools/HandTool/childStates/Dragging.js +1 -0
- package/dist-cjs/lib/tools/HandTool/childStates/Dragging.js.map +2 -2
- package/dist-cjs/lib/tools/LaserTool/childStates/Lasering.js +1 -0
- package/dist-cjs/lib/tools/LaserTool/childStates/Lasering.js.map +2 -2
- package/dist-cjs/lib/tools/SelectTool/childStates/Brushing.js +1 -0
- package/dist-cjs/lib/tools/SelectTool/childStates/Brushing.js.map +2 -2
- package/dist-cjs/lib/tools/SelectTool/childStates/Crop/children/Cropping.js +1 -0
- package/dist-cjs/lib/tools/SelectTool/childStates/Crop/children/Cropping.js.map +2 -2
- package/dist-cjs/lib/tools/SelectTool/childStates/DraggingHandle.js +1 -0
- package/dist-cjs/lib/tools/SelectTool/childStates/DraggingHandle.js.map +2 -2
- package/dist-cjs/lib/tools/SelectTool/childStates/EditingShape.js +1 -1
- package/dist-cjs/lib/tools/SelectTool/childStates/EditingShape.js.map +2 -2
- package/dist-cjs/lib/tools/SelectTool/childStates/Idle.js +19 -14
- package/dist-cjs/lib/tools/SelectTool/childStates/Idle.js.map +2 -2
- package/dist-cjs/lib/tools/SelectTool/childStates/PointingHandle.js +26 -8
- package/dist-cjs/lib/tools/SelectTool/childStates/PointingHandle.js.map +2 -2
- package/dist-cjs/lib/tools/SelectTool/childStates/Resizing.js +1 -0
- package/dist-cjs/lib/tools/SelectTool/childStates/Resizing.js.map +2 -2
- package/dist-cjs/lib/tools/SelectTool/childStates/Rotating.js +1 -0
- package/dist-cjs/lib/tools/SelectTool/childStates/Rotating.js.map +2 -2
- package/dist-cjs/lib/tools/SelectTool/childStates/ScribbleBrushing.js +1 -0
- package/dist-cjs/lib/tools/SelectTool/childStates/ScribbleBrushing.js.map +2 -2
- package/dist-cjs/lib/tools/SelectTool/childStates/Translating.js +18 -9
- package/dist-cjs/lib/tools/SelectTool/childStates/Translating.js.map +2 -2
- package/dist-cjs/lib/tools/ZoomTool/childStates/ZoomQuick.js +3 -3
- package/dist-cjs/lib/tools/ZoomTool/childStates/ZoomQuick.js.map +2 -2
- package/dist-cjs/lib/tools/selection-logic/updateHoveredShapeId.js +18 -4
- package/dist-cjs/lib/tools/selection-logic/updateHoveredShapeId.js.map +2 -2
- package/dist-cjs/lib/ui/components/Minimap/DefaultMinimap.js +2 -2
- package/dist-cjs/lib/ui/components/Minimap/DefaultMinimap.js.map +2 -2
- package/dist-cjs/lib/ui/components/MobileStylePanel.js +2 -2
- package/dist-cjs/lib/ui/components/MobileStylePanel.js.map +2 -2
- package/dist-cjs/lib/ui/components/SharePanel/{PeopleMenu.js → DefaultPeopleMenu.js} +15 -36
- package/dist-cjs/lib/ui/components/SharePanel/DefaultPeopleMenu.js.map +7 -0
- package/dist-cjs/lib/ui/components/SharePanel/{PeopleMenuAvatar.js → DefaultPeopleMenuAvatar.js} +7 -8
- package/dist-cjs/lib/ui/components/SharePanel/DefaultPeopleMenuAvatar.js.map +7 -0
- package/dist-cjs/lib/ui/components/SharePanel/DefaultPeopleMenuContent.js +35 -0
- package/dist-cjs/lib/ui/components/SharePanel/DefaultPeopleMenuContent.js.map +7 -0
- package/dist-cjs/lib/ui/components/SharePanel/DefaultPeopleMenuFacePile.js +51 -0
- package/dist-cjs/lib/ui/components/SharePanel/DefaultPeopleMenuFacePile.js.map +7 -0
- package/dist-cjs/lib/ui/components/SharePanel/{PeopleMenuItem.js → DefaultPeopleMenuItem.js} +8 -6
- package/dist-cjs/lib/ui/components/SharePanel/DefaultPeopleMenuItem.js.map +7 -0
- package/dist-cjs/lib/ui/components/SharePanel/DefaultSharePanel.js +4 -2
- package/dist-cjs/lib/ui/components/SharePanel/DefaultSharePanel.js.map +2 -2
- package/dist-cjs/lib/ui/components/SharePanel/{UserPresenceEditor.js → DefaultUserPresenceEditor.js} +6 -6
- package/dist-cjs/lib/ui/components/SharePanel/DefaultUserPresenceEditor.js.map +7 -0
- package/dist-cjs/lib/ui/components/SharePanel/UserPresenceColorPicker.js.map +2 -2
- package/dist-cjs/lib/ui/components/StylePanel/DefaultStylePanel.js +9 -9
- package/dist-cjs/lib/ui/components/StylePanel/DefaultStylePanel.js.map +2 -2
- package/dist-cjs/lib/ui/components/StylePanel/DefaultStylePanelContent.js +10 -15
- package/dist-cjs/lib/ui/components/StylePanel/DefaultStylePanelContent.js.map +2 -2
- package/dist-cjs/lib/ui/components/StylePanel/StylePanelButtonPicker.js +2 -3
- package/dist-cjs/lib/ui/components/StylePanel/StylePanelButtonPicker.js.map +2 -2
- package/dist-cjs/lib/ui/components/StylePanel/StylePanelContext.js +26 -2
- package/dist-cjs/lib/ui/components/StylePanel/StylePanelContext.js.map +2 -2
- package/dist-cjs/lib/ui/components/primitives/menus/TldrawUiMenuItem.js +5 -0
- package/dist-cjs/lib/ui/components/primitives/menus/TldrawUiMenuItem.js.map +2 -2
- package/dist-cjs/lib/ui/context/actions.js +43 -1
- package/dist-cjs/lib/ui/context/actions.js.map +2 -2
- package/dist-cjs/lib/ui/context/components.js +10 -0
- package/dist-cjs/lib/ui/context/components.js.map +2 -2
- package/dist-cjs/lib/ui/hooks/useClipboardEvents.js +28 -5
- package/dist-cjs/lib/ui/hooks/useClipboardEvents.js.map +3 -3
- package/dist-cjs/lib/ui/version.js +3 -3
- package/dist-cjs/lib/ui/version.js.map +1 -1
- package/dist-esm/index.d.mts +449 -151
- package/dist-esm/index.mjs +72 -31
- package/dist-esm/index.mjs.map +3 -3
- package/dist-esm/lib/Tldraw.mjs +40 -0
- package/dist-esm/lib/Tldraw.mjs.map +2 -2
- package/dist-esm/lib/assets/BookmarkAssetUtil.mjs +23 -0
- package/dist-esm/lib/assets/BookmarkAssetUtil.mjs.map +7 -0
- package/dist-esm/lib/assets/ImageAssetUtil.mjs +67 -0
- package/dist-esm/lib/assets/ImageAssetUtil.mjs.map +7 -0
- package/dist-esm/lib/assets/VideoAssetUtil.mjs +55 -0
- package/dist-esm/lib/assets/VideoAssetUtil.mjs.map +7 -0
- package/dist-esm/lib/defaultAssetUtils.mjs +8 -0
- package/dist-esm/lib/defaultAssetUtils.mjs.map +7 -0
- package/dist-esm/lib/defaultEmbedDefinitions.mjs +25 -0
- package/dist-esm/lib/defaultEmbedDefinitions.mjs.map +2 -2
- package/dist-esm/lib/defaultExternalContentHandlers.mjs +38 -114
- package/dist-esm/lib/defaultExternalContentHandlers.mjs.map +3 -3
- package/dist-esm/lib/defaultSideEffects.mjs +9 -2
- package/dist-esm/lib/defaultSideEffects.mjs.map +2 -2
- package/dist-esm/lib/shapes/arrow/ArrowShapeUtil.mjs +119 -63
- package/dist-esm/lib/shapes/arrow/ArrowShapeUtil.mjs.map +2 -2
- package/dist-esm/lib/shapes/arrow/arrowLabel.mjs +19 -21
- package/dist-esm/lib/shapes/arrow/arrowLabel.mjs.map +2 -2
- package/dist-esm/lib/shapes/arrow/curved-arrow.mjs +8 -6
- package/dist-esm/lib/shapes/arrow/curved-arrow.mjs.map +2 -2
- package/dist-esm/lib/shapes/arrow/elbow/getElbowArrowInfo.mjs +22 -7
- package/dist-esm/lib/shapes/arrow/elbow/getElbowArrowInfo.mjs.map +2 -2
- package/dist-esm/lib/shapes/arrow/getArrowInfo.mjs +8 -4
- package/dist-esm/lib/shapes/arrow/getArrowInfo.mjs.map +2 -2
- package/dist-esm/lib/shapes/arrow/shared.mjs +0 -7
- package/dist-esm/lib/shapes/arrow/shared.mjs.map +2 -2
- package/dist-esm/lib/shapes/arrow/straight-arrow.mjs +6 -4
- package/dist-esm/lib/shapes/arrow/straight-arrow.mjs.map +2 -2
- package/dist-esm/lib/shapes/bookmark/BookmarkShapeUtil.mjs +10 -2
- package/dist-esm/lib/shapes/bookmark/BookmarkShapeUtil.mjs.map +2 -2
- package/dist-esm/lib/shapes/draw/DrawShapeUtil.mjs +74 -32
- package/dist-esm/lib/shapes/draw/DrawShapeUtil.mjs.map +2 -2
- package/dist-esm/lib/shapes/draw/getPath.mjs +2 -1
- package/dist-esm/lib/shapes/draw/getPath.mjs.map +2 -2
- package/dist-esm/lib/shapes/draw/toolStates/Drawing.mjs +13 -5
- package/dist-esm/lib/shapes/draw/toolStates/Drawing.mjs.map +2 -2
- package/dist-esm/lib/shapes/embed/EmbedShapeUtil.mjs +22 -8
- package/dist-esm/lib/shapes/embed/EmbedShapeUtil.mjs.map +2 -2
- package/dist-esm/lib/shapes/frame/FrameShapeUtil.mjs +37 -26
- package/dist-esm/lib/shapes/frame/FrameShapeUtil.mjs.map +2 -2
- package/dist-esm/lib/shapes/geo/GeoShapeBody.mjs +40 -0
- package/dist-esm/lib/shapes/geo/GeoShapeBody.mjs.map +7 -0
- package/dist-esm/lib/shapes/geo/GeoShapeUtil.mjs +269 -160
- package/dist-esm/lib/shapes/geo/GeoShapeUtil.mjs.map +2 -2
- package/dist-esm/lib/shapes/geo/getGeoShapePath.mjs +7 -5
- package/dist-esm/lib/shapes/geo/getGeoShapePath.mjs.map +2 -2
- package/dist-esm/lib/shapes/highlight/HighlightShapeUtil.mjs +55 -41
- package/dist-esm/lib/shapes/highlight/HighlightShapeUtil.mjs.map +2 -2
- package/dist-esm/lib/shapes/image/ImageShapeUtil.mjs +27 -2
- package/dist-esm/lib/shapes/image/ImageShapeUtil.mjs.map +2 -2
- package/dist-esm/lib/shapes/line/LineShapeUtil.mjs +42 -17
- package/dist-esm/lib/shapes/line/LineShapeUtil.mjs.map +2 -2
- package/dist-esm/lib/shapes/note/NoteShapeUtil.mjs +200 -159
- package/dist-esm/lib/shapes/note/NoteShapeUtil.mjs.map +2 -2
- package/dist-esm/lib/shapes/note/noteHelpers.mjs +32 -31
- package/dist-esm/lib/shapes/note/noteHelpers.mjs.map +2 -2
- package/dist-esm/lib/shapes/note/toolStates/Pointing.mjs +14 -3
- package/dist-esm/lib/shapes/note/toolStates/Pointing.mjs.map +2 -2
- package/dist-esm/lib/shapes/shared/PathBuilder.mjs +14 -1
- package/dist-esm/lib/shapes/shared/PathBuilder.mjs.map +2 -2
- package/dist-esm/lib/shapes/shared/PatternFill.mjs +47 -0
- package/dist-esm/lib/shapes/shared/PatternFill.mjs.map +7 -0
- package/dist-esm/lib/shapes/shared/PlainTextLabel.mjs +7 -7
- package/dist-esm/lib/shapes/shared/PlainTextLabel.mjs.map +2 -2
- package/dist-esm/lib/shapes/shared/RichTextLabel.mjs +14 -15
- package/dist-esm/lib/shapes/shared/RichTextLabel.mjs.map +2 -2
- package/dist-esm/lib/shapes/shared/SvgTextLabel.mjs +6 -6
- package/dist-esm/lib/shapes/shared/SvgTextLabel.mjs.map +2 -2
- package/dist-esm/lib/shapes/shared/default-shape-constants.mjs +23 -18
- package/dist-esm/lib/shapes/shared/default-shape-constants.mjs.map +2 -2
- package/dist-esm/lib/shapes/shared/defaultFills.mjs +10 -0
- package/dist-esm/lib/shapes/shared/defaultFills.mjs.map +7 -0
- package/dist-esm/lib/shapes/shared/defaultFonts.mjs +16 -2
- package/dist-esm/lib/shapes/shared/defaultFonts.mjs.map +2 -2
- package/dist-esm/lib/shapes/shared/defaultStyleDefs.mjs +23 -15
- package/dist-esm/lib/shapes/shared/defaultStyleDefs.mjs.map +2 -2
- package/dist-esm/lib/shapes/shared/getDisplayValues.mjs +19 -0
- package/dist-esm/lib/shapes/shared/getDisplayValues.mjs.map +7 -0
- package/dist-esm/lib/shapes/text/TextShapeUtil.mjs +52 -27
- package/dist-esm/lib/shapes/text/TextShapeUtil.mjs.map +2 -2
- package/dist-esm/lib/shapes/text/toolStates/Idle.mjs +5 -2
- package/dist-esm/lib/shapes/text/toolStates/Idle.mjs.map +2 -2
- package/dist-esm/lib/shapes/video/VideoShapeUtil.mjs +26 -3
- package/dist-esm/lib/shapes/video/VideoShapeUtil.mjs.map +2 -2
- package/dist-esm/lib/styles.mjs +55 -15
- package/dist-esm/lib/styles.mjs.map +2 -2
- package/dist-esm/lib/tools/EraserTool/childStates/Erasing.mjs +1 -0
- package/dist-esm/lib/tools/EraserTool/childStates/Erasing.mjs.map +2 -2
- package/dist-esm/lib/tools/HandTool/childStates/Dragging.mjs +1 -0
- package/dist-esm/lib/tools/HandTool/childStates/Dragging.mjs.map +2 -2
- package/dist-esm/lib/tools/LaserTool/childStates/Lasering.mjs +1 -0
- package/dist-esm/lib/tools/LaserTool/childStates/Lasering.mjs.map +2 -2
- package/dist-esm/lib/tools/SelectTool/childStates/Brushing.mjs +1 -0
- package/dist-esm/lib/tools/SelectTool/childStates/Brushing.mjs.map +2 -2
- package/dist-esm/lib/tools/SelectTool/childStates/Crop/children/Cropping.mjs +1 -0
- package/dist-esm/lib/tools/SelectTool/childStates/Crop/children/Cropping.mjs.map +2 -2
- package/dist-esm/lib/tools/SelectTool/childStates/DraggingHandle.mjs +1 -0
- package/dist-esm/lib/tools/SelectTool/childStates/DraggingHandle.mjs.map +2 -2
- package/dist-esm/lib/tools/SelectTool/childStates/EditingShape.mjs +5 -2
- package/dist-esm/lib/tools/SelectTool/childStates/EditingShape.mjs.map +2 -2
- package/dist-esm/lib/tools/SelectTool/childStates/Idle.mjs +25 -16
- package/dist-esm/lib/tools/SelectTool/childStates/Idle.mjs.map +2 -2
- package/dist-esm/lib/tools/SelectTool/childStates/PointingHandle.mjs +26 -9
- package/dist-esm/lib/tools/SelectTool/childStates/PointingHandle.mjs.map +2 -2
- package/dist-esm/lib/tools/SelectTool/childStates/Resizing.mjs +1 -0
- package/dist-esm/lib/tools/SelectTool/childStates/Resizing.mjs.map +2 -2
- package/dist-esm/lib/tools/SelectTool/childStates/Rotating.mjs +1 -0
- package/dist-esm/lib/tools/SelectTool/childStates/Rotating.mjs.map +2 -2
- package/dist-esm/lib/tools/SelectTool/childStates/ScribbleBrushing.mjs +1 -0
- package/dist-esm/lib/tools/SelectTool/childStates/ScribbleBrushing.mjs.map +2 -2
- package/dist-esm/lib/tools/SelectTool/childStates/Translating.mjs +18 -10
- package/dist-esm/lib/tools/SelectTool/childStates/Translating.mjs.map +2 -2
- package/dist-esm/lib/tools/ZoomTool/childStates/ZoomQuick.mjs +3 -3
- package/dist-esm/lib/tools/ZoomTool/childStates/ZoomQuick.mjs.map +2 -2
- package/dist-esm/lib/tools/selection-logic/updateHoveredShapeId.mjs +18 -4
- package/dist-esm/lib/tools/selection-logic/updateHoveredShapeId.mjs.map +2 -2
- package/dist-esm/lib/ui/components/Minimap/DefaultMinimap.mjs +4 -4
- package/dist-esm/lib/ui/components/Minimap/DefaultMinimap.mjs.map +2 -2
- package/dist-esm/lib/ui/components/MobileStylePanel.mjs +2 -3
- package/dist-esm/lib/ui/components/MobileStylePanel.mjs.map +2 -2
- package/dist-esm/lib/ui/components/SharePanel/DefaultPeopleMenu.mjs +46 -0
- package/dist-esm/lib/ui/components/SharePanel/DefaultPeopleMenu.mjs.map +7 -0
- package/dist-esm/lib/ui/components/SharePanel/{PeopleMenuAvatar.mjs → DefaultPeopleMenuAvatar.mjs} +4 -5
- package/dist-esm/lib/ui/components/SharePanel/DefaultPeopleMenuAvatar.mjs.map +7 -0
- package/dist-esm/lib/ui/components/SharePanel/DefaultPeopleMenuContent.mjs +15 -0
- package/dist-esm/lib/ui/components/SharePanel/DefaultPeopleMenuContent.mjs.map +7 -0
- package/dist-esm/lib/ui/components/SharePanel/DefaultPeopleMenuFacePile.mjs +31 -0
- package/dist-esm/lib/ui/components/SharePanel/DefaultPeopleMenuFacePile.mjs.map +7 -0
- package/dist-esm/lib/ui/components/SharePanel/{PeopleMenuItem.mjs → DefaultPeopleMenuItem.mjs} +5 -3
- package/dist-esm/lib/ui/components/SharePanel/DefaultPeopleMenuItem.mjs.map +7 -0
- package/dist-esm/lib/ui/components/SharePanel/DefaultSharePanel.mjs +3 -1
- package/dist-esm/lib/ui/components/SharePanel/DefaultSharePanel.mjs.map +2 -2
- package/dist-esm/lib/ui/components/SharePanel/{UserPresenceEditor.mjs → DefaultUserPresenceEditor.mjs} +3 -3
- package/dist-esm/lib/ui/components/SharePanel/DefaultUserPresenceEditor.mjs.map +7 -0
- package/dist-esm/lib/ui/components/SharePanel/UserPresenceColorPicker.mjs.map +2 -2
- package/dist-esm/lib/ui/components/StylePanel/DefaultStylePanel.mjs +10 -10
- package/dist-esm/lib/ui/components/StylePanel/DefaultStylePanel.mjs.map +2 -2
- package/dist-esm/lib/ui/components/StylePanel/DefaultStylePanelContent.mjs +12 -17
- package/dist-esm/lib/ui/components/StylePanel/DefaultStylePanelContent.mjs.map +2 -2
- package/dist-esm/lib/ui/components/StylePanel/StylePanelButtonPicker.mjs +2 -3
- package/dist-esm/lib/ui/components/StylePanel/StylePanelButtonPicker.mjs.map +2 -2
- package/dist-esm/lib/ui/components/StylePanel/StylePanelContext.mjs +31 -3
- package/dist-esm/lib/ui/components/StylePanel/StylePanelContext.mjs.map +2 -2
- package/dist-esm/lib/ui/components/primitives/menus/TldrawUiMenuItem.mjs +5 -0
- package/dist-esm/lib/ui/components/primitives/menus/TldrawUiMenuItem.mjs.map +2 -2
- package/dist-esm/lib/ui/context/actions.mjs +43 -1
- package/dist-esm/lib/ui/context/actions.mjs.map +2 -2
- package/dist-esm/lib/ui/context/components.mjs +16 -0
- package/dist-esm/lib/ui/context/components.mjs.map +2 -2
- package/dist-esm/lib/ui/hooks/useClipboardEvents.mjs +28 -5
- package/dist-esm/lib/ui/hooks/useClipboardEvents.mjs.map +3 -3
- package/dist-esm/lib/ui/version.mjs +3 -3
- package/dist-esm/lib/ui/version.mjs.map +1 -1
- package/package.json +4 -4
- package/src/index.ts +88 -22
- package/src/lib/Tldraw.tsx +55 -0
- package/src/lib/assets/BookmarkAssetUtil.ts +23 -0
- package/src/lib/assets/ImageAssetUtil.test.ts +116 -0
- package/src/lib/assets/ImageAssetUtil.ts +77 -0
- package/src/lib/assets/VideoAssetUtil.ts +64 -0
- package/src/lib/defaultAssetUtils.ts +6 -0
- package/src/lib/defaultEmbedDefinitions.ts +33 -0
- package/src/lib/defaultExternalContentHandlers.ts +60 -142
- package/src/lib/defaultSideEffects.ts +9 -2
- package/src/lib/shapes/arrow/ArrowShapeUtil.tsx +143 -70
- package/src/lib/shapes/arrow/arrow-types.ts +26 -2
- package/src/lib/shapes/arrow/arrowLabel.ts +25 -22
- package/src/lib/shapes/arrow/curved-arrow.ts +14 -8
- package/src/lib/shapes/arrow/elbow/getElbowArrowInfo.tsx +26 -7
- package/src/lib/shapes/arrow/getArrowInfo.ts +12 -4
- package/src/lib/shapes/arrow/shared.ts +0 -8
- package/src/lib/shapes/arrow/straight-arrow.ts +12 -6
- package/src/lib/shapes/bookmark/BookmarkShapeUtil.tsx +22 -2
- package/src/lib/shapes/draw/DrawShapeUtil.tsx +116 -45
- package/src/lib/shapes/draw/getPath.ts +1 -0
- package/src/lib/shapes/draw/toolStates/Drawing.ts +22 -5
- package/src/lib/shapes/embed/EmbedShapeUtil.tsx +34 -11
- package/src/lib/shapes/frame/FrameShapeUtil.tsx +55 -33
- package/src/lib/shapes/geo/GeoShapeBody.tsx +53 -0
- package/src/lib/shapes/geo/GeoShapeUtil.tsx +352 -223
- package/src/lib/shapes/geo/getGeoShapePath.ts +10 -5
- package/src/lib/shapes/highlight/HighlightShapeUtil.tsx +71 -47
- package/src/lib/shapes/image/ImageShapeUtil.tsx +42 -2
- package/src/lib/shapes/line/LineShapeUtil.tsx +57 -16
- package/src/lib/shapes/note/NoteShapeUtil.tsx +254 -190
- package/src/lib/shapes/note/noteHelpers.ts +69 -55
- package/src/lib/shapes/note/toolStates/Pointing.ts +23 -3
- package/src/lib/shapes/shared/PathBuilder.test.tsx +10 -10
- package/src/lib/shapes/shared/PathBuilder.tsx +24 -4
- package/src/lib/shapes/shared/PatternFill.tsx +56 -0
- package/src/lib/shapes/shared/PlainTextLabel.tsx +21 -20
- package/src/lib/shapes/shared/RichTextLabel.tsx +32 -33
- package/src/lib/shapes/shared/SvgTextLabel.tsx +6 -6
- package/src/lib/shapes/shared/default-shape-constants.ts +31 -25
- package/src/lib/shapes/shared/defaultFills.ts +11 -0
- package/src/lib/shapes/shared/defaultFonts.tsx +23 -1
- package/src/lib/shapes/shared/defaultStyleDefs.tsx +29 -20
- package/src/lib/shapes/shared/getDisplayValues.ts +49 -0
- package/src/lib/shapes/text/TextShapeUtil.tsx +66 -28
- package/src/lib/shapes/text/toolStates/Idle.ts +5 -2
- package/src/lib/shapes/video/VideoShapeUtil.tsx +38 -3
- package/src/lib/styles.tsx +88 -14
- package/src/lib/tools/EraserTool/childStates/Erasing.ts +1 -0
- package/src/lib/tools/HandTool/childStates/Dragging.ts +1 -0
- package/src/lib/tools/LaserTool/childStates/Lasering.ts +1 -0
- package/src/lib/tools/SelectTool/childStates/Brushing.ts +1 -0
- package/src/lib/tools/SelectTool/childStates/Crop/children/Cropping.ts +1 -0
- package/src/lib/tools/SelectTool/childStates/DraggingHandle.tsx +1 -0
- package/src/lib/tools/SelectTool/childStates/EditingShape.ts +5 -2
- package/src/lib/tools/SelectTool/childStates/Idle.ts +34 -21
- package/src/lib/tools/SelectTool/childStates/PointingHandle.ts +29 -9
- package/src/lib/tools/SelectTool/childStates/Resizing.ts +1 -0
- package/src/lib/tools/SelectTool/childStates/Rotating.ts +1 -0
- package/src/lib/tools/SelectTool/childStates/ScribbleBrushing.ts +1 -0
- package/src/lib/tools/SelectTool/childStates/Translating.ts +18 -9
- package/src/lib/tools/ZoomTool/childStates/ZoomQuick.ts +3 -3
- package/src/lib/tools/selection-logic/updateHoveredShapeId.ts +25 -4
- package/src/lib/ui/components/Minimap/DefaultMinimap.tsx +3 -3
- package/src/lib/ui/components/MobileStylePanel.tsx +3 -4
- package/src/lib/ui/components/SharePanel/{PeopleMenu.tsx → DefaultPeopleMenu.tsx} +15 -40
- package/src/lib/ui/components/SharePanel/{PeopleMenuAvatar.tsx → DefaultPeopleMenuAvatar.tsx} +7 -2
- package/src/lib/ui/components/SharePanel/DefaultPeopleMenuContent.tsx +28 -0
- package/src/lib/ui/components/SharePanel/DefaultPeopleMenuFacePile.tsx +46 -0
- package/src/lib/ui/components/SharePanel/{PeopleMenuItem.tsx → DefaultPeopleMenuItem.tsx} +9 -1
- package/src/lib/ui/components/SharePanel/DefaultSharePanel.tsx +5 -1
- package/src/lib/ui/components/SharePanel/{UserPresenceEditor.tsx → DefaultUserPresenceEditor.tsx} +2 -1
- package/src/lib/ui/components/SharePanel/UserPresenceColorPicker.tsx +1 -0
- package/src/lib/ui/components/StylePanel/DefaultStylePanel.tsx +16 -11
- package/src/lib/ui/components/StylePanel/DefaultStylePanelContent.tsx +13 -19
- package/src/lib/ui/components/StylePanel/StylePanelButtonPicker.tsx +2 -3
- package/src/lib/ui/components/StylePanel/StylePanelContext.tsx +39 -2
- package/src/lib/ui/components/primitives/menus/TldrawUiMenuItem.tsx +9 -0
- package/src/lib/ui/context/actions.tsx +51 -1
- package/src/lib/ui/context/components.tsx +24 -0
- package/src/lib/ui/hooks/useClipboardEvents.ts +57 -12
- package/src/lib/ui/version.ts +3 -3
- package/src/lib/utils/embeds/embeds.test.ts +46 -0
- package/src/test/Editor.test.tsx +0 -16
- package/src/test/TldrawEditor.test.tsx +2 -2
- package/src/test/ZoomTool.test.ts +41 -0
- package/src/test/commands/__snapshots__/getSvgString.test.ts.snap +8 -8
- package/src/test/commands/cameraState.test.ts +16 -0
- package/src/test/commands/clipboardCallbacks.test.ts +97 -0
- package/src/test/commands/nudge.test.ts +36 -0
- package/src/test/custom-clipping.test.ts +2 -2
- package/src/test/displayValues.test.ts +309 -0
- package/src/test/frames.test.ts +3 -3
- package/src/test/getCulledShapes.test.tsx +1 -1
- package/src/test/grid-align-on-create.test.ts +1 -2
- package/src/test/notVisibleShapes.test.ts +1 -1
- package/src/test/selection-omnibus.test.ts +23 -0
- package/tldraw.css +0 -33
- package/dist-cjs/lib/shapes/geo/components/GeoShapeBody.js.map +0 -7
- package/dist-cjs/lib/shapes/shared/ShapeFill.js +0 -84
- package/dist-cjs/lib/shapes/shared/ShapeFill.js.map +0 -7
- package/dist-cjs/lib/shapes/shared/useColorSpace.js +0 -41
- package/dist-cjs/lib/shapes/shared/useColorSpace.js.map +0 -7
- package/dist-cjs/lib/shapes/shared/useDefaultColorTheme.js.map +0 -7
- package/dist-cjs/lib/ui/components/SharePanel/PeopleMenu.js.map +0 -7
- package/dist-cjs/lib/ui/components/SharePanel/PeopleMenuAvatar.js.map +0 -7
- package/dist-cjs/lib/ui/components/SharePanel/PeopleMenuItem.js.map +0 -7
- package/dist-cjs/lib/ui/components/SharePanel/PeopleMenuMore.js.map +0 -7
- package/dist-cjs/lib/ui/components/SharePanel/UserPresenceEditor.js.map +0 -7
- package/dist-esm/lib/shapes/geo/components/GeoShapeBody.mjs +0 -33
- package/dist-esm/lib/shapes/geo/components/GeoShapeBody.mjs.map +0 -7
- package/dist-esm/lib/shapes/shared/ShapeFill.mjs +0 -59
- package/dist-esm/lib/shapes/shared/ShapeFill.mjs.map +0 -7
- package/dist-esm/lib/shapes/shared/useColorSpace.mjs +0 -21
- package/dist-esm/lib/shapes/shared/useColorSpace.mjs.map +0 -7
- package/dist-esm/lib/shapes/shared/useDefaultColorTheme.mjs +0 -8
- package/dist-esm/lib/shapes/shared/useDefaultColorTheme.mjs.map +0 -7
- package/dist-esm/lib/ui/components/SharePanel/PeopleMenu.mjs +0 -67
- package/dist-esm/lib/ui/components/SharePanel/PeopleMenu.mjs.map +0 -7
- package/dist-esm/lib/ui/components/SharePanel/PeopleMenuAvatar.mjs.map +0 -7
- package/dist-esm/lib/ui/components/SharePanel/PeopleMenuItem.mjs.map +0 -7
- package/dist-esm/lib/ui/components/SharePanel/PeopleMenuMore.mjs +0 -8
- package/dist-esm/lib/ui/components/SharePanel/PeopleMenuMore.mjs.map +0 -7
- package/dist-esm/lib/ui/components/SharePanel/UserPresenceEditor.mjs.map +0 -7
- package/src/lib/shapes/geo/components/GeoShapeBody.tsx +0 -40
- package/src/lib/shapes/shared/ShapeFill.tsx +0 -73
- package/src/lib/shapes/shared/useColorSpace.tsx +0 -23
- package/src/lib/shapes/shared/useDefaultColorTheme.ts +0 -6
- package/src/lib/ui/components/SharePanel/PeopleMenuMore.tsx +0 -3
package/dist-cjs/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AssetUtil } from '@tldraw/editor';
|
|
1
2
|
import { Atom } from '@tldraw/editor';
|
|
2
3
|
import { BaseBoxShapeTool } from '@tldraw/editor';
|
|
3
4
|
import { BaseBoxShapeUtil } from '@tldraw/editor';
|
|
@@ -78,12 +79,9 @@ import { TLClickEventInfo } from '@tldraw/editor';
|
|
|
78
79
|
import { TLClipboardWriteInfo } from '@tldraw/editor';
|
|
79
80
|
import { TLContent } from '@tldraw/editor';
|
|
80
81
|
import { TLCropInfo } from '@tldraw/editor';
|
|
81
|
-
import {
|
|
82
|
-
import {
|
|
83
|
-
import { TLDefaultFontStyle } from '@tldraw/editor';
|
|
84
|
-
import { TLDefaultHorizontalAlignStyle } from '@tldraw/editor';
|
|
82
|
+
import { TLDefaultColorStyle } from '@tldraw/tlschema';
|
|
83
|
+
import { TLDefaultFontStyle } from '@tldraw/tlschema';
|
|
85
84
|
import { TLDefaultSizeStyle } from '@tldraw/editor';
|
|
86
|
-
import { TLDefaultVerticalAlignStyle } from '@tldraw/editor';
|
|
87
85
|
import { TLDragShapesOutInfo } from '@tldraw/editor';
|
|
88
86
|
import { TLDragShapesOverInfo } from '@tldraw/editor';
|
|
89
87
|
import { TldrawEditorBaseProps } from '@tldraw/editor';
|
|
@@ -100,7 +98,8 @@ import { TLEmbedShapeProps } from '@tldraw/editor';
|
|
|
100
98
|
import { TLEventInfo } from '@tldraw/editor';
|
|
101
99
|
import { TLExportType } from '@tldraw/editor';
|
|
102
100
|
import { TLFileExternalAsset } from '@tldraw/editor';
|
|
103
|
-
import { TLFontFace } from '@tldraw/
|
|
101
|
+
import { TLFontFace } from '@tldraw/tlschema';
|
|
102
|
+
import { TLFontFace as TLFontFace_2 } from '@tldraw/editor';
|
|
104
103
|
import { TLFrameShape } from '@tldraw/editor';
|
|
105
104
|
import { TLFrameShapeProps } from '@tldraw/editor';
|
|
106
105
|
import { TLGeometryOpts } from '@tldraw/editor';
|
|
@@ -143,10 +142,13 @@ import { TLStore } from '@tldraw/editor';
|
|
|
143
142
|
import { TLStoreSnapshot } from '@tldraw/editor';
|
|
144
143
|
import { TLTextOptions } from '@tldraw/editor';
|
|
145
144
|
import { TLTextShape } from '@tldraw/editor';
|
|
145
|
+
import { TLTheme } from '@tldraw/editor';
|
|
146
|
+
import { TLThemeColors } from '@tldraw/editor';
|
|
146
147
|
import { TLUrlExternalAsset } from '@tldraw/editor';
|
|
147
148
|
import { TLVideoAsset } from '@tldraw/editor';
|
|
148
149
|
import { TLVideoShape } from '@tldraw/editor';
|
|
149
150
|
import { UnknownRecord } from '@tldraw/editor';
|
|
151
|
+
import { Validator } from '@tldraw/validate';
|
|
150
152
|
import { Vec } from '@tldraw/editor';
|
|
151
153
|
import { VecLike } from '@tldraw/editor';
|
|
152
154
|
import { VecModel } from '@tldraw/editor';
|
|
@@ -176,14 +178,11 @@ export declare type AlertSeverity = 'error' | 'info' | 'success' | 'warning';
|
|
|
176
178
|
export declare function AlignMenuItems(): JSX.Element;
|
|
177
179
|
|
|
178
180
|
/** @public */
|
|
179
|
-
export declare const allDefaultFontFaces:
|
|
181
|
+
export declare const allDefaultFontFaces: TLFontFace_2[];
|
|
180
182
|
|
|
181
183
|
/** @public @react */
|
|
182
184
|
export declare function ArrangeMenuSubmenu(): JSX.Element | null;
|
|
183
185
|
|
|
184
|
-
/** @public */
|
|
185
|
-
export declare const ARROW_LABEL_FONT_SIZES: Record<TLDefaultSizeStyle, number>;
|
|
186
|
-
|
|
187
186
|
/**
|
|
188
187
|
* @public
|
|
189
188
|
*/
|
|
@@ -224,7 +223,7 @@ export declare function ArrowRightToolbarItem(): JSX.Element;
|
|
|
224
223
|
*
|
|
225
224
|
* @public
|
|
226
225
|
*/
|
|
227
|
-
export declare interface ArrowShapeOptions {
|
|
226
|
+
export declare interface ArrowShapeOptions extends ShapeOptionsWithDisplayValues<TLArrowShape, ArrowShapeUtilDisplayValues> {
|
|
228
227
|
/**
|
|
229
228
|
* How far should elbow arrows expand from the shapes they're targeting?
|
|
230
229
|
*/
|
|
@@ -315,13 +314,13 @@ export declare class ArrowShapeUtil extends ShapeUtil<TLArrowShape> {
|
|
|
315
314
|
static props: RecordProps<TLArrowShape>;
|
|
316
315
|
static migrations: MigrationSequence;
|
|
317
316
|
options: ArrowShapeOptions;
|
|
318
|
-
canEdit(): boolean;
|
|
317
|
+
canEdit(shape: TLArrowShape): boolean;
|
|
319
318
|
canBind({ toShape }: TLShapeUtilCanBindOpts<TLArrowShape>): boolean;
|
|
320
|
-
canSnap(): boolean;
|
|
321
|
-
hideResizeHandles(): boolean;
|
|
322
|
-
hideRotateHandle(): boolean;
|
|
323
|
-
hideSelectionBoundsBg(): boolean;
|
|
324
|
-
hideSelectionBoundsFg(): boolean;
|
|
319
|
+
canSnap(shape: TLArrowShape): boolean;
|
|
320
|
+
hideResizeHandles(shape: TLArrowShape): boolean;
|
|
321
|
+
hideRotateHandle(shape: TLArrowShape): boolean;
|
|
322
|
+
hideSelectionBoundsBg(shape: TLArrowShape): boolean;
|
|
323
|
+
hideSelectionBoundsFg(shape: TLArrowShape): boolean;
|
|
325
324
|
hideInMinimap(): boolean;
|
|
326
325
|
canBeLaidOut(shape: TLArrowShape, info: TLShapeUtilCanBeLaidOutOpts): boolean;
|
|
327
326
|
getFontFaces(shape: TLArrowShape): TLFontFace[];
|
|
@@ -380,6 +379,20 @@ export declare class ArrowShapeUtil extends ShapeUtil<TLArrowShape> {
|
|
|
380
379
|
getInterpolatedProps(startShape: TLArrowShape, endShape: TLArrowShape, progress: number): TLArrowShapeProps;
|
|
381
380
|
}
|
|
382
381
|
|
|
382
|
+
/** @public */
|
|
383
|
+
export declare interface ArrowShapeUtilDisplayValues {
|
|
384
|
+
strokeColor: string;
|
|
385
|
+
strokeWidth: number;
|
|
386
|
+
fillColor: string;
|
|
387
|
+
patternFillFallbackColor: string;
|
|
388
|
+
labelColor: string;
|
|
389
|
+
labelFontFamily: string;
|
|
390
|
+
labelFontSize: number;
|
|
391
|
+
labelLineHeight: number;
|
|
392
|
+
labelPadding: number;
|
|
393
|
+
labelBorderRadius: number;
|
|
394
|
+
}
|
|
395
|
+
|
|
383
396
|
/**
|
|
384
397
|
* State representing what we're pointing to when drawing or updating an arrow. You can get this
|
|
385
398
|
* state using {@link getArrowTargetState}, and update it as part of an arrow interaction with
|
|
@@ -444,13 +457,32 @@ export declare interface BasePathBuilderOpts {
|
|
|
444
457
|
props?: SVGProps<SVGPathElement & SVGGElement>;
|
|
445
458
|
}
|
|
446
459
|
|
|
460
|
+
/** @public */
|
|
461
|
+
export declare class BookmarkAssetUtil extends AssetUtil<TLBookmarkAsset> {
|
|
462
|
+
static type: "bookmark";
|
|
463
|
+
static props: {
|
|
464
|
+
description: Validator<string>;
|
|
465
|
+
favicon: Validator<string>;
|
|
466
|
+
image: Validator<string>;
|
|
467
|
+
src: Validator<null | string>;
|
|
468
|
+
title: Validator<string>;
|
|
469
|
+
};
|
|
470
|
+
static migrations: MigrationSequence;
|
|
471
|
+
getDefaultProps(): TLBookmarkAsset['props'];
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
/** @public */
|
|
475
|
+
export declare interface BookmarkShapeOptions extends ShapeOptionsWithDisplayValues<TLBookmarkShape, BookmarkShapeUtilDisplayValues> {
|
|
476
|
+
}
|
|
477
|
+
|
|
447
478
|
/** @public */
|
|
448
479
|
export declare class BookmarkShapeUtil extends BaseBoxShapeUtil<TLBookmarkShape> {
|
|
449
480
|
static type: "bookmark";
|
|
450
481
|
static props: RecordProps<TLBookmarkShape>;
|
|
451
482
|
static migrations: TLPropsMigrations;
|
|
452
|
-
|
|
453
|
-
|
|
483
|
+
options: BookmarkShapeOptions;
|
|
484
|
+
canResize(shape: TLBookmarkShape): boolean;
|
|
485
|
+
hideSelectionBoundsFg(shape: TLBookmarkShape): boolean;
|
|
454
486
|
getText(shape: TLBookmarkShape): string;
|
|
455
487
|
getAriaDescriptor(shape: TLBookmarkShape): string | undefined;
|
|
456
488
|
getDefaultProps(): TLBookmarkShape['props'];
|
|
@@ -499,6 +531,9 @@ export declare class BookmarkShapeUtil extends BaseBoxShapeUtil<TLBookmarkShape>
|
|
|
499
531
|
getInterpolatedProps(startShape: TLBookmarkShape, endShape: TLBookmarkShape, t: number): TLBookmarkShapeProps;
|
|
500
532
|
}
|
|
501
533
|
|
|
534
|
+
/** @public */
|
|
535
|
+
export declare type BookmarkShapeUtilDisplayValues = object;
|
|
536
|
+
|
|
502
537
|
/** @public */
|
|
503
538
|
export declare interface BoxWidthHeight {
|
|
504
539
|
w: number;
|
|
@@ -703,6 +738,16 @@ export declare const DEFAULT_EMBED_DEFINITIONS: readonly [{
|
|
|
703
738
|
readonly toEmbedUrl: (url: string) => string | undefined;
|
|
704
739
|
readonly type: "figma";
|
|
705
740
|
readonly width: 720;
|
|
741
|
+
}, {
|
|
742
|
+
readonly doesResize: true;
|
|
743
|
+
readonly embedOnPaste: true;
|
|
744
|
+
readonly fromEmbedUrl: (url: string) => string | undefined;
|
|
745
|
+
readonly height: 500;
|
|
746
|
+
readonly hostnames: readonly ["canva.com"];
|
|
747
|
+
readonly title: "Canva";
|
|
748
|
+
readonly toEmbedUrl: (url: string) => string | undefined;
|
|
749
|
+
readonly type: "canva";
|
|
750
|
+
readonly width: 720;
|
|
706
751
|
}, {
|
|
707
752
|
readonly doesResize: true;
|
|
708
753
|
readonly embedOnPaste: true;
|
|
@@ -907,7 +952,10 @@ export declare const DefaultActionsMenu: NamedExoticComponent<TLUiActionsMenuPro
|
|
|
907
952
|
export declare function DefaultActionsMenuContent(): JSX.Element;
|
|
908
953
|
|
|
909
954
|
/** @public */
|
|
910
|
-
export declare function defaultAddFontsFromNode(node: Node_2, state: RichTextFontVisitorState, addFont: (font:
|
|
955
|
+
export declare function defaultAddFontsFromNode(node: Node_2, state: RichTextFontVisitorState, addFont: (font: TLFontFace_2) => void): RichTextFontVisitorState;
|
|
956
|
+
|
|
957
|
+
/** @public */
|
|
958
|
+
export declare const defaultAssetUtils: readonly [typeof ImageAssetUtil, typeof VideoAssetUtil, typeof BookmarkAssetUtil];
|
|
911
959
|
|
|
912
960
|
/** @public */
|
|
913
961
|
export declare const defaultBindingUtils: readonly [typeof ArrowBindingUtil];
|
|
@@ -955,7 +1003,7 @@ export declare function defaultHandleExternalExcalidrawContent(editor: Editor, {
|
|
|
955
1003
|
}): Promise<void>;
|
|
956
1004
|
|
|
957
1005
|
/** @public */
|
|
958
|
-
export declare function defaultHandleExternalFileAsset(editor: Editor, { file, assetId }: TLFileExternalAsset, options: TLDefaultExternalContentHandlerOpts): Promise<TLAsset
|
|
1006
|
+
export declare function defaultHandleExternalFileAsset(editor: Editor, { file, assetId }: TLFileExternalAsset, options: TLDefaultExternalContentHandlerOpts): Promise<TLAsset<"bookmark" | "image" | "video">>;
|
|
959
1007
|
|
|
960
1008
|
/** @public */
|
|
961
1009
|
export declare function defaultHandleExternalFileContent(editor: Editor, { point, files }: {
|
|
@@ -1042,6 +1090,35 @@ export declare const DefaultNavigationPanel: NamedExoticComponent<object>;
|
|
|
1042
1090
|
/** @public @react */
|
|
1043
1091
|
export declare const DefaultPageMenu: NamedExoticComponent<object>;
|
|
1044
1092
|
|
|
1093
|
+
/** @public @react */
|
|
1094
|
+
declare function DefaultPeopleMenu({ children }: DefaultPeopleMenuProps): JSX.Element | null;
|
|
1095
|
+
export { DefaultPeopleMenu }
|
|
1096
|
+
export { DefaultPeopleMenu as PeopleMenu }
|
|
1097
|
+
|
|
1098
|
+
/** @public @react */
|
|
1099
|
+
export declare function DefaultPeopleMenuAvatar({ userId }: TLUiPeopleMenuAvatarProps): JSX.Element | null;
|
|
1100
|
+
|
|
1101
|
+
/** @public @react */
|
|
1102
|
+
export declare function DefaultPeopleMenuContent({ userIds }: DefaultPeopleMenuContentProps): JSX.Element;
|
|
1103
|
+
|
|
1104
|
+
/** @public */
|
|
1105
|
+
export declare interface DefaultPeopleMenuContentProps {
|
|
1106
|
+
userIds: string[];
|
|
1107
|
+
}
|
|
1108
|
+
|
|
1109
|
+
/** @public @react */
|
|
1110
|
+
export declare function DefaultPeopleMenuFacePile({ userIds, userName, userColor }: TLUiPeopleMenuFacePileProps): JSX.Element;
|
|
1111
|
+
|
|
1112
|
+
/** @public @react */
|
|
1113
|
+
export declare const DefaultPeopleMenuItem: NamedExoticComponent<TLUiPeopleMenuItemProps>;
|
|
1114
|
+
|
|
1115
|
+
/** @public */
|
|
1116
|
+
declare interface DefaultPeopleMenuProps {
|
|
1117
|
+
children?: ReactNode;
|
|
1118
|
+
}
|
|
1119
|
+
export { DefaultPeopleMenuProps }
|
|
1120
|
+
export { DefaultPeopleMenuProps as PeopleMenuProps }
|
|
1121
|
+
|
|
1045
1122
|
/** @public @react */
|
|
1046
1123
|
export declare const DefaultQuickActions: NamedExoticComponent<TLUiQuickActionsProps>;
|
|
1047
1124
|
|
|
@@ -1075,7 +1152,7 @@ export declare const defaultShapeTools: readonly [typeof TextShapeTool, typeof D
|
|
|
1075
1152
|
export declare const defaultShapeUtils: readonly [typeof TextShapeUtil, typeof BookmarkShapeUtil, typeof DrawShapeUtil, typeof GeoShapeUtil, typeof NoteShapeUtil, typeof LineShapeUtil, typeof FrameShapeUtil, typeof ArrowShapeUtil, typeof HighlightShapeUtil, typeof EmbedShapeUtil, typeof ImageShapeUtil, typeof VideoShapeUtil];
|
|
1076
1153
|
|
|
1077
1154
|
/** @public @react */
|
|
1078
|
-
export declare function DefaultSharePanel(): JSX.Element;
|
|
1155
|
+
export declare function DefaultSharePanel(): JSX.Element | null;
|
|
1079
1156
|
|
|
1080
1157
|
/** @public @react */
|
|
1081
1158
|
export declare const DefaultStylePanel: NamedExoticComponent<TLUiStylePanelProps>;
|
|
@@ -1112,6 +1189,9 @@ export declare interface DefaultToolbarProps {
|
|
|
1112
1189
|
/** @public */
|
|
1113
1190
|
export declare const defaultTools: readonly [typeof EraserTool, typeof HandTool, typeof LaserTool, typeof ZoomTool, typeof SelectTool];
|
|
1114
1191
|
|
|
1192
|
+
/** @public @react */
|
|
1193
|
+
export declare function DefaultUserPresenceEditor(): JSX.Element;
|
|
1194
|
+
|
|
1115
1195
|
/** @public @react */
|
|
1116
1196
|
export declare const DefaultVideoToolbar: NamedExoticComponent<TLUiVideoToolbarProps>;
|
|
1117
1197
|
|
|
@@ -1178,7 +1258,7 @@ export declare interface DrawPathBuilderOpts extends BasePathBuilderOpts, DrawPa
|
|
|
1178
1258
|
}
|
|
1179
1259
|
|
|
1180
1260
|
/** @public */
|
|
1181
|
-
export declare interface DrawShapeOptions {
|
|
1261
|
+
export declare interface DrawShapeOptions extends ShapeOptionsWithDisplayValues<TLDrawShape, DrawShapeUtilDisplayValues> {
|
|
1182
1262
|
/**
|
|
1183
1263
|
* The maximum number of points in a line before the draw tool will begin a new shape.
|
|
1184
1264
|
* A higher number will lead to poor performance while drawing very long lines.
|
|
@@ -1224,6 +1304,14 @@ export declare class DrawShapeUtil extends ShapeUtil<TLDrawShape> {
|
|
|
1224
1304
|
getInterpolatedProps(startShape: TLDrawShape, endShape: TLDrawShape, t: number): TLDrawShapeProps;
|
|
1225
1305
|
}
|
|
1226
1306
|
|
|
1307
|
+
/** @public */
|
|
1308
|
+
export declare interface DrawShapeUtilDisplayValues {
|
|
1309
|
+
strokeColor: string;
|
|
1310
|
+
strokeWidth: number;
|
|
1311
|
+
fillColor: string;
|
|
1312
|
+
patternFillFallbackColor: string;
|
|
1313
|
+
}
|
|
1314
|
+
|
|
1227
1315
|
/** @public @react */
|
|
1228
1316
|
export declare function DrawToolbarItem(): JSX.Element;
|
|
1229
1317
|
|
|
@@ -1487,7 +1575,7 @@ export declare interface EmbedDefinition {
|
|
|
1487
1575
|
}
|
|
1488
1576
|
|
|
1489
1577
|
/** @public */
|
|
1490
|
-
export declare interface EmbedShapeOptions {
|
|
1578
|
+
export declare interface EmbedShapeOptions extends ShapeOptionsWithDisplayValues<TLEmbedShape, EmbedShapeUtilDisplayValues> {
|
|
1491
1579
|
/** The embed definitions to use for this shape util. */
|
|
1492
1580
|
readonly embedDefinitions: readonly TLEmbedDefinition[];
|
|
1493
1581
|
}
|
|
@@ -1531,9 +1619,9 @@ export declare class EmbedShapeUtil extends BaseBoxShapeUtil<TLEmbedShape> {
|
|
|
1531
1619
|
getText(shape: TLEmbedShape): string;
|
|
1532
1620
|
getAriaDescriptor(shape: TLEmbedShape): string | undefined;
|
|
1533
1621
|
hideSelectionBoundsFg(shape: TLEmbedShape): boolean;
|
|
1534
|
-
canEdit(): boolean;
|
|
1622
|
+
canEdit(shape: TLEmbedShape): boolean;
|
|
1535
1623
|
canResize(shape: TLEmbedShape): boolean;
|
|
1536
|
-
canEditInReadonly(): boolean;
|
|
1624
|
+
canEditInReadonly(shape: TLEmbedShape): boolean;
|
|
1537
1625
|
getDefaultProps(): TLEmbedShape['props'];
|
|
1538
1626
|
getGeometry(shape: TLEmbedShape): Geometry2d;
|
|
1539
1627
|
isAspectRatioLocked(shape: TLEmbedShape): boolean;
|
|
@@ -1545,6 +1633,11 @@ export declare class EmbedShapeUtil extends BaseBoxShapeUtil<TLEmbedShape> {
|
|
|
1545
1633
|
getInterpolatedProps(startShape: TLEmbedShape, endShape: TLEmbedShape, t: number): TLEmbedShapeProps;
|
|
1546
1634
|
}
|
|
1547
1635
|
|
|
1636
|
+
/** @public */
|
|
1637
|
+
export declare interface EmbedShapeUtilDisplayValues {
|
|
1638
|
+
showShadow: boolean;
|
|
1639
|
+
}
|
|
1640
|
+
|
|
1548
1641
|
/** @public */
|
|
1549
1642
|
export declare class EraserTool extends StateNode {
|
|
1550
1643
|
static id: string;
|
|
@@ -1628,13 +1721,7 @@ export declare function fitFrameToContent(editor: Editor, id: TLShapeId, opts?:
|
|
|
1628
1721
|
export declare function FitFrameToContentMenuItem(): JSX.Element | null;
|
|
1629
1722
|
|
|
1630
1723
|
/** @public */
|
|
1631
|
-
export declare
|
|
1632
|
-
|
|
1633
|
-
/** @public */
|
|
1634
|
-
export declare const FONT_SIZES: Record<TLDefaultSizeStyle, number>;
|
|
1635
|
-
|
|
1636
|
-
/** @public */
|
|
1637
|
-
export declare interface FrameShapeOptions {
|
|
1724
|
+
export declare interface FrameShapeOptions extends ShapeOptionsWithDisplayValues<TLFrameShape, FrameShapeUtilDisplayValues> {
|
|
1638
1725
|
/**
|
|
1639
1726
|
* When true, the frame will display colors for the shape's headings and background.
|
|
1640
1727
|
*/
|
|
@@ -1663,8 +1750,8 @@ export declare class FrameShapeUtil extends BaseBoxShapeUtil<TLFrameShape> {
|
|
|
1663
1750
|
options: infer Options;
|
|
1664
1751
|
} ? Partial<Options> : never): T;
|
|
1665
1752
|
canEdit(shape: TLFrameShape, info: TLEditStartInfo): boolean;
|
|
1666
|
-
canResize(): boolean;
|
|
1667
|
-
canResizeChildren(): boolean;
|
|
1753
|
+
canResize(shape: TLFrameShape): boolean;
|
|
1754
|
+
canResizeChildren(shape: TLFrameShape): boolean;
|
|
1668
1755
|
isExportBoundsContainer(): boolean;
|
|
1669
1756
|
getDefaultProps(): TLFrameShape['props'];
|
|
1670
1757
|
getAriaDescriptor(shape: TLFrameShape): string;
|
|
@@ -1696,9 +1783,28 @@ export declare class FrameShapeUtil extends BaseBoxShapeUtil<TLFrameShape> {
|
|
|
1696
1783
|
onDragShapesOut(shape: TLFrameShape, draggingShapes: TLShape[], info: TLDragShapesOutInfo): void;
|
|
1697
1784
|
}
|
|
1698
1785
|
|
|
1786
|
+
/** @public */
|
|
1787
|
+
export declare interface FrameShapeUtilDisplayValues {
|
|
1788
|
+
fillColor: string;
|
|
1789
|
+
strokeColor: string;
|
|
1790
|
+
showColorsFillColor: string;
|
|
1791
|
+
showColorsStrokeColor: string;
|
|
1792
|
+
headingFillColor: string;
|
|
1793
|
+
headingStrokeColor: string;
|
|
1794
|
+
headingTextColor: string;
|
|
1795
|
+
showColorsHeadingFillColor: string;
|
|
1796
|
+
showColorsHeadingStrokeColor: string;
|
|
1797
|
+
showColorsHeadingTextColor: string;
|
|
1798
|
+
}
|
|
1799
|
+
|
|
1699
1800
|
/** @public @react */
|
|
1700
1801
|
export declare function FrameToolbarItem(): JSX.Element;
|
|
1701
1802
|
|
|
1803
|
+
/** @public */
|
|
1804
|
+
export declare interface GeoShapeOptions extends ShapeOptionsWithDisplayValues<TLGeoShape, GeoShapeUtilDisplayValues> {
|
|
1805
|
+
showTextOutline: boolean;
|
|
1806
|
+
}
|
|
1807
|
+
|
|
1702
1808
|
/** @public */
|
|
1703
1809
|
export declare class GeoShapeTool extends StateNode {
|
|
1704
1810
|
static id: string;
|
|
@@ -1712,17 +1818,15 @@ export declare class GeoShapeUtil extends BaseBoxShapeUtil<TLGeoShape> {
|
|
|
1712
1818
|
static type: "geo";
|
|
1713
1819
|
static props: RecordProps<TLGeoShape>;
|
|
1714
1820
|
static migrations: TLPropsMigrations;
|
|
1715
|
-
options:
|
|
1716
|
-
|
|
1717
|
-
};
|
|
1718
|
-
canEdit(): boolean;
|
|
1821
|
+
options: GeoShapeOptions;
|
|
1822
|
+
canEdit(shape: TLGeoShape): boolean;
|
|
1719
1823
|
getDefaultProps(): TLGeoShape['props'];
|
|
1720
1824
|
getGeometry(shape: TLGeoShape): Group2d;
|
|
1721
1825
|
getHandleSnapGeometry(shape: TLGeoShape): HandleSnapGeometry;
|
|
1722
1826
|
getText(shape: TLGeoShape): string;
|
|
1723
1827
|
getFontFaces(shape: TLGeoShape): TLFontFace[];
|
|
1724
1828
|
component(shape: TLGeoShape): JSX.Element;
|
|
1725
|
-
indicator(shape: TLGeoShape): JSX.Element;
|
|
1829
|
+
indicator(shape: TLGeoShape): JSX.Element | null;
|
|
1726
1830
|
useLegacyIndicator(): boolean;
|
|
1727
1831
|
getIndicatorPath(shape: TLGeoShape): Path2D | undefined;
|
|
1728
1832
|
toSvg(shape: TLGeoShape, ctx: SvgExportContext): JSX.Element;
|
|
@@ -1745,14 +1849,14 @@ export declare class GeoShapeUtil extends BaseBoxShapeUtil<TLGeoShape> {
|
|
|
1745
1849
|
parentId: TLParentId;
|
|
1746
1850
|
props: {
|
|
1747
1851
|
align: "end-legacy" | "end" | "middle-legacy" | "middle" | "start-legacy" | "start";
|
|
1748
|
-
color:
|
|
1749
|
-
dash: "dashed" | "dotted" | "draw" | "solid";
|
|
1852
|
+
color: TLDefaultColorStyle;
|
|
1853
|
+
dash: "dashed" | "dotted" | "draw" | "none" | "solid";
|
|
1750
1854
|
fill: "fill" | "lined-fill" | "none" | "pattern" | "semi" | "solid";
|
|
1751
|
-
font:
|
|
1855
|
+
font: TLDefaultFontStyle;
|
|
1752
1856
|
geo: "arrow-down" | "arrow-left" | "arrow-right" | "arrow-up" | "check-box" | "cloud" | "diamond" | "ellipse" | "heart" | "hexagon" | "octagon" | "oval" | "pentagon" | "rectangle" | "rhombus-2" | "rhombus" | "star" | "trapezoid" | "triangle" | "x-box";
|
|
1753
1857
|
growY: number;
|
|
1754
1858
|
h: number;
|
|
1755
|
-
labelColor:
|
|
1859
|
+
labelColor: TLDefaultColorStyle;
|
|
1756
1860
|
richText: {
|
|
1757
1861
|
attrs?: any;
|
|
1758
1862
|
content: unknown[];
|
|
@@ -1779,14 +1883,14 @@ export declare class GeoShapeUtil extends BaseBoxShapeUtil<TLGeoShape> {
|
|
|
1779
1883
|
parentId: TLParentId;
|
|
1780
1884
|
props: {
|
|
1781
1885
|
align: "end-legacy" | "end" | "middle-legacy" | "middle" | "start-legacy" | "start";
|
|
1782
|
-
color:
|
|
1783
|
-
dash: "dashed" | "dotted" | "draw" | "solid";
|
|
1886
|
+
color: TLDefaultColorStyle;
|
|
1887
|
+
dash: "dashed" | "dotted" | "draw" | "none" | "solid";
|
|
1784
1888
|
fill: "fill" | "lined-fill" | "none" | "pattern" | "semi" | "solid";
|
|
1785
|
-
font:
|
|
1889
|
+
font: TLDefaultFontStyle;
|
|
1786
1890
|
geo: "arrow-down" | "arrow-left" | "arrow-right" | "arrow-up" | "check-box" | "cloud" | "diamond" | "ellipse" | "heart" | "hexagon" | "octagon" | "oval" | "pentagon" | "rectangle" | "rhombus-2" | "rhombus" | "star" | "trapezoid" | "triangle" | "x-box";
|
|
1787
1891
|
growY: number;
|
|
1788
1892
|
h: number;
|
|
1789
|
-
labelColor:
|
|
1893
|
+
labelColor: TLDefaultColorStyle;
|
|
1790
1894
|
richText: {
|
|
1791
1895
|
attrs?: any;
|
|
1792
1896
|
content: unknown[];
|
|
@@ -1836,6 +1940,52 @@ export declare class GeoShapeUtil extends BaseBoxShapeUtil<TLGeoShape> {
|
|
|
1836
1940
|
y: number;
|
|
1837
1941
|
} | undefined;
|
|
1838
1942
|
getInterpolatedProps(startShape: TLGeoShape, endShape: TLGeoShape, t: number): TLGeoShapeProps;
|
|
1943
|
+
/**
|
|
1944
|
+
* Get the unscaled dimensions from a geo shape's props
|
|
1945
|
+
*/
|
|
1946
|
+
private getUnscaledGeoProps;
|
|
1947
|
+
/**
|
|
1948
|
+
* Calculate the growY needed to fit a label within a shape.
|
|
1949
|
+
* Returns null if no change is needed, otherwise returns the new unscaled growY value.
|
|
1950
|
+
*/
|
|
1951
|
+
private calculateGrowY;
|
|
1952
|
+
/**
|
|
1953
|
+
* Calculate expanded dimensions when adding a label to a shape for the first time.
|
|
1954
|
+
* Ensures the shape meets minimum size requirements and is square if originally small.
|
|
1955
|
+
*/
|
|
1956
|
+
private expandShapeForFirstLabel;
|
|
1957
|
+
private _labelSizesForGeoCache;
|
|
1958
|
+
/**
|
|
1959
|
+
* Get the cached label size for the shape. Don't call with empty rich text.
|
|
1960
|
+
*/
|
|
1961
|
+
private getUnscaledLabelSize;
|
|
1962
|
+
/**
|
|
1963
|
+
* Expensively measure the unscaled label size for the shape. Avoid using it if we can.
|
|
1964
|
+
*/
|
|
1965
|
+
private measureUnscaledLabelSize;
|
|
1966
|
+
}
|
|
1967
|
+
|
|
1968
|
+
/** @public */
|
|
1969
|
+
export declare interface GeoShapeUtilDisplayValues {
|
|
1970
|
+
strokeColor: string;
|
|
1971
|
+
strokeRoundness: number;
|
|
1972
|
+
strokeWidth: number;
|
|
1973
|
+
fillColor: string;
|
|
1974
|
+
patternFillFallbackColor: string;
|
|
1975
|
+
labelColor: string;
|
|
1976
|
+
labelFontFamily: string;
|
|
1977
|
+
labelFontSize: number;
|
|
1978
|
+
labelMinWidth: number;
|
|
1979
|
+
labelExtraPadding: number;
|
|
1980
|
+
labelLineHeight: number;
|
|
1981
|
+
labelFontWeight: string;
|
|
1982
|
+
labelFontVariant: string;
|
|
1983
|
+
labelFontStyle: string;
|
|
1984
|
+
labelHorizontalAlign: 'center' | 'end' | 'start';
|
|
1985
|
+
labelVerticalAlign: 'end' | 'middle' | 'start';
|
|
1986
|
+
labelPadding: number;
|
|
1987
|
+
labelEdgeMargin: number;
|
|
1988
|
+
minSizeWithLabel: number;
|
|
1839
1989
|
}
|
|
1840
1990
|
|
|
1841
1991
|
/** @public */
|
|
@@ -1859,7 +2009,19 @@ export declare function getArrowTerminalsInArrowSpace(editor: Editor, shape: TLA
|
|
|
1859
2009
|
};
|
|
1860
2010
|
|
|
1861
2011
|
/** @public */
|
|
1862
|
-
export declare function getAssetInfo(
|
|
2012
|
+
export declare function getAssetInfo(editor: Editor, file: File, assetId?: TLAssetId): Promise<null | TLAsset>;
|
|
2013
|
+
|
|
2014
|
+
/**
|
|
2015
|
+
* Returns the current list of color style items for the style panel,
|
|
2016
|
+
* derived from the theme's color palette. Only palette colors are included;
|
|
2017
|
+
* utility colors like `text`, `background`, etc. are excluded.
|
|
2018
|
+
*
|
|
2019
|
+
* Colors are ordered by their position in {@link @tldraw/tlschema#DefaultColorStyle},
|
|
2020
|
+
* followed by any additional theme colors in their object key order.
|
|
2021
|
+
*
|
|
2022
|
+
* @public
|
|
2023
|
+
*/
|
|
2024
|
+
export declare function getColorStyleItems(colors: TLThemeColors): StyleValuesForUi<string>;
|
|
1863
2025
|
|
|
1864
2026
|
/** @public */
|
|
1865
2027
|
export declare function getCropBox<T extends ShapeWithCrop>(shape: T, info: TLCropInfo<T>, opts?: CropBoxOptions): {
|
|
@@ -1873,6 +2035,16 @@ export declare function getCropBox<T extends ShapeWithCrop>(shape: T, info: TLCr
|
|
|
1873
2035
|
/** @public */
|
|
1874
2036
|
export declare function getDefaultCrop(): TLShapeCrop;
|
|
1875
2037
|
|
|
2038
|
+
/**
|
|
2039
|
+
* Get the resolved display values for a shape, merging the base values with any overrides.
|
|
2040
|
+
*
|
|
2041
|
+
* @public
|
|
2042
|
+
*/
|
|
2043
|
+
export declare function getDisplayValues<Shape extends TLShape, DisplayValues extends object>(util: {
|
|
2044
|
+
editor: Editor;
|
|
2045
|
+
options: ShapeOptionsWithDisplayValues<Shape, DisplayValues>;
|
|
2046
|
+
}, shape: Shape, colorMode?: 'dark' | 'light'): DisplayValues;
|
|
2047
|
+
|
|
1876
2048
|
/**
|
|
1877
2049
|
* Tests whether an URL supports embedding and returns the result. If we encounter an error, we
|
|
1878
2050
|
* return undefined.
|
|
@@ -1883,10 +2055,21 @@ export declare function getDefaultCrop(): TLShapeCrop;
|
|
|
1883
2055
|
export declare function getEmbedInfo(definitions: readonly TLEmbedDefinition[], inputUrl: string): TLEmbedResult;
|
|
1884
2056
|
|
|
1885
2057
|
/** @public */
|
|
1886
|
-
export declare function
|
|
2058
|
+
export declare function getFontFamily(theme: TLTheme, font: string): string;
|
|
2059
|
+
|
|
2060
|
+
/**
|
|
2061
|
+
* Returns the current list of font style items for the style panel,
|
|
2062
|
+
* derived from the theme's font palette.
|
|
2063
|
+
*
|
|
2064
|
+
* Fonts are ordered by their position in {@link @tldraw/tlschema#DefaultFontStyle},
|
|
2065
|
+
* followed by any additional theme fonts in their object key order.
|
|
2066
|
+
*
|
|
2067
|
+
* @public
|
|
2068
|
+
*/
|
|
2069
|
+
export declare function getFontStyleItems(theme: TLTheme): StyleValuesForUi<string>;
|
|
1887
2070
|
|
|
1888
2071
|
/** @public */
|
|
1889
|
-
export declare function
|
|
2072
|
+
export declare function getHitShapeOnCanvasPointerDown(editor: Editor, hitLabels?: boolean): TLShape | undefined;
|
|
1890
2073
|
|
|
1891
2074
|
/** @public */
|
|
1892
2075
|
export declare function getPointsFromDrawSegment(segment: TLDrawShapeSegment, scaleX: number, scaleY: number, points?: Vec[]): Vec[];
|
|
@@ -1990,14 +2173,12 @@ export declare function HexagonToolbarItem(): JSX.Element;
|
|
|
1990
2173
|
export declare function hideAllTooltips(): void;
|
|
1991
2174
|
|
|
1992
2175
|
/** @public */
|
|
1993
|
-
export declare interface HighlightShapeOptions {
|
|
2176
|
+
export declare interface HighlightShapeOptions extends ShapeOptionsWithDisplayValues<TLHighlightShape, HighlightShapeUtilDisplayValues> {
|
|
1994
2177
|
/**
|
|
1995
2178
|
* The maximum number of points in a line before the draw tool will begin a new shape.
|
|
1996
2179
|
* A higher number will lead to poor performance while drawing very long lines.
|
|
1997
2180
|
*/
|
|
1998
2181
|
readonly maxPointsPerShape: number;
|
|
1999
|
-
readonly underlayOpacity: number;
|
|
2000
|
-
readonly overlayOpacity: number;
|
|
2001
2182
|
}
|
|
2002
2183
|
|
|
2003
2184
|
/** @public */
|
|
@@ -2027,8 +2208,8 @@ export declare class HighlightShapeUtil extends ShapeUtil<TLHighlightShape> {
|
|
|
2027
2208
|
indicator(shape: TLHighlightShape): JSX.Element;
|
|
2028
2209
|
useLegacyIndicator(): boolean;
|
|
2029
2210
|
getIndicatorPath(shape: TLHighlightShape): Path2D;
|
|
2030
|
-
toSvg(shape: TLHighlightShape): JSX.Element;
|
|
2031
|
-
toBackgroundSvg(shape: TLHighlightShape): JSX.Element;
|
|
2211
|
+
toSvg(shape: TLHighlightShape, ctx: SvgExportContext): JSX.Element;
|
|
2212
|
+
toBackgroundSvg(shape: TLHighlightShape, ctx: SvgExportContext): JSX.Element;
|
|
2032
2213
|
onResize(shape: TLHighlightShape, info: TLResizeInfo<TLHighlightShape>): {
|
|
2033
2214
|
props: {
|
|
2034
2215
|
scaleX: number;
|
|
@@ -2038,21 +2219,59 @@ export declare class HighlightShapeUtil extends ShapeUtil<TLHighlightShape> {
|
|
|
2038
2219
|
getInterpolatedProps(startShape: TLHighlightShape, endShape: TLHighlightShape, t: number): TLHighlightShapeProps;
|
|
2039
2220
|
}
|
|
2040
2221
|
|
|
2222
|
+
/** @public */
|
|
2223
|
+
export declare interface HighlightShapeUtilDisplayValues {
|
|
2224
|
+
strokeColor: string;
|
|
2225
|
+
strokeWidth: number;
|
|
2226
|
+
underlayOpacity: number;
|
|
2227
|
+
overlayOpacity: number;
|
|
2228
|
+
}
|
|
2229
|
+
|
|
2041
2230
|
/** @public @react */
|
|
2042
2231
|
export declare function HighlightToolbarItem(): JSX.Element;
|
|
2043
2232
|
|
|
2044
2233
|
/** @public */
|
|
2045
2234
|
export declare const iconTypes: readonly ["align-bottom", "align-center-horizontal", "align-center-vertical", "align-left", "align-right", "align-top", "alt", "arrow-arc", "arrow-cycle", "arrow-elbow", "arrow-left", "arrowhead-arrow", "arrowhead-bar", "arrowhead-diamond", "arrowhead-dot", "arrowhead-none", "arrowhead-square", "arrowhead-triangle-inverted", "arrowhead-triangle", "blob", "bold", "bookmark", "bring-forward", "bring-to-front", "broken", "bulletList", "check-circle", "check", "chevron-down", "chevron-left", "chevron-right", "chevron-up", "chevrons-ne", "chevrons-sw", "clipboard-copied", "clipboard-copy", "code", "color", "comment", "corners", "crop", "cross-2", "cross-circle", "dash-dashed", "dash-dotted", "dash-draw", "dash-solid", "disconnected", "discord", "distribute-horizontal", "distribute-vertical", "dot", "dots-horizontal", "dots-vertical", "download", "drag-handle-dots", "duplicate", "edit", "external-link", "fill-fill", "fill-lined-fill", "fill-none", "fill-pattern", "fill-semi", "fill-solid", "follow", "following", "font-draw", "font-mono", "font-sans", "font-serif", "geo-arrow-down", "geo-arrow-left", "geo-arrow-right", "geo-arrow-up", "geo-check-box", "geo-cloud", "geo-diamond", "geo-ellipse", "geo-heart", "geo-hexagon", "geo-octagon", "geo-oval", "geo-pentagon", "geo-rectangle", "geo-rhombus-2", "geo-rhombus", "geo-star", "geo-trapezoid", "geo-triangle", "geo-x-box", "github", "group", "heading", "help-circle", "highlight", "horizontal-align-end", "horizontal-align-middle", "horizontal-align-start", "info-circle", "italic", "leading", "link", "list", "lock", "manual", "menu", "minus", "mixed", "pack", "plus", "question-mark-circle", "question-mark", "redo", "reset-zoom", "rotate-ccw", "rotate-cw", "send-backward", "send-to-back", "share-1", "size-extra-large", "size-large", "size-medium", "size-small", "spline-cubic", "spline-line", "stack-horizontal", "stack-vertical", "status-offline", "stretch-horizontal", "stretch-vertical", "strike", "text-align-center", "text-align-left", "text-align-right", "toggle-off", "toggle-on", "tool-arrow", "tool-eraser", "tool-frame", "tool-hand", "tool-highlight", "tool-laser", "tool-line", "tool-media", "tool-note", "tool-pencil", "tool-pointer", "tool-screenshot", "tool-text", "trash", "twitter", "underline", "undo", "ungroup", "unlock", "vertical-align-end", "vertical-align-middle", "vertical-align-start", "warning-triangle", "zoom-in", "zoom-out"];
|
|
2046
2235
|
|
|
2236
|
+
/** @public */
|
|
2237
|
+
export declare class ImageAssetUtil extends AssetUtil<TLImageAsset> {
|
|
2238
|
+
static type: "image";
|
|
2239
|
+
static props: {
|
|
2240
|
+
fileSize: Validator<number | undefined>;
|
|
2241
|
+
h: Validator<number>;
|
|
2242
|
+
isAnimated: Validator<boolean>;
|
|
2243
|
+
mimeType: Validator<null | string>;
|
|
2244
|
+
name: Validator<string>;
|
|
2245
|
+
pixelRatio: Validator<number | undefined>;
|
|
2246
|
+
src: Validator<null | string>;
|
|
2247
|
+
w: Validator<number>;
|
|
2248
|
+
};
|
|
2249
|
+
static migrations: MigrationSequence;
|
|
2250
|
+
options: {
|
|
2251
|
+
maxDimension: number;
|
|
2252
|
+
supportedMimeTypes: null | readonly string[];
|
|
2253
|
+
};
|
|
2254
|
+
getDefaultProps(): TLImageAsset['props'];
|
|
2255
|
+
getSupportedMimeTypes(): readonly string[];
|
|
2256
|
+
getAssetFromFile(file: File, assetId: TLAssetId): Promise<null | TLImageAsset>;
|
|
2257
|
+
}
|
|
2258
|
+
|
|
2259
|
+
/** @public */
|
|
2260
|
+
export declare interface ImageShapeOptions extends ShapeOptionsWithDisplayValues<TLImageShape, ImageShapeUtilDisplayValues> {
|
|
2261
|
+
}
|
|
2262
|
+
|
|
2047
2263
|
/** @public */
|
|
2048
2264
|
export declare class ImageShapeUtil extends BaseBoxShapeUtil<TLImageShape> {
|
|
2049
2265
|
static type: "image";
|
|
2050
2266
|
static props: RecordProps<TLImageShape>;
|
|
2051
2267
|
static migrations: TLPropsMigrations;
|
|
2052
|
-
|
|
2053
|
-
|
|
2268
|
+
static handledAssetTypes: readonly ["image"];
|
|
2269
|
+
options: ImageShapeOptions;
|
|
2270
|
+
isAspectRatioLocked(shape: TLImageShape): boolean;
|
|
2271
|
+
canCrop(shape: TLImageShape): boolean;
|
|
2054
2272
|
isExportBoundsContainer(): boolean;
|
|
2055
2273
|
getDefaultProps(): TLImageShape['props'];
|
|
2274
|
+
createShapeForAsset(asset: TLAsset, position: VecModel): null | TLShapePartial;
|
|
2056
2275
|
getGeometry(shape: TLImageShape): Geometry2d;
|
|
2057
2276
|
getAriaDescriptor(shape: TLImageShape): string;
|
|
2058
2277
|
onResize(shape: TLImageShape, info: TLResizeInfo<TLImageShape>): TLImageShape;
|
|
@@ -2065,15 +2284,16 @@ export declare class ImageShapeUtil extends BaseBoxShapeUtil<TLImageShape> {
|
|
|
2065
2284
|
getInterpolatedProps(startShape: TLImageShape, endShape: TLImageShape, t: number): TLImageShapeProps;
|
|
2066
2285
|
}
|
|
2067
2286
|
|
|
2287
|
+
/** @public */
|
|
2288
|
+
export declare interface ImageShapeUtilDisplayValues {
|
|
2289
|
+
}
|
|
2290
|
+
|
|
2068
2291
|
/** @public */
|
|
2069
2292
|
export declare const KeyboardShiftEnterTweakExtension: Extension<any, any>;
|
|
2070
2293
|
|
|
2071
2294
|
/** @public @react */
|
|
2072
2295
|
export declare function KeyboardShortcutsMenuItem(): JSX.Element | null;
|
|
2073
2296
|
|
|
2074
|
-
/** @public */
|
|
2075
|
-
export declare const LABEL_FONT_SIZES: Record<TLDefaultSizeStyle, number>;
|
|
2076
|
-
|
|
2077
2297
|
/** @public @react */
|
|
2078
2298
|
export declare function LanguageMenu(): JSX.Element | null;
|
|
2079
2299
|
|
|
@@ -2096,6 +2316,10 @@ export declare class LaserTool extends StateNode {
|
|
|
2096
2316
|
/** @public @react */
|
|
2097
2317
|
export declare function LaserToolbarItem(): JSX.Element;
|
|
2098
2318
|
|
|
2319
|
+
/** @public */
|
|
2320
|
+
export declare interface LineShapeOptions extends ShapeOptionsWithDisplayValues<TLLineShape, LineShapeUtilDisplayValues> {
|
|
2321
|
+
}
|
|
2322
|
+
|
|
2099
2323
|
/** @public */
|
|
2100
2324
|
export declare class LineShapeTool extends StateNode {
|
|
2101
2325
|
static id: string;
|
|
@@ -2109,10 +2333,11 @@ export declare class LineShapeUtil extends ShapeUtil<TLLineShape> {
|
|
|
2109
2333
|
static type: "line";
|
|
2110
2334
|
static props: RecordProps<TLLineShape>;
|
|
2111
2335
|
static migrations: TLPropsMigrations;
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2336
|
+
options: LineShapeOptions;
|
|
2337
|
+
hideResizeHandles(shape: TLLineShape): boolean;
|
|
2338
|
+
hideRotateHandle(shape: TLLineShape): boolean;
|
|
2339
|
+
hideSelectionBoundsFg(shape: TLLineShape): boolean;
|
|
2340
|
+
hideSelectionBoundsBg(shape: TLLineShape): boolean;
|
|
2116
2341
|
hideInMinimap(): boolean;
|
|
2117
2342
|
getDefaultProps(): TLLineShape['props'];
|
|
2118
2343
|
getGeometry(shape: TLLineShape): PathBuilderGeometry2d;
|
|
@@ -2138,8 +2363,8 @@ export declare class LineShapeUtil extends ShapeUtil<TLLineShape> {
|
|
|
2138
2363
|
opacity: number;
|
|
2139
2364
|
parentId: TLParentId;
|
|
2140
2365
|
props: {
|
|
2141
|
-
color:
|
|
2142
|
-
dash: "dashed" | "dotted" | "draw" | "solid";
|
|
2366
|
+
color: TLDefaultColorStyle;
|
|
2367
|
+
dash: "dashed" | "dotted" | "draw" | "none" | "solid";
|
|
2143
2368
|
points: {
|
|
2144
2369
|
[x: string]: {
|
|
2145
2370
|
id: string;
|
|
@@ -2166,8 +2391,8 @@ export declare class LineShapeUtil extends ShapeUtil<TLLineShape> {
|
|
|
2166
2391
|
opacity: number;
|
|
2167
2392
|
parentId: TLParentId;
|
|
2168
2393
|
props: {
|
|
2169
|
-
color:
|
|
2170
|
-
dash: "dashed" | "dotted" | "draw" | "solid";
|
|
2394
|
+
color: TLDefaultColorStyle;
|
|
2395
|
+
dash: "dashed" | "dotted" | "draw" | "none" | "solid";
|
|
2171
2396
|
points: {
|
|
2172
2397
|
[x: string]: {
|
|
2173
2398
|
id: IndexKey;
|
|
@@ -2187,14 +2412,20 @@ export declare class LineShapeUtil extends ShapeUtil<TLLineShape> {
|
|
|
2187
2412
|
y: number;
|
|
2188
2413
|
} | undefined;
|
|
2189
2414
|
component(shape: TLLineShape): JSX.Element;
|
|
2190
|
-
indicator(shape: TLLineShape): JSX.Element;
|
|
2415
|
+
indicator(shape: TLLineShape): JSX.Element | null;
|
|
2191
2416
|
useLegacyIndicator(): boolean;
|
|
2192
2417
|
getIndicatorPath(shape: TLLineShape): Path2D;
|
|
2193
|
-
toSvg(shape: TLLineShape): JSX.Element;
|
|
2418
|
+
toSvg(shape: TLLineShape, ctx: SvgExportContext): JSX.Element;
|
|
2194
2419
|
getHandleSnapGeometry(shape: TLLineShape): HandleSnapGeometry;
|
|
2195
2420
|
getInterpolatedProps(startShape: TLLineShape, endShape: TLLineShape, t: number): TLLineShape['props'];
|
|
2196
2421
|
}
|
|
2197
2422
|
|
|
2423
|
+
/** @public */
|
|
2424
|
+
export declare interface LineShapeUtilDisplayValues {
|
|
2425
|
+
strokeColor: string;
|
|
2426
|
+
strokeWidth: number;
|
|
2427
|
+
}
|
|
2428
|
+
|
|
2198
2429
|
/** @public @react */
|
|
2199
2430
|
export declare function LineToolbarItem(): JSX.Element;
|
|
2200
2431
|
|
|
@@ -2215,7 +2446,12 @@ export declare function MoveToPageMenu(): JSX.Element | null;
|
|
|
2215
2446
|
/* Excluded from this release type: MoveToPathBuilderCommand */
|
|
2216
2447
|
|
|
2217
2448
|
/** @public */
|
|
2218
|
-
export declare interface
|
|
2449
|
+
export declare interface NonePathBuilderOpts extends BasePathBuilderOpts {
|
|
2450
|
+
style: 'none';
|
|
2451
|
+
}
|
|
2452
|
+
|
|
2453
|
+
/** @public */
|
|
2454
|
+
export declare interface NoteShapeOptions extends ShapeOptionsWithDisplayValues<TLNoteShape, NoteShapeUtilDisplayValues> {
|
|
2219
2455
|
/**
|
|
2220
2456
|
* How should the note shape resize? By default it does not resize (except automatically based on its text content),
|
|
2221
2457
|
* but you can set it to be user-resizable using scale.
|
|
@@ -2237,10 +2473,10 @@ export declare class NoteShapeUtil extends ShapeUtil<TLNoteShape> {
|
|
|
2237
2473
|
static props: RecordProps<TLNoteShape>;
|
|
2238
2474
|
static migrations: TLPropsMigrations;
|
|
2239
2475
|
options: NoteShapeOptions;
|
|
2240
|
-
canEdit(): boolean;
|
|
2241
|
-
hideResizeHandles(): boolean;
|
|
2242
|
-
isAspectRatioLocked(): boolean;
|
|
2243
|
-
hideSelectionBoundsFg(): boolean;
|
|
2476
|
+
canEdit(shape: TLNoteShape): boolean;
|
|
2477
|
+
hideResizeHandles(shape: TLNoteShape): boolean;
|
|
2478
|
+
isAspectRatioLocked(shape: TLNoteShape): boolean;
|
|
2479
|
+
hideSelectionBoundsFg(shape: TLNoteShape): boolean;
|
|
2244
2480
|
getDefaultProps(): TLNoteShape['props'];
|
|
2245
2481
|
getGeometry(shape: TLNoteShape): Group2d;
|
|
2246
2482
|
getHandles(shape: TLNoteShape): TLHandle[];
|
|
@@ -2268,11 +2504,11 @@ export declare class NoteShapeUtil extends ShapeUtil<TLNoteShape> {
|
|
|
2268
2504
|
parentId: TLParentId;
|
|
2269
2505
|
props: {
|
|
2270
2506
|
align: "end-legacy" | "end" | "middle-legacy" | "middle" | "start-legacy" | "start";
|
|
2271
|
-
color:
|
|
2272
|
-
font:
|
|
2507
|
+
color: TLDefaultColorStyle;
|
|
2508
|
+
font: TLDefaultFontStyle;
|
|
2273
2509
|
fontSizeAdjustment: number;
|
|
2274
2510
|
growY: number;
|
|
2275
|
-
labelColor:
|
|
2511
|
+
labelColor: TLDefaultColorStyle;
|
|
2276
2512
|
richText: {
|
|
2277
2513
|
attrs?: any;
|
|
2278
2514
|
content: unknown[];
|
|
@@ -2292,6 +2528,38 @@ export declare class NoteShapeUtil extends ShapeUtil<TLNoteShape> {
|
|
|
2292
2528
|
} | undefined;
|
|
2293
2529
|
onBeforeUpdate(prev: TLNoteShape, next: TLNoteShape): TLNoteShape | undefined;
|
|
2294
2530
|
getInterpolatedProps(startShape: TLNoteShape, endShape: TLNoteShape, t: number): TLNoteShapeProps;
|
|
2531
|
+
/**
|
|
2532
|
+
* Get the growY and fontSizeAdjustment for a shape.
|
|
2533
|
+
*/
|
|
2534
|
+
private getNoteSizeAdjustments;
|
|
2535
|
+
private _labelSizesForNoteCache;
|
|
2536
|
+
/**
|
|
2537
|
+
* Get the cached label size for the shape.
|
|
2538
|
+
*/
|
|
2539
|
+
private getLabelSize;
|
|
2540
|
+
/**
|
|
2541
|
+
* Expensively measure the label size for a note shape.
|
|
2542
|
+
*/
|
|
2543
|
+
private measureNoteLabelSize;
|
|
2544
|
+
}
|
|
2545
|
+
|
|
2546
|
+
/** @public */
|
|
2547
|
+
export declare interface NoteShapeUtilDisplayValues {
|
|
2548
|
+
noteWidth: number;
|
|
2549
|
+
noteHeight: number;
|
|
2550
|
+
noteBackgroundColor: string;
|
|
2551
|
+
borderColor: string;
|
|
2552
|
+
borderWidth: number;
|
|
2553
|
+
labelColor: string;
|
|
2554
|
+
labelFontFamily: string;
|
|
2555
|
+
labelFontSize: number;
|
|
2556
|
+
labelLineHeight: number;
|
|
2557
|
+
labelFontWeight: string;
|
|
2558
|
+
labelFontVariant: string;
|
|
2559
|
+
labelFontStyle: string;
|
|
2560
|
+
labelPadding: number;
|
|
2561
|
+
labelHorizontalAlign: 'center' | 'end' | 'start';
|
|
2562
|
+
labelVerticalAlign: 'end' | 'middle' | 'start';
|
|
2295
2563
|
}
|
|
2296
2564
|
|
|
2297
2565
|
/** @public @react */
|
|
@@ -2300,12 +2568,13 @@ export declare function NoteToolbarItem(): JSX.Element;
|
|
|
2300
2568
|
/**
|
|
2301
2569
|
* Checks if a file is allowed to be uploaded. If it is not, it will show a toast explaining why to the user.
|
|
2302
2570
|
*
|
|
2571
|
+
* @param editor - The editor instance
|
|
2303
2572
|
* @param file - The file to check
|
|
2304
2573
|
* @param options - The options for the external content handler
|
|
2305
2574
|
* @returns True if the file is allowed, false otherwise
|
|
2306
2575
|
* @public
|
|
2307
2576
|
*/
|
|
2308
|
-
export declare function notifyIfFileNotAllowed(file: File, options: TLDefaultExternalContentHandlerOpts): boolean;
|
|
2577
|
+
export declare function notifyIfFileNotAllowed(editor: Editor, file: File, options: TLDefaultExternalContentHandlerOpts): boolean;
|
|
2309
2578
|
|
|
2310
2579
|
/** @public @react */
|
|
2311
2580
|
export declare function OfflineIndicator(): JSX.Element;
|
|
@@ -2407,7 +2676,7 @@ export declare class PathBuilder {
|
|
|
2407
2676
|
private cubicBezierToWithResolution;
|
|
2408
2677
|
close(): this;
|
|
2409
2678
|
toD(opts?: PathBuilderToDOpts): string;
|
|
2410
|
-
toSvg(opts: PathBuilderOpts): JSX.Element;
|
|
2679
|
+
toSvg(opts: PathBuilderOpts): JSX.Element | null;
|
|
2411
2680
|
toPath2D(opts: PathBuilderOpts): Path2D;
|
|
2412
2681
|
toGeometry(): Group2d | PathBuilderGeometry2d;
|
|
2413
2682
|
private toSolidSvg;
|
|
@@ -2467,7 +2736,7 @@ export declare interface PathBuilderLineOpts extends PathBuilderCommandOpts {
|
|
|
2467
2736
|
}
|
|
2468
2737
|
|
|
2469
2738
|
/** @public */
|
|
2470
|
-
export declare type PathBuilderOpts = DashedPathBuilderOpts | DrawPathBuilderOpts | SolidPathBuilderOpts;
|
|
2739
|
+
export declare type PathBuilderOpts = DashedPathBuilderOpts | DrawPathBuilderOpts | NonePathBuilderOpts | SolidPathBuilderOpts;
|
|
2471
2740
|
|
|
2472
2741
|
/** @public */
|
|
2473
2742
|
export declare interface PathBuilderToDOpts {
|
|
@@ -2476,14 +2745,6 @@ export declare interface PathBuilderToDOpts {
|
|
|
2476
2745
|
onlyFilled?: boolean;
|
|
2477
2746
|
}
|
|
2478
2747
|
|
|
2479
|
-
/** @public @react */
|
|
2480
|
-
export declare function PeopleMenu({ children }: PeopleMenuProps): JSX.Element | null;
|
|
2481
|
-
|
|
2482
|
-
/** @public */
|
|
2483
|
-
export declare interface PeopleMenuProps {
|
|
2484
|
-
children?: ReactNode;
|
|
2485
|
-
}
|
|
2486
|
-
|
|
2487
2748
|
/**
|
|
2488
2749
|
* A plain text area that can be used for basic editing text.
|
|
2489
2750
|
*
|
|
@@ -2506,12 +2767,11 @@ export declare interface PlainTextLabelProps {
|
|
|
2506
2767
|
type: ExtractShapeByProps<{
|
|
2507
2768
|
text: string;
|
|
2508
2769
|
}>['type'];
|
|
2509
|
-
|
|
2770
|
+
fontFamily: string;
|
|
2510
2771
|
fontSize: number;
|
|
2511
2772
|
lineHeight: number;
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
verticalAlign: TLDefaultVerticalAlignStyle;
|
|
2773
|
+
textAlign: 'center' | 'end' | 'start';
|
|
2774
|
+
verticalAlign: 'end' | 'middle' | 'start';
|
|
2515
2775
|
wrap?: boolean;
|
|
2516
2776
|
text?: string;
|
|
2517
2777
|
labelColor: string;
|
|
@@ -2663,12 +2923,11 @@ export declare interface RichTextLabelProps {
|
|
|
2663
2923
|
type: ExtractShapeByProps<{
|
|
2664
2924
|
richText: TLRichText;
|
|
2665
2925
|
}>['type'];
|
|
2666
|
-
|
|
2926
|
+
fontFamily: string;
|
|
2667
2927
|
fontSize: number;
|
|
2668
2928
|
lineHeight: number;
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
verticalAlign: TLDefaultVerticalAlignStyle;
|
|
2929
|
+
textAlign: 'center' | 'end' | 'start';
|
|
2930
|
+
verticalAlign: 'end' | 'middle' | 'start';
|
|
2672
2931
|
wrap?: boolean;
|
|
2673
2932
|
richText?: TLRichText;
|
|
2674
2933
|
labelColor: string;
|
|
@@ -2689,16 +2948,17 @@ export declare interface RichTextLabelProps {
|
|
|
2689
2948
|
*
|
|
2690
2949
|
* @public @react
|
|
2691
2950
|
*/
|
|
2692
|
-
export declare function RichTextSVG({ bounds, richText, fontSize,
|
|
2951
|
+
export declare function RichTextSVG({ bounds, richText, fontSize, fontFamily, lineHeight, textAlign, verticalAlign, wrap, labelColor, padding, showTextOutline }: RichTextSVGProps): JSX.Element;
|
|
2693
2952
|
|
|
2694
2953
|
/** @public */
|
|
2695
2954
|
export declare interface RichTextSVGProps {
|
|
2696
2955
|
bounds: Box;
|
|
2697
2956
|
richText: TLRichText;
|
|
2698
2957
|
fontSize: number;
|
|
2699
|
-
|
|
2700
|
-
|
|
2701
|
-
|
|
2958
|
+
fontFamily: string;
|
|
2959
|
+
lineHeight: number;
|
|
2960
|
+
textAlign: 'center' | 'end' | 'start';
|
|
2961
|
+
verticalAlign: 'end' | 'middle' | 'start';
|
|
2702
2962
|
wrap?: boolean;
|
|
2703
2963
|
labelColor: string;
|
|
2704
2964
|
padding: number;
|
|
@@ -2755,6 +3015,12 @@ export declare function serializeTldrawJsonBlob(editor: Editor): Promise<Blob>;
|
|
|
2755
3015
|
/** @public */
|
|
2756
3016
|
export declare function setStrokePointRadii(strokePoints: StrokePoint[], options: StrokeOptions): StrokePoint[];
|
|
2757
3017
|
|
|
3018
|
+
/** @public */
|
|
3019
|
+
export declare interface ShapeOptionsWithDisplayValues<Shape extends TLShape, DisplayValues extends object> {
|
|
3020
|
+
getDefaultDisplayValues(editor: Editor, shape: Shape, theme: TLTheme, colorMode: 'dark' | 'light'): DisplayValues;
|
|
3021
|
+
getCustomDisplayValues(editor: Editor, shape: Shape, theme: TLTheme, colorMode: 'dark' | 'light'): Partial<DisplayValues>;
|
|
3022
|
+
}
|
|
3023
|
+
|
|
2758
3024
|
/** @public */
|
|
2759
3025
|
export declare interface SolidPathBuilderOpts extends BasePathBuilderOpts {
|
|
2760
3026
|
style: 'solid';
|
|
@@ -2783,9 +3049,6 @@ export declare function startEditingShapeWithRichText(editor: Editor, shapeOrId:
|
|
|
2783
3049
|
/** @public @react */
|
|
2784
3050
|
export declare function StarToolbarItem(): JSX.Element;
|
|
2785
3051
|
|
|
2786
|
-
/** @public */
|
|
2787
|
-
export declare const STROKE_SIZES: Record<TLDefaultSizeStyle, number>;
|
|
2788
|
-
|
|
2789
3052
|
/**
|
|
2790
3053
|
* The options object for `getStroke` or `getStrokePoints`.
|
|
2791
3054
|
*
|
|
@@ -2866,6 +3129,7 @@ export declare interface StylePanelContext {
|
|
|
2866
3129
|
enhancedA11yMode: boolean;
|
|
2867
3130
|
onHistoryMark(id: string): void;
|
|
2868
3131
|
onValueChange<T>(style: StyleProp<T>, value: T): void;
|
|
3132
|
+
onOpacityChange(opacity: number): void;
|
|
2869
3133
|
}
|
|
2870
3134
|
|
|
2871
3135
|
/** @public @react */
|
|
@@ -2969,15 +3233,6 @@ export declare type StyleValuesForUi<T> = readonly {
|
|
|
2969
3233
|
readonly value: T;
|
|
2970
3234
|
}[];
|
|
2971
3235
|
|
|
2972
|
-
/** @public */
|
|
2973
|
-
export declare const TEXT_PROPS: {
|
|
2974
|
-
fontStyle: string;
|
|
2975
|
-
fontVariant: string;
|
|
2976
|
-
fontWeight: string;
|
|
2977
|
-
lineHeight: number;
|
|
2978
|
-
padding: string;
|
|
2979
|
-
};
|
|
2980
|
-
|
|
2981
3236
|
/** @public */
|
|
2982
3237
|
export declare interface TextAreaProps {
|
|
2983
3238
|
isEditing: boolean;
|
|
@@ -2998,7 +3253,7 @@ export declare interface TextAreaProps {
|
|
|
2998
3253
|
}
|
|
2999
3254
|
|
|
3000
3255
|
/** @public */
|
|
3001
|
-
export declare interface TextShapeOptions {
|
|
3256
|
+
export declare interface TextShapeOptions extends ShapeOptionsWithDisplayValues<TLTextShape, TextShapeUtilDisplayValues> {
|
|
3002
3257
|
/** How much addition padding should be added to the horizontal geometry of the shape when binding to an arrow? */
|
|
3003
3258
|
extraArrowHorizontalPadding: number;
|
|
3004
3259
|
/** Whether to show the outline of the text shape (using the same color as the canvas). This helps with overlapping shapes. It does not show up on Safari, where text outline is a performance issues. */
|
|
@@ -3027,8 +3282,8 @@ export declare class TextShapeUtil extends ShapeUtil<TLTextShape> {
|
|
|
3027
3282
|
getGeometry(shape: TLTextShape, opts: TLGeometryOpts): Rectangle2d;
|
|
3028
3283
|
getFontFaces(shape: TLTextShape): TLFontFace[];
|
|
3029
3284
|
getText(shape: TLTextShape): string;
|
|
3030
|
-
canEdit(): boolean;
|
|
3031
|
-
isAspectRatioLocked(): boolean;
|
|
3285
|
+
canEdit(shape: TLTextShape): boolean;
|
|
3286
|
+
isAspectRatioLocked(shape: TLTextShape): boolean;
|
|
3032
3287
|
component(shape: TLTextShape): JSX.Element;
|
|
3033
3288
|
indicator(shape: TLTextShape): JSX.Element | null;
|
|
3034
3289
|
useLegacyIndicator(): boolean;
|
|
@@ -3062,8 +3317,8 @@ export declare class TextShapeUtil extends ShapeUtil<TLTextShape> {
|
|
|
3062
3317
|
parentId: TLParentId;
|
|
3063
3318
|
props: {
|
|
3064
3319
|
autoSize: boolean;
|
|
3065
|
-
color:
|
|
3066
|
-
font:
|
|
3320
|
+
color: TLDefaultColorStyle;
|
|
3321
|
+
font: TLDefaultFontStyle;
|
|
3067
3322
|
richText: {
|
|
3068
3323
|
attrs?: any;
|
|
3069
3324
|
content: unknown[];
|
|
@@ -3082,6 +3337,17 @@ export declare class TextShapeUtil extends ShapeUtil<TLTextShape> {
|
|
|
3082
3337
|
} | undefined;
|
|
3083
3338
|
}
|
|
3084
3339
|
|
|
3340
|
+
/** @public */
|
|
3341
|
+
export declare interface TextShapeUtilDisplayValues {
|
|
3342
|
+
color: string;
|
|
3343
|
+
fontFamily: string;
|
|
3344
|
+
fontSize: number;
|
|
3345
|
+
lineHeight: number;
|
|
3346
|
+
fontWeight: string;
|
|
3347
|
+
fontStyle: string;
|
|
3348
|
+
fontVariant: string;
|
|
3349
|
+
}
|
|
3350
|
+
|
|
3085
3351
|
/** @public @react */
|
|
3086
3352
|
export declare function TextToolbarItem(): JSX.Element;
|
|
3087
3353
|
|
|
@@ -3165,12 +3431,12 @@ export declare interface TLDefaultExternalContentHandlerOpts extends TLExternalC
|
|
|
3165
3431
|
/** @public */
|
|
3166
3432
|
export declare interface TLDefaultFont {
|
|
3167
3433
|
normal: {
|
|
3168
|
-
bold:
|
|
3169
|
-
normal:
|
|
3434
|
+
bold: TLFontFace_2;
|
|
3435
|
+
normal: TLFontFace_2;
|
|
3170
3436
|
};
|
|
3171
3437
|
italic: {
|
|
3172
|
-
bold:
|
|
3173
|
-
normal:
|
|
3438
|
+
bold: TLFontFace_2;
|
|
3439
|
+
normal: TLFontFace_2;
|
|
3174
3440
|
};
|
|
3175
3441
|
}
|
|
3176
3442
|
|
|
@@ -3681,13 +3947,17 @@ export declare interface TLExternalContentProps {
|
|
|
3681
3947
|
*/
|
|
3682
3948
|
maxAssetSize?: number;
|
|
3683
3949
|
/**
|
|
3684
|
-
* The mime types of images that are allowed to be handled.
|
|
3685
|
-
* DEFAULT_SUPPORTED_IMAGE_TYPES
|
|
3950
|
+
* The mime types of images that are allowed to be handled. When using the
|
|
3951
|
+
* `Tldraw` component, defaults to `DEFAULT_SUPPORTED_IMAGE_TYPES`. If neither
|
|
3952
|
+
* this nor `acceptedVideoMimeTypes` is provided, the registered asset utils
|
|
3953
|
+
* determine which MIME types are allowed.
|
|
3686
3954
|
*/
|
|
3687
3955
|
acceptedImageMimeTypes?: readonly string[];
|
|
3688
3956
|
/**
|
|
3689
|
-
* The mime types of videos that are allowed to be handled.
|
|
3690
|
-
* DEFAULT_SUPPORT_VIDEO_TYPES
|
|
3957
|
+
* The mime types of videos that are allowed to be handled. When using the
|
|
3958
|
+
* `Tldraw` component, defaults to `DEFAULT_SUPPORT_VIDEO_TYPES`. If neither
|
|
3959
|
+
* this nor `acceptedImageMimeTypes` is provided, the registered asset utils
|
|
3960
|
+
* determine which MIME types are allowed.
|
|
3691
3961
|
*/
|
|
3692
3962
|
acceptedVideoMimeTypes?: readonly string[];
|
|
3693
3963
|
}
|
|
@@ -3814,6 +4084,11 @@ export declare interface TLUiComponents {
|
|
|
3814
4084
|
Toasts?: ComponentType | null;
|
|
3815
4085
|
A11y?: ComponentType | null;
|
|
3816
4086
|
FollowingIndicator?: ComponentType | null;
|
|
4087
|
+
PeopleMenu?: ComponentType | null;
|
|
4088
|
+
PeopleMenuAvatar?: ComponentType<TLUiPeopleMenuAvatarProps> | null;
|
|
4089
|
+
PeopleMenuItem?: ComponentType<TLUiPeopleMenuItemProps> | null;
|
|
4090
|
+
PeopleMenuFacePile?: ComponentType<TLUiPeopleMenuFacePileProps> | null;
|
|
4091
|
+
UserPresenceEditor?: ComponentType | null;
|
|
3817
4092
|
}
|
|
3818
4093
|
|
|
3819
4094
|
/** @public */
|
|
@@ -4386,6 +4661,23 @@ export declare interface TLUiOverrides {
|
|
|
4386
4661
|
translations?: TLUiTranslationProviderProps['overrides'];
|
|
4387
4662
|
}
|
|
4388
4663
|
|
|
4664
|
+
/** @public */
|
|
4665
|
+
export declare interface TLUiPeopleMenuAvatarProps {
|
|
4666
|
+
userId: string;
|
|
4667
|
+
}
|
|
4668
|
+
|
|
4669
|
+
/** @public */
|
|
4670
|
+
export declare interface TLUiPeopleMenuFacePileProps {
|
|
4671
|
+
userIds: string[];
|
|
4672
|
+
userName: string;
|
|
4673
|
+
userColor: string;
|
|
4674
|
+
}
|
|
4675
|
+
|
|
4676
|
+
/** @public */
|
|
4677
|
+
export declare interface TLUiPeopleMenuItemProps {
|
|
4678
|
+
userId: string;
|
|
4679
|
+
}
|
|
4680
|
+
|
|
4389
4681
|
/** @public */
|
|
4390
4682
|
export declare interface TLUiPopoverContentProps {
|
|
4391
4683
|
children: React_3.ReactNode;
|
|
@@ -4850,27 +5142,6 @@ export declare function useCopyAs(): (ids: TLShapeId[], format?: TLCopyType) =>
|
|
|
4850
5142
|
/** @public */
|
|
4851
5143
|
export declare function useCurrentTranslation(): TLUiTranslation;
|
|
4852
5144
|
|
|
4853
|
-
/** @public */
|
|
4854
|
-
export declare function useDefaultColorTheme(): {
|
|
4855
|
-
"light-blue": TLDefaultColorThemeColor;
|
|
4856
|
-
"light-green": TLDefaultColorThemeColor;
|
|
4857
|
-
"light-red": TLDefaultColorThemeColor;
|
|
4858
|
-
"light-violet": TLDefaultColorThemeColor;
|
|
4859
|
-
background: string;
|
|
4860
|
-
black: TLDefaultColorThemeColor;
|
|
4861
|
-
blue: TLDefaultColorThemeColor;
|
|
4862
|
-
green: TLDefaultColorThemeColor;
|
|
4863
|
-
grey: TLDefaultColorThemeColor;
|
|
4864
|
-
id: "dark" | "light";
|
|
4865
|
-
orange: TLDefaultColorThemeColor;
|
|
4866
|
-
red: TLDefaultColorThemeColor;
|
|
4867
|
-
solid: string;
|
|
4868
|
-
text: string;
|
|
4869
|
-
violet: TLDefaultColorThemeColor;
|
|
4870
|
-
white: TLDefaultColorThemeColor;
|
|
4871
|
-
yellow: TLDefaultColorThemeColor;
|
|
4872
|
-
};
|
|
4873
|
-
|
|
4874
5145
|
/** @public */
|
|
4875
5146
|
export declare function useDefaultHelpers(): {
|
|
4876
5147
|
addDialog: (dialog: Omit<TLUiDialog, "id"> & {
|
|
@@ -5075,7 +5346,28 @@ export declare function useUiEvents(): TLUiEventContextType;
|
|
|
5075
5346
|
export declare function useUnlockedSelectedShapesCount(min?: number, max?: number): boolean | number;
|
|
5076
5347
|
|
|
5077
5348
|
/** @public */
|
|
5078
|
-
export declare
|
|
5349
|
+
export declare class VideoAssetUtil extends AssetUtil<TLVideoAsset> {
|
|
5350
|
+
static type: "video";
|
|
5351
|
+
static props: {
|
|
5352
|
+
fileSize: Validator<number | undefined>;
|
|
5353
|
+
h: Validator<number>;
|
|
5354
|
+
isAnimated: Validator<boolean>;
|
|
5355
|
+
mimeType: Validator<null | string>;
|
|
5356
|
+
name: Validator<string>;
|
|
5357
|
+
src: Validator<null | string>;
|
|
5358
|
+
w: Validator<number>;
|
|
5359
|
+
};
|
|
5360
|
+
static migrations: MigrationSequence;
|
|
5361
|
+
options: {
|
|
5362
|
+
supportedMimeTypes: null | readonly string[];
|
|
5363
|
+
};
|
|
5364
|
+
getDefaultProps(): TLVideoAsset['props'];
|
|
5365
|
+
getSupportedMimeTypes(): readonly string[];
|
|
5366
|
+
getAssetFromFile(file: File, assetId: TLAssetId): Promise<null | TLVideoAsset>;
|
|
5367
|
+
}
|
|
5368
|
+
|
|
5369
|
+
/** @public */
|
|
5370
|
+
export declare interface VideoShapeOptions extends ShapeOptionsWithDisplayValues<TLVideoShape, VideoShapeUtilDisplayValues> {
|
|
5079
5371
|
/**
|
|
5080
5372
|
* Should videos play automatically?
|
|
5081
5373
|
*/
|
|
@@ -5087,10 +5379,12 @@ export declare class VideoShapeUtil extends BaseBoxShapeUtil<TLVideoShape> {
|
|
|
5087
5379
|
static type: "video";
|
|
5088
5380
|
static props: RecordProps<TLVideoShape>;
|
|
5089
5381
|
static migrations: TLPropsMigrations;
|
|
5382
|
+
static handledAssetTypes: readonly ["video"];
|
|
5090
5383
|
options: VideoShapeOptions;
|
|
5091
|
-
canEdit(): boolean;
|
|
5092
|
-
isAspectRatioLocked(): boolean;
|
|
5384
|
+
canEdit(shape: TLVideoShape): boolean;
|
|
5385
|
+
isAspectRatioLocked(shape: TLVideoShape): boolean;
|
|
5093
5386
|
getDefaultProps(): TLVideoShape['props'];
|
|
5387
|
+
createShapeForAsset(asset: TLAsset, position: VecModel): null | TLShapePartial;
|
|
5094
5388
|
getAriaDescriptor(shape: TLVideoShape): string;
|
|
5095
5389
|
component(shape: TLVideoShape): JSX.Element;
|
|
5096
5390
|
indicator(shape: TLVideoShape): JSX.Element;
|
|
@@ -5099,6 +5393,10 @@ export declare class VideoShapeUtil extends BaseBoxShapeUtil<TLVideoShape> {
|
|
|
5099
5393
|
toSvg(shape: TLVideoShape, ctx: SvgExportContext): Promise<JSX.Element | null>;
|
|
5100
5394
|
}
|
|
5101
5395
|
|
|
5396
|
+
/** @public */
|
|
5397
|
+
export declare interface VideoShapeUtilDisplayValues {
|
|
5398
|
+
}
|
|
5399
|
+
|
|
5102
5400
|
/** @public @react */
|
|
5103
5401
|
export declare function ViewSubmenu(): JSX.Element;
|
|
5104
5402
|
|