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