@dxos/shell 0.4.10-main.d560ca0 → 0.4.10-main.f68a1ca
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 +8261 -8194
- package/dist/bundle/shell.mjs.map +1 -1
- package/dist/bundle/shell.umd.js +53 -53
- 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 +417 -328
- package/dist/lib/browser/react.mjs.map +4 -4
- package/dist/types/src/composites/IdentityDialog/IdentityDialog.js +1 -1
- package/dist/types/src/composites/IdentityDialog/IdentityDialog.js.map +1 -1
- package/dist/types/src/composites/Shell/Shell.d.ts.map +1 -1
- package/dist/types/src/composites/Shell/Shell.js +18 -6
- package/dist/types/src/composites/Shell/Shell.js.map +1 -1
- package/dist/types/src/composites/StatusDialog/StatusDialog.d.ts +2 -0
- package/dist/types/src/composites/StatusDialog/StatusDialog.d.ts.map +1 -0
- package/dist/types/src/composites/StatusDialog/StatusDialog.js +22 -0
- package/dist/types/src/composites/StatusDialog/StatusDialog.js.map +1 -0
- package/dist/types/src/composites/StatusDialog/index.d.ts +2 -0
- package/dist/types/src/composites/StatusDialog/index.d.ts.map +1 -0
- package/dist/types/src/composites/StatusDialog/index.js +21 -0
- package/dist/types/src/composites/StatusDialog/index.js.map +1 -0
- package/dist/types/src/panels/IdentityPanel/IdentityPanel.d.ts +1 -1
- package/dist/types/src/panels/IdentityPanel/IdentityPanel.d.ts.map +1 -1
- package/dist/types/src/panels/IdentityPanel/IdentityPanel.js +15 -8
- package/dist/types/src/panels/IdentityPanel/IdentityPanel.js.map +1 -1
- package/dist/types/src/panels/IdentityPanel/IdentityPanelProps.d.ts +5 -3
- package/dist/types/src/panels/IdentityPanel/IdentityPanelProps.d.ts.map +1 -1
- package/dist/types/src/panels/IdentityPanel/identityMachine.d.ts +3 -1
- package/dist/types/src/panels/IdentityPanel/identityMachine.d.ts.map +1 -1
- package/dist/types/src/panels/IdentityPanel/identityMachine.js +15 -2
- package/dist/types/src/panels/IdentityPanel/identityMachine.js.map +1 -1
- package/dist/types/src/panels/IdentityPanel/steps/IdentityActionChooser.d.ts.map +1 -1
- package/dist/types/src/panels/IdentityPanel/steps/IdentityActionChooser.js +9 -5
- package/dist/types/src/panels/IdentityPanel/steps/IdentityActionChooser.js.map +1 -1
- package/dist/types/src/panels/IdentityPanel/steps/index.d.ts +0 -1
- package/dist/types/src/panels/IdentityPanel/steps/index.d.ts.map +1 -1
- package/dist/types/src/panels/IdentityPanel/steps/index.js +0 -1
- package/dist/types/src/panels/IdentityPanel/steps/index.js.map +1 -1
- package/dist/types/src/panels/JoinPanel/JoinPanel.d.ts +1 -1
- package/dist/types/src/panels/JoinPanel/JoinPanel.d.ts.map +1 -1
- package/dist/types/src/panels/JoinPanel/JoinPanel.js +12 -5
- package/dist/types/src/panels/JoinPanel/JoinPanel.js.map +1 -1
- package/dist/types/src/panels/JoinPanel/JoinPanel.stories.d.ts +1 -1
- package/dist/types/src/panels/JoinPanel/JoinPanel.stories.d.ts.map +1 -1
- package/dist/types/src/panels/JoinPanel/JoinPanel.stories.js +2 -1
- package/dist/types/src/panels/JoinPanel/JoinPanel.stories.js.map +1 -1
- package/dist/types/src/panels/JoinPanel/JoinPanelProps.d.ts +8 -3
- package/dist/types/src/panels/JoinPanel/JoinPanelProps.d.ts.map +1 -1
- package/dist/types/src/panels/JoinPanel/joinMachine.d.ts +3 -2
- package/dist/types/src/panels/JoinPanel/joinMachine.d.ts.map +1 -1
- package/dist/types/src/panels/JoinPanel/joinMachine.js +7 -0
- package/dist/types/src/panels/JoinPanel/joinMachine.js.map +1 -1
- package/dist/types/src/panels/JoinPanel/steps/index.d.ts +0 -1
- package/dist/types/src/panels/JoinPanel/steps/index.d.ts.map +1 -1
- package/dist/types/src/panels/JoinPanel/steps/index.js +0 -1
- package/dist/types/src/panels/JoinPanel/steps/index.js.map +1 -1
- package/dist/types/src/panels/StatusPanel/StatusPanel.d.ts +4 -0
- package/dist/types/src/panels/StatusPanel/StatusPanel.d.ts.map +1 -0
- package/dist/types/src/panels/StatusPanel/StatusPanel.js +19 -0
- package/dist/types/src/panels/StatusPanel/StatusPanel.js.map +1 -0
- package/dist/types/src/panels/StatusPanel/index.d.ts +2 -0
- package/dist/types/src/panels/StatusPanel/index.d.ts.map +1 -0
- package/dist/types/src/panels/StatusPanel/index.js +21 -0
- package/dist/types/src/panels/StatusPanel/index.js.map +1 -0
- package/dist/types/src/panels/index.d.ts +1 -0
- package/dist/types/src/panels/index.d.ts.map +1 -1
- package/dist/types/src/panels/index.js +1 -0
- package/dist/types/src/panels/index.js.map +1 -1
- package/dist/types/src/steps/ConfirmReset.d.ts +16 -0
- package/dist/types/src/steps/ConfirmReset.d.ts.map +1 -0
- package/dist/types/src/steps/ConfirmReset.js +70 -0
- package/dist/types/src/steps/ConfirmReset.js.map +1 -0
- package/dist/types/src/steps/StepProps.d.ts +4 -1
- package/dist/types/src/steps/StepProps.d.ts.map +1 -1
- package/dist/types/src/steps/index.d.ts +1 -0
- package/dist/types/src/steps/index.d.ts.map +1 -1
- package/dist/types/src/steps/index.js +1 -0
- package/dist/types/src/steps/index.js.map +1 -1
- package/dist/types/src/translations/locales/en-US.d.ts +4 -1
- package/dist/types/src/translations/locales/en-US.d.ts.map +1 -1
- package/dist/types/src/translations/locales/en-US.js +8 -5
- package/dist/types/src/translations/locales/en-US.js.map +1 -1
- package/package.json +19 -19
- package/src/composites/IdentityDialog/IdentityDialog.tsx +1 -1
- package/src/composites/Shell/Shell.tsx +23 -4
- package/src/composites/StatusDialog/StatusDialog.tsx +24 -0
- package/src/composites/StatusDialog/index.ts +5 -0
- package/src/panels/IdentityPanel/IdentityPanel.tsx +31 -14
- package/src/panels/IdentityPanel/IdentityPanelProps.ts +7 -3
- package/src/panels/IdentityPanel/identityMachine.ts +25 -3
- package/src/panels/IdentityPanel/steps/IdentityActionChooser.tsx +16 -7
- package/src/panels/IdentityPanel/steps/index.ts +0 -1
- package/src/panels/JoinPanel/JoinPanel.stories.tsx +3 -2
- package/src/panels/JoinPanel/JoinPanel.tsx +21 -5
- package/src/panels/JoinPanel/JoinPanelProps.ts +9 -3
- package/src/panels/JoinPanel/joinMachine.ts +12 -2
- package/src/panels/JoinPanel/steps/index.ts +0 -1
- package/src/panels/StatusPanel/StatusPanel.tsx +19 -0
- package/src/panels/StatusPanel/index.ts +5 -0
- package/src/panels/index.ts +1 -0
- package/src/steps/ConfirmReset.tsx +111 -0
- package/src/steps/StepProps.ts +2 -1
- package/src/steps/index.ts +1 -0
- package/src/translations/locales/en-US.ts +9 -5
- package/dist/types/src/panels/IdentityPanel/steps/SignOutChooser.d.ts +0 -16
- package/dist/types/src/panels/IdentityPanel/steps/SignOutChooser.d.ts.map +0 -1
- package/dist/types/src/panels/IdentityPanel/steps/SignOutChooser.js +0 -40
- package/dist/types/src/panels/IdentityPanel/steps/SignOutChooser.js.map +0 -1
- package/dist/types/src/panels/JoinPanel/steps/ResetIdentity.d.ts +0 -13
- package/dist/types/src/panels/JoinPanel/steps/ResetIdentity.d.ts.map +0 -1
- package/dist/types/src/panels/JoinPanel/steps/ResetIdentity.js +0 -66
- package/dist/types/src/panels/JoinPanel/steps/ResetIdentity.js.map +0 -1
- package/src/panels/IdentityPanel/steps/SignOutChooser.tsx +0 -84
- package/src/panels/JoinPanel/steps/ResetIdentity.tsx +0 -80
|
@@ -922,7 +922,7 @@ import { Dialog, useId as useId9 } from "@dxos/react-ui";
|
|
|
922
922
|
// packages/sdk/shell/src/panels/IdentityPanel/IdentityPanel.tsx
|
|
923
923
|
import React29, { useEffect as useEffect3, useMemo as useMemo3 } from "react";
|
|
924
924
|
import { generateName as generateName3 } from "@dxos/display-name";
|
|
925
|
-
import { log as
|
|
925
|
+
import { log as log6 } from "@dxos/log";
|
|
926
926
|
import { useClient as useClient3 } from "@dxos/react-client";
|
|
927
927
|
import { useIdentity, useDevices, useHaloInvitations as useHaloInvitations2 } from "@dxos/react-client/halo";
|
|
928
928
|
import { useInvitationStatus as useInvitationStatus2 } from "@dxos/react-client/invitations";
|
|
@@ -946,6 +946,24 @@ var identityMachine = createMachine({
|
|
|
946
946
|
src: (context) => context.identitySubscribable
|
|
947
947
|
},
|
|
948
948
|
states: {
|
|
949
|
+
unknown: {
|
|
950
|
+
always: [
|
|
951
|
+
{
|
|
952
|
+
cond: "initiallyManagingDeviceInvitation",
|
|
953
|
+
target: "managingDeviceInvitation",
|
|
954
|
+
actions: "log"
|
|
955
|
+
},
|
|
956
|
+
{
|
|
957
|
+
cond: "initiallyManagingProfile",
|
|
958
|
+
target: "managingProfile",
|
|
959
|
+
actions: "log"
|
|
960
|
+
},
|
|
961
|
+
{
|
|
962
|
+
target: "choosingAction",
|
|
963
|
+
actions: "log"
|
|
964
|
+
}
|
|
965
|
+
]
|
|
966
|
+
},
|
|
949
967
|
choosingAction: {},
|
|
950
968
|
managingDeviceInvitation: {},
|
|
951
969
|
managingAgent: {
|
|
@@ -976,7 +994,8 @@ var identityMachine = createMachine({
|
|
|
976
994
|
}
|
|
977
995
|
}
|
|
978
996
|
},
|
|
979
|
-
|
|
997
|
+
confirmingResetStorage: {},
|
|
998
|
+
confirmingJoinNewIdentity: {}
|
|
980
999
|
},
|
|
981
1000
|
on: {
|
|
982
1001
|
unchooseAction: {
|
|
@@ -1008,8 +1027,12 @@ var identityMachine = createMachine({
|
|
|
1008
1027
|
target: ".managingProfile",
|
|
1009
1028
|
actions: "log"
|
|
1010
1029
|
},
|
|
1011
|
-
|
|
1012
|
-
target: ".
|
|
1030
|
+
chooseJoinNewIdentity: {
|
|
1031
|
+
target: ".confirmingJoinNewIdentity",
|
|
1032
|
+
actions: "log"
|
|
1033
|
+
},
|
|
1034
|
+
chooseResetStorage: {
|
|
1035
|
+
target: ".confirmingResetStorage",
|
|
1013
1036
|
actions: "log"
|
|
1014
1037
|
},
|
|
1015
1038
|
chooseAgent: {
|
|
@@ -1018,6 +1041,10 @@ var identityMachine = createMachine({
|
|
|
1018
1041
|
}
|
|
1019
1042
|
}
|
|
1020
1043
|
}, {
|
|
1044
|
+
guards: {
|
|
1045
|
+
initiallyManagingDeviceInvitation: ({ initialDisposition }, _event) => initialDisposition === "manage-device-invitation",
|
|
1046
|
+
initiallyManagingProfile: ({ initialDisposition }, _event) => initialDisposition === "manage-profile"
|
|
1047
|
+
},
|
|
1021
1048
|
actions: {
|
|
1022
1049
|
setIdentity: assign({
|
|
1023
1050
|
identity: (context, event) => event?.identity ?? null
|
|
@@ -1034,7 +1061,7 @@ var identityMachine = createMachine({
|
|
|
1034
1061
|
context
|
|
1035
1062
|
}, {
|
|
1036
1063
|
F: __dxlog_file,
|
|
1037
|
-
L:
|
|
1064
|
+
L: 126,
|
|
1038
1065
|
S: void 0,
|
|
1039
1066
|
C: (f, a) => f(...a)
|
|
1040
1067
|
});
|
|
@@ -1110,7 +1137,7 @@ var DeviceManager = ({ devices, active, send }) => {
|
|
|
1110
1137
|
};
|
|
1111
1138
|
|
|
1112
1139
|
// packages/sdk/shell/src/panels/IdentityPanel/steps/IdentityActionChooser.tsx
|
|
1113
|
-
import { CaretRight, Devices, Plus, Power, UserGear, HardDrive } from "@phosphor-icons/react";
|
|
1140
|
+
import { CaretRight, Devices, Plus, Power, UserGear, HardDrive, Intersect } from "@phosphor-icons/react";
|
|
1114
1141
|
import React25, { useCallback as useCallback4 } from "react";
|
|
1115
1142
|
import { log as log2 } from "@dxos/log";
|
|
1116
1143
|
import { useAgentHostingProviderClient, useClient as useClient2 } from "@dxos/react-client";
|
|
@@ -1168,7 +1195,20 @@ var IdentityActionChooserImpl = ({ onCreateInvitationClick, active, send, onDone
|
|
|
1168
1195
|
density: "coarse"
|
|
1169
1196
|
}, /* @__PURE__ */ React25.createElement("div", {
|
|
1170
1197
|
className: "grow justify-center flex flex-col gap-1"
|
|
1171
|
-
},
|
|
1198
|
+
}, /* @__PURE__ */ React25.createElement(Action, {
|
|
1199
|
+
"data-testid": "manage-profile",
|
|
1200
|
+
onClick: () => send?.({
|
|
1201
|
+
type: "chooseProfile"
|
|
1202
|
+
}),
|
|
1203
|
+
classNames: "plb-4"
|
|
1204
|
+
}, /* @__PURE__ */ React25.createElement(UserGear, {
|
|
1205
|
+
className: getSize8(6)
|
|
1206
|
+
}), /* @__PURE__ */ React25.createElement("span", {
|
|
1207
|
+
className: "grow mli-3"
|
|
1208
|
+
}, t("choose profile label")), /* @__PURE__ */ React25.createElement(CaretRight, {
|
|
1209
|
+
weight: "bold",
|
|
1210
|
+
className: getSize8(4)
|
|
1211
|
+
})), agentHostingEnabled && /* @__PURE__ */ React25.createElement(Action, {
|
|
1172
1212
|
"data-testid": "manage-agent",
|
|
1173
1213
|
onClick: () => send?.({
|
|
1174
1214
|
type: "chooseAgent"
|
|
@@ -1194,35 +1234,35 @@ var IdentityActionChooserImpl = ({ onCreateInvitationClick, active, send, onDone
|
|
|
1194
1234
|
weight: "bold",
|
|
1195
1235
|
className: getSize8(4)
|
|
1196
1236
|
})), /* @__PURE__ */ React25.createElement(Action, {
|
|
1197
|
-
"data-testid": "
|
|
1237
|
+
"data-testid": "devices-panel.join-new-identity",
|
|
1198
1238
|
onClick: () => send?.({
|
|
1199
|
-
type: "
|
|
1239
|
+
type: "chooseJoinNewIdentity"
|
|
1200
1240
|
}),
|
|
1201
1241
|
classNames: "plb-4"
|
|
1202
|
-
}, /* @__PURE__ */ React25.createElement(
|
|
1242
|
+
}, /* @__PURE__ */ React25.createElement(Intersect, {
|
|
1203
1243
|
className: getSize8(6)
|
|
1204
1244
|
}), /* @__PURE__ */ React25.createElement("span", {
|
|
1205
1245
|
className: "grow mli-3"
|
|
1206
|
-
}, t("choose
|
|
1246
|
+
}, t("choose join new identity label")), /* @__PURE__ */ React25.createElement(CaretRight, {
|
|
1207
1247
|
weight: "bold",
|
|
1208
1248
|
className: getSize8(4)
|
|
1209
1249
|
})), /* @__PURE__ */ React25.createElement(Action, {
|
|
1210
|
-
"data-testid": "manage-
|
|
1250
|
+
"data-testid": "manage-devices",
|
|
1211
1251
|
onClick: () => send?.({
|
|
1212
|
-
type: "
|
|
1252
|
+
type: "chooseDevices"
|
|
1213
1253
|
}),
|
|
1214
1254
|
classNames: "plb-4"
|
|
1215
|
-
}, /* @__PURE__ */ React25.createElement(
|
|
1255
|
+
}, /* @__PURE__ */ React25.createElement(Devices, {
|
|
1216
1256
|
className: getSize8(6)
|
|
1217
1257
|
}), /* @__PURE__ */ React25.createElement("span", {
|
|
1218
1258
|
className: "grow mli-3"
|
|
1219
|
-
}, t("choose
|
|
1259
|
+
}, t("choose devices label")), /* @__PURE__ */ React25.createElement(CaretRight, {
|
|
1220
1260
|
weight: "bold",
|
|
1221
1261
|
className: getSize8(4)
|
|
1222
1262
|
})), /* @__PURE__ */ React25.createElement(Action, {
|
|
1223
1263
|
"data-testid": "devices-panel.sign-out",
|
|
1224
1264
|
onClick: () => send?.({
|
|
1225
|
-
type: "
|
|
1265
|
+
type: "chooseResetStorage"
|
|
1226
1266
|
}),
|
|
1227
1267
|
classNames: "plb-4"
|
|
1228
1268
|
}, /* @__PURE__ */ React25.createElement(Power, {
|
|
@@ -1341,54 +1381,6 @@ var ProfileFormImpl = (props) => {
|
|
|
1341
1381
|
}, t("done label"))));
|
|
1342
1382
|
};
|
|
1343
1383
|
|
|
1344
|
-
// packages/sdk/shell/src/panels/IdentityPanel/steps/SignOutChooser.tsx
|
|
1345
|
-
import { Warning } from "@phosphor-icons/react";
|
|
1346
|
-
import React27 from "react";
|
|
1347
|
-
import { Message, useTranslation as useTranslation13 } from "@dxos/react-ui";
|
|
1348
|
-
import { getSize as getSize9, mx as mx18 } from "@dxos/react-ui-theme";
|
|
1349
|
-
var SignOutChooser = (props) => {
|
|
1350
|
-
const { t } = useTranslation13("os");
|
|
1351
|
-
const onResetDevice = () => {
|
|
1352
|
-
if (window.confirm(t("reset device confirm message"))) {
|
|
1353
|
-
void props.onResetDevice?.();
|
|
1354
|
-
}
|
|
1355
|
-
};
|
|
1356
|
-
return /* @__PURE__ */ React27.createElement(SignOutChooserImpl, {
|
|
1357
|
-
disabled: !props.active,
|
|
1358
|
-
onBack: () => props.send?.({
|
|
1359
|
-
type: "unchooseAction"
|
|
1360
|
-
}),
|
|
1361
|
-
onResetDevice,
|
|
1362
|
-
onJoinNewIdentity: props.onJoinNewIdentity
|
|
1363
|
-
});
|
|
1364
|
-
};
|
|
1365
|
-
var SignOutChooserImpl = ({ disabled, onResetDevice, onJoinNewIdentity, onBack }) => {
|
|
1366
|
-
const { t } = useTranslation13("os");
|
|
1367
|
-
return /* @__PURE__ */ React27.createElement(React27.Fragment, null, /* @__PURE__ */ React27.createElement("div", {
|
|
1368
|
-
role: "none",
|
|
1369
|
-
className: "grow flex flex-col justify-center"
|
|
1370
|
-
}, /* @__PURE__ */ React27.createElement(Message.Root, {
|
|
1371
|
-
valence: "error"
|
|
1372
|
-
}, /* @__PURE__ */ React27.createElement(Message.Title, null, /* @__PURE__ */ React27.createElement(Warning, {
|
|
1373
|
-
className: mx18(getSize9(6), "inline mie-2")
|
|
1374
|
-
}), t("sign out chooser title")), /* @__PURE__ */ React27.createElement(Message.Body, null, t("sign out chooser message")))), /* @__PURE__ */ React27.createElement(Actions, null, /* @__PURE__ */ React27.createElement(Action, {
|
|
1375
|
-
disabled,
|
|
1376
|
-
onClick: onBack
|
|
1377
|
-
}, t("back label")), /* @__PURE__ */ React27.createElement(Action, {
|
|
1378
|
-
variant: "primary",
|
|
1379
|
-
"data-testid": "sign-out.join-new-identity",
|
|
1380
|
-
classNames: "!bg-error-500 hover:!bg-error-550",
|
|
1381
|
-
disabled,
|
|
1382
|
-
onClick: onJoinNewIdentity
|
|
1383
|
-
}, t("join new identity label")), /* @__PURE__ */ React27.createElement(Action, {
|
|
1384
|
-
variant: "primary",
|
|
1385
|
-
"data-testid": "sign-out.reset-device",
|
|
1386
|
-
classNames: "!bg-error-500 hover:!bg-error-550",
|
|
1387
|
-
disabled,
|
|
1388
|
-
onClick: onResetDevice
|
|
1389
|
-
}, t("reset device label"))));
|
|
1390
|
-
};
|
|
1391
|
-
|
|
1392
1384
|
// packages/sdk/shell/src/panels/IdentityPanel/useAgentHandlers.ts
|
|
1393
1385
|
import { useCallback as useCallback5, useEffect as useEffect2, useState as useState5 } from "react";
|
|
1394
1386
|
import { invariant } from "@dxos/invariant";
|
|
@@ -1490,11 +1482,11 @@ var useAgentHandlers = ({ client, invitations, identity }) => {
|
|
|
1490
1482
|
|
|
1491
1483
|
// packages/sdk/shell/src/steps/InvitationManager.tsx
|
|
1492
1484
|
import { Check as Check4, X as X3 } from "@phosphor-icons/react";
|
|
1493
|
-
import
|
|
1485
|
+
import React27, { useMemo as useMemo2 } from "react";
|
|
1494
1486
|
import { QR } from "react-qr-rounded";
|
|
1495
1487
|
import { Invitation as Invitation5 } from "@dxos/react-client/invitations";
|
|
1496
|
-
import { useId as useId4, useTranslation as
|
|
1497
|
-
import { descriptionText as descriptionText7, getSize as
|
|
1488
|
+
import { useId as useId4, useTranslation as useTranslation13 } from "@dxos/react-ui";
|
|
1489
|
+
import { descriptionText as descriptionText7, getSize as getSize9, mx as mx18 } from "@dxos/react-ui-theme";
|
|
1498
1490
|
import { hexToEmoji as hexToEmoji3 } from "@dxos/util";
|
|
1499
1491
|
|
|
1500
1492
|
// packages/sdk/shell/src/util/invitationStatusValue.ts
|
|
@@ -1540,13 +1532,13 @@ var invitationStatusValue = /* @__PURE__ */ new Map([
|
|
|
1540
1532
|
|
|
1541
1533
|
// packages/sdk/shell/src/steps/InvitationManager.tsx
|
|
1542
1534
|
var InvitationManagerView = ({ children, ...props }) => {
|
|
1543
|
-
return /* @__PURE__ */
|
|
1535
|
+
return /* @__PURE__ */ React27.createElement(Viewport.View, {
|
|
1544
1536
|
...props,
|
|
1545
1537
|
classNames: "grow flex flex-col justify-around items-center"
|
|
1546
1538
|
}, children);
|
|
1547
1539
|
};
|
|
1548
1540
|
var InvitationManager = ({ invitationUrl, active, send, status, type, authCode, id = "0" }) => {
|
|
1549
|
-
const { t } =
|
|
1541
|
+
const { t } = useTranslation13("os");
|
|
1550
1542
|
const qrLabel = useId4("invitation-manager__qr-code");
|
|
1551
1543
|
const statusValue = type === Invitation5.Type.MULTIUSE ? 0 : invitationStatusValue.get(status) ?? 0;
|
|
1552
1544
|
const showAuthCode = statusValue === 3;
|
|
@@ -1564,50 +1556,50 @@ var InvitationManager = ({ invitationUrl, active, send, status, type, authCode,
|
|
|
1564
1556
|
}, [
|
|
1565
1557
|
statusValue
|
|
1566
1558
|
]);
|
|
1567
|
-
return /* @__PURE__ */
|
|
1559
|
+
return /* @__PURE__ */ React27.createElement(React27.Fragment, null, /* @__PURE__ */ React27.createElement(Viewport.Root, {
|
|
1568
1560
|
activeView,
|
|
1569
1561
|
classNames: "grow plb-1"
|
|
1570
|
-
}, /* @__PURE__ */
|
|
1562
|
+
}, /* @__PURE__ */ React27.createElement(Viewport.Views, null, /* @__PURE__ */ React27.createElement(InvitationManagerView, {
|
|
1571
1563
|
id: "showing qr",
|
|
1572
1564
|
emoji
|
|
1573
|
-
}, /* @__PURE__ */
|
|
1565
|
+
}, /* @__PURE__ */ React27.createElement("p", {
|
|
1574
1566
|
className: "text-sm mlb-1 font-normal text-center"
|
|
1575
|
-
}, t(type === Invitation5.Type.MULTIUSE ? "invite many qr label" : "invite one qr label")), /* @__PURE__ */
|
|
1567
|
+
}, t(type === Invitation5.Type.MULTIUSE ? "invite many qr label" : "invite one qr label")), /* @__PURE__ */ React27.createElement("div", {
|
|
1576
1568
|
role: "none",
|
|
1577
|
-
className:
|
|
1578
|
-
}, /* @__PURE__ */
|
|
1569
|
+
className: mx18(descriptionText7, "is-full max-is-[14rem] relative")
|
|
1570
|
+
}, /* @__PURE__ */ React27.createElement(QR, {
|
|
1579
1571
|
rounding: 100,
|
|
1580
1572
|
backgroundColor: "transparent",
|
|
1581
1573
|
color: "currentColor",
|
|
1582
|
-
className:
|
|
1574
|
+
className: mx18("is-full bs-full p-2", showAuthCode && "invisible"),
|
|
1583
1575
|
"aria-labelledby": qrLabel,
|
|
1584
1576
|
errorCorrectionLevel: "Q",
|
|
1585
1577
|
cutout: true
|
|
1586
|
-
}, invitationUrl ?? "never"), /* @__PURE__ */
|
|
1578
|
+
}, invitationUrl ?? "never"), /* @__PURE__ */ React27.createElement(Centered, null, /* @__PURE__ */ React27.createElement(Emoji, {
|
|
1587
1579
|
text: emoji
|
|
1588
|
-
}))), /* @__PURE__ */
|
|
1580
|
+
}))), /* @__PURE__ */ React27.createElement("span", {
|
|
1589
1581
|
id: qrLabel,
|
|
1590
1582
|
className: "sr-only"
|
|
1591
|
-
}, t("qr label")), /* @__PURE__ */
|
|
1583
|
+
}, t("qr label")), /* @__PURE__ */ React27.createElement(CopyButton, {
|
|
1592
1584
|
variant: "ghost",
|
|
1593
1585
|
value: invitationUrl ?? "never"
|
|
1594
|
-
})), /* @__PURE__ */
|
|
1586
|
+
})), /* @__PURE__ */ React27.createElement(InvitationManagerView, {
|
|
1595
1587
|
id: "showing auth code"
|
|
1596
|
-
}, /* @__PURE__ */
|
|
1588
|
+
}, /* @__PURE__ */ React27.createElement(Label, null, t("auth code message")), /* @__PURE__ */ React27.createElement(AuthCode, {
|
|
1597
1589
|
code: authCode,
|
|
1598
1590
|
large: true,
|
|
1599
1591
|
classNames: "text-black dark:text-white"
|
|
1600
|
-
}), /* @__PURE__ */
|
|
1592
|
+
}), /* @__PURE__ */ React27.createElement(Label, null, "Be sure the other device is showing this symbol:"), emoji && /* @__PURE__ */ React27.createElement(Emoji, {
|
|
1601
1593
|
text: emoji
|
|
1602
|
-
})), /* @__PURE__ */
|
|
1594
|
+
})), /* @__PURE__ */ React27.createElement(InvitationManagerView, {
|
|
1603
1595
|
id: "showing final"
|
|
1604
|
-
}, statusValue > 0 ? /* @__PURE__ */
|
|
1605
|
-
className:
|
|
1606
|
-
}) : /* @__PURE__ */
|
|
1607
|
-
className:
|
|
1608
|
-
})))), /* @__PURE__ */
|
|
1596
|
+
}, statusValue > 0 ? /* @__PURE__ */ React27.createElement(Check4, {
|
|
1597
|
+
className: mx18("m-1.5", getSize9(6))
|
|
1598
|
+
}) : /* @__PURE__ */ React27.createElement(X3, {
|
|
1599
|
+
className: mx18("m-1.5", getSize9(6))
|
|
1600
|
+
})))), /* @__PURE__ */ React27.createElement(Actions, {
|
|
1609
1601
|
classNames: "mbs-4"
|
|
1610
|
-
}, /* @__PURE__ */
|
|
1602
|
+
}, /* @__PURE__ */ React27.createElement(Action, {
|
|
1611
1603
|
disabled: !active,
|
|
1612
1604
|
onClick: () => send?.({
|
|
1613
1605
|
type: "deselectInvitation"
|
|
@@ -1615,8 +1607,75 @@ var InvitationManager = ({ invitationUrl, active, send, status, type, authCode,
|
|
|
1615
1607
|
}, t("back label"))));
|
|
1616
1608
|
};
|
|
1617
1609
|
|
|
1610
|
+
// packages/sdk/shell/src/steps/ConfirmReset.tsx
|
|
1611
|
+
import { Warning } from "@phosphor-icons/react";
|
|
1612
|
+
import React28, { useState as useState6 } from "react";
|
|
1613
|
+
import { log as log5 } from "@dxos/log";
|
|
1614
|
+
import { Message, useTranslation as useTranslation14 } from "@dxos/react-ui";
|
|
1615
|
+
import { getSize as getSize10, mx as mx19 } from "@dxos/react-ui-theme";
|
|
1616
|
+
var __dxlog_file5 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/steps/ConfirmReset.tsx";
|
|
1617
|
+
var ConfirmReset = ({ active, onCancel, onConfirm, mode }) => {
|
|
1618
|
+
const { t } = useTranslation14("os");
|
|
1619
|
+
const [validationMessage, setValidationMessage] = useState6("");
|
|
1620
|
+
const [pending, setPending] = useState6(false);
|
|
1621
|
+
const processReset = async () => {
|
|
1622
|
+
setPending(true);
|
|
1623
|
+
return onConfirm?.().then(() => setPending(false), (error) => {
|
|
1624
|
+
log5.catch(error, void 0, {
|
|
1625
|
+
F: __dxlog_file5,
|
|
1626
|
+
L: 38,
|
|
1627
|
+
S: void 0,
|
|
1628
|
+
C: (f, a) => f(...a)
|
|
1629
|
+
});
|
|
1630
|
+
setValidationMessage(t("failed to reset identity message"));
|
|
1631
|
+
setPending(false);
|
|
1632
|
+
});
|
|
1633
|
+
};
|
|
1634
|
+
return /* @__PURE__ */ React28.createElement(ConfirmResetImpl, {
|
|
1635
|
+
disabled: !active,
|
|
1636
|
+
pending,
|
|
1637
|
+
validationMessage,
|
|
1638
|
+
onConfirm: processReset,
|
|
1639
|
+
onCancel,
|
|
1640
|
+
mode
|
|
1641
|
+
});
|
|
1642
|
+
};
|
|
1643
|
+
var ConfirmResetImpl = ({ disabled, pending, validationMessage, onConfirm, onCancel, mode }) => {
|
|
1644
|
+
const { t } = useTranslation14("os");
|
|
1645
|
+
const confirmationValue = t("confirmation value");
|
|
1646
|
+
const [inputValue, setInputValue] = useState6("");
|
|
1647
|
+
return /* @__PURE__ */ React28.createElement(React28.Fragment, null, /* @__PURE__ */ React28.createElement("div", {
|
|
1648
|
+
role: "none",
|
|
1649
|
+
className: "grow flex flex-col gap-2 justify-center"
|
|
1650
|
+
}, /* @__PURE__ */ React28.createElement(Message.Root, {
|
|
1651
|
+
valence: "error"
|
|
1652
|
+
}, /* @__PURE__ */ React28.createElement(Message.Title, null, /* @__PURE__ */ React28.createElement(Warning, {
|
|
1653
|
+
className: mx19(getSize10(6), "inline mie-2")
|
|
1654
|
+
}), t("sign out chooser title")), /* @__PURE__ */ React28.createElement(Message.Body, null, t("sign out chooser message"))), /* @__PURE__ */ React28.createElement(Input, {
|
|
1655
|
+
validationMessage,
|
|
1656
|
+
label: /* @__PURE__ */ React28.createElement(StepHeading, {
|
|
1657
|
+
className: "text-start mlb-2"
|
|
1658
|
+
}, t(mode === "join new identity" ? "join new identity input label" : "reset storage input label", {
|
|
1659
|
+
confirmationValue
|
|
1660
|
+
})),
|
|
1661
|
+
disabled,
|
|
1662
|
+
"data-testid": "reset-identity-input",
|
|
1663
|
+
placeholder: confirmationValue,
|
|
1664
|
+
onChange: ({ target: { value } }) => setInputValue(value)
|
|
1665
|
+
})), /* @__PURE__ */ React28.createElement(Actions, null, onCancel && /* @__PURE__ */ React28.createElement(Action, {
|
|
1666
|
+
disabled,
|
|
1667
|
+
onClick: onCancel,
|
|
1668
|
+
"data-testid": "reset-identity-input-cancel"
|
|
1669
|
+
}, t("cancel label")), onConfirm && /* @__PURE__ */ React28.createElement(Action, {
|
|
1670
|
+
variant: "destructive",
|
|
1671
|
+
disabled: disabled || pending || inputValue !== confirmationValue,
|
|
1672
|
+
onClick: onConfirm,
|
|
1673
|
+
"data-testid": "reset-identity-input-confirm"
|
|
1674
|
+
}, pending ? t("reset in progress label") : t("reset device label"))));
|
|
1675
|
+
};
|
|
1676
|
+
|
|
1618
1677
|
// packages/sdk/shell/src/panels/IdentityPanel/IdentityPanel.tsx
|
|
1619
|
-
var
|
|
1678
|
+
var __dxlog_file6 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/IdentityPanel/IdentityPanel.tsx";
|
|
1620
1679
|
var viewStyles = "pbs-1 pbe-3 pli-3";
|
|
1621
1680
|
var IdentityHeading = ({ titleId, title, identity, onDone }) => {
|
|
1622
1681
|
const fallbackValue = keyToFallback2(identity.identityKey);
|
|
@@ -1641,7 +1700,7 @@ var IdentityHeading = ({ titleId, title, identity, onDone }) => {
|
|
|
1641
1700
|
}, identity.profile?.displayName ?? generateName3(identity.identityKey.toHex()))));
|
|
1642
1701
|
};
|
|
1643
1702
|
var IdentityPanelImpl = (props) => {
|
|
1644
|
-
const { identity, titleId, activeView, onUpdateProfile,
|
|
1703
|
+
const { identity, titleId, activeView, onUpdateProfile, onResetStorage, onJoinNewIdentity, IdentityActionChooser: IdentityActionChooserComponent = IdentityActionChooser, InvitationManager: InvitationManagerComponent = InvitationManager, onDone, ...rest } = props;
|
|
1645
1704
|
const { t } = useTranslation15("os");
|
|
1646
1705
|
const title = useMemo3(() => {
|
|
1647
1706
|
switch (activeView) {
|
|
@@ -1656,6 +1715,7 @@ var IdentityPanelImpl = (props) => {
|
|
|
1656
1715
|
activeView,
|
|
1657
1716
|
t
|
|
1658
1717
|
]);
|
|
1718
|
+
const onCancelReset = () => rest.send?.("unchooseAction");
|
|
1659
1719
|
return /* @__PURE__ */ React29.createElement(DensityProvider2, {
|
|
1660
1720
|
density: "fine"
|
|
1661
1721
|
}, /* @__PURE__ */ React29.createElement(IdentityHeading, {
|
|
@@ -1692,14 +1752,6 @@ var IdentityPanelImpl = (props) => {
|
|
|
1692
1752
|
active: activeView === "update profile form",
|
|
1693
1753
|
identity,
|
|
1694
1754
|
onUpdateProfile
|
|
1695
|
-
})), /* @__PURE__ */ React29.createElement(Viewport.View, {
|
|
1696
|
-
classNames: viewStyles,
|
|
1697
|
-
id: "signing out"
|
|
1698
|
-
}, /* @__PURE__ */ React29.createElement(SignOutChooser, {
|
|
1699
|
-
send: rest.send,
|
|
1700
|
-
active: activeView === "signing out",
|
|
1701
|
-
onResetDevice,
|
|
1702
|
-
onJoinNewIdentity
|
|
1703
1755
|
})), /* @__PURE__ */ React29.createElement(Viewport.View, {
|
|
1704
1756
|
classNames: viewStyles,
|
|
1705
1757
|
id: "agent manager"
|
|
@@ -1707,6 +1759,24 @@ var IdentityPanelImpl = (props) => {
|
|
|
1707
1759
|
send: rest.send,
|
|
1708
1760
|
active: activeView === "agent manager",
|
|
1709
1761
|
...rest
|
|
1762
|
+
})), /* @__PURE__ */ React29.createElement(Viewport.View, {
|
|
1763
|
+
classNames: viewStyles,
|
|
1764
|
+
id: "confirm join new identity"
|
|
1765
|
+
}, /* @__PURE__ */ React29.createElement(ConfirmReset, {
|
|
1766
|
+
active: activeView === "confirm join new identity",
|
|
1767
|
+
...rest,
|
|
1768
|
+
mode: "join new identity",
|
|
1769
|
+
onConfirm: onJoinNewIdentity,
|
|
1770
|
+
onCancel: onCancelReset
|
|
1771
|
+
})), /* @__PURE__ */ React29.createElement(Viewport.View, {
|
|
1772
|
+
classNames: viewStyles,
|
|
1773
|
+
id: "confirm reset storage"
|
|
1774
|
+
}, /* @__PURE__ */ React29.createElement(ConfirmReset, {
|
|
1775
|
+
active: activeView === "confirm reset storage",
|
|
1776
|
+
...rest,
|
|
1777
|
+
mode: "reset storage",
|
|
1778
|
+
onConfirm: onResetStorage,
|
|
1779
|
+
onCancel: onCancelReset
|
|
1710
1780
|
})))));
|
|
1711
1781
|
};
|
|
1712
1782
|
var IdentityPanelWithInvitationImpl = ({ invitation, ...props }) => {
|
|
@@ -1716,7 +1786,7 @@ var IdentityPanelWithInvitationImpl = ({ invitation, ...props }) => {
|
|
|
1716
1786
|
...invitationStatus
|
|
1717
1787
|
});
|
|
1718
1788
|
};
|
|
1719
|
-
var IdentityPanel = ({ titleId: propsTitleId, createInvitationUrl = (code) => code, ...props }) => {
|
|
1789
|
+
var IdentityPanel = ({ titleId: propsTitleId, createInvitationUrl = (code) => code, initialDisposition = "default", ...props }) => {
|
|
1720
1790
|
const titleId = useId5("identityPanel__heading", propsTitleId);
|
|
1721
1791
|
const client = useClient3();
|
|
1722
1792
|
const devices = useDevices();
|
|
@@ -1728,20 +1798,24 @@ var IdentityPanel = ({ titleId: propsTitleId, createInvitationUrl = (code) => co
|
|
|
1728
1798
|
invitations
|
|
1729
1799
|
});
|
|
1730
1800
|
if (!identity) {
|
|
1731
|
-
|
|
1732
|
-
F:
|
|
1733
|
-
L:
|
|
1801
|
+
log6.error("IdentityPanel rendered with no active identity.", void 0, {
|
|
1802
|
+
F: __dxlog_file6,
|
|
1803
|
+
L: 145,
|
|
1734
1804
|
S: void 0,
|
|
1735
1805
|
C: (f, a) => f(...a)
|
|
1736
1806
|
});
|
|
1737
1807
|
return null;
|
|
1738
1808
|
}
|
|
1739
|
-
const [identityState, identitySend, identityService] = useIdentityMachine(client
|
|
1809
|
+
const [identityState, identitySend, identityService] = useIdentityMachine(client, {
|
|
1810
|
+
context: {
|
|
1811
|
+
initialDisposition
|
|
1812
|
+
}
|
|
1813
|
+
});
|
|
1740
1814
|
useEffect3(() => {
|
|
1741
1815
|
const subscription = identityService.subscribe((state) => {
|
|
1742
|
-
|
|
1743
|
-
F:
|
|
1744
|
-
L:
|
|
1816
|
+
log6("[state]", state, {
|
|
1817
|
+
F: __dxlog_file6,
|
|
1818
|
+
L: 154,
|
|
1745
1819
|
S: void 0,
|
|
1746
1820
|
C: (f, a) => f(...a)
|
|
1747
1821
|
});
|
|
@@ -1767,8 +1841,10 @@ var IdentityPanel = ({ titleId: propsTitleId, createInvitationUrl = (code) => co
|
|
|
1767
1841
|
}
|
|
1768
1842
|
].some(identityState.matches):
|
|
1769
1843
|
return "update profile form";
|
|
1770
|
-
case identityState.matches("
|
|
1771
|
-
return "
|
|
1844
|
+
case identityState.matches("confirmingResetStorage"):
|
|
1845
|
+
return "confirm reset storage";
|
|
1846
|
+
case identityState.matches("confirmingJoinNewIdentity"):
|
|
1847
|
+
return "confirm join new identity";
|
|
1772
1848
|
case [
|
|
1773
1849
|
{
|
|
1774
1850
|
managingAgent: "idle"
|
|
@@ -1808,9 +1884,9 @@ var IdentityPanel = ({ titleId: propsTitleId, createInvitationUrl = (code) => co
|
|
|
1808
1884
|
};
|
|
1809
1885
|
|
|
1810
1886
|
// packages/sdk/shell/src/panels/JoinPanel/JoinPanel.tsx
|
|
1811
|
-
import
|
|
1887
|
+
import React38, { useCallback as useCallback7, useEffect as useEffect5, useMemo as useMemo4 } from "react";
|
|
1812
1888
|
import { log as log10 } from "@dxos/log";
|
|
1813
|
-
import { useClient as
|
|
1889
|
+
import { useClient as useClient5, useMulticastObservable } from "@dxos/react-client";
|
|
1814
1890
|
import { useIdentity as useIdentity2 } from "@dxos/react-client/halo";
|
|
1815
1891
|
import { DensityProvider as DensityProvider3, useId as useId7, useThemeContext as useThemeContext4 } from "@dxos/react-ui";
|
|
1816
1892
|
|
|
@@ -1851,14 +1927,14 @@ var JoinHeading = /* @__PURE__ */ forwardRef8(({ mode, titleId, onExit, exitActi
|
|
|
1851
1927
|
import { useMachine as useMachine2 } from "@xstate/react";
|
|
1852
1928
|
import { useCallback as useCallback6 } from "react";
|
|
1853
1929
|
import { assign as assign2, createMachine as createMachine2 } from "xstate";
|
|
1854
|
-
import { log as
|
|
1930
|
+
import { log as log7 } from "@dxos/log";
|
|
1855
1931
|
import { AlreadyJoinedError } from "@dxos/react-client";
|
|
1856
1932
|
import { Invitation as Invitation6, InvitationEncoder as InvitationEncoder3 } from "@dxos/react-client/invitations";
|
|
1857
|
-
var
|
|
1933
|
+
var __dxlog_file7 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/JoinPanel/joinMachine.ts";
|
|
1858
1934
|
var getInvitationSubscribable = (Kind, invitation) => {
|
|
1859
|
-
|
|
1860
|
-
F:
|
|
1861
|
-
L:
|
|
1935
|
+
log7("[subscribing to invitation]", invitation, {
|
|
1936
|
+
F: __dxlog_file7,
|
|
1937
|
+
L: 90,
|
|
1862
1938
|
S: void 0,
|
|
1863
1939
|
C: (f, a) => f(...a)
|
|
1864
1940
|
});
|
|
@@ -1866,12 +1942,12 @@ var getInvitationSubscribable = (Kind, invitation) => {
|
|
|
1866
1942
|
subscribe: (next, onError, complete) => invitation.subscribe((invitation2) => {
|
|
1867
1943
|
switch (invitation2.state) {
|
|
1868
1944
|
case Invitation6.State.CONNECTING: {
|
|
1869
|
-
|
|
1945
|
+
log7("[invitation connecting]", {
|
|
1870
1946
|
Kind,
|
|
1871
1947
|
invitation: invitation2
|
|
1872
1948
|
}, {
|
|
1873
|
-
F:
|
|
1874
|
-
L:
|
|
1949
|
+
F: __dxlog_file7,
|
|
1950
|
+
L: 101,
|
|
1875
1951
|
S: void 0,
|
|
1876
1952
|
C: (f, a) => f(...a)
|
|
1877
1953
|
});
|
|
@@ -1881,12 +1957,12 @@ var getInvitationSubscribable = (Kind, invitation) => {
|
|
|
1881
1957
|
});
|
|
1882
1958
|
}
|
|
1883
1959
|
case Invitation6.State.CONNECTED: {
|
|
1884
|
-
|
|
1960
|
+
log7("[invitation connected]", {
|
|
1885
1961
|
Kind,
|
|
1886
1962
|
invitation: invitation2
|
|
1887
1963
|
}, {
|
|
1888
|
-
F:
|
|
1889
|
-
L:
|
|
1964
|
+
F: __dxlog_file7,
|
|
1965
|
+
L: 106,
|
|
1890
1966
|
S: void 0,
|
|
1891
1967
|
C: (f, a) => f(...a)
|
|
1892
1968
|
});
|
|
@@ -1896,12 +1972,12 @@ var getInvitationSubscribable = (Kind, invitation) => {
|
|
|
1896
1972
|
});
|
|
1897
1973
|
}
|
|
1898
1974
|
case Invitation6.State.READY_FOR_AUTHENTICATION: {
|
|
1899
|
-
|
|
1975
|
+
log7("[invitation ready for authentication]", {
|
|
1900
1976
|
Kind,
|
|
1901
1977
|
invitation: invitation2
|
|
1902
1978
|
}, {
|
|
1903
|
-
F:
|
|
1904
|
-
L:
|
|
1979
|
+
F: __dxlog_file7,
|
|
1980
|
+
L: 111,
|
|
1905
1981
|
S: void 0,
|
|
1906
1982
|
C: (f, a) => f(...a)
|
|
1907
1983
|
});
|
|
@@ -1911,12 +1987,12 @@ var getInvitationSubscribable = (Kind, invitation) => {
|
|
|
1911
1987
|
});
|
|
1912
1988
|
}
|
|
1913
1989
|
case Invitation6.State.AUTHENTICATING: {
|
|
1914
|
-
|
|
1990
|
+
log7("[invitation authenticating]", {
|
|
1915
1991
|
Kind,
|
|
1916
1992
|
invitation: invitation2
|
|
1917
1993
|
}, {
|
|
1918
|
-
F:
|
|
1919
|
-
L:
|
|
1994
|
+
F: __dxlog_file7,
|
|
1995
|
+
L: 116,
|
|
1920
1996
|
S: void 0,
|
|
1921
1997
|
C: (f, a) => f(...a)
|
|
1922
1998
|
});
|
|
@@ -1926,12 +2002,12 @@ var getInvitationSubscribable = (Kind, invitation) => {
|
|
|
1926
2002
|
});
|
|
1927
2003
|
}
|
|
1928
2004
|
case Invitation6.State.SUCCESS: {
|
|
1929
|
-
|
|
2005
|
+
log7("[invitation success]", {
|
|
1930
2006
|
Kind,
|
|
1931
2007
|
invitation: invitation2
|
|
1932
2008
|
}, {
|
|
1933
|
-
F:
|
|
1934
|
-
L:
|
|
2009
|
+
F: __dxlog_file7,
|
|
2010
|
+
L: 121,
|
|
1935
2011
|
S: void 0,
|
|
1936
2012
|
C: (f, a) => f(...a)
|
|
1937
2013
|
});
|
|
@@ -1942,11 +2018,11 @@ var getInvitationSubscribable = (Kind, invitation) => {
|
|
|
1942
2018
|
return complete?.();
|
|
1943
2019
|
}
|
|
1944
2020
|
case Invitation6.State.CANCELLED: {
|
|
1945
|
-
|
|
2021
|
+
log7.warn("[invitation cancelled]", {
|
|
1946
2022
|
Kind
|
|
1947
2023
|
}, {
|
|
1948
|
-
F:
|
|
1949
|
-
L:
|
|
2024
|
+
F: __dxlog_file7,
|
|
2025
|
+
L: 127,
|
|
1950
2026
|
S: void 0,
|
|
1951
2027
|
C: (f, a) => f(...a)
|
|
1952
2028
|
});
|
|
@@ -1956,11 +2032,11 @@ var getInvitationSubscribable = (Kind, invitation) => {
|
|
|
1956
2032
|
});
|
|
1957
2033
|
}
|
|
1958
2034
|
case Invitation6.State.TIMEOUT: {
|
|
1959
|
-
|
|
2035
|
+
log7.error("[invitation timeout]", {
|
|
1960
2036
|
Kind
|
|
1961
2037
|
}, {
|
|
1962
|
-
F:
|
|
1963
|
-
L:
|
|
2038
|
+
F: __dxlog_file7,
|
|
2039
|
+
L: 132,
|
|
1964
2040
|
S: void 0,
|
|
1965
2041
|
C: (f, a) => f(...a)
|
|
1966
2042
|
});
|
|
@@ -1972,12 +2048,12 @@ var getInvitationSubscribable = (Kind, invitation) => {
|
|
|
1972
2048
|
}
|
|
1973
2049
|
}, (error) => {
|
|
1974
2050
|
if (error instanceof AlreadyJoinedError) {
|
|
1975
|
-
|
|
2051
|
+
log7("[already joined]", {
|
|
1976
2052
|
Kind,
|
|
1977
2053
|
error
|
|
1978
2054
|
}, {
|
|
1979
|
-
F:
|
|
1980
|
-
L:
|
|
2055
|
+
F: __dxlog_file7,
|
|
2056
|
+
L: 139,
|
|
1981
2057
|
S: void 0,
|
|
1982
2058
|
C: (f, a) => f(...a)
|
|
1983
2059
|
});
|
|
@@ -1987,12 +2063,12 @@ var getInvitationSubscribable = (Kind, invitation) => {
|
|
|
1987
2063
|
});
|
|
1988
2064
|
return complete?.();
|
|
1989
2065
|
}
|
|
1990
|
-
|
|
2066
|
+
log7.error("[invitation errored]", {
|
|
1991
2067
|
Kind,
|
|
1992
2068
|
error
|
|
1993
2069
|
}, {
|
|
1994
|
-
F:
|
|
1995
|
-
L:
|
|
2070
|
+
F: __dxlog_file7,
|
|
2071
|
+
L: 144,
|
|
1996
2072
|
S: void 0,
|
|
1997
2073
|
C: (f, a) => f(...a)
|
|
1998
2074
|
});
|
|
@@ -2164,6 +2240,7 @@ var joinMachine = createMachine2({
|
|
|
2164
2240
|
id: "join",
|
|
2165
2241
|
predictableActionArguments: true,
|
|
2166
2242
|
context: {
|
|
2243
|
+
initialDisposition: "default",
|
|
2167
2244
|
mode: "default",
|
|
2168
2245
|
identity: null,
|
|
2169
2246
|
halo: {},
|
|
@@ -2178,6 +2255,11 @@ var joinMachine = createMachine2({
|
|
|
2178
2255
|
target: "resettingIdentity",
|
|
2179
2256
|
actions: "log"
|
|
2180
2257
|
},
|
|
2258
|
+
{
|
|
2259
|
+
cond: "initiallyAcceptingHaloInvitation",
|
|
2260
|
+
target: "#join.choosingIdentity.acceptingHaloInvitation",
|
|
2261
|
+
actions: "log"
|
|
2262
|
+
},
|
|
2181
2263
|
{
|
|
2182
2264
|
cond: "noSelectedIdentity",
|
|
2183
2265
|
target: "choosingIdentity",
|
|
@@ -2260,6 +2342,7 @@ var joinMachine = createMachine2({
|
|
|
2260
2342
|
guards: {
|
|
2261
2343
|
existingIdentity: ({ identity, mode }, _event) => mode === "halo-only" && !!identity,
|
|
2262
2344
|
noSelectedIdentity: ({ identity }, _event) => !identity,
|
|
2345
|
+
initiallyAcceptingHaloInvitation: ({ identity, initialDisposition }, _event) => !identity && initialDisposition === "accept-halo-invitation",
|
|
2263
2346
|
hasHaloUnredeemedCode: ({ halo }, _event) => !!halo.unredeemedCode,
|
|
2264
2347
|
noSpaceInvitation: ({ space }, _event) => !space.invitation && !space.unredeemedCode
|
|
2265
2348
|
},
|
|
@@ -2311,13 +2394,13 @@ var joinMachine = createMachine2({
|
|
|
2311
2394
|
} : context.space
|
|
2312
2395
|
}),
|
|
2313
2396
|
log: (context, event) => {
|
|
2314
|
-
|
|
2397
|
+
log7("[transition]", {
|
|
2315
2398
|
event,
|
|
2316
2399
|
haloInvitation: context.halo.invitation,
|
|
2317
2400
|
spaceInvitation: context.space.invitation
|
|
2318
2401
|
}, {
|
|
2319
|
-
F:
|
|
2320
|
-
L:
|
|
2402
|
+
F: __dxlog_file7,
|
|
2403
|
+
L: 416,
|
|
2321
2404
|
S: void 0,
|
|
2322
2405
|
C: (f, a) => f(...a)
|
|
2323
2406
|
});
|
|
@@ -2329,9 +2412,9 @@ var defaultCodeFromUrl = (invitationType, text) => {
|
|
|
2329
2412
|
const searchParams = new URLSearchParams(text.substring(text.lastIndexOf("?")));
|
|
2330
2413
|
return searchParams.get(`${invitationType}InvitationCode`) ?? searchParams.get(`${invitationType}Invitation`) ?? searchParams.get("invitationCode") ?? searchParams.get("invitation") ?? text;
|
|
2331
2414
|
} catch (err) {
|
|
2332
|
-
|
|
2333
|
-
F:
|
|
2334
|
-
L:
|
|
2415
|
+
log7.catch(err, void 0, {
|
|
2416
|
+
F: __dxlog_file7,
|
|
2417
|
+
L: 443,
|
|
2335
2418
|
S: void 0,
|
|
2336
2419
|
C: (f, a) => f(...a)
|
|
2337
2420
|
});
|
|
@@ -2350,9 +2433,9 @@ var useJoinMachine = (client, options) => {
|
|
|
2350
2433
|
invitationSubscribable: getInvitationSubscribable("Halo", invitationObservable)
|
|
2351
2434
|
};
|
|
2352
2435
|
} catch (err) {
|
|
2353
|
-
|
|
2354
|
-
F:
|
|
2355
|
-
L:
|
|
2436
|
+
log7.error("Could not redeem device invitation code", err, {
|
|
2437
|
+
F: __dxlog_file7,
|
|
2438
|
+
L: 464,
|
|
2356
2439
|
S: void 0,
|
|
2357
2440
|
C: (f, a) => f(...a)
|
|
2358
2441
|
});
|
|
@@ -2375,9 +2458,9 @@ var useJoinMachine = (client, options) => {
|
|
|
2375
2458
|
invitationSubscribable: getInvitationSubscribable("Space", invitationObservable)
|
|
2376
2459
|
};
|
|
2377
2460
|
} catch (err) {
|
|
2378
|
-
|
|
2379
|
-
F:
|
|
2380
|
-
L:
|
|
2461
|
+
log7.error("Could not redeem space invitation code", err, {
|
|
2462
|
+
F: __dxlog_file7,
|
|
2463
|
+
L: 486,
|
|
2381
2464
|
S: void 0,
|
|
2382
2465
|
C: (f, a) => f(...a)
|
|
2383
2466
|
});
|
|
@@ -2540,17 +2623,17 @@ var IdentityAdded = (props) => {
|
|
|
2540
2623
|
};
|
|
2541
2624
|
|
|
2542
2625
|
// packages/sdk/shell/src/panels/JoinPanel/steps/IdentityInput.tsx
|
|
2543
|
-
import React33, { useState as
|
|
2544
|
-
import { log as
|
|
2626
|
+
import React33, { useState as useState7 } from "react";
|
|
2627
|
+
import { log as log8 } from "@dxos/log";
|
|
2545
2628
|
import { useClient as useClient4 } from "@dxos/react-client";
|
|
2546
2629
|
import { useTranslation as useTranslation19 } from "@dxos/react-ui";
|
|
2547
|
-
var
|
|
2630
|
+
var __dxlog_file8 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/JoinPanel/steps/IdentityInput.tsx";
|
|
2548
2631
|
var IdentityInput = (props) => {
|
|
2549
2632
|
const { send, method } = props;
|
|
2550
2633
|
const isRecover = method === "recover identity";
|
|
2551
2634
|
const client = useClient4();
|
|
2552
2635
|
const { t } = useTranslation19("os");
|
|
2553
|
-
const [validationMessage, setValidationMessage] =
|
|
2636
|
+
const [validationMessage, setValidationMessage] = useState7("");
|
|
2554
2637
|
const createIdentity = (displayName) => {
|
|
2555
2638
|
void client.halo.createIdentity({
|
|
2556
2639
|
[isRecover ? "seedphrase" : "displayName"]: displayName
|
|
@@ -2560,8 +2643,8 @@ var IdentityInput = (props) => {
|
|
|
2560
2643
|
identity
|
|
2561
2644
|
});
|
|
2562
2645
|
}, (error) => {
|
|
2563
|
-
|
|
2564
|
-
F:
|
|
2646
|
+
log8.catch(error, void 0, {
|
|
2647
|
+
F: __dxlog_file8,
|
|
2565
2648
|
L: 37,
|
|
2566
2649
|
S: void 0,
|
|
2567
2650
|
C: (f, a) => f(...a)
|
|
@@ -2579,7 +2662,7 @@ var IdentityInputImpl = (props) => {
|
|
|
2579
2662
|
const { method, send, active, onDisplayNameConfirm, validationMessage } = props;
|
|
2580
2663
|
const disabled = !active;
|
|
2581
2664
|
const { t } = useTranslation19("os");
|
|
2582
|
-
const [inputValue, setInputValue] =
|
|
2665
|
+
const [inputValue, setInputValue] = useState7("");
|
|
2583
2666
|
const isRecover = method === "recover identity";
|
|
2584
2667
|
return /* @__PURE__ */ React33.createElement(React33.Fragment, null, /* @__PURE__ */ React33.createElement("div", {
|
|
2585
2668
|
role: "none",
|
|
@@ -2629,18 +2712,18 @@ var InvitationAccepted = (props) => {
|
|
|
2629
2712
|
};
|
|
2630
2713
|
|
|
2631
2714
|
// packages/sdk/shell/src/panels/JoinPanel/steps/InvitationInput.tsx
|
|
2632
|
-
import React35, { useState as
|
|
2633
|
-
import { log as
|
|
2715
|
+
import React35, { useState as useState8, useEffect as useEffect4, cloneElement as cloneElement4 } from "react";
|
|
2716
|
+
import { log as log9 } from "@dxos/log";
|
|
2634
2717
|
import { useTranslation as useTranslation21 } from "@dxos/react-ui";
|
|
2635
|
-
var
|
|
2718
|
+
var __dxlog_file9 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/JoinPanel/steps/InvitationInput.tsx";
|
|
2636
2719
|
var invitationCodeFromUrl = (text) => {
|
|
2637
2720
|
try {
|
|
2638
2721
|
const searchParams = new URLSearchParams(text.substring(text.lastIndexOf("?")));
|
|
2639
2722
|
const invitation = searchParams.get("spaceInvitationCode") ?? searchParams.get("deviceInvitationCode");
|
|
2640
2723
|
return invitation ?? text;
|
|
2641
2724
|
} catch (err) {
|
|
2642
|
-
|
|
2643
|
-
F:
|
|
2725
|
+
log9.catch(err, void 0, {
|
|
2726
|
+
F: __dxlog_file9,
|
|
2644
2727
|
L: 25,
|
|
2645
2728
|
S: void 0,
|
|
2646
2729
|
C: (f, a) => f(...a)
|
|
@@ -2652,7 +2735,7 @@ var InvitationInput = (props) => {
|
|
|
2652
2735
|
const { Kind, active, send, unredeemedCode, onExit, exitActionParent, onDone, doneActionParent, succeededKeys } = props;
|
|
2653
2736
|
const disabled = !active;
|
|
2654
2737
|
const { t } = useTranslation21("os");
|
|
2655
|
-
const [inputValue, setInputValue] =
|
|
2738
|
+
const [inputValue, setInputValue] = useState8(unredeemedCode ?? "");
|
|
2656
2739
|
useEffect4(() => {
|
|
2657
2740
|
unredeemedCode && setInputValue(unredeemedCode ?? "");
|
|
2658
2741
|
}, [
|
|
@@ -2771,7 +2854,7 @@ var InvitationRescuer = (props) => {
|
|
|
2771
2854
|
};
|
|
2772
2855
|
|
|
2773
2856
|
// packages/sdk/shell/src/panels/JoinPanel/steps/InvitationAuthenticator.tsx
|
|
2774
|
-
import React37, { useState as
|
|
2857
|
+
import React37, { useState as useState9 } from "react";
|
|
2775
2858
|
import { Input as Input2, useTranslation as useTranslation23 } from "@dxos/react-ui";
|
|
2776
2859
|
import { hexToEmoji as hexToEmoji4 } from "@dxos/util";
|
|
2777
2860
|
var pinLength = 6;
|
|
@@ -2779,7 +2862,7 @@ var InvitationAuthenticator = ({ failed, Kind, active, pending, invitationId, on
|
|
|
2779
2862
|
const disabled = !active || pending;
|
|
2780
2863
|
const { t } = useTranslation23("os");
|
|
2781
2864
|
const invitationType = Kind.toLowerCase();
|
|
2782
|
-
const [authCode, setAuthCode] =
|
|
2865
|
+
const [authCode, setAuthCode] = useState9("");
|
|
2783
2866
|
const onChange = ({ target: { value } }) => {
|
|
2784
2867
|
setAuthCode(value);
|
|
2785
2868
|
if (value.length === pinLength) {
|
|
@@ -2822,64 +2905,6 @@ var InvitationAuthenticator = ({ failed, Kind, active, pending, invitationId, on
|
|
|
2822
2905
|
}, t("next label"))));
|
|
2823
2906
|
};
|
|
2824
2907
|
|
|
2825
|
-
// packages/sdk/shell/src/panels/JoinPanel/steps/ResetIdentity.tsx
|
|
2826
|
-
import React38, { useState as useState9 } from "react";
|
|
2827
|
-
import { log as log9 } from "@dxos/log";
|
|
2828
|
-
import { useClient as useClient5 } from "@dxos/react-client";
|
|
2829
|
-
import { useTranslation as useTranslation24 } from "@dxos/react-ui";
|
|
2830
|
-
var __dxlog_file9 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/JoinPanel/steps/ResetIdentity.tsx";
|
|
2831
|
-
var ResetIdentity = ({ send, active }) => {
|
|
2832
|
-
const client = useClient5();
|
|
2833
|
-
const { t } = useTranslation24("os");
|
|
2834
|
-
const [validationMessage, setValidationMessage] = useState9("");
|
|
2835
|
-
const [pending, setPending] = useState9(false);
|
|
2836
|
-
const resetIdentity = () => {
|
|
2837
|
-
setPending(true);
|
|
2838
|
-
void client.reset().then(() => send?.({
|
|
2839
|
-
type: "resetIdentity"
|
|
2840
|
-
}), (error) => {
|
|
2841
|
-
log9.catch(error, void 0, {
|
|
2842
|
-
F: __dxlog_file9,
|
|
2843
|
-
L: 35,
|
|
2844
|
-
S: void 0,
|
|
2845
|
-
C: (f, a) => f(...a)
|
|
2846
|
-
});
|
|
2847
|
-
setValidationMessage(t("failed to reset identity message"));
|
|
2848
|
-
setPending(false);
|
|
2849
|
-
});
|
|
2850
|
-
};
|
|
2851
|
-
return /* @__PURE__ */ React38.createElement(ResetIdentityImpl, {
|
|
2852
|
-
disabled: !active,
|
|
2853
|
-
pending,
|
|
2854
|
-
validationMessage,
|
|
2855
|
-
onConfirm: () => resetIdentity()
|
|
2856
|
-
});
|
|
2857
|
-
};
|
|
2858
|
-
var ResetIdentityImpl = ({ disabled, pending, validationMessage, onConfirm }) => {
|
|
2859
|
-
const { t } = useTranslation24("os");
|
|
2860
|
-
const confirmationValue = t("confirmation value");
|
|
2861
|
-
const [inputValue, setInputValue] = useState9("");
|
|
2862
|
-
return /* @__PURE__ */ React38.createElement(React38.Fragment, null, /* @__PURE__ */ React38.createElement("div", {
|
|
2863
|
-
role: "none",
|
|
2864
|
-
className: "grow flex flex-col justify-center"
|
|
2865
|
-
}, /* @__PURE__ */ React38.createElement(Input, {
|
|
2866
|
-
validationMessage,
|
|
2867
|
-
label: /* @__PURE__ */ React38.createElement(StepHeading, null, t("reset identity input label", {
|
|
2868
|
-
confirmationValue
|
|
2869
|
-
})),
|
|
2870
|
-
disabled,
|
|
2871
|
-
"data-testid": "reset-identity-input",
|
|
2872
|
-
placeholder: confirmationValue,
|
|
2873
|
-
onChange: ({ target: { value } }) => setInputValue(value)
|
|
2874
|
-
})), /* @__PURE__ */ React38.createElement(Actions, null, /* @__PURE__ */ React38.createElement(Action, {
|
|
2875
|
-
// TODO(wittjosiah): Probably make this red?
|
|
2876
|
-
variant: "primary",
|
|
2877
|
-
disabled: disabled || pending || inputValue !== confirmationValue,
|
|
2878
|
-
onClick: () => onConfirm?.(),
|
|
2879
|
-
"data-testid": "reset-identity-input-confirm"
|
|
2880
|
-
}, pending ? t("reset in progress label") : t("confirm label"))));
|
|
2881
|
-
};
|
|
2882
|
-
|
|
2883
2908
|
// packages/sdk/shell/src/styles/panelStyles.ts
|
|
2884
2909
|
var stepStyles = "pbs-1 pbe-3 pli-3";
|
|
2885
2910
|
|
|
@@ -2907,48 +2932,49 @@ var resolvedTextColor = (status) => status === Invitation7.State.ERROR ? errorTe
|
|
|
2907
2932
|
// packages/sdk/shell/src/panels/JoinPanel/JoinPanel.tsx
|
|
2908
2933
|
var __dxlog_file10 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/JoinPanel/JoinPanel.tsx";
|
|
2909
2934
|
var JoinPanelImpl = (props) => {
|
|
2910
|
-
const { titleId, send, activeView, failed, mode, unredeemedCodes, invitationStates, succeededKeys, failReasons, onExit, onHaloDone, onSpaceDone, exitActionParent, doneActionParent, onHaloInvitationCancel, onSpaceInvitationCancel, onHaloInvitationAuthenticate, onSpaceInvitationAuthenticate, IdentityInput: IdentityInputComponent = IdentityInput,
|
|
2911
|
-
return /* @__PURE__ */
|
|
2935
|
+
const { titleId, send, activeView, failed, mode, unredeemedCodes, invitationStates, succeededKeys, failReasons, onExit, onHaloDone, onSpaceDone, exitActionParent, doneActionParent, onHaloInvitationCancel, onSpaceInvitationCancel, onHaloInvitationAuthenticate, onSpaceInvitationAuthenticate, onCancelResetStorage, onConfirmResetStorage, IdentityInput: IdentityInputComponent = IdentityInput, ConfirmReset: ConfirmResetComponent = ConfirmReset } = props;
|
|
2936
|
+
return /* @__PURE__ */ React38.createElement(DensityProvider3, {
|
|
2912
2937
|
density: "fine"
|
|
2913
|
-
}, mode !== "halo-only" && /* @__PURE__ */
|
|
2938
|
+
}, mode !== "halo-only" && /* @__PURE__ */ React38.createElement(JoinHeading, {
|
|
2914
2939
|
titleId,
|
|
2915
2940
|
mode,
|
|
2916
2941
|
onExit,
|
|
2917
2942
|
exitActionParent
|
|
2918
|
-
}), /* @__PURE__ */
|
|
2943
|
+
}), /* @__PURE__ */ React38.createElement(Viewport.Root, {
|
|
2919
2944
|
focusManaged: true,
|
|
2920
2945
|
activeView
|
|
2921
|
-
}, /* @__PURE__ */
|
|
2946
|
+
}, /* @__PURE__ */ React38.createElement(Viewport.Views, null, /* @__PURE__ */ React38.createElement(Viewport.View, {
|
|
2922
2947
|
classNames: stepStyles,
|
|
2923
2948
|
id: "addition method chooser"
|
|
2924
|
-
}, /* @__PURE__ */
|
|
2949
|
+
}, /* @__PURE__ */ React38.createElement(AdditionMethodChooser, {
|
|
2925
2950
|
send,
|
|
2926
2951
|
active: activeView === "addition method chooser"
|
|
2927
|
-
})), /* @__PURE__ */
|
|
2952
|
+
})), /* @__PURE__ */ React38.createElement(Viewport.View, {
|
|
2928
2953
|
classNames: stepStyles,
|
|
2929
|
-
id: "reset
|
|
2930
|
-
}, /* @__PURE__ */
|
|
2954
|
+
id: "reset storage confirmation"
|
|
2955
|
+
}, /* @__PURE__ */ React38.createElement(ConfirmResetComponent, {
|
|
2931
2956
|
send,
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
|
|
2957
|
+
active: activeView === "reset identity confirmation",
|
|
2958
|
+
onCancel: onCancelResetStorage,
|
|
2959
|
+
onConfirm: onConfirmResetStorage
|
|
2960
|
+
})), /* @__PURE__ */ React38.createElement(Viewport.View, {
|
|
2935
2961
|
classNames: stepStyles,
|
|
2936
2962
|
id: "create identity input"
|
|
2937
|
-
}, /* @__PURE__ */
|
|
2963
|
+
}, /* @__PURE__ */ React38.createElement(IdentityInputComponent, {
|
|
2938
2964
|
send,
|
|
2939
2965
|
method: "create identity",
|
|
2940
2966
|
active: activeView === "create identity input"
|
|
2941
|
-
})), /* @__PURE__ */
|
|
2967
|
+
})), /* @__PURE__ */ React38.createElement(Viewport.View, {
|
|
2942
2968
|
classNames: stepStyles,
|
|
2943
2969
|
id: "recover identity input"
|
|
2944
|
-
}, /* @__PURE__ */
|
|
2970
|
+
}, /* @__PURE__ */ React38.createElement(IdentityInputComponent, {
|
|
2945
2971
|
send,
|
|
2946
2972
|
method: "recover identity",
|
|
2947
2973
|
active: activeView === "recover identity input"
|
|
2948
|
-
})), /* @__PURE__ */
|
|
2974
|
+
})), /* @__PURE__ */ React38.createElement(Viewport.View, {
|
|
2949
2975
|
classNames: stepStyles,
|
|
2950
2976
|
id: "halo invitation input"
|
|
2951
|
-
}, /* @__PURE__ */
|
|
2977
|
+
}, /* @__PURE__ */ React38.createElement(InvitationInput, {
|
|
2952
2978
|
send,
|
|
2953
2979
|
Kind: "Halo",
|
|
2954
2980
|
active: activeView === "halo invitation input",
|
|
@@ -2958,20 +2984,20 @@ var JoinPanelImpl = (props) => {
|
|
|
2958
2984
|
...succeededKeys?.Halo && {
|
|
2959
2985
|
succeededKeys: succeededKeys.Halo
|
|
2960
2986
|
}
|
|
2961
|
-
})), /* @__PURE__ */
|
|
2987
|
+
})), /* @__PURE__ */ React38.createElement(Viewport.View, {
|
|
2962
2988
|
classNames: stepStyles,
|
|
2963
2989
|
id: "halo invitation rescuer"
|
|
2964
|
-
}, /* @__PURE__ */
|
|
2990
|
+
}, /* @__PURE__ */ React38.createElement(InvitationRescuer, {
|
|
2965
2991
|
send,
|
|
2966
2992
|
Kind: "Halo",
|
|
2967
2993
|
active: activeView === "halo invitation rescuer",
|
|
2968
2994
|
invitationState: invitationStates?.Halo,
|
|
2969
2995
|
onInvitationCancel: onHaloInvitationCancel,
|
|
2970
2996
|
failReason: failReasons?.Halo
|
|
2971
|
-
})), /* @__PURE__ */
|
|
2997
|
+
})), /* @__PURE__ */ React38.createElement(Viewport.View, {
|
|
2972
2998
|
classNames: stepStyles,
|
|
2973
2999
|
id: "halo invitation authenticator"
|
|
2974
|
-
}, /* @__PURE__ */
|
|
3000
|
+
}, /* @__PURE__ */ React38.createElement(InvitationAuthenticator, {
|
|
2975
3001
|
send,
|
|
2976
3002
|
Kind: "Halo",
|
|
2977
3003
|
active: activeView === "halo invitation authenticator",
|
|
@@ -2980,28 +3006,28 @@ var JoinPanelImpl = (props) => {
|
|
|
2980
3006
|
...failed.has("Halo") && {
|
|
2981
3007
|
failed: true
|
|
2982
3008
|
}
|
|
2983
|
-
})), /* @__PURE__ */
|
|
3009
|
+
})), /* @__PURE__ */ React38.createElement(Viewport.View, {
|
|
2984
3010
|
classNames: stepStyles,
|
|
2985
3011
|
id: "halo invitation accepted"
|
|
2986
|
-
}, /* @__PURE__ */
|
|
3012
|
+
}, /* @__PURE__ */ React38.createElement(InvitationAccepted, {
|
|
2987
3013
|
send,
|
|
2988
3014
|
Kind: "Halo",
|
|
2989
3015
|
active: activeView === "halo invitation accepted",
|
|
2990
3016
|
doneActionParent,
|
|
2991
3017
|
onDone: onHaloDone
|
|
2992
|
-
})), /* @__PURE__ */
|
|
3018
|
+
})), /* @__PURE__ */ React38.createElement(Viewport.View, {
|
|
2993
3019
|
classNames: stepStyles,
|
|
2994
3020
|
id: "identity added"
|
|
2995
|
-
}, /* @__PURE__ */
|
|
3021
|
+
}, /* @__PURE__ */ React38.createElement(IdentityAdded, {
|
|
2996
3022
|
send,
|
|
2997
3023
|
mode,
|
|
2998
3024
|
active: activeView === "identity added",
|
|
2999
3025
|
doneActionParent,
|
|
3000
3026
|
onDone: onHaloDone
|
|
3001
|
-
})), /* @__PURE__ */
|
|
3027
|
+
})), /* @__PURE__ */ React38.createElement(Viewport.View, {
|
|
3002
3028
|
classNames: stepStyles,
|
|
3003
3029
|
id: "space invitation input"
|
|
3004
|
-
}, /* @__PURE__ */
|
|
3030
|
+
}, /* @__PURE__ */ React38.createElement(InvitationInput, {
|
|
3005
3031
|
send,
|
|
3006
3032
|
Kind: "Space",
|
|
3007
3033
|
active: activeView === "space invitation input",
|
|
@@ -3013,20 +3039,20 @@ var JoinPanelImpl = (props) => {
|
|
|
3013
3039
|
},
|
|
3014
3040
|
onExit,
|
|
3015
3041
|
exitActionParent
|
|
3016
|
-
})), /* @__PURE__ */
|
|
3042
|
+
})), /* @__PURE__ */ React38.createElement(Viewport.View, {
|
|
3017
3043
|
classNames: stepStyles,
|
|
3018
3044
|
id: "space invitation rescuer"
|
|
3019
|
-
}, /* @__PURE__ */
|
|
3045
|
+
}, /* @__PURE__ */ React38.createElement(InvitationRescuer, {
|
|
3020
3046
|
send,
|
|
3021
3047
|
Kind: "Space",
|
|
3022
3048
|
active: activeView === "space invitation rescuer",
|
|
3023
3049
|
invitationState: invitationStates?.Space,
|
|
3024
3050
|
onInvitationCancel: onSpaceInvitationCancel,
|
|
3025
3051
|
failReason: failReasons?.Space
|
|
3026
|
-
})), /* @__PURE__ */
|
|
3052
|
+
})), /* @__PURE__ */ React38.createElement(Viewport.View, {
|
|
3027
3053
|
classNames: stepStyles,
|
|
3028
3054
|
id: "space invitation authenticator"
|
|
3029
|
-
}, /* @__PURE__ */
|
|
3055
|
+
}, /* @__PURE__ */ React38.createElement(InvitationAuthenticator, {
|
|
3030
3056
|
send,
|
|
3031
3057
|
Kind: "Space",
|
|
3032
3058
|
active: activeView === "space invitation authenticator",
|
|
@@ -3035,10 +3061,10 @@ var JoinPanelImpl = (props) => {
|
|
|
3035
3061
|
...failed.has("Space") && {
|
|
3036
3062
|
failed: true
|
|
3037
3063
|
}
|
|
3038
|
-
})), /* @__PURE__ */
|
|
3064
|
+
})), /* @__PURE__ */ React38.createElement(Viewport.View, {
|
|
3039
3065
|
classNames: stepStyles,
|
|
3040
3066
|
id: "space invitation accepted"
|
|
3041
|
-
}, /* @__PURE__ */
|
|
3067
|
+
}, /* @__PURE__ */ React38.createElement(InvitationAccepted, {
|
|
3042
3068
|
send,
|
|
3043
3069
|
Kind: "Space",
|
|
3044
3070
|
active: activeView === "space invitation accepted",
|
|
@@ -3046,14 +3072,15 @@ var JoinPanelImpl = (props) => {
|
|
|
3046
3072
|
onDone: onSpaceDone
|
|
3047
3073
|
})))));
|
|
3048
3074
|
};
|
|
3049
|
-
var JoinPanel = ({ titleId: propsTitleId, mode = "default", initialInvitationCode, exitActionParent, onExit, doneActionParent, onDone: propsOnDone }) => {
|
|
3050
|
-
const client =
|
|
3075
|
+
var JoinPanel = ({ titleId: propsTitleId, mode = "default", initialDisposition = "default", initialInvitationCode, exitActionParent, onExit, doneActionParent, onDone: propsOnDone, onCancelResetStorage }) => {
|
|
3076
|
+
const client = useClient5();
|
|
3051
3077
|
const identity = useIdentity2();
|
|
3052
3078
|
const { hasIosKeyboard } = useThemeContext4();
|
|
3053
3079
|
const titleId = useId7("joinPanel__heading", propsTitleId);
|
|
3054
3080
|
const [joinState, joinSend, joinService] = useJoinMachine(client, {
|
|
3055
3081
|
context: {
|
|
3056
3082
|
mode,
|
|
3083
|
+
initialDisposition,
|
|
3057
3084
|
identity,
|
|
3058
3085
|
...initialInvitationCode && {
|
|
3059
3086
|
[mode === "halo-only" ? "halo" : "space"]: {
|
|
@@ -3066,7 +3093,7 @@ var JoinPanel = ({ titleId: propsTitleId, mode = "default", initialInvitationCod
|
|
|
3066
3093
|
const subscription = joinService.subscribe((state) => {
|
|
3067
3094
|
log10("[state]", state, {
|
|
3068
3095
|
F: __dxlog_file10,
|
|
3069
|
-
L:
|
|
3096
|
+
L: 204,
|
|
3070
3097
|
S: void 0,
|
|
3071
3098
|
C: (f, a) => f(...a)
|
|
3072
3099
|
});
|
|
@@ -3278,7 +3305,15 @@ var JoinPanel = ({ titleId: propsTitleId, mode = "default", initialInvitationCod
|
|
|
3278
3305
|
joinState,
|
|
3279
3306
|
propsOnDone
|
|
3280
3307
|
]);
|
|
3281
|
-
|
|
3308
|
+
const onConfirmResetStorage = useCallback7(() => client.reset().then(() => {
|
|
3309
|
+
joinSend({
|
|
3310
|
+
type: "resetIdentity"
|
|
3311
|
+
});
|
|
3312
|
+
}), [
|
|
3313
|
+
client,
|
|
3314
|
+
joinSend
|
|
3315
|
+
]);
|
|
3316
|
+
return /* @__PURE__ */ React38.createElement(JoinPanelImpl, {
|
|
3282
3317
|
titleId,
|
|
3283
3318
|
mode,
|
|
3284
3319
|
send: joinSend,
|
|
@@ -3311,16 +3346,18 @@ var JoinPanel = ({ titleId: propsTitleId, mode = "default", initialInvitationCod
|
|
|
3311
3346
|
type: "authenticateSpaceVerificationCode"
|
|
3312
3347
|
});
|
|
3313
3348
|
return joinState.context.space.invitationObservable?.authenticate(authCode);
|
|
3314
|
-
}
|
|
3349
|
+
},
|
|
3350
|
+
onConfirmResetStorage,
|
|
3351
|
+
onCancelResetStorage
|
|
3315
3352
|
});
|
|
3316
3353
|
};
|
|
3317
3354
|
|
|
3318
3355
|
// packages/sdk/shell/src/panels/SpacePanel/SpacePanel.tsx
|
|
3319
3356
|
import { Planet } from "@phosphor-icons/react";
|
|
3320
|
-
import
|
|
3357
|
+
import React40, { useEffect as useEffect6, useMemo as useMemo5 } from "react";
|
|
3321
3358
|
import { log as log13 } from "@dxos/log";
|
|
3322
3359
|
import { useInvitationStatus as useInvitationStatus3 } from "@dxos/react-client/invitations";
|
|
3323
|
-
import { DensityProvider as DensityProvider4, useId as useId8, useTranslation as
|
|
3360
|
+
import { DensityProvider as DensityProvider4, useId as useId8, useTranslation as useTranslation25 } from "@dxos/react-ui";
|
|
3324
3361
|
|
|
3325
3362
|
// packages/sdk/shell/src/panels/SpacePanel/spaceMachine.ts
|
|
3326
3363
|
import { useMachine as useMachine3 } from "@xstate/react";
|
|
@@ -3386,18 +3423,18 @@ var useSpaceMachine = (options) => {
|
|
|
3386
3423
|
|
|
3387
3424
|
// packages/sdk/shell/src/panels/SpacePanel/steps/SpaceManager.tsx
|
|
3388
3425
|
import { Placeholder as Placeholder2, UserPlus, UsersThree } from "@phosphor-icons/react";
|
|
3389
|
-
import
|
|
3426
|
+
import React39, { useCallback as useCallback8, useState as useState10 } from "react";
|
|
3390
3427
|
import { log as log12 } from "@dxos/log";
|
|
3391
3428
|
import { useConfig } from "@dxos/react-client";
|
|
3392
3429
|
import { useSpaceInvitations as useSpaceInvitations2 } from "@dxos/react-client/echo";
|
|
3393
3430
|
import { Invitation as Invitation8, InvitationEncoder as InvitationEncoder4 } from "@dxos/react-client/invitations";
|
|
3394
|
-
import { ScrollArea, useTranslation as
|
|
3431
|
+
import { ScrollArea, useTranslation as useTranslation24 } from "@dxos/react-ui";
|
|
3395
3432
|
import { descriptionText as descriptionText10, mx as mx22 } from "@dxos/react-ui-theme";
|
|
3396
3433
|
var __dxlog_file12 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/SpacePanel/steps/SpaceManager.tsx";
|
|
3397
3434
|
var activeActionKey = "dxos:react-shell/space-manager/active-action";
|
|
3398
3435
|
var SpaceManager = (props) => {
|
|
3399
3436
|
const { space, target } = props;
|
|
3400
|
-
const { t } =
|
|
3437
|
+
const { t } = useTranslation24("os");
|
|
3401
3438
|
const config = useConfig();
|
|
3402
3439
|
const invitations = useSpaceInvitations2(space?.key);
|
|
3403
3440
|
const onInvitationEvent = useCallback8((invitation) => {
|
|
@@ -3450,7 +3487,7 @@ var SpaceManager = (props) => {
|
|
|
3450
3487
|
])
|
|
3451
3488
|
}
|
|
3452
3489
|
};
|
|
3453
|
-
return /* @__PURE__ */
|
|
3490
|
+
return /* @__PURE__ */ React39.createElement(SpaceManagerImpl, {
|
|
3454
3491
|
...props,
|
|
3455
3492
|
invitations,
|
|
3456
3493
|
inviteActions
|
|
@@ -3459,7 +3496,7 @@ var SpaceManager = (props) => {
|
|
|
3459
3496
|
var headingFragment = "pis-3 pie-1 plb-1 mbe-1 font-medium";
|
|
3460
3497
|
var SpaceManagerImpl = (props) => {
|
|
3461
3498
|
const { active, space, createInvitationUrl, send, inviteActions: propsInviteActions, invitations, showInactiveInvitations, SpaceMemberList: SpaceMemberListComponent = SpaceMemberList, InvitationList: InvitationListComponent = InvitationList } = props;
|
|
3462
|
-
const { t } =
|
|
3499
|
+
const { t } = useTranslation24("os");
|
|
3463
3500
|
const inviteActions = propsInviteActions ?? {
|
|
3464
3501
|
noopInvite: {
|
|
3465
3502
|
label: t("create space invitation label"),
|
|
@@ -3477,26 +3514,26 @@ var SpaceManagerImpl = (props) => {
|
|
|
3477
3514
|
const visibleInvitations = showInactiveInvitations ? invitations : invitations?.filter((invitation) => ![
|
|
3478
3515
|
Invitation8.State.CANCELLED
|
|
3479
3516
|
].includes(invitation.get().state));
|
|
3480
|
-
return /* @__PURE__ */
|
|
3517
|
+
return /* @__PURE__ */ React39.createElement(React39.Fragment, null, /* @__PURE__ */ React39.createElement(ScrollArea.Root, {
|
|
3481
3518
|
classNames: "grow shrink basis-28 -mli-2"
|
|
3482
|
-
}, /* @__PURE__ */
|
|
3519
|
+
}, /* @__PURE__ */ React39.createElement(ScrollArea.Viewport, {
|
|
3483
3520
|
classNames: "is-full pie-2"
|
|
3484
|
-
}, !!visibleInvitations?.length && /* @__PURE__ */
|
|
3521
|
+
}, !!visibleInvitations?.length && /* @__PURE__ */ React39.createElement(React39.Fragment, null, /* @__PURE__ */ React39.createElement("h3", {
|
|
3485
3522
|
className: mx22(headingFragment, descriptionText10)
|
|
3486
|
-
}, t("invitation list heading")), /* @__PURE__ */
|
|
3523
|
+
}, t("invitation list heading")), /* @__PURE__ */ React39.createElement(InvitationListComponent, {
|
|
3487
3524
|
className: "mb-2",
|
|
3488
3525
|
send,
|
|
3489
3526
|
invitations: visibleInvitations ?? [],
|
|
3490
3527
|
onClickRemove: (invitation) => invitation.cancel(),
|
|
3491
3528
|
createInvitationUrl
|
|
3492
|
-
}), /* @__PURE__ */
|
|
3529
|
+
}), /* @__PURE__ */ React39.createElement("h3", {
|
|
3493
3530
|
className: mx22(headingFragment, descriptionText10, "mbs-2")
|
|
3494
|
-
}, t("space member list heading"))), /* @__PURE__ */
|
|
3531
|
+
}, t("space member list heading"))), /* @__PURE__ */ React39.createElement(SpaceMemberListComponent, {
|
|
3495
3532
|
spaceKey: space.key,
|
|
3496
3533
|
includeSelf: true
|
|
3497
|
-
})), /* @__PURE__ */
|
|
3534
|
+
})), /* @__PURE__ */ React39.createElement(ScrollArea.Scrollbar, {
|
|
3498
3535
|
orientation: "vertical"
|
|
3499
|
-
}, /* @__PURE__ */
|
|
3536
|
+
}, /* @__PURE__ */ React39.createElement(ScrollArea.Thumb, null))), /* @__PURE__ */ React39.createElement(Actions, null, /* @__PURE__ */ React39.createElement(BifurcatedAction, {
|
|
3500
3537
|
disabled: !active,
|
|
3501
3538
|
actions: inviteActions,
|
|
3502
3539
|
activeAction,
|
|
@@ -3508,47 +3545,47 @@ var SpaceManagerImpl = (props) => {
|
|
|
3508
3545
|
// packages/sdk/shell/src/panels/SpacePanel/SpacePanel.tsx
|
|
3509
3546
|
var __dxlog_file13 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/SpacePanel/SpacePanel.tsx";
|
|
3510
3547
|
var SpacePanelHeading = ({ titleId, space, onDone }) => {
|
|
3511
|
-
const { t } =
|
|
3548
|
+
const { t } = useTranslation25("os");
|
|
3512
3549
|
const name = space.properties.name;
|
|
3513
|
-
return /* @__PURE__ */
|
|
3550
|
+
return /* @__PURE__ */ React40.createElement(Heading, {
|
|
3514
3551
|
titleId,
|
|
3515
3552
|
title: t("space panel heading"),
|
|
3516
|
-
corner: /* @__PURE__ */
|
|
3553
|
+
corner: /* @__PURE__ */ React40.createElement(CloseButton, {
|
|
3517
3554
|
"data-testid": "identity-panel-done",
|
|
3518
3555
|
onDone
|
|
3519
3556
|
})
|
|
3520
|
-
}, /* @__PURE__ */
|
|
3557
|
+
}, /* @__PURE__ */ React40.createElement("div", {
|
|
3521
3558
|
role: "none",
|
|
3522
3559
|
className: "flex gap-4 items-center justify-center mlb-4"
|
|
3523
|
-
}, /* @__PURE__ */
|
|
3560
|
+
}, /* @__PURE__ */ React40.createElement(Planet, {
|
|
3524
3561
|
size: 32,
|
|
3525
3562
|
weight: "light"
|
|
3526
|
-
}), /* @__PURE__ */
|
|
3563
|
+
}), /* @__PURE__ */ React40.createElement("div", {
|
|
3527
3564
|
className: "block text-start font-light text-xl"
|
|
3528
3565
|
}, name ?? space.key.truncate())));
|
|
3529
3566
|
};
|
|
3530
3567
|
var SpacePanelImpl = (props) => {
|
|
3531
3568
|
const { titleId, activeView, space, target, SpaceManager: SpaceManagerComponent = SpaceManager, InvitationManager: InvitationManagerComponent = InvitationManager, ...rest } = props;
|
|
3532
|
-
return /* @__PURE__ */
|
|
3569
|
+
return /* @__PURE__ */ React40.createElement(DensityProvider4, {
|
|
3533
3570
|
density: "fine"
|
|
3534
|
-
}, /* @__PURE__ */
|
|
3571
|
+
}, /* @__PURE__ */ React40.createElement(SpacePanelHeading, {
|
|
3535
3572
|
...rest,
|
|
3536
3573
|
titleId,
|
|
3537
3574
|
space
|
|
3538
|
-
}), /* @__PURE__ */
|
|
3575
|
+
}), /* @__PURE__ */ React40.createElement(Viewport.Root, {
|
|
3539
3576
|
activeView
|
|
3540
|
-
}, /* @__PURE__ */
|
|
3577
|
+
}, /* @__PURE__ */ React40.createElement(Viewport.Views, null, /* @__PURE__ */ React40.createElement(Viewport.View, {
|
|
3541
3578
|
id: "space manager",
|
|
3542
3579
|
classNames: stepStyles
|
|
3543
|
-
}, /* @__PURE__ */
|
|
3580
|
+
}, /* @__PURE__ */ React40.createElement(SpaceManagerComponent, {
|
|
3544
3581
|
active: activeView === "space manager",
|
|
3545
3582
|
space,
|
|
3546
3583
|
target,
|
|
3547
3584
|
...rest
|
|
3548
|
-
})), /* @__PURE__ */
|
|
3585
|
+
})), /* @__PURE__ */ React40.createElement(Viewport.View, {
|
|
3549
3586
|
id: "space invitation manager",
|
|
3550
3587
|
classNames: stepStyles
|
|
3551
|
-
}, /* @__PURE__ */
|
|
3588
|
+
}, /* @__PURE__ */ React40.createElement(InvitationManagerComponent, {
|
|
3552
3589
|
active: activeView === "space invitation manager",
|
|
3553
3590
|
...rest,
|
|
3554
3591
|
invitationUrl: props.invitationUrl
|
|
@@ -3556,7 +3593,7 @@ var SpacePanelImpl = (props) => {
|
|
|
3556
3593
|
};
|
|
3557
3594
|
var SpacePanelWithInvitationImpl = ({ invitation, ...props }) => {
|
|
3558
3595
|
const invitationStatus = useInvitationStatus3(invitation);
|
|
3559
|
-
return /* @__PURE__ */
|
|
3596
|
+
return /* @__PURE__ */ React40.createElement(SpacePanelImpl, {
|
|
3560
3597
|
...props,
|
|
3561
3598
|
...invitationStatus,
|
|
3562
3599
|
invitationUrl: props.createInvitationUrl(invitationStatus.invitationCode)
|
|
@@ -3603,16 +3640,31 @@ var SpacePanel = ({ titleId: propsTitleId, createInvitationUrl = (code) => code,
|
|
|
3603
3640
|
};
|
|
3604
3641
|
return spaceState.context.invitation ? (
|
|
3605
3642
|
// TODO(wittjosiah): Unused? Remove?
|
|
3606
|
-
/* @__PURE__ */
|
|
3643
|
+
/* @__PURE__ */ React40.createElement(SpacePanelWithInvitationImpl, {
|
|
3607
3644
|
...implProps,
|
|
3608
3645
|
invitation: spaceState.context.invitation
|
|
3609
3646
|
})
|
|
3610
|
-
) : /* @__PURE__ */
|
|
3647
|
+
) : /* @__PURE__ */ React40.createElement(SpacePanelImpl, implProps);
|
|
3648
|
+
};
|
|
3649
|
+
|
|
3650
|
+
// packages/sdk/shell/src/panels/StatusPanel/StatusPanel.tsx
|
|
3651
|
+
import React41 from "react";
|
|
3652
|
+
import { Status, useTranslation as useTranslation26 } from "@dxos/react-ui";
|
|
3653
|
+
var StatusPanel = ({ titleId }) => {
|
|
3654
|
+
const { t } = useTranslation26("os");
|
|
3655
|
+
return /* @__PURE__ */ React41.createElement("div", {
|
|
3656
|
+
className: "grid place-items-center p-2 gap-2"
|
|
3657
|
+
}, /* @__PURE__ */ React41.createElement("p", {
|
|
3658
|
+
id: titleId,
|
|
3659
|
+
className: "font-medium text-center"
|
|
3660
|
+
}, t("resetting message")), /* @__PURE__ */ React41.createElement(Status, {
|
|
3661
|
+
indeterminate: true
|
|
3662
|
+
}, t("resetting message")));
|
|
3611
3663
|
};
|
|
3612
3664
|
|
|
3613
3665
|
// packages/sdk/shell/src/composites/IdentityDialog/IdentityDialog.tsx
|
|
3614
3666
|
var IdentityDialog = (props) => {
|
|
3615
|
-
const titleId = useId9("
|
|
3667
|
+
const titleId = useId9("identityDialog__title", props.title);
|
|
3616
3668
|
return /* @__PURE__ */ React42.createElement(Dialog.Root, {
|
|
3617
3669
|
defaultOpen: true,
|
|
3618
3670
|
onOpenChange: (open) => open || props.onDone?.()
|
|
@@ -3659,7 +3711,7 @@ var JoinDialog = (joinPanelProps) => {
|
|
|
3659
3711
|
};
|
|
3660
3712
|
|
|
3661
3713
|
// packages/sdk/shell/src/composites/Shell/run-shell.tsx
|
|
3662
|
-
import
|
|
3714
|
+
import React47, { StrictMode } from "react";
|
|
3663
3715
|
import { createRoot } from "react-dom/client";
|
|
3664
3716
|
import { DEFAULT_CLIENT_CHANNEL, DEFAULT_SHELL_CHANNEL } from "@dxos/client-protocol";
|
|
3665
3717
|
import { ShellRuntimeImpl } from "@dxos/client-services";
|
|
@@ -3669,9 +3721,9 @@ import { defaultTx } from "@dxos/react-ui-theme";
|
|
|
3669
3721
|
import { createIFramePort } from "@dxos/rpc-tunnel";
|
|
3670
3722
|
|
|
3671
3723
|
// packages/sdk/shell/src/composites/Shell/Shell.tsx
|
|
3672
|
-
import
|
|
3724
|
+
import React46, { useEffect as useEffect7, useState as useState11 } from "react";
|
|
3673
3725
|
import { log as log14 } from "@dxos/log";
|
|
3674
|
-
import { ShellDisplay, ShellLayout, useClient as
|
|
3726
|
+
import { ShellDisplay, ShellLayout, useClient as useClient6 } from "@dxos/react-client";
|
|
3675
3727
|
import { useSpace as useSpace2 } from "@dxos/react-client/echo";
|
|
3676
3728
|
|
|
3677
3729
|
// packages/sdk/shell/src/composites/SpaceDialog/SpaceDialog.tsx
|
|
@@ -3693,6 +3745,20 @@ var SpaceDialog = (spacePanelProps) => {
|
|
|
3693
3745
|
}))))));
|
|
3694
3746
|
};
|
|
3695
3747
|
|
|
3748
|
+
// packages/sdk/shell/src/composites/StatusDialog/StatusDialog.tsx
|
|
3749
|
+
import React45 from "react";
|
|
3750
|
+
import { AlertDialog as AlertDialog2, useId as useId12 } from "@dxos/react-ui";
|
|
3751
|
+
var StatusDialog = () => {
|
|
3752
|
+
const titleId = useId12("statusDialog__title");
|
|
3753
|
+
return /* @__PURE__ */ React45.createElement(AlertDialog2.Root, {
|
|
3754
|
+
open: true
|
|
3755
|
+
}, /* @__PURE__ */ React45.createElement(AlertDialog2.Portal, null, /* @__PURE__ */ React45.createElement(AlertDialog2.Overlay, null, /* @__PURE__ */ React45.createElement(AlertDialog2.Content, {
|
|
3756
|
+
"aria-labelledby": titleId
|
|
3757
|
+
}, /* @__PURE__ */ React45.createElement(StatusPanel, {
|
|
3758
|
+
titleId
|
|
3759
|
+
})))));
|
|
3760
|
+
};
|
|
3761
|
+
|
|
3696
3762
|
// packages/sdk/shell/src/composites/Shell/Shell.tsx
|
|
3697
3763
|
var __dxlog_file14 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/composites/Shell/Shell.tsx";
|
|
3698
3764
|
var Shell = ({ runtime, origin }) => {
|
|
@@ -3702,7 +3768,7 @@ var Shell = ({ runtime, origin }) => {
|
|
|
3702
3768
|
spaceKey: runtime.spaceKey,
|
|
3703
3769
|
target: runtime.target
|
|
3704
3770
|
});
|
|
3705
|
-
const client =
|
|
3771
|
+
const client = useClient6();
|
|
3706
3772
|
const space = useSpace2(spaceKey);
|
|
3707
3773
|
useEffect7(() => {
|
|
3708
3774
|
return runtime.layoutUpdate.on((request) => setLayout(request));
|
|
@@ -3713,7 +3779,7 @@ var Shell = ({ runtime, origin }) => {
|
|
|
3713
3779
|
if (layout === ShellLayout.SPACE && !space) {
|
|
3714
3780
|
log14.warn("No space found for shell space invitations.", void 0, {
|
|
3715
3781
|
F: __dxlog_file14,
|
|
3716
|
-
L:
|
|
3782
|
+
L: 33,
|
|
3717
3783
|
S: void 0,
|
|
3718
3784
|
C: (f, a) => f(...a)
|
|
3719
3785
|
});
|
|
@@ -3733,10 +3799,17 @@ var Shell = ({ runtime, origin }) => {
|
|
|
3733
3799
|
space
|
|
3734
3800
|
]);
|
|
3735
3801
|
switch (layout) {
|
|
3802
|
+
case ShellLayout.STATUS:
|
|
3803
|
+
return /* @__PURE__ */ React46.createElement(StatusDialog, null);
|
|
3736
3804
|
case ShellLayout.INITIALIZE_IDENTITY:
|
|
3737
|
-
|
|
3805
|
+
case ShellLayout.INITIALIZE_IDENTITY_FROM_INVITATION:
|
|
3806
|
+
return /* @__PURE__ */ React46.createElement(JoinDialog, {
|
|
3738
3807
|
mode: "halo-only",
|
|
3808
|
+
initialDisposition: layout === ShellLayout.INITIALIZE_IDENTITY_FROM_INVITATION ? "accept-halo-invitation" : "default",
|
|
3739
3809
|
initialInvitationCode: invitationCode,
|
|
3810
|
+
onCancelResetStorage: () => runtime.setLayout({
|
|
3811
|
+
layout: ShellLayout.IDENTITY
|
|
3812
|
+
}),
|
|
3740
3813
|
onDone: () => {
|
|
3741
3814
|
void runtime.setAppContext({
|
|
3742
3815
|
display: ShellDisplay.NONE
|
|
@@ -3749,18 +3822,27 @@ var Shell = ({ runtime, origin }) => {
|
|
|
3749
3822
|
case ShellLayout.IDENTITY:
|
|
3750
3823
|
case ShellLayout.SHARE_IDENTITY:
|
|
3751
3824
|
case ShellLayout.EDIT_PROFILE:
|
|
3752
|
-
return /* @__PURE__ */
|
|
3825
|
+
return /* @__PURE__ */ React46.createElement(IdentityDialog, {
|
|
3753
3826
|
createInvitationUrl: (invitationCode2) => `${origin}?deviceInvitationCode=${invitationCode2}`,
|
|
3754
|
-
|
|
3827
|
+
onResetStorage: async () => {
|
|
3828
|
+
runtime.setLayout({
|
|
3829
|
+
layout: ShellLayout.STATUS
|
|
3830
|
+
});
|
|
3755
3831
|
await client.reset();
|
|
3756
|
-
|
|
3832
|
+
return runtime.setAppContext({
|
|
3757
3833
|
display: ShellDisplay.NONE,
|
|
3758
3834
|
reload: true
|
|
3759
3835
|
});
|
|
3760
3836
|
},
|
|
3761
|
-
onJoinNewIdentity: () =>
|
|
3762
|
-
|
|
3763
|
-
|
|
3837
|
+
onJoinNewIdentity: async () => {
|
|
3838
|
+
runtime.setLayout({
|
|
3839
|
+
layout: ShellLayout.STATUS
|
|
3840
|
+
});
|
|
3841
|
+
await client.reset();
|
|
3842
|
+
return runtime.setLayout({
|
|
3843
|
+
layout: ShellLayout.INITIALIZE_IDENTITY_FROM_INVITATION
|
|
3844
|
+
});
|
|
3845
|
+
},
|
|
3764
3846
|
onDone: async () => {
|
|
3765
3847
|
await runtime.setAppContext({
|
|
3766
3848
|
display: ShellDisplay.NONE
|
|
@@ -3768,10 +3850,11 @@ var Shell = ({ runtime, origin }) => {
|
|
|
3768
3850
|
runtime.setLayout({
|
|
3769
3851
|
layout: ShellLayout.DEFAULT
|
|
3770
3852
|
});
|
|
3771
|
-
}
|
|
3853
|
+
},
|
|
3854
|
+
initialDisposition: layout === ShellLayout.SHARE_IDENTITY ? "manage-device-invitation" : layout === ShellLayout.EDIT_PROFILE ? "manage-profile" : "default"
|
|
3772
3855
|
});
|
|
3773
3856
|
case ShellLayout.SPACE:
|
|
3774
|
-
return space ? /* @__PURE__ */
|
|
3857
|
+
return space ? /* @__PURE__ */ React46.createElement(SpaceDialog, {
|
|
3775
3858
|
space,
|
|
3776
3859
|
target,
|
|
3777
3860
|
createInvitationUrl: (invitationCode2) => `${origin}?spaceInvitationCode=${invitationCode2}`,
|
|
@@ -3785,7 +3868,7 @@ var Shell = ({ runtime, origin }) => {
|
|
|
3785
3868
|
}
|
|
3786
3869
|
}) : null;
|
|
3787
3870
|
case ShellLayout.JOIN_SPACE:
|
|
3788
|
-
return /* @__PURE__ */
|
|
3871
|
+
return /* @__PURE__ */ React46.createElement(JoinDialog, {
|
|
3789
3872
|
initialInvitationCode: invitationCode,
|
|
3790
3873
|
onDone: async (result) => {
|
|
3791
3874
|
const target2 = result?.target ?? void 0;
|
|
@@ -3888,7 +3971,8 @@ var os = {
|
|
|
3888
3971
|
"choose add device label": "Add device",
|
|
3889
3972
|
"choose devices label": "Manage devices",
|
|
3890
3973
|
"choose profile label": "Edit profile",
|
|
3891
|
-
"choose sign out label": "
|
|
3974
|
+
"choose sign out label": "Reset storage",
|
|
3975
|
+
"choose join new identity label": "Join existing device",
|
|
3892
3976
|
"empty space members message": "There is nobody in this space yet.",
|
|
3893
3977
|
"back to all invitations label": "Back to all invitations",
|
|
3894
3978
|
"invitation heading": "Invitation",
|
|
@@ -3912,18 +3996,20 @@ var os = {
|
|
|
3912
3996
|
"invite options label": "Change the active invite option.",
|
|
3913
3997
|
"reset in progress label": "Resetting...",
|
|
3914
3998
|
"confirm label": "Confirm",
|
|
3915
|
-
"reset
|
|
3999
|
+
"reset storage input label": "This will clear this device and all associated data. Type {{confirmationValue}} and confirm to continue.",
|
|
4000
|
+
"join new identity input label": "In order to join an existing device, storage on this device must be cleared first. Type {{confirmationValue}} to continue.",
|
|
3916
4001
|
"failed to reset identity message": "Failed to reset identity.",
|
|
3917
4002
|
"confirmation value": "CONFIRM",
|
|
3918
|
-
"sign out chooser title": "
|
|
3919
|
-
"sign out chooser message": "Proceeding with
|
|
4003
|
+
"sign out chooser title": "Danger zone",
|
|
4004
|
+
"sign out chooser message": "Proceeding with the action below will erase all data on this device.",
|
|
3920
4005
|
"join new identity label": "Join a new identity",
|
|
3921
|
-
"reset device label": "Reset
|
|
4006
|
+
"reset device label": "Reset storage",
|
|
3922
4007
|
"reset device confirm message": "Are you sure you want to reset your device? All data will be lost.",
|
|
3923
4008
|
"emoji and color label": "Emoji and color",
|
|
3924
4009
|
"clear label": "Use default",
|
|
3925
4010
|
"select emoji label": "Choose an emoji to use in your avatar",
|
|
3926
4011
|
"select hue label": "Choose a hue to use in your avatar",
|
|
4012
|
+
"resetting message": "One moment while things are reset\u2026",
|
|
3927
4013
|
"red label": "Red",
|
|
3928
4014
|
"orange label": "Orange",
|
|
3929
4015
|
"amber label": "Amber",
|
|
@@ -3964,25 +4050,25 @@ var runShell = async (config = new Config()) => {
|
|
|
3964
4050
|
runtime.open(),
|
|
3965
4051
|
client.initialize()
|
|
3966
4052
|
]);
|
|
3967
|
-
createRoot(document.getElementById("root")).render(/* @__PURE__ */
|
|
4053
|
+
createRoot(document.getElementById("root")).render(/* @__PURE__ */ React47.createElement(StrictMode, null, /* @__PURE__ */ React47.createElement(ThemeProvider, {
|
|
3968
4054
|
tx: defaultTx,
|
|
3969
4055
|
resourceExtensions: [
|
|
3970
4056
|
osTranslations
|
|
3971
4057
|
]
|
|
3972
|
-
}, /* @__PURE__ */
|
|
4058
|
+
}, /* @__PURE__ */ React47.createElement(ClientContext.Provider, {
|
|
3973
4059
|
value: {
|
|
3974
4060
|
client,
|
|
3975
4061
|
status: SystemStatus.ACTIVE
|
|
3976
4062
|
}
|
|
3977
|
-
}, /* @__PURE__ */
|
|
4063
|
+
}, /* @__PURE__ */ React47.createElement(ClipboardProvider, null, /* @__PURE__ */ React47.createElement(Tooltip5.Provider, null, /* @__PURE__ */ React47.createElement(Shell, {
|
|
3978
4064
|
runtime,
|
|
3979
4065
|
origin: location.origin
|
|
3980
4066
|
})))))));
|
|
3981
4067
|
};
|
|
3982
4068
|
|
|
3983
4069
|
// packages/sdk/shell/src/composites/Shell/ShellContext.tsx
|
|
3984
|
-
import
|
|
3985
|
-
import { ShellDisplay as ShellDisplay2, ShellLayout as ShellLayout3, useClient as
|
|
4070
|
+
import React48, { createContext as createContext2, useCallback as useCallback9, useContext as useContext2, useEffect as useEffect8, useMemo as useMemo6, useState as useState12 } from "react";
|
|
4071
|
+
import { ShellDisplay as ShellDisplay2, ShellLayout as ShellLayout3, useClient as useClient7 } from "@dxos/react-client";
|
|
3986
4072
|
import { useIdentity as useIdentity3 } from "@dxos/react-client/halo";
|
|
3987
4073
|
import { mx as mx23 } from "@dxos/react-ui-theme";
|
|
3988
4074
|
|
|
@@ -4020,7 +4106,7 @@ var MemoryShellRuntime = class {
|
|
|
4020
4106
|
// packages/sdk/shell/src/composites/Shell/ShellContext.tsx
|
|
4021
4107
|
var ShellContext = /* @__PURE__ */ createContext2({});
|
|
4022
4108
|
var useShell = () => {
|
|
4023
|
-
const client =
|
|
4109
|
+
const client = useClient7();
|
|
4024
4110
|
const { runtime, setDisplay } = useContext2(ShellContext);
|
|
4025
4111
|
const setLayout = async (layout, options) => {
|
|
4026
4112
|
if (runtime) {
|
|
@@ -4041,7 +4127,7 @@ var useShell = () => {
|
|
|
4041
4127
|
};
|
|
4042
4128
|
};
|
|
4043
4129
|
var ShellProvider = ({ space, deviceInvitationCode, spaceInvitationCode, onJoinedSpace, children }) => {
|
|
4044
|
-
const client =
|
|
4130
|
+
const client = useClient7();
|
|
4045
4131
|
const identity = useIdentity3();
|
|
4046
4132
|
const [display, setDisplay] = useState12(!identity || spaceInvitationCode || deviceInvitationCode ? ShellDisplay2.FULLSCREEN : ShellDisplay2.NONE);
|
|
4047
4133
|
const shellRuntime = useMemo6(() => {
|
|
@@ -4113,12 +4199,12 @@ var ShellProvider = ({ space, deviceInvitationCode, spaceInvitationCode, onJoine
|
|
|
4113
4199
|
}, [
|
|
4114
4200
|
shellRuntime
|
|
4115
4201
|
]);
|
|
4116
|
-
return /* @__PURE__ */
|
|
4202
|
+
return /* @__PURE__ */ React48.createElement(React48.Fragment, null, shellRuntime && /* @__PURE__ */ React48.createElement("div", {
|
|
4117
4203
|
className: mx23(display === ShellDisplay2.NONE ? "hidden" : "")
|
|
4118
|
-
}, /* @__PURE__ */
|
|
4204
|
+
}, /* @__PURE__ */ React48.createElement(Shell, {
|
|
4119
4205
|
runtime: shellRuntime,
|
|
4120
4206
|
origin: window.location.origin
|
|
4121
|
-
})), /* @__PURE__ */
|
|
4207
|
+
})), /* @__PURE__ */ React48.createElement(ShellContext.Provider, {
|
|
4122
4208
|
value: {
|
|
4123
4209
|
runtime: shellRuntime,
|
|
4124
4210
|
setDisplay
|
|
@@ -4135,6 +4221,8 @@ export {
|
|
|
4135
4221
|
ClipboardProvider,
|
|
4136
4222
|
CloseButton,
|
|
4137
4223
|
CompoundButton,
|
|
4224
|
+
ConfirmReset,
|
|
4225
|
+
ConfirmResetImpl,
|
|
4138
4226
|
CopyButton,
|
|
4139
4227
|
CopyButtonIconOnly,
|
|
4140
4228
|
DeviceList,
|
|
@@ -4165,6 +4253,7 @@ export {
|
|
|
4165
4253
|
SpaceMemberListImpl,
|
|
4166
4254
|
SpacePanel,
|
|
4167
4255
|
SpacePanelImpl,
|
|
4256
|
+
StatusPanel,
|
|
4168
4257
|
StepHeading,
|
|
4169
4258
|
Viewport,
|
|
4170
4259
|
activeBgColor,
|