tldraw 3.16.0-internal.51e99e128bd4 → 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 +23 -297
- package/dist-cjs/index.js +2 -30
- 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/TldrawScribble.js +1 -1
- package/dist-cjs/lib/canvas/TldrawScribble.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 +44 -27
- 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/elbow/ElbowArrowDebug.js +3 -3
- package/dist-cjs/lib/shapes/arrow/elbow/ElbowArrowDebug.js.map +1 -1
- 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 +6 -3
- package/dist-cjs/lib/shapes/draw/DrawShapeUtil.js.map +2 -2
- package/dist-cjs/lib/shapes/embed/EmbedShapeUtil.js +1 -1
- package/dist-cjs/lib/shapes/embed/EmbedShapeUtil.js.map +1 -1
- package/dist-cjs/lib/shapes/frame/FrameShapeUtil.js +17 -17
- package/dist-cjs/lib/shapes/frame/FrameShapeUtil.js.map +2 -2
- package/dist-cjs/lib/shapes/frame/components/FrameHeading.js +1 -1
- package/dist-cjs/lib/shapes/frame/components/FrameHeading.js.map +2 -2
- package/dist-cjs/lib/shapes/geo/GeoShapeUtil.js +2 -2
- package/dist-cjs/lib/shapes/geo/GeoShapeUtil.js.map +2 -2
- package/dist-cjs/lib/shapes/geo/components/GeoShapeBody.js +1 -2
- package/dist-cjs/lib/shapes/geo/components/GeoShapeBody.js.map +2 -2
- package/dist-cjs/lib/shapes/highlight/HighlightShapeUtil.js +4 -5
- package/dist-cjs/lib/shapes/highlight/HighlightShapeUtil.js.map +2 -2
- package/dist-cjs/lib/shapes/image/ImageShapeUtil.js +3 -3
- package/dist-cjs/lib/shapes/image/ImageShapeUtil.js.map +1 -1
- package/dist-cjs/lib/shapes/line/LineShapeUtil.js +5 -20
- package/dist-cjs/lib/shapes/line/LineShapeUtil.js.map +2 -2
- package/dist-cjs/lib/shapes/note/NoteShapeUtil.js +5 -6
- 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/ShapeFill.js +4 -4
- package/dist-cjs/lib/shapes/shared/ShapeFill.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/freehand/svg.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 +13 -7
- package/dist-cjs/lib/shapes/text/TextShapeUtil.js.map +2 -2
- package/dist-cjs/lib/shapes/video/VideoShapeUtil.js +3 -3
- package/dist-cjs/lib/shapes/video/VideoShapeUtil.js.map +1 -1
- package/dist-cjs/lib/styles.js.map +2 -2
- package/dist-cjs/lib/tools/EraserTool/childStates/Erasing.js +1 -25
- package/dist-cjs/lib/tools/EraserTool/childStates/Erasing.js.map +2 -2
- package/dist-cjs/lib/tools/EraserTool/childStates/Pointing.js +0 -12
- package/dist-cjs/lib/tools/EraserTool/childStates/Pointing.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/TldrawUi.js +0 -14
- package/dist-cjs/lib/ui/TldrawUi.js.map +3 -3
- 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/ActionsMenu/DefaultActionsMenu.js +3 -12
- package/dist-cjs/lib/ui/components/ActionsMenu/DefaultActionsMenu.js.map +2 -2
- package/dist-cjs/lib/ui/components/DefaultMenuPanel.js +2 -3
- package/dist-cjs/lib/ui/components/DefaultMenuPanel.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/Minimap/MinimapManager.js +4 -4
- package/dist-cjs/lib/ui/components/Minimap/MinimapManager.js.map +2 -2
- package/dist-cjs/lib/ui/components/MobileStylePanel.js +3 -5
- package/dist-cjs/lib/ui/components/MobileStylePanel.js.map +2 -2
- package/dist-cjs/lib/ui/components/NavigationPanel/DefaultNavigationPanel.js +5 -4
- package/dist-cjs/lib/ui/components/NavigationPanel/DefaultNavigationPanel.js.map +2 -2
- package/dist-cjs/lib/ui/components/PageMenu/DefaultPageMenu.js +1 -2
- package/dist-cjs/lib/ui/components/PageMenu/DefaultPageMenu.js.map +2 -2
- package/dist-cjs/lib/ui/components/SharePanel/PeopleMenuItem.js +2 -3
- package/dist-cjs/lib/ui/components/SharePanel/PeopleMenuItem.js.map +2 -2
- package/dist-cjs/lib/ui/components/SharePanel/UserPresenceColorPicker.js +2 -2
- package/dist-cjs/lib/ui/components/SharePanel/UserPresenceColorPicker.js.map +2 -2
- package/dist-cjs/lib/ui/components/Spinner.js +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 +139 -171
- package/dist-cjs/lib/ui/components/StylePanel/DefaultStylePanelContent.js.map +2 -2
- package/dist-cjs/lib/ui/components/StylePanel/DoubleDropdownPicker.js +3 -3
- package/dist-cjs/lib/ui/components/StylePanel/DoubleDropdownPicker.js.map +2 -2
- package/dist-cjs/lib/ui/components/StylePanel/DropdownPicker.js +25 -26
- package/dist-cjs/lib/ui/components/StylePanel/DropdownPicker.js.map +3 -3
- 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/DefaultImageToolbarContent.js +1 -1
- package/dist-cjs/lib/ui/components/Toolbar/DefaultImageToolbarContent.js.map +2 -2
- package/dist-cjs/lib/ui/components/Toolbar/DefaultToolbar.js +21 -66
- package/dist-cjs/lib/ui/components/Toolbar/DefaultToolbar.js.map +3 -3
- package/dist-cjs/lib/ui/components/Toolbar/OverflowingToolbar.js +80 -189
- package/dist-cjs/lib/ui/components/Toolbar/OverflowingToolbar.js.map +3 -3
- package/dist-cjs/lib/ui/components/Toolbar/ToggleToolLockedButton.js +4 -5
- 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 +16 -7
- package/dist-cjs/lib/ui/components/primitives/TldrawUiButtonPicker.js.map +3 -3
- package/dist-cjs/lib/ui/components/primitives/TldrawUiContextualToolbar.js +1 -1
- package/dist-cjs/lib/ui/components/primitives/TldrawUiContextualToolbar.js.map +2 -2
- package/dist-cjs/lib/ui/components/primitives/TldrawUiDialog.js +1 -1
- package/dist-cjs/lib/ui/components/primitives/TldrawUiDialog.js.map +2 -2
- package/dist-cjs/lib/ui/components/primitives/TldrawUiIcon.js +1 -35
- package/dist-cjs/lib/ui/components/primitives/TldrawUiIcon.js.map +2 -2
- package/dist-cjs/lib/ui/components/primitives/TldrawUiPopover.js +2 -3
- package/dist-cjs/lib/ui/components/primitives/TldrawUiPopover.js.map +3 -3
- 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 +7 -31
- 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/TldrawUiMenuContext.js.map +2 -2
- package/dist-cjs/lib/ui/components/primitives/menus/TldrawUiMenuGroup.js +12 -25
- package/dist-cjs/lib/ui/components/primitives/menus/TldrawUiMenuGroup.js.map +2 -2
- package/dist-cjs/lib/ui/components/primitives/menus/TldrawUiMenuItem.js +22 -154
- 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 +9 -94
- 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 +23 -297
- package/dist-esm/index.mjs +4 -51
- 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/TldrawScribble.mjs +1 -1
- package/dist-esm/lib/canvas/TldrawScribble.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 +44 -30
- 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/elbow/ElbowArrowDebug.mjs +3 -3
- package/dist-esm/lib/shapes/arrow/elbow/ElbowArrowDebug.mjs.map +1 -1
- 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 +6 -4
- package/dist-esm/lib/shapes/draw/DrawShapeUtil.mjs.map +2 -2
- package/dist-esm/lib/shapes/embed/EmbedShapeUtil.mjs +1 -1
- package/dist-esm/lib/shapes/embed/EmbedShapeUtil.mjs.map +1 -1
- package/dist-esm/lib/shapes/frame/FrameShapeUtil.mjs +17 -18
- package/dist-esm/lib/shapes/frame/FrameShapeUtil.mjs.map +2 -2
- package/dist-esm/lib/shapes/frame/components/FrameHeading.mjs +1 -1
- package/dist-esm/lib/shapes/frame/components/FrameHeading.mjs.map +2 -2
- package/dist-esm/lib/shapes/geo/GeoShapeUtil.mjs +2 -3
- package/dist-esm/lib/shapes/geo/GeoShapeUtil.mjs.map +2 -2
- package/dist-esm/lib/shapes/geo/components/GeoShapeBody.mjs +1 -2
- package/dist-esm/lib/shapes/geo/components/GeoShapeBody.mjs.map +2 -2
- package/dist-esm/lib/shapes/highlight/HighlightShapeUtil.mjs +4 -6
- package/dist-esm/lib/shapes/highlight/HighlightShapeUtil.mjs.map +2 -2
- package/dist-esm/lib/shapes/image/ImageShapeUtil.mjs +3 -3
- package/dist-esm/lib/shapes/image/ImageShapeUtil.mjs.map +1 -1
- package/dist-esm/lib/shapes/line/LineShapeUtil.mjs +5 -21
- package/dist-esm/lib/shapes/line/LineShapeUtil.mjs.map +2 -2
- package/dist-esm/lib/shapes/note/NoteShapeUtil.mjs +5 -7
- 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/ShapeFill.mjs +4 -5
- package/dist-esm/lib/shapes/shared/ShapeFill.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/freehand/svg.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 +13 -8
- package/dist-esm/lib/shapes/text/TextShapeUtil.mjs.map +2 -2
- package/dist-esm/lib/shapes/video/VideoShapeUtil.mjs +3 -3
- package/dist-esm/lib/shapes/video/VideoShapeUtil.mjs.map +1 -1
- package/dist-esm/lib/styles.mjs.map +2 -2
- package/dist-esm/lib/tools/EraserTool/childStates/Erasing.mjs +1 -26
- package/dist-esm/lib/tools/EraserTool/childStates/Erasing.mjs.map +2 -2
- package/dist-esm/lib/tools/EraserTool/childStates/Pointing.mjs +0 -13
- package/dist-esm/lib/tools/EraserTool/childStates/Pointing.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/TldrawUi.mjs +2 -16
- package/dist-esm/lib/ui/TldrawUi.mjs.map +3 -3
- 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/ActionsMenu/DefaultActionsMenu.mjs +3 -12
- package/dist-esm/lib/ui/components/ActionsMenu/DefaultActionsMenu.mjs.map +2 -2
- package/dist-esm/lib/ui/components/DefaultMenuPanel.mjs +2 -3
- package/dist-esm/lib/ui/components/DefaultMenuPanel.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/Minimap/MinimapManager.mjs +4 -4
- package/dist-esm/lib/ui/components/Minimap/MinimapManager.mjs.map +2 -2
- package/dist-esm/lib/ui/components/MobileStylePanel.mjs +3 -6
- package/dist-esm/lib/ui/components/MobileStylePanel.mjs.map +2 -2
- package/dist-esm/lib/ui/components/NavigationPanel/DefaultNavigationPanel.mjs +5 -4
- package/dist-esm/lib/ui/components/NavigationPanel/DefaultNavigationPanel.mjs.map +2 -2
- package/dist-esm/lib/ui/components/PageMenu/DefaultPageMenu.mjs +1 -2
- package/dist-esm/lib/ui/components/PageMenu/DefaultPageMenu.mjs.map +2 -2
- package/dist-esm/lib/ui/components/SharePanel/PeopleMenuItem.mjs +2 -3
- package/dist-esm/lib/ui/components/SharePanel/PeopleMenuItem.mjs.map +2 -2
- package/dist-esm/lib/ui/components/SharePanel/UserPresenceColorPicker.mjs +2 -2
- package/dist-esm/lib/ui/components/SharePanel/UserPresenceColorPicker.mjs.map +2 -2
- package/dist-esm/lib/ui/components/Spinner.mjs +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 +139 -171
- package/dist-esm/lib/ui/components/StylePanel/DefaultStylePanelContent.mjs.map +2 -2
- package/dist-esm/lib/ui/components/StylePanel/DoubleDropdownPicker.mjs +3 -3
- package/dist-esm/lib/ui/components/StylePanel/DoubleDropdownPicker.mjs.map +2 -2
- package/dist-esm/lib/ui/components/StylePanel/DropdownPicker.mjs +25 -26
- package/dist-esm/lib/ui/components/StylePanel/DropdownPicker.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/DefaultImageToolbarContent.mjs +1 -1
- package/dist-esm/lib/ui/components/Toolbar/DefaultImageToolbarContent.mjs.map +2 -2
- package/dist-esm/lib/ui/components/Toolbar/DefaultToolbar.mjs +21 -56
- package/dist-esm/lib/ui/components/Toolbar/DefaultToolbar.mjs.map +2 -2
- package/dist-esm/lib/ui/components/Toolbar/OverflowingToolbar.mjs +81 -192
- package/dist-esm/lib/ui/components/Toolbar/OverflowingToolbar.mjs.map +3 -3
- package/dist-esm/lib/ui/components/Toolbar/ToggleToolLockedButton.mjs +4 -5
- 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 +6 -8
- package/dist-esm/lib/ui/components/primitives/TldrawUiButtonPicker.mjs.map +2 -2
- package/dist-esm/lib/ui/components/primitives/TldrawUiContextualToolbar.mjs +1 -1
- package/dist-esm/lib/ui/components/primitives/TldrawUiContextualToolbar.mjs.map +2 -2
- package/dist-esm/lib/ui/components/primitives/TldrawUiDialog.mjs +1 -1
- package/dist-esm/lib/ui/components/primitives/TldrawUiDialog.mjs.map +2 -2
- package/dist-esm/lib/ui/components/primitives/TldrawUiIcon.mjs +2 -36
- package/dist-esm/lib/ui/components/primitives/TldrawUiIcon.mjs.map +2 -2
- 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 +2 -6
- package/dist-esm/lib/ui/components/primitives/TldrawUiSlider.mjs.map +2 -2
- package/dist-esm/lib/ui/components/primitives/TldrawUiToolbar.mjs +7 -31
- 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/TldrawUiMenuContext.mjs.map +2 -2
- package/dist-esm/lib/ui/components/primitives/menus/TldrawUiMenuGroup.mjs +12 -25
- package/dist-esm/lib/ui/components/primitives/menus/TldrawUiMenuGroup.mjs.map +2 -2
- package/dist-esm/lib/ui/components/primitives/menus/TldrawUiMenuItem.mjs +24 -162
- 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 +10 -102
- 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 +34 -12
- package/src/index.ts +2 -39
- 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/TldrawScribble.tsx +1 -1
- package/src/lib/canvas/TldrawSelectionForeground.tsx +1 -5
- package/src/lib/defaultExternalContentHandlers.ts +1 -2
- package/src/lib/shapes/arrow/ArrowShapeOptions.test.ts +1 -2
- package/src/lib/shapes/arrow/ArrowShapeTool.test.ts +3 -4
- package/src/lib/shapes/arrow/ArrowShapeUtil.test.ts +11 -12
- package/src/lib/shapes/arrow/ArrowShapeUtil.tsx +46 -30
- package/src/lib/shapes/arrow/arrowLabel.ts +3 -23
- package/src/lib/shapes/arrow/arrowTargetState.ts +1 -2
- package/src/lib/shapes/arrow/elbow/ElbowArrowDebug.tsx +3 -3
- package/src/lib/shapes/arrow/toolStates/Pointing.tsx +0 -3
- package/src/lib/shapes/draw/DrawShapeTool.test.ts +5 -0
- package/src/lib/shapes/draw/DrawShapeUtil.tsx +7 -4
- package/src/lib/shapes/embed/EmbedShapeUtil.tsx +1 -1
- package/src/lib/shapes/frame/FrameShapeUtil.tsx +21 -26
- package/src/lib/shapes/frame/components/FrameHeading.tsx +1 -1
- package/src/lib/shapes/geo/GeoShapeUtil.tsx +2 -3
- package/src/lib/shapes/geo/components/GeoShapeBody.tsx +2 -2
- package/src/lib/shapes/highlight/HighlightShapeUtil.tsx +4 -7
- package/src/lib/shapes/image/ImageShapeUtil.tsx +3 -3
- package/src/lib/shapes/line/LineShapeUtil.test.tsx +3 -4
- package/src/lib/shapes/line/LineShapeUtil.tsx +6 -25
- package/src/lib/shapes/line/__snapshots__/LineShapeUtil.test.tsx.snap +2 -2
- package/src/lib/shapes/note/NoteShapeUtil.tsx +4 -10
- 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/ShapeFill.tsx +4 -5
- package/src/lib/shapes/shared/SvgTextLabel.tsx +2 -4
- package/src/lib/shapes/shared/freehand/svg.ts +0 -2
- package/src/lib/shapes/shared/usePrefersReducedMotion.tsx +1 -11
- package/src/lib/shapes/text/TextShapeTool.test.ts +5 -6
- package/src/lib/shapes/text/TextShapeUtil.tsx +14 -8
- package/src/lib/shapes/video/VideoShapeUtil.tsx +3 -3
- package/src/lib/styles.tsx +1 -3
- package/src/lib/tools/EraserTool/childStates/Erasing.ts +1 -34
- package/src/lib/tools/EraserTool/childStates/Pointing.ts +0 -20
- 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 +1 -11
- package/src/lib/tools/selection-logic/getHitShapeOnCanvasPointerDown.ts +0 -1
- package/src/lib/ui/TldrawUi.tsx +2 -17
- package/src/lib/ui/components/A11y.tsx +13 -15
- package/src/lib/ui/components/ActionsMenu/DefaultActionsMenu.tsx +3 -15
- package/src/lib/ui/components/DefaultMenuPanel.tsx +3 -4
- 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/Minimap/MinimapManager.ts +4 -4
- package/src/lib/ui/components/MobileStylePanel.tsx +6 -9
- package/src/lib/ui/components/NavigationPanel/DefaultNavigationPanel.tsx +5 -4
- package/src/lib/ui/components/PageMenu/DefaultPageMenu.tsx +2 -3
- package/src/lib/ui/components/SharePanel/PeopleMenuItem.tsx +3 -4
- package/src/lib/ui/components/SharePanel/UserPresenceColorPicker.tsx +3 -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 +106 -146
- package/src/lib/ui/components/StylePanel/DoubleDropdownPicker.tsx +3 -3
- package/src/lib/ui/components/StylePanel/DropdownPicker.tsx +6 -7
- package/src/lib/ui/components/Toolbar/DefaultImageToolbar.tsx +9 -25
- package/src/lib/ui/components/Toolbar/DefaultImageToolbarContent.tsx +1 -1
- package/src/lib/ui/components/Toolbar/DefaultToolbar.tsx +23 -55
- package/src/lib/ui/components/Toolbar/OverflowingToolbar.tsx +61 -212
- 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 +35 -40
- package/src/lib/ui/components/primitives/TldrawUiContextualToolbar.tsx +1 -1
- 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/TldrawUiPopover.tsx +2 -4
- package/src/lib/ui/components/primitives/TldrawUiSlider.tsx +1 -6
- package/src/lib/ui/components/primitives/TldrawUiToolbar.tsx +12 -56
- package/src/lib/ui/components/primitives/menus/TldrawUiMenuCheckboxItem.tsx +2 -2
- package/src/lib/ui/components/primitives/menus/TldrawUiMenuContext.tsx +1 -0
- package/src/lib/ui/components/primitives/menus/TldrawUiMenuGroup.tsx +16 -29
- package/src/lib/ui/components/primitives/menus/TldrawUiMenuItem.tsx +23 -224
- 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 -6
- 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 +11 -142
- 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 +314 -414
- package/src/lib/utils/excalidraw/__snapshots__/putExcalidrawContent.test.tsx.snap +7 -21
- package/src/lib/utils/excalidraw/putExcalidrawContent.ts +1 -1
- package/src/lib/utils/tldr/__snapshots__/buildFromV1Document.test.ts.snap +7 -28
- package/src/lib/utils/tldr/buildFromV1Document.ts +1 -2
- package/src/test/A11y.test.tsx +2 -3
- package/src/test/ClickManager.test.ts +6 -7
- package/src/test/Editor.test.tsx +20 -21
- package/src/test/EraserTool.test.ts +13 -184
- package/src/test/HandTool.test.ts +9 -10
- package/src/test/HighlightShape.test.ts +1 -2
- package/src/test/SelectTool.test.ts +13 -40
- package/src/test/TLUserPreferences.test.ts +3 -4
- package/src/test/TestEditor.ts +15 -13
- package/src/test/TldrawEditor.test.tsx +10 -11
- package/src/test/ZoomTool.test.ts +6 -7
- package/src/test/__snapshots__/drawing.test.ts.snap +2 -2
- package/src/test/__snapshots__/groups.test.tsx.snap +6 -6
- package/src/test/__snapshots__/resizing.test.ts.snap +2 -2
- package/src/test/arrows-megabus.test.tsx +10 -17
- package/src/test/bindings.test.tsx +37 -24
- package/src/test/bookmark-shapes.test.ts +8 -1
- package/src/test/commands/__snapshots__/getSvgString.test.ts.snap +7 -23
- package/src/test/commands/__snapshots__/packShapes.test.ts.snap +8 -8
- package/src/test/commands/__snapshots__/zoomToFit.test.ts.snap +2 -2
- package/src/test/commands/alignShapes.test.tsx +24 -25
- package/src/test/commands/animationSpeed.test.ts +1 -2
- package/src/test/commands/centerOnPoint.test.ts +2 -3
- package/src/test/commands/clipboard.test.ts +2 -3
- package/src/test/commands/createShapes.test.ts +1 -2
- package/src/test/commands/deletePage.test.ts +1 -84
- package/src/test/commands/deleteShapes.test.ts +1 -2
- package/src/test/commands/distributeShapes.test.tsx +10 -11
- package/src/test/commands/getSvgString.test.ts +1 -2
- package/src/test/commands/packShapes.test.ts +4 -5
- package/src/test/commands/resizeShape.test.ts +1 -2
- package/src/test/commands/rotateShapes.test.ts +6 -7
- package/src/test/commands/setCamera.test.ts +3 -4
- package/src/test/commands/setCurrentPage.test.ts +2 -3
- package/src/test/commands/stackShapes.test.ts +10 -11
- package/src/test/commands/stretch.test.tsx +12 -13
- package/src/test/createDeepLink.test.tsx +1 -2
- package/src/test/cropping.test.ts +2 -3
- package/src/test/drawing.test.ts +1 -2
- package/src/test/flipShapes.test.ts +3 -4
- package/src/test/frames.test.ts +24 -25
- package/src/test/getCulledShapes.test.tsx +2 -3
- package/src/test/groups.test.tsx +2 -2
- package/src/test/handleDeepLink.test.tsx +1 -2
- package/src/test/maxShapes.test.ts +2 -3
- package/src/test/modifiers.test.ts +4 -5
- package/src/test/navigation.test.ts +9 -264
- package/src/test/panning.test.ts +1 -2
- package/src/test/perf/perf.test.ts +1 -2
- package/src/test/registerDeepLinkListener.test.tsx +9 -10
- package/src/test/resizing.test.ts +38 -39
- package/src/test/select.test.tsx +3 -4
- package/src/test/selection-omnibus.test.ts +10 -11
- package/src/test/shapeutils.test.ts +48 -398
- package/src/test/translating.test.ts +9 -10
- package/tldraw.css +627 -726
- 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 -268
- package/dist-cjs/lib/ui/components/primitives/TldrawUiTooltip.js.map +0 -7
- package/dist-cjs/lib/ui/components/primitives/layout.js +0 -76
- package/dist-cjs/lib/ui/components/primitives/layout.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 -245
- package/dist-esm/lib/ui/components/primitives/TldrawUiTooltip.mjs.map +0 -7
- package/dist-esm/lib/ui/components/primitives/layout.mjs +0 -46
- package/dist-esm/lib/ui/components/primitives/layout.mjs.map +0 -7
- package/src/lib/ui/components/AccessibilityMenu.tsx +0 -20
- package/src/lib/ui/components/primitives/TldrawUiTooltip.tsx +0 -327
- package/src/lib/ui/components/primitives/layout.tsx +0 -107
- package/src/test/inner-outer-margin.test.ts +0 -315
|
@@ -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
|
|
@@ -127,10 +125,8 @@ export interface TLUiEventMap {
|
|
|
127
125
|
'open-context-menu': null
|
|
128
126
|
'adjust-shape-styles': null
|
|
129
127
|
'copy-link': null
|
|
130
|
-
'drag-tool': { id: string }
|
|
131
128
|
'image-replace': null
|
|
132
129
|
'video-replace': null
|
|
133
|
-
'open-kbd-shortcuts': null
|
|
134
130
|
'rich-text': {
|
|
135
131
|
operation:
|
|
136
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,18 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
assertExists,
|
|
3
|
-
createShapeId,
|
|
4
|
-
Editor,
|
|
5
|
-
GeoShapeGeoStyle,
|
|
6
|
-
getIndicesBetween,
|
|
7
|
-
TLLineShape,
|
|
8
|
-
TLPointerEventInfo,
|
|
9
|
-
TLShapeId,
|
|
10
|
-
toRichText,
|
|
11
|
-
useMaybeEditor,
|
|
12
|
-
} from '@tldraw/editor'
|
|
1
|
+
import { Editor, GeoShapeGeoStyle, useMaybeEditor } from '@tldraw/editor'
|
|
13
2
|
import * as React from 'react'
|
|
14
3
|
import { EmbedDialog } from '../components/EmbedDialog'
|
|
15
|
-
import { TLUiIconJsx } from '../components/primitives/TldrawUiIcon'
|
|
16
4
|
import { useA11y } from '../context/a11y'
|
|
17
5
|
import { TLUiEventSource, useUiEvents } from '../context/events'
|
|
18
6
|
import { TLUiIconType } from '../icon-types'
|
|
@@ -28,9 +16,8 @@ export interface TLUiToolItem<
|
|
|
28
16
|
id: string
|
|
29
17
|
label: TranslationKey
|
|
30
18
|
shortcutsLabel?: TranslationKey
|
|
31
|
-
icon: IconType
|
|
19
|
+
icon: IconType
|
|
32
20
|
onSelect(source: TLUiEventSource): void
|
|
33
|
-
onDragStart?(source: TLUiEventSource, info: TLPointerEventInfo): void
|
|
34
21
|
/**
|
|
35
22
|
* The keyboard shortcut for this tool. This is a string that can be a single key,
|
|
36
23
|
* or a combination of keys.
|
|
@@ -138,28 +125,21 @@ export function ToolsProvider({ overrides, children }: TLUiToolsProviderProps) {
|
|
|
138
125
|
onToolSelect(source, this)
|
|
139
126
|
},
|
|
140
127
|
},
|
|
141
|
-
...[...GeoShapeGeoStyle.values].map((
|
|
142
|
-
id
|
|
143
|
-
label: `tool.${
|
|
128
|
+
...[...GeoShapeGeoStyle.values].map((id) => ({
|
|
129
|
+
id,
|
|
130
|
+
label: `tool.${id}` as TLUiTranslationKey,
|
|
144
131
|
meta: {
|
|
145
|
-
geo,
|
|
132
|
+
geo: id,
|
|
146
133
|
},
|
|
147
|
-
kbd:
|
|
148
|
-
icon: ('geo-' +
|
|
134
|
+
kbd: id === 'rectangle' ? 'r' : id === 'ellipse' ? 'o' : undefined,
|
|
135
|
+
icon: ('geo-' + id) as TLUiIconType,
|
|
149
136
|
onSelect(source: TLUiEventSource) {
|
|
150
137
|
editor.run(() => {
|
|
151
|
-
editor.setStyleForNextShapes(GeoShapeGeoStyle,
|
|
138
|
+
editor.setStyleForNextShapes(GeoShapeGeoStyle, id)
|
|
152
139
|
editor.setCurrentTool('geo')
|
|
153
|
-
onToolSelect(source, this, `geo-${
|
|
140
|
+
onToolSelect(source, this, `geo-${id}`)
|
|
154
141
|
})
|
|
155
142
|
},
|
|
156
|
-
onDragStart(source: TLUiEventSource, info: TLPointerEventInfo) {
|
|
157
|
-
onDragFromToolbarToCreateShape(editor, info, {
|
|
158
|
-
createShape: (id) =>
|
|
159
|
-
editor.createShape({ id, type: 'geo', props: { w: 200, h: 200, geo } }),
|
|
160
|
-
})
|
|
161
|
-
trackEvent('drag-tool', { source, id: 'geo' })
|
|
162
|
-
},
|
|
163
143
|
})),
|
|
164
144
|
{
|
|
165
145
|
id: 'arrow',
|
|
@@ -170,17 +150,6 @@ export function ToolsProvider({ overrides, children }: TLUiToolsProviderProps) {
|
|
|
170
150
|
editor.setCurrentTool('arrow')
|
|
171
151
|
onToolSelect(source, this)
|
|
172
152
|
},
|
|
173
|
-
onDragStart(source: TLUiEventSource, info: TLPointerEventInfo) {
|
|
174
|
-
onDragFromToolbarToCreateShape(editor, info, {
|
|
175
|
-
createShape: (id) =>
|
|
176
|
-
editor.createShape({
|
|
177
|
-
id,
|
|
178
|
-
type: 'arrow',
|
|
179
|
-
props: { start: { x: 0, y: 0 }, end: { x: 200, y: 0 } },
|
|
180
|
-
}),
|
|
181
|
-
})
|
|
182
|
-
trackEvent('drag-tool', { source, id: 'arrow' })
|
|
183
|
-
},
|
|
184
153
|
},
|
|
185
154
|
{
|
|
186
155
|
id: 'line',
|
|
@@ -191,24 +160,6 @@ export function ToolsProvider({ overrides, children }: TLUiToolsProviderProps) {
|
|
|
191
160
|
editor.setCurrentTool('line')
|
|
192
161
|
onToolSelect(source, this)
|
|
193
162
|
},
|
|
194
|
-
onDragStart(source, info) {
|
|
195
|
-
onDragFromToolbarToCreateShape(editor, info, {
|
|
196
|
-
createShape: (id) => {
|
|
197
|
-
const [start, end] = getIndicesBetween(null, null, 2)
|
|
198
|
-
editor.createShape<TLLineShape>({
|
|
199
|
-
id,
|
|
200
|
-
type: 'line',
|
|
201
|
-
props: {
|
|
202
|
-
points: {
|
|
203
|
-
[start]: { id: start, index: start, x: 0, y: 200 },
|
|
204
|
-
[end]: { id: end, index: end, x: 200, y: 0 },
|
|
205
|
-
},
|
|
206
|
-
},
|
|
207
|
-
})
|
|
208
|
-
},
|
|
209
|
-
})
|
|
210
|
-
trackEvent('drag-tool', { source, id: 'line' })
|
|
211
|
-
},
|
|
212
163
|
},
|
|
213
164
|
{
|
|
214
165
|
id: 'frame',
|
|
@@ -219,12 +170,6 @@ export function ToolsProvider({ overrides, children }: TLUiToolsProviderProps) {
|
|
|
219
170
|
editor.setCurrentTool('frame')
|
|
220
171
|
onToolSelect(source, this)
|
|
221
172
|
},
|
|
222
|
-
onDragStart(source, info) {
|
|
223
|
-
onDragFromToolbarToCreateShape(editor, info, {
|
|
224
|
-
createShape: (id) => editor.createShape({ id, type: 'frame' }),
|
|
225
|
-
})
|
|
226
|
-
trackEvent('drag-tool', { source, id: 'frame' })
|
|
227
|
-
},
|
|
228
173
|
},
|
|
229
174
|
{
|
|
230
175
|
id: 'text',
|
|
@@ -235,17 +180,6 @@ export function ToolsProvider({ overrides, children }: TLUiToolsProviderProps) {
|
|
|
235
180
|
editor.setCurrentTool('text')
|
|
236
181
|
onToolSelect(source, this)
|
|
237
182
|
},
|
|
238
|
-
onDragStart(source, info) {
|
|
239
|
-
onDragFromToolbarToCreateShape(editor, info, {
|
|
240
|
-
createShape: (id) =>
|
|
241
|
-
editor.createShape({ id, type: 'text', props: { richText: toRichText('Text') } }),
|
|
242
|
-
onDragEnd: (id) => {
|
|
243
|
-
editor.setEditingShape(id)
|
|
244
|
-
editor.emit('select-all-text', { shapeId: id })
|
|
245
|
-
},
|
|
246
|
-
})
|
|
247
|
-
trackEvent('drag-tool', { source, id: 'text' })
|
|
248
|
-
},
|
|
249
183
|
},
|
|
250
184
|
{
|
|
251
185
|
id: 'asset',
|
|
@@ -266,16 +200,6 @@ export function ToolsProvider({ overrides, children }: TLUiToolsProviderProps) {
|
|
|
266
200
|
editor.setCurrentTool('note')
|
|
267
201
|
onToolSelect(source, this)
|
|
268
202
|
},
|
|
269
|
-
onDragStart(source, info) {
|
|
270
|
-
onDragFromToolbarToCreateShape(editor, info, {
|
|
271
|
-
createShape: (id) => editor.createShape({ id, type: 'note' }),
|
|
272
|
-
onDragEnd: (id) => {
|
|
273
|
-
editor.setEditingShape(id)
|
|
274
|
-
editor.emit('select-all-text', { shapeId: id })
|
|
275
|
-
},
|
|
276
|
-
})
|
|
277
|
-
trackEvent('drag-tool', { source, id: 'note' })
|
|
278
|
-
},
|
|
279
203
|
},
|
|
280
204
|
{
|
|
281
205
|
id: 'laser',
|
|
@@ -319,7 +243,7 @@ export function ToolsProvider({ overrides, children }: TLUiToolsProviderProps) {
|
|
|
319
243
|
}
|
|
320
244
|
|
|
321
245
|
return tools
|
|
322
|
-
}, [overrides, editor, helpers, onToolSelect
|
|
246
|
+
}, [overrides, editor, helpers, onToolSelect])
|
|
323
247
|
|
|
324
248
|
return <ToolsContext.Provider value={tools}>{children}</ToolsContext.Provider>
|
|
325
249
|
}
|
|
@@ -334,58 +258,3 @@ export function useTools() {
|
|
|
334
258
|
|
|
335
259
|
return ctx
|
|
336
260
|
}
|
|
337
|
-
|
|
338
|
-
/**
|
|
339
|
-
* Options for {@link onDragFromToolbarToCreateShape}.
|
|
340
|
-
* @public
|
|
341
|
-
*/
|
|
342
|
-
export interface OnDragFromToolbarToCreateShapesOpts {
|
|
343
|
-
/**
|
|
344
|
-
* Create the shape being dragged. You don't need to worry about positioning it, as it'll be
|
|
345
|
-
* immediately updated with the correct position.
|
|
346
|
-
*/
|
|
347
|
-
createShape(id: TLShapeId): void
|
|
348
|
-
/**
|
|
349
|
-
* Called once the drag interaction has finished.
|
|
350
|
-
*/
|
|
351
|
-
onDragEnd?(id: TLShapeId): void
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
/**
|
|
355
|
-
* A helper method to use in {@link TLUiToolItem#onDragStart} to create a shape by dragging it from
|
|
356
|
-
* the toolbar.
|
|
357
|
-
* @public
|
|
358
|
-
*/
|
|
359
|
-
export function onDragFromToolbarToCreateShape(
|
|
360
|
-
editor: Editor,
|
|
361
|
-
info: TLPointerEventInfo,
|
|
362
|
-
opts: OnDragFromToolbarToCreateShapesOpts
|
|
363
|
-
) {
|
|
364
|
-
const { x, y } = editor.inputs.currentPagePoint
|
|
365
|
-
|
|
366
|
-
const stoppingPoint = editor.markHistoryStoppingPoint('drag shape tool')
|
|
367
|
-
editor.setCurrentTool('select.translating')
|
|
368
|
-
|
|
369
|
-
const id = createShapeId()
|
|
370
|
-
opts.createShape(id)
|
|
371
|
-
const shape = assertExists(editor.getShape(id), 'Shape not found')
|
|
372
|
-
|
|
373
|
-
const { w, h } = editor.getShapePageBounds(id)!
|
|
374
|
-
editor.updateShape({ id, type: shape.type, x: x - w / 2, y: y - h / 2 })
|
|
375
|
-
editor.select(id)
|
|
376
|
-
|
|
377
|
-
editor.setCurrentTool('select.translating', {
|
|
378
|
-
...info,
|
|
379
|
-
target: 'shape',
|
|
380
|
-
shape: editor.getShape(id),
|
|
381
|
-
isCreating: true,
|
|
382
|
-
creatingMarkId: stoppingPoint,
|
|
383
|
-
onCreate() {
|
|
384
|
-
editor.setCurrentTool('select.idle')
|
|
385
|
-
editor.select(id)
|
|
386
|
-
opts.onDragEnd?.(id)
|
|
387
|
-
},
|
|
388
|
-
})
|
|
389
|
-
|
|
390
|
-
editor.getCurrentTool().setCurrentToolIdMask(shape.type)
|
|
391
|
-
}
|
|
@@ -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-internal.
|
|
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-19T10:
|
|
8
|
-
patch: '2025-08-19T10:
|
|
7
|
+
minor: '2025-08-19T10:21:26.717Z',
|
|
8
|
+
patch: '2025-08-19T10:21:26.717Z',
|
|
9
9
|
}
|