@dxos/shell 0.7.5-main.9d2a38b → 0.7.5-main.e9bb01b
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundle/shell.mjs +11739 -12837
- package/dist/bundle/shell.mjs.map +1 -1
- package/dist/bundle/shell.umd.js +128 -126
- package/dist/bundle/shell.umd.js.map +1 -1
- package/dist/bundle/style.css +1 -1
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/react.mjs +517 -781
- package/dist/lib/browser/react.mjs.map +4 -4
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/react.cjs +614 -878
- package/dist/lib/node/react.cjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/react.mjs +517 -781
- package/dist/lib/node-esm/react.mjs.map +4 -4
- package/dist/types/src/components/AgentConfig.js +1 -1
- package/dist/types/src/components/AgentConfig.js.map +1 -1
- package/dist/types/src/components/DeviceList/DeviceList.js +1 -1
- package/dist/types/src/components/DeviceList/DeviceList.js.map +1 -1
- package/dist/types/src/components/index.d.ts +0 -2
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/components/index.js +0 -2
- package/dist/types/src/components/index.js.map +1 -1
- package/dist/types/src/panels/IdentityPanel/IdentityPanel.d.ts.map +1 -1
- package/dist/types/src/panels/IdentityPanel/IdentityPanel.js +3 -2
- package/dist/types/src/panels/IdentityPanel/IdentityPanel.js.map +1 -1
- package/dist/types/src/panels/IdentityPanel/steps/ProfileForm.d.ts.map +1 -1
- package/dist/types/src/panels/IdentityPanel/steps/ProfileForm.js +3 -2
- package/dist/types/src/panels/IdentityPanel/steps/ProfileForm.js.map +1 -1
- package/package.json +31 -30
- package/src/components/AgentConfig.tsx +1 -1
- package/src/components/DeviceList/DeviceList.tsx +1 -1
- package/src/components/index.ts +0 -2
- package/src/panels/IdentityPanel/IdentityPanel.tsx +2 -1
- package/src/panels/IdentityPanel/steps/ProfileForm.tsx +2 -1
- package/dist/lib/browser/react.css +0 -7
- package/dist/lib/browser/react.css.map +0 -7
- package/dist/lib/node/react.css +0 -7
- package/dist/lib/node/react.css.map +0 -7
- package/dist/lib/node-esm/react.css +0 -7
- package/dist/lib/node-esm/react.css.map +0 -7
- package/dist/types/src/components/EmojiPicker.d.ts +0 -19
- package/dist/types/src/components/EmojiPicker.d.ts.map +0 -1
- package/dist/types/src/components/EmojiPicker.js +0 -146
- package/dist/types/src/components/EmojiPicker.js.map +0 -1
- package/dist/types/src/components/HuePicker.d.ts +0 -18
- package/dist/types/src/components/HuePicker.d.ts.map +0 -1
- package/dist/types/src/components/HuePicker.js +0 -133
- package/dist/types/src/components/HuePicker.js.map +0 -1
- package/src/components/EmojiPicker.tsx +0 -187
- package/src/components/HuePicker.tsx +0 -182
- package/src/components/emoji.css +0 -25
|
@@ -56,7 +56,7 @@ var AgentConfig = ({ agentStatus, validationMessage, onAgentDestroy, onAgentCrea
|
|
|
56
56
|
className: mx(descriptionText, "mlb-2")
|
|
57
57
|
}, t("agent requested description"))) : /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Button, {
|
|
58
58
|
variant: "ghost",
|
|
59
|
-
classNames: "mlb-2 is-full justify-start gap-2
|
|
59
|
+
classNames: "mlb-2 is-full justify-start gap-2 pis-0 pie-3",
|
|
60
60
|
"data-testid": agentStatus === "creatable" ? "devices-panel.create-agent" : "devices-panel.agent-error",
|
|
61
61
|
onClick: agentStatus === "creatable" ? onAgentCreate : onAgentRefresh,
|
|
62
62
|
"aria-describedby": "devices-panel.create-agent.description"
|
|
@@ -136,351 +136,89 @@ var CompoundButton = ({ children, description, before, after, variant = "default
|
|
|
136
136
|
}, after));
|
|
137
137
|
};
|
|
138
138
|
|
|
139
|
-
// packages/sdk/shell/src/components/EmojiPicker.tsx
|
|
140
|
-
import emojiData from "@emoji-mart/data";
|
|
141
|
-
import EmojiMart from "@emoji-mart/react";
|
|
142
|
-
import { ArrowCounterClockwise, CaretDown, UserCircle } from "@phosphor-icons/react";
|
|
143
|
-
import { useControllableState } from "@radix-ui/react-use-controllable-state";
|
|
144
|
-
import React3, { useRef, useState } from "react";
|
|
145
|
-
import { Button as Button2, Popover, Toolbar, Tooltip as Tooltip2, useMediaQuery, useThemeContext as useThemeContext2, useTranslation as useTranslation2 } from "@dxos/react-ui";
|
|
146
|
-
import { getSize as getSize2 } from "@dxos/react-ui-theme";
|
|
147
|
-
var EmojiPickerToolbarButton = ({ disabled, defaultEmoji, emoji, onChangeEmoji, classNames }) => {
|
|
148
|
-
const { t } = useTranslation2("os");
|
|
149
|
-
const { themeMode } = useThemeContext2();
|
|
150
|
-
const [_emojiValue, setEmojiValue] = useControllableState({
|
|
151
|
-
prop: emoji,
|
|
152
|
-
onChange: onChangeEmoji,
|
|
153
|
-
defaultProp: defaultEmoji
|
|
154
|
-
});
|
|
155
|
-
const [emojiPickerOpen, setEmojiPickerOpen] = useState(false);
|
|
156
|
-
const suppressNextTooltip = useRef(false);
|
|
157
|
-
const [triggerTooltipOpen, setTriggerTooltipOpen] = useState(false);
|
|
158
|
-
return /* @__PURE__ */ React3.createElement(Tooltip2.Root, {
|
|
159
|
-
open: triggerTooltipOpen,
|
|
160
|
-
onOpenChange: (nextOpen) => {
|
|
161
|
-
if (suppressNextTooltip.current) {
|
|
162
|
-
setTriggerTooltipOpen(false);
|
|
163
|
-
suppressNextTooltip.current = false;
|
|
164
|
-
} else {
|
|
165
|
-
setTriggerTooltipOpen(nextOpen);
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
}, /* @__PURE__ */ React3.createElement(Popover.Root, {
|
|
169
|
-
open: emojiPickerOpen,
|
|
170
|
-
onOpenChange: (nextOpen) => {
|
|
171
|
-
setEmojiPickerOpen(nextOpen);
|
|
172
|
-
suppressNextTooltip.current = true;
|
|
173
|
-
}
|
|
174
|
-
}, /* @__PURE__ */ React3.createElement(Tooltip2.Trigger, {
|
|
175
|
-
asChild: true
|
|
176
|
-
}, /* @__PURE__ */ React3.createElement(Popover.Trigger, {
|
|
177
|
-
asChild: true
|
|
178
|
-
}, /* @__PURE__ */ React3.createElement(Toolbar.Button, {
|
|
179
|
-
classNames: [
|
|
180
|
-
"gap-2 text-2xl plb-1",
|
|
181
|
-
classNames
|
|
182
|
-
],
|
|
183
|
-
disabled
|
|
184
|
-
}, /* @__PURE__ */ React3.createElement("span", {
|
|
185
|
-
className: "sr-only"
|
|
186
|
-
}, t("select emoji label")), /* @__PURE__ */ React3.createElement(UserCircle, {
|
|
187
|
-
className: getSize2(5)
|
|
188
|
-
})))), /* @__PURE__ */ React3.createElement(Tooltip2.Portal, null, /* @__PURE__ */ React3.createElement(Tooltip2.Content, {
|
|
189
|
-
side: "bottom"
|
|
190
|
-
}, t("select emoji label"), /* @__PURE__ */ React3.createElement(Tooltip2.Arrow, null))), /* @__PURE__ */ React3.createElement(Popover.Content, {
|
|
191
|
-
side: "bottom",
|
|
192
|
-
onKeyDownCapture: (event) => {
|
|
193
|
-
if (event.key === "Escape") {
|
|
194
|
-
event.stopPropagation();
|
|
195
|
-
setEmojiPickerOpen(false);
|
|
196
|
-
suppressNextTooltip.current = true;
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
}, /* @__PURE__ */ React3.createElement(EmojiMart, {
|
|
200
|
-
data: emojiData,
|
|
201
|
-
onEmojiSelect: ({ native }) => {
|
|
202
|
-
if (native) {
|
|
203
|
-
setEmojiValue(native);
|
|
204
|
-
setEmojiPickerOpen(false);
|
|
205
|
-
}
|
|
206
|
-
},
|
|
207
|
-
autoFocus: true,
|
|
208
|
-
maxFrequentRows: 0,
|
|
209
|
-
noCountryFlags: true,
|
|
210
|
-
theme: themeMode
|
|
211
|
-
}), /* @__PURE__ */ React3.createElement(Popover.Arrow, null))));
|
|
212
|
-
};
|
|
213
|
-
var EmojiPickerBlock = ({ disabled, defaultEmoji, emoji, onChangeEmoji, onClickClear }) => {
|
|
214
|
-
const { t } = useTranslation2("os");
|
|
215
|
-
const [isMd] = useMediaQuery("md", {
|
|
216
|
-
ssr: false
|
|
217
|
-
});
|
|
218
|
-
const [emojiValue, setEmojiValue] = useControllableState({
|
|
219
|
-
prop: emoji,
|
|
220
|
-
onChange: onChangeEmoji,
|
|
221
|
-
defaultProp: defaultEmoji
|
|
222
|
-
});
|
|
223
|
-
const [emojiPickerOpen, setEmojiPickerOpen] = useState(false);
|
|
224
|
-
return /* @__PURE__ */ React3.createElement(React3.Fragment, null, /* @__PURE__ */ React3.createElement(Popover.Root, {
|
|
225
|
-
open: emojiPickerOpen,
|
|
226
|
-
onOpenChange: setEmojiPickerOpen
|
|
227
|
-
}, /* @__PURE__ */ React3.createElement(Popover.Trigger, {
|
|
228
|
-
asChild: true
|
|
229
|
-
}, /* @__PURE__ */ React3.createElement(Button2, {
|
|
230
|
-
variant: "ghost",
|
|
231
|
-
classNames: "gap-2 text-2xl plb-1",
|
|
232
|
-
disabled
|
|
233
|
-
}, /* @__PURE__ */ React3.createElement("span", {
|
|
234
|
-
className: "sr-only"
|
|
235
|
-
}, t("select emoji label")), /* @__PURE__ */ React3.createElement("span", {
|
|
236
|
-
className: "grow pis-14"
|
|
237
|
-
}, emojiValue), /* @__PURE__ */ React3.createElement(CaretDown, {
|
|
238
|
-
className: getSize2(4)
|
|
239
|
-
}))), /* @__PURE__ */ React3.createElement(Popover.Content, {
|
|
240
|
-
side: "right",
|
|
241
|
-
sideOffset: isMd ? 0 : -310,
|
|
242
|
-
onKeyDownCapture: (event) => {
|
|
243
|
-
if (event.key === "Escape") {
|
|
244
|
-
event.stopPropagation();
|
|
245
|
-
setEmojiPickerOpen(false);
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
}, /* @__PURE__ */ React3.createElement(EmojiMart, {
|
|
249
|
-
data: emojiData,
|
|
250
|
-
onEmojiSelect: ({ native }) => {
|
|
251
|
-
if (native) {
|
|
252
|
-
setEmojiValue(native);
|
|
253
|
-
setEmojiPickerOpen(false);
|
|
254
|
-
}
|
|
255
|
-
},
|
|
256
|
-
autoFocus: true,
|
|
257
|
-
maxFrequentRows: 0,
|
|
258
|
-
noCountryFlags: true
|
|
259
|
-
}), /* @__PURE__ */ React3.createElement(Popover.Arrow, null))), /* @__PURE__ */ React3.createElement(Tooltip2.Root, null, /* @__PURE__ */ React3.createElement(Tooltip2.Trigger, {
|
|
260
|
-
asChild: true
|
|
261
|
-
}, /* @__PURE__ */ React3.createElement(Button2, {
|
|
262
|
-
variant: "ghost",
|
|
263
|
-
onClick: onClickClear,
|
|
264
|
-
disabled
|
|
265
|
-
}, /* @__PURE__ */ React3.createElement("span", {
|
|
266
|
-
className: "sr-only"
|
|
267
|
-
}, t("clear label")), /* @__PURE__ */ React3.createElement(ArrowCounterClockwise, null))), /* @__PURE__ */ React3.createElement(Tooltip2.Portal, null, /* @__PURE__ */ React3.createElement(Tooltip2.Content, {
|
|
268
|
-
side: "right"
|
|
269
|
-
}, t("clear label"), /* @__PURE__ */ React3.createElement(Tooltip2.Arrow, null)))));
|
|
270
|
-
};
|
|
271
|
-
|
|
272
|
-
// packages/sdk/shell/src/components/HuePicker.tsx
|
|
273
|
-
import { ArrowCounterClockwise as ArrowCounterClockwise2, CaretDown as CaretDown2, Check, Palette } from "@phosphor-icons/react";
|
|
274
|
-
import { useControllableState as useControllableState2 } from "@radix-ui/react-use-controllable-state";
|
|
275
|
-
import React4, { useRef as useRef2, useState as useState2 } from "react";
|
|
276
|
-
import { Button as Button3, DropdownMenu, Toolbar as Toolbar2, Tooltip as Tooltip3, useThemeContext as useThemeContext3, useTranslation as useTranslation3 } from "@dxos/react-ui";
|
|
277
|
-
import { getSize as getSize3, hueTokenThemes, mx as mx3 } from "@dxos/react-ui-theme";
|
|
278
|
-
var HuePreview = ({ hue }) => {
|
|
279
|
-
const { tx } = useThemeContext3();
|
|
280
|
-
const size = 20;
|
|
281
|
-
return /* @__PURE__ */ React4.createElement("svg", {
|
|
282
|
-
width: size,
|
|
283
|
-
height: size,
|
|
284
|
-
viewBox: `0 0 ${size} ${size}`
|
|
285
|
-
}, /* @__PURE__ */ React4.createElement("rect", {
|
|
286
|
-
x: 0,
|
|
287
|
-
y: 0,
|
|
288
|
-
width: size,
|
|
289
|
-
height: size,
|
|
290
|
-
className: tx("hue.fill", "select--hue__preview", {
|
|
291
|
-
hue
|
|
292
|
-
})
|
|
293
|
-
}));
|
|
294
|
-
};
|
|
295
|
-
var hueTokens = Object.keys(hueTokenThemes).slice(0, 16);
|
|
296
|
-
var HuePickerToolbarButton = ({ disabled, hue, onChangeHue, classNames, defaultHue }) => {
|
|
297
|
-
const { t } = useTranslation3("os");
|
|
298
|
-
const [hueValue, setHueValue] = useControllableState2({
|
|
299
|
-
prop: hue,
|
|
300
|
-
onChange: onChangeHue,
|
|
301
|
-
defaultProp: defaultHue
|
|
302
|
-
});
|
|
303
|
-
const [huePickerOpen, setHuePickerOpen] = useState2(false);
|
|
304
|
-
const suppressNextTooltip = useRef2(false);
|
|
305
|
-
const [triggerTooltipOpen, setTriggerTooltipOpen] = useState2(false);
|
|
306
|
-
return /* @__PURE__ */ React4.createElement(Tooltip3.Root, {
|
|
307
|
-
open: triggerTooltipOpen,
|
|
308
|
-
onOpenChange: (nextOpen) => {
|
|
309
|
-
if (suppressNextTooltip.current) {
|
|
310
|
-
setTriggerTooltipOpen(false);
|
|
311
|
-
suppressNextTooltip.current = false;
|
|
312
|
-
} else {
|
|
313
|
-
setTriggerTooltipOpen(nextOpen);
|
|
314
|
-
}
|
|
315
|
-
}
|
|
316
|
-
}, /* @__PURE__ */ React4.createElement(DropdownMenu.Root, {
|
|
317
|
-
modal: false,
|
|
318
|
-
open: huePickerOpen,
|
|
319
|
-
onOpenChange: (nextOpen) => {
|
|
320
|
-
setHuePickerOpen(nextOpen);
|
|
321
|
-
suppressNextTooltip.current = true;
|
|
322
|
-
}
|
|
323
|
-
}, /* @__PURE__ */ React4.createElement(Tooltip3.Trigger, {
|
|
324
|
-
asChild: true
|
|
325
|
-
}, /* @__PURE__ */ React4.createElement(DropdownMenu.Trigger, {
|
|
326
|
-
asChild: true
|
|
327
|
-
}, /* @__PURE__ */ React4.createElement(Toolbar2.Button, {
|
|
328
|
-
classNames: mx3("gap-2 plb-1", classNames),
|
|
329
|
-
disabled
|
|
330
|
-
}, /* @__PURE__ */ React4.createElement("span", {
|
|
331
|
-
className: "sr-only"
|
|
332
|
-
}, t("select hue label")), /* @__PURE__ */ React4.createElement(Palette, {
|
|
333
|
-
className: getSize3(5)
|
|
334
|
-
})))), /* @__PURE__ */ React4.createElement(Tooltip3.Portal, null, /* @__PURE__ */ React4.createElement(Tooltip3.Content, {
|
|
335
|
-
side: "bottom"
|
|
336
|
-
}, t("select hue label"), /* @__PURE__ */ React4.createElement(Tooltip3.Arrow, null))), /* @__PURE__ */ React4.createElement(DropdownMenu.Content, {
|
|
337
|
-
side: "bottom",
|
|
338
|
-
classNames: "!w-40"
|
|
339
|
-
}, /* @__PURE__ */ React4.createElement(DropdownMenu.Viewport, {
|
|
340
|
-
classNames: "grid grid-cols-4"
|
|
341
|
-
}, hueTokens.map((hue2) => {
|
|
342
|
-
return /* @__PURE__ */ React4.createElement(DropdownMenu.CheckboxItem, {
|
|
343
|
-
key: hue2,
|
|
344
|
-
checked: hue2 === hueValue,
|
|
345
|
-
onCheckedChange: () => setHueValue(hue2),
|
|
346
|
-
classNames: "px-0 py-2 items-center justify-center"
|
|
347
|
-
}, /* @__PURE__ */ React4.createElement(HuePreview, {
|
|
348
|
-
hue: hue2
|
|
349
|
-
}));
|
|
350
|
-
})))));
|
|
351
|
-
};
|
|
352
|
-
var HuePickerBlock = ({ disabled, hue, onChangeHue, defaultHue, onClickClear }) => {
|
|
353
|
-
const { t } = useTranslation3("os");
|
|
354
|
-
const [hueValue, setHueValue] = useControllableState2({
|
|
355
|
-
prop: hue,
|
|
356
|
-
onChange: onChangeHue,
|
|
357
|
-
defaultProp: defaultHue
|
|
358
|
-
});
|
|
359
|
-
return /* @__PURE__ */ React4.createElement(React4.Fragment, null, /* @__PURE__ */ React4.createElement(DropdownMenu.Root, {
|
|
360
|
-
modal: false
|
|
361
|
-
}, /* @__PURE__ */ React4.createElement(DropdownMenu.Trigger, {
|
|
362
|
-
asChild: true
|
|
363
|
-
}, /* @__PURE__ */ React4.createElement(Button3, {
|
|
364
|
-
variant: "ghost",
|
|
365
|
-
classNames: "gap-2 plb-1",
|
|
366
|
-
disabled
|
|
367
|
-
}, /* @__PURE__ */ React4.createElement("span", {
|
|
368
|
-
className: "sr-only"
|
|
369
|
-
}, t("select hue label")), /* @__PURE__ */ React4.createElement("div", {
|
|
370
|
-
role: "none",
|
|
371
|
-
className: "pis-14 grow flex items-center justify-center gap-2"
|
|
372
|
-
}, /* @__PURE__ */ React4.createElement(HuePreview, {
|
|
373
|
-
hue: hueValue
|
|
374
|
-
}), /* @__PURE__ */ React4.createElement("span", null, t(`${hueValue} label`))), /* @__PURE__ */ React4.createElement(CaretDown2, {
|
|
375
|
-
className: getSize3(4)
|
|
376
|
-
}))), /* @__PURE__ */ React4.createElement(DropdownMenu.Content, {
|
|
377
|
-
side: "right"
|
|
378
|
-
}, /* @__PURE__ */ React4.createElement(DropdownMenu.Viewport, null, Object.keys(hueTokenThemes).map((hue2) => {
|
|
379
|
-
return /* @__PURE__ */ React4.createElement(DropdownMenu.CheckboxItem, {
|
|
380
|
-
key: hue2,
|
|
381
|
-
checked: hue2 === hueValue,
|
|
382
|
-
onCheckedChange: () => setHueValue(hue2)
|
|
383
|
-
}, /* @__PURE__ */ React4.createElement(HuePreview, {
|
|
384
|
-
hue: hue2
|
|
385
|
-
}), /* @__PURE__ */ React4.createElement("span", {
|
|
386
|
-
className: "grow"
|
|
387
|
-
}, t(`${hue2} label`)), /* @__PURE__ */ React4.createElement(DropdownMenu.ItemIndicator, null, /* @__PURE__ */ React4.createElement(Check, null)));
|
|
388
|
-
})), /* @__PURE__ */ React4.createElement(DropdownMenu.Arrow, null))), /* @__PURE__ */ React4.createElement(Tooltip3.Root, null, /* @__PURE__ */ React4.createElement(Tooltip3.Trigger, {
|
|
389
|
-
asChild: true
|
|
390
|
-
}, /* @__PURE__ */ React4.createElement(Button3, {
|
|
391
|
-
variant: "ghost",
|
|
392
|
-
onClick: onClickClear,
|
|
393
|
-
disabled
|
|
394
|
-
}, /* @__PURE__ */ React4.createElement("span", {
|
|
395
|
-
className: "sr-only"
|
|
396
|
-
}, t("clear label")), /* @__PURE__ */ React4.createElement(ArrowCounterClockwise2, null))), /* @__PURE__ */ React4.createElement(Tooltip3.Portal, null, /* @__PURE__ */ React4.createElement(Tooltip3.Content, {
|
|
397
|
-
side: "right"
|
|
398
|
-
}, t("clear label"), /* @__PURE__ */ React4.createElement(Tooltip3.Arrow, null)))));
|
|
399
|
-
};
|
|
400
|
-
|
|
401
139
|
// packages/sdk/shell/src/components/IdentityList/IdentityListItem.tsx
|
|
402
|
-
import
|
|
140
|
+
import React3, { forwardRef } from "react";
|
|
403
141
|
import { generateName } from "@dxos/display-name";
|
|
404
142
|
import { SpaceMember } from "@dxos/react-client/echo";
|
|
405
143
|
import { ListItem, Avatar as Avatar2, useId as useId2 } from "@dxos/react-ui";
|
|
406
|
-
import { mx as
|
|
144
|
+
import { mx as mx3 } from "@dxos/react-ui-theme";
|
|
407
145
|
import { keyToFallback } from "@dxos/util";
|
|
408
146
|
var IdentityListItem = /* @__PURE__ */ forwardRef(({ identity, presence, onClick, classNames, ...props }, forwardedRef) => {
|
|
409
147
|
const fallbackValue = keyToFallback(identity.identityKey);
|
|
410
148
|
const labelId = useId2("identityListItem__label");
|
|
411
149
|
const displayName = identity.profile?.displayName ?? generateName(identity.identityKey.toHex());
|
|
412
|
-
return /* @__PURE__ */
|
|
150
|
+
return /* @__PURE__ */ React3.createElement(ListItem.Root, {
|
|
413
151
|
...props,
|
|
414
|
-
classNames:
|
|
152
|
+
classNames: mx3("flex gap-2 pis-3 pie-1 items-center", onClick && "cursor-pointer", classNames),
|
|
415
153
|
onClick: () => onClick?.(),
|
|
416
154
|
"data-testid": "identity-list-item",
|
|
417
155
|
labelId,
|
|
418
156
|
ref: forwardedRef
|
|
419
|
-
}, /* @__PURE__ */
|
|
157
|
+
}, /* @__PURE__ */ React3.createElement(Avatar2.Root, {
|
|
420
158
|
status: presence === SpaceMember.PresenceState.ONLINE ? "active" : "inactive",
|
|
421
159
|
labelId,
|
|
422
160
|
hue: identity.profile?.data?.hue || fallbackValue.hue
|
|
423
|
-
}, /* @__PURE__ */
|
|
161
|
+
}, /* @__PURE__ */ React3.createElement(Avatar2.Frame, {
|
|
424
162
|
classNames: "place-self-center"
|
|
425
|
-
}, /* @__PURE__ */
|
|
163
|
+
}, /* @__PURE__ */ React3.createElement(Avatar2.Fallback, {
|
|
426
164
|
text: identity.profile?.data?.emoji || fallbackValue.emoji
|
|
427
|
-
})), /* @__PURE__ */
|
|
165
|
+
})), /* @__PURE__ */ React3.createElement(Avatar2.Label, {
|
|
428
166
|
classNames: "text-sm truncate pli-2"
|
|
429
167
|
}, displayName)));
|
|
430
168
|
});
|
|
431
169
|
|
|
432
170
|
// packages/sdk/shell/src/components/IdentityList/SpaceMemberList.tsx
|
|
433
|
-
import
|
|
171
|
+
import React4, { useMemo } from "react";
|
|
434
172
|
import { useClient } from "@dxos/react-client";
|
|
435
173
|
import { useMembers } from "@dxos/react-client/echo";
|
|
436
|
-
import { useTranslation as
|
|
437
|
-
import { descriptionText as descriptionText3, mx as
|
|
174
|
+
import { useTranslation as useTranslation2, List } from "@dxos/react-ui";
|
|
175
|
+
import { descriptionText as descriptionText3, mx as mx4 } from "@dxos/react-ui-theme";
|
|
438
176
|
var SpaceMemberList = ({ spaceKey, includeSelf, onSelect }) => {
|
|
439
177
|
const client = useClient();
|
|
440
178
|
const allUnsortedMembers = useMembers(spaceKey);
|
|
441
179
|
const members = useMemo(() => includeSelf ? allUnsortedMembers.sort((member) => member.identity.identityKey.equals(client.halo.identity.get().identityKey) ? -1 : 1) : allUnsortedMembers.filter((member) => !member.identity.identityKey.equals(client.halo.identity.get().identityKey)), [
|
|
442
180
|
allUnsortedMembers
|
|
443
181
|
]);
|
|
444
|
-
return /* @__PURE__ */
|
|
182
|
+
return /* @__PURE__ */ React4.createElement(SpaceMemberListImpl, {
|
|
445
183
|
members,
|
|
446
184
|
onSelect
|
|
447
185
|
});
|
|
448
186
|
};
|
|
449
187
|
var SpaceMemberListImpl = ({ members, onSelect }) => {
|
|
450
|
-
const { t } =
|
|
188
|
+
const { t } = useTranslation2("os");
|
|
451
189
|
const visibleMembers = members.filter((member) => member.identity);
|
|
452
|
-
return visibleMembers.length > 0 ? /* @__PURE__ */
|
|
190
|
+
return visibleMembers.length > 0 ? /* @__PURE__ */ React4.createElement(List, {
|
|
453
191
|
classNames: "flex flex-col gap-2",
|
|
454
192
|
"data-testid": "space-members-list"
|
|
455
193
|
}, visibleMembers.map((member) => {
|
|
456
|
-
return /* @__PURE__ */
|
|
194
|
+
return /* @__PURE__ */ React4.createElement(IdentityListItem, {
|
|
457
195
|
key: member.identity.identityKey.toHex(),
|
|
458
196
|
identity: member.identity,
|
|
459
197
|
presence: member.presence,
|
|
460
198
|
onClick: onSelect && (() => onSelect(member))
|
|
461
199
|
});
|
|
462
|
-
})) : /* @__PURE__ */
|
|
200
|
+
})) : /* @__PURE__ */ React4.createElement("div", {
|
|
463
201
|
role: "none",
|
|
464
202
|
className: "grow flex items-center p-2"
|
|
465
|
-
}, /* @__PURE__ */
|
|
466
|
-
className:
|
|
203
|
+
}, /* @__PURE__ */ React4.createElement("p", {
|
|
204
|
+
className: mx4(descriptionText3, "text-center is-full mlb-2")
|
|
467
205
|
}, t("empty space members message")));
|
|
468
206
|
};
|
|
469
207
|
|
|
470
208
|
// packages/sdk/shell/src/components/DeviceList/DeviceList.tsx
|
|
471
209
|
import { CaretRight, Plus as Plus2 } from "@phosphor-icons/react";
|
|
472
|
-
import
|
|
473
|
-
import { Button as
|
|
474
|
-
import { descriptionText as descriptionText4, getSize as
|
|
210
|
+
import React6 from "react";
|
|
211
|
+
import { Button as Button3, List as List2, useTranslation as useTranslation4 } from "@dxos/react-ui";
|
|
212
|
+
import { descriptionText as descriptionText4, getSize as getSize3, mx as mx5 } from "@dxos/react-ui-theme";
|
|
475
213
|
|
|
476
214
|
// packages/sdk/shell/src/components/DeviceList/DeviceListItem.tsx
|
|
477
215
|
import { Compass, Desktop, DeviceMobile, Devices, DotsThree, ShareFat, Power as Power2, Robot, Database as Database2, FirstAidKit } from "@phosphor-icons/react";
|
|
478
|
-
import
|
|
216
|
+
import React5, { forwardRef as forwardRef2 } from "react";
|
|
479
217
|
import { generateName as generateName2 } from "@dxos/display-name";
|
|
480
218
|
import { Device, DeviceType, DeviceKind } from "@dxos/react-client/halo";
|
|
481
219
|
import { ConnectionState } from "@dxos/react-client/mesh";
|
|
482
|
-
import { ListItem as ListItem2, Avatar as Avatar3, useId as useId3, Tag, useTranslation as
|
|
483
|
-
import { getSize as
|
|
220
|
+
import { ListItem as ListItem2, Avatar as Avatar3, useId as useId3, Tag, useTranslation as useTranslation3, DropdownMenu, Button as Button2 } from "@dxos/react-ui";
|
|
221
|
+
import { getSize as getSize2 } from "@dxos/react-ui-theme";
|
|
484
222
|
import { keyToFallback as keyToFallback2 } from "@dxos/util";
|
|
485
223
|
var iconProps = {
|
|
486
224
|
weight: "duotone",
|
|
@@ -490,7 +228,7 @@ var iconProps = {
|
|
|
490
228
|
y: 8
|
|
491
229
|
};
|
|
492
230
|
var DeviceListItem = /* @__PURE__ */ forwardRef2(({ device, onClickAdd, onClickEdit, onClickReset, onClickRecover, onClickJoinExisting, classNames, connectionState, onAgentDestroy: _, ...props }, forwardedRef) => {
|
|
493
|
-
const { t } =
|
|
231
|
+
const { t } = useTranslation3("os");
|
|
494
232
|
const fallbackValue = keyToFallback2(device.deviceKey);
|
|
495
233
|
const labelId = useId3("identityListItem__label");
|
|
496
234
|
const displayName = device.profile ? t("device name placeholder", {
|
|
@@ -498,7 +236,7 @@ var DeviceListItem = /* @__PURE__ */ forwardRef2(({ device, onClickAdd, onClickE
|
|
|
498
236
|
platform: device.profile.platform
|
|
499
237
|
}) : generateName2(device.deviceKey.toHex());
|
|
500
238
|
const isCurrent = device.kind === DeviceKind.CURRENT;
|
|
501
|
-
return /* @__PURE__ */
|
|
239
|
+
return /* @__PURE__ */ React5.createElement(ListItem2.Root, {
|
|
502
240
|
...props,
|
|
503
241
|
classNames: [
|
|
504
242
|
"flex gap-2 items-center mlb-2",
|
|
@@ -507,60 +245,60 @@ var DeviceListItem = /* @__PURE__ */ forwardRef2(({ device, onClickAdd, onClickE
|
|
|
507
245
|
"data-testid": `device-list-item${isCurrent ? "-current" : ""}`,
|
|
508
246
|
labelId,
|
|
509
247
|
ref: forwardedRef
|
|
510
|
-
}, /* @__PURE__ */
|
|
248
|
+
}, /* @__PURE__ */ React5.createElement(Avatar3.Root, {
|
|
511
249
|
status: isCurrent && connectionState === ConnectionState.OFFLINE ? "error" : device.presence === Device.PresenceState.ONLINE ? "active" : "inactive",
|
|
512
250
|
labelId,
|
|
513
251
|
hue: fallbackValue.hue,
|
|
514
252
|
variant: "square"
|
|
515
|
-
}, /* @__PURE__ */
|
|
253
|
+
}, /* @__PURE__ */ React5.createElement(Avatar3.Frame, {
|
|
516
254
|
classNames: "place-self-center"
|
|
517
|
-
}, device.profile?.type ? device.profile.type === DeviceType.AGENT_MANAGED ? /* @__PURE__ */
|
|
255
|
+
}, device.profile?.type ? device.profile.type === DeviceType.AGENT_MANAGED ? /* @__PURE__ */ React5.createElement(Database2, iconProps) : device.profile.type === DeviceType.BROWSER ? /* @__PURE__ */ React5.createElement(Compass, iconProps) : device.profile.type === DeviceType.NATIVE ? /* @__PURE__ */ React5.createElement(Desktop, iconProps) : [
|
|
518
256
|
DeviceType.AGENT,
|
|
519
257
|
DeviceType.AGENT_MANAGED
|
|
520
|
-
].includes(device.profile.type) ? /* @__PURE__ */
|
|
258
|
+
].includes(device.profile.type) ? /* @__PURE__ */ React5.createElement(Robot, iconProps) : device.profile.type === DeviceType.MOBILE ? /* @__PURE__ */ React5.createElement(DeviceMobile, iconProps) : /* @__PURE__ */ React5.createElement(Devices, iconProps) : /* @__PURE__ */ React5.createElement(Avatar3.Fallback, {
|
|
521
259
|
text: fallbackValue.emoji
|
|
522
|
-
})), /* @__PURE__ */
|
|
260
|
+
})), /* @__PURE__ */ React5.createElement(Avatar3.Label, {
|
|
523
261
|
classNames: "flex-1 text-sm truncate"
|
|
524
|
-
}, displayName), isCurrent && /* @__PURE__ */
|
|
262
|
+
}, displayName), isCurrent && /* @__PURE__ */ React5.createElement(Tag, {
|
|
525
263
|
color: "primary"
|
|
526
|
-
}, t("current device tag label")), device.kind === DeviceKind.CURRENT && /* @__PURE__ */
|
|
264
|
+
}, t("current device tag label")), device.kind === DeviceKind.CURRENT && /* @__PURE__ */ React5.createElement(DropdownMenu.Root, null, /* @__PURE__ */ React5.createElement(DropdownMenu.Trigger, {
|
|
527
265
|
asChild: true
|
|
528
|
-
}, /* @__PURE__ */
|
|
266
|
+
}, /* @__PURE__ */ React5.createElement(Button2, {
|
|
529
267
|
variant: "ghost",
|
|
530
268
|
classNames: "pli-0 is-[--rail-action] bs-[--rail-action]",
|
|
531
269
|
"data-testid": `device-list-item${isCurrent ? "-current" : ""}.options`
|
|
532
|
-
}, /* @__PURE__ */
|
|
270
|
+
}, /* @__PURE__ */ React5.createElement("span", {
|
|
533
271
|
className: "sr-only"
|
|
534
|
-
}, t("more options label")), /* @__PURE__ */
|
|
535
|
-
className:
|
|
536
|
-
}))), /* @__PURE__ */
|
|
272
|
+
}, t("more options label")), /* @__PURE__ */ React5.createElement(DotsThree, {
|
|
273
|
+
className: getSize2(5)
|
|
274
|
+
}))), /* @__PURE__ */ React5.createElement(DropdownMenu.Content, null, /* @__PURE__ */ React5.createElement(DropdownMenu.Viewport, null, /* @__PURE__ */ React5.createElement(DropdownMenu.Item, {
|
|
537
275
|
"data-testid": "device-list-item-current.join-existing",
|
|
538
276
|
onClick: onClickJoinExisting
|
|
539
|
-
}, /* @__PURE__ */
|
|
540
|
-
className:
|
|
541
|
-
}), t("choose join new identity label")), onClickRecover && /* @__PURE__ */
|
|
277
|
+
}, /* @__PURE__ */ React5.createElement(ShareFat, {
|
|
278
|
+
className: getSize2(5)
|
|
279
|
+
}), t("choose join new identity label")), onClickRecover && /* @__PURE__ */ React5.createElement(DropdownMenu.Item, {
|
|
542
280
|
"data-testid": "device-list-item-current.recover",
|
|
543
281
|
onClick: onClickRecover
|
|
544
|
-
}, /* @__PURE__ */
|
|
545
|
-
className:
|
|
546
|
-
}), t("choose recover identity label")), /* @__PURE__ */
|
|
282
|
+
}, /* @__PURE__ */ React5.createElement(FirstAidKit, {
|
|
283
|
+
className: getSize2(5)
|
|
284
|
+
}), t("choose recover identity label")), /* @__PURE__ */ React5.createElement(DropdownMenu.Item, {
|
|
547
285
|
"data-testid": "device-list-item-current.reset",
|
|
548
286
|
onClick: onClickReset
|
|
549
|
-
}, /* @__PURE__ */
|
|
550
|
-
className:
|
|
287
|
+
}, /* @__PURE__ */ React5.createElement(Power2, {
|
|
288
|
+
className: getSize2(5)
|
|
551
289
|
}), t("reset device label")))))));
|
|
552
290
|
});
|
|
553
291
|
|
|
554
292
|
// packages/sdk/shell/src/components/DeviceList/DeviceList.tsx
|
|
555
293
|
var DeviceList = ({ devices, connectionState, onClickAdd, onClickEdit, onClickReset, onClickRecover, onClickJoinExisting, onAgentDestroy }) => {
|
|
556
|
-
const { t } =
|
|
557
|
-
return /* @__PURE__ */
|
|
294
|
+
const { t } = useTranslation4("os");
|
|
295
|
+
return /* @__PURE__ */ React6.createElement("div", {
|
|
558
296
|
role: "none",
|
|
559
297
|
className: "p-1"
|
|
560
|
-
}, /* @__PURE__ */
|
|
561
|
-
className:
|
|
562
|
-
}, t("devices heading")), devices.length > 0 && /* @__PURE__ */
|
|
563
|
-
return /* @__PURE__ */
|
|
298
|
+
}, /* @__PURE__ */ React6.createElement("h2", {
|
|
299
|
+
className: mx5(descriptionText4, "text-center mbs-2")
|
|
300
|
+
}, t("devices heading")), devices.length > 0 && /* @__PURE__ */ React6.createElement(List2, null, devices.map((device) => {
|
|
301
|
+
return /* @__PURE__ */ React6.createElement(DeviceListItem, {
|
|
564
302
|
key: device.deviceKey.toHex(),
|
|
565
303
|
device,
|
|
566
304
|
onClickEdit: () => onClickEdit?.(device),
|
|
@@ -570,43 +308,43 @@ var DeviceList = ({ devices, connectionState, onClickAdd, onClickEdit, onClickRe
|
|
|
570
308
|
connectionState,
|
|
571
309
|
onAgentDestroy
|
|
572
310
|
});
|
|
573
|
-
})), /* @__PURE__ */
|
|
311
|
+
})), /* @__PURE__ */ React6.createElement(Button3, {
|
|
574
312
|
variant: "ghost",
|
|
575
|
-
classNames: "justify-start gap-2
|
|
313
|
+
classNames: "justify-start gap-2 pis-0 pie-3 is-full",
|
|
576
314
|
"data-testid": "devices-panel.create-invitation",
|
|
577
315
|
onClick: onClickAdd
|
|
578
|
-
}, /* @__PURE__ */
|
|
316
|
+
}, /* @__PURE__ */ React6.createElement("div", {
|
|
579
317
|
role: "img",
|
|
580
|
-
className:
|
|
581
|
-
}, /* @__PURE__ */
|
|
318
|
+
className: mx5(getSize3(8), "m-1 rounded-sm bg-input grid place-items-center")
|
|
319
|
+
}, /* @__PURE__ */ React6.createElement(Plus2, {
|
|
582
320
|
weight: "light",
|
|
583
|
-
className:
|
|
584
|
-
})), /* @__PURE__ */
|
|
321
|
+
className: getSize3(6)
|
|
322
|
+
})), /* @__PURE__ */ React6.createElement("span", {
|
|
585
323
|
className: "grow font-medium text-start"
|
|
586
|
-
}, t("choose add device label")), /* @__PURE__ */
|
|
324
|
+
}, t("choose add device label")), /* @__PURE__ */ React6.createElement(CaretRight, {
|
|
587
325
|
weight: "bold",
|
|
588
|
-
className:
|
|
326
|
+
className: getSize3(4)
|
|
589
327
|
})));
|
|
590
328
|
};
|
|
591
329
|
|
|
592
330
|
// packages/sdk/shell/src/components/InvitationList/InvitationListItem.tsx
|
|
593
331
|
import { X } from "@phosphor-icons/react";
|
|
594
332
|
import { formatDistanceToNow } from "date-fns";
|
|
595
|
-
import
|
|
333
|
+
import React8, { useCallback } from "react";
|
|
596
334
|
import { Invitation, useInvitationStatus } from "@dxos/react-client/invitations";
|
|
597
|
-
import { Button as
|
|
598
|
-
import { focusRing, getSize as
|
|
335
|
+
import { Button as Button4, Clipboard, ListItem as ListItem3, useTranslation as useTranslation5, Avatar as Avatar4, useThemeContext as useThemeContext2, Tooltip as Tooltip2 } from "@dxos/react-ui";
|
|
336
|
+
import { focusRing, getSize as getSize4, mx as mx7 } from "@dxos/react-ui-theme";
|
|
599
337
|
import { hexToEmoji } from "@dxos/util";
|
|
600
338
|
|
|
601
339
|
// packages/sdk/shell/src/components/AuthCode.tsx
|
|
602
|
-
import
|
|
603
|
-
import { mx as
|
|
340
|
+
import React7, { useRef } from "react";
|
|
341
|
+
import { mx as mx6 } from "@dxos/react-ui-theme";
|
|
604
342
|
var AuthCode = (props) => {
|
|
605
343
|
const { code, large, classNames } = props;
|
|
606
344
|
const l = code?.length ?? 0;
|
|
607
345
|
const left = code?.slice(0, l / 2);
|
|
608
346
|
const right = code?.slice(l / 2);
|
|
609
|
-
const codeRef =
|
|
347
|
+
const codeRef = useRef(null);
|
|
610
348
|
const handleClick = () => {
|
|
611
349
|
if (codeRef.current) {
|
|
612
350
|
const selection = window.getSelection();
|
|
@@ -617,20 +355,20 @@ var AuthCode = (props) => {
|
|
|
617
355
|
}
|
|
618
356
|
void navigator.clipboard.writeText(code ?? "");
|
|
619
357
|
};
|
|
620
|
-
return /* @__PURE__ */
|
|
621
|
-
className:
|
|
358
|
+
return /* @__PURE__ */ React7.createElement("span", {
|
|
359
|
+
className: mx6(large ? "text-6xl" : "text-2xl", "font-mono pli-2.5 rounded cursor-pointer", classNames),
|
|
622
360
|
onClick: handleClick,
|
|
623
361
|
ref: codeRef
|
|
624
|
-
}, /* @__PURE__ */
|
|
362
|
+
}, /* @__PURE__ */ React7.createElement("span", {
|
|
625
363
|
className: "mie-[0.4em]"
|
|
626
|
-
}, left), /* @__PURE__ */
|
|
364
|
+
}, left), /* @__PURE__ */ React7.createElement("span", null, right));
|
|
627
365
|
};
|
|
628
366
|
|
|
629
367
|
// packages/sdk/shell/src/components/InvitationList/InvitationListItem.tsx
|
|
630
368
|
var InvitationListItem = (props) => {
|
|
631
369
|
const { invitation } = props;
|
|
632
370
|
const invitationStatus = useInvitationStatus(invitation);
|
|
633
|
-
return /* @__PURE__ */
|
|
371
|
+
return /* @__PURE__ */ React8.createElement(InvitationListItemImpl, {
|
|
634
372
|
...props,
|
|
635
373
|
invitationStatus
|
|
636
374
|
});
|
|
@@ -640,11 +378,11 @@ var avatarProps = {
|
|
|
640
378
|
variant: "circle"
|
|
641
379
|
};
|
|
642
380
|
var AvatarStackEffect = ({ animation, status, reverseEffects }) => {
|
|
643
|
-
const { tx } =
|
|
644
|
-
return /* @__PURE__ */
|
|
381
|
+
const { tx } = useThemeContext2();
|
|
382
|
+
return /* @__PURE__ */ React8.createElement(React8.Fragment, null, /* @__PURE__ */ React8.createElement("span", {
|
|
645
383
|
role: "none",
|
|
646
|
-
className:
|
|
647
|
-
}, /* @__PURE__ */
|
|
384
|
+
className: mx7("absolute inline-end-auto opacity-20", reverseEffects ? "inline-start-3" : "inline-start-1", getSize4(avatarProps.size))
|
|
385
|
+
}, /* @__PURE__ */ React8.createElement("span", {
|
|
648
386
|
role: "none",
|
|
649
387
|
className: tx("avatar.ring", "avatar__ring", {
|
|
650
388
|
...avatarProps,
|
|
@@ -654,10 +392,10 @@ var AvatarStackEffect = ({ animation, status, reverseEffects }) => {
|
|
|
654
392
|
style: {
|
|
655
393
|
animationDelay: "400ms"
|
|
656
394
|
}
|
|
657
|
-
})), /* @__PURE__ */
|
|
395
|
+
})), /* @__PURE__ */ React8.createElement("span", {
|
|
658
396
|
role: "none",
|
|
659
|
-
className:
|
|
660
|
-
}, /* @__PURE__ */
|
|
397
|
+
className: mx7("absolute inline-end-auto opacity-50", reverseEffects ? "inline-start-2" : "inline-start-2", getSize4(avatarProps.size))
|
|
398
|
+
}, /* @__PURE__ */ React8.createElement("span", {
|
|
661
399
|
role: "none",
|
|
662
400
|
className: tx("avatar.ring", "avatar__ring", {
|
|
663
401
|
...avatarProps,
|
|
@@ -670,7 +408,7 @@ var AvatarStackEffect = ({ animation, status, reverseEffects }) => {
|
|
|
670
408
|
})));
|
|
671
409
|
};
|
|
672
410
|
var InvitationListItemImpl = ({ invitation, invitationStatus: propsInvitationStatus, send, onClickRemove, createInvitationUrl, reverseEffects, ...props }) => {
|
|
673
|
-
const { t } =
|
|
411
|
+
const { t } = useTranslation5("os");
|
|
674
412
|
const { cancel, status: invitationStatus, invitationCode, authCode, multiUse, shareable } = propsInvitationStatus;
|
|
675
413
|
const isCancellable = !([
|
|
676
414
|
Invitation.State.ERROR,
|
|
@@ -712,38 +450,38 @@ var InvitationListItemImpl = ({ invitation, invitationStatus: propsInvitationSta
|
|
|
712
450
|
Invitation.State.SUCCESS
|
|
713
451
|
].includes(invitationStatus);
|
|
714
452
|
const avatarStatus = avatarError ? "error" : avatarGreen ? "active" : "inactive";
|
|
715
|
-
return /* @__PURE__ */
|
|
453
|
+
return /* @__PURE__ */ React8.createElement(ListItem3.Root, {
|
|
716
454
|
id: invitationCode,
|
|
717
455
|
...props,
|
|
718
456
|
classNames: [
|
|
719
457
|
"flex gap-2 pis-3 pie-1 items-center relative",
|
|
720
458
|
props.classNames
|
|
721
459
|
]
|
|
722
|
-
}, /* @__PURE__ */
|
|
460
|
+
}, /* @__PURE__ */ React8.createElement(ListItem3.Heading, {
|
|
723
461
|
classNames: "sr-only"
|
|
724
|
-
}, t(multiUse ? "invite many list item label" : "invite one list item label")), multiUse && /* @__PURE__ */
|
|
462
|
+
}, t(multiUse ? "invite many list item label" : "invite one list item label")), multiUse && /* @__PURE__ */ React8.createElement(AvatarStackEffect, {
|
|
725
463
|
status: avatarStatus,
|
|
726
464
|
animation: avatarAnimation,
|
|
727
465
|
reverseEffects
|
|
728
|
-
}), /* @__PURE__ */
|
|
466
|
+
}), /* @__PURE__ */ React8.createElement(Tooltip2.Root, null, /* @__PURE__ */ React8.createElement(Avatar4.Root, {
|
|
729
467
|
...avatarProps,
|
|
730
468
|
animation: avatarAnimation,
|
|
731
469
|
status: avatarStatus
|
|
732
|
-
}, /* @__PURE__ */
|
|
470
|
+
}, /* @__PURE__ */ React8.createElement(Tooltip2.Trigger, {
|
|
733
471
|
asChild: true
|
|
734
|
-
}, /* @__PURE__ */
|
|
472
|
+
}, /* @__PURE__ */ React8.createElement(Avatar4.Frame, {
|
|
735
473
|
tabIndex: 0,
|
|
736
474
|
classNames: [
|
|
737
475
|
focusRing,
|
|
738
476
|
"relative rounded-full place-self-center"
|
|
739
477
|
]
|
|
740
|
-
}, /* @__PURE__ */
|
|
478
|
+
}, /* @__PURE__ */ React8.createElement(Avatar4.Fallback, {
|
|
741
479
|
text: hexToEmoji(invitationId)
|
|
742
|
-
})))), /* @__PURE__ */
|
|
480
|
+
})))), /* @__PURE__ */ React8.createElement(Tooltip2.Portal, null, /* @__PURE__ */ React8.createElement(Tooltip2.Content, {
|
|
743
481
|
side: "left"
|
|
744
|
-
}, t(multiUse ? "invite many qr label" : "invite one qr label"), /* @__PURE__ */
|
|
482
|
+
}, t(multiUse ? "invite many qr label" : "invite one qr label"), /* @__PURE__ */ React8.createElement(Tooltip2.Arrow, null)))), showShare && invitationUrl ? /* @__PURE__ */ React8.createElement(Tooltip2.Root, null, /* @__PURE__ */ React8.createElement(React8.Fragment, null, /* @__PURE__ */ React8.createElement(Tooltip2.Trigger, {
|
|
745
483
|
asChild: true
|
|
746
|
-
}, /* @__PURE__ */
|
|
484
|
+
}, /* @__PURE__ */ React8.createElement(Button4, {
|
|
747
485
|
variant: "ghost",
|
|
748
486
|
classNames: "grow justify-start font-medium",
|
|
749
487
|
onClick: () => send({
|
|
@@ -751,64 +489,64 @@ var InvitationListItemImpl = ({ invitation, invitationStatus: propsInvitationSta
|
|
|
751
489
|
invitation
|
|
752
490
|
}),
|
|
753
491
|
"data-testid": "show-qrcode"
|
|
754
|
-
}, /* @__PURE__ */
|
|
492
|
+
}, /* @__PURE__ */ React8.createElement("span", null, t("open share panel label")))), /* @__PURE__ */ React8.createElement(Clipboard.IconButton, {
|
|
755
493
|
variant: "ghost",
|
|
756
494
|
value: invitationUrl
|
|
757
|
-
})), /* @__PURE__ */
|
|
495
|
+
})), /* @__PURE__ */ React8.createElement(Tooltip2.Portal, null, /* @__PURE__ */ React8.createElement(Tooltip2.Content, {
|
|
758
496
|
side: "left"
|
|
759
|
-
}, invitationHasLifetime && /* @__PURE__ */
|
|
497
|
+
}, invitationHasLifetime && /* @__PURE__ */ React8.createElement("span", null, "Expires ", invitationTimeLeft)))) : showAuthCode ? /* @__PURE__ */ React8.createElement(AuthCode, {
|
|
760
498
|
code: authCode,
|
|
761
499
|
classNames: "grow"
|
|
762
|
-
}) : invitationStatus === Invitation.State.CONNECTING ? /* @__PURE__ */
|
|
500
|
+
}) : invitationStatus === Invitation.State.CONNECTING ? /* @__PURE__ */ React8.createElement("span", {
|
|
763
501
|
className: "pli-2 grow text-neutral-500"
|
|
764
|
-
}, "Connecting...") : invitationStatus === Invitation.State.AUTHENTICATING ? /* @__PURE__ */
|
|
502
|
+
}, "Connecting...") : invitationStatus === Invitation.State.AUTHENTICATING ? /* @__PURE__ */ React8.createElement("span", {
|
|
765
503
|
className: "pli-2 grow text-neutral-500"
|
|
766
|
-
}, "Authenticating...") : invitationStatus === Invitation.State.ERROR || invitationStatus === Invitation.State.TIMEOUT ? /* @__PURE__ */
|
|
504
|
+
}, "Authenticating...") : invitationStatus === Invitation.State.ERROR || invitationStatus === Invitation.State.TIMEOUT ? /* @__PURE__ */ React8.createElement("span", {
|
|
767
505
|
className: "pli-2 grow text-neutral-500"
|
|
768
|
-
}, "Failed") : invitationStatus === Invitation.State.CANCELLED ? /* @__PURE__ */
|
|
506
|
+
}, "Failed") : invitationStatus === Invitation.State.CANCELLED ? /* @__PURE__ */ React8.createElement("span", {
|
|
769
507
|
className: "pli-2 grow text-neutral-500"
|
|
770
|
-
}, "Cancelled") : invitationStatus === Invitation.State.SUCCESS ? /* @__PURE__ */
|
|
508
|
+
}, "Cancelled") : invitationStatus === Invitation.State.SUCCESS ? /* @__PURE__ */ React8.createElement("span", {
|
|
771
509
|
className: "pli-2 grow truncate"
|
|
772
|
-
}, "User joined") : !shareable ? /* @__PURE__ */
|
|
510
|
+
}, "User joined") : !shareable ? /* @__PURE__ */ React8.createElement("span", {
|
|
773
511
|
className: "pli-2 grow text-neutral-500"
|
|
774
|
-
}, "Pending Invitation") : /* @__PURE__ */
|
|
512
|
+
}, "Pending Invitation") : /* @__PURE__ */ React8.createElement("span", {
|
|
775
513
|
className: "grow"
|
|
776
|
-
}, " "), isCancellable ? /* @__PURE__ */
|
|
514
|
+
}, " "), isCancellable ? /* @__PURE__ */ React8.createElement(Button4, {
|
|
777
515
|
variant: "ghost",
|
|
778
516
|
classNames: "flex gap-1 pli-0",
|
|
779
517
|
onClick: cancel,
|
|
780
518
|
"data-testid": "cancel-invitation"
|
|
781
|
-
}, /* @__PURE__ */
|
|
519
|
+
}, /* @__PURE__ */ React8.createElement("span", {
|
|
782
520
|
className: "sr-only"
|
|
783
|
-
}, t("cancel invitation label")), /* @__PURE__ */
|
|
784
|
-
className:
|
|
785
|
-
})) : /* @__PURE__ */
|
|
521
|
+
}, t("cancel invitation label")), /* @__PURE__ */ React8.createElement(X, {
|
|
522
|
+
className: getSize4(4)
|
|
523
|
+
})) : /* @__PURE__ */ React8.createElement(Button4, {
|
|
786
524
|
variant: "ghost",
|
|
787
525
|
classNames: "flex gap-1 pli-0",
|
|
788
526
|
onClick: handleClickRemove,
|
|
789
527
|
"data-testid": "remove-invitation"
|
|
790
|
-
}, /* @__PURE__ */
|
|
528
|
+
}, /* @__PURE__ */ React8.createElement("span", {
|
|
791
529
|
className: "sr-only"
|
|
792
|
-
}, t("remove invitation label")), /* @__PURE__ */
|
|
793
|
-
className:
|
|
530
|
+
}, t("remove invitation label")), /* @__PURE__ */ React8.createElement(X, {
|
|
531
|
+
className: getSize4(4)
|
|
794
532
|
})));
|
|
795
533
|
};
|
|
796
534
|
|
|
797
535
|
// packages/sdk/shell/src/components/InvitationList/InvitationListContainer.tsx
|
|
798
|
-
import
|
|
536
|
+
import React10, { useCallback as useCallback2 } from "react";
|
|
799
537
|
import { useSpace, useSpaceInvitations } from "@dxos/react-client/echo";
|
|
800
538
|
|
|
801
539
|
// packages/sdk/shell/src/components/InvitationList/InvitationList.tsx
|
|
802
|
-
import
|
|
540
|
+
import React9 from "react";
|
|
803
541
|
import { List as List3 } from "@dxos/react-ui";
|
|
804
|
-
import { mx as
|
|
542
|
+
import { mx as mx8 } from "@dxos/react-ui-theme";
|
|
805
543
|
var InvitationList = ({ invitations, send, ...invitationProps }) => {
|
|
806
544
|
const { className, InvitationListItem: Item = InvitationListItem } = invitationProps;
|
|
807
|
-
return /* @__PURE__ */
|
|
808
|
-
classNames:
|
|
545
|
+
return /* @__PURE__ */ React9.createElement(List3, {
|
|
546
|
+
classNames: mx8("flex flex-col gap-2", className)
|
|
809
547
|
}, invitations.map((invitation) => {
|
|
810
548
|
const value = invitation.get().invitationId;
|
|
811
|
-
return /* @__PURE__ */
|
|
549
|
+
return /* @__PURE__ */ React9.createElement(Item, {
|
|
812
550
|
key: value,
|
|
813
551
|
send,
|
|
814
552
|
invitation,
|
|
@@ -826,7 +564,7 @@ var InvitationListContainer = ({ spaceKey, createInvitationUrl, send }) => {
|
|
|
826
564
|
}, [
|
|
827
565
|
space
|
|
828
566
|
]);
|
|
829
|
-
return /* @__PURE__ */
|
|
567
|
+
return /* @__PURE__ */ React10.createElement(InvitationList, {
|
|
830
568
|
invitations,
|
|
831
569
|
onClickRemove: handleClickRemove,
|
|
832
570
|
createInvitationUrl,
|
|
@@ -835,11 +573,11 @@ var InvitationListContainer = ({ spaceKey, createInvitationUrl, send }) => {
|
|
|
835
573
|
};
|
|
836
574
|
|
|
837
575
|
// packages/sdk/shell/src/components/Panel/Action.tsx
|
|
838
|
-
import { CaretDown
|
|
839
|
-
import { useControllableState
|
|
840
|
-
import
|
|
841
|
-
import { Button as
|
|
842
|
-
import { descriptionText as descriptionText5, getSize as
|
|
576
|
+
import { CaretDown, Check, Placeholder } from "@phosphor-icons/react";
|
|
577
|
+
import { useControllableState } from "@radix-ui/react-use-controllable-state";
|
|
578
|
+
import React11, { forwardRef as forwardRef3 } from "react";
|
|
579
|
+
import { Button as Button5, DropdownMenu as DropdownMenu2, useTranslation as useTranslation6 } from "@dxos/react-ui";
|
|
580
|
+
import { descriptionText as descriptionText5, getSize as getSize5, mx as mx9 } from "@dxos/react-ui-theme";
|
|
843
581
|
var defaultActions = {
|
|
844
582
|
noopAction: {
|
|
845
583
|
label: "No-op",
|
|
@@ -852,17 +590,17 @@ var defaultActions = {
|
|
|
852
590
|
var BifurcatedAction = /* @__PURE__ */ forwardRef3((props, forwardedRef) => {
|
|
853
591
|
const { classNames, variant, isFull = true, actions = defaultActions, activeAction: propsActiveAction, onChangeActiveAction, defaultActiveAction, "data-testid": testId, ...rest } = props;
|
|
854
592
|
const dropdownTestId = testId && `${testId}.more`;
|
|
855
|
-
const [activeActionKey2 = Object.keys(actions)[0], setActiveAction] =
|
|
593
|
+
const [activeActionKey2 = Object.keys(actions)[0], setActiveAction] = useControllableState({
|
|
856
594
|
prop: propsActiveAction,
|
|
857
595
|
onChange: onChangeActiveAction,
|
|
858
596
|
defaultProp: defaultActiveAction
|
|
859
597
|
});
|
|
860
598
|
const activeAction = actions[activeActionKey2] ?? {};
|
|
861
|
-
const { t } =
|
|
862
|
-
return /* @__PURE__ */
|
|
599
|
+
const { t } = useTranslation6("os");
|
|
600
|
+
return /* @__PURE__ */ React11.createElement("div", {
|
|
863
601
|
role: "none",
|
|
864
|
-
className:
|
|
865
|
-
}, /* @__PURE__ */
|
|
602
|
+
className: mx9("mbs-2 flex gap-px items-center", isFull && "is-full")
|
|
603
|
+
}, /* @__PURE__ */ React11.createElement(Button5, {
|
|
866
604
|
...rest,
|
|
867
605
|
classNames: [
|
|
868
606
|
"bs-11 flex-1 min-is-0 flex gap-2 rounded-ie-none",
|
|
@@ -872,22 +610,22 @@ var BifurcatedAction = /* @__PURE__ */ forwardRef3((props, forwardedRef) => {
|
|
|
872
610
|
variant,
|
|
873
611
|
"data-testid": testId,
|
|
874
612
|
onClick: activeAction.onClick
|
|
875
|
-
}, activeAction.icon && /* @__PURE__ */
|
|
876
|
-
className:
|
|
877
|
-
}), /* @__PURE__ */
|
|
613
|
+
}, activeAction.icon && /* @__PURE__ */ React11.createElement(activeAction.icon, {
|
|
614
|
+
className: getSize5(5)
|
|
615
|
+
}), /* @__PURE__ */ React11.createElement("span", null, activeAction.label)), /* @__PURE__ */ React11.createElement(DropdownMenu2.Root, null, /* @__PURE__ */ React11.createElement(DropdownMenu2.Trigger, {
|
|
878
616
|
asChild: true
|
|
879
|
-
}, /* @__PURE__ */
|
|
617
|
+
}, /* @__PURE__ */ React11.createElement(Button5, {
|
|
880
618
|
classNames: [
|
|
881
619
|
"bs-11 flex-none rounded-is-none",
|
|
882
620
|
classNames
|
|
883
621
|
],
|
|
884
622
|
"data-testid": dropdownTestId
|
|
885
|
-
}, /* @__PURE__ */
|
|
623
|
+
}, /* @__PURE__ */ React11.createElement("span", {
|
|
886
624
|
className: "sr-only"
|
|
887
|
-
}, t("invite options label")), /* @__PURE__ */
|
|
888
|
-
className:
|
|
889
|
-
}))), /* @__PURE__ */
|
|
890
|
-
return /* @__PURE__ */
|
|
625
|
+
}, t("invite options label")), /* @__PURE__ */ React11.createElement(CaretDown, {
|
|
626
|
+
className: getSize5(4)
|
|
627
|
+
}))), /* @__PURE__ */ React11.createElement(DropdownMenu2.Portal, null, /* @__PURE__ */ React11.createElement(DropdownMenu2.Content, null, /* @__PURE__ */ React11.createElement(DropdownMenu2.Viewport, null, Object.entries(actions).map(([id, action]) => {
|
|
628
|
+
return /* @__PURE__ */ React11.createElement(DropdownMenu2.CheckboxItem, {
|
|
891
629
|
key: id,
|
|
892
630
|
"aria-labelledby": `${id}__label`,
|
|
893
631
|
"aria-describedby": `${id}__description`,
|
|
@@ -895,27 +633,27 @@ var BifurcatedAction = /* @__PURE__ */ forwardRef3((props, forwardedRef) => {
|
|
|
895
633
|
onCheckedChange: (checked) => checked && setActiveAction(id),
|
|
896
634
|
classNames: "gap-2",
|
|
897
635
|
"data-testid": action.testId
|
|
898
|
-
}, action.icon && /* @__PURE__ */
|
|
899
|
-
className:
|
|
900
|
-
}), /* @__PURE__ */
|
|
636
|
+
}, action.icon && /* @__PURE__ */ React11.createElement(action.icon, {
|
|
637
|
+
className: getSize5(5)
|
|
638
|
+
}), /* @__PURE__ */ React11.createElement("div", {
|
|
901
639
|
role: "none",
|
|
902
640
|
className: "flex-1 min-is-0 space-b-1"
|
|
903
|
-
}, /* @__PURE__ */
|
|
641
|
+
}, /* @__PURE__ */ React11.createElement("p", {
|
|
904
642
|
id: `${id}__label`
|
|
905
|
-
}, action.label), action.description && /* @__PURE__ */
|
|
643
|
+
}, action.label), action.description && /* @__PURE__ */ React11.createElement("p", {
|
|
906
644
|
id: `${id}__description`,
|
|
907
645
|
className: descriptionText5
|
|
908
|
-
}, action.description)), /* @__PURE__ */
|
|
646
|
+
}, action.description)), /* @__PURE__ */ React11.createElement(DropdownMenu2.ItemIndicator, {
|
|
909
647
|
asChild: true
|
|
910
|
-
}, /* @__PURE__ */
|
|
648
|
+
}, /* @__PURE__ */ React11.createElement(Check, {
|
|
911
649
|
weight: "bold",
|
|
912
|
-
className:
|
|
650
|
+
className: getSize5(4)
|
|
913
651
|
})));
|
|
914
|
-
})), /* @__PURE__ */
|
|
652
|
+
})), /* @__PURE__ */ React11.createElement(DropdownMenu2.Arrow, null)))));
|
|
915
653
|
});
|
|
916
654
|
var Action = /* @__PURE__ */ forwardRef3((props, forwardedRef) => {
|
|
917
655
|
const { children, classNames, variant, isFull = true, ...rest } = props;
|
|
918
|
-
return /* @__PURE__ */
|
|
656
|
+
return /* @__PURE__ */ React11.createElement(Button5, {
|
|
919
657
|
...rest,
|
|
920
658
|
classNames: [
|
|
921
659
|
isFull && "is-full",
|
|
@@ -928,49 +666,49 @@ var Action = /* @__PURE__ */ forwardRef3((props, forwardedRef) => {
|
|
|
928
666
|
});
|
|
929
667
|
|
|
930
668
|
// packages/sdk/shell/src/components/Panel/Actions.tsx
|
|
931
|
-
import
|
|
932
|
-
import { mx as
|
|
669
|
+
import React12, { forwardRef as forwardRef4 } from "react";
|
|
670
|
+
import { mx as mx10 } from "@dxos/react-ui-theme";
|
|
933
671
|
var Actions = /* @__PURE__ */ forwardRef4(({ classNames, children, ...props }, forwardedRef) => {
|
|
934
|
-
return /* @__PURE__ */
|
|
672
|
+
return /* @__PURE__ */ React12.createElement("div", {
|
|
935
673
|
...props,
|
|
936
|
-
className:
|
|
674
|
+
className: mx10("flex flex-col gap-2 mbs-2", Array.isArray(children) && children.length > 1 ? "justify-between" : "justify-center", classNames),
|
|
937
675
|
ref: forwardedRef
|
|
938
676
|
}, children);
|
|
939
677
|
});
|
|
940
678
|
|
|
941
679
|
// packages/sdk/shell/src/components/Panel/CloseButton.tsx
|
|
942
680
|
import { X as X2 } from "@phosphor-icons/react";
|
|
943
|
-
import
|
|
944
|
-
import { Button as
|
|
945
|
-
import { getSize as
|
|
681
|
+
import React13 from "react";
|
|
682
|
+
import { Button as Button6, useTranslation as useTranslation7 } from "@dxos/react-ui";
|
|
683
|
+
import { getSize as getSize6, mx as mx11 } from "@dxos/react-ui-theme";
|
|
946
684
|
var CloseButton = ({ onDone, ...props }) => {
|
|
947
|
-
const { t } =
|
|
948
|
-
return /* @__PURE__ */
|
|
685
|
+
const { t } = useTranslation7("os");
|
|
686
|
+
return /* @__PURE__ */ React13.createElement(Button6, {
|
|
949
687
|
variant: "ghost",
|
|
950
|
-
classNames:
|
|
688
|
+
classNames: mx11("plb-0 pli-2 absolute block-start-0 inline-end-0 z-[1]"),
|
|
951
689
|
onClick: () => onDone?.(),
|
|
952
690
|
...props
|
|
953
|
-
}, /* @__PURE__ */
|
|
691
|
+
}, /* @__PURE__ */ React13.createElement(X2, {
|
|
954
692
|
weight: "bold",
|
|
955
|
-
className:
|
|
956
|
-
}), /* @__PURE__ */
|
|
693
|
+
className: getSize6(4)
|
|
694
|
+
}), /* @__PURE__ */ React13.createElement("span", {
|
|
957
695
|
className: "sr-only"
|
|
958
696
|
}, t("exit label")));
|
|
959
697
|
};
|
|
960
698
|
|
|
961
699
|
// packages/sdk/shell/src/components/Panel/Emoji.tsx
|
|
962
|
-
import
|
|
963
|
-
import { mx as
|
|
700
|
+
import React14 from "react";
|
|
701
|
+
import { mx as mx12, getSize as getSize7 } from "@dxos/react-ui-theme";
|
|
964
702
|
var Emoji = ({ text, className }) => {
|
|
965
703
|
const size = 14;
|
|
966
|
-
return /* @__PURE__ */
|
|
704
|
+
return /* @__PURE__ */ React14.createElement("div", {
|
|
967
705
|
role: "none",
|
|
968
|
-
className:
|
|
969
|
-
}, /* @__PURE__ */
|
|
706
|
+
className: mx12(getSize7(size), "rounded relative pointer-events-none", className)
|
|
707
|
+
}, /* @__PURE__ */ React14.createElement("svg", {
|
|
970
708
|
viewBox: `0 0 ${size * 4} ${size * 4}`,
|
|
971
709
|
width: size * 4,
|
|
972
710
|
height: size * 4
|
|
973
|
-
}, /* @__PURE__ */
|
|
711
|
+
}, /* @__PURE__ */ React14.createElement("text", {
|
|
974
712
|
x: "50%",
|
|
975
713
|
y: "50%",
|
|
976
714
|
textAnchor: "middle",
|
|
@@ -981,57 +719,57 @@ var Emoji = ({ text, className }) => {
|
|
|
981
719
|
};
|
|
982
720
|
var Centered = (props) => {
|
|
983
721
|
const { children } = props;
|
|
984
|
-
return /* @__PURE__ */
|
|
722
|
+
return /* @__PURE__ */ React14.createElement("div", {
|
|
985
723
|
role: "none",
|
|
986
724
|
className: "absolute inset-0 flex items-center justify-center"
|
|
987
725
|
}, children);
|
|
988
726
|
};
|
|
989
727
|
|
|
990
728
|
// packages/sdk/shell/src/components/Panel/Heading.tsx
|
|
991
|
-
import
|
|
992
|
-
import { descriptionText as descriptionText6, mx as
|
|
729
|
+
import React15, { forwardRef as forwardRef5 } from "react";
|
|
730
|
+
import { descriptionText as descriptionText6, mx as mx13 } from "@dxos/react-ui-theme";
|
|
993
731
|
var Heading = /* @__PURE__ */ forwardRef5(({ titleId, title, titleSrOnly, children, corner }, forwardedRef) => {
|
|
994
|
-
return /* @__PURE__ */
|
|
732
|
+
return /* @__PURE__ */ React15.createElement("div", {
|
|
995
733
|
role: "none",
|
|
996
734
|
className: "pbe-2 relative",
|
|
997
735
|
ref: forwardedRef
|
|
998
|
-
}, corner, /* @__PURE__ */
|
|
736
|
+
}, corner, /* @__PURE__ */ React15.createElement("h1", {
|
|
999
737
|
...!titleSrOnly && {
|
|
1000
738
|
id: titleId
|
|
1001
739
|
},
|
|
1002
|
-
className:
|
|
1003
|
-
}, title), titleSrOnly && /* @__PURE__ */
|
|
740
|
+
className: mx13(descriptionText6, "text-center mlb-2", titleSrOnly && "invisible")
|
|
741
|
+
}, title), titleSrOnly && /* @__PURE__ */ React15.createElement("span", {
|
|
1004
742
|
id: titleId
|
|
1005
743
|
}, title), children);
|
|
1006
744
|
});
|
|
1007
745
|
|
|
1008
746
|
// packages/sdk/shell/src/components/Panel/Label.tsx
|
|
1009
|
-
import
|
|
1010
|
-
import { descriptionText as descriptionText7, mx as
|
|
747
|
+
import React16 from "react";
|
|
748
|
+
import { descriptionText as descriptionText7, mx as mx14 } from "@dxos/react-ui-theme";
|
|
1011
749
|
var Label = (props) => {
|
|
1012
750
|
const { children } = props;
|
|
1013
|
-
return /* @__PURE__ */
|
|
1014
|
-
className:
|
|
751
|
+
return /* @__PURE__ */ React16.createElement("span", {
|
|
752
|
+
className: mx14(descriptionText7, "text-center mli-6 whitespace-normal")
|
|
1015
753
|
}, children);
|
|
1016
754
|
};
|
|
1017
755
|
|
|
1018
756
|
// packages/sdk/shell/src/components/Panel/Input.tsx
|
|
1019
|
-
import
|
|
757
|
+
import React17 from "react";
|
|
1020
758
|
import { Input as UiInput } from "@dxos/react-ui";
|
|
1021
759
|
var Input = ({ validationMessage, label, ...props }) => {
|
|
1022
|
-
return /* @__PURE__ */
|
|
760
|
+
return /* @__PURE__ */ React17.createElement(UiInput.Root, null, /* @__PURE__ */ React17.createElement(UiInput.Label, null, label), /* @__PURE__ */ React17.createElement(UiInput.TextInput, {
|
|
1023
761
|
...props,
|
|
1024
762
|
classNames: "plb-3 mbs-2 text-center"
|
|
1025
|
-
}), /* @__PURE__ */
|
|
763
|
+
}), /* @__PURE__ */ React17.createElement(UiInput.DescriptionAndValidation, null, validationMessage && /* @__PURE__ */ React17.createElement(UiInput.Validation, null, validationMessage)));
|
|
1026
764
|
};
|
|
1027
765
|
|
|
1028
766
|
// packages/sdk/shell/src/components/Panel/StepHeading.tsx
|
|
1029
|
-
import
|
|
1030
|
-
import { mx as
|
|
767
|
+
import React18, { forwardRef as forwardRef6 } from "react";
|
|
768
|
+
import { mx as mx15 } from "@dxos/react-ui-theme";
|
|
1031
769
|
var StepHeading = /* @__PURE__ */ forwardRef6(({ children, className, ...props }, forwardedRef) => {
|
|
1032
|
-
return /* @__PURE__ */
|
|
770
|
+
return /* @__PURE__ */ React18.createElement("h2", {
|
|
1033
771
|
...props,
|
|
1034
|
-
className:
|
|
772
|
+
className: mx15("font-normal text-sm mbe-4 mli-1 text-center", className),
|
|
1035
773
|
ref: forwardedRef
|
|
1036
774
|
}, children);
|
|
1037
775
|
});
|
|
@@ -1039,31 +777,31 @@ var StepHeading = /* @__PURE__ */ forwardRef6(({ children, className, ...props }
|
|
|
1039
777
|
// packages/sdk/shell/src/components/Viewport/Viewport.tsx
|
|
1040
778
|
import { useFocusFinders } from "@fluentui/react-tabster";
|
|
1041
779
|
import { createContextScope } from "@radix-ui/react-context";
|
|
1042
|
-
import { useControllableState as
|
|
1043
|
-
import
|
|
780
|
+
import { useControllableState as useControllableState2 } from "@radix-ui/react-use-controllable-state";
|
|
781
|
+
import React19, { forwardRef as forwardRef7, useEffect } from "react";
|
|
1044
782
|
import { useForwardedRef } from "@dxos/react-ui";
|
|
1045
|
-
import { mx as
|
|
783
|
+
import { mx as mx16 } from "@dxos/react-ui-theme";
|
|
1046
784
|
var VIEWPORT_NAME = "Viewport";
|
|
1047
785
|
var VIEWS_NAME = "ViewportViews";
|
|
1048
786
|
var VIEW_NAME = "ViewportView";
|
|
1049
787
|
var [createViewportContext, createViewportScope] = createContextScope(VIEWPORT_NAME, []);
|
|
1050
788
|
var [ViewportProvider, useViewportContext] = createViewportContext(VIEWPORT_NAME);
|
|
1051
789
|
var ViewportRoot = ({ __viewportScope, classNames, children, defaultActiveView, activeView: propsActiveView, focusManaged = false, onActiveViewChange, ...props }) => {
|
|
1052
|
-
const [activeView = "never", setActiveView] =
|
|
790
|
+
const [activeView = "never", setActiveView] = useControllableState2({
|
|
1053
791
|
prop: propsActiveView,
|
|
1054
792
|
defaultProp: defaultActiveView,
|
|
1055
793
|
onChange: onActiveViewChange
|
|
1056
794
|
});
|
|
1057
|
-
return /* @__PURE__ */
|
|
795
|
+
return /* @__PURE__ */ React19.createElement(ViewportProvider, {
|
|
1058
796
|
focusManaged,
|
|
1059
797
|
activeView,
|
|
1060
798
|
setActiveView,
|
|
1061
799
|
scope: __viewportScope
|
|
1062
|
-
}, /* @__PURE__ */
|
|
800
|
+
}, /* @__PURE__ */ React19.createElement("div", {
|
|
1063
801
|
role: "region",
|
|
1064
802
|
"aria-live": "polite",
|
|
1065
803
|
...props,
|
|
1066
|
-
className:
|
|
804
|
+
className: mx16("is-full overflow-hidden", classNames)
|
|
1067
805
|
}, children));
|
|
1068
806
|
};
|
|
1069
807
|
ViewportRoot.displayName = VIEWPORT_NAME;
|
|
@@ -1071,11 +809,11 @@ var ViewportViews = ({ classNames, children, ...props }) => {
|
|
|
1071
809
|
const size = {
|
|
1072
810
|
inlineSize: `${Math.ceil(children.length) * 100}%`
|
|
1073
811
|
};
|
|
1074
|
-
return /* @__PURE__ */
|
|
812
|
+
return /* @__PURE__ */ React19.createElement("div", {
|
|
1075
813
|
role: "none",
|
|
1076
814
|
style: size,
|
|
1077
815
|
...props,
|
|
1078
|
-
className:
|
|
816
|
+
className: mx16("flex", classNames)
|
|
1079
817
|
}, children);
|
|
1080
818
|
};
|
|
1081
819
|
ViewportViews.displayName = VIEWS_NAME;
|
|
@@ -1093,12 +831,12 @@ var ViewportView = /* @__PURE__ */ forwardRef7(({ __viewportScope, classNames, c
|
|
|
1093
831
|
ref.current,
|
|
1094
832
|
isActive
|
|
1095
833
|
]);
|
|
1096
|
-
return /* @__PURE__ */
|
|
834
|
+
return /* @__PURE__ */ React19.createElement("section", {
|
|
1097
835
|
...props,
|
|
1098
836
|
...!isActive && {
|
|
1099
837
|
"aria-hidden": true
|
|
1100
838
|
},
|
|
1101
|
-
className:
|
|
839
|
+
className: mx16("min-is-0 flex-1 flex flex-col", isActive ? "order-2" : "order-4 invisible", classNames),
|
|
1102
840
|
ref
|
|
1103
841
|
}, children);
|
|
1104
842
|
});
|
|
@@ -1110,43 +848,44 @@ var Viewport = {
|
|
|
1110
848
|
};
|
|
1111
849
|
|
|
1112
850
|
// packages/sdk/shell/src/components/SpaceListItem.tsx
|
|
1113
|
-
import
|
|
851
|
+
import React20, { forwardRef as forwardRef8 } from "react";
|
|
1114
852
|
import { Avatar as Avatar5, useId as useId4 } from "@dxos/react-ui";
|
|
1115
|
-
import { mx as
|
|
853
|
+
import { mx as mx17 } from "@dxos/react-ui-theme";
|
|
1116
854
|
import { humanize, keyToEmoji } from "@dxos/util";
|
|
1117
855
|
var SpaceListItem = /* @__PURE__ */ forwardRef8(({ space, onClick }, ref) => {
|
|
1118
856
|
const fallbackValue = keyToEmoji(space.key);
|
|
1119
857
|
const labelId = useId4("identityListItem__label");
|
|
1120
858
|
const displayName = space.properties.name ?? humanize(space.key.toHex());
|
|
1121
|
-
return /* @__PURE__ */
|
|
1122
|
-
className:
|
|
859
|
+
return /* @__PURE__ */ React20.createElement("li", {
|
|
860
|
+
className: mx17("flex gap-2 items-center mbe-2", onClick && "cursor-pointer"),
|
|
1123
861
|
onClick: () => onClick?.(),
|
|
1124
862
|
ref,
|
|
1125
863
|
"data-testid": "space-list-item"
|
|
1126
|
-
}, /* @__PURE__ */
|
|
864
|
+
}, /* @__PURE__ */ React20.createElement(Avatar5.Root, {
|
|
1127
865
|
labelId
|
|
1128
|
-
}, /* @__PURE__ */
|
|
866
|
+
}, /* @__PURE__ */ React20.createElement(Avatar5.Frame, null, /* @__PURE__ */ React20.createElement(Avatar5.Fallback, {
|
|
1129
867
|
text: fallbackValue
|
|
1130
|
-
})), /* @__PURE__ */
|
|
868
|
+
})), /* @__PURE__ */ React20.createElement(Avatar5.Label, {
|
|
1131
869
|
classNames: "text-sm truncate"
|
|
1132
870
|
}, displayName)));
|
|
1133
871
|
});
|
|
1134
872
|
|
|
1135
873
|
// packages/sdk/shell/src/composites/IdentityDialog/IdentityDialog.tsx
|
|
1136
|
-
import
|
|
874
|
+
import React38 from "react";
|
|
1137
875
|
import { Clipboard as Clipboard3, Dialog, useId as useId10 } from "@dxos/react-ui";
|
|
1138
876
|
|
|
1139
877
|
// packages/sdk/shell/src/panels/IdentityPanel/IdentityPanel.tsx
|
|
1140
878
|
import { Key, Plugs, PlugsConnected } from "@phosphor-icons/react";
|
|
1141
|
-
import
|
|
879
|
+
import React25, { useEffect as useEffect4, useMemo as useMemo3, useState as useState5 } from "react";
|
|
1142
880
|
import { generateName as generateName3 } from "@dxos/display-name";
|
|
1143
881
|
import { log as log7 } from "@dxos/log";
|
|
1144
882
|
import { useClient as useClient6 } from "@dxos/react-client";
|
|
1145
883
|
import { useIdentity, useDevices, useHaloInvitations as useHaloInvitations2 } from "@dxos/react-client/halo";
|
|
1146
884
|
import { useInvitationStatus as useInvitationStatus2 } from "@dxos/react-client/invitations";
|
|
1147
885
|
import { useNetworkStatus, ConnectionState as ConnectionState2 } from "@dxos/react-client/mesh";
|
|
1148
|
-
import { Avatar as Avatar6, Input as Input2, Toolbar
|
|
1149
|
-
import {
|
|
886
|
+
import { Avatar as Avatar6, Input as Input2, Toolbar, Tooltip as Tooltip3, useClipboard as useClipboard2, useId as useId6, useTranslation as useTranslation11 } from "@dxos/react-ui";
|
|
887
|
+
import { EmojiPickerToolbarButton, HuePickerToolbarButton } from "@dxos/react-ui-pickers";
|
|
888
|
+
import { getSize as getSize10 } from "@dxos/react-ui-theme";
|
|
1150
889
|
import { hexToEmoji as hexToEmoji4, hexToHue as hexToHue2, keyToFallback as keyToFallback3 } from "@dxos/util";
|
|
1151
890
|
|
|
1152
891
|
// packages/sdk/shell/src/panels/IdentityPanel/identityMachine.ts
|
|
@@ -1262,7 +1001,7 @@ var useIdentityMachine = (client, options) => {
|
|
|
1262
1001
|
};
|
|
1263
1002
|
|
|
1264
1003
|
// packages/sdk/shell/src/panels/IdentityPanel/steps/IdentityActionChooser.tsx
|
|
1265
|
-
import
|
|
1004
|
+
import React21 from "react";
|
|
1266
1005
|
import { log as log2 } from "@dxos/log";
|
|
1267
1006
|
import { useClient as useClient2 } from "@dxos/react-client";
|
|
1268
1007
|
import { useHaloInvitations, DeviceType as DeviceType2 } from "@dxos/react-client/halo";
|
|
@@ -1298,7 +1037,7 @@ var IdentityActionChooser = (props) => {
|
|
|
1298
1037
|
});
|
|
1299
1038
|
};
|
|
1300
1039
|
const isProduction = client.config.values.runtime?.app?.env?.DX_ENVIRONMENT === "production";
|
|
1301
|
-
return /* @__PURE__ */
|
|
1040
|
+
return /* @__PURE__ */ React21.createElement(IdentityActionChooserImpl, {
|
|
1302
1041
|
...props,
|
|
1303
1042
|
onClickAdd: createInvitation,
|
|
1304
1043
|
onClickJoinExisting: () => send?.({
|
|
@@ -1314,10 +1053,10 @@ var IdentityActionChooser = (props) => {
|
|
|
1314
1053
|
};
|
|
1315
1054
|
var IdentityActionChooserImpl = ({ devices, connectionState, agentHostingEnabled, onClickAdd, onClickJoinExisting, onClickRecover, onClickReset, ...agentProps }) => {
|
|
1316
1055
|
const edgeDeviceAvailable = devices.find((device) => device.profile?.type === DeviceType2.AGENT_MANAGED && device.profile?.os?.toUpperCase() === "EDGE");
|
|
1317
|
-
return /* @__PURE__ */
|
|
1056
|
+
return /* @__PURE__ */ React21.createElement("div", {
|
|
1318
1057
|
role: "none",
|
|
1319
1058
|
className: "bs-40 grow overflow-y-auto"
|
|
1320
|
-
}, /* @__PURE__ */
|
|
1059
|
+
}, /* @__PURE__ */ React21.createElement(DeviceList, {
|
|
1321
1060
|
devices,
|
|
1322
1061
|
connectionState,
|
|
1323
1062
|
onClickAdd,
|
|
@@ -1325,20 +1064,21 @@ var IdentityActionChooserImpl = ({ devices, connectionState, agentHostingEnabled
|
|
|
1325
1064
|
onClickRecover: agentProps.agentStatus === "created" ? onClickRecover : void 0,
|
|
1326
1065
|
onClickReset,
|
|
1327
1066
|
onAgentDestroy: agentProps.onAgentDestroy
|
|
1328
|
-
}), !edgeDeviceAvailable && agentHostingEnabled && /* @__PURE__ */
|
|
1067
|
+
}), !edgeDeviceAvailable && agentHostingEnabled && /* @__PURE__ */ React21.createElement(AgentConfig, agentProps));
|
|
1329
1068
|
};
|
|
1330
1069
|
|
|
1331
1070
|
// packages/sdk/shell/src/panels/IdentityPanel/steps/ProfileForm.tsx
|
|
1332
|
-
import
|
|
1071
|
+
import React22, { useState } from "react";
|
|
1333
1072
|
import { log as log3 } from "@dxos/log";
|
|
1334
|
-
import { useClipboard, useTranslation as
|
|
1073
|
+
import { useClipboard, useTranslation as useTranslation8 } from "@dxos/react-ui";
|
|
1074
|
+
import { EmojiPickerBlock, HuePickerBlock } from "@dxos/react-ui-pickers";
|
|
1335
1075
|
import { hexToEmoji as hexToEmoji2, hexToHue } from "@dxos/util";
|
|
1336
1076
|
|
|
1337
1077
|
// packages/sdk/shell/src/panels/IdentityPanel/useAgentHandlers.ts
|
|
1338
1078
|
import { useClient as useClient5 } from "@dxos/react-client";
|
|
1339
1079
|
|
|
1340
1080
|
// packages/sdk/shell/src/panels/IdentityPanel/useEdgeAgentsHandlers.ts
|
|
1341
|
-
import { useEffect as useEffect2, useState as
|
|
1081
|
+
import { useEffect as useEffect2, useState as useState2 } from "react";
|
|
1342
1082
|
import { invariant } from "@dxos/invariant";
|
|
1343
1083
|
import { log as log4 } from "@dxos/log";
|
|
1344
1084
|
import { QueryAgentStatusResponse } from "@dxos/protocols/proto/dxos/client/services";
|
|
@@ -1346,9 +1086,9 @@ import { EdgeReplicationSetting } from "@dxos/protocols/proto/dxos/echo/metadata
|
|
|
1346
1086
|
import { useClient as useClient3 } from "@dxos/react-client";
|
|
1347
1087
|
var __dxlog_file3 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/IdentityPanel/useEdgeAgentsHandlers.ts";
|
|
1348
1088
|
var useEdgeAgentHandlers = ({ identity }) => {
|
|
1349
|
-
const [validationMessage, setValidationMessage] =
|
|
1350
|
-
const [lastReceivedStatus, setLastReceivedStatus] =
|
|
1351
|
-
const [agentStatus, setAgentStatus] =
|
|
1089
|
+
const [validationMessage, setValidationMessage] = useState2("");
|
|
1090
|
+
const [lastReceivedStatus, setLastReceivedStatus] = useState2(QueryAgentStatusResponse.AgentStatus.UNKNOWN);
|
|
1091
|
+
const [agentStatus, setAgentStatus] = useState2("getting");
|
|
1352
1092
|
const client = useClient3();
|
|
1353
1093
|
const agentHostingEnabled = Boolean(client.config.values.runtime?.client?.edgeFeatures?.agents);
|
|
1354
1094
|
const handleStatus = (status) => {
|
|
@@ -1434,15 +1174,15 @@ var useEdgeAgentHandlers = ({ identity }) => {
|
|
|
1434
1174
|
};
|
|
1435
1175
|
|
|
1436
1176
|
// packages/sdk/shell/src/panels/IdentityPanel/useKubeAgentHandlers.ts
|
|
1437
|
-
import { useCallback as useCallback3, useEffect as useEffect3, useState as
|
|
1177
|
+
import { useCallback as useCallback3, useEffect as useEffect3, useState as useState3 } from "react";
|
|
1438
1178
|
import { invariant as invariant2 } from "@dxos/invariant";
|
|
1439
1179
|
import { log as log5 } from "@dxos/log";
|
|
1440
1180
|
import { useClient as useClient4, useAgentHostingClient } from "@dxos/react-client";
|
|
1441
1181
|
import { Invitation as Invitation3, InvitationEncoder as InvitationEncoder2 } from "@dxos/react-client/invitations";
|
|
1442
1182
|
var __dxlog_file4 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/IdentityPanel/useKubeAgentHandlers.ts";
|
|
1443
1183
|
var useKubeAgentHandlers = ({ invitations, identity }) => {
|
|
1444
|
-
const [validationMessage, setValidationMessage] =
|
|
1445
|
-
const [agentStatus, setAgentStatus] =
|
|
1184
|
+
const [validationMessage, setValidationMessage] = useState3("");
|
|
1185
|
+
const [agentStatus, setAgentStatus] = useState3("getting");
|
|
1446
1186
|
const agentHostingProviderClient = useAgentHostingClient();
|
|
1447
1187
|
const client = useClient4();
|
|
1448
1188
|
const updateAgentStatus = async () => {
|
|
@@ -1571,11 +1311,11 @@ var useAgentHandlers = (params) => {
|
|
|
1571
1311
|
};
|
|
1572
1312
|
|
|
1573
1313
|
// packages/sdk/shell/src/steps/InvitationManager.tsx
|
|
1574
|
-
import { Check as
|
|
1575
|
-
import
|
|
1314
|
+
import { Check as Check2, X as X3 } from "@phosphor-icons/react";
|
|
1315
|
+
import React23, { useMemo as useMemo2 } from "react";
|
|
1576
1316
|
import { QR } from "react-qr-rounded";
|
|
1577
|
-
import { Clipboard as Clipboard2, useId as useId5, useTranslation as
|
|
1578
|
-
import { descriptionText as descriptionText8, getSize as
|
|
1317
|
+
import { Clipboard as Clipboard2, useId as useId5, useTranslation as useTranslation9 } from "@dxos/react-ui";
|
|
1318
|
+
import { descriptionText as descriptionText8, getSize as getSize8, mx as mx18 } from "@dxos/react-ui-theme";
|
|
1579
1319
|
import { hexToEmoji as hexToEmoji3 } from "@dxos/util";
|
|
1580
1320
|
|
|
1581
1321
|
// packages/sdk/shell/src/util/invitationStatusValue.ts
|
|
@@ -1621,13 +1361,13 @@ var invitationStatusValue = /* @__PURE__ */ new Map([
|
|
|
1621
1361
|
|
|
1622
1362
|
// packages/sdk/shell/src/steps/InvitationManager.tsx
|
|
1623
1363
|
var InvitationManagerView = ({ children, ...props }) => {
|
|
1624
|
-
return /* @__PURE__ */
|
|
1364
|
+
return /* @__PURE__ */ React23.createElement(Viewport.View, {
|
|
1625
1365
|
...props,
|
|
1626
1366
|
classNames: "grow flex flex-col justify-around items-center"
|
|
1627
1367
|
}, children);
|
|
1628
1368
|
};
|
|
1629
1369
|
var InvitationManager = ({ invitationUrl, active, send, status, multiUse, authCode, id = "0" }) => {
|
|
1630
|
-
const { t } =
|
|
1370
|
+
const { t } = useTranslation9("os");
|
|
1631
1371
|
const qrLabel = useId5("invitation-manager__qr-code");
|
|
1632
1372
|
const statusValue = multiUse ? 0 : invitationStatusValue.get(status) ?? 0;
|
|
1633
1373
|
const showAuthCode = statusValue === 3;
|
|
@@ -1648,50 +1388,50 @@ var InvitationManager = ({ invitationUrl, active, send, status, multiUse, authCo
|
|
|
1648
1388
|
}, [
|
|
1649
1389
|
statusValue
|
|
1650
1390
|
]);
|
|
1651
|
-
return /* @__PURE__ */
|
|
1391
|
+
return /* @__PURE__ */ React23.createElement(React23.Fragment, null, /* @__PURE__ */ React23.createElement(Viewport.Root, {
|
|
1652
1392
|
activeView,
|
|
1653
1393
|
classNames: "grow plb-1"
|
|
1654
|
-
}, /* @__PURE__ */
|
|
1394
|
+
}, /* @__PURE__ */ React23.createElement(Viewport.Views, null, /* @__PURE__ */ React23.createElement(InvitationManagerView, {
|
|
1655
1395
|
id: "showing qr",
|
|
1656
1396
|
emoji
|
|
1657
|
-
}, /* @__PURE__ */
|
|
1397
|
+
}, /* @__PURE__ */ React23.createElement("p", {
|
|
1658
1398
|
className: "text-sm mlb-1 font-normal text-center"
|
|
1659
|
-
}, t(multiUse ? "invite many qr label" : "invite one qr label")), /* @__PURE__ */
|
|
1399
|
+
}, t(multiUse ? "invite many qr label" : "invite one qr label")), /* @__PURE__ */ React23.createElement("div", {
|
|
1660
1400
|
role: "none",
|
|
1661
|
-
className:
|
|
1662
|
-
}, /* @__PURE__ */
|
|
1401
|
+
className: mx18(descriptionText8, "is-full max-is-[14rem] relative")
|
|
1402
|
+
}, /* @__PURE__ */ React23.createElement(QR, {
|
|
1663
1403
|
rounding: 100,
|
|
1664
1404
|
backgroundColor: "transparent",
|
|
1665
1405
|
color: "currentColor",
|
|
1666
|
-
className:
|
|
1406
|
+
className: mx18("is-full bs-full p-2", showAuthCode && "invisible"),
|
|
1667
1407
|
"aria-labelledby": qrLabel,
|
|
1668
1408
|
errorCorrectionLevel: "Q",
|
|
1669
1409
|
cutout: true
|
|
1670
|
-
}, invitationUrl ?? "never"), /* @__PURE__ */
|
|
1410
|
+
}, invitationUrl ?? "never"), /* @__PURE__ */ React23.createElement(Centered, null, /* @__PURE__ */ React23.createElement(Emoji, {
|
|
1671
1411
|
text: emoji
|
|
1672
|
-
}))), /* @__PURE__ */
|
|
1412
|
+
}))), /* @__PURE__ */ React23.createElement("span", {
|
|
1673
1413
|
id: qrLabel,
|
|
1674
1414
|
className: "sr-only"
|
|
1675
|
-
}, t("qr label")), /* @__PURE__ */
|
|
1415
|
+
}, t("qr label")), /* @__PURE__ */ React23.createElement(Clipboard2.Button, {
|
|
1676
1416
|
variant: "ghost",
|
|
1677
1417
|
value: invitationUrl ?? "never"
|
|
1678
|
-
})), /* @__PURE__ */
|
|
1418
|
+
})), /* @__PURE__ */ React23.createElement(InvitationManagerView, {
|
|
1679
1419
|
id: "showing auth code"
|
|
1680
|
-
}, /* @__PURE__ */
|
|
1420
|
+
}, /* @__PURE__ */ React23.createElement(Label, null, t("auth code message")), /* @__PURE__ */ React23.createElement(AuthCode, {
|
|
1681
1421
|
code: authCode,
|
|
1682
1422
|
large: true,
|
|
1683
1423
|
classNames: "text-black dark:text-white"
|
|
1684
|
-
}), /* @__PURE__ */
|
|
1424
|
+
}), /* @__PURE__ */ React23.createElement(Label, null, t("auth other device emoji message")), emoji && /* @__PURE__ */ React23.createElement(Emoji, {
|
|
1685
1425
|
text: emoji
|
|
1686
|
-
})), /* @__PURE__ */
|
|
1426
|
+
})), /* @__PURE__ */ React23.createElement(InvitationManagerView, {
|
|
1687
1427
|
id: "showing final"
|
|
1688
|
-
}, statusValue > 0 ? /* @__PURE__ */
|
|
1689
|
-
className:
|
|
1690
|
-
}) : /* @__PURE__ */
|
|
1691
|
-
className:
|
|
1692
|
-
})))), /* @__PURE__ */
|
|
1428
|
+
}, statusValue > 0 ? /* @__PURE__ */ React23.createElement(Check2, {
|
|
1429
|
+
className: mx18("m-1.5", getSize8(6))
|
|
1430
|
+
}) : /* @__PURE__ */ React23.createElement(X3, {
|
|
1431
|
+
className: mx18("m-1.5", getSize8(6))
|
|
1432
|
+
})))), /* @__PURE__ */ React23.createElement(Actions, {
|
|
1693
1433
|
classNames: "mbs-4"
|
|
1694
|
-
}, /* @__PURE__ */
|
|
1434
|
+
}, /* @__PURE__ */ React23.createElement(Action, {
|
|
1695
1435
|
disabled: !active,
|
|
1696
1436
|
onClick: () => send?.({
|
|
1697
1437
|
type: "deselectInvitation"
|
|
@@ -1701,15 +1441,15 @@ var InvitationManager = ({ invitationUrl, active, send, status, multiUse, authCo
|
|
|
1701
1441
|
|
|
1702
1442
|
// packages/sdk/shell/src/steps/ConfirmReset.tsx
|
|
1703
1443
|
import { Warning } from "@phosphor-icons/react";
|
|
1704
|
-
import
|
|
1444
|
+
import React24, { useState as useState4 } from "react";
|
|
1705
1445
|
import { log as log6 } from "@dxos/log";
|
|
1706
|
-
import { Message, useTranslation as
|
|
1707
|
-
import { getSize as
|
|
1446
|
+
import { Message, useTranslation as useTranslation10 } from "@dxos/react-ui";
|
|
1447
|
+
import { getSize as getSize9, mx as mx19 } from "@dxos/react-ui-theme";
|
|
1708
1448
|
var __dxlog_file5 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/steps/ConfirmReset.tsx";
|
|
1709
1449
|
var ConfirmReset = ({ active, onCancel, onConfirm, mode }) => {
|
|
1710
|
-
const { t } =
|
|
1711
|
-
const [validationMessage, setValidationMessage] =
|
|
1712
|
-
const [pending, setPending] =
|
|
1450
|
+
const { t } = useTranslation10("os");
|
|
1451
|
+
const [validationMessage, setValidationMessage] = useState4("");
|
|
1452
|
+
const [pending, setPending] = useState4(false);
|
|
1713
1453
|
const processReset = async () => {
|
|
1714
1454
|
setPending(true);
|
|
1715
1455
|
return onConfirm?.().then(() => setPending(false), (error) => {
|
|
@@ -1723,7 +1463,7 @@ var ConfirmReset = ({ active, onCancel, onConfirm, mode }) => {
|
|
|
1723
1463
|
setPending(false);
|
|
1724
1464
|
});
|
|
1725
1465
|
};
|
|
1726
|
-
return /* @__PURE__ */
|
|
1466
|
+
return /* @__PURE__ */ React24.createElement(ConfirmResetImpl, {
|
|
1727
1467
|
disabled: !active,
|
|
1728
1468
|
pending,
|
|
1729
1469
|
validationMessage,
|
|
@@ -1733,20 +1473,20 @@ var ConfirmReset = ({ active, onCancel, onConfirm, mode }) => {
|
|
|
1733
1473
|
});
|
|
1734
1474
|
};
|
|
1735
1475
|
var ConfirmResetImpl = ({ disabled, pending, validationMessage, onConfirm, onCancel, mode }) => {
|
|
1736
|
-
const { t } =
|
|
1476
|
+
const { t } = useTranslation10("os");
|
|
1737
1477
|
const confirmationValue = t("confirmation value");
|
|
1738
|
-
const [inputValue, setInputValue] =
|
|
1478
|
+
const [inputValue, setInputValue] = useState4("");
|
|
1739
1479
|
const testIdAffix = mode === "join new identity" ? "join-new-identity" : mode === "recover" ? "recover" : "reset-storage";
|
|
1740
|
-
return /* @__PURE__ */
|
|
1480
|
+
return /* @__PURE__ */ React24.createElement(React24.Fragment, null, /* @__PURE__ */ React24.createElement("div", {
|
|
1741
1481
|
role: "none",
|
|
1742
1482
|
className: "grow flex flex-col gap-2 justify-center"
|
|
1743
|
-
}, /* @__PURE__ */
|
|
1483
|
+
}, /* @__PURE__ */ React24.createElement(Message.Root, {
|
|
1744
1484
|
valence: "error"
|
|
1745
|
-
}, /* @__PURE__ */
|
|
1746
|
-
className:
|
|
1747
|
-
}), t("sign out chooser title")), /* @__PURE__ */
|
|
1485
|
+
}, /* @__PURE__ */ React24.createElement(Message.Title, null, /* @__PURE__ */ React24.createElement(Warning, {
|
|
1486
|
+
className: mx19(getSize9(6), "inline mie-2")
|
|
1487
|
+
}), t("sign out chooser title")), /* @__PURE__ */ React24.createElement(Message.Body, null, t("sign out chooser message"))), /* @__PURE__ */ React24.createElement(Input, {
|
|
1748
1488
|
validationMessage,
|
|
1749
|
-
label: /* @__PURE__ */
|
|
1489
|
+
label: /* @__PURE__ */ React24.createElement(StepHeading, {
|
|
1750
1490
|
className: "text-start mlb-2"
|
|
1751
1491
|
}, t(mode === "join new identity" ? "join new identity input label" : mode === "recover" ? "recover reset input label" : "reset storage input label", {
|
|
1752
1492
|
confirmationValue
|
|
@@ -1757,11 +1497,11 @@ var ConfirmResetImpl = ({ disabled, pending, validationMessage, onConfirm, onCan
|
|
|
1757
1497
|
confirmationValue
|
|
1758
1498
|
}),
|
|
1759
1499
|
onChange: ({ target: { value } }) => setInputValue(value)
|
|
1760
|
-
})), /* @__PURE__ */
|
|
1500
|
+
})), /* @__PURE__ */ React24.createElement(Actions, null, onCancel && /* @__PURE__ */ React24.createElement(Action, {
|
|
1761
1501
|
disabled,
|
|
1762
1502
|
onClick: onCancel,
|
|
1763
1503
|
"data-testid": `${testIdAffix}.reset-identity-cancel`
|
|
1764
|
-
}, t("cancel label")), onConfirm && /* @__PURE__ */
|
|
1504
|
+
}, t("cancel label")), onConfirm && /* @__PURE__ */ React24.createElement(Action, {
|
|
1765
1505
|
variant: "destructive",
|
|
1766
1506
|
disabled: disabled || pending || inputValue !== confirmationValue,
|
|
1767
1507
|
onClick: onConfirm,
|
|
@@ -1776,10 +1516,10 @@ var getHueValue = (identity) => identity?.profile?.data?.hue || hexToHue2(identi
|
|
|
1776
1516
|
var getEmojiValue = (identity) => identity?.profile?.data?.emoji || hexToEmoji4(identity?.identityKey.toHex() ?? "0");
|
|
1777
1517
|
var IdentityHeading = ({ titleId, title, identity, onDone, onUpdateProfile, connectionState, onChangeConnectionState }) => {
|
|
1778
1518
|
const fallbackValue = keyToFallback3(identity.identityKey);
|
|
1779
|
-
const { t } =
|
|
1780
|
-
const [displayName, setDisplayName] =
|
|
1781
|
-
const [emoji, setEmojiDirectly] =
|
|
1782
|
-
const [hue, setHueDirectly] =
|
|
1519
|
+
const { t } = useTranslation11("os");
|
|
1520
|
+
const [displayName, setDisplayName] = useState5(identity.profile?.displayName ?? "");
|
|
1521
|
+
const [emoji, setEmojiDirectly] = useState5(getEmojiValue(identity));
|
|
1522
|
+
const [hue, setHueDirectly] = useState5(getHueValue(identity));
|
|
1783
1523
|
const { textValue, setTextValue } = useClipboard2();
|
|
1784
1524
|
const identityHex = identity.identityKey.toHex();
|
|
1785
1525
|
const publicKeyCopied = textValue === identityHex;
|
|
@@ -1804,29 +1544,29 @@ var IdentityHeading = ({ titleId, title, identity, onDone, onUpdateProfile, conn
|
|
|
1804
1544
|
});
|
|
1805
1545
|
};
|
|
1806
1546
|
const isConnected = connectionState === ConnectionState2.ONLINE;
|
|
1807
|
-
return /* @__PURE__ */
|
|
1547
|
+
return /* @__PURE__ */ React25.createElement(Heading, {
|
|
1808
1548
|
titleId,
|
|
1809
1549
|
title,
|
|
1810
|
-
corner: /* @__PURE__ */
|
|
1550
|
+
corner: /* @__PURE__ */ React25.createElement(CloseButton, {
|
|
1811
1551
|
onDone
|
|
1812
1552
|
})
|
|
1813
|
-
}, /* @__PURE__ */
|
|
1553
|
+
}, /* @__PURE__ */ React25.createElement(Avatar6.Root, {
|
|
1814
1554
|
size: 16,
|
|
1815
1555
|
variant: "circle",
|
|
1816
1556
|
status: isConnected ? "active" : "error",
|
|
1817
1557
|
hue: hue || fallbackValue.hue
|
|
1818
|
-
}, /* @__PURE__ */
|
|
1558
|
+
}, /* @__PURE__ */ React25.createElement(Toolbar.Root, {
|
|
1819
1559
|
classNames: "flex justify-center"
|
|
1820
|
-
}, /* @__PURE__ */
|
|
1560
|
+
}, /* @__PURE__ */ React25.createElement(Avatar6.Frame, {
|
|
1821
1561
|
classNames: "relative z-[2] -mli-4 chromatic-ignore"
|
|
1822
|
-
}, /* @__PURE__ */
|
|
1562
|
+
}, /* @__PURE__ */ React25.createElement(Avatar6.Fallback, {
|
|
1823
1563
|
text: emoji || fallbackValue.emoji
|
|
1824
|
-
}))), /* @__PURE__ */
|
|
1564
|
+
}))), /* @__PURE__ */ React25.createElement(Avatar6.Label, {
|
|
1825
1565
|
classNames: "sr-only",
|
|
1826
1566
|
"data-testid": "identityHeading.displayName"
|
|
1827
|
-
}, identity.profile?.displayName ?? generateName3(identity.identityKey.toHex())), /* @__PURE__ */
|
|
1567
|
+
}, identity.profile?.displayName ?? generateName3(identity.identityKey.toHex())), /* @__PURE__ */ React25.createElement(Input2.Root, null, /* @__PURE__ */ React25.createElement(Input2.Label, {
|
|
1828
1568
|
srOnly: true
|
|
1829
|
-
}, t("display name input label")), /* @__PURE__ */
|
|
1569
|
+
}, t("display name input label")), /* @__PURE__ */ React25.createElement(Input2.TextInput, {
|
|
1830
1570
|
variant: "subdued",
|
|
1831
1571
|
"data-testid": "display-name-input",
|
|
1832
1572
|
placeholder: t("display name input placeholder"),
|
|
@@ -1837,49 +1577,49 @@ var IdentityHeading = ({ titleId, title, identity, onDone, onUpdateProfile, conn
|
|
|
1837
1577
|
...identity.profile,
|
|
1838
1578
|
displayName: value
|
|
1839
1579
|
})
|
|
1840
|
-
})), /* @__PURE__ */
|
|
1580
|
+
})), /* @__PURE__ */ React25.createElement(Toolbar.Root, {
|
|
1841
1581
|
classNames: "flex justify-center items-center gap-1 pt-3"
|
|
1842
|
-
}, /* @__PURE__ */
|
|
1582
|
+
}, /* @__PURE__ */ React25.createElement(EmojiPickerToolbarButton, {
|
|
1843
1583
|
emoji,
|
|
1844
1584
|
onChangeEmoji: setEmoji,
|
|
1845
1585
|
classNames: "bs-[--rail-action]"
|
|
1846
|
-
}), /* @__PURE__ */
|
|
1586
|
+
}), /* @__PURE__ */ React25.createElement(HuePickerToolbarButton, {
|
|
1847
1587
|
hue,
|
|
1848
1588
|
onChangeHue: setHue,
|
|
1849
1589
|
classNames: "bs-[--rail-action]"
|
|
1850
|
-
}), /* @__PURE__ */
|
|
1590
|
+
}), /* @__PURE__ */ React25.createElement(Tooltip3.Root, null, /* @__PURE__ */ React25.createElement(Tooltip3.Trigger, {
|
|
1851
1591
|
asChild: true
|
|
1852
|
-
}, /* @__PURE__ */
|
|
1592
|
+
}, /* @__PURE__ */ React25.createElement(Toolbar.Button, {
|
|
1853
1593
|
classNames: "bs-[--rail-action]",
|
|
1854
1594
|
"data-testid": "update-profile-form-copy-key",
|
|
1855
1595
|
onClick: () => setTextValue(identityHex)
|
|
1856
|
-
}, /* @__PURE__ */
|
|
1596
|
+
}, /* @__PURE__ */ React25.createElement("span", {
|
|
1857
1597
|
className: "sr-only"
|
|
1858
|
-
}, t(publicKeyCopied ? "copy success label" : "copy self public key label")), /* @__PURE__ */
|
|
1859
|
-
className:
|
|
1860
|
-
}))), /* @__PURE__ */
|
|
1598
|
+
}, t(publicKeyCopied ? "copy success label" : "copy self public key label")), /* @__PURE__ */ React25.createElement(Key, {
|
|
1599
|
+
className: getSize10(5)
|
|
1600
|
+
}))), /* @__PURE__ */ React25.createElement(Tooltip3.Portal, null, /* @__PURE__ */ React25.createElement(Tooltip3.Content, {
|
|
1861
1601
|
side: "bottom"
|
|
1862
|
-
}, t(publicKeyCopied ? "copy success label" : "copy self public key label"), /* @__PURE__ */
|
|
1602
|
+
}, t(publicKeyCopied ? "copy success label" : "copy self public key label"), /* @__PURE__ */ React25.createElement(Tooltip3.Arrow, null)))), /* @__PURE__ */ React25.createElement(Tooltip3.Root, null, /* @__PURE__ */ React25.createElement(Tooltip3.Trigger, {
|
|
1863
1603
|
asChild: true
|
|
1864
|
-
}, /* @__PURE__ */
|
|
1604
|
+
}, /* @__PURE__ */ React25.createElement(Toolbar.Button, {
|
|
1865
1605
|
classNames: [
|
|
1866
1606
|
"bs-[--rail-action]",
|
|
1867
1607
|
!isConnected && "text-error-500"
|
|
1868
1608
|
],
|
|
1869
1609
|
onClick: () => onChangeConnectionState?.(isConnected ? ConnectionState2.OFFLINE : ConnectionState2.ONLINE)
|
|
1870
|
-
}, /* @__PURE__ */
|
|
1610
|
+
}, /* @__PURE__ */ React25.createElement("span", {
|
|
1871
1611
|
className: "sr-only"
|
|
1872
|
-
}, t(isConnected ? "disconnect label" : "connect label")), isConnected ? /* @__PURE__ */
|
|
1873
|
-
className:
|
|
1874
|
-
}) : /* @__PURE__ */
|
|
1875
|
-
className:
|
|
1876
|
-
}))), /* @__PURE__ */
|
|
1612
|
+
}, t(isConnected ? "disconnect label" : "connect label")), isConnected ? /* @__PURE__ */ React25.createElement(PlugsConnected, {
|
|
1613
|
+
className: getSize10(5)
|
|
1614
|
+
}) : /* @__PURE__ */ React25.createElement(Plugs, {
|
|
1615
|
+
className: getSize10(5)
|
|
1616
|
+
}))), /* @__PURE__ */ React25.createElement(Tooltip3.Portal, null, /* @__PURE__ */ React25.createElement(Tooltip3.Content, {
|
|
1877
1617
|
side: "bottom"
|
|
1878
|
-
}, t(isConnected ? "disconnect label" : "connect label"), /* @__PURE__ */
|
|
1618
|
+
}, t(isConnected ? "disconnect label" : "connect label"), /* @__PURE__ */ React25.createElement(Tooltip3.Arrow, null)))))));
|
|
1879
1619
|
};
|
|
1880
1620
|
var IdentityPanelImpl = (props) => {
|
|
1881
1621
|
const { identity, titleId, activeView, onUpdateProfile, onResetStorage, onRecover, onJoinNewIdentity, IdentityActionChooser: IdentityActionChooserComponent = IdentityActionChooser, InvitationManager: InvitationManagerComponent = InvitationManager, connectionState, onChangeConnectionState, onDone, ...rest } = props;
|
|
1882
|
-
const { t } =
|
|
1622
|
+
const { t } = useTranslation11("os");
|
|
1883
1623
|
const title = useMemo3(() => {
|
|
1884
1624
|
switch (activeView) {
|
|
1885
1625
|
case "device invitation manager":
|
|
@@ -1893,7 +1633,7 @@ var IdentityPanelImpl = (props) => {
|
|
|
1893
1633
|
]);
|
|
1894
1634
|
const onCancelReset = () => rest.send?.("unchooseAction");
|
|
1895
1635
|
const hideRecover = rest.agentStatus !== "created";
|
|
1896
|
-
return /* @__PURE__ */
|
|
1636
|
+
return /* @__PURE__ */ React25.createElement(React25.Fragment, null, /* @__PURE__ */ React25.createElement(IdentityHeading, {
|
|
1897
1637
|
identity,
|
|
1898
1638
|
titleId,
|
|
1899
1639
|
title,
|
|
@@ -1902,44 +1642,44 @@ var IdentityPanelImpl = (props) => {
|
|
|
1902
1642
|
onUpdateProfile,
|
|
1903
1643
|
connectionState,
|
|
1904
1644
|
onChangeConnectionState
|
|
1905
|
-
}), /* @__PURE__ */
|
|
1645
|
+
}), /* @__PURE__ */ React25.createElement(Viewport.Root, {
|
|
1906
1646
|
activeView
|
|
1907
|
-
}, /* @__PURE__ */
|
|
1647
|
+
}, /* @__PURE__ */ React25.createElement(Viewport.Views, null, /* @__PURE__ */ React25.createElement(Viewport.View, {
|
|
1908
1648
|
id: "identity action chooser",
|
|
1909
1649
|
classNames: viewStyles
|
|
1910
|
-
}, /* @__PURE__ */
|
|
1650
|
+
}, /* @__PURE__ */ React25.createElement(IdentityActionChooserComponent, {
|
|
1911
1651
|
active: activeView === "identity action chooser",
|
|
1912
1652
|
...rest,
|
|
1913
1653
|
connectionState
|
|
1914
|
-
})), /* @__PURE__ */
|
|
1654
|
+
})), /* @__PURE__ */ React25.createElement(Viewport.View, {
|
|
1915
1655
|
id: "device invitation manager",
|
|
1916
1656
|
classNames: viewStyles
|
|
1917
|
-
}, /* @__PURE__ */
|
|
1657
|
+
}, /* @__PURE__ */ React25.createElement(InvitationManagerComponent, {
|
|
1918
1658
|
active: activeView === "device invitation manager",
|
|
1919
1659
|
...rest,
|
|
1920
1660
|
invitationUrl: rest.createInvitationUrl(rest.invitationCode)
|
|
1921
|
-
})), /* @__PURE__ */
|
|
1661
|
+
})), /* @__PURE__ */ React25.createElement(Viewport.View, {
|
|
1922
1662
|
classNames: viewStyles,
|
|
1923
1663
|
id: "confirm join new identity"
|
|
1924
|
-
}, /* @__PURE__ */
|
|
1664
|
+
}, /* @__PURE__ */ React25.createElement(ConfirmReset, {
|
|
1925
1665
|
active: activeView === "confirm join new identity",
|
|
1926
1666
|
...rest,
|
|
1927
1667
|
mode: "join new identity",
|
|
1928
1668
|
onConfirm: onJoinNewIdentity,
|
|
1929
1669
|
onCancel: onCancelReset
|
|
1930
|
-
})), /* @__PURE__ */
|
|
1670
|
+
})), /* @__PURE__ */ React25.createElement(Viewport.View, {
|
|
1931
1671
|
classNames: viewStyles,
|
|
1932
1672
|
id: "confirm recover"
|
|
1933
|
-
}, /* @__PURE__ */
|
|
1673
|
+
}, /* @__PURE__ */ React25.createElement(ConfirmReset, {
|
|
1934
1674
|
active: activeView === "confirm recover",
|
|
1935
1675
|
...rest,
|
|
1936
1676
|
mode: "recover",
|
|
1937
1677
|
onConfirm: onRecover,
|
|
1938
1678
|
onCancel: onCancelReset
|
|
1939
|
-
})), /* @__PURE__ */
|
|
1679
|
+
})), /* @__PURE__ */ React25.createElement(Viewport.View, {
|
|
1940
1680
|
classNames: viewStyles,
|
|
1941
1681
|
id: "confirm reset storage"
|
|
1942
|
-
}, /* @__PURE__ */
|
|
1682
|
+
}, /* @__PURE__ */ React25.createElement(ConfirmReset, {
|
|
1943
1683
|
active: activeView === "confirm reset storage",
|
|
1944
1684
|
...rest,
|
|
1945
1685
|
mode: "reset storage",
|
|
@@ -1949,7 +1689,7 @@ var IdentityPanelImpl = (props) => {
|
|
|
1949
1689
|
};
|
|
1950
1690
|
var IdentityPanelWithInvitationImpl = ({ invitation, ...props }) => {
|
|
1951
1691
|
const invitationStatus = useInvitationStatus2(invitation);
|
|
1952
|
-
return /* @__PURE__ */
|
|
1692
|
+
return /* @__PURE__ */ React25.createElement(IdentityPanelImpl, {
|
|
1953
1693
|
...props,
|
|
1954
1694
|
...invitationStatus
|
|
1955
1695
|
});
|
|
@@ -1967,7 +1707,7 @@ var IdentityPanel = ({ titleId: propsTitleId, createInvitationUrl = (code) => co
|
|
|
1967
1707
|
if (!identity) {
|
|
1968
1708
|
log7.error("IdentityPanel rendered with no active identity.", void 0, {
|
|
1969
1709
|
F: __dxlog_file6,
|
|
1970
|
-
L:
|
|
1710
|
+
L: 256,
|
|
1971
1711
|
S: void 0,
|
|
1972
1712
|
C: (f, a) => f(...a)
|
|
1973
1713
|
});
|
|
@@ -1984,7 +1724,7 @@ var IdentityPanel = ({ titleId: propsTitleId, createInvitationUrl = (code) => co
|
|
|
1984
1724
|
const subscription = identityService.subscribe((state) => {
|
|
1985
1725
|
log7("[state]", state, {
|
|
1986
1726
|
F: __dxlog_file6,
|
|
1987
|
-
L:
|
|
1727
|
+
L: 269,
|
|
1988
1728
|
S: void 0,
|
|
1989
1729
|
C: (f, a) => f(...a)
|
|
1990
1730
|
});
|
|
@@ -2030,40 +1770,40 @@ var IdentityPanel = ({ titleId: propsTitleId, createInvitationUrl = (code) => co
|
|
|
2030
1770
|
onChangeConnectionState: handleChangeConnectionState,
|
|
2031
1771
|
...agentProps
|
|
2032
1772
|
};
|
|
2033
|
-
return identityState.context.invitation ? /* @__PURE__ */
|
|
1773
|
+
return identityState.context.invitation ? /* @__PURE__ */ React25.createElement(IdentityPanelWithInvitationImpl, {
|
|
2034
1774
|
...implProps,
|
|
2035
1775
|
invitation: identityState.context.invitation
|
|
2036
|
-
}) : /* @__PURE__ */
|
|
1776
|
+
}) : /* @__PURE__ */ React25.createElement(IdentityPanelImpl, implProps);
|
|
2037
1777
|
};
|
|
2038
1778
|
|
|
2039
1779
|
// packages/sdk/shell/src/panels/JoinPanel/JoinPanel.tsx
|
|
2040
|
-
import
|
|
1780
|
+
import React34, { useCallback as useCallback6, useEffect as useEffect6, useMemo as useMemo4 } from "react";
|
|
2041
1781
|
import { log as log11 } from "@dxos/log";
|
|
2042
1782
|
import { useClient as useClient8, useMulticastObservable } from "@dxos/react-client";
|
|
2043
1783
|
import { useIdentity as useIdentity2 } from "@dxos/react-client/halo";
|
|
2044
|
-
import { useId as useId8, useThemeContext as
|
|
1784
|
+
import { useId as useId8, useThemeContext as useThemeContext3 } from "@dxos/react-ui";
|
|
2045
1785
|
|
|
2046
1786
|
// packages/sdk/shell/src/panels/JoinPanel/JoinHeading.tsx
|
|
2047
1787
|
import { X as X4 } from "@phosphor-icons/react";
|
|
2048
|
-
import
|
|
2049
|
-
import { Button as
|
|
2050
|
-
import { descriptionText as descriptionText9, getSize as
|
|
1788
|
+
import React26, { cloneElement, forwardRef as forwardRef9 } from "react";
|
|
1789
|
+
import { Button as Button7, useTranslation as useTranslation12 } from "@dxos/react-ui";
|
|
1790
|
+
import { descriptionText as descriptionText9, getSize as getSize11, mx as mx20 } from "@dxos/react-ui-theme";
|
|
2051
1791
|
var JoinHeading = /* @__PURE__ */ forwardRef9(({ mode, titleId, exitActionParent, onExit }, forwardedRef) => {
|
|
2052
|
-
const { t } =
|
|
2053
|
-
const exitButton = /* @__PURE__ */
|
|
1792
|
+
const { t } = useTranslation12("os");
|
|
1793
|
+
const exitButton = /* @__PURE__ */ React26.createElement(Button7, {
|
|
2054
1794
|
variant: "ghost",
|
|
2055
1795
|
...onExit && {
|
|
2056
1796
|
onClick: onExit
|
|
2057
1797
|
},
|
|
2058
|
-
classNames:
|
|
1798
|
+
classNames: mx20(descriptionText9, "plb-0 pli-2 absolute block-start-0 inline-end-0 z-[1]"),
|
|
2059
1799
|
"data-testid": "join-exit"
|
|
2060
|
-
}, /* @__PURE__ */
|
|
1800
|
+
}, /* @__PURE__ */ React26.createElement(X4, {
|
|
2061
1801
|
weight: "bold",
|
|
2062
|
-
className:
|
|
2063
|
-
}), /* @__PURE__ */
|
|
1802
|
+
className: getSize11(4)
|
|
1803
|
+
}), /* @__PURE__ */ React26.createElement("span", {
|
|
2064
1804
|
className: "sr-only"
|
|
2065
1805
|
}, t("exit label")));
|
|
2066
|
-
return /* @__PURE__ */
|
|
1806
|
+
return /* @__PURE__ */ React26.createElement(Heading, {
|
|
2067
1807
|
ref: forwardedRef,
|
|
2068
1808
|
titleId,
|
|
2069
1809
|
title: t(mode === "halo-only" ? "selecting identity heading" : "joining space heading"),
|
|
@@ -2681,17 +2421,17 @@ var useJoinMachine = (client, options) => {
|
|
|
2681
2421
|
|
|
2682
2422
|
// packages/sdk/shell/src/panels/JoinPanel/steps/AdditionMethodChooser.tsx
|
|
2683
2423
|
import { CaretRight as CaretRight2, Plus as Plus3, QrCode, Textbox } from "@phosphor-icons/react";
|
|
2684
|
-
import
|
|
2685
|
-
import { useTranslation as
|
|
2686
|
-
import { getSize as
|
|
2424
|
+
import React27 from "react";
|
|
2425
|
+
import { useTranslation as useTranslation13 } from "@dxos/react-ui";
|
|
2426
|
+
import { getSize as getSize12 } from "@dxos/react-ui-theme";
|
|
2687
2427
|
var AdditionMethodChooser = (viewStateProps) => {
|
|
2688
2428
|
const disabled = !viewStateProps.active;
|
|
2689
2429
|
const { send } = viewStateProps;
|
|
2690
|
-
const { t } =
|
|
2430
|
+
const { t } = useTranslation13("os");
|
|
2691
2431
|
const sharedButtonProps = {
|
|
2692
2432
|
disabled,
|
|
2693
|
-
after: /* @__PURE__ */
|
|
2694
|
-
className:
|
|
2433
|
+
after: /* @__PURE__ */ React27.createElement(CaretRight2, {
|
|
2434
|
+
className: getSize12(4),
|
|
2695
2435
|
weight: "bold"
|
|
2696
2436
|
}),
|
|
2697
2437
|
slots: {
|
|
@@ -2700,35 +2440,35 @@ var AdditionMethodChooser = (viewStateProps) => {
|
|
|
2700
2440
|
}
|
|
2701
2441
|
}
|
|
2702
2442
|
};
|
|
2703
|
-
return /* @__PURE__ */
|
|
2443
|
+
return /* @__PURE__ */ React27.createElement(React27.Fragment, null, /* @__PURE__ */ React27.createElement(StepHeading, null, t("addition method chooser title")), /* @__PURE__ */ React27.createElement("div", {
|
|
2704
2444
|
role: "none",
|
|
2705
2445
|
className: "flex flex-col gap-1 grow"
|
|
2706
|
-
}, /* @__PURE__ */
|
|
2446
|
+
}, /* @__PURE__ */ React27.createElement(CompoundButton, {
|
|
2707
2447
|
...sharedButtonProps,
|
|
2708
2448
|
description: t("create identity description"),
|
|
2709
|
-
before: /* @__PURE__ */
|
|
2710
|
-
className:
|
|
2449
|
+
before: /* @__PURE__ */ React27.createElement(Plus3, {
|
|
2450
|
+
className: getSize12(6)
|
|
2711
2451
|
}),
|
|
2712
2452
|
onClick: () => send({
|
|
2713
2453
|
type: "createIdentity"
|
|
2714
2454
|
}),
|
|
2715
2455
|
"data-autofocus": "choosingAuthMethod",
|
|
2716
2456
|
"data-testid": "identity-chooser.create-identity"
|
|
2717
|
-
}, t("create identity label")), /* @__PURE__ */
|
|
2457
|
+
}, t("create identity label")), /* @__PURE__ */ React27.createElement(CompoundButton, {
|
|
2718
2458
|
...sharedButtonProps,
|
|
2719
2459
|
description: t("join identity description"),
|
|
2720
|
-
before: /* @__PURE__ */
|
|
2721
|
-
className:
|
|
2460
|
+
before: /* @__PURE__ */ React27.createElement(QrCode, {
|
|
2461
|
+
className: getSize12(6)
|
|
2722
2462
|
}),
|
|
2723
2463
|
onClick: () => send({
|
|
2724
2464
|
type: "acceptHaloInvitation"
|
|
2725
2465
|
}),
|
|
2726
2466
|
"data-testid": "identity-chooser.join-identity"
|
|
2727
|
-
}, t("join identity label")), /* @__PURE__ */
|
|
2467
|
+
}, t("join identity label")), /* @__PURE__ */ React27.createElement(CompoundButton, {
|
|
2728
2468
|
...sharedButtonProps,
|
|
2729
2469
|
description: t("recover identity description"),
|
|
2730
|
-
before: /* @__PURE__ */
|
|
2731
|
-
className:
|
|
2470
|
+
before: /* @__PURE__ */ React27.createElement(Textbox, {
|
|
2471
|
+
className: getSize12(6)
|
|
2732
2472
|
}),
|
|
2733
2473
|
onClick: () => send({
|
|
2734
2474
|
type: "recoverIdentity"
|
|
@@ -2738,39 +2478,39 @@ var AdditionMethodChooser = (viewStateProps) => {
|
|
|
2738
2478
|
};
|
|
2739
2479
|
|
|
2740
2480
|
// packages/sdk/shell/src/panels/JoinPanel/steps/IdentityAdded.tsx
|
|
2741
|
-
import
|
|
2481
|
+
import React28, { cloneElement as cloneElement2 } from "react";
|
|
2742
2482
|
import { generateName as generateName4 } from "@dxos/display-name";
|
|
2743
|
-
import { Avatar as Avatar7, useId as useId7, useTranslation as
|
|
2744
|
-
import { mx as
|
|
2483
|
+
import { Avatar as Avatar7, useId as useId7, useTranslation as useTranslation14 } from "@dxos/react-ui";
|
|
2484
|
+
import { mx as mx21 } from "@dxos/react-ui-theme";
|
|
2745
2485
|
import { hexToFallback } from "@dxos/util";
|
|
2746
2486
|
var IdentityAdded = (props) => {
|
|
2747
2487
|
const { mode, addedIdentity, active, send, onDone, doneActionParent } = props;
|
|
2748
2488
|
const disabled = !active;
|
|
2749
|
-
const { t } =
|
|
2489
|
+
const { t } = useTranslation14("os");
|
|
2750
2490
|
const addedIdentityHex = addedIdentity?.identityKey.toHex() ?? "0";
|
|
2751
2491
|
const fallbackValue = hexToFallback(addedIdentityHex);
|
|
2752
2492
|
const labelId = useId7("identityListItem__label");
|
|
2753
2493
|
const displayName = addedIdentity?.profile?.displayName ?? (addedIdentity && generateName4(addedIdentityHex));
|
|
2754
|
-
const doneAction = /* @__PURE__ */
|
|
2494
|
+
const doneAction = /* @__PURE__ */ React28.createElement(Action, {
|
|
2755
2495
|
...onDone && {
|
|
2756
2496
|
onClick: () => onDone(null)
|
|
2757
2497
|
},
|
|
2758
2498
|
disabled,
|
|
2759
2499
|
"data-autofocus": "confirmingAddedIdentity",
|
|
2760
2500
|
"data-testid": "identity-added-done"
|
|
2761
|
-
}, /* @__PURE__ */
|
|
2762
|
-
return /* @__PURE__ */
|
|
2501
|
+
}, /* @__PURE__ */ React28.createElement("span", null, t("done label")));
|
|
2502
|
+
return /* @__PURE__ */ React28.createElement(React28.Fragment, null, /* @__PURE__ */ React28.createElement(StepHeading, null, t("identity added label")), /* @__PURE__ */ React28.createElement("div", {
|
|
2763
2503
|
role: "none",
|
|
2764
2504
|
className: "grow flex flex-col items-center justify-center text-center gap-2"
|
|
2765
|
-
}, /* @__PURE__ */
|
|
2505
|
+
}, /* @__PURE__ */ React28.createElement(Avatar7.Root, {
|
|
2766
2506
|
status: "active",
|
|
2767
2507
|
labelId,
|
|
2768
2508
|
hue: addedIdentity?.profile?.data?.hue || fallbackValue.hue
|
|
2769
|
-
}, /* @__PURE__ */
|
|
2509
|
+
}, /* @__PURE__ */ React28.createElement(Avatar7.Frame, null, /* @__PURE__ */ React28.createElement(Avatar7.Fallback, {
|
|
2770
2510
|
text: addedIdentity?.profile?.data?.emoji || fallbackValue.emoji
|
|
2771
|
-
})), /* @__PURE__ */
|
|
2772
|
-
classNames:
|
|
2773
|
-
}, displayName))), /* @__PURE__ */
|
|
2511
|
+
})), /* @__PURE__ */ React28.createElement(Avatar7.Label, {
|
|
2512
|
+
classNames: mx21("text-lg truncate", !addedIdentity?.profile?.displayName && "font-mono")
|
|
2513
|
+
}, displayName))), /* @__PURE__ */ React28.createElement(Actions, null, mode === "halo-only" ? doneActionParent ? /* @__PURE__ */ cloneElement2(doneActionParent, {}, doneAction) : doneAction : /* @__PURE__ */ React28.createElement(Action, {
|
|
2774
2514
|
variant: "primary",
|
|
2775
2515
|
disabled: disabled || !addedIdentity,
|
|
2776
2516
|
onClick: () => addedIdentity && send({
|
|
@@ -2782,17 +2522,17 @@ var IdentityAdded = (props) => {
|
|
|
2782
2522
|
};
|
|
2783
2523
|
|
|
2784
2524
|
// packages/sdk/shell/src/panels/JoinPanel/steps/IdentityInput.tsx
|
|
2785
|
-
import
|
|
2525
|
+
import React29, { useCallback as useCallback5, useState as useState6 } from "react";
|
|
2786
2526
|
import { log as log9 } from "@dxos/log";
|
|
2787
2527
|
import { useClient as useClient7 } from "@dxos/react-client";
|
|
2788
|
-
import { useTranslation as
|
|
2528
|
+
import { useTranslation as useTranslation15 } from "@dxos/react-ui";
|
|
2789
2529
|
var __dxlog_file8 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/JoinPanel/steps/IdentityInput.tsx";
|
|
2790
2530
|
var IdentityInput = (props) => {
|
|
2791
2531
|
const { send, method } = props;
|
|
2792
2532
|
const isRecover = method === "recover identity";
|
|
2793
2533
|
const client = useClient7();
|
|
2794
|
-
const { t } =
|
|
2795
|
-
const [validationMessage, setValidationMessage] =
|
|
2534
|
+
const { t } = useTranslation15("os");
|
|
2535
|
+
const [validationMessage, setValidationMessage] = useState6("");
|
|
2796
2536
|
const handleConfirm = async (value) => {
|
|
2797
2537
|
if (isRecover) {
|
|
2798
2538
|
await client.halo.recoverIdentity({
|
|
@@ -2830,7 +2570,7 @@ var IdentityInput = (props) => {
|
|
|
2830
2570
|
});
|
|
2831
2571
|
}
|
|
2832
2572
|
};
|
|
2833
|
-
return /* @__PURE__ */
|
|
2573
|
+
return /* @__PURE__ */ React29.createElement(IdentityInputImpl, {
|
|
2834
2574
|
...props,
|
|
2835
2575
|
onConfirm: handleConfirm,
|
|
2836
2576
|
validationMessage
|
|
@@ -2838,9 +2578,9 @@ var IdentityInput = (props) => {
|
|
|
2838
2578
|
};
|
|
2839
2579
|
var IdentityInputImpl = (props) => {
|
|
2840
2580
|
const { method, active, onConfirm, validationMessage } = props;
|
|
2841
|
-
const { t } =
|
|
2842
|
-
const [inputValue, setInputValue] =
|
|
2843
|
-
const [pending, setPending] =
|
|
2581
|
+
const { t } = useTranslation15("os");
|
|
2582
|
+
const [inputValue, setInputValue] = useState6("");
|
|
2583
|
+
const [pending, setPending] = useState6(false);
|
|
2844
2584
|
const disabled = !active || pending;
|
|
2845
2585
|
const isRecover = method === "recover identity";
|
|
2846
2586
|
const handleConfirm = useCallback5(async () => {
|
|
@@ -2851,17 +2591,17 @@ var IdentityInputImpl = (props) => {
|
|
|
2851
2591
|
onConfirm,
|
|
2852
2592
|
inputValue
|
|
2853
2593
|
]);
|
|
2854
|
-
return /* @__PURE__ */
|
|
2594
|
+
return /* @__PURE__ */ React29.createElement(React29.Fragment, null, /* @__PURE__ */ React29.createElement("div", {
|
|
2855
2595
|
role: "none",
|
|
2856
2596
|
className: "grow flex flex-col justify-center"
|
|
2857
|
-
}, /* @__PURE__ */
|
|
2597
|
+
}, /* @__PURE__ */ React29.createElement(Input, {
|
|
2858
2598
|
validationMessage,
|
|
2859
|
-
label: /* @__PURE__ */
|
|
2599
|
+
label: /* @__PURE__ */ React29.createElement(StepHeading, null, t(isRecover ? "recover identity input label" : "new identity input label")),
|
|
2860
2600
|
disabled,
|
|
2861
2601
|
"data-testid": "identity-input",
|
|
2862
2602
|
placeholder: isRecover ? t("recovery code placeholder") : t("display name placeholder"),
|
|
2863
2603
|
onChange: ({ target: { value } }) => setInputValue(value)
|
|
2864
|
-
})), /* @__PURE__ */
|
|
2604
|
+
})), /* @__PURE__ */ React29.createElement(Actions, null, /* @__PURE__ */ React29.createElement(Action, {
|
|
2865
2605
|
variant: "primary",
|
|
2866
2606
|
disabled: disabled || inputValue.trim().length === 0,
|
|
2867
2607
|
onClick: handleConfirm,
|
|
@@ -2870,13 +2610,13 @@ var IdentityInputImpl = (props) => {
|
|
|
2870
2610
|
};
|
|
2871
2611
|
|
|
2872
2612
|
// packages/sdk/shell/src/panels/JoinPanel/steps/InvitationAccepted.tsx
|
|
2873
|
-
import
|
|
2874
|
-
import { useTranslation as
|
|
2613
|
+
import React30, { cloneElement as cloneElement3 } from "react";
|
|
2614
|
+
import { useTranslation as useTranslation16 } from "@dxos/react-ui";
|
|
2875
2615
|
|
|
2876
2616
|
// packages/sdk/shell/src/panels/JoinPanel/steps/InvitationInput.tsx
|
|
2877
|
-
import
|
|
2617
|
+
import React31, { useState as useState7, useEffect as useEffect5, cloneElement as cloneElement4 } from "react";
|
|
2878
2618
|
import { log as log10 } from "@dxos/log";
|
|
2879
|
-
import { useTranslation as
|
|
2619
|
+
import { useTranslation as useTranslation17 } from "@dxos/react-ui";
|
|
2880
2620
|
var __dxlog_file9 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/JoinPanel/steps/InvitationInput.tsx";
|
|
2881
2621
|
var invitationCodeFromUrl = (text) => {
|
|
2882
2622
|
try {
|
|
@@ -2896,8 +2636,8 @@ var invitationCodeFromUrl = (text) => {
|
|
|
2896
2636
|
var InvitationInput = (props) => {
|
|
2897
2637
|
const { Kind, active, send, unredeemedCode, onExit, exitActionParent, onDone, doneActionParent, succeededKeys } = props;
|
|
2898
2638
|
const disabled = !active;
|
|
2899
|
-
const { t } =
|
|
2900
|
-
const [inputValue, setInputValue] =
|
|
2639
|
+
const { t } = useTranslation17("os");
|
|
2640
|
+
const [inputValue, setInputValue] = useState7(unredeemedCode ?? "");
|
|
2901
2641
|
useEffect5(() => {
|
|
2902
2642
|
unredeemedCode && setInputValue(unredeemedCode ?? "");
|
|
2903
2643
|
}, [
|
|
@@ -2915,7 +2655,7 @@ var InvitationInput = (props) => {
|
|
|
2915
2655
|
}
|
|
2916
2656
|
});
|
|
2917
2657
|
};
|
|
2918
|
-
const exitAction = /* @__PURE__ */
|
|
2658
|
+
const exitAction = /* @__PURE__ */ React31.createElement(Action, {
|
|
2919
2659
|
variant: "ghost",
|
|
2920
2660
|
disabled,
|
|
2921
2661
|
...onExit ? {
|
|
@@ -2925,11 +2665,11 @@ var InvitationInput = (props) => {
|
|
|
2925
2665
|
},
|
|
2926
2666
|
"data-testid": "join-exit"
|
|
2927
2667
|
}, t("cancel label"));
|
|
2928
|
-
return /* @__PURE__ */
|
|
2668
|
+
return /* @__PURE__ */ React31.createElement(React31.Fragment, null, /* @__PURE__ */ React31.createElement("div", {
|
|
2929
2669
|
role: "none",
|
|
2930
2670
|
className: "grow flex flex-col justify-center"
|
|
2931
|
-
}, /* @__PURE__ */
|
|
2932
|
-
label: /* @__PURE__ */
|
|
2671
|
+
}, /* @__PURE__ */ React31.createElement(Input, {
|
|
2672
|
+
label: /* @__PURE__ */ React31.createElement(StepHeading, null, t("invitation input label")),
|
|
2933
2673
|
placeholder: t("invitation input placeholder"),
|
|
2934
2674
|
disabled,
|
|
2935
2675
|
value: inputValue,
|
|
@@ -2937,7 +2677,7 @@ var InvitationInput = (props) => {
|
|
|
2937
2677
|
"data-autofocus": `inputting${Kind}InvitationCode`,
|
|
2938
2678
|
"data-testid": `${Kind.toLowerCase()}-invitation-input`,
|
|
2939
2679
|
onKeyUp: ({ key }) => key === "Enter" && handleNext()
|
|
2940
|
-
})), /* @__PURE__ */
|
|
2680
|
+
})), /* @__PURE__ */ React31.createElement(Actions, null, Kind === "Halo" ? null : exitActionParent ? /* @__PURE__ */ cloneElement4(exitActionParent, {}, exitAction) : doneActionParent ? /* @__PURE__ */ cloneElement4(doneActionParent, {}, exitAction) : exitAction, /* @__PURE__ */ React31.createElement(Action, {
|
|
2941
2681
|
variant: "primary",
|
|
2942
2682
|
disabled: disabled || inputValue.trim().length === 0,
|
|
2943
2683
|
onClick: handleNext,
|
|
@@ -2946,8 +2686,8 @@ var InvitationInput = (props) => {
|
|
|
2946
2686
|
};
|
|
2947
2687
|
|
|
2948
2688
|
// packages/sdk/shell/src/panels/JoinPanel/steps/InvitationRescuer.tsx
|
|
2949
|
-
import
|
|
2950
|
-
import { useTranslation as
|
|
2689
|
+
import React32 from "react";
|
|
2690
|
+
import { useTranslation as useTranslation18 } from "@dxos/react-ui";
|
|
2951
2691
|
import { descriptionText as descriptionText10 } from "@dxos/react-ui-theme";
|
|
2952
2692
|
var InvitationActions = ({
|
|
2953
2693
|
// `invitationState` does report correct state, but here we evaluate whether `failReason` is a better source of truth
|
|
@@ -2959,14 +2699,14 @@ var InvitationActions = ({
|
|
|
2959
2699
|
Kind,
|
|
2960
2700
|
failReason
|
|
2961
2701
|
}) => {
|
|
2962
|
-
const { t } =
|
|
2702
|
+
const { t } = useTranslation18("os");
|
|
2963
2703
|
if (failReason) {
|
|
2964
|
-
return /* @__PURE__ */
|
|
2704
|
+
return /* @__PURE__ */ React32.createElement(React32.Fragment, null, /* @__PURE__ */ React32.createElement(StepHeading, {
|
|
2965
2705
|
className: descriptionText10
|
|
2966
|
-
}, t(failReason === "timeout" ? "timeout status label" : failReason === "cancelled" ? "cancelled status label" : "error status label")), /* @__PURE__ */
|
|
2706
|
+
}, t(failReason === "timeout" ? "timeout status label" : failReason === "cancelled" ? "cancelled status label" : "error status label")), /* @__PURE__ */ React32.createElement("div", {
|
|
2967
2707
|
role: "none",
|
|
2968
2708
|
className: "grow"
|
|
2969
|
-
}), /* @__PURE__ */
|
|
2709
|
+
}), /* @__PURE__ */ React32.createElement(Actions, null, /* @__PURE__ */ React32.createElement(Action, {
|
|
2970
2710
|
disabled: !active,
|
|
2971
2711
|
onClick: () => send({
|
|
2972
2712
|
type: `reset${Kind}Invitation`
|
|
@@ -2974,16 +2714,16 @@ var InvitationActions = ({
|
|
|
2974
2714
|
"data-testid": "invitation-rescuer-reset"
|
|
2975
2715
|
}, t("reset label"))));
|
|
2976
2716
|
} else {
|
|
2977
|
-
return /* @__PURE__ */
|
|
2717
|
+
return /* @__PURE__ */ React32.createElement(React32.Fragment, null, /* @__PURE__ */ React32.createElement(StepHeading, {
|
|
2978
2718
|
className: descriptionText10
|
|
2979
|
-
}, t("connecting status label")), /* @__PURE__ */
|
|
2719
|
+
}, t("connecting status label")), /* @__PURE__ */ React32.createElement("div", {
|
|
2980
2720
|
role: "none",
|
|
2981
2721
|
className: "grow"
|
|
2982
|
-
}), /* @__PURE__ */
|
|
2722
|
+
}), /* @__PURE__ */ React32.createElement(Actions, null, /* @__PURE__ */ React32.createElement(Action, {
|
|
2983
2723
|
disabled: true,
|
|
2984
2724
|
classNames: "order-2",
|
|
2985
2725
|
"data-testid": "next"
|
|
2986
|
-
}, t("next label")), /* @__PURE__ */
|
|
2726
|
+
}, t("next label")), /* @__PURE__ */ React32.createElement(Action, {
|
|
2987
2727
|
disabled: !active,
|
|
2988
2728
|
onClick: onInvitationCancel,
|
|
2989
2729
|
"data-testid": "invitation-rescuer-cancel"
|
|
@@ -2992,52 +2732,52 @@ var InvitationActions = ({
|
|
|
2992
2732
|
};
|
|
2993
2733
|
var InvitationRescuer = (props) => {
|
|
2994
2734
|
const { Kind, invitationState, active, send } = props;
|
|
2995
|
-
const { t } =
|
|
2996
|
-
return /* @__PURE__ */
|
|
2735
|
+
const { t } = useTranslation18("os");
|
|
2736
|
+
return /* @__PURE__ */ React32.createElement(React32.Fragment, null, typeof invitationState === "undefined" ? /* @__PURE__ */ React32.createElement(React32.Fragment, null, /* @__PURE__ */ React32.createElement("div", {
|
|
2997
2737
|
role: "none",
|
|
2998
2738
|
className: "grow flex flex-col justify-center"
|
|
2999
|
-
}, /* @__PURE__ */
|
|
2739
|
+
}, /* @__PURE__ */ React32.createElement(StepHeading, {
|
|
3000
2740
|
className: descriptionText10
|
|
3001
|
-
}, "There was a problem joining the space")), /* @__PURE__ */
|
|
2741
|
+
}, "There was a problem joining the space")), /* @__PURE__ */ React32.createElement(Actions, null, /* @__PURE__ */ React32.createElement(Action, {
|
|
3002
2742
|
disabled: !active,
|
|
3003
2743
|
"data-testid": "invitation-rescuer-blank-reset",
|
|
3004
2744
|
onClick: () => send({
|
|
3005
2745
|
type: `reset${Kind}Invitation`
|
|
3006
2746
|
})
|
|
3007
|
-
}, t("reset label")))) : /* @__PURE__ */
|
|
2747
|
+
}, t("reset label")))) : /* @__PURE__ */ React32.createElement(InvitationActions, props));
|
|
3008
2748
|
};
|
|
3009
2749
|
|
|
3010
2750
|
// packages/sdk/shell/src/panels/JoinPanel/steps/InvitationAuthenticator.tsx
|
|
3011
|
-
import
|
|
2751
|
+
import React33, { useState as useState8 } from "react";
|
|
3012
2752
|
import { Invitation as Invitation6 } from "@dxos/react-client/invitations";
|
|
3013
|
-
import { Input as Input3, useTranslation as
|
|
2753
|
+
import { Input as Input3, useTranslation as useTranslation19 } from "@dxos/react-ui";
|
|
3014
2754
|
import { descriptionText as descriptionText11 } from "@dxos/react-ui-theme";
|
|
3015
2755
|
import { hexToEmoji as hexToEmoji5 } from "@dxos/util";
|
|
3016
2756
|
var pinLength = 6;
|
|
3017
2757
|
var InvitationAuthenticator = ({ failed, Kind, authMethod, active, pending, invitationId, onInvitationAuthenticate, onInvitationCancel }) => {
|
|
3018
2758
|
const disabled = !active || pending;
|
|
3019
|
-
const { t } =
|
|
2759
|
+
const { t } = useTranslation19("os");
|
|
3020
2760
|
const invitationType = Kind.toLowerCase();
|
|
3021
|
-
const [authCode, setAuthCode] =
|
|
2761
|
+
const [authCode, setAuthCode] = useState8("");
|
|
3022
2762
|
const onChange = ({ target: { value } }) => {
|
|
3023
2763
|
setAuthCode(value);
|
|
3024
2764
|
if (value.length === pinLength) {
|
|
3025
2765
|
document.querySelector(`[data-autofocus-pinlength="${invitationType}"]`)?.focus();
|
|
3026
2766
|
}
|
|
3027
2767
|
};
|
|
3028
|
-
return /* @__PURE__ */
|
|
2768
|
+
return /* @__PURE__ */ React33.createElement(React33.Fragment, null, /* @__PURE__ */ React33.createElement("div", {
|
|
3029
2769
|
role: "none",
|
|
3030
2770
|
className: "grow flex flex-col justify-center gap-4"
|
|
3031
|
-
}, /* @__PURE__ */
|
|
2771
|
+
}, /* @__PURE__ */ React33.createElement(Input3.Root, failed && {
|
|
3032
2772
|
validationValence: "error"
|
|
3033
|
-
}, /* @__PURE__ */
|
|
2773
|
+
}, /* @__PURE__ */ React33.createElement(Input3.Label, {
|
|
3034
2774
|
asChild: true
|
|
3035
|
-
}, authMethod === Invitation6.AuthMethod.SHARED_SECRET ? /* @__PURE__ */
|
|
2775
|
+
}, authMethod === Invitation6.AuthMethod.SHARED_SECRET ? /* @__PURE__ */ React33.createElement(StepHeading, null, t("auth code input label")) : /* @__PURE__ */ React33.createElement(React33.Fragment, null, /* @__PURE__ */ React33.createElement(StepHeading, {
|
|
3036
2776
|
className: descriptionText11
|
|
3037
|
-
}, t("authenticating label")), /* @__PURE__ */
|
|
2777
|
+
}, t("authenticating label")), /* @__PURE__ */ React33.createElement("div", {
|
|
3038
2778
|
role: "none",
|
|
3039
2779
|
className: "grow"
|
|
3040
|
-
}))), authMethod === Invitation6.AuthMethod.SHARED_SECRET && /* @__PURE__ */
|
|
2780
|
+
}))), authMethod === Invitation6.AuthMethod.SHARED_SECRET && /* @__PURE__ */ React33.createElement(Input3.PinInput, {
|
|
3041
2781
|
disabled,
|
|
3042
2782
|
length: pinLength,
|
|
3043
2783
|
onChange,
|
|
@@ -3048,18 +2788,18 @@ var InvitationAuthenticator = ({ failed, Kind, authMethod, active, pending, invi
|
|
|
3048
2788
|
"data-prevent-ios-autofocus": true,
|
|
3049
2789
|
"data-testid": `${invitationType}-auth-code-input`,
|
|
3050
2790
|
"data-1p-ignore": true
|
|
3051
|
-
}), failed && /* @__PURE__ */
|
|
2791
|
+
}), failed && /* @__PURE__ */ React33.createElement(Input3.DescriptionAndValidation, {
|
|
3052
2792
|
classNames: "text-center"
|
|
3053
|
-
}, /* @__PURE__ */
|
|
2793
|
+
}, /* @__PURE__ */ React33.createElement(Input3.Validation, null, t("failed to authenticate message")))), invitationId && authMethod === Invitation6.AuthMethod.SHARED_SECRET && /* @__PURE__ */ React33.createElement(React33.Fragment, null, /* @__PURE__ */ React33.createElement(Label, null, t("auth other device emoji message")), /* @__PURE__ */ React33.createElement("div", {
|
|
3054
2794
|
className: "flex justify-center"
|
|
3055
|
-
}, /* @__PURE__ */
|
|
2795
|
+
}, /* @__PURE__ */ React33.createElement(Emoji, {
|
|
3056
2796
|
text: hexToEmoji5(invitationId)
|
|
3057
|
-
})))), /* @__PURE__ */
|
|
2797
|
+
})))), /* @__PURE__ */ React33.createElement(Actions, null, /* @__PURE__ */ React33.createElement(Action, {
|
|
3058
2798
|
variant: "ghost",
|
|
3059
2799
|
disabled,
|
|
3060
2800
|
onClick: () => onInvitationCancel?.(),
|
|
3061
2801
|
"data-testid": `${invitationType}-invitation-authenticator-cancel`
|
|
3062
|
-
}, t("cancel label")), /* @__PURE__ */
|
|
2802
|
+
}, t("cancel label")), /* @__PURE__ */ React33.createElement(Action, {
|
|
3063
2803
|
variant: "primary",
|
|
3064
2804
|
disabled,
|
|
3065
2805
|
onClick: () => onInvitationAuthenticate?.(authCode),
|
|
@@ -3121,46 +2861,46 @@ var JoinPanelImpl = (props) => {
|
|
|
3121
2861
|
IdentityInput: IdentityInputComponent = IdentityInput,
|
|
3122
2862
|
ConfirmReset: ConfirmResetComponent = ConfirmReset
|
|
3123
2863
|
} = props;
|
|
3124
|
-
return /* @__PURE__ */
|
|
2864
|
+
return /* @__PURE__ */ React34.createElement(React34.Fragment, null, mode !== "halo-only" && /* @__PURE__ */ React34.createElement(JoinHeading, {
|
|
3125
2865
|
titleId,
|
|
3126
2866
|
mode,
|
|
3127
2867
|
onExit,
|
|
3128
2868
|
exitActionParent
|
|
3129
|
-
}), /* @__PURE__ */
|
|
2869
|
+
}), /* @__PURE__ */ React34.createElement(Viewport.Root, {
|
|
3130
2870
|
focusManaged: true,
|
|
3131
2871
|
activeView
|
|
3132
|
-
}, /* @__PURE__ */
|
|
2872
|
+
}, /* @__PURE__ */ React34.createElement(Viewport.Views, null, /* @__PURE__ */ React34.createElement(Viewport.View, {
|
|
3133
2873
|
classNames: stepStyles,
|
|
3134
2874
|
id: "addition method chooser"
|
|
3135
|
-
}, /* @__PURE__ */
|
|
2875
|
+
}, /* @__PURE__ */ React34.createElement(AdditionMethodChooser, {
|
|
3136
2876
|
send,
|
|
3137
2877
|
active: activeView === "addition method chooser"
|
|
3138
|
-
})), /* @__PURE__ */
|
|
2878
|
+
})), /* @__PURE__ */ React34.createElement(Viewport.View, {
|
|
3139
2879
|
classNames: stepStyles,
|
|
3140
2880
|
id: "reset storage confirmation"
|
|
3141
|
-
}, /* @__PURE__ */
|
|
2881
|
+
}, /* @__PURE__ */ React34.createElement(ConfirmResetComponent, {
|
|
3142
2882
|
send,
|
|
3143
2883
|
active: activeView === "reset storage confirmation",
|
|
3144
2884
|
onCancel: onCancelResetStorage,
|
|
3145
2885
|
onConfirm: onConfirmResetStorage
|
|
3146
|
-
})), /* @__PURE__ */
|
|
2886
|
+
})), /* @__PURE__ */ React34.createElement(Viewport.View, {
|
|
3147
2887
|
classNames: stepStyles,
|
|
3148
2888
|
id: "create identity input"
|
|
3149
|
-
}, /* @__PURE__ */
|
|
2889
|
+
}, /* @__PURE__ */ React34.createElement(IdentityInputComponent, {
|
|
3150
2890
|
send,
|
|
3151
2891
|
method: "create identity",
|
|
3152
2892
|
active: activeView === "create identity input"
|
|
3153
|
-
})), /* @__PURE__ */
|
|
2893
|
+
})), /* @__PURE__ */ React34.createElement(Viewport.View, {
|
|
3154
2894
|
classNames: stepStyles,
|
|
3155
2895
|
id: "recover identity input"
|
|
3156
|
-
}, /* @__PURE__ */
|
|
2896
|
+
}, /* @__PURE__ */ React34.createElement(IdentityInputComponent, {
|
|
3157
2897
|
send,
|
|
3158
2898
|
method: "recover identity",
|
|
3159
2899
|
active: activeView === "recover identity input"
|
|
3160
|
-
})), /* @__PURE__ */
|
|
2900
|
+
})), /* @__PURE__ */ React34.createElement(Viewport.View, {
|
|
3161
2901
|
classNames: stepStyles,
|
|
3162
2902
|
id: "halo invitation input"
|
|
3163
|
-
}, /* @__PURE__ */
|
|
2903
|
+
}, /* @__PURE__ */ React34.createElement(InvitationInput, {
|
|
3164
2904
|
send,
|
|
3165
2905
|
Kind: "Halo",
|
|
3166
2906
|
active: activeView === "halo invitation input",
|
|
@@ -3170,20 +2910,20 @@ var JoinPanelImpl = (props) => {
|
|
|
3170
2910
|
...succeededKeys?.Halo && {
|
|
3171
2911
|
succeededKeys: succeededKeys.Halo
|
|
3172
2912
|
}
|
|
3173
|
-
})), /* @__PURE__ */
|
|
2913
|
+
})), /* @__PURE__ */ React34.createElement(Viewport.View, {
|
|
3174
2914
|
classNames: stepStyles,
|
|
3175
2915
|
id: "halo invitation rescuer"
|
|
3176
|
-
}, /* @__PURE__ */
|
|
2916
|
+
}, /* @__PURE__ */ React34.createElement(InvitationRescuer, {
|
|
3177
2917
|
send,
|
|
3178
2918
|
Kind: "Halo",
|
|
3179
2919
|
active: activeView === "halo invitation rescuer",
|
|
3180
2920
|
invitationState: invitationStates?.Halo,
|
|
3181
2921
|
onInvitationCancel: onHaloInvitationCancel,
|
|
3182
2922
|
failReason: failReasons?.Halo
|
|
3183
|
-
})), /* @__PURE__ */
|
|
2923
|
+
})), /* @__PURE__ */ React34.createElement(Viewport.View, {
|
|
3184
2924
|
classNames: stepStyles,
|
|
3185
2925
|
id: "halo invitation authenticator"
|
|
3186
|
-
}, /* @__PURE__ */
|
|
2926
|
+
}, /* @__PURE__ */ React34.createElement(InvitationAuthenticator, {
|
|
3187
2927
|
send,
|
|
3188
2928
|
Kind: "Halo",
|
|
3189
2929
|
invitationId: invitationIds?.Halo,
|
|
@@ -3194,19 +2934,19 @@ var JoinPanelImpl = (props) => {
|
|
|
3194
2934
|
...failed.has("Halo") && {
|
|
3195
2935
|
failed: true
|
|
3196
2936
|
}
|
|
3197
|
-
})), /* @__PURE__ */
|
|
2937
|
+
})), /* @__PURE__ */ React34.createElement(Viewport.View, {
|
|
3198
2938
|
classNames: stepStyles,
|
|
3199
2939
|
id: "identity added"
|
|
3200
|
-
}, /* @__PURE__ */
|
|
2940
|
+
}, /* @__PURE__ */ React34.createElement(IdentityAdded, {
|
|
3201
2941
|
send,
|
|
3202
2942
|
mode,
|
|
3203
2943
|
active: activeView === "identity added",
|
|
3204
2944
|
doneActionParent,
|
|
3205
2945
|
onDone: onHaloDone
|
|
3206
|
-
})), /* @__PURE__ */
|
|
2946
|
+
})), /* @__PURE__ */ React34.createElement(Viewport.View, {
|
|
3207
2947
|
classNames: stepStyles,
|
|
3208
2948
|
id: "space invitation input"
|
|
3209
|
-
}, /* @__PURE__ */
|
|
2949
|
+
}, /* @__PURE__ */ React34.createElement(InvitationInput, {
|
|
3210
2950
|
send,
|
|
3211
2951
|
Kind: "Space",
|
|
3212
2952
|
active: activeView === "space invitation input",
|
|
@@ -3218,20 +2958,20 @@ var JoinPanelImpl = (props) => {
|
|
|
3218
2958
|
},
|
|
3219
2959
|
onExit,
|
|
3220
2960
|
exitActionParent
|
|
3221
|
-
})), /* @__PURE__ */
|
|
2961
|
+
})), /* @__PURE__ */ React34.createElement(Viewport.View, {
|
|
3222
2962
|
classNames: stepStyles,
|
|
3223
2963
|
id: "space invitation rescuer"
|
|
3224
|
-
}, /* @__PURE__ */
|
|
2964
|
+
}, /* @__PURE__ */ React34.createElement(InvitationRescuer, {
|
|
3225
2965
|
send,
|
|
3226
2966
|
Kind: "Space",
|
|
3227
2967
|
active: activeView === "space invitation rescuer",
|
|
3228
2968
|
invitationState: invitationStates?.Space,
|
|
3229
2969
|
onInvitationCancel: onSpaceInvitationCancel,
|
|
3230
2970
|
failReason: failReasons?.Space
|
|
3231
|
-
})), /* @__PURE__ */
|
|
2971
|
+
})), /* @__PURE__ */ React34.createElement(Viewport.View, {
|
|
3232
2972
|
classNames: stepStyles,
|
|
3233
2973
|
id: "space invitation authenticator"
|
|
3234
|
-
}, /* @__PURE__ */
|
|
2974
|
+
}, /* @__PURE__ */ React34.createElement(InvitationAuthenticator, {
|
|
3235
2975
|
send,
|
|
3236
2976
|
Kind: "Space",
|
|
3237
2977
|
invitationId: invitationIds?.Space,
|
|
@@ -3247,7 +2987,7 @@ var JoinPanelImpl = (props) => {
|
|
|
3247
2987
|
var JoinPanel = ({ titleId: propsTitleId, mode = "default", initialDisposition = "default", initialInvitationCode, exitActionParent, onExit, doneActionParent, onDone: propsOnDone, onCancelResetStorage }) => {
|
|
3248
2988
|
const client = useClient8();
|
|
3249
2989
|
const identity = useIdentity2();
|
|
3250
|
-
const { hasIosKeyboard } =
|
|
2990
|
+
const { hasIosKeyboard } = useThemeContext3();
|
|
3251
2991
|
const titleId = useId8("joinPanel__heading", propsTitleId);
|
|
3252
2992
|
const [joinState, joinSend, joinService] = useJoinMachine(client, {
|
|
3253
2993
|
context: {
|
|
@@ -3509,7 +3249,7 @@ var JoinPanel = ({ titleId: propsTitleId, mode = "default", initialDisposition =
|
|
|
3509
3249
|
client,
|
|
3510
3250
|
joinSend
|
|
3511
3251
|
]);
|
|
3512
|
-
return /* @__PURE__ */
|
|
3252
|
+
return /* @__PURE__ */ React34.createElement(JoinPanelImpl, {
|
|
3513
3253
|
titleId,
|
|
3514
3254
|
mode,
|
|
3515
3255
|
send: joinSend,
|
|
@@ -3552,10 +3292,10 @@ var JoinPanel = ({ titleId: propsTitleId, mode = "default", initialDisposition =
|
|
|
3552
3292
|
|
|
3553
3293
|
// packages/sdk/shell/src/panels/SpacePanel/SpacePanel.tsx
|
|
3554
3294
|
import { Planet } from "@phosphor-icons/react";
|
|
3555
|
-
import
|
|
3295
|
+
import React36, { useEffect as useEffect7, useMemo as useMemo5 } from "react";
|
|
3556
3296
|
import { log as log14 } from "@dxos/log";
|
|
3557
3297
|
import { useInvitationStatus as useInvitationStatus3 } from "@dxos/react-client/invitations";
|
|
3558
|
-
import { useId as useId9, useTranslation as
|
|
3298
|
+
import { useId as useId9, useTranslation as useTranslation21 } from "@dxos/react-ui";
|
|
3559
3299
|
|
|
3560
3300
|
// packages/sdk/shell/src/panels/SpacePanel/spaceMachine.ts
|
|
3561
3301
|
import { useMachine as useMachine3 } from "@xstate/react";
|
|
@@ -3621,13 +3361,13 @@ var useSpaceMachine = (options) => {
|
|
|
3621
3361
|
|
|
3622
3362
|
// packages/sdk/shell/src/panels/SpacePanel/steps/SpaceManager.tsx
|
|
3623
3363
|
import { Placeholder as Placeholder2, UserPlus, UsersThree } from "@phosphor-icons/react";
|
|
3624
|
-
import
|
|
3364
|
+
import React35, { useCallback as useCallback7, useState as useState9 } from "react";
|
|
3625
3365
|
import { log as log13 } from "@dxos/log";
|
|
3626
3366
|
import { useConfig } from "@dxos/react-client";
|
|
3627
3367
|
import { useSpaceInvitations as useSpaceInvitations2 } from "@dxos/react-client/echo";
|
|
3628
3368
|
import { Invitation as Invitation8, InvitationEncoder as InvitationEncoder4 } from "@dxos/react-client/invitations";
|
|
3629
|
-
import { ScrollArea, useTranslation as
|
|
3630
|
-
import { descriptionText as descriptionText12, mx as
|
|
3369
|
+
import { ScrollArea, useTranslation as useTranslation20 } from "@dxos/react-ui";
|
|
3370
|
+
import { descriptionText as descriptionText12, mx as mx22 } from "@dxos/react-ui-theme";
|
|
3631
3371
|
var __dxlog_file12 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/SpacePanel/steps/SpaceManager.tsx";
|
|
3632
3372
|
var activeActionKey = "dxos:react-shell/space-manager/active-action";
|
|
3633
3373
|
var handleInvitationEvent = (invitation, subscription) => {
|
|
@@ -3647,7 +3387,7 @@ var handleInvitationEvent = (invitation, subscription) => {
|
|
|
3647
3387
|
};
|
|
3648
3388
|
var SpaceManager = (props) => {
|
|
3649
3389
|
const { space, target } = props;
|
|
3650
|
-
const { t } =
|
|
3390
|
+
const { t } = useTranslation20("os");
|
|
3651
3391
|
const config = useConfig();
|
|
3652
3392
|
const invitations = useSpaceInvitations2(space?.key);
|
|
3653
3393
|
const inviteActions = {
|
|
@@ -3692,7 +3432,7 @@ var SpaceManager = (props) => {
|
|
|
3692
3432
|
])
|
|
3693
3433
|
}
|
|
3694
3434
|
};
|
|
3695
|
-
return /* @__PURE__ */
|
|
3435
|
+
return /* @__PURE__ */ React35.createElement(SpaceManagerImpl, {
|
|
3696
3436
|
...props,
|
|
3697
3437
|
invitations,
|
|
3698
3438
|
inviteActions
|
|
@@ -3701,7 +3441,7 @@ var SpaceManager = (props) => {
|
|
|
3701
3441
|
var headingFragment = "pis-3 pie-1 plb-1 mbe-1 font-medium";
|
|
3702
3442
|
var SpaceManagerImpl = (props) => {
|
|
3703
3443
|
const { active, space, createInvitationUrl, send, inviteActions: propsInviteActions, invitations, showInactiveInvitations, SpaceMemberList: SpaceMemberListComponent = SpaceMemberList, InvitationList: InvitationListComponent = InvitationList } = props;
|
|
3704
|
-
const { t } =
|
|
3444
|
+
const { t } = useTranslation20("os");
|
|
3705
3445
|
const inviteActions = propsInviteActions ?? {
|
|
3706
3446
|
noopInvite: {
|
|
3707
3447
|
label: t("create space invitation label"),
|
|
@@ -3711,7 +3451,7 @@ var SpaceManagerImpl = (props) => {
|
|
|
3711
3451
|
}
|
|
3712
3452
|
}
|
|
3713
3453
|
};
|
|
3714
|
-
const [activeAction, setInternalActiveAction] =
|
|
3454
|
+
const [activeAction, setInternalActiveAction] = useState9(localStorage.getItem(activeActionKey) ?? "inviteMany");
|
|
3715
3455
|
const setActiveAction = (nextAction) => {
|
|
3716
3456
|
setInternalActiveAction(nextAction);
|
|
3717
3457
|
localStorage.setItem(activeActionKey, nextAction);
|
|
@@ -3719,26 +3459,26 @@ var SpaceManagerImpl = (props) => {
|
|
|
3719
3459
|
const visibleInvitations = showInactiveInvitations ? invitations : invitations?.filter((invitation) => ![
|
|
3720
3460
|
Invitation8.State.CANCELLED
|
|
3721
3461
|
].includes(invitation.get().state));
|
|
3722
|
-
return /* @__PURE__ */
|
|
3462
|
+
return /* @__PURE__ */ React35.createElement(React35.Fragment, null, /* @__PURE__ */ React35.createElement(ScrollArea.Root, {
|
|
3723
3463
|
classNames: "grow shrink basis-28 -mli-2"
|
|
3724
|
-
}, /* @__PURE__ */
|
|
3464
|
+
}, /* @__PURE__ */ React35.createElement(ScrollArea.Viewport, {
|
|
3725
3465
|
classNames: "is-full pie-2"
|
|
3726
|
-
}, !!visibleInvitations?.length && /* @__PURE__ */
|
|
3727
|
-
className:
|
|
3728
|
-
}, t("invitation list heading")), /* @__PURE__ */
|
|
3466
|
+
}, !!visibleInvitations?.length && /* @__PURE__ */ React35.createElement(React35.Fragment, null, /* @__PURE__ */ React35.createElement("h3", {
|
|
3467
|
+
className: mx22(headingFragment, descriptionText12)
|
|
3468
|
+
}, t("invitation list heading")), /* @__PURE__ */ React35.createElement(InvitationListComponent, {
|
|
3729
3469
|
className: "mb-2",
|
|
3730
3470
|
send,
|
|
3731
3471
|
invitations: visibleInvitations ?? [],
|
|
3732
3472
|
onClickRemove: (invitation) => invitation.cancel(),
|
|
3733
3473
|
createInvitationUrl
|
|
3734
|
-
}), /* @__PURE__ */
|
|
3735
|
-
className:
|
|
3736
|
-
}, t("space member list heading"))), /* @__PURE__ */
|
|
3474
|
+
}), /* @__PURE__ */ React35.createElement("h3", {
|
|
3475
|
+
className: mx22(headingFragment, descriptionText12, "mbs-2")
|
|
3476
|
+
}, t("space member list heading"))), /* @__PURE__ */ React35.createElement(SpaceMemberListComponent, {
|
|
3737
3477
|
spaceKey: space.key,
|
|
3738
3478
|
includeSelf: true
|
|
3739
|
-
})), /* @__PURE__ */
|
|
3479
|
+
})), /* @__PURE__ */ React35.createElement(ScrollArea.Scrollbar, {
|
|
3740
3480
|
orientation: "vertical"
|
|
3741
|
-
}, /* @__PURE__ */
|
|
3481
|
+
}, /* @__PURE__ */ React35.createElement(ScrollArea.Thumb, null))), /* @__PURE__ */ React35.createElement(Actions, null, /* @__PURE__ */ React35.createElement(BifurcatedAction, {
|
|
3742
3482
|
disabled: !active,
|
|
3743
3483
|
actions: inviteActions,
|
|
3744
3484
|
activeAction,
|
|
@@ -3750,45 +3490,45 @@ var SpaceManagerImpl = (props) => {
|
|
|
3750
3490
|
// packages/sdk/shell/src/panels/SpacePanel/SpacePanel.tsx
|
|
3751
3491
|
var __dxlog_file13 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/SpacePanel/SpacePanel.tsx";
|
|
3752
3492
|
var SpacePanelHeading = ({ titleId, space, onDone }) => {
|
|
3753
|
-
const { t } =
|
|
3493
|
+
const { t } = useTranslation21("os");
|
|
3754
3494
|
const name = space.properties.name;
|
|
3755
|
-
return /* @__PURE__ */
|
|
3495
|
+
return /* @__PURE__ */ React36.createElement(Heading, {
|
|
3756
3496
|
titleId,
|
|
3757
3497
|
title: t("space panel heading"),
|
|
3758
|
-
corner: /* @__PURE__ */
|
|
3498
|
+
corner: /* @__PURE__ */ React36.createElement(CloseButton, {
|
|
3759
3499
|
"data-testid": "identity-panel-done",
|
|
3760
3500
|
onDone
|
|
3761
3501
|
})
|
|
3762
|
-
}, /* @__PURE__ */
|
|
3502
|
+
}, /* @__PURE__ */ React36.createElement("div", {
|
|
3763
3503
|
role: "none",
|
|
3764
3504
|
className: "flex gap-4 items-center justify-center mlb-4"
|
|
3765
|
-
}, /* @__PURE__ */
|
|
3505
|
+
}, /* @__PURE__ */ React36.createElement(Planet, {
|
|
3766
3506
|
size: 32,
|
|
3767
3507
|
weight: "light"
|
|
3768
|
-
}), /* @__PURE__ */
|
|
3508
|
+
}), /* @__PURE__ */ React36.createElement("div", {
|
|
3769
3509
|
className: "block text-start font-light text-xl"
|
|
3770
3510
|
}, name ?? space.key.truncate())));
|
|
3771
3511
|
};
|
|
3772
3512
|
var SpacePanelImpl = (props) => {
|
|
3773
3513
|
const { titleId, activeView, space, hideHeading, target, SpaceManager: SpaceManagerComponent = SpaceManager, InvitationManager: InvitationManagerComponent = InvitationManager, ...rest } = props;
|
|
3774
|
-
return /* @__PURE__ */
|
|
3514
|
+
return /* @__PURE__ */ React36.createElement(React36.Fragment, null, !hideHeading && /* @__PURE__ */ React36.createElement(SpacePanelHeading, {
|
|
3775
3515
|
...rest,
|
|
3776
3516
|
titleId,
|
|
3777
3517
|
space
|
|
3778
|
-
}), /* @__PURE__ */
|
|
3518
|
+
}), /* @__PURE__ */ React36.createElement(Viewport.Root, {
|
|
3779
3519
|
activeView
|
|
3780
|
-
}, /* @__PURE__ */
|
|
3520
|
+
}, /* @__PURE__ */ React36.createElement(Viewport.Views, null, /* @__PURE__ */ React36.createElement(Viewport.View, {
|
|
3781
3521
|
id: "space manager",
|
|
3782
3522
|
classNames: stepStyles
|
|
3783
|
-
}, /* @__PURE__ */
|
|
3523
|
+
}, /* @__PURE__ */ React36.createElement(SpaceManagerComponent, {
|
|
3784
3524
|
active: activeView === "space manager",
|
|
3785
3525
|
space,
|
|
3786
3526
|
target,
|
|
3787
3527
|
...rest
|
|
3788
|
-
})), /* @__PURE__ */
|
|
3528
|
+
})), /* @__PURE__ */ React36.createElement(Viewport.View, {
|
|
3789
3529
|
id: "space invitation manager",
|
|
3790
3530
|
classNames: stepStyles
|
|
3791
|
-
}, /* @__PURE__ */
|
|
3531
|
+
}, /* @__PURE__ */ React36.createElement(InvitationManagerComponent, {
|
|
3792
3532
|
active: activeView === "space invitation manager",
|
|
3793
3533
|
...rest,
|
|
3794
3534
|
invitationUrl: props.invitationUrl
|
|
@@ -3796,7 +3536,7 @@ var SpacePanelImpl = (props) => {
|
|
|
3796
3536
|
};
|
|
3797
3537
|
var SpacePanelWithInvitationImpl = ({ invitation, ...props }) => {
|
|
3798
3538
|
const invitationStatus = useInvitationStatus3(invitation);
|
|
3799
|
-
return /* @__PURE__ */
|
|
3539
|
+
return /* @__PURE__ */ React36.createElement(SpacePanelImpl, {
|
|
3800
3540
|
...props,
|
|
3801
3541
|
...invitationStatus,
|
|
3802
3542
|
invitationUrl: props.createInvitationUrl(invitationStatus.invitationCode)
|
|
@@ -3843,24 +3583,24 @@ var SpacePanel = ({ titleId: propsTitleId, createInvitationUrl = (code) => code,
|
|
|
3843
3583
|
};
|
|
3844
3584
|
return spaceState.context.invitation ? (
|
|
3845
3585
|
// TODO(wittjosiah): Unused? Remove?
|
|
3846
|
-
/* @__PURE__ */
|
|
3586
|
+
/* @__PURE__ */ React36.createElement(SpacePanelWithInvitationImpl, {
|
|
3847
3587
|
...implProps,
|
|
3848
3588
|
invitation: spaceState.context.invitation
|
|
3849
3589
|
})
|
|
3850
|
-
) : /* @__PURE__ */
|
|
3590
|
+
) : /* @__PURE__ */ React36.createElement(SpacePanelImpl, implProps);
|
|
3851
3591
|
};
|
|
3852
3592
|
|
|
3853
3593
|
// packages/sdk/shell/src/panels/StatusPanel/StatusPanel.tsx
|
|
3854
|
-
import
|
|
3855
|
-
import { Status, useTranslation as
|
|
3594
|
+
import React37 from "react";
|
|
3595
|
+
import { Status, useTranslation as useTranslation22 } from "@dxos/react-ui";
|
|
3856
3596
|
var StatusPanel = ({ titleId }) => {
|
|
3857
|
-
const { t } =
|
|
3858
|
-
return /* @__PURE__ */
|
|
3597
|
+
const { t } = useTranslation22("os");
|
|
3598
|
+
return /* @__PURE__ */ React37.createElement("div", {
|
|
3859
3599
|
className: "grid place-items-center p-2 gap-2"
|
|
3860
|
-
}, /* @__PURE__ */
|
|
3600
|
+
}, /* @__PURE__ */ React37.createElement("p", {
|
|
3861
3601
|
id: titleId,
|
|
3862
3602
|
className: "font-medium text-center"
|
|
3863
|
-
}, t("resetting message")), /* @__PURE__ */
|
|
3603
|
+
}, t("resetting message")), /* @__PURE__ */ React37.createElement(Status, {
|
|
3864
3604
|
indeterminate: true
|
|
3865
3605
|
}, t("resetting message")));
|
|
3866
3606
|
};
|
|
@@ -3868,96 +3608,96 @@ var StatusPanel = ({ titleId }) => {
|
|
|
3868
3608
|
// packages/sdk/shell/src/composites/IdentityDialog/IdentityDialog.tsx
|
|
3869
3609
|
var IdentityDialog = (props) => {
|
|
3870
3610
|
const titleId = useId10("identityDialog__title", props.title);
|
|
3871
|
-
return /* @__PURE__ */
|
|
3611
|
+
return /* @__PURE__ */ React38.createElement(Dialog.Root, {
|
|
3872
3612
|
defaultOpen: true,
|
|
3873
3613
|
onOpenChange: (open) => open || props.onDone?.()
|
|
3874
|
-
}, /* @__PURE__ */
|
|
3614
|
+
}, /* @__PURE__ */ React38.createElement(Dialog.Portal, null, /* @__PURE__ */ React38.createElement(Dialog.Overlay, null, /* @__PURE__ */ React38.createElement(Dialog.Content, {
|
|
3875
3615
|
"aria-labelledby": titleId,
|
|
3876
3616
|
onOpenAutoFocus: (e) => e.preventDefault()
|
|
3877
|
-
}, /* @__PURE__ */
|
|
3617
|
+
}, /* @__PURE__ */ React38.createElement(Clipboard3.Provider, null, /* @__PURE__ */ React38.createElement(IdentityPanel, {
|
|
3878
3618
|
...props,
|
|
3879
3619
|
titleId,
|
|
3880
|
-
doneActionParent: /* @__PURE__ */
|
|
3620
|
+
doneActionParent: /* @__PURE__ */ React38.createElement(Dialog.Close, {
|
|
3881
3621
|
asChild: true
|
|
3882
3622
|
})
|
|
3883
3623
|
}))))));
|
|
3884
3624
|
};
|
|
3885
3625
|
|
|
3886
3626
|
// packages/sdk/shell/src/composites/JoinDialog/JoinDialog.tsx
|
|
3887
|
-
import
|
|
3627
|
+
import React39 from "react";
|
|
3888
3628
|
import { AlertDialog, useId as useId11, useVisualViewport } from "@dxos/react-ui";
|
|
3889
3629
|
var JoinDialog = (joinPanelProps) => {
|
|
3890
3630
|
const titleId = useId11("joinDialog__title");
|
|
3891
3631
|
const { height } = useVisualViewport();
|
|
3892
|
-
return /* @__PURE__ */
|
|
3632
|
+
return /* @__PURE__ */ React39.createElement(AlertDialog.Root, {
|
|
3893
3633
|
defaultOpen: true,
|
|
3894
3634
|
onOpenChange: (open) => open || (joinPanelProps.onExit ? joinPanelProps.onExit() : joinPanelProps.onDone?.(null))
|
|
3895
|
-
}, /* @__PURE__ */
|
|
3635
|
+
}, /* @__PURE__ */ React39.createElement(AlertDialog.Portal, null, /* @__PURE__ */ React39.createElement(AlertDialog.Overlay, {
|
|
3896
3636
|
classNames: "backdrop-blur",
|
|
3897
3637
|
...height && {
|
|
3898
3638
|
style: {
|
|
3899
3639
|
blockSize: `${height}px`
|
|
3900
3640
|
}
|
|
3901
3641
|
}
|
|
3902
|
-
}, /* @__PURE__ */
|
|
3642
|
+
}, /* @__PURE__ */ React39.createElement(AlertDialog.Content, {
|
|
3903
3643
|
"aria-labelledby": titleId
|
|
3904
|
-
}, /* @__PURE__ */
|
|
3644
|
+
}, /* @__PURE__ */ React39.createElement(JoinPanel, {
|
|
3905
3645
|
...joinPanelProps,
|
|
3906
3646
|
titleId,
|
|
3907
|
-
exitActionParent: /* @__PURE__ */
|
|
3647
|
+
exitActionParent: /* @__PURE__ */ React39.createElement(AlertDialog.Cancel, {
|
|
3908
3648
|
asChild: true
|
|
3909
3649
|
}),
|
|
3910
|
-
doneActionParent: /* @__PURE__ */
|
|
3650
|
+
doneActionParent: /* @__PURE__ */ React39.createElement(AlertDialog.Action, {
|
|
3911
3651
|
asChild: true
|
|
3912
3652
|
})
|
|
3913
3653
|
})))));
|
|
3914
3654
|
};
|
|
3915
3655
|
|
|
3916
3656
|
// packages/sdk/shell/src/composites/Shell/run-shell.tsx
|
|
3917
|
-
import
|
|
3657
|
+
import React43, { StrictMode } from "react";
|
|
3918
3658
|
import { createRoot } from "react-dom/client";
|
|
3919
3659
|
import { DEFAULT_CLIENT_CHANNEL, DEFAULT_SHELL_CHANNEL } from "@dxos/client-protocol";
|
|
3920
3660
|
import { AgentHostingProvider, ClientProvider, ClientServicesProxy, Config, ShellDisplay as ShellDisplay2 } from "@dxos/react-client";
|
|
3921
|
-
import { Button as
|
|
3661
|
+
import { Button as Button8, Clipboard as Clipboard5, Dialog as Dialog3, ThemeProvider, Tooltip as Tooltip4, useTranslation as useTranslation23 } from "@dxos/react-ui";
|
|
3922
3662
|
import { defaultTx } from "@dxos/react-ui-theme";
|
|
3923
3663
|
import { createIFramePort } from "@dxos/rpc-tunnel";
|
|
3924
3664
|
|
|
3925
3665
|
// packages/sdk/shell/src/composites/Shell/Shell.tsx
|
|
3926
|
-
import
|
|
3666
|
+
import React42, { useEffect as useEffect8, useState as useState10 } from "react";
|
|
3927
3667
|
import { log as log15 } from "@dxos/log";
|
|
3928
3668
|
import { useClient as useClient9 } from "@dxos/react-client";
|
|
3929
3669
|
import { ShellDisplay, ShellLayout } from "@dxos/react-client";
|
|
3930
3670
|
import { useSpace as useSpace2 } from "@dxos/react-client/echo";
|
|
3931
3671
|
|
|
3932
3672
|
// packages/sdk/shell/src/composites/SpaceDialog/SpaceDialog.tsx
|
|
3933
|
-
import
|
|
3673
|
+
import React40 from "react";
|
|
3934
3674
|
import { Clipboard as Clipboard4, Dialog as Dialog2, useId as useId12 } from "@dxos/react-ui";
|
|
3935
3675
|
var SpaceDialog = (spacePanelProps) => {
|
|
3936
3676
|
const titleId = useId12("spaceDialog__title");
|
|
3937
|
-
return /* @__PURE__ */
|
|
3677
|
+
return /* @__PURE__ */ React40.createElement(Dialog2.Root, {
|
|
3938
3678
|
defaultOpen: true,
|
|
3939
3679
|
onOpenChange: (open) => open || spacePanelProps.onDone?.()
|
|
3940
|
-
}, /* @__PURE__ */
|
|
3680
|
+
}, /* @__PURE__ */ React40.createElement(Dialog2.Portal, null, /* @__PURE__ */ React40.createElement(Dialog2.Overlay, null, /* @__PURE__ */ React40.createElement(Dialog2.Content, {
|
|
3941
3681
|
"aria-labelledby": titleId
|
|
3942
|
-
}, /* @__PURE__ */
|
|
3682
|
+
}, /* @__PURE__ */ React40.createElement(Clipboard4.Provider, null, /* @__PURE__ */ React40.createElement(SpacePanel, {
|
|
3943
3683
|
...spacePanelProps,
|
|
3944
3684
|
titleId,
|
|
3945
|
-
doneActionParent: /* @__PURE__ */
|
|
3685
|
+
doneActionParent: /* @__PURE__ */ React40.createElement(Dialog2.Close, {
|
|
3946
3686
|
asChild: true
|
|
3947
3687
|
})
|
|
3948
3688
|
}))))));
|
|
3949
3689
|
};
|
|
3950
3690
|
|
|
3951
3691
|
// packages/sdk/shell/src/composites/StatusDialog/StatusDialog.tsx
|
|
3952
|
-
import
|
|
3692
|
+
import React41 from "react";
|
|
3953
3693
|
import { AlertDialog as AlertDialog2, useId as useId13 } from "@dxos/react-ui";
|
|
3954
3694
|
var StatusDialog = () => {
|
|
3955
3695
|
const titleId = useId13("statusDialog__title");
|
|
3956
|
-
return /* @__PURE__ */
|
|
3696
|
+
return /* @__PURE__ */ React41.createElement(AlertDialog2.Root, {
|
|
3957
3697
|
open: true
|
|
3958
|
-
}, /* @__PURE__ */
|
|
3698
|
+
}, /* @__PURE__ */ React41.createElement(AlertDialog2.Portal, null, /* @__PURE__ */ React41.createElement(AlertDialog2.Overlay, null, /* @__PURE__ */ React41.createElement(AlertDialog2.Content, {
|
|
3959
3699
|
"aria-labelledby": titleId
|
|
3960
|
-
}, /* @__PURE__ */
|
|
3700
|
+
}, /* @__PURE__ */ React41.createElement(StatusPanel, {
|
|
3961
3701
|
titleId
|
|
3962
3702
|
})))));
|
|
3963
3703
|
};
|
|
@@ -3966,14 +3706,14 @@ var StatusDialog = () => {
|
|
|
3966
3706
|
var __dxlog_file14 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/composites/Shell/Shell.tsx";
|
|
3967
3707
|
var blurActiveElement = () => document.activeElement?.blur?.();
|
|
3968
3708
|
var Shell = ({ runtime }) => {
|
|
3969
|
-
const [{ layout, invitationCode, spaceKey, spaceId, target }, setLayout] =
|
|
3709
|
+
const [{ layout, invitationCode, spaceKey, spaceId, target }, setLayout] = useState10({
|
|
3970
3710
|
layout: runtime.layout,
|
|
3971
3711
|
invitationCode: runtime.invitationCode,
|
|
3972
3712
|
spaceKey: runtime.spaceKey,
|
|
3973
3713
|
spaceId: runtime.spaceId,
|
|
3974
3714
|
target: runtime.target
|
|
3975
3715
|
});
|
|
3976
|
-
const [{ invitationUrl, deviceInvitationParam, spaceInvitationParam }, setInvitationUrl] =
|
|
3716
|
+
const [{ invitationUrl, deviceInvitationParam, spaceInvitationParam }, setInvitationUrl] = useState10({
|
|
3977
3717
|
invitationUrl: runtime.invitationUrl,
|
|
3978
3718
|
deviceInvitationParam: runtime.deviceInvitationParam,
|
|
3979
3719
|
spaceInvitationParam: runtime.spaceInvitationParam
|
|
@@ -4025,11 +3765,11 @@ var Shell = ({ runtime }) => {
|
|
|
4025
3765
|
]);
|
|
4026
3766
|
switch (layout) {
|
|
4027
3767
|
case ShellLayout.STATUS:
|
|
4028
|
-
return /* @__PURE__ */
|
|
3768
|
+
return /* @__PURE__ */ React42.createElement(StatusDialog, null);
|
|
4029
3769
|
case ShellLayout.INITIALIZE_IDENTITY:
|
|
4030
3770
|
case ShellLayout.INITIALIZE_IDENTITY_FROM_INVITATION:
|
|
4031
3771
|
case ShellLayout.INITIALIZE_IDENTITY_FROM_RECOVERY:
|
|
4032
|
-
return /* @__PURE__ */
|
|
3772
|
+
return /* @__PURE__ */ React42.createElement(JoinDialog, {
|
|
4033
3773
|
mode: "halo-only",
|
|
4034
3774
|
initialDisposition: layout === ShellLayout.INITIALIZE_IDENTITY_FROM_RECOVERY ? "recover-identity" : layout === ShellLayout.INITIALIZE_IDENTITY_FROM_INVITATION ? "accept-halo-invitation" : "default",
|
|
4035
3775
|
initialInvitationCode: invitationCode,
|
|
@@ -4049,7 +3789,7 @@ var Shell = ({ runtime }) => {
|
|
|
4049
3789
|
case ShellLayout.IDENTITY:
|
|
4050
3790
|
case ShellLayout.SHARE_IDENTITY:
|
|
4051
3791
|
case ShellLayout.EDIT_PROFILE:
|
|
4052
|
-
return /* @__PURE__ */
|
|
3792
|
+
return /* @__PURE__ */ React42.createElement(IdentityDialog, {
|
|
4053
3793
|
createInvitationUrl: createDeviceInvitationUrl,
|
|
4054
3794
|
onResetStorage: async () => {
|
|
4055
3795
|
runtime.setLayout({
|
|
@@ -4095,7 +3835,7 @@ var Shell = ({ runtime }) => {
|
|
|
4095
3835
|
initialDisposition: layout === ShellLayout.SHARE_IDENTITY ? "manage-device-invitation" : "default"
|
|
4096
3836
|
});
|
|
4097
3837
|
case ShellLayout.SPACE:
|
|
4098
|
-
return space ? /* @__PURE__ */
|
|
3838
|
+
return space ? /* @__PURE__ */ React42.createElement(SpaceDialog, {
|
|
4099
3839
|
space,
|
|
4100
3840
|
target,
|
|
4101
3841
|
createInvitationUrl: createSpaceInvitationUrl,
|
|
@@ -4110,7 +3850,7 @@ var Shell = ({ runtime }) => {
|
|
|
4110
3850
|
}
|
|
4111
3851
|
}) : null;
|
|
4112
3852
|
case ShellLayout.JOIN_SPACE:
|
|
4113
|
-
return /* @__PURE__ */
|
|
3853
|
+
return /* @__PURE__ */ React42.createElement(JoinDialog, {
|
|
4114
3854
|
initialInvitationCode: invitationCode,
|
|
4115
3855
|
onDone: async (result) => {
|
|
4116
3856
|
blurActiveElement();
|
|
@@ -4417,25 +4157,25 @@ var runShell = async (config = new Config()) => {
|
|
|
4417
4157
|
const services = new ClientServicesProxy(createIFramePort({
|
|
4418
4158
|
channel: DEFAULT_CLIENT_CHANNEL
|
|
4419
4159
|
}));
|
|
4420
|
-
createRoot(document.getElementById("root")).render(/* @__PURE__ */
|
|
4160
|
+
createRoot(document.getElementById("root")).render(/* @__PURE__ */ React43.createElement(StrictMode, null, /* @__PURE__ */ React43.createElement(ThemeProvider, {
|
|
4421
4161
|
tx: defaultTx,
|
|
4422
4162
|
resourceExtensions: [
|
|
4423
4163
|
osTranslations
|
|
4424
4164
|
]
|
|
4425
|
-
}, /* @__PURE__ */
|
|
4165
|
+
}, /* @__PURE__ */ React43.createElement(ClientProvider, {
|
|
4426
4166
|
config,
|
|
4427
4167
|
services,
|
|
4428
4168
|
noBanner: true
|
|
4429
|
-
}, /* @__PURE__ */
|
|
4169
|
+
}, /* @__PURE__ */ React43.createElement(Clipboard5.Provider, null, /* @__PURE__ */ React43.createElement(Tooltip4.Provider, null, /* @__PURE__ */ React43.createElement(AgentHostingProvider, null, /* @__PURE__ */ React43.createElement(Shell, {
|
|
4430
4170
|
runtime
|
|
4431
4171
|
}))))))));
|
|
4432
4172
|
} catch {
|
|
4433
|
-
createRoot(document.getElementById("root")).render(/* @__PURE__ */
|
|
4173
|
+
createRoot(document.getElementById("root")).render(/* @__PURE__ */ React43.createElement(StrictMode, null, /* @__PURE__ */ React43.createElement(ThemeProvider, {
|
|
4434
4174
|
tx: defaultTx,
|
|
4435
4175
|
resourceExtensions: [
|
|
4436
4176
|
osTranslations
|
|
4437
4177
|
]
|
|
4438
|
-
}, /* @__PURE__ */
|
|
4178
|
+
}, /* @__PURE__ */ React43.createElement(Fallback, {
|
|
4439
4179
|
onClose: () => runtime.setAppContext({
|
|
4440
4180
|
display: ShellDisplay2.NONE
|
|
4441
4181
|
})
|
|
@@ -4443,24 +4183,24 @@ var runShell = async (config = new Config()) => {
|
|
|
4443
4183
|
}
|
|
4444
4184
|
};
|
|
4445
4185
|
var Fallback = ({ onClose }) => {
|
|
4446
|
-
const { t } =
|
|
4447
|
-
return /* @__PURE__ */
|
|
4186
|
+
const { t } = useTranslation23("os");
|
|
4187
|
+
return /* @__PURE__ */ React43.createElement(Dialog3.Root, {
|
|
4448
4188
|
modal: true,
|
|
4449
4189
|
open: true,
|
|
4450
4190
|
onOpenChange: () => onClose?.()
|
|
4451
|
-
}, /* @__PURE__ */
|
|
4191
|
+
}, /* @__PURE__ */ React43.createElement(Dialog3.Overlay, null, /* @__PURE__ */ React43.createElement(Dialog3.Content, null, /* @__PURE__ */ React43.createElement(Dialog3.Title, null, t("shell fallback title")), /* @__PURE__ */ React43.createElement(Dialog3.Close, {
|
|
4452
4192
|
asChild: true,
|
|
4453
4193
|
onClick: () => onClose?.()
|
|
4454
|
-
}, /* @__PURE__ */
|
|
4194
|
+
}, /* @__PURE__ */ React43.createElement(Button8, {
|
|
4455
4195
|
variant: "primary"
|
|
4456
4196
|
}, t("close label"))))));
|
|
4457
4197
|
};
|
|
4458
4198
|
|
|
4459
4199
|
// packages/sdk/shell/src/composites/Shell/ShellContext.tsx
|
|
4460
|
-
import
|
|
4200
|
+
import React44, { createContext, useCallback as useCallback8, useContext, useEffect as useEffect9, useMemo as useMemo6, useState as useState11 } from "react";
|
|
4461
4201
|
import { useClient as useClient10, ShellDisplay as ShellDisplay3, ShellLayout as ShellLayout4 } from "@dxos/react-client";
|
|
4462
4202
|
import { useIdentity as useIdentity3 } from "@dxos/react-client/halo";
|
|
4463
|
-
import { mx as
|
|
4203
|
+
import { mx as mx23 } from "@dxos/react-ui-theme";
|
|
4464
4204
|
|
|
4465
4205
|
// packages/sdk/shell/src/composites/Shell/memory-shell-runtime.ts
|
|
4466
4206
|
import { Event as Event2 } from "@dxos/async";
|
|
@@ -4538,7 +4278,7 @@ var useShell = () => {
|
|
|
4538
4278
|
var ShellProvider = ({ space, deviceInvitationCode, spaceInvitationCode, onJoinedSpace, children }) => {
|
|
4539
4279
|
const client = useClient10();
|
|
4540
4280
|
const identity = useIdentity3();
|
|
4541
|
-
const [display, setDisplay] =
|
|
4281
|
+
const [display, setDisplay] = useState11(!identity || spaceInvitationCode || deviceInvitationCode ? ShellDisplay3.FULLSCREEN : ShellDisplay3.NONE);
|
|
4542
4282
|
const shellRuntime = useMemo6(() => {
|
|
4543
4283
|
if (client.config.get("runtime.app.env.DX_VAULT") !== "false") {
|
|
4544
4284
|
return;
|
|
@@ -4608,11 +4348,11 @@ var ShellProvider = ({ space, deviceInvitationCode, spaceInvitationCode, onJoine
|
|
|
4608
4348
|
}, [
|
|
4609
4349
|
shellRuntime
|
|
4610
4350
|
]);
|
|
4611
|
-
return /* @__PURE__ */
|
|
4612
|
-
className:
|
|
4613
|
-
}, /* @__PURE__ */
|
|
4351
|
+
return /* @__PURE__ */ React44.createElement(React44.Fragment, null, shellRuntime && /* @__PURE__ */ React44.createElement("div", {
|
|
4352
|
+
className: mx23(display === ShellDisplay3.NONE ? "hidden" : "")
|
|
4353
|
+
}, /* @__PURE__ */ React44.createElement(Shell, {
|
|
4614
4354
|
runtime: shellRuntime
|
|
4615
|
-
})), /* @__PURE__ */
|
|
4355
|
+
})), /* @__PURE__ */ React44.createElement(ShellContext.Provider, {
|
|
4616
4356
|
value: {
|
|
4617
4357
|
runtime: shellRuntime,
|
|
4618
4358
|
setDisplay
|
|
@@ -4632,11 +4372,7 @@ export {
|
|
|
4632
4372
|
ConfirmResetImpl,
|
|
4633
4373
|
DeviceList,
|
|
4634
4374
|
Emoji,
|
|
4635
|
-
EmojiPickerBlock,
|
|
4636
|
-
EmojiPickerToolbarButton,
|
|
4637
4375
|
Heading,
|
|
4638
|
-
HuePickerBlock,
|
|
4639
|
-
HuePickerToolbarButton,
|
|
4640
4376
|
IdentityDialog,
|
|
4641
4377
|
IdentityListItem,
|
|
4642
4378
|
IdentityPanel,
|