@dxos/plugin-status-bar 0.7.5-staging.e6154f3 → 0.8.1-main.013e445
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 +121 -96
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node/index.cjs +149 -123
- package/dist/lib/node/index.cjs.map +4 -4
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node-esm/index.mjs +121 -96
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/types/src/components/FeedbackForm.d.ts +5 -3
- package/dist/types/src/components/FeedbackForm.d.ts.map +1 -1
- package/dist/types/src/components/StatusBar.stories.d.ts +2 -1
- package/dist/types/src/components/StatusBar.stories.d.ts.map +1 -1
- package/dist/types/src/components/StatusBarPanel.d.ts +3 -2
- package/dist/types/src/components/StatusBarPanel.d.ts.map +1 -1
- package/dist/types/src/components/VersionNumber.d.ts +2 -1
- package/dist/types/src/components/VersionNumber.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +1 -0
- package/dist/types/src/components/index.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/package.json +15 -16
- package/src/components/FeedbackForm.tsx +39 -29
- package/src/components/StatusBarPanel.tsx +14 -3
- package/src/components/VersionNumber.tsx +2 -1
- package/src/components/index.ts +1 -0
- package/src/meta.ts +2 -2
- package/src/translations.ts +1 -1
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { UserFeedback } from '@dxos/plugin-observability/types';
|
|
3
|
+
export declare const FeedbackForm: ({ onSave }: {
|
|
4
|
+
onSave: (values: UserFeedback) => void;
|
|
5
|
+
}) => React.JSX.Element;
|
|
4
6
|
//# sourceMappingURL=FeedbackForm.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FeedbackForm.d.ts","sourceRoot":"","sources":["../../../../src/components/FeedbackForm.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FeedbackForm.d.ts","sourceRoot":"","sources":["../../../../src/components/FeedbackForm.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAiB,MAAM,OAAO,CAAC;AAGtC,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAgGhE,eAAO,MAAM,YAAY,eAAgB;IAAE,MAAM,EAAE,CAAC,MAAM,EAAE,YAAY,KAAK,IAAI,CAAA;CAAE,sBAYlF,CAAC"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import '@dxos-theme';
|
|
2
2
|
import { type Meta } from '@storybook/react';
|
|
3
|
+
import React from 'react';
|
|
3
4
|
import { StatusBar } from './StatusBar';
|
|
4
|
-
export declare const DefaultStory: () =>
|
|
5
|
+
export declare const DefaultStory: () => React.JSX.Element;
|
|
5
6
|
export declare const Default: {};
|
|
6
7
|
declare const meta: Meta<typeof StatusBar>;
|
|
7
8
|
export default meta;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StatusBar.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/StatusBar.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAErB,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"StatusBar.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/StatusBar.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAErB,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,eAAO,MAAM,YAAY,yBAmBxB,CAAC;AAEF,eAAO,MAAM,OAAO,IAAK,CAAC;AAE1B,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,SAAS,CAQhC,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const StatusBarActions: () => React.JSX.Element;
|
|
3
|
+
export declare const StatusBarPanel: () => React.JSX.Element;
|
|
3
4
|
//# sourceMappingURL=StatusBarPanel.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StatusBarPanel.d.ts","sourceRoot":"","sources":["../../../../src/components/StatusBarPanel.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"StatusBarPanel.d.ts","sourceRoot":"","sources":["../../../../src/components/StatusBarPanel.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAgC,MAAM,OAAO,CAAC;AAWrD,eAAO,MAAM,gBAAgB,yBAqC5B,CAAC;AAEF,eAAO,MAAM,cAAc,yBAQ1B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VersionNumber.d.ts","sourceRoot":"","sources":["../../../../src/components/VersionNumber.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"VersionNumber.d.ts","sourceRoot":"","sources":["../../../../src/components/VersionNumber.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,MAAM,OAAO,CAAC;AAY1B,eAAO,MAAM,aAAa,yBAqEzB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/index.ts"],"names":[],"mappings":"AAIA,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/index.ts"],"names":[],"mappings":"AAIA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC"}
|
package/dist/types/src/meta.d.ts
CHANGED
|
@@ -1,8 +1,4 @@
|
|
|
1
|
+
import { type PluginMeta } from '@dxos/app-framework';
|
|
1
2
|
export declare const STATUS_BAR_PLUGIN = "dxos.org/plugin/status-bar";
|
|
2
|
-
export declare const meta:
|
|
3
|
-
id: string;
|
|
4
|
-
name: string;
|
|
5
|
-
description: string;
|
|
6
|
-
icon: string;
|
|
7
|
-
};
|
|
3
|
+
export declare const meta: PluginMeta;
|
|
8
4
|
//# sourceMappingURL=meta.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../src/meta.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../src/meta.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEtD,eAAO,MAAM,iBAAiB,+BAA+B,CAAC;AAE9D,eAAO,MAAM,IAAI,EAAE,UAKlB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-status-bar",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.1-main.013e445",
|
|
4
4
|
"description": "Status bar plugin",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -24,20 +24,19 @@
|
|
|
24
24
|
"src"
|
|
25
25
|
],
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@
|
|
28
|
-
"@fluentui/react-tabster": "9.23.3",
|
|
27
|
+
"@fluentui/react-tabster": "^9.24.2",
|
|
29
28
|
"@preact/signals-core": "^1.6.0",
|
|
30
29
|
"@radix-ui/react-slot": "1.1.2",
|
|
31
30
|
"date-fns": "^3.3.1",
|
|
32
|
-
"effect": "
|
|
31
|
+
"effect": "3.13.3",
|
|
33
32
|
"react-resize-detector": "^11.0.1",
|
|
34
|
-
"@dxos/
|
|
35
|
-
"@dxos/
|
|
36
|
-
"@dxos/echo-schema": "0.
|
|
37
|
-
"@dxos/plugin-observability": "0.
|
|
38
|
-
"@dxos/react-ui-form": "0.
|
|
39
|
-
"@dxos/react-client": "0.
|
|
40
|
-
"@dxos/schema": "0.
|
|
33
|
+
"@dxos/async": "0.8.1-main.013e445",
|
|
34
|
+
"@dxos/app-framework": "0.8.1-main.013e445",
|
|
35
|
+
"@dxos/echo-schema": "0.8.1-main.013e445",
|
|
36
|
+
"@dxos/plugin-observability": "0.8.1-main.013e445",
|
|
37
|
+
"@dxos/react-ui-form": "0.8.1-main.013e445",
|
|
38
|
+
"@dxos/react-client": "0.8.1-main.013e445",
|
|
39
|
+
"@dxos/schema": "0.8.1-main.013e445"
|
|
41
40
|
},
|
|
42
41
|
"devDependencies": {
|
|
43
42
|
"@phosphor-icons/react": "^2.1.5",
|
|
@@ -46,16 +45,16 @@
|
|
|
46
45
|
"react": "~18.2.0",
|
|
47
46
|
"react-dom": "~18.2.0",
|
|
48
47
|
"vite": "5.4.7",
|
|
49
|
-
"@dxos/react-ui
|
|
50
|
-
"@dxos/react-ui": "0.
|
|
51
|
-
"@dxos/storybook-utils": "0.
|
|
48
|
+
"@dxos/react-ui": "0.8.1-main.013e445",
|
|
49
|
+
"@dxos/react-ui-theme": "0.8.1-main.013e445",
|
|
50
|
+
"@dxos/storybook-utils": "0.8.1-main.013e445"
|
|
52
51
|
},
|
|
53
52
|
"peerDependencies": {
|
|
54
53
|
"@phosphor-icons/react": "^2.0.5",
|
|
55
54
|
"react": "~18.2.0",
|
|
56
55
|
"react-dom": "~18.2.0",
|
|
57
|
-
"@dxos/react-ui": "0.
|
|
58
|
-
"@dxos/react-ui-theme": "0.
|
|
56
|
+
"@dxos/react-ui": "0.8.1-main.013e445",
|
|
57
|
+
"@dxos/react-ui-theme": "0.8.1-main.013e445"
|
|
59
58
|
},
|
|
60
59
|
"publishConfig": {
|
|
61
60
|
"access": "public"
|
|
@@ -3,81 +3,77 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { PaperPlaneTilt, X } from '@phosphor-icons/react';
|
|
6
|
-
import React, {
|
|
6
|
+
import React, { useRef } from 'react';
|
|
7
7
|
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
8
|
+
import { getSnapshot } from '@dxos/echo-schema';
|
|
9
|
+
import { UserFeedback } from '@dxos/plugin-observability/types';
|
|
10
10
|
import { Button, Input, Popover, useTranslation } from '@dxos/react-ui';
|
|
11
|
-
import {
|
|
11
|
+
import { FormProvider, useFormContext, useInputProps } from '@dxos/react-ui-form';
|
|
12
12
|
import { getSize } from '@dxos/react-ui-theme';
|
|
13
13
|
|
|
14
14
|
import { STATUS_BAR_PLUGIN } from '../meta';
|
|
15
15
|
import { mkTranslation } from '../translations';
|
|
16
16
|
|
|
17
|
-
const
|
|
17
|
+
const defaultValues: UserFeedback = { name: '', email: '', message: '' };
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
const FormContent = () => {
|
|
20
20
|
const { t } = useTranslation(STATUS_BAR_PLUGIN);
|
|
21
21
|
const translation = mkTranslation(t);
|
|
22
|
-
const {
|
|
22
|
+
const { handleSave, canSave } = useFormContext<UserFeedback>();
|
|
23
23
|
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
onClose();
|
|
28
|
-
},
|
|
29
|
-
[dispatch, onClose],
|
|
30
|
-
);
|
|
31
|
-
|
|
32
|
-
const { handleSave, canSave, getStatus, ...inputProps } = useForm<UserFeedback>({
|
|
33
|
-
initialValues,
|
|
34
|
-
schema: UserFeedback,
|
|
35
|
-
onSave,
|
|
36
|
-
});
|
|
24
|
+
const nameProps = useInputProps(['name']);
|
|
25
|
+
const emailProps = useInputProps(['email']);
|
|
26
|
+
const messageProps = useInputProps(['message']);
|
|
37
27
|
|
|
38
28
|
return (
|
|
39
29
|
<div role='form' className='p-3 flex flex-col gap-2'>
|
|
40
30
|
<div role='none' className='space-b-1'>
|
|
41
|
-
<Input.Root validationValence={getStatus(
|
|
31
|
+
<Input.Root validationValence={nameProps.getStatus().status}>
|
|
42
32
|
<Input.Label>{translation('name label')}</Input.Label>
|
|
43
33
|
<Input.TextInput
|
|
44
34
|
classNames={'text-sm'}
|
|
45
35
|
placeholder={translation('name placeholder')}
|
|
46
36
|
autoFocus
|
|
47
|
-
{
|
|
37
|
+
value={nameProps.getValue() ?? ''}
|
|
38
|
+
onChange={(e) => nameProps.onValueChange('string', e.target.value)}
|
|
39
|
+
onBlur={nameProps.onBlur}
|
|
48
40
|
/>
|
|
49
41
|
<Input.DescriptionAndValidation>
|
|
50
|
-
<Input.Validation>{getStatus(
|
|
42
|
+
<Input.Validation>{nameProps.getStatus().error}</Input.Validation>
|
|
51
43
|
</Input.DescriptionAndValidation>
|
|
52
44
|
</Input.Root>
|
|
53
45
|
</div>
|
|
54
46
|
|
|
55
47
|
<div role='none' className='space-b-1'>
|
|
56
|
-
<Input.Root validationValence={getStatus(
|
|
48
|
+
<Input.Root validationValence={emailProps.getStatus().status}>
|
|
57
49
|
<Input.Label>{translation('email input label')}</Input.Label>
|
|
58
50
|
<Input.TextInput
|
|
59
51
|
classNames={'text-sm'}
|
|
60
52
|
placeholder={translation('email input placeholder')}
|
|
61
|
-
{
|
|
53
|
+
value={emailProps.getValue() ?? ''}
|
|
54
|
+
onChange={(e) => emailProps.onValueChange('string', e.target.value)}
|
|
55
|
+
onBlur={emailProps.onBlur}
|
|
62
56
|
/>
|
|
63
57
|
<Input.DescriptionAndValidation>
|
|
64
|
-
<Input.Validation>{getStatus(
|
|
58
|
+
<Input.Validation>{emailProps.getStatus().error}</Input.Validation>
|
|
65
59
|
</Input.DescriptionAndValidation>
|
|
66
60
|
</Input.Root>
|
|
67
61
|
</div>
|
|
68
62
|
|
|
69
63
|
<div role='none' className='space-b-1'>
|
|
70
|
-
<Input.Root validationValence={getStatus(
|
|
64
|
+
<Input.Root validationValence={messageProps.getStatus().status}>
|
|
71
65
|
<Input.Label>{translation('feedback text area label')}</Input.Label>
|
|
72
66
|
<Input.TextArea
|
|
73
67
|
classNames={'text-sm'}
|
|
74
68
|
rows={5}
|
|
75
69
|
cols={30}
|
|
76
70
|
placeholder={translation('feedback text area placeholder')}
|
|
77
|
-
{
|
|
71
|
+
value={messageProps.getValue() ?? ''}
|
|
72
|
+
onChange={(e) => messageProps.onValueChange('string', e.target.value)}
|
|
73
|
+
onBlur={messageProps.onBlur}
|
|
78
74
|
/>
|
|
79
75
|
<Input.DescriptionAndValidation>
|
|
80
|
-
<Input.Validation>{getStatus(
|
|
76
|
+
<Input.Validation>{messageProps.getStatus().error}</Input.Validation>
|
|
81
77
|
</Input.DescriptionAndValidation>
|
|
82
78
|
</Input.Root>
|
|
83
79
|
</div>
|
|
@@ -105,3 +101,17 @@ export const FeedbackForm = ({ onClose }: { onClose: () => void }) => {
|
|
|
105
101
|
</div>
|
|
106
102
|
);
|
|
107
103
|
};
|
|
104
|
+
|
|
105
|
+
export const FeedbackForm = ({ onSave }: { onSave: (values: UserFeedback) => void }) => {
|
|
106
|
+
const formRef = useRef<HTMLDivElement>(null);
|
|
107
|
+
|
|
108
|
+
const initialValues = getSnapshot(defaultValues);
|
|
109
|
+
|
|
110
|
+
return (
|
|
111
|
+
<FormProvider formRef={formRef} schema={UserFeedback} initialValues={initialValues} onSave={onSave}>
|
|
112
|
+
<div ref={formRef}>
|
|
113
|
+
<FormContent />
|
|
114
|
+
</div>
|
|
115
|
+
</FormProvider>
|
|
116
|
+
);
|
|
117
|
+
};
|
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import React, { useState } from 'react';
|
|
5
|
+
import React, { useCallback, useState } from 'react';
|
|
6
6
|
|
|
7
|
-
import { Surface } from '@dxos/app-framework';
|
|
7
|
+
import { createIntent, Surface, useIntentDispatcher } from '@dxos/app-framework';
|
|
8
|
+
import { ObservabilityAction, type UserFeedback } from '@dxos/plugin-observability/types';
|
|
8
9
|
import { Icon, Popover, useTranslation } from '@dxos/react-ui';
|
|
9
10
|
|
|
10
11
|
import { FeedbackForm } from './FeedbackForm';
|
|
@@ -15,6 +16,16 @@ import { STATUS_BAR_PLUGIN } from '../meta';
|
|
|
15
16
|
export const StatusBarActions = () => {
|
|
16
17
|
const { t } = useTranslation(STATUS_BAR_PLUGIN);
|
|
17
18
|
const [open, setOpen] = useState(false);
|
|
19
|
+
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
20
|
+
|
|
21
|
+
const handleSave = useCallback(
|
|
22
|
+
(values: UserFeedback) => {
|
|
23
|
+
void dispatch(createIntent(ObservabilityAction.CaptureUserFeedback, values));
|
|
24
|
+
setOpen(false);
|
|
25
|
+
},
|
|
26
|
+
[dispatch],
|
|
27
|
+
);
|
|
28
|
+
|
|
18
29
|
return (
|
|
19
30
|
<Popover.Root open={open} onOpenChange={setOpen}>
|
|
20
31
|
<Popover.Trigger asChild>
|
|
@@ -33,7 +44,7 @@ export const StatusBarActions = () => {
|
|
|
33
44
|
<VersionNumber />
|
|
34
45
|
<Popover.Portal>
|
|
35
46
|
<Popover.Content classNames='shadow-lg'>
|
|
36
|
-
<FeedbackForm
|
|
47
|
+
<FeedbackForm onSave={handleSave} />
|
|
37
48
|
<Popover.Arrow />
|
|
38
49
|
</Popover.Content>
|
|
39
50
|
</Popover.Portal>
|
|
@@ -20,6 +20,7 @@ export const VersionNumber = () => {
|
|
|
20
20
|
const { t } = useTranslation(STATUS_BAR_PLUGIN);
|
|
21
21
|
const { version, timestamp, commitHash } = config.values.runtime?.app?.build ?? {};
|
|
22
22
|
const [_, v] = version?.match(VERSION_REGEX) ?? [];
|
|
23
|
+
const isLabs = config.values.runtime?.app?.env?.DX_LABS;
|
|
23
24
|
|
|
24
25
|
const releaseUrl =
|
|
25
26
|
config.values.runtime?.app?.env?.DX_ENVIRONMENT === 'production'
|
|
@@ -31,7 +32,7 @@ export const VersionNumber = () => {
|
|
|
31
32
|
return (
|
|
32
33
|
<Popover.Root>
|
|
33
34
|
<Popover.Trigger asChild>
|
|
34
|
-
<StatusBar.Button classNames='text-xs'>
|
|
35
|
+
<StatusBar.Button classNames='text-xs'>{isLabs ? version : v}</StatusBar.Button>
|
|
35
36
|
</Popover.Trigger>
|
|
36
37
|
<Popover.Portal>
|
|
37
38
|
<Popover.Content
|
package/src/components/index.ts
CHANGED
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
|
@@ -43,7 +43,7 @@ const translations: Record<Language, TranslationEntry> = {
|
|
|
43
43
|
'feedback text area placeholder': 'Please describe your issue or suggestion.',
|
|
44
44
|
'send feedback label': 'Send Feedback',
|
|
45
45
|
'warning title': 'WARNING',
|
|
46
|
-
'technology preview message': 'Composer is
|
|
46
|
+
'technology preview message': 'Composer is currently in beta.',
|
|
47
47
|
'learn more label': 'Learn more',
|
|
48
48
|
'released message': 'This version released {{released}}.',
|
|
49
49
|
'see release label': 'See release on GitHub',
|