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