@dxos/shell 0.4.7-main.ea67fec → 0.4.7-main.f9d3866
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 +21882 -64428
- package/dist/bundle/shell.mjs.map +1 -1
- package/dist/bundle/shell.umd.js +78 -793
- 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 +591 -766
- package/dist/lib/browser/react.mjs.map +4 -4
- package/dist/types/src/components/IdentityList/IdentityListItem.d.ts.map +1 -1
- package/dist/types/src/components/IdentityList/IdentityListItem.js +5 -5
- package/dist/types/src/components/IdentityList/IdentityListItem.js.map +1 -1
- package/dist/types/src/components/InvitationList/InvitationListItem.d.ts.map +1 -1
- package/dist/types/src/components/InvitationList/InvitationListItem.js +2 -2
- package/dist/types/src/components/InvitationList/InvitationListItem.js.map +1 -1
- package/dist/types/src/components/SpaceListItem.d.ts.map +1 -1
- package/dist/types/src/components/SpaceListItem.js +3 -2
- package/dist/types/src/components/SpaceListItem.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 +5 -6
- package/dist/types/src/panels/IdentityPanel/IdentityPanel.js.map +1 -1
- package/dist/types/src/panels/IdentityPanel/steps/ProfileForm.d.ts.map +1 -1
- package/dist/types/src/panels/IdentityPanel/steps/ProfileForm.js +3 -12
- package/dist/types/src/panels/IdentityPanel/steps/ProfileForm.js.map +1 -1
- package/dist/types/src/panels/JoinPanel/steps/IdentityAdded.d.ts.map +1 -1
- package/dist/types/src/panels/JoinPanel/steps/IdentityAdded.js +7 -8
- package/dist/types/src/panels/JoinPanel/steps/IdentityAdded.js.map +1 -1
- package/dist/types/src/panels/JoinPanel/steps/InvitationAuthenticator.js +2 -2
- package/dist/types/src/panels/JoinPanel/steps/InvitationAuthenticator.js.map +1 -1
- package/dist/types/src/steps/InvitationManager.d.ts.map +1 -1
- package/dist/types/src/steps/InvitationManager.js +4 -5
- package/dist/types/src/steps/InvitationManager.js.map +1 -1
- package/dist/types/src/translations/locales/en-US.d.ts +0 -21
- package/dist/types/src/translations/locales/en-US.d.ts.map +1 -1
- package/dist/types/src/translations/locales/en-US.js +0 -21
- package/dist/types/src/translations/locales/en-US.js.map +1 -1
- package/dist/types/src/util/index.d.ts +1 -0
- package/dist/types/src/util/index.d.ts.map +1 -1
- package/dist/types/src/util/index.js +1 -0
- package/dist/types/src/util/index.js.map +1 -1
- package/dist/types/src/util/toEmoji.d.ts +2 -0
- package/dist/types/src/util/toEmoji.d.ts.map +1 -0
- package/dist/types/src/util/toEmoji.js +26 -0
- package/dist/types/src/util/toEmoji.js.map +1 -0
- package/package.json +21 -22
- package/src/components/IdentityList/IdentityListItem.tsx +5 -9
- package/src/components/InvitationList/InvitationListItem.tsx +2 -2
- package/src/components/SpaceListItem.tsx +5 -4
- package/src/components/index.ts +0 -2
- package/src/panels/IdentityPanel/IdentityPanel.tsx +4 -5
- package/src/panels/IdentityPanel/steps/ProfileForm.tsx +7 -28
- package/src/panels/JoinPanel/steps/IdentityAdded.tsx +7 -7
- package/src/panels/JoinPanel/steps/InvitationAuthenticator.tsx +2 -2
- package/src/steps/InvitationManager.tsx +3 -4
- package/src/translations/locales/en-US.ts +0 -21
- package/src/util/index.ts +1 -0
- package/src/util/toEmoji.ts +22 -0
- package/dist/types/src/components/EmojiPicker.d.ts +0 -11
- package/dist/types/src/components/EmojiPicker.d.ts.map +0 -1
- package/dist/types/src/components/EmojiPicker.js +0 -79
- package/dist/types/src/components/EmojiPicker.js.map +0 -1
- package/dist/types/src/components/HuePicker.d.ts +0 -11
- package/dist/types/src/components/HuePicker.d.ts.map +0 -1
- package/dist/types/src/components/HuePicker.js +0 -56
- package/dist/types/src/components/HuePicker.js.map +0 -1
- package/src/components/EmojiPicker.tsx +0 -82
- package/src/components/HuePicker.tsx +0 -87
|
@@ -139,188 +139,47 @@ var CompoundButton = ({ children, description, before, after, variant = "default
|
|
|
139
139
|
}, after));
|
|
140
140
|
};
|
|
141
141
|
|
|
142
|
-
// packages/sdk/shell/src/components/EmojiPicker.tsx
|
|
143
|
-
import emojiData from "@emoji-mart/data";
|
|
144
|
-
import EmojiMart from "@emoji-mart/react";
|
|
145
|
-
import { ArrowCounterClockwise, CaretDown } from "@phosphor-icons/react";
|
|
146
|
-
import { useControllableState } from "@radix-ui/react-use-controllable-state";
|
|
147
|
-
import React4, { useState as useState3 } from "react";
|
|
148
|
-
import { Button as Button2, Popover, useTranslation as useTranslation2, Tooltip as Tooltip2 } from "@dxos/react-ui";
|
|
149
|
-
import { getSize as getSize2 } from "@dxos/react-ui-theme";
|
|
150
|
-
var EmojiPicker = ({ disabled, defaultEmoji, emoji, onChangeEmoji, onClickClear }) => {
|
|
151
|
-
const { t } = useTranslation2("os");
|
|
152
|
-
const [emojiValue, setEmojiValue] = useControllableState({
|
|
153
|
-
prop: emoji,
|
|
154
|
-
onChange: onChangeEmoji,
|
|
155
|
-
defaultProp: defaultEmoji
|
|
156
|
-
});
|
|
157
|
-
const [emojiPickerOpen, setEmojiPickerOpen] = useState3(false);
|
|
158
|
-
return /* @__PURE__ */ React4.createElement(React4.Fragment, null, /* @__PURE__ */ React4.createElement(Popover.Root, {
|
|
159
|
-
open: emojiPickerOpen,
|
|
160
|
-
onOpenChange: setEmojiPickerOpen
|
|
161
|
-
}, /* @__PURE__ */ React4.createElement(Popover.Trigger, {
|
|
162
|
-
asChild: true
|
|
163
|
-
}, /* @__PURE__ */ React4.createElement(Button2, {
|
|
164
|
-
variant: "ghost",
|
|
165
|
-
classNames: "gap-2 text-2xl plb-1",
|
|
166
|
-
disabled
|
|
167
|
-
}, /* @__PURE__ */ React4.createElement("span", {
|
|
168
|
-
className: "sr-only"
|
|
169
|
-
}, t("select emoji label")), /* @__PURE__ */ React4.createElement("span", {
|
|
170
|
-
className: "grow pis-14"
|
|
171
|
-
}, emojiValue), /* @__PURE__ */ React4.createElement(CaretDown, {
|
|
172
|
-
className: getSize2(4)
|
|
173
|
-
}))), /* @__PURE__ */ React4.createElement(Popover.Content, {
|
|
174
|
-
side: "right",
|
|
175
|
-
onKeyDownCapture: (event) => {
|
|
176
|
-
if (event.key === "Escape") {
|
|
177
|
-
event.stopPropagation();
|
|
178
|
-
setEmojiPickerOpen(false);
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
}, /* @__PURE__ */ React4.createElement(EmojiMart, {
|
|
182
|
-
data: emojiData,
|
|
183
|
-
onEmojiSelect: ({ native }) => {
|
|
184
|
-
if (native) {
|
|
185
|
-
setEmojiValue(native);
|
|
186
|
-
setEmojiPickerOpen(false);
|
|
187
|
-
}
|
|
188
|
-
},
|
|
189
|
-
autoFocus: true,
|
|
190
|
-
maxFrequentRows: 0,
|
|
191
|
-
noCountryFlags: true
|
|
192
|
-
}), /* @__PURE__ */ React4.createElement(Popover.Arrow, null))), /* @__PURE__ */ React4.createElement(Tooltip2.Root, null, /* @__PURE__ */ React4.createElement(Tooltip2.Trigger, {
|
|
193
|
-
asChild: true
|
|
194
|
-
}, /* @__PURE__ */ React4.createElement(Button2, {
|
|
195
|
-
variant: "ghost",
|
|
196
|
-
onClick: onClickClear,
|
|
197
|
-
disabled
|
|
198
|
-
}, /* @__PURE__ */ React4.createElement("span", {
|
|
199
|
-
className: "sr-only"
|
|
200
|
-
}, t("clear label")), /* @__PURE__ */ React4.createElement(ArrowCounterClockwise, null))), /* @__PURE__ */ React4.createElement(Tooltip2.Portal, null, /* @__PURE__ */ React4.createElement(Tooltip2.Content, {
|
|
201
|
-
style: {
|
|
202
|
-
zIndex: 70
|
|
203
|
-
},
|
|
204
|
-
side: "right"
|
|
205
|
-
}, t("clear label"), /* @__PURE__ */ React4.createElement(Tooltip2.Arrow, null)))));
|
|
206
|
-
};
|
|
207
|
-
|
|
208
|
-
// packages/sdk/shell/src/components/HuePicker.tsx
|
|
209
|
-
import { ArrowCounterClockwise as ArrowCounterClockwise2, CaretDown as CaretDown2, Check as Check2 } from "@phosphor-icons/react";
|
|
210
|
-
import { useControllableState as useControllableState2 } from "@radix-ui/react-use-controllable-state";
|
|
211
|
-
import React5 from "react";
|
|
212
|
-
import { Button as Button3, useTranslation as useTranslation3, Tooltip as Tooltip3, DropdownMenu, useThemeContext as useThemeContext2 } from "@dxos/react-ui";
|
|
213
|
-
import { getSize as getSize3, hueTokenThemes } from "@dxos/react-ui-theme";
|
|
214
|
-
var HuePreview = ({ hue }) => {
|
|
215
|
-
const { tx } = useThemeContext2();
|
|
216
|
-
return /* @__PURE__ */ React5.createElement("svg", {
|
|
217
|
-
width: 12,
|
|
218
|
-
height: 12,
|
|
219
|
-
viewBox: "0 0 12 12"
|
|
220
|
-
}, /* @__PURE__ */ React5.createElement("rect", {
|
|
221
|
-
x: 0,
|
|
222
|
-
y: 0,
|
|
223
|
-
width: 12,
|
|
224
|
-
height: 12,
|
|
225
|
-
className: tx("hue.fill", "select--hue__preview", {
|
|
226
|
-
hue
|
|
227
|
-
})
|
|
228
|
-
}));
|
|
229
|
-
};
|
|
230
|
-
var HuePicker = ({ disabled, hue, onChangeHue, defaultHue, onClickClear }) => {
|
|
231
|
-
const { t } = useTranslation3("os");
|
|
232
|
-
const [hueValue, setHueValue] = useControllableState2({
|
|
233
|
-
prop: hue,
|
|
234
|
-
onChange: onChangeHue,
|
|
235
|
-
defaultProp: defaultHue
|
|
236
|
-
});
|
|
237
|
-
return /* @__PURE__ */ React5.createElement(React5.Fragment, null, /* @__PURE__ */ React5.createElement(DropdownMenu.Root, {
|
|
238
|
-
modal: false
|
|
239
|
-
}, /* @__PURE__ */ React5.createElement(DropdownMenu.Trigger, {
|
|
240
|
-
asChild: true
|
|
241
|
-
}, /* @__PURE__ */ React5.createElement(Button3, {
|
|
242
|
-
variant: "ghost",
|
|
243
|
-
classNames: "gap-2 plb-1",
|
|
244
|
-
disabled
|
|
245
|
-
}, /* @__PURE__ */ React5.createElement("span", {
|
|
246
|
-
className: "sr-only"
|
|
247
|
-
}, t("select hue label")), /* @__PURE__ */ React5.createElement("div", {
|
|
248
|
-
role: "none",
|
|
249
|
-
className: "pis-14 grow flex items-center justify-center gap-2"
|
|
250
|
-
}, /* @__PURE__ */ React5.createElement(HuePreview, {
|
|
251
|
-
hue: hueValue
|
|
252
|
-
}), /* @__PURE__ */ React5.createElement("span", null, t(`${hueValue} label`))), /* @__PURE__ */ React5.createElement(CaretDown2, {
|
|
253
|
-
className: getSize3(4)
|
|
254
|
-
}))), /* @__PURE__ */ React5.createElement(DropdownMenu.Content, {
|
|
255
|
-
side: "right"
|
|
256
|
-
}, /* @__PURE__ */ React5.createElement(DropdownMenu.Viewport, null, Object.keys(hueTokenThemes).map((hue2) => {
|
|
257
|
-
return /* @__PURE__ */ React5.createElement(DropdownMenu.CheckboxItem, {
|
|
258
|
-
key: hue2,
|
|
259
|
-
checked: hue2 === hueValue,
|
|
260
|
-
onCheckedChange: () => setHueValue(hue2)
|
|
261
|
-
}, /* @__PURE__ */ React5.createElement(HuePreview, {
|
|
262
|
-
hue: hue2
|
|
263
|
-
}), /* @__PURE__ */ React5.createElement("span", {
|
|
264
|
-
className: "grow"
|
|
265
|
-
}, t(`${hue2} label`)), /* @__PURE__ */ React5.createElement(DropdownMenu.ItemIndicator, null, /* @__PURE__ */ React5.createElement(Check2, null)));
|
|
266
|
-
})), /* @__PURE__ */ React5.createElement(DropdownMenu.Arrow, null))), /* @__PURE__ */ React5.createElement(Tooltip3.Root, null, /* @__PURE__ */ React5.createElement(Tooltip3.Trigger, {
|
|
267
|
-
asChild: true
|
|
268
|
-
}, /* @__PURE__ */ React5.createElement(Button3, {
|
|
269
|
-
variant: "ghost",
|
|
270
|
-
onClick: onClickClear,
|
|
271
|
-
disabled
|
|
272
|
-
}, /* @__PURE__ */ React5.createElement("span", {
|
|
273
|
-
className: "sr-only"
|
|
274
|
-
}, t("clear label")), /* @__PURE__ */ React5.createElement(ArrowCounterClockwise2, null))), /* @__PURE__ */ React5.createElement(Tooltip3.Portal, null, /* @__PURE__ */ React5.createElement(Tooltip3.Content, {
|
|
275
|
-
style: {
|
|
276
|
-
zIndex: 70
|
|
277
|
-
},
|
|
278
|
-
side: "right"
|
|
279
|
-
}, t("clear label"), /* @__PURE__ */ React5.createElement(Tooltip3.Arrow, null)))));
|
|
280
|
-
};
|
|
281
|
-
|
|
282
142
|
// packages/sdk/shell/src/components/IdentityList/DeviceList.tsx
|
|
283
|
-
import
|
|
143
|
+
import React5 from "react";
|
|
284
144
|
import { generateName as generateName2 } from "@dxos/display-name";
|
|
285
145
|
import { DeviceType } from "@dxos/react-client/halo";
|
|
286
|
-
import { List, useTranslation as
|
|
146
|
+
import { List, useTranslation as useTranslation2 } from "@dxos/react-ui";
|
|
287
147
|
import { descriptionText as descriptionText2, mx as mx4 } from "@dxos/react-ui-theme";
|
|
288
148
|
|
|
289
149
|
// packages/sdk/shell/src/components/IdentityList/IdentityListItem.tsx
|
|
290
|
-
import
|
|
150
|
+
import React4, { forwardRef } from "react";
|
|
291
151
|
import { generateName } from "@dxos/display-name";
|
|
292
152
|
import { SpaceMember } from "@dxos/react-client/echo";
|
|
293
|
-
import { ListItem, Avatar, useId as useId2 } from "@dxos/react-ui";
|
|
153
|
+
import { ListItem, Avatar, useJdenticonHref, useId as useId2 } from "@dxos/react-ui";
|
|
294
154
|
import { mx as mx3 } from "@dxos/react-ui-theme";
|
|
295
|
-
import { keyToFallback } from "@dxos/util";
|
|
296
155
|
var IdentityListItem = /* @__PURE__ */ forwardRef(({ identity, presence, onClick, classNames, ...props }, forwardedRef) => {
|
|
297
|
-
const fallbackValue =
|
|
156
|
+
const fallbackValue = identity.identityKey.toHex();
|
|
298
157
|
const labelId = useId2("identityListItem__label");
|
|
158
|
+
const jdenticon = useJdenticonHref(fallbackValue ?? "", 12);
|
|
299
159
|
const displayName = identity.profile?.displayName ?? generateName(identity.identityKey.toHex());
|
|
300
|
-
return /* @__PURE__ */
|
|
160
|
+
return /* @__PURE__ */ React4.createElement(ListItem.Root, {
|
|
301
161
|
...props,
|
|
302
162
|
classNames: mx3("flex gap-2 pis-3 pie-1 items-center", onClick && "cursor-pointer", classNames),
|
|
303
163
|
onClick: () => onClick?.(),
|
|
304
164
|
"data-testid": "identity-list-item",
|
|
305
165
|
labelId,
|
|
306
166
|
ref: forwardedRef
|
|
307
|
-
}, /* @__PURE__ */
|
|
167
|
+
}, /* @__PURE__ */ React4.createElement(Avatar.Root, {
|
|
308
168
|
status: presence === SpaceMember.PresenceState.ONLINE ? "active" : "inactive",
|
|
309
|
-
labelId
|
|
310
|
-
|
|
311
|
-
}, /* @__PURE__ */ React6.createElement(Avatar.Frame, {
|
|
169
|
+
labelId
|
|
170
|
+
}, /* @__PURE__ */ React4.createElement(Avatar.Frame, {
|
|
312
171
|
classNames: "place-self-center"
|
|
313
|
-
}, /* @__PURE__ */
|
|
314
|
-
|
|
315
|
-
})), /* @__PURE__ */
|
|
172
|
+
}, /* @__PURE__ */ React4.createElement(Avatar.Fallback, {
|
|
173
|
+
href: jdenticon
|
|
174
|
+
})), /* @__PURE__ */ React4.createElement(Avatar.Label, {
|
|
316
175
|
classNames: "text-sm truncate pli-2"
|
|
317
176
|
}, displayName)));
|
|
318
177
|
});
|
|
319
178
|
|
|
320
179
|
// packages/sdk/shell/src/components/IdentityList/DeviceList.tsx
|
|
321
180
|
var DeviceList = ({ devices, onSelect }) => {
|
|
322
|
-
const { t } =
|
|
323
|
-
return devices.length > 0 ? /* @__PURE__ */
|
|
181
|
+
const { t } = useTranslation2("os");
|
|
182
|
+
return devices.length > 0 ? /* @__PURE__ */ React5.createElement(List, {
|
|
324
183
|
classNames: "flex flex-col gap-2"
|
|
325
184
|
}, devices.map((device) => {
|
|
326
185
|
const deviceType = device.profile?.type || DeviceType.UNKNOWN;
|
|
@@ -331,25 +190,25 @@ var DeviceList = ({ devices, onSelect }) => {
|
|
|
331
190
|
displayName
|
|
332
191
|
}
|
|
333
192
|
};
|
|
334
|
-
return /* @__PURE__ */
|
|
193
|
+
return /* @__PURE__ */ React5.createElement(IdentityListItem, {
|
|
335
194
|
key: device.deviceKey.toHex(),
|
|
336
195
|
identity,
|
|
337
196
|
presence: device.presence,
|
|
338
197
|
onClick: onSelect && (() => onSelect(device))
|
|
339
198
|
});
|
|
340
|
-
})) : /* @__PURE__ */
|
|
199
|
+
})) : /* @__PURE__ */ React5.createElement("div", {
|
|
341
200
|
role: "none",
|
|
342
201
|
className: "grow flex items-center p-2"
|
|
343
|
-
}, /* @__PURE__ */
|
|
202
|
+
}, /* @__PURE__ */ React5.createElement("p", {
|
|
344
203
|
className: mx4(descriptionText2, "text-center is-full")
|
|
345
204
|
}, t("empty device list message")));
|
|
346
205
|
};
|
|
347
206
|
|
|
348
207
|
// packages/sdk/shell/src/components/IdentityList/SpaceMemberList.tsx
|
|
349
|
-
import
|
|
208
|
+
import React6, { useMemo } from "react";
|
|
350
209
|
import { useClient } from "@dxos/react-client";
|
|
351
210
|
import { useMembers } from "@dxos/react-client/echo";
|
|
352
|
-
import { useTranslation as
|
|
211
|
+
import { useTranslation as useTranslation3, List as List2 } from "@dxos/react-ui";
|
|
353
212
|
import { descriptionText as descriptionText3, mx as mx5 } from "@dxos/react-ui-theme";
|
|
354
213
|
var SpaceMemberList = ({ spaceKey, includeSelf, onSelect }) => {
|
|
355
214
|
const client = useClient();
|
|
@@ -357,42 +216,100 @@ var SpaceMemberList = ({ spaceKey, includeSelf, onSelect }) => {
|
|
|
357
216
|
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)), [
|
|
358
217
|
allUnsortedMembers
|
|
359
218
|
]);
|
|
360
|
-
return /* @__PURE__ */
|
|
219
|
+
return /* @__PURE__ */ React6.createElement(SpaceMemberListImpl, {
|
|
361
220
|
members,
|
|
362
221
|
onSelect
|
|
363
222
|
});
|
|
364
223
|
};
|
|
365
224
|
var SpaceMemberListImpl = ({ members, onSelect }) => {
|
|
366
|
-
const { t } =
|
|
225
|
+
const { t } = useTranslation3("os");
|
|
367
226
|
const visibleMembers = members.filter((member) => member.identity);
|
|
368
|
-
return visibleMembers.length > 0 ? /* @__PURE__ */
|
|
227
|
+
return visibleMembers.length > 0 ? /* @__PURE__ */ React6.createElement(List2, {
|
|
369
228
|
classNames: "flex flex-col gap-2",
|
|
370
229
|
"data-testid": "space-members-list"
|
|
371
230
|
}, visibleMembers.map((member) => {
|
|
372
|
-
return /* @__PURE__ */
|
|
231
|
+
return /* @__PURE__ */ React6.createElement(IdentityListItem, {
|
|
373
232
|
key: member.identity.identityKey.toHex(),
|
|
374
233
|
identity: member.identity,
|
|
375
234
|
presence: member.presence,
|
|
376
235
|
onClick: onSelect && (() => onSelect(member))
|
|
377
236
|
});
|
|
378
|
-
})) : /* @__PURE__ */
|
|
237
|
+
})) : /* @__PURE__ */ React6.createElement("div", {
|
|
379
238
|
role: "none",
|
|
380
239
|
className: "grow flex items-center p-2"
|
|
381
|
-
}, /* @__PURE__ */
|
|
240
|
+
}, /* @__PURE__ */ React6.createElement("p", {
|
|
382
241
|
className: mx5(descriptionText3, "text-center is-full mlb-2")
|
|
383
242
|
}, t("empty space members message")));
|
|
384
243
|
};
|
|
385
244
|
|
|
386
245
|
// packages/sdk/shell/src/components/InvitationList/InvitationListItem.tsx
|
|
387
246
|
import { X } from "@phosphor-icons/react";
|
|
388
|
-
import
|
|
389
|
-
import { Invitation, useInvitationStatus } from "@dxos/react-client/invitations";
|
|
390
|
-
import { Button as
|
|
391
|
-
import { focusRing, getSize as
|
|
392
|
-
|
|
247
|
+
import React8, { useCallback as useCallback2 } from "react";
|
|
248
|
+
import { Invitation as Invitation2, useInvitationStatus } from "@dxos/react-client/invitations";
|
|
249
|
+
import { Button as Button2, ListItem as ListItem2, useTranslation as useTranslation4, Avatar as Avatar2, useThemeContext as useThemeContext2, Tooltip as Tooltip2 } from "@dxos/react-ui";
|
|
250
|
+
import { focusRing, getSize as getSize2, mx as mx7 } from "@dxos/react-ui-theme";
|
|
251
|
+
|
|
252
|
+
// packages/sdk/shell/src/util/invitationStatusValue.ts
|
|
253
|
+
import { Invitation } from "@dxos/react-client/invitations";
|
|
254
|
+
var invitationStatusValue = /* @__PURE__ */ new Map([
|
|
255
|
+
[
|
|
256
|
+
Invitation.State.ERROR,
|
|
257
|
+
-3
|
|
258
|
+
],
|
|
259
|
+
[
|
|
260
|
+
Invitation.State.TIMEOUT,
|
|
261
|
+
-2
|
|
262
|
+
],
|
|
263
|
+
[
|
|
264
|
+
Invitation.State.CANCELLED,
|
|
265
|
+
-1
|
|
266
|
+
],
|
|
267
|
+
[
|
|
268
|
+
Invitation.State.INIT,
|
|
269
|
+
0
|
|
270
|
+
],
|
|
271
|
+
[
|
|
272
|
+
Invitation.State.CONNECTING,
|
|
273
|
+
1
|
|
274
|
+
],
|
|
275
|
+
[
|
|
276
|
+
Invitation.State.CONNECTED,
|
|
277
|
+
2
|
|
278
|
+
],
|
|
279
|
+
[
|
|
280
|
+
Invitation.State.READY_FOR_AUTHENTICATION,
|
|
281
|
+
3
|
|
282
|
+
],
|
|
283
|
+
[
|
|
284
|
+
Invitation.State.AUTHENTICATING,
|
|
285
|
+
4
|
|
286
|
+
],
|
|
287
|
+
[
|
|
288
|
+
Invitation.State.SUCCESS,
|
|
289
|
+
5
|
|
290
|
+
]
|
|
291
|
+
]);
|
|
292
|
+
|
|
293
|
+
// packages/sdk/shell/src/util/toEmoji.ts
|
|
294
|
+
import toArray from "lodash.toarray";
|
|
295
|
+
var emoji = toArray(
|
|
296
|
+
// When changing this set, please check the result in a console or e.g. RunKit (https://runkit.com/thure/642214441dd6ae000855a8de)
|
|
297
|
+
// Emoji sometimes use a combination of code points, and some code points aren't visible on their own, so by adding or deleting you may unintentionally create non-visible items.
|
|
298
|
+
// This set was chosen from the characters in Unicode Emoji v15.0 based on the following criteria:
|
|
299
|
+
// – not people or isolated anthropomorphic faces
|
|
300
|
+
// – not flags
|
|
301
|
+
// – more concrete than abstract
|
|
302
|
+
// – less culturally specific
|
|
303
|
+
// – less easily confused with another emoji in the set
|
|
304
|
+
// – requires less special knowledge to identify
|
|
305
|
+
// – less likely to evoke negative feelings (no meat, no drugs, no weapons, etc)
|
|
306
|
+
// – less common as a signifier in UX
|
|
307
|
+
"\u{1F479}\u{1F47B}\u{1F47D}\u{1F916}\u{1F383}\u{1F9BE}\u{1F9BF}\u{1F9B7}\u{1F463}\u{1F441}\uFE0F\u{1F9F6}\u{1F451}\u{1F412}\u{1F986}\u{1F989}\u{1F434}\u{1F984}\u{1F41D}\u{1F98B}\u{1F41E}\u{1FAB2}\u{1F422}\u{1F98E}\u{1F995}\u{1F991}\u{1F980}\u{1F420}\u{1F42C}\u{1F40B}\u{1F9AD}\u{1F405}\u{1F406}\u{1F993}\u{1F98D}\u{1F9A7}\u{1F418}\u{1F42B}\u{1F992}\u{1F998}\u{1F9AC}\u{1F416}\u{1F40F}\u{1F98C}\u{1F415}\u{1F408}\u{1F413}\u{1F99A}\u{1F99C}\u{1F9A2}\u{1F9A9}\u{1F9A6}\u{1F401}\u{1F43F}\uFE0F\u{1F335}\u{1F332}\u{1F333}\u{1FAB5}\u{1F331}\u{1F341}\u{1FABA}\u{1F344}\u{1F41A}\u{1FAB8}\u{1FAA8}\u{1F33E}\u{1F337}\u{1F33B}\u2600\uFE0F\u{1F319}\u{1FA90}\u2B50\uFE0F\u26A1\uFE0F\u2604\uFE0F\u{1F525}\u{1F308}\u2601\uFE0F\u{1F4A7}\u26F1\uFE0F\u{1F30A}\u{1F34E}\u{1F34B}\u{1F349}\u{1F347}\u{1FAD0}\u{1F348}\u{1F352}\u{1F351}\u{1F96D}\u{1F34D}\u{1F965}\u{1F95D}\u{1F951}\u{1F336}\uFE0F\u{1F33D}\u{1F955}\u{1F36C}\u{1F95C}\u{1FAD6}\u2615\uFE0F\u{1F375}\u{1F9CA}\u{1F9C2}\u{1F3D4}\uFE0F\u2693\uFE0F\u{1F6DF}\u{1F3DD}\uFE0F\u{1F6F6}\u{1F680}\u{1F6F0}\uFE0F\u26F2\uFE0F\u{1F3F0}\u{1F6B2}\u26FA\uFE0F\u{1F399}\uFE0F\u{1F9F2}\u2699\uFE0F\u{1F529}\u{1F52E}\u{1F52D}\u{1F52C}\u{1F9EC}\u{1F321}\uFE0F\u{1F9FA}\u{1F6CE}\uFE0F\u{1F511}\u{1FA91}\u{1F9F8}\u{1F388}\u{1F380}\u{1F38A}\u267B\uFE0F\u{1F3B5}"
|
|
308
|
+
);
|
|
309
|
+
var toEmoji = (keyAsHex) => emoji[parseInt(keyAsHex, 16) % emoji.length];
|
|
393
310
|
|
|
394
311
|
// packages/sdk/shell/src/components/AuthCode.tsx
|
|
395
|
-
import
|
|
312
|
+
import React7 from "react";
|
|
396
313
|
import { mx as mx6 } from "@dxos/react-ui-theme";
|
|
397
314
|
var AuthCode = (props) => {
|
|
398
315
|
const { code, large, classNames } = props;
|
|
@@ -402,17 +319,17 @@ var AuthCode = (props) => {
|
|
|
402
319
|
const handleCopy = () => {
|
|
403
320
|
void navigator.clipboard.writeText(code ?? "");
|
|
404
321
|
};
|
|
405
|
-
return /* @__PURE__ */
|
|
322
|
+
return /* @__PURE__ */ React7.createElement("span", {
|
|
406
323
|
className: mx6(large ? "text-6xl" : "text-2xl", "font-mono pli-2.5 flex gap-1.5 rounded cursor-pointer", classNames),
|
|
407
324
|
onClick: handleCopy
|
|
408
|
-
}, /* @__PURE__ */
|
|
325
|
+
}, /* @__PURE__ */ React7.createElement("span", null, left), /* @__PURE__ */ React7.createElement("span", null, right));
|
|
409
326
|
};
|
|
410
327
|
|
|
411
328
|
// packages/sdk/shell/src/components/InvitationList/InvitationListItem.tsx
|
|
412
329
|
var InvitationListItem = (props) => {
|
|
413
330
|
const { invitation } = props;
|
|
414
331
|
const invitationStatus = useInvitationStatus(invitation);
|
|
415
|
-
return /* @__PURE__ */
|
|
332
|
+
return /* @__PURE__ */ React8.createElement(InvitationListItemImpl, {
|
|
416
333
|
...props,
|
|
417
334
|
invitationStatus
|
|
418
335
|
});
|
|
@@ -422,11 +339,11 @@ var avatarProps = {
|
|
|
422
339
|
variant: "circle"
|
|
423
340
|
};
|
|
424
341
|
var AvatarStackEffect = ({ animation, status, reverseEffects }) => {
|
|
425
|
-
const { tx } =
|
|
426
|
-
return /* @__PURE__ */
|
|
342
|
+
const { tx } = useThemeContext2();
|
|
343
|
+
return /* @__PURE__ */ React8.createElement(React8.Fragment, null, /* @__PURE__ */ React8.createElement("span", {
|
|
427
344
|
role: "none",
|
|
428
|
-
className: mx7("absolute inline-end-auto opacity-20", reverseEffects ? "inline-start-3" : "inline-start-1",
|
|
429
|
-
}, /* @__PURE__ */
|
|
345
|
+
className: mx7("absolute inline-end-auto opacity-20", reverseEffects ? "inline-start-3" : "inline-start-1", getSize2(avatarProps.size))
|
|
346
|
+
}, /* @__PURE__ */ React8.createElement("span", {
|
|
430
347
|
role: "none",
|
|
431
348
|
className: tx("avatar.ring", "avatar__ring", {
|
|
432
349
|
...avatarProps,
|
|
@@ -436,10 +353,10 @@ var AvatarStackEffect = ({ animation, status, reverseEffects }) => {
|
|
|
436
353
|
style: {
|
|
437
354
|
animationDelay: "400ms"
|
|
438
355
|
}
|
|
439
|
-
})), /* @__PURE__ */
|
|
356
|
+
})), /* @__PURE__ */ React8.createElement("span", {
|
|
440
357
|
role: "none",
|
|
441
|
-
className: mx7("absolute inline-end-auto opacity-50", reverseEffects ? "inline-start-2" : "inline-start-2",
|
|
442
|
-
}, /* @__PURE__ */
|
|
358
|
+
className: mx7("absolute inline-end-auto opacity-50", reverseEffects ? "inline-start-2" : "inline-start-2", getSize2(avatarProps.size))
|
|
359
|
+
}, /* @__PURE__ */ React8.createElement("span", {
|
|
443
360
|
role: "none",
|
|
444
361
|
className: tx("avatar.ring", "avatar__ring", {
|
|
445
362
|
...avatarProps,
|
|
@@ -452,19 +369,19 @@ var AvatarStackEffect = ({ animation, status, reverseEffects }) => {
|
|
|
452
369
|
})));
|
|
453
370
|
};
|
|
454
371
|
var InvitationListItemImpl = ({ invitation, invitationStatus: propsInvitationStatus, send, onClickRemove, createInvitationUrl, reverseEffects, ...props }) => {
|
|
455
|
-
const { t } =
|
|
372
|
+
const { t } = useTranslation4("os");
|
|
456
373
|
const { cancel, status: invitationStatus, invitationCode, authCode, type } = propsInvitationStatus;
|
|
457
374
|
const isCancellable = !([
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
375
|
+
Invitation2.State.ERROR,
|
|
376
|
+
Invitation2.State.TIMEOUT,
|
|
377
|
+
Invitation2.State.CANCELLED
|
|
461
378
|
].indexOf(invitationStatus) >= 0);
|
|
462
|
-
const showShare = type ===
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
379
|
+
const showShare = type === Invitation2.Type.MULTIUSE || [
|
|
380
|
+
Invitation2.State.INIT,
|
|
381
|
+
Invitation2.State.CONNECTING,
|
|
382
|
+
Invitation2.State.CONNECTED
|
|
466
383
|
].indexOf(invitationStatus) >= 0;
|
|
467
|
-
const showAuthCode = invitationStatus ===
|
|
384
|
+
const showAuthCode = invitationStatus === Invitation2.State.READY_FOR_AUTHENTICATION;
|
|
468
385
|
const handleClickRemove = useCallback2(() => onClickRemove?.(invitation), [
|
|
469
386
|
invitation,
|
|
470
387
|
onClickRemove
|
|
@@ -472,55 +389,55 @@ var InvitationListItemImpl = ({ invitation, invitationStatus: propsInvitationSta
|
|
|
472
389
|
const invitationUrl = invitationCode && createInvitationUrl(invitationCode);
|
|
473
390
|
const invitationId = invitation?.get().invitationId;
|
|
474
391
|
const avatarAnimation = [
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
392
|
+
Invitation2.State.INIT,
|
|
393
|
+
Invitation2.State.CONNECTING,
|
|
394
|
+
Invitation2.State.CONNECTED,
|
|
395
|
+
Invitation2.State.READY_FOR_AUTHENTICATION,
|
|
396
|
+
Invitation2.State.AUTHENTICATING
|
|
480
397
|
].includes(invitationStatus) ? "pulse" : "none";
|
|
481
398
|
const avatarError = [
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
399
|
+
Invitation2.State.ERROR,
|
|
400
|
+
Invitation2.State.TIMEOUT,
|
|
401
|
+
Invitation2.State.CANCELLED
|
|
485
402
|
].includes(invitationStatus);
|
|
486
403
|
const avatarGreen = [
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
404
|
+
Invitation2.State.CONNECTED,
|
|
405
|
+
Invitation2.State.READY_FOR_AUTHENTICATION,
|
|
406
|
+
Invitation2.State.AUTHENTICATING,
|
|
407
|
+
Invitation2.State.SUCCESS
|
|
491
408
|
].includes(invitationStatus);
|
|
492
409
|
const avatarStatus = avatarError ? "error" : avatarGreen ? "active" : "inactive";
|
|
493
|
-
return /* @__PURE__ */
|
|
410
|
+
return /* @__PURE__ */ React8.createElement(ListItem2.Root, {
|
|
494
411
|
id: invitationCode,
|
|
495
412
|
...props,
|
|
496
413
|
classNames: [
|
|
497
414
|
"flex gap-2 pis-3 pie-1 items-center relative",
|
|
498
415
|
props.classNames
|
|
499
416
|
]
|
|
500
|
-
}, /* @__PURE__ */
|
|
417
|
+
}, /* @__PURE__ */ React8.createElement(ListItem2.Heading, {
|
|
501
418
|
classNames: "sr-only"
|
|
502
|
-
}, t(type ===
|
|
419
|
+
}, t(type === Invitation2.Type.MULTIUSE ? "invite many list item label" : "invite one list item label")), type === Invitation2.Type.MULTIUSE && /* @__PURE__ */ React8.createElement(AvatarStackEffect, {
|
|
503
420
|
status: avatarStatus,
|
|
504
421
|
animation: avatarAnimation,
|
|
505
422
|
reverseEffects
|
|
506
|
-
}), /* @__PURE__ */
|
|
423
|
+
}), /* @__PURE__ */ React8.createElement(Tooltip2.Root, null, /* @__PURE__ */ React8.createElement(Avatar2.Root, {
|
|
507
424
|
...avatarProps,
|
|
508
425
|
animation: avatarAnimation,
|
|
509
426
|
status: avatarStatus
|
|
510
|
-
}, /* @__PURE__ */
|
|
427
|
+
}, /* @__PURE__ */ React8.createElement(Tooltip2.Trigger, {
|
|
511
428
|
asChild: true
|
|
512
|
-
}, /* @__PURE__ */
|
|
429
|
+
}, /* @__PURE__ */ React8.createElement(Avatar2.Frame, {
|
|
513
430
|
tabIndex: 0,
|
|
514
431
|
classNames: [
|
|
515
432
|
focusRing,
|
|
516
433
|
"relative rounded-full place-self-center"
|
|
517
434
|
]
|
|
518
|
-
}, /* @__PURE__ */
|
|
519
|
-
text:
|
|
520
|
-
})))), /* @__PURE__ */
|
|
435
|
+
}, /* @__PURE__ */ React8.createElement(Avatar2.Fallback, {
|
|
436
|
+
text: toEmoji(invitationId)
|
|
437
|
+
})))), /* @__PURE__ */ React8.createElement(Tooltip2.Portal, null, /* @__PURE__ */ React8.createElement(Tooltip2.Content, {
|
|
521
438
|
side: "left",
|
|
522
439
|
classNames: "z-[70]"
|
|
523
|
-
}, t(type ===
|
|
440
|
+
}, t(type === Invitation2.Type.MULTIUSE ? "invite many qr label" : "invite one qr label"), /* @__PURE__ */ React8.createElement(Tooltip2.Arrow, null)))), showShare && invitationUrl ? /* @__PURE__ */ React8.createElement(React8.Fragment, null, /* @__PURE__ */ React8.createElement(Button2, {
|
|
524
441
|
variant: "ghost",
|
|
525
442
|
classNames: "grow justify-start font-medium",
|
|
526
443
|
onClick: () => send({
|
|
@@ -528,60 +445,60 @@ var InvitationListItemImpl = ({ invitation, invitationStatus: propsInvitationSta
|
|
|
528
445
|
invitation
|
|
529
446
|
}),
|
|
530
447
|
"data-testid": "show-qrcode"
|
|
531
|
-
}, /* @__PURE__ */
|
|
448
|
+
}, /* @__PURE__ */ React8.createElement("span", null, t("open share panel label"))), /* @__PURE__ */ React8.createElement(CopyButtonIconOnly, {
|
|
532
449
|
variant: "ghost",
|
|
533
450
|
value: invitationUrl
|
|
534
|
-
})) : showAuthCode ? /* @__PURE__ */
|
|
451
|
+
})) : showAuthCode ? /* @__PURE__ */ React8.createElement(AuthCode, {
|
|
535
452
|
code: authCode,
|
|
536
453
|
classNames: "grow"
|
|
537
|
-
}) : invitationStatus ===
|
|
454
|
+
}) : invitationStatus === Invitation2.State.CONNECTING ? /* @__PURE__ */ React8.createElement("span", {
|
|
538
455
|
className: "pli-2 grow text-neutral-500"
|
|
539
|
-
}, "Connecting...") : invitationStatus ===
|
|
456
|
+
}, "Connecting...") : invitationStatus === Invitation2.State.AUTHENTICATING ? /* @__PURE__ */ React8.createElement("span", {
|
|
540
457
|
className: "pli-2 grow text-neutral-500"
|
|
541
|
-
}, "Authenticating...") : invitationStatus ===
|
|
458
|
+
}, "Authenticating...") : invitationStatus === Invitation2.State.ERROR || invitationStatus === Invitation2.State.TIMEOUT ? /* @__PURE__ */ React8.createElement("span", {
|
|
542
459
|
className: "pli-2 grow text-neutral-500"
|
|
543
|
-
}, "Failed") : invitationStatus ===
|
|
460
|
+
}, "Failed") : invitationStatus === Invitation2.State.CANCELLED ? /* @__PURE__ */ React8.createElement("span", {
|
|
544
461
|
className: "pli-2 grow text-neutral-500"
|
|
545
|
-
}, "Cancelled") : invitationStatus ===
|
|
462
|
+
}, "Cancelled") : invitationStatus === Invitation2.State.SUCCESS ? /* @__PURE__ */ React8.createElement("span", {
|
|
546
463
|
className: "pli-2 grow truncate"
|
|
547
|
-
}, "User joined") : /* @__PURE__ */
|
|
464
|
+
}, "User joined") : /* @__PURE__ */ React8.createElement("span", {
|
|
548
465
|
className: "grow"
|
|
549
|
-
}, " "), isCancellable ? /* @__PURE__ */
|
|
466
|
+
}, " "), isCancellable ? /* @__PURE__ */ React8.createElement(Button2, {
|
|
550
467
|
variant: "ghost",
|
|
551
468
|
classNames: "flex gap-1 pli-0",
|
|
552
469
|
onClick: cancel,
|
|
553
470
|
"data-testid": "cancel-invitation"
|
|
554
|
-
}, /* @__PURE__ */
|
|
471
|
+
}, /* @__PURE__ */ React8.createElement("span", {
|
|
555
472
|
className: "sr-only"
|
|
556
|
-
}, t("cancel invitation label")), /* @__PURE__ */
|
|
557
|
-
className:
|
|
558
|
-
})) : /* @__PURE__ */
|
|
473
|
+
}, t("cancel invitation label")), /* @__PURE__ */ React8.createElement(X, {
|
|
474
|
+
className: getSize2(4)
|
|
475
|
+
})) : /* @__PURE__ */ React8.createElement(Button2, {
|
|
559
476
|
variant: "ghost",
|
|
560
477
|
classNames: "flex gap-1 pli-0",
|
|
561
478
|
onClick: handleClickRemove,
|
|
562
479
|
"data-testid": "remove-invitation"
|
|
563
|
-
}, /* @__PURE__ */
|
|
480
|
+
}, /* @__PURE__ */ React8.createElement("span", {
|
|
564
481
|
className: "sr-only"
|
|
565
|
-
}, t("remove invitation label")), /* @__PURE__ */
|
|
566
|
-
className:
|
|
482
|
+
}, t("remove invitation label")), /* @__PURE__ */ React8.createElement(X, {
|
|
483
|
+
className: getSize2(4)
|
|
567
484
|
})));
|
|
568
485
|
};
|
|
569
486
|
|
|
570
487
|
// packages/sdk/shell/src/components/InvitationList/InvitationListContainer.tsx
|
|
571
|
-
import
|
|
488
|
+
import React10, { useCallback as useCallback3 } from "react";
|
|
572
489
|
import { useSpace, useSpaceInvitations } from "@dxos/react-client/echo";
|
|
573
490
|
|
|
574
491
|
// packages/sdk/shell/src/components/InvitationList/InvitationList.tsx
|
|
575
|
-
import
|
|
492
|
+
import React9 from "react";
|
|
576
493
|
import { List as List3 } from "@dxos/react-ui";
|
|
577
494
|
import { mx as mx8 } from "@dxos/react-ui-theme";
|
|
578
495
|
var InvitationList = ({ invitations, send, ...invitationProps }) => {
|
|
579
496
|
const { className, InvitationListItem: Item = InvitationListItem } = invitationProps;
|
|
580
|
-
return /* @__PURE__ */
|
|
497
|
+
return /* @__PURE__ */ React9.createElement(List3, {
|
|
581
498
|
classNames: mx8("flex flex-col gap-2", className)
|
|
582
499
|
}, invitations.map((invitation) => {
|
|
583
500
|
const value = invitation.get().invitationId;
|
|
584
|
-
return /* @__PURE__ */
|
|
501
|
+
return /* @__PURE__ */ React9.createElement(Item, {
|
|
585
502
|
key: value,
|
|
586
503
|
send,
|
|
587
504
|
invitation,
|
|
@@ -599,7 +516,7 @@ var InvitationListContainer = ({ spaceKey, createInvitationUrl, send }) => {
|
|
|
599
516
|
}, [
|
|
600
517
|
space
|
|
601
518
|
]);
|
|
602
|
-
return /* @__PURE__ */
|
|
519
|
+
return /* @__PURE__ */ React10.createElement(InvitationList, {
|
|
603
520
|
invitations,
|
|
604
521
|
onClickRemove,
|
|
605
522
|
createInvitationUrl,
|
|
@@ -608,11 +525,11 @@ var InvitationListContainer = ({ spaceKey, createInvitationUrl, send }) => {
|
|
|
608
525
|
};
|
|
609
526
|
|
|
610
527
|
// packages/sdk/shell/src/components/Panel/Action.tsx
|
|
611
|
-
import { CaretDown
|
|
612
|
-
import { useControllableState
|
|
613
|
-
import
|
|
614
|
-
import { Button as
|
|
615
|
-
import { descriptionText as descriptionText4, getSize as
|
|
528
|
+
import { CaretDown, Check as Check2, Placeholder } from "@phosphor-icons/react";
|
|
529
|
+
import { useControllableState } from "@radix-ui/react-use-controllable-state";
|
|
530
|
+
import React11, { forwardRef as forwardRef2 } from "react";
|
|
531
|
+
import { Button as Button3, DropdownMenu, useTranslation as useTranslation5 } from "@dxos/react-ui";
|
|
532
|
+
import { descriptionText as descriptionText4, getSize as getSize3, mx as mx9 } from "@dxos/react-ui-theme";
|
|
616
533
|
var defaultActions = {
|
|
617
534
|
noopAction: {
|
|
618
535
|
label: "No-op",
|
|
@@ -624,17 +541,17 @@ var defaultActions = {
|
|
|
624
541
|
};
|
|
625
542
|
var BifurcatedAction = /* @__PURE__ */ forwardRef2((props, forwardedRef) => {
|
|
626
543
|
const { classNames, variant, isFull = true, actions = defaultActions, activeAction: propsActiveAction, onChangeActiveAction, defaultActiveAction, ...rest } = props;
|
|
627
|
-
const [activeActionKey2 = Object.keys(actions)[0], setActiveAction] =
|
|
544
|
+
const [activeActionKey2 = Object.keys(actions)[0], setActiveAction] = useControllableState({
|
|
628
545
|
prop: propsActiveAction,
|
|
629
546
|
onChange: onChangeActiveAction,
|
|
630
547
|
defaultProp: defaultActiveAction
|
|
631
548
|
});
|
|
632
549
|
const activeAction = actions[activeActionKey2] ?? {};
|
|
633
|
-
const { t } =
|
|
634
|
-
return /* @__PURE__ */
|
|
550
|
+
const { t } = useTranslation5("os");
|
|
551
|
+
return /* @__PURE__ */ React11.createElement("div", {
|
|
635
552
|
role: "none",
|
|
636
553
|
className: mx9("mbs-2 flex gap-px items-center", isFull && "is-full")
|
|
637
|
-
}, /* @__PURE__ */
|
|
554
|
+
}, /* @__PURE__ */ React11.createElement(Button3, {
|
|
638
555
|
...rest,
|
|
639
556
|
classNames: [
|
|
640
557
|
"bs-11 flex-1 min-is-0 flex gap-2 rounded-ie-none",
|
|
@@ -643,48 +560,48 @@ var BifurcatedAction = /* @__PURE__ */ forwardRef2((props, forwardedRef) => {
|
|
|
643
560
|
ref: forwardedRef,
|
|
644
561
|
variant,
|
|
645
562
|
onClick: activeAction.onClick
|
|
646
|
-
}, activeAction.icon && /* @__PURE__ */
|
|
647
|
-
className:
|
|
648
|
-
}), /* @__PURE__ */
|
|
563
|
+
}, activeAction.icon && /* @__PURE__ */ React11.createElement(activeAction.icon, {
|
|
564
|
+
className: getSize3(5)
|
|
565
|
+
}), /* @__PURE__ */ React11.createElement("span", null, activeAction.label)), /* @__PURE__ */ React11.createElement(DropdownMenu.Root, null, /* @__PURE__ */ React11.createElement(DropdownMenu.Trigger, {
|
|
649
566
|
asChild: true
|
|
650
|
-
}, /* @__PURE__ */
|
|
567
|
+
}, /* @__PURE__ */ React11.createElement(Button3, {
|
|
651
568
|
classNames: [
|
|
652
569
|
"bs-11 flex-none rounded-is-none",
|
|
653
570
|
classNames
|
|
654
571
|
]
|
|
655
|
-
}, /* @__PURE__ */
|
|
572
|
+
}, /* @__PURE__ */ React11.createElement("span", {
|
|
656
573
|
className: "sr-only"
|
|
657
|
-
}, t("invite options label")), /* @__PURE__ */
|
|
658
|
-
className:
|
|
659
|
-
}))), /* @__PURE__ */
|
|
660
|
-
return /* @__PURE__ */
|
|
574
|
+
}, t("invite options label")), /* @__PURE__ */ React11.createElement(CaretDown, {
|
|
575
|
+
className: getSize3(4)
|
|
576
|
+
}))), /* @__PURE__ */ React11.createElement(DropdownMenu.Content, null, /* @__PURE__ */ React11.createElement(DropdownMenu.Viewport, null, Object.entries(actions).map(([id, action]) => {
|
|
577
|
+
return /* @__PURE__ */ React11.createElement(DropdownMenu.CheckboxItem, {
|
|
661
578
|
key: id,
|
|
662
579
|
"aria-labelledby": `${id}__label`,
|
|
663
580
|
"aria-describedby": `${id}__description`,
|
|
664
581
|
checked: activeActionKey2 === id,
|
|
665
582
|
onCheckedChange: (checked) => checked && setActiveAction(id),
|
|
666
583
|
classNames: "gap-2"
|
|
667
|
-
}, action.icon && /* @__PURE__ */
|
|
668
|
-
className:
|
|
669
|
-
}), /* @__PURE__ */
|
|
584
|
+
}, action.icon && /* @__PURE__ */ React11.createElement(action.icon, {
|
|
585
|
+
className: getSize3(5)
|
|
586
|
+
}), /* @__PURE__ */ React11.createElement("div", {
|
|
670
587
|
role: "none",
|
|
671
588
|
className: "flex-1 min-is-0 space-b-1"
|
|
672
|
-
}, /* @__PURE__ */
|
|
589
|
+
}, /* @__PURE__ */ React11.createElement("p", {
|
|
673
590
|
id: `${id}__label`
|
|
674
|
-
}, action.label), action.description && /* @__PURE__ */
|
|
591
|
+
}, action.label), action.description && /* @__PURE__ */ React11.createElement("p", {
|
|
675
592
|
id: `${id}__description`,
|
|
676
593
|
className: descriptionText4
|
|
677
|
-
}, action.description)), /* @__PURE__ */
|
|
594
|
+
}, action.description)), /* @__PURE__ */ React11.createElement(DropdownMenu.ItemIndicator, {
|
|
678
595
|
asChild: true
|
|
679
|
-
}, /* @__PURE__ */
|
|
596
|
+
}, /* @__PURE__ */ React11.createElement(Check2, {
|
|
680
597
|
weight: "bold",
|
|
681
|
-
className:
|
|
598
|
+
className: getSize3(4)
|
|
682
599
|
})));
|
|
683
|
-
})), /* @__PURE__ */
|
|
600
|
+
})), /* @__PURE__ */ React11.createElement(DropdownMenu.Arrow, null))));
|
|
684
601
|
});
|
|
685
602
|
var Action = /* @__PURE__ */ forwardRef2((props, forwardedRef) => {
|
|
686
603
|
const { children, classNames, variant, isFull = true, ...rest } = props;
|
|
687
|
-
return /* @__PURE__ */
|
|
604
|
+
return /* @__PURE__ */ React11.createElement(Button3, {
|
|
688
605
|
...rest,
|
|
689
606
|
classNames: [
|
|
690
607
|
isFull && "is-full",
|
|
@@ -697,10 +614,10 @@ var Action = /* @__PURE__ */ forwardRef2((props, forwardedRef) => {
|
|
|
697
614
|
});
|
|
698
615
|
|
|
699
616
|
// packages/sdk/shell/src/components/Panel/Actions.tsx
|
|
700
|
-
import
|
|
617
|
+
import React12, { forwardRef as forwardRef3 } from "react";
|
|
701
618
|
import { mx as mx10 } from "@dxos/react-ui-theme";
|
|
702
619
|
var Actions = /* @__PURE__ */ forwardRef3(({ classNames, children, ...props }, forwardedRef) => {
|
|
703
|
-
return /* @__PURE__ */
|
|
620
|
+
return /* @__PURE__ */ React12.createElement("div", {
|
|
704
621
|
...props,
|
|
705
622
|
className: mx10("flex flex-col gap-2 mbs-2", Array.isArray(children) && children.length > 1 ? "justify-between" : "justify-center", classNames),
|
|
706
623
|
ref: forwardedRef
|
|
@@ -709,37 +626,37 @@ var Actions = /* @__PURE__ */ forwardRef3(({ classNames, children, ...props }, f
|
|
|
709
626
|
|
|
710
627
|
// packages/sdk/shell/src/components/Panel/CloseButton.tsx
|
|
711
628
|
import { X as X2 } from "@phosphor-icons/react";
|
|
712
|
-
import
|
|
713
|
-
import { Button as
|
|
714
|
-
import { getSize as
|
|
629
|
+
import React13 from "react";
|
|
630
|
+
import { Button as Button4, useTranslation as useTranslation6 } from "@dxos/react-ui";
|
|
631
|
+
import { getSize as getSize4, mx as mx11 } from "@dxos/react-ui-theme";
|
|
715
632
|
var CloseButton = ({ onDone, ...props }) => {
|
|
716
|
-
const { t } =
|
|
717
|
-
return /* @__PURE__ */
|
|
633
|
+
const { t } = useTranslation6("os");
|
|
634
|
+
return /* @__PURE__ */ React13.createElement(Button4, {
|
|
718
635
|
variant: "ghost",
|
|
719
636
|
classNames: mx11("plb-0 pli-2 absolute block-start-0 inline-end-0 z-[1]"),
|
|
720
637
|
onClick: () => onDone?.(),
|
|
721
638
|
...props
|
|
722
|
-
}, /* @__PURE__ */
|
|
639
|
+
}, /* @__PURE__ */ React13.createElement(X2, {
|
|
723
640
|
weight: "bold",
|
|
724
|
-
className:
|
|
725
|
-
}), /* @__PURE__ */
|
|
641
|
+
className: getSize4(4)
|
|
642
|
+
}), /* @__PURE__ */ React13.createElement("span", {
|
|
726
643
|
className: "sr-only"
|
|
727
644
|
}, t("exit label")));
|
|
728
645
|
};
|
|
729
646
|
|
|
730
647
|
// packages/sdk/shell/src/components/Panel/Emoji.tsx
|
|
731
|
-
import
|
|
732
|
-
import { mx as mx12, getSize as
|
|
648
|
+
import React14 from "react";
|
|
649
|
+
import { mx as mx12, getSize as getSize5 } from "@dxos/react-ui-theme";
|
|
733
650
|
var Emoji = ({ text, className }) => {
|
|
734
651
|
const size = 14;
|
|
735
|
-
return /* @__PURE__ */
|
|
652
|
+
return /* @__PURE__ */ React14.createElement("div", {
|
|
736
653
|
role: "none",
|
|
737
|
-
className: mx12(
|
|
738
|
-
}, /* @__PURE__ */
|
|
654
|
+
className: mx12(getSize5(size), "rounded relative pointer-events-none", className)
|
|
655
|
+
}, /* @__PURE__ */ React14.createElement("svg", {
|
|
739
656
|
viewBox: `0 0 ${size * 4} ${size * 4}`,
|
|
740
657
|
width: size * 4,
|
|
741
658
|
height: size * 4
|
|
742
|
-
}, /* @__PURE__ */
|
|
659
|
+
}, /* @__PURE__ */ React14.createElement("text", {
|
|
743
660
|
x: "50%",
|
|
744
661
|
y: "50%",
|
|
745
662
|
textAnchor: "middle",
|
|
@@ -750,55 +667,55 @@ var Emoji = ({ text, className }) => {
|
|
|
750
667
|
};
|
|
751
668
|
var Centered = (props) => {
|
|
752
669
|
const { children } = props;
|
|
753
|
-
return /* @__PURE__ */
|
|
670
|
+
return /* @__PURE__ */ React14.createElement("div", {
|
|
754
671
|
role: "none",
|
|
755
672
|
className: "absolute inset-0 flex items-center justify-center"
|
|
756
673
|
}, children);
|
|
757
674
|
};
|
|
758
675
|
|
|
759
676
|
// packages/sdk/shell/src/components/Panel/Heading.tsx
|
|
760
|
-
import
|
|
677
|
+
import React15, { forwardRef as forwardRef4 } from "react";
|
|
761
678
|
import { descriptionText as descriptionText5, mx as mx13 } from "@dxos/react-ui-theme";
|
|
762
679
|
var Heading = /* @__PURE__ */ forwardRef4(({ titleId, title, titleSrOnly, children, corner }, forwardedRef) => {
|
|
763
|
-
return /* @__PURE__ */
|
|
680
|
+
return /* @__PURE__ */ React15.createElement("div", {
|
|
764
681
|
role: "none",
|
|
765
682
|
className: "pbe-2 relative",
|
|
766
683
|
ref: forwardedRef
|
|
767
|
-
}, corner, /* @__PURE__ */
|
|
684
|
+
}, corner, /* @__PURE__ */ React15.createElement("h1", {
|
|
768
685
|
...!titleSrOnly && {
|
|
769
686
|
id: titleId
|
|
770
687
|
},
|
|
771
688
|
className: mx13(descriptionText5, "text-center mlb-2", titleSrOnly && "invisible")
|
|
772
|
-
}, title), titleSrOnly && /* @__PURE__ */
|
|
689
|
+
}, title), titleSrOnly && /* @__PURE__ */ React15.createElement("span", {
|
|
773
690
|
id: titleId
|
|
774
691
|
}, title), children);
|
|
775
692
|
});
|
|
776
693
|
|
|
777
694
|
// packages/sdk/shell/src/components/Panel/Label.tsx
|
|
778
|
-
import
|
|
695
|
+
import React16 from "react";
|
|
779
696
|
import { descriptionText as descriptionText6, mx as mx14 } from "@dxos/react-ui-theme";
|
|
780
697
|
var Label = (props) => {
|
|
781
698
|
const { children } = props;
|
|
782
|
-
return /* @__PURE__ */
|
|
699
|
+
return /* @__PURE__ */ React16.createElement("span", {
|
|
783
700
|
className: mx14(descriptionText6, "text-center mli-6 whitespace-normal")
|
|
784
701
|
}, children);
|
|
785
702
|
};
|
|
786
703
|
|
|
787
704
|
// packages/sdk/shell/src/components/Panel/Input.tsx
|
|
788
|
-
import
|
|
705
|
+
import React17 from "react";
|
|
789
706
|
import { Input as UiInput } from "@dxos/react-ui";
|
|
790
707
|
var Input = ({ validationMessage, label, ...props }) => {
|
|
791
|
-
return /* @__PURE__ */
|
|
708
|
+
return /* @__PURE__ */ React17.createElement(UiInput.Root, null, /* @__PURE__ */ React17.createElement(UiInput.Label, null, label), /* @__PURE__ */ React17.createElement(UiInput.TextInput, {
|
|
792
709
|
...props,
|
|
793
710
|
classNames: "plb-3 mbs-2 text-center"
|
|
794
|
-
}), /* @__PURE__ */
|
|
711
|
+
}), /* @__PURE__ */ React17.createElement(UiInput.DescriptionAndValidation, null, validationMessage && /* @__PURE__ */ React17.createElement(UiInput.Validation, null, validationMessage)));
|
|
795
712
|
};
|
|
796
713
|
|
|
797
714
|
// packages/sdk/shell/src/components/Panel/StepHeading.tsx
|
|
798
|
-
import
|
|
715
|
+
import React18, { forwardRef as forwardRef5 } from "react";
|
|
799
716
|
import { mx as mx15 } from "@dxos/react-ui-theme";
|
|
800
717
|
var StepHeading = /* @__PURE__ */ forwardRef5(({ children, className, ...props }, forwardedRef) => {
|
|
801
|
-
return /* @__PURE__ */
|
|
718
|
+
return /* @__PURE__ */ React18.createElement("h2", {
|
|
802
719
|
...props,
|
|
803
720
|
className: mx15("font-normal text-sm mbe-4 mli-1 text-center", className),
|
|
804
721
|
ref: forwardedRef
|
|
@@ -808,8 +725,8 @@ var StepHeading = /* @__PURE__ */ forwardRef5(({ children, className, ...props }
|
|
|
808
725
|
// packages/sdk/shell/src/components/Viewport/Viewport.tsx
|
|
809
726
|
import { useFocusFinders } from "@fluentui/react-tabster";
|
|
810
727
|
import { createContextScope } from "@radix-ui/react-context";
|
|
811
|
-
import { useControllableState as
|
|
812
|
-
import
|
|
728
|
+
import { useControllableState as useControllableState2 } from "@radix-ui/react-use-controllable-state";
|
|
729
|
+
import React19, { forwardRef as forwardRef6, useEffect } from "react";
|
|
813
730
|
import { useForwardedRef } from "@dxos/react-ui";
|
|
814
731
|
import { mx as mx16 } from "@dxos/react-ui-theme";
|
|
815
732
|
var VIEWPORT_NAME = "Viewport";
|
|
@@ -818,17 +735,17 @@ var VIEW_NAME = "ViewportView";
|
|
|
818
735
|
var [createViewportContext, createViewportScope] = createContextScope(VIEWPORT_NAME, []);
|
|
819
736
|
var [ViewportProvider, useViewportContext] = createViewportContext(VIEWPORT_NAME);
|
|
820
737
|
var ViewportRoot = ({ __viewportScope, classNames, children, defaultActiveView, activeView: propsActiveView, focusManaged = false, onActiveViewChange, ...props }) => {
|
|
821
|
-
const [activeView = "never", setActiveView] =
|
|
738
|
+
const [activeView = "never", setActiveView] = useControllableState2({
|
|
822
739
|
prop: propsActiveView,
|
|
823
740
|
defaultProp: defaultActiveView,
|
|
824
741
|
onChange: onActiveViewChange
|
|
825
742
|
});
|
|
826
|
-
return /* @__PURE__ */
|
|
743
|
+
return /* @__PURE__ */ React19.createElement(ViewportProvider, {
|
|
827
744
|
focusManaged,
|
|
828
745
|
activeView,
|
|
829
746
|
setActiveView,
|
|
830
747
|
scope: __viewportScope
|
|
831
|
-
}, /* @__PURE__ */
|
|
748
|
+
}, /* @__PURE__ */ React19.createElement("div", {
|
|
832
749
|
role: "region",
|
|
833
750
|
"aria-live": "polite",
|
|
834
751
|
...props,
|
|
@@ -840,7 +757,7 @@ var ViewportViews = ({ classNames, children, ...props }) => {
|
|
|
840
757
|
const size = {
|
|
841
758
|
inlineSize: `${Math.ceil(children.length) * 100}%`
|
|
842
759
|
};
|
|
843
|
-
return /* @__PURE__ */
|
|
760
|
+
return /* @__PURE__ */ React19.createElement("div", {
|
|
844
761
|
role: "none",
|
|
845
762
|
style: size,
|
|
846
763
|
...props,
|
|
@@ -862,7 +779,7 @@ var ViewportView = /* @__PURE__ */ forwardRef6(({ __viewportScope, classNames, c
|
|
|
862
779
|
ref.current,
|
|
863
780
|
isActive
|
|
864
781
|
]);
|
|
865
|
-
return /* @__PURE__ */
|
|
782
|
+
return /* @__PURE__ */ React19.createElement("section", {
|
|
866
783
|
...props,
|
|
867
784
|
...!isActive && {
|
|
868
785
|
"aria-hidden": true
|
|
@@ -879,41 +796,41 @@ var Viewport = {
|
|
|
879
796
|
};
|
|
880
797
|
|
|
881
798
|
// packages/sdk/shell/src/components/SpaceListItem.tsx
|
|
882
|
-
import
|
|
883
|
-
import { Avatar as Avatar3, useId as useId3 } from "@dxos/react-ui";
|
|
799
|
+
import React20, { forwardRef as forwardRef7 } from "react";
|
|
800
|
+
import { Avatar as Avatar3, useId as useId3, useJdenticonHref as useJdenticonHref2 } from "@dxos/react-ui";
|
|
884
801
|
import { mx as mx17 } from "@dxos/react-ui-theme";
|
|
885
|
-
import { humanize
|
|
802
|
+
import { humanize } from "@dxos/util";
|
|
886
803
|
var SpaceListItem = /* @__PURE__ */ forwardRef7(({ space, onClick }, ref) => {
|
|
887
|
-
const fallbackValue =
|
|
804
|
+
const fallbackValue = space.key.toHex();
|
|
888
805
|
const labelId = useId3("identityListItem__label");
|
|
806
|
+
const jdenticon = useJdenticonHref2(fallbackValue ?? "", 12);
|
|
889
807
|
const displayName = space.properties.name ?? humanize(space.key.toHex());
|
|
890
|
-
return /* @__PURE__ */
|
|
808
|
+
return /* @__PURE__ */ React20.createElement("li", {
|
|
891
809
|
className: mx17("flex gap-2 items-center mbe-2", onClick && "cursor-pointer"),
|
|
892
810
|
onClick: () => onClick?.(),
|
|
893
811
|
ref,
|
|
894
812
|
"data-testid": "space-list-item"
|
|
895
|
-
}, /* @__PURE__ */
|
|
813
|
+
}, /* @__PURE__ */ React20.createElement(Avatar3.Root, {
|
|
896
814
|
labelId
|
|
897
|
-
}, /* @__PURE__ */
|
|
898
|
-
|
|
899
|
-
})), /* @__PURE__ */
|
|
815
|
+
}, /* @__PURE__ */ React20.createElement(Avatar3.Frame, null, /* @__PURE__ */ React20.createElement(Avatar3.Fallback, {
|
|
816
|
+
href: jdenticon
|
|
817
|
+
})), /* @__PURE__ */ React20.createElement(Avatar3.Label, {
|
|
900
818
|
classNames: "text-sm truncate"
|
|
901
819
|
}, displayName)));
|
|
902
820
|
});
|
|
903
821
|
|
|
904
822
|
// packages/sdk/shell/src/composites/IdentityDialog/IdentityDialog.tsx
|
|
905
|
-
import
|
|
823
|
+
import React40 from "react";
|
|
906
824
|
import { Dialog, useId as useId9 } from "@dxos/react-ui";
|
|
907
825
|
|
|
908
826
|
// packages/sdk/shell/src/panels/IdentityPanel/IdentityPanel.tsx
|
|
909
|
-
import
|
|
827
|
+
import React27, { useEffect as useEffect3, useMemo as useMemo3 } from "react";
|
|
910
828
|
import { generateName as generateName3 } from "@dxos/display-name";
|
|
911
829
|
import { log as log3 } from "@dxos/log";
|
|
912
830
|
import { useClient as useClient3 } from "@dxos/react-client";
|
|
913
831
|
import { useIdentity, useDevices, useHaloInvitations as useHaloInvitations2 } from "@dxos/react-client/halo";
|
|
914
832
|
import { useInvitationStatus as useInvitationStatus2 } from "@dxos/react-client/invitations";
|
|
915
|
-
import { Avatar as Avatar4, DensityProvider as DensityProvider2, useId as useId5, useTranslation as
|
|
916
|
-
import { keyToFallback as keyToFallback2 } from "@dxos/util";
|
|
833
|
+
import { Avatar as Avatar4, DensityProvider as DensityProvider2, useId as useId5, useJdenticonHref as useJdenticonHref3, useTranslation as useTranslation13 } from "@dxos/react-ui";
|
|
917
834
|
|
|
918
835
|
// packages/sdk/shell/src/panels/IdentityPanel/identityMachine.ts
|
|
919
836
|
import { useMachine } from "@xstate/react";
|
|
@@ -1042,30 +959,30 @@ var useIdentityMachine = (client, options) => {
|
|
|
1042
959
|
};
|
|
1043
960
|
|
|
1044
961
|
// packages/sdk/shell/src/panels/IdentityPanel/steps/AgentForm.tsx
|
|
1045
|
-
import
|
|
1046
|
-
import { useTranslation as
|
|
962
|
+
import React21 from "react";
|
|
963
|
+
import { useTranslation as useTranslation7 } from "@dxos/react-ui";
|
|
1047
964
|
var AgentForm = (props) => {
|
|
1048
965
|
const { active, onAgentCreate, onAgentDestroy, send, validationMessage, agentStatus, agentActive, agentProviderDisabled } = props;
|
|
1049
966
|
const disabled = !active;
|
|
1050
|
-
const { t } =
|
|
1051
|
-
return /* @__PURE__ */
|
|
967
|
+
const { t } = useTranslation7("os");
|
|
968
|
+
return /* @__PURE__ */ React21.createElement(React21.Fragment, null, /* @__PURE__ */ React21.createElement("div", {
|
|
1052
969
|
role: "none",
|
|
1053
970
|
className: "grow flex flex-col justify-center"
|
|
1054
|
-
}, /* @__PURE__ */
|
|
971
|
+
}, /* @__PURE__ */ React21.createElement(Input, {
|
|
1055
972
|
validationMessage,
|
|
1056
|
-
label: /* @__PURE__ */
|
|
973
|
+
label: /* @__PURE__ */ React21.createElement(StepHeading, null, "Agent Status"),
|
|
1057
974
|
disabled,
|
|
1058
975
|
"data-testid": "agent-status",
|
|
1059
976
|
value: agentStatus
|
|
1060
|
-
})), /* @__PURE__ */
|
|
977
|
+
})), /* @__PURE__ */ React21.createElement(Actions, null, /* @__PURE__ */ React21.createElement(Action, {
|
|
1061
978
|
disabled: agentActive || agentProviderDisabled,
|
|
1062
979
|
onClick: () => onAgentCreate?.(),
|
|
1063
980
|
"data-testid": "create-agent"
|
|
1064
|
-
}, "Create Agent"), /* @__PURE__ */
|
|
981
|
+
}, "Create Agent"), /* @__PURE__ */ React21.createElement(Action, {
|
|
1065
982
|
disabled: !agentActive || agentProviderDisabled,
|
|
1066
983
|
onClick: () => onAgentDestroy?.(),
|
|
1067
984
|
"data-testid": "destroy-agent"
|
|
1068
|
-
}, "Destroy Agent"), /* @__PURE__ */
|
|
985
|
+
}, "Destroy Agent"), /* @__PURE__ */ React21.createElement(Action, {
|
|
1069
986
|
disabled,
|
|
1070
987
|
onClick: () => send?.({
|
|
1071
988
|
type: "unchooseAction"
|
|
@@ -1075,17 +992,17 @@ var AgentForm = (props) => {
|
|
|
1075
992
|
};
|
|
1076
993
|
|
|
1077
994
|
// packages/sdk/shell/src/panels/IdentityPanel/steps/DeviceManager.tsx
|
|
1078
|
-
import
|
|
1079
|
-
import { useTranslation as
|
|
995
|
+
import React22 from "react";
|
|
996
|
+
import { useTranslation as useTranslation8 } from "@dxos/react-ui";
|
|
1080
997
|
var DeviceManager = ({ devices, active, send }) => {
|
|
1081
|
-
const { t } =
|
|
998
|
+
const { t } = useTranslation8("os");
|
|
1082
999
|
const disabled = !active;
|
|
1083
|
-
return /* @__PURE__ */
|
|
1000
|
+
return /* @__PURE__ */ React22.createElement(React22.Fragment, null, /* @__PURE__ */ React22.createElement("div", {
|
|
1084
1001
|
role: "none",
|
|
1085
1002
|
className: "grow"
|
|
1086
|
-
}, /* @__PURE__ */
|
|
1003
|
+
}, /* @__PURE__ */ React22.createElement(DeviceList, {
|
|
1087
1004
|
devices
|
|
1088
|
-
})), /* @__PURE__ */
|
|
1005
|
+
})), /* @__PURE__ */ React22.createElement(Actions, null, /* @__PURE__ */ React22.createElement(Action, {
|
|
1089
1006
|
variant: "ghost",
|
|
1090
1007
|
disabled,
|
|
1091
1008
|
onClick: () => send?.({
|
|
@@ -1097,12 +1014,12 @@ var DeviceManager = ({ devices, active, send }) => {
|
|
|
1097
1014
|
|
|
1098
1015
|
// packages/sdk/shell/src/panels/IdentityPanel/steps/IdentityActionChooser.tsx
|
|
1099
1016
|
import { CaretRight, Devices, Plus, Power, UserGear, HardDrive } from "@phosphor-icons/react";
|
|
1100
|
-
import
|
|
1017
|
+
import React23, { useCallback as useCallback4 } from "react";
|
|
1101
1018
|
import { useAgentHostingProviderClient, useClient as useClient2 } from "@dxos/react-client";
|
|
1102
1019
|
import { useHaloInvitations } from "@dxos/react-client/halo";
|
|
1103
|
-
import { Invitation as
|
|
1104
|
-
import { DensityProvider, useTranslation as
|
|
1105
|
-
import { getSize as
|
|
1020
|
+
import { Invitation as Invitation3, InvitationEncoder } from "@dxos/react-client/invitations";
|
|
1021
|
+
import { DensityProvider, useTranslation as useTranslation9 } from "@dxos/react-ui";
|
|
1022
|
+
import { getSize as getSize6 } from "@dxos/react-ui-theme";
|
|
1106
1023
|
var IdentityActionChooser = (props) => {
|
|
1107
1024
|
const { send } = props;
|
|
1108
1025
|
const client = useClient2();
|
|
@@ -1110,7 +1027,7 @@ var IdentityActionChooser = (props) => {
|
|
|
1110
1027
|
const agentHostingProviderClient = useAgentHostingProviderClient(client.config);
|
|
1111
1028
|
const onInvitationEvent = useCallback4((invitation) => {
|
|
1112
1029
|
const invitationCode = InvitationEncoder.encode(invitation);
|
|
1113
|
-
if (invitation.state ===
|
|
1030
|
+
if (invitation.state === Invitation3.State.CONNECTING) {
|
|
1114
1031
|
console.log(JSON.stringify({
|
|
1115
1032
|
invitationCode,
|
|
1116
1033
|
authCode: invitation.authCode
|
|
@@ -1121,8 +1038,8 @@ var IdentityActionChooser = (props) => {
|
|
|
1121
1038
|
const testing = e.altKey && e.shiftKey;
|
|
1122
1039
|
invitations.forEach((invitation2) => invitation2.cancel());
|
|
1123
1040
|
const invitation = client.halo.share(testing ? {
|
|
1124
|
-
type:
|
|
1125
|
-
authMethod:
|
|
1041
|
+
type: Invitation3.Type.MULTIUSE,
|
|
1042
|
+
authMethod: Invitation3.AuthMethod.NONE
|
|
1126
1043
|
} : void 0);
|
|
1127
1044
|
if (true) {
|
|
1128
1045
|
invitation.subscribe(onInvitationEvent);
|
|
@@ -1132,157 +1049,138 @@ var IdentityActionChooser = (props) => {
|
|
|
1132
1049
|
invitation
|
|
1133
1050
|
});
|
|
1134
1051
|
};
|
|
1135
|
-
return /* @__PURE__ */
|
|
1052
|
+
return /* @__PURE__ */ React23.createElement(IdentityActionChooserImpl, {
|
|
1136
1053
|
...props,
|
|
1137
1054
|
onCreateInvitationClick: (e) => createInvitation(e),
|
|
1138
1055
|
agentHostingEnabled: !!agentHostingProviderClient
|
|
1139
1056
|
});
|
|
1140
1057
|
};
|
|
1141
1058
|
var IdentityActionChooserImpl = ({ onCreateInvitationClick, active, send, onDone, doneActionParent, agentHostingEnabled }) => {
|
|
1142
|
-
const { t } =
|
|
1143
|
-
return /* @__PURE__ */
|
|
1059
|
+
const { t } = useTranslation9("os");
|
|
1060
|
+
return /* @__PURE__ */ React23.createElement("div", {
|
|
1144
1061
|
role: "none",
|
|
1145
1062
|
className: "grow flex flex-col gap-1"
|
|
1146
|
-
}, /* @__PURE__ */
|
|
1063
|
+
}, /* @__PURE__ */ React23.createElement(DensityProvider, {
|
|
1147
1064
|
density: "coarse"
|
|
1148
|
-
}, /* @__PURE__ */
|
|
1065
|
+
}, /* @__PURE__ */ React23.createElement("div", {
|
|
1149
1066
|
className: "grow justify-center flex flex-col gap-1"
|
|
1150
|
-
}, agentHostingEnabled && /* @__PURE__ */
|
|
1067
|
+
}, agentHostingEnabled && /* @__PURE__ */ React23.createElement(Action, {
|
|
1151
1068
|
"data-testid": "manage-agent",
|
|
1152
1069
|
onClick: () => send?.({
|
|
1153
1070
|
type: "chooseAgent"
|
|
1154
1071
|
}),
|
|
1155
1072
|
classNames: "plb-4"
|
|
1156
|
-
}, /* @__PURE__ */
|
|
1157
|
-
className:
|
|
1158
|
-
}), /* @__PURE__ */
|
|
1073
|
+
}, /* @__PURE__ */ React23.createElement(HardDrive, {
|
|
1074
|
+
className: getSize6(6)
|
|
1075
|
+
}), /* @__PURE__ */ React23.createElement("span", {
|
|
1159
1076
|
className: "grow mli-3"
|
|
1160
|
-
}, "Manage Agent"), /* @__PURE__ */
|
|
1077
|
+
}, "Manage Agent"), /* @__PURE__ */ React23.createElement(CaretRight, {
|
|
1161
1078
|
weight: "bold",
|
|
1162
|
-
className:
|
|
1163
|
-
})), /* @__PURE__ */
|
|
1079
|
+
className: getSize6(4)
|
|
1080
|
+
})), /* @__PURE__ */ React23.createElement(Action, {
|
|
1164
1081
|
disabled: !active,
|
|
1165
1082
|
"data-testid": "devices-panel.create-invitation",
|
|
1166
1083
|
onClick: onCreateInvitationClick,
|
|
1167
1084
|
classNames: "plb-4"
|
|
1168
|
-
}, /* @__PURE__ */
|
|
1169
|
-
className:
|
|
1170
|
-
}), /* @__PURE__ */
|
|
1085
|
+
}, /* @__PURE__ */ React23.createElement(Plus, {
|
|
1086
|
+
className: getSize6(6)
|
|
1087
|
+
}), /* @__PURE__ */ React23.createElement("span", {
|
|
1171
1088
|
className: "grow mli-3"
|
|
1172
|
-
}, t("choose add device label")), /* @__PURE__ */
|
|
1089
|
+
}, t("choose add device label")), /* @__PURE__ */ React23.createElement(CaretRight, {
|
|
1173
1090
|
weight: "bold",
|
|
1174
|
-
className:
|
|
1175
|
-
})), /* @__PURE__ */
|
|
1091
|
+
className: getSize6(4)
|
|
1092
|
+
})), /* @__PURE__ */ React23.createElement(Action, {
|
|
1176
1093
|
"data-testid": "manage-devices",
|
|
1177
1094
|
onClick: () => send?.({
|
|
1178
1095
|
type: "chooseDevices"
|
|
1179
1096
|
}),
|
|
1180
1097
|
classNames: "plb-4"
|
|
1181
|
-
}, /* @__PURE__ */
|
|
1182
|
-
className:
|
|
1183
|
-
}), /* @__PURE__ */
|
|
1098
|
+
}, /* @__PURE__ */ React23.createElement(Devices, {
|
|
1099
|
+
className: getSize6(6)
|
|
1100
|
+
}), /* @__PURE__ */ React23.createElement("span", {
|
|
1184
1101
|
className: "grow mli-3"
|
|
1185
|
-
}, t("choose devices label")), /* @__PURE__ */
|
|
1102
|
+
}, t("choose devices label")), /* @__PURE__ */ React23.createElement(CaretRight, {
|
|
1186
1103
|
weight: "bold",
|
|
1187
|
-
className:
|
|
1188
|
-
})), /* @__PURE__ */
|
|
1104
|
+
className: getSize6(4)
|
|
1105
|
+
})), /* @__PURE__ */ React23.createElement(Action, {
|
|
1189
1106
|
"data-testid": "manage-profile",
|
|
1190
1107
|
onClick: () => send?.({
|
|
1191
1108
|
type: "chooseProfile"
|
|
1192
1109
|
}),
|
|
1193
1110
|
classNames: "plb-4"
|
|
1194
|
-
}, /* @__PURE__ */
|
|
1195
|
-
className:
|
|
1196
|
-
}), /* @__PURE__ */
|
|
1111
|
+
}, /* @__PURE__ */ React23.createElement(UserGear, {
|
|
1112
|
+
className: getSize6(6)
|
|
1113
|
+
}), /* @__PURE__ */ React23.createElement("span", {
|
|
1197
1114
|
className: "grow mli-3"
|
|
1198
|
-
}, t("choose profile label")), /* @__PURE__ */
|
|
1115
|
+
}, t("choose profile label")), /* @__PURE__ */ React23.createElement(CaretRight, {
|
|
1199
1116
|
weight: "bold",
|
|
1200
|
-
className:
|
|
1201
|
-
})), /* @__PURE__ */
|
|
1117
|
+
className: getSize6(4)
|
|
1118
|
+
})), /* @__PURE__ */ React23.createElement(Action, {
|
|
1202
1119
|
"data-testid": "devices-panel.sign-out",
|
|
1203
1120
|
onClick: () => send?.({
|
|
1204
1121
|
type: "chooseSignOut"
|
|
1205
1122
|
}),
|
|
1206
1123
|
classNames: "plb-4"
|
|
1207
|
-
}, /* @__PURE__ */
|
|
1208
|
-
className:
|
|
1209
|
-
}), /* @__PURE__ */
|
|
1124
|
+
}, /* @__PURE__ */ React23.createElement(Power, {
|
|
1125
|
+
className: getSize6(6)
|
|
1126
|
+
}), /* @__PURE__ */ React23.createElement("span", {
|
|
1210
1127
|
className: "grow mli-3"
|
|
1211
|
-
}, t("choose sign out label")), /* @__PURE__ */
|
|
1128
|
+
}, t("choose sign out label")), /* @__PURE__ */ React23.createElement(CaretRight, {
|
|
1212
1129
|
weight: "bold",
|
|
1213
|
-
className:
|
|
1130
|
+
className: getSize6(4)
|
|
1214
1131
|
})))));
|
|
1215
1132
|
};
|
|
1216
1133
|
|
|
1217
1134
|
// packages/sdk/shell/src/panels/IdentityPanel/steps/ProfileForm.tsx
|
|
1218
|
-
import
|
|
1135
|
+
import React24, { useState as useState3 } from "react";
|
|
1219
1136
|
import { log as log2 } from "@dxos/log";
|
|
1220
|
-
import { useTranslation as
|
|
1221
|
-
import { hexToEmoji as hexToEmoji2, hexToHue } from "@dxos/util";
|
|
1137
|
+
import { useTranslation as useTranslation10 } from "@dxos/react-ui";
|
|
1222
1138
|
var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/IdentityPanel/steps/ProfileForm.tsx";
|
|
1223
1139
|
var ProfileForm = (props) => {
|
|
1224
1140
|
const { onUpdateProfile } = props;
|
|
1225
|
-
const { t } =
|
|
1226
|
-
const [validationMessage, setValidationMessage] =
|
|
1141
|
+
const { t } = useTranslation10("os");
|
|
1142
|
+
const [validationMessage, setValidationMessage] = useState3("");
|
|
1227
1143
|
const handleUpdateProfile = async (profile) => {
|
|
1228
1144
|
await onUpdateProfile?.(profile).catch((error) => {
|
|
1229
1145
|
log2.catch(error, void 0, {
|
|
1230
1146
|
F: __dxlog_file2,
|
|
1231
|
-
L:
|
|
1147
|
+
L: 32,
|
|
1232
1148
|
S: void 0,
|
|
1233
1149
|
C: (f, a) => f(...a)
|
|
1234
1150
|
});
|
|
1235
1151
|
setValidationMessage(t("failed to update profile message"));
|
|
1236
1152
|
});
|
|
1237
1153
|
};
|
|
1238
|
-
return /* @__PURE__ */
|
|
1154
|
+
return /* @__PURE__ */ React24.createElement(ProfileFormImpl, {
|
|
1239
1155
|
...props,
|
|
1240
1156
|
onUpdateProfile: handleUpdateProfile,
|
|
1241
1157
|
validationMessage
|
|
1242
1158
|
});
|
|
1243
1159
|
};
|
|
1244
|
-
var getHueValue = (identity) => identity?.profile?.hue || hexToHue(identity?.identityKey.toHex() ?? "0");
|
|
1245
|
-
var getEmojiValue = (identity) => identity?.profile?.emoji || hexToEmoji2(identity?.identityKey.toHex() ?? "0");
|
|
1246
1160
|
var ProfileFormImpl = (props) => {
|
|
1247
1161
|
const { active, identity, send, onUpdateProfile, validationMessage } = props;
|
|
1248
1162
|
const profile = identity?.profile;
|
|
1249
1163
|
const disabled = !active;
|
|
1250
|
-
const { t } =
|
|
1251
|
-
const [
|
|
1252
|
-
const [hue, setHue] = useState4(getHueValue(identity));
|
|
1253
|
-
const [emoji, setEmoji] = useState4(getEmojiValue(identity));
|
|
1164
|
+
const { t } = useTranslation10("os");
|
|
1165
|
+
const [inputValue, setInputValue] = useState3(profile?.displayName ?? "");
|
|
1254
1166
|
const { textValue, setTextValue } = useClipboardContext();
|
|
1255
1167
|
const identityHex = identity?.identityKey.toHex();
|
|
1256
1168
|
const copied = textValue === identityHex;
|
|
1257
|
-
return /* @__PURE__ */
|
|
1169
|
+
return /* @__PURE__ */ React24.createElement(React24.Fragment, null, /* @__PURE__ */ React24.createElement("div", {
|
|
1258
1170
|
role: "none",
|
|
1259
1171
|
className: "grow flex flex-col justify-center"
|
|
1260
|
-
}, /* @__PURE__ */
|
|
1172
|
+
}, /* @__PURE__ */ React24.createElement(Input, {
|
|
1261
1173
|
validationMessage,
|
|
1262
|
-
label: /* @__PURE__ */
|
|
1263
|
-
className: "m-0"
|
|
1264
|
-
}, t("display name input label")),
|
|
1174
|
+
label: /* @__PURE__ */ React24.createElement(StepHeading, null, t("display name input label")),
|
|
1265
1175
|
disabled,
|
|
1266
1176
|
"data-testid": "display-name-input",
|
|
1267
1177
|
placeholder: t("display name input placeholder"),
|
|
1268
|
-
value:
|
|
1269
|
-
onChange: ({ target: { value } }) =>
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
className: "grid grid-cols-[1fr_min-content] gap-y-2"
|
|
1275
|
-
}, /* @__PURE__ */ React26.createElement(EmojiPicker, {
|
|
1276
|
-
emoji,
|
|
1277
|
-
onChangeEmoji: setEmoji,
|
|
1278
|
-
disabled,
|
|
1279
|
-
onClickClear: () => setEmoji(getEmojiValue(identity))
|
|
1280
|
-
}), /* @__PURE__ */ React26.createElement(HuePicker, {
|
|
1281
|
-
hue,
|
|
1282
|
-
onChangeHue: setHue,
|
|
1283
|
-
disabled,
|
|
1284
|
-
onClickClear: () => setHue(getHueValue(identity))
|
|
1285
|
-
}))), /* @__PURE__ */ React26.createElement(Actions, null, /* @__PURE__ */ React26.createElement(Action, {
|
|
1178
|
+
value: inputValue,
|
|
1179
|
+
onChange: ({ target: { value } }) => setInputValue(value),
|
|
1180
|
+
onKeyDown: ({ key }) => key === "Enter" && onUpdateProfile?.({
|
|
1181
|
+
displayName: inputValue
|
|
1182
|
+
})
|
|
1183
|
+
})), /* @__PURE__ */ React24.createElement(Actions, null, /* @__PURE__ */ React24.createElement(Action, {
|
|
1286
1184
|
variant: "ghost",
|
|
1287
1185
|
disabled,
|
|
1288
1186
|
onClick: () => {
|
|
@@ -1291,20 +1189,18 @@ var ProfileFormImpl = (props) => {
|
|
|
1291
1189
|
}
|
|
1292
1190
|
},
|
|
1293
1191
|
"data-testid": "update-profile-form-copy-key"
|
|
1294
|
-
}, t(copied ? "copy success label" : "copy self public key label")), /* @__PURE__ */
|
|
1192
|
+
}, t(copied ? "copy success label" : "copy self public key label")), /* @__PURE__ */ React24.createElement(Action, {
|
|
1295
1193
|
variant: "ghost",
|
|
1296
1194
|
disabled,
|
|
1297
1195
|
onClick: () => send?.({
|
|
1298
1196
|
type: "unchooseAction"
|
|
1299
1197
|
}),
|
|
1300
1198
|
"data-testid": "update-profile-form-back"
|
|
1301
|
-
}, t("back label")), /* @__PURE__ */
|
|
1199
|
+
}, t("back label")), /* @__PURE__ */ React24.createElement(Action, {
|
|
1302
1200
|
variant: "primary",
|
|
1303
1201
|
disabled,
|
|
1304
1202
|
onClick: () => onUpdateProfile?.({
|
|
1305
|
-
displayName
|
|
1306
|
-
emoji,
|
|
1307
|
-
hue
|
|
1203
|
+
displayName: inputValue
|
|
1308
1204
|
}),
|
|
1309
1205
|
"data-testid": "update-profile-form-continue"
|
|
1310
1206
|
}, t("done label"))));
|
|
@@ -1312,17 +1208,17 @@ var ProfileFormImpl = (props) => {
|
|
|
1312
1208
|
|
|
1313
1209
|
// packages/sdk/shell/src/panels/IdentityPanel/steps/SignOutChooser.tsx
|
|
1314
1210
|
import { Warning } from "@phosphor-icons/react";
|
|
1315
|
-
import
|
|
1316
|
-
import { Message, useTranslation as
|
|
1317
|
-
import { getSize as
|
|
1211
|
+
import React25 from "react";
|
|
1212
|
+
import { Message, useTranslation as useTranslation11 } from "@dxos/react-ui";
|
|
1213
|
+
import { getSize as getSize7, mx as mx18 } from "@dxos/react-ui-theme";
|
|
1318
1214
|
var SignOutChooser = (props) => {
|
|
1319
|
-
const { t } =
|
|
1215
|
+
const { t } = useTranslation11("os");
|
|
1320
1216
|
const onResetDevice = () => {
|
|
1321
1217
|
if (window.confirm(t("reset device confirm message"))) {
|
|
1322
1218
|
void props.onResetDevice?.();
|
|
1323
1219
|
}
|
|
1324
1220
|
};
|
|
1325
|
-
return /* @__PURE__ */
|
|
1221
|
+
return /* @__PURE__ */ React25.createElement(SignOutChooserImpl, {
|
|
1326
1222
|
disabled: !props.active,
|
|
1327
1223
|
onBack: () => props.send?.({
|
|
1328
1224
|
type: "unchooseAction"
|
|
@@ -1332,24 +1228,24 @@ var SignOutChooser = (props) => {
|
|
|
1332
1228
|
});
|
|
1333
1229
|
};
|
|
1334
1230
|
var SignOutChooserImpl = ({ disabled, onResetDevice, onJoinNewIdentity, onBack }) => {
|
|
1335
|
-
const { t } =
|
|
1336
|
-
return /* @__PURE__ */
|
|
1231
|
+
const { t } = useTranslation11("os");
|
|
1232
|
+
return /* @__PURE__ */ React25.createElement(React25.Fragment, null, /* @__PURE__ */ React25.createElement("div", {
|
|
1337
1233
|
role: "none",
|
|
1338
1234
|
className: "grow flex flex-col justify-center"
|
|
1339
|
-
}, /* @__PURE__ */
|
|
1235
|
+
}, /* @__PURE__ */ React25.createElement(Message.Root, {
|
|
1340
1236
|
valence: "error"
|
|
1341
|
-
}, /* @__PURE__ */
|
|
1342
|
-
className: mx18(
|
|
1343
|
-
}), t("sign out chooser title")), /* @__PURE__ */
|
|
1237
|
+
}, /* @__PURE__ */ React25.createElement(Message.Title, null, /* @__PURE__ */ React25.createElement(Warning, {
|
|
1238
|
+
className: mx18(getSize7(6), "inline mie-2")
|
|
1239
|
+
}), t("sign out chooser title")), /* @__PURE__ */ React25.createElement(Message.Body, null, t("sign out chooser message")))), /* @__PURE__ */ React25.createElement(Actions, null, /* @__PURE__ */ React25.createElement(Action, {
|
|
1344
1240
|
disabled,
|
|
1345
1241
|
onClick: onBack
|
|
1346
|
-
}, t("back label")), /* @__PURE__ */
|
|
1242
|
+
}, t("back label")), /* @__PURE__ */ React25.createElement(Action, {
|
|
1347
1243
|
variant: "primary",
|
|
1348
1244
|
"data-testid": "sign-out.join-new-identity",
|
|
1349
1245
|
classNames: "!bg-error-500 hover:!bg-error-550",
|
|
1350
1246
|
disabled,
|
|
1351
1247
|
onClick: onJoinNewIdentity
|
|
1352
|
-
}, t("join new identity label")), /* @__PURE__ */
|
|
1248
|
+
}, t("join new identity label")), /* @__PURE__ */ React25.createElement(Action, {
|
|
1353
1249
|
variant: "primary",
|
|
1354
1250
|
"data-testid": "sign-out.reset-device",
|
|
1355
1251
|
classNames: "!bg-error-500 hover:!bg-error-550",
|
|
@@ -1359,15 +1255,15 @@ var SignOutChooserImpl = ({ disabled, onResetDevice, onJoinNewIdentity, onBack }
|
|
|
1359
1255
|
};
|
|
1360
1256
|
|
|
1361
1257
|
// packages/sdk/shell/src/panels/IdentityPanel/useAgentHandlers.ts
|
|
1362
|
-
import { useCallback as useCallback5, useEffect as useEffect2, useState as
|
|
1258
|
+
import { useCallback as useCallback5, useEffect as useEffect2, useState as useState4 } from "react";
|
|
1363
1259
|
import { invariant } from "@dxos/invariant";
|
|
1364
1260
|
import { useAgentHostingProviderClient as useAgentHostingProviderClient2 } from "@dxos/react-client";
|
|
1365
|
-
import { Invitation as
|
|
1261
|
+
import { Invitation as Invitation4, InvitationEncoder as InvitationEncoder2 } from "@dxos/react-client/invitations";
|
|
1366
1262
|
var __dxlog_file3 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/IdentityPanel/useAgentHandlers.ts";
|
|
1367
1263
|
var useAgentHandlers = ({ client, invitations, identity }) => {
|
|
1368
|
-
const [validationMessage, setValidationMessage] =
|
|
1369
|
-
const [agentStatus, setAgentStatus] =
|
|
1370
|
-
const [agentActive, setAgentActive] =
|
|
1264
|
+
const [validationMessage, setValidationMessage] = useState4("");
|
|
1265
|
+
const [agentStatus, setAgentStatus] = useState4("");
|
|
1266
|
+
const [agentActive, setAgentActive] = useState4(false);
|
|
1371
1267
|
const agentHostingProviderClient = useAgentHostingProviderClient2(client.config);
|
|
1372
1268
|
useEffect2(() => {
|
|
1373
1269
|
const fetchAgentStatus = async () => {
|
|
@@ -1388,7 +1284,7 @@ var useAgentHandlers = ({ client, invitations, identity }) => {
|
|
|
1388
1284
|
}, []);
|
|
1389
1285
|
const handleAgentCreate = useCallback5(async (invitation) => {
|
|
1390
1286
|
const invitationCode = InvitationEncoder2.encode(invitation);
|
|
1391
|
-
if (invitation.state ===
|
|
1287
|
+
if (invitation.state === Invitation4.State.CONNECTING) {
|
|
1392
1288
|
console.log(JSON.stringify({
|
|
1393
1289
|
invitationCode,
|
|
1394
1290
|
authCode: invitation.authCode
|
|
@@ -1417,8 +1313,8 @@ var useAgentHandlers = ({ client, invitations, identity }) => {
|
|
|
1417
1313
|
const onAgentCreate = async () => {
|
|
1418
1314
|
invitations.forEach((invitation2) => invitation2.cancel());
|
|
1419
1315
|
const invitation = client.halo.share({
|
|
1420
|
-
type:
|
|
1421
|
-
authMethod:
|
|
1316
|
+
type: Invitation4.Type.MULTIUSE,
|
|
1317
|
+
authMethod: Invitation4.AuthMethod.NONE
|
|
1422
1318
|
});
|
|
1423
1319
|
invitation.subscribe(handleAgentCreate);
|
|
1424
1320
|
};
|
|
@@ -1452,68 +1348,24 @@ var useAgentHandlers = ({ client, invitations, identity }) => {
|
|
|
1452
1348
|
};
|
|
1453
1349
|
|
|
1454
1350
|
// packages/sdk/shell/src/steps/InvitationManager.tsx
|
|
1455
|
-
import { Check as
|
|
1456
|
-
import
|
|
1351
|
+
import { Check as Check3, X as X3 } from "@phosphor-icons/react";
|
|
1352
|
+
import React26, { useMemo as useMemo2 } from "react";
|
|
1457
1353
|
import { QR } from "react-qr-rounded";
|
|
1458
1354
|
import { Invitation as Invitation5 } from "@dxos/react-client/invitations";
|
|
1459
|
-
import { useId as useId4, useTranslation as
|
|
1460
|
-
import { descriptionText as descriptionText7, getSize as
|
|
1461
|
-
import { hexToEmoji as hexToEmoji3 } from "@dxos/util";
|
|
1462
|
-
|
|
1463
|
-
// packages/sdk/shell/src/util/invitationStatusValue.ts
|
|
1464
|
-
import { Invitation as Invitation4 } from "@dxos/react-client/invitations";
|
|
1465
|
-
var invitationStatusValue = /* @__PURE__ */ new Map([
|
|
1466
|
-
[
|
|
1467
|
-
Invitation4.State.ERROR,
|
|
1468
|
-
-3
|
|
1469
|
-
],
|
|
1470
|
-
[
|
|
1471
|
-
Invitation4.State.TIMEOUT,
|
|
1472
|
-
-2
|
|
1473
|
-
],
|
|
1474
|
-
[
|
|
1475
|
-
Invitation4.State.CANCELLED,
|
|
1476
|
-
-1
|
|
1477
|
-
],
|
|
1478
|
-
[
|
|
1479
|
-
Invitation4.State.INIT,
|
|
1480
|
-
0
|
|
1481
|
-
],
|
|
1482
|
-
[
|
|
1483
|
-
Invitation4.State.CONNECTING,
|
|
1484
|
-
1
|
|
1485
|
-
],
|
|
1486
|
-
[
|
|
1487
|
-
Invitation4.State.CONNECTED,
|
|
1488
|
-
2
|
|
1489
|
-
],
|
|
1490
|
-
[
|
|
1491
|
-
Invitation4.State.READY_FOR_AUTHENTICATION,
|
|
1492
|
-
3
|
|
1493
|
-
],
|
|
1494
|
-
[
|
|
1495
|
-
Invitation4.State.AUTHENTICATING,
|
|
1496
|
-
4
|
|
1497
|
-
],
|
|
1498
|
-
[
|
|
1499
|
-
Invitation4.State.SUCCESS,
|
|
1500
|
-
5
|
|
1501
|
-
]
|
|
1502
|
-
]);
|
|
1503
|
-
|
|
1504
|
-
// packages/sdk/shell/src/steps/InvitationManager.tsx
|
|
1355
|
+
import { useId as useId4, useTranslation as useTranslation12 } from "@dxos/react-ui";
|
|
1356
|
+
import { descriptionText as descriptionText7, getSize as getSize8, mx as mx19 } from "@dxos/react-ui-theme";
|
|
1505
1357
|
var InvitationManagerView = ({ children, ...props }) => {
|
|
1506
|
-
return /* @__PURE__ */
|
|
1358
|
+
return /* @__PURE__ */ React26.createElement(Viewport.View, {
|
|
1507
1359
|
...props,
|
|
1508
1360
|
classNames: "grow flex flex-col justify-around items-center"
|
|
1509
1361
|
}, children);
|
|
1510
1362
|
};
|
|
1511
|
-
var InvitationManager = ({ invitationUrl, active, send, status, type, authCode, id
|
|
1512
|
-
const { t } =
|
|
1363
|
+
var InvitationManager = ({ invitationUrl, active, send, status, type, authCode, id }) => {
|
|
1364
|
+
const { t } = useTranslation12("os");
|
|
1513
1365
|
const qrLabel = useId4("invitation-manager__qr-code");
|
|
1514
1366
|
const statusValue = type === Invitation5.Type.MULTIUSE ? 0 : invitationStatusValue.get(status) ?? 0;
|
|
1515
1367
|
const showAuthCode = statusValue === 3;
|
|
1516
|
-
const
|
|
1368
|
+
const emoji2 = toEmoji(id ?? "");
|
|
1517
1369
|
const activeView = useMemo2(() => {
|
|
1518
1370
|
switch (true) {
|
|
1519
1371
|
case statusValue === 5:
|
|
@@ -1527,18 +1379,18 @@ var InvitationManager = ({ invitationUrl, active, send, status, type, authCode,
|
|
|
1527
1379
|
}, [
|
|
1528
1380
|
statusValue
|
|
1529
1381
|
]);
|
|
1530
|
-
return /* @__PURE__ */
|
|
1382
|
+
return /* @__PURE__ */ React26.createElement(React26.Fragment, null, /* @__PURE__ */ React26.createElement(Viewport.Root, {
|
|
1531
1383
|
activeView,
|
|
1532
1384
|
classNames: "grow plb-1"
|
|
1533
|
-
}, /* @__PURE__ */
|
|
1385
|
+
}, /* @__PURE__ */ React26.createElement(Viewport.Views, null, /* @__PURE__ */ React26.createElement(InvitationManagerView, {
|
|
1534
1386
|
id: "showing qr",
|
|
1535
|
-
emoji
|
|
1536
|
-
}, /* @__PURE__ */
|
|
1387
|
+
emoji: emoji2
|
|
1388
|
+
}, /* @__PURE__ */ React26.createElement("p", {
|
|
1537
1389
|
className: "text-sm mlb-1 font-normal text-center"
|
|
1538
|
-
}, t(type === Invitation5.Type.MULTIUSE ? "invite many qr label" : "invite one qr label")), /* @__PURE__ */
|
|
1390
|
+
}, t(type === Invitation5.Type.MULTIUSE ? "invite many qr label" : "invite one qr label")), /* @__PURE__ */ React26.createElement("div", {
|
|
1539
1391
|
role: "none",
|
|
1540
1392
|
className: mx19(descriptionText7, "is-full max-is-[14rem] relative")
|
|
1541
|
-
}, /* @__PURE__ */
|
|
1393
|
+
}, /* @__PURE__ */ React26.createElement(QR, {
|
|
1542
1394
|
rounding: 100,
|
|
1543
1395
|
backgroundColor: "transparent",
|
|
1544
1396
|
color: "currentColor",
|
|
@@ -1546,31 +1398,31 @@ var InvitationManager = ({ invitationUrl, active, send, status, type, authCode,
|
|
|
1546
1398
|
"aria-labelledby": qrLabel,
|
|
1547
1399
|
errorCorrectionLevel: "Q",
|
|
1548
1400
|
cutout: true
|
|
1549
|
-
}, invitationUrl ?? "never"), /* @__PURE__ */
|
|
1550
|
-
text:
|
|
1551
|
-
}))), /* @__PURE__ */
|
|
1401
|
+
}, invitationUrl ?? "never"), /* @__PURE__ */ React26.createElement(Centered, null, /* @__PURE__ */ React26.createElement(Emoji, {
|
|
1402
|
+
text: emoji2
|
|
1403
|
+
}))), /* @__PURE__ */ React26.createElement("span", {
|
|
1552
1404
|
id: qrLabel,
|
|
1553
1405
|
className: "sr-only"
|
|
1554
|
-
}, t("qr label")), /* @__PURE__ */
|
|
1406
|
+
}, t("qr label")), /* @__PURE__ */ React26.createElement(CopyButton, {
|
|
1555
1407
|
variant: "ghost",
|
|
1556
1408
|
value: invitationUrl ?? "never"
|
|
1557
|
-
})), /* @__PURE__ */
|
|
1409
|
+
})), /* @__PURE__ */ React26.createElement(InvitationManagerView, {
|
|
1558
1410
|
id: "showing auth code"
|
|
1559
|
-
}, /* @__PURE__ */
|
|
1411
|
+
}, /* @__PURE__ */ React26.createElement(Label, null, t("auth code message")), /* @__PURE__ */ React26.createElement(AuthCode, {
|
|
1560
1412
|
code: authCode,
|
|
1561
1413
|
large: true,
|
|
1562
1414
|
classNames: "text-black dark:text-white"
|
|
1563
|
-
}), /* @__PURE__ */
|
|
1564
|
-
text:
|
|
1565
|
-
})), /* @__PURE__ */
|
|
1415
|
+
}), /* @__PURE__ */ React26.createElement(Label, null, "Be sure the other device is showing this symbol:"), emoji2 && /* @__PURE__ */ React26.createElement(Emoji, {
|
|
1416
|
+
text: emoji2
|
|
1417
|
+
})), /* @__PURE__ */ React26.createElement(InvitationManagerView, {
|
|
1566
1418
|
id: "showing final"
|
|
1567
|
-
}, statusValue > 0 ? /* @__PURE__ */
|
|
1568
|
-
className: mx19("m-1.5",
|
|
1569
|
-
}) : /* @__PURE__ */
|
|
1570
|
-
className: mx19("m-1.5",
|
|
1571
|
-
})))), /* @__PURE__ */
|
|
1419
|
+
}, statusValue > 0 ? /* @__PURE__ */ React26.createElement(Check3, {
|
|
1420
|
+
className: mx19("m-1.5", getSize8(6))
|
|
1421
|
+
}) : /* @__PURE__ */ React26.createElement(X3, {
|
|
1422
|
+
className: mx19("m-1.5", getSize8(6))
|
|
1423
|
+
})))), /* @__PURE__ */ React26.createElement(Actions, {
|
|
1572
1424
|
classNames: "mbs-4"
|
|
1573
|
-
}, /* @__PURE__ */
|
|
1425
|
+
}, /* @__PURE__ */ React26.createElement(Action, {
|
|
1574
1426
|
disabled: !active,
|
|
1575
1427
|
onClick: () => send?.({
|
|
1576
1428
|
type: "deselectInvitation"
|
|
@@ -1582,30 +1434,29 @@ var InvitationManager = ({ invitationUrl, active, send, status, type, authCode,
|
|
|
1582
1434
|
var __dxlog_file4 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/IdentityPanel/IdentityPanel.tsx";
|
|
1583
1435
|
var viewStyles = "pbs-1 pbe-3 pli-3";
|
|
1584
1436
|
var IdentityHeading = ({ titleId, title, identity, onDone }) => {
|
|
1585
|
-
const
|
|
1586
|
-
return /* @__PURE__ */
|
|
1437
|
+
const fallbackHref = useJdenticonHref3(identity.identityKey.toHex(), 12);
|
|
1438
|
+
return /* @__PURE__ */ React27.createElement(Heading, {
|
|
1587
1439
|
titleId,
|
|
1588
1440
|
title,
|
|
1589
|
-
corner: /* @__PURE__ */
|
|
1441
|
+
corner: /* @__PURE__ */ React27.createElement(CloseButton, {
|
|
1590
1442
|
onDone
|
|
1591
1443
|
})
|
|
1592
|
-
}, /* @__PURE__ */
|
|
1444
|
+
}, /* @__PURE__ */ React27.createElement(Avatar4.Root, {
|
|
1593
1445
|
size: 12,
|
|
1594
1446
|
variant: "circle",
|
|
1595
|
-
status: "active"
|
|
1596
|
-
|
|
1597
|
-
}, /* @__PURE__ */ React29.createElement(Avatar4.Frame, {
|
|
1447
|
+
status: "active"
|
|
1448
|
+
}, /* @__PURE__ */ React27.createElement(Avatar4.Frame, {
|
|
1598
1449
|
classNames: "block mbs-4 mbe-2 mli-auto chromatic-ignore"
|
|
1599
|
-
}, /* @__PURE__ */
|
|
1600
|
-
|
|
1601
|
-
})), /* @__PURE__ */
|
|
1450
|
+
}, /* @__PURE__ */ React27.createElement(Avatar4.Fallback, {
|
|
1451
|
+
href: fallbackHref
|
|
1452
|
+
})), /* @__PURE__ */ React27.createElement(Avatar4.Label, {
|
|
1602
1453
|
classNames: "block text-center font-light text-xl",
|
|
1603
1454
|
"data-testid": "identityHeading.displayName"
|
|
1604
1455
|
}, identity.profile?.displayName ?? generateName3(identity.identityKey.toHex()))));
|
|
1605
1456
|
};
|
|
1606
1457
|
var IdentityPanelImpl = (props) => {
|
|
1607
1458
|
const { identity, titleId, activeView, onUpdateProfile, onResetDevice, onJoinNewIdentity, IdentityActionChooser: IdentityActionChooserComponent = IdentityActionChooser, InvitationManager: InvitationManagerComponent = InvitationManager, onDone, ...rest } = props;
|
|
1608
|
-
const { t } =
|
|
1459
|
+
const { t } = useTranslation13("os");
|
|
1609
1460
|
const title = useMemo3(() => {
|
|
1610
1461
|
switch (activeView) {
|
|
1611
1462
|
case "agent manager":
|
|
@@ -1619,54 +1470,54 @@ var IdentityPanelImpl = (props) => {
|
|
|
1619
1470
|
activeView,
|
|
1620
1471
|
t
|
|
1621
1472
|
]);
|
|
1622
|
-
return /* @__PURE__ */
|
|
1473
|
+
return /* @__PURE__ */ React27.createElement(DensityProvider2, {
|
|
1623
1474
|
density: "fine"
|
|
1624
|
-
}, /* @__PURE__ */
|
|
1475
|
+
}, /* @__PURE__ */ React27.createElement(IdentityHeading, {
|
|
1625
1476
|
identity,
|
|
1626
1477
|
titleId,
|
|
1627
1478
|
title,
|
|
1628
1479
|
onDone
|
|
1629
|
-
}), /* @__PURE__ */
|
|
1480
|
+
}), /* @__PURE__ */ React27.createElement(Viewport.Root, {
|
|
1630
1481
|
activeView
|
|
1631
|
-
}, /* @__PURE__ */
|
|
1482
|
+
}, /* @__PURE__ */ React27.createElement(Viewport.Views, null, /* @__PURE__ */ React27.createElement(Viewport.View, {
|
|
1632
1483
|
id: "identity action chooser",
|
|
1633
1484
|
classNames: viewStyles
|
|
1634
|
-
}, /* @__PURE__ */
|
|
1485
|
+
}, /* @__PURE__ */ React27.createElement(IdentityActionChooserComponent, {
|
|
1635
1486
|
active: activeView === "identity action chooser",
|
|
1636
1487
|
...rest
|
|
1637
|
-
})), /* @__PURE__ */
|
|
1488
|
+
})), /* @__PURE__ */ React27.createElement(Viewport.View, {
|
|
1638
1489
|
id: "device invitation manager",
|
|
1639
1490
|
classNames: viewStyles
|
|
1640
|
-
}, /* @__PURE__ */
|
|
1491
|
+
}, /* @__PURE__ */ React27.createElement(InvitationManagerComponent, {
|
|
1641
1492
|
active: activeView === "device invitation manager",
|
|
1642
1493
|
...rest,
|
|
1643
1494
|
invitationUrl: rest.createInvitationUrl(rest.invitationCode)
|
|
1644
|
-
})), /* @__PURE__ */
|
|
1495
|
+
})), /* @__PURE__ */ React27.createElement(Viewport.View, {
|
|
1645
1496
|
id: "device manager",
|
|
1646
1497
|
classNames: viewStyles
|
|
1647
|
-
}, /* @__PURE__ */
|
|
1498
|
+
}, /* @__PURE__ */ React27.createElement(DeviceManager, {
|
|
1648
1499
|
active: activeView === "device manager",
|
|
1649
1500
|
...rest
|
|
1650
|
-
})), /* @__PURE__ */
|
|
1501
|
+
})), /* @__PURE__ */ React27.createElement(Viewport.View, {
|
|
1651
1502
|
classNames: viewStyles,
|
|
1652
1503
|
id: "update profile form"
|
|
1653
|
-
}, /* @__PURE__ */
|
|
1504
|
+
}, /* @__PURE__ */ React27.createElement(ProfileForm, {
|
|
1654
1505
|
send: rest.send,
|
|
1655
1506
|
active: activeView === "update profile form",
|
|
1656
1507
|
identity,
|
|
1657
1508
|
onUpdateProfile
|
|
1658
|
-
})), /* @__PURE__ */
|
|
1509
|
+
})), /* @__PURE__ */ React27.createElement(Viewport.View, {
|
|
1659
1510
|
classNames: viewStyles,
|
|
1660
1511
|
id: "signing out"
|
|
1661
|
-
}, /* @__PURE__ */
|
|
1512
|
+
}, /* @__PURE__ */ React27.createElement(SignOutChooser, {
|
|
1662
1513
|
send: rest.send,
|
|
1663
1514
|
active: activeView === "signing out",
|
|
1664
1515
|
onResetDevice,
|
|
1665
1516
|
onJoinNewIdentity
|
|
1666
|
-
})), /* @__PURE__ */
|
|
1517
|
+
})), /* @__PURE__ */ React27.createElement(Viewport.View, {
|
|
1667
1518
|
classNames: viewStyles,
|
|
1668
1519
|
id: "agent manager"
|
|
1669
|
-
}, /* @__PURE__ */
|
|
1520
|
+
}, /* @__PURE__ */ React27.createElement(AgentForm, {
|
|
1670
1521
|
send: rest.send,
|
|
1671
1522
|
active: activeView === "agent manager",
|
|
1672
1523
|
...rest
|
|
@@ -1674,7 +1525,7 @@ var IdentityPanelImpl = (props) => {
|
|
|
1674
1525
|
};
|
|
1675
1526
|
var IdentityPanelWithInvitationImpl = ({ invitation, ...props }) => {
|
|
1676
1527
|
const invitationStatus = useInvitationStatus2(invitation);
|
|
1677
|
-
return /* @__PURE__ */
|
|
1528
|
+
return /* @__PURE__ */ React27.createElement(IdentityPanelImpl, {
|
|
1678
1529
|
...props,
|
|
1679
1530
|
...invitationStatus
|
|
1680
1531
|
});
|
|
@@ -1699,7 +1550,7 @@ var IdentityPanel = ({ titleId: propsTitleId, createInvitationUrl = (code) => co
|
|
|
1699
1550
|
const subscription = identityService.subscribe((state) => {
|
|
1700
1551
|
log3("[state]", state, {
|
|
1701
1552
|
F: __dxlog_file4,
|
|
1702
|
-
L:
|
|
1553
|
+
L: 138,
|
|
1703
1554
|
S: void 0,
|
|
1704
1555
|
C: (f, a) => f(...a)
|
|
1705
1556
|
});
|
|
@@ -1759,40 +1610,40 @@ var IdentityPanel = ({ titleId: propsTitleId, createInvitationUrl = (code) => co
|
|
|
1759
1610
|
onUpdateProfile,
|
|
1760
1611
|
...agentProps
|
|
1761
1612
|
};
|
|
1762
|
-
return identityState.context.invitation ? /* @__PURE__ */
|
|
1613
|
+
return identityState.context.invitation ? /* @__PURE__ */ React27.createElement(IdentityPanelWithInvitationImpl, {
|
|
1763
1614
|
...implProps,
|
|
1764
1615
|
invitation: identityState.context.invitation
|
|
1765
|
-
}) : /* @__PURE__ */
|
|
1616
|
+
}) : /* @__PURE__ */ React27.createElement(IdentityPanelImpl, implProps);
|
|
1766
1617
|
};
|
|
1767
1618
|
|
|
1768
1619
|
// packages/sdk/shell/src/panels/JoinPanel/JoinPanel.tsx
|
|
1769
|
-
import
|
|
1620
|
+
import React37, { useCallback as useCallback7, useEffect as useEffect5, useMemo as useMemo4 } from "react";
|
|
1770
1621
|
import { log as log8 } from "@dxos/log";
|
|
1771
1622
|
import { useClient as useClient6, useMulticastObservable } from "@dxos/react-client";
|
|
1772
1623
|
import { useIdentity as useIdentity2 } from "@dxos/react-client/halo";
|
|
1773
|
-
import { DensityProvider as DensityProvider3, useId as useId7, useThemeContext as
|
|
1624
|
+
import { DensityProvider as DensityProvider3, useId as useId7, useThemeContext as useThemeContext3 } from "@dxos/react-ui";
|
|
1774
1625
|
|
|
1775
1626
|
// packages/sdk/shell/src/panels/JoinPanel/JoinHeading.tsx
|
|
1776
1627
|
import { X as X4 } from "@phosphor-icons/react";
|
|
1777
|
-
import
|
|
1778
|
-
import { Button as
|
|
1779
|
-
import { descriptionText as descriptionText8, getSize as
|
|
1628
|
+
import React28, { cloneElement, forwardRef as forwardRef8 } from "react";
|
|
1629
|
+
import { Button as Button5, useTranslation as useTranslation14 } from "@dxos/react-ui";
|
|
1630
|
+
import { descriptionText as descriptionText8, getSize as getSize9, mx as mx20 } from "@dxos/react-ui-theme";
|
|
1780
1631
|
var JoinHeading = /* @__PURE__ */ forwardRef8(({ mode, titleId, onExit, exitActionParent }, forwardedRef) => {
|
|
1781
|
-
const { t } =
|
|
1782
|
-
const exitButton = /* @__PURE__ */
|
|
1632
|
+
const { t } = useTranslation14("os");
|
|
1633
|
+
const exitButton = /* @__PURE__ */ React28.createElement(Button5, {
|
|
1783
1634
|
variant: "ghost",
|
|
1784
1635
|
...onExit && {
|
|
1785
1636
|
onClick: onExit
|
|
1786
1637
|
},
|
|
1787
1638
|
classNames: mx20(descriptionText8, "plb-0 pli-2 absolute block-start-0 inline-end-0 z-[1]"),
|
|
1788
1639
|
"data-testid": "join-exit"
|
|
1789
|
-
}, /* @__PURE__ */
|
|
1640
|
+
}, /* @__PURE__ */ React28.createElement(X4, {
|
|
1790
1641
|
weight: "bold",
|
|
1791
|
-
className:
|
|
1792
|
-
}), /* @__PURE__ */
|
|
1642
|
+
className: getSize9(4)
|
|
1643
|
+
}), /* @__PURE__ */ React28.createElement("span", {
|
|
1793
1644
|
className: "sr-only"
|
|
1794
1645
|
}, t("exit label")));
|
|
1795
|
-
return /* @__PURE__ */
|
|
1646
|
+
return /* @__PURE__ */ React28.createElement(Heading, {
|
|
1796
1647
|
ref: forwardedRef,
|
|
1797
1648
|
titleId,
|
|
1798
1649
|
title: t(mode === "halo-only" ? "selecting identity heading" : "joining space heading"),
|
|
@@ -2395,17 +2246,17 @@ var useJoinMachine = (client, options) => {
|
|
|
2395
2246
|
|
|
2396
2247
|
// packages/sdk/shell/src/panels/JoinPanel/steps/AdditionMethodChooser.tsx
|
|
2397
2248
|
import { CaretRight as CaretRight2, Plus as Plus2, QrCode, Textbox } from "@phosphor-icons/react";
|
|
2398
|
-
import
|
|
2399
|
-
import { useTranslation as
|
|
2400
|
-
import { getSize as
|
|
2249
|
+
import React29 from "react";
|
|
2250
|
+
import { useTranslation as useTranslation15 } from "@dxos/react-ui";
|
|
2251
|
+
import { getSize as getSize10 } from "@dxos/react-ui-theme";
|
|
2401
2252
|
var AdditionMethodChooser = (viewStateProps) => {
|
|
2402
2253
|
const disabled = !viewStateProps.active;
|
|
2403
2254
|
const { send } = viewStateProps;
|
|
2404
|
-
const { t } =
|
|
2255
|
+
const { t } = useTranslation15("os");
|
|
2405
2256
|
const sharedButtonProps = {
|
|
2406
2257
|
disabled,
|
|
2407
|
-
after: /* @__PURE__ */
|
|
2408
|
-
className:
|
|
2258
|
+
after: /* @__PURE__ */ React29.createElement(CaretRight2, {
|
|
2259
|
+
className: getSize10(4),
|
|
2409
2260
|
weight: "bold"
|
|
2410
2261
|
}),
|
|
2411
2262
|
slots: {
|
|
@@ -2414,37 +2265,37 @@ var AdditionMethodChooser = (viewStateProps) => {
|
|
|
2414
2265
|
}
|
|
2415
2266
|
}
|
|
2416
2267
|
};
|
|
2417
|
-
return /* @__PURE__ */
|
|
2268
|
+
return /* @__PURE__ */ React29.createElement(React29.Fragment, null, /* @__PURE__ */ React29.createElement(StepHeading, null, t("addition method chooser title")), /* @__PURE__ */ React29.createElement("div", {
|
|
2418
2269
|
role: "none",
|
|
2419
2270
|
className: "flex flex-col gap-1 grow"
|
|
2420
|
-
}, /* @__PURE__ */
|
|
2271
|
+
}, /* @__PURE__ */ React29.createElement(CompoundButton, {
|
|
2421
2272
|
...sharedButtonProps,
|
|
2422
2273
|
description: t("create identity description"),
|
|
2423
|
-
before: /* @__PURE__ */
|
|
2424
|
-
className:
|
|
2274
|
+
before: /* @__PURE__ */ React29.createElement(Plus2, {
|
|
2275
|
+
className: getSize10(6)
|
|
2425
2276
|
}),
|
|
2426
2277
|
onClick: () => send({
|
|
2427
2278
|
type: "createIdentity"
|
|
2428
2279
|
}),
|
|
2429
2280
|
"data-autofocus": "choosingAuthMethod",
|
|
2430
2281
|
"data-testid": "identity-chooser.create-identity"
|
|
2431
|
-
}, t("create identity label")), /* @__PURE__ */
|
|
2282
|
+
}, t("create identity label")), /* @__PURE__ */ React29.createElement(CompoundButton, {
|
|
2432
2283
|
...sharedButtonProps,
|
|
2433
2284
|
description: t("join identity description"),
|
|
2434
|
-
before: /* @__PURE__ */
|
|
2435
|
-
className:
|
|
2285
|
+
before: /* @__PURE__ */ React29.createElement(QrCode, {
|
|
2286
|
+
className: getSize10(6)
|
|
2436
2287
|
}),
|
|
2437
2288
|
onClick: () => send({
|
|
2438
2289
|
type: "acceptHaloInvitation"
|
|
2439
2290
|
}),
|
|
2440
2291
|
"data-testid": "identity-chooser.join-identity"
|
|
2441
|
-
}, t("join identity label")), /* @__PURE__ */
|
|
2292
|
+
}, t("join identity label")), /* @__PURE__ */ React29.createElement(CompoundButton, {
|
|
2442
2293
|
...sharedButtonProps,
|
|
2443
2294
|
// TODO(mykola): Implement recover.
|
|
2444
2295
|
disabled: true,
|
|
2445
2296
|
description: t("recover identity description"),
|
|
2446
|
-
before: /* @__PURE__ */
|
|
2447
|
-
className:
|
|
2297
|
+
before: /* @__PURE__ */ React29.createElement(Textbox, {
|
|
2298
|
+
className: getSize10(6)
|
|
2448
2299
|
}),
|
|
2449
2300
|
onClick: () => send({
|
|
2450
2301
|
type: "recoverIdentity"
|
|
@@ -2454,39 +2305,37 @@ var AdditionMethodChooser = (viewStateProps) => {
|
|
|
2454
2305
|
};
|
|
2455
2306
|
|
|
2456
2307
|
// packages/sdk/shell/src/panels/JoinPanel/steps/IdentityAdded.tsx
|
|
2457
|
-
import
|
|
2308
|
+
import React30, { cloneElement as cloneElement2 } from "react";
|
|
2458
2309
|
import { generateName as generateName4 } from "@dxos/display-name";
|
|
2459
|
-
import { Avatar as Avatar5, useId as useId6, useTranslation as
|
|
2310
|
+
import { Avatar as Avatar5, useId as useId6, useJdenticonHref as useJdenticonHref4, useTranslation as useTranslation16 } from "@dxos/react-ui";
|
|
2460
2311
|
import { mx as mx21 } from "@dxos/react-ui-theme";
|
|
2461
|
-
import { hexToFallback } from "@dxos/util";
|
|
2462
2312
|
var IdentityAdded = (props) => {
|
|
2463
2313
|
const { mode, addedIdentity, active, send, onDone, doneActionParent } = props;
|
|
2464
2314
|
const disabled = !active;
|
|
2465
|
-
const { t } =
|
|
2466
|
-
const
|
|
2467
|
-
const fallbackValue = hexToFallback(addedIdentityHex);
|
|
2315
|
+
const { t } = useTranslation16("os");
|
|
2316
|
+
const fallbackValue = addedIdentity?.identityKey.toHex();
|
|
2468
2317
|
const labelId = useId6("identityListItem__label");
|
|
2469
|
-
const
|
|
2470
|
-
const
|
|
2318
|
+
const jdenticon = useJdenticonHref4(fallbackValue ?? "", 12);
|
|
2319
|
+
const displayName = addedIdentity?.profile?.displayName ?? (addedIdentity && generateName4(addedIdentity?.identityKey.toHex()));
|
|
2320
|
+
const doneAction = /* @__PURE__ */ React30.createElement(Action, {
|
|
2471
2321
|
...onDone && {
|
|
2472
2322
|
onClick: () => onDone(null)
|
|
2473
2323
|
},
|
|
2474
2324
|
disabled,
|
|
2475
2325
|
"data-autofocus": "confirmingAddedIdentity",
|
|
2476
2326
|
"data-testid": "identity-added-done"
|
|
2477
|
-
}, /* @__PURE__ */
|
|
2478
|
-
return /* @__PURE__ */
|
|
2327
|
+
}, /* @__PURE__ */ React30.createElement("span", null, t("done label")));
|
|
2328
|
+
return /* @__PURE__ */ React30.createElement(React30.Fragment, null, /* @__PURE__ */ React30.createElement(StepHeading, null, t("identity added label")), /* @__PURE__ */ React30.createElement("div", {
|
|
2479
2329
|
role: "none",
|
|
2480
2330
|
className: "grow flex flex-col items-center justify-center text-center gap-2"
|
|
2481
|
-
}, /* @__PURE__ */
|
|
2331
|
+
}, /* @__PURE__ */ React30.createElement(Avatar5.Root, {
|
|
2482
2332
|
status: "active",
|
|
2483
|
-
labelId
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
})), /* @__PURE__ */ React32.createElement(Avatar5.Label, {
|
|
2333
|
+
labelId
|
|
2334
|
+
}, /* @__PURE__ */ React30.createElement(Avatar5.Frame, null, /* @__PURE__ */ React30.createElement(Avatar5.Fallback, {
|
|
2335
|
+
href: jdenticon
|
|
2336
|
+
})), /* @__PURE__ */ React30.createElement(Avatar5.Label, {
|
|
2488
2337
|
classNames: mx21("text-lg truncate", !addedIdentity?.profile?.displayName && "font-mono")
|
|
2489
|
-
}, displayName))), /* @__PURE__ */
|
|
2338
|
+
}, displayName))), /* @__PURE__ */ React30.createElement(Actions, null, mode === "halo-only" ? doneActionParent ? /* @__PURE__ */ cloneElement2(doneActionParent, {}, doneAction) : doneAction : /* @__PURE__ */ React30.createElement(Action, {
|
|
2490
2339
|
variant: "primary",
|
|
2491
2340
|
disabled: disabled || !addedIdentity,
|
|
2492
2341
|
onClick: () => addedIdentity && send({
|
|
@@ -2498,17 +2347,17 @@ var IdentityAdded = (props) => {
|
|
|
2498
2347
|
};
|
|
2499
2348
|
|
|
2500
2349
|
// packages/sdk/shell/src/panels/JoinPanel/steps/IdentityInput.tsx
|
|
2501
|
-
import
|
|
2350
|
+
import React31, { useState as useState5 } from "react";
|
|
2502
2351
|
import { log as log5 } from "@dxos/log";
|
|
2503
2352
|
import { useClient as useClient4 } from "@dxos/react-client";
|
|
2504
|
-
import { useTranslation as
|
|
2353
|
+
import { useTranslation as useTranslation17 } from "@dxos/react-ui";
|
|
2505
2354
|
var __dxlog_file6 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/JoinPanel/steps/IdentityInput.tsx";
|
|
2506
2355
|
var IdentityInput = (props) => {
|
|
2507
2356
|
const { send, method } = props;
|
|
2508
2357
|
const isRecover = method === "recover identity";
|
|
2509
2358
|
const client = useClient4();
|
|
2510
|
-
const { t } =
|
|
2511
|
-
const [validationMessage, setValidationMessage] =
|
|
2359
|
+
const { t } = useTranslation17("os");
|
|
2360
|
+
const [validationMessage, setValidationMessage] = useState5("");
|
|
2512
2361
|
const createIdentity = (displayName) => {
|
|
2513
2362
|
void client.halo.createIdentity({
|
|
2514
2363
|
[isRecover ? "seedphrase" : "displayName"]: displayName
|
|
@@ -2527,7 +2376,7 @@ var IdentityInput = (props) => {
|
|
|
2527
2376
|
setValidationMessage(t(isRecover ? "failed to recover identity message" : "failed to create identity message"));
|
|
2528
2377
|
});
|
|
2529
2378
|
};
|
|
2530
|
-
return /* @__PURE__ */
|
|
2379
|
+
return /* @__PURE__ */ React31.createElement(IdentityInputImpl, {
|
|
2531
2380
|
...props,
|
|
2532
2381
|
onDisplayNameConfirm: createIdentity,
|
|
2533
2382
|
validationMessage
|
|
@@ -2536,27 +2385,27 @@ var IdentityInput = (props) => {
|
|
|
2536
2385
|
var IdentityInputImpl = (props) => {
|
|
2537
2386
|
const { method, send, active, onDisplayNameConfirm, validationMessage } = props;
|
|
2538
2387
|
const disabled = !active;
|
|
2539
|
-
const { t } =
|
|
2540
|
-
const [inputValue, setInputValue] =
|
|
2388
|
+
const { t } = useTranslation17("os");
|
|
2389
|
+
const [inputValue, setInputValue] = useState5("");
|
|
2541
2390
|
const isRecover = method === "recover identity";
|
|
2542
|
-
return /* @__PURE__ */
|
|
2391
|
+
return /* @__PURE__ */ React31.createElement(React31.Fragment, null, /* @__PURE__ */ React31.createElement("div", {
|
|
2543
2392
|
role: "none",
|
|
2544
2393
|
className: "grow flex flex-col justify-center"
|
|
2545
|
-
}, /* @__PURE__ */
|
|
2394
|
+
}, /* @__PURE__ */ React31.createElement(Input, {
|
|
2546
2395
|
validationMessage,
|
|
2547
|
-
label: /* @__PURE__ */
|
|
2396
|
+
label: /* @__PURE__ */ React31.createElement(StepHeading, null, t(isRecover ? "recover identity input label" : "new identity input label")),
|
|
2548
2397
|
disabled,
|
|
2549
2398
|
"data-testid": "identity-input",
|
|
2550
2399
|
placeholder: isRecover ? "Type your recovery phrase" : "Type a display name",
|
|
2551
2400
|
onChange: ({ target: { value } }) => setInputValue(value)
|
|
2552
|
-
})), /* @__PURE__ */
|
|
2401
|
+
})), /* @__PURE__ */ React31.createElement(Actions, null, /* @__PURE__ */ React31.createElement(Action, {
|
|
2553
2402
|
variant: "ghost",
|
|
2554
2403
|
disabled,
|
|
2555
2404
|
onClick: () => send?.({
|
|
2556
2405
|
type: "deselectAuthMethod"
|
|
2557
2406
|
}),
|
|
2558
2407
|
"data-testid": `${method === "recover identity" ? "recover" : "create"}-identity-input-back`
|
|
2559
|
-
}, t("back label")), /* @__PURE__ */
|
|
2408
|
+
}, t("back label")), /* @__PURE__ */ React31.createElement(Action, {
|
|
2560
2409
|
variant: "primary",
|
|
2561
2410
|
disabled,
|
|
2562
2411
|
onClick: () => onDisplayNameConfirm?.(inputValue),
|
|
@@ -2565,31 +2414,31 @@ var IdentityInputImpl = (props) => {
|
|
|
2565
2414
|
};
|
|
2566
2415
|
|
|
2567
2416
|
// packages/sdk/shell/src/panels/JoinPanel/steps/InvitationAccepted.tsx
|
|
2568
|
-
import
|
|
2569
|
-
import { useTranslation as
|
|
2417
|
+
import React32, { cloneElement as cloneElement3 } from "react";
|
|
2418
|
+
import { useTranslation as useTranslation18 } from "@dxos/react-ui";
|
|
2570
2419
|
var InvitationAccepted = (props) => {
|
|
2571
2420
|
const { active, Kind, doneActionParent, onDone } = props;
|
|
2572
2421
|
const disabled = !active;
|
|
2573
|
-
const { t } =
|
|
2574
|
-
const doneAction = /* @__PURE__ */
|
|
2422
|
+
const { t } = useTranslation18("os");
|
|
2423
|
+
const doneAction = /* @__PURE__ */ React32.createElement(Action, {
|
|
2575
2424
|
variant: "primary",
|
|
2576
2425
|
onClick: onDone,
|
|
2577
2426
|
disabled,
|
|
2578
2427
|
"data-autofocus": `success${Kind}Invitation finishingJoining${Kind}`,
|
|
2579
2428
|
"data-testid": `${Kind.toLowerCase()}-invitation-accepted-done`
|
|
2580
2429
|
}, t("done label"));
|
|
2581
|
-
return /* @__PURE__ */
|
|
2430
|
+
return /* @__PURE__ */ React32.createElement(React32.Fragment, null, /* @__PURE__ */ React32.createElement("div", {
|
|
2582
2431
|
role: "none",
|
|
2583
2432
|
className: "grow flex flex-col justify-center"
|
|
2584
|
-
}, /* @__PURE__ */
|
|
2433
|
+
}, /* @__PURE__ */ React32.createElement("p", {
|
|
2585
2434
|
className: "text-center text-sm font-normal"
|
|
2586
|
-
}, t("welcome message"))), /* @__PURE__ */
|
|
2435
|
+
}, t("welcome message"))), /* @__PURE__ */ React32.createElement(Actions, null, doneActionParent ? /* @__PURE__ */ cloneElement3(doneActionParent, {}, doneAction) : doneAction));
|
|
2587
2436
|
};
|
|
2588
2437
|
|
|
2589
2438
|
// packages/sdk/shell/src/panels/JoinPanel/steps/InvitationInput.tsx
|
|
2590
|
-
import
|
|
2439
|
+
import React33, { useState as useState6, useEffect as useEffect4, cloneElement as cloneElement4 } from "react";
|
|
2591
2440
|
import { log as log6 } from "@dxos/log";
|
|
2592
|
-
import { useTranslation as
|
|
2441
|
+
import { useTranslation as useTranslation19 } from "@dxos/react-ui";
|
|
2593
2442
|
var __dxlog_file7 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/JoinPanel/steps/InvitationInput.tsx";
|
|
2594
2443
|
var invitationCodeFromUrl = (text) => {
|
|
2595
2444
|
try {
|
|
@@ -2609,8 +2458,8 @@ var invitationCodeFromUrl = (text) => {
|
|
|
2609
2458
|
var InvitationInput = (props) => {
|
|
2610
2459
|
const { Kind, active, send, unredeemedCode, onExit, exitActionParent, onDone, doneActionParent, succeededKeys } = props;
|
|
2611
2460
|
const disabled = !active;
|
|
2612
|
-
const { t } =
|
|
2613
|
-
const [inputValue, setInputValue] =
|
|
2461
|
+
const { t } = useTranslation19("os");
|
|
2462
|
+
const [inputValue, setInputValue] = useState6(unredeemedCode ?? "");
|
|
2614
2463
|
useEffect4(() => {
|
|
2615
2464
|
unredeemedCode && setInputValue(unredeemedCode ?? "");
|
|
2616
2465
|
}, [
|
|
@@ -2628,7 +2477,7 @@ var InvitationInput = (props) => {
|
|
|
2628
2477
|
}
|
|
2629
2478
|
});
|
|
2630
2479
|
};
|
|
2631
|
-
const exitAction = /* @__PURE__ */
|
|
2480
|
+
const exitAction = /* @__PURE__ */ React33.createElement(Action, {
|
|
2632
2481
|
variant: "ghost",
|
|
2633
2482
|
disabled,
|
|
2634
2483
|
...onExit ? {
|
|
@@ -2638,11 +2487,11 @@ var InvitationInput = (props) => {
|
|
|
2638
2487
|
},
|
|
2639
2488
|
"data-testid": "join-exit"
|
|
2640
2489
|
}, t("cancel label"));
|
|
2641
|
-
return /* @__PURE__ */
|
|
2490
|
+
return /* @__PURE__ */ React33.createElement(React33.Fragment, null, /* @__PURE__ */ React33.createElement("div", {
|
|
2642
2491
|
role: "none",
|
|
2643
2492
|
className: "grow flex flex-col justify-center"
|
|
2644
|
-
}, /* @__PURE__ */
|
|
2645
|
-
label: /* @__PURE__ */
|
|
2493
|
+
}, /* @__PURE__ */ React33.createElement(Input, {
|
|
2494
|
+
label: /* @__PURE__ */ React33.createElement(StepHeading, null, t("invitation input label")),
|
|
2646
2495
|
// TODO(burdon): Translation.
|
|
2647
2496
|
placeholder: "Type an invitation code",
|
|
2648
2497
|
disabled,
|
|
@@ -2651,14 +2500,14 @@ var InvitationInput = (props) => {
|
|
|
2651
2500
|
"data-autofocus": `inputting${Kind}InvitationCode`,
|
|
2652
2501
|
"data-testid": `${Kind.toLowerCase()}-invitation-input`,
|
|
2653
2502
|
onKeyUp: ({ key }) => key === "Enter" && handleNext()
|
|
2654
|
-
})), /* @__PURE__ */
|
|
2503
|
+
})), /* @__PURE__ */ React33.createElement(Actions, null, Kind === "Halo" ? /* @__PURE__ */ React33.createElement(Action, {
|
|
2655
2504
|
variant: "ghost",
|
|
2656
2505
|
disabled,
|
|
2657
2506
|
onClick: () => send({
|
|
2658
2507
|
type: "deselectAuthMethod"
|
|
2659
2508
|
}),
|
|
2660
2509
|
"data-testid": `${Kind.toLowerCase()}-invitation-input-back`
|
|
2661
|
-
}, t("back label")) : exitActionParent ? /* @__PURE__ */ cloneElement4(exitActionParent, {}, exitAction) : doneActionParent ? /* @__PURE__ */ cloneElement4(doneActionParent, {}, exitAction) : exitAction, /* @__PURE__ */
|
|
2510
|
+
}, t("back label")) : exitActionParent ? /* @__PURE__ */ cloneElement4(exitActionParent, {}, exitAction) : doneActionParent ? /* @__PURE__ */ cloneElement4(doneActionParent, {}, exitAction) : exitAction, /* @__PURE__ */ React33.createElement(Action, {
|
|
2662
2511
|
variant: "primary",
|
|
2663
2512
|
disabled,
|
|
2664
2513
|
onClick: handleNext,
|
|
@@ -2667,8 +2516,8 @@ var InvitationInput = (props) => {
|
|
|
2667
2516
|
};
|
|
2668
2517
|
|
|
2669
2518
|
// packages/sdk/shell/src/panels/JoinPanel/steps/InvitationRescuer.tsx
|
|
2670
|
-
import
|
|
2671
|
-
import { useTranslation as
|
|
2519
|
+
import React34 from "react";
|
|
2520
|
+
import { useTranslation as useTranslation20 } from "@dxos/react-ui";
|
|
2672
2521
|
import { descriptionText as descriptionText9 } from "@dxos/react-ui-theme";
|
|
2673
2522
|
var InvitationActions = ({
|
|
2674
2523
|
// `invitationState` does report correct state, but here we evaluate whether `failReason` is a better source of truth
|
|
@@ -2680,14 +2529,14 @@ var InvitationActions = ({
|
|
|
2680
2529
|
Kind,
|
|
2681
2530
|
failReason
|
|
2682
2531
|
}) => {
|
|
2683
|
-
const { t } =
|
|
2532
|
+
const { t } = useTranslation20("os");
|
|
2684
2533
|
if (failReason) {
|
|
2685
|
-
return /* @__PURE__ */
|
|
2534
|
+
return /* @__PURE__ */ React34.createElement(React34.Fragment, null, /* @__PURE__ */ React34.createElement(StepHeading, {
|
|
2686
2535
|
className: descriptionText9
|
|
2687
|
-
}, t(failReason === "timeout" ? "timeout status label" : failReason === "cancelled" ? "cancelled status label" : "error status label")), /* @__PURE__ */
|
|
2536
|
+
}, t(failReason === "timeout" ? "timeout status label" : failReason === "cancelled" ? "cancelled status label" : "error status label")), /* @__PURE__ */ React34.createElement("div", {
|
|
2688
2537
|
role: "none",
|
|
2689
2538
|
className: "grow"
|
|
2690
|
-
}), /* @__PURE__ */
|
|
2539
|
+
}), /* @__PURE__ */ React34.createElement(Actions, null, /* @__PURE__ */ React34.createElement(Action, {
|
|
2691
2540
|
disabled: !active,
|
|
2692
2541
|
onClick: () => send({
|
|
2693
2542
|
type: `reset${Kind}Invitation`
|
|
@@ -2695,16 +2544,16 @@ var InvitationActions = ({
|
|
|
2695
2544
|
"data-testid": "invitation-rescuer-reset"
|
|
2696
2545
|
}, t("reset label"))));
|
|
2697
2546
|
} else {
|
|
2698
|
-
return /* @__PURE__ */
|
|
2547
|
+
return /* @__PURE__ */ React34.createElement(React34.Fragment, null, /* @__PURE__ */ React34.createElement(StepHeading, {
|
|
2699
2548
|
className: descriptionText9
|
|
2700
|
-
}, t("connecting status label")), /* @__PURE__ */
|
|
2549
|
+
}, t("connecting status label")), /* @__PURE__ */ React34.createElement("div", {
|
|
2701
2550
|
role: "none",
|
|
2702
2551
|
className: "grow"
|
|
2703
|
-
}), /* @__PURE__ */
|
|
2552
|
+
}), /* @__PURE__ */ React34.createElement(Actions, null, /* @__PURE__ */ React34.createElement(Action, {
|
|
2704
2553
|
disabled: true,
|
|
2705
2554
|
classNames: "order-2",
|
|
2706
2555
|
"data-testid": "next"
|
|
2707
|
-
}, t("next label")), /* @__PURE__ */
|
|
2556
|
+
}, t("next label")), /* @__PURE__ */ React34.createElement(Action, {
|
|
2708
2557
|
disabled: !active,
|
|
2709
2558
|
onClick: onInvitationCancel,
|
|
2710
2559
|
"data-testid": "invitation-rescuer-cancel"
|
|
@@ -2713,47 +2562,46 @@ var InvitationActions = ({
|
|
|
2713
2562
|
};
|
|
2714
2563
|
var InvitationRescuer = (props) => {
|
|
2715
2564
|
const { Kind, invitationState, active, send } = props;
|
|
2716
|
-
const { t } =
|
|
2717
|
-
return /* @__PURE__ */
|
|
2565
|
+
const { t } = useTranslation20("os");
|
|
2566
|
+
return /* @__PURE__ */ React34.createElement(React34.Fragment, null, typeof invitationState === "undefined" ? /* @__PURE__ */ React34.createElement(React34.Fragment, null, /* @__PURE__ */ React34.createElement("div", {
|
|
2718
2567
|
role: "none",
|
|
2719
2568
|
className: "grow flex flex-col justify-center"
|
|
2720
|
-
}, /* @__PURE__ */
|
|
2569
|
+
}, /* @__PURE__ */ React34.createElement(StepHeading, {
|
|
2721
2570
|
className: descriptionText9
|
|
2722
|
-
}, "There was a problem joining the space")), /* @__PURE__ */
|
|
2571
|
+
}, "There was a problem joining the space")), /* @__PURE__ */ React34.createElement(Actions, null, /* @__PURE__ */ React34.createElement(Action, {
|
|
2723
2572
|
disabled: !active,
|
|
2724
2573
|
"data-testid": "invitation-rescuer-blank-reset",
|
|
2725
2574
|
onClick: () => send({
|
|
2726
2575
|
type: `reset${Kind}Invitation`
|
|
2727
2576
|
})
|
|
2728
|
-
}, t("reset label")))) : /* @__PURE__ */
|
|
2577
|
+
}, t("reset label")))) : /* @__PURE__ */ React34.createElement(InvitationActions, props));
|
|
2729
2578
|
};
|
|
2730
2579
|
|
|
2731
2580
|
// packages/sdk/shell/src/panels/JoinPanel/steps/InvitationAuthenticator.tsx
|
|
2732
|
-
import
|
|
2733
|
-
import { Input as Input2, useTranslation as
|
|
2734
|
-
import { hexToEmoji as hexToEmoji4 } from "@dxos/util";
|
|
2581
|
+
import React35, { useState as useState7 } from "react";
|
|
2582
|
+
import { Input as Input2, useTranslation as useTranslation21 } from "@dxos/react-ui";
|
|
2735
2583
|
var pinLength = 6;
|
|
2736
2584
|
var InvitationAuthenticator = ({ failed, Kind, active, pending, invitationId, onInvitationAuthenticate, onInvitationCancel }) => {
|
|
2737
2585
|
const disabled = !active || pending;
|
|
2738
|
-
const { t } =
|
|
2586
|
+
const { t } = useTranslation21("os");
|
|
2739
2587
|
const invitationType = Kind.toLowerCase();
|
|
2740
|
-
const [authCode, setAuthCode] =
|
|
2588
|
+
const [authCode, setAuthCode] = useState7("");
|
|
2741
2589
|
const onChange = ({ target: { value } }) => {
|
|
2742
2590
|
setAuthCode(value);
|
|
2743
2591
|
if (value.length === pinLength) {
|
|
2744
2592
|
document.querySelector(`[data-autofocus-pinlength="${invitationType}"]`)?.focus();
|
|
2745
2593
|
}
|
|
2746
2594
|
};
|
|
2747
|
-
return /* @__PURE__ */
|
|
2595
|
+
return /* @__PURE__ */ React35.createElement(React35.Fragment, null, /* @__PURE__ */ React35.createElement("div", {
|
|
2748
2596
|
role: "none",
|
|
2749
2597
|
className: "grow flex flex-col justify-center"
|
|
2750
|
-
}, invitationId && /* @__PURE__ */
|
|
2751
|
-
text:
|
|
2752
|
-
}), /* @__PURE__ */
|
|
2598
|
+
}, invitationId && /* @__PURE__ */ React35.createElement(Emoji, {
|
|
2599
|
+
text: toEmoji(invitationId)
|
|
2600
|
+
}), /* @__PURE__ */ React35.createElement(Input2.Root, failed && {
|
|
2753
2601
|
validationValence: "error"
|
|
2754
|
-
}, /* @__PURE__ */
|
|
2602
|
+
}, /* @__PURE__ */ React35.createElement(Input2.Label, {
|
|
2755
2603
|
asChild: true
|
|
2756
|
-
}, /* @__PURE__ */
|
|
2604
|
+
}, /* @__PURE__ */ React35.createElement(StepHeading, null, t("auth code input label"))), /* @__PURE__ */ React35.createElement(Input2.PinInput, {
|
|
2757
2605
|
disabled,
|
|
2758
2606
|
length: pinLength,
|
|
2759
2607
|
onChange,
|
|
@@ -2764,14 +2612,14 @@ var InvitationAuthenticator = ({ failed, Kind, active, pending, invitationId, on
|
|
|
2764
2612
|
"data-prevent-ios-autofocus": true,
|
|
2765
2613
|
"data-testid": `${invitationType}-auth-code-input`,
|
|
2766
2614
|
"data-1p-ignore": true
|
|
2767
|
-
}), failed && /* @__PURE__ */
|
|
2615
|
+
}), failed && /* @__PURE__ */ React35.createElement(Input2.DescriptionAndValidation, {
|
|
2768
2616
|
classNames: "text-center"
|
|
2769
|
-
}, /* @__PURE__ */
|
|
2617
|
+
}, /* @__PURE__ */ React35.createElement(Input2.Validation, null, t("failed to authenticate message"))))), /* @__PURE__ */ React35.createElement(Actions, null, /* @__PURE__ */ React35.createElement(Action, {
|
|
2770
2618
|
variant: "ghost",
|
|
2771
2619
|
disabled,
|
|
2772
2620
|
onClick: () => onInvitationCancel?.(),
|
|
2773
2621
|
"data-testid": `${invitationType}-invitation-authenticator-cancel`
|
|
2774
|
-
}, t("cancel label")), /* @__PURE__ */
|
|
2622
|
+
}, t("cancel label")), /* @__PURE__ */ React35.createElement(Action, {
|
|
2775
2623
|
variant: "primary",
|
|
2776
2624
|
disabled,
|
|
2777
2625
|
onClick: () => onInvitationAuthenticate?.(authCode),
|
|
@@ -2781,16 +2629,16 @@ var InvitationAuthenticator = ({ failed, Kind, active, pending, invitationId, on
|
|
|
2781
2629
|
};
|
|
2782
2630
|
|
|
2783
2631
|
// packages/sdk/shell/src/panels/JoinPanel/steps/ResetIdentity.tsx
|
|
2784
|
-
import
|
|
2632
|
+
import React36, { useState as useState8 } from "react";
|
|
2785
2633
|
import { log as log7 } from "@dxos/log";
|
|
2786
2634
|
import { useClient as useClient5 } from "@dxos/react-client";
|
|
2787
|
-
import { useTranslation as
|
|
2635
|
+
import { useTranslation as useTranslation22 } from "@dxos/react-ui";
|
|
2788
2636
|
var __dxlog_file8 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/JoinPanel/steps/ResetIdentity.tsx";
|
|
2789
2637
|
var ResetIdentity = ({ send, active }) => {
|
|
2790
2638
|
const client = useClient5();
|
|
2791
|
-
const { t } =
|
|
2792
|
-
const [validationMessage, setValidationMessage] =
|
|
2793
|
-
const [pending, setPending] =
|
|
2639
|
+
const { t } = useTranslation22("os");
|
|
2640
|
+
const [validationMessage, setValidationMessage] = useState8("");
|
|
2641
|
+
const [pending, setPending] = useState8(false);
|
|
2794
2642
|
const resetIdentity = () => {
|
|
2795
2643
|
setPending(true);
|
|
2796
2644
|
void client.reset().then(() => send?.({
|
|
@@ -2806,7 +2654,7 @@ var ResetIdentity = ({ send, active }) => {
|
|
|
2806
2654
|
setPending(false);
|
|
2807
2655
|
});
|
|
2808
2656
|
};
|
|
2809
|
-
return /* @__PURE__ */
|
|
2657
|
+
return /* @__PURE__ */ React36.createElement(ResetIdentityImpl, {
|
|
2810
2658
|
disabled: !active,
|
|
2811
2659
|
pending,
|
|
2812
2660
|
validationMessage,
|
|
@@ -2814,22 +2662,22 @@ var ResetIdentity = ({ send, active }) => {
|
|
|
2814
2662
|
});
|
|
2815
2663
|
};
|
|
2816
2664
|
var ResetIdentityImpl = ({ disabled, pending, validationMessage, onConfirm }) => {
|
|
2817
|
-
const { t } =
|
|
2665
|
+
const { t } = useTranslation22("os");
|
|
2818
2666
|
const confirmationValue = t("confirmation value");
|
|
2819
|
-
const [inputValue, setInputValue] =
|
|
2820
|
-
return /* @__PURE__ */
|
|
2667
|
+
const [inputValue, setInputValue] = useState8("");
|
|
2668
|
+
return /* @__PURE__ */ React36.createElement(React36.Fragment, null, /* @__PURE__ */ React36.createElement("div", {
|
|
2821
2669
|
role: "none",
|
|
2822
2670
|
className: "grow flex flex-col justify-center"
|
|
2823
|
-
}, /* @__PURE__ */
|
|
2671
|
+
}, /* @__PURE__ */ React36.createElement(Input, {
|
|
2824
2672
|
validationMessage,
|
|
2825
|
-
label: /* @__PURE__ */
|
|
2673
|
+
label: /* @__PURE__ */ React36.createElement(StepHeading, null, t("reset identity input label", {
|
|
2826
2674
|
confirmationValue
|
|
2827
2675
|
})),
|
|
2828
2676
|
disabled,
|
|
2829
2677
|
"data-testid": "reset-identity-input",
|
|
2830
2678
|
placeholder: confirmationValue,
|
|
2831
2679
|
onChange: ({ target: { value } }) => setInputValue(value)
|
|
2832
|
-
})), /* @__PURE__ */
|
|
2680
|
+
})), /* @__PURE__ */ React36.createElement(Actions, null, /* @__PURE__ */ React36.createElement(Action, {
|
|
2833
2681
|
// TODO(wittjosiah): Probably make this red?
|
|
2834
2682
|
variant: "primary",
|
|
2835
2683
|
disabled: disabled || pending || inputValue !== confirmationValue,
|
|
@@ -2866,47 +2714,47 @@ var resolvedTextColor = (status) => status === Invitation7.State.ERROR ? errorTe
|
|
|
2866
2714
|
var __dxlog_file9 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/JoinPanel/JoinPanel.tsx";
|
|
2867
2715
|
var JoinPanelImpl = (props) => {
|
|
2868
2716
|
const { titleId, send, activeView, failed, mode, unredeemedCodes, invitationStates, succeededKeys, failReasons, onExit, onHaloDone, onSpaceDone, exitActionParent, doneActionParent, onHaloInvitationCancel, onSpaceInvitationCancel, onHaloInvitationAuthenticate, onSpaceInvitationAuthenticate, IdentityInput: IdentityInputComponent = IdentityInput, ResetIdentity: ResetIdentityComponent = ResetIdentity } = props;
|
|
2869
|
-
return /* @__PURE__ */
|
|
2717
|
+
return /* @__PURE__ */ React37.createElement(DensityProvider3, {
|
|
2870
2718
|
density: "fine"
|
|
2871
|
-
}, mode !== "halo-only" && /* @__PURE__ */
|
|
2719
|
+
}, mode !== "halo-only" && /* @__PURE__ */ React37.createElement(JoinHeading, {
|
|
2872
2720
|
titleId,
|
|
2873
2721
|
mode,
|
|
2874
2722
|
onExit,
|
|
2875
2723
|
exitActionParent
|
|
2876
|
-
}), /* @__PURE__ */
|
|
2724
|
+
}), /* @__PURE__ */ React37.createElement(Viewport.Root, {
|
|
2877
2725
|
focusManaged: true,
|
|
2878
2726
|
activeView
|
|
2879
|
-
}, /* @__PURE__ */
|
|
2727
|
+
}, /* @__PURE__ */ React37.createElement(Viewport.Views, null, /* @__PURE__ */ React37.createElement(Viewport.View, {
|
|
2880
2728
|
classNames: stepStyles,
|
|
2881
2729
|
id: "addition method chooser"
|
|
2882
|
-
}, /* @__PURE__ */
|
|
2730
|
+
}, /* @__PURE__ */ React37.createElement(AdditionMethodChooser, {
|
|
2883
2731
|
send,
|
|
2884
2732
|
active: activeView === "addition method chooser"
|
|
2885
|
-
})), /* @__PURE__ */
|
|
2733
|
+
})), /* @__PURE__ */ React37.createElement(Viewport.View, {
|
|
2886
2734
|
classNames: stepStyles,
|
|
2887
2735
|
id: "reset identity confirmation"
|
|
2888
|
-
}, /* @__PURE__ */
|
|
2736
|
+
}, /* @__PURE__ */ React37.createElement(ResetIdentityComponent, {
|
|
2889
2737
|
send,
|
|
2890
2738
|
method: "reset identity",
|
|
2891
2739
|
active: activeView === "reset identity confirmation"
|
|
2892
|
-
})), /* @__PURE__ */
|
|
2740
|
+
})), /* @__PURE__ */ React37.createElement(Viewport.View, {
|
|
2893
2741
|
classNames: stepStyles,
|
|
2894
2742
|
id: "create identity input"
|
|
2895
|
-
}, /* @__PURE__ */
|
|
2743
|
+
}, /* @__PURE__ */ React37.createElement(IdentityInputComponent, {
|
|
2896
2744
|
send,
|
|
2897
2745
|
method: "create identity",
|
|
2898
2746
|
active: activeView === "create identity input"
|
|
2899
|
-
})), /* @__PURE__ */
|
|
2747
|
+
})), /* @__PURE__ */ React37.createElement(Viewport.View, {
|
|
2900
2748
|
classNames: stepStyles,
|
|
2901
2749
|
id: "recover identity input"
|
|
2902
|
-
}, /* @__PURE__ */
|
|
2750
|
+
}, /* @__PURE__ */ React37.createElement(IdentityInputComponent, {
|
|
2903
2751
|
send,
|
|
2904
2752
|
method: "recover identity",
|
|
2905
2753
|
active: activeView === "recover identity input"
|
|
2906
|
-
})), /* @__PURE__ */
|
|
2754
|
+
})), /* @__PURE__ */ React37.createElement(Viewport.View, {
|
|
2907
2755
|
classNames: stepStyles,
|
|
2908
2756
|
id: "halo invitation input"
|
|
2909
|
-
}, /* @__PURE__ */
|
|
2757
|
+
}, /* @__PURE__ */ React37.createElement(InvitationInput, {
|
|
2910
2758
|
send,
|
|
2911
2759
|
Kind: "Halo",
|
|
2912
2760
|
active: activeView === "halo invitation input",
|
|
@@ -2916,20 +2764,20 @@ var JoinPanelImpl = (props) => {
|
|
|
2916
2764
|
...succeededKeys?.Halo && {
|
|
2917
2765
|
succeededKeys: succeededKeys.Halo
|
|
2918
2766
|
}
|
|
2919
|
-
})), /* @__PURE__ */
|
|
2767
|
+
})), /* @__PURE__ */ React37.createElement(Viewport.View, {
|
|
2920
2768
|
classNames: stepStyles,
|
|
2921
2769
|
id: "halo invitation rescuer"
|
|
2922
|
-
}, /* @__PURE__ */
|
|
2770
|
+
}, /* @__PURE__ */ React37.createElement(InvitationRescuer, {
|
|
2923
2771
|
send,
|
|
2924
2772
|
Kind: "Halo",
|
|
2925
2773
|
active: activeView === "halo invitation rescuer",
|
|
2926
2774
|
invitationState: invitationStates?.Halo,
|
|
2927
2775
|
onInvitationCancel: onHaloInvitationCancel,
|
|
2928
2776
|
failReason: failReasons?.Halo
|
|
2929
|
-
})), /* @__PURE__ */
|
|
2777
|
+
})), /* @__PURE__ */ React37.createElement(Viewport.View, {
|
|
2930
2778
|
classNames: stepStyles,
|
|
2931
2779
|
id: "halo invitation authenticator"
|
|
2932
|
-
}, /* @__PURE__ */
|
|
2780
|
+
}, /* @__PURE__ */ React37.createElement(InvitationAuthenticator, {
|
|
2933
2781
|
send,
|
|
2934
2782
|
Kind: "Halo",
|
|
2935
2783
|
active: activeView === "halo invitation authenticator",
|
|
@@ -2938,28 +2786,28 @@ var JoinPanelImpl = (props) => {
|
|
|
2938
2786
|
...failed.has("Halo") && {
|
|
2939
2787
|
failed: true
|
|
2940
2788
|
}
|
|
2941
|
-
})), /* @__PURE__ */
|
|
2789
|
+
})), /* @__PURE__ */ React37.createElement(Viewport.View, {
|
|
2942
2790
|
classNames: stepStyles,
|
|
2943
2791
|
id: "halo invitation accepted"
|
|
2944
|
-
}, /* @__PURE__ */
|
|
2792
|
+
}, /* @__PURE__ */ React37.createElement(InvitationAccepted, {
|
|
2945
2793
|
send,
|
|
2946
2794
|
Kind: "Halo",
|
|
2947
2795
|
active: activeView === "halo invitation accepted",
|
|
2948
2796
|
doneActionParent,
|
|
2949
2797
|
onDone: onHaloDone
|
|
2950
|
-
})), /* @__PURE__ */
|
|
2798
|
+
})), /* @__PURE__ */ React37.createElement(Viewport.View, {
|
|
2951
2799
|
classNames: stepStyles,
|
|
2952
2800
|
id: "identity added"
|
|
2953
|
-
}, /* @__PURE__ */
|
|
2801
|
+
}, /* @__PURE__ */ React37.createElement(IdentityAdded, {
|
|
2954
2802
|
send,
|
|
2955
2803
|
mode,
|
|
2956
2804
|
active: activeView === "identity added",
|
|
2957
2805
|
doneActionParent,
|
|
2958
2806
|
onDone: onHaloDone
|
|
2959
|
-
})), /* @__PURE__ */
|
|
2807
|
+
})), /* @__PURE__ */ React37.createElement(Viewport.View, {
|
|
2960
2808
|
classNames: stepStyles,
|
|
2961
2809
|
id: "space invitation input"
|
|
2962
|
-
}, /* @__PURE__ */
|
|
2810
|
+
}, /* @__PURE__ */ React37.createElement(InvitationInput, {
|
|
2963
2811
|
send,
|
|
2964
2812
|
Kind: "Space",
|
|
2965
2813
|
active: activeView === "space invitation input",
|
|
@@ -2971,20 +2819,20 @@ var JoinPanelImpl = (props) => {
|
|
|
2971
2819
|
},
|
|
2972
2820
|
onExit,
|
|
2973
2821
|
exitActionParent
|
|
2974
|
-
})), /* @__PURE__ */
|
|
2822
|
+
})), /* @__PURE__ */ React37.createElement(Viewport.View, {
|
|
2975
2823
|
classNames: stepStyles,
|
|
2976
2824
|
id: "space invitation rescuer"
|
|
2977
|
-
}, /* @__PURE__ */
|
|
2825
|
+
}, /* @__PURE__ */ React37.createElement(InvitationRescuer, {
|
|
2978
2826
|
send,
|
|
2979
2827
|
Kind: "Space",
|
|
2980
2828
|
active: activeView === "space invitation rescuer",
|
|
2981
2829
|
invitationState: invitationStates?.Space,
|
|
2982
2830
|
onInvitationCancel: onSpaceInvitationCancel,
|
|
2983
2831
|
failReason: failReasons?.Space
|
|
2984
|
-
})), /* @__PURE__ */
|
|
2832
|
+
})), /* @__PURE__ */ React37.createElement(Viewport.View, {
|
|
2985
2833
|
classNames: stepStyles,
|
|
2986
2834
|
id: "space invitation authenticator"
|
|
2987
|
-
}, /* @__PURE__ */
|
|
2835
|
+
}, /* @__PURE__ */ React37.createElement(InvitationAuthenticator, {
|
|
2988
2836
|
send,
|
|
2989
2837
|
Kind: "Space",
|
|
2990
2838
|
active: activeView === "space invitation authenticator",
|
|
@@ -2993,10 +2841,10 @@ var JoinPanelImpl = (props) => {
|
|
|
2993
2841
|
...failed.has("Space") && {
|
|
2994
2842
|
failed: true
|
|
2995
2843
|
}
|
|
2996
|
-
})), /* @__PURE__ */
|
|
2844
|
+
})), /* @__PURE__ */ React37.createElement(Viewport.View, {
|
|
2997
2845
|
classNames: stepStyles,
|
|
2998
2846
|
id: "space invitation accepted"
|
|
2999
|
-
}, /* @__PURE__ */
|
|
2847
|
+
}, /* @__PURE__ */ React37.createElement(InvitationAccepted, {
|
|
3000
2848
|
send,
|
|
3001
2849
|
Kind: "Space",
|
|
3002
2850
|
active: activeView === "space invitation accepted",
|
|
@@ -3007,7 +2855,7 @@ var JoinPanelImpl = (props) => {
|
|
|
3007
2855
|
var JoinPanel = ({ titleId: propsTitleId, mode = "default", initialInvitationCode, exitActionParent, onExit, doneActionParent, onDone: propsOnDone }) => {
|
|
3008
2856
|
const client = useClient6();
|
|
3009
2857
|
const identity = useIdentity2();
|
|
3010
|
-
const { hasIosKeyboard } =
|
|
2858
|
+
const { hasIosKeyboard } = useThemeContext3();
|
|
3011
2859
|
const titleId = useId7("joinPanel__heading", propsTitleId);
|
|
3012
2860
|
const [joinState, joinSend, joinService] = useJoinMachine(client, {
|
|
3013
2861
|
context: {
|
|
@@ -3236,7 +3084,7 @@ var JoinPanel = ({ titleId: propsTitleId, mode = "default", initialInvitationCod
|
|
|
3236
3084
|
joinState,
|
|
3237
3085
|
propsOnDone
|
|
3238
3086
|
]);
|
|
3239
|
-
return /* @__PURE__ */
|
|
3087
|
+
return /* @__PURE__ */ React37.createElement(JoinPanelImpl, {
|
|
3240
3088
|
titleId,
|
|
3241
3089
|
mode,
|
|
3242
3090
|
send: joinSend,
|
|
@@ -3275,10 +3123,10 @@ var JoinPanel = ({ titleId: propsTitleId, mode = "default", initialInvitationCod
|
|
|
3275
3123
|
|
|
3276
3124
|
// packages/sdk/shell/src/panels/SpacePanel/SpacePanel.tsx
|
|
3277
3125
|
import { Planet } from "@phosphor-icons/react";
|
|
3278
|
-
import
|
|
3126
|
+
import React39, { useEffect as useEffect6, useMemo as useMemo5 } from "react";
|
|
3279
3127
|
import { log as log10 } from "@dxos/log";
|
|
3280
3128
|
import { useInvitationStatus as useInvitationStatus3 } from "@dxos/react-client/invitations";
|
|
3281
|
-
import { DensityProvider as DensityProvider4, useId as useId8, useTranslation as
|
|
3129
|
+
import { DensityProvider as DensityProvider4, useId as useId8, useTranslation as useTranslation24 } from "@dxos/react-ui";
|
|
3282
3130
|
|
|
3283
3131
|
// packages/sdk/shell/src/panels/SpacePanel/spaceMachine.ts
|
|
3284
3132
|
import { useMachine as useMachine3 } from "@xstate/react";
|
|
@@ -3344,16 +3192,16 @@ var useSpaceMachine = (options) => {
|
|
|
3344
3192
|
|
|
3345
3193
|
// packages/sdk/shell/src/panels/SpacePanel/steps/SpaceManager.tsx
|
|
3346
3194
|
import { Placeholder as Placeholder2, UserPlus, UsersThree } from "@phosphor-icons/react";
|
|
3347
|
-
import
|
|
3195
|
+
import React38, { useCallback as useCallback8, useState as useState9 } from "react";
|
|
3348
3196
|
import { useConfig } from "@dxos/react-client";
|
|
3349
3197
|
import { useSpaceInvitations as useSpaceInvitations2 } from "@dxos/react-client/echo";
|
|
3350
3198
|
import { Invitation as Invitation8, InvitationEncoder as InvitationEncoder4 } from "@dxos/react-client/invitations";
|
|
3351
|
-
import { ScrollArea, useTranslation as
|
|
3199
|
+
import { ScrollArea, useTranslation as useTranslation23 } from "@dxos/react-ui";
|
|
3352
3200
|
import { descriptionText as descriptionText10, mx as mx22 } from "@dxos/react-ui-theme";
|
|
3353
3201
|
var activeActionKey = "dxos:react-shell/space-manager/active-action";
|
|
3354
3202
|
var SpaceManager = (props) => {
|
|
3355
3203
|
const { space, target } = props;
|
|
3356
|
-
const { t } =
|
|
3204
|
+
const { t } = useTranslation23("os");
|
|
3357
3205
|
const config = useConfig();
|
|
3358
3206
|
const invitations = useSpaceInvitations2(space?.key);
|
|
3359
3207
|
const onInvitationEvent = useCallback8((invitation) => {
|
|
@@ -3401,7 +3249,7 @@ var SpaceManager = (props) => {
|
|
|
3401
3249
|
])
|
|
3402
3250
|
}
|
|
3403
3251
|
};
|
|
3404
|
-
return /* @__PURE__ */
|
|
3252
|
+
return /* @__PURE__ */ React38.createElement(SpaceManagerImpl, {
|
|
3405
3253
|
...props,
|
|
3406
3254
|
invitations,
|
|
3407
3255
|
inviteActions
|
|
@@ -3410,7 +3258,7 @@ var SpaceManager = (props) => {
|
|
|
3410
3258
|
var headingFragment = "pis-3 pie-1 plb-1 mbe-1 font-medium";
|
|
3411
3259
|
var SpaceManagerImpl = (props) => {
|
|
3412
3260
|
const { active, space, createInvitationUrl, send, inviteActions: propsInviteActions, invitations, showInactiveInvitations, SpaceMemberList: SpaceMemberListComponent = SpaceMemberList, InvitationList: InvitationListComponent = InvitationList } = props;
|
|
3413
|
-
const { t } =
|
|
3261
|
+
const { t } = useTranslation23("os");
|
|
3414
3262
|
const inviteActions = propsInviteActions ?? {
|
|
3415
3263
|
noopInvite: {
|
|
3416
3264
|
label: t("create space invitation label"),
|
|
@@ -3420,7 +3268,7 @@ var SpaceManagerImpl = (props) => {
|
|
|
3420
3268
|
}
|
|
3421
3269
|
}
|
|
3422
3270
|
};
|
|
3423
|
-
const [activeAction, setInternalActiveAction] =
|
|
3271
|
+
const [activeAction, setInternalActiveAction] = useState9(localStorage.getItem(activeActionKey) ?? "inviteOne");
|
|
3424
3272
|
const setActiveAction = (nextAction) => {
|
|
3425
3273
|
setInternalActiveAction(nextAction);
|
|
3426
3274
|
localStorage.setItem(activeActionKey, nextAction);
|
|
@@ -3428,26 +3276,26 @@ var SpaceManagerImpl = (props) => {
|
|
|
3428
3276
|
const visibleInvitations = showInactiveInvitations ? invitations : invitations?.filter((invitation) => ![
|
|
3429
3277
|
Invitation8.State.CANCELLED
|
|
3430
3278
|
].includes(invitation.get().state));
|
|
3431
|
-
return /* @__PURE__ */
|
|
3279
|
+
return /* @__PURE__ */ React38.createElement(React38.Fragment, null, /* @__PURE__ */ React38.createElement(ScrollArea.Root, {
|
|
3432
3280
|
classNames: "grow shrink basis-28 -mli-2"
|
|
3433
|
-
}, /* @__PURE__ */
|
|
3281
|
+
}, /* @__PURE__ */ React38.createElement(ScrollArea.Viewport, {
|
|
3434
3282
|
classNames: "is-full pie-2"
|
|
3435
|
-
}, !!visibleInvitations?.length && /* @__PURE__ */
|
|
3283
|
+
}, !!visibleInvitations?.length && /* @__PURE__ */ React38.createElement(React38.Fragment, null, /* @__PURE__ */ React38.createElement("h3", {
|
|
3436
3284
|
className: mx22(headingFragment, descriptionText10)
|
|
3437
|
-
}, t("invitation list heading")), /* @__PURE__ */
|
|
3285
|
+
}, t("invitation list heading")), /* @__PURE__ */ React38.createElement(InvitationListComponent, {
|
|
3438
3286
|
className: "mb-2",
|
|
3439
3287
|
send,
|
|
3440
3288
|
invitations: visibleInvitations ?? [],
|
|
3441
3289
|
onClickRemove: (invitation) => invitation.cancel(),
|
|
3442
3290
|
createInvitationUrl
|
|
3443
|
-
}), /* @__PURE__ */
|
|
3291
|
+
}), /* @__PURE__ */ React38.createElement("h3", {
|
|
3444
3292
|
className: mx22(headingFragment, descriptionText10, "mbs-2")
|
|
3445
|
-
}, t("space member list heading"))), /* @__PURE__ */
|
|
3293
|
+
}, t("space member list heading"))), /* @__PURE__ */ React38.createElement(SpaceMemberListComponent, {
|
|
3446
3294
|
spaceKey: space.key,
|
|
3447
3295
|
includeSelf: true
|
|
3448
|
-
})), /* @__PURE__ */
|
|
3296
|
+
})), /* @__PURE__ */ React38.createElement(ScrollArea.Scrollbar, {
|
|
3449
3297
|
orientation: "vertical"
|
|
3450
|
-
}, /* @__PURE__ */
|
|
3298
|
+
}, /* @__PURE__ */ React38.createElement(ScrollArea.Thumb, null))), /* @__PURE__ */ React38.createElement(Actions, null, /* @__PURE__ */ React38.createElement(BifurcatedAction, {
|
|
3451
3299
|
disabled: !active,
|
|
3452
3300
|
actions: inviteActions,
|
|
3453
3301
|
activeAction,
|
|
@@ -3459,47 +3307,47 @@ var SpaceManagerImpl = (props) => {
|
|
|
3459
3307
|
// packages/sdk/shell/src/panels/SpacePanel/SpacePanel.tsx
|
|
3460
3308
|
var __dxlog_file11 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/SpacePanel/SpacePanel.tsx";
|
|
3461
3309
|
var SpacePanelHeading = ({ titleId, space, onDone }) => {
|
|
3462
|
-
const { t } =
|
|
3310
|
+
const { t } = useTranslation24("os");
|
|
3463
3311
|
const name = space.properties.name;
|
|
3464
|
-
return /* @__PURE__ */
|
|
3312
|
+
return /* @__PURE__ */ React39.createElement(Heading, {
|
|
3465
3313
|
titleId,
|
|
3466
3314
|
title: t("space panel heading"),
|
|
3467
|
-
corner: /* @__PURE__ */
|
|
3315
|
+
corner: /* @__PURE__ */ React39.createElement(CloseButton, {
|
|
3468
3316
|
"data-testid": "identity-panel-done",
|
|
3469
3317
|
onDone
|
|
3470
3318
|
})
|
|
3471
|
-
}, /* @__PURE__ */
|
|
3319
|
+
}, /* @__PURE__ */ React39.createElement("div", {
|
|
3472
3320
|
role: "none",
|
|
3473
3321
|
className: "flex gap-4 items-center justify-center mlb-4"
|
|
3474
|
-
}, /* @__PURE__ */
|
|
3322
|
+
}, /* @__PURE__ */ React39.createElement(Planet, {
|
|
3475
3323
|
size: 32,
|
|
3476
3324
|
weight: "light"
|
|
3477
|
-
}), /* @__PURE__ */
|
|
3325
|
+
}), /* @__PURE__ */ React39.createElement("div", {
|
|
3478
3326
|
className: "block text-start font-light text-xl"
|
|
3479
3327
|
}, name ?? space.key.truncate())));
|
|
3480
3328
|
};
|
|
3481
3329
|
var SpacePanelImpl = (props) => {
|
|
3482
3330
|
const { titleId, activeView, space, target, SpaceManager: SpaceManagerComponent = SpaceManager, InvitationManager: InvitationManagerComponent = InvitationManager, ...rest } = props;
|
|
3483
|
-
return /* @__PURE__ */
|
|
3331
|
+
return /* @__PURE__ */ React39.createElement(DensityProvider4, {
|
|
3484
3332
|
density: "fine"
|
|
3485
|
-
}, /* @__PURE__ */
|
|
3333
|
+
}, /* @__PURE__ */ React39.createElement(SpacePanelHeading, {
|
|
3486
3334
|
...rest,
|
|
3487
3335
|
titleId,
|
|
3488
3336
|
space
|
|
3489
|
-
}), /* @__PURE__ */
|
|
3337
|
+
}), /* @__PURE__ */ React39.createElement(Viewport.Root, {
|
|
3490
3338
|
activeView
|
|
3491
|
-
}, /* @__PURE__ */
|
|
3339
|
+
}, /* @__PURE__ */ React39.createElement(Viewport.Views, null, /* @__PURE__ */ React39.createElement(Viewport.View, {
|
|
3492
3340
|
id: "space manager",
|
|
3493
3341
|
classNames: stepStyles
|
|
3494
|
-
}, /* @__PURE__ */
|
|
3342
|
+
}, /* @__PURE__ */ React39.createElement(SpaceManagerComponent, {
|
|
3495
3343
|
active: activeView === "space manager",
|
|
3496
3344
|
space,
|
|
3497
3345
|
target,
|
|
3498
3346
|
...rest
|
|
3499
|
-
})), /* @__PURE__ */
|
|
3347
|
+
})), /* @__PURE__ */ React39.createElement(Viewport.View, {
|
|
3500
3348
|
id: "space invitation manager",
|
|
3501
3349
|
classNames: stepStyles
|
|
3502
|
-
}, /* @__PURE__ */
|
|
3350
|
+
}, /* @__PURE__ */ React39.createElement(InvitationManagerComponent, {
|
|
3503
3351
|
active: activeView === "space invitation manager",
|
|
3504
3352
|
...rest,
|
|
3505
3353
|
invitationUrl: props.invitationUrl
|
|
@@ -3507,7 +3355,7 @@ var SpacePanelImpl = (props) => {
|
|
|
3507
3355
|
};
|
|
3508
3356
|
var SpacePanelWithInvitationImpl = ({ invitation, ...props }) => {
|
|
3509
3357
|
const invitationStatus = useInvitationStatus3(invitation);
|
|
3510
|
-
return /* @__PURE__ */
|
|
3358
|
+
return /* @__PURE__ */ React39.createElement(SpacePanelImpl, {
|
|
3511
3359
|
...props,
|
|
3512
3360
|
...invitationStatus,
|
|
3513
3361
|
invitationUrl: props.createInvitationUrl(invitationStatus.invitationCode)
|
|
@@ -3554,91 +3402,91 @@ var SpacePanel = ({ titleId: propsTitleId, createInvitationUrl = (code) => code,
|
|
|
3554
3402
|
};
|
|
3555
3403
|
return spaceState.context.invitation ? (
|
|
3556
3404
|
// TODO(wittjosiah): Unused? Remove?
|
|
3557
|
-
/* @__PURE__ */
|
|
3405
|
+
/* @__PURE__ */ React39.createElement(SpacePanelWithInvitationImpl, {
|
|
3558
3406
|
...implProps,
|
|
3559
3407
|
invitation: spaceState.context.invitation
|
|
3560
3408
|
})
|
|
3561
|
-
) : /* @__PURE__ */
|
|
3409
|
+
) : /* @__PURE__ */ React39.createElement(SpacePanelImpl, implProps);
|
|
3562
3410
|
};
|
|
3563
3411
|
|
|
3564
3412
|
// packages/sdk/shell/src/composites/IdentityDialog/IdentityDialog.tsx
|
|
3565
3413
|
var IdentityDialog = (props) => {
|
|
3566
3414
|
const titleId = useId9("spaceDialog__title");
|
|
3567
|
-
return /* @__PURE__ */
|
|
3415
|
+
return /* @__PURE__ */ React40.createElement(Dialog.Root, {
|
|
3568
3416
|
defaultOpen: true,
|
|
3569
3417
|
onOpenChange: (open) => open || props.onDone?.()
|
|
3570
|
-
}, /* @__PURE__ */
|
|
3418
|
+
}, /* @__PURE__ */ React40.createElement(Dialog.Portal, null, /* @__PURE__ */ React40.createElement(Dialog.Overlay, null, /* @__PURE__ */ React40.createElement(Dialog.Content, {
|
|
3571
3419
|
"aria-labelledby": titleId,
|
|
3572
3420
|
onOpenAutoFocus: (e) => e.preventDefault()
|
|
3573
|
-
}, /* @__PURE__ */
|
|
3421
|
+
}, /* @__PURE__ */ React40.createElement(ClipboardProvider, null, /* @__PURE__ */ React40.createElement(IdentityPanel, {
|
|
3574
3422
|
...props,
|
|
3575
3423
|
titleId,
|
|
3576
|
-
doneActionParent: /* @__PURE__ */
|
|
3424
|
+
doneActionParent: /* @__PURE__ */ React40.createElement(Dialog.Close, {
|
|
3577
3425
|
asChild: true
|
|
3578
3426
|
})
|
|
3579
3427
|
}))))));
|
|
3580
3428
|
};
|
|
3581
3429
|
|
|
3582
3430
|
// packages/sdk/shell/src/composites/JoinDialog/JoinDialog.tsx
|
|
3583
|
-
import
|
|
3431
|
+
import React41 from "react";
|
|
3584
3432
|
import { AlertDialog, useId as useId10, useVisualViewport } from "@dxos/react-ui";
|
|
3585
3433
|
var JoinDialog = (joinPanelProps) => {
|
|
3586
3434
|
const titleId = useId10("joinDialog__title");
|
|
3587
3435
|
const { height } = useVisualViewport();
|
|
3588
|
-
return /* @__PURE__ */
|
|
3436
|
+
return /* @__PURE__ */ React41.createElement(AlertDialog.Root, {
|
|
3589
3437
|
defaultOpen: true,
|
|
3590
3438
|
onOpenChange: (open) => open || (joinPanelProps.onExit ? joinPanelProps.onExit() : joinPanelProps.onDone?.(null))
|
|
3591
|
-
}, /* @__PURE__ */
|
|
3439
|
+
}, /* @__PURE__ */ React41.createElement(AlertDialog.Portal, null, /* @__PURE__ */ React41.createElement(AlertDialog.Overlay, {
|
|
3592
3440
|
classNames: "backdrop-blur",
|
|
3593
3441
|
...height && {
|
|
3594
3442
|
style: {
|
|
3595
3443
|
blockSize: `${height}px`
|
|
3596
3444
|
}
|
|
3597
3445
|
}
|
|
3598
|
-
}, /* @__PURE__ */
|
|
3446
|
+
}, /* @__PURE__ */ React41.createElement(AlertDialog.Content, {
|
|
3599
3447
|
"aria-labelledby": titleId
|
|
3600
|
-
}, /* @__PURE__ */
|
|
3448
|
+
}, /* @__PURE__ */ React41.createElement(JoinPanel, {
|
|
3601
3449
|
...joinPanelProps,
|
|
3602
3450
|
titleId,
|
|
3603
|
-
exitActionParent: /* @__PURE__ */
|
|
3451
|
+
exitActionParent: /* @__PURE__ */ React41.createElement(AlertDialog.Cancel, {
|
|
3604
3452
|
asChild: true
|
|
3605
3453
|
}),
|
|
3606
|
-
doneActionParent: /* @__PURE__ */
|
|
3454
|
+
doneActionParent: /* @__PURE__ */ React41.createElement(AlertDialog.Action, {
|
|
3607
3455
|
asChild: true
|
|
3608
3456
|
})
|
|
3609
3457
|
})))));
|
|
3610
3458
|
};
|
|
3611
3459
|
|
|
3612
3460
|
// packages/sdk/shell/src/composites/Shell/run-shell.tsx
|
|
3613
|
-
import
|
|
3461
|
+
import React44, { StrictMode } from "react";
|
|
3614
3462
|
import { createRoot } from "react-dom/client";
|
|
3615
3463
|
import { DEFAULT_CLIENT_CHANNEL, DEFAULT_SHELL_CHANNEL } from "@dxos/client-protocol";
|
|
3616
3464
|
import { ShellRuntimeImpl } from "@dxos/client-services";
|
|
3617
3465
|
import { Client, ClientContext, ClientServicesProxy, Config, SystemStatus } from "@dxos/react-client";
|
|
3618
|
-
import { ThemeProvider, Tooltip as
|
|
3466
|
+
import { ThemeProvider, Tooltip as Tooltip3 } from "@dxos/react-ui";
|
|
3619
3467
|
import { defaultTx } from "@dxos/react-ui-theme";
|
|
3620
3468
|
import { createIFramePort } from "@dxos/rpc-tunnel";
|
|
3621
3469
|
|
|
3622
3470
|
// packages/sdk/shell/src/composites/Shell/Shell.tsx
|
|
3623
|
-
import
|
|
3471
|
+
import React43, { useEffect as useEffect7, useState as useState10 } from "react";
|
|
3624
3472
|
import { log as log11 } from "@dxos/log";
|
|
3625
3473
|
import { ShellDisplay, ShellLayout, useClient as useClient7 } from "@dxos/react-client";
|
|
3626
3474
|
import { useSpace as useSpace2 } from "@dxos/react-client/echo";
|
|
3627
3475
|
|
|
3628
3476
|
// packages/sdk/shell/src/composites/SpaceDialog/SpaceDialog.tsx
|
|
3629
|
-
import
|
|
3477
|
+
import React42 from "react";
|
|
3630
3478
|
import { Dialog as Dialog2, useId as useId11 } from "@dxos/react-ui";
|
|
3631
3479
|
var SpaceDialog = (spacePanelProps) => {
|
|
3632
3480
|
const titleId = useId11("spaceDialog__title");
|
|
3633
|
-
return /* @__PURE__ */
|
|
3481
|
+
return /* @__PURE__ */ React42.createElement(Dialog2.Root, {
|
|
3634
3482
|
defaultOpen: true,
|
|
3635
3483
|
onOpenChange: (open) => open || spacePanelProps.onDone?.()
|
|
3636
|
-
}, /* @__PURE__ */
|
|
3484
|
+
}, /* @__PURE__ */ React42.createElement(Dialog2.Portal, null, /* @__PURE__ */ React42.createElement(Dialog2.Overlay, null, /* @__PURE__ */ React42.createElement(Dialog2.Content, {
|
|
3637
3485
|
"aria-labelledby": titleId
|
|
3638
|
-
}, /* @__PURE__ */
|
|
3486
|
+
}, /* @__PURE__ */ React42.createElement(ClipboardProvider, null, /* @__PURE__ */ React42.createElement(SpacePanel, {
|
|
3639
3487
|
...spacePanelProps,
|
|
3640
3488
|
titleId,
|
|
3641
|
-
doneActionParent: /* @__PURE__ */
|
|
3489
|
+
doneActionParent: /* @__PURE__ */ React42.createElement(Dialog2.Close, {
|
|
3642
3490
|
asChild: true
|
|
3643
3491
|
})
|
|
3644
3492
|
}))))));
|
|
@@ -3647,7 +3495,7 @@ var SpaceDialog = (spacePanelProps) => {
|
|
|
3647
3495
|
// packages/sdk/shell/src/composites/Shell/Shell.tsx
|
|
3648
3496
|
var __dxlog_file12 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/composites/Shell/Shell.tsx";
|
|
3649
3497
|
var Shell = ({ runtime, origin }) => {
|
|
3650
|
-
const [{ layout, invitationCode, spaceKey, target }, setLayout] =
|
|
3498
|
+
const [{ layout, invitationCode, spaceKey, target }, setLayout] = useState10({
|
|
3651
3499
|
layout: runtime.layout,
|
|
3652
3500
|
invitationCode: runtime.invitationCode,
|
|
3653
3501
|
spaceKey: runtime.spaceKey,
|
|
@@ -3685,7 +3533,7 @@ var Shell = ({ runtime, origin }) => {
|
|
|
3685
3533
|
]);
|
|
3686
3534
|
switch (layout) {
|
|
3687
3535
|
case ShellLayout.INITIALIZE_IDENTITY:
|
|
3688
|
-
return /* @__PURE__ */
|
|
3536
|
+
return /* @__PURE__ */ React43.createElement(JoinDialog, {
|
|
3689
3537
|
mode: "halo-only",
|
|
3690
3538
|
initialInvitationCode: invitationCode,
|
|
3691
3539
|
onDone: () => {
|
|
@@ -3700,7 +3548,7 @@ var Shell = ({ runtime, origin }) => {
|
|
|
3700
3548
|
case ShellLayout.IDENTITY:
|
|
3701
3549
|
case ShellLayout.SHARE_IDENTITY:
|
|
3702
3550
|
case ShellLayout.EDIT_PROFILE:
|
|
3703
|
-
return /* @__PURE__ */
|
|
3551
|
+
return /* @__PURE__ */ React43.createElement(IdentityDialog, {
|
|
3704
3552
|
createInvitationUrl: (invitationCode2) => `${origin}?deviceInvitationCode=${invitationCode2}`,
|
|
3705
3553
|
onResetDevice: async () => {
|
|
3706
3554
|
await client.reset();
|
|
@@ -3722,7 +3570,7 @@ var Shell = ({ runtime, origin }) => {
|
|
|
3722
3570
|
}
|
|
3723
3571
|
});
|
|
3724
3572
|
case ShellLayout.SPACE:
|
|
3725
|
-
return space ? /* @__PURE__ */
|
|
3573
|
+
return space ? /* @__PURE__ */ React43.createElement(SpaceDialog, {
|
|
3726
3574
|
space,
|
|
3727
3575
|
target,
|
|
3728
3576
|
createInvitationUrl: (invitationCode2) => `${origin}?spaceInvitationCode=${invitationCode2}`,
|
|
@@ -3736,7 +3584,7 @@ var Shell = ({ runtime, origin }) => {
|
|
|
3736
3584
|
}
|
|
3737
3585
|
}) : null;
|
|
3738
3586
|
case ShellLayout.JOIN_SPACE:
|
|
3739
|
-
return /* @__PURE__ */
|
|
3587
|
+
return /* @__PURE__ */ React43.createElement(JoinDialog, {
|
|
3740
3588
|
initialInvitationCode: invitationCode,
|
|
3741
3589
|
onDone: async (result) => {
|
|
3742
3590
|
const target2 = result?.target ?? void 0;
|
|
@@ -3870,28 +3718,7 @@ var os = {
|
|
|
3870
3718
|
"sign out chooser message": "Proceeding with either action below will erase all data on this device.",
|
|
3871
3719
|
"join new identity label": "Join a new identity",
|
|
3872
3720
|
"reset device label": "Reset device",
|
|
3873
|
-
"reset device confirm message": "Are you sure you want to reset your device? All data will be lost."
|
|
3874
|
-
"emoji and color label": "Emoji and color",
|
|
3875
|
-
"clear label": "Use default",
|
|
3876
|
-
"select emoji label": "Choose an emoji to use in your avatar",
|
|
3877
|
-
"select hue label": "Choose a hue to use in your avatar",
|
|
3878
|
-
"red label": "Red",
|
|
3879
|
-
"orange label": "Orange",
|
|
3880
|
-
"amber label": "Amber",
|
|
3881
|
-
"yellow label": "Yellow",
|
|
3882
|
-
"lime label": "Lime",
|
|
3883
|
-
"green label": "Green",
|
|
3884
|
-
"emerald label": "Emerald",
|
|
3885
|
-
"teal label": "Teal",
|
|
3886
|
-
"cyan label": "Cyan",
|
|
3887
|
-
"sky label": "Sky",
|
|
3888
|
-
"blue label": "Blue",
|
|
3889
|
-
"indigo label": "Indigo",
|
|
3890
|
-
"violet label": "Violet",
|
|
3891
|
-
"purple label": "Purple",
|
|
3892
|
-
"fuchsia label": "Fuchsia",
|
|
3893
|
-
"pink label": "Pink",
|
|
3894
|
-
"rose label": "Rose"
|
|
3721
|
+
"reset device confirm message": "Are you sure you want to reset your device? All data will be lost."
|
|
3895
3722
|
};
|
|
3896
3723
|
|
|
3897
3724
|
// packages/sdk/shell/src/translations/index.ts
|
|
@@ -3915,24 +3742,24 @@ var runShell = async (config = new Config()) => {
|
|
|
3915
3742
|
runtime.open(),
|
|
3916
3743
|
client.initialize()
|
|
3917
3744
|
]);
|
|
3918
|
-
createRoot(document.getElementById("root")).render(/* @__PURE__ */
|
|
3745
|
+
createRoot(document.getElementById("root")).render(/* @__PURE__ */ React44.createElement(StrictMode, null, /* @__PURE__ */ React44.createElement(ThemeProvider, {
|
|
3919
3746
|
tx: defaultTx,
|
|
3920
3747
|
resourceExtensions: [
|
|
3921
3748
|
osTranslations
|
|
3922
3749
|
]
|
|
3923
|
-
}, /* @__PURE__ */
|
|
3750
|
+
}, /* @__PURE__ */ React44.createElement(ClientContext.Provider, {
|
|
3924
3751
|
value: {
|
|
3925
3752
|
client,
|
|
3926
3753
|
status: SystemStatus.ACTIVE
|
|
3927
3754
|
}
|
|
3928
|
-
}, /* @__PURE__ */
|
|
3755
|
+
}, /* @__PURE__ */ React44.createElement(ClipboardProvider, null, /* @__PURE__ */ React44.createElement(Tooltip3.Provider, null, /* @__PURE__ */ React44.createElement(Shell, {
|
|
3929
3756
|
runtime,
|
|
3930
3757
|
origin: location.origin
|
|
3931
3758
|
})))))));
|
|
3932
3759
|
};
|
|
3933
3760
|
|
|
3934
3761
|
// packages/sdk/shell/src/composites/Shell/ShellContext.tsx
|
|
3935
|
-
import
|
|
3762
|
+
import React45, { createContext as createContext2, useCallback as useCallback9, useContext as useContext2, useEffect as useEffect8, useMemo as useMemo6, useState as useState11 } from "react";
|
|
3936
3763
|
import { ShellDisplay as ShellDisplay2, ShellLayout as ShellLayout3, useClient as useClient8 } from "@dxos/react-client";
|
|
3937
3764
|
import { useIdentity as useIdentity3 } from "@dxos/react-client/halo";
|
|
3938
3765
|
import { mx as mx23 } from "@dxos/react-ui-theme";
|
|
@@ -3994,7 +3821,7 @@ var useShell = () => {
|
|
|
3994
3821
|
var ShellProvider = ({ space, deviceInvitationCode, spaceInvitationCode, onJoinedSpace, children }) => {
|
|
3995
3822
|
const client = useClient8();
|
|
3996
3823
|
const identity = useIdentity3();
|
|
3997
|
-
const [display, setDisplay] =
|
|
3824
|
+
const [display, setDisplay] = useState11(!identity || spaceInvitationCode || deviceInvitationCode ? ShellDisplay2.FULLSCREEN : ShellDisplay2.NONE);
|
|
3998
3825
|
const shellRuntime = useMemo6(() => {
|
|
3999
3826
|
if (client.config.get("runtime.app.env.DX_VAULT") !== "false") {
|
|
4000
3827
|
return;
|
|
@@ -4064,12 +3891,12 @@ var ShellProvider = ({ space, deviceInvitationCode, spaceInvitationCode, onJoine
|
|
|
4064
3891
|
}, [
|
|
4065
3892
|
shellRuntime
|
|
4066
3893
|
]);
|
|
4067
|
-
return /* @__PURE__ */
|
|
3894
|
+
return /* @__PURE__ */ React45.createElement(React45.Fragment, null, shellRuntime && /* @__PURE__ */ React45.createElement("div", {
|
|
4068
3895
|
className: mx23(display === ShellDisplay2.NONE ? "hidden" : "")
|
|
4069
|
-
}, /* @__PURE__ */
|
|
3896
|
+
}, /* @__PURE__ */ React45.createElement(Shell, {
|
|
4070
3897
|
runtime: shellRuntime,
|
|
4071
3898
|
origin: window.location.origin
|
|
4072
|
-
})), /* @__PURE__ */
|
|
3899
|
+
})), /* @__PURE__ */ React45.createElement(ShellContext.Provider, {
|
|
4073
3900
|
value: {
|
|
4074
3901
|
runtime: shellRuntime,
|
|
4075
3902
|
setDisplay
|
|
@@ -4090,9 +3917,7 @@ export {
|
|
|
4090
3917
|
CopyButtonIconOnly,
|
|
4091
3918
|
DeviceList,
|
|
4092
3919
|
Emoji,
|
|
4093
|
-
EmojiPicker,
|
|
4094
3920
|
Heading,
|
|
4095
|
-
HuePicker,
|
|
4096
3921
|
IdentityDialog,
|
|
4097
3922
|
IdentityListItem,
|
|
4098
3923
|
IdentityPanel,
|