@dxos/plugin-status-bar 0.7.5-main.9d26e3a → 0.7.5-main.b19bfc8

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.
Files changed (49) hide show
  1. package/dist/lib/browser/index.mjs +150 -64
  2. package/dist/lib/browser/index.mjs.map +4 -4
  3. package/dist/lib/browser/meta.json +1 -1
  4. package/dist/lib/node/index.cjs +186 -93
  5. package/dist/lib/node/index.cjs.map +4 -4
  6. package/dist/lib/node/meta.json +1 -1
  7. package/dist/lib/node-esm/index.mjs +150 -63
  8. package/dist/lib/node-esm/index.mjs.map +4 -4
  9. package/dist/lib/node-esm/meta.json +1 -1
  10. package/dist/types/src/StatusBarPlugin.d.ts +1 -3
  11. package/dist/types/src/StatusBarPlugin.d.ts.map +1 -1
  12. package/dist/types/src/components/FeedbackForm.d.ts +1 -2
  13. package/dist/types/src/components/FeedbackForm.d.ts.map +1 -1
  14. package/dist/types/src/components/StatusBar.d.ts +13 -27
  15. package/dist/types/src/components/StatusBar.d.ts.map +1 -1
  16. package/dist/types/src/components/StatusBar.stories.d.ts +1 -2
  17. package/dist/types/src/components/StatusBar.stories.d.ts.map +1 -1
  18. package/dist/types/src/components/StatusBarPanel.d.ts +2 -2
  19. package/dist/types/src/components/StatusBarPanel.d.ts.map +1 -1
  20. package/dist/types/src/components/VersionNumber.d.ts +2 -0
  21. package/dist/types/src/components/VersionNumber.d.ts.map +1 -0
  22. package/dist/types/src/index.d.ts +2 -3
  23. package/dist/types/src/index.d.ts.map +1 -1
  24. package/dist/types/src/meta.d.ts +1 -2
  25. package/dist/types/src/meta.d.ts.map +1 -1
  26. package/dist/types/src/translations.d.ts +1 -1
  27. package/dist/types/src/translations.d.ts.map +1 -1
  28. package/dist/types/tsconfig.tsbuildinfo +1 -1
  29. package/package.json +19 -25
  30. package/src/StatusBarPlugin.tsx +39 -18
  31. package/src/components/StatusBar.stories.tsx +2 -2
  32. package/src/components/StatusBar.tsx +8 -34
  33. package/src/components/StatusBarPanel.tsx +35 -26
  34. package/src/components/VersionNumber.tsx +86 -0
  35. package/src/index.ts +2 -5
  36. package/src/meta.ts +1 -1
  37. package/src/translations.ts +18 -2
  38. package/dist/lib/browser/chunk-4KDZC7WS.mjs +0 -14
  39. package/dist/lib/browser/chunk-4KDZC7WS.mjs.map +0 -7
  40. package/dist/lib/browser/meta.mjs +0 -9
  41. package/dist/lib/browser/meta.mjs.map +0 -7
  42. package/dist/lib/node/chunk-OGG3PMIV.cjs +0 -37
  43. package/dist/lib/node/chunk-OGG3PMIV.cjs.map +0 -7
  44. package/dist/lib/node/meta.cjs +0 -30
  45. package/dist/lib/node/meta.cjs.map +0 -7
  46. package/dist/lib/node-esm/chunk-UVUSU6KS.mjs +0 -16
  47. package/dist/lib/node-esm/chunk-UVUSU6KS.mjs.map +0 -7
  48. package/dist/lib/node-esm/meta.mjs +0 -10
  49. package/dist/lib/node-esm/meta.mjs.map +0 -7
@@ -0,0 +1,2 @@
1
+ export declare const VersionNumber: () => import("react/jsx-runtime").JSX.Element;
2
+ //# sourceMappingURL=VersionNumber.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VersionNumber.d.ts","sourceRoot":"","sources":["../../../../src/components/VersionNumber.tsx"],"names":[],"mappings":"AAiBA,eAAO,MAAM,aAAa,+CAoEzB,CAAC"}
@@ -1,5 +1,4 @@
1
- import { StatusBarPlugin } from './StatusBarPlugin';
2
- export default StatusBarPlugin;
3
- export * from './StatusBarPlugin';
4
1
  export * from './components';
