@dxos/app-framework 0.3.10-main.c5193cc → 0.3.10-main.cbe7692

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/app-framework",
3
- "version": "0.3.10-main.c5193cc",
3
+ "version": "0.3.10-main.cbe7692",
4
4
  "description": "A framework for building applications from composible plugins.",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
@@ -16,26 +16,26 @@
16
16
  "@preact/signals-react": "^1.3.6",
17
17
  "deepsignal": "1.4.0-shallow.0",
18
18
  "zod": "^3.22.4",
19
- "@dxos/app-graph": "0.3.10-main.c5193cc",
20
- "@dxos/async": "0.3.10-main.c5193cc",
21
- "@dxos/debug": "0.3.10-main.c5193cc",
22
- "@dxos/invariant": "0.3.10-main.c5193cc",
23
- "@dxos/keyboard": "0.3.10-main.c5193cc",
24
- "@dxos/react-ui-searchlist": "0.3.10-main.c5193cc",
25
- "@dxos/local-storage": "0.3.10-main.c5193cc",
26
- "@dxos/log": "0.3.10-main.c5193cc"
19
+ "@dxos/app-graph": "0.3.10-main.cbe7692",
20
+ "@dxos/invariant": "0.3.10-main.cbe7692",
21
+ "@dxos/async": "0.3.10-main.cbe7692",
22
+ "@dxos/keyboard": "0.3.10-main.cbe7692",
23
+ "@dxos/debug": "0.3.10-main.cbe7692",
24
+ "@dxos/local-storage": "0.3.10-main.cbe7692",
25
+ "@dxos/log": "0.3.10-main.cbe7692",
26
+ "@dxos/react-ui-searchlist": "0.3.10-main.cbe7692"
27
27
  },
28
28
  "devDependencies": {
29
29
  "@types/react": "^18.0.21",
30
30
  "react": "^18.2.0",
31
- "@dxos/storybook-utils": "0.3.10-main.c5193cc",
32
- "@dxos/react-ui": "0.3.10-main.c5193cc",
33
- "@dxos/react-ui-theme": "0.3.10-main.c5193cc"
31
+ "@dxos/react-ui": "0.3.10-main.cbe7692",
32
+ "@dxos/react-ui-theme": "0.3.10-main.cbe7692",
33
+ "@dxos/storybook-utils": "0.3.10-main.cbe7692"
34
34
  },
35
35
  "peerDependencies": {
36
36
  "react": "*",
37
- "@dxos/react-ui": "0.3.10-main.c5193cc",
38
- "@dxos/react-ui-theme": "0.3.10-main.c5193cc"
37
+ "@dxos/react-ui-theme": "0.3.10-main.cbe7692",
38
+ "@dxos/react-ui": "0.3.10-main.cbe7692"
39
39
  },
40
40
  "publishConfig": {
41
41
  "access": "public"
@@ -16,7 +16,7 @@ export const CommandsDialogContent = ({ graph }: { graph?: Graph }) => {
16
16
 
17
17
  // TODO(burdon): Factor out.
18
18
  // TODO(burdon): How to access all translations across plugins?
19
- const toString = (label: Label) => (Array.isArray(label) ? t(...label) : label);
19
+ const getLabel = (label: Label) => (Array.isArray(label) ? t(...label) : label);
20
20
 
21
21
  // Traverse graph.
22
22
  // TODO(burdon): Factor out commonality with shortcut dialog.
@@ -38,10 +38,6 @@ export const CommandsDialogContent = ({ graph }: { graph?: Graph }) => {
38
38
  },
39
39
  });
40
40
 
41
- actions.sort(({ label: a }, { label: b }) => {
42
- return toString(a)?.toLowerCase().localeCompare(toString(b)?.toLowerCase());
43
- });
44
-
45
41
  // console.log(JSON.stringify(actions, undefined, 2));
46
42
  return actions;
47
43
  }, [graph]);
@@ -55,10 +51,10 @@ export const CommandsDialogContent = ({ graph }: { graph?: Graph }) => {
55
51
 
56
52
  {/* TODO(burdon): BUG: Overscrolls container. */}
57
53
  <SearchList.Root label={t('commandlist input placeholder')} classNames='flex flex-col grow overflow-hidden my-2'>
58
- <SearchList.Input placeholder={t('commandlist input placeholder')} classNames={mx('px-1 my-2')} />
54
+ <SearchList.Input placeholder={t('commandlist input placeholder')} classNames={mx('px-3 my-2')} />
59
55
  <SearchList.Content classNames={['max-bs-[30rem] overflow-auto']}>
60
56
  {actions?.map((action) => {
61
- const label = toString(action.label);
57
+ const label = getLabel(action.label);
62
58
  const Icon = action.icon ?? DotOutline;
63
59
  return (
64
60
  <SearchList.Item
@@ -75,7 +71,7 @@ export const CommandsDialogContent = ({ graph }: { graph?: Graph }) => {
75
71
  void action.invoke();
76
72
  });
77
73
  }}
78
- classNames='flex items-center gap-2'
74
+ classNames='flex items-center gap-2 pli-2'
79
75
  disabled={action.properties.disabled}
80
76
  {...(action.properties?.testId && { 'data-testid': action.properties.testId })}
81
77
  >
@@ -89,7 +85,6 @@ export const CommandsDialogContent = ({ graph }: { graph?: Graph }) => {
89
85
  })}
