@dxos/plugin-status-bar 0.7.4 → 0.7.5-labs.071a3e2

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 (47) hide show
  1. package/dist/lib/browser/index.mjs +156 -91
  2. package/dist/lib/browser/index.mjs.map +4 -4
  3. package/dist/lib/browser/meta.json +1 -1
  4. package/dist/lib/node/index.cjs +186 -114
  5. package/dist/lib/node/index.cjs.map +4 -4
  6. package/dist/lib/node/meta.json +1 -1
  7. package/dist/lib/node-esm/index.mjs +156 -90
  8. package/dist/lib/node-esm/index.mjs.map +4 -4
  9. package/dist/lib/node-esm/meta.json +1 -1
  10. package/dist/types/src/StatusBarPlugin.d.ts +1 -3
  11. package/dist/types/src/StatusBarPlugin.d.ts.map +1 -1
  12. package/dist/types/src/components/FeedbackForm.d.ts.map +1 -1
  13. package/dist/types/src/components/StatusBar.d.ts +10 -24
  14. package/dist/types/src/components/StatusBar.d.ts.map +1 -1
  15. package/dist/types/src/components/StatusBarPanel.d.ts +1 -0
  16. package/dist/types/src/components/StatusBarPanel.d.ts.map +1 -1
  17. package/dist/types/src/components/VersionNumber.d.ts +3 -0
  18. package/dist/types/src/components/VersionNumber.d.ts.map +1 -0
  19. package/dist/types/src/index.d.ts +2 -3
  20. package/dist/types/src/index.d.ts.map +1 -1
  21. package/dist/types/src/meta.d.ts +1 -2
  22. package/dist/types/src/meta.d.ts.map +1 -1
  23. package/dist/types/src/translations.d.ts +1 -1
  24. package/dist/types/src/translations.d.ts.map +1 -1
  25. package/dist/types/tsconfig.tsbuildinfo +1 -0
  26. package/package.json +18 -24
  27. package/src/StatusBarPlugin.tsx +47 -24
  28. package/src/components/FeedbackForm.tsx +8 -27
  29. package/src/components/StatusBar.stories.tsx +2 -2
  30. package/src/components/StatusBar.tsx +8 -34
  31. package/src/components/StatusBarPanel.tsx +35 -26
  32. package/src/components/VersionNumber.tsx +86 -0
  33. package/src/index.ts +2 -5
  34. package/src/meta.ts +1 -1
  35. package/src/translations.ts +18 -2
  36. package/dist/lib/browser/chunk-4KDZC7WS.mjs +0 -14
  37. package/dist/lib/browser/chunk-4KDZC7WS.mjs.map +0 -7
  38. package/dist/lib/browser/meta.mjs +0 -9
  39. package/dist/lib/browser/meta.mjs.map +0 -7
  40. package/dist/lib/node/chunk-OGG3PMIV.cjs +0 -37
  41. package/dist/lib/node/chunk-OGG3PMIV.cjs.map +0 -7
  42. package/dist/lib/node/meta.cjs +0 -30
  43. package/dist/lib/node/meta.cjs.map +0 -7
  44. package/dist/lib/node-esm/chunk-UVUSU6KS.mjs +0 -16
  45. package/dist/lib/node-esm/chunk-UVUSU6KS.mjs.map +0 -7
  46. package/dist/lib/node-esm/meta.mjs +0 -10
  47. package/dist/lib/node-esm/meta.mjs.map +0 -7
@@ -28,83 +28,82 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
28
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
29
  var node_exports = {};
30
30
  __export(node_exports, {
31
+ STATUS_BAR_PLUGIN: () => STATUS_BAR_PLUGIN,
31
32
  StatusBar: () => StatusBar,
33
+ StatusBarActions: () => StatusBarActions,
32
34
  StatusBarPanel: () => StatusBarPanel,
33
35
  StatusBarPlugin: () => StatusBarPlugin,
34
- default: () => src_default
36
+ meta: () => meta
35
37
  });
36
38
  module.exports = __toCommonJS(node_exports);
37
- var import_chunk_OGG3PMIV = require("./chunk-OGG3PMIV.cjs");
38
- var import_react = __toESM(require("react"));
39
- var import_react_tabster = require("@fluentui/react-tabster");
40
39
  var import_react_slot = require("@radix-ui/react-slot");
41
- var import_react2 = __toESM(require("react"));
40
+ var import_react = __toESM(require("react"));
42
41
  var import_react_ui_theme = require("@dxos/react-ui-theme");
43
- var import_react3 = __toESM(require("react"));
42
+ var import_react2 = __toESM(require("react"));
44
43
  var import_app_framework = require("@dxos/app-framework");
45
44
  var import_react_ui = require("@dxos/react-ui");
46
- var import_schema = require("@effect/schema");
47
- var import_react4 = require("@phosphor-icons/react");
48
- var import_react5 = __toESM(require("react"));
45
+ var import_react3 = require("@phosphor-icons/react");
46
+ var import_react4 = __toESM(require("react"));
49
47
  var import_app_framework2 = require("@dxos/app-framework");
48
+ var import_types = require("@dxos/plugin-observability/types");
50
49
  var import_react_ui2 = require("@dxos/react-ui");
51
50
  var import_react_ui_form = require("@dxos/react-ui-form");
52
51
  var import_react_ui_theme2 = require("@dxos/react-ui-theme");
