tldraw 3.16.0-canary.ffdf566dd0a8 → 3.16.0-internal.a478398270c6
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 +19 -125
- package/dist-cjs/index.js +2 -19
- package/dist-cjs/index.js.map +2 -2
- package/dist-cjs/lib/TldrawImage.js +2 -5
- package/dist-cjs/lib/TldrawImage.js.map +3 -3
- package/dist-cjs/lib/canvas/TldrawCropHandles.js +1 -1
- package/dist-cjs/lib/canvas/TldrawCropHandles.js.map +2 -2
- package/dist-cjs/lib/canvas/TldrawHandles.js +1 -1
- package/dist-cjs/lib/canvas/TldrawHandles.js.map +2 -2
- package/dist-cjs/lib/canvas/TldrawOverlays.js +1 -1
- package/dist-cjs/lib/canvas/TldrawOverlays.js.map +2 -2
- package/dist-cjs/lib/canvas/TldrawSelectionForeground.js +271 -279
- package/dist-cjs/lib/canvas/TldrawSelectionForeground.js.map +2 -2
- package/dist-cjs/lib/defaultExternalContentHandlers.js +0 -1
- package/dist-cjs/lib/defaultExternalContentHandlers.js.map +2 -2
- package/dist-cjs/lib/shapes/arrow/ArrowShapeUtil.js +41 -24
- package/dist-cjs/lib/shapes/arrow/ArrowShapeUtil.js.map +2 -2
- package/dist-cjs/lib/shapes/arrow/arrowLabel.js +4 -16
- package/dist-cjs/lib/shapes/arrow/arrowLabel.js.map +2 -2
- package/dist-cjs/lib/shapes/arrow/arrowTargetState.js +1 -1
- package/dist-cjs/lib/shapes/arrow/arrowTargetState.js.map +2 -2
- package/dist-cjs/lib/shapes/arrow/toolStates/Pointing.js +0 -3
- package/dist-cjs/lib/shapes/arrow/toolStates/Pointing.js.map +2 -2
- package/dist-cjs/lib/shapes/draw/DrawShapeUtil.js +3 -0
- package/dist-cjs/lib/shapes/draw/DrawShapeUtil.js.map +2 -2
- package/dist-cjs/lib/shapes/frame/FrameShapeUtil.js +5 -5
- package/dist-cjs/lib/shapes/frame/FrameShapeUtil.js.map +2 -2
- package/dist-cjs/lib/shapes/highlight/HighlightShapeUtil.js +3 -0
- package/dist-cjs/lib/shapes/highlight/HighlightShapeUtil.js.map +2 -2
- package/dist-cjs/lib/shapes/line/LineShapeUtil.js +4 -15
- 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/shared/PathBuilder.js +3 -21
- package/dist-cjs/lib/shapes/shared/PathBuilder.js.map +2 -2
- package/dist-cjs/lib/shapes/shared/PlainTextLabel.js +0 -1
- package/dist-cjs/lib/shapes/shared/PlainTextLabel.js.map +2 -2
- package/dist-cjs/lib/shapes/shared/RichTextLabel.js +2 -5
- package/dist-cjs/lib/shapes/shared/RichTextLabel.js.map +2 -2
- package/dist-cjs/lib/shapes/shared/SvgTextLabel.js +3 -4
- package/dist-cjs/lib/shapes/shared/SvgTextLabel.js.map +2 -2
- package/dist-cjs/lib/shapes/shared/usePrefersReducedMotion.js +1 -10
- package/dist-cjs/lib/shapes/shared/usePrefersReducedMotion.js.map +2 -2
- package/dist-cjs/lib/shapes/text/TextShapeUtil.js +11 -5
- package/dist-cjs/lib/shapes/text/TextShapeUtil.js.map +2 -2
- package/dist-cjs/lib/styles.js.map +2 -2
- package/dist-cjs/lib/tools/SelectTool/childStates/Crop/children/PointingCrop.js +1 -7
- package/dist-cjs/lib/tools/SelectTool/childStates/Crop/children/PointingCrop.js.map +2 -2
- package/dist-cjs/lib/tools/SelectTool/childStates/DraggingHandle.js +22 -43
- package/dist-cjs/lib/tools/SelectTool/childStates/DraggingHandle.js.map +2 -2
- package/dist-cjs/lib/tools/SelectTool/childStates/Idle.js +15 -2
- package/dist-cjs/lib/tools/SelectTool/childStates/Idle.js.map +2 -2
- package/dist-cjs/lib/tools/SelectTool/childStates/PointingShape.js +0 -5
- package/dist-cjs/lib/tools/SelectTool/childStates/PointingShape.js.map +2 -2
- package/dist-cjs/lib/tools/SelectTool/childStates/Resizing.js +0 -8
- package/dist-cjs/lib/tools/SelectTool/childStates/Resizing.js.map +2 -2
- package/dist-cjs/lib/tools/SelectTool/childStates/Rotating.js +0 -8
- package/dist-cjs/lib/tools/SelectTool/childStates/Rotating.js.map +2 -2
- package/dist-cjs/lib/tools/SelectTool/childStates/Translating.js +0 -8
- package/dist-cjs/lib/tools/SelectTool/childStates/Translating.js.map +2 -2
- package/dist-cjs/lib/tools/selection-logic/getHitShapeOnCanvasPointerDown.js.map +2 -2
- package/dist-cjs/lib/ui/assetUrls.js +13 -10
- package/dist-cjs/lib/ui/assetUrls.js.map +2 -2
- package/dist-cjs/lib/ui/components/A11y.js +12 -14
- package/dist-cjs/lib/ui/components/A11y.js.map +2 -2
- package/dist-cjs/lib/ui/components/KeyboardShortcutsDialog/DefaultKeyboardShortcutsDialogContent.js +1 -51
- package/dist-cjs/lib/ui/components/KeyboardShortcutsDialog/DefaultKeyboardShortcutsDialogContent.js.map +2 -2
- package/dist-cjs/lib/ui/components/MainMenu/DefaultMainMenuContent.js +2 -3
- package/dist-cjs/lib/ui/components/MainMenu/DefaultMainMenuContent.js.map +2 -2
- package/dist-cjs/lib/ui/components/NavigationPanel/DefaultNavigationPanel.js +4 -3
- package/dist-cjs/lib/ui/components/NavigationPanel/DefaultNavigationPanel.js.map +2 -2
- package/dist-cjs/lib/ui/components/Spinner.js +25 -2
- package/dist-cjs/lib/ui/components/Spinner.js.map +2 -2
- package/dist-cjs/lib/ui/components/StylePanel/DefaultStylePanel.js +0 -2
- package/dist-cjs/lib/ui/components/StylePanel/DefaultStylePanel.js.map +2 -2
- package/dist-cjs/lib/ui/components/StylePanel/DefaultStylePanelContent.js +136 -168
- package/dist-cjs/lib/ui/components/StylePanel/DefaultStylePanelContent.js.map +2 -2
- package/dist-cjs/lib/ui/components/Toolbar/DefaultImageToolbar.js +7 -21
- package/dist-cjs/lib/ui/components/Toolbar/DefaultImageToolbar.js.map +3 -3
- package/dist-cjs/lib/ui/components/Toolbar/OverflowingToolbar.js +3 -3
- package/dist-cjs/lib/ui/components/Toolbar/OverflowingToolbar.js.map +2 -2
- package/dist-cjs/lib/ui/components/Toolbar/ToggleToolLockedButton.js +2 -3
- package/dist-cjs/lib/ui/components/Toolbar/ToggleToolLockedButton.js.map +2 -2
- package/dist-cjs/lib/ui/components/menu-items.js +0 -22
- package/dist-cjs/lib/ui/components/menu-items.js.map +2 -2
- package/dist-cjs/lib/ui/components/primitives/Button/TldrawUiButtonIcon.js.map +2 -2
- package/dist-cjs/lib/ui/components/primitives/TldrawUiButtonPicker.js +0 -2
- package/dist-cjs/lib/ui/components/primitives/TldrawUiButtonPicker.js.map +2 -2
- package/dist-cjs/lib/ui/components/primitives/TldrawUiDialog.js +1 -1
- package/dist-cjs/lib/ui/components/primitives/TldrawUiDialog.js.map +2 -2
- package/dist-cjs/lib/ui/components/primitives/TldrawUiIcon.js +1 -35
- package/dist-cjs/lib/ui/components/primitives/TldrawUiIcon.js.map +2 -2
- package/dist-cjs/lib/ui/components/primitives/TldrawUiSlider.js +2 -6
- package/dist-cjs/lib/ui/components/primitives/TldrawUiSlider.js.map +2 -2
- package/dist-cjs/lib/ui/components/primitives/TldrawUiToolbar.js +3 -12
- package/dist-cjs/lib/ui/components/primitives/TldrawUiToolbar.js.map +2 -2
- package/dist-cjs/lib/ui/components/primitives/menus/TldrawUiMenuCheckboxItem.js.map +2 -2
- package/dist-cjs/lib/ui/components/primitives/menus/TldrawUiMenuItem.js +2 -0
- package/dist-cjs/lib/ui/components/primitives/menus/TldrawUiMenuItem.js.map +2 -2
- package/dist-cjs/lib/ui/context/TldrawUiContextProvider.js +2 -3
- package/dist-cjs/lib/ui/context/TldrawUiContextProvider.js.map +2 -2
- package/dist-cjs/lib/ui/context/actions.js +8 -57
- package/dist-cjs/lib/ui/context/actions.js.map +2 -2
- package/dist-cjs/lib/ui/context/events.js.map +2 -2
- package/dist-cjs/lib/ui/hooks/menu-hooks.js.map +2 -2
- package/dist-cjs/lib/ui/hooks/useKeyboardShortcuts.js +2 -2
- package/dist-cjs/lib/ui/hooks/useKeyboardShortcuts.js.map +2 -2
- package/dist-cjs/lib/ui/hooks/useTools.js.map +2 -2
- package/dist-cjs/lib/ui/hooks/useTranslation/TLUiTranslationKey.js.map +1 -1
- package/dist-cjs/lib/ui/hooks/useTranslation/defaultTranslation.js +0 -11
- package/dist-cjs/lib/ui/hooks/useTranslation/defaultTranslation.js.map +2 -2
- package/dist-cjs/lib/ui/kbd-utils.js +1 -2
- package/dist-cjs/lib/ui/kbd-utils.js.map +2 -2
- package/dist-cjs/lib/ui/version.js +3 -3
- package/dist-cjs/lib/ui/version.js.map +1 -1
- package/dist-cjs/lib/utils/excalidraw/putExcalidrawContent.js +1 -1
- package/dist-cjs/lib/utils/excalidraw/putExcalidrawContent.js.map +2 -2
- package/dist-cjs/lib/utils/tldr/buildFromV1Document.js +2 -3
- package/dist-cjs/lib/utils/tldr/buildFromV1Document.js.map +2 -2
- package/dist-esm/index.d.mts +19 -125
- package/dist-esm/index.mjs +4 -33
- package/dist-esm/index.mjs.map +2 -2
- package/dist-esm/lib/TldrawImage.mjs +2 -5
- package/dist-esm/lib/TldrawImage.mjs.map +2 -2
- package/dist-esm/lib/canvas/TldrawCropHandles.mjs +1 -1
- package/dist-esm/lib/canvas/TldrawCropHandles.mjs.map +2 -2
- package/dist-esm/lib/canvas/TldrawHandles.mjs +1 -1
- package/dist-esm/lib/canvas/TldrawHandles.mjs.map +2 -2
- package/dist-esm/lib/canvas/TldrawOverlays.mjs +1 -1
- package/dist-esm/lib/canvas/TldrawOverlays.mjs.map +2 -2
- package/dist-esm/lib/canvas/TldrawSelectionForeground.mjs +271 -279
- package/dist-esm/lib/canvas/TldrawSelectionForeground.mjs.map +2 -2
- package/dist-esm/lib/defaultExternalContentHandlers.mjs +0 -1
- package/dist-esm/lib/defaultExternalContentHandlers.mjs.map +2 -2
- package/dist-esm/lib/shapes/arrow/ArrowShapeUtil.mjs +41 -26
- package/dist-esm/lib/shapes/arrow/ArrowShapeUtil.mjs.map +2 -2
- package/dist-esm/lib/shapes/arrow/arrowLabel.mjs +5 -19
- package/dist-esm/lib/shapes/arrow/arrowLabel.mjs.map +2 -2
- package/dist-esm/lib/shapes/arrow/arrowTargetState.mjs +1 -1
- package/dist-esm/lib/shapes/arrow/arrowTargetState.mjs.map +2 -2
- package/dist-esm/lib/shapes/arrow/toolStates/Pointing.mjs +0 -3
- package/dist-esm/lib/shapes/arrow/toolStates/Pointing.mjs.map +2 -2
- package/dist-esm/lib/shapes/draw/DrawShapeUtil.mjs +3 -0
- package/dist-esm/lib/shapes/draw/DrawShapeUtil.mjs.map +2 -2
- package/dist-esm/lib/shapes/frame/FrameShapeUtil.mjs +5 -5
- package/dist-esm/lib/shapes/frame/FrameShapeUtil.mjs.map +2 -2
- package/dist-esm/lib/shapes/highlight/HighlightShapeUtil.mjs +3 -0
- package/dist-esm/lib/shapes/highlight/HighlightShapeUtil.mjs.map +2 -2
- package/dist-esm/lib/shapes/line/LineShapeUtil.mjs +4 -15
- package/dist-esm/lib/shapes/line/LineShapeUtil.mjs.map +2 -2
- package/dist-esm/lib/shapes/note/NoteShapeUtil.mjs +1 -2
- package/dist-esm/lib/shapes/note/NoteShapeUtil.mjs.map +2 -2
- package/dist-esm/lib/shapes/shared/PathBuilder.mjs +3 -22
- package/dist-esm/lib/shapes/shared/PathBuilder.mjs.map +2 -2
- package/dist-esm/lib/shapes/shared/PlainTextLabel.mjs +0 -1
- package/dist-esm/lib/shapes/shared/PlainTextLabel.mjs.map +2 -2
- package/dist-esm/lib/shapes/shared/RichTextLabel.mjs +2 -5
- package/dist-esm/lib/shapes/shared/RichTextLabel.mjs.map +2 -2
- package/dist-esm/lib/shapes/shared/SvgTextLabel.mjs +3 -4
- package/dist-esm/lib/shapes/shared/SvgTextLabel.mjs.map +2 -2
- package/dist-esm/lib/shapes/shared/usePrefersReducedMotion.mjs +1 -10
- package/dist-esm/lib/shapes/shared/usePrefersReducedMotion.mjs.map +2 -2
- package/dist-esm/lib/shapes/text/TextShapeUtil.mjs +11 -5
- package/dist-esm/lib/shapes/text/TextShapeUtil.mjs.map +2 -2
- package/dist-esm/lib/styles.mjs.map +2 -2
- package/dist-esm/lib/tools/SelectTool/childStates/Crop/children/PointingCrop.mjs +1 -7
- package/dist-esm/lib/tools/SelectTool/childStates/Crop/children/PointingCrop.mjs.map +2 -2
- package/dist-esm/lib/tools/SelectTool/childStates/DraggingHandle.mjs +22 -43
- package/dist-esm/lib/tools/SelectTool/childStates/DraggingHandle.mjs.map +2 -2
- package/dist-esm/lib/tools/SelectTool/childStates/Idle.mjs +15 -2
- package/dist-esm/lib/tools/SelectTool/childStates/Idle.mjs.map +2 -2
- package/dist-esm/lib/tools/SelectTool/childStates/PointingShape.mjs +0 -5
- package/dist-esm/lib/tools/SelectTool/childStates/PointingShape.mjs.map +2 -2
- package/dist-esm/lib/tools/SelectTool/childStates/Resizing.mjs +0 -8
- package/dist-esm/lib/tools/SelectTool/childStates/Resizing.mjs.map +2 -2
- package/dist-esm/lib/tools/SelectTool/childStates/Rotating.mjs +0 -8
- package/dist-esm/lib/tools/SelectTool/childStates/Rotating.mjs.map +2 -2
- package/dist-esm/lib/tools/SelectTool/childStates/Translating.mjs +0 -8
- package/dist-esm/lib/tools/SelectTool/childStates/Translating.mjs.map +2 -2
- package/dist-esm/lib/tools/selection-logic/getHitShapeOnCanvasPointerDown.mjs.map +2 -2
- package/dist-esm/lib/ui/assetUrls.mjs +13 -10
- package/dist-esm/lib/ui/assetUrls.mjs.map +2 -2
- package/dist-esm/lib/ui/components/A11y.mjs +12 -14
- package/dist-esm/lib/ui/components/A11y.mjs.map +2 -2
- package/dist-esm/lib/ui/components/KeyboardShortcutsDialog/DefaultKeyboardShortcutsDialogContent.mjs +1 -51
- package/dist-esm/lib/ui/components/KeyboardShortcutsDialog/DefaultKeyboardShortcutsDialogContent.mjs.map +2 -2
- package/dist-esm/lib/ui/components/MainMenu/DefaultMainMenuContent.mjs +3 -3
- package/dist-esm/lib/ui/components/MainMenu/DefaultMainMenuContent.mjs.map +2 -2
- package/dist-esm/lib/ui/components/NavigationPanel/DefaultNavigationPanel.mjs +4 -3
- package/dist-esm/lib/ui/components/NavigationPanel/DefaultNavigationPanel.mjs.map +2 -2
- package/dist-esm/lib/ui/components/Spinner.mjs +26 -3
- package/dist-esm/lib/ui/components/Spinner.mjs.map +2 -2
- package/dist-esm/lib/ui/components/StylePanel/DefaultStylePanel.mjs +1 -3
- package/dist-esm/lib/ui/components/StylePanel/DefaultStylePanel.mjs.map +2 -2
- package/dist-esm/lib/ui/components/StylePanel/DefaultStylePanelContent.mjs +136 -168
- package/dist-esm/lib/ui/components/StylePanel/DefaultStylePanelContent.mjs.map +2 -2
- package/dist-esm/lib/ui/components/Toolbar/DefaultImageToolbar.mjs +9 -23
- package/dist-esm/lib/ui/components/Toolbar/DefaultImageToolbar.mjs.map +3 -3
- package/dist-esm/lib/ui/components/Toolbar/OverflowingToolbar.mjs +3 -3
- package/dist-esm/lib/ui/components/Toolbar/OverflowingToolbar.mjs.map +2 -2
- package/dist-esm/lib/ui/components/Toolbar/ToggleToolLockedButton.mjs +2 -3
- package/dist-esm/lib/ui/components/Toolbar/ToggleToolLockedButton.mjs.map +2 -2
- package/dist-esm/lib/ui/components/menu-items.mjs +0 -22
- package/dist-esm/lib/ui/components/menu-items.mjs.map +2 -2
- package/dist-esm/lib/ui/components/primitives/Button/TldrawUiButtonIcon.mjs.map +2 -2
- package/dist-esm/lib/ui/components/primitives/TldrawUiButtonPicker.mjs +0 -2
- package/dist-esm/lib/ui/components/primitives/TldrawUiButtonPicker.mjs.map +2 -2
- package/dist-esm/lib/ui/components/primitives/TldrawUiDialog.mjs +1 -1
- package/dist-esm/lib/ui/components/primitives/TldrawUiDialog.mjs.map +2 -2
- package/dist-esm/lib/ui/components/primitives/TldrawUiIcon.mjs +2 -36
- package/dist-esm/lib/ui/components/primitives/TldrawUiIcon.mjs.map +2 -2
- package/dist-esm/lib/ui/components/primitives/TldrawUiSlider.mjs +2 -6
- package/dist-esm/lib/ui/components/primitives/TldrawUiSlider.mjs.map +2 -2
- package/dist-esm/lib/ui/components/primitives/TldrawUiToolbar.mjs +3 -12
- package/dist-esm/lib/ui/components/primitives/TldrawUiToolbar.mjs.map +2 -2
- package/dist-esm/lib/ui/components/primitives/menus/TldrawUiMenuCheckboxItem.mjs.map +2 -2
- package/dist-esm/lib/ui/components/primitives/menus/TldrawUiMenuItem.mjs +2 -0
- package/dist-esm/lib/ui/components/primitives/menus/TldrawUiMenuItem.mjs.map +2 -2
- package/dist-esm/lib/ui/context/TldrawUiContextProvider.mjs +2 -3
- package/dist-esm/lib/ui/context/TldrawUiContextProvider.mjs.map +2 -2
- package/dist-esm/lib/ui/context/actions.mjs +8 -57
- package/dist-esm/lib/ui/context/actions.mjs.map +2 -2
- package/dist-esm/lib/ui/context/events.mjs.map +2 -2
- package/dist-esm/lib/ui/hooks/menu-hooks.mjs.map +2 -2
- package/dist-esm/lib/ui/hooks/useKeyboardShortcuts.mjs +2 -2
- package/dist-esm/lib/ui/hooks/useKeyboardShortcuts.mjs.map +2 -2
- package/dist-esm/lib/ui/hooks/useTools.mjs.map +2 -2
- package/dist-esm/lib/ui/hooks/useTranslation/defaultTranslation.mjs +0 -11
- package/dist-esm/lib/ui/hooks/useTranslation/defaultTranslation.mjs.map +2 -2
- package/dist-esm/lib/ui/kbd-utils.mjs +1 -2
- package/dist-esm/lib/ui/kbd-utils.mjs.map +2 -2
- package/dist-esm/lib/ui/version.mjs +3 -3
- package/dist-esm/lib/ui/version.mjs.map +1 -1
- package/dist-esm/lib/utils/excalidraw/putExcalidrawContent.mjs +1 -1
- package/dist-esm/lib/utils/excalidraw/putExcalidrawContent.mjs.map +2 -2
- package/dist-esm/lib/utils/tldr/buildFromV1Document.mjs +2 -3
- package/dist-esm/lib/utils/tldr/buildFromV1Document.mjs.map +2 -2
- package/package.json +3 -4
- package/src/index.ts +2 -24
- package/src/lib/TldrawImage.tsx +2 -6
- package/src/lib/canvas/TldrawCropHandles.tsx +1 -3
- package/src/lib/canvas/TldrawHandles.tsx +1 -5
- package/src/lib/canvas/TldrawOverlays.tsx +1 -1
- package/src/lib/canvas/TldrawSelectionForeground.tsx +1 -5
- package/src/lib/defaultExternalContentHandlers.ts +1 -2
- package/src/lib/shapes/arrow/ArrowShapeUtil.test.ts +5 -5
- package/src/lib/shapes/arrow/ArrowShapeUtil.tsx +43 -26
- package/src/lib/shapes/arrow/arrowLabel.ts +3 -23
- package/src/lib/shapes/arrow/arrowTargetState.ts +1 -2
- package/src/lib/shapes/arrow/toolStates/Pointing.tsx +0 -3
- package/src/lib/shapes/draw/DrawShapeUtil.tsx +4 -0
- package/src/lib/shapes/frame/FrameShapeUtil.tsx +7 -5
- package/src/lib/shapes/highlight/HighlightShapeUtil.tsx +3 -0
- package/src/lib/shapes/line/LineShapeUtil.tsx +5 -19
- package/src/lib/shapes/note/NoteShapeUtil.tsx +0 -1
- package/src/lib/shapes/shared/PathBuilder.test.tsx +1 -1
- package/src/lib/shapes/shared/PathBuilder.tsx +1 -35
- package/src/lib/shapes/shared/PlainTextLabel.tsx +0 -1
- package/src/lib/shapes/shared/RichTextLabel.tsx +0 -4
- package/src/lib/shapes/shared/SvgTextLabel.tsx +2 -4
- package/src/lib/shapes/shared/usePrefersReducedMotion.tsx +1 -11
- package/src/lib/shapes/text/TextShapeUtil.tsx +12 -5
- package/src/lib/styles.tsx +1 -3
- package/src/lib/tools/SelectTool/childStates/Crop/children/PointingCrop.ts +1 -8
- package/src/lib/tools/SelectTool/childStates/DraggingHandle.tsx +30 -54
- package/src/lib/tools/SelectTool/childStates/Idle.ts +24 -2
- package/src/lib/tools/SelectTool/childStates/PointingShape.ts +0 -7
- package/src/lib/tools/SelectTool/childStates/Resizing.ts +1 -12
- package/src/lib/tools/SelectTool/childStates/Rotating.ts +0 -11
- package/src/lib/tools/SelectTool/childStates/Translating.ts +0 -11
- package/src/lib/tools/selection-logic/getHitShapeOnCanvasPointerDown.ts +0 -1
- package/src/lib/ui/assetUrls.ts +13 -10
- package/src/lib/ui/components/A11y.tsx +13 -15
- package/src/lib/ui/components/KeyboardShortcutsDialog/DefaultKeyboardShortcutsDialogContent.tsx +0 -40
- package/src/lib/ui/components/MainMenu/DefaultMainMenuContent.tsx +2 -4
- package/src/lib/ui/components/NavigationPanel/DefaultNavigationPanel.tsx +4 -3
- package/src/lib/ui/components/Spinner.tsx +24 -2
- package/src/lib/ui/components/StylePanel/DefaultStylePanel.tsx +1 -3
- package/src/lib/ui/components/StylePanel/DefaultStylePanelContent.tsx +127 -171
- package/src/lib/ui/components/Toolbar/DefaultImageToolbar.tsx +9 -25
- package/src/lib/ui/components/Toolbar/OverflowingToolbar.tsx +3 -3
- package/src/lib/ui/components/Toolbar/ToggleToolLockedButton.tsx +12 -17
- package/src/lib/ui/components/menu-items.tsx +0 -25
- package/src/lib/ui/components/primitives/Button/TldrawUiButtonIcon.tsx +2 -2
- package/src/lib/ui/components/primitives/TldrawUiButtonPicker.tsx +0 -2
- package/src/lib/ui/components/primitives/TldrawUiDialog.tsx +1 -1
- package/src/lib/ui/components/primitives/TldrawUiIcon.tsx +3 -41
- package/src/lib/ui/components/primitives/TldrawUiSlider.tsx +1 -6
- package/src/lib/ui/components/primitives/TldrawUiToolbar.tsx +3 -24
- package/src/lib/ui/components/primitives/menus/TldrawUiMenuCheckboxItem.tsx +2 -2
- package/src/lib/ui/components/primitives/menus/TldrawUiMenuItem.tsx +4 -3
- package/src/lib/ui/context/TldrawUiContextProvider.tsx +20 -23
- package/src/lib/ui/context/actions.tsx +9 -59
- package/src/lib/ui/context/events.tsx +2 -5
- package/src/lib/ui/hooks/menu-hooks.ts +0 -1
- package/src/lib/ui/hooks/useKeyboardShortcuts.ts +2 -3
- package/src/lib/ui/hooks/useTools.tsx +1 -2
- package/src/lib/ui/hooks/useTranslation/TLUiTranslationKey.ts +0 -11
- package/src/lib/ui/hooks/useTranslation/defaultTranslation.ts +0 -11
- package/src/lib/ui/kbd-utils.ts +1 -2
- package/src/lib/ui/version.ts +3 -3
- package/src/lib/ui.css +23 -65
- package/src/lib/utils/excalidraw/__snapshots__/putExcalidrawContent.test.tsx.snap +2 -16
- package/src/lib/utils/excalidraw/putExcalidrawContent.ts +1 -1
- package/src/lib/utils/tldr/__snapshots__/buildFromV1Document.test.ts.snap +3 -24
- package/src/lib/utils/tldr/buildFromV1Document.ts +1 -2
- package/src/test/Editor.test.tsx +1 -1
- package/src/test/SelectTool.test.ts +11 -37
- package/src/test/arrows-megabus.test.tsx +6 -12
- package/src/test/commands/__snapshots__/getSvgString.test.ts.snap +2 -2
- package/src/test/commands/deletePage.test.ts +1 -84
- package/src/test/groups.test.tsx +1 -1
- package/src/test/navigation.test.ts +0 -254
- package/src/test/shapeutils.test.ts +45 -394
- package/src/test/translating.test.ts +1 -1
- package/tldraw.css +50 -88
- package/dist-cjs/lib/ui/components/AccessibilityMenu.js +0 -35
- package/dist-cjs/lib/ui/components/AccessibilityMenu.js.map +0 -7
- package/dist-cjs/lib/ui/components/primitives/TldrawUiTooltip.js +0 -267
- package/dist-cjs/lib/ui/components/primitives/TldrawUiTooltip.js.map +0 -7
- package/dist-esm/lib/ui/components/AccessibilityMenu.mjs +0 -19
- package/dist-esm/lib/ui/components/AccessibilityMenu.mjs.map +0 -7
- package/dist-esm/lib/ui/components/primitives/TldrawUiTooltip.mjs +0 -237
- package/dist-esm/lib/ui/components/primitives/TldrawUiTooltip.mjs.map +0 -7
- package/src/lib/ui/components/AccessibilityMenu.tsx +0 -20
- package/src/lib/ui/components/primitives/TldrawUiTooltip.tsx +0 -313
- package/src/test/inner-outer-margin.test.ts +0 -315
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import classnames from 'classnames'
|
|
2
2
|
import { Toolbar as _Toolbar } from 'radix-ui'
|
|
3
3
|
import React from 'react'
|
|
4
|
-
import { TldrawUiTooltip } from './TldrawUiTooltip'
|
|
5
4
|
|
|
6
5
|
/** @public */
|
|
7
6
|
export interface TLUiToolbarProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
@@ -35,30 +34,23 @@ export interface TLUiToolbarButtonProps extends React.HTMLAttributes<HTMLButtonE
|
|
|
35
34
|
disabled?: boolean
|
|
36
35
|
isActive?: boolean
|
|
37
36
|
type: 'icon' | 'tool' | 'menu'
|
|
38
|
-
tooltip?: string
|
|
39
37
|
}
|
|
40
38
|
|
|
41
39
|
/** @public @react */
|
|
42
40
|
export const TldrawUiToolbarButton = React.forwardRef<HTMLButtonElement, TLUiToolbarButtonProps>(
|
|
43
|
-
({ asChild, children, type, isActive,
|
|
44
|
-
|
|
41
|
+
({ asChild, children, type, isActive, ...props }: TLUiToolbarButtonProps, ref) => {
|
|
42
|
+
return (
|
|
45
43
|
<_Toolbar.Button
|
|
46
44
|
ref={ref}
|
|
47
45
|
asChild={asChild}
|
|
48
46
|
draggable={false}
|
|
49
47
|
data-isactive={isActive}
|
|
50
48
|
{...props}
|
|
51
|
-
// The tooltip takes care of this.
|
|
52
|
-
title={undefined}
|
|
53
49
|
className={classnames('tlui-button', `tlui-button__${type}`, props.className)}
|
|
54
50
|
>
|
|
55
51
|
{children}
|
|
56
52
|
</_Toolbar.Button>
|
|
57
53
|
)
|
|
58
|
-
|
|
59
|
-
const tooltipContent = tooltip || props.title
|
|
60
|
-
|
|
61
|
-
return <TldrawUiTooltip content={tooltipContent}>{button}</TldrawUiTooltip>
|
|
62
54
|
}
|
|
63
55
|
)
|
|
64
56
|
|
|
@@ -67,7 +59,6 @@ export interface TLUiToolbarToggleGroupProps extends React.HTMLAttributes<HTMLDi
|
|
|
67
59
|
children?: React.ReactNode
|
|
68
60
|
className?: string
|
|
69
61
|
dir?: 'ltr' | 'rtl'
|
|
70
|
-
value: any
|
|
71
62
|
// TODO: fix up this type later
|
|
72
63
|
defaultValue?: any
|
|
73
64
|
type: 'single' | 'multiple'
|
|
@@ -84,10 +75,6 @@ export const TldrawUiToolbarToggleGroup = ({
|
|
|
84
75
|
<_Toolbar.ToggleGroup
|
|
85
76
|
type={type}
|
|
86
77
|
{...props}
|
|
87
|
-
// TODO: this fixes a bug in Radix until they fix it.
|
|
88
|
-
// https://github.com/radix-ui/primitives/issues/3188
|
|
89
|
-
// https://github.com/radix-ui/primitives/pull/3189
|
|
90
|
-
role="radiogroup"
|
|
91
78
|
className={classnames('tlui-toolbar-toggle-group', className)}
|
|
92
79
|
>
|
|
93
80
|
{children}
|
|
@@ -101,7 +88,6 @@ export interface TLUiToolbarToggleItemProps extends React.HTMLAttributes<HTMLBut
|
|
|
101
88
|
className?: string
|
|
102
89
|
type: 'icon' | 'tool'
|
|
103
90
|
value: string
|
|
104
|
-
tooltip?: string
|
|
105
91
|
}
|
|
106
92
|
|
|
107
93
|
/** @public @react */
|
|
@@ -110,14 +96,11 @@ export const TldrawUiToolbarToggleItem = ({
|
|
|
110
96
|
className,
|
|
111
97
|
type,
|
|
112
98
|
value,
|
|
113
|
-
tooltip,
|
|
114
99
|
...props
|
|
115
100
|
}: TLUiToolbarToggleItemProps) => {
|
|
116
|
-
|
|
101
|
+
return (
|
|
117
102
|
<_Toolbar.ToggleItem
|
|
118
103
|
{...props}
|
|
119
|
-
// The tooltip takes care of this.
|
|
120
|
-
title={undefined}
|
|
121
104
|
className={classnames(
|
|
122
105
|
'tlui-button',
|
|
123
106
|
`tlui-button__${type}`,
|
|
@@ -129,8 +112,4 @@ export const TldrawUiToolbarToggleItem = ({
|
|
|
129
112
|
{children}
|
|
130
113
|
</_Toolbar.ToggleItem>
|
|
131
114
|
)
|
|
132
|
-
|
|
133
|
-
const tooltipContent = tooltip || props.title
|
|
134
|
-
|
|
135
|
-
return <TldrawUiTooltip content={tooltipContent}>{toggleItem}</TldrawUiTooltip>
|
|
136
115
|
}
|
|
@@ -5,7 +5,7 @@ import { TLUiEventSource } from '../../../context/events'
|
|
|
5
5
|
import { useReadonly } from '../../../hooks/useReadonly'
|
|
6
6
|
import { TLUiTranslationKey } from '../../../hooks/useTranslation/TLUiTranslationKey'
|
|
7
7
|
import { useTranslation } from '../../../hooks/useTranslation/useTranslation'
|
|
8
|
-
import { TldrawUiIcon
|
|
8
|
+
import { TldrawUiIcon } from '../TldrawUiIcon'
|
|
9
9
|
import { TldrawUiKbd } from '../TldrawUiKbd'
|
|
10
10
|
import { useTldrawUiMenuContext } from './TldrawUiMenuContext'
|
|
11
11
|
|
|
@@ -14,7 +14,7 @@ export interface TLUiMenuCheckboxItemProps<
|
|
|
14
14
|
TranslationKey extends string = string,
|
|
15
15
|
IconType extends string = string,
|
|
16
16
|
> {
|
|
17
|
-
icon?: IconType
|
|
17
|
+
icon?: IconType
|
|
18
18
|
id: string
|
|
19
19
|
kbd?: string
|
|
20
20
|
title?: string
|
|
@@ -12,7 +12,6 @@ import { TldrawUiButton } from '../Button/TldrawUiButton'
|
|
|
12
12
|
import { TldrawUiButtonIcon } from '../Button/TldrawUiButtonIcon'
|
|
13
13
|
import { TldrawUiButtonLabel } from '../Button/TldrawUiButtonLabel'
|
|
14
14
|
import { TldrawUiDropdownMenuItem } from '../TldrawUiDropdownMenu'
|
|
15
|
-
import { TLUiIconJsx } from '../TldrawUiIcon'
|
|
16
15
|
import { TldrawUiKbd } from '../TldrawUiKbd'
|
|
17
16
|
import { TldrawUiToolbarButton } from '../TldrawUiToolbar'
|
|
18
17
|
import { useTldrawUiMenuContext } from './TldrawUiMenuContext'
|
|
@@ -26,11 +25,11 @@ export interface TLUiMenuItemProps<
|
|
|
26
25
|
/**
|
|
27
26
|
* The icon to display on the item. Icons are only shown in certain menu types.
|
|
28
27
|
*/
|
|
29
|
-
icon?: IconType
|
|
28
|
+
icon?: IconType
|
|
30
29
|
/**
|
|
31
30
|
* An icon to display to the left of the menu item.
|
|
32
31
|
*/
|
|
33
|
-
iconLeft?: IconType
|
|
32
|
+
iconLeft?: IconType
|
|
34
33
|
/**
|
|
35
34
|
* The keyboard shortcut to display on the item.
|
|
36
35
|
*/
|
|
@@ -219,6 +218,7 @@ export function TldrawUiMenuItem<
|
|
|
219
218
|
preventDefault(e)
|
|
220
219
|
onSelect('toolbar')
|
|
221
220
|
}}
|
|
221
|
+
role="option"
|
|
222
222
|
title={titleStr}
|
|
223
223
|
type="tool"
|
|
224
224
|
>
|
|
@@ -237,6 +237,7 @@ export function TldrawUiMenuItem<
|
|
|
237
237
|
data-value={id}
|
|
238
238
|
disabled={disabled}
|
|
239
239
|
onClick={() => onSelect('toolbar')}
|
|
240
|
+
role="option"
|
|
240
241
|
title={titleStr}
|
|
241
242
|
type="icon"
|
|
242
243
|
>
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { RecursivePartial, defaultUserPreferences, track, useMaybeEditor } from '@tldraw/editor'
|
|
2
2
|
import { ReactNode } from 'react'
|
|
3
3
|
import { TLUiAssetUrls, useDefaultUiAssetUrlsWithOverrides } from '../assetUrls'
|
|
4
|
-
import { TldrawUiTooltipProvider } from '../components/primitives/TldrawUiTooltip'
|
|
5
4
|
import { ToolsProvider } from '../hooks/useTools'
|
|
6
5
|
import { TldrawUiTranslationProvider } from '../hooks/useTranslation/useTranslation'
|
|
7
6
|
import {
|
|
@@ -73,28 +72,26 @@ export const TldrawUiContextProvider = track(function TldrawUiContextProvider({
|
|
|
73
72
|
const editor = useMaybeEditor()
|
|
74
73
|
return (
|
|
75
74
|
<MimeTypeContext.Provider value={mediaMimeTypes}>
|
|
76
|
-
<
|
|
77
|
-
<
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
>
|
|
82
|
-
<
|
|
83
|
-
<
|
|
84
|
-
<
|
|
85
|
-
<
|
|
86
|
-
<
|
|
87
|
-
<
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
</AssetUrlsProvider>
|
|
97
|
-
</TldrawUiTooltipProvider>
|
|
75
|
+
<AssetUrlsProvider assetUrls={useDefaultUiAssetUrlsWithOverrides(assetUrls)}>
|
|
76
|
+
<TldrawUiTranslationProvider
|
|
77
|
+
overrides={useMergedTranslationOverrides(overrides)}
|
|
78
|
+
locale={editor?.user.getLocale() ?? defaultUserPreferences.locale}
|
|
79
|
+
>
|
|
80
|
+
<TldrawUiEventsProvider onEvent={onUiEvent}>
|
|
81
|
+
<TldrawUiToastsProvider>
|
|
82
|
+
<TldrawUiDialogsProvider context={'tla'}>
|
|
83
|
+
<TldrawUiA11yProvider>
|
|
84
|
+
<BreakPointProvider forceMobile={forceMobile}>
|
|
85
|
+
<TldrawUiComponentsProvider overrides={components}>
|
|
86
|
+
<InternalProviders overrides={overrides}>{children}</InternalProviders>
|
|
87
|
+
</TldrawUiComponentsProvider>
|
|
88
|
+
</BreakPointProvider>
|
|
89
|
+
</TldrawUiA11yProvider>
|
|
90
|
+
</TldrawUiDialogsProvider>
|
|
91
|
+
</TldrawUiToastsProvider>
|
|
92
|
+
</TldrawUiEventsProvider>
|
|
93
|
+
</TldrawUiTranslationProvider>
|
|
94
|
+
</AssetUrlsProvider>
|
|
98
95
|
</MimeTypeContext.Provider>
|
|
99
96
|
)
|
|
100
97
|
})
|
|
@@ -28,7 +28,6 @@ import { fitFrameToContent, removeFrame } from '../../utils/frames/frames'
|
|
|
28
28
|
import { generateShapeAnnouncementMessage } from '../components/A11y'
|
|
29
29
|
import { EditLinkDialog } from '../components/EditLinkDialog'
|
|
30
30
|
import { EmbedDialog } from '../components/EmbedDialog'
|
|
31
|
-
import { DefaultKeyboardShortcutsDialog } from '../components/KeyboardShortcutsDialog/DefaultKeyboardShortcutsDialog'
|
|
32
31
|
import { useShowCollaborationUi } from '../hooks/useCollaborationStatus'
|
|
33
32
|
import { flattenShapesToImages } from '../hooks/useFlatten'
|
|
34
33
|
import { TLUiTranslationKey } from '../hooks/useTranslation/TLUiTranslationKey'
|
|
@@ -43,13 +42,12 @@ export interface TLUiActionItem<
|
|
|
43
42
|
TransationKey extends string = string,
|
|
44
43
|
IconType extends string = string,
|
|
45
44
|
> {
|
|
46
|
-
icon?: IconType
|
|
45
|
+
icon?: IconType
|
|
47
46
|
id: string
|
|
48
47
|
kbd?: string
|
|
49
48
|
label?: TransationKey | { [key: string]: TransationKey }
|
|
50
49
|
readonlyOk?: boolean
|
|
51
50
|
checkbox?: boolean
|
|
52
|
-
isRequiredA11yAction?: boolean
|
|
53
51
|
onSelect(source: TLUiEventSource): Promise<void> | void
|
|
54
52
|
}
|
|
55
53
|
|
|
@@ -170,15 +168,6 @@ export function ActionsProvider({ overrides, children }: ActionsProviderProps) {
|
|
|
170
168
|
helpers.addDialog({ component: EmbedDialog })
|
|
171
169
|
},
|
|
172
170
|
},
|
|
173
|
-
{
|
|
174
|
-
id: 'open-kbd-shortcuts',
|
|
175
|
-
label: 'action.open-kbd-shortcuts',
|
|
176
|
-
kbd: 'cmd+alt+/,ctrl+alt+/',
|
|
177
|
-
onSelect(source) {
|
|
178
|
-
trackEvent('open-kbd-shortcuts', { source })
|
|
179
|
-
helpers.addDialog({ component: DefaultKeyboardShortcutsDialog })
|
|
180
|
-
},
|
|
181
|
-
},
|
|
182
171
|
{
|
|
183
172
|
id: 'insert-media',
|
|
184
173
|
label: 'action.insert-media',
|
|
@@ -513,6 +502,7 @@ export function ActionsProvider({ overrides, children }: ActionsProviderProps) {
|
|
|
513
502
|
}
|
|
514
503
|
}
|
|
515
504
|
|
|
505
|
+
if (!editor.canCreateShapes(ids)) return
|
|
516
506
|
editor.markHistoryStoppingPoint('duplicate shapes')
|
|
517
507
|
editor.duplicateShapes(ids, offset)
|
|
518
508
|
|
|
@@ -1037,20 +1027,17 @@ export function ActionsProvider({ overrides, children }: ActionsProviderProps) {
|
|
|
1037
1027
|
id: 'rotate-cw',
|
|
1038
1028
|
label: 'action.rotate-cw',
|
|
1039
1029
|
icon: 'rotate-cw',
|
|
1040
|
-
kbd: 'shift+.,shift+alt+.',
|
|
1041
1030
|
onSelect(source) {
|
|
1042
1031
|
if (!canApplySelectionAction()) return
|
|
1043
1032
|
if (mustGoBackToSelectToolFirst()) return
|
|
1044
1033
|
|
|
1045
|
-
|
|
1046
|
-
trackEvent('rotate-cw', { source, fine: isFine })
|
|
1034
|
+
trackEvent('rotate-cw', { source })
|
|
1047
1035
|
editor.markHistoryStoppingPoint('rotate-cw')
|
|
1048
1036
|
editor.run(() => {
|
|
1049
|
-
const
|
|
1050
|
-
const
|
|
1051
|
-
const dontUseOffset = approximately(offset, 0) || approximately(offset, rotation)
|
|
1037
|
+
const offset = editor.getSelectionRotation() % (HALF_PI / 2)
|
|
1038
|
+
const dontUseOffset = approximately(offset, 0) || approximately(offset, HALF_PI / 2)
|
|
1052
1039
|
const selectedShapeIds = editor.getSelectedShapeIds()
|
|
1053
|
-
editor.rotateShapesBy(selectedShapeIds,
|
|
1040
|
+
editor.rotateShapesBy(selectedShapeIds, HALF_PI / 2 - (dontUseOffset ? 0 : offset))
|
|
1054
1041
|
kickoutOccludedShapes(editor, selectedShapeIds)
|
|
1055
1042
|
})
|
|
1056
1043
|
},
|
|
@@ -1059,21 +1046,17 @@ export function ActionsProvider({ overrides, children }: ActionsProviderProps) {
|
|
|
1059
1046
|
id: 'rotate-ccw',
|
|
1060
1047
|
label: 'action.rotate-ccw',
|
|
1061
1048
|
icon: 'rotate-ccw',
|
|
1062
|
-
// omg double comma
|
|
1063
|
-
kbd: 'shift+,,shift+alt+,',
|
|
1064
1049
|
onSelect(source) {
|
|
1065
1050
|
if (!canApplySelectionAction()) return
|
|
1066
1051
|
if (mustGoBackToSelectToolFirst()) return
|
|
1067
1052
|
|
|
1068
|
-
|
|
1069
|
-
trackEvent('rotate-ccw', { source, fine: isFine })
|
|
1053
|
+
trackEvent('rotate-ccw', { source })
|
|
1070
1054
|
editor.markHistoryStoppingPoint('rotate-ccw')
|
|
1071
1055
|
editor.run(() => {
|
|
1072
|
-
const
|
|
1073
|
-
const offset = editor.getSelectionRotation() % rotation
|
|
1056
|
+
const offset = editor.getSelectionRotation() % (HALF_PI / 2)
|
|
1074
1057
|
const offsetCloseToZero = approximately(offset, 0)
|
|
1075
1058
|
const selectedShapeIds = editor.getSelectedShapeIds()
|
|
1076
|
-
editor.rotateShapesBy(selectedShapeIds, offsetCloseToZero ? -
|
|
1059
|
+
editor.rotateShapesBy(selectedShapeIds, offsetCloseToZero ? -(HALF_PI / 2) : -offset)
|
|
1077
1060
|
kickoutOccludedShapes(editor, selectedShapeIds)
|
|
1078
1061
|
})
|
|
1079
1062
|
},
|
|
@@ -1251,36 +1234,6 @@ export function ActionsProvider({ overrides, children }: ActionsProviderProps) {
|
|
|
1251
1234
|
},
|
|
1252
1235
|
checkbox: true,
|
|
1253
1236
|
},
|
|
1254
|
-
{
|
|
1255
|
-
id: 'toggle-keyboard-shortcuts',
|
|
1256
|
-
label: {
|
|
1257
|
-
default: 'action.toggle-keyboard-shortcuts',
|
|
1258
|
-
menu: 'action.toggle-keyboard-shortcuts.menu',
|
|
1259
|
-
},
|
|
1260
|
-
readonlyOk: true,
|
|
1261
|
-
onSelect(source) {
|
|
1262
|
-
trackEvent('toggle-keyboard-shortcuts', { source })
|
|
1263
|
-
editor.user.updateUserPreferences({
|
|
1264
|
-
areKeyboardShortcutsEnabled: !editor.user.getAreKeyboardShortcutsEnabled(),
|
|
1265
|
-
})
|
|
1266
|
-
},
|
|
1267
|
-
checkbox: true,
|
|
1268
|
-
},
|
|
1269
|
-
{
|
|
1270
|
-
id: 'toggle-ui-labels',
|
|
1271
|
-
label: {
|
|
1272
|
-
default: 'action.toggle-ui-labels',
|
|
1273
|
-
menu: 'action.toggle-ui-labels.menu',
|
|
1274
|
-
},
|
|
1275
|
-
readonlyOk: true,
|
|
1276
|
-
onSelect(source) {
|
|
1277
|
-
trackEvent('toggle-ui-labels', { source })
|
|
1278
|
-
editor.user.updateUserPreferences({
|
|
1279
|
-
showUiLabels: !editor.user.getShowUiLabels(),
|
|
1280
|
-
})
|
|
1281
|
-
},
|
|
1282
|
-
checkbox: true,
|
|
1283
|
-
},
|
|
1284
1237
|
{
|
|
1285
1238
|
id: 'toggle-edge-scrolling',
|
|
1286
1239
|
label: {
|
|
@@ -1577,7 +1530,6 @@ export function ActionsProvider({ overrides, children }: ActionsProviderProps) {
|
|
|
1577
1530
|
id: 'adjust-shape-styles',
|
|
1578
1531
|
label: 'a11y.adjust-shape-styles',
|
|
1579
1532
|
kbd: 'cmd+Enter,ctrl+Enter',
|
|
1580
|
-
isRequiredA11yAction: true,
|
|
1581
1533
|
onSelect: async (source) => {
|
|
1582
1534
|
if (!canApplySelectionAction()) return
|
|
1583
1535
|
|
|
@@ -1591,7 +1543,6 @@ export function ActionsProvider({ overrides, children }: ActionsProviderProps) {
|
|
|
1591
1543
|
{
|
|
1592
1544
|
id: 'a11y-open-context-menu',
|
|
1593
1545
|
kbd: 'cmd+shift+Enter,ctrl+shift+Enter',
|
|
1594
|
-
isRequiredA11yAction: true,
|
|
1595
1546
|
readonlyOk: true,
|
|
1596
1547
|
onSelect: async (source) => {
|
|
1597
1548
|
if (!canApplySelectionAction()) return
|
|
@@ -1644,7 +1595,6 @@ export function ActionsProvider({ overrides, children }: ActionsProviderProps) {
|
|
|
1644
1595
|
id: 'a11y-repeat-shape-announce',
|
|
1645
1596
|
kbd: 'alt+r',
|
|
1646
1597
|
label: 'a11y.repeat-shape',
|
|
1647
|
-
isRequiredA11yAction: true,
|
|
1648
1598
|
readonlyOk: true,
|
|
1649
1599
|
onSelect: async (source) => {
|
|
1650
1600
|
const selectedShapeIds = editor.getSelectedShapeIds()
|
|
@@ -76,8 +76,8 @@ export interface TLUiEventMap {
|
|
|
76
76
|
'delete-shapes': null
|
|
77
77
|
'select-all-shapes': null
|
|
78
78
|
'select-none-shapes': null
|
|
79
|
-
'rotate-ccw':
|
|
80
|
-
'rotate-cw':
|
|
79
|
+
'rotate-ccw': null
|
|
80
|
+
'rotate-cw': null
|
|
81
81
|
'zoom-in': { towardsCursor: boolean }
|
|
82
82
|
'zoom-out': { towardsCursor: boolean }
|
|
83
83
|
'zoom-to-fit': null
|
|
@@ -107,8 +107,6 @@ export interface TLUiEventMap {
|
|
|
107
107
|
'toggle-paste-at-cursor': null
|
|
108
108
|
'toggle-lock': null
|
|
109
109
|
'toggle-reduce-motion': null
|
|
110
|
-
'toggle-keyboard-shortcuts': null
|
|
111
|
-
'toggle-ui-labels': null
|
|
112
110
|
'toggle-edge-scrolling': null
|
|
113
111
|
'color-scheme': { value: string }
|
|
114
112
|
'exit-pen-mode': null
|
|
@@ -129,7 +127,6 @@ export interface TLUiEventMap {
|
|
|
129
127
|
'copy-link': null
|
|
130
128
|
'image-replace': null
|
|
131
129
|
'video-replace': null
|
|
132
|
-
'open-kbd-shortcuts': null
|
|
133
130
|
'rich-text': {
|
|
134
131
|
operation:
|
|
135
132
|
| 'bold'
|
|
@@ -123,7 +123,6 @@ export function useAnySelectedShapesCount(min?: number, max?: number) {
|
|
|
123
123
|
|
|
124
124
|
/**
|
|
125
125
|
* Returns true if the number of UNLOCKED selected shapes is at least min or at most max.
|
|
126
|
-
* @public
|
|
127
126
|
*/
|
|
128
127
|
export function useUnlockedSelectedShapesCount(min?: number, max?: number) {
|
|
129
128
|
const editor = useEditor()
|
|
@@ -61,7 +61,7 @@ export function useKeyboardShortcuts() {
|
|
|
61
61
|
if (SKIP_KBDS.includes(action.id)) continue
|
|
62
62
|
|
|
63
63
|
hot(getHotkeysStringFromKbd(action.kbd), (event) => {
|
|
64
|
-
if (areShortcutsDisabled(editor)
|
|
64
|
+
if (areShortcutsDisabled(editor)) return
|
|
65
65
|
preventDefault(event)
|
|
66
66
|
action.onSelect('kbd')
|
|
67
67
|
})
|
|
@@ -149,8 +149,7 @@ export function areShortcutsDisabled(editor: Editor) {
|
|
|
149
149
|
return (
|
|
150
150
|
editor.menus.hasAnyOpenMenus() ||
|
|
151
151
|
editor.getEditingShapeId() !== null ||
|
|
152
|
-
editor.getCrashingError()
|
|
153
|
-
!editor.user.getAreKeyboardShortcutsEnabled()
|
|
152
|
+
editor.getCrashingError()
|
|
154
153
|
)
|
|
155
154
|
}
|
|
156
155
|
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Editor, GeoShapeGeoStyle, useMaybeEditor } from '@tldraw/editor'
|
|
2
2
|
import * as React from 'react'
|
|
3
3
|
import { EmbedDialog } from '../components/EmbedDialog'
|
|
4
|
-
import { TLUiIconJsx } from '../components/primitives/TldrawUiIcon'
|
|
5
4
|
import { useA11y } from '../context/a11y'
|
|
6
5
|
import { TLUiEventSource, useUiEvents } from '../context/events'
|
|
7
6
|
import { TLUiIconType } from '../icon-types'
|
|
@@ -17,7 +16,7 @@ export interface TLUiToolItem<
|
|
|
17
16
|
id: string
|
|
18
17
|
label: TranslationKey
|
|
19
18
|
shortcutsLabel?: TranslationKey
|
|
20
|
-
icon: IconType
|
|
19
|
+
icon: IconType
|
|
21
20
|
onSelect(source: TLUiEventSource): void
|
|
22
21
|
/**
|
|
23
22
|
* The keyboard shortcut for this tool. This is a string that can be a single key,
|
|
@@ -55,7 +55,6 @@ export type TLUiTranslationKey =
|
|
|
55
55
|
| 'action.new-project'
|
|
56
56
|
| 'action.new-shared-project'
|
|
57
57
|
| 'action.open-cursor-chat'
|
|
58
|
-
| 'action.open-kbd-shortcuts'
|
|
59
58
|
| 'action.open-file'
|
|
60
59
|
| 'action.pack'
|
|
61
60
|
| 'action.paste'
|
|
@@ -91,10 +90,6 @@ export type TLUiTranslationKey =
|
|
|
91
90
|
| 'action.toggle-wrap-mode'
|
|
92
91
|
| 'action.toggle-reduce-motion.menu'
|
|
93
92
|
| 'action.toggle-reduce-motion'
|
|
94
|
-
| 'action.toggle-keyboard-shortcuts.menu'
|
|
95
|
-
| 'action.toggle-keyboard-shortcuts'
|
|
96
|
-
| 'action.toggle-ui-labels.menu'
|
|
97
|
-
| 'action.toggle-ui-labels'
|
|
98
93
|
| 'action.toggle-edge-scrolling.menu'
|
|
99
94
|
| 'action.toggle-edge-scrolling'
|
|
100
95
|
| 'action.toggle-debug-mode.menu'
|
|
@@ -288,19 +283,13 @@ export type TLUiTranslationKey =
|
|
|
288
283
|
| 'a11y.repeat-shape'
|
|
289
284
|
| 'a11y.move-shape'
|
|
290
285
|
| 'a11y.move-shape-faster'
|
|
291
|
-
| 'a11y.rotate-shape-cw'
|
|
292
|
-
| 'a11y.rotate-shape-ccw'
|
|
293
|
-
| 'a11y.rotate-shape-cw-fine'
|
|
294
|
-
| 'a11y.rotate-shape-ccw-fine'
|
|
295
286
|
| 'a11y.enlarge-shape'
|
|
296
287
|
| 'a11y.shrink-shape'
|
|
297
288
|
| 'a11y.pan-camera'
|
|
298
289
|
| 'a11y.adjust-shape-styles'
|
|
299
290
|
| 'a11y.open-context-menu'
|
|
300
|
-
| 'a11y.open-keyboard-shortcuts'
|
|
301
291
|
| 'menu.title'
|
|
302
292
|
| 'menu.theme'
|
|
303
|
-
| 'menu.accessibility'
|
|
304
293
|
| 'menu.copy-as'
|
|
305
294
|
| 'menu.edit'
|
|
306
295
|
| 'menu.export-as'
|
|
@@ -55,7 +55,6 @@ export const DEFAULT_TRANSLATION = {
|
|
|
55
55
|
'action.new-project': 'New project',
|
|
56
56
|
'action.new-shared-project': 'New shared project',
|
|
57
57
|
'action.open-cursor-chat': 'Cursor chat',
|
|
58
|
-
'action.open-kbd-shortcuts': 'Open keyboard shortcuts',
|
|
59
58
|
'action.open-file': 'Open file',
|
|
60
59
|
'action.pack': 'Pack',
|
|
61
60
|
'action.paste': 'Paste',
|
|
@@ -92,10 +91,6 @@ export const DEFAULT_TRANSLATION = {
|
|
|
92
91
|
'action.toggle-wrap-mode': 'Toggle Select on wrap',
|
|
93
92
|
'action.toggle-reduce-motion.menu': 'Reduce motion',
|
|
94
93
|
'action.toggle-reduce-motion': 'Toggle reduce motion',
|
|
95
|
-
'action.toggle-keyboard-shortcuts.menu': 'Keyboard shortcuts',
|
|
96
|
-
'action.toggle-keyboard-shortcuts': 'Toggle keyboard shortcuts',
|
|
97
|
-
'action.toggle-ui-labels.menu': 'UI labels',
|
|
98
|
-
'action.toggle-ui-labels': 'Toggle UI labels',
|
|
99
94
|
'action.toggle-edge-scrolling.menu': 'Edge scrolling',
|
|
100
95
|
'action.toggle-edge-scrolling': 'Toggle edge scrolling',
|
|
101
96
|
'action.toggle-debug-mode.menu': 'Debug mode',
|
|
@@ -289,19 +284,13 @@ export const DEFAULT_TRANSLATION = {
|
|
|
289
284
|
'a11y.repeat-shape': 'Repeat shape',
|
|
290
285
|
'a11y.move-shape': 'Move shape',
|
|
291
286
|
'a11y.move-shape-faster': 'Move shape faster',
|
|
292
|
-
'a11y.rotate-shape-cw': 'Rotate shape clockwise',
|
|
293
|
-
'a11y.rotate-shape-ccw': 'Rotate shape counterclockwise',
|
|
294
|
-
'a11y.rotate-shape-cw-fine': 'Rotate shape clockwise (fine)',
|
|
295
|
-
'a11y.rotate-shape-ccw-fine': 'Rotate shape counterclockwise (fine)',
|
|
296
287
|
'a11y.enlarge-shape': 'Enlarge shape',
|
|
297
288
|
'a11y.shrink-shape': 'Shrink shape',
|
|
298
289
|
'a11y.pan-camera': 'Pan camera',
|
|
299
290
|
'a11y.adjust-shape-styles': 'Adjust shape styles',
|
|
300
291
|
'a11y.open-context-menu': 'Open context menu',
|
|
301
|
-
'a11y.open-keyboard-shortcuts': 'Open keyboard shortcuts',
|
|
302
292
|
'menu.title': 'Menu',
|
|
303
293
|
'menu.theme': 'Theme',
|
|
304
|
-
'menu.accessibility': 'Accessibility',
|
|
305
294
|
'menu.copy-as': 'Copy as',
|
|
306
295
|
'menu.edit': 'Edit',
|
|
307
296
|
'menu.export-as': 'Export as',
|
package/src/lib/ui/kbd-utils.ts
CHANGED
|
@@ -2,7 +2,6 @@ import { tlenv } from '@tldraw/editor'
|
|
|
2
2
|
|
|
3
3
|
// N.B. We rework these Windows placeholders down below.
|
|
4
4
|
const cmdKey = tlenv.isDarwin ? '⌘' : '__CTRL__'
|
|
5
|
-
const ctrlKey = tlenv.isDarwin ? '⌃' : '__CTRL__'
|
|
6
5
|
const altKey = tlenv.isDarwin ? '⌥' : '__ALT__'
|
|
7
6
|
|
|
8
7
|
/** @public */
|
|
@@ -20,7 +19,7 @@ export function kbd(str: string) {
|
|
|
20
19
|
? s.replace(/[[\]]/g, '')
|
|
21
20
|
: s
|
|
22
21
|
.replace(/cmd\+/g, cmdKey)
|
|
23
|
-
.replace(/ctrl\+/g,
|
|
22
|
+
.replace(/ctrl\+/g, cmdKey)
|
|
24
23
|
.replace(/alt\+/g, altKey)
|
|
25
24
|
.replace(/shift\+/g, '⇧')
|
|
26
25
|
// Backwards compatibility with the old system.
|
package/src/lib/ui/version.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// This file is automatically generated by internal/scripts/refresh-assets.ts.
|
|
2
2
|
// Do not edit manually. Or do, I'm a comment, not a cop.
|
|
3
3
|
|
|
4
|
-
export const version = '3.16.0-
|
|
4
|
+
export const version = '3.16.0-internal.a478398270c6'
|
|
5
5
|
export const publishDates = {
|
|
6
6
|
major: '2024-09-13T14:36:29.063Z',
|
|
7
|
-
minor: '2025-08-
|
|
8
|
-
patch: '2025-08-
|
|
7
|
+
minor: '2025-08-19T10:21:26.717Z',
|
|
8
|
+
patch: '2025-08-19T10:21:26.717Z',
|
|
9
9
|
}
|