@dxos/plugin-status-bar 0.8.1-staging.391c573 → 0.8.1-staging.97aedb1
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 +70 -165
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node/index.cjs +64 -159
- package/dist/lib/node/index.cjs.map +4 -4
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node-esm/index.mjs +70 -165
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/types/src/components/StatusBarPanel.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +2 -6
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +1 -1
- package/dist/types/src/translations.d.ts.map +1 -1
- package/package.json +13 -13
- package/src/components/StatusBarPanel.tsx +7 -13
- package/src/meta.ts +2 -2
- package/src/translations.ts +4 -14
- package/dist/types/src/components/FeedbackForm.d.ts +0 -5
- package/dist/types/src/components/FeedbackForm.d.ts.map +0 -1
- package/src/components/FeedbackForm.tsx +0 -107
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-status-bar",
|
|
3
|
-
"version": "0.8.1-staging.
|
|
3
|
+
"version": "0.8.1-staging.97aedb1",
|
|
4
4
|
"description": "Status bar plugin",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -30,13 +30,13 @@
|
|
|
30
30
|
"date-fns": "^3.3.1",
|
|
31
31
|
"effect": "3.13.3",
|
|
32
32
|
"react-resize-detector": "^11.0.1",
|
|
33
|
-
"@dxos/app-framework": "0.8.1-staging.
|
|
34
|
-
"@dxos/async": "0.8.1-staging.
|
|
35
|
-
"@dxos/echo-schema": "0.8.1-staging.
|
|
36
|
-
"@dxos/plugin-observability": "0.8.1-staging.
|
|
37
|
-
"@dxos/react-client": "0.8.1-staging.
|
|
38
|
-
"@dxos/react-ui-form": "0.8.1-staging.
|
|
39
|
-
"@dxos/schema": "0.8.1-staging.
|
|
33
|
+
"@dxos/app-framework": "0.8.1-staging.97aedb1",
|
|
34
|
+
"@dxos/async": "0.8.1-staging.97aedb1",
|
|
35
|
+
"@dxos/echo-schema": "0.8.1-staging.97aedb1",
|
|
36
|
+
"@dxos/plugin-observability": "0.8.1-staging.97aedb1",
|
|
37
|
+
"@dxos/react-client": "0.8.1-staging.97aedb1",
|
|
38
|
+
"@dxos/react-ui-form": "0.8.1-staging.97aedb1",
|
|
39
|
+
"@dxos/schema": "0.8.1-staging.97aedb1"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@phosphor-icons/react": "^2.1.5",
|
|
@@ -45,16 +45,16 @@
|
|
|
45
45
|
"react": "~18.2.0",
|
|
46
46
|
"react-dom": "~18.2.0",
|
|
47
47
|
"vite": "5.4.7",
|
|
48
|
-
"@dxos/react-ui": "0.8.1-staging.
|
|
49
|
-
"@dxos/react-ui-theme": "0.8.1-staging.
|
|
50
|
-
"@dxos/storybook-utils": "0.8.1-staging.
|
|
48
|
+
"@dxos/react-ui": "0.8.1-staging.97aedb1",
|
|
49
|
+
"@dxos/react-ui-theme": "0.8.1-staging.97aedb1",
|
|
50
|
+
"@dxos/storybook-utils": "0.8.1-staging.97aedb1"
|
|
51
51
|
},
|
|
52
52
|
"peerDependencies": {
|
|
53
53
|
"@phosphor-icons/react": "^2.0.5",
|
|
54
54
|
"react": "~18.2.0",
|
|
55
55
|
"react-dom": "~18.2.0",
|
|
56
|
-
"@dxos/react-ui": "0.8.1-staging.
|
|
57
|
-
"@dxos/react-ui-theme": "0.8.1-staging.
|
|
56
|
+
"@dxos/react-ui": "0.8.1-staging.97aedb1",
|
|
57
|
+
"@dxos/react-ui-theme": "0.8.1-staging.97aedb1"
|
|
58
58
|
},
|
|
59
59
|
"publishConfig": {
|
|
60
60
|
"access": "public"
|
|
@@ -7,7 +7,6 @@ import React, { useState } from 'react';
|
|
|
7
7
|
import { Surface } from '@dxos/app-framework';
|
|
8
8
|
import { Icon, Popover, useTranslation } from '@dxos/react-ui';
|
|
9
9
|
|
|
10
|
-
import { FeedbackForm } from './FeedbackForm';
|
|
11
10
|
import { StatusBar } from './StatusBar';
|
|
12
11
|
import { VersionNumber } from './VersionNumber';
|
|
13
12
|
import { STATUS_BAR_PLUGIN } from '../meta';
|
|
@@ -15,14 +14,9 @@ import { STATUS_BAR_PLUGIN } from '../meta';
|
|
|
15
14
|
export const StatusBarActions = () => {
|
|
16
15
|
const { t } = useTranslation(STATUS_BAR_PLUGIN);
|
|
17
16
|
const [open, setOpen] = useState(false);
|
|
17
|
+
|
|
18
18
|
return (
|
|
19
19
|
<Popover.Root open={open} onOpenChange={setOpen}>
|
|
20
|
-
<Popover.Trigger asChild>
|
|
21
|
-
<StatusBar.Button data-joyride='welcome/feedback'>
|
|
22
|
-
<Icon icon='ph--paper-plane-tilt--regular' size={4} />
|
|
23
|
-
<StatusBar.Text classNames='hidden sm:block'>{t('feedback label')}</StatusBar.Text>
|
|
24
|
-
</StatusBar.Button>
|
|
25
|
-
</Popover.Trigger>
|
|
26
20
|
{/* TODO(zan): Configure this label? */}
|
|
27
21
|
<StatusBar.Button asChild>
|
|
28
22
|
<a href='https://dxos.org/discord' target='_blank' rel='noopener noreferrer'>
|
|
@@ -30,13 +24,13 @@ export const StatusBarActions = () => {
|
|
|
30
24
|
<StatusBar.Text classNames='hidden sm:block'>{t('discord label')}</StatusBar.Text>
|
|
31
25
|
</a>
|
|
32
26
|
</StatusBar.Button>
|
|
27
|
+
<StatusBar.Button asChild>
|
|
28
|
+
<a href='https://github.com/dxos/dxos' target='_blank' rel='noopener noreferrer'>
|
|
29
|
+
<Icon icon='ph--github-logo--regular' size={4} />
|
|
30
|
+
<StatusBar.Text classNames='hidden sm:block'>{t('github label')}</StatusBar.Text>
|
|
31
|
+
</a>
|
|
32
|
+
</StatusBar.Button>
|
|
33
33
|
<VersionNumber />
|
|
34
|
-
<Popover.Portal>
|
|
35
|
-
<Popover.Content classNames='shadow-lg'>
|
|
36
|
-
<FeedbackForm onClose={() => setOpen(false)} />
|
|
37
|
-
<Popover.Arrow />
|
|
38
|
-
</Popover.Content>
|
|
39
|
-
</Popover.Portal>
|
|
40
34
|
</Popover.Root>
|
|
41
35
|
);
|
|
42
36
|
};
|
package/src/meta.ts
CHANGED
|
@@ -6,9 +6,9 @@ import { type PluginMeta } from '@dxos/app-framework';
|
|
|
6
6
|
|
|
7
7
|
export const STATUS_BAR_PLUGIN = 'dxos.org/plugin/status-bar';
|
|
8
8
|
|
|
9
|
-
export const meta = {
|
|
9
|
+
export const meta: PluginMeta = {
|
|
10
10
|
id: STATUS_BAR_PLUGIN,
|
|
11
11
|
name: 'Status Bar',
|
|
12
12
|
description: 'Display a bar with status and actions.',
|
|
13
13
|
icon: 'ph--info--regular',
|
|
14
|
-
}
|
|
14
|
+
};
|
package/src/translations.ts
CHANGED
|
@@ -6,15 +6,10 @@ import { type useTranslation } from '@dxos/react-ui';
|
|
|
6
6
|
|
|
7
7
|
import { STATUS_BAR_PLUGIN } from './meta';
|
|
8
8
|
|
|
9
|
+
// TODO(wittjosiah): There's got to be a better way to do typesafe translations, this is too much boilerplate.
|
|
10
|
+
|
|
9
11
|
type StatusBarTranslationKeys =
|
|
10
12
|
| 'plugin name'
|
|
11
|
-
| 'email input label'
|
|
12
|
-
| 'email input placeholder'
|
|
13
|
-
| 'feedback text area label'
|
|
14
|
-
| 'feedback text area placeholder'
|
|
15
|
-
| 'send feedback label'
|
|
16
|
-
| 'name label'
|
|
17
|
-
| 'name placeholder'
|
|
18
13
|
| 'warning title'
|
|
19
14
|
| 'technology preview message'
|
|
20
15
|
| 'learn more label'
|
|
@@ -22,6 +17,7 @@ type StatusBarTranslationKeys =
|
|
|
22
17
|
| 'see release label'
|
|
23
18
|
| 'powered by dxos message'
|
|
24
19
|
| 'discord label'
|
|
20
|
+
| 'github label'
|
|
25
21
|
| 'feedback label';
|
|
26
22
|
|
|
27
23
|
type RequiredTranslation = { [key in StatusBarTranslationKeys]: string };
|
|
@@ -35,13 +31,6 @@ export const mkTranslation = (t: ReturnType<typeof useTranslation>['t']) => (key
|
|
|
35
31
|
const translations: Record<Language, TranslationEntry> = {
|
|
36
32
|
'en-US': entry({
|
|
37
33
|
'plugin name': 'Status Bar',
|
|
38
|
-
'name label': 'Name',
|
|
39
|
-
'name placeholder': 'Preferred name',
|
|
40
|
-
'email input label': 'Email',
|
|
41
|
-
'email input placeholder': 'hello@example.com',
|
|
42
|
-
'feedback text area label': 'Feedback',
|
|
43
|
-
'feedback text area placeholder': 'Please describe your issue or suggestion.',
|
|
44
|
-
'send feedback label': 'Send Feedback',
|
|
45
34
|
'warning title': 'WARNING',
|
|
46
35
|
'technology preview message': 'Composer is currently in beta.',
|
|
47
36
|
'learn more label': 'Learn more',
|
|
@@ -49,6 +38,7 @@ const translations: Record<Language, TranslationEntry> = {
|
|
|
49
38
|
'see release label': 'See release on GitHub',
|
|
50
39
|
'powered by dxos message': 'Powered by <dxos>DXOS</dxos>',
|
|
51
40
|
'discord label': 'Discord',
|
|
41
|
+
'github label': 'GitHub',
|
|
52
42
|
'feedback label': 'Feedback',
|
|
53
43
|
}),
|
|
54
44
|
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FeedbackForm.d.ts","sourceRoot":"","sources":["../../../../src/components/FeedbackForm.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAa3C,eAAO,MAAM,YAAY,gBAAiB;IAAE,OAAO,EAAE,MAAM,IAAI,CAAA;CAAE,sBAwFhE,CAAC"}
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2024 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { PaperPlaneTilt, X } from '@phosphor-icons/react';
|
|
6
|
-
import React, { useCallback } from 'react';
|
|
7
|
-
|
|
8
|
-
import { createIntent, useIntentDispatcher } from '@dxos/app-framework';
|
|
9
|
-
import { ObservabilityAction, UserFeedback } from '@dxos/plugin-observability/types';
|
|
10
|
-
import { Button, Input, Popover, useTranslation } from '@dxos/react-ui';
|
|
11
|
-
import { useForm } from '@dxos/react-ui-form';
|
|
12
|
-
import { getSize } from '@dxos/react-ui-theme';
|
|
13
|
-
|
|
14
|
-
import { STATUS_BAR_PLUGIN } from '../meta';
|
|
15
|
-
import { mkTranslation } from '../translations';
|
|
16
|
-
|
|
17
|
-
const initialValues: UserFeedback = { name: '', email: '', message: '' };
|
|
18
|
-
|
|
19
|
-
export const FeedbackForm = ({ onClose }: { onClose: () => void }) => {
|
|
20
|
-
const { t } = useTranslation(STATUS_BAR_PLUGIN);
|
|
21
|
-
const translation = mkTranslation(t);
|
|
22
|
-
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
23
|
-
|
|
24
|
-
const onSave = useCallback(
|
|
25
|
-
(values: UserFeedback) => {
|
|
26
|
-
void dispatch(createIntent(ObservabilityAction.CaptureUserFeedback, values));
|
|
27
|
-
onClose();
|
|
28
|
-
},
|
|
29
|
-
[dispatch, onClose],
|
|
30
|
-
);
|
|
31
|
-
|
|
32
|
-
const { handleSave, canSave, getStatus, ...inputProps } = useForm<UserFeedback>({
|
|
33
|
-
initialValues,
|
|
34
|
-
schema: UserFeedback,
|
|
35
|
-
onSave,
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
return (
|
|
39
|
-
<div role='form' className='p-3 flex flex-col gap-2'>
|
|
40
|
-
<div role='none' className='space-b-1'>
|
|
41
|
-
<Input.Root validationValence={getStatus('name').status}>
|
|
42
|
-
<Input.Label>{translation('name label')}</Input.Label>
|
|
43
|
-
<Input.TextInput
|
|
44
|
-
classNames={'text-sm'}
|
|
45
|
-
placeholder={translation('name placeholder')}
|
|
46
|
-
autoFocus
|
|
47
|
-
{...inputProps}
|
|
48
|
-
/>
|
|
49
|
-
<Input.DescriptionAndValidation>
|
|
50
|
-
<Input.Validation>{getStatus('name').error}</Input.Validation>
|
|
51
|
-
</Input.DescriptionAndValidation>
|
|
52
|
-
</Input.Root>
|
|
53
|
-
</div>
|
|
54
|
-
|
|
55
|
-
<div role='none' className='space-b-1'>
|
|
56
|
-
<Input.Root validationValence={getStatus('email').status}>
|
|
57
|
-
<Input.Label>{translation('email input label')}</Input.Label>
|
|
58
|
-
<Input.TextInput
|
|
59
|
-
classNames={'text-sm'}
|
|
60
|
-
placeholder={translation('email input placeholder')}
|
|
61
|
-
{...inputProps}
|
|
62
|
-
/>
|
|
63
|
-
<Input.DescriptionAndValidation>
|
|
64
|
-
<Input.Validation>{getStatus('email').error}</Input.Validation>
|
|
65
|
-
</Input.DescriptionAndValidation>
|
|
66
|
-
</Input.Root>
|
|
67
|
-
</div>
|
|
68
|
-
|
|
69
|
-
<div role='none' className='space-b-1'>
|
|
70
|
-
<Input.Root validationValence={getStatus('message').status}>
|
|
71
|
-
<Input.Label>{translation('feedback text area label')}</Input.Label>
|
|
72
|
-
<Input.TextArea
|
|
73
|
-
classNames={'text-sm'}
|
|
74
|
-
rows={5}
|
|
75
|
-
cols={30}
|
|
76
|
-
placeholder={translation('feedback text area placeholder')}
|
|
77
|
-
{...inputProps}
|
|
78
|
-
/>
|
|
79
|
-
<Input.DescriptionAndValidation>
|
|
80
|
-
<Input.Validation>{getStatus('message').error}</Input.Validation>
|
|
81
|
-
</Input.DescriptionAndValidation>
|
|
82
|
-
</Input.Root>
|
|
83
|
-
</div>
|
|
84
|
-
|
|
85
|
-
<div role='none' className='space-b-2'>
|
|
86
|
-
<Button
|
|
87
|
-
type='submit'
|
|
88
|
-
variant='primary'
|
|
89
|
-
classNames='is-full flex gap-2'
|
|
90
|
-
disabled={!canSave}
|
|
91
|
-
onClick={handleSave}
|
|
92
|
-
>
|
|
93
|
-
<span>{translation('send feedback label')}</span>
|
|
94
|
-
<div className='grow' />
|
|
95
|
-
<PaperPlaneTilt className={getSize(5)} />
|
|
96
|
-
</Button>
|
|
97
|
-
<Popover.Close asChild>
|
|
98
|
-
<Button classNames='is-full flex gap-2'>
|
|
99
|
-
<span>{t('cancel label', { ns: 'os' })}</span>
|
|
100
|
-
<div className='grow' />
|
|
101
|
-
<X className={getSize(5)} />
|
|
102
|
-
</Button>
|
|
103
|
-
</Popover.Close>
|
|
104
|
-
</div>
|
|
105
|
-
</div>
|
|
106
|
-
);
|
|
107
|
-
};
|