@dxos/plugin-status-bar 0.8.3-staging.0fa589b → 0.8.4-main.03d5cd7b56

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 (124) hide show
  1. package/dist/lib/neutral/StatusBarActions-GYLT4QVU.mjs +8 -0
  2. package/dist/lib/neutral/StatusBarActions-GYLT4QVU.mjs.map +7 -0
  3. package/dist/lib/neutral/StatusBarPanel-UTQAZ7VT.mjs +20 -0
  4. package/dist/lib/neutral/StatusBarPanel-UTQAZ7VT.mjs.map +7 -0
  5. package/dist/lib/neutral/StatusBarPlugin.mjs +17 -0
  6. package/dist/lib/neutral/StatusBarPlugin.mjs.map +7 -0
  7. package/dist/lib/neutral/VersionNumber-E7DDIVTB.mjs +7 -0
  8. package/dist/lib/neutral/VersionNumber-E7DDIVTB.mjs.map +7 -0
  9. package/dist/lib/neutral/capabilities/index.mjs +7 -0
  10. package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
  11. package/dist/lib/neutral/chunk-BHLVVHW4.mjs +19 -0
  12. package/dist/lib/neutral/chunk-BHLVVHW4.mjs.map +7 -0
  13. package/dist/lib/neutral/chunk-DV7SD4RL.mjs +71 -0
  14. package/dist/lib/neutral/chunk-DV7SD4RL.mjs.map +7 -0
  15. package/dist/lib/neutral/chunk-PQSD2QVZ.mjs +70 -0
  16. package/dist/lib/neutral/chunk-PQSD2QVZ.mjs.map +7 -0
  17. package/dist/lib/neutral/components/index.mjs +48 -0
  18. package/dist/lib/neutral/components/index.mjs.map +7 -0
  19. package/dist/lib/neutral/containers/index.mjs +11 -0
  20. package/dist/lib/neutral/containers/index.mjs.map +7 -0
  21. package/dist/lib/neutral/index.mjs +7 -0
  22. package/dist/lib/neutral/index.mjs.map +7 -0
  23. package/dist/lib/neutral/meta.json +1 -0
  24. package/dist/lib/neutral/meta.mjs +7 -0
  25. package/dist/lib/neutral/meta.mjs.map +7 -0
  26. package/dist/lib/neutral/plugin.mjs +11 -0
  27. package/dist/lib/neutral/plugin.mjs.map +7 -0
  28. package/dist/lib/neutral/react-surface-LRBTL7UM.mjs +27 -0
  29. package/dist/lib/neutral/react-surface-LRBTL7UM.mjs.map +7 -0
  30. package/dist/lib/neutral/translations.mjs +24 -0
  31. package/dist/lib/neutral/translations.mjs.map +7 -0
  32. package/dist/types/src/StatusBarPlugin.d.ts +3 -1
  33. package/dist/types/src/StatusBarPlugin.d.ts.map +1 -1
  34. package/dist/types/src/StatusBarPlugin.test.d.ts +2 -0
  35. package/dist/types/src/StatusBarPlugin.test.d.ts.map +1 -0
  36. package/dist/types/src/capabilities/index.d.ts +2 -1
  37. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  38. package/dist/types/src/capabilities/react-surface.d.ts +3 -2
  39. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
  40. package/dist/types/src/components/{StatusBar.d.ts → StatusBar/StatusBar.d.ts} +9 -7
  41. package/dist/types/src/components/StatusBar/StatusBar.d.ts.map +1 -0
  42. package/dist/types/src/components/StatusBar/StatusBar.stories.d.ts +15 -0
  43. package/dist/types/src/components/StatusBar/StatusBar.stories.d.ts.map +1 -0
  44. package/dist/types/src/components/StatusBar/index.d.ts +2 -0
  45. package/dist/types/src/components/StatusBar/index.d.ts.map +1 -0
  46. package/dist/types/src/components/index.d.ts +0 -2
  47. package/dist/types/src/components/index.d.ts.map +1 -1
  48. package/dist/types/src/containers/StatusBarActions/StatusBarActions.d.ts +4 -0
  49. package/dist/types/src/containers/StatusBarActions/StatusBarActions.d.ts.map +1 -0
  50. package/dist/types/src/containers/StatusBarActions/StatusBarActions.stories.d.ts +7 -0
  51. package/dist/types/src/containers/StatusBarActions/StatusBarActions.stories.d.ts.map +1 -0
  52. package/dist/types/src/containers/StatusBarActions/index.d.ts +2 -0
  53. package/dist/types/src/containers/StatusBarActions/index.d.ts.map +1 -0
  54. package/dist/types/src/containers/StatusBarPanel/StatusBarPanel.d.ts +4 -0
  55. package/dist/types/src/containers/StatusBarPanel/StatusBarPanel.d.ts.map +1 -0
  56. package/dist/types/src/containers/StatusBarPanel/index.d.ts +2 -0
  57. package/dist/types/src/containers/StatusBarPanel/index.d.ts.map +1 -0
  58. package/dist/types/src/containers/VersionNumber/VersionNumber.d.ts +4 -0
  59. package/dist/types/src/containers/VersionNumber/VersionNumber.d.ts.map +1 -0
  60. package/dist/types/src/containers/VersionNumber/index.d.ts +2 -0
  61. package/dist/types/src/containers/VersionNumber/index.d.ts.map +1 -0
  62. package/dist/types/src/containers/index.d.ts +5 -0
  63. package/dist/types/src/containers/index.d.ts.map +1 -0
  64. package/dist/types/src/index.d.ts +0 -2
  65. package/dist/types/src/index.d.ts.map +1 -1
  66. package/dist/types/src/meta.d.ts +2 -3
  67. package/dist/types/src/meta.d.ts.map +1 -1
  68. package/dist/types/src/plugin.d.ts +3 -0
  69. package/dist/types/src/plugin.d.ts.map +1 -0
  70. package/dist/types/src/translations.d.ts +16 -12
  71. package/dist/types/src/translations.d.ts.map +1 -1
  72. package/dist/types/tsconfig.tsbuildinfo +1 -1
  73. package/package.json +81 -34
  74. package/src/StatusBarPlugin.test.ts +23 -0
  75. package/src/StatusBarPlugin.ts +12 -17
  76. package/src/capabilities/index.ts +2 -2
  77. package/src/capabilities/react-surface.tsx +25 -26
  78. package/src/components/StatusBar/StatusBar.stories.tsx +45 -0
  79. package/src/components/{StatusBar.tsx → StatusBar/StatusBar.tsx} +45 -23
  80. package/src/components/StatusBar/index.ts +5 -0
  81. package/src/components/index.ts +0 -2
  82. package/src/containers/StatusBarActions/StatusBarActions.stories.tsx +62 -0
  83. package/src/containers/StatusBarActions/StatusBarActions.tsx +70 -0
  84. package/src/containers/StatusBarActions/index.ts +5 -0
  85. package/src/containers/StatusBarPanel/StatusBarPanel.tsx +21 -0
  86. package/src/containers/StatusBarPanel/index.ts +5 -0
  87. package/src/containers/VersionNumber/VersionNumber.tsx +97 -0
  88. package/src/containers/VersionNumber/index.ts +5 -0
  89. package/src/containers/index.ts +9 -0
  90. package/src/index.ts +1 -2
  91. package/src/meta.ts +9 -6
  92. package/src/plugin.ts +9 -0
  93. package/src/translations.ts +22 -42
  94. package/dist/lib/browser/chunk-NV543FLZ.mjs +0 -249
  95. package/dist/lib/browser/chunk-NV543FLZ.mjs.map +0 -7
  96. package/dist/lib/browser/index.mjs +0 -61
  97. package/dist/lib/browser/index.mjs.map +0 -7
  98. package/dist/lib/browser/meta.json +0 -1
  99. package/dist/lib/browser/react-surface-XYQMVXMA.mjs +0 -38
  100. package/dist/lib/browser/react-surface-XYQMVXMA.mjs.map +0 -7
  101. package/dist/lib/node/chunk-IQ5QWIXI.cjs +0 -280
  102. package/dist/lib/node/chunk-IQ5QWIXI.cjs.map +0 -7
  103. package/dist/lib/node/index.cjs +0 -86
  104. package/dist/lib/node/index.cjs.map +0 -7
  105. package/dist/lib/node/meta.json +0 -1
  106. package/dist/lib/node/react-surface-BD2WWDVZ.cjs +0 -61
  107. package/dist/lib/node/react-surface-BD2WWDVZ.cjs.map +0 -7
  108. package/dist/lib/node-esm/chunk-4ENEPGOY.mjs +0 -251
  109. package/dist/lib/node-esm/chunk-4ENEPGOY.mjs.map +0 -7
  110. package/dist/lib/node-esm/index.mjs +0 -62
  111. package/dist/lib/node-esm/index.mjs.map +0 -7
  112. package/dist/lib/node-esm/meta.json +0 -1
  113. package/dist/lib/node-esm/react-surface-HZE7P2TS.mjs +0 -39
  114. package/dist/lib/node-esm/react-surface-HZE7P2TS.mjs.map +0 -7
  115. package/dist/types/src/components/StatusBar.d.ts.map +0 -1
  116. package/dist/types/src/components/StatusBar.stories.d.ts +0 -9
  117. package/dist/types/src/components/StatusBar.stories.d.ts.map +0 -1
  118. package/dist/types/src/components/StatusBarPanel.d.ts +0 -4
  119. package/dist/types/src/components/StatusBarPanel.d.ts.map +0 -1
  120. package/dist/types/src/components/VersionNumber.d.ts +0 -3
  121. package/dist/types/src/components/VersionNumber.d.ts.map +0 -1
  122. package/src/components/StatusBar.stories.tsx +0 -48
  123. package/src/components/StatusBarPanel.tsx +0 -75
  124. package/src/components/VersionNumber.tsx +0 -84