90
86
  </SearchList.Content>
91
87
  </SearchList.Root>
92
-
93
88
  <Dialog.Close asChild>
94
89
  <Button ref={buttonRef} variant='primary' classNames='mbs-2'>
95
90
  {t('close label', { ns: 'os' })}
@@ -31,12 +31,13 @@ export const SettingsDialogContent = () => {
31
31
  .map((plugin) => plugin!.meta)
32
32
  .sort(({ name: a }, { name: b }) => a?.localeCompare(b ?? '') ?? 0);
33
33
 
34
- // TODO(burdon): Common treatment for dialogs (e.g., shrink height to fit, mobile, etc.)
34
+ // TODO(burdon): Vertical layout if mobile (pattern).
35
+ // TODO(burdon): BUG: Dialogs do not compress if screen height is shrunk.
35
36
  return (
36
- <Dialog.Content classNames={['h-full md:max-is-[40rem] overflow-hidden']}>
37
+ <Dialog.Content classNames={['md:max-is-[40rem] overflow-hidden']}>
37
38
  <Dialog.Title>{t('settings dialog title', { ns: 'os' })}</Dialog.Title>
38
39
 
39
- <div className='flex grow mlb-4 overflow-hidden'>
40
+ <div className='flex grow mlb-4 overflow-hidden max-bs-[40rem]'>
40
41
  <div className={mx('flex flex-col w-[200px] space-y-4 pr-4 border-r overflow-y-auto', groupBorder)}>
41
42
  <PluginList
42
43
  title='Options'
@@ -59,7 +60,7 @@ export const SettingsDialogContent = () => {
59
60
  </div>
60
61
 
61
62
  <Dialog.Close asChild>
62
- <Button variant='primary' classNames='mbs-2' autoFocus>
63
+ <Button variant='primary' classNames='mbs-2'>
63
64
  {t('done label', { ns: 'os' })}
64
65
  </Button>
65
66
  </Dialog.Close>
@@ -12,48 +12,42 @@ import { mx } from '@dxos/react-ui-theme';
12
12
  export const ShortcutsDialogContent = () => {
13
13
  const { t } = useTranslation('os');
14
14
 
15
+ const bindings = Keyboard.singleton.getBindings();
16
+
15
17
  // TODO(burdon): Factor out.
16
18
  // 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
- });
19
+ const getLabel = (label: Label) => (Array.isArray(label) ? t(...label) : label);
24
20
 
25
21
  return (
26
- <Dialog.Content classNames={['max-bs-[40rem] md:max-is-[30rem] overflow-hidden']}>
22
+ <Dialog.Content classNames={['md:max-is-[30rem] overflow-hidden']}>
27
23
  <Dialog.Title>{t('shortcuts dialog title', { ns: 'os' })}</Dialog.Title>
28
24
 
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>
25
+ <table className='table-fixed border-collapse my-4'>
26
+ <tbody>
27
+ {bindings.map((binding, i) => (
28
+ <tr key={i}>
29
+ <td className='p-1 w-[120px]'>
30
+ <div className='flex gap-1'>
31
+ {keySymbols(binding.binding).map((c, i) => (
32
+ <span
33
+ key={i}
34
+ className={mx(
35
+ 'inline-flex w-[24px] h-[24px] justify-center items-center text-xs',
36
+ 'rounded border border-neutral-300 dark:border-neutral-600 bg-neutral-50 dark:bg-neutral-850',
37
+ )}
38
+ >
39
+ {c}
40
+ </span>
41
+ ))}
42
+ </div>
43
+ </td>
44
+ <td className='p-1'>
45
+ <span className='grow truncate'>{getLabel(binding.data as Label)}</span>
46
+ </td>
47
+ </tr>
48
+ ))}
49
+ </tbody>
50
+ </table>
57
51
 
58
52
  <Dialog.Close asChild>
59
53
  <Button variant='primary' classNames='mbs-2'>