@dxos/shell 0.4.10-main.d560ca0 → 0.4.10-main.e158b1a
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 +8269 -8199
- 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 +418 -328
- package/dist/lib/browser/react.mjs.map +4 -4
- package/dist/lib/browser/testing/index.mjs +5 -7
- package/dist/lib/browser/testing/index.mjs.map +3 -3
- 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 +71 -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/testing/shell-manager.d.ts.map +1 -1
- package/dist/types/src/testing/shell-manager.js +5 -7
- package/dist/types/src/testing/shell-manager.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 +112 -0
- package/src/steps/StepProps.ts +2 -1
- package/src/steps/index.ts +1 -0
- package/src/testing/shell-manager.ts +5 -7
- 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,76 @@ 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
|
+
const testIdAffix = mode === "join new identity" ? "join-new-identity" : "reset-storage";
|
|
1648
|
+
return /* @__PURE__ */ React28.createElement(React28.Fragment, null, /* @__PURE__ */ React28.createElement("div", {
|
|
1649
|
+
role: "none",
|
|
1650
|
+
className: "grow flex flex-col gap-2 justify-center"
|
|
1651
|
+
}, /* @__PURE__ */ React28.createElement(Message.Root, {
|
|
1652
|
+
valence: "error"
|
|
1653
|
+
}, /* @__PURE__ */ React28.createElement(Message.Title, null, /* @__PURE__ */ React28.createElement(Warning, {
|
|
1654
|
+
className: mx19(getSize10(6), "inline mie-2")
|
|
1655
|
+
}), t("sign out chooser title")), /* @__PURE__ */ React28.createElement(Message.Body, null, t("sign out chooser message"))), /* @__PURE__ */ React28.createElement(Input, {
|
|
1656
|
+
validationMessage,
|
|
1657
|
+
label: /* @__PURE__ */ React28.createElement(StepHeading, {
|
|
1658
|
+
className: "text-start mlb-2"
|
|
1659
|
+
}, t(mode === "join new identity" ? "join new identity input label" : "reset storage input label", {
|
|
1660
|
+
confirmationValue
|
|
1661
|
+
})),
|
|
1662
|
+
disabled,
|
|
1663
|
+
"data-testid": `${testIdAffix}.reset-identity-input`,
|
|
1664
|
+
placeholder: confirmationValue,
|
|
1665
|
+
onChange: ({ target: { value } }) => setInputValue(value)
|
|
1666
|
+
})), /* @__PURE__ */ React28.createElement(Actions, null, onCancel && /* @__PURE__ */ React28.createElement(Action, {
|
|
1667
|
+
disabled,
|
|
1668
|
+
onClick: onCancel,
|
|
1669
|
+
"data-testid": `${testIdAffix}.reset-identity-cancel`
|
|
1670
|
+
}, t("cancel label")), onConfirm && /* @__PURE__ */ React28.createElement(Action, {
|
|
1671
|
+
variant: "destructive",
|
|
1672
|
+
disabled: disabled || pending || inputValue !== confirmationValue,
|
|
1673
|
+
onClick: onConfirm,
|
|
1674
|
+
"data-testid": `${testIdAffix}.reset-identity-confirm`
|
|
1675
|
+
}, pending ? t("reset in progress label") : t("reset device label"))));
|
|
1676
|
+
};
|
|
1677
|
+
|
|
1618
1678
|
// packages/sdk/shell/src/panels/IdentityPanel/IdentityPanel.tsx
|
|
1619
|
-
var
|
|
1679
|
+
var __dxlog_file6 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/IdentityPanel/IdentityPanel.tsx";
|
|
1620
1680
|
var viewStyles = "pbs-1 pbe-3 pli-3";
|
|
1621
1681
|
var IdentityHeading = ({ titleId, title, identity, onDone }) => {
|
|
1622
1682
|
const fallbackValue = keyToFallback2(identity.identityKey);
|
|
@@ -1641,7 +1701,7 @@ var IdentityHeading = ({ titleId, title, identity, onDone }) => {
|
|
|
1641
1701
|
}, identity.profile?.displayName ?? generateName3(identity.identityKey.toHex()))));
|
|
1642
1702
|
};
|
|
1643
1703
|
var IdentityPanelImpl = (props) => {
|
|
1644
|
-
const { identity, titleId, activeView, onUpdateProfile,
|
|
1704
|
+
const { identity, titleId, activeView, onUpdateProfile, onResetStorage, onJoinNewIdentity, IdentityActionChooser: IdentityActionChooserComponent = IdentityActionChooser, InvitationManager: InvitationManagerComponent = InvitationManager, onDone, ...rest } = props;
|
|
1645
1705
|
const { t } = useTranslation15("os");
|
|
1646
1706
|
const title = useMemo3(() => {
|
|
1647
1707
|
switch (activeView) {
|
|
@@ -1656,6 +1716,7 @@ var IdentityPanelImpl = (props) => {
|
|
|
1656
1716
|
activeView,
|
|
1657
1717
|
t
|
|
1658
1718
|
]);
|
|
1719
|
+
const onCancelReset = () => rest.send?.("unchooseAction");
|
|
1659
1720
|
return /* @__PURE__ */ React29.createElement(DensityProvider2, {
|
|
1660
1721
|
density: "fine"
|
|
1661
1722
|
}, /* @__PURE__ */ React29.createElement(IdentityHeading, {
|
|
@@ -1692,14 +1753,6 @@ var IdentityPanelImpl = (props) => {
|
|
|
1692
1753
|
active: activeView === "update profile form",
|
|
1693
1754
|
identity,
|
|
1694
1755
|
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
1756
|
})), /* @__PURE__ */ React29.createElement(Viewport.View, {
|
|
1704
1757
|
classNames: viewStyles,
|
|
1705
1758
|
id: "agent manager"
|
|
@@ -1707,6 +1760,24 @@ var IdentityPanelImpl = (props) => {
|
|
|
1707
1760
|
send: rest.send,
|
|
1708
1761
|
active: activeView === "agent manager",
|
|
1709
1762
|
...rest
|
|
1763
|
+
})), /* @__PURE__ */ React29.createElement(Viewport.View, {
|
|
1764
|
+
classNames: viewStyles,
|
|
1765
|
+
id: "confirm join new identity"
|
|
1766
|
+
}, /* @__PURE__ */ React29.createElement(ConfirmReset, {
|
|
1767
|
+
active: activeView === "confirm join new identity",
|
|
1768
|
+
...rest,
|
|
1769
|
+
mode: "join new identity",
|
|
1770
|
+
onConfirm: onJoinNewIdentity,
|
|
1771
|
+
onCancel: onCancelReset
|
|
1772
|
+
})), /* @__PURE__ */ React29.createElement(Viewport.View, {
|
|
1773
|
+
classNames: viewStyles,
|
|
1774
|
+
id: "confirm reset storage"
|
|
1775
|
+
}, /* @__PURE__ */ React29.createElement(ConfirmReset, {
|
|
1776
|
+
active: activeView === "confirm reset storage",
|
|
1777
|
+
...rest,
|
|
1778
|
+
mode: "reset storage",
|
|
1779
|
+
onConfirm: onResetStorage,
|
|
1780
|
+
onCancel: onCancelReset
|
|
1710
1781
|
})))));
|
|
1711
1782
|
};
|
|
1712
1783
|
var IdentityPanelWithInvitationImpl = ({ invitation, ...props }) => {
|
|
@@ -1716,7 +1787,7 @@ var IdentityPanelWithInvitationImpl = ({ invitation, ...props }) => {
|
|
|
1716
1787
|
...invitationStatus
|
|
1717
1788
|
});
|
|
1718
1789
|
};
|
|
1719
|
-
var IdentityPanel = ({ titleId: propsTitleId, createInvitationUrl = (code) => code, ...props }) => {
|
|
1790
|
+
var IdentityPanel = ({ titleId: propsTitleId, createInvitationUrl = (code) => code, initialDisposition = "default", ...props }) => {
|
|
1720
1791
|
const titleId = useId5("identityPanel__heading", propsTitleId);
|
|
1721
1792
|
const client = useClient3();
|
|
1722
1793
|
const devices = useDevices();
|
|
@@ -1728,20 +1799,24 @@ var IdentityPanel = ({ titleId: propsTitleId, createInvitationUrl = (code) => co
|
|
|
1728
1799
|
invitations
|
|
1729
1800
|
});
|
|
1730
1801
|
if (!identity) {
|
|
1731
|
-
|
|
1732
|
-
F:
|
|
1733
|
-
L:
|
|
1802
|
+
log6.error("IdentityPanel rendered with no active identity.", void 0, {
|
|
1803
|
+
F: __dxlog_file6,
|
|
1804
|
+
L: 145,
|
|
1734
1805
|
S: void 0,
|
|
1735
1806
|
C: (f, a) => f(...a)
|
|
1736
1807
|
});
|
|
1737
1808
|
return null;
|
|
1738
1809
|
}
|
|
1739
|
-
const [identityState, identitySend, identityService] = useIdentityMachine(client
|
|
1810
|
+
const [identityState, identitySend, identityService] = useIdentityMachine(client, {
|
|
1811
|
+
context: {
|
|
1812
|
+
initialDisposition
|
|
1813
|
+
}
|
|
1814
|
+
});
|
|
1740
1815
|
useEffect3(() => {
|
|
1741
1816
|
const subscription = identityService.subscribe((state) => {
|
|
1742
|
-
|
|
1743
|
-
F:
|
|
1744
|
-
L:
|
|
1817
|
+
log6("[state]", state, {
|
|
1818
|
+
F: __dxlog_file6,
|
|
1819
|
+
L: 154,
|
|
1745
1820
|
S: void 0,
|
|
1746
1821
|
C: (f, a) => f(...a)
|
|
1747
1822
|
});
|
|
@@ -1767,8 +1842,10 @@ var IdentityPanel = ({ titleId: propsTitleId, createInvitationUrl = (code) => co
|
|
|
1767
1842
|
}
|
|
1768
1843
|
].some(identityState.matches):
|
|
1769
1844
|
return "update profile form";
|
|
1770
|
-
case identityState.matches("
|
|
1771
|
-
return "
|
|
1845
|
+
case identityState.matches("confirmingResetStorage"):
|
|
1846
|
+
return "confirm reset storage";
|
|
1847
|
+
case identityState.matches("confirmingJoinNewIdentity"):
|
|
1848
|
+
return "confirm join new identity";
|
|
1772
1849
|
case [
|
|
1773
1850
|
{
|
|
1774
1851
|
managingAgent: "idle"
|
|
@@ -1808,9 +1885,9 @@ var IdentityPanel = ({ titleId: propsTitleId, createInvitationUrl = (code) => co
|
|
|
1808
1885
|
};
|
|
1809
1886
|
|
|
1810
1887
|
// packages/sdk/shell/src/panels/JoinPanel/JoinPanel.tsx
|
|
1811
|
-
import
|
|
1888
|
+
import React38, { useCallback as useCallback7, useEffect as useEffect5, useMemo as useMemo4 } from "react";
|
|
1812
1889
|
import { log as log10 } from "@dxos/log";
|
|
1813
|
-
import { useClient as
|
|
1890
|
+
import { useClient as useClient5, useMulticastObservable } from "@dxos/react-client";
|
|
1814
1891
|
import { useIdentity as useIdentity2 } from "@dxos/react-client/halo";
|
|
1815
1892
|
import { DensityProvider as DensityProvider3, useId as useId7, useThemeContext as useThemeContext4 } from "@dxos/react-ui";
|
|
1816
1893
|
|
|
@@ -1851,14 +1928,14 @@ var JoinHeading = /* @__PURE__ */ forwardRef8(({ mode, titleId, onExit, exitActi
|
|
|
1851
1928
|
import { useMachine as useMachine2 } from "@xstate/react";
|
|
1852
1929
|
import { useCallback as useCallback6 } from "react";
|
|
1853
1930
|
import { assign as assign2, createMachine as createMachine2 } from "xstate";
|
|
1854
|
-
import { log as
|
|
1931
|
+
import { log as log7 } from "@dxos/log";
|
|
1855
1932
|
import { AlreadyJoinedError } from "@dxos/react-client";
|
|
1856
1933
|
import { Invitation as Invitation6, InvitationEncoder as InvitationEncoder3 } from "@dxos/react-client/invitations";
|
|
1857
|
-
var
|
|
1934
|
+
var __dxlog_file7 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/JoinPanel/joinMachine.ts";
|
|
1858
1935
|
var getInvitationSubscribable = (Kind, invitation) => {
|
|
1859
|
-
|
|
1860
|
-
F:
|
|
1861
|
-
L:
|
|
1936
|
+
log7("[subscribing to invitation]", invitation, {
|
|
1937
|
+
F: __dxlog_file7,
|
|
1938
|
+
L: 90,
|
|
1862
1939
|
S: void 0,
|
|
1863
1940
|
C: (f, a) => f(...a)
|
|
1864
1941
|
});
|
|
@@ -1866,12 +1943,12 @@ var getInvitationSubscribable = (Kind, invitation) => {
|
|
|
1866
1943
|
subscribe: (next, onError, complete) => invitation.subscribe((invitation2) => {
|
|
1867
1944
|
switch (invitation2.state) {
|
|
1868
1945
|
case Invitation6.State.CONNECTING: {
|
|
1869
|
-
|
|
1946
|
+
log7("[invitation connecting]", {
|
|
1870
1947
|
Kind,
|
|
1871
1948
|
invitation: invitation2
|
|
1872
1949
|
}, {
|
|
1873
|
-
F:
|
|
1874
|
-
L:
|
|
1950
|
+
F: __dxlog_file7,
|
|
1951
|
+
L: 101,
|
|
1875
1952
|
S: void 0,
|
|
1876
1953
|
C: (f, a) => f(...a)
|
|
1877
1954
|
});
|
|
@@ -1881,12 +1958,12 @@ var getInvitationSubscribable = (Kind, invitation) => {
|
|
|
1881
1958
|
});
|
|
1882
1959
|
}
|
|
1883
1960
|
case Invitation6.State.CONNECTED: {
|
|
1884
|
-
|
|
1961
|
+
log7("[invitation connected]", {
|
|
1885
1962
|
Kind,
|
|
1886
1963
|
invitation: invitation2
|
|
1887
1964
|
}, {
|
|
1888
|
-
F:
|
|
1889
|
-
L:
|
|
1965
|
+
F: __dxlog_file7,
|
|
1966
|
+
L: 106,
|
|
1890
1967
|
S: void 0,
|
|
1891
1968
|
C: (f, a) => f(...a)
|
|
1892
1969
|
});
|
|
@@ -1896,12 +1973,12 @@ var getInvitationSubscribable = (Kind, invitation) => {
|
|
|
1896
1973
|
});
|
|
1897
1974
|
}
|
|
1898
1975
|
case Invitation6.State.READY_FOR_AUTHENTICATION: {
|
|
1899
|
-
|
|
1976
|
+
log7("[invitation ready for authentication]", {
|
|
1900
1977
|
Kind,
|
|
1901
1978
|
invitation: invitation2
|
|
1902
1979
|
}, {
|
|
1903
|
-
F:
|
|
1904
|
-
L:
|
|
1980
|
+
F: __dxlog_file7,
|
|
1981
|
+
L: 111,
|
|
1905
1982
|
S: void 0,
|
|
1906
1983
|
C: (f, a) => f(...a)
|
|
1907
1984
|
});
|
|
@@ -1911,12 +1988,12 @@ var getInvitationSubscribable = (Kind, invitation) => {
|
|
|
1911
1988
|
});
|
|
1912
1989
|
}
|
|
1913
1990
|
case Invitation6.State.AUTHENTICATING: {
|
|
1914
|
-
|
|
1991
|
+
log7("[invitation authenticating]", {
|
|
1915
1992
|
Kind,
|
|
1916
1993
|
invitation: invitation2
|
|
1917
1994
|
}, {
|
|
1918
|
-
F:
|
|
1919
|
-
L:
|
|
1995
|
+
F: __dxlog_file7,
|
|
1996
|
+
L: 116,
|
|
1920
1997
|
S: void 0,
|
|
1921
1998
|
C: (f, a) => f(...a)
|
|
1922
1999
|
});
|
|
@@ -1926,12 +2003,12 @@ var getInvitationSubscribable = (Kind, invitation) => {
|
|
|
1926
2003
|
});
|
|
1927
2004
|
}
|
|
1928
2005
|
case Invitation6.State.SUCCESS: {
|
|
1929
|
-
|
|
2006
|
+
log7("[invitation success]", {
|
|
1930
2007
|
Kind,
|
|
1931
2008
|
invitation: invitation2
|
|
1932
2009
|
}, {
|
|
1933
|
-
F:
|
|
1934
|
-
L:
|
|
2010
|
+
F: __dxlog_file7,
|
|
2011
|
+
L: 121,
|
|
1935
2012
|
S: void 0,
|
|
1936
2013
|
C: (f, a) => f(...a)
|
|
1937
2014
|
});
|
|
@@ -1942,11 +2019,11 @@ var getInvitationSubscribable = (Kind, invitation) => {
|
|
|
1942
2019
|
return complete?.();
|
|
1943
2020
|
}
|
|
1944
2021
|
case Invitation6.State.CANCELLED: {
|
|
1945
|
-
|
|
2022
|
+
log7.warn("[invitation cancelled]", {
|
|
1946
2023
|
Kind
|
|
1947
2024
|
}, {
|
|
1948
|
-
F:
|
|
1949
|
-
L:
|
|
2025
|
+
F: __dxlog_file7,
|
|
2026
|
+
L: 127,
|
|
1950
2027
|
S: void 0,
|
|
1951
2028
|
C: (f, a) => f(...a)
|
|
1952
2029
|
});
|
|
@@ -1956,11 +2033,11 @@ var getInvitationSubscribable = (Kind, invitation) => {
|
|
|
1956
2033
|
});
|
|
1957
2034
|
}
|
|
1958
2035
|
case Invitation6.State.TIMEOUT: {
|
|
1959
|
-
|
|
2036
|
+
log7.error("[invitation timeout]", {
|
|
1960
2037
|
Kind
|
|
1961
2038
|
}, {
|
|
1962
|
-
F:
|
|
1963
|
-
L:
|
|
2039
|
+
F: __dxlog_file7,
|
|
2040
|
+
L: 132,
|
|
1964
2041
|
S: void 0,
|
|
1965
2042
|
C: (f, a) => f(...a)
|
|
1966
2043
|
});
|
|
@@ -1972,12 +2049,12 @@ var getInvitationSubscribable = (Kind, invitation) => {
|
|
|
1972
2049
|
}
|
|
1973
2050
|
}, (error) => {
|
|
1974
2051
|
if (error instanceof AlreadyJoinedError) {
|
|
1975
|
-
|
|
2052
|
+
log7("[already joined]", {
|
|
1976
2053
|
Kind,
|
|
1977
2054
|
error
|
|
1978
2055
|
}, {
|
|
1979
|
-
F:
|
|
1980
|
-
L:
|
|
2056
|
+
F: __dxlog_file7,
|
|
2057
|
+
L: 139,
|
|
1981
2058
|
S: void 0,
|
|
1982
2059
|
C: (f, a) => f(...a)
|
|
1983
2060
|
});
|
|
@@ -1987,12 +2064,12 @@ var getInvitationSubscribable = (Kind, invitation) => {
|
|
|
1987
2064
|
});
|
|
1988
2065
|
return complete?.();
|
|
1989
2066
|
}
|
|
1990
|
-
|
|
2067
|
+
log7.error("[invitation errored]", {
|
|
1991
2068
|
Kind,
|
|
1992
2069
|
error
|
|
1993
2070
|
}, {
|
|
1994
|
-
F:
|
|
1995
|
-
L:
|
|
2071
|
+
F: __dxlog_file7,
|
|
2072
|
+
L: 144,
|
|
1996
2073
|
S: void 0,
|
|
1997
2074
|
C: (f, a) => f(...a)
|
|
1998
2075
|
});
|
|
@@ -2164,6 +2241,7 @@ var joinMachine = createMachine2({
|
|
|
2164
2241
|
id: "join",
|
|
2165
2242
|
predictableActionArguments: true,
|
|
2166
2243
|
context: {
|
|
2244
|
+
initialDisposition: "default",
|
|
2167
2245
|
mode: "default",
|
|
2168
2246
|
identity: null,
|
|
2169
2247
|
halo: {},
|
|
@@ -2178,6 +2256,11 @@ var joinMachine = createMachine2({
|
|
|
2178
2256
|
target: "resettingIdentity",
|
|
2179
2257
|
actions: "log"
|
|
2180
2258
|
},
|
|
2259
|
+
{
|
|
2260
|
+
cond: "initiallyAcceptingHaloInvitation",
|
|
2261
|
+
target: "#join.choosingIdentity.acceptingHaloInvitation",
|
|
2262
|
+
actions: "log"
|
|
2263
|
+
},
|
|
2181
2264
|
{
|
|
2182
2265
|
cond: "noSelectedIdentity",
|
|
2183
2266
|
target: "choosingIdentity",
|
|
@@ -2260,6 +2343,7 @@ var joinMachine = createMachine2({
|
|
|
2260
2343
|
guards: {
|
|
2261
2344
|
existingIdentity: ({ identity, mode }, _event) => mode === "halo-only" && !!identity,
|
|
2262
2345
|
noSelectedIdentity: ({ identity }, _event) => !identity,
|
|
2346
|
+
initiallyAcceptingHaloInvitation: ({ identity, initialDisposition }, _event) => !identity && initialDisposition === "accept-halo-invitation",
|
|
2263
2347
|
hasHaloUnredeemedCode: ({ halo }, _event) => !!halo.unredeemedCode,
|
|
2264
2348
|
noSpaceInvitation: ({ space }, _event) => !space.invitation && !space.unredeemedCode
|
|
2265
2349
|
},
|
|
@@ -2311,13 +2395,13 @@ var joinMachine = createMachine2({
|
|
|
2311
2395
|
} : context.space
|
|
2312
2396
|
}),
|
|
2313
2397
|
log: (context, event) => {
|
|
2314
|
-
|
|
2398
|
+
log7("[transition]", {
|
|
2315
2399
|
event,
|
|
2316
2400
|
haloInvitation: context.halo.invitation,
|
|
2317
2401
|
spaceInvitation: context.space.invitation
|
|
2318
2402
|
}, {
|
|
2319
|
-
F:
|
|
2320
|
-
L:
|
|
2403
|
+
F: __dxlog_file7,
|
|
2404
|
+
L: 416,
|
|
2321
2405
|
S: void 0,
|
|
2322
2406
|
C: (f, a) => f(...a)
|
|
2323
2407
|
});
|
|
@@ -2329,9 +2413,9 @@ var defaultCodeFromUrl = (invitationType, text) => {
|
|
|
2329
2413
|
const searchParams = new URLSearchParams(text.substring(text.lastIndexOf("?")));
|
|
2330
2414
|
return searchParams.get(`${invitationType}InvitationCode`) ?? searchParams.get(`${invitationType}Invitation`) ?? searchParams.get("invitationCode") ?? searchParams.get("invitation") ?? text;
|
|
2331
2415
|
} catch (err) {
|
|
2332
|
-
|
|
2333
|
-
F:
|
|
2334
|
-
L:
|
|
2416
|
+
log7.catch(err, void 0, {
|
|
2417
|
+
F: __dxlog_file7,
|
|
2418
|
+
L: 443,
|
|
2335
2419
|
S: void 0,
|
|
2336
2420
|
C: (f, a) => f(...a)
|
|
2337
2421
|
});
|
|
@@ -2350,9 +2434,9 @@ var useJoinMachine = (client, options) => {
|
|
|
2350
2434
|
invitationSubscribable: getInvitationSubscribable("Halo", invitationObservable)
|
|
2351
2435
|
};
|
|
2352
2436
|
} catch (err) {
|
|
2353
|
-
|
|
2354
|
-
F:
|
|
2355
|
-
L:
|
|
2437
|
+
log7.error("Could not redeem device invitation code", err, {
|
|
2438
|
+
F: __dxlog_file7,
|
|
2439
|
+
L: 464,
|
|
2356
2440
|
S: void 0,
|
|
2357
2441
|
C: (f, a) => f(...a)
|
|
2358
2442
|
});
|
|
@@ -2375,9 +2459,9 @@ var useJoinMachine = (client, options) => {
|
|
|
2375
2459
|
invitationSubscribable: getInvitationSubscribable("Space", invitationObservable)
|
|
2376
2460
|
};
|
|
2377
2461
|
} catch (err) {
|
|
2378
|
-
|
|
2379
|
-
F:
|
|
2380
|
-
L:
|
|
2462
|
+
log7.error("Could not redeem space invitation code", err, {
|
|
2463
|
+
F: __dxlog_file7,
|
|
2464
|
+
L: 486,
|
|
2381
2465
|
S: void 0,
|
|
2382
2466
|
C: (f, a) => f(...a)
|
|
2383
2467
|
});
|
|
@@ -2540,17 +2624,17 @@ var IdentityAdded = (props) => {
|
|
|
2540
2624
|
};
|
|
2541
2625
|
|
|
2542
2626
|
// packages/sdk/shell/src/panels/JoinPanel/steps/IdentityInput.tsx
|
|
2543
|
-
import React33, { useState as
|
|
2544
|
-
import { log as
|
|
2627
|
+
import React33, { useState as useState7 } from "react";
|
|
2628
|
+
import { log as log8 } from "@dxos/log";
|
|
2545
2629
|
import { useClient as useClient4 } from "@dxos/react-client";
|
|
2546
2630
|
import { useTranslation as useTranslation19 } from "@dxos/react-ui";
|
|
2547
|
-
var
|
|
2631
|
+
var __dxlog_file8 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/JoinPanel/steps/IdentityInput.tsx";
|
|
2548
2632
|
var IdentityInput = (props) => {
|
|
2549
2633
|
const { send, method } = props;
|
|
2550
2634
|
const isRecover = method === "recover identity";
|
|
2551
2635
|
const client = useClient4();
|
|
2552
2636
|
const { t } = useTranslation19("os");
|
|
2553
|
-
const [validationMessage, setValidationMessage] =
|
|
2637
|
+
const [validationMessage, setValidationMessage] = useState7("");
|
|
2554
2638
|
const createIdentity = (displayName) => {
|
|
2555
2639
|
void client.halo.createIdentity({
|
|
2556
2640
|
[isRecover ? "seedphrase" : "displayName"]: displayName
|
|
@@ -2560,8 +2644,8 @@ var IdentityInput = (props) => {
|
|
|
2560
2644
|
identity
|
|
2561
2645
|
});
|
|
2562
2646
|
}, (error) => {
|
|
2563
|
-
|
|
2564
|
-
F:
|
|
2647
|
+
log8.catch(error, void 0, {
|
|
2648
|
+
F: __dxlog_file8,
|
|
2565
2649
|
L: 37,
|
|
2566
2650
|
S: void 0,
|
|
2567
2651
|
C: (f, a) => f(...a)
|
|
@@ -2579,7 +2663,7 @@ var IdentityInputImpl = (props) => {
|
|
|
2579
2663
|
const { method, send, active, onDisplayNameConfirm, validationMessage } = props;
|
|
2580
2664
|
const disabled = !active;
|
|
2581
2665
|
const { t } = useTranslation19("os");
|
|
2582
|
-
const [inputValue, setInputValue] =
|
|
2666
|
+
const [inputValue, setInputValue] = useState7("");
|
|
2583
2667
|
const isRecover = method === "recover identity";
|
|
2584
2668
|
return /* @__PURE__ */ React33.createElement(React33.Fragment, null, /* @__PURE__ */ React33.createElement("div", {
|
|
2585
2669
|
role: "none",
|
|
@@ -2629,18 +2713,18 @@ var InvitationAccepted = (props) => {
|
|
|
2629
2713
|
};
|
|
2630
2714
|
|
|
2631
2715
|
// packages/sdk/shell/src/panels/JoinPanel/steps/InvitationInput.tsx
|
|
2632
|
-
import React35, { useState as
|
|
2633
|
-
import { log as
|
|
2716
|
+
import React35, { useState as useState8, useEffect as useEffect4, cloneElement as cloneElement4 } from "react";
|
|
2717
|
+
import { log as log9 } from "@dxos/log";
|
|
2634
2718
|
import { useTranslation as useTranslation21 } from "@dxos/react-ui";
|
|
2635
|
-
var
|
|
2719
|
+
var __dxlog_file9 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/JoinPanel/steps/InvitationInput.tsx";
|
|
2636
2720
|
var invitationCodeFromUrl = (text) => {
|
|
2637
2721
|
try {
|
|
2638
2722
|
const searchParams = new URLSearchParams(text.substring(text.lastIndexOf("?")));
|
|
2639
2723
|
const invitation = searchParams.get("spaceInvitationCode") ?? searchParams.get("deviceInvitationCode");
|
|
2640
2724
|
return invitation ?? text;
|
|
2641
2725
|
} catch (err) {
|
|
2642
|
-
|
|
2643
|
-
F:
|
|
2726
|
+
log9.catch(err, void 0, {
|
|
2727
|
+
F: __dxlog_file9,
|
|
2644
2728
|
L: 25,
|
|
2645
2729
|
S: void 0,
|
|
2646
2730
|
C: (f, a) => f(...a)
|
|
@@ -2652,7 +2736,7 @@ var InvitationInput = (props) => {
|
|
|
2652
2736
|
const { Kind, active, send, unredeemedCode, onExit, exitActionParent, onDone, doneActionParent, succeededKeys } = props;
|
|
2653
2737
|
const disabled = !active;
|
|
2654
2738
|
const { t } = useTranslation21("os");
|
|
2655
|
-
const [inputValue, setInputValue] =
|
|
2739
|
+
const [inputValue, setInputValue] = useState8(unredeemedCode ?? "");
|
|
2656
2740
|
useEffect4(() => {
|
|
2657
2741
|
unredeemedCode && setInputValue(unredeemedCode ?? "");
|
|
2658
2742
|
}, [
|
|
@@ -2771,7 +2855,7 @@ var InvitationRescuer = (props) => {
|
|
|
2771
2855
|
};
|
|
2772
2856
|
|
|
2773
2857
|
// packages/sdk/shell/src/panels/JoinPanel/steps/InvitationAuthenticator.tsx
|
|
2774
|
-
import React37, { useState as
|
|
2858
|
+
import React37, { useState as useState9 } from "react";
|
|
2775
2859
|
import { Input as Input2, useTranslation as useTranslation23 } from "@dxos/react-ui";
|
|
2776
2860
|
import { hexToEmoji as hexToEmoji4 } from "@dxos/util";
|
|
2777
2861
|
var pinLength = 6;
|
|
@@ -2779,7 +2863,7 @@ var InvitationAuthenticator = ({ failed, Kind, active, pending, invitationId, on
|
|
|
2779
2863
|
const disabled = !active || pending;
|
|
2780
2864
|
const { t } = useTranslation23("os");
|
|
2781
2865
|
const invitationType = Kind.toLowerCase();
|
|
2782
|
-
const [authCode, setAuthCode] =
|
|
2866
|
+
const [authCode, setAuthCode] = useState9("");
|
|
2783
2867
|
const onChange = ({ target: { value } }) => {
|
|
2784
2868
|
setAuthCode(value);
|
|
2785
2869
|
if (value.length === pinLength) {
|
|
@@ -2822,64 +2906,6 @@ var InvitationAuthenticator = ({ failed, Kind, active, pending, invitationId, on
|
|
|
2822
2906
|
}, t("next label"))));
|
|
2823
2907
|
};
|
|
2824
2908
|
|
|
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
2909
|
// packages/sdk/shell/src/styles/panelStyles.ts
|
|
2884
2910
|
var stepStyles = "pbs-1 pbe-3 pli-3";
|
|
2885
2911
|
|
|
@@ -2907,48 +2933,49 @@ var resolvedTextColor = (status) => status === Invitation7.State.ERROR ? errorTe
|
|
|
2907
2933
|
// packages/sdk/shell/src/panels/JoinPanel/JoinPanel.tsx
|
|
2908
2934
|
var __dxlog_file10 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/JoinPanel/JoinPanel.tsx";
|
|
2909
2935
|
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__ */
|
|
2936
|
+
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;
|
|
2937
|
+
return /* @__PURE__ */ React38.createElement(DensityProvider3, {
|
|
2912
2938
|
density: "fine"
|
|
2913
|
-
}, mode !== "halo-only" && /* @__PURE__ */
|
|
2939
|
+
}, mode !== "halo-only" && /* @__PURE__ */ React38.createElement(JoinHeading, {
|
|
2914
2940
|
titleId,
|
|
2915
2941
|
mode,
|
|
2916
2942
|
onExit,
|
|
2917
2943
|
exitActionParent
|
|
2918
|
-
}), /* @__PURE__ */
|
|
2944
|
+
}), /* @__PURE__ */ React38.createElement(Viewport.Root, {
|
|
2919
2945
|
focusManaged: true,
|
|
2920
2946
|
activeView
|
|
2921
|
-
}, /* @__PURE__ */
|
|
2947
|
+
}, /* @__PURE__ */ React38.createElement(Viewport.Views, null, /* @__PURE__ */ React38.createElement(Viewport.View, {
|
|
2922
2948
|
classNames: stepStyles,
|
|
2923
2949
|
id: "addition method chooser"
|
|
2924
|
-
}, /* @__PURE__ */
|
|
2950
|
+
}, /* @__PURE__ */ React38.createElement(AdditionMethodChooser, {
|
|
2925
2951
|
send,
|
|
2926
2952
|
active: activeView === "addition method chooser"
|
|
2927
|
-
})), /* @__PURE__ */
|
|
2953
|
+
})), /* @__PURE__ */ React38.createElement(Viewport.View, {
|
|
2928
2954
|
classNames: stepStyles,
|
|
2929
|
-
id: "reset
|
|
2930
|
-
}, /* @__PURE__ */
|
|
2955
|
+
id: "reset storage confirmation"
|
|
2956
|
+
}, /* @__PURE__ */ React38.createElement(ConfirmResetComponent, {
|
|
2931
2957
|
send,
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
|
|
2958
|
+
active: activeView === "reset identity confirmation",
|
|
2959
|
+
onCancel: onCancelResetStorage,
|
|
2960
|
+
onConfirm: onConfirmResetStorage
|
|
2961
|
+
})), /* @__PURE__ */ React38.createElement(Viewport.View, {
|
|
2935
2962
|
classNames: stepStyles,
|
|
2936
2963
|
id: "create identity input"
|
|
2937
|
-
}, /* @__PURE__ */
|
|
2964
|
+
}, /* @__PURE__ */ React38.createElement(IdentityInputComponent, {
|
|
2938
2965
|
send,
|
|
2939
2966
|
method: "create identity",
|
|
2940
2967
|
active: activeView === "create identity input"
|
|
2941
|
-
})), /* @__PURE__ */
|
|
2968
|
+
})), /* @__PURE__ */ React38.createElement(Viewport.View, {
|
|
2942
2969
|
classNames: stepStyles,
|
|
2943
2970
|
id: "recover identity input"
|
|
2944
|
-
}, /* @__PURE__ */
|
|
2971
|
+
}, /* @__PURE__ */ React38.createElement(IdentityInputComponent, {
|
|
2945
2972
|
send,
|
|
2946
2973
|
method: "recover identity",
|
|
2947
2974
|
active: activeView === "recover identity input"
|
|
2948
|
-
})), /* @__PURE__ */
|
|
2975
|
+
})), /* @__PURE__ */ React38.createElement(Viewport.View, {
|
|
2949
2976
|
classNames: stepStyles,
|
|
2950
2977
|
id: "halo invitation input"
|
|
2951
|
-
}, /* @__PURE__ */
|
|
2978
|
+
}, /* @__PURE__ */ React38.createElement(InvitationInput, {
|
|
2952
2979
|
send,
|
|
2953
2980
|
Kind: "Halo",
|
|
2954
2981
|
active: activeView === "halo invitation input",
|
|
@@ -2958,20 +2985,20 @@ var JoinPanelImpl = (props) => {
|
|
|
2958
2985
|
...succeededKeys?.Halo && {
|
|
2959
2986
|
succeededKeys: succeededKeys.Halo
|
|
2960
2987
|
}
|
|
2961
|
-
})), /* @__PURE__ */
|
|
2988
|
+
})), /* @__PURE__ */ React38.createElement(Viewport.View, {
|
|
2962
2989
|
classNames: stepStyles,
|
|
2963
2990
|
id: "halo invitation rescuer"
|
|
2964
|
-
}, /* @__PURE__ */
|
|
2991
|
+
}, /* @__PURE__ */ React38.createElement(InvitationRescuer, {
|
|
2965
2992
|
send,
|
|
2966
2993
|
Kind: "Halo",
|
|
2967
2994
|
active: activeView === "halo invitation rescuer",
|
|
2968
2995
|
invitationState: invitationStates?.Halo,
|
|
2969
2996
|
onInvitationCancel: onHaloInvitationCancel,
|
|
2970
2997
|
failReason: failReasons?.Halo
|
|
2971
|
-
})), /* @__PURE__ */
|
|
2998
|
+
})), /* @__PURE__ */ React38.createElement(Viewport.View, {
|
|
2972
2999
|
classNames: stepStyles,
|
|
2973
3000
|
id: "halo invitation authenticator"
|
|
2974
|
-
}, /* @__PURE__ */
|
|
3001
|
+
}, /* @__PURE__ */ React38.createElement(InvitationAuthenticator, {
|
|
2975
3002
|
send,
|
|
2976
3003
|
Kind: "Halo",
|
|
2977
3004
|
active: activeView === "halo invitation authenticator",
|
|
@@ -2980,28 +3007,28 @@ var JoinPanelImpl = (props) => {
|
|
|
2980
3007
|
...failed.has("Halo") && {
|
|
2981
3008
|
failed: true
|
|
2982
3009
|
}
|
|
2983
|
-
})), /* @__PURE__ */
|
|
3010
|
+
})), /* @__PURE__ */ React38.createElement(Viewport.View, {
|
|
2984
3011
|
classNames: stepStyles,
|
|
2985
3012
|
id: "halo invitation accepted"
|
|
2986
|
-
}, /* @__PURE__ */
|
|
3013
|
+
}, /* @__PURE__ */ React38.createElement(InvitationAccepted, {
|
|
2987
3014
|
send,
|
|
2988
3015
|
Kind: "Halo",
|
|
2989
3016
|
active: activeView === "halo invitation accepted",
|
|
2990
3017
|
doneActionParent,
|
|
2991
3018
|
onDone: onHaloDone
|
|
2992
|
-
})), /* @__PURE__ */
|
|
3019
|
+
})), /* @__PURE__ */ React38.createElement(Viewport.View, {
|
|
2993
3020
|
classNames: stepStyles,
|
|
2994
3021
|
id: "identity added"
|
|
2995
|
-
}, /* @__PURE__ */
|
|
3022
|
+
}, /* @__PURE__ */ React38.createElement(IdentityAdded, {
|
|
2996
3023
|
send,
|
|
2997
3024
|
mode,
|
|
2998
3025
|
active: activeView === "identity added",
|
|
2999
3026
|
doneActionParent,
|
|
3000
3027
|
onDone: onHaloDone
|
|
3001
|
-
})), /* @__PURE__ */
|
|
3028
|
+
})), /* @__PURE__ */ React38.createElement(Viewport.View, {
|
|
3002
3029
|
classNames: stepStyles,
|
|
3003
3030
|
id: "space invitation input"
|
|
3004
|
-
}, /* @__PURE__ */
|
|
3031
|
+
}, /* @__PURE__ */ React38.createElement(InvitationInput, {
|
|
3005
3032
|
send,
|
|
3006
3033
|
Kind: "Space",
|
|
3007
3034
|
active: activeView === "space invitation input",
|
|
@@ -3013,20 +3040,20 @@ var JoinPanelImpl = (props) => {
|
|
|
3013
3040
|
},
|
|
3014
3041
|
onExit,
|
|
3015
3042
|
exitActionParent
|
|
3016
|
-
})), /* @__PURE__ */
|
|
3043
|
+
})), /* @__PURE__ */ React38.createElement(Viewport.View, {
|
|
3017
3044
|
classNames: stepStyles,
|
|
3018
3045
|
id: "space invitation rescuer"
|
|
3019
|
-
}, /* @__PURE__ */
|
|
3046
|
+
}, /* @__PURE__ */ React38.createElement(InvitationRescuer, {
|
|
3020
3047
|
send,
|
|
3021
3048
|
Kind: "Space",
|
|
3022
3049
|
active: activeView === "space invitation rescuer",
|
|
3023
3050
|
invitationState: invitationStates?.Space,
|
|
3024
3051
|
onInvitationCancel: onSpaceInvitationCancel,
|
|
3025
3052
|
failReason: failReasons?.Space
|
|
3026
|
-
})), /* @__PURE__ */
|
|
3053
|
+
})), /* @__PURE__ */ React38.createElement(Viewport.View, {
|
|
3027
3054
|
classNames: stepStyles,
|
|
3028
3055
|
id: "space invitation authenticator"
|
|
3029
|
-
}, /* @__PURE__ */
|
|
3056
|
+
}, /* @__PURE__ */ React38.createElement(InvitationAuthenticator, {
|
|
3030
3057
|
send,
|
|
3031
3058
|
Kind: "Space",
|
|
3032
3059
|
active: activeView === "space invitation authenticator",
|
|
@@ -3035,10 +3062,10 @@ var JoinPanelImpl = (props) => {
|
|
|
3035
3062
|
...failed.has("Space") && {
|
|
3036
3063
|
failed: true
|
|
3037
3064
|
}
|
|
3038
|
-
})), /* @__PURE__ */
|
|
3065
|
+
})), /* @__PURE__ */ React38.createElement(Viewport.View, {
|
|
3039
3066
|
classNames: stepStyles,
|
|
3040
3067
|
id: "space invitation accepted"
|
|
3041
|
-
}, /* @__PURE__ */
|
|
3068
|
+
}, /* @__PURE__ */ React38.createElement(InvitationAccepted, {
|
|
3042
3069
|
send,
|
|
3043
3070
|
Kind: "Space",
|
|
3044
3071
|
active: activeView === "space invitation accepted",
|
|
@@ -3046,14 +3073,15 @@ var JoinPanelImpl = (props) => {
|
|
|
3046
3073
|
onDone: onSpaceDone
|
|
3047
3074
|
})))));
|
|
3048
3075
|
};
|
|
3049
|
-
var JoinPanel = ({ titleId: propsTitleId, mode = "default", initialInvitationCode, exitActionParent, onExit, doneActionParent, onDone: propsOnDone }) => {
|
|
3050
|
-
const client =
|
|
3076
|
+
var JoinPanel = ({ titleId: propsTitleId, mode = "default", initialDisposition = "default", initialInvitationCode, exitActionParent, onExit, doneActionParent, onDone: propsOnDone, onCancelResetStorage }) => {
|
|
3077
|
+
const client = useClient5();
|
|
3051
3078
|
const identity = useIdentity2();
|
|
3052
3079
|
const { hasIosKeyboard } = useThemeContext4();
|
|
3053
3080
|
const titleId = useId7("joinPanel__heading", propsTitleId);
|
|
3054
3081
|
const [joinState, joinSend, joinService] = useJoinMachine(client, {
|
|
3055
3082
|
context: {
|
|
3056
3083
|
mode,
|
|
3084
|
+
initialDisposition,
|
|
3057
3085
|
identity,
|
|
3058
3086
|
...initialInvitationCode && {
|
|
3059
3087
|
[mode === "halo-only" ? "halo" : "space"]: {
|
|
@@ -3066,7 +3094,7 @@ var JoinPanel = ({ titleId: propsTitleId, mode = "default", initialInvitationCod
|
|
|
3066
3094
|
const subscription = joinService.subscribe((state) => {
|
|
3067
3095
|
log10("[state]", state, {
|
|
3068
3096
|
F: __dxlog_file10,
|
|
3069
|
-
L:
|
|
3097
|
+
L: 204,
|
|
3070
3098
|
S: void 0,
|
|
3071
3099
|
C: (f, a) => f(...a)
|
|
3072
3100
|
});
|
|
@@ -3278,7 +3306,15 @@ var JoinPanel = ({ titleId: propsTitleId, mode = "default", initialInvitationCod
|
|
|
3278
3306
|
joinState,
|
|
3279
3307
|
propsOnDone
|
|
3280
3308
|
]);
|
|
3281
|
-
|
|
3309
|
+
const onConfirmResetStorage = useCallback7(() => client.reset().then(() => {
|
|
3310
|
+
joinSend({
|
|
3311
|
+
type: "resetIdentity"
|
|
3312
|
+
});
|
|
3313
|
+
}), [
|
|
3314
|
+
client,
|
|
3315
|
+
joinSend
|
|
3316
|
+
]);
|
|
3317
|
+
return /* @__PURE__ */ React38.createElement(JoinPanelImpl, {
|
|
3282
3318
|
titleId,
|
|
3283
3319
|
mode,
|
|
3284
3320
|
send: joinSend,
|
|
@@ -3311,16 +3347,18 @@ var JoinPanel = ({ titleId: propsTitleId, mode = "default", initialInvitationCod
|
|
|
3311
3347
|
type: "authenticateSpaceVerificationCode"
|
|
3312
3348
|
});
|
|
3313
3349
|
return joinState.context.space.invitationObservable?.authenticate(authCode);
|
|
3314
|
-
}
|
|
3350
|
+
},
|
|
3351
|
+
onConfirmResetStorage,
|
|
3352
|
+
onCancelResetStorage
|
|
3315
3353
|
});
|
|
3316
3354
|
};
|
|
3317
3355
|
|
|
3318
3356
|
// packages/sdk/shell/src/panels/SpacePanel/SpacePanel.tsx
|
|
3319
3357
|
import { Planet } from "@phosphor-icons/react";
|
|
3320
|
-
import
|
|
3358
|
+
import React40, { useEffect as useEffect6, useMemo as useMemo5 } from "react";
|
|
3321
3359
|
import { log as log13 } from "@dxos/log";
|
|
3322
3360
|
import { useInvitationStatus as useInvitationStatus3 } from "@dxos/react-client/invitations";
|
|
3323
|
-
import { DensityProvider as DensityProvider4, useId as useId8, useTranslation as
|
|
3361
|
+
import { DensityProvider as DensityProvider4, useId as useId8, useTranslation as useTranslation25 } from "@dxos/react-ui";
|
|
3324
3362
|
|
|
3325
3363
|
// packages/sdk/shell/src/panels/SpacePanel/spaceMachine.ts
|
|
3326
3364
|
import { useMachine as useMachine3 } from "@xstate/react";
|
|
@@ -3386,18 +3424,18 @@ var useSpaceMachine = (options) => {
|
|
|
3386
3424
|
|
|
3387
3425
|
// packages/sdk/shell/src/panels/SpacePanel/steps/SpaceManager.tsx
|
|
3388
3426
|
import { Placeholder as Placeholder2, UserPlus, UsersThree } from "@phosphor-icons/react";
|
|
3389
|
-
import
|
|
3427
|
+
import React39, { useCallback as useCallback8, useState as useState10 } from "react";
|
|
3390
3428
|
import { log as log12 } from "@dxos/log";
|
|
3391
3429
|
import { useConfig } from "@dxos/react-client";
|
|
3392
3430
|
import { useSpaceInvitations as useSpaceInvitations2 } from "@dxos/react-client/echo";
|
|
3393
3431
|
import { Invitation as Invitation8, InvitationEncoder as InvitationEncoder4 } from "@dxos/react-client/invitations";
|
|
3394
|
-
import { ScrollArea, useTranslation as
|
|
3432
|
+
import { ScrollArea, useTranslation as useTranslation24 } from "@dxos/react-ui";
|
|
3395
3433
|
import { descriptionText as descriptionText10, mx as mx22 } from "@dxos/react-ui-theme";
|
|
3396
3434
|
var __dxlog_file12 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/SpacePanel/steps/SpaceManager.tsx";
|
|
3397
3435
|
var activeActionKey = "dxos:react-shell/space-manager/active-action";
|
|
3398
3436
|
var SpaceManager = (props) => {
|
|
3399
3437
|
const { space, target } = props;
|
|
3400
|
-
const { t } =
|
|
3438
|
+
const { t } = useTranslation24("os");
|
|
3401
3439
|
const config = useConfig();
|
|
3402
3440
|
const invitations = useSpaceInvitations2(space?.key);
|
|
3403
3441
|
const onInvitationEvent = useCallback8((invitation) => {
|
|
@@ -3450,7 +3488,7 @@ var SpaceManager = (props) => {
|
|
|
3450
3488
|
])
|
|
3451
3489
|
}
|
|
3452
3490
|
};
|
|
3453
|
-
return /* @__PURE__ */
|
|
3491
|
+
return /* @__PURE__ */ React39.createElement(SpaceManagerImpl, {
|
|
3454
3492
|
...props,
|
|
3455
3493
|
invitations,
|
|
3456
3494
|
inviteActions
|
|
@@ -3459,7 +3497,7 @@ var SpaceManager = (props) => {
|
|
|
3459
3497
|
var headingFragment = "pis-3 pie-1 plb-1 mbe-1 font-medium";
|
|
3460
3498
|
var SpaceManagerImpl = (props) => {
|
|
3461
3499
|
const { active, space, createInvitationUrl, send, inviteActions: propsInviteActions, invitations, showInactiveInvitations, SpaceMemberList: SpaceMemberListComponent = SpaceMemberList, InvitationList: InvitationListComponent = InvitationList } = props;
|
|
3462
|
-
const { t } =
|
|
3500
|
+
const { t } = useTranslation24("os");
|
|
3463
3501
|
const inviteActions = propsInviteActions ?? {
|
|
3464
3502
|
noopInvite: {
|
|
3465
3503
|
label: t("create space invitation label"),
|
|
@@ -3477,26 +3515,26 @@ var SpaceManagerImpl = (props) => {
|
|
|
3477
3515
|
const visibleInvitations = showInactiveInvitations ? invitations : invitations?.filter((invitation) => ![
|
|
3478
3516
|
Invitation8.State.CANCELLED
|
|
3479
3517
|
].includes(invitation.get().state));
|
|
3480
|
-
return /* @__PURE__ */
|
|
3518
|
+
return /* @__PURE__ */ React39.createElement(React39.Fragment, null, /* @__PURE__ */ React39.createElement(ScrollArea.Root, {
|
|
3481
3519
|
classNames: "grow shrink basis-28 -mli-2"
|
|
3482
|
-
}, /* @__PURE__ */
|
|
3520
|
+
}, /* @__PURE__ */ React39.createElement(ScrollArea.Viewport, {
|
|
3483
3521
|
classNames: "is-full pie-2"
|
|
3484
|
-
}, !!visibleInvitations?.length && /* @__PURE__ */
|
|
3522
|
+
}, !!visibleInvitations?.length && /* @__PURE__ */ React39.createElement(React39.Fragment, null, /* @__PURE__ */ React39.createElement("h3", {
|
|
3485
3523
|
className: mx22(headingFragment, descriptionText10)
|
|
3486
|
-
}, t("invitation list heading")), /* @__PURE__ */
|
|
3524
|
+
}, t("invitation list heading")), /* @__PURE__ */ React39.createElement(InvitationListComponent, {
|
|
3487
3525
|
className: "mb-2",
|
|
3488
3526
|
send,
|
|
3489
3527
|
invitations: visibleInvitations ?? [],
|
|
3490
3528
|
onClickRemove: (invitation) => invitation.cancel(),
|
|
3491
3529
|
createInvitationUrl
|
|
3492
|
-
}), /* @__PURE__ */
|
|
3530
|
+
}), /* @__PURE__ */ React39.createElement("h3", {
|
|
3493
3531
|
className: mx22(headingFragment, descriptionText10, "mbs-2")
|
|
3494
|
-
}, t("space member list heading"))), /* @__PURE__ */
|
|
3532
|
+
}, t("space member list heading"))), /* @__PURE__ */ React39.createElement(SpaceMemberListComponent, {
|
|
3495
3533
|
spaceKey: space.key,
|
|
3496
3534
|
includeSelf: true
|
|
3497
|
-
})), /* @__PURE__ */
|
|
3535
|
+
})), /* @__PURE__ */ React39.createElement(ScrollArea.Scrollbar, {
|
|
3498
3536
|
orientation: "vertical"
|
|
3499
|
-
}, /* @__PURE__ */
|
|
3537
|
+
}, /* @__PURE__ */ React39.createElement(ScrollArea.Thumb, null))), /* @__PURE__ */ React39.createElement(Actions, null, /* @__PURE__ */ React39.createElement(BifurcatedAction, {
|
|
3500
3538
|
disabled: !active,
|
|
3501
3539
|
actions: inviteActions,
|
|
3502
3540
|
activeAction,
|
|
@@ -3508,47 +3546,47 @@ var SpaceManagerImpl = (props) => {
|
|
|
3508
3546
|
// packages/sdk/shell/src/panels/SpacePanel/SpacePanel.tsx
|
|
3509
3547
|
var __dxlog_file13 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/SpacePanel/SpacePanel.tsx";
|
|
3510
3548
|
var SpacePanelHeading = ({ titleId, space, onDone }) => {
|
|
3511
|
-
const { t } =
|
|
3549
|
+
const { t } = useTranslation25("os");
|
|
3512
3550
|
const name = space.properties.name;
|
|
3513
|
-
return /* @__PURE__ */
|
|
3551
|
+
return /* @__PURE__ */ React40.createElement(Heading, {
|
|
3514
3552
|
titleId,
|
|
3515
3553
|
title: t("space panel heading"),
|
|
3516
|
-
corner: /* @__PURE__ */
|
|
3554
|
+
corner: /* @__PURE__ */ React40.createElement(CloseButton, {
|
|
3517
3555
|
"data-testid": "identity-panel-done",
|
|
3518
3556
|
onDone
|
|
3519
3557
|
})
|
|
3520
|
-
}, /* @__PURE__ */
|
|
3558
|
+
}, /* @__PURE__ */ React40.createElement("div", {
|
|
3521
3559
|
role: "none",
|
|
3522
3560
|
className: "flex gap-4 items-center justify-center mlb-4"
|
|
3523
|
-
}, /* @__PURE__ */
|
|
3561
|
+
}, /* @__PURE__ */ React40.createElement(Planet, {
|
|
3524
3562
|
size: 32,
|
|
3525
3563
|
weight: "light"
|
|
3526
|
-
}), /* @__PURE__ */
|
|
3564
|
+
}), /* @__PURE__ */ React40.createElement("div", {
|
|
3527
3565
|
className: "block text-start font-light text-xl"
|
|
3528
3566
|
}, name ?? space.key.truncate())));
|
|
3529
3567
|
};
|
|
3530
3568
|
var SpacePanelImpl = (props) => {
|
|
3531
3569
|
const { titleId, activeView, space, target, SpaceManager: SpaceManagerComponent = SpaceManager, InvitationManager: InvitationManagerComponent = InvitationManager, ...rest } = props;
|
|
3532
|
-
return /* @__PURE__ */
|
|
3570
|
+
return /* @__PURE__ */ React40.createElement(DensityProvider4, {
|
|
3533
3571
|
density: "fine"
|
|
3534
|
-
}, /* @__PURE__ */
|
|
3572
|
+
}, /* @__PURE__ */ React40.createElement(SpacePanelHeading, {
|
|
3535
3573
|
...rest,
|
|
3536
3574
|
titleId,
|
|
3537
3575
|
space
|
|
3538
|
-
}), /* @__PURE__ */
|
|
3576
|
+
}), /* @__PURE__ */ React40.createElement(Viewport.Root, {
|
|
3539
3577
|
activeView
|
|
3540
|
-
}, /* @__PURE__ */
|
|
3578
|
+
}, /* @__PURE__ */ React40.createElement(Viewport.Views, null, /* @__PURE__ */ React40.createElement(Viewport.View, {
|
|
3541
3579
|
id: "space manager",
|
|
3542
3580
|
classNames: stepStyles
|
|
3543
|
-
}, /* @__PURE__ */
|
|
3581
|
+
}, /* @__PURE__ */ React40.createElement(SpaceManagerComponent, {
|
|
3544
3582
|
active: activeView === "space manager",
|
|
3545
3583
|
space,
|
|
3546
3584
|
target,
|
|
3547
3585
|
...rest
|
|
3548
|
-
})), /* @__PURE__ */
|
|
3586
|
+
})), /* @__PURE__ */ React40.createElement(Viewport.View, {
|
|
3549
3587
|
id: "space invitation manager",
|
|
3550
3588
|
classNames: stepStyles
|
|
3551
|
-
}, /* @__PURE__ */
|
|
3589
|
+
}, /* @__PURE__ */ React40.createElement(InvitationManagerComponent, {
|
|
3552
3590
|
active: activeView === "space invitation manager",
|
|
3553
3591
|
...rest,
|
|
3554
3592
|
invitationUrl: props.invitationUrl
|
|
@@ -3556,7 +3594,7 @@ var SpacePanelImpl = (props) => {
|
|
|
3556
3594
|
};
|
|
3557
3595
|
var SpacePanelWithInvitationImpl = ({ invitation, ...props }) => {
|
|
3558
3596
|
const invitationStatus = useInvitationStatus3(invitation);
|
|
3559
|
-
return /* @__PURE__ */
|
|
3597
|
+
return /* @__PURE__ */ React40.createElement(SpacePanelImpl, {
|
|
3560
3598
|
...props,
|
|
3561
3599
|
...invitationStatus,
|
|
3562
3600
|
invitationUrl: props.createInvitationUrl(invitationStatus.invitationCode)
|
|
@@ -3603,16 +3641,31 @@ var SpacePanel = ({ titleId: propsTitleId, createInvitationUrl = (code) => code,
|
|
|
3603
3641
|
};
|
|
3604
3642
|
return spaceState.context.invitation ? (
|
|
3605
3643
|
// TODO(wittjosiah): Unused? Remove?
|
|
3606
|
-
/* @__PURE__ */
|
|
3644
|
+
/* @__PURE__ */ React40.createElement(SpacePanelWithInvitationImpl, {
|
|
3607
3645
|
...implProps,
|
|
3608
3646
|
invitation: spaceState.context.invitation
|
|
3609
3647
|
})
|
|
3610
|
-
) : /* @__PURE__ */
|
|
3648
|
+
) : /* @__PURE__ */ React40.createElement(SpacePanelImpl, implProps);
|
|
3649
|
+
};
|
|
3650
|
+
|
|
3651
|
+
// packages/sdk/shell/src/panels/StatusPanel/StatusPanel.tsx
|
|
3652
|
+
import React41 from "react";
|
|
3653
|
+
import { Status, useTranslation as useTranslation26 } from "@dxos/react-ui";
|
|
3654
|
+
var StatusPanel = ({ titleId }) => {
|
|
3655
|
+
const { t } = useTranslation26("os");
|
|
3656
|
+
return /* @__PURE__ */ React41.createElement("div", {
|
|
3657
|
+
className: "grid place-items-center p-2 gap-2"
|
|
3658
|
+
}, /* @__PURE__ */ React41.createElement("p", {
|
|
3659
|
+
id: titleId,
|
|
3660
|
+
className: "font-medium text-center"
|
|
3661
|
+
}, t("resetting message")), /* @__PURE__ */ React41.createElement(Status, {
|
|
3662
|
+
indeterminate: true
|
|
3663
|
+
}, t("resetting message")));
|
|
3611
3664
|
};
|
|
3612
3665
|
|
|
3613
3666
|
// packages/sdk/shell/src/composites/IdentityDialog/IdentityDialog.tsx
|
|
3614
3667
|
var IdentityDialog = (props) => {
|
|
3615
|
-
const titleId = useId9("
|
|
3668
|
+
const titleId = useId9("identityDialog__title", props.title);
|
|
3616
3669
|
return /* @__PURE__ */ React42.createElement(Dialog.Root, {
|
|
3617
3670
|
defaultOpen: true,
|
|
3618
3671
|
onOpenChange: (open) => open || props.onDone?.()
|
|
@@ -3659,7 +3712,7 @@ var JoinDialog = (joinPanelProps) => {
|
|
|
3659
3712
|
};
|
|
3660
3713
|
|
|
3661
3714
|
// packages/sdk/shell/src/composites/Shell/run-shell.tsx
|
|
3662
|
-
import
|
|
3715
|
+
import React47, { StrictMode } from "react";
|
|
3663
3716
|
import { createRoot } from "react-dom/client";
|
|
3664
3717
|
import { DEFAULT_CLIENT_CHANNEL, DEFAULT_SHELL_CHANNEL } from "@dxos/client-protocol";
|
|
3665
3718
|
import { ShellRuntimeImpl } from "@dxos/client-services";
|
|
@@ -3669,9 +3722,9 @@ import { defaultTx } from "@dxos/react-ui-theme";
|
|
|
3669
3722
|
import { createIFramePort } from "@dxos/rpc-tunnel";
|
|
3670
3723
|
|
|
3671
3724
|
// packages/sdk/shell/src/composites/Shell/Shell.tsx
|
|
3672
|
-
import
|
|
3725
|
+
import React46, { useEffect as useEffect7, useState as useState11 } from "react";
|
|
3673
3726
|
import { log as log14 } from "@dxos/log";
|
|
3674
|
-
import { ShellDisplay, ShellLayout, useClient as
|
|
3727
|
+
import { ShellDisplay, ShellLayout, useClient as useClient6 } from "@dxos/react-client";
|
|
3675
3728
|
import { useSpace as useSpace2 } from "@dxos/react-client/echo";
|
|
3676
3729
|
|
|
3677
3730
|
// packages/sdk/shell/src/composites/SpaceDialog/SpaceDialog.tsx
|
|
@@ -3693,6 +3746,20 @@ var SpaceDialog = (spacePanelProps) => {
|
|
|
3693
3746
|
}))))));
|
|
3694
3747
|
};
|
|
3695
3748
|
|
|
3749
|
+
// packages/sdk/shell/src/composites/StatusDialog/StatusDialog.tsx
|
|
3750
|
+
import React45 from "react";
|
|
3751
|
+
import { AlertDialog as AlertDialog2, useId as useId12 } from "@dxos/react-ui";
|
|
3752
|
+
var StatusDialog = () => {
|
|
3753
|
+
const titleId = useId12("statusDialog__title");
|
|
3754
|
+
return /* @__PURE__ */ React45.createElement(AlertDialog2.Root, {
|
|
3755
|
+
open: true
|
|
3756
|
+
}, /* @__PURE__ */ React45.createElement(AlertDialog2.Portal, null, /* @__PURE__ */ React45.createElement(AlertDialog2.Overlay, null, /* @__PURE__ */ React45.createElement(AlertDialog2.Content, {
|
|
3757
|
+
"aria-labelledby": titleId
|
|
3758
|
+
}, /* @__PURE__ */ React45.createElement(StatusPanel, {
|
|
3759
|
+
titleId
|
|
3760
|
+
})))));
|
|
3761
|
+
};
|
|
3762
|
+
|
|
3696
3763
|
// packages/sdk/shell/src/composites/Shell/Shell.tsx
|
|
3697
3764
|
var __dxlog_file14 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/composites/Shell/Shell.tsx";
|
|
3698
3765
|
var Shell = ({ runtime, origin }) => {
|
|
@@ -3702,7 +3769,7 @@ var Shell = ({ runtime, origin }) => {
|
|
|
3702
3769
|
spaceKey: runtime.spaceKey,
|
|
3703
3770
|
target: runtime.target
|
|
3704
3771
|
});
|
|
3705
|
-
const client =
|
|
3772
|
+
const client = useClient6();
|
|
3706
3773
|
const space = useSpace2(spaceKey);
|
|
3707
3774
|
useEffect7(() => {
|
|
3708
3775
|
return runtime.layoutUpdate.on((request) => setLayout(request));
|
|
@@ -3713,7 +3780,7 @@ var Shell = ({ runtime, origin }) => {
|
|
|
3713
3780
|
if (layout === ShellLayout.SPACE && !space) {
|
|
3714
3781
|
log14.warn("No space found for shell space invitations.", void 0, {
|
|
3715
3782
|
F: __dxlog_file14,
|
|
3716
|
-
L:
|
|
3783
|
+
L: 33,
|
|
3717
3784
|
S: void 0,
|
|
3718
3785
|
C: (f, a) => f(...a)
|
|
3719
3786
|
});
|
|
@@ -3733,10 +3800,17 @@ var Shell = ({ runtime, origin }) => {
|
|
|
3733
3800
|
space
|
|
3734
3801
|
]);
|
|
3735
3802
|
switch (layout) {
|
|
3803
|
+
case ShellLayout.STATUS:
|
|
3804
|
+
return /* @__PURE__ */ React46.createElement(StatusDialog, null);
|
|
3736
3805
|
case ShellLayout.INITIALIZE_IDENTITY:
|
|
3737
|
-
|
|
3806
|
+
case ShellLayout.INITIALIZE_IDENTITY_FROM_INVITATION:
|
|
3807
|
+
return /* @__PURE__ */ React46.createElement(JoinDialog, {
|
|
3738
3808
|
mode: "halo-only",
|
|
3809
|
+
initialDisposition: layout === ShellLayout.INITIALIZE_IDENTITY_FROM_INVITATION ? "accept-halo-invitation" : "default",
|
|
3739
3810
|
initialInvitationCode: invitationCode,
|
|
3811
|
+
onCancelResetStorage: () => runtime.setLayout({
|
|
3812
|
+
layout: ShellLayout.IDENTITY
|
|
3813
|
+
}),
|
|
3740
3814
|
onDone: () => {
|
|
3741
3815
|
void runtime.setAppContext({
|
|
3742
3816
|
display: ShellDisplay.NONE
|
|
@@ -3749,18 +3823,27 @@ var Shell = ({ runtime, origin }) => {
|
|
|
3749
3823
|
case ShellLayout.IDENTITY:
|
|
3750
3824
|
case ShellLayout.SHARE_IDENTITY:
|
|
3751
3825
|
case ShellLayout.EDIT_PROFILE:
|
|
3752
|
-
return /* @__PURE__ */
|
|
3826
|
+
return /* @__PURE__ */ React46.createElement(IdentityDialog, {
|
|
3753
3827
|
createInvitationUrl: (invitationCode2) => `${origin}?deviceInvitationCode=${invitationCode2}`,
|
|
3754
|
-
|
|
3828
|
+
onResetStorage: async () => {
|
|
3829
|
+
runtime.setLayout({
|
|
3830
|
+
layout: ShellLayout.STATUS
|
|
3831
|
+
});
|
|
3755
3832
|
await client.reset();
|
|
3756
|
-
|
|
3833
|
+
return runtime.setAppContext({
|
|
3757
3834
|
display: ShellDisplay.NONE,
|
|
3758
3835
|
reload: true
|
|
3759
3836
|
});
|
|
3760
3837
|
},
|
|
3761
|
-
onJoinNewIdentity: () =>
|
|
3762
|
-
|
|
3763
|
-
|
|
3838
|
+
onJoinNewIdentity: async () => {
|
|
3839
|
+
runtime.setLayout({
|
|
3840
|
+
layout: ShellLayout.STATUS
|
|
3841
|
+
});
|
|
3842
|
+
await client.reset();
|
|
3843
|
+
return runtime.setLayout({
|
|
3844
|
+
layout: ShellLayout.INITIALIZE_IDENTITY_FROM_INVITATION
|
|
3845
|
+
});
|
|
3846
|
+
},
|
|
3764
3847
|
onDone: async () => {
|
|
3765
3848
|
await runtime.setAppContext({
|
|
3766
3849
|
display: ShellDisplay.NONE
|
|
@@ -3768,10 +3851,11 @@ var Shell = ({ runtime, origin }) => {
|
|
|
3768
3851
|
runtime.setLayout({
|
|
3769
3852
|
layout: ShellLayout.DEFAULT
|
|
3770
3853
|
});
|
|
3771
|
-
}
|
|
3854
|
+
},
|
|
3855
|
+
initialDisposition: layout === ShellLayout.SHARE_IDENTITY ? "manage-device-invitation" : layout === ShellLayout.EDIT_PROFILE ? "manage-profile" : "default"
|
|
3772
3856
|
});
|
|
3773
3857
|
case ShellLayout.SPACE:
|
|
3774
|
-
return space ? /* @__PURE__ */
|
|
3858
|
+
return space ? /* @__PURE__ */ React46.createElement(SpaceDialog, {
|
|
3775
3859
|
space,
|
|
3776
3860
|
target,
|
|
3777
3861
|
createInvitationUrl: (invitationCode2) => `${origin}?spaceInvitationCode=${invitationCode2}`,
|
|
@@ -3785,7 +3869,7 @@ var Shell = ({ runtime, origin }) => {
|
|
|
3785
3869
|
}
|
|
3786
3870
|
}) : null;
|
|
3787
3871
|
case ShellLayout.JOIN_SPACE:
|
|
3788
|
-
return /* @__PURE__ */
|
|
3872
|
+
return /* @__PURE__ */ React46.createElement(JoinDialog, {
|
|
3789
3873
|
initialInvitationCode: invitationCode,
|
|
3790
3874
|
onDone: async (result) => {
|
|
3791
3875
|
const target2 = result?.target ?? void 0;
|
|
@@ -3888,7 +3972,8 @@ var os = {
|
|
|
3888
3972
|
"choose add device label": "Add device",
|
|
3889
3973
|
"choose devices label": "Manage devices",
|
|
3890
3974
|
"choose profile label": "Edit profile",
|
|
3891
|
-
"choose sign out label": "
|
|
3975
|
+
"choose sign out label": "Reset storage",
|
|
3976
|
+
"choose join new identity label": "Join existing device",
|
|
3892
3977
|
"empty space members message": "There is nobody in this space yet.",
|
|
3893
3978
|
"back to all invitations label": "Back to all invitations",
|
|
3894
3979
|
"invitation heading": "Invitation",
|
|
@@ -3912,18 +3997,20 @@ var os = {
|
|
|
3912
3997
|
"invite options label": "Change the active invite option.",
|
|
3913
3998
|
"reset in progress label": "Resetting...",
|
|
3914
3999
|
"confirm label": "Confirm",
|
|
3915
|
-
"reset
|
|
4000
|
+
"reset storage input label": "This will clear this device and all associated data. Type {{confirmationValue}} and confirm to continue.",
|
|
4001
|
+
"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
4002
|
"failed to reset identity message": "Failed to reset identity.",
|
|
3917
4003
|
"confirmation value": "CONFIRM",
|
|
3918
|
-
"sign out chooser title": "
|
|
3919
|
-
"sign out chooser message": "Proceeding with
|
|
4004
|
+
"sign out chooser title": "Danger zone",
|
|
4005
|
+
"sign out chooser message": "Proceeding with the action below will erase all data on this device.",
|
|
3920
4006
|
"join new identity label": "Join a new identity",
|
|
3921
|
-
"reset device label": "Reset
|
|
4007
|
+
"reset device label": "Reset storage",
|
|
3922
4008
|
"reset device confirm message": "Are you sure you want to reset your device? All data will be lost.",
|
|
3923
4009
|
"emoji and color label": "Emoji and color",
|
|
3924
4010
|
"clear label": "Use default",
|
|
3925
4011
|
"select emoji label": "Choose an emoji to use in your avatar",
|
|
3926
4012
|
"select hue label": "Choose a hue to use in your avatar",
|
|
4013
|
+
"resetting message": "One moment while things are reset\u2026",
|
|
3927
4014
|
"red label": "Red",
|
|
3928
4015
|
"orange label": "Orange",
|
|
3929
4016
|
"amber label": "Amber",
|
|
@@ -3964,25 +4051,25 @@ var runShell = async (config = new Config()) => {
|
|
|
3964
4051
|
runtime.open(),
|
|
3965
4052
|
client.initialize()
|
|
3966
4053
|
]);
|
|
3967
|
-
createRoot(document.getElementById("root")).render(/* @__PURE__ */
|
|
4054
|
+
createRoot(document.getElementById("root")).render(/* @__PURE__ */ React47.createElement(StrictMode, null, /* @__PURE__ */ React47.createElement(ThemeProvider, {
|
|
3968
4055
|
tx: defaultTx,
|
|
3969
4056
|
resourceExtensions: [
|
|
3970
4057
|
osTranslations
|
|
3971
4058
|
]
|
|
3972
|
-
}, /* @__PURE__ */
|
|
4059
|
+
}, /* @__PURE__ */ React47.createElement(ClientContext.Provider, {
|
|
3973
4060
|
value: {
|
|
3974
4061
|
client,
|
|
3975
4062
|
status: SystemStatus.ACTIVE
|
|
3976
4063
|
}
|
|
3977
|
-
}, /* @__PURE__ */
|
|
4064
|
+
}, /* @__PURE__ */ React47.createElement(ClipboardProvider, null, /* @__PURE__ */ React47.createElement(Tooltip5.Provider, null, /* @__PURE__ */ React47.createElement(Shell, {
|
|
3978
4065
|
runtime,
|
|
3979
4066
|
origin: location.origin
|
|
3980
4067
|
})))))));
|
|
3981
4068
|
};
|
|
3982
4069
|
|
|
3983
4070
|
// packages/sdk/shell/src/composites/Shell/ShellContext.tsx
|
|
3984
|
-
import
|
|
3985
|
-
import { ShellDisplay as ShellDisplay2, ShellLayout as ShellLayout3, useClient as
|
|
4071
|
+
import React48, { createContext as createContext2, useCallback as useCallback9, useContext as useContext2, useEffect as useEffect8, useMemo as useMemo6, useState as useState12 } from "react";
|
|
4072
|
+
import { ShellDisplay as ShellDisplay2, ShellLayout as ShellLayout3, useClient as useClient7 } from "@dxos/react-client";
|
|
3986
4073
|
import { useIdentity as useIdentity3 } from "@dxos/react-client/halo";
|
|
3987
4074
|
import { mx as mx23 } from "@dxos/react-ui-theme";
|
|
3988
4075
|
|
|
@@ -4020,7 +4107,7 @@ var MemoryShellRuntime = class {
|
|
|
4020
4107
|
// packages/sdk/shell/src/composites/Shell/ShellContext.tsx
|
|
4021
4108
|
var ShellContext = /* @__PURE__ */ createContext2({});
|
|
4022
4109
|
var useShell = () => {
|
|
4023
|
-
const client =
|
|
4110
|
+
const client = useClient7();
|
|
4024
4111
|
const { runtime, setDisplay } = useContext2(ShellContext);
|
|
4025
4112
|
const setLayout = async (layout, options) => {
|
|
4026
4113
|
if (runtime) {
|
|
@@ -4041,7 +4128,7 @@ var useShell = () => {
|
|
|
4041
4128
|
};
|
|
4042
4129
|
};
|
|
4043
4130
|
var ShellProvider = ({ space, deviceInvitationCode, spaceInvitationCode, onJoinedSpace, children }) => {
|
|
4044
|
-
const client =
|
|
4131
|
+
const client = useClient7();
|
|
4045
4132
|
const identity = useIdentity3();
|
|
4046
4133
|
const [display, setDisplay] = useState12(!identity || spaceInvitationCode || deviceInvitationCode ? ShellDisplay2.FULLSCREEN : ShellDisplay2.NONE);
|
|
4047
4134
|
const shellRuntime = useMemo6(() => {
|
|
@@ -4113,12 +4200,12 @@ var ShellProvider = ({ space, deviceInvitationCode, spaceInvitationCode, onJoine
|
|
|
4113
4200
|
}, [
|
|
4114
4201
|
shellRuntime
|
|
4115
4202
|
]);
|
|
4116
|
-
return /* @__PURE__ */
|
|
4203
|
+
return /* @__PURE__ */ React48.createElement(React48.Fragment, null, shellRuntime && /* @__PURE__ */ React48.createElement("div", {
|
|
4117
4204
|
className: mx23(display === ShellDisplay2.NONE ? "hidden" : "")
|
|
4118
|
-
}, /* @__PURE__ */
|
|
4205
|
+
}, /* @__PURE__ */ React48.createElement(Shell, {
|
|
4119
4206
|
runtime: shellRuntime,
|
|
4120
4207
|
origin: window.location.origin
|
|
4121
|
-
})), /* @__PURE__ */
|
|
4208
|
+
})), /* @__PURE__ */ React48.createElement(ShellContext.Provider, {
|
|
4122
4209
|
value: {
|
|
4123
4210
|
runtime: shellRuntime,
|
|
4124
4211
|
setDisplay
|
|
@@ -4135,6 +4222,8 @@ export {
|
|
|
4135
4222
|
ClipboardProvider,
|
|
4136
4223
|
CloseButton,
|
|
4137
4224
|
CompoundButton,
|
|
4225
|
+
ConfirmReset,
|
|
4226
|
+
ConfirmResetImpl,
|
|
4138
4227
|
CopyButton,
|
|
4139
4228
|
CopyButtonIconOnly,
|
|
4140
4229
|
DeviceList,
|
|
@@ -4165,6 +4254,7 @@ export {
|
|
|
4165
4254
|
SpaceMemberListImpl,
|
|
4166
4255
|
SpacePanel,
|
|
4167
4256
|
SpacePanelImpl,
|
|
4257
|
+
StatusPanel,
|
|
4168
4258
|
StepHeading,
|
|
4169
4259
|
Viewport,
|
|
4170
4260
|
activeBgColor,
|