@@ -0,0 +1,97 @@
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 { Icon, Link, Message, Popover, Trans, useTranslation } from '@dxos/react-ui';
10
+
11
+ import { StatusBar } from '#components';
12
+ import { meta } from '#meta';
13
+
14
+ export type VersionNumberProps = {};
15
+
16
+ const repo = 'https://github.com/dxos/dxos';
17
+
18
+ const VERSION_REGEX = /([\d.]+)/;
19
+
20
+ export const VersionNumber = (_props: VersionNumberProps) => {
21
+ const { t } = useTranslation(meta.id);
22
+ const config = useConfig();
23
+ const { version, timestamp, commitHash } = config.values.runtime?.app?.build ?? {};
24
+ const [_, v] = version?.match(VERSION_REGEX) ?? [];
25
+
26
+ const releaseUrl =
27
+ config.values.runtime?.app?.env?.DX_ENVIRONMENT === 'production'
28
+ ? `${repo}/releases/tag/v${version}`
29
+ : `${repo}/commit/${commitHash}`;
30
+
31
+ const previewUrl = 'https://docs.dxos.org/composer#technology-preview';
32
+
33
+ return (
34
+ <Popover.Root>
35
+ <Popover.Trigger asChild>
36
+ <StatusBar.Button classNames='h-full text-xs'>{v}</StatusBar.Button>
37
+ </Popover.Trigger>
38
+ <Popover.Portal>
39
+ <Popover.Content side='top' role='message' classNames='z-[12] max-w-[min(calc(100vw-16px),40ch)]'>
40
+ <Message.Root valence='info' classNames='p-2 rounded-b-none'>
41
+ <Message.Title>{t('warning.title')}</Message.Title>
42
+ <Message.Content>
43
+ {t('technology-preview.message')}
44
+ <br />
45
+ <Link href={previewUrl} target='_blank' rel='noreferrer' variant='neutral'>
46
+ {t('learn-more.label')}
47
+ <Icon icon='ph--arrow-square-out--bold' classNames='dx-icon-inline ms-1' />
48
+ </Link>
49
+ </Message.Content>
50
+ </Message.Root>
51
+ <div className='flex flex-col ps-10 pe-4 py-2 gap-1 space-b-2 text-base-surface-text'>
52
+ {timestamp && (
53
+ <div>
54
+ <p>
55
+ {t('released.message', {
56
+ released: formatDistance(new Date(timestamp), new Date(), { addSuffix: true }),
57
+ })}
58
+ </p>
59
+ <div>
60
+ <span className='dx-tag dx-tag--neutral -ml-1'>{version}</span>
61
+ </div>
62
+ </div>
63
+ )}
64
+ <div>
65
+ <p>
66
+ <Link href={releaseUrl} target='_blank' rel='noreferrer' variant='neutral'>
67
+ {t('see-release.label')}
68
+ <Icon icon='ph--arrow-square-out--bold' size={4} classNames='dx-icon-inline ms-1' />
69
+ </Link>
70
+ </p>
71
+ <p>
72
+ <Trans
73
+ {...{
74
+ t,
75
+ i18nKey: 'powered-by-dxos.message',
76
+ components: {
77
+ dxos: (
78
+ <Link
79
+ classNames='text-green-500'
80
+ href='https://dxos.org'
81
+ target='_blank'
82
+ rel='noreferrer'
83
+ variant='neutral'
84
+ />
85
+ ),
86
+ },
87
+ }}
88
+ />
89
+ </p>
90
+ </div>
91
+ </div>
92
+ <Popover.Arrow />
93
+ </Popover.Content>
94
+ </Popover.Portal>
95
+ </Popover.Root>
96
+ );
97
+ };
@@ -0,0 +1,5 @@
1
+ //
2
+ // Copyright 2024 DXOS.org
3
+ //
4
+
5
+ export { VersionNumber as default } from './VersionNumber';
@@ -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/index.ts CHANGED
@@ -2,6 +2,5 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- export * from './components';
5
+ // TODO(wittjosiah): StatusBar should be factored out of plugin-status-bar into a shared UI package.
6
6
  export * from './meta';