53
- var StatusBarText = /* @__PURE__ */ (0, import_react2.forwardRef)(({ classNames, children }, forwardedRef) => /* @__PURE__ */ import_react2.default.createElement("span", {
52
+ var import_formatDistance = require("date-fns/formatDistance");
53
+ var import_react5 = __toESM(require("react"));
54
+ var import_react_client = require("@dxos/react-client");
55
+ var import_react_ui3 = require("@dxos/react-ui");
56
+ var import_react6 = __toESM(require("react"));
57
+ var import_app_framework3 = require("@dxos/app-framework");
58
+ var StatusBarText = /* @__PURE__ */ (0, import_react.forwardRef)(({ classNames, children }, forwardedRef) => /* @__PURE__ */ import_react.default.createElement("span", {
54
59
  className: (0, import_react_ui_theme.mx)(classNames),
55
60
  ref: forwardedRef
56
61
  }, children));
57
- var StatusBarButton = /* @__PURE__ */ (0, import_react2.forwardRef)(({ classNames, children, asChild, ...props }, forwardedRef) => {
58
- const classes = (0, import_react_ui_theme.mx)("flex items-center gap-2 p-1 px-2 rounded-sm", "select-none cursor-pointer ch-focus-ring", "hover:bg-neutral-75 active:bg-neutral-150 dark:hover:bg-neutral-750 dark:active:bg-neutral-700", classNames);
59
- return asChild ? /* @__PURE__ */ import_react2.default.createElement(import_react_slot.Slot, {
62
+ var StatusBarButton = /* @__PURE__ */ (0, import_react.forwardRef)(({ classNames, children, asChild, ...props }, forwardedRef) => {
63
+ const classes = (0, import_react_ui_theme.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);
64
+ return asChild ? /* @__PURE__ */ import_react.default.createElement(import_react_slot.Slot, {
60
65
  role: "button",
61
66
  ref: forwardedRef,
62
67
  className: classes,
63
68
  ...props
64
- }, children) : /* @__PURE__ */ import_react2.default.createElement("button", {
69
+ }, children) : /* @__PURE__ */ import_react.default.createElement("button", {
65
70
  className: classes,
66
71
  ref: forwardedRef,
67
72
  ...props
68
73
  }, children);
69
74
  });
70
- var StatusBarItem = /* @__PURE__ */ (0, import_react2.forwardRef)(({ classNames, children, ...props }, forwardedRef) => /* @__PURE__ */ import_react2.default.createElement("div", {
75
+ var StatusBarItem = /* @__PURE__ */ (0, import_react.forwardRef)(({ classNames, children, ...props }, forwardedRef) => /* @__PURE__ */ import_react.default.createElement("div", {
71
76
  role: "menuitem",
72
- className: (0, import_react_ui_theme.mx)("flex items-center gap-2 p-1 px-2 rounded-sm select-none", classNames),
77
+ className: (0, import_react_ui_theme.mx)("flex items-center justify-center gap-2 p-1 px-2 rounded-sm select-none", classNames),
73
78
  ref: forwardedRef,
74
79
  ...props
75
80
  }, children));
76
- var StatusBarContainer = /* @__PURE__ */ (0, import_react2.forwardRef)(({ classNames, children }, forwardedRef) => {
77
- const groupAttrs = (0, import_react_tabster.useFocusableGroup)({
78
- tabBehavior: "limited"
79
- });
80
- return /* @__PURE__ */ import_react2.default.createElement("div", {
81
- role: "menubar",
82
- tabIndex: 0,
83
- ...groupAttrs,
84
- className: (0, import_react_ui_theme.mx)("bs-[--statusbar-size] flex justify-end items-center gap-2 bg-base text-description text-lg pointer-fine:text-xs ch-focus-ring-inset", classNames),
85
- ref: forwardedRef
86
- }, children);
87
- });
88
- var StartContent = /* @__PURE__ */ (0, import_react2.forwardRef)(({ classNames, children }, forwardedRef) => /* @__PURE__ */ import_react2.default.createElement("div", {
81
+ var StartContent = /* @__PURE__ */ (0, import_react.forwardRef)(({ classNames, children }, forwardedRef) => /* @__PURE__ */ import_react.default.createElement("div", {
89
82
  role: "none",
90
83
  className: (0, import_react_ui_theme.mx)("flex-grow flex items-center space-x-2", classNames),
91
84
  ref: forwardedRef
92
85
  }, children));
93
- var EndContent = /* @__PURE__ */ (0, import_react2.forwardRef)(({ classNames, children }, forwardedRef) => /* @__PURE__ */ import_react2.default.createElement("div", {
86
+ var EndContent = /* @__PURE__ */ (0, import_react.forwardRef)(({ classNames, children }, forwardedRef) => /* @__PURE__ */ import_react.default.createElement("div", {
94
87
  role: "none",
95
88
  className: (0, import_react_ui_theme.mx)("flex-grow flex items-center justify-end", classNames),
96
89
  ref: forwardedRef
97
90
  }, children));
98
91
  var StatusBar = {
99
- Container: StatusBarContainer,
100
92
  Text: StatusBarText,
101
93
  Item: StatusBarItem,
102
94
  Button: StatusBarButton,
103
95
  StartContent,
104
96
  EndContent
105
97
  };
98
+ var STATUS_BAR_PLUGIN = "dxos.org/plugin/status-bar";
99
+ var meta = {
100
+ id: STATUS_BAR_PLUGIN,
101
+ name: "Status Bar",
102
+ description: "Display a bar with status and actions.",
103
+ icon: "ph--info--regular"
104
+ };
106
105
  var entry = (translation) => ({
107
- [import_chunk_OGG3PMIV.STATUS_BAR_PLUGIN]: translation
106
+ [STATUS_BAR_PLUGIN]: translation
108
107
  });
109
108
  var mkTranslation = (t) => (key) => t(key);
110
109
  var translations = {
@@ -115,43 +114,32 @@ var translations = {
115
114
  "email input label": "Email",
116
115
  "email input placeholder": "hello@example.com",
117
116
  "feedback text area label": "Feedback",
118
- "feedback text area placeholder": "Found a bug? Have a suggestion? Let us know!",
119
- "send feedback label": "Send Feedback"
117
+ "feedback text area placeholder": "Please describe your issue or suggestion.",
118
+ "send feedback label": "Send Feedback",
119
+ "warning title": "WARNING",
120
+ "technology preview message": "Composer is still in technology preview.",
121
+ "learn more label": "Learn more",
122
+ "released message": "This version released {{released}}.",
123
+ "see release label": "See release on GitHub",
124
+ "powered by dxos message": "Powered by <dxos>DXOS</dxos>",
125
+ "discord label": "Discord",
126
+ "feedback label": "Feedback"
120
127
  })
121
128
  };
122
129
  var translations_default = [
123
130
  translations
124
131
  ];
125
- var Email = import_schema.Schema.String.pipe(import_schema.Schema.nonEmptyString({
126
- message: () => "Email is required."
127
- }), import_schema.Schema.pattern(/^(?!\.)(?!.*\.\.)([A-Z0-9_+-.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9-]*\.)+[A-Z]{2,}$/i, {
128
- message: () => "Invalid email address."
129
- }));
130
- var nonEmpty = (field) => import_schema.Schema.nonEmptyString({
131
- message: () => `${field} is required.`
132
- });
133
- var maxLength = (field, length) => import_schema.Schema.maxLength(length, {
134
- message: () => `${field} is too long.`
135
- });
136
- var FeedbackFormSchema = import_schema.Schema.Struct({
137
- name: import_schema.Schema.String.pipe(nonEmpty("Name"), maxLength("Name", 256)),
138
- email: Email.pipe(maxLength("Email", 256)),
139
- message: import_schema.Schema.String.pipe(nonEmpty("Feedback"), maxLength("Feedback", 32768))
140
- });
141
132
  var initialValues = {
142
133
  name: "",
143
134
  email: "",
144
135
  message: ""
145
136
  };
146
137
  var FeedbackForm = ({ onClose }) => {
147
- const { t } = (0, import_react_ui2.useTranslation)(import_chunk_OGG3PMIV.STATUS_BAR_PLUGIN);
138
+ const { t } = (0, import_react_ui2.useTranslation)(STATUS_BAR_PLUGIN);
148
139
  const translation = mkTranslation(t);
149
- const dispatch = (0, import_app_framework2.useIntentDispatcher)();
150
- const onSave = (0, import_react5.useCallback)((values) => {
151
- void dispatch({
152
- action: "dxos.org/plugin/observability/capture-feedback",
153
- data: values
154
- });
140
+ const { dispatchPromise: dispatch } = (0, import_app_framework2.useIntentDispatcher)();
141
+ const onSave = (0, import_react4.useCallback)((values) => {
142
+ void dispatch((0, import_app_framework2.createIntent)(import_types.ObservabilityAction.CaptureUserFeedback, values));
155
143
  onClose();
156
144
  }, [
157
145
  dispatch,
@@ -159,125 +147,209 @@ var FeedbackForm = ({ onClose }) => {
159
147
  ]);
160
148
  const { handleSave, canSave, getStatus, ...inputProps } = (0, import_react_ui_form.useForm)({
161
149
  initialValues,
162
- schema: FeedbackFormSchema,
150
+ schema: import_types.UserFeedback,
163
151
  onSave
164
152
  });
165
- return /* @__PURE__ */ import_react5.default.createElement("div", {
153
+ return /* @__PURE__ */ import_react4.default.createElement("div", {
166
154
  role: "form",
167
155
  className: "p-3 flex flex-col gap-2"
168
- }, /* @__PURE__ */ import_react5.default.createElement("div", {
156
+ }, /* @__PURE__ */ import_react4.default.createElement("div", {
169
157
  role: "none",
170
158
  className: "space-b-1"
171
- }, /* @__PURE__ */ import_react5.default.createElement(import_react_ui2.Input.Root, {
159
+ }, /* @__PURE__ */ import_react4.default.createElement(import_react_ui2.Input.Root, {
172
160
  validationValence: getStatus("name").status
173
- }, /* @__PURE__ */ import_react5.default.createElement(import_react_ui2.Input.Label, null, translation("name label")), /* @__PURE__ */ import_react5.default.createElement(import_react_ui2.Input.TextInput, {
161
+ }, /* @__PURE__ */ import_react4.default.createElement(import_react_ui2.Input.Label, null, translation("name label")), /* @__PURE__ */ import_react4.default.createElement(import_react_ui2.Input.TextInput, {
174
162
  classNames: "text-sm",
175
163
  placeholder: translation("name placeholder"),
176
164
  autoFocus: true,
177
165
  ...inputProps
178
- }), /* @__PURE__ */ import_react5.default.createElement(import_react_ui2.Input.DescriptionAndValidation, null, /* @__PURE__ */ import_react5.default.createElement(import_react_ui2.Input.Validation, null, getStatus("name").error)))), /* @__PURE__ */ import_react5.default.createElement("div", {
166
+ }), /* @__PURE__ */ import_react4.default.createElement(import_react_ui2.Input.DescriptionAndValidation, null, /* @__PURE__ */ import_react4.default.createElement(import_react_ui2.Input.Validation, null, getStatus("name").error)))), /* @__PURE__ */ import_react4.default.createElement("div", {
179
167
  role: "none",
180
168
  className: "space-b-1"
181
- }, /* @__PURE__ */ import_react5.default.createElement(import_react_ui2.Input.Root, {
169
+ }, /* @__PURE__ */ import_react4.default.createElement(import_react_ui2.Input.Root, {
182
170
  validationValence: getStatus("email").status
183
- }, /* @__PURE__ */ import_react5.default.createElement(import_react_ui2.Input.Label, null, translation("email input label")), /* @__PURE__ */ import_react5.default.createElement(import_react_ui2.Input.TextInput, {
171
+ }, /* @__PURE__ */ import_react4.default.createElement(import_react_ui2.Input.Label, null, translation("email input label")), /* @__PURE__ */ import_react4.default.createElement(import_react_ui2.Input.TextInput, {
184
172
  classNames: "text-sm",
185
173
  placeholder: translation("email input placeholder"),
186
174
  ...inputProps
187
- }), /* @__PURE__ */ import_react5.default.createElement(import_react_ui2.Input.DescriptionAndValidation, null, /* @__PURE__ */ import_react5.default.createElement(import_react_ui2.Input.Validation, null, getStatus("email").error)))), /* @__PURE__ */ import_react5.default.createElement("div", {
175
+ }), /* @__PURE__ */ import_react4.default.createElement(import_react_ui2.Input.DescriptionAndValidation, null, /* @__PURE__ */ import_react4.default.createElement(import_react_ui2.Input.Validation, null, getStatus("email").error)))), /* @__PURE__ */ import_react4.default.createElement("div", {
188
176
  role: "none",
189
177
  className: "space-b-1"
190
- }, /* @__PURE__ */ import_react5.default.createElement(import_react_ui2.Input.Root, {
178
+ }, /* @__PURE__ */ import_react4.default.createElement(import_react_ui2.Input.Root, {
191
179
  validationValence: getStatus("message").status
192
- }, /* @__PURE__ */ import_react5.default.createElement(import_react_ui2.Input.Label, null, translation("feedback text area label")), /* @__PURE__ */ import_react5.default.createElement(import_react_ui2.Input.TextArea, {
180
+ }, /* @__PURE__ */ import_react4.default.createElement(import_react_ui2.Input.Label, null, translation("feedback text area label")), /* @__PURE__ */ import_react4.default.createElement(import_react_ui2.Input.TextArea, {
193
181
  classNames: "text-sm",
194
182
  rows: 5,
195
183
  cols: 30,
196
184
  placeholder: translation("feedback text area placeholder"),
197
185
  ...inputProps
198
- }), /* @__PURE__ */ import_react5.default.createElement(import_react_ui2.Input.DescriptionAndValidation, null, /* @__PURE__ */ import_react5.default.createElement(import_react_ui2.Input.Validation, null, getStatus("message").error)))), /* @__PURE__ */ import_react5.default.createElement("div", {
186
+ }), /* @__PURE__ */ import_react4.default.createElement(import_react_ui2.Input.DescriptionAndValidation, null, /* @__PURE__ */ import_react4.default.createElement(import_react_ui2.Input.Validation, null, getStatus("message").error)))), /* @__PURE__ */ import_react4.default.createElement("div", {
199
187
  role: "none",
200
188
  className: "space-b-2"
201
- }, /* @__PURE__ */ import_react5.default.createElement(import_react_ui2.Button, {
189
+ }, /* @__PURE__ */ import_react4.default.createElement(import_react_ui2.Button, {
202
190
  type: "submit",
203
191
  variant: "primary",
204
192
  classNames: "is-full flex gap-2",
205
193
  disabled: !canSave,
206
194
  onClick: handleSave
207
- }, /* @__PURE__ */ import_react5.default.createElement("span", null, translation("send feedback label")), /* @__PURE__ */ import_react5.default.createElement("div", {
195
+ }, /* @__PURE__ */ import_react4.default.createElement("span", null, translation("send feedback label")), /* @__PURE__ */ import_react4.default.createElement("div", {
208
196
  className: "grow"
209
- }), /* @__PURE__ */ import_react5.default.createElement(import_react4.PaperPlaneTilt, {
197
+ }), /* @__PURE__ */ import_react4.default.createElement(import_react3.PaperPlaneTilt, {
210
198
  className: (0, import_react_ui_theme2.getSize)(5)
211
- })), /* @__PURE__ */ import_react5.default.createElement(import_react_ui2.Popover.Close, {
199
+ })), /* @__PURE__ */ import_react4.default.createElement(import_react_ui2.Popover.Close, {
212
200
  asChild: true
213
- }, /* @__PURE__ */ import_react5.default.createElement(import_react_ui2.Button, {
201
+ }, /* @__PURE__ */ import_react4.default.createElement(import_react_ui2.Button, {
214
202
  classNames: "is-full flex gap-2"
215
- }, /* @__PURE__ */ import_react5.default.createElement("span", null, t("cancel label", {
203
+ }, /* @__PURE__ */ import_react4.default.createElement("span", null, t("cancel label", {
216
204
  ns: "os"
217
- })), /* @__PURE__ */ import_react5.default.createElement("div", {
205
+ })), /* @__PURE__ */ import_react4.default.createElement("div", {
218
206
  className: "grow"
219
- }), /* @__PURE__ */ import_react5.default.createElement(import_react4.X, {
207
+ }), /* @__PURE__ */ import_react4.default.createElement(import_react3.X, {
220
208
  className: (0, import_react_ui_theme2.getSize)(5)
221
209
  })))));
222
210
  };
223
- var StatusBarPanel = () => {
224
- const [open, setOpen] = (0, import_react3.useState)(false);
225
- return /* @__PURE__ */ import_react3.default.createElement(import_react_ui.Popover.Root, {
211
+ var repo = "https://github.com/dxos/dxos";
212
+ var VERSION_REGEX = /([\d.]+)/;
213
+ var VersionNumber = () => {
214
+ const config = (0, import_react_client.useConfig)();
215
+ const { t } = (0, import_react_ui3.useTranslation)(STATUS_BAR_PLUGIN);
216
+ const { version, timestamp, commitHash } = config.values.runtime?.app?.build ?? {};
217
+ const [_, v] = version?.match(VERSION_REGEX) ?? [];
218
+ const releaseUrl = config.values.runtime?.app?.env?.DX_ENVIRONMENT === "production" ? `${repo}/releases/tag/v${version}` : `${repo}/commit/${commitHash}`;
219
+ const previewUrl = "https://docs.dxos.org/composer#technology-preview";
220
+ return /* @__PURE__ */ import_react5.default.createElement(import_react_ui3.Popover.Root, null, /* @__PURE__ */ import_react5.default.createElement(import_react_ui3.Popover.Trigger, {
221
+ asChild: true
222
+ }, /* @__PURE__ */ import_react5.default.createElement(StatusBar.Button, {
223
+ classNames: "text-xs"
224
+ }, "v", v)), /* @__PURE__ */ import_react5.default.createElement(import_react_ui3.Popover.Portal, null, /* @__PURE__ */ import_react5.default.createElement(import_react_ui3.Popover.Content, {
225
+ side: "top",
226
+ role: "message",
227
+ classNames: "z-[12] bg-warning-500 max-is-[min(calc(100vw-16px),40ch)]"
228
+ }, /* @__PURE__ */ import_react5.default.createElement(import_react_ui3.Message.Root, {
229
+ valence: "warning",
230
+ className: "rounded-be-none p-5"
231
+ }, /* @__PURE__ */ import_react5.default.createElement(import_react_ui3.Message.Title, null, /* @__PURE__ */ import_react5.default.createElement(import_react_ui3.Icon, {
232
+ icon: "ph--warning--duotone",
233
+ size: 6,
234
+ classNames: "inline mie-2"
235
+ }), /* @__PURE__ */ import_react5.default.createElement("span", null, t("warning title"))), /* @__PURE__ */ import_react5.default.createElement(import_react_ui3.Message.Body, null, t("technology preview message"), /* @__PURE__ */ import_react5.default.createElement("br", null), /* @__PURE__ */ import_react5.default.createElement(import_react_ui3.Link, {
236
+ href: previewUrl,
237
+ target: "_blank",
238
+ rel: "noreferrer",
239
+ variant: "neutral"
240
+ }, t("learn more label"), /* @__PURE__ */ import_react5.default.createElement(import_react_ui3.Icon, {
241
+ icon: "ph--arrow-square-out--bold",
242
+ classNames: "inline mis-1"
243
+ })))), /* @__PURE__ */ import_react5.default.createElement("div", {
244
+ role: "none",
245
+ className: "plb-4 pli-5 space-b-2 text-baseText"
246
+ }, timestamp && /* @__PURE__ */ import_react5.default.createElement("p", null, t("released message", {
247
+ released: (0, import_formatDistance.formatDistance)(new Date(timestamp), /* @__PURE__ */ new Date(), {
248
+ addSuffix: true
249
+ })
250
+ }), /* @__PURE__ */ import_react5.default.createElement("br", null), /* @__PURE__ */ import_react5.default.createElement(import_react_ui3.Link, {
251
+ href: releaseUrl,
252
+ target: "_blank",
253
+ rel: "noreferrer",
254
+ variant: "neutral"
255
+ }, t("see release label"), /* @__PURE__ */ import_react5.default.createElement(import_react_ui3.Icon, {
256
+ icon: "ph--arrow-square-out--bold",
257
+ classNames: "inline mis-1"
258
+ }))), /* @__PURE__ */ import_react5.default.createElement("p", null, /* @__PURE__ */ import_react5.default.createElement(import_react_ui3.Trans, {
259
+ t,
260
+ i18nKey: "powered by dxos message",
261
+ components: {
262
+ dxos: /* @__PURE__ */ import_react5.default.createElement(import_react_ui3.Link, {
263
+ href: "https://dxos.org",
264
+ target: "_blank",
265
+ rel: "noreferrer",
266
+ variant: "neutral"
267
+ })
268
+ }
269
+ }))), /* @__PURE__ */ import_react5.default.createElement(import_react_ui3.Popover.Arrow, null))));
270
+ };
271
+ var StatusBarActions = () => {
272
+ const { t } = (0, import_react_ui.useTranslation)(STATUS_BAR_PLUGIN);
273
+ const [open, setOpen] = (0, import_react2.useState)(false);
274
+ return /* @__PURE__ */ import_react2.default.createElement(import_react_ui.Popover.Root, {
226
275
  open,
227
276
  onOpenChange: setOpen
228
- }, /* @__PURE__ */ import_react3.default.createElement(StatusBar.Container, null, /* @__PURE__ */ import_react3.default.createElement(StatusBar.EndContent, null, /* @__PURE__ */ import_react3.default.createElement(import_app_framework.Surface, {
229
- role: "status"
230
- }), /* @__PURE__ */ import_react3.default.createElement(import_react_ui.Popover.Trigger, {
277
+ }, /* @__PURE__ */ import_react2.default.createElement(import_react_ui.Popover.Trigger, {
231
278
  asChild: true
232
- }, /* @__PURE__ */ import_react3.default.createElement(StatusBar.Button, {
233
- "aria-label": "Give feedback about composer",
279
+ }, /* @__PURE__ */ import_react2.default.createElement(StatusBar.Button, {
234
280
  "data-joyride": "welcome/feedback"
235
- }, /* @__PURE__ */ import_react3.default.createElement(import_react_ui.Icon, {
281
+ }, /* @__PURE__ */ import_react2.default.createElement(import_react_ui.Icon, {
236
282
  icon: "ph--paper-plane-tilt--regular",
237
283
  size: 4
238
- }), /* @__PURE__ */ import_react3.default.createElement(StatusBar.Text, {
284
+ }), /* @__PURE__ */ import_react2.default.createElement(StatusBar.Text, {
239
285
  classNames: "hidden sm:block"
240
- }, "Feedback"))), /* @__PURE__ */ import_react3.default.createElement(StatusBar.Button, {
241
- "aria-label": "Open DXOS Discord",
286
+ }, t("feedback label")))), /* @__PURE__ */ import_react2.default.createElement(StatusBar.Button, {
242
287
  asChild: true
243
- }, /* @__PURE__ */ import_react3.default.createElement("a", {
288
+ }, /* @__PURE__ */ import_react2.default.createElement("a", {
244
289
  href: "https://dxos.org/discord",
245
290
  target: "_blank",
246
291
  rel: "noopener noreferrer"
247
- }, /* @__PURE__ */ import_react3.default.createElement(import_react_ui.Icon, {
292
+ }, /* @__PURE__ */ import_react2.default.createElement(import_react_ui.Icon, {
248
293
  icon: "ph--discord-logo--regular",
249
294
  size: 4
250
- }), /* @__PURE__ */ import_react3.default.createElement(StatusBar.Text, {
295
+ }), /* @__PURE__ */ import_react2.default.createElement(StatusBar.Text, {
251
296
  classNames: "hidden sm:block"
252
- }, "Discord"))))), /* @__PURE__ */ import_react3.default.createElement(import_react_ui.Popover.Content, {
297
+ }, t("discord label")))), /* @__PURE__ */ import_react2.default.createElement(VersionNumber, null), /* @__PURE__ */ import_react2.default.createElement(import_react_ui.Popover.Portal, null, /* @__PURE__ */ import_react2.default.createElement(import_react_ui.Popover.Content, {
253
298
  classNames: "shadow-lg"
254
- }, /* @__PURE__ */ import_react3.default.createElement(FeedbackForm, {
299
+ }, /* @__PURE__ */ import_react2.default.createElement(FeedbackForm, {
255
300
  onClose: () => setOpen(false)
256
- }), /* @__PURE__ */ import_react3.default.createElement(import_react_ui.Popover.Arrow, null)));
301
+ }), /* @__PURE__ */ import_react2.default.createElement(import_react_ui.Popover.Arrow, null))));
257
302
  };
258
- var StatusBarPlugin = () => {
259
- return {
260
- meta: import_chunk_OGG3PMIV.meta_default,
261
- provides: {
262
- translations: translations_default,
263
- surface: {
264
- component: ({ role }) => {
265
- switch (role) {
266
- case "status-bar": {
267
- return /* @__PURE__ */ import_react.default.createElement(StatusBarPanel, null);
268
- }
269
- }
270
- return null;
271
- }
272
- }
273
- }
274
- };
303
+ var StatusBarPanel = () => {
304
+ return /* @__PURE__ */ import_react2.default.createElement(import_react2.default.Fragment, null, /* @__PURE__ */ import_react2.default.createElement(StatusBarActions, null), /* @__PURE__ */ import_react2.default.createElement("span", {
305
+ role: "separator",
306
+ className: "grow"
307
+ }), /* @__PURE__ */ import_react2.default.createElement(import_app_framework.Surface, {
308
+ role: "status"
309
+ }));
275
310
  };
276
- var src_default = StatusBarPlugin;
311
+ var StatusBarPlugin = () => (0, import_app_framework3.definePlugin)(meta, [
312
+ (0, import_app_framework3.defineModule)({
313
+ id: `${meta.id}/module/translations`,
314
+ activatesOn: import_app_framework3.Events.SetupTranslations,
315
+ activate: () => (0, import_app_framework3.contributes)(import_app_framework3.Capabilities.Translations, translations_default)
316
+ }),
317
+ (0, import_app_framework3.defineModule)({
318
+ id: `${meta.id}/module/react-surface`,
319
+ activatesOn: import_app_framework3.Events.SetupSurfaces,
320
+ activate: () => (0, import_app_framework3.contributes)(import_app_framework3.Capabilities.ReactSurface, [
321
+ (0, import_app_framework3.createSurface)({
322
+ id: meta.id,
323
+ role: "status-bar",
324
+ component: () => /* @__PURE__ */ import_react6.default.createElement(StatusBarPanel, null)
325
+ }),
326
+ (0, import_app_framework3.createSurface)({
327
+ id: meta.id,
328
+ role: "status-bar--r0-footer",
329
+ component: () => /* @__PURE__ */ import_react6.default.createElement(import_app_framework3.Surface, {
330
+ role: "status"
331
+ })
332
+ }),
333
+ (0, import_app_framework3.createSurface)({
334
+ id: meta.id,
335
+ role: "status-bar--r1-footer",
336
+ component: () => /* @__PURE__ */ import_react6.default.createElement(StatusBarActions, null)
337
+ }),
338
+ (0, import_app_framework3.createSurface)({
339
+ id: `${STATUS_BAR_PLUGIN}/header-end`,
340
+ role: "header-end",
341
+ component: () => /* @__PURE__ */ import_react6.default.createElement(VersionNumber, null)
342
+ })
343
+ ])
344
+ })
345
+ ]);
277
346
  // Annotate the CommonJS export names for ESM import in node:
278
347
  0 && (module.exports = {
348
+ STATUS_BAR_PLUGIN,
279
349
  StatusBar,
350
+ StatusBarActions,
280
351
  StatusBarPanel,
281
- StatusBarPlugin
352
+ StatusBarPlugin,
353
+ meta
282
354
  });
283
355
  //# sourceMappingURL=index.cjs.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../src/StatusBarPlugin.tsx", "../../../src/components/StatusBar.tsx", "../../../src/components/StatusBarPanel.tsx", "../../../src/components/FeedbackForm.tsx", "../../../src/translations.ts", "../../../src/index.ts"],
4
- "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport React from 'react';\n\nimport { type PluginDefinition, type SurfaceProvides, type TranslationsProvides } from '@dxos/app-framework';\n\nimport { StatusBarPanel } from './components';\nimport meta from './meta';\nimport translations from './translations';\n\nexport type StatusBarPluginProvides = SurfaceProvides & TranslationsProvides;\n\nexport const StatusBarPlugin = (): PluginDefinition<StatusBarPluginProvides> => {\n return {\n meta,\n provides: {\n translations,\n surface: {\n component: ({ role }) => {\n switch (role) {\n case 'status-bar': {\n return <StatusBarPanel />;\n }\n }\n\n return null;\n },\n },\n },\n };\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { useFocusableGroup } from '@fluentui/react-tabster';\nimport { Slot } from '@radix-ui/react-slot';\nimport React, { forwardRef, type HTMLAttributes, 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<{ children: ReactNode; asChild?: boolean }> &\n HTMLAttributes<HTMLButtonElement>;\n\nconst StatusBarButton = forwardRef<HTMLButtonElement, StatusBarButtonProps>(\n ({ classNames, children, asChild, ...props }, forwardedRef) => {\n const classes = mx(\n 'flex items-center gap-2 p-1 px-2 rounded-sm',\n 'select-none cursor-pointer ch-focus-ring',\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<{ children: ReactNode }> & HTMLAttributes<HTMLDivElement>;\n\nconst StatusBarItem = forwardRef<HTMLDivElement, StatusBarItemProps>(\n ({ classNames, children, ...props }, forwardedRef) => (\n <div\n role='menuitem'\n className={mx('flex items-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 StatusBarContainerProps = ThemedClassName<{ children: ReactNode }>;\n\n// TODO(zan): tabable group with tabster.\nconst StatusBarContainer = forwardRef<HTMLDivElement, StatusBarContainerProps>(\n ({ classNames, children }, forwardedRef) => {\n const groupAttrs = useFocusableGroup({ tabBehavior: 'limited' });\n return (\n <div\n role='menubar'\n tabIndex={0}\n {...groupAttrs}\n className={mx(\n 'bs-[--statusbar-size] flex justify-end items-center gap-2 bg-base text-description text-lg pointer-fine:text-xs ch-focus-ring-inset',\n classNames,\n )}\n ref={forwardedRef}\n >\n {children}\n </div>\n );\n },\n);\n\ntype StartContentProps = ThemedClassName<{ children: ReactNode }>;\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<{ children: ReactNode }>;\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 Container: StatusBarContainer,\n Text: StatusBarText,\n Item: StatusBarItem,\n Button: StatusBarButton,\n StartContent,\n EndContent,\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { useState } from 'react';\n\nimport { Surface } from '@dxos/app-framework';\nimport { Icon, Popover } from '@dxos/react-ui';\n\nimport { FeedbackForm } from './FeedbackForm';\nimport { StatusBar } from './StatusBar';\n\nexport const StatusBarPanel = () => {\n const [open, setOpen] = useState(false);\n\n // TODO(wittjosiah): Factor out feedback and discord buttons.\n return (\n <Popover.Root open={open} onOpenChange={setOpen}>\n <StatusBar.Container>\n <StatusBar.EndContent>\n <Surface role='status' />\n <Popover.Trigger asChild>\n <StatusBar.Button aria-label='Give feedback about composer' data-joyride='welcome/feedback'>\n <Icon icon='ph--paper-plane-tilt--regular' size={4} />\n <StatusBar.Text classNames='hidden sm:block'>Feedback</StatusBar.Text>\n </StatusBar.Button>\n </Popover.Trigger>\n {/* TODO(zan): Configure this label? */}\n <StatusBar.Button aria-label='Open DXOS Discord' 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'>Discord</StatusBar.Text>\n </a>\n </StatusBar.Button>\n </StatusBar.EndContent>\n </StatusBar.Container>\n <Popover.Content classNames='shadow-lg'>\n <FeedbackForm onClose={() => setOpen(false)} />\n <Popover.Arrow />\n </Popover.Content>\n </Popover.Root>\n );\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { Schema as S } from '@effect/schema';\nimport { PaperPlaneTilt, X } from '@phosphor-icons/react';\nimport React, { useCallback } from 'react';\n\nimport { useIntentDispatcher } from '@dxos/app-framework';\nimport { Button, Input, Popover, useTranslation } from '@dxos/react-ui';\nimport { useForm } from '@dxos/react-ui-form';\nimport { getSize } from '@dxos/react-ui-theme';\n\nimport { STATUS_BAR_PLUGIN } from '../meta';\nimport { mkTranslation } from '../translations';\n\nconst Email = S.String.pipe(\n S.nonEmptyString({ message: () => 'Email is required.' }),\n S.pattern(/^(?!\\.)(?!.*\\.\\.)([A-Z0-9_+-.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9-]*\\.)+[A-Z]{2,}$/i, {\n message: () => 'Invalid email address.',\n }),\n);\n\nconst nonEmpty = (field: string) => S.nonEmptyString({ message: () => `${field} is required.` });\nconst maxLength = (field: string, length: number) => S.maxLength(length, { message: () => `${field} is too long.` });\n\n// Types and validation.\nconst FeedbackFormSchema = S.Struct({\n name: S.String.pipe(nonEmpty('Name'), maxLength('Name', 256)),\n email: Email.pipe(maxLength('Email', 256)),\n message: S.String.pipe(nonEmpty('Feedback'), maxLength('Feedback', 32_768)),\n});\n\ntype FeedbackFormType = S.Schema.Type<typeof FeedbackFormSchema>;\n\nconst initialValues: FeedbackFormType = { name: '', email: '', message: '' };\n\nexport const FeedbackForm = ({ onClose }: { onClose: () => void }) => {\n const { t } = useTranslation(STATUS_BAR_PLUGIN);\n const translation = mkTranslation(t);\n const dispatch = useIntentDispatcher();\n\n const onSave = useCallback(\n (values: FeedbackFormType) => {\n void dispatch({ action: 'dxos.org/plugin/observability/capture-feedback', data: values });\n onClose();\n },\n [dispatch, onClose],\n );\n\n const { handleSave, canSave, getStatus, ...inputProps } = useForm<FeedbackFormType>({\n initialValues,\n schema: FeedbackFormSchema,\n onSave,\n });\n\n return (\n <div role='form' className='p-3 flex flex-col gap-2'>\n <div role='none' className='space-b-1'>\n <Input.Root validationValence={getStatus('name').status}>\n <Input.Label>{translation('name label')}</Input.Label>\n <Input.TextInput\n classNames={'text-sm'}\n placeholder={translation('name placeholder')}\n autoFocus\n {...inputProps}\n />\n <Input.DescriptionAndValidation>\n <Input.Validation>{getStatus('name').error}</Input.Validation>\n </Input.DescriptionAndValidation>\n </Input.Root>\n </div>\n\n <div role='none' className='space-b-1'>\n <Input.Root validationValence={getStatus('email').status}>\n <Input.Label>{translation('email input label')}</Input.Label>\n <Input.TextInput\n classNames={'text-sm'}\n placeholder={translation('email input placeholder')}\n {...inputProps}\n />\n <Input.DescriptionAndValidation>\n <Input.Validation>{getStatus('email').error}</Input.Validation>\n </Input.DescriptionAndValidation>\n </Input.Root>\n </div>\n\n <div role='none' className='space-b-1'>\n <Input.Root validationValence={getStatus('message').status}>\n <Input.Label>{translation('feedback text area label')}</Input.Label>\n <Input.TextArea\n classNames={'text-sm'}\n rows={5}\n cols={30}\n placeholder={translation('feedback text area placeholder')}\n {...inputProps}\n />\n <Input.DescriptionAndValidation>\n <Input.Validation>{getStatus('message').error}</Input.Validation>\n </Input.DescriptionAndValidation>\n </Input.Root>\n </div>\n\n <div role='none' className='space-b-2'>\n <Button\n type='submit'\n variant='primary'\n classNames='is-full flex gap-2'\n disabled={!canSave}\n onClick={handleSave}\n >\n <span>{translation('send feedback label')}</span>\n <div className='grow' />\n <PaperPlaneTilt className={getSize(5)} />\n </Button>\n <Popover.Close asChild>\n <Button classNames='is-full flex gap-2'>\n <span>{t('cancel label', { ns: 'os' })}</span>\n <div className='grow' />\n <X className={getSize(5)} />\n </Button>\n </Popover.Close>\n </div>\n </div>\n );\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type useTranslation } from '@dxos/react-ui';\n\nimport { STATUS_BAR_PLUGIN } from './meta';\n\ntype StatusBarTranslationKeys =\n | 'plugin name'\n | 'email input label'\n | 'email input placeholder'\n | 'feedback text area label'\n | 'feedback text area placeholder'\n | 'send feedback label'\n | 'name label'\n | 'name placeholder';\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 'name label': 'Name',\n 'name placeholder': 'Preferred name',\n 'email input label': 'Email',\n 'email input placeholder': 'hello@example.com',\n 'feedback text area label': 'Feedback',\n 'feedback text area placeholder': 'Found a bug? Have a suggestion? Let us know!',\n 'send feedback label': 'Send Feedback',\n }),\n};\n\nexport default [translations];\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { StatusBarPlugin } from './StatusBarPlugin';\n\nexport default StatusBarPlugin;\n\nexport * from './StatusBarPlugin';\nexport * from './components';\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,mBAAkB;ACAlB,2BAAkC;AAClC,wBAAqB;AACrB,IAAAA,gBAAuE;AAGvE,4BAAmB;ACLnB,IAAAA,gBAAgC;AAEhC,2BAAwB;AACxB,sBAA8B;ACH9B,oBAA4B;AAC5B,IAAAA,gBAAkC;AAClC,IAAAA,gBAAmC;AAEnC,IAAAC,wBAAoC;AACpC,IAA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AQoB,SAAO;IAAC5G,YAAW;KAC1BG,8BAAAA,QAAA,cAACiD,cAAAA;IAAaC,SAAS,MAAMyC,QAAQ,KAAA;MACrC3F,8BAAAA,QAAA,cAACqF,gBAAAA,QAAQqB,OAAK,IAAA,CAAA,CAAA;AAItB;AF5BO,IAAMC,kBAAkB,MAAA;AAC7B,SAAO;IACLC,MAAAA;IACAC,UAAU;MACR7E,cAAAA;MACA8E,SAAS;QACPC,WAAW,CAAC,EAAErG,KAAI,MAAE;AAClB,kBAAQA,MAAAA;YACN,KAAK,cAAc;AACjB,qBAAOV,6BAAAA,QAAA,cAACyF,gBAAAA,IAAAA;YACV;UACF;AAEA,iBAAO;QACT;MACF;IACF;EACF;AACF;AK1BA,IAAA,cAAekB;",
6
- "names": ["import_react", "import_app_framework", "import_react_ui", "import_react_ui_theme", "StatusBarText", "forwardRef", "classNames", "children", "forwardedRef", "React", "span", "className", "mx", "ref", "StatusBarButton", "asChild", "props", "classes", "Slot", "role", "button", "StatusBarItem", "div", "StatusBarContainer", "groupAttrs", "useFocusableGroup", "tabBehavior", "tabIndex", "StartContent", "EndContent", "StatusBar", "Container", "Text", "Item", "Button", "entry", "translation", "STATUS_BAR_PLUGIN", "mkTranslation", "t", "key", "translations", "Email", "S", "String", "pipe", "nonEmptyString", "message", "pattern", "nonEmpty", "field", "maxLength", "length", "FeedbackFormSchema", "Struct", "name", "email", "initialValues", "FeedbackForm", "onClose", "useTranslation", "dispatch", "useIntentDispatcher", "onSave", "useCallback", "values", "action", "data", "handleSave", "canSave", "getStatus", "inputProps", "useForm", "schema", "Input", "Root", "validationValence", "status", "Label", "TextInput", "placeholder", "autoFocus", "DescriptionAndValidation", "Validation", "error", "TextArea", "rows", "cols", "type", "variant", "disabled", "onClick", "PaperPlaneTilt", "getSize", "Popover", "Close", "ns", "X", "StatusBarPanel", "open", "setOpen", "useState", "onOpenChange", "Surface", "Trigger", "aria-label", "data-joyride", "Icon", "icon", "size", "a", "href", "target", "rel", "Content", "Arrow", "StatusBarPlugin", "meta", "provides", "surface", "component"]
3
+ "sources": ["../../../src/components/StatusBar.tsx", "../../../src/components/StatusBarPanel.tsx", "../../../src/components/FeedbackForm.tsx", "../../../src/meta.ts", "../../../src/translations.ts", "../../../src/components/VersionNumber.tsx", "../../../src/StatusBarPlugin.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 React, { useState } from 'react';\n\nimport { Surface } from '@dxos/app-framework';\nimport { Icon, Popover, useTranslation } from '@dxos/react-ui';\n\nimport { FeedbackForm } from './FeedbackForm';\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 return (\n <Popover.Root open={open} onOpenChange={setOpen}>\n <Popover.Trigger asChild>\n <StatusBar.Button data-joyride='welcome/feedback'>\n <Icon icon='ph--paper-plane-tilt--regular' size={4} />\n <StatusBar.Text classNames='hidden sm:block'>{t('feedback label')}</StatusBar.Text>\n </StatusBar.Button>\n </Popover.Trigger>\n {/* TODO(zan): Configure this label? */}\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 <VersionNumber />\n <Popover.Portal>\n <Popover.Content classNames='shadow-lg'>\n <FeedbackForm onClose={() => setOpen(false)} />\n <Popover.Arrow />\n </Popover.Content>\n </Popover.Portal>\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", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { PaperPlaneTilt, X } from '@phosphor-icons/react';\nimport React, { useCallback } from 'react';\n\nimport { createIntent, useIntentDispatcher } from '@dxos/app-framework';\nimport { ObservabilityAction, UserFeedback } from '@dxos/plugin-observability/types';\nimport { Button, Input, Popover, useTranslation } from '@dxos/react-ui';\nimport { useForm } from '@dxos/react-ui-form';\nimport { getSize } from '@dxos/react-ui-theme';\n\nimport { STATUS_BAR_PLUGIN } from '../meta';\nimport { mkTranslation } from '../translations';\n\nconst initialValues: UserFeedback = { name: '', email: '', message: '' };\n\nexport const FeedbackForm = ({ onClose }: { onClose: () => void }) => {\n const { t } = useTranslation(STATUS_BAR_PLUGIN);\n const translation = mkTranslation(t);\n const { dispatchPromise: dispatch } = useIntentDispatcher();\n\n const onSave = useCallback(\n (values: UserFeedback) => {\n void dispatch(createIntent(ObservabilityAction.CaptureUserFeedback, values));\n onClose();\n },\n [dispatch, onClose],\n );\n\n const { handleSave, canSave, getStatus, ...inputProps } = useForm<UserFeedback>({\n initialValues,\n schema: UserFeedback,\n onSave,\n });\n\n return (\n <div role='form' className='p-3 flex flex-col gap-2'>\n <div role='none' className='space-b-1'>\n <Input.Root validationValence={getStatus('name').status}>\n <Input.Label>{translation('name label')}</Input.Label>\n <Input.TextInput\n classNames={'text-sm'}\n placeholder={translation('name placeholder')}\n autoFocus\n {...inputProps}\n />\n <Input.DescriptionAndValidation>\n <Input.Validation>{getStatus('name').error}</Input.Validation>\n </Input.DescriptionAndValidation>\n </Input.Root>\n </div>\n\n <div role='none' className='space-b-1'>\n <Input.Root validationValence={getStatus('email').status}>\n <Input.Label>{translation('email input label')}</Input.Label>\n <Input.TextInput\n classNames={'text-sm'}\n placeholder={translation('email input placeholder')}\n {...inputProps}\n />\n <Input.DescriptionAndValidation>\n <Input.Validation>{getStatus('email').error}</Input.Validation>\n </Input.DescriptionAndValidation>\n </Input.Root>\n </div>\n\n <div role='none' className='space-b-1'>\n <Input.Root validationValence={getStatus('message').status}>\n <Input.Label>{translation('feedback text area label')}</Input.Label>\n <Input.TextArea\n classNames={'text-sm'}\n rows={5}\n cols={30}\n placeholder={translation('feedback text area placeholder')}\n {...inputProps}\n />\n <Input.DescriptionAndValidation>\n <Input.Validation>{getStatus('message').error}</Input.Validation>\n </Input.DescriptionAndValidation>\n </Input.Root>\n </div>\n\n <div role='none' className='space-b-2'>\n <Button\n type='submit'\n variant='primary'\n classNames='is-full flex gap-2'\n disabled={!canSave}\n onClick={handleSave}\n >\n <span>{translation('send feedback label')}</span>\n <div className='grow' />\n <PaperPlaneTilt className={getSize(5)} />\n </Button>\n <Popover.Close asChild>\n <Button classNames='is-full flex gap-2'>\n <span>{t('cancel label', { ns: 'os' })}</span>\n <div className='grow' />\n <X className={getSize(5)} />\n </Button>\n </Popover.Close>\n </div>\n </div>\n );\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 = {\n id: STATUS_BAR_PLUGIN,\n name: 'Status Bar',\n description: 'Display a bar with status and actions.',\n icon: 'ph--info--regular',\n} satisfies PluginMeta;\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type useTranslation } from '@dxos/react-ui';\n\nimport { STATUS_BAR_PLUGIN } from './meta';\n\ntype StatusBarTranslationKeys =\n | 'plugin name'\n | 'email input label'\n | 'email input placeholder'\n | 'feedback text area label'\n | 'feedback text area placeholder'\n | 'send feedback label'\n | 'name label'\n | 'name placeholder'\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 | '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 'name label': 'Name',\n 'name placeholder': 'Preferred name',\n 'email input label': 'Email',\n 'email input placeholder': 'hello@example.com',\n 'feedback text area label': 'Feedback',\n 'feedback text area placeholder': 'Please describe your issue or suggestion.',\n 'send feedback label': 'Send Feedback',\n 'warning title': 'WARNING',\n 'technology preview message': 'Composer is still in technology preview.',\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 'feedback label': 'Feedback',\n }),\n};\n\nexport default [translations];\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 config = useConfig();\n const { t } = useTranslation(STATUS_BAR_PLUGIN);\n const { version, timestamp, commitHash } = config.values.runtime?.app?.build ?? {};\n const [_, v] = version?.match(VERSION_REGEX) ?? [];\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'>v{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' className='rounded-be-none p-5'>\n <Message.Title>\n <Icon icon='ph--warning--duotone' size={6} classNames='inline mie-2' />\n <span>{t('warning title')}</span>\n </Message.Title>\n <Message.Body>\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.Body>\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 from 'react';\n\nimport {\n Capabilities,\n contributes,\n createSurface,\n defineModule,\n definePlugin,\n Events,\n Surface,\n} from '@dxos/app-framework';\n\nimport { StatusBarActions, StatusBarPanel } from './components';\nimport { VersionNumber } from './components/VersionNumber';\nimport { meta, STATUS_BAR_PLUGIN } 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.SetupSurfaces,\n activate: () =>\n contributes(Capabilities.ReactSurface, [\n createSurface({\n id: meta.id,\n role: 'status-bar',\n component: () => <StatusBarPanel />,\n }),\n createSurface({\n id: meta.id,\n role: 'status-bar--r0-footer',\n component: () => <Surface role='status' />,\n }),\n createSurface({\n id: meta.id,\n role: 'status-bar--r1-footer',\n component: () => <StatusBarActions />,\n }),\n createSurface({\n id: `${STATUS_BAR_PLUGIN}/header-end`,\n role: 'header-end',\n component: () => <VersionNumber />,\n }),\n ]),\n }),\n ]);\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,wBAAqB;AACrB,mBAAsG;AAGtG,4BAAmB;ACJnB,IAAAA,gBAAgC;AAEhC,2BAAwB;AACxB,sBAA8C;ACH9C,IAAAA,gBAAkC;AAClC,IAAAA,gBAAmC;AAEnC,IAAAC,wBAAkD;AAClD,mBAAkD;AAClD,IAAAC,mBAAuD;AACvD,2BAAwB;AACxB,IAAAC,yBAAwB;AGPxB,4BAA+B;AAC/B,IAAAH,gBAAkB;AAElB,0BAA0B;AAC1B,IAAAE,mBAAoE;ACJpE,IAAAF,gBAAkB;AAElB,IAAAC,wBAQO;ANFP,IAAMG,gBAAgBC,6CAAgD,CAAC,EAAEC,YAAYC,SAAQ,GAAIC,iBAC/F,6BAAAC,QAAA,cAACC,QAAAA;EAAKC,eAAWC,0BAAGN,UAAAA;EAAaO,KAAKL;GACnCD,QAAAA,CAAAA;AAML,IAAMO,kBAAkBT,6CACtB,CAAC,EAAEC,YAAYC,UAAUQ,SAAS,GAAGC,MAAAA,GAASR,iBAAAA;AAC5C,QAAMS,cAAUL,0BACd,8DACA,qEACA,kGACAN,UAAAA;AAGF,SAAOS,UACL,6BAAAN,QAAA,cAACS,wBAAAA;IAAKC,MAAK;IAASN,KAAKL;IAAcG,WAAWM;IAAU,GAAGD;KAC5DT,QAAAA,IAGH,6BAAAE,QAAA,cAACW,U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AA,UAAA,MACEA,8BAAAA,QAAA,cAACyH,kBAAAA,IAAAA,GACDzH,8BAAAA,QAAA,cAACC,QAAAA;IAAKS,MAAK;IAAYR,WAAU;MACjCF,8BAAAA,QAAA,cAACiI,8BAAAA;IAAQvH,MAAK;;AAGpB;AK9BO,IAAMwH,kBAAkB,UAC7BC,oCAAa9G,MAAM;MACjB+G,oCAAa;IACX9G,IAAI,GAAGD,KAAKC,EAAE;IACd+G,aAAaC,6BAAOC;IACpBC,UAAU,UAAMC,mCAAYC,mCAAaC,cAAc5G,oBAAAA;EACzD,CAAA;MACAqG,oCAAa;IACX9G,IAAI,GAAGD,KAAKC,EAAE;IACd+G,aAAaC,6BAAOM;IACpBJ,UAAU,UACRC,mCAAYC,mCAAaG,cAAc;UACrCC,qCAAc;QACZxH,IAAID,KAAKC;QACTZ,MAAM;QACNqI,WAAW,MAAM/I,8BAAAA,QAAA,cAACgI,gBAAAA,IAAAA;MACpB,CAAA;UACAc,qCAAc;QACZxH,IAAID,KAAKC;QACTZ,MAAM;QACNqI,WAAW,MAAM/I,8BAAAA,QAAA,cAACiI,sBAAAA,SAAAA;UAAQvH,MAAK;;MACjC,CAAA;UACAoI,qCAAc;QACZxH,IAAID,KAAKC;QACTZ,MAAM;QACNqI,WAAW,MAAM/I,8BAAAA,QAAA,cAACyH,kBAAAA,IAAAA;MACpB,CAAA;UACAqB,qCAAc;QACZxH,IAAI,GAAGF,iBAAAA;QACPV,MAAM;QACNqI,WAAW,MAAM/I,8BAAAA,QAAA,cAACgF,eAAAA,IAAAA;MACpB,CAAA;KACD;EACL,CAAA;CACD;",
6
+ "names": ["import_react", "import_app_framework", "import_react_ui", "import_react_ui_theme", "StatusBarText", "forwardRef", "classNames", "children", "forwardedRef", "React", "span", "className", "mx", "ref", "StatusBarButton", "asChild", "props", "classes", "Slot", "role", "button", "StatusBarItem", "div", "StartContent", "EndContent", "StatusBar", "Text", "Item", "Button", "STATUS_BAR_PLUGIN", "meta", "id", "name", "description", "icon", "entry", "translation", "mkTranslation", "t", "key", "translations", "initialValues", "email", "message", "FeedbackForm", "onClose", "useTranslation", "dispatchPromise", "dispatch", "useIntentDispatcher", "onSave", "useCallback", "values", "createIntent", "ObservabilityAction", "CaptureUserFeedback", "handleSave", "canSave", "getStatus", "inputProps", "useForm", "schema", "UserFeedback", "Input", "Root", "validationValence", "status", "Label", "TextInput", "placeholder", "autoFocus", "DescriptionAndValidation", "Validation", "error", "TextArea", "rows", "cols", "type", "variant", "disabled", "onClick", "PaperPlaneTilt", "getSize", "Popover", "Close", "ns", "X", "repo", "VERSION_REGEX", "VersionNumber", "config", "useConfig", "version", "timestamp", "commitHash", "runtime", "app", "build", "_", "v", "match", "releaseUrl", "env", "DX_ENVIRONMENT", "previewUrl", "Trigger", "Portal", "Content", "side", "Message", "valence", "Title", "Icon", "size", "Body", "br", "Link", "href", "target", "rel", "p", "released", "formatDistance", "Date", "addSuffix", "Trans", "i18nKey", "components", "dxos", "Arrow", "StatusBarActions", "open", "setOpen", "useState", "onOpenChange", "data-joyride", "a", "StatusBarPanel", "Surface", "StatusBarPlugin", "definePlugin", "defineModule", "activatesOn", "Events", "SetupTranslations", "activate", "contributes", "Capabilities", "Translations", "SetupSurfaces", "ReactSurface", "createSurface", "component"]
7
7
  }