quick fixes (#3128)

- Menu items
- keyboard shortcuts dialog menu

### Change Type

- [x] `patch` — Bug fix
This commit is contained in:
Steve Ruiz 2024-03-12 11:50:12 +00:00 committed by GitHub
parent b0210c0d6d
commit 599a6cd484
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 6 additions and 9 deletions

View file

@ -60,7 +60,7 @@ const components: TLComponents = {
const actions = useActions() const actions = useActions()
return ( return (
<DefaultKeyboardShortcutsDialog {...props}> <DefaultKeyboardShortcutsDialog {...props}>
<TldrawUiMenuGroup id="shortcuts-dialog.file"> <TldrawUiMenuGroup label="shortcuts-dialog.file" id="file">
<TldrawUiMenuItem {...actions[SAVE_FILE_COPY_ACTION]} /> <TldrawUiMenuItem {...actions[SAVE_FILE_COPY_ACTION]} />
<TldrawUiMenuItem {...actions[OPEN_FILE_ACTION]} /> <TldrawUiMenuItem {...actions[OPEN_FILE_ACTION]} />
</TldrawUiMenuGroup> </TldrawUiMenuGroup>

View file

@ -80,12 +80,12 @@ const components: TLComponents = {
const actions = useActions() const actions = useActions()
return ( return (
<DefaultKeyboardShortcutsDialog {...props}> <DefaultKeyboardShortcutsDialog {...props}>
<TldrawUiMenuGroup id="shortcuts-dialog.file"> <TldrawUiMenuGroup label="shortcuts-dialog.file" id="file">
<TldrawUiMenuItem {...actions[SAVE_FILE_COPY_ACTION]} /> <TldrawUiMenuItem {...actions[SAVE_FILE_COPY_ACTION]} />
<TldrawUiMenuItem {...actions[OPEN_FILE_ACTION]} /> <TldrawUiMenuItem {...actions[OPEN_FILE_ACTION]} />
</TldrawUiMenuGroup> </TldrawUiMenuGroup>
<DefaultKeyboardShortcutsDialogContent /> <DefaultKeyboardShortcutsDialogContent />
<TldrawUiMenuGroup id="shortcuts-dialog.collaboration"> <TldrawUiMenuGroup label="shortcuts-dialog.collaboration" id="collaboration">
<TldrawUiMenuItem {...actions[CURSOR_CHAT_ACTION]} /> <TldrawUiMenuItem {...actions[CURSOR_CHAT_ACTION]} />
</TldrawUiMenuGroup> </TldrawUiMenuGroup>
</DefaultKeyboardShortcutsDialog> </DefaultKeyboardShortcutsDialog>

View file

@ -47,7 +47,7 @@ const components: TLComponents = {
const actions = useActions() const actions = useActions()
return ( return (
<DefaultKeyboardShortcutsDialog {...props}> <DefaultKeyboardShortcutsDialog {...props}>
<TldrawUiMenuGroup id="shortcuts-dialog.file"> <TldrawUiMenuGroup label="shortcuts-dialog.file" id="file">
<TldrawUiMenuItem {...actions[SAVE_FILE_COPY_ACTION]} /> <TldrawUiMenuItem {...actions[SAVE_FILE_COPY_ACTION]} />
</TldrawUiMenuGroup> </TldrawUiMenuGroup>
<DefaultKeyboardShortcutsDialogContent /> <DefaultKeyboardShortcutsDialogContent />

View file

@ -49,7 +49,7 @@ export const EmbedDialog = track(function EmbedDialog({ onClose }: TLUiDialogPro
<TldrawUiDialogBody className="tlui-embed-dialog__enter"> <TldrawUiDialogBody className="tlui-embed-dialog__enter">
<TldrawUiInput <TldrawUiInput
className="tlui-embed-dialog__input" className="tlui-embed-dialog__input"
label="embed-url" label="embed-dialog.url"
placeholder="http://example.com" placeholder="http://example.com"
autofocus autofocus
onValueChange={(value) => { onValueChange={(value) => {

View file

@ -11,6 +11,7 @@ export function DefaultKeyboardShortcutsDialogContent() {
<> <>
<TldrawUiMenuGroup label="shortcuts-dialog.tools" id="tools"> <TldrawUiMenuGroup label="shortcuts-dialog.tools" id="tools">
<TldrawUiMenuItem {...actions['toggle-tool-lock']} /> <TldrawUiMenuItem {...actions['toggle-tool-lock']} />
<TldrawUiMenuItem {...actions['insert-media']} />
<TldrawUiMenuItem {...tools['select']} /> <TldrawUiMenuItem {...tools['select']} />
<TldrawUiMenuItem {...tools['draw']} /> <TldrawUiMenuItem {...tools['draw']} />
<TldrawUiMenuItem {...tools['eraser']} /> <TldrawUiMenuItem {...tools['eraser']} />
@ -24,10 +25,6 @@ export function DefaultKeyboardShortcutsDialogContent() {
<TldrawUiMenuItem {...tools['note']} /> <TldrawUiMenuItem {...tools['note']} />
<TldrawUiMenuItem {...tools['laser']} /> <TldrawUiMenuItem {...tools['laser']} />
</TldrawUiMenuGroup> </TldrawUiMenuGroup>
<TldrawUiMenuGroup label="shortcuts-dialog.file" id="file">
<TldrawUiMenuItem {...actions['insert-media']} />
<TldrawUiMenuItem {...actions['print']} />
</TldrawUiMenuGroup>
<TldrawUiMenuGroup label="shortcuts-dialog.preferences" id="preferences"> <TldrawUiMenuGroup label="shortcuts-dialog.preferences" id="preferences">
<TldrawUiMenuItem {...actions['toggle-dark-mode']} /> <TldrawUiMenuItem {...actions['toggle-dark-mode']} />
<TldrawUiMenuItem {...actions['toggle-focus-mode']} /> <TldrawUiMenuItem {...actions['toggle-focus-mode']} />