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,5 +1,4 @@
|
|
|
1
1
|
import {
|
|
2
|
-
Mat,
|
|
3
2
|
StateNode,
|
|
4
3
|
TLArrowShape,
|
|
5
4
|
TLHandle,
|
|
@@ -27,20 +26,20 @@ export type DraggingHandleInfo = TLPointerEventInfo & {
|
|
|
27
26
|
export class DraggingHandle extends StateNode {
|
|
28
27
|
static override id = 'dragging_handle'
|
|
29
28
|
|
|
30
|
-
shapeId
|
|
31
|
-
initialHandle
|
|
32
|
-
initialAdjacentHandle
|
|
33
|
-
initialPagePoint
|
|
29
|
+
shapeId = '' as TLShapeId
|
|
30
|
+
initialHandle = {} as TLHandle
|
|
31
|
+
initialAdjacentHandle = null as TLHandle | null
|
|
32
|
+
initialPagePoint = {} as Vec
|
|
34
33
|
|
|
35
|
-
markId
|
|
36
|
-
initialPageTransform
|
|
37
|
-
initialPageRotation
|
|
34
|
+
markId = ''
|
|
35
|
+
initialPageTransform: any
|
|
36
|
+
initialPageRotation: any
|
|
38
37
|
|
|
39
|
-
info
|
|
38
|
+
info = {} as DraggingHandleInfo
|
|
40
39
|
|
|
41
40
|
isPrecise = false
|
|
42
|
-
isPreciseId
|
|
43
|
-
pointingId
|
|
41
|
+
isPreciseId = null as TLShapeId | null
|
|
42
|
+
pointingId = null as TLShapeId | null
|
|
44
43
|
|
|
45
44
|
override onEnter(info: DraggingHandleInfo) {
|
|
46
45
|
const { shape, isCreating, creatingMarkId, handle } = info
|
|
@@ -67,6 +66,26 @@ export class DraggingHandle extends StateNode {
|
|
|
67
66
|
|
|
68
67
|
this.initialHandle = structuredClone(handle)
|
|
69
68
|
|
|
69
|
+
if (this.editor.isShapeOfType<TLLineShape>(shape, 'line')) {
|
|
70
|
+
// For line shapes, if we're dragging a "create" handle, then
|
|
71
|
+
// create a new vertex handle at that point; and make this handle
|
|
72
|
+
// the handle that we're dragging.
|
|
73
|
+
if (this.initialHandle.type === 'create') {
|
|
74
|
+
this.editor.updateShape({
|
|
75
|
+
...shape,
|
|
76
|
+
props: {
|
|
77
|
+
points: {
|
|
78
|
+
...shape.props.points,
|
|
79
|
+
[handle.index]: { id: handle.index, index: handle.index, x: handle.x, y: handle.y },
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
})
|
|
83
|
+
const handlesAfter = this.editor.getShapeHandles(shape)!
|
|
84
|
+
const handleAfter = handlesAfter.find((h) => h.index === handle.index)!
|
|
85
|
+
this.initialHandle = structuredClone(handleAfter)
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
70
89
|
this.initialPageTransform = this.editor.getShapePageTransform(shape)!
|
|
71
90
|
this.initialPageRotation = this.initialPageTransform.rotation()
|
|
72
91
|
this.initialPagePoint = this.editor.inputs.originPagePoint.clone()
|
|
@@ -116,19 +135,6 @@ export class DraggingHandle extends StateNode {
|
|
|
116
135
|
}
|
|
117
136
|
// -->
|
|
118
137
|
|
|
119
|
-
// Call onHandleDragStart callback
|
|
120
|
-
const handleDragInfo = {
|
|
121
|
-
handle: this.initialHandle,
|
|
122
|
-
isPrecise: this.isPrecise,
|
|
123
|
-
isCreatingShape: !!this.info.isCreating,
|
|
124
|
-
initial: shape,
|
|
125
|
-
}
|
|
126
|
-
const util = this.editor.getShapeUtil(shape)
|
|
127
|
-
const startChanges = util.onHandleDragStart?.(shape, handleDragInfo)
|
|
128
|
-
if (startChanges) {
|
|
129
|
-
this.editor.updateShapes([{ ...startChanges, id: shape.id, type: shape.type }])
|
|
130
|
-
}
|
|
131
|
-
|
|
132
138
|
this.update()
|
|
133
139
|
|
|
134
140
|
this.editor.select(this.shapeId)
|
|
@@ -198,22 +204,6 @@ export class DraggingHandle extends StateNode {
|
|
|
198
204
|
this.editor.snaps.clearIndicators()
|
|
199
205
|
kickoutOccludedShapes(this.editor, [this.shapeId])
|
|
200
206
|
|
|
201
|
-
// Call onHandleDragEnd callback before state transitions
|
|
202
|
-
const shape = this.editor.getShape(this.shapeId)
|
|
203
|
-
if (shape) {
|
|
204
|
-
const util = this.editor.getShapeUtil(shape)
|
|
205
|
-
const handleDragInfo = {
|
|
206
|
-
handle: this.initialHandle,
|
|
207
|
-
isPrecise: this.isPrecise,
|
|
208
|
-
isCreatingShape: !!this.info.isCreating,
|
|
209
|
-
initial: this.info.shape,
|
|
210
|
-
}
|
|
211
|
-
const endChanges = util.onHandleDragEnd?.(shape, handleDragInfo)
|
|
212
|
-
if (endChanges) {
|
|
213
|
-
this.editor.updateShapes([{ ...endChanges, id: shape.id, type: shape.type }])
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
|
|
217
207
|
const { onInteractionEnd } = this.info
|
|
218
208
|
if (this.editor.getInstanceState().isToolLocked && onInteractionEnd) {
|
|
219
209
|
// Return to the tool that was active before this one,
|
|
@@ -226,19 +216,6 @@ export class DraggingHandle extends StateNode {
|
|
|
226
216
|
}
|
|
227
217
|
|
|
228
218
|
private cancel() {
|
|
229
|
-
// Call onHandleDragCancel callback before bailing to mark
|
|
230
|
-
const shape = this.editor.getShape(this.shapeId)
|
|
231
|
-
if (shape) {
|
|
232
|
-
const util = this.editor.getShapeUtil(shape)
|
|
233
|
-
const handleDragInfo = {
|
|
234
|
-
handle: this.initialHandle,
|
|
235
|
-
isPrecise: this.isPrecise,
|
|
236
|
-
isCreatingShape: !!this.info.isCreating,
|
|
237
|
-
initial: this.info.shape,
|
|
238
|
-
}
|
|
239
|
-
util.onHandleDragCancel?.(shape, handleDragInfo)
|
|
240
|
-
}
|
|
241
|
-
|
|
242
219
|
this.editor.bailToMark(this.markId)
|
|
243
220
|
this.editor.snaps.clearIndicators()
|
|
244
221
|
|
|
@@ -307,7 +284,6 @@ export class DraggingHandle extends StateNode {
|
|
|
307
284
|
const changes = util.onHandleDrag?.(shape, {
|
|
308
285
|
handle: nextHandle,
|
|
309
286
|
isPrecise: this.isPrecise || altKey,
|
|
310
|
-
isCreatingShape: !!this.info.isCreating,
|
|
311
287
|
initial: initial,
|
|
312
288
|
})
|
|
313
289
|
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Editor,
|
|
3
|
+
Group2d,
|
|
3
4
|
StateNode,
|
|
4
5
|
TLAdjacentDirection,
|
|
6
|
+
TLArrowShape,
|
|
5
7
|
TLClickEventInfo,
|
|
6
8
|
TLGroupShape,
|
|
7
9
|
TLKeyboardEventInfo,
|
|
@@ -16,7 +18,6 @@ import {
|
|
|
16
18
|
pointInPolygon,
|
|
17
19
|
toRichText,
|
|
18
20
|
} from '@tldraw/editor'
|
|
19
|
-
import { isOverArrowLabel } from '../../../shapes/arrow/arrowLabel'
|
|
20
21
|
import { getHitShapeOnCanvasPointerDown } from '../../selection-logic/getHitShapeOnCanvasPointerDown'
|
|
21
22
|
import { getShouldEnterCropMode } from '../../selection-logic/getShouldEnterCropModeOnPointerDown'
|
|
22
23
|
import { selectOnCanvasPointerUp } from '../../selection-logic/selectOnCanvasPointerUp'
|
|
@@ -97,6 +98,12 @@ export class Idle extends StateNode {
|
|
|
97
98
|
case 'shape': {
|
|
98
99
|
const { shape } = info
|
|
99
100
|
|
|
101
|
+
if (this.isOverArrowLabelTest(shape)) {
|
|
102
|
+
// We're moving the label on a shape.
|
|
103
|
+
this.parent.transition('pointing_arrow_label', info)
|
|
104
|
+
break
|
|
105
|
+
}
|
|
106
|
+
|
|
100
107
|
if (this.editor.isShapeOrAncestorLocked(shape)) {
|
|
101
108
|
this.parent.transition('pointing_canvas', info)
|
|
102
109
|
break
|
|
@@ -588,7 +595,22 @@ export class Idle extends StateNode {
|
|
|
588
595
|
isOverArrowLabelTest(shape: TLShape | undefined) {
|
|
589
596
|
if (!shape) return false
|
|
590
597
|
|
|
591
|
-
|
|
598
|
+
// todo: Extract into general hit test for arrows
|
|
599
|
+
if (this.editor.isShapeOfType<TLArrowShape>(shape, 'arrow')) {
|
|
600
|
+
const pointInShapeSpace = this.editor.getPointInShapeSpace(
|
|
601
|
+
shape,
|
|
602
|
+
this.editor.inputs.currentPagePoint
|
|
603
|
+
)
|
|
604
|
+
// How should we handle multiple labels? Do shapes ever have multiple labels?
|
|
605
|
+
const labelGeometry = this.editor.getShapeGeometry<Group2d>(shape).children[1]
|
|
606
|
+
// Knowing what we know about arrows... if the shape has no text in its label,
|
|
607
|
+
// then the label geometry should not be there.
|
|
608
|
+
if (labelGeometry && pointInPolygon(pointInShapeSpace, labelGeometry.vertices)) {
|
|
609
|
+
return true
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
return false
|
|
592
614
|
}
|
|
593
615
|
|
|
594
616
|
handleDoubleClickOnCanvas(info: TLClickEventInfo) {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { StateNode, TLPointerEventInfo, TLShape } from '@tldraw/editor'
|
|
2
|
-
import { isOverArrowLabel } from '../../../shapes/arrow/arrowLabel'
|
|
3
2
|
import { getTextLabels } from '../../../utils/shapes/shapes'
|
|
4
3
|
|
|
5
4
|
export class PointingShape extends StateNode {
|
|
@@ -211,12 +210,6 @@ export class PointingShape extends StateNode {
|
|
|
211
210
|
|
|
212
211
|
override onPointerMove(info: TLPointerEventInfo) {
|
|
213
212
|
if (this.editor.inputs.isDragging) {
|
|
214
|
-
if (isOverArrowLabel(this.editor, this.hitShape)) {
|
|
215
|
-
// We're moving the label on a shape.
|
|
216
|
-
this.parent.transition('pointing_arrow_label', { ...info, shape: this.hitShape })
|
|
217
|
-
return
|
|
218
|
-
}
|
|
219
|
-
|
|
220
213
|
if (this.didCtrlOnEnter) {
|
|
221
214
|
this.parent.transition('brushing', info)
|
|
222
215
|
} else {
|
|
@@ -122,19 +122,8 @@ export class Resizing extends StateNode {
|
|
|
122
122
|
}
|
|
123
123
|
|
|
124
124
|
private cancel() {
|
|
125
|
-
//
|
|
126
|
-
const { shapeSnapshots } = this.snapshot
|
|
127
|
-
|
|
128
|
-
shapeSnapshots.forEach(({ shape }) => {
|
|
129
|
-
const current = this.editor.getShape(shape.id)
|
|
130
|
-
if (current) {
|
|
131
|
-
const util = this.editor.getShapeUtil(shape)
|
|
132
|
-
util.onResizeCancel?.(shape, current)
|
|
133
|
-
}
|
|
134
|
-
})
|
|
135
|
-
|
|
125
|
+
// Restore initial models
|
|
136
126
|
this.editor.bailToMark(this.markId)
|
|
137
|
-
|
|
138
127
|
if (this.info.onInteractionEnd) {
|
|
139
128
|
this.editor.setCurrentTool(this.info.onInteractionEnd, {})
|
|
140
129
|
} else {
|
|
@@ -109,17 +109,6 @@ export class Rotating extends StateNode {
|
|
|
109
109
|
}
|
|
110
110
|
|
|
111
111
|
private cancel() {
|
|
112
|
-
// Call onRotateCancel callback before bailing to mark
|
|
113
|
-
const { shapeSnapshots } = this.snapshot
|
|
114
|
-
|
|
115
|
-
shapeSnapshots.forEach(({ shape }) => {
|
|
116
|
-
const current = this.editor.getShape(shape.id)
|
|
117
|
-
if (current) {
|
|
118
|
-
const util = this.editor.getShapeUtil(shape)
|
|
119
|
-
util.onRotateCancel?.(shape, current)
|
|
120
|
-
}
|
|
121
|
-
})
|
|
122
|
-
|
|
123
112
|
this.editor.bailToMark(this.markId)
|
|
124
113
|
if (this.info.onInteractionEnd) {
|
|
125
114
|
this.editor.setCurrentTool(this.info.onInteractionEnd, this.info)
|
|
@@ -203,17 +203,6 @@ export class Translating extends StateNode {
|
|
|
203
203
|
}
|
|
204
204
|
|
|
205
205
|
private cancel() {
|
|
206
|
-
// Call onTranslateCancel callback before resetting
|
|
207
|
-
const { movingShapes } = this.snapshot
|
|
208
|
-
|
|
209
|
-
movingShapes.forEach((shape) => {
|
|
210
|
-
const current = this.editor.getShape(shape.id)
|
|
211
|
-
if (current) {
|
|
212
|
-
const util = this.editor.getShapeUtil(shape)
|
|
213
|
-
util.onTranslateCancel?.(shape, current)
|
|
214
|
-
}
|
|
215
|
-
})
|
|
216
|
-
|
|
217
206
|
this.reset()
|
|
218
207
|
if (this.info.onInteractionEnd) {
|
|
219
208
|
this.editor.setCurrentTool(this.info.onInteractionEnd)
|
package/src/lib/ui/assetUrls.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { LANGUAGES, RecursivePartial, getDefaultCdnBaseUrl } from '@tldraw/editor'
|
|
2
|
+
import { useMemo } from 'react'
|
|
2
3
|
import { DEFAULT_EMBED_DEFINITIONS } from '../defaultEmbedDefinitions'
|
|
3
4
|
import { TLEditorAssetUrls, defaultEditorAssetUrls } from '../utils/static-assets/assetUrls'
|
|
4
5
|
import { TLUiIconType, iconTypes } from './icon-types'
|
|
@@ -41,15 +42,17 @@ export function setDefaultUiAssetUrls(urls: TLUiAssetUrls) {
|
|
|
41
42
|
export function useDefaultUiAssetUrlsWithOverrides(
|
|
42
43
|
overrides?: TLUiAssetUrlOverrides
|
|
43
44
|
): TLUiAssetUrls {
|
|
44
|
-
|
|
45
|
+
return useMemo(() => {
|
|
46
|
+
if (!overrides) return defaultUiAssetUrls
|
|
45
47
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
48
|
+
return {
|
|
49
|
+
fonts: Object.assign({ ...defaultUiAssetUrls.fonts }, { ...overrides?.fonts }),
|
|
50
|
+
icons: Object.assign({ ...defaultUiAssetUrls.icons }, { ...overrides?.icons }),
|
|
51
|
+
embedIcons: Object.assign({ ...defaultUiAssetUrls.embedIcons }, { ...overrides?.embedIcons }),
|
|
52
|
+
translations: Object.assign(
|
|
53
|
+
{ ...defaultUiAssetUrls.translations },
|
|
54
|
+
{ ...overrides?.translations }
|
|
55
|
+
),
|
|
56
|
+
}
|
|
57
|
+
}, [overrides])
|
|
55
58
|
}
|
|
@@ -148,22 +148,20 @@ export const useSelectedShapesAnnouncer = () => {
|
|
|
148
148
|
if (!editor) return
|
|
149
149
|
|
|
150
150
|
const isInSelecting = editor.isIn('select.idle')
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
msg,
|
|
160
|
-
})
|
|
161
|
-
|
|
162
|
-
if (a11yLive) {
|
|
163
|
-
a11y.announce({ msg: a11yLive })
|
|
164
|
-
}
|
|
151
|
+
const selectedShapeIds = editor.getSelectedShapeIds()
|
|
152
|
+
if (isInSelecting && selectedShapeIds !== rPrevSelectedShapeIds.current) {
|
|
153
|
+
rPrevSelectedShapeIds.current = selectedShapeIds
|
|
154
|
+
unsafe__withoutCapture(() => {
|
|
155
|
+
const a11yLive = generateShapeAnnouncementMessage({
|
|
156
|
+
editor,
|
|
157
|
+
selectedShapeIds,
|
|
158
|
+
msg,
|
|
165
159
|
})
|
|
166
|
-
|
|
160
|
+
|
|
161
|
+
if (a11yLive) {
|
|
162
|
+
a11y.announce({ msg: a11yLive })
|
|
163
|
+
}
|
|
164
|
+
})
|
|
167
165
|
}
|
|
168
166
|
},
|
|
169
167
|
[editor, a11y, msg]
|
package/src/lib/ui/components/KeyboardShortcutsDialog/DefaultKeyboardShortcutsDialogContent.tsx
CHANGED
|
@@ -210,49 +210,9 @@ export function DefaultKeyboardShortcutsDialogContent() {
|
|
|
210
210
|
/* do nothing */
|
|
211
211
|
}}
|
|
212
212
|
/>
|
|
213
|
-
<TldrawUiMenuItem
|
|
214
|
-
id="a11y-rotate-shape-cw"
|
|
215
|
-
label="a11y.rotate-shape-cw"
|
|
216
|
-
kbd="shift+﹥"
|
|
217
|
-
onSelect={() => {
|
|
218
|
-
/* do nothing */
|
|
219
|
-
}}
|
|
220
|
-
/>
|
|
221
|
-
<TldrawUiMenuItem
|
|
222
|
-
id="a11y-rotate-shape-cw-fine"
|
|
223
|
-
label="a11y.rotate-shape-cw-fine"
|
|
224
|
-
kbd="shift+alt+﹥"
|
|
225
|
-
onSelect={() => {
|
|
226
|
-
/* do nothing */
|
|
227
|
-
}}
|
|
228
|
-
/>
|
|
229
|
-
<TldrawUiMenuItem
|
|
230
|
-
id="a11y-rotate-shape-ccw"
|
|
231
|
-
label="a11y.rotate-shape-ccw"
|
|
232
|
-
kbd="shift+﹤"
|
|
233
|
-
onSelect={() => {
|
|
234
|
-
/* do nothing */
|
|
235
|
-
}}
|
|
236
|
-
/>
|
|
237
|
-
<TldrawUiMenuItem
|
|
238
|
-
id="a11y-rotate-shape-ccw-fine"
|
|
239
|
-
label="a11y.rotate-shape-ccw-fine"
|
|
240
|
-
kbd="shift+alt+﹤"
|
|
241
|
-
onSelect={() => {
|
|
242
|
-
/* do nothing */
|
|
243
|
-
}}
|
|
244
|
-
/>
|
|
245
213
|
<TldrawUiMenuActionItem actionId="enlarge-shapes" />
|
|
246
214
|
<TldrawUiMenuActionItem actionId="shrink-shapes" />
|
|
247
215
|
<TldrawUiMenuActionItem actionId="a11y-repeat-shape-announce" />
|
|
248
|
-
<TldrawUiMenuItem
|
|
249
|
-
id="a11y-open-keyboard-shortcuts"
|
|
250
|
-
label="a11y.open-keyboard-shortcuts"
|
|
251
|
-
kbd="cmd+alt+/"
|
|
252
|
-
onSelect={() => {
|
|
253
|
-
/* do nothing */
|
|
254
|
-
}}
|
|
255
|
-
/>
|
|
256
216
|
</TldrawUiMenuGroup>
|
|
257
217
|
{showCollaborationUi && (
|
|
258
218
|
<TldrawUiMenuGroup label="shortcuts-dialog.collaboration" id="collaboration">
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { useCanRedo, useCanUndo } from '../../hooks/menu-hooks'
|
|
2
|
-
import { AccessibilityMenu } from '../AccessibilityMenu'
|
|
3
2
|
import { ColorSchemeMenu } from '../ColorSchemeMenu'
|
|
4
3
|
import { KeyboardShortcutsMenuItem } from '../HelpMenu/DefaultHelpMenuContent'
|
|
5
4
|
import { LanguageMenu } from '../LanguageMenu'
|
|
@@ -22,6 +21,7 @@ import {
|
|
|
22
21
|
ToggleGridItem,
|
|
23
22
|
ToggleLockMenuItem,
|
|
24
23
|
TogglePasteAtCursorItem,
|
|
24
|
+
ToggleReduceMotionItem,
|
|
25
25
|
ToggleSnapModeItem,
|
|
26
26
|
ToggleToolLockItem,
|
|
27
27
|
ToggleTransparentBgMenuItem,
|
|
@@ -160,6 +160,7 @@ export function PreferencesGroup() {
|
|
|
160
160
|
<ToggleWrapModeItem />
|
|
161
161
|
<ToggleFocusModeItem />
|
|
162
162
|
<ToggleEdgeScrollingItem />
|
|
163
|
+
<ToggleReduceMotionItem />
|
|
163
164
|
<ToggleDynamicSizeModeItem />
|
|
164
165
|
<TogglePasteAtCursorItem />
|
|
165
166
|
<ToggleDebugModeItem />
|
|
@@ -167,9 +168,6 @@ export function PreferencesGroup() {
|
|
|
167
168
|
<TldrawUiMenuGroup id="color-scheme">
|
|
168
169
|
<ColorSchemeMenu />
|
|
169
170
|
</TldrawUiMenuGroup>
|
|
170
|
-
<TldrawUiMenuGroup id="accessibility-menu">
|
|
171
|
-
<AccessibilityMenu />
|
|
172
|
-
</TldrawUiMenuGroup>
|
|
173
171
|
</TldrawUiMenuSubmenu>
|
|
174
172
|
<LanguageMenu />
|
|
175
173
|
<KeyboardShortcutsMenuItem />
|
|
@@ -45,7 +45,7 @@ export const DefaultNavigationPanel = memo(function DefaultNavigationPanel() {
|
|
|
45
45
|
title={`${msg(unwrapLabel(actions['zoom-out'].label))} ${kbdStr(actions['zoom-out'].kbd!)}`}
|
|
46
46
|
onClick={() => actions['zoom-out'].onSelect('navigation-zone')}
|
|
47
47
|
>
|
|
48
|
-
<TldrawUiButtonIcon
|
|
48
|
+
<TldrawUiButtonIcon icon="minus" />
|
|
49
49
|
</TldrawUiToolbarButton>
|
|
50
50
|
)}
|
|
51
51
|
{ZoomMenu && <ZoomMenu key="zoom-menu" />}
|
|
@@ -56,7 +56,7 @@ export const DefaultNavigationPanel = memo(function DefaultNavigationPanel() {
|
|
|
56
56
|
title={`${msg(unwrapLabel(actions['zoom-in'].label))} ${kbdStr(actions['zoom-in'].kbd!)}`}
|
|
57
57
|
onClick={() => actions['zoom-in'].onSelect('navigation-zone')}
|
|
58
58
|
>
|
|
59
|
-
<TldrawUiButtonIcon
|
|
59
|
+
<TldrawUiButtonIcon icon="plus" />
|
|
60
60
|
</TldrawUiToolbarButton>
|
|
61
61
|
)}
|
|
62
62
|
{Minimap && (
|
|
@@ -64,9 +64,10 @@ export const DefaultNavigationPanel = memo(function DefaultNavigationPanel() {
|
|
|
64
64
|
type="icon"
|
|
65
65
|
data-testid="minimap.toggle-button"
|
|
66
66
|
title={msg('navigation-zone.toggle-minimap')}
|
|
67
|
+
className="tlui-navigation-panel__toggle"
|
|
67
68
|
onClick={toggleMinimap}
|
|
68
69
|
>
|
|
69
|
-
<TldrawUiButtonIcon
|
|
70
|
+
<TldrawUiButtonIcon icon={collapsed ? 'chevrons-ne' : 'chevrons-sw'} />
|
|
70
71
|
</TldrawUiToolbarButton>
|
|
71
72
|
)}
|
|
72
73
|
</>
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { DefaultSpinner } from '@tldraw/editor'
|
|
2
1
|
import React from 'react'
|
|
3
2
|
import { useTranslation } from '../hooks/useTranslation/useTranslation'
|
|
4
3
|
|
|
@@ -6,5 +5,28 @@ import { useTranslation } from '../hooks/useTranslation/useTranslation'
|
|
|
6
5
|
export function Spinner(props: React.SVGProps<SVGSVGElement>) {
|
|
7
6
|
const msg = useTranslation()
|
|
8
7
|
|
|
9
|
-
return
|
|
8
|
+
return (
|
|
9
|
+
<svg
|
|
10
|
+
width={16}
|
|
11
|
+
height={16}
|
|
12
|
+
viewBox="0 0 16 16"
|
|
13
|
+
{...props}
|
|
14
|
+
aria-label={msg('app.loading')}
|
|
15
|
+
aria-hidden="false"
|
|
16
|
+
>
|
|
17
|
+
<g strokeWidth={2} fill="none" fillRule="evenodd">
|
|
18
|
+
<circle strokeOpacity={0.25} cx={8} cy={8} r={7} stroke="currentColor" />
|
|
19
|
+
<path strokeLinecap="round" d="M15 8c0-4.5-4.5-7-7-7" stroke="currentColor">
|
|
20
|
+
<animateTransform
|
|
21
|
+
attributeName="transform"
|
|
22
|
+
type="rotate"
|
|
23
|
+
from="0 8 8"
|
|
24
|
+
to="360 8 8"
|
|
25
|
+
dur="1s"
|
|
26
|
+
repeatCount="indefinite"
|
|
27
|
+
/>
|
|
28
|
+
</path>
|
|
29
|
+
</g>
|
|
30
|
+
</svg>
|
|
31
|
+
)
|
|
10
32
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useEditor, usePassThroughWheelEvents
|
|
1
|
+
import { useEditor, usePassThroughWheelEvents } from '@tldraw/editor'
|
|
2
2
|
import classNames from 'classnames'
|
|
3
3
|
import { ReactNode, memo, useCallback, useEffect, useRef } from 'react'
|
|
4
4
|
import { useRelevantStyles } from '../../hooks/useRelevantStyles'
|
|
@@ -16,7 +16,6 @@ export const DefaultStylePanel = memo(function DefaultStylePanel({
|
|
|
16
16
|
children,
|
|
17
17
|
}: TLUiStylePanelProps) {
|
|
18
18
|
const editor = useEditor()
|
|
19
|
-
const showUiLabels = useValue('showUiLabels', () => editor.user.getShowUiLabels(), [editor])
|
|
20
19
|
|
|
21
20
|
const ref = useRef<HTMLDivElement>(null)
|
|
22
21
|
usePassThroughWheelEvents(ref)
|
|
@@ -51,7 +50,6 @@ export const DefaultStylePanel = memo(function DefaultStylePanel({
|
|
|
51
50
|
ref={ref}
|
|
52
51
|
className={classNames('tlui-style-panel', { 'tlui-style-panel__wrapper': !isMobile })}
|
|
53
52
|
data-ismobile={isMobile}
|
|
54
|
-
data-show-ui-labels={showUiLabels}
|
|
55
53
|
onPointerLeave={handlePointerOut}
|
|
56
54
|
>
|
|
57
55
|
{content}
|