@dxos/plugin-status-bar 0.8.4-main.bc674ce → 0.8.4-main.bcb3aa67d6
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 +77 -29
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node-esm/index.mjs +78 -29
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/types/src/StatusBarPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +2 -1
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts +5 -0
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
- package/dist/types/src/components/{StatusBar.d.ts → StatusBar/StatusBar.d.ts} +6 -4
- package/dist/types/src/components/StatusBar/StatusBar.d.ts.map +1 -0
- package/dist/types/src/components/{StatusBar.stories.d.ts → StatusBar/StatusBar.stories.d.ts} +3 -0
- package/dist/types/src/components/StatusBar/StatusBar.stories.d.ts.map +1 -0
- package/dist/types/src/components/StatusBar/index.d.ts +2 -0
- package/dist/types/src/components/StatusBar/index.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +0 -2
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/containers/StatusBarActions/StatusBarActions.d.ts +4 -0
- package/dist/types/src/containers/StatusBarActions/StatusBarActions.d.ts.map +1 -0
- package/dist/types/src/containers/StatusBarActions/index.d.ts +3 -0
- package/dist/types/src/containers/StatusBarActions/index.d.ts.map +1 -0
- package/dist/types/src/containers/StatusBarPanel/StatusBarPanel.d.ts +4 -0
- package/dist/types/src/containers/StatusBarPanel/StatusBarPanel.d.ts.map +1 -0
- package/dist/types/src/containers/StatusBarPanel/index.d.ts +3 -0
- package/dist/types/src/containers/StatusBarPanel/index.d.ts.map +1 -0
- package/dist/types/src/containers/VersionNumber/VersionNumber.d.ts +4 -0
- package/dist/types/src/containers/VersionNumber/VersionNumber.d.ts.map +1 -0
- package/dist/types/src/containers/VersionNumber/index.d.ts +3 -0
- package/dist/types/src/containers/VersionNumber/index.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +5 -0
- package/dist/types/src/containers/index.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +11 -11
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +26 -19
- package/src/StatusBarPlugin.ts +7 -5
- package/src/capabilities/index.ts +3 -1
- package/src/capabilities/react-surface.tsx +34 -0
- package/src/components/StatusBar/StatusBar.stories.tsx +45 -0
- package/src/components/{StatusBar.tsx → StatusBar/StatusBar.tsx} +41 -19
- package/src/components/StatusBar/index.ts +5 -0
- package/src/components/index.ts +0 -2
- package/src/{components/StatusBarPanel.tsx → containers/StatusBarActions/StatusBarActions.tsx} +10 -20
- package/src/containers/StatusBarActions/index.ts +7 -0
- package/src/containers/StatusBarPanel/StatusBarPanel.tsx +21 -0
- package/src/containers/StatusBarPanel/index.ts +7 -0
- package/src/{components → containers/VersionNumber}/VersionNumber.tsx +14 -13
- package/src/containers/VersionNumber/index.ts +7 -0
- package/src/containers/index.ts +9 -0
- package/src/meta.ts +1 -1
- package/src/translations.ts +11 -11
- package/dist/lib/browser/chunk-G3E35NNM.mjs +0 -195
- package/dist/lib/browser/chunk-G3E35NNM.mjs.map +0 -7
- package/dist/lib/browser/react-surface-MYYYPTEW.mjs +0 -40
- package/dist/lib/browser/react-surface-MYYYPTEW.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-RE6CUOP4.mjs +0 -197
- package/dist/lib/node-esm/chunk-RE6CUOP4.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-RNK64YYP.mjs +0 -41
- package/dist/lib/node-esm/react-surface-RNK64YYP.mjs.map +0 -7
- package/dist/types/src/capabilities/react-surface/index.d.ts +0 -3
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts +0 -5
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +0 -1
- package/dist/types/src/components/StatusBar.d.ts.map +0 -1
- package/dist/types/src/components/StatusBar.stories.d.ts.map +0 -1
- package/dist/types/src/components/StatusBarPanel.d.ts +0 -4
- package/dist/types/src/components/StatusBarPanel.d.ts.map +0 -1
- package/dist/types/src/components/VersionNumber.d.ts +0 -3
- package/dist/types/src/components/VersionNumber.d.ts.map +0 -1
- package/src/capabilities/react-surface/index.ts +0 -7
- package/src/capabilities/react-surface/react-surface.tsx +0 -39
- package/src/components/StatusBar.stories.tsx +0 -45
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-status-bar",
|
|
3
|
-
"version": "0.8.4-main.
|
|
3
|
+
"version": "0.8.4-main.bcb3aa67d6",
|
|
4
4
|
"description": "Status bar plugin",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -12,6 +12,12 @@
|
|
|
12
12
|
"author": "DXOS.org",
|
|
13
13
|
"sideEffects": true,
|
|
14
14
|
"type": "module",
|
|
15
|
+
"imports": {
|
|
16
|
+
"#capabilities": "./src/capabilities/index.ts",
|
|
17
|
+
"#components": "./src/components/index.ts",
|
|
18
|
+
"#containers": "./src/containers/index.ts",
|
|
19
|
+
"#meta": "./src/meta.ts"
|
|
20
|
+
},
|
|
15
21
|
"exports": {
|
|
16
22
|
".": {
|
|
17
23
|
"source": "./src/index.ts",
|
|
@@ -31,35 +37,36 @@
|
|
|
31
37
|
"dependencies": {
|
|
32
38
|
"@fluentui/react-tabster": "9.26.11",
|
|
33
39
|
"@radix-ui/react-slot": "1.1.2",
|
|
34
|
-
"date-fns": "^3.
|
|
35
|
-
"effect": "3.
|
|
40
|
+
"date-fns": "^3.6.0",
|
|
41
|
+
"effect": "3.20.0",
|
|
36
42
|
"react-resize-detector": "^11.0.1",
|
|
37
|
-
"@dxos/app-framework": "0.8.4-main.
|
|
38
|
-
"@dxos/async": "0.8.4-main.
|
|
39
|
-
"@dxos/
|
|
40
|
-
"@dxos/
|
|
41
|
-
"@dxos/
|
|
42
|
-
"@dxos/plugin-observability": "0.8.4-main.
|
|
43
|
-
"@dxos/
|
|
44
|
-
"@dxos/schema": "0.8.4-main.
|
|
45
|
-
"@dxos/react-ui-form": "0.8.4-main.
|
|
43
|
+
"@dxos/app-framework": "0.8.4-main.bcb3aa67d6",
|
|
44
|
+
"@dxos/async": "0.8.4-main.bcb3aa67d6",
|
|
45
|
+
"@dxos/app-toolkit": "0.8.4-main.bcb3aa67d6",
|
|
46
|
+
"@dxos/echo": "0.8.4-main.bcb3aa67d6",
|
|
47
|
+
"@dxos/operation": "0.8.4-main.bcb3aa67d6",
|
|
48
|
+
"@dxos/plugin-observability": "0.8.4-main.bcb3aa67d6",
|
|
49
|
+
"@dxos/react-client": "0.8.4-main.bcb3aa67d6",
|
|
50
|
+
"@dxos/schema": "0.8.4-main.bcb3aa67d6",
|
|
51
|
+
"@dxos/react-ui-form": "0.8.4-main.bcb3aa67d6",
|
|
52
|
+
"@dxos/util": "0.8.4-main.bcb3aa67d6"
|
|
46
53
|
},
|
|
47
54
|
"devDependencies": {
|
|
48
55
|
"@types/react": "~19.2.7",
|
|
49
56
|
"@types/react-dom": "~19.2.3",
|
|
50
57
|
"react": "~19.2.3",
|
|
51
58
|
"react-dom": "~19.2.3",
|
|
52
|
-
"vite": "7.1.
|
|
53
|
-
"@dxos/
|
|
54
|
-
"@dxos/
|
|
55
|
-
"@dxos/ui-theme": "0.8.4-main.
|
|
59
|
+
"vite": "^7.1.11",
|
|
60
|
+
"@dxos/react-ui": "0.8.4-main.bcb3aa67d6",
|
|
61
|
+
"@dxos/storybook-utils": "0.8.4-main.bcb3aa67d6",
|
|
62
|
+
"@dxos/ui-theme": "0.8.4-main.bcb3aa67d6"
|
|
56
63
|
},
|
|
57
64
|
"peerDependencies": {
|
|
58
|
-
"effect": "3.
|
|
65
|
+
"effect": "3.20.0",
|
|
59
66
|
"react": "~19.2.3",
|
|
60
67
|
"react-dom": "~19.2.3",
|
|
61
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
62
|
-
"@dxos/ui-theme": "0.8.4-main.
|
|
68
|
+
"@dxos/react-ui": "0.8.4-main.bcb3aa67d6",
|
|
69
|
+
"@dxos/ui-theme": "0.8.4-main.bcb3aa67d6"
|
|
63
70
|
},
|
|
64
71
|
"publishConfig": {
|
|
65
72
|
"access": "public"
|
package/src/StatusBarPlugin.ts
CHANGED
|
@@ -2,14 +2,16 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { Plugin } from '@dxos/app-framework';
|
|
6
|
+
import { AppPlugin } from '@dxos/app-toolkit';
|
|
6
7
|
|
|
7
|
-
import {
|
|
8
|
-
import { meta } from './meta';
|
|
8
|
+
import { meta } from '#meta';
|
|
9
9
|
import { translations } from './translations';
|
|
10
10
|
|
|
11
|
+
import { ReactSurface } from '#capabilities';
|
|
12
|
+
|
|
11
13
|
export const StatusBarPlugin = Plugin.define(meta).pipe(
|
|
12
|
-
|
|
13
|
-
|
|
14
|
+
AppPlugin.addSurfaceModule({ activate: ReactSurface }),
|
|
15
|
+
AppPlugin.addTranslationsModule({ translations }),
|
|
14
16
|
Plugin.make,
|
|
15
17
|
);
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
import React from 'react';
|
|
7
|
+
|
|
8
|
+
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
9
|
+
import { Surface } from '@dxos/app-framework/ui';
|
|
10
|
+
|
|
11
|
+
import { StatusBarActions, StatusBarPanel, VersionNumber } from '#containers';
|
|
12
|
+
import { meta } from '#meta';
|
|
13
|
+
|
|
14
|
+
export default Capability.makeModule(() =>
|
|
15
|
+
Effect.succeed(
|
|
16
|
+
Capability.contributes(Capabilities.ReactSurface, [
|
|
17
|
+
Surface.create({
|
|
18
|
+
id: `${meta.id}.status-bar`,
|
|
19
|
+
role: 'status-bar',
|
|
20
|
+
component: () => <StatusBarPanel />,
|
|
21
|
+
}),
|
|
22
|
+
Surface.create({
|
|
23
|
+
id: `${meta.id}.status-bar--r1-footer`,
|
|
24
|
+
role: 'status-bar--r1-footer',
|
|
25
|
+
component: () => <StatusBarActions />,
|
|
26
|
+
}),
|
|
27
|
+
Surface.create({
|
|
28
|
+
id: `${meta.id}.version-info`,
|
|
29
|
+
role: 'version-info',
|
|
30
|
+
component: () => <VersionNumber />,
|
|
31
|
+
}),
|
|
32
|
+
]),
|
|
33
|
+
),
|
|
34
|
+
);
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2024 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
6
|
+
import React from 'react';
|
|
7
|
+
|
|
8
|
+
import { Icon, IconButton } from '@dxos/react-ui';
|
|
9
|
+
import { withTheme } from '@dxos/react-ui/testing';
|
|
10
|
+
|
|
11
|
+
import { StatusBar } from './index';
|
|
12
|
+
|
|
13
|
+
export const DefaultStory = () => (
|
|
14
|
+
<StatusBar.EndContent>
|
|
15
|
+
<StatusBar.Button>
|
|
16
|
+
<Icon icon='ph--mailbox--regular' />
|
|
17
|
+
<StatusBar.Text>Quick feedback</StatusBar.Text>
|
|
18
|
+
</StatusBar.Button>
|
|
19
|
+
<a href='https://dxos.org/discord' target='_blank' rel='noopener noreferrer'>
|
|
20
|
+
<StatusBar.Button>
|
|
21
|
+
<Icon icon='ph--discord-logo--regular' />
|
|
22
|
+
<StatusBar.Text>Join us on Discord</StatusBar.Text>
|
|
23
|
+
</StatusBar.Button>
|
|
24
|
+
</a>
|
|
25
|
+
<StatusBar.Item>
|
|
26
|
+
<IconButton variant='ghost' icon='ph--lightning--regular' iconOnly label='Online' />
|
|
27
|
+
</StatusBar.Item>
|
|
28
|
+
</StatusBar.EndContent>
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
const meta = {
|
|
32
|
+
title: 'plugins/plugin-status-bar/components/StatusBar',
|
|
33
|
+
component: StatusBar as any,
|
|
34
|
+
render: DefaultStory,
|
|
35
|
+
decorators: [withTheme()],
|
|
36
|
+
parameters: {
|
|
37
|
+
layout: 'centered',
|
|
38
|
+
},
|
|
39
|
+
} satisfies Meta<typeof StatusBar>;
|
|
40
|
+
|
|
41
|
+
export default meta;
|
|
42
|
+
|
|
43
|
+
type Story = StoryObj<typeof meta>;
|
|
44
|
+
|
|
45
|
+
export const Default: Story = {};
|
|
@@ -8,6 +8,26 @@ import React, { type ComponentPropsWithRef, type PropsWithChildren, type ReactNo
|
|
|
8
8
|
import { type ThemedClassName } from '@dxos/react-ui';
|
|
9
9
|
import { mx } from '@dxos/ui-theme';
|
|
10
10
|
|
|
11
|
+
//
|
|
12
|
+
// Item
|
|
13
|
+
//
|
|
14
|
+
|
|
15
|
+
type StatusBarItemProps = ThemedClassName<PropsWithChildren>;
|
|
16
|
+
|
|
17
|
+
const StatusBarItem = forwardRef<HTMLDivElement, StatusBarItemProps>(
|
|
18
|
+
({ classNames, children, ...props }, forwardedRef) => {
|
|
19
|
+
return (
|
|
20
|
+
<div {...props} role='status' className={mx('grid place-items-center', classNames)} ref={forwardedRef}>
|
|
21
|
+
{children}
|
|
22
|
+
</div>
|
|
23
|
+
);
|
|
24
|
+
},
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
//
|
|
28
|
+
// Text
|
|
29
|
+
//
|
|
30
|
+
|
|
11
31
|
type StatusBarTextProps = ThemedClassName<{ children: ReactNode }>;
|
|
12
32
|
|
|
13
33
|
const StatusBarText = forwardRef<HTMLSpanElement, StatusBarTextProps>(({ classNames, children }, forwardedRef) => (
|
|
@@ -16,14 +36,21 @@ const StatusBarText = forwardRef<HTMLSpanElement, StatusBarTextProps>(({ classNa
|
|
|
16
36
|
</span>
|
|
17
37
|
));
|
|
18
38
|
|
|
39
|
+
//
|
|
40
|
+
// Button
|
|
41
|
+
//
|
|
42
|
+
|
|
19
43
|
type StatusBarButtonProps = ThemedClassName<ComponentPropsWithRef<'button'> & { asChild?: boolean }>;
|
|
20
44
|
|
|
45
|
+
/**
|
|
46
|
+
* @deprecated
|
|
47
|
+
*/
|
|
21
48
|
const StatusBarButton = forwardRef<HTMLButtonElement, StatusBarButtonProps>(
|
|
22
49
|
({ classNames, children, asChild, ...props }, forwardedRef) => {
|
|
23
50
|
const classes = mx(
|
|
24
|
-
'flex items-center justify-center gap-2 p-1
|
|
51
|
+
'flex items-center justify-center gap-2 p-1 px-2 rounded-xs',
|
|
25
52
|
'select-none cursor-pointer dx-focus-ring text-description text-xs',
|
|
26
|
-
'hover:bg-neutral-
|
|
53
|
+
'hover:bg-neutral-100 active:bg-neutral-200 dark:hover:bg-neutral-700 dark:active:bg-neutral-600',
|
|
27
54
|
classNames,
|
|
28
55
|
);
|
|
29
56
|
|
|
@@ -39,22 +66,9 @@ const StatusBarButton = forwardRef<HTMLButtonElement, StatusBarButtonProps>(
|
|
|
39
66
|
},
|
|
40
67
|
);
|
|
41
68
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
const StatusBarItem = forwardRef<HTMLDivElement, StatusBarItemProps>(
|
|
47
|
-
({ classNames, children, ...props }, forwardedRef) => (
|
|
48
|
-
<div
|
|
49
|
-
role='menuitem'
|
|
50
|
-
className={mx('flex items-center justify-center gap-2 p-1 pli-2 rounded-sm select-none', classNames)}
|
|
51
|
-
ref={forwardedRef}
|
|
52
|
-
{...props}
|
|
53
|
-
>
|
|
54
|
-
{children}
|
|
55
|
-
</div>
|
|
56
|
-
),
|
|
57
|
-
);
|
|
69
|
+
//
|
|
70
|
+
// Content
|
|
71
|
+
//
|
|
58
72
|
|
|
59
73
|
type StartContentProps = ThemedClassName<PropsWithChildren<{}>>;
|
|
60
74
|
|
|
@@ -64,6 +78,10 @@ const StartContent = forwardRef<HTMLDivElement, StartContentProps>(({ classNames
|
|
|
64
78
|
</div>
|
|
65
79
|
));
|
|
66
80
|
|
|
81
|
+
//
|
|
82
|
+
// EndContent
|
|
83
|
+
//
|
|
84
|
+
|
|
67
85
|
type EndContentProps = ThemedClassName<PropsWithChildren<{}>>;
|
|
68
86
|
|
|
69
87
|
const EndContent = forwardRef<HTMLDivElement, EndContentProps>(({ classNames, children }, forwardedRef) => (
|
|
@@ -72,9 +90,13 @@ const EndContent = forwardRef<HTMLDivElement, EndContentProps>(({ classNames, ch
|
|
|
72
90
|
</div>
|
|
73
91
|
));
|
|
74
92
|
|
|
93
|
+
//
|
|
94
|
+
// StatusBar
|
|
95
|
+
//
|
|
96
|
+
|
|
75
97
|
export const StatusBar = {
|
|
76
|
-
Text: StatusBarText,
|
|
77
98
|
Item: StatusBarItem,
|
|
99
|
+
Text: StatusBarText,
|
|
78
100
|
Button: StatusBarButton,
|
|
79
101
|
StartContent,
|
|
80
102
|
EndContent,
|
package/src/components/index.ts
CHANGED
package/src/{components/StatusBarPanel.tsx → containers/StatusBarActions/StatusBarActions.tsx}
RENAMED
|
@@ -4,16 +4,16 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { useState } from 'react';
|
|
6
6
|
|
|
7
|
-
import { Surface } from '@dxos/app-framework/react';
|
|
8
7
|
import { useConfig } from '@dxos/react-client';
|
|
9
8
|
import { Icon, Popover, useTranslation } from '@dxos/react-ui';
|
|
10
9
|
|
|
11
|
-
import {
|
|
10
|
+
import { StatusBar } from '#components';
|
|
11
|
+
import { meta } from '#meta';
|
|
12
|
+
import VersionNumber from '../VersionNumber';
|
|
12
13
|
|
|
13
|
-
|
|
14
|
-
import { VersionNumber } from './VersionNumber';
|
|
14
|
+
export type StatusBarActionsProps = {};
|
|
15
15
|
|
|
16
|
-
export const StatusBarActions = () => {
|
|
16
|
+
export const StatusBarActions = (_props: StatusBarActionsProps) => {
|
|
17
17
|
const { t } = useTranslation(meta.id);
|
|
18
18
|
const [open, setOpen] = useState(false);
|
|
19
19
|
|
|
@@ -23,30 +23,20 @@ export const StatusBarActions = () => {
|
|
|
23
23
|
<VersionNumber />
|
|
24
24
|
<StatusBar.Button asChild>
|
|
25
25
|
<a href='https://dxos.org/discord' target='_blank' rel='noopener noreferrer'>
|
|
26
|
-
<Icon icon='ph--discord-logo--regular'
|
|
27
|
-
<StatusBar.Text classNames='hidden sm:block'>{t('discord
|
|
26
|
+
<Icon icon='ph--discord-logo--regular' />
|
|
27
|
+
<StatusBar.Text classNames='hidden sm:block'>{t('discord.label')}</StatusBar.Text>
|
|
28
28
|
</a>
|
|
29
29
|
</StatusBar.Button>
|
|
30
30
|
<StatusBar.Button asChild>
|
|
31
31
|
<a href='https://github.com/dxos/dxos' target='_blank' rel='noopener noreferrer'>
|
|
32
|
-
<Icon icon='ph--github-logo--regular'
|
|
33
|
-
<StatusBar.Text classNames='hidden sm:block'>{t('github
|
|
32
|
+
<Icon icon='ph--github-logo--regular' />
|
|
33
|
+
<StatusBar.Text classNames='hidden sm:block'>{t('github.label')}</StatusBar.Text>
|
|
34
34
|
</a>
|
|
35
35
|
</StatusBar.Button>
|
|
36
36
|
</Popover.Root>
|
|
37
37
|
);
|
|
38
38
|
};
|
|
39
39
|
|
|
40
|
-
export const StatusBarPanel = () => {
|
|
41
|
-
return (
|
|
42
|
-
<>
|
|
43
|
-
<StatusBarActions />
|
|
44
|
-
<span role='separator' className='grow' />
|
|
45
|
-
<Surface role='status' />
|
|
46
|
-
</>
|
|
47
|
-
);
|
|
48
|
-
};
|
|
49
|
-
|
|
50
40
|
const ENV_LABELS: Record<string, string> = {
|
|
51
41
|
'edge-dev': 'Dev',
|
|
52
42
|
'edge-main': 'Main',
|
|
@@ -68,7 +58,7 @@ const EnvironmentLabel = () => {
|
|
|
68
58
|
|
|
69
59
|
return (
|
|
70
60
|
<StatusBar.Item>
|
|
71
|
-
<StatusBar.Text classNames='text-xs text-subdued border border-separator rounded-full
|
|
61
|
+
<StatusBar.Text classNames='text-xs text-subdued border border-separator rounded-full px-1'>
|
|
72
62
|
<span title={edgeEnv}>{edgeEnv[0]}</span>
|
|
73
63
|
</StatusBar.Text>
|
|
74
64
|
</StatusBar.Item>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2024 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React from 'react';
|
|
6
|
+
|
|
7
|
+
import { Surface } from '@dxos/app-framework/ui';
|
|
8
|
+
|
|
9
|
+
import StatusBarActionsDefault from '../StatusBarActions';
|
|
10
|
+
|
|
11
|
+
export type StatusBarPanelProps = {};
|
|
12
|
+
|
|
13
|
+
export const StatusBarPanel = (_props: StatusBarPanelProps) => {
|
|
14
|
+
return (
|
|
15
|
+
<>
|
|
16
|
+
<StatusBarActionsDefault />
|
|
17
|
+
<span role='separator' className='grow' />
|
|
18
|
+
<Surface.Surface role='status' />
|
|
19
|
+
</>
|
|
20
|
+
);
|
|
21
|
+
};
|
|
@@ -8,15 +8,16 @@ import React from 'react';
|
|
|
8
8
|
import { useConfig } from '@dxos/react-client';
|
|
9
9
|
import { Icon, Link, Message, Popover, Trans, useTranslation } from '@dxos/react-ui';
|
|
10
10
|
|
|
11
|
-
import {
|
|
11
|
+
import { StatusBar } from '#components';
|
|
12
|
+
import { meta } from '#meta';
|
|
12
13
|
|
|
13
|
-
|
|
14
|
+
export type VersionNumberProps = {};
|
|
14
15
|
|
|
15
16
|
const repo = 'https://github.com/dxos/dxos';
|
|
16
17
|
|
|
17
18
|
const VERSION_REGEX = /([\d.]+)/;
|
|
18
19
|
|
|
19
|
-
export const VersionNumber = () => {
|
|
20
|
+
export const VersionNumber = (_props: VersionNumberProps) => {
|
|
20
21
|
const { t } = useTranslation(meta.id);
|
|
21
22
|
const config = useConfig();
|
|
22
23
|
const { version, timestamp, commitHash } = config.values.runtime?.app?.build ?? {};
|
|
@@ -39,29 +40,29 @@ export const VersionNumber = () => {
|
|
|
39
40
|
<Popover.Content
|
|
40
41
|
side='top'
|
|
41
42
|
role='message'
|
|
42
|
-
classNames='z-[12] bg-warning-500 max-
|
|
43
|
+
classNames='z-[12] bg-warning-500 max-w-[min(calc(100vw-16px),40ch)]'
|
|
43
44
|
>
|
|
44
|
-
<Message.Root valence='warning' classNames='rounded-
|
|
45
|
-
<Message.Title>{t('warning
|
|
45
|
+
<Message.Root valence='warning' classNames='rounded-b-none p-5'>
|
|
46
|
+
<Message.Title>{t('warning.title')}</Message.Title>
|
|
46
47
|
<Message.Content>
|
|
47
|
-
{t('technology
|
|
48
|
+
{t('technology-preview.message')}
|
|
48
49
|
<br />
|
|
49
50
|
<Link href={previewUrl} target='_blank' rel='noreferrer' variant='neutral'>
|
|
50
|
-
{t('learn
|
|
51
|
-
<Icon icon='ph--arrow-square-out--bold' classNames='inline
|
|
51
|
+
{t('learn-more.label')}
|
|
52
|
+
<Icon icon='ph--arrow-square-out--bold' classNames='dx-icon-inline ms-1' />
|
|
52
53
|
</Link>
|
|
53
54
|
</Message.Content>
|
|
54
55
|
</Message.Root>
|
|
55
|
-
<div role='none' className='
|
|
56
|
+
<div role='none' className='py-4 px-5 space-b-2 text-base-surface-text'>
|
|
56
57
|
{timestamp && (
|
|
57
58
|
<p>
|
|
58
|
-
{t('released
|
|
59
|
+
{t('released.message', {
|
|
59
60
|
released: formatDistance(new Date(timestamp), new Date(), { addSuffix: true }),
|
|
60
61
|
})}
|
|
61
62
|
<br />
|
|
62
63
|
<Link href={releaseUrl} target='_blank' rel='noreferrer' variant='neutral'>
|
|
63
|
-
{t('see
|
|
64
|
-
<Icon icon='ph--arrow-square-out--bold' classNames='inline
|
|
64
|
+
{t('see-release.label')}
|
|
65
|
+
<Icon icon='ph--arrow-square-out--bold' classNames='dx-icon-inline ms-1' />
|
|
65
66
|
</Link>
|
|
66
67
|
</p>
|
|
67
68
|
)}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2024 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type ComponentType, lazy } from 'react';
|
|
6
|
+
|
|
7
|
+
export const StatusBarActions: ComponentType<any> = lazy(() => import('./StatusBarActions'));
|
|
8
|
+
export const StatusBarPanel: ComponentType<any> = lazy(() => import('./StatusBarPanel'));
|
|
9
|
+
export const VersionNumber: ComponentType<any> = lazy(() => import('./VersionNumber'));
|
package/src/meta.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { type Plugin } from '@dxos/app-framework';
|
|
|
6
6
|
import { trim } from '@dxos/util';
|
|
7
7
|
|
|
8
8
|
export const meta: Plugin.Meta = {
|
|
9
|
-
id: 'dxos.
|
|
9
|
+
id: 'org.dxos.plugin.status-bar',
|
|
10
10
|
name: 'Status Bar',
|
|
11
11
|
description: trim`
|
|
12
12
|
Persistent bottom bar displaying workspace status information and quick actions.
|
package/src/translations.ts
CHANGED
|
@@ -4,22 +4,22 @@
|
|
|
4
4
|
|
|
5
5
|
import { type Resource } from '@dxos/react-ui';
|
|
6
6
|
|
|
7
|
-
import { meta } from '
|
|
7
|
+
import { meta } from '#meta';
|
|
8
8
|
|
|
9
9
|
export const translations = [
|
|
10
10
|
{
|
|
11
11
|
'en-US': {
|
|
12
12
|
[meta.id]: {
|
|
13
|
-
'plugin
|
|
14
|
-
'warning
|
|
15
|
-
'technology
|
|
16
|
-
'learn
|
|
17
|
-
'released
|
|
18
|
-
'see
|
|
19
|
-
'powered
|
|
20
|
-
'discord
|
|
21
|
-
'github
|
|
22
|
-
'feedback
|
|
13
|
+
'plugin.name': 'Status Bar',
|
|
14
|
+
'warning.title': 'WARNING',
|
|
15
|
+
'technology-preview.message': 'Composer is currently in beta.',
|
|
16
|
+
'learn-more.label': 'Learn more',
|
|
17
|
+
'released.message': 'This version was released {{released}}.',
|
|
18
|
+
'see-release.label': 'See release on GitHub',
|
|
19
|
+
'powered-by-dxos.message': 'Powered by <dxos>DXOS</dxos>',
|
|
20
|
+
'discord.label': 'Discord',
|
|
21
|
+
'github.label': 'GitHub',
|
|
22
|
+
'feedback.label': 'Feedback',
|
|
23
23
|
},
|
|
24
24
|
},
|
|
25
25
|
},
|