@dxos/app-framework 0.3.10-main.dcfebef → 0.3.10-main.ec4f2f4

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.
@@ -1,61 +0,0 @@
1
- //
2
- // Copyright 2023 DXOS.org
3
- //
4
-
5
- import React from 'react';
6
-
7
- import { type Label } from '@dxos/app-graph';
8
- import { Keyboard, keySymbols } from '@dxos/keyboard';
9
- import { Button, Dialog, DensityProvider, useTranslation } from '@dxos/react-ui';
10
- import { mx } from '@dxos/react-ui-theme';
11
-
12
- export const ShortcutsDialogContent = () => {
13
- const { t } = useTranslation('os');
14
-
15
- const bindings = Keyboard.singleton.getBindings();
16
-
17
- // TODO(burdon): Factor out.
18
- // TODO(burdon): How to access all translations across plugins?
19
- const getLabel = (label: Label) => (Array.isArray(label) ? t(...label) : label);
20
-
21
- return (
22
- <DensityProvider density='fine'>
23
- <Dialog.Content classNames={['md:max-is-[30rem] overflow-hidden']}>
24
- <Dialog.Title>{t('shortcuts dialog title', { ns: 'os' })}</Dialog.Title>
25
-
26
- <table className='table-fixed border-collapse my-4'>
27
- <tbody>
28
- {bindings.map((binding, i) => (
29
- <tr key={i}>
30
- <td className='p-1 w-[120px]'>
31
- <div className='flex gap-1'>
32
- {keySymbols(binding.binding).map((c, i) => (
33
- <span
34
- key={i}
35
- className={mx(
36
- 'inline-flex w-[24px] h-[24px] justify-center items-center text-xs',
37
- 'rounded border border-neutral-300 dark:border-neutral-600 bg-neutral-50 dark:bg-neutral-850',
38
- )}
39
- >
40
- {c}
41
- </span>
42
- ))}
43
- </div>
44
- </td>
45
- <td className='p-1'>
46
- <span className='grow truncate'>{getLabel(binding.data as Label)}</span>
47
- </td>
48
- </tr>
49
- ))}
50
- </tbody>
51
- </table>
52
-
53
- <Dialog.Close asChild>
54
- <Button variant='primary' classNames='mbs-2'>
55
- {t('close label', { ns: 'os' })}
56
- </Button>
57
- </Dialog.Close>
58
- </Dialog.Content>
59
- </DensityProvider>
60
- );
61
- };