import { defineMessages, noop } from '@tldraw/editor' import { useShowCollaborationUi } from '../../hooks/useCollaborationStatus' import { TldrawUiMenuActionItem } from '../primitives/menus/TldrawUiMenuActionItem' import { TldrawUiMenuGroup } from '../primitives/menus/TldrawUiMenuGroup' import { TldrawUiMenuItem } from '../primitives/menus/TldrawUiMenuItem' import { TldrawUiMenuToolItem } from '../primitives/menus/TldrawUiMenuToolItem' // The shortcut rows name actions from all over the UI, so only the ids nothing else declares // are declared here — a second copy of an English string is a second thing to keep in step. // `label` is data the menu primitives translate, so these reference the id rather than being ``. const messages = defineMessages({ toolRichTextOrderedList: { id: 'tool.rich-text-orderedList', defaultMessage: 'Ordered list' }, a11yEnterLeaveContainer: { id: 'a11y.enter-leave-container', defaultMessage: 'Enter/leave container', }, a11yMoveShape: { id: 'a11y.move-shape', defaultMessage: 'Move shape' }, a11yMoveShapeFaster: { id: 'a11y.move-shape-faster', defaultMessage: 'Move shape faster' }, a11yOpenContextMenu: { id: 'a11y.open-context-menu', defaultMessage: 'Context menu…' }, a11yOpenKeyboardShortcuts: { id: 'a11y.open-keyboard-shortcuts', defaultMessage: 'Keyboard shortcuts', }, a11yPanCamera: { id: 'a11y.pan-camera', defaultMessage: 'Pan camera' }, a11yRotateShapeCcw: { id: 'a11y.rotate-shape-ccw', defaultMessage: 'Rotate shape counterclockwise', }, a11yRotateShapeCcwFine: { id: 'a11y.rotate-shape-ccw-fine', defaultMessage: 'Rotate shape counterclockwise (fine)', }, a11yRotateShapeCw: { id: 'a11y.rotate-shape-cw', defaultMessage: 'Rotate shape clockwise' }, a11yRotateShapeCwFine: { id: 'a11y.rotate-shape-cw-fine', defaultMessage: 'Rotate shape clockwise (fine)', }, a11ySelectShape: { id: 'a11y.select-shape', defaultMessage: 'Select next shape' }, a11ySelectShapeDirection: { id: 'a11y.select-shape-direction', defaultMessage: 'Select shape in direction', }, actionZoomQuick: { id: 'action.zoom-quick', defaultMessage: 'Quick zoom' }, shortcutsDialogA11y: { id: 'shortcuts-dialog.a11y', defaultMessage: 'Accessibility' }, shortcutsDialogCollaboration: { id: 'shortcuts-dialog.collaboration', defaultMessage: 'Collaboration', }, shortcutsDialogEdit: { id: 'shortcuts-dialog.edit', defaultMessage: 'Edit' }, shortcutsDialogPreferences: { id: 'shortcuts-dialog.preferences', defaultMessage: 'Preferences' }, shortcutsDialogTextFormatting: { id: 'shortcuts-dialog.text-formatting', defaultMessage: 'Text formatting', }, shortcutsDialogTools: { id: 'shortcuts-dialog.tools', defaultMessage: 'Tools' }, shortcutsDialogTransform: { id: 'shortcuts-dialog.transform', defaultMessage: 'Transform' }, shortcutsDialogView: { id: 'shortcuts-dialog.view', defaultMessage: 'View' }, toolPointerDown: { id: 'tool.pointer-down', defaultMessage: 'Pointer down' }, toolRichTextHeader: { id: 'tool.rich-text-header', defaultMessage: 'Header' }, toolRichTextStrikethrough: { id: 'tool.rich-text-strikethrough', defaultMessage: 'Strikethrough', }, }) /** @public @react */ export function DefaultKeyboardShortcutsDialogContent() { const showCollaborationUi = useShowCollaborationUi() return ( <> {showCollaborationUi && ( )} ) }