@dxos/plugin-status-bar 0.8.4-main.937b3ca → 0.8.4-main.9be5663bfe
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 -1
- 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/StatusBarActions.stories.d.ts +7 -0
- package/dist/types/src/containers/StatusBarActions/StatusBarActions.stories.d.ts.map +1 -0
- package/dist/types/src/containers/StatusBarActions/index.d.ts +2 -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 +2 -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 +2 -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 +33 -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/containers/StatusBarActions/StatusBarActions.stories.tsx +61 -0
- package/src/containers/StatusBarActions/StatusBarActions.tsx +70 -0
- package/src/containers/StatusBarActions/index.ts +5 -0
- package/src/containers/StatusBarPanel/StatusBarPanel.tsx +21 -0
- package/src/containers/StatusBarPanel/index.ts +5 -0
- package/src/containers/VersionNumber/VersionNumber.tsx +97 -0
- package/src/containers/VersionNumber/index.ts +5 -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/src/components/StatusBarPanel.tsx +0 -76
- package/src/components/VersionNumber.tsx +0 -85
|
@@ -1,195 +0,0 @@
|
|
|
1
|
-
// src/components/StatusBar.tsx
|
|
2
|
-
import { Slot } from "@radix-ui/react-slot";
|
|
3
|
-
import React, { forwardRef } from "react";
|
|
4
|
-
import { mx } from "@dxos/ui-theme";
|
|
5
|
-
var StatusBarText = /* @__PURE__ */ forwardRef(({ classNames, children }, forwardedRef) => /* @__PURE__ */ React.createElement("span", {
|
|
6
|
-
className: mx(classNames),
|
|
7
|
-
ref: forwardedRef
|
|
8
|
-
}, children));
|
|
9
|
-
var StatusBarButton = /* @__PURE__ */ forwardRef(({ classNames, children, asChild, ...props }, forwardedRef) => {
|
|
10
|
-
const classes = mx("flex items-center justify-center gap-2 p-1 pli-2 rounded-sm", "select-none cursor-pointer dx-focus-ring text-description text-xs", "hover:bg-neutral-75 active:bg-neutral-150 dark:hover:bg-neutral-750 dark:active:bg-neutral-700", classNames);
|
|
11
|
-
return asChild ? /* @__PURE__ */ React.createElement(Slot, {
|
|
12
|
-
role: "button",
|
|
13
|
-
ref: forwardedRef,
|
|
14
|
-
className: classes,
|
|
15
|
-
...props
|
|
16
|
-
}, children) : /* @__PURE__ */ React.createElement("button", {
|
|
17
|
-
className: classes,
|
|
18
|
-
ref: forwardedRef,
|
|
19
|
-
...props
|
|
20
|
-
}, children);
|
|
21
|
-
});
|
|
22
|
-
var StatusBarItem = /* @__PURE__ */ forwardRef(({ classNames, children, ...props }, forwardedRef) => /* @__PURE__ */ React.createElement("div", {
|
|
23
|
-
role: "menuitem",
|
|
24
|
-
className: mx("flex items-center justify-center gap-2 p-1 pli-2 rounded-sm select-none", classNames),
|
|
25
|
-
ref: forwardedRef,
|
|
26
|
-
...props
|
|
27
|
-
}, children));
|
|
28
|
-
var StartContent = /* @__PURE__ */ forwardRef(({ classNames, children }, forwardedRef) => /* @__PURE__ */ React.createElement("div", {
|
|
29
|
-
role: "none",
|
|
30
|
-
className: mx("flex-grow flex items-center space-x-2", classNames),
|
|
31
|
-
ref: forwardedRef
|
|
32
|
-
}, children));
|
|
33
|
-
var EndContent = /* @__PURE__ */ forwardRef(({ classNames, children }, forwardedRef) => /* @__PURE__ */ React.createElement("div", {
|
|
34
|
-
role: "none",
|
|
35
|
-
className: mx("flex-grow flex items-center justify-end", classNames),
|
|
36
|
-
ref: forwardedRef
|
|
37
|
-
}, children));
|
|
38
|
-
var StatusBar = {
|
|
39
|
-
Text: StatusBarText,
|
|
40
|
-
Item: StatusBarItem,
|
|
41
|
-
Button: StatusBarButton,
|
|
42
|
-
StartContent,
|
|
43
|
-
EndContent
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
// src/meta.ts
|
|
47
|
-
import { trim } from "@dxos/util";
|
|
48
|
-
var meta = {
|
|
49
|
-
id: "dxos.org/plugin/status-bar",
|
|
50
|
-
name: "Status Bar",
|
|
51
|
-
description: trim`
|
|
52
|
-
Persistent bottom bar displaying workspace status information and quick actions.
|
|
53
|
-
Access connection state, notifications, and common commands without leaving your current context.
|
|
54
|
-
`,
|
|
55
|
-
icon: "ph--info--regular"
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
// src/components/VersionNumber.tsx
|
|
59
|
-
import { formatDistance } from "date-fns/formatDistance";
|
|
60
|
-
import React2 from "react";
|
|
61
|
-
import { useConfig } from "@dxos/react-client";
|
|
62
|
-
import { Icon, Link, Message, Popover, Trans, useTranslation } from "@dxos/react-ui";
|
|
63
|
-
var repo = "https://github.com/dxos/dxos";
|
|
64
|
-
var VERSION_REGEX = /([\d.]+)/;
|
|
65
|
-
var VersionNumber = () => {
|
|
66
|
-
const { t } = useTranslation(meta.id);
|
|
67
|
-
const config = useConfig();
|
|
68
|
-
const { version, timestamp, commitHash } = config.values.runtime?.app?.build ?? {};
|
|
69
|
-
const [_, v] = version?.match(VERSION_REGEX) ?? [];
|
|
70
|
-
const isLabs = config.values.runtime?.app?.env?.DX_LABS;
|
|
71
|
-
const releaseUrl = config.values.runtime?.app?.env?.DX_ENVIRONMENT === "production" ? `${repo}/releases/tag/v${version}` : `${repo}/commit/${commitHash}`;
|
|
72
|
-
const previewUrl = "https://docs.dxos.org/composer#technology-preview";
|
|
73
|
-
return /* @__PURE__ */ React2.createElement(Popover.Root, null, /* @__PURE__ */ React2.createElement(Popover.Trigger, {
|
|
74
|
-
asChild: true
|
|
75
|
-
}, /* @__PURE__ */ React2.createElement(StatusBar.Button, {
|
|
76
|
-
classNames: "text-xs"
|
|
77
|
-
}, isLabs ? version : v)), /* @__PURE__ */ React2.createElement(Popover.Portal, null, /* @__PURE__ */ React2.createElement(Popover.Content, {
|
|
78
|
-
side: "top",
|
|
79
|
-
role: "message",
|
|
80
|
-
classNames: "z-[12] bg-warning-500 max-is-[min(calc(100vw-16px),40ch)]"
|
|
81
|
-
}, /* @__PURE__ */ React2.createElement(Message.Root, {
|
|
82
|
-
valence: "warning",
|
|
83
|
-
classNames: "rounded-be-none p-5"
|
|
84
|
-
}, /* @__PURE__ */ React2.createElement(Message.Title, null, t("warning title")), /* @__PURE__ */ React2.createElement(Message.Content, null, t("technology preview message"), /* @__PURE__ */ React2.createElement("br", null), /* @__PURE__ */ React2.createElement(Link, {
|
|
85
|
-
href: previewUrl,
|
|
86
|
-
target: "_blank",
|
|
87
|
-
rel: "noreferrer",
|
|
88
|
-
variant: "neutral"
|
|
89
|
-
}, t("learn more label"), /* @__PURE__ */ React2.createElement(Icon, {
|
|
90
|
-
icon: "ph--arrow-square-out--bold",
|
|
91
|
-
classNames: "inline mis-1"
|
|
92
|
-
})))), /* @__PURE__ */ React2.createElement("div", {
|
|
93
|
-
role: "none",
|
|
94
|
-
className: "plb-4 pli-5 space-b-2 text-baseText"
|
|
95
|
-
}, timestamp && /* @__PURE__ */ React2.createElement("p", null, t("released message", {
|
|
96
|
-
released: formatDistance(new Date(timestamp), /* @__PURE__ */ new Date(), {
|
|
97
|
-
addSuffix: true
|
|
98
|
-
})
|
|
99
|
-
}), /* @__PURE__ */ React2.createElement("br", null), /* @__PURE__ */ React2.createElement(Link, {
|
|
100
|
-
href: releaseUrl,
|
|
101
|
-
target: "_blank",
|
|
102
|
-
rel: "noreferrer",
|
|
103
|
-
variant: "neutral"
|
|
104
|
-
}, t("see release label"), /* @__PURE__ */ React2.createElement(Icon, {
|
|
105
|
-
icon: "ph--arrow-square-out--bold",
|
|
106
|
-
classNames: "inline mis-1"
|
|
107
|
-
}))), /* @__PURE__ */ React2.createElement("p", null, /* @__PURE__ */ React2.createElement(Trans, {
|
|
108
|
-
t,
|
|
109
|
-
i18nKey: "powered by dxos message",
|
|
110
|
-
components: {
|
|
111
|
-
dxos: /* @__PURE__ */ React2.createElement(Link, {
|
|
112
|
-
href: "https://dxos.org",
|
|
113
|
-
target: "_blank",
|
|
114
|
-
rel: "noreferrer",
|
|
115
|
-
variant: "neutral"
|
|
116
|
-
})
|
|
117
|
-
}
|
|
118
|
-
}))), /* @__PURE__ */ React2.createElement(Popover.Arrow, null))));
|
|
119
|
-
};
|
|
120
|
-
|
|
121
|
-
// src/components/StatusBarPanel.tsx
|
|
122
|
-
import React3, { useState } from "react";
|
|
123
|
-
import { Surface } from "@dxos/app-framework/react";
|
|
124
|
-
import { useConfig as useConfig2 } from "@dxos/react-client";
|
|
125
|
-
import { Icon as Icon2, Popover as Popover2, useTranslation as useTranslation2 } from "@dxos/react-ui";
|
|
126
|
-
var StatusBarActions = () => {
|
|
127
|
-
const { t } = useTranslation2(meta.id);
|
|
128
|
-
const [open, setOpen] = useState(false);
|
|
129
|
-
return /* @__PURE__ */ React3.createElement(Popover2.Root, {
|
|
130
|
-
open,
|
|
131
|
-
onOpenChange: setOpen
|
|
132
|
-
}, /* @__PURE__ */ React3.createElement(EnvironmentLabel, null), /* @__PURE__ */ React3.createElement(VersionNumber, null), /* @__PURE__ */ React3.createElement(StatusBar.Button, {
|
|
133
|
-
asChild: true
|
|
134
|
-
}, /* @__PURE__ */ React3.createElement("a", {
|
|
135
|
-
href: "https://dxos.org/discord",
|
|
136
|
-
target: "_blank",
|
|
137
|
-
rel: "noopener noreferrer"
|
|
138
|
-
}, /* @__PURE__ */ React3.createElement(Icon2, {
|
|
139
|
-
icon: "ph--discord-logo--regular",
|
|
140
|
-
size: 4
|
|
141
|
-
}), /* @__PURE__ */ React3.createElement(StatusBar.Text, {
|
|
142
|
-
classNames: "hidden sm:block"
|
|
143
|
-
}, t("discord label")))), /* @__PURE__ */ React3.createElement(StatusBar.Button, {
|
|
144
|
-
asChild: true
|
|
145
|
-
}, /* @__PURE__ */ React3.createElement("a", {
|
|
146
|
-
href: "https://github.com/dxos/dxos",
|
|
147
|
-
target: "_blank",
|
|
148
|
-
rel: "noopener noreferrer"
|
|
149
|
-
}, /* @__PURE__ */ React3.createElement(Icon2, {
|
|
150
|
-
icon: "ph--github-logo--regular",
|
|
151
|
-
size: 4
|
|
152
|
-
}), /* @__PURE__ */ React3.createElement(StatusBar.Text, {
|
|
153
|
-
classNames: "hidden sm:block"
|
|
154
|
-
}, t("github label")))));
|
|
155
|
-
};
|
|
156
|
-
var StatusBarPanel = () => {
|
|
157
|
-
return /* @__PURE__ */ React3.createElement(React3.Fragment, null, /* @__PURE__ */ React3.createElement(StatusBarActions, null), /* @__PURE__ */ React3.createElement("span", {
|
|
158
|
-
role: "separator",
|
|
159
|
-
className: "grow"
|
|
160
|
-
}), /* @__PURE__ */ React3.createElement(Surface, {
|
|
161
|
-
role: "status"
|
|
162
|
-
}));
|
|
163
|
-
};
|
|
164
|
-
var ENV_LABELS = {
|
|
165
|
-
"edge-dev": "Dev",
|
|
166
|
-
"edge-main": "Main",
|
|
167
|
-
"edge-labs": "Labs",
|
|
168
|
-
"edge-production": "Production"
|
|
169
|
-
};
|
|
170
|
-
var EnvironmentLabel = () => {
|
|
171
|
-
const config = useConfig2();
|
|
172
|
-
const edgeUrl = config.values.runtime?.services?.edge?.url;
|
|
173
|
-
if (!edgeUrl) {
|
|
174
|
-
return null;
|
|
175
|
-
}
|
|
176
|
-
const part = new URL(edgeUrl).host.split(".")[0];
|
|
177
|
-
const edgeEnv = ENV_LABELS[part];
|
|
178
|
-
if (!edgeEnv) {
|
|
179
|
-
return null;
|
|
180
|
-
}
|
|
181
|
-
return /* @__PURE__ */ React3.createElement(StatusBar.Item, null, /* @__PURE__ */ React3.createElement(StatusBar.Text, {
|
|
182
|
-
classNames: "text-xs text-subdued border border-separator rounded-full pli-1"
|
|
183
|
-
}, /* @__PURE__ */ React3.createElement("span", {
|
|
184
|
-
title: edgeEnv
|
|
185
|
-
}, edgeEnv[0])));
|
|
186
|
-
};
|
|
187
|
-
|
|
188
|
-
export {
|
|
189
|
-
StatusBar,
|
|
190
|
-
meta,
|
|
191
|
-
VersionNumber,
|
|
192
|
-
StatusBarActions,
|
|
193
|
-
StatusBarPanel
|
|
194
|
-
};
|
|
195
|
-
//# sourceMappingURL=chunk-G3E35NNM.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/StatusBar.tsx", "../../../src/meta.ts", "../../../src/components/VersionNumber.tsx", "../../../src/components/StatusBarPanel.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { Slot } from '@radix-ui/react-slot';\nimport React, { type ComponentPropsWithRef, type PropsWithChildren, type ReactNode, forwardRef } from 'react';\n\nimport { type ThemedClassName } from '@dxos/react-ui';\nimport { mx } from '@dxos/ui-theme';\n\ntype StatusBarTextProps = ThemedClassName<{ children: ReactNode }>;\n\nconst StatusBarText = forwardRef<HTMLSpanElement, StatusBarTextProps>(({ classNames, children }, forwardedRef) => (\n <span className={mx(classNames)} ref={forwardedRef}>\n {children}\n </span>\n));\n\ntype StatusBarButtonProps = ThemedClassName<ComponentPropsWithRef<'button'> & { asChild?: boolean }>;\n\nconst StatusBarButton = forwardRef<HTMLButtonElement, StatusBarButtonProps>(\n ({ classNames, children, asChild, ...props }, forwardedRef) => {\n const classes = mx(\n 'flex items-center justify-center gap-2 p-1 pli-2 rounded-sm',\n 'select-none cursor-pointer dx-focus-ring text-description text-xs',\n 'hover:bg-neutral-75 active:bg-neutral-150 dark:hover:bg-neutral-750 dark:active:bg-neutral-700',\n classNames,\n );\n\n return asChild ? (\n <Slot role='button' ref={forwardedRef} className={classes} {...props}>\n {children}\n </Slot>\n ) : (\n <button className={classes} ref={forwardedRef} {...props}>\n {children}\n </button>\n );\n },\n);\n\nexport default StatusBarButton;\n\ntype StatusBarItemProps = ThemedClassName<ComponentPropsWithRef<'div'>>;\n\nconst StatusBarItem = forwardRef<HTMLDivElement, StatusBarItemProps>(\n ({ classNames, children, ...props }, forwardedRef) => (\n <div\n role='menuitem'\n className={mx('flex items-center justify-center gap-2 p-1 pli-2 rounded-sm select-none', classNames)}\n ref={forwardedRef}\n {...props}\n >\n {children}\n </div>\n ),\n);\n\ntype StartContentProps = ThemedClassName<PropsWithChildren<{}>>;\n\nconst StartContent = forwardRef<HTMLDivElement, StartContentProps>(({ classNames, children }, forwardedRef) => (\n <div role='none' className={mx('flex-grow flex items-center space-x-2', classNames)} ref={forwardedRef}>\n {children}\n </div>\n));\n\ntype EndContentProps = ThemedClassName<PropsWithChildren<{}>>;\n\nconst EndContent = forwardRef<HTMLDivElement, EndContentProps>(({ classNames, children }, forwardedRef) => (\n <div role='none' className={mx('flex-grow flex items-center justify-end', classNames)} ref={forwardedRef}>\n {children}\n </div>\n));\n\nexport const StatusBar = {\n Text: StatusBarText,\n Item: StatusBarItem,\n Button: StatusBarButton,\n StartContent,\n EndContent,\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { type Plugin } from '@dxos/app-framework';\nimport { trim } from '@dxos/util';\n\nexport const meta: Plugin.Meta = {\n id: 'dxos.org/plugin/status-bar',\n name: 'Status Bar',\n description: trim`\n Persistent bottom bar displaying workspace status information and quick actions.\n Access connection state, notifications, and common commands without leaving your current context.\n `,\n icon: 'ph--info--regular',\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { formatDistance } from 'date-fns/formatDistance';\nimport React from 'react';\n\nimport { useConfig } from '@dxos/react-client';\nimport { Icon, Link, Message, Popover, Trans, useTranslation } from '@dxos/react-ui';\n\nimport { meta } from '../meta';\n\nimport { StatusBar } from './StatusBar';\n\nconst repo = 'https://github.com/dxos/dxos';\n\nconst VERSION_REGEX = /([\\d.]+)/;\n\nexport const VersionNumber = () => {\n const { t } = useTranslation(meta.id);\n const config = useConfig();\n const { version, timestamp, commitHash } = config.values.runtime?.app?.build ?? {};\n const [_, v] = version?.match(VERSION_REGEX) ?? [];\n const isLabs = config.values.runtime?.app?.env?.DX_LABS;\n\n const releaseUrl =\n config.values.runtime?.app?.env?.DX_ENVIRONMENT === 'production'\n ? `${repo}/releases/tag/v${version}`\n : `${repo}/commit/${commitHash}`;\n\n const previewUrl = 'https://docs.dxos.org/composer#technology-preview';\n\n return (\n <Popover.Root>\n <Popover.Trigger asChild>\n <StatusBar.Button classNames='text-xs'>{isLabs ? version : v}</StatusBar.Button>\n </Popover.Trigger>\n <Popover.Portal>\n <Popover.Content\n side='top'\n role='message'\n classNames='z-[12] bg-warning-500 max-is-[min(calc(100vw-16px),40ch)]'\n >\n <Message.Root valence='warning' classNames='rounded-be-none p-5'>\n <Message.Title>{t('warning title')}</Message.Title>\n <Message.Content>\n {t('technology preview message')}\n <br />\n <Link href={previewUrl} target='_blank' rel='noreferrer' variant='neutral'>\n {t('learn more label')}\n <Icon icon='ph--arrow-square-out--bold' classNames='inline mis-1' />\n </Link>\n </Message.Content>\n </Message.Root>\n <div role='none' className='plb-4 pli-5 space-b-2 text-baseText'>\n {timestamp && (\n <p>\n {t('released message', {\n released: formatDistance(new Date(timestamp), new Date(), { addSuffix: true }),\n })}\n <br />\n <Link href={releaseUrl} target='_blank' rel='noreferrer' variant='neutral'>\n {t('see release label')}\n <Icon icon='ph--arrow-square-out--bold' classNames='inline mis-1' />\n </Link>\n </p>\n )}\n <p>\n <Trans\n {...{\n t,\n i18nKey: 'powered by dxos message',\n components: {\n dxos: <Link href='https://dxos.org' target='_blank' rel='noreferrer' variant='neutral' />,\n },\n }}\n />\n </p>\n </div>\n <Popover.Arrow />\n </Popover.Content>\n </Popover.Portal>\n </Popover.Root>\n );\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { useState } from 'react';\n\nimport { Surface } from '@dxos/app-framework/react';\nimport { useConfig } from '@dxos/react-client';\nimport { Icon, Popover, useTranslation } from '@dxos/react-ui';\n\nimport { meta } from '../meta';\n\nimport { StatusBar } from './StatusBar';\nimport { VersionNumber } from './VersionNumber';\n\nexport const StatusBarActions = () => {\n const { t } = useTranslation(meta.id);\n const [open, setOpen] = useState(false);\n\n return (\n <Popover.Root open={open} onOpenChange={setOpen}>\n <EnvironmentLabel />\n <VersionNumber />\n <StatusBar.Button asChild>\n <a href='https://dxos.org/discord' target='_blank' rel='noopener noreferrer'>\n <Icon icon='ph--discord-logo--regular' size={4} />\n <StatusBar.Text classNames='hidden sm:block'>{t('discord label')}</StatusBar.Text>\n </a>\n </StatusBar.Button>\n <StatusBar.Button asChild>\n <a href='https://github.com/dxos/dxos' target='_blank' rel='noopener noreferrer'>\n <Icon icon='ph--github-logo--regular' size={4} />\n <StatusBar.Text classNames='hidden sm:block'>{t('github label')}</StatusBar.Text>\n </a>\n </StatusBar.Button>\n </Popover.Root>\n );\n};\n\nexport const StatusBarPanel = () => {\n return (\n <>\n <StatusBarActions />\n <span role='separator' className='grow' />\n <Surface role='status' />\n </>\n );\n};\n\nconst ENV_LABELS: Record<string, string> = {\n 'edge-dev': 'Dev',\n 'edge-main': 'Main',\n 'edge-labs': 'Labs',\n 'edge-production': 'Production',\n};\n\nconst EnvironmentLabel = () => {\n const config = useConfig();\n const edgeUrl = config.values.runtime?.services?.edge?.url;\n if (!edgeUrl) {\n return null;\n }\n const part = new URL(edgeUrl).host.split('.')[0];\n const edgeEnv = ENV_LABELS[part];\n if (!edgeEnv) {\n return null;\n }\n\n return (\n <StatusBar.Item>\n <StatusBar.Text classNames='text-xs text-subdued border border-separator rounded-full pli-1'>\n <span title={edgeEnv}>{edgeEnv[0]}</span>\n </StatusBar.Text>\n </StatusBar.Item>\n );\n};\n"],
|
|
5
|
-
"mappings": ";AAIA,SAASA,YAAY;AACrB,OAAOC,SAA6EC,kBAAkB;AAGtG,SAASC,UAAU;AAInB,IAAMC,gBAAgBC,2BAAgD,CAAC,EAAEC,YAAYC,SAAQ,GAAIC,iBAC/F,sBAAA,cAACC,QAAAA;EAAKC,WAAWC,GAAGL,UAAAA;EAAaM,KAAKJ;GACnCD,QAAAA,CAAAA;AAML,IAAMM,kBAAkBR,2BACtB,CAAC,EAAEC,YAAYC,UAAUO,SAAS,GAAGC,MAAAA,GAASP,iBAAAA;AAC5C,QAAMQ,UAAUL,GACd,+DACA,qEACA,kGACAL,UAAAA;AAGF,SAAOQ,UACL,sBAAA,cAACG,MAAAA;IAAKC,MAAK;IAASN,KAAKJ;IAAcE,WAAWM;IAAU,GAAGD;KAC5DR,QAAAA,IAGH,sBAAA,cAACY,UAAAA;IAAOT,WAAWM;IAASJ,KAAKJ;IAA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MAAK;IAA+BC,QAAO;IAASC,KAAI;KACzD,gBAAAZ,OAAA,cAACa,OAAAA;IAAKC,MAAK;IAA2BC,MAAM;MAC5C,gBAAAf,OAAA,cAACM,UAAUU,MAAI;IAACC,YAAW;KAAmBxB,EAAE,cAAA,CAAA,CAAA,CAAA,CAAA;AAK1D;AAEO,IAAMyB,iBAAiB,MAAA;AAC5B,SACE,gBAAAlB,OAAA,cAAAA,OAAA,UAAA,MACE,gBAAAA,OAAA,cAACR,kBAAAA,IAAAA,GACD,gBAAAQ,OAAA,cAACmB,QAAAA;IAAKC,MAAK;IAAYC,WAAU;MACjC,gBAAArB,OAAA,cAACsB,SAAAA;IAAQF,MAAK;;AAGpB;AAEA,IAAMG,aAAqC;EACzC,YAAY;EACZ,aAAa;EACb,aAAa;EACb,mBAAmB;AACrB;AAEA,IAAMnB,mBAAmB,MAAA;AACvB,QAAMoB,SAASC,WAAAA;AACf,QAAMC,UAAUF,OAAOG,OAAOC,SAASC,UAAUC,MAAMC;AACvD,MAAI,CAACL,SAAS;AACZ,WAAO;EACT;AACA,QAAMM,OAAO,IAAIC,IAAIP,OAAAA,EAASQ,KAAKC,MAAM,GAAA,EAAK,CAAA;AAC9C,QAAMC,UAAUb,WAAWS,IAAAA;AAC3B,MAAI,CAACI,SAAS;AACZ,WAAO;EACT;AAEA,SACE,gBAAApC,OAAA,cAACM,UAAU+B,MAAI,MACb,gBAAArC,OAAA,cAACM,UAAUU,MAAI;IAACC,YAAW;KACzB,gBAAAjB,OAAA,cAACmB,QAAAA;IAAKmB,OAAOF;KAAUA,QAAQ,CAAA,CAAE,CAAA,CAAA;AAIzC;",
|
|
6
|
-
"names": ["Slot", "React", "forwardRef", "mx", "StatusBarText", "forwardRef", "classNames", "children", "forwardedRef", "span", "className", "mx", "ref", "StatusBarButton", "asChild", "props", "classes", "Slot", "role", "button", "StatusBarItem", "forwardRef", "classNames", "children", "props", "forwardedRef", "div", "role", "className", "mx", "ref", "StartContent", "EndContent", "StatusBar", "Text", "StatusBarText", "Item", "Button", "StatusBarButton", "trim", "meta", "id", "name", "description", "trim", "icon", "formatDistance", "React", "useConfig", "Icon", "Link", "Message", "Popover", "Trans", "useTranslation", "repo", "VERSION_REGEX", "VersionNumber", "t", "useTranslation", "meta", "id", "config", "useConfig", "version", "timestamp", "commitHash", "values", "runtime", "app", "build", "_", "v", "match", "isLabs", "env", "DX_LABS", "releaseUrl", "DX_ENVIRONMENT", "previewUrl", "React", "Popover", "Root", "Trigger", "asChild", "StatusBar", "Button", "classNames", "Portal", "Content", "side", "role", "Message", "valence", "Title", "br", "Link", "href", "target", "rel", "variant", "Icon", "icon", "div", "className", "p", "released", "formatDistance", "Date", "addSuffix", "Trans", "i18nKey", "components", "dxos", "Arrow", "React", "useState", "Surface", "useConfig", "Icon", "Popover", "useTranslation", "StatusBarActions", "t", "useTranslation", "meta", "id", "open", "setOpen", "useState", "React", "Popover", "Root", "onOpenChange", "EnvironmentLabel", "VersionNumber", "StatusBar", "Button", "asChild", "a", "href", "target", "rel", "Icon", "icon", "size", "Text", "classNames", "StatusBarPanel", "span", "role", "className", "Surface", "ENV_LABELS", "config", "useConfig", "edgeUrl", "values", "runtime", "services", "edge", "url", "part", "URL", "host", "split", "edgeEnv", "Item", "title"]
|
|
7
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
StatusBarActions,
|
|
3
|
-
StatusBarPanel,
|
|
4
|
-
VersionNumber,
|
|
5
|
-
meta
|
|
6
|
-
} from "./chunk-G3E35NNM.mjs";
|
|
7
|
-
|
|
8
|
-
// src/capabilities/react-surface/react-surface.tsx
|
|
9
|
-
import * as Effect from "effect/Effect";
|
|
10
|
-
import React from "react";
|
|
11
|
-
import { Capability, Common } from "@dxos/app-framework";
|
|
12
|
-
import { Surface } from "@dxos/app-framework/react";
|
|
13
|
-
var react_surface_default = Capability.makeModule(() => Effect.succeed(Capability.contributes(Common.Capability.ReactSurface, [
|
|
14
|
-
Common.createSurface({
|
|
15
|
-
id: `${meta.id}/status-bar`,
|
|
16
|
-
role: "status-bar",
|
|
17
|
-
component: () => /* @__PURE__ */ React.createElement(StatusBarPanel, null)
|
|
18
|
-
}),
|
|
19
|
-
Common.createSurface({
|
|
20
|
-
id: `${meta.id}/status-bar--r0-footer`,
|
|
21
|
-
role: "status-bar--r0-footer",
|
|
22
|
-
component: () => /* @__PURE__ */ React.createElement(Surface, {
|
|
23
|
-
role: "status"
|
|
24
|
-
})
|
|
25
|
-
}),
|
|
26
|
-
Common.createSurface({
|
|
27
|
-
id: `${meta.id}/status-bar--r1-footer`,
|
|
28
|
-
role: "status-bar--r1-footer",
|
|
29
|
-
component: () => /* @__PURE__ */ React.createElement(StatusBarActions, null)
|
|
30
|
-
}),
|
|
31
|
-
Common.createSurface({
|
|
32
|
-
id: `${meta.id}/header-end`,
|
|
33
|
-
role: "header-end",
|
|
34
|
-
component: () => /* @__PURE__ */ React.createElement(VersionNumber, null)
|
|
35
|
-
})
|
|
36
|
-
])));
|
|
37
|
-
export {
|
|
38
|
-
react_surface_default as default
|
|
39
|
-
};
|
|
40
|
-
//# sourceMappingURL=react-surface-MYYYPTEW.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/react-surface/react-surface.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport React from 'react';\n\nimport { Capability, Common } from '@dxos/app-framework';\nimport { Surface } from '@dxos/app-framework/react';\n\nimport { StatusBarActions, StatusBarPanel, VersionNumber } from '../../components';\nimport { meta } from '../../meta';\n\nexport default Capability.makeModule(() =>\n Effect.succeed(\n Capability.contributes(Common.Capability.ReactSurface, [\n Common.createSurface({\n id: `${meta.id}/status-bar`,\n role: 'status-bar',\n component: () => <StatusBarPanel />,\n }),\n Common.createSurface({\n id: `${meta.id}/status-bar--r0-footer`,\n role: 'status-bar--r0-footer',\n component: () => <Surface role='status' />,\n }),\n Common.createSurface({\n id: `${meta.id}/status-bar--r1-footer`,\n role: 'status-bar--r1-footer',\n component: () => <StatusBarActions />,\n }),\n Common.createSurface({\n id: `${meta.id}/header-end`,\n role: 'header-end',\n component: () => <VersionNumber />,\n }),\n ]),\n ),\n);\n"],
|
|
5
|
-
"mappings": ";;;;;;;;AAIA,YAAYA,YAAY;AACxB,OAAOC,WAAW;AAElB,SAASC,YAAYC,cAAc;AACnC,SAASC,eAAe;AAKxB,IAAA,wBAAeC,WAAWC,WAAW,MAC5BC,eACLF,WAAWG,YAAYC,OAAOJ,WAAWK,cAAc;EACrDD,OAAOE,cAAc;IACnBC,IAAI,GAAGC,KAAKD,EAAE;IACdE,MAAM;IACNC,WAAW,MAAM,sBAAA,cAACC,gBAAAA,IAAAA;EACpB,CAAA;EACAP,OAAOE,cAAc;IACnBC,IAAI,GAAGC,KAAKD,EAAE;IACdE,MAAM;IACNC,WAAW,MAAM,sBAAA,cAACE,SAAAA;MAAQH,MAAK;;EACjC,CAAA;EACAL,OAAOE,cAAc;IACnBC,IAAI,GAAGC,KAAKD,EAAE;IACdE,MAAM;IACNC,WAAW,MAAM,sBAAA,cAACG,kBAAAA,IAAAA;EACpB,CAAA;EACAT,OAAOE,cAAc;IACnBC,IAAI,GAAGC,KAAKD,EAAE;IACdE,MAAM;IACNC,WAAW,MAAM,sBAAA,cAACI,eAAAA,IAAAA;EACpB,CAAA;CACD,CAAA,CAAA;",
|
|
6
|
-
"names": ["Effect", "React", "Capability", "Common", "Surface", "Capability", "makeModule", "succeed", "contributes", "Common", "ReactSurface", "createSurface", "id", "meta", "role", "component", "StatusBarPanel", "Surface", "StatusBarActions", "VersionNumber"]
|
|
7
|
-
}
|
|
@@ -1,197 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
-
|
|
3
|
-
// src/components/StatusBar.tsx
|
|
4
|
-
import { Slot } from "@radix-ui/react-slot";
|
|
5
|
-
import React, { forwardRef } from "react";
|
|
6
|
-
import { mx } from "@dxos/ui-theme";
|
|
7
|
-
var StatusBarText = /* @__PURE__ */ forwardRef(({ classNames, children }, forwardedRef) => /* @__PURE__ */ React.createElement("span", {
|
|
8
|
-
className: mx(classNames),
|
|
9
|
-
ref: forwardedRef
|
|
10
|
-
}, children));
|
|
11
|
-
var StatusBarButton = /* @__PURE__ */ forwardRef(({ classNames, children, asChild, ...props }, forwardedRef) => {
|
|
12
|
-
const classes = mx("flex items-center justify-center gap-2 p-1 pli-2 rounded-sm", "select-none cursor-pointer dx-focus-ring text-description text-xs", "hover:bg-neutral-75 active:bg-neutral-150 dark:hover:bg-neutral-750 dark:active:bg-neutral-700", classNames);
|
|
13
|
-
return asChild ? /* @__PURE__ */ React.createElement(Slot, {
|
|
14
|
-
role: "button",
|
|
15
|
-
ref: forwardedRef,
|
|
16
|
-
className: classes,
|
|
17
|
-
...props
|
|
18
|
-
}, children) : /* @__PURE__ */ React.createElement("button", {
|
|
19
|
-
className: classes,
|
|
20
|
-
ref: forwardedRef,
|
|
21
|
-
...props
|
|
22
|
-
}, children);
|
|
23
|
-
});
|
|
24
|
-
var StatusBarItem = /* @__PURE__ */ forwardRef(({ classNames, children, ...props }, forwardedRef) => /* @__PURE__ */ React.createElement("div", {
|
|
25
|
-
role: "menuitem",
|
|
26
|
-
className: mx("flex items-center justify-center gap-2 p-1 pli-2 rounded-sm select-none", classNames),
|
|
27
|
-
ref: forwardedRef,
|
|
28
|
-
...props
|
|
29
|
-
}, children));
|
|
30
|
-
var StartContent = /* @__PURE__ */ forwardRef(({ classNames, children }, forwardedRef) => /* @__PURE__ */ React.createElement("div", {
|
|
31
|
-
role: "none",
|
|
32
|
-
className: mx("flex-grow flex items-center space-x-2", classNames),
|
|
33
|
-
ref: forwardedRef
|
|
34
|
-
}, children));
|
|
35
|
-
var EndContent = /* @__PURE__ */ forwardRef(({ classNames, children }, forwardedRef) => /* @__PURE__ */ React.createElement("div", {
|
|
36
|
-
role: "none",
|
|
37
|
-
className: mx("flex-grow flex items-center justify-end", classNames),
|
|
38
|
-
ref: forwardedRef
|
|
39
|
-
}, children));
|
|
40
|
-
var StatusBar = {
|
|
41
|
-
Text: StatusBarText,
|
|
42
|
-
Item: StatusBarItem,
|
|
43
|
-
Button: StatusBarButton,
|
|
44
|
-
StartContent,
|
|
45
|
-
EndContent
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
// src/meta.ts
|
|
49
|
-
import { trim } from "@dxos/util";
|
|
50
|
-
var meta = {
|
|
51
|
-
id: "dxos.org/plugin/status-bar",
|
|
52
|
-
name: "Status Bar",
|
|
53
|
-
description: trim`
|
|
54
|
-
Persistent bottom bar displaying workspace status information and quick actions.
|
|
55
|
-
Access connection state, notifications, and common commands without leaving your current context.
|
|
56
|
-
`,
|
|
57
|
-
icon: "ph--info--regular"
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
// src/components/VersionNumber.tsx
|
|
61
|
-
import { formatDistance } from "date-fns/formatDistance";
|
|
62
|
-
import React2 from "react";
|
|
63
|
-
import { useConfig } from "@dxos/react-client";
|
|
64
|
-
import { Icon, Link, Message, Popover, Trans, useTranslation } from "@dxos/react-ui";
|
|
65
|
-
var repo = "https://github.com/dxos/dxos";
|
|
66
|
-
var VERSION_REGEX = /([\d.]+)/;
|
|
67
|
-
var VersionNumber = () => {
|
|
68
|
-
const { t } = useTranslation(meta.id);
|
|
69
|
-
const config = useConfig();
|
|
70
|
-
const { version, timestamp, commitHash } = config.values.runtime?.app?.build ?? {};
|
|
71
|
-
const [_, v] = version?.match(VERSION_REGEX) ?? [];
|
|
72
|
-
const isLabs = config.values.runtime?.app?.env?.DX_LABS;
|
|
73
|
-
const releaseUrl = config.values.runtime?.app?.env?.DX_ENVIRONMENT === "production" ? `${repo}/releases/tag/v${version}` : `${repo}/commit/${commitHash}`;
|
|
74
|
-
const previewUrl = "https://docs.dxos.org/composer#technology-preview";
|
|
75
|
-
return /* @__PURE__ */ React2.createElement(Popover.Root, null, /* @__PURE__ */ React2.createElement(Popover.Trigger, {
|
|
76
|
-
asChild: true
|
|
77
|
-
}, /* @__PURE__ */ React2.createElement(StatusBar.Button, {
|
|
78
|
-
classNames: "text-xs"
|
|
79
|
-
}, isLabs ? version : v)), /* @__PURE__ */ React2.createElement(Popover.Portal, null, /* @__PURE__ */ React2.createElement(Popover.Content, {
|
|
80
|
-
side: "top",
|
|
81
|
-
role: "message",
|
|
82
|
-
classNames: "z-[12] bg-warning-500 max-is-[min(calc(100vw-16px),40ch)]"
|
|
83
|
-
}, /* @__PURE__ */ React2.createElement(Message.Root, {
|
|
84
|
-
valence: "warning",
|
|
85
|
-
classNames: "rounded-be-none p-5"
|
|
86
|
-
}, /* @__PURE__ */ React2.createElement(Message.Title, null, t("warning title")), /* @__PURE__ */ React2.createElement(Message.Content, null, t("technology preview message"), /* @__PURE__ */ React2.createElement("br", null), /* @__PURE__ */ React2.createElement(Link, {
|
|
87
|
-
href: previewUrl,
|
|
88
|
-
target: "_blank",
|
|
89
|
-
rel: "noreferrer",
|
|
90
|
-
variant: "neutral"
|
|
91
|
-
}, t("learn more label"), /* @__PURE__ */ React2.createElement(Icon, {
|
|
92
|
-
icon: "ph--arrow-square-out--bold",
|
|
93
|
-
classNames: "inline mis-1"
|
|
94
|
-
})))), /* @__PURE__ */ React2.createElement("div", {
|
|
95
|
-
role: "none",
|
|
96
|
-
className: "plb-4 pli-5 space-b-2 text-baseText"
|
|
97
|
-
}, timestamp && /* @__PURE__ */ React2.createElement("p", null, t("released message", {
|
|
98
|
-
released: formatDistance(new Date(timestamp), /* @__PURE__ */ new Date(), {
|
|
99
|
-
addSuffix: true
|
|
100
|
-
})
|
|
101
|
-
}), /* @__PURE__ */ React2.createElement("br", null), /* @__PURE__ */ React2.createElement(Link, {
|
|
102
|
-
href: releaseUrl,
|
|
103
|
-
target: "_blank",
|
|
104
|
-
rel: "noreferrer",
|
|
105
|
-
variant: "neutral"
|
|
106
|
-
}, t("see release label"), /* @__PURE__ */ React2.createElement(Icon, {
|
|
107
|
-
icon: "ph--arrow-square-out--bold",
|
|
108
|
-
classNames: "inline mis-1"
|
|
109
|
-
}))), /* @__PURE__ */ React2.createElement("p", null, /* @__PURE__ */ React2.createElement(Trans, {
|
|
110
|
-
t,
|
|
111
|
-
i18nKey: "powered by dxos message",
|
|
112
|
-
components: {
|
|
113
|
-
dxos: /* @__PURE__ */ React2.createElement(Link, {
|
|
114
|
-
href: "https://dxos.org",
|
|
115
|
-
target: "_blank",
|
|
116
|
-
rel: "noreferrer",
|
|
117
|
-
variant: "neutral"
|
|
118
|
-
})
|
|
119
|
-
}
|
|
120
|
-
}))), /* @__PURE__ */ React2.createElement(Popover.Arrow, null))));
|
|
121
|
-
};
|
|
122
|
-
|
|
123
|
-
// src/components/StatusBarPanel.tsx
|
|
124
|
-
import React3, { useState } from "react";
|
|
125
|
-
import { Surface } from "@dxos/app-framework/react";
|
|
126
|
-
import { useConfig as useConfig2 } from "@dxos/react-client";
|
|
127
|
-
import { Icon as Icon2, Popover as Popover2, useTranslation as useTranslation2 } from "@dxos/react-ui";
|
|
128
|
-
var StatusBarActions = () => {
|
|
129
|
-
const { t } = useTranslation2(meta.id);
|
|
130
|
-
const [open, setOpen] = useState(false);
|
|
131
|
-
return /* @__PURE__ */ React3.createElement(Popover2.Root, {
|
|
132
|
-
open,
|
|
133
|
-
onOpenChange: setOpen
|
|
134
|
-
}, /* @__PURE__ */ React3.createElement(EnvironmentLabel, null), /* @__PURE__ */ React3.createElement(VersionNumber, null), /* @__PURE__ */ React3.createElement(StatusBar.Button, {
|
|
135
|
-
asChild: true
|
|
136
|
-
}, /* @__PURE__ */ React3.createElement("a", {
|
|
137
|
-
href: "https://dxos.org/discord",
|
|
138
|
-
target: "_blank",
|
|
139
|
-
rel: "noopener noreferrer"
|
|
140
|
-
}, /* @__PURE__ */ React3.createElement(Icon2, {
|
|
141
|
-
icon: "ph--discord-logo--regular",
|
|
142
|
-
size: 4
|
|
143
|
-
}), /* @__PURE__ */ React3.createElement(StatusBar.Text, {
|
|
144
|
-
classNames: "hidden sm:block"
|
|
145
|
-
}, t("discord label")))), /* @__PURE__ */ React3.createElement(StatusBar.Button, {
|
|
146
|
-
asChild: true
|
|
147
|
-
}, /* @__PURE__ */ React3.createElement("a", {
|
|
148
|
-
href: "https://github.com/dxos/dxos",
|
|
149
|
-
target: "_blank",
|
|
150
|
-
rel: "noopener noreferrer"
|
|
151
|
-
}, /* @__PURE__ */ React3.createElement(Icon2, {
|
|
152
|
-
icon: "ph--github-logo--regular",
|
|
153
|
-
size: 4
|
|
154
|
-
}), /* @__PURE__ */ React3.createElement(StatusBar.Text, {
|
|
155
|
-
classNames: "hidden sm:block"
|
|
156
|
-
}, t("github label")))));
|
|
157
|
-
};
|
|
158
|
-
var StatusBarPanel = () => {
|
|
159
|
-
return /* @__PURE__ */ React3.createElement(React3.Fragment, null, /* @__PURE__ */ React3.createElement(StatusBarActions, null), /* @__PURE__ */ React3.createElement("span", {
|
|
160
|
-
role: "separator",
|
|
161
|
-
className: "grow"
|
|
162
|
-
}), /* @__PURE__ */ React3.createElement(Surface, {
|
|
163
|
-
role: "status"
|
|
164
|
-
}));
|
|
165
|
-
};
|
|
166
|
-
var ENV_LABELS = {
|
|
167
|
-
"edge-dev": "Dev",
|
|
168
|
-
"edge-main": "Main",
|
|
169
|
-
"edge-labs": "Labs",
|
|
170
|
-
"edge-production": "Production"
|
|
171
|
-
};
|
|
172
|
-
var EnvironmentLabel = () => {
|
|
173
|
-
const config = useConfig2();
|
|
174
|
-
const edgeUrl = config.values.runtime?.services?.edge?.url;
|
|
175
|
-
if (!edgeUrl) {
|
|
176
|
-
return null;
|
|
177
|
-
}
|
|
178
|
-
const part = new URL(edgeUrl).host.split(".")[0];
|
|
179
|
-
const edgeEnv = ENV_LABELS[part];
|
|
180
|
-
if (!edgeEnv) {
|
|
181
|
-
return null;
|
|
182
|
-
}
|
|
183
|
-
return /* @__PURE__ */ React3.createElement(StatusBar.Item, null, /* @__PURE__ */ React3.createElement(StatusBar.Text, {
|
|
184
|
-
classNames: "text-xs text-subdued border border-separator rounded-full pli-1"
|
|
185
|
-
}, /* @__PURE__ */ React3.createElement("span", {
|
|
186
|
-
title: edgeEnv
|
|
187
|
-
}, edgeEnv[0])));
|
|
188
|
-
};
|
|
189
|
-
|
|
190
|
-
export {
|
|
191
|
-
StatusBar,
|
|
192
|
-
meta,
|
|
193
|
-
VersionNumber,
|
|
194
|
-
StatusBarActions,
|
|
195
|
-
StatusBarPanel
|
|
196
|
-
};
|
|
197
|
-
//# sourceMappingURL=chunk-RE6CUOP4.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/StatusBar.tsx", "../../../src/meta.ts", "../../../src/components/VersionNumber.tsx", "../../../src/components/StatusBarPanel.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { Slot } from '@radix-ui/react-slot';\nimport React, { type ComponentPropsWithRef, type PropsWithChildren, type ReactNode, forwardRef } from 'react';\n\nimport { type ThemedClassName } from '@dxos/react-ui';\nimport { mx } from '@dxos/ui-theme';\n\ntype StatusBarTextProps = ThemedClassName<{ children: ReactNode }>;\n\nconst StatusBarText = forwardRef<HTMLSpanElement, StatusBarTextProps>(({ classNames, children }, forwardedRef) => (\n <span className={mx(classNames)} ref={forwardedRef}>\n {children}\n </span>\n));\n\ntype StatusBarButtonProps = ThemedClassName<ComponentPropsWithRef<'button'> & { asChild?: boolean }>;\n\nconst StatusBarButton = forwardRef<HTMLButtonElement, StatusBarButtonProps>(\n ({ classNames, children, asChild, ...props }, forwardedRef) => {\n const classes = mx(\n 'flex items-center justify-center gap-2 p-1 pli-2 rounded-sm',\n 'select-none cursor-pointer dx-focus-ring text-description text-xs',\n 'hover:bg-neutral-75 active:bg-neutral-150 dark:hover:bg-neutral-750 dark:active:bg-neutral-700',\n classNames,\n );\n\n return asChild ? (\n <Slot role='button' ref={forwardedRef} className={classes} {...props}>\n {children}\n </Slot>\n ) : (\n <button className={classes} ref={forwardedRef} {...props}>\n {children}\n </button>\n );\n },\n);\n\nexport default StatusBarButton;\n\ntype StatusBarItemProps = ThemedClassName<ComponentPropsWithRef<'div'>>;\n\nconst StatusBarItem = forwardRef<HTMLDivElement, StatusBarItemProps>(\n ({ classNames, children, ...props }, forwardedRef) => (\n <div\n role='menuitem'\n className={mx('flex items-center justify-center gap-2 p-1 pli-2 rounded-sm select-none', classNames)}\n ref={forwardedRef}\n {...props}\n >\n {children}\n </div>\n ),\n);\n\ntype StartContentProps = ThemedClassName<PropsWithChildren<{}>>;\n\nconst StartContent = forwardRef<HTMLDivElement, StartContentProps>(({ classNames, children }, forwardedRef) => (\n <div role='none' className={mx('flex-grow flex items-center space-x-2', classNames)} ref={forwardedRef}>\n {children}\n </div>\n));\n\ntype EndContentProps = ThemedClassName<PropsWithChildren<{}>>;\n\nconst EndContent = forwardRef<HTMLDivElement, EndContentProps>(({ classNames, children }, forwardedRef) => (\n <div role='none' className={mx('flex-grow flex items-center justify-end', classNames)} ref={forwardedRef}>\n {children}\n </div>\n));\n\nexport const StatusBar = {\n Text: StatusBarText,\n Item: StatusBarItem,\n Button: StatusBarButton,\n StartContent,\n EndContent,\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { type Plugin } from '@dxos/app-framework';\nimport { trim } from '@dxos/util';\n\nexport const meta: Plugin.Meta = {\n id: 'dxos.org/plugin/status-bar',\n name: 'Status Bar',\n description: trim`\n Persistent bottom bar displaying workspace status information and quick actions.\n Access connection state, notifications, and common commands without leaving your current context.\n `,\n icon: 'ph--info--regular',\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { formatDistance } from 'date-fns/formatDistance';\nimport React from 'react';\n\nimport { useConfig } from '@dxos/react-client';\nimport { Icon, Link, Message, Popover, Trans, useTranslation } from '@dxos/react-ui';\n\nimport { meta } from '../meta';\n\nimport { StatusBar } from './StatusBar';\n\nconst repo = 'https://github.com/dxos/dxos';\n\nconst VERSION_REGEX = /([\\d.]+)/;\n\nexport const VersionNumber = () => {\n const { t } = useTranslation(meta.id);\n const config = useConfig();\n const { version, timestamp, commitHash } = config.values.runtime?.app?.build ?? {};\n const [_, v] = version?.match(VERSION_REGEX) ?? [];\n const isLabs = config.values.runtime?.app?.env?.DX_LABS;\n\n const releaseUrl =\n config.values.runtime?.app?.env?.DX_ENVIRONMENT === 'production'\n ? `${repo}/releases/tag/v${version}`\n : `${repo}/commit/${commitHash}`;\n\n const previewUrl = 'https://docs.dxos.org/composer#technology-preview';\n\n return (\n <Popover.Root>\n <Popover.Trigger asChild>\n <StatusBar.Button classNames='text-xs'>{isLabs ? version : v}</StatusBar.Button>\n </Popover.Trigger>\n <Popover.Portal>\n <Popover.Content\n side='top'\n role='message'\n classNames='z-[12] bg-warning-500 max-is-[min(calc(100vw-16px),40ch)]'\n >\n <Message.Root valence='warning' classNames='rounded-be-none p-5'>\n <Message.Title>{t('warning title')}</Message.Title>\n <Message.Content>\n {t('technology preview message')}\n <br />\n <Link href={previewUrl} target='_blank' rel='noreferrer' variant='neutral'>\n {t('learn more label')}\n <Icon icon='ph--arrow-square-out--bold' classNames='inline mis-1' />\n </Link>\n </Message.Content>\n </Message.Root>\n <div role='none' className='plb-4 pli-5 space-b-2 text-baseText'>\n {timestamp && (\n <p>\n {t('released message', {\n released: formatDistance(new Date(timestamp), new Date(), { addSuffix: true }),\n })}\n <br />\n <Link href={releaseUrl} target='_blank' rel='noreferrer' variant='neutral'>\n {t('see release label')}\n <Icon icon='ph--arrow-square-out--bold' classNames='inline mis-1' />\n </Link>\n </p>\n )}\n <p>\n <Trans\n {...{\n t,\n i18nKey: 'powered by dxos message',\n components: {\n dxos: <Link href='https://dxos.org' target='_blank' rel='noreferrer' variant='neutral' />,\n },\n }}\n />\n </p>\n </div>\n <Popover.Arrow />\n </Popover.Content>\n </Popover.Portal>\n </Popover.Root>\n );\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { useState } from 'react';\n\nimport { Surface } from '@dxos/app-framework/react';\nimport { useConfig } from '@dxos/react-client';\nimport { Icon, Popover, useTranslation } from '@dxos/react-ui';\n\nimport { meta } from '../meta';\n\nimport { StatusBar } from './StatusBar';\nimport { VersionNumber } from './VersionNumber';\n\nexport const StatusBarActions = () => {\n const { t } = useTranslation(meta.id);\n const [open, setOpen] = useState(false);\n\n return (\n <Popover.Root open={open} onOpenChange={setOpen}>\n <EnvironmentLabel />\n <VersionNumber />\n <StatusBar.Button asChild>\n <a href='https://dxos.org/discord' target='_blank' rel='noopener noreferrer'>\n <Icon icon='ph--discord-logo--regular' size={4} />\n <StatusBar.Text classNames='hidden sm:block'>{t('discord label')}</StatusBar.Text>\n </a>\n </StatusBar.Button>\n <StatusBar.Button asChild>\n <a href='https://github.com/dxos/dxos' target='_blank' rel='noopener noreferrer'>\n <Icon icon='ph--github-logo--regular' size={4} />\n <StatusBar.Text classNames='hidden sm:block'>{t('github label')}</StatusBar.Text>\n </a>\n </StatusBar.Button>\n </Popover.Root>\n );\n};\n\nexport const StatusBarPanel = () => {\n return (\n <>\n <StatusBarActions />\n <span role='separator' className='grow' />\n <Surface role='status' />\n </>\n );\n};\n\nconst ENV_LABELS: Record<string, string> = {\n 'edge-dev': 'Dev',\n 'edge-main': 'Main',\n 'edge-labs': 'Labs',\n 'edge-production': 'Production',\n};\n\nconst EnvironmentLabel = () => {\n const config = useConfig();\n const edgeUrl = config.values.runtime?.services?.edge?.url;\n if (!edgeUrl) {\n return null;\n }\n const part = new URL(edgeUrl).host.split('.')[0];\n const edgeEnv = ENV_LABELS[part];\n if (!edgeEnv) {\n return null;\n }\n\n return (\n <StatusBar.Item>\n <StatusBar.Text classNames='text-xs text-subdued border border-separator rounded-full pli-1'>\n <span title={edgeEnv}>{edgeEnv[0]}</span>\n </StatusBar.Text>\n </StatusBar.Item>\n );\n};\n"],
|
|
5
|
-
"mappings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AAIC,IAAIP,OAAAA,EAASQ,KAAKC,MAAM,GAAA,EAAK,CAAA;AAC9C,QAAMC,UAAUb,WAAWS,IAAAA;AAC3B,MAAI,CAACI,SAAS;AACZ,WAAO;EACT;AAEA,SACE,gBAAApC,OAAA,cAACM,UAAU+B,MAAI,MACb,gBAAArC,OAAA,cAACM,UAAUU,MAAI;IAACC,YAAW;KACzB,gBAAAjB,OAAA,cAACmB,QAAAA;IAAKmB,OAAOF;KAAUA,QAAQ,CAAA,CAAE,CAAA,CAAA;AAIzC;",
|
|
6
|
-
"names": ["Slot", "React", "forwardRef", "mx", "StatusBarText", "forwardRef", "classNames", "children", "forwardedRef", "span", "className", "mx", "ref", "StatusBarButton", "asChild", "props", "classes", "Slot", "role", "button", "StatusBarItem", "forwardRef", "classNames", "children", "props", "forwardedRef", "div", "role", "className", "mx", "ref", "StartContent", "EndContent", "StatusBar", "Text", "StatusBarText", "Item", "Button", "StatusBarButton", "trim", "meta", "id", "name", "description", "trim", "icon", "formatDistance", "React", "useConfig", "Icon", "Link", "Message", "Popover", "Trans", "useTranslation", "repo", "VERSION_REGEX", "VersionNumber", "t", "useTranslation", "meta", "id", "config", "useConfig", "version", "timestamp", "commitHash", "values", "runtime", "app", "build", "_", "v", "match", "isLabs", "env", "DX_LABS", "releaseUrl", "DX_ENVIRONMENT", "previewUrl", "React", "Popover", "Root", "Trigger", "asChild", "StatusBar", "Button", "classNames", "Portal", "Content", "side", "role", "Message", "valence", "Title", "br", "Link", "href", "target", "rel", "variant", "Icon", "icon", "div", "className", "p", "released", "formatDistance", "Date", "addSuffix", "Trans", "i18nKey", "components", "dxos", "Arrow", "React", "useState", "Surface", "useConfig", "Icon", "Popover", "useTranslation", "StatusBarActions", "t", "useTranslation", "meta", "id", "open", "setOpen", "useState", "React", "Popover", "Root", "onOpenChange", "EnvironmentLabel", "VersionNumber", "StatusBar", "Button", "asChild", "a", "href", "target", "rel", "Icon", "icon", "size", "Text", "classNames", "StatusBarPanel", "span", "role", "className", "Surface", "ENV_LABELS", "config", "useConfig", "edgeUrl", "values", "runtime", "services", "edge", "url", "part", "URL", "host", "split", "edgeEnv", "Item", "title"]
|
|
7
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
StatusBarActions,
|
|
4
|
-
StatusBarPanel,
|
|
5
|
-
VersionNumber,
|
|
6
|
-
meta
|
|
7
|
-
} from "./chunk-RE6CUOP4.mjs";
|
|
8
|
-
|
|
9
|
-
// src/capabilities/react-surface/react-surface.tsx
|
|
10
|
-
import * as Effect from "effect/Effect";
|
|
11
|
-
import React from "react";
|
|
12
|
-
import { Capability, Common } from "@dxos/app-framework";
|
|
13
|
-
import { Surface } from "@dxos/app-framework/react";
|
|
14
|
-
var react_surface_default = Capability.makeModule(() => Effect.succeed(Capability.contributes(Common.Capability.ReactSurface, [
|
|
15
|
-
Common.createSurface({
|
|
16
|
-
id: `${meta.id}/status-bar`,
|
|
17
|
-
role: "status-bar",
|
|
18
|
-
component: () => /* @__PURE__ */ React.createElement(StatusBarPanel, null)
|
|
19
|
-
}),
|
|
20
|
-
Common.createSurface({
|
|
21
|
-
id: `${meta.id}/status-bar--r0-footer`,
|
|
22
|
-
role: "status-bar--r0-footer",
|
|
23
|
-
component: () => /* @__PURE__ */ React.createElement(Surface, {
|
|
24
|
-
role: "status"
|
|
25
|
-
})
|
|
26
|
-
}),
|
|
27
|
-
Common.createSurface({
|
|
28
|
-
id: `${meta.id}/status-bar--r1-footer`,
|
|
29
|
-
role: "status-bar--r1-footer",
|
|
30
|
-
component: () => /* @__PURE__ */ React.createElement(StatusBarActions, null)
|
|
31
|
-
}),
|
|
32
|
-
Common.createSurface({
|
|
33
|
-
id: `${meta.id}/header-end`,
|
|
34
|
-
role: "header-end",
|
|
35
|
-
component: () => /* @__PURE__ */ React.createElement(VersionNumber, null)
|
|
36
|
-
})
|
|
37
|
-
])));
|
|
38
|
-
export {
|
|
39
|
-
react_surface_default as default
|
|
40
|
-
};
|
|
41
|
-
//# sourceMappingURL=react-surface-RNK64YYP.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/react-surface/react-surface.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport React from 'react';\n\nimport { Capability, Common } from '@dxos/app-framework';\nimport { Surface } from '@dxos/app-framework/react';\n\nimport { StatusBarActions, StatusBarPanel, VersionNumber } from '../../components';\nimport { meta } from '../../meta';\n\nexport default Capability.makeModule(() =>\n Effect.succeed(\n Capability.contributes(Common.Capability.ReactSurface, [\n Common.createSurface({\n id: `${meta.id}/status-bar`,\n role: 'status-bar',\n component: () => <StatusBarPanel />,\n }),\n Common.createSurface({\n id: `${meta.id}/status-bar--r0-footer`,\n role: 'status-bar--r0-footer',\n component: () => <Surface role='status' />,\n }),\n Common.createSurface({\n id: `${meta.id}/status-bar--r1-footer`,\n role: 'status-bar--r1-footer',\n component: () => <StatusBarActions />,\n }),\n Common.createSurface({\n id: `${meta.id}/header-end`,\n role: 'header-end',\n component: () => <VersionNumber />,\n }),\n ]),\n ),\n);\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;AAIA,YAAYA,YAAY;AACxB,OAAOC,WAAW;AAElB,SAASC,YAAYC,cAAc;AACnC,SAASC,eAAe;AAKxB,IAAA,wBAAeC,WAAWC,WAAW,MAC5BC,eACLF,WAAWG,YAAYC,OAAOJ,WAAWK,cAAc;EACrDD,OAAOE,cAAc;IACnBC,IAAI,GAAGC,KAAKD,EAAE;IACdE,MAAM;IACNC,WAAW,MAAM,sBAAA,cAACC,gBAAAA,IAAAA;EACpB,CAAA;EACAP,OAAOE,cAAc;IACnBC,IAAI,GAAGC,KAAKD,EAAE;IACdE,MAAM;IACNC,WAAW,MAAM,sBAAA,cAACE,SAAAA;MAAQH,MAAK;;EACjC,CAAA;EACAL,OAAOE,cAAc;IACnBC,IAAI,GAAGC,KAAKD,EAAE;IACdE,MAAM;IACNC,WAAW,MAAM,sBAAA,cAACG,kBAAAA,IAAAA;EACpB,CAAA;EACAT,OAAOE,cAAc;IACnBC,IAAI,GAAGC,KAAKD,EAAE;IACdE,MAAM;IACNC,WAAW,MAAM,sBAAA,cAACI,eAAAA,IAAAA;EACpB,CAAA;CACD,CAAA,CAAA;",
|
|
6
|
-
"names": ["Effect", "React", "Capability", "Common", "Surface", "Capability", "makeModule", "succeed", "contributes", "Common", "ReactSurface", "createSurface", "id", "meta", "role", "component", "StatusBarPanel", "Surface", "StatusBarActions", "VersionNumber"]
|
|
7
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/capabilities/react-surface/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,eAAO,MAAM,YAAY,sJAAmE,CAAC"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import * as Effect from 'effect/Effect';
|
|
2
|
-
import { Capability, Common } from '@dxos/app-framework';
|
|
3
|
-
declare const _default: (props?: void | undefined) => Effect.Effect<Capability.Capability<Capability.InterfaceDef<Common.Capability.ReactSurface>>, never, never>;
|
|
4
|
-
export default _default;
|
|
5
|
-
//# sourceMappingURL=react-surface.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"react-surface.d.ts","sourceRoot":"","sources":["../../../../../src/capabilities/react-surface/react-surface.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAGxC,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;;AAMzD,wBAyBE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"StatusBar.d.ts","sourceRoot":"","sources":["../../../../src/components/StatusBar.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,EAAE,KAAK,qBAAqB,EAA0B,KAAK,SAAS,EAAc,MAAM,OAAO,CAAC;AAE9G,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAWtD,KAAK,oBAAoB,GAAG,eAAe,CAAC,qBAAqB,CAAC,QAAQ,CAAC,GAAG;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC,CAAC;AAErG,QAAA,MAAM,eAAe,6GAmBpB,CAAC;AAEF,eAAe,eAAe,CAAC;AAE/B,KAAK,kBAAkB,GAAG,eAAe,CAAC,qBAAqB,CAAC,KAAK,CAAC,CAAC,CAAC;AA+BxE,eAAO,MAAM,SAAS;;kBAhEgC,SAAS;;;;;;;;;;;;;;;;CAsE9D,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"StatusBar.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/StatusBar.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,eAAO,MAAM,YAAY,yBAmBxB,CAAC;AAEF,QAAA,MAAM,IAAI;;eAEgB,GAAG;;;CAGK,CAAC;AAEnC,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"StatusBarPanel.d.ts","sourceRoot":"","sources":["../../../../src/components/StatusBarPanel.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAWxC,eAAO,MAAM,gBAAgB,yBAsB5B,CAAC;AAEF,eAAO,MAAM,cAAc,yBAQ1B,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"VersionNumber.d.ts","sourceRoot":"","sources":["../../../../src/components/VersionNumber.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,MAAM,OAAO,CAAC;AAa1B,eAAO,MAAM,aAAa,yBAkEzB,CAAC"}
|