2
+ export * from './meta';
3
+ export * from './StatusBarPlugin';
5
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,eAAe,eAAe,CAAC;AAE/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAIA,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,mBAAmB,CAAC"}
@@ -1,9 +1,8 @@
1
1
  export declare const STATUS_BAR_PLUGIN = "dxos.org/plugin/status-bar";
2
- declare const _default: {
2
+ export declare const meta: {
3
3
  id: string;
4
4
  name: string;
5
5
  description: string;
6
6
  icon: string;
7
7
  };
8
- export default _default;
9
8
  //# sourceMappingURL=meta.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../src/meta.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,iBAAiB,+BAA+B,CAAC;;;;;;;AAE9D,wBAKuB"}
1
+ {"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../src/meta.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,iBAAiB,+BAA+B,CAAC;AAE9D,eAAO,MAAM,IAAI;;;;;CAKK,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import { type useTranslation } from '@dxos/react-ui';
2
2
  import { STATUS_BAR_PLUGIN } from './meta';
3
- type StatusBarTranslationKeys = 'plugin name' | 'email input label' | 'email input placeholder' | 'feedback text area label' | 'feedback text area placeholder' | 'send feedback label' | 'name label' | 'name placeholder';
3
+ type StatusBarTranslationKeys = 'plugin name' | 'email input label' | 'email input placeholder' | 'feedback text area label' | 'feedback text area placeholder' | 'send feedback label' | 'name label' | 'name placeholder' | 'warning title' | 'technology preview message' | 'learn more label' | 'released message' | 'see release label' | 'powered by dxos message' | 'discord label' | 'feedback label';
4
4
  type RequiredTranslation = {
5
5
  [key in StatusBarTranslationKeys]: string;
6
6
  };
@@ -1 +1 @@
1
- {"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../../src/translations.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAErD,OAAO,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AAE3C,KAAK,wBAAwB,GACzB,aAAa,GACb,mBAAmB,GACnB,yBAAyB,GACzB,0BAA0B,GAC1B,gCAAgC,GAChC,qBAAqB,GACrB,YAAY,GACZ,kBAAkB,CAAC;AAEvB,KAAK,mBAAmB,GAAG;KAAG,GAAG,IAAI,wBAAwB,GAAG,MAAM;CAAE,CAAC;AACzE,KAAK,gBAAgB,GAAG;IAAE,CAAC,iBAAiB,CAAC,EAAE,mBAAmB,CAAA;CAAE,CAAC;AAKrE,eAAO,MAAM,aAAa,MAAO,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC,GAAG,CAAC,WAAW,wBAAwB,WAAW,CAAC;;AAetH,wBAA8B"}
1
+ {"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../../src/translations.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAErD,OAAO,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AAE3C,KAAK,wBAAwB,GACzB,aAAa,GACb,mBAAmB,GACnB,yBAAyB,GACzB,0BAA0B,GAC1B,gCAAgC,GAChC,qBAAqB,GACrB,YAAY,GACZ,kBAAkB,GAClB,eAAe,GACf,4BAA4B,GAC5B,kBAAkB,GAClB,kBAAkB,GAClB,mBAAmB,GACnB,yBAAyB,GACzB,eAAe,GACf,gBAAgB,CAAC;AAErB,KAAK,mBAAmB,GAAG;KAAG,GAAG,IAAI,wBAAwB,GAAG,MAAM;CAAE,CAAC;AACzE,KAAK,gBAAgB,GAAG;IAAE,CAAC,iBAAiB,CAAC,EAAE,mBAAmB,CAAA;CAAE,CAAC;AAKrE,eAAO,MAAM,aAAa,MAAO,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC,GAAG,CAAC,WAAW,wBAAwB,WAAW,CAAC;;AAuBtH,wBAA8B"}
@@ -1 +1 @@
1
- {"version":"5.7.2"}
1
+ {"version":"5.7.3"}
package/package.json CHANGED
@@ -1,31 +1,23 @@
1
1
  {
2
2
  "name": "@dxos/plugin-status-bar",
3
- "version": "0.7.5-main.9d26e3a",
3
+ "version": "0.7.5-main.b19bfc8",
4
4
  "description": "Status bar plugin",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
7
7
  "license": "MIT",
8
8
  "author": "DXOS.org",
9
9
  "sideEffects": true,
10
+ "type": "module",
10
11
  "exports": {
11
12
  ".": {
12
13
  "types": "./dist/types/src/index.d.ts",
13
14
  "browser": "./dist/lib/browser/index.mjs",
14
15
  "node": "./dist/lib/node-esm/index.mjs"
15
- },
16
- "./meta": {
17
- "types": "./dist/types/src/meta.d.ts",
18
- "browser": "./dist/lib/browser/meta.mjs",
19
- "node": "./dist/lib/node-esm/meta.mjs"
20
16
  }
21
17
  },
22
18
  "types": "dist/types/src/index.d.ts",
23
19
  "typesVersions": {
24
- "*": {
25
- "meta": [
26
- "dist/types/src/meta.d.ts"
27
- ]
28
- }
20
+ "*": {}
29
21
  },
30
22
  "files": [
31
23
  "dist",
@@ -33,17 +25,19 @@
33
25
  ],
34
26
  "dependencies": {
35
27
  "@effect/schema": "^0.75.5",
36
- "@fluentui/react-tabster": "^9.19.0",
28
+ "@fluentui/react-tabster": "9.23.3",
37
29
  "@preact/signals-core": "^1.6.0",
38
- "@radix-ui/react-slot": "^1.0.1",
39
- "effect": "^3.12.1",
30
+ "@radix-ui/react-slot": "1.1.2",
31
+ "date-fns": "^3.3.1",
32
+ "effect": "^3.12.3",
40
33
  "react-resize-detector": "^11.0.1",
41
- "@dxos/async": "0.7.5-main.9d26e3a",
42
- "@dxos/echo-schema": "0.7.5-main.9d26e3a",
43
- "@dxos/app-framework": "0.7.5-main.9d26e3a",
44
- "@dxos/schema": "0.7.5-main.9d26e3a",
45
- "@dxos/react-ui-form": "0.7.5-main.9d26e3a",
46
- "@dxos/plugin-observability": "0.7.5-main.9d26e3a"
34
+ "@dxos/app-framework": "0.7.5-main.b19bfc8",
35
+ "@dxos/async": "0.7.5-main.b19bfc8",
36
+ "@dxos/echo-schema": "0.7.5-main.b19bfc8",
37
+ "@dxos/react-client": "0.7.5-main.b19bfc8",
38
+ "@dxos/react-ui-form": "0.7.5-main.b19bfc8",
39
+ "@dxos/schema": "0.7.5-main.b19bfc8",
40
+ "@dxos/plugin-observability": "0.7.5-main.b19bfc8"
47
41
  },
48
42
  "devDependencies": {
49
43
  "@phosphor-icons/react": "^2.1.5",
@@ -52,16 +46,16 @@
52
46
  "react": "~18.2.0",
53
47
  "react-dom": "~18.2.0",
54
48
  "vite": "5.4.7",
55
- "@dxos/react-ui": "0.7.5-main.9d26e3a",
56
- "@dxos/storybook-utils": "0.7.5-main.9d26e3a",
57
- "@dxos/react-ui-theme": "0.7.5-main.9d26e3a"
49
+ "@dxos/react-ui": "0.7.5-main.b19bfc8",
50
+ "@dxos/react-ui-theme": "0.7.5-main.b19bfc8",
51
+ "@dxos/storybook-utils": "0.7.5-main.b19bfc8"
58
52
  },
59
53
  "peerDependencies": {
60
54
  "@phosphor-icons/react": "^2.0.5",
61
55
  "react": "~18.2.0",
62
56
  "react-dom": "~18.2.0",
63
- "@dxos/react-ui-theme": "0.7.5-main.9d26e3a",
64
- "@dxos/react-ui": "0.7.5-main.9d26e3a"
57
+ "@dxos/react-ui-theme": "0.7.5-main.b19bfc8",
58
+ "@dxos/react-ui": "0.7.5-main.b19bfc8"
65
59
  },
66
60
  "publishConfig": {
67
61
  "access": "public"
@@ -5,31 +5,52 @@
5
5
  import React from 'react';
6
6
 
7
7
  import {
8
+ Capabilities,
9
+ contributes,
8
10
  createSurface,
9
- type PluginDefinition,
10
- type SurfaceProvides,
11
- type TranslationsProvides,
11
+ defineModule,
12
+ definePlugin,
13
+ Events,
14
+ Surface,
12
15
  } from '@dxos/app-framework';
13
16
 
14
- import { StatusBarPanel } from './components';
15
- import meta from './meta';
17
+ import { StatusBarActions, StatusBarPanel } from './components';
18
+ import { VersionNumber } from './components/VersionNumber';
19
+ import { meta, STATUS_BAR_PLUGIN } from './meta';
16
20
  import translations from './translations';
17
21
 
18
- export type StatusBarPluginProvides = SurfaceProvides & TranslationsProvides;
19
-
20
- export const StatusBarPlugin = (): PluginDefinition<StatusBarPluginProvides> => {
21
- return {
22
- meta,
23
- provides: {
24
- translations,
25
- surface: {
26
- definitions: () =>
22
+ export const StatusBarPlugin = () =>
23
+ definePlugin(meta, [
24
+ defineModule({
25
+ id: `${meta.id}/module/translations`,
26
+ activatesOn: Events.SetupTranslations,
27
+ activate: () => contributes(Capabilities.Translations, translations),
28
+ }),
29
+ defineModule({
30
+ id: `${meta.id}/module/react-surface`,
31
+ activatesOn: Events.SetupReactSurface,
32
+ activate: () =>
33
+ contributes(Capabilities.ReactSurface, [
27
34
  createSurface({
28
35
  id: meta.id,
29
36
  role: 'status-bar',
30
37
  component: () => <StatusBarPanel />,
31
38
  }),
32
- },
33
- },
34
- };
35
- };
39
+ createSurface({
40
+ id: meta.id,
41
+ role: 'status-bar--r0-footer',
42
+ component: () => <Surface role='status' />,
43
+ }),
44
+ createSurface({
45
+ id: meta.id,
46
+ role: 'status-bar--r1-footer',
47
+ component: () => <StatusBarActions />,
48
+ }),
49
+ createSurface({
50
+ id: `${STATUS_BAR_PLUGIN}/header-end`,
51
+ role: 'header-end',
52
+ component: () => <VersionNumber />,
53
+ }),
54
+ ]),
55
+ }),
56
+ ]);
@@ -13,7 +13,7 @@ import { withTheme } from '@dxos/storybook-utils';
13
13
  import { StatusBar } from './StatusBar';
14
14
 
15
15
  export const DefaultStory = () => (
16
- <StatusBar.Container>
16
+ <div>
17
17
  <StatusBar.EndContent>
18
18
  <StatusBar.Button>
19
19
  <Icon icon='ph--mailbox--regular' size={4} />
@@ -30,7 +30,7 @@ export const DefaultStory = () => (
30
30
  <StatusBar.Text>Online</StatusBar.Text>
31
31
  </StatusBar.Item>
32
32
  </StatusBar.EndContent>
33
- </StatusBar.Container>
33
+ </div>
34
34
  );
35
35
 
36
36
  export const Default = {};
@@ -2,9 +2,8 @@
2
2
  // Copyright 2024 DXOS.org
3
3
  //
4
4
 
5
- import { useFocusableGroup } from '@fluentui/react-tabster';
6
5
  import { Slot } from '@radix-ui/react-slot';
7
- import React, { forwardRef, type HTMLAttributes, type ReactNode } from 'react';
6
+ import React, { type ComponentPropsWithRef, forwardRef, type PropsWithChildren, type ReactNode } from 'react';
8
7
 
9
8
  import { type ThemedClassName } from '@dxos/react-ui';
10
9
  import { mx } from '@dxos/react-ui-theme';
@@ -17,14 +16,13 @@ const StatusBarText = forwardRef<HTMLSpanElement, StatusBarTextProps>(({ classNa
17
16
  </span>
18
17
  ));
19
18
 
20
- type StatusBarButtonProps = ThemedClassName<{ children: ReactNode; asChild?: boolean }> &
21
- HTMLAttributes<HTMLButtonElement>;
19
+ type StatusBarButtonProps = ThemedClassName<ComponentPropsWithRef<'button'> & { asChild?: boolean }>;
22
20
 
23
21
  const StatusBarButton = forwardRef<HTMLButtonElement, StatusBarButtonProps>(
24
22
  ({ classNames, children, asChild, ...props }, forwardedRef) => {
25
23
  const classes = mx(
26
- 'flex items-center gap-2 p-1 px-2 rounded-sm',
27
- 'select-none cursor-pointer ch-focus-ring',
24
+ 'flex items-center justify-center gap-2 p-1 px-2 rounded-sm',
25
+ 'select-none cursor-pointer dx-focus-ring text-description text-xs',
28
26
  'hover:bg-neutral-75 active:bg-neutral-150 dark:hover:bg-neutral-750 dark:active:bg-neutral-700',
29
27
  classNames,
30
28
  );
@@ -43,13 +41,13 @@ const StatusBarButton = forwardRef<HTMLButtonElement, StatusBarButtonProps>(
43
41
 
44
42
  export default StatusBarButton;
45
43
 
46
- type StatusBarItemProps = ThemedClassName<{ children: ReactNode }> & HTMLAttributes<HTMLDivElement>;
44
+ type StatusBarItemProps = ThemedClassName<ComponentPropsWithRef<'div'>>;
47
45
 
48
46
  const StatusBarItem = forwardRef<HTMLDivElement, StatusBarItemProps>(
49
47
  ({ classNames, children, ...props }, forwardedRef) => (
50
48
  <div
51
49
  role='menuitem'
52
- className={mx('flex items-center gap-2 p-1 px-2 rounded-sm select-none', classNames)}
50
+ className={mx('flex items-center justify-center gap-2 p-1 px-2 rounded-sm select-none', classNames)}
53
51
  ref={forwardedRef}
54
52
  {...props}
55
53
  >
@@ -58,30 +56,7 @@ const StatusBarItem = forwardRef<HTMLDivElement, StatusBarItemProps>(
58
56
  ),
59
57
  );
60
58
 
61
- type StatusBarContainerProps = ThemedClassName<{ children: ReactNode }>;
62
-
63
- // TODO(zan): tabable group with tabster.
64
- const StatusBarContainer = forwardRef<HTMLDivElement, StatusBarContainerProps>(
65
- ({ classNames, children }, forwardedRef) => {
66
- const groupAttrs = useFocusableGroup({ tabBehavior: 'limited' });
67
- return (
68
- <div
69
- role='menubar'
70
- tabIndex={0}
71
- {...groupAttrs}
72
- className={mx(
73
- 'bs-[--statusbar-size] flex justify-end items-center gap-2 bg-base text-description text-lg pointer-fine:text-xs ch-focus-ring-inset',
74
- classNames,
75
- )}
76
- ref={forwardedRef}
77
- >
78
- {children}
79
- </div>
80
- );
81
- },
82
- );
83
-
84
- type StartContentProps = ThemedClassName<{ children: ReactNode }>;
59
+ type StartContentProps = ThemedClassName<PropsWithChildren<{}>>;
85
60
 
86
61
  const StartContent = forwardRef<HTMLDivElement, StartContentProps>(({ classNames, children }, forwardedRef) => (
87
62
  <div role='none' className={mx('flex-grow flex items-center space-x-2', classNames)} ref={forwardedRef}>
@@ -89,7 +64,7 @@ const StartContent = forwardRef<HTMLDivElement, StartContentProps>(({ classNames
89
64
  </div>
90
65
  ));
91
66
 
92
- type EndContentProps = ThemedClassName<{ children: ReactNode }>;
67
+ type EndContentProps = ThemedClassName<PropsWithChildren<{}>>;
93
68
 
94
69
  const EndContent = forwardRef<HTMLDivElement, EndContentProps>(({ classNames, children }, forwardedRef) => (
95
70
  <div role='none' className={mx('flex-grow flex items-center justify-end', classNames)} ref={forwardedRef}>
@@ -98,7 +73,6 @@ const EndContent = forwardRef<HTMLDivElement, EndContentProps>(({ classNames, ch
98
73
  ));
99
74
 
100
75
  export const StatusBar = {
101
- Container: StatusBarContainer,
102
76
  Text: StatusBarText,
103
77
  Item: StatusBarItem,
104
78
  Button: StatusBarButton,
@@ -5,39 +5,48 @@
5
5
  import React, { useState } from 'react';
6
6
 
7
7
  import { Surface } from '@dxos/app-framework';
8
- import { Icon, Popover } from '@dxos/react-ui';
8
+ import { Icon, Popover, useTranslation } from '@dxos/react-ui';
9
9
 
10
10
  import { FeedbackForm } from './FeedbackForm';
11
11
  import { StatusBar } from './StatusBar';
12
+ import { VersionNumber } from './VersionNumber';
13
+ import { STATUS_BAR_PLUGIN } from '../meta';
12
14
 
13
- export const StatusBarPanel = () => {
15
+ export const StatusBarActions = () => {
16
+ const { t } = useTranslation(STATUS_BAR_PLUGIN);
14
17
  const [open, setOpen] = useState(false);
15
-
16
- // TODO(wittjosiah): Factor out feedback and discord buttons.
17
18
  return (
18
19
  <Popover.Root open={open} onOpenChange={setOpen}>
19
- <StatusBar.Container>
20
- <StatusBar.EndContent>
21
- <Surface role='status' />
22
- <Popover.Trigger asChild>
23
- <StatusBar.Button aria-label='Give feedback about composer' data-joyride='welcome/feedback'>
24
- <Icon icon='ph--paper-plane-tilt--regular' size={4} />
25
- <StatusBar.Text classNames='hidden sm:block'>Feedback</StatusBar.Text>
26
- </StatusBar.Button>
27
- </Popover.Trigger>
28
- {/* TODO(zan): Configure this label? */}
29
- <StatusBar.Button aria-label='Open DXOS Discord' asChild>
30
- <a href='https://dxos.org/discord' target='_blank' rel='noopener noreferrer'>
31
- <Icon icon='ph--discord-logo--regular' size={4} />
32
- <StatusBar.Text classNames='hidden sm:block'>Discord</StatusBar.Text>
33
- </a>
34
- </StatusBar.Button>
35
- </StatusBar.EndContent>
36
- </StatusBar.Container>
37
- <Popover.Content classNames='shadow-lg'>
38
- <FeedbackForm onClose={() => setOpen(false)} />
39
- <Popover.Arrow />
40
- </Popover.Content>
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
+ {/* TODO(zan): Configure this label? */}
27
+ <StatusBar.Button asChild>
28
+ <a href='https://dxos.org/discord' target='_blank' rel='noopener noreferrer'>
29
+ <Icon icon='ph--discord-logo--regular' size={4} />
30
+ <StatusBar.Text classNames='hidden sm:block'>{t('discord label')}</StatusBar.Text>
31
+ </a>
32
+ </StatusBar.Button>
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>
41
40
  </Popover.Root>
42
41
  );
43
42
  };
43
+
44
+ export const StatusBarPanel = () => {
45
+ return (
46
+ <>
47
+ <StatusBarActions />
48
+ <span role='separator' className='grow' />
49
+ <Surface role='status' />
50
+ </>
51
+ );
52
+ };
@@ -0,0 +1,86 @@
1
+ //
2
+ // Copyright 2024 DXOS.org
3
+ //
4
+
5
+ import { formatDistance } from 'date-fns/formatDistance';
6
+ import React from 'react';
7
+
8
+ import { useConfig } from '@dxos/react-client';
9
+ import { Link, Message, Popover, Trans, useTranslation, Icon } from '@dxos/react-ui';
10
+
11
+ import { StatusBar } from './StatusBar';
12
+ import { STATUS_BAR_PLUGIN } from '../meta';
13
+
14
+ const repo = 'https://github.com/dxos/dxos';
15
+
16
+ const VERSION_REGEX = /([\d.]+)/;
17
+
18
+ export const VersionNumber = () => {
19
+ const config = useConfig();
20
+ const { t } = useTranslation(STATUS_BAR_PLUGIN);
21
+ const { version, timestamp, commitHash } = config.values.runtime?.app?.build ?? {};
22
+ const [_, v] = version?.match(VERSION_REGEX) ?? [];
23
+
24
+ const releaseUrl =
25
+ config.values.runtime?.app?.env?.DX_ENVIRONMENT === 'production'
26
+ ? `${repo}/releases/tag/v${version}`
27
+ : `${repo}/commit/${commitHash}`;
28
+
29
+ const previewUrl = 'https://docs.dxos.org/composer#technology-preview';
30
+
31
+ return (
32
+ <Popover.Root>
33
+ <Popover.Trigger asChild>
34
+ <StatusBar.Button classNames='text-xs'>v{v}</StatusBar.Button>
35
+ </Popover.Trigger>
36
+ <Popover.Portal>
37
+ <Popover.Content
38
+ side='top'
39
+ role='message'
40
+ classNames='z-[12] bg-warning-500 max-is-[min(calc(100vw-16px),40ch)]'
41
+ >
42
+ <Message.Root valence='warning' className='rounded-be-none p-5'>
43
+ <Message.Title>
44
+ <Icon icon='ph--warning--duotone' size={6} classNames='inline mie-2' />
45
+ <span>{t('warning title')}</span>
46
+ </Message.Title>
47
+ <Message.Body>
48
+ {t('technology preview message')}
49
+ <br />
50
+ <Link href={previewUrl} target='_blank' rel='noreferrer' variant='neutral'>
51
+ {t('learn more label')}
52
+ <Icon icon='ph--arrow-square-out--bold' classNames='inline mis-1' />
53
+ </Link>
54
+ </Message.Body>
55
+ </Message.Root>
56
+ <div role='none' className='plb-4 pli-5 space-b-2 text-baseText'>
57
+ {timestamp && (
58
+ <p>
59
+ {t('released message', {
60
+ released: formatDistance(new Date(timestamp), new Date(), { addSuffix: true }),
61
+ })}
62
+ <br />
63
+ <Link href={releaseUrl} target='_blank' rel='noreferrer' variant='neutral'>
64
+ {t('see release label')}
65
+ <Icon icon='ph--arrow-square-out--bold' classNames='inline mis-1' />
66
+ </Link>
67
+ </p>
68
+ )}
69
+ <p>
70
+ <Trans
71
+ {...{
72
+ t,
73
+ i18nKey: 'powered by dxos message',
74
+ components: {
75
+ dxos: <Link href='https://dxos.org' target='_blank' rel='noreferrer' variant='neutral' />,
76
+ },
77
+ }}
78
+ />
79
+ </p>
80
+ </div>
81
+ <Popover.Arrow />
82
+ </Popover.Content>
83
+ </Popover.Portal>
84
+ </Popover.Root>
85
+ );
86
+ };
package/src/index.ts CHANGED
@@ -2,9 +2,6 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import { StatusBarPlugin } from './StatusBarPlugin';
6
-
7
- export default StatusBarPlugin;
8
-
9
- export * from './StatusBarPlugin';
10
5
  export * from './components';
6
+ export * from './meta';
7
+ export * from './StatusBarPlugin';
package/src/meta.ts CHANGED
@@ -6,7 +6,7 @@ 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 default {
9
+ export const meta = {
10
10
  id: STATUS_BAR_PLUGIN,
11
11
  name: 'Status Bar',
12
12
  description: 'Display a bar with status and actions.',
@@ -14,7 +14,15 @@ type StatusBarTranslationKeys =
14
14
  | 'feedback text area placeholder'
15
15
  | 'send feedback label'
16
16
  | 'name label'
17
- | 'name placeholder';
17
+ | 'name placeholder'
18
+ | 'warning title'
19
+ | 'technology preview message'
20
+ | 'learn more label'
21
+ | 'released message'
22
+ | 'see release label'
23
+ | 'powered by dxos message'
24
+ | 'discord label'
25
+ | 'feedback label';
18
26
 
19
27
  type RequiredTranslation = { [key in StatusBarTranslationKeys]: string };
20
28
  type TranslationEntry = { [STATUS_BAR_PLUGIN]: RequiredTranslation };
@@ -32,8 +40,16 @@ const translations: Record<Language, TranslationEntry> = {
32
40
  'email input label': 'Email',
33
41
  'email input placeholder': 'hello@example.com',
34
42
  'feedback text area label': 'Feedback',
35
- 'feedback text area placeholder': 'Found a bug? Have a suggestion? Let us know!',
43
+ 'feedback text area placeholder': 'Please describe your issue or suggestion.',
36
44
  'send feedback label': 'Send Feedback',
45
+ 'warning title': 'WARNING',
46
+ 'technology preview message': 'Composer is still in technology preview.',
47
+ 'learn more label': 'Learn more',
48
+ 'released message': 'This version released {{released}}.',
49
+ 'see release label': 'See release on GitHub',
50
+ 'powered by dxos message': 'Powered by <dxos>DXOS</dxos>',
51
+ 'discord label': 'Discord',
52
+ 'feedback label': 'Feedback',
37
53
  }),
38
54
  };
39
55
 
@@ -1,14 +0,0 @@
1
- // packages/plugins/plugin-status-bar/src/meta.ts
2
- var STATUS_BAR_PLUGIN = "dxos.org/plugin/status-bar";
3
- var meta_default = {
4
- id: STATUS_BAR_PLUGIN,
5
- name: "Status Bar",
6
- description: "Display a bar with status and actions.",
7
- icon: "ph--info--regular"
8
- };
9
-
10
- export {
11
- STATUS_BAR_PLUGIN,
12
- meta_default
13
- };
14
- //# sourceMappingURL=chunk-4KDZC7WS.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/meta.ts"],
4
- "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { type PluginMeta } from '@dxos/app-framework';\n\nexport const STATUS_BAR_PLUGIN = 'dxos.org/plugin/status-bar';\n\nexport default {\n id: STATUS_BAR_PLUGIN,\n name: 'Status Bar',\n description: 'Display a bar with status and actions.',\n icon: 'ph--info--regular',\n} satisfies PluginMeta;\n"],
5
- "mappings": ";AAMO,IAAMA,oBAAoB;AAEjC,IAAA,eAAe;EACbC,IAAID;EACJE,MAAM;EACNC,aAAa;EACbC,MAAM;AACR;",
6
- "names": ["STATUS_BAR_PLUGIN", "id", "name", "description", "icon"]
7
- }
@@ -1,9 +0,0 @@
1
- import {
2
- STATUS_BAR_PLUGIN,
3
- meta_default
4
- } from "./chunk-4KDZC7WS.mjs";
5
- export {
6
- STATUS_BAR_PLUGIN,
7
- meta_default as default
8
- };
9
- //# sourceMappingURL=meta.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": [],
4
- "sourcesContent": [],
5
- "mappings": "",
6
- "names": []
7
- }
@@ -1,37 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var chunk_OGG3PMIV_exports = {};
20
- __export(chunk_OGG3PMIV_exports, {
21
- STATUS_BAR_PLUGIN: () => STATUS_BAR_PLUGIN,
22
- meta_default: () => meta_default
23
- });
24
- module.exports = __toCommonJS(chunk_OGG3PMIV_exports);
25
- var STATUS_BAR_PLUGIN = "dxos.org/plugin/status-bar";
26
- var meta_default = {
27
- id: STATUS_BAR_PLUGIN,
28
- name: "Status Bar",
29
- description: "Display a bar with status and actions.",
30
- icon: "ph--info--regular"
31
- };
32
- // Annotate the CommonJS export names for ESM import in node:
33
- 0 && (module.exports = {
34
- STATUS_BAR_PLUGIN,
35
- meta_default
36
- });
37
- //# sourceMappingURL=chunk-OGG3PMIV.cjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/meta.ts"],
4
- "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { type PluginMeta } from '@dxos/app-framework';\n\nexport const STATUS_BAR_PLUGIN = 'dxos.org/plugin/status-bar';\n\nexport default {\n id: STATUS_BAR_PLUGIN,\n name: 'Status Bar',\n description: 'Display a bar with status and actions.',\n icon: 'ph--info--regular',\n} satisfies PluginMeta;\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAMO,IAAMA,oBAAoB;AAEjC,IAAA,eAAe;EACbC,IAAID;EACJE,MAAM;EACNC,aAAa;EACbC,MAAM;AACR;",
6
- "names": ["STATUS_BAR_PLUGIN", "id", "name", "description", "icon"]
7
- }