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