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