@dxos/app-framework 0.3.10-main.c5193cc → 0.3.10-main.c9b5e9b
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/lib/browser/index.mjs +2 -48
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node/index.cjs +1 -46
- package/dist/lib/node/index.cjs.map +4 -4
- package/dist/lib/node/meta.json +1 -1
- package/dist/types/src/plugins/components/index.d.ts +0 -1
- package/dist/types/src/plugins/components/index.d.ts.map +1 -1
- package/package.json +14 -14
- package/src/plugins/components/index.ts +0 -1
- package/dist/types/src/plugins/components/ShortcutsDialog.d.ts +0 -2
- package/dist/types/src/plugins/components/ShortcutsDialog.d.ts.map +0 -1
- package/src/plugins/components/ShortcutsDialog.tsx +0 -65
|
@@ -1,65 +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, 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
|
-
// TODO(burdon): Factor out.
|
|
16
|
-
// TODO(burdon): How to access all translations across plugins?
|
|
17
|
-
const toString = (label: Label) => (Array.isArray(label) ? t(...label) : label);
|
|
18
|
-
|
|
19
|
-
// TODO(burdon): Get shortcuts from TextEditor.
|
|
20
|
-
const bindings = Keyboard.singleton.getBindings();
|
|
21
|
-
bindings.sort((a, b) => {
|
|
22
|
-
return toString(a.data)?.toLowerCase().localeCompare(toString(b.data)?.toLowerCase());
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
return (
|
|
26
|
-
<Dialog.Content classNames={['max-bs-[40rem] md:max-is-[30rem] overflow-hidden']}>
|
|
27
|
-
<Dialog.Title>{t('shortcuts dialog title', { ns: 'os' })}</Dialog.Title>
|
|
28
|
-
|
|
29
|
-
<div className='grow overflow-y-auto py-2'>
|
|
30
|
-
<table className='table-fixed border-collapse my-4'>
|
|
31
|
-
<tbody>
|
|
32
|
-
{bindings.map((binding, i) => (
|
|
33
|
-
<tr key={i}>
|
|
34
|
-
<td className='p-1 w-[120px]'>
|
|
35
|
-
<div className='flex gap-1'>
|
|
36
|
-
{keySymbols(binding.binding).map((c, i) => (
|
|
37
|
-
<span
|
|
38
|
-
key={i}
|
|
39
|
-
className={mx(
|
|
40
|
-
'inline-flex w-[24px] h-[24px] justify-center items-center text-xs',
|
|
41
|
-
'rounded border border-neutral-300 dark:border-neutral-600 bg-neutral-50 dark:bg-neutral-850',
|
|
42
|
-
)}
|
|
43
|
-
>
|
|
44
|
-
{c}
|
|
45
|
-
</span>
|
|
46
|
-
))}
|
|
47
|
-
</div>
|
|
48
|
-
</td>
|
|
49
|
-
<td className='p-1'>
|
|
50
|
-
<span className='grow truncate'>{toString(binding.data as Label)}</span>
|
|
51
|
-
</td>
|
|
52
|
-
</tr>
|
|
53
|
-
))}
|
|
54
|
-
</tbody>
|
|
55
|
-
</table>
|
|
56
|
-
</div>
|
|
57
|
-
|
|
58
|
-
<Dialog.Close asChild>
|
|
59
|
-
<Button variant='primary' classNames='mbs-2'>
|
|
60
|
-
{t('close label', { ns: 'os' })}
|
|
61
|
-
</Button>
|
|
62
|
-
</Dialog.Close>
|
|
63
|
-
</Dialog.Content>
|
|
64
|
-
);
|
|
65
|
-
};
|