@dxos/app-framework 0.3.10-main.cbe7692 → 0.3.10-main.d280bad
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 +13 -50
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node/index.cjs +12 -48
- package/dist/lib/node/index.cjs.map +4 -4
- package/dist/lib/node/meta.json +1 -1
- package/dist/types/src/plugins/components/CommandsDialog.d.ts.map +1 -1
- package/dist/types/src/plugins/components/SettingsDialog.d.ts.map +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/CommandsDialog.tsx +9 -4
- package/src/plugins/components/SettingsDialog.tsx +4 -5
- 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 -59
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/components/index.ts"],"names":[],"mappings":"AAIA,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/components/index.ts"],"names":[],"mappings":"AAIA,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/app-framework",
|
|
3
|
-
"version": "0.3.10-main.
|
|
3
|
+
"version": "0.3.10-main.d280bad",
|
|
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.
|
|
20
|
-
"@dxos/
|
|
21
|
-
"@dxos/
|
|
22
|
-
"@dxos/
|
|
23
|
-
"@dxos/
|
|
24
|
-
"@dxos/local-storage": "0.3.10-main.
|
|
25
|
-
"@dxos/log": "0.3.10-main.
|
|
26
|
-
"@dxos/react-ui-searchlist": "0.3.10-main.
|
|
19
|
+
"@dxos/app-graph": "0.3.10-main.d280bad",
|
|
20
|
+
"@dxos/async": "0.3.10-main.d280bad",
|
|
21
|
+
"@dxos/debug": "0.3.10-main.d280bad",
|
|
22
|
+
"@dxos/invariant": "0.3.10-main.d280bad",
|
|
23
|
+
"@dxos/keyboard": "0.3.10-main.d280bad",
|
|
24
|
+
"@dxos/local-storage": "0.3.10-main.d280bad",
|
|
25
|
+
"@dxos/log": "0.3.10-main.d280bad",
|
|
26
|
+
"@dxos/react-ui-searchlist": "0.3.10-main.d280bad"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@types/react": "^18.0.21",
|
|
30
30
|
"react": "^18.2.0",
|
|
31
|
-
"@dxos/react-ui": "0.3.10-main.
|
|
32
|
-
"@dxos/react-ui-theme": "0.3.10-main.
|
|
33
|
-
"@dxos/storybook-utils": "0.3.10-main.
|
|
31
|
+
"@dxos/react-ui": "0.3.10-main.d280bad",
|
|
32
|
+
"@dxos/react-ui-theme": "0.3.10-main.d280bad",
|
|
33
|
+
"@dxos/storybook-utils": "0.3.10-main.d280bad"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
36
|
"react": "*",
|
|
37
|
-
"@dxos/react-ui-theme": "0.3.10-main.
|
|
38
|
-
"@dxos/react-ui": "0.3.10-main.
|
|
37
|
+
"@dxos/react-ui-theme": "0.3.10-main.d280bad",
|
|
38
|
+
"@dxos/react-ui": "0.3.10-main.d280bad"
|
|
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
|
|
19
|
+
const toString = (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,6 +38,10 @@ 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
|
+
|
|
41
45
|
// console.log(JSON.stringify(actions, undefined, 2));
|
|
42
46
|
return actions;
|
|
43
47
|
}, [graph]);
|
|
@@ -51,10 +55,10 @@ export const CommandsDialogContent = ({ graph }: { graph?: Graph }) => {
|
|
|
51
55
|
|
|
52
56
|
{/* TODO(burdon): BUG: Overscrolls container. */}
|
|
53
57
|
<SearchList.Root label={t('commandlist input placeholder')} classNames='flex flex-col grow overflow-hidden my-2'>
|
|
54
|
-
<SearchList.Input placeholder={t('commandlist input placeholder')} classNames={mx('px-
|
|
58
|
+
<SearchList.Input placeholder={t('commandlist input placeholder')} classNames={mx('px-1 my-2')} />
|
|
55
59
|
<SearchList.Content classNames={['max-bs-[30rem] overflow-auto']}>
|
|
56
60
|
{actions?.map((action) => {
|
|
57
|
-
const label =
|
|
61
|
+
const label = toString(action.label);
|
|
58
62
|
const Icon = action.icon ?? DotOutline;
|
|
59
63
|
return (
|
|
60
64
|
<SearchList.Item
|
|
@@ -71,7 +75,7 @@ export const CommandsDialogContent = ({ graph }: { graph?: Graph }) => {
|
|
|
71
75
|
void action.invoke();
|
|
72
76
|
});
|
|
73
77
|
}}
|
|
74
|
-
classNames='flex items-center gap-2
|
|
78
|
+
classNames='flex items-center gap-2'
|
|
75
79
|
disabled={action.properties.disabled}
|
|
76
80
|
{...(action.properties?.testId && { 'data-testid': action.properties.testId })}
|
|
77
81
|
>
|
|
@@ -85,6 +89,7 @@ export const CommandsDialogContent = ({ graph }: { graph?: Graph }) => {
|
|
|
85
89
|
})}
|
|
86
90
|
</SearchList.Content>
|
|
87
91
|
</SearchList.Root>
|
|
92
|
+
|
|
88
93
|
<Dialog.Close asChild>
|
|
89
94
|
<Button ref={buttonRef} variant='primary' classNames='mbs-2'>
|
|
90
95
|
{t('close label', { ns: 'os' })}
|
|
@@ -31,13 +31,12 @@ 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):
|
|
35
|
-
// TODO(burdon): BUG: Dialogs do not compress if screen height is shrunk.
|
|
34
|
+
// TODO(burdon): Common treatment for dialogs (e.g., shrink height to fit, mobile, etc.)
|
|
36
35
|
return (
|
|
37
|
-
<Dialog.Content classNames={['md:max-is-[40rem] overflow-hidden']}>
|
|
36
|
+
<Dialog.Content classNames={['h-full md:max-is-[40rem] overflow-hidden']}>
|
|
38
37
|
<Dialog.Title>{t('settings dialog title', { ns: 'os' })}</Dialog.Title>
|
|
39
38
|
|
|
40
|
-
<div className='flex grow mlb-4 overflow-hidden
|
|
39
|
+
<div className='flex grow mlb-4 overflow-hidden'>
|
|
41
40
|
<div className={mx('flex flex-col w-[200px] space-y-4 pr-4 border-r overflow-y-auto', groupBorder)}>
|
|
42
41
|
<PluginList
|
|
43
42
|
title='Options'
|
|
@@ -60,7 +59,7 @@ export const SettingsDialogContent = () => {
|
|
|
60
59
|
</div>
|
|
61
60
|
|
|
62
61
|
<Dialog.Close asChild>
|
|
63
|
-
<Button variant='primary' classNames='mbs-2'>
|
|
62
|
+
<Button variant='primary' classNames='mbs-2' autoFocus>
|
|
64
63
|
{t('done label', { ns: 'os' })}
|
|
65
64
|
</Button>
|
|
66
65
|
</Dialog.Close>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ShortcutsDialog.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/components/ShortcutsDialog.tsx"],"names":[],"mappings":"AAWA,eAAO,MAAM,sBAAsB,mBA+ClC,CAAC"}
|
|
@@ -1,59 +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
|
-
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
|
-
<Dialog.Content classNames={['md:max-is-[30rem] overflow-hidden']}>
|
|
23
|
-
<Dialog.Title>{t('shortcuts dialog title', { ns: 'os' })}</Dialog.Title>
|
|
24
|
-
|
|
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>
|
|
51
|
-
|
|
52
|
-
<Dialog.Close asChild>
|
|
53
|
-
<Button variant='primary' classNames='mbs-2'>
|
|
54
|
-
{t('close label', { ns: 'os' })}
|
|
55
|
-
</Button>
|
|
56
|
-
</Dialog.Close>
|
|
57
|
-
</Dialog.Content>
|
|
58
|
-
);
|
|
59
|
-
};
|