tldraw 5.4.2 → 5.5.0-canary.0241f11f2e99
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/DOCS.md +101 -38
- package/RELEASE_NOTES.md +12 -16
- package/dist-cjs/index.js +1 -1
- package/dist-cjs/lib/shapes/draw/toolStates/Drawing.js +7 -2
- package/dist-cjs/lib/shapes/draw/toolStates/Drawing.js.map +2 -2
- package/dist-cjs/lib/shapes/image/ImageShapeUtil.js +25 -9
- package/dist-cjs/lib/shapes/image/ImageShapeUtil.js.map +3 -3
- package/dist-cjs/lib/shapes/line/LineShapeUtil.js +15 -5
- package/dist-cjs/lib/shapes/line/LineShapeUtil.js.map +2 -2
- package/dist-cjs/lib/shapes/note/NoteShapeUtil.js +1 -2
- package/dist-cjs/lib/shapes/note/NoteShapeUtil.js.map +2 -2
- package/dist-cjs/lib/shapes/note/noteHelpers.js +7 -2
- package/dist-cjs/lib/shapes/note/noteHelpers.js.map +2 -2
- package/dist-cjs/lib/shapes/note/toolStates/Pointing.js +4 -4
- package/dist-cjs/lib/shapes/note/toolStates/Pointing.js.map +2 -2
- package/dist-cjs/lib/shapes/shared/crop.js +13 -24
- package/dist-cjs/lib/shapes/shared/crop.js.map +2 -2
- package/dist-cjs/lib/shapes/shared/useImageOrVideoAsset.js +16 -3
- package/dist-cjs/lib/shapes/shared/useImageOrVideoAsset.js.map +2 -2
- package/dist-cjs/lib/shapes/video/VideoShapeUtil.js +6 -1
- package/dist-cjs/lib/shapes/video/VideoShapeUtil.js.map +2 -2
- package/dist-cjs/lib/tools/SelectTool/GestureShapeChangeTracker.js +71 -0
- package/dist-cjs/lib/tools/SelectTool/GestureShapeChangeTracker.js.map +7 -0
- package/dist-cjs/lib/tools/SelectTool/childStates/Brushing.js +2 -2
- package/dist-cjs/lib/tools/SelectTool/childStates/Brushing.js.map +2 -2
- package/dist-cjs/lib/tools/SelectTool/childStates/Crop/children/Cropping.js +37 -5
- package/dist-cjs/lib/tools/SelectTool/childStates/Crop/children/Cropping.js.map +2 -2
- package/dist-cjs/lib/tools/SelectTool/childStates/Crop/children/TranslatingCrop.js +26 -4
- package/dist-cjs/lib/tools/SelectTool/childStates/Crop/children/TranslatingCrop.js.map +2 -2
- package/dist-cjs/lib/tools/SelectTool/childStates/DraggingHandle.js +14 -9
- package/dist-cjs/lib/tools/SelectTool/childStates/DraggingHandle.js.map +2 -2
- package/dist-cjs/lib/tools/SelectTool/childStates/Idle.js +1 -1
- package/dist-cjs/lib/tools/SelectTool/childStates/Idle.js.map +2 -2
- package/dist-cjs/lib/tools/SelectTool/childStates/PointingArrowLabel.js +3 -4
- package/dist-cjs/lib/tools/SelectTool/childStates/PointingArrowLabel.js.map +2 -2
- package/dist-cjs/lib/tools/SelectTool/childStates/PointingHandle.js +9 -1
- package/dist-cjs/lib/tools/SelectTool/childStates/PointingHandle.js.map +2 -2
- package/dist-cjs/lib/tools/SelectTool/childStates/PointingShape.js +10 -1
- package/dist-cjs/lib/tools/SelectTool/childStates/PointingShape.js.map +2 -2
- package/dist-cjs/lib/tools/SelectTool/childStates/Resizing.js +71 -34
- package/dist-cjs/lib/tools/SelectTool/childStates/Resizing.js.map +2 -2
- package/dist-cjs/lib/tools/SelectTool/childStates/Rotating.js +53 -10
- package/dist-cjs/lib/tools/SelectTool/childStates/Rotating.js.map +2 -2
- package/dist-cjs/lib/tools/SelectTool/childStates/Translating.js +88 -43
- package/dist-cjs/lib/tools/SelectTool/childStates/Translating.js.map +2 -2
- package/dist-cjs/lib/ui/TldrawUi.js +7 -12
- package/dist-cjs/lib/ui/TldrawUi.js.map +3 -3
- package/dist-cjs/lib/ui/components/A11y.js +12 -23
- package/dist-cjs/lib/ui/components/A11y.js.map +2 -2
- package/dist-cjs/lib/ui/components/ActionsMenu/DefaultActionsMenu.js.map +2 -2
- package/dist-cjs/lib/ui/components/ActionsMenu/DefaultActionsMenuContent.js +1 -1
- package/dist-cjs/lib/ui/components/ActionsMenu/DefaultActionsMenuContent.js.map +2 -2
- package/dist-cjs/lib/ui/components/ContextMenu/DefaultContextMenu.js +8 -16
- package/dist-cjs/lib/ui/components/ContextMenu/DefaultContextMenu.js.map +2 -2
- package/dist-cjs/lib/ui/components/CursorChatBubble.js +3 -4
- package/dist-cjs/lib/ui/components/CursorChatBubble.js.map +2 -2
- package/dist-cjs/lib/ui/components/DebugMenu/DefaultDebugMenuContent.js +9 -43
- package/dist-cjs/lib/ui/components/DebugMenu/DefaultDebugMenuContent.js.map +2 -2
- package/dist-cjs/lib/ui/components/DefaultDebugPanel.js +2 -8
- package/dist-cjs/lib/ui/components/DefaultDebugPanel.js.map +2 -2
- package/dist-cjs/lib/ui/components/Dialogs.js +1 -5
- package/dist-cjs/lib/ui/components/Dialogs.js.map +2 -2
- package/dist-cjs/lib/ui/components/EditLinkDialog.js +17 -27
- package/dist-cjs/lib/ui/components/EditLinkDialog.js.map +2 -2
- package/dist-cjs/lib/ui/components/EmbedDialog.js +5 -5
- package/dist-cjs/lib/ui/components/EmbedDialog.js.map +3 -3
- package/dist-cjs/lib/ui/components/HelpMenu/DefaultHelpMenuContent.js.map +2 -2
- package/dist-cjs/lib/ui/components/HelperButtons/BackToContent.js +8 -8
- package/dist-cjs/lib/ui/components/HelperButtons/BackToContent.js.map +2 -2
- package/dist-cjs/lib/ui/components/InputModeMenu.js +18 -31
- package/dist-cjs/lib/ui/components/InputModeMenu.js.map +3 -3
- package/dist-cjs/lib/ui/components/KeyboardShortcutsDialog/DefaultKeyboardShortcutsDialogContent.js +25 -80
- package/dist-cjs/lib/ui/components/KeyboardShortcutsDialog/DefaultKeyboardShortcutsDialogContent.js.map +2 -2
- package/dist-cjs/lib/ui/components/Minimap/MinimapManager.js +2 -6
- package/dist-cjs/lib/ui/components/Minimap/MinimapManager.js.map +2 -2
- package/dist-cjs/lib/ui/components/MobileStylePanel.js +7 -3
- package/dist-cjs/lib/ui/components/MobileStylePanel.js.map +2 -2
- package/dist-cjs/lib/ui/components/NavigationPanel/DefaultNavigationPanel.js +13 -20
- package/dist-cjs/lib/ui/components/NavigationPanel/DefaultNavigationPanel.js.map +2 -2
- package/dist-cjs/lib/ui/components/PageMenu/DefaultPageMenu.js +46 -47
- package/dist-cjs/lib/ui/components/PageMenu/DefaultPageMenu.js.map +2 -2
- package/dist-cjs/lib/ui/components/PageMenu/PageItemInput.js +1 -4
- package/dist-cjs/lib/ui/components/PageMenu/PageItemInput.js.map +2 -2
- package/dist-cjs/lib/ui/components/SharePanel/DefaultPeopleMenuFacePile.js +1 -1
- package/dist-cjs/lib/ui/components/SharePanel/DefaultPeopleMenuFacePile.js.map +2 -2
- package/dist-cjs/lib/ui/components/SharePanel/DefaultUserPresenceEditor.js +1 -3
- package/dist-cjs/lib/ui/components/SharePanel/DefaultUserPresenceEditor.js.map +2 -2
- package/dist-cjs/lib/ui/components/SharePanel/UserPresenceColorPicker.js +2 -5
- package/dist-cjs/lib/ui/components/SharePanel/UserPresenceColorPicker.js.map +3 -3
- package/dist-cjs/lib/ui/components/StylePanel/DefaultStylePanelContent.js.map +2 -2
- package/dist-cjs/lib/ui/components/StylePanel/StylePanelButtonPicker.js +1 -1
- package/dist-cjs/lib/ui/components/StylePanel/StylePanelButtonPicker.js.map +2 -2
- package/dist-cjs/lib/ui/components/StylePanel/StylePanelDoubleDropdownPicker.js +73 -71
- package/dist-cjs/lib/ui/components/StylePanel/StylePanelDoubleDropdownPicker.js.map +2 -2
- package/dist-cjs/lib/ui/components/Toolbar/AltTextEditor.js +5 -8
- package/dist-cjs/lib/ui/components/Toolbar/AltTextEditor.js.map +2 -2
- package/dist-cjs/lib/ui/components/Toolbar/DefaultImageToolbarContent.js +40 -55
- package/dist-cjs/lib/ui/components/Toolbar/DefaultImageToolbarContent.js.map +2 -2
- package/dist-cjs/lib/ui/components/Toolbar/DefaultRichTextToolbar.js +1 -4
- package/dist-cjs/lib/ui/components/Toolbar/DefaultRichTextToolbar.js.map +2 -2
- package/dist-cjs/lib/ui/components/Toolbar/DefaultToolbar.js +4 -4
- package/dist-cjs/lib/ui/components/Toolbar/DefaultToolbar.js.map +2 -2
- package/dist-cjs/lib/ui/components/Toolbar/LinkEditor.js +2 -4
- package/dist-cjs/lib/ui/components/Toolbar/LinkEditor.js.map +3 -3
- package/dist-cjs/lib/ui/components/Toolbar/OverflowingToolbar.js +3 -7
- package/dist-cjs/lib/ui/components/Toolbar/OverflowingToolbar.js.map +2 -2
- package/dist-cjs/lib/ui/components/menu-items.js +16 -14
- package/dist-cjs/lib/ui/components/menu-items.js.map +2 -2
- package/dist-cjs/lib/ui/components/primitives/TldrawUiContextualToolbar.js +6 -17
- package/dist-cjs/lib/ui/components/primitives/TldrawUiContextualToolbar.js.map +3 -3
- package/dist-cjs/lib/ui/components/primitives/TldrawUiDropdownMenu.js +1 -1
- package/dist-cjs/lib/ui/components/primitives/TldrawUiDropdownMenu.js.map +2 -2
- package/dist-cjs/lib/ui/components/primitives/TldrawUiIcon.js +1 -1
- package/dist-cjs/lib/ui/components/primitives/TldrawUiIcon.js.map +2 -2
- package/dist-cjs/lib/ui/components/primitives/TldrawUiInput.js +12 -28
- package/dist-cjs/lib/ui/components/primitives/TldrawUiInput.js.map +3 -3
- package/dist-cjs/lib/ui/components/primitives/TldrawUiPopover.js +2 -3
- package/dist-cjs/lib/ui/components/primitives/TldrawUiPopover.js.map +2 -2
- package/dist-cjs/lib/ui/components/primitives/TldrawUiSlider.js +1 -3
- package/dist-cjs/lib/ui/components/primitives/TldrawUiSlider.js.map +2 -2
- package/dist-cjs/lib/ui/components/primitives/TldrawUiToolbar.js +1 -2
- package/dist-cjs/lib/ui/components/primitives/TldrawUiToolbar.js.map +2 -2
- package/dist-cjs/lib/ui/components/primitives/TldrawUiTooltip.js +24 -56
- package/dist-cjs/lib/ui/components/primitives/TldrawUiTooltip.js.map +2 -2
- package/dist-cjs/lib/ui/components/primitives/layout.js +13 -18
- package/dist-cjs/lib/ui/components/primitives/layout.js.map +2 -2
- package/dist-cjs/lib/ui/components/primitives/menus/TldrawUiMenuCheckboxItem.js +22 -34
- package/dist-cjs/lib/ui/components/primitives/menus/TldrawUiMenuCheckboxItem.js.map +2 -2
- package/dist-cjs/lib/ui/components/primitives/menus/TldrawUiMenuGroup.js +6 -27
- package/dist-cjs/lib/ui/components/primitives/menus/TldrawUiMenuGroup.js.map +2 -2
- package/dist-cjs/lib/ui/components/primitives/menus/TldrawUiMenuItem.js +30 -33
- package/dist-cjs/lib/ui/components/primitives/menus/TldrawUiMenuItem.js.map +2 -2
- package/dist-cjs/lib/ui/components/primitives/menus/TldrawUiMenuSubmenu.js +2 -1
- package/dist-cjs/lib/ui/components/primitives/menus/TldrawUiMenuSubmenu.js.map +2 -2
- package/dist-cjs/lib/ui/context/TldrawUiContextProvider.js.map +2 -2
- package/dist-cjs/lib/ui/context/actions.js +117 -209
- package/dist-cjs/lib/ui/context/actions.js.map +2 -2
- package/dist-cjs/lib/ui/getLocalFiles.js +2 -2
- package/dist-cjs/lib/ui/getLocalFiles.js.map +2 -2
- package/dist-cjs/lib/ui/hooks/menu-hooks.js +15 -54
- package/dist-cjs/lib/ui/hooks/menu-hooks.js.map +2 -2
- package/dist-cjs/lib/ui/hooks/useClipboardEvents.js +63 -113
- package/dist-cjs/lib/ui/hooks/useClipboardEvents.js.map +2 -2
- package/dist-cjs/lib/ui/hooks/useFlatten.js +3 -9
- package/dist-cjs/lib/ui/hooks/useFlatten.js.map +2 -2
- package/dist-cjs/lib/ui/hooks/useKeyboardShortcuts.js +32 -67
- package/dist-cjs/lib/ui/hooks/useKeyboardShortcuts.js.map +2 -2
- package/dist-cjs/lib/ui/hooks/usePrint.js +5 -7
- package/dist-cjs/lib/ui/hooks/usePrint.js.map +2 -2
- package/dist-cjs/lib/ui/hooks/useRelevantStyles.js +3 -2
- package/dist-cjs/lib/ui/hooks/useRelevantStyles.js.map +2 -2
- package/dist-cjs/lib/ui/hooks/useTranslation/translations.js +3 -6
- package/dist-cjs/lib/ui/hooks/useTranslation/translations.js.map +2 -2
- package/dist-cjs/lib/ui/hooks/useTranslation/useTranslation.js +11 -26
- package/dist-cjs/lib/ui/hooks/useTranslation/useTranslation.js.map +2 -2
- package/dist-cjs/lib/ui/kbd-utils.js +3 -3
- package/dist-cjs/lib/ui/kbd-utils.js.map +2 -2
- package/dist-cjs/lib/ui/overrides.js +11 -26
- package/dist-cjs/lib/ui/overrides.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/embeds/embeds.js +1 -1
- package/dist-cjs/lib/utils/embeds/embeds.js.map +2 -2
- package/dist-cjs/lib/utils/frames/frames.js +8 -0
- package/dist-cjs/lib/utils/frames/frames.js.map +2 -2
- package/dist-esm/index.mjs +1 -1
- package/dist-esm/lib/shapes/draw/toolStates/Drawing.mjs +7 -2
- package/dist-esm/lib/shapes/draw/toolStates/Drawing.mjs.map +2 -2
- package/dist-esm/lib/shapes/image/ImageShapeUtil.mjs +25 -9
- package/dist-esm/lib/shapes/image/ImageShapeUtil.mjs.map +3 -3
- package/dist-esm/lib/shapes/line/LineShapeUtil.mjs +15 -5
- package/dist-esm/lib/shapes/line/LineShapeUtil.mjs.map +2 -2
- package/dist-esm/lib/shapes/note/NoteShapeUtil.mjs +6 -3
- package/dist-esm/lib/shapes/note/NoteShapeUtil.mjs.map +2 -2
- package/dist-esm/lib/shapes/note/noteHelpers.mjs +7 -2
- package/dist-esm/lib/shapes/note/noteHelpers.mjs.map +2 -2
- package/dist-esm/lib/shapes/note/toolStates/Pointing.mjs +4 -4
- package/dist-esm/lib/shapes/note/toolStates/Pointing.mjs.map +2 -2
- package/dist-esm/lib/shapes/shared/crop.mjs +13 -24
- package/dist-esm/lib/shapes/shared/crop.mjs.map +2 -2
- package/dist-esm/lib/shapes/shared/useImageOrVideoAsset.mjs +16 -3
- package/dist-esm/lib/shapes/shared/useImageOrVideoAsset.mjs.map +2 -2
- package/dist-esm/lib/shapes/video/VideoShapeUtil.mjs +6 -1
- package/dist-esm/lib/shapes/video/VideoShapeUtil.mjs.map +2 -2
- package/dist-esm/lib/tools/SelectTool/GestureShapeChangeTracker.mjs +51 -0
- package/dist-esm/lib/tools/SelectTool/GestureShapeChangeTracker.mjs.map +7 -0
- package/dist-esm/lib/tools/SelectTool/childStates/Brushing.mjs +2 -2
- package/dist-esm/lib/tools/SelectTool/childStates/Brushing.mjs.map +2 -2
- package/dist-esm/lib/tools/SelectTool/childStates/Crop/children/Cropping.mjs +40 -5
- package/dist-esm/lib/tools/SelectTool/childStates/Crop/children/Cropping.mjs.map +2 -2
- package/dist-esm/lib/tools/SelectTool/childStates/Crop/children/TranslatingCrop.mjs +32 -5
- package/dist-esm/lib/tools/SelectTool/childStates/Crop/children/TranslatingCrop.mjs.map +2 -2
- package/dist-esm/lib/tools/SelectTool/childStates/DraggingHandle.mjs +14 -9
- package/dist-esm/lib/tools/SelectTool/childStates/DraggingHandle.mjs.map +2 -2
- package/dist-esm/lib/tools/SelectTool/childStates/Idle.mjs +1 -1
- package/dist-esm/lib/tools/SelectTool/childStates/Idle.mjs.map +2 -2
- package/dist-esm/lib/tools/SelectTool/childStates/PointingArrowLabel.mjs +3 -4
- package/dist-esm/lib/tools/SelectTool/childStates/PointingArrowLabel.mjs.map +2 -2
- package/dist-esm/lib/tools/SelectTool/childStates/PointingHandle.mjs +11 -2
- package/dist-esm/lib/tools/SelectTool/childStates/PointingHandle.mjs.map +2 -2
- package/dist-esm/lib/tools/SelectTool/childStates/PointingShape.mjs +10 -1
- package/dist-esm/lib/tools/SelectTool/childStates/PointingShape.mjs.map +2 -2
- package/dist-esm/lib/tools/SelectTool/childStates/Resizing.mjs +74 -34
- package/dist-esm/lib/tools/SelectTool/childStates/Resizing.mjs.map +2 -2
- package/dist-esm/lib/tools/SelectTool/childStates/Rotating.mjs +56 -10
- package/dist-esm/lib/tools/SelectTool/childStates/Rotating.mjs.map +2 -2
- package/dist-esm/lib/tools/SelectTool/childStates/Translating.mjs +88 -43
- package/dist-esm/lib/tools/SelectTool/childStates/Translating.mjs.map +2 -2
- package/dist-esm/lib/ui/TldrawUi.mjs +7 -12
- package/dist-esm/lib/ui/TldrawUi.mjs.map +3 -3
- package/dist-esm/lib/ui/components/A11y.mjs +12 -23
- package/dist-esm/lib/ui/components/A11y.mjs.map +2 -2
- package/dist-esm/lib/ui/components/ActionsMenu/DefaultActionsMenu.mjs.map +2 -2
- package/dist-esm/lib/ui/components/ActionsMenu/DefaultActionsMenuContent.mjs +1 -1
- package/dist-esm/lib/ui/components/ActionsMenu/DefaultActionsMenuContent.mjs.map +2 -2
- package/dist-esm/lib/ui/components/ContextMenu/DefaultContextMenu.mjs +8 -16
- package/dist-esm/lib/ui/components/ContextMenu/DefaultContextMenu.mjs.map +2 -2
- package/dist-esm/lib/ui/components/CursorChatBubble.mjs +3 -4
- package/dist-esm/lib/ui/components/CursorChatBubble.mjs.map +2 -2
- package/dist-esm/lib/ui/components/DebugMenu/DefaultDebugMenuContent.mjs +10 -43
- package/dist-esm/lib/ui/components/DebugMenu/DefaultDebugMenuContent.mjs.map +2 -2
- package/dist-esm/lib/ui/components/DefaultDebugPanel.mjs +2 -8
- package/dist-esm/lib/ui/components/DefaultDebugPanel.mjs.map +2 -2
- package/dist-esm/lib/ui/components/Dialogs.mjs +1 -5
- package/dist-esm/lib/ui/components/Dialogs.mjs.map +2 -2
- package/dist-esm/lib/ui/components/EditLinkDialog.mjs +17 -27
- package/dist-esm/lib/ui/components/EditLinkDialog.mjs.map +2 -2
- package/dist-esm/lib/ui/components/EmbedDialog.mjs +5 -5
- package/dist-esm/lib/ui/components/EmbedDialog.mjs.map +3 -3
- package/dist-esm/lib/ui/components/HelpMenu/DefaultHelpMenuContent.mjs.map +2 -2
- package/dist-esm/lib/ui/components/HelperButtons/BackToContent.mjs +8 -8
- package/dist-esm/lib/ui/components/HelperButtons/BackToContent.mjs.map +2 -2
- package/dist-esm/lib/ui/components/InputModeMenu.mjs +18 -31
- package/dist-esm/lib/ui/components/InputModeMenu.mjs.map +3 -3
- package/dist-esm/lib/ui/components/KeyboardShortcutsDialog/DefaultKeyboardShortcutsDialogContent.mjs +25 -80
- package/dist-esm/lib/ui/components/KeyboardShortcutsDialog/DefaultKeyboardShortcutsDialogContent.mjs.map +2 -2
- package/dist-esm/lib/ui/components/Minimap/MinimapManager.mjs +2 -6
- package/dist-esm/lib/ui/components/Minimap/MinimapManager.mjs.map +2 -2
- package/dist-esm/lib/ui/components/MobileStylePanel.mjs +7 -3
- package/dist-esm/lib/ui/components/MobileStylePanel.mjs.map +2 -2
- package/dist-esm/lib/ui/components/NavigationPanel/DefaultNavigationPanel.mjs +13 -20
- package/dist-esm/lib/ui/components/NavigationPanel/DefaultNavigationPanel.mjs.map +2 -2
- package/dist-esm/lib/ui/components/PageMenu/DefaultPageMenu.mjs +47 -47
- package/dist-esm/lib/ui/components/PageMenu/DefaultPageMenu.mjs.map +2 -2
- package/dist-esm/lib/ui/components/PageMenu/PageItemInput.mjs +1 -4
- package/dist-esm/lib/ui/components/PageMenu/PageItemInput.mjs.map +2 -2
- package/dist-esm/lib/ui/components/SharePanel/DefaultPeopleMenuFacePile.mjs +1 -1
- package/dist-esm/lib/ui/components/SharePanel/DefaultPeopleMenuFacePile.mjs.map +2 -2
- package/dist-esm/lib/ui/components/SharePanel/DefaultUserPresenceEditor.mjs +1 -3
- package/dist-esm/lib/ui/components/SharePanel/DefaultUserPresenceEditor.mjs.map +2 -2
- package/dist-esm/lib/ui/components/SharePanel/UserPresenceColorPicker.mjs +2 -5
- package/dist-esm/lib/ui/components/SharePanel/UserPresenceColorPicker.mjs.map +3 -3
- package/dist-esm/lib/ui/components/StylePanel/DefaultStylePanelContent.mjs.map +2 -2
- package/dist-esm/lib/ui/components/StylePanel/StylePanelButtonPicker.mjs +1 -1
- package/dist-esm/lib/ui/components/StylePanel/StylePanelButtonPicker.mjs.map +2 -2
- package/dist-esm/lib/ui/components/StylePanel/StylePanelDoubleDropdownPicker.mjs +73 -71
- package/dist-esm/lib/ui/components/StylePanel/StylePanelDoubleDropdownPicker.mjs.map +2 -2
- package/dist-esm/lib/ui/components/Toolbar/AltTextEditor.mjs +5 -8
- package/dist-esm/lib/ui/components/Toolbar/AltTextEditor.mjs.map +2 -2
- package/dist-esm/lib/ui/components/Toolbar/DefaultImageToolbarContent.mjs +41 -56
- package/dist-esm/lib/ui/components/Toolbar/DefaultImageToolbarContent.mjs.map +2 -2
- package/dist-esm/lib/ui/components/Toolbar/DefaultRichTextToolbar.mjs +1 -4
- package/dist-esm/lib/ui/components/Toolbar/DefaultRichTextToolbar.mjs.map +2 -2
- package/dist-esm/lib/ui/components/Toolbar/DefaultToolbar.mjs +4 -4
- package/dist-esm/lib/ui/components/Toolbar/DefaultToolbar.mjs.map +2 -2
- package/dist-esm/lib/ui/components/Toolbar/LinkEditor.mjs +2 -4
- package/dist-esm/lib/ui/components/Toolbar/LinkEditor.mjs.map +3 -3
- package/dist-esm/lib/ui/components/Toolbar/OverflowingToolbar.mjs +4 -8
- package/dist-esm/lib/ui/components/Toolbar/OverflowingToolbar.mjs.map +2 -2
- package/dist-esm/lib/ui/components/menu-items.mjs +16 -14
- package/dist-esm/lib/ui/components/menu-items.mjs.map +2 -2
- package/dist-esm/lib/ui/components/primitives/TldrawUiContextualToolbar.mjs +6 -17
- package/dist-esm/lib/ui/components/primitives/TldrawUiContextualToolbar.mjs.map +3 -3
- package/dist-esm/lib/ui/components/primitives/TldrawUiDropdownMenu.mjs +1 -1
- package/dist-esm/lib/ui/components/primitives/TldrawUiDropdownMenu.mjs.map +2 -2
- package/dist-esm/lib/ui/components/primitives/TldrawUiIcon.mjs +1 -1
- package/dist-esm/lib/ui/components/primitives/TldrawUiIcon.mjs.map +2 -2
- package/dist-esm/lib/ui/components/primitives/TldrawUiInput.mjs +12 -28
- package/dist-esm/lib/ui/components/primitives/TldrawUiInput.mjs.map +3 -3
- package/dist-esm/lib/ui/components/primitives/TldrawUiPopover.mjs +2 -3
- package/dist-esm/lib/ui/components/primitives/TldrawUiPopover.mjs.map +2 -2
- package/dist-esm/lib/ui/components/primitives/TldrawUiSlider.mjs +1 -3
- package/dist-esm/lib/ui/components/primitives/TldrawUiSlider.mjs.map +2 -2
- package/dist-esm/lib/ui/components/primitives/TldrawUiToolbar.mjs +1 -2
- package/dist-esm/lib/ui/components/primitives/TldrawUiToolbar.mjs.map +2 -2
- package/dist-esm/lib/ui/components/primitives/TldrawUiTooltip.mjs +24 -56
- package/dist-esm/lib/ui/components/primitives/TldrawUiTooltip.mjs.map +2 -2
- package/dist-esm/lib/ui/components/primitives/layout.mjs +13 -18
- package/dist-esm/lib/ui/components/primitives/layout.mjs.map +2 -2
- package/dist-esm/lib/ui/components/primitives/menus/TldrawUiMenuCheckboxItem.mjs +23 -35
- package/dist-esm/lib/ui/components/primitives/menus/TldrawUiMenuCheckboxItem.mjs.map +2 -2
- package/dist-esm/lib/ui/components/primitives/menus/TldrawUiMenuGroup.mjs +6 -27
- package/dist-esm/lib/ui/components/primitives/menus/TldrawUiMenuGroup.mjs.map +2 -2
- package/dist-esm/lib/ui/components/primitives/menus/TldrawUiMenuItem.mjs +31 -34
- package/dist-esm/lib/ui/components/primitives/menus/TldrawUiMenuItem.mjs.map +2 -2
- package/dist-esm/lib/ui/components/primitives/menus/TldrawUiMenuSubmenu.mjs +2 -1
- package/dist-esm/lib/ui/components/primitives/menus/TldrawUiMenuSubmenu.mjs.map +2 -2
- package/dist-esm/lib/ui/context/TldrawUiContextProvider.mjs.map +2 -2
- package/dist-esm/lib/ui/context/actions.mjs +118 -210
- package/dist-esm/lib/ui/context/actions.mjs.map +2 -2
- package/dist-esm/lib/ui/getLocalFiles.mjs +2 -2
- package/dist-esm/lib/ui/getLocalFiles.mjs.map +2 -2
- package/dist-esm/lib/ui/hooks/menu-hooks.mjs +15 -54
- package/dist-esm/lib/ui/hooks/menu-hooks.mjs.map +2 -2
- package/dist-esm/lib/ui/hooks/useClipboardEvents.mjs +65 -115
- package/dist-esm/lib/ui/hooks/useClipboardEvents.mjs.map +3 -3
- package/dist-esm/lib/ui/hooks/useFlatten.mjs +3 -9
- package/dist-esm/lib/ui/hooks/useFlatten.mjs.map +2 -2
- package/dist-esm/lib/ui/hooks/useKeyboardShortcuts.mjs +32 -67
- package/dist-esm/lib/ui/hooks/useKeyboardShortcuts.mjs.map +2 -2
- package/dist-esm/lib/ui/hooks/usePrint.mjs +5 -7
- package/dist-esm/lib/ui/hooks/usePrint.mjs.map +2 -2
- package/dist-esm/lib/ui/hooks/useRelevantStyles.mjs +3 -2
- package/dist-esm/lib/ui/hooks/useRelevantStyles.mjs.map +2 -2
- package/dist-esm/lib/ui/hooks/useTranslation/translations.mjs +3 -6
- package/dist-esm/lib/ui/hooks/useTranslation/translations.mjs.map +2 -2
- package/dist-esm/lib/ui/hooks/useTranslation/useTranslation.mjs +11 -26
- package/dist-esm/lib/ui/hooks/useTranslation/useTranslation.mjs.map +2 -2
- package/dist-esm/lib/ui/kbd-utils.mjs +3 -3
- package/dist-esm/lib/ui/kbd-utils.mjs.map +2 -2
- package/dist-esm/lib/ui/overrides.mjs +11 -26
- package/dist-esm/lib/ui/overrides.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/embeds/embeds.mjs +1 -1
- package/dist-esm/lib/utils/embeds/embeds.mjs.map +2 -2
- package/dist-esm/lib/utils/frames/frames.mjs +8 -0
- package/dist-esm/lib/utils/frames/frames.mjs.map +2 -2
- package/package.json +6 -6
- package/src/lib/shapes/draw/toolStates/Drawing.ts +11 -2
- package/src/lib/shapes/image/ImageShapeUtil.tsx +29 -7
- package/src/lib/shapes/line/LineShapeUtil.test.tsx +23 -0
- package/src/lib/shapes/line/LineShapeUtil.tsx +21 -5
- package/src/lib/shapes/note/NoteShapeUtil.tsx +6 -3
- package/src/lib/shapes/note/noteCloning.test.ts +62 -0
- package/src/lib/shapes/note/noteHelpers.ts +12 -1
- package/src/lib/shapes/note/toolStates/Pointing.ts +6 -4
- package/src/lib/shapes/shared/crop.ts +19 -33
- package/src/lib/shapes/shared/useImageOrVideoAsset.test.tsx +153 -0
- package/src/lib/shapes/shared/useImageOrVideoAsset.ts +25 -6
- package/src/lib/shapes/video/VideoShapeUtil.tsx +10 -1
- package/src/lib/tools/SelectTool/GestureShapeChangeTracker.test.ts +45 -0
- package/src/lib/tools/SelectTool/GestureShapeChangeTracker.ts +76 -0
- package/src/lib/tools/SelectTool/childStates/Brushing.ts +2 -2
- package/src/lib/tools/SelectTool/childStates/Crop/children/Cropping.ts +35 -5
- package/src/lib/tools/SelectTool/childStates/Crop/children/TranslatingCrop.ts +33 -5
- package/src/lib/tools/SelectTool/childStates/DraggingHandle.tsx +18 -9
- package/src/lib/tools/SelectTool/childStates/Idle.ts +2 -2
- package/src/lib/tools/SelectTool/childStates/PointingArrowLabel.ts +7 -4
- package/src/lib/tools/SelectTool/childStates/PointingHandle.ts +14 -1
- package/src/lib/tools/SelectTool/childStates/PointingShape.ts +13 -1
- package/src/lib/tools/SelectTool/childStates/Resizing.ts +78 -42
- package/src/lib/tools/SelectTool/childStates/Rotating.ts +51 -11
- package/src/lib/tools/SelectTool/childStates/Translating.ts +102 -45
- package/src/lib/ui/TldrawUi.tsx +7 -14
- package/src/lib/ui/components/A11y.tsx +29 -35
- package/src/lib/ui/components/ActionsMenu/DefaultActionsMenu.tsx +0 -4
- package/src/lib/ui/components/ActionsMenu/DefaultActionsMenuContent.tsx +7 -8
- package/src/lib/ui/components/ContextMenu/DefaultContextMenu.tsx +11 -19
- package/src/lib/ui/components/CursorChatBubble.tsx +3 -4
- package/src/lib/ui/components/DebugMenu/DefaultDebugMenuContent.tsx +18 -56
- package/src/lib/ui/components/DefaultDebugPanel.tsx +2 -8
- package/src/lib/ui/components/Dialogs.tsx +4 -6
- package/src/lib/ui/components/EditLinkDialog.tsx +20 -45
- package/src/lib/ui/components/EmbedDialog.tsx +20 -22
- package/src/lib/ui/components/HelpMenu/DefaultHelpMenuContent.tsx +1 -0
- package/src/lib/ui/components/HelperButtons/BackToContent.tsx +9 -8
- package/src/lib/ui/components/InputModeMenu.tsx +17 -31
- package/src/lib/ui/components/KeyboardShortcutsDialog/DefaultKeyboardShortcutsDialogContent.tsx +25 -92
- package/src/lib/ui/components/Minimap/MinimapManager.ts +6 -8
- package/src/lib/ui/components/MobileStylePanel.tsx +7 -5
- package/src/lib/ui/components/NavigationPanel/DefaultNavigationPanel.tsx +14 -20
- package/src/lib/ui/components/PageMenu/DefaultPageMenu.tsx +53 -59
- package/src/lib/ui/components/PageMenu/PageItemInput.tsx +3 -7
- package/src/lib/ui/components/SharePanel/DefaultPeopleMenuFacePile.tsx +1 -1
- package/src/lib/ui/components/SharePanel/DefaultUserPresenceEditor.tsx +1 -3
- package/src/lib/ui/components/SharePanel/UserPresenceColorPicker.tsx +2 -5
- package/src/lib/ui/components/StylePanel/DefaultStylePanelContent.tsx +2 -2
- package/src/lib/ui/components/StylePanel/StylePanelButtonPicker.tsx +1 -1
- package/src/lib/ui/components/StylePanel/StylePanelDoubleDropdownPicker.tsx +95 -100
- package/src/lib/ui/components/Toolbar/AltTextEditor.tsx +5 -10
- package/src/lib/ui/components/Toolbar/DefaultImageToolbarContent.tsx +47 -67
- package/src/lib/ui/components/Toolbar/DefaultRichTextToolbar.tsx +1 -5
- package/src/lib/ui/components/Toolbar/DefaultToolbar.tsx +4 -4
- package/src/lib/ui/components/Toolbar/LinkEditor.tsx +2 -6
- package/src/lib/ui/components/Toolbar/OverflowingToolbar.tsx +51 -64
- package/src/lib/ui/components/menu-items.tsx +19 -17
- package/src/lib/ui/components/primitives/TldrawUiContextualToolbar.tsx +7 -20
- package/src/lib/ui/components/primitives/TldrawUiDropdownMenu.tsx +1 -1
- package/src/lib/ui/components/primitives/TldrawUiIcon.tsx +1 -1
- package/src/lib/ui/components/primitives/TldrawUiInput.tsx +15 -31
- package/src/lib/ui/components/primitives/TldrawUiPopover.tsx +2 -3
- package/src/lib/ui/components/primitives/TldrawUiSlider.tsx +1 -3
- package/src/lib/ui/components/primitives/TldrawUiToolbar.tsx +1 -3
- package/src/lib/ui/components/primitives/TldrawUiTooltip.tsx +26 -63
- package/src/lib/ui/components/primitives/layout.tsx +22 -30
- package/src/lib/ui/components/primitives/menus/TldrawUiMenuCheckboxItem.tsx +25 -30
- package/src/lib/ui/components/primitives/menus/TldrawUiMenuGroup.tsx +6 -15
- package/src/lib/ui/components/primitives/menus/TldrawUiMenuItem.tsx +53 -32
- package/src/lib/ui/components/primitives/menus/TldrawUiMenuSubmenu.tsx +2 -5
- package/src/lib/ui/context/TldrawUiContextProvider.tsx +1 -1
- package/src/lib/ui/context/actions.tsx +122 -225
- package/src/lib/ui/getLocalFiles.ts +2 -2
- package/src/lib/ui/hooks/menu-hooks.ts +18 -65
- package/src/lib/ui/hooks/useClipboardEvents.ts +88 -140
- package/src/lib/ui/hooks/useFlatten.ts +3 -9
- package/src/lib/ui/hooks/useKeyboardShortcuts.ts +39 -78
- package/src/lib/ui/hooks/usePrint.ts +5 -8
- package/src/lib/ui/hooks/useRelevantStyles.ts +3 -2
- package/src/lib/ui/hooks/useTranslation/translations.ts +3 -7
- package/src/lib/ui/hooks/useTranslation/useTranslation.tsx +13 -27
- package/src/lib/ui/kbd-utils.ts +2 -4
- package/src/lib/ui/overrides.ts +19 -32
- package/src/lib/ui/version.ts +3 -3
- package/src/lib/utils/embeds/embeds.test.ts +9 -0
- package/src/lib/utils/embeds/embeds.ts +4 -1
- package/src/lib/utils/frames/frames.ts +19 -0
- package/src/test/SelectTool.test.ts +201 -0
- package/src/test/bindings.test.tsx +27 -0
- package/src/test/commands/animateShapes.test.ts +71 -2
- package/src/test/commands/getSvgString.test.ts +141 -1
- package/src/test/commands/lockShapes.test.ts +60 -0
- package/src/test/commands/setCamera.test.ts +81 -5
- package/src/test/commands/stackShapes.test.ts +42 -0
- package/src/test/cropping.test.ts +55 -0
- package/src/test/dragFromToolbar-dom.test.tsx +150 -0
- package/src/test/drawing-shift-keyup.test.ts +79 -0
- package/src/test/groups.test.tsx +104 -0
- package/src/test/maxShapes.test.ts +20 -0
- package/src/test/navigation.test.ts +246 -34
- package/src/test/resizing.test.ts +59 -0
- package/src/test/resolveAssetsInContent.test.ts +96 -0
- package/src/test/rotating.test.ts +32 -0
- package/src/test/selection-omnibus.test.ts +19 -16
- package/src/test/translating.test.ts +61 -4
- package/src/test/ui/FrameSelectionMenuItem.test.tsx +115 -0
- package/src/test/ui/changePage.test.tsx +131 -0
- package/src/test/ui/keyboardShortcuts.test.tsx +191 -1
- package/src/test/zoomToUser.test.ts +63 -0
package/DOCS.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# tldraw Documentation
|
|
2
2
|
|
|
3
|
-
Version: `5.
|
|
3
|
+
Version: `5.5.0-canary.0241f11f2e99`
|
|
4
4
|
|
|
5
5
|
This file is generated during package publishing from the tldraw docs content for this exact package version.
|
|
6
6
|
|
|
@@ -1199,7 +1199,7 @@ See [Collaboration](https://tldraw.dev/sdk-features/collaboration) for productio
|
|
|
1199
1199
|
|
|
1200
1200
|
When you load a snapshot from an older schema version, the store migrates it automatically. For custom shapes, you can define migrations to handle changes to their props over time.
|
|
1201
1201
|
|
|
1202
|
-
See [Persistence](https://tldraw.dev/sdk-features/persistence#
|
|
1202
|
+
See [Persistence](https://tldraw.dev/sdk-features/persistence#Migrations) for details on shape props migrations and general migrations.
|
|
1203
1203
|
|
|
1204
1204
|
#### Examples
|
|
1205
1205
|
|
|
@@ -1419,7 +1419,7 @@ function MyApp() {
|
|
|
1419
1419
|
}
|
|
1420
1420
|
```
|
|
1421
1421
|
|
|
1422
|
-
Comment records are opt-in, so register `commentSchemaRecords` on your server's schema too, and list the comment record types in the room's `objectTypes` (see [Comments and the object-store lane](https://tldraw.dev/docs/sync#
|
|
1422
|
+
Comment records are opt-in, so register `commentSchemaRecords` on your server's schema too, and list the comment record types in the room's `objectTypes` (see [Comments and the object-store lane](https://tldraw.dev/docs/sync#Comments-and-the-object-store-lane)). Commenting is a licensed feature. See the [commenting overview](https://tldraw.dev/docs/commenting) for an introduction, or the [commenting reference](https://tldraw.dev/sdk-features/commenting) for anchors, options, and server setup.
|
|
1423
1423
|
|
|
1424
1424
|
#### Using other backends
|
|
1425
1425
|
|
|
@@ -1772,7 +1772,7 @@ import { CommentTool } from '@tldraw/commenting'
|
|
|
1772
1772
|
const tools = [CommentTool.configure({ enableRegions: true })]
|
|
1773
1773
|
```
|
|
1774
1774
|
|
|
1775
|
-
The option worth knowing about first is `history`. Comment writes default to `'ignore'`, which keeps them off the undo stack, and that default matters in a shared document: an undoable resolve would revert a thread a collaborator has since reopened. Deletes are never undoable, whatever `history` says. See [Comments and undo](https://tldraw.dev/sdk-features/commenting#
|
|
1775
|
+
The option worth knowing about first is `history`. Comment writes default to `'ignore'`, which keeps them off the undo stack, and that default matters in a shared document: an undoable resolve would revert a thread a collaborator has since reopened. Deletes are never undoable, whatever `history` says. See [Comments and undo](https://tldraw.dev/sdk-features/commenting#Comments-and-undo).
|
|
1776
1776
|
|
|
1777
1777
|
#### Permissions
|
|
1778
1778
|
|
|
@@ -1784,7 +1784,7 @@ They're UI-level controls and nothing more. Comment records carry a client-suppl
|
|
|
1784
1784
|
|
|
1785
1785
|
Comments sync like the rest of your document, with one registration on each side. Pass `records: commentSchemaRecords` to your sync hook, and the same map to `createTLSchema` on the server.
|
|
1786
1786
|
|
|
1787
|
-
On the server you can go a step further and serve comments through the room's object-store lane. Lane records are gated by their own per-session permission rather than by `isReadonly`, which is how a viewer who can't edit the document can still comment. See [Syncing comments](https://tldraw.dev/sdk-features/commenting#
|
|
1787
|
+
On the server you can go a step further and serve comments through the room's object-store lane. Lane records are gated by their own per-session permission rather than by `isReadonly`, which is how a viewer who can't edit the document can still comment. See [Syncing comments](https://tldraw.dev/sdk-features/commenting#Syncing-comments).
|
|
1788
1788
|
|
|
1789
1789
|
#### Related
|
|
1790
1790
|
|
|
@@ -2094,7 +2094,7 @@ function MyApp() {
|
|
|
2094
2094
|
Use `createTLSchema` to create a store schema, and pass that into `TLSocketRoom`. You can
|
|
2095
2095
|
use shape/binding utils here, but the schema only reads three properties:
|
|
2096
2096
|
[`props`](https://tldraw.dev/reference/editor/ShapeUtil#props), `meta`, and
|
|
2097
|
-
[`migrations`](https://tldraw.dev/sdk-features/persistence#
|
|
2097
|
+
[`migrations`](https://tldraw.dev/sdk-features/persistence#Migrations). You need to provide the default shape
|
|
2098
2098
|
schemas if you're using them.
|
|
2099
2099
|
|
|
2100
2100
|
```tsx
|
|
@@ -2918,7 +2918,7 @@ For example, see `src/components/WhiteboardModal.tsx:92` for UI component overri
|
|
|
2918
2918
|
|
|
2919
2919
|
#### Further reading
|
|
2920
2920
|
|
|
2921
|
-
- **[Custom shape utilities](https://tldraw.dev/docs/shapes#
|
|
2921
|
+
- **[Custom shape utilities](https://tldraw.dev/docs/shapes#Custom-shapes)**: Learn how to create custom shapes with their own interactions.
|
|
2922
2922
|
|
|
2923
2923
|
- **[Editor API](https://tldraw.dev/docs/editor)**: Learn about the tldraw Editor.
|
|
2924
2924
|
|
|
@@ -3454,14 +3454,14 @@ The system prompt is rebuilt for each step in the agentic loop depending on whic
|
|
|
3454
3454
|
You can set an agent's model by calling `setModelName` on the `modelName` manager.
|
|
3455
3455
|
|
|
3456
3456
|
```tsx
|
|
3457
|
-
agent.modelName.setModelName('gemini-3-flash
|
|
3457
|
+
agent.modelName.setModelName('gemini-3.8-flash')
|
|
3458
3458
|
```
|
|
3459
3459
|
|
|
3460
3460
|
To override an agent's model, specify a different model name with a request.
|
|
3461
3461
|
|
|
3462
3462
|
```tsx
|
|
3463
3463
|
agent.prompt({
|
|
3464
|
-
modelName: 'gemini-3-flash
|
|
3464
|
+
modelName: 'gemini-3.8-flash',
|
|
3465
3465
|
message: 'Draw a diagram of a volcano.',
|
|
3466
3466
|
})
|
|
3467
3467
|
```
|
|
@@ -3470,7 +3470,7 @@ You can conditionally override the model name by overriding the `getModelName()`
|
|
|
3470
3470
|
|
|
3471
3471
|
```tsx
|
|
3472
3472
|
override getModelName(part: MyCustomPromptPart) {
|
|
3473
|
-
return part.fastMode ? 'gemini-3-flash
|
|
3473
|
+
return part.fastMode ? 'gemini-3.8-flash' : 'claude-sonnet-5'
|
|
3474
3474
|
}
|
|
3475
3475
|
```
|
|
3476
3476
|
|
|
@@ -3479,10 +3479,14 @@ override getModelName(part: MyCustomPromptPart) {
|
|
|
3479
3479
|
To add support for a different model, add the model's definition to `AGENT_MODEL_DEFINITIONS` in the `shared/models.ts` file.
|
|
3480
3480
|
|
|
3481
3481
|
```tsx
|
|
3482
|
-
'claude-sonnet-
|
|
3483
|
-
name: 'claude-sonnet-
|
|
3484
|
-
id: 'claude-sonnet-
|
|
3482
|
+
'claude-sonnet-5': {
|
|
3483
|
+
name: 'claude-sonnet-5',
|
|
3484
|
+
id: 'claude-sonnet-5',
|
|
3485
3485
|
provider: 'anthropic',
|
|
3486
|
+
supportsPrefill: false,
|
|
3487
|
+
supportsTemperature: false,
|
|
3488
|
+
thinking: 'adaptive',
|
|
3489
|
+
effort: 'low',
|
|
3486
3490
|
}
|
|
3487
3491
|
```
|
|
3488
3492
|
|
|
@@ -3490,7 +3494,7 @@ If you need to add any extra setup or configuration for your provider, you can a
|
|
|
3490
3494
|
|
|
3491
3495
|
##### Support custom shapes
|
|
3492
3496
|
|
|
3493
|
-
If your app includes [custom shapes](https://tldraw.dev/docs/shapes#
|
|
3497
|
+
If your app includes [custom shapes](https://tldraw.dev/docs/shapes#Custom-shapes), the agent will be able to see, move, delete, resize, rotate and arrange them with no extra setup. However, you might want to also let the agent create and edit them, and read their custom properties.
|
|
3494
3498
|
|
|
3495
3499
|
To support custom shapes, you have two main options:
|
|
3496
3500
|
|
|
@@ -3667,7 +3671,7 @@ export function convertFocusedShapeToTldrawShape(
|
|
|
3667
3671
|
|
|
3668
3672
|
- **[Multiplayer starter kit](https://tldraw.dev/starter-kits/multiplayer)**: Use the tldraw multiplayer sync starter kit to build multi-user agent environments.
|
|
3669
3673
|
|
|
3670
|
-
- **[Shape utilities](https://tldraw.dev/docs/shapes#
|
|
3674
|
+
- **[Shape utilities](https://tldraw.dev/docs/shapes#Custom-shapes)**: Learn how to create custom shapes and extend tldraw's shape system with advanced geometry, rendering, and interaction patterns.
|
|
3671
3675
|
|
|
3672
3676
|
- **[Editor state management](https://tldraw.dev/docs/editor)**: Learn how to work with tldraw's reactive state system, editor lifecycle, and event handling for complex canvas applications.
|
|
3673
3677
|
|
|
@@ -3871,7 +3875,7 @@ See `client/connection/ConnectionBindingUtil.tsx` as an example. This file demon
|
|
|
3871
3875
|
#### Further reading
|
|
3872
3876
|
|
|
3873
3877
|
- [Workflow starter kit](https://tldraw.dev/starter-kits/workflow): Learn how to build visual programming interfaces with node-based workflows on infinite canvas.
|
|
3874
|
-
- [Shape utilities](https://tldraw.dev/docs/shapes#
|
|
3878
|
+
- [Shape utilities](https://tldraw.dev/docs/shapes#Custom-shapes): Learn how to create custom shapes and extend tldraw's shape system with advanced geometry, rendering, and interaction patterns.
|
|
3875
3879
|
- [Binding system](https://tldraw.dev/sdk-features/bindings): Learn more about tldraw's binding system for creating relationships between shapes, automatic updates, and connection management.
|
|
3876
3880
|
- [Editor state management](https://tldraw.dev/docs/editor): Learn how to work with tldraw's reactive state system, editor lifecycle, and event handling for complex canvas applications.
|
|
3877
3881
|
|
|
@@ -4199,7 +4203,7 @@ See [`src/fluid/FluidManager.ts`](https://github.com/tldraw/tldraw/tree/main/tem
|
|
|
4199
4203
|
|
|
4200
4204
|
#### Further reading
|
|
4201
4205
|
|
|
4202
|
-
For multi-user shader environments, see the [Multiplayer starter kit](https://tldraw.dev/starter-kits/multiplayer). To create custom shapes with advanced geometry and rendering, see [Shape utilities](https://tldraw.dev/docs/shapes#
|
|
4206
|
+
For multi-user shader environments, see the [Multiplayer starter kit](https://tldraw.dev/starter-kits/multiplayer). To create custom shapes with advanced geometry and rendering, see [Shape utilities](https://tldraw.dev/docs/shapes#Custom-shapes). For working with tldraw's reactive state system and event handling, see [Editor state management](https://tldraw.dev/docs/editor).
|
|
4203
4207
|
|
|
4204
4208
|
---
|
|
4205
4209
|
|
|
@@ -5433,7 +5437,7 @@ Custom metadata is validated and persisted alongside the standard user fields. A
|
|
|
5433
5437
|
| `createCachedUserResolve` | Create a cached resolve function for `TLUserStore` |
|
|
5434
5438
|
| `createUserRecordType` | Build a user record type with custom meta validators |
|
|
5435
5439
|
|
|
5436
|
-
For setting up user identity in multiplayer, see the [Collaboration](https://tldraw.dev/sdk-features/collaboration#
|
|
5440
|
+
For setting up user identity in multiplayer, see the [Collaboration](https://tldraw.dev/sdk-features/collaboration#User-identity) page.
|
|
5437
5441
|
|
|
5438
5442
|
#### Related examples
|
|
5439
5443
|
|
|
@@ -7576,7 +7580,7 @@ class MyShapeUtil extends ShapeUtil<MyShape> {
|
|
|
7576
7580
|
}
|
|
7577
7581
|
```
|
|
7578
7582
|
|
|
7579
|
-
Shapes whose util overrides `canCull` are subscribed to individually inside the culling derivation, so a `canCull` that reads many props re-runs the derivation more often. Shapes using the default fast path don't pay this cost. Disable culling only for shapes that need it: visual effects that extend past the bounds, shapes that measure their DOM, or animations that should keep running off-screen. See [Performance](https://tldraw.dev/sdk-features/performance#
|
|
7583
|
+
Shapes whose util overrides `canCull` are subscribed to individually inside the culling derivation, so a `canCull` that reads many props re-runs the derivation more often. Shapes using the default fast path don't pay this cost. Disable culling only for shapes that need it: visual effects that extend past the bounds, shapes that measure their DOM, or animations that should keep running off-screen. See [Performance](https://tldraw.dev/sdk-features/performance#Disable-culling-only-when-necessary) for guidance.
|
|
7580
7584
|
|
|
7581
7585
|
#### Related examples
|
|
7582
7586
|
|
|
@@ -7749,7 +7753,7 @@ export default function App() {
|
|
|
7749
7753
|
}
|
|
7750
7754
|
```
|
|
7751
7755
|
|
|
7752
|
-
Remote users' chat messages render as part of the collaborator cursor, in the DOM cursor layer. To customize how they appear, replace the `CollaboratorCursor` component. See [Cursors](https://tldraw.dev/sdk-features/cursors#
|
|
7756
|
+
Remote users' chat messages render as part of the collaborator cursor, in the DOM cursor layer. To customize how they appear, replace the `CollaboratorCursor` component. See [Cursors](https://tldraw.dev/sdk-features/cursors#Rendering-collaborator-cursors) for details.
|
|
7753
7757
|
|
|
7754
7758
|
#### Availability
|
|
7755
7759
|
|
|
@@ -8542,7 +8546,7 @@ const ConfiguredFrameUtil = FrameShapeUtil.configure({
|
|
|
8542
8546
|
})
|
|
8543
8547
|
```
|
|
8544
8548
|
|
|
8545
|
-
To build your own container shape that behaves like a frame, extend `BaseFrameLikeShapeUtil` rather than re-implementing every behavior on `FrameShapeUtil`. The base class provides defaults for clipping children, full-brush selection, blocking erasure from inside, and drag-and-drop reparenting — see [Shapes](https://tldraw.dev/sdk-features/shapes#
|
|
8549
|
+
To build your own container shape that behaves like a frame, extend `BaseFrameLikeShapeUtil` rather than re-implementing every behavior on `FrameShapeUtil`. The base class provides defaults for clipping children, full-brush selection, blocking erasure from inside, and drag-and-drop reparenting — see [Shapes](https://tldraw.dev/sdk-features/shapes#Frames) for details and the [portal shapes example](https://tldraw.dev/examples/shapes/tools/portal-shapes) for a working implementation.
|
|
8546
8550
|
|
|
8547
8551
|
##### Group
|
|
8548
8552
|
|
|
@@ -9155,8 +9159,8 @@ The geometry uses the processed stroke points (after applying streamline and smo
|
|
|
9155
9159
|
|
|
9156
9160
|
#### Related shapes
|
|
9157
9161
|
|
|
9158
|
-
- [Highlight](https://tldraw.dev/sdk-features/default-shapes#
|
|
9159
|
-
- [Line](https://tldraw.dev/sdk-features/default-shapes#
|
|
9162
|
+
- [Highlight](https://tldraw.dev/sdk-features/default-shapes#Highlight) uses the same point capture system but renders semi-transparently for marking up content
|
|
9163
|
+
- [Line](https://tldraw.dev/sdk-features/default-shapes#Line) creates editable multi-point lines with draggable handles
|
|
9160
9164
|
|
|
9161
9165
|
#### Related articles
|
|
9162
9166
|
|
|
@@ -9624,7 +9628,7 @@ editor.updateInstanceState({ isReadonly: true })
|
|
|
9624
9628
|
editor.updateInstanceState({ isToolLocked: true })
|
|
9625
9629
|
```
|
|
9626
9630
|
|
|
9627
|
-
See [Tools](https://tldraw.dev/sdk-features/tools#
|
|
9631
|
+
See [Tools](https://tldraw.dev/sdk-features/tools#Tool-lock) for more on tool lock.
|
|
9628
9632
|
|
|
9629
9633
|
Each page also has instance state (`TLInstancePageState`) tracking selection, hovered shape, and editing shape for that page:
|
|
9630
9634
|
|
|
@@ -9765,7 +9769,7 @@ The shape stores the original URL and renders the embed version.
|
|
|
9765
9769
|
|
|
9766
9770
|
#### Fallback to bookmarks
|
|
9767
9771
|
|
|
9768
|
-
When you paste a URL that no embed definition recognizes, the default URL handler creates a [bookmark shape](https://tldraw.dev/sdk-features/default-shapes#
|
|
9772
|
+
When you paste a URL that no embed definition recognizes, the default URL handler creates a [bookmark shape](https://tldraw.dev/sdk-features/default-shapes#Bookmark) instead of an embed. An existing embed shape whose URL doesn't match any definition still renders the URL in an iframe, using the stricter sandbox for unknown sources.
|
|
9769
9773
|
|
|
9770
9774
|
Use `getEmbedInfo` to check whether a URL is embeddable before creating a shape:
|
|
9771
9775
|
|
|
@@ -9899,7 +9903,7 @@ Embed shapes render as blank rectangles in SVG exports. The iframe content can't
|
|
|
9899
9903
|
#### Related articles
|
|
9900
9904
|
|
|
9901
9905
|
- [Default shapes](https://tldraw.dev/sdk-features/default-shapes) — Overview of all built-in shape types
|
|
9902
|
-
- [Bookmark shape](https://tldraw.dev/sdk-features/default-shapes#
|
|
9906
|
+
- [Bookmark shape](https://tldraw.dev/sdk-features/default-shapes#Bookmark) — URL link cards (fallback for non-embeddable URLs)
|
|
9903
9907
|
- [External content handling](https://tldraw.dev/sdk-features/external-content) — Handling pasted and dropped content
|
|
9904
9908
|
- [Custom embeds example](https://tldraw.dev/examples/configuration/custom-embed) — Add a custom embed definition for a new service
|
|
9905
9909
|
|
|
@@ -10856,7 +10860,7 @@ Empty names render as `Frame` so unnamed frames still get a label. The shape's `
|
|
|
10856
10860
|
|
|
10857
10861
|
Frames clip their children to the frame's rectangle during rendering. A shape that extends past the frame edge is rendered up to the boundary and then cut off. Clipping doesn't change the child's geometry or its own bounds, but hit testing respects the mask: you can't click the clipped-off part of a shape, and `Editor#getShapeMaskedPageBounds` returns only the visible portion. Arrows are exempt from clipping so connectors can leave a frame.
|
|
10858
10862
|
|
|
10859
|
-
The `BaseFrameLikeShapeUtil` base class implements clipping via `getClipPath` and the arrow exemption via `shouldClipChild`. If you need clipping for a custom container shape, see the [Frames](https://tldraw.dev/sdk-features/shapes#
|
|
10863
|
+
The `BaseFrameLikeShapeUtil` base class implements clipping via `getClipPath` and the arrow exemption via `shouldClipChild`. If you need clipping for a custom container shape, see the [Frames](https://tldraw.dev/sdk-features/shapes#Frames) section in the Shapes guide.
|
|
10860
10864
|
|
|
10861
10865
|
#### Shape properties
|
|
10862
10866
|
|
|
@@ -10948,8 +10952,8 @@ Reach for a frame when you want a labeled, bounded region: a slide, a screen, an
|
|
|
10948
10952
|
|
|
10949
10953
|
#### Related articles
|
|
10950
10954
|
|
|
10951
|
-
- [Shapes](https://tldraw.dev/sdk-features/shapes#
|
|
10952
|
-
- [Default shapes](https://tldraw.dev/sdk-features/default-shapes#
|
|
10955
|
+
- [Shapes](https://tldraw.dev/sdk-features/shapes#Frames) — How to build your own container shape with `BaseFrameLikeShapeUtil`
|
|
10956
|
+
- [Default shapes](https://tldraw.dev/sdk-features/default-shapes#Frame) — Overview of all built-in shapes
|
|
10953
10957
|
- [Shape clipping](https://tldraw.dev/sdk-features/shape-clipping) — How custom shapes can clip their children
|
|
10954
10958
|
- [Image export](https://tldraw.dev/sdk-features/image-export) — Exporting frames and selections as images
|
|
10955
10959
|
- [Parenting](https://tldraw.dev/sdk-features/parenting) — How shapes are nested inside containers
|
|
@@ -13214,7 +13218,7 @@ When tool lock is enabled, the current tool stays active after creating a shape
|
|
|
13214
13218
|
editor.updateInstanceState({ isToolLocked: true })
|
|
13215
13219
|
```
|
|
13216
13220
|
|
|
13217
|
-
Custom tools should check this property to decide whether to return to select after completing their action. See [Tools](https://tldraw.dev/sdk-features/tools#
|
|
13221
|
+
Custom tools should check this property to decide whether to return to select after completing their action. See [Tools](https://tldraw.dev/sdk-features/tools#Tool-lock) for implementation details.
|
|
13218
13222
|
|
|
13219
13223
|
##### Cursor customization
|
|
13220
13224
|
|
|
@@ -13273,7 +13277,7 @@ When you switch pages, the instance's `currentPageId` changes, but each page ret
|
|
|
13273
13277
|
- [Cursors](https://tldraw.dev/sdk-features/cursors) — Cursor types and rotation handling
|
|
13274
13278
|
- [Readonly mode](https://tldraw.dev/sdk-features/readonly) — Disable editing with `isReadonly`
|
|
13275
13279
|
- [Focus](https://tldraw.dev/sdk-features/focus) — Editor focus state with `isFocused`
|
|
13276
|
-
- [Tools](https://tldraw.dev/sdk-features/tools#
|
|
13280
|
+
- [Tools](https://tldraw.dev/sdk-features/tools#Tool-lock) — Tool lock behavior with `isToolLocked`
|
|
13277
13281
|
- [User preferences](https://tldraw.dev/sdk-features/user-preferences) — Global preferences that persist across editor instances
|
|
13278
13282
|
|
|
13279
13283
|
#### Related examples
|
|
@@ -13714,7 +13718,7 @@ Even with `ignoreShapeLock: true`, some behaviors remain unchanged: locked shape
|
|
|
13714
13718
|
|
|
13715
13719
|
Some shapes have interactive content that should remain usable even when locked. Embed shapes (YouTube videos, Figma files, interactive maps) are a good example: you might want the embed locked in place but still playable or navigable.
|
|
13716
13720
|
|
|
13717
|
-
[ShapeUtils](https://tldraw.dev/sdk-features/shapes#
|
|
13721
|
+
[ShapeUtils](https://tldraw.dev/sdk-features/shapes#ShapeUtil) can override `ShapeUtil#canEditWhileLocked` (default `false`) to allow editing interactions on locked shapes. The built-in embed shape returns `true` unless its embed definition says otherwise:
|
|
13718
13722
|
|
|
13719
13723
|
```typescript
|
|
13720
13724
|
class MyInteractiveShapeUtil extends ShapeUtil<MyShape> {
|
|
@@ -13848,7 +13852,7 @@ See the [note resizing example](https://tldraw.dev/examples/configuration/resize
|
|
|
13848
13852
|
|
|
13849
13853
|
#### Dynamic resize mode
|
|
13850
13854
|
|
|
13851
|
-
When `editor.user.getIsDynamicResizeMode()` is true, new notes are created at a scale inversely proportional to the current zoom level, so they stay visually consistent regardless of zoom. `Editor#getResizeScaleFactor` returns that scale. See [Text shape](https://tldraw.dev/sdk-features/text-shape#
|
|
13855
|
+
When `editor.user.getIsDynamicResizeMode()` is true, new notes are created at a scale inversely proportional to the current zoom level, so they stay visually consistent regardless of zoom. `Editor#getResizeScaleFactor` returns that scale. See [Text shape](https://tldraw.dev/sdk-features/text-shape#Dynamic-resize-mode) for details.
|
|
13852
13856
|
|
|
13853
13857
|
#### Related articles
|
|
13854
13858
|
|
|
@@ -13927,7 +13931,7 @@ Control when pointer movement becomes a drag operation:
|
|
|
13927
13931
|
| `uiDragDistanceSquared` | 16 | Distance² for UI element drag (4px) |
|
|
13928
13932
|
| `uiCoarseDragDistanceSquared` | 625 | Distance² for touch UI drag (25px) |
|
|
13929
13933
|
|
|
13930
|
-
Values are squared to avoid computing square roots during drag detection. The larger touch thresholds prevent accidental drags on mobile devices.
|
|
13934
|
+
Values are squared to avoid computing square roots during drag detection. The larger touch thresholds prevent accidental drags on mobile devices. The UI thresholds govern dragging a tool out of the toolbar. A drag starts once the pointer has left the toolbar, so they matter only for presses that begin near its edge.
|
|
13931
13935
|
|
|
13932
13936
|
##### Handle and hit testing
|
|
13933
13937
|
|
|
@@ -14181,7 +14185,7 @@ function App() {
|
|
|
14181
14185
|
}
|
|
14182
14186
|
```
|
|
14183
14187
|
|
|
14184
|
-
See [Embed shape](https://tldraw.dev/sdk-features/embed-shape#
|
|
14188
|
+
See [Embed shape](https://tldraw.dev/sdk-features/embed-shape#Custom-embed-definitions) for the full embed definition API.
|
|
14185
14189
|
|
|
14186
14190
|
##### Editor setup
|
|
14187
14191
|
|
|
@@ -18086,7 +18090,7 @@ Snapshots include schema version information. When you load a snapshot from an o
|
|
|
18086
18090
|
const migrated = editor.store.migrateSnapshot(oldSnapshot)
|
|
18087
18091
|
```
|
|
18088
18092
|
|
|
18089
|
-
The migration system handles schema changes between tldraw versions. You can also define migrations for custom shape props and custom record types. See [persistence](https://tldraw.dev/sdk-features/persistence#
|
|
18093
|
+
The migration system handles schema changes between tldraw versions. You can also define migrations for custom shape props and custom record types. See [persistence](https://tldraw.dev/sdk-features/persistence#Migrations) for details.
|
|
18090
18094
|
|
|
18091
18095
|
#### Queries
|
|
18092
18096
|
|
|
@@ -20446,7 +20450,7 @@ export default function App() {
|
|
|
20446
20450
|
|
|
20447
20451
|
Preferences cover visual settings (color scheme, animation speed), interaction settings (snap mode, edge scroll speed), and identity (user name, color, locale). By default the editor stores them in localStorage and syncs them across tabs with a BroadcastChannel.
|
|
20448
20452
|
|
|
20449
|
-
To supply preferences from your own auth or state instead, pass a `user` created with `useTldrawCurrentUser` (or `createTLCurrentUser`) to the `Tldraw` component. Preferences you provide this way are yours to persist and sync. See [Collaboration](https://tldraw.dev/sdk-features/collaboration#
|
|
20453
|
+
To supply preferences from your own auth or state instead, pass a `user` created with `useTldrawCurrentUser` (or `createTLCurrentUser`) to the `Tldraw` component. Preferences you provide this way are yours to persist and sync. See [Collaboration](https://tldraw.dev/sdk-features/collaboration#Integrating-with-useTldrawCurrentUser) for a full example.
|
|
20450
20454
|
|
|
20451
20455
|
#### Reading preferences
|
|
20452
20456
|
|
|
@@ -20527,7 +20531,7 @@ const isDark = editor.user.getIsDarkMode()
|
|
|
20527
20531
|
// true if colorScheme is 'dark', or 'system' with OS in dark mode
|
|
20528
20532
|
```
|
|
20529
20533
|
|
|
20530
|
-
The editor-level `colorScheme` prop sets the default color scheme. When a user preference is set, it takes priority over the prop. See [Themes](https://tldraw.dev/sdk-features/themes#
|
|
20534
|
+
The editor-level `colorScheme` prop sets the default color scheme. When a user preference is set, it takes priority over the prop. See [Themes](https://tldraw.dev/sdk-features/themes#Color-mode) for more.
|
|
20531
20535
|
|
|
20532
20536
|
#### Persistence and synchronization
|
|
20533
20537
|
|
|
@@ -20900,3 +20904,62 @@ While the tldraw SDK is [source available](https://github.com/tldraw/tldraw), it
|
|
|
20900
20904
|
If you wish to include tldraw in an open source project, you may do so but the SDK itself must remain under its original license. This means that you and your downstream users will require their own trial, commercial, or hobby license in order to use the SDK in production. In this case, please also see our [trademark guidelines](https://tldraw.dev/legal/trademark-guidelines) that limit the use of the tldraw name and branding.
|
|
20901
20905
|
|
|
20902
20906
|
The tldraw SDK is a product of a company. See [tldraw.dev](https://tldraw.dev/company) for more information about the company and the team.
|
|
20907
|
+
|
|
20908
|
+
### Dependencies
|
|
20909
|
+
|
|
20910
|
+
{/* This page is generated by `yarn license-report --prod`. Do not edit it by hand. */}
|
|
20911
|
+
|
|
20912
|
+
The tldraw SDK itself is published under the [tldraw license](https://tldraw.dev/legal/tldraw-license). It also depends on the third-party packages listed below, each under its own license.
|
|
20913
|
+
|
|
20914
|
+
This covers the runtime dependencies that the `@tldraw/*` packages declare directly. It does not include their own transitive dependencies, our development and build tooling, or anything in the tldraw.com application. If you need a full transitive list for the exact versions you have installed, generate one from your own lockfile.
|
|
20915
|
+
|
|
20916
|
+
#### Dependencies
|
|
20917
|
+
|
|
20918
|
+
| Dependency | Version | License | Used by |
|
|
20919
|
+
| ------------------------------------------------------------------- | ------- | ------- | -------------------------------------------- |
|
|
20920
|
+
| [@tiptap/core](https://github.com/ueberdosis/tiptap) | 3.13.0 | MIT | `commenting`, `editor`, `mentions`, `tldraw` |
|
|
20921
|
+
| [@tiptap/extension-code](https://github.com/ueberdosis/tiptap) | 3.13.0 | MIT | `tldraw` |
|
|
20922
|
+
| [@tiptap/extension-highlight](https://github.com/ueberdosis/tiptap) | 3.13.0 | MIT | `tldraw` |
|
|
20923
|
+
| [@tiptap/extension-list](https://github.com/ueberdosis/tiptap) | 3.13.0 | MIT | `tldraw` |
|
|
20924
|
+
| [@tiptap/extension-mention](https://github.com/ueberdosis/tiptap) | 3.13.0 | MIT | `mentions` |
|
|
20925
|
+
| [@tiptap/pm](https://github.com/ueberdosis/tiptap) | 3.13.0 | MIT | `commenting`, `editor`, `mentions`, `tldraw` |
|
|
20926
|
+
| [@tiptap/react](https://github.com/ueberdosis/tiptap) | 3.13.0 | MIT | `commenting`, `editor`, `mentions`, `tldraw` |
|
|
20927
|
+
| [@tiptap/starter-kit](https://github.com/ueberdosis/tiptap) | 3.13.0 | MIT | `tldraw` |
|
|
20928
|
+
| [@tiptap/suggestion](https://github.com/ueberdosis/tiptap) | 3.13.0 | MIT | `mentions` |
|
|
20929
|
+
| [classnames](https://github.com/JedWatson/classnames) | 2.5.1 | MIT | `editor`, `tldraw` |
|
|
20930
|
+
| [eventemitter3](https://github.com/primus/eventemitter3) | 4.0.7 | MIT | `editor` |
|
|
20931
|
+
| [idb](https://github.com/jakearchibald/idb) | 7.1.1 | ISC | `editor`, `tldraw` |
|
|
20932
|
+
| [is-plain-object](https://github.com/jonschlinkert/is-plain-object) | 5.0.0 | MIT | `editor` |
|
|
20933
|
+
| [lodash.isequal](https://github.com/lodash/lodash) | 4.5.0 | MIT | `utils` |
|
|
20934
|
+
| [lodash.isequalwith](https://github.com/lodash/lodash) | 4.4.0 | MIT | `utils` |
|
|
20935
|
+
| [lodash.throttle](https://github.com/lodash/lodash) | 4.1.1 | MIT | `utils` |
|
|
20936
|
+
| [lodash.uniq](https://github.com/lodash/lodash) | 4.5.0 | MIT | `utils` |
|
|
20937
|
+
| [lz-string](https://github.com/pieroxy/lz-string) | 1.5.0 | MIT | `tldraw` |
|
|
20938
|
+
| [mermaid](https://github.com/mermaid-js/mermaid) | 11.16.1 | MIT | `mermaid` |
|
|
20939
|
+
| [nanoevents](https://github.com/ai/nanoevents) | 7.0.1 | MIT | `sync`, `sync-core` |
|
|
20940
|
+
| [radix-ui](https://github.com/radix-ui/primitives) | 1.4.2 | MIT | `tldraw` |
|
|
20941
|
+
| [rbush](https://github.com/mourner/rbush) | 3.0.1 | MIT | `editor` |
|
|
20942
|
+
| [ws](https://github.com/websockets/ws) | 8.21.0 | MIT | `sync`, `sync-core` |
|
|
20943
|
+
|
|
20944
|
+
#### Inline code
|
|
20945
|
+
|
|
20946
|
+
Some third-party code is included directly in our source rather than as a dependency. Each of these files carries its license in a comment at the top.
|
|
20947
|
+
|
|
20948
|
+
| File | License | Copyright |
|
|
20949
|
+
| ---------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------ |
|
|
20950
|
+
| `packages/create-tldraw/src/group-select.ts` | [MIT](https://github.com/bombshell-dev/clack/blob/1adb270af5509ead3d22c4fa602b465f39c7a8c2/packages/prompts/LICENSE) | Nate Moore |
|
|
20951
|
+
| `packages/create-tldraw/src/wrap-ansi.ts` | [MIT](https://github.com/chalk/wrap-ansi/blob/163b878a6eb5d8c32b7bbea65036eeadc0e4def9/license) | Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com) |
|
|
20952
|
+
| `packages/editor/src/lib/hooks/useScreenBounds.ts` | [MIT](https://github.com/excalidraw/excalidraw/blob/master/LICENSE) | |
|
|
20953
|
+
| `packages/editor/src/lib/hooks/useViewportHeight.ts` | [BSD](https://github.com/outline/rich-markdown-editor/blob/main/LICENSE) | 2020 General Outline, Inc (https://www.getoutline.com/) and individual contributors. |
|
|
20954
|
+
| `packages/editor/src/lib/utils/browserCanvasMaxSize.ts` | [MIT](https://github.com/jhildenbiddle/canvas-size/blob/master/LICENSE) | John Hildenbiddle |
|
|
20955
|
+
| `packages/store/src/lib/ImmutableMap.ts` | [MIT](https://github.com/immutable-js/immutable-js/blob/main/LICENSE) | 2014-present, Lee Byron and other contributors. |
|
|
20956
|
+
| `packages/tldraw/src/lib/shapes/shared/PathBuilder.tsx` | [Apache](https://github.com/adobe-webplatform/Snap.svg/blob/master/LICENSE) | |
|
|
20957
|
+
| `packages/tldraw/src/lib/ui/hooks/useKeyboardShortcuts.ts` | [MIT](https://github.com/jaywcjlove/hotkeys-js/blob/master/LICENSE) | 2015-present, Kenny Wong |
|
|
20958
|
+
| `packages/tldraw/src/lib/ui/kbd-utils.ts` | [MIT](https://github.com/jaywcjlove/hotkeys-js/blob/master/LICENSE) | 2015-present, Kenny Wong |
|
|
20959
|
+
| `packages/tldraw/src/lib/utils/svg/sanitizeSvg.ts` | MIT | 2015 Mario Heiderich |
|
|
20960
|
+
| `packages/utils/src/lib/bind.ts` | [MIT](https://github.com/NoHomey/bind-decorator/blob/master/License) | 2016 Ivo Stratev |
|
|
20961
|
+
| `packages/utils/src/lib/id.ts` | [MIT](https://github.com/ai/nanoid/blob/main/LICENSE) | 2017 Andrey Sitnik <andrey@sitnik.ru> |
|
|
20962
|
+
| `packages/utils/src/lib/media/apng.ts` | [MIT](https://github.com/vHeemstra/is-apng/blob/main/license) | Philip van Heemstra |
|
|
20963
|
+
| `packages/utils/src/lib/media/gif.ts` | MIT | 2016 Józef Sokołowski <j.k.sokolowski@gmail.com> |
|
|
20964
|
+
| `packages/utils/src/lib/media/png.ts` | [MIT](https://github.com/alexgorbatchev/crc/blob/master/LICENSE) | 2014 Alex Gorbatchev |
|
|
20965
|
+
| `packages/utils/src/lib/media/webp.ts` | [MIT](https://github.com/sindresorhus/is-webp/blob/main/license) | Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com) |
|
package/RELEASE_NOTES.md
CHANGED
|
@@ -1,23 +1,9 @@
|
|
|
1
1
|
# Releases
|
|
2
2
|
|
|
3
|
-
Version: `5.
|
|
3
|
+
Version: `5.5.0-canary.0241f11f2e99`
|
|
4
4
|
|
|
5
5
|
This file is generated during package publishing from the tldraw release notes content for this exact package version.
|
|
6
6
|
|
|
7
|
-
## v5.4.2
|
|
8
|
-
|
|
9
|
-
So far this release is a set of fixes: camera coasting and edge scrolling now move at the same rate on high-refresh displays, rotated images stay put when a crop changes their size, and embed hostname matching no longer trusts lookalike hosts.
|
|
10
|
-
|
|
11
|
-
### Bug fixes
|
|
12
|
-
|
|
13
|
-
- Fix camera coasting after a fling, and edge scrolling, running roughly twice as fast on a 120 Hz display as on a 60 Hz one. Both now scale by the elapsed tick time, so motion per second is the same at any refresh rate. ([#10501](https://github.com/tldraw/tldraw/pull/10501))
|
|
14
|
-
- Fix rotated images jumping on the canvas when their aspect ratio or crop zoom changed, or when the image was replaced. ([#10233](https://github.com/tldraw/tldraw/pull/10233))
|
|
15
|
-
- Fix embed hostname matching trusting lookalike hosts such as `tldraw.com.evil.io`, which were rendered with the matched definition's relaxed iframe permissions. A host must now be the pattern itself or a subdomain of it. ([#10196](https://github.com/tldraw/tldraw/pull/10196))
|
|
16
|
-
- Fix geometry hit tests, nearest-point, and length calculations losing precision after a shape's SVG path data was generated. `getSvgPathData` rounded the geometry's stored points to two decimals in place, and geometries are cached per shape, so every later calculation used the rounded points. ([#10600](https://github.com/tldraw/tldraw/pull/10600))
|
|
17
|
-
- Fix keyboard shape navigation, and `Editor.selectAdjacentShape('prev')`, selecting the second-to-last shape instead of the last one when nothing is selected. ([#10601](https://github.com/tldraw/tldraw/pull/10601))
|
|
18
|
-
- Fix `Editor.getCurrentTheme()` returning `undefined` after `setCurrentTheme()` was called with an unregistered theme id. The call is now rejected and the current theme is kept. ([#10602](https://github.com/tldraw/tldraw/pull/10602))
|
|
19
|
-
- Fix `Group2d.transform` dropping its ignored children, resetting the `isInternal`, `excludeFromShapeBounds`, and `isEmptyLabel` flags, and discarding its `opts` argument. It now matches the base `Geometry2d.transform` signature. ([#10603](https://github.com/tldraw/tldraw/pull/10603))
|
|
20
|
-
|
|
21
7
|
## v5.4.0
|
|
22
8
|
|
|
23
9
|
[View on GitHub](https://github.com/tldraw/tldraw/releases/tag/v5.4.0)
|
|
@@ -191,6 +177,16 @@ This release adds a `center` operation to `Editor.alignShapes`, a `tleditors` re
|
|
|
191
177
|
- Fix the `store.query.ids()` query creator being called with a computed's `(previousValue, epoch)` arguments. ([#10218](https://github.com/tldraw/tldraw/pull/10218))
|
|
192
178
|
- Fix `CollectionDiff`s from `store.query.ids()` and `index()` containing an empty `added` or `removed` set after an add/remove round trip. ([#10221](https://github.com/tldraw/tldraw/pull/10221))
|
|
193
179
|
|
|
180
|
+
---
|
|
181
|
+
|
|
182
|
+
### Patch releases
|
|
183
|
+
|
|
184
|
+
#### v5.4.1
|
|
185
|
+
|
|
186
|
+
- Fix the context menu not reopening after a left-click dismissal when radix-ui 1.5 or later is installed. ([#10567](https://github.com/tldraw/tldraw/pull/10567))
|
|
187
|
+
|
|
188
|
+
[View release on GitHub](https://github.com/tldraw/tldraw/releases/tag/v5.4.1)
|
|
189
|
+
|
|
194
190
|
## v5.3.0
|
|
195
191
|
|
|
196
192
|
[View on GitHub](https://github.com/tldraw/tldraw/releases/tag/v5.3.0)
|
|
@@ -1401,7 +1397,7 @@ declare module 'tldraw' {
|
|
|
1401
1397
|
type MyBinding = TLBinding`<'my-binding'>`
|
|
1402
1398
|
```
|
|
1403
1399
|
|
|
1404
|
-
See the [Custom Shapes Guide](https://tldraw.dev/docs/shapes#
|
|
1400
|
+
See the [Custom Shapes Guide](https://tldraw.dev/docs/shapes#Custom-shapes) and the [Pin Bindings example](https://github.com/tldraw/tldraw/tree/main/apps/examples/src/examples/shapes/tools/pin-bindings) for details.
|
|
1405
1401
|
|
|
1406
1402
|
**After registering, remove the `TLBaseShape` import** — it's no longer used and will trip lint rules that flag unused imports.
|
|
1407
1403
|
|
package/dist-cjs/index.js
CHANGED
|
@@ -653,7 +653,7 @@ var import_buildFromV1Document = require("./lib/utils/tldr/buildFromV1Document")
|
|
|
653
653
|
var import_file = require("./lib/utils/tldr/file");
|
|
654
654
|
(0, import_editor.registerTldrawLibraryVersion)(
|
|
655
655
|
"tldraw",
|
|
656
|
-
"5.
|
|
656
|
+
"5.5.0-canary.0241f11f2e99",
|
|
657
657
|
"cjs"
|
|
658
658
|
);
|
|
659
659
|
//# sourceMappingURL=index.js.map
|
|
@@ -103,8 +103,13 @@ class Drawing extends import_editor.StateNode {
|
|
|
103
103
|
break;
|
|
104
104
|
}
|
|
105
105
|
case "starting_straight": {
|
|
106
|
-
this.
|
|
107
|
-
|
|
106
|
+
const shape = this.initialShape && this.editor.getShape(this.initialShape.id);
|
|
107
|
+
if (shape && (0, import_editor.last)(shape.props.segments)?.type === "straight") {
|
|
108
|
+
this.segmentMode = "starting_free";
|
|
109
|
+
} else {
|
|
110
|
+
this.pagePointWhereNextSegmentChanged = null;
|
|
111
|
+
this.segmentMode = "free";
|
|
112
|
+
}
|
|
108
113
|
break;
|
|
109
114
|
}
|
|
110
115
|
}
|