7
- export * from './StatusBarPlugin';
package/src/meta.ts CHANGED
@@ -2,13 +2,16 @@
2
2
  // Copyright 2024 DXOS.org
3
3
  //
4
4
 
5
- import { type PluginMeta } from '@dxos/app-framework';
5
+ import { type Plugin } from '@dxos/app-framework';
6
+ import { trim } from '@dxos/util';
6
7
 
7
- export const STATUS_BAR_PLUGIN = 'dxos.org/plugin/status-bar';
8
-
9
- export const meta: PluginMeta = {
10
- id: STATUS_BAR_PLUGIN,
8
+ export const meta: Plugin.Meta = {
9
+ id: 'org.dxos.plugin.statusBar',
11
10
  name: 'Status Bar',
12
- description: 'Display a bar with status and actions.',
11
+ description: trim`
12
+ Persistent bottom bar displaying workspace status information and quick actions.
13
+ Access connection state, notifications, and common commands without leaving your current context.
14
+ `,
13
15
  icon: 'ph--info--regular',
16
+ tags: ['system'],
14
17
  };
package/src/plugin.ts ADDED
@@ -0,0 +1,9 @@
1
+ //
2
+ // Copyright 2023 DXOS.org
3
+ //
4
+
5
+ import { Plugin } from '@dxos/app-framework';
6
+
7
+ import { meta } from './meta';
8
+
9
+ export const StatusBarPlugin = Plugin.lazy(meta, () => import('#plugin'));
@@ -2,45 +2,25 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import { type useTranslation } from '@dxos/react-ui';
6
-
7
- import { STATUS_BAR_PLUGIN } from './meta';
8
-
9
- // TODO(wittjosiah): There's got to be a better way to do typesafe translations, this is too much boilerplate.
10
-
11
- type StatusBarTranslationKeys =
12
- | 'plugin name'
13
- | 'warning title'
14
- | 'technology preview message'
15
- | 'learn more label'
16
- | 'released message'
17
- | 'see release label'
18
- | 'powered by dxos message'
19
- | 'discord label'
20
- | 'github label'
21
- | 'feedback label';
22
-
23
- type RequiredTranslation = { [key in StatusBarTranslationKeys]: string };
24
- type TranslationEntry = { [STATUS_BAR_PLUGIN]: RequiredTranslation };
25
- type Language = string;
26
-
27
- // -- helpers.
28
- const entry = (translation: RequiredTranslation): TranslationEntry => ({ [STATUS_BAR_PLUGIN]: translation });
29
- export const mkTranslation = (t: ReturnType<typeof useTranslation>['t']) => (key: StatusBarTranslationKeys) => t(key);
30
-
31
- const translations: Record<Language, TranslationEntry> = {
32
- 'en-US': entry({
33
- 'plugin name': 'Status Bar',
34
- 'warning title': 'WARNING',
35
- 'technology preview message': 'Composer is currently in beta.',
36
- 'learn more label': 'Learn more',
37
- 'released message': 'This version released {{released}}.',
38
- 'see release label': 'See release on GitHub',
39
- 'powered by dxos message': 'Powered by <dxos>DXOS</dxos>',
40
- 'discord label': 'Discord',
41
- 'github label': 'GitHub',
42
- 'feedback label': 'Feedback',
43
- }),
44
- };
45
-
46
- export default [translations];
5
+ import { type Resource } from '@dxos/react-ui';
6
+
7
+ import { meta } from '#meta';
8
+
9
+ export const translations = [
10
+ {
11
+ 'en-US': {
12
+ [meta.id]: {
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
+ },
24
+ },
25
+ },
26
+ ] as const satisfies Resource[];
@@ -1,249 +0,0 @@
1
- // packages/plugins/plugin-status-bar/src/components/StatusBar.tsx
2
- import { useSignals as _useSignals } from "@preact-signals/safe-react/tracking";
3
- import { Slot } from "@radix-ui/react-slot";
4
- import React, { forwardRef } from "react";
5
- import { mx } from "@dxos/react-ui-theme";
6
- var StatusBarText = /* @__PURE__ */ forwardRef(({ classNames, children }, forwardedRef) => {
7
- var _effect = _useSignals();
8
- try {
9
- return /* @__PURE__ */ React.createElement("span", {
10
- className: mx(classNames),
11
- ref: forwardedRef
12
- }, children);
13
- } finally {
14
- _effect.f();
15
- }
16
- });
17
- var StatusBarButton = /* @__PURE__ */ forwardRef(({ classNames, children, asChild, ...props }, forwardedRef) => {
18
- var _effect = _useSignals();
19
- try {
20
- const classes = mx("flex items-center justify-center gap-2 p-1 px-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);
21
- return asChild ? /* @__PURE__ */ React.createElement(Slot, {
22
- role: "button",
23
- ref: forwardedRef,
24
- className: classes,
25
- ...props
26
- }, children) : /* @__PURE__ */ React.createElement("button", {
27
- className: classes,
28
- ref: forwardedRef,
29
- ...props
30
- }, children);
31
- } finally {
32
- _effect.f();
33
- }
34
- });
35
- var StatusBarItem = /* @__PURE__ */ forwardRef(({ classNames, children, ...props }, forwardedRef) => {
36
- var _effect = _useSignals();
37
- try {
38
- return /* @__PURE__ */ React.createElement("div", {
39
- role: "menuitem",
40
- className: mx("flex items-center justify-center gap-2 p-1 px-2 rounded-sm select-none", classNames),
41
- ref: forwardedRef,
42
- ...props
43
- }, children);
44
- } finally {
45
- _effect.f();
46
- }
47
- });
48
- var StartContent = /* @__PURE__ */ forwardRef(({ classNames, children }, forwardedRef) => {
49
- var _effect = _useSignals();
50
- try {
51
- return /* @__PURE__ */ React.createElement("div", {
52
- role: "none",
53
- className: mx("flex-grow flex items-center space-x-2", classNames),
54
- ref: forwardedRef
55
- }, children);
56
- } finally {
57
- _effect.f();
58
- }
59
- });
60
- var EndContent = /* @__PURE__ */ forwardRef(({ classNames, children }, forwardedRef) => {
61
- var _effect = _useSignals();
62
- try {
63
- return /* @__PURE__ */ React.createElement("div", {
64
- role: "none",
65
- className: mx("flex-grow flex items-center justify-end", classNames),
66
- ref: forwardedRef
67
- }, children);
68
- } finally {
69
- _effect.f();
70
- }
71
- });
72
- var StatusBar = {
73
- Text: StatusBarText,
74
- Item: StatusBarItem,
75
- Button: StatusBarButton,
76
- StartContent,
77
- EndContent
78
- };
79
-
80
- // packages/plugins/plugin-status-bar/src/meta.ts
81
- var STATUS_BAR_PLUGIN = "dxos.org/plugin/status-bar";
82
- var meta = {
83
- id: STATUS_BAR_PLUGIN,
84
- name: "Status Bar",
85
- description: "Display a bar with status and actions.",
86
- icon: "ph--info--regular"
87
- };
88
-
89
- // packages/plugins/plugin-status-bar/src/components/VersionNumber.tsx
90
- import { useSignals as _useSignals2 } from "@preact-signals/safe-react/tracking";
91
- import { formatDistance } from "date-fns/formatDistance";
92
- import React2 from "react";
93
- import { useConfig } from "@dxos/react-client";
94
- import { Link, Message, Popover, Trans, useTranslation, Icon } from "@dxos/react-ui";
95
- var repo = "https://github.com/dxos/dxos";
96
- var VERSION_REGEX = /([\d.]+)/;
97
- var VersionNumber = () => {
98
- var _effect = _useSignals2();
99
- try {
100
- const { t } = useTranslation(STATUS_BAR_PLUGIN);
101
- const config = useConfig();
102
- const { version, timestamp, commitHash } = config.values.runtime?.app?.build ?? {};
103
- const [_, v] = version?.match(VERSION_REGEX) ?? [];
104
- const isLabs = config.values.runtime?.app?.env?.DX_LABS;
105
- const releaseUrl = config.values.runtime?.app?.env?.DX_ENVIRONMENT === "production" ? `${repo}/releases/tag/v${version}` : `${repo}/commit/${commitHash}`;
106
- const previewUrl = "https://docs.dxos.org/composer#technology-preview";
107
- return /* @__PURE__ */ React2.createElement(Popover.Root, null, /* @__PURE__ */ React2.createElement(Popover.Trigger, {
108
- asChild: true
109
- }, /* @__PURE__ */ React2.createElement(StatusBar.Button, {
110
- classNames: "text-xs"
111
- }, isLabs ? version : v)), /* @__PURE__ */ React2.createElement(Popover.Portal, null, /* @__PURE__ */ React2.createElement(Popover.Content, {
112
- side: "top",
113
- role: "message",
114
- classNames: "z-[12] bg-warning-500 max-is-[min(calc(100vw-16px),40ch)]"
115
- }, /* @__PURE__ */ React2.createElement(Message.Root, {
116
- valence: "warning",
117
- classNames: "rounded-be-none p-5"
118
- }, /* @__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, {
119
- href: previewUrl,
120
- target: "_blank",
121
- rel: "noreferrer",
122
- variant: "neutral"
123
- }, t("learn more label"), /* @__PURE__ */ React2.createElement(Icon, {
124
- icon: "ph--arrow-square-out--bold",
125
- classNames: "inline mis-1"
126
- })))), /* @__PURE__ */ React2.createElement("div", {
127
- role: "none",
128
- className: "plb-4 pli-5 space-b-2 text-baseText"
129
- }, timestamp && /* @__PURE__ */ React2.createElement("p", null, t("released message", {
130
- released: formatDistance(new Date(timestamp), /* @__PURE__ */ new Date(), {
131
- addSuffix: true
132
- })
133
- }), /* @__PURE__ */ React2.createElement("br", null), /* @__PURE__ */ React2.createElement(Link, {
134
- href: releaseUrl,
135
- target: "_blank",
136
- rel: "noreferrer",
137
- variant: "neutral"
138
- }, t("see release label"), /* @__PURE__ */ React2.createElement(Icon, {
139
- icon: "ph--arrow-square-out--bold",
140
- classNames: "inline mis-1"
141
- }))), /* @__PURE__ */ React2.createElement("p", null, /* @__PURE__ */ React2.createElement(Trans, {
142
- t,
143
- i18nKey: "powered by dxos message",
144
- components: {
145
- dxos: /* @__PURE__ */ React2.createElement(Link, {
146
- href: "https://dxos.org",
147
- target: "_blank",
148
- rel: "noreferrer",
149
- variant: "neutral"
150
- })
151
- }
152
- }))), /* @__PURE__ */ React2.createElement(Popover.Arrow, null))));
153
- } finally {
154
- _effect.f();
155
- }
156
- };
157
-
158
- // packages/plugins/plugin-status-bar/src/components/StatusBarPanel.tsx
159
- import { useSignals as _useSignals3 } from "@preact-signals/safe-react/tracking";
160
- import React3, { useState } from "react";
161
- import { Surface } from "@dxos/app-framework";
162
- import { useConfig as useConfig2 } from "@dxos/react-client";
163
- import { Icon as Icon2, Popover as Popover2, useTranslation as useTranslation2 } from "@dxos/react-ui";
164
- var StatusBarActions = () => {
165
- var _effect = _useSignals3();
166
- try {
167
- const { t } = useTranslation2(STATUS_BAR_PLUGIN);
168
- const [open, setOpen] = useState(false);
169
- return /* @__PURE__ */ React3.createElement(Popover2.Root, {
170
- open,
171
- onOpenChange: setOpen
172
- }, /* @__PURE__ */ React3.createElement(EnvironmentLabel, null), /* @__PURE__ */ React3.createElement(VersionNumber, null), /* @__PURE__ */ React3.createElement(StatusBar.Button, {
173
- asChild: true
174
- }, /* @__PURE__ */ React3.createElement("a", {
175
- href: "https://dxos.org/discord",
176
- target: "_blank",
177
- rel: "noopener noreferrer"
178
- }, /* @__PURE__ */ React3.createElement(Icon2, {
179
- icon: "ph--discord-logo--regular",
180
- size: 4
181
- }), /* @__PURE__ */ React3.createElement(StatusBar.Text, {
182
- classNames: "hidden sm:block"
183
- }, t("discord label")))), /* @__PURE__ */ React3.createElement(StatusBar.Button, {
184
- asChild: true
185
- }, /* @__PURE__ */ React3.createElement("a", {
186
- href: "https://github.com/dxos/dxos",
187
- target: "_blank",
188
- rel: "noopener noreferrer"
189
- }, /* @__PURE__ */ React3.createElement(Icon2, {
190
- icon: "ph--github-logo--regular",
191
- size: 4
192
- }), /* @__PURE__ */ React3.createElement(StatusBar.Text, {
193
- classNames: "hidden sm:block"
194
- }, t("github label")))));
195
- } finally {
196
- _effect.f();
197
- }
198
- };
199
- var StatusBarPanel = () => {
200
- var _effect = _useSignals3();
201
- try {
202
- return /* @__PURE__ */ React3.createElement(React3.Fragment, null, /* @__PURE__ */ React3.createElement(StatusBarActions, null), /* @__PURE__ */ React3.createElement("span", {
203
- role: "separator",
204
- className: "grow"
205
- }), /* @__PURE__ */ React3.createElement(Surface, {
206
- role: "status"
207
- }));
208
- } finally {
209
- _effect.f();
210
- }
211
- };
212
- var ENV_LABELS = {
213
- "edge-dev": "Dev",
214
- "edge-main": "Main",
215
- "edge-labs": "Labs",
216
- "edge-production": "Production"
217
- };
218
- var EnvironmentLabel = () => {
219
- var _effect = _useSignals3();
220
- try {
221
- const config = useConfig2();
222
- const edgeUrl = config.values.runtime?.services?.edge?.url;
223
- if (!edgeUrl) {
224
- return null;
225
- }
226
- const part = new URL(edgeUrl).host.split(".")[0];
227
- const edgeEnv = ENV_LABELS[part];
228
- if (!edgeEnv) {
229
- return null;
230
- }
231
- return /* @__PURE__ */ React3.createElement(StatusBar.Item, null, /* @__PURE__ */ React3.createElement(StatusBar.Text, {
232
- classNames: "text-xs text-subdued border border-separator rounded-full px-1"
233
- }, /* @__PURE__ */ React3.createElement("span", {
234
- title: edgeEnv
235
- }, edgeEnv[0])));
236
- } finally {
237
- _effect.f();
238
- }
239
- };
240
-
241
- export {
242
- StatusBar,
243
- STATUS_BAR_PLUGIN,
244
- meta,
245
- VersionNumber,
246
- StatusBarActions,
247
- StatusBarPanel
248
- };
249
- //# sourceMappingURL=chunk-NV543FLZ.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, forwardRef, type PropsWithChildren, type ReactNode } from 'react';\n\nimport { type ThemedClassName } from '@dxos/react-ui';\nimport { mx } from '@dxos/react-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 px-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 px-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 PluginMeta } from '@dxos/app-framework';\n\nexport const STATUS_BAR_PLUGIN = 'dxos.org/plugin/status-bar';\n\nexport const meta: PluginMeta = {\n id: STATUS_BAR_PLUGIN,\n name: 'Status Bar',\n description: 'Display a bar with status and actions.',\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 { Link, Message, Popover, Trans, useTranslation, Icon } from '@dxos/react-ui';\n\nimport { StatusBar } from './StatusBar';\nimport { STATUS_BAR_PLUGIN } from '../meta';\n\nconst repo = 'https://github.com/dxos/dxos';\n\nconst VERSION_REGEX = /([\\d.]+)/;\n\nexport const VersionNumber = () => {\n const { t } = useTranslation(STATUS_BAR_PLUGIN);\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';\nimport { useConfig } from '@dxos/react-client';\nimport { Icon, Popover, useTranslation } from '@dxos/react-ui';\n\nimport { StatusBar } from './StatusBar';\nimport { VersionNumber } from './VersionNumber';\nimport { STATUS_BAR_PLUGIN } from '../meta';\n\nexport const StatusBarActions = () => {\n const { t } = useTranslation(STATUS_BAR_PLUGIN);\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 px-1'>\n <span title={edgeEnv}>{edgeEnv[0]}</span>\n </StatusBar.Text>\n </StatusBar.Item>\n );\n};\n"],
5
- "mappings": ";;AAIA,SAASA,Y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,aAAO;IACT;AACA,UAAMM,OAAO,IAAIC,IAAIP,OAAAA,EAASQ,KAAKC,MAAM,GAAA,EAAK,CAAA;AAC9C,UAAMC,UAAUb,WAAWS,IAAAA;AAC3B,QAAI,CAACI,SAAS;AACZ,aAAO;IACT;AAEA,WACE,gBAAApC,OAAA,cAACM,UAAU+B,MAAI,MACb,gBAAArC,OAAA,cAACM,UAAUU,MAAI;MAACC,YAAW;OACzB,gBAAAjB,OAAA,cAACmB,QAAAA;MAAKmB,OAAOF;OAAUA,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", "STATUS_BAR_PLUGIN", "meta", "id", "name", "description", "icon", "formatDistance", "React", "useConfig", "Link", "Message", "Popover", "Trans", "useTranslation", "Icon", "repo", "VERSION_REGEX", "VersionNumber", "t", "useTranslation", "STATUS_BAR_PLUGIN", "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", "STATUS_BAR_PLUGIN", "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,61 +0,0 @@
1
- import {
2
- STATUS_BAR_PLUGIN,
3
- StatusBar,
4
- StatusBarActions,
5
- StatusBarPanel,
6
- VersionNumber,
7
- meta
8
- } from "./chunk-NV543FLZ.mjs";
9
-
10
- // packages/plugins/plugin-status-bar/src/StatusBarPlugin.ts
11
- import { Capabilities, contributes, defineModule, definePlugin, Events } from "@dxos/app-framework";
12
-
13
- // packages/plugins/plugin-status-bar/src/capabilities/index.ts
14
- import { lazy } from "@dxos/app-framework";
15
- var ReactSurface = lazy(() => import("./react-surface-XYQMVXMA.mjs"));
16
-
17
- // packages/plugins/plugin-status-bar/src/translations.ts
18
- var entry = (translation) => ({
19
- [STATUS_BAR_PLUGIN]: translation
20
- });
21
- var translations = {
22
- "en-US": entry({
23
- "plugin name": "Status Bar",
24
- "warning title": "WARNING",
25
- "technology preview message": "Composer is currently in beta.",
26
- "learn more label": "Learn more",
27
- "released message": "This version released {{released}}.",
28
- "see release label": "See release on GitHub",
29
- "powered by dxos message": "Powered by <dxos>DXOS</dxos>",
30
- "discord label": "Discord",
31
- "github label": "GitHub",
32
- "feedback label": "Feedback"
33
- })
34
- };
35
- var translations_default = [
36
- translations
37
- ];
38
-
39
- // packages/plugins/plugin-status-bar/src/StatusBarPlugin.ts
40
- var StatusBarPlugin = () => definePlugin(meta, [
41
- defineModule({
42
- id: `${meta.id}/module/translations`,
43
- activatesOn: Events.SetupTranslations,
44
- activate: () => contributes(Capabilities.Translations, translations_default)
45
- }),
46
- defineModule({
47
- id: `${meta.id}/module/react-surface`,
48
- activatesOn: Events.SetupReactSurface,
49
- activate: ReactSurface
50
- })
51
- ]);
52
- export {
53
- STATUS_BAR_PLUGIN,
54
- StatusBar,
55
- StatusBarActions,
56
- StatusBarPanel,
57
- StatusBarPlugin,
58
- VersionNumber,
59
- meta
60
- };
61
- //# sourceMappingURL=index.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/StatusBarPlugin.ts", "../../../src/capabilities/index.ts", "../../../src/translations.ts"],
4
- "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { Capabilities, contributes, defineModule, definePlugin, Events } from '@dxos/app-framework';\n\nimport { ReactSurface } from './capabilities';\nimport { meta } from './meta';\nimport translations from './translations';\n\nexport const StatusBarPlugin = () =>\n definePlugin(meta, [\n defineModule({\n id: `${meta.id}/module/translations`,\n activatesOn: Events.SetupTranslations,\n activate: () => contributes(Capabilities.Translations, translations),\n }),\n defineModule({\n id: `${meta.id}/module/react-surface`,\n activatesOn: Events.SetupReactSurface,\n activate: ReactSurface,\n }),\n ]);\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { lazy } from '@dxos/app-framework';\n\nexport const ReactSurface = lazy(() => import('./react-surface'));\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type useTranslation } from '@dxos/react-ui';\n\nimport { STATUS_BAR_PLUGIN } from './meta';\n\n// TODO(wittjosiah): There's got to be a better way to do typesafe translations, this is too much boilerplate.\n\ntype StatusBarTranslationKeys =\n | 'plugin name'\n | 'warning title'\n | 'technology preview message'\n | 'learn more label'\n | 'released message'\n | 'see release label'\n | 'powered by dxos message'\n | 'discord label'\n | 'github label'\n | 'feedback label';\n\ntype RequiredTranslation = { [key in StatusBarTranslationKeys]: string };\ntype TranslationEntry = { [STATUS_BAR_PLUGIN]: RequiredTranslation };\ntype Language = string;\n\n// -- helpers.\nconst entry = (translation: RequiredTranslation): TranslationEntry => ({ [STATUS_BAR_PLUGIN]: translation });\nexport const mkTranslation = (t: ReturnType<typeof useTranslation>['t']) => (key: StatusBarTranslationKeys) => t(key);\n\nconst translations: Record<Language, TranslationEntry> = {\n 'en-US': entry({\n 'plugin name': 'Status Bar',\n 'warning title': 'WARNING',\n 'technology preview message': 'Composer is currently in beta.',\n 'learn more label': 'Learn more',\n 'released message': 'This version released {{released}}.',\n 'see release label': 'See release on GitHub',\n 'powered by dxos message': 'Powered by <dxos>DXOS</dxos>',\n 'discord label': 'Discord',\n 'github label': 'GitHub',\n 'feedback label': 'Feedback',\n }),\n};\n\nexport default [translations];\n"],
5
- "mappings": ";;;;;;;;;;AAIA,SAASA,cAAcC,aAAaC,cAAcC,cAAcC,cAAc;;;ACA9E,SAASC,YAAY;AAEd,IAAMC,eAAeC,KAAK,MAAM,OAAO,8BAAA,CAAA;;;ACqB9C,IAAMC,QAAQ,CAACC,iBAAwD;EAAE,CAACC,iBAAAA,GAAoBD;AAAY;AAG1G,IAAME,eAAmD;EACvD,SAASC,MAAM;IACb,eAAe;IACf,iBAAiB;IACjB,8BAA8B;IAC9B,oBAAoB;IACpB,oBAAoB;IACpB,qBAAqB;IACrB,2BAA2B;IAC3B,iBAAiB;IACjB,gBAAgB;IAChB,kBAAkB;EACpB,CAAA;AACF;AAEA,IAAA,uBAAe;EAACD;;;;AFnCT,IAAME,kBAAkB,MAC7BC,aAAaC,MAAM;EACjBC,aAAa;IACXC,IAAI,GAAGF,KAAKE,EAAE;IACdC,aAAaC,OAAOC;IACpBC,UAAU,MAAMC,YAAYC,aAAaC,cAAcC,oBAAAA;EACzD,CAAA;EACAT,aAAa;IACXC,IAAI,GAAGF,KAAKE,EAAE;IACdC,aAAaC,OAAOO;IACpBL,UAAUM;EACZ,CAAA;CACD;",
6
- "names": ["Capabilities", "contributes", "defineModule", "definePlugin", "Events", "lazy", "ReactSurface", "lazy", "entry", "translation", "STATUS_BAR_PLUGIN", "translations", "entry", "StatusBarPlugin", "definePlugin", "meta", "defineModule", "id", "activatesOn", "Events", "SetupTranslations", "activate", "contributes", "Capabilities", "Translations", "translations", "SetupReactSurface", "ReactSurface"]
7
- }
@@ -1 +0,0 @@
1
- {"inputs":{"packages/plugins/plugin-status-bar/src/components/StatusBar.tsx":{"bytes":8429,"imports":[{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"@radix-ui/react-slot","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/plugin-status-bar/src/meta.ts":{"bytes":1237,"imports":[],"format":"esm"},"packages/plugins/plugin-status-bar/src/components/VersionNumber.tsx":{"bytes":10949,"imports":[{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"date-fns/formatDistance","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-status-bar/src/components/StatusBar.tsx","kind":"import-statement","original":"./StatusBar"},{"path":"packages/plugins/plugin-status-bar/src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"packages/plugins/plugin-status-bar/src/components/StatusBarPanel.tsx":{"bytes":9015,"imports":[{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-status-bar/src/components/StatusBar.tsx","kind":"import-statement","original":"./StatusBar"},{"path":"packages/plugins/plugin-status-bar/src/components/VersionNumber.tsx","kind":"import-statement","original":"./VersionNumber"},{"path":"packages/plugins/plugin-status-bar/src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"packages/plugins/plugin-status-bar/src/components/index.ts":{"bytes":697,"imports":[{"path":"packages/plugins/plugin-status-bar/src/components/StatusBar.tsx","kind":"import-statement","original":"./StatusBar"},{"path":"packages/plugins/plugin-status-bar/src/components/StatusBarPanel.tsx","kind":"import-statement","original":"./StatusBarPanel"},{"path":"packages/plugins/plugin-status-bar/src/components/VersionNumber.tsx","kind":"import-statement","original":"./VersionNumber"}],"format":"esm"},"packages/plugins/plugin-status-bar/src/capabilities/react-surface.tsx":{"bytes":3838,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-status-bar/src/components/index.ts","kind":"import-statement","original":"../components"},{"path":"packages/plugins/plugin-status-bar/src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"packages/plugins/plugin-status-bar/src/capabilities/index.ts":{"bytes":796,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-status-bar/src/capabilities/react-surface.tsx","kind":"dynamic-import","original":"./react-surface"}],"format":"esm"},"packages/plugins/plugin-status-bar/src/translations.ts":{"bytes":3755,"imports":[{"path":"packages/plugins/plugin-status-bar/src/meta.ts","kind":"import-statement","original":"./meta"}],"format":"esm"},"packages/plugins/plugin-status-bar/src/StatusBarPlugin.ts":{"bytes":2804,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-status-bar/src/capabilities/index.ts","kind":"import-statement","original":"./capabilities"},{"path":"packages/plugins/plugin-status-bar/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/plugin-status-bar/src/translations.ts","kind":"import-statement","original":"./translations"}],"format":"esm"},"packages/plugins/plugin-status-bar/src/index.ts":{"bytes":667,"imports":[{"path":"packages/plugins/plugin-status-bar/src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"packages/plugins/plugin-status-bar/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/plugin-status-bar/src/StatusBarPlugin.ts","kind":"import-statement","original":"./StatusBarPlugin"}],"format":"esm"}},"outputs":{"packages/plugins/plugin-status-bar/dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3585},"packages/plugins/plugin-status-bar/dist/lib/browser/index.mjs":{"imports":[{"path":"packages/plugins/plugin-status-bar/dist/lib/browser/chunk-NV543FLZ.mjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-status-bar/dist/lib/browser/react-surface-XYQMVXMA.mjs","kind":"dynamic-import"}],"exports":["STATUS_BAR_PLUGIN","StatusBar","StatusBarActions","StatusBarPanel","StatusBarPlugin","VersionNumber","meta"],"entryPoint":"packages/plugins/plugin-status-bar/src/index.ts","inputs":{"packages/plugins/plugin-status-bar/src/index.ts":{"bytesInOutput":0},"packages/plugins/plugin-status-bar/src/StatusBarPlugin.ts":{"bytesInOutput":478},"packages/plugins/plugin-status-bar/src/capabilities/index.ts":{"bytesInOutput":115},"packages/plugins/plugin-status-bar/src/translations.ts":{"bytesInOutput":608}},"bytes":1747},"packages/plugins/plugin-status-bar/dist/lib/browser/react-surface-XYQMVXMA.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1838},"packages/plugins/plugin-status-bar/dist/lib/browser/react-surface-XYQMVXMA.mjs":{"imports":[{"path":"packages/plugins/plugin-status-bar/dist/lib/browser/chunk-NV543FLZ.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/plugins/plugin-status-bar/src/capabilities/react-surface.tsx","inputs":{"packages/plugins/plugin-status-bar/src/capabilities/react-surface.tsx":{"bytesInOutput":896}},"bytes":1171},"packages/plugins/plugin-status-bar/dist/lib/browser/chunk-NV543FLZ.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":14886},"packages/plugins/plugin-status-bar/dist/lib/browser/chunk-NV543FLZ.mjs":{"imports":[{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"@radix-ui/react-slot","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"date-fns/formatDistance","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true}],"exports":["STATUS_BAR_PLUGIN","StatusBar","StatusBarActions","StatusBarPanel","VersionNumber","meta"],"inputs":{"packages/plugins/plugin-status-bar/src/components/StatusBar.tsx":{"bytesInOutput":2549},"packages/plugins/plugin-status-bar/src/meta.ts":{"bytesInOutput":202},"packages/plugins/plugin-status-bar/src/components/VersionNumber.tsx":{"bytesInOutput":3296},"packages/plugins/plugin-status-bar/src/components/StatusBarPanel.tsx":{"bytesInOutput":2943},"packages/plugins/plugin-status-bar/src/components/index.ts":{"bytesInOutput":0}},"bytes":9406}}}