@dxos/plugin-status-bar 0.8.1-main.ae460ac → 0.8.1-staging.31c3ee1

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/plugin-status-bar",
3
- "version": "0.8.1-main.ae460ac",
3
+ "version": "0.8.1-staging.31c3ee1",
4
4
  "description": "Status bar plugin",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
@@ -24,19 +24,19 @@
24
24
  "src"
25
25
  ],
26
26
  "dependencies": {
27
- "@fluentui/react-tabster": "9.23.3",
27
+ "@fluentui/react-tabster": "^9.24.2",
28
28
  "@preact/signals-core": "^1.6.0",
29
29
  "@radix-ui/react-slot": "1.1.2",
30
30
  "date-fns": "^3.3.1",
31
- "effect": "^3.12.3",
31
+ "effect": "3.13.3",
32
32
  "react-resize-detector": "^11.0.1",
33
- "@dxos/app-framework": "0.8.1-main.ae460ac",
34
- "@dxos/async": "0.8.1-main.ae460ac",
35
- "@dxos/echo-schema": "0.8.1-main.ae460ac",
36
- "@dxos/plugin-observability": "0.8.1-main.ae460ac",
37
- "@dxos/react-client": "0.8.1-main.ae460ac",
38
- "@dxos/react-ui-form": "0.8.1-main.ae460ac",
39
- "@dxos/schema": "0.8.1-main.ae460ac"
33
+ "@dxos/app-framework": "0.8.1-staging.31c3ee1",
34
+ "@dxos/async": "0.8.1-staging.31c3ee1",
35
+ "@dxos/echo-schema": "0.8.1-staging.31c3ee1",
36
+ "@dxos/react-client": "0.8.1-staging.31c3ee1",
37
+ "@dxos/plugin-observability": "0.8.1-staging.31c3ee1",
38
+ "@dxos/schema": "0.8.1-staging.31c3ee1",
39
+ "@dxos/react-ui-form": "0.8.1-staging.31c3ee1"
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-main.ae460ac",
49
- "@dxos/react-ui-theme": "0.8.1-main.ae460ac",
50
- "@dxos/storybook-utils": "0.8.1-main.ae460ac"
48
+ "@dxos/react-ui": "0.8.1-staging.31c3ee1",
49
+ "@dxos/storybook-utils": "0.8.1-staging.31c3ee1",
50
+ "@dxos/react-ui-theme": "0.8.1-staging.31c3ee1"
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-main.ae460ac",
57
- "@dxos/react-ui-theme": "0.8.1-main.ae460ac"
56
+ "@dxos/react-ui": "0.8.1-staging.31c3ee1",
57
+ "@dxos/react-ui-theme": "0.8.1-staging.31c3ee1"
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
  };
@@ -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'>v{v}</StatusBar.Button>
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/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
- } satisfies PluginMeta;
14
+ };
@@ -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,20 +31,14 @@ 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
- 'technology preview message': 'Composer is still in technology preview.',
35
+ 'technology preview message': 'Composer is currently in beta.',
47
36
  'learn more label': 'Learn more',
48
37
  'released message': 'This version released {{released}}.',
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,4 +0,0 @@
1
- export declare const FeedbackForm: ({ onClose }: {
2
- onClose: () => void;
3
- }) => import("react/jsx-runtime").JSX.Element;
4
- //# sourceMappingURL=FeedbackForm.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"FeedbackForm.d.ts","sourceRoot":"","sources":["../../../../src/components/FeedbackForm.tsx"],"names":[],"mappings":"AAkBA,eAAO,MAAM,YAAY,gBAAiB;IAAE,OAAO,EAAE,MAAM,IAAI,CAAA;CAAE,4CAwFhE,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
- };