@dxos/shell 0.4.10-main.fa5a270 → 0.4.10-main.fd4f2a3
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 +12847 -11834
- package/dist/bundle/shell.mjs.map +1 -1
- package/dist/bundle/shell.umd.js +73 -65
- 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 +435 -333
- 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/components/EmojiPicker.d.ts.map +1 -1
- package/dist/types/src/components/EmojiPicker.js +2 -1
- package/dist/types/src/components/EmojiPicker.js.map +1 -1
- 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/ProfileForm.js +4 -1
- package/dist/types/src/panels/IdentityPanel/steps/ProfileForm.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/dist/types/src/types/index.js +1 -0
- package/dist/types/src/types/index.js.map +1 -1
- package/package.json +20 -20
- package/src/components/EmojiPicker.tsx +3 -1
- 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/ProfileForm.tsx +6 -1
- 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/src/types/index.ts +2 -0
- 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
|
@@ -145,10 +145,13 @@ import EmojiMart from "@emoji-mart/react";
|
|
|
145
145
|
import { ArrowCounterClockwise, CaretDown } from "@phosphor-icons/react";
|
|
146
146
|
import { useControllableState } from "@radix-ui/react-use-controllable-state";
|
|
147
147
|
import React4, { useState as useState3 } from "react";
|
|
148
|
-
import { Button as Button2, Popover, useTranslation as useTranslation2, Tooltip as Tooltip2 } from "@dxos/react-ui";
|
|
148
|
+
import { Button as Button2, Popover, useTranslation as useTranslation2, Tooltip as Tooltip2, useMediaQuery } from "@dxos/react-ui";
|
|
149
149
|
import { getSize as getSize2 } from "@dxos/react-ui-theme";
|
|
150
150
|
var EmojiPicker = ({ disabled, defaultEmoji, emoji, onChangeEmoji, onClickClear }) => {
|
|
151
151
|
const { t } = useTranslation2("os");
|
|
152
|
+
const [isMd] = useMediaQuery("md", {
|
|
153
|
+
ssr: false
|
|
154
|
+
});
|
|
152
155
|
const [emojiValue, setEmojiValue] = useControllableState({
|
|
153
156
|
prop: emoji,
|
|
154
157
|
onChange: onChangeEmoji,
|
|
@@ -172,6 +175,7 @@ var EmojiPicker = ({ disabled, defaultEmoji, emoji, onChangeEmoji, onClickClear
|
|
|
172
175
|
className: getSize2(4)
|
|
173
176
|
}))), /* @__PURE__ */ React4.createElement(Popover.Content, {
|
|
174
177
|
side: "right",
|
|
178
|
+
sideOffset: isMd ? 0 : -310,
|
|
175
179
|
onKeyDownCapture: (event) => {
|
|
176
180
|
if (event.key === "Escape") {
|
|
177
181
|
event.stopPropagation();
|
|
@@ -918,7 +922,7 @@ import { Dialog, useId as useId9 } from "@dxos/react-ui";
|
|
|
918
922
|
// packages/sdk/shell/src/panels/IdentityPanel/IdentityPanel.tsx
|
|
919
923
|
import React29, { useEffect as useEffect3, useMemo as useMemo3 } from "react";
|
|
920
924
|
import { generateName as generateName3 } from "@dxos/display-name";
|
|
921
|
-
import { log as
|
|
925
|
+
import { log as log6 } from "@dxos/log";
|
|
922
926
|
import { useClient as useClient3 } from "@dxos/react-client";
|
|
923
927
|
import { useIdentity, useDevices, useHaloInvitations as useHaloInvitations2 } from "@dxos/react-client/halo";
|
|
924
928
|
import { useInvitationStatus as useInvitationStatus2 } from "@dxos/react-client/invitations";
|
|
@@ -942,6 +946,24 @@ var identityMachine = createMachine({
|
|
|
942
946
|
src: (context) => context.identitySubscribable
|
|
943
947
|
},
|
|
944
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
|
+
},
|
|
945
967
|
choosingAction: {},
|
|
946
968
|
managingDeviceInvitation: {},
|
|
947
969
|
managingAgent: {
|
|
@@ -972,7 +994,8 @@ var identityMachine = createMachine({
|
|
|
972
994
|
}
|
|
973
995
|
}
|
|
974
996
|
},
|
|
975
|
-
|
|
997
|
+
confirmingResetStorage: {},
|
|
998
|
+
confirmingJoinNewIdentity: {}
|
|
976
999
|
},
|
|
977
1000
|
on: {
|
|
978
1001
|
unchooseAction: {
|
|
@@ -1004,8 +1027,12 @@ var identityMachine = createMachine({
|
|
|
1004
1027
|
target: ".managingProfile",
|
|
1005
1028
|
actions: "log"
|
|
1006
1029
|
},
|
|
1007
|
-
|
|
1008
|
-
target: ".
|
|
1030
|
+
chooseJoinNewIdentity: {
|
|
1031
|
+
target: ".confirmingJoinNewIdentity",
|
|
1032
|
+
actions: "log"
|
|
1033
|
+
},
|
|
1034
|
+
chooseResetStorage: {
|
|
1035
|
+
target: ".confirmingResetStorage",
|
|
1009
1036
|
actions: "log"
|
|
1010
1037
|
},
|
|
1011
1038
|
chooseAgent: {
|
|
@@ -1014,6 +1041,10 @@ var identityMachine = createMachine({
|
|
|
1014
1041
|
}
|
|
1015
1042
|
}
|
|
1016
1043
|
}, {
|
|
1044
|
+
guards: {
|
|
1045
|
+
initiallyManagingDeviceInvitation: ({ initialDisposition }, _event) => initialDisposition === "manage-device-invitation",
|
|
1046
|
+
initiallyManagingProfile: ({ initialDisposition }, _event) => initialDisposition === "manage-profile"
|
|
1047
|
+
},
|
|
1017
1048
|
actions: {
|
|
1018
1049
|
setIdentity: assign({
|
|
1019
1050
|
identity: (context, event) => event?.identity ?? null
|
|
@@ -1030,7 +1061,7 @@ var identityMachine = createMachine({
|
|
|
1030
1061
|
context
|
|
1031
1062
|
}, {
|
|
1032
1063
|
F: __dxlog_file,
|
|
1033
|
-
L:
|
|
1064
|
+
L: 126,
|
|
1034
1065
|
S: void 0,
|
|
1035
1066
|
C: (f, a) => f(...a)
|
|
1036
1067
|
});
|
|
@@ -1106,7 +1137,7 @@ var DeviceManager = ({ devices, active, send }) => {
|
|
|
1106
1137
|
};
|
|
1107
1138
|
|
|
1108
1139
|
// packages/sdk/shell/src/panels/IdentityPanel/steps/IdentityActionChooser.tsx
|
|
1109
|
-
import { CaretRight, Devices, Plus, Power, UserGear, HardDrive } from "@phosphor-icons/react";
|
|
1140
|
+
import { CaretRight, Devices, Plus, Power, UserGear, HardDrive, Intersect } from "@phosphor-icons/react";
|
|
1110
1141
|
import React25, { useCallback as useCallback4 } from "react";
|
|
1111
1142
|
import { log as log2 } from "@dxos/log";
|
|
1112
1143
|
import { useAgentHostingProviderClient, useClient as useClient2 } from "@dxos/react-client";
|
|
@@ -1164,7 +1195,20 @@ var IdentityActionChooserImpl = ({ onCreateInvitationClick, active, send, onDone
|
|
|
1164
1195
|
density: "coarse"
|
|
1165
1196
|
}, /* @__PURE__ */ React25.createElement("div", {
|
|
1166
1197
|
className: "grow justify-center flex flex-col gap-1"
|
|
1167
|
-
},
|
|
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, {
|
|
1168
1212
|
"data-testid": "manage-agent",
|
|
1169
1213
|
onClick: () => send?.({
|
|
1170
1214
|
type: "chooseAgent"
|
|
@@ -1190,35 +1234,35 @@ var IdentityActionChooserImpl = ({ onCreateInvitationClick, active, send, onDone
|
|
|
1190
1234
|
weight: "bold",
|
|
1191
1235
|
className: getSize8(4)
|
|
1192
1236
|
})), /* @__PURE__ */ React25.createElement(Action, {
|
|
1193
|
-
"data-testid": "
|
|
1237
|
+
"data-testid": "devices-panel.join-new-identity",
|
|
1194
1238
|
onClick: () => send?.({
|
|
1195
|
-
type: "
|
|
1239
|
+
type: "chooseJoinNewIdentity"
|
|
1196
1240
|
}),
|
|
1197
1241
|
classNames: "plb-4"
|
|
1198
|
-
}, /* @__PURE__ */ React25.createElement(
|
|
1242
|
+
}, /* @__PURE__ */ React25.createElement(Intersect, {
|
|
1199
1243
|
className: getSize8(6)
|
|
1200
1244
|
}), /* @__PURE__ */ React25.createElement("span", {
|
|
1201
1245
|
className: "grow mli-3"
|
|
1202
|
-
}, t("choose
|
|
1246
|
+
}, t("choose join new identity label")), /* @__PURE__ */ React25.createElement(CaretRight, {
|
|
1203
1247
|
weight: "bold",
|
|
1204
1248
|
className: getSize8(4)
|
|
1205
1249
|
})), /* @__PURE__ */ React25.createElement(Action, {
|
|
1206
|
-
"data-testid": "manage-
|
|
1250
|
+
"data-testid": "manage-devices",
|
|
1207
1251
|
onClick: () => send?.({
|
|
1208
|
-
type: "
|
|
1252
|
+
type: "chooseDevices"
|
|
1209
1253
|
}),
|
|
1210
1254
|
classNames: "plb-4"
|
|
1211
|
-
}, /* @__PURE__ */ React25.createElement(
|
|
1255
|
+
}, /* @__PURE__ */ React25.createElement(Devices, {
|
|
1212
1256
|
className: getSize8(6)
|
|
1213
1257
|
}), /* @__PURE__ */ React25.createElement("span", {
|
|
1214
1258
|
className: "grow mli-3"
|
|
1215
|
-
}, t("choose
|
|
1259
|
+
}, t("choose devices label")), /* @__PURE__ */ React25.createElement(CaretRight, {
|
|
1216
1260
|
weight: "bold",
|
|
1217
1261
|
className: getSize8(4)
|
|
1218
1262
|
})), /* @__PURE__ */ React25.createElement(Action, {
|
|
1219
1263
|
"data-testid": "devices-panel.sign-out",
|
|
1220
1264
|
onClick: () => send?.({
|
|
1221
|
-
type: "
|
|
1265
|
+
type: "chooseResetStorage"
|
|
1222
1266
|
}),
|
|
1223
1267
|
classNames: "plb-4"
|
|
1224
1268
|
}, /* @__PURE__ */ React25.createElement(Power, {
|
|
@@ -1319,64 +1363,24 @@ var ProfileFormImpl = (props) => {
|
|
|
1319
1363
|
variant: "primary",
|
|
1320
1364
|
disabled,
|
|
1321
1365
|
onClick: () => onUpdateProfile?.({
|
|
1322
|
-
displayName
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1366
|
+
...displayName && {
|
|
1367
|
+
displayName
|
|
1368
|
+
},
|
|
1369
|
+
...(emoji || hue) && {
|
|
1370
|
+
data: {
|
|
1371
|
+
...emoji && {
|
|
1372
|
+
emoji
|
|
1373
|
+
},
|
|
1374
|
+
...hue && {
|
|
1375
|
+
hue
|
|
1376
|
+
}
|
|
1377
|
+
}
|
|
1326
1378
|
}
|
|
1327
1379
|
}),
|
|
1328
1380
|
"data-testid": "update-profile-form-continue"
|
|
1329
1381
|
}, t("done label"))));
|
|
1330
1382
|
};
|
|
1331
1383
|
|
|
1332
|
-
// packages/sdk/shell/src/panels/IdentityPanel/steps/SignOutChooser.tsx
|
|
1333
|
-
import { Warning } from "@phosphor-icons/react";
|
|
1334
|
-
import React27 from "react";
|
|
1335
|
-
import { Message, useTranslation as useTranslation13 } from "@dxos/react-ui";
|
|
1336
|
-
import { getSize as getSize9, mx as mx18 } from "@dxos/react-ui-theme";
|
|
1337
|
-
var SignOutChooser = (props) => {
|
|
1338
|
-
const { t } = useTranslation13("os");
|
|
1339
|
-
const onResetDevice = () => {
|
|
1340
|
-
if (window.confirm(t("reset device confirm message"))) {
|
|
1341
|
-
void props.onResetDevice?.();
|
|
1342
|
-
}
|
|
1343
|
-
};
|
|
1344
|
-
return /* @__PURE__ */ React27.createElement(SignOutChooserImpl, {
|
|
1345
|
-
disabled: !props.active,
|
|
1346
|
-
onBack: () => props.send?.({
|
|
1347
|
-
type: "unchooseAction"
|
|
1348
|
-
}),
|
|
1349
|
-
onResetDevice,
|
|
1350
|
-
onJoinNewIdentity: props.onJoinNewIdentity
|
|
1351
|
-
});
|
|
1352
|
-
};
|
|
1353
|
-
var SignOutChooserImpl = ({ disabled, onResetDevice, onJoinNewIdentity, onBack }) => {
|
|
1354
|
-
const { t } = useTranslation13("os");
|
|
1355
|
-
return /* @__PURE__ */ React27.createElement(React27.Fragment, null, /* @__PURE__ */ React27.createElement("div", {
|
|
1356
|
-
role: "none",
|
|
1357
|
-
className: "grow flex flex-col justify-center"
|
|
1358
|
-
}, /* @__PURE__ */ React27.createElement(Message.Root, {
|
|
1359
|
-
valence: "error"
|
|
1360
|
-
}, /* @__PURE__ */ React27.createElement(Message.Title, null, /* @__PURE__ */ React27.createElement(Warning, {
|
|
1361
|
-
className: mx18(getSize9(6), "inline mie-2")
|
|
1362
|
-
}), 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, {
|
|
1363
|
-
disabled,
|
|
1364
|
-
onClick: onBack
|
|
1365
|
-
}, t("back label")), /* @__PURE__ */ React27.createElement(Action, {
|
|
1366
|
-
variant: "primary",
|
|
1367
|
-
"data-testid": "sign-out.join-new-identity",
|
|
1368
|
-
classNames: "!bg-error-500 hover:!bg-error-550",
|
|
1369
|
-
disabled,
|
|
1370
|
-
onClick: onJoinNewIdentity
|
|
1371
|
-
}, t("join new identity label")), /* @__PURE__ */ React27.createElement(Action, {
|
|
1372
|
-
variant: "primary",
|
|
1373
|
-
"data-testid": "sign-out.reset-device",
|
|
1374
|
-
classNames: "!bg-error-500 hover:!bg-error-550",
|
|
1375
|
-
disabled,
|
|
1376
|
-
onClick: onResetDevice
|
|
1377
|
-
}, t("reset device label"))));
|
|
1378
|
-
};
|
|
1379
|
-
|
|
1380
1384
|
// packages/sdk/shell/src/panels/IdentityPanel/useAgentHandlers.ts
|
|
1381
1385
|
import { useCallback as useCallback5, useEffect as useEffect2, useState as useState5 } from "react";
|
|
1382
1386
|
import { invariant } from "@dxos/invariant";
|
|
@@ -1478,11 +1482,11 @@ var useAgentHandlers = ({ client, invitations, identity }) => {
|
|
|
1478
1482
|
|
|
1479
1483
|
// packages/sdk/shell/src/steps/InvitationManager.tsx
|
|
1480
1484
|
import { Check as Check4, X as X3 } from "@phosphor-icons/react";
|
|
1481
|
-
import
|
|
1485
|
+
import React27, { useMemo as useMemo2 } from "react";
|
|
1482
1486
|
import { QR } from "react-qr-rounded";
|
|
1483
1487
|
import { Invitation as Invitation5 } from "@dxos/react-client/invitations";
|
|
1484
|
-
import { useId as useId4, useTranslation as
|
|
1485
|
-
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";
|
|
1486
1490
|
import { hexToEmoji as hexToEmoji3 } from "@dxos/util";
|
|
1487
1491
|
|
|
1488
1492
|
// packages/sdk/shell/src/util/invitationStatusValue.ts
|
|
@@ -1528,13 +1532,13 @@ var invitationStatusValue = /* @__PURE__ */ new Map([
|
|
|
1528
1532
|
|
|
1529
1533
|
// packages/sdk/shell/src/steps/InvitationManager.tsx
|
|
1530
1534
|
var InvitationManagerView = ({ children, ...props }) => {
|
|
1531
|
-
return /* @__PURE__ */
|
|
1535
|
+
return /* @__PURE__ */ React27.createElement(Viewport.View, {
|
|
1532
1536
|
...props,
|
|
1533
1537
|
classNames: "grow flex flex-col justify-around items-center"
|
|
1534
1538
|
}, children);
|
|
1535
1539
|
};
|
|
1536
1540
|
var InvitationManager = ({ invitationUrl, active, send, status, type, authCode, id = "0" }) => {
|
|
1537
|
-
const { t } =
|
|
1541
|
+
const { t } = useTranslation13("os");
|
|
1538
1542
|
const qrLabel = useId4("invitation-manager__qr-code");
|
|
1539
1543
|
const statusValue = type === Invitation5.Type.MULTIUSE ? 0 : invitationStatusValue.get(status) ?? 0;
|
|
1540
1544
|
const showAuthCode = statusValue === 3;
|
|
@@ -1552,50 +1556,50 @@ var InvitationManager = ({ invitationUrl, active, send, status, type, authCode,
|
|
|
1552
1556
|
}, [
|
|
1553
1557
|
statusValue
|
|
1554
1558
|
]);
|
|
1555
|
-
return /* @__PURE__ */
|
|
1559
|
+
return /* @__PURE__ */ React27.createElement(React27.Fragment, null, /* @__PURE__ */ React27.createElement(Viewport.Root, {
|
|
1556
1560
|
activeView,
|
|
1557
1561
|
classNames: "grow plb-1"
|
|
1558
|
-
}, /* @__PURE__ */
|
|
1562
|
+
}, /* @__PURE__ */ React27.createElement(Viewport.Views, null, /* @__PURE__ */ React27.createElement(InvitationManagerView, {
|
|
1559
1563
|
id: "showing qr",
|
|
1560
1564
|
emoji
|
|
1561
|
-
}, /* @__PURE__ */
|
|
1565
|
+
}, /* @__PURE__ */ React27.createElement("p", {
|
|
1562
1566
|
className: "text-sm mlb-1 font-normal text-center"
|
|
1563
|
-
}, 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", {
|
|
1564
1568
|
role: "none",
|
|
1565
|
-
className:
|
|
1566
|
-
}, /* @__PURE__ */
|
|
1569
|
+
className: mx18(descriptionText7, "is-full max-is-[14rem] relative")
|
|
1570
|
+
}, /* @__PURE__ */ React27.createElement(QR, {
|
|
1567
1571
|
rounding: 100,
|
|
1568
1572
|
backgroundColor: "transparent",
|
|
1569
1573
|
color: "currentColor",
|
|
1570
|
-
className:
|
|
1574
|
+
className: mx18("is-full bs-full p-2", showAuthCode && "invisible"),
|
|
1571
1575
|
"aria-labelledby": qrLabel,
|
|
1572
1576
|
errorCorrectionLevel: "Q",
|
|
1573
1577
|
cutout: true
|
|
1574
|
-
}, invitationUrl ?? "never"), /* @__PURE__ */
|
|
1578
|
+
}, invitationUrl ?? "never"), /* @__PURE__ */ React27.createElement(Centered, null, /* @__PURE__ */ React27.createElement(Emoji, {
|
|
1575
1579
|
text: emoji
|
|
1576
|
-
}))), /* @__PURE__ */
|
|
1580
|
+
}))), /* @__PURE__ */ React27.createElement("span", {
|
|
1577
1581
|
id: qrLabel,
|
|
1578
1582
|
className: "sr-only"
|
|
1579
|
-
}, t("qr label")), /* @__PURE__ */
|
|
1583
|
+
}, t("qr label")), /* @__PURE__ */ React27.createElement(CopyButton, {
|
|
1580
1584
|
variant: "ghost",
|
|
1581
1585
|
value: invitationUrl ?? "never"
|
|
1582
|
-
})), /* @__PURE__ */
|
|
1586
|
+
})), /* @__PURE__ */ React27.createElement(InvitationManagerView, {
|
|
1583
1587
|
id: "showing auth code"
|
|
1584
|
-
}, /* @__PURE__ */
|
|
1588
|
+
}, /* @__PURE__ */ React27.createElement(Label, null, t("auth code message")), /* @__PURE__ */ React27.createElement(AuthCode, {
|
|
1585
1589
|
code: authCode,
|
|
1586
1590
|
large: true,
|
|
1587
1591
|
classNames: "text-black dark:text-white"
|
|
1588
|
-
}), /* @__PURE__ */
|
|
1592
|
+
}), /* @__PURE__ */ React27.createElement(Label, null, "Be sure the other device is showing this symbol:"), emoji && /* @__PURE__ */ React27.createElement(Emoji, {
|
|
1589
1593
|
text: emoji
|
|
1590
|
-
})), /* @__PURE__ */
|
|
1594
|
+
})), /* @__PURE__ */ React27.createElement(InvitationManagerView, {
|
|
1591
1595
|
id: "showing final"
|
|
1592
|
-
}, statusValue > 0 ? /* @__PURE__ */
|
|
1593
|
-
className:
|
|
1594
|
-
}) : /* @__PURE__ */
|
|
1595
|
-
className:
|
|
1596
|
-
})))), /* @__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, {
|
|
1597
1601
|
classNames: "mbs-4"
|
|
1598
|
-
}, /* @__PURE__ */
|
|
1602
|
+
}, /* @__PURE__ */ React27.createElement(Action, {
|
|
1599
1603
|
disabled: !active,
|
|
1600
1604
|
onClick: () => send?.({
|
|
1601
1605
|
type: "deselectInvitation"
|
|
@@ -1603,8 +1607,76 @@ var InvitationManager = ({ invitationUrl, active, send, status, type, authCode,
|
|
|
1603
1607
|
}, t("back label"))));
|
|
1604
1608
|
};
|
|
1605
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
|
+
|
|
1606
1678
|
// packages/sdk/shell/src/panels/IdentityPanel/IdentityPanel.tsx
|
|
1607
|
-
var
|
|
1679
|
+
var __dxlog_file6 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/IdentityPanel/IdentityPanel.tsx";
|
|
1608
1680
|
var viewStyles = "pbs-1 pbe-3 pli-3";
|
|
1609
1681
|
var IdentityHeading = ({ titleId, title, identity, onDone }) => {
|
|
1610
1682
|
const fallbackValue = keyToFallback2(identity.identityKey);
|
|
@@ -1629,7 +1701,7 @@ var IdentityHeading = ({ titleId, title, identity, onDone }) => {
|
|
|
1629
1701
|
}, identity.profile?.displayName ?? generateName3(identity.identityKey.toHex()))));
|
|
1630
1702
|
};
|
|
1631
1703
|
var IdentityPanelImpl = (props) => {
|
|
1632
|
-
const { identity, titleId, activeView, onUpdateProfile,
|
|
1704
|
+
const { identity, titleId, activeView, onUpdateProfile, onResetStorage, onJoinNewIdentity, IdentityActionChooser: IdentityActionChooserComponent = IdentityActionChooser, InvitationManager: InvitationManagerComponent = InvitationManager, onDone, ...rest } = props;
|
|
1633
1705
|
const { t } = useTranslation15("os");
|
|
1634
1706
|
const title = useMemo3(() => {
|
|
1635
1707
|
switch (activeView) {
|
|
@@ -1644,6 +1716,7 @@ var IdentityPanelImpl = (props) => {
|
|
|
1644
1716
|
activeView,
|
|
1645
1717
|
t
|
|
1646
1718
|
]);
|
|
1719
|
+
const onCancelReset = () => rest.send?.("unchooseAction");
|
|
1647
1720
|
return /* @__PURE__ */ React29.createElement(DensityProvider2, {
|
|
1648
1721
|
density: "fine"
|
|
1649
1722
|
}, /* @__PURE__ */ React29.createElement(IdentityHeading, {
|
|
@@ -1680,14 +1753,6 @@ var IdentityPanelImpl = (props) => {
|
|
|
1680
1753
|
active: activeView === "update profile form",
|
|
1681
1754
|
identity,
|
|
1682
1755
|
onUpdateProfile
|
|
1683
|
-
})), /* @__PURE__ */ React29.createElement(Viewport.View, {
|
|
1684
|
-
classNames: viewStyles,
|
|
1685
|
-
id: "signing out"
|
|
1686
|
-
}, /* @__PURE__ */ React29.createElement(SignOutChooser, {
|
|
1687
|
-
send: rest.send,
|
|
1688
|
-
active: activeView === "signing out",
|
|
1689
|
-
onResetDevice,
|
|
1690
|
-
onJoinNewIdentity
|
|
1691
1756
|
})), /* @__PURE__ */ React29.createElement(Viewport.View, {
|
|
1692
1757
|
classNames: viewStyles,
|
|
1693
1758
|
id: "agent manager"
|
|
@@ -1695,6 +1760,24 @@ var IdentityPanelImpl = (props) => {
|
|
|
1695
1760
|
send: rest.send,
|
|
1696
1761
|
active: activeView === "agent manager",
|
|
1697
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
|
|
1698
1781
|
})))));
|
|
1699
1782
|
};
|
|
1700
1783
|
var IdentityPanelWithInvitationImpl = ({ invitation, ...props }) => {
|
|
@@ -1704,7 +1787,7 @@ var IdentityPanelWithInvitationImpl = ({ invitation, ...props }) => {
|
|
|
1704
1787
|
...invitationStatus
|
|
1705
1788
|
});
|
|
1706
1789
|
};
|
|
1707
|
-
var IdentityPanel = ({ titleId: propsTitleId, createInvitationUrl = (code) => code, ...props }) => {
|
|
1790
|
+
var IdentityPanel = ({ titleId: propsTitleId, createInvitationUrl = (code) => code, initialDisposition = "default", ...props }) => {
|
|
1708
1791
|
const titleId = useId5("identityPanel__heading", propsTitleId);
|
|
1709
1792
|
const client = useClient3();
|
|
1710
1793
|
const devices = useDevices();
|
|
@@ -1716,20 +1799,24 @@ var IdentityPanel = ({ titleId: propsTitleId, createInvitationUrl = (code) => co
|
|
|
1716
1799
|
invitations
|
|
1717
1800
|
});
|
|
1718
1801
|
if (!identity) {
|
|
1719
|
-
|
|
1720
|
-
F:
|
|
1721
|
-
L:
|
|
1802
|
+
log6.error("IdentityPanel rendered with no active identity.", void 0, {
|
|
1803
|
+
F: __dxlog_file6,
|
|
1804
|
+
L: 145,
|
|
1722
1805
|
S: void 0,
|
|
1723
1806
|
C: (f, a) => f(...a)
|
|
1724
1807
|
});
|
|
1725
1808
|
return null;
|
|
1726
1809
|
}
|
|
1727
|
-
const [identityState, identitySend, identityService] = useIdentityMachine(client
|
|
1810
|
+
const [identityState, identitySend, identityService] = useIdentityMachine(client, {
|
|
1811
|
+
context: {
|
|
1812
|
+
initialDisposition
|
|
1813
|
+
}
|
|
1814
|
+
});
|
|
1728
1815
|
useEffect3(() => {
|
|
1729
1816
|
const subscription = identityService.subscribe((state) => {
|
|
1730
|
-
|
|
1731
|
-
F:
|
|
1732
|
-
L:
|
|
1817
|
+
log6("[state]", state, {
|
|
1818
|
+
F: __dxlog_file6,
|
|
1819
|
+
L: 154,
|
|
1733
1820
|
S: void 0,
|
|
1734
1821
|
C: (f, a) => f(...a)
|
|
1735
1822
|
});
|
|
@@ -1755,8 +1842,10 @@ var IdentityPanel = ({ titleId: propsTitleId, createInvitationUrl = (code) => co
|
|
|
1755
1842
|
}
|
|
1756
1843
|
].some(identityState.matches):
|
|
1757
1844
|
return "update profile form";
|
|
1758
|
-
case identityState.matches("
|
|
1759
|
-
return "
|
|
1845
|
+
case identityState.matches("confirmingResetStorage"):
|
|
1846
|
+
return "confirm reset storage";
|
|
1847
|
+
case identityState.matches("confirmingJoinNewIdentity"):
|
|
1848
|
+
return "confirm join new identity";
|
|
1760
1849
|
case [
|
|
1761
1850
|
{
|
|
1762
1851
|
managingAgent: "idle"
|
|
@@ -1796,9 +1885,9 @@ var IdentityPanel = ({ titleId: propsTitleId, createInvitationUrl = (code) => co
|
|
|
1796
1885
|
};
|
|
1797
1886
|
|
|
1798
1887
|
// packages/sdk/shell/src/panels/JoinPanel/JoinPanel.tsx
|
|
1799
|
-
import
|
|
1888
|
+
import React38, { useCallback as useCallback7, useEffect as useEffect5, useMemo as useMemo4 } from "react";
|
|
1800
1889
|
import { log as log10 } from "@dxos/log";
|
|
1801
|
-
import { useClient as
|
|
1890
|
+
import { useClient as useClient5, useMulticastObservable } from "@dxos/react-client";
|
|
1802
1891
|
import { useIdentity as useIdentity2 } from "@dxos/react-client/halo";
|
|
1803
1892
|
import { DensityProvider as DensityProvider3, useId as useId7, useThemeContext as useThemeContext4 } from "@dxos/react-ui";
|
|
1804
1893
|
|
|
@@ -1839,14 +1928,14 @@ var JoinHeading = /* @__PURE__ */ forwardRef8(({ mode, titleId, onExit, exitActi
|
|
|
1839
1928
|
import { useMachine as useMachine2 } from "@xstate/react";
|
|
1840
1929
|
import { useCallback as useCallback6 } from "react";
|
|
1841
1930
|
import { assign as assign2, createMachine as createMachine2 } from "xstate";
|
|
1842
|
-
import { log as
|
|
1931
|
+
import { log as log7 } from "@dxos/log";
|
|
1843
1932
|
import { AlreadyJoinedError } from "@dxos/react-client";
|
|
1844
1933
|
import { Invitation as Invitation6, InvitationEncoder as InvitationEncoder3 } from "@dxos/react-client/invitations";
|
|
1845
|
-
var
|
|
1934
|
+
var __dxlog_file7 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/JoinPanel/joinMachine.ts";
|
|
1846
1935
|
var getInvitationSubscribable = (Kind, invitation) => {
|
|
1847
|
-
|
|
1848
|
-
F:
|
|
1849
|
-
L:
|
|
1936
|
+
log7("[subscribing to invitation]", invitation, {
|
|
1937
|
+
F: __dxlog_file7,
|
|
1938
|
+
L: 90,
|
|
1850
1939
|
S: void 0,
|
|
1851
1940
|
C: (f, a) => f(...a)
|
|
1852
1941
|
});
|
|
@@ -1854,12 +1943,12 @@ var getInvitationSubscribable = (Kind, invitation) => {
|
|
|
1854
1943
|
subscribe: (next, onError, complete) => invitation.subscribe((invitation2) => {
|
|
1855
1944
|
switch (invitation2.state) {
|
|
1856
1945
|
case Invitation6.State.CONNECTING: {
|
|
1857
|
-
|
|
1946
|
+
log7("[invitation connecting]", {
|
|
1858
1947
|
Kind,
|
|
1859
1948
|
invitation: invitation2
|
|
1860
1949
|
}, {
|
|
1861
|
-
F:
|
|
1862
|
-
L:
|
|
1950
|
+
F: __dxlog_file7,
|
|
1951
|
+
L: 101,
|
|
1863
1952
|
S: void 0,
|
|
1864
1953
|
C: (f, a) => f(...a)
|
|
1865
1954
|
});
|
|
@@ -1869,12 +1958,12 @@ var getInvitationSubscribable = (Kind, invitation) => {
|
|
|
1869
1958
|
});
|
|
1870
1959
|
}
|
|
1871
1960
|
case Invitation6.State.CONNECTED: {
|
|
1872
|
-
|
|
1961
|
+
log7("[invitation connected]", {
|
|
1873
1962
|
Kind,
|
|
1874
1963
|
invitation: invitation2
|
|
1875
1964
|
}, {
|
|
1876
|
-
F:
|
|
1877
|
-
L:
|
|
1965
|
+
F: __dxlog_file7,
|
|
1966
|
+
L: 106,
|
|
1878
1967
|
S: void 0,
|
|
1879
1968
|
C: (f, a) => f(...a)
|
|
1880
1969
|
});
|
|
@@ -1884,12 +1973,12 @@ var getInvitationSubscribable = (Kind, invitation) => {
|
|
|
1884
1973
|
});
|
|
1885
1974
|
}
|
|
1886
1975
|
case Invitation6.State.READY_FOR_AUTHENTICATION: {
|
|
1887
|
-
|
|
1976
|
+
log7("[invitation ready for authentication]", {
|
|
1888
1977
|
Kind,
|
|
1889
1978
|
invitation: invitation2
|
|
1890
1979
|
}, {
|
|
1891
|
-
F:
|
|
1892
|
-
L:
|
|
1980
|
+
F: __dxlog_file7,
|
|
1981
|
+
L: 111,
|
|
1893
1982
|
S: void 0,
|
|
1894
1983
|
C: (f, a) => f(...a)
|
|
1895
1984
|
});
|
|
@@ -1899,12 +1988,12 @@ var getInvitationSubscribable = (Kind, invitation) => {
|
|
|
1899
1988
|
});
|
|
1900
1989
|
}
|
|
1901
1990
|
case Invitation6.State.AUTHENTICATING: {
|
|
1902
|
-
|
|
1991
|
+
log7("[invitation authenticating]", {
|
|
1903
1992
|
Kind,
|
|
1904
1993
|
invitation: invitation2
|
|
1905
1994
|
}, {
|
|
1906
|
-
F:
|
|
1907
|
-
L:
|
|
1995
|
+
F: __dxlog_file7,
|
|
1996
|
+
L: 116,
|
|
1908
1997
|
S: void 0,
|
|
1909
1998
|
C: (f, a) => f(...a)
|
|
1910
1999
|
});
|
|
@@ -1914,12 +2003,12 @@ var getInvitationSubscribable = (Kind, invitation) => {
|
|
|
1914
2003
|
});
|
|
1915
2004
|
}
|
|
1916
2005
|
case Invitation6.State.SUCCESS: {
|
|
1917
|
-
|
|
2006
|
+
log7("[invitation success]", {
|
|
1918
2007
|
Kind,
|
|
1919
2008
|
invitation: invitation2
|
|
1920
2009
|
}, {
|
|
1921
|
-
F:
|
|
1922
|
-
L:
|
|
2010
|
+
F: __dxlog_file7,
|
|
2011
|
+
L: 121,
|
|
1923
2012
|
S: void 0,
|
|
1924
2013
|
C: (f, a) => f(...a)
|
|
1925
2014
|
});
|
|
@@ -1930,11 +2019,11 @@ var getInvitationSubscribable = (Kind, invitation) => {
|
|
|
1930
2019
|
return complete?.();
|
|
1931
2020
|
}
|
|
1932
2021
|
case Invitation6.State.CANCELLED: {
|
|
1933
|
-
|
|
2022
|
+
log7.warn("[invitation cancelled]", {
|
|
1934
2023
|
Kind
|
|
1935
2024
|
}, {
|
|
1936
|
-
F:
|
|
1937
|
-
L:
|
|
2025
|
+
F: __dxlog_file7,
|
|
2026
|
+
L: 127,
|
|
1938
2027
|
S: void 0,
|
|
1939
2028
|
C: (f, a) => f(...a)
|
|
1940
2029
|
});
|
|
@@ -1944,11 +2033,11 @@ var getInvitationSubscribable = (Kind, invitation) => {
|
|
|
1944
2033
|
});
|
|
1945
2034
|
}
|
|
1946
2035
|
case Invitation6.State.TIMEOUT: {
|
|
1947
|
-
|
|
2036
|
+
log7.error("[invitation timeout]", {
|
|
1948
2037
|
Kind
|
|
1949
2038
|
}, {
|
|
1950
|
-
F:
|
|
1951
|
-
L:
|
|
2039
|
+
F: __dxlog_file7,
|
|
2040
|
+
L: 132,
|
|
1952
2041
|
S: void 0,
|
|
1953
2042
|
C: (f, a) => f(...a)
|
|
1954
2043
|
});
|
|
@@ -1960,12 +2049,12 @@ var getInvitationSubscribable = (Kind, invitation) => {
|
|
|
1960
2049
|
}
|
|
1961
2050
|
}, (error) => {
|
|
1962
2051
|
if (error instanceof AlreadyJoinedError) {
|
|
1963
|
-
|
|
2052
|
+
log7("[already joined]", {
|
|
1964
2053
|
Kind,
|
|
1965
2054
|
error
|
|
1966
2055
|
}, {
|
|
1967
|
-
F:
|
|
1968
|
-
L:
|
|
2056
|
+
F: __dxlog_file7,
|
|
2057
|
+
L: 139,
|
|
1969
2058
|
S: void 0,
|
|
1970
2059
|
C: (f, a) => f(...a)
|
|
1971
2060
|
});
|
|
@@ -1975,12 +2064,12 @@ var getInvitationSubscribable = (Kind, invitation) => {
|
|
|
1975
2064
|
});
|
|
1976
2065
|
return complete?.();
|
|
1977
2066
|
}
|
|
1978
|
-
|
|
2067
|
+
log7.error("[invitation errored]", {
|
|
1979
2068
|
Kind,
|
|
1980
2069
|
error
|
|
1981
2070
|
}, {
|
|
1982
|
-
F:
|
|
1983
|
-
L:
|
|
2071
|
+
F: __dxlog_file7,
|
|
2072
|
+
L: 144,
|
|
1984
2073
|
S: void 0,
|
|
1985
2074
|
C: (f, a) => f(...a)
|
|
1986
2075
|
});
|
|
@@ -2152,6 +2241,7 @@ var joinMachine = createMachine2({
|
|
|
2152
2241
|
id: "join",
|
|
2153
2242
|
predictableActionArguments: true,
|
|
2154
2243
|
context: {
|
|
2244
|
+
initialDisposition: "default",
|
|
2155
2245
|
mode: "default",
|
|
2156
2246
|
identity: null,
|
|
2157
2247
|
halo: {},
|
|
@@ -2166,6 +2256,11 @@ var joinMachine = createMachine2({
|
|
|
2166
2256
|
target: "resettingIdentity",
|
|
2167
2257
|
actions: "log"
|
|
2168
2258
|
},
|
|
2259
|
+
{
|
|
2260
|
+
cond: "initiallyAcceptingHaloInvitation",
|
|
2261
|
+
target: "#join.choosingIdentity.acceptingHaloInvitation",
|
|
2262
|
+
actions: "log"
|
|
2263
|
+
},
|
|
2169
2264
|
{
|
|
2170
2265
|
cond: "noSelectedIdentity",
|
|
2171
2266
|
target: "choosingIdentity",
|
|
@@ -2248,6 +2343,7 @@ var joinMachine = createMachine2({
|
|
|
2248
2343
|
guards: {
|
|
2249
2344
|
existingIdentity: ({ identity, mode }, _event) => mode === "halo-only" && !!identity,
|
|
2250
2345
|
noSelectedIdentity: ({ identity }, _event) => !identity,
|
|
2346
|
+
initiallyAcceptingHaloInvitation: ({ identity, initialDisposition }, _event) => !identity && initialDisposition === "accept-halo-invitation",
|
|
2251
2347
|
hasHaloUnredeemedCode: ({ halo }, _event) => !!halo.unredeemedCode,
|
|
2252
2348
|
noSpaceInvitation: ({ space }, _event) => !space.invitation && !space.unredeemedCode
|
|
2253
2349
|
},
|
|
@@ -2299,13 +2395,13 @@ var joinMachine = createMachine2({
|
|
|
2299
2395
|
} : context.space
|
|
2300
2396
|
}),
|
|
2301
2397
|
log: (context, event) => {
|
|
2302
|
-
|
|
2398
|
+
log7("[transition]", {
|
|
2303
2399
|
event,
|
|
2304
2400
|
haloInvitation: context.halo.invitation,
|
|
2305
2401
|
spaceInvitation: context.space.invitation
|
|
2306
2402
|
}, {
|
|
2307
|
-
F:
|
|
2308
|
-
L:
|
|
2403
|
+
F: __dxlog_file7,
|
|
2404
|
+
L: 416,
|
|
2309
2405
|
S: void 0,
|
|
2310
2406
|
C: (f, a) => f(...a)
|
|
2311
2407
|
});
|
|
@@ -2317,9 +2413,9 @@ var defaultCodeFromUrl = (invitationType, text) => {
|
|
|
2317
2413
|
const searchParams = new URLSearchParams(text.substring(text.lastIndexOf("?")));
|
|
2318
2414
|
return searchParams.get(`${invitationType}InvitationCode`) ?? searchParams.get(`${invitationType}Invitation`) ?? searchParams.get("invitationCode") ?? searchParams.get("invitation") ?? text;
|
|
2319
2415
|
} catch (err) {
|
|
2320
|
-
|
|
2321
|
-
F:
|
|
2322
|
-
L:
|
|
2416
|
+
log7.catch(err, void 0, {
|
|
2417
|
+
F: __dxlog_file7,
|
|
2418
|
+
L: 443,
|
|
2323
2419
|
S: void 0,
|
|
2324
2420
|
C: (f, a) => f(...a)
|
|
2325
2421
|
});
|
|
@@ -2338,9 +2434,9 @@ var useJoinMachine = (client, options) => {
|
|
|
2338
2434
|
invitationSubscribable: getInvitationSubscribable("Halo", invitationObservable)
|
|
2339
2435
|
};
|
|
2340
2436
|
} catch (err) {
|
|
2341
|
-
|
|
2342
|
-
F:
|
|
2343
|
-
L:
|
|
2437
|
+
log7.error("Could not redeem device invitation code", err, {
|
|
2438
|
+
F: __dxlog_file7,
|
|
2439
|
+
L: 464,
|
|
2344
2440
|
S: void 0,
|
|
2345
2441
|
C: (f, a) => f(...a)
|
|
2346
2442
|
});
|
|
@@ -2363,9 +2459,9 @@ var useJoinMachine = (client, options) => {
|
|
|
2363
2459
|
invitationSubscribable: getInvitationSubscribable("Space", invitationObservable)
|
|
2364
2460
|
};
|
|
2365
2461
|
} catch (err) {
|
|
2366
|
-
|
|
2367
|
-
F:
|
|
2368
|
-
L:
|
|
2462
|
+
log7.error("Could not redeem space invitation code", err, {
|
|
2463
|
+
F: __dxlog_file7,
|
|
2464
|
+
L: 486,
|
|
2369
2465
|
S: void 0,
|
|
2370
2466
|
C: (f, a) => f(...a)
|
|
2371
2467
|
});
|
|
@@ -2528,17 +2624,17 @@ var IdentityAdded = (props) => {
|
|
|
2528
2624
|
};
|
|
2529
2625
|
|
|
2530
2626
|
// packages/sdk/shell/src/panels/JoinPanel/steps/IdentityInput.tsx
|
|
2531
|
-
import React33, { useState as
|
|
2532
|
-
import { log as
|
|
2627
|
+
import React33, { useState as useState7 } from "react";
|
|
2628
|
+
import { log as log8 } from "@dxos/log";
|
|
2533
2629
|
import { useClient as useClient4 } from "@dxos/react-client";
|
|
2534
2630
|
import { useTranslation as useTranslation19 } from "@dxos/react-ui";
|
|
2535
|
-
var
|
|
2631
|
+
var __dxlog_file8 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/JoinPanel/steps/IdentityInput.tsx";
|
|
2536
2632
|
var IdentityInput = (props) => {
|
|
2537
2633
|
const { send, method } = props;
|
|
2538
2634
|
const isRecover = method === "recover identity";
|
|
2539
2635
|
const client = useClient4();
|
|
2540
2636
|
const { t } = useTranslation19("os");
|
|
2541
|
-
const [validationMessage, setValidationMessage] =
|
|
2637
|
+
const [validationMessage, setValidationMessage] = useState7("");
|
|
2542
2638
|
const createIdentity = (displayName) => {
|
|
2543
2639
|
void client.halo.createIdentity({
|
|
2544
2640
|
[isRecover ? "seedphrase" : "displayName"]: displayName
|
|
@@ -2548,8 +2644,8 @@ var IdentityInput = (props) => {
|
|
|
2548
2644
|
identity
|
|
2549
2645
|
});
|
|
2550
2646
|
}, (error) => {
|
|
2551
|
-
|
|
2552
|
-
F:
|
|
2647
|
+
log8.catch(error, void 0, {
|
|
2648
|
+
F: __dxlog_file8,
|
|
2553
2649
|
L: 37,
|
|
2554
2650
|
S: void 0,
|
|
2555
2651
|
C: (f, a) => f(...a)
|
|
@@ -2567,7 +2663,7 @@ var IdentityInputImpl = (props) => {
|
|
|
2567
2663
|
const { method, send, active, onDisplayNameConfirm, validationMessage } = props;
|
|
2568
2664
|
const disabled = !active;
|
|
2569
2665
|
const { t } = useTranslation19("os");
|
|
2570
|
-
const [inputValue, setInputValue] =
|
|
2666
|
+
const [inputValue, setInputValue] = useState7("");
|
|
2571
2667
|
const isRecover = method === "recover identity";
|
|
2572
2668
|
return /* @__PURE__ */ React33.createElement(React33.Fragment, null, /* @__PURE__ */ React33.createElement("div", {
|
|
2573
2669
|
role: "none",
|
|
@@ -2617,18 +2713,18 @@ var InvitationAccepted = (props) => {
|
|
|
2617
2713
|
};
|
|
2618
2714
|
|
|
2619
2715
|
// packages/sdk/shell/src/panels/JoinPanel/steps/InvitationInput.tsx
|
|
2620
|
-
import React35, { useState as
|
|
2621
|
-
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";
|
|
2622
2718
|
import { useTranslation as useTranslation21 } from "@dxos/react-ui";
|
|
2623
|
-
var
|
|
2719
|
+
var __dxlog_file9 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/JoinPanel/steps/InvitationInput.tsx";
|
|
2624
2720
|
var invitationCodeFromUrl = (text) => {
|
|
2625
2721
|
try {
|
|
2626
2722
|
const searchParams = new URLSearchParams(text.substring(text.lastIndexOf("?")));
|
|
2627
2723
|
const invitation = searchParams.get("spaceInvitationCode") ?? searchParams.get("deviceInvitationCode");
|
|
2628
2724
|
return invitation ?? text;
|
|
2629
2725
|
} catch (err) {
|
|
2630
|
-
|
|
2631
|
-
F:
|
|
2726
|
+
log9.catch(err, void 0, {
|
|
2727
|
+
F: __dxlog_file9,
|
|
2632
2728
|
L: 25,
|
|
2633
2729
|
S: void 0,
|
|
2634
2730
|
C: (f, a) => f(...a)
|
|
@@ -2640,7 +2736,7 @@ var InvitationInput = (props) => {
|
|
|
2640
2736
|
const { Kind, active, send, unredeemedCode, onExit, exitActionParent, onDone, doneActionParent, succeededKeys } = props;
|
|
2641
2737
|
const disabled = !active;
|
|
2642
2738
|
const { t } = useTranslation21("os");
|
|
2643
|
-
const [inputValue, setInputValue] =
|
|
2739
|
+
const [inputValue, setInputValue] = useState8(unredeemedCode ?? "");
|
|
2644
2740
|
useEffect4(() => {
|
|
2645
2741
|
unredeemedCode && setInputValue(unredeemedCode ?? "");
|
|
2646
2742
|
}, [
|
|
@@ -2759,7 +2855,7 @@ var InvitationRescuer = (props) => {
|
|
|
2759
2855
|
};
|
|
2760
2856
|
|
|
2761
2857
|
// packages/sdk/shell/src/panels/JoinPanel/steps/InvitationAuthenticator.tsx
|
|
2762
|
-
import React37, { useState as
|
|
2858
|
+
import React37, { useState as useState9 } from "react";
|
|
2763
2859
|
import { Input as Input2, useTranslation as useTranslation23 } from "@dxos/react-ui";
|
|
2764
2860
|
import { hexToEmoji as hexToEmoji4 } from "@dxos/util";
|
|
2765
2861
|
var pinLength = 6;
|
|
@@ -2767,7 +2863,7 @@ var InvitationAuthenticator = ({ failed, Kind, active, pending, invitationId, on
|
|
|
2767
2863
|
const disabled = !active || pending;
|
|
2768
2864
|
const { t } = useTranslation23("os");
|
|
2769
2865
|
const invitationType = Kind.toLowerCase();
|
|
2770
|
-
const [authCode, setAuthCode] =
|
|
2866
|
+
const [authCode, setAuthCode] = useState9("");
|
|
2771
2867
|
const onChange = ({ target: { value } }) => {
|
|
2772
2868
|
setAuthCode(value);
|
|
2773
2869
|
if (value.length === pinLength) {
|
|
@@ -2810,64 +2906,6 @@ var InvitationAuthenticator = ({ failed, Kind, active, pending, invitationId, on
|
|
|
2810
2906
|
}, t("next label"))));
|
|
2811
2907
|
};
|
|
2812
2908
|
|
|
2813
|
-
// packages/sdk/shell/src/panels/JoinPanel/steps/ResetIdentity.tsx
|
|
2814
|
-
import React38, { useState as useState9 } from "react";
|
|
2815
|
-
import { log as log9 } from "@dxos/log";
|
|
2816
|
-
import { useClient as useClient5 } from "@dxos/react-client";
|
|
2817
|
-
import { useTranslation as useTranslation24 } from "@dxos/react-ui";
|
|
2818
|
-
var __dxlog_file9 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/JoinPanel/steps/ResetIdentity.tsx";
|
|
2819
|
-
var ResetIdentity = ({ send, active }) => {
|
|
2820
|
-
const client = useClient5();
|
|
2821
|
-
const { t } = useTranslation24("os");
|
|
2822
|
-
const [validationMessage, setValidationMessage] = useState9("");
|
|
2823
|
-
const [pending, setPending] = useState9(false);
|
|
2824
|
-
const resetIdentity = () => {
|
|
2825
|
-
setPending(true);
|
|
2826
|
-
void client.reset().then(() => send?.({
|
|
2827
|
-
type: "resetIdentity"
|
|
2828
|
-
}), (error) => {
|
|
2829
|
-
log9.catch(error, void 0, {
|
|
2830
|
-
F: __dxlog_file9,
|
|
2831
|
-
L: 35,
|
|
2832
|
-
S: void 0,
|
|
2833
|
-
C: (f, a) => f(...a)
|
|
2834
|
-
});
|
|
2835
|
-
setValidationMessage(t("failed to reset identity message"));
|
|
2836
|
-
setPending(false);
|
|
2837
|
-
});
|
|
2838
|
-
};
|
|
2839
|
-
return /* @__PURE__ */ React38.createElement(ResetIdentityImpl, {
|
|
2840
|
-
disabled: !active,
|
|
2841
|
-
pending,
|
|
2842
|
-
validationMessage,
|
|
2843
|
-
onConfirm: () => resetIdentity()
|
|
2844
|
-
});
|
|
2845
|
-
};
|
|
2846
|
-
var ResetIdentityImpl = ({ disabled, pending, validationMessage, onConfirm }) => {
|
|
2847
|
-
const { t } = useTranslation24("os");
|
|
2848
|
-
const confirmationValue = t("confirmation value");
|
|
2849
|
-
const [inputValue, setInputValue] = useState9("");
|
|
2850
|
-
return /* @__PURE__ */ React38.createElement(React38.Fragment, null, /* @__PURE__ */ React38.createElement("div", {
|
|
2851
|
-
role: "none",
|
|
2852
|
-
className: "grow flex flex-col justify-center"
|
|
2853
|
-
}, /* @__PURE__ */ React38.createElement(Input, {
|
|
2854
|
-
validationMessage,
|
|
2855
|
-
label: /* @__PURE__ */ React38.createElement(StepHeading, null, t("reset identity input label", {
|
|
2856
|
-
confirmationValue
|
|
2857
|
-
})),
|
|
2858
|
-
disabled,
|
|
2859
|
-
"data-testid": "reset-identity-input",
|
|
2860
|
-
placeholder: confirmationValue,
|
|
2861
|
-
onChange: ({ target: { value } }) => setInputValue(value)
|
|
2862
|
-
})), /* @__PURE__ */ React38.createElement(Actions, null, /* @__PURE__ */ React38.createElement(Action, {
|
|
2863
|
-
// TODO(wittjosiah): Probably make this red?
|
|
2864
|
-
variant: "primary",
|
|
2865
|
-
disabled: disabled || pending || inputValue !== confirmationValue,
|
|
2866
|
-
onClick: () => onConfirm?.(),
|
|
2867
|
-
"data-testid": "reset-identity-input-confirm"
|
|
2868
|
-
}, pending ? t("reset in progress label") : t("confirm label"))));
|
|
2869
|
-
};
|
|
2870
|
-
|
|
2871
2909
|
// packages/sdk/shell/src/styles/panelStyles.ts
|
|
2872
2910
|
var stepStyles = "pbs-1 pbe-3 pli-3";
|
|
2873
2911
|
|
|
@@ -2895,48 +2933,49 @@ var resolvedTextColor = (status) => status === Invitation7.State.ERROR ? errorTe
|
|
|
2895
2933
|
// packages/sdk/shell/src/panels/JoinPanel/JoinPanel.tsx
|
|
2896
2934
|
var __dxlog_file10 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/JoinPanel/JoinPanel.tsx";
|
|
2897
2935
|
var JoinPanelImpl = (props) => {
|
|
2898
|
-
const { titleId, send, activeView, failed, mode, unredeemedCodes, invitationStates, succeededKeys, failReasons, onExit, onHaloDone, onSpaceDone, exitActionParent, doneActionParent, onHaloInvitationCancel, onSpaceInvitationCancel, onHaloInvitationAuthenticate, onSpaceInvitationAuthenticate, IdentityInput: IdentityInputComponent = IdentityInput,
|
|
2899
|
-
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, {
|
|
2900
2938
|
density: "fine"
|
|
2901
|
-
}, mode !== "halo-only" && /* @__PURE__ */
|
|
2939
|
+
}, mode !== "halo-only" && /* @__PURE__ */ React38.createElement(JoinHeading, {
|
|
2902
2940
|
titleId,
|
|
2903
2941
|
mode,
|
|
2904
2942
|
onExit,
|
|
2905
2943
|
exitActionParent
|
|
2906
|
-
}), /* @__PURE__ */
|
|
2944
|
+
}), /* @__PURE__ */ React38.createElement(Viewport.Root, {
|
|
2907
2945
|
focusManaged: true,
|
|
2908
2946
|
activeView
|
|
2909
|
-
}, /* @__PURE__ */
|
|
2947
|
+
}, /* @__PURE__ */ React38.createElement(Viewport.Views, null, /* @__PURE__ */ React38.createElement(Viewport.View, {
|
|
2910
2948
|
classNames: stepStyles,
|
|
2911
2949
|
id: "addition method chooser"
|
|
2912
|
-
}, /* @__PURE__ */
|
|
2950
|
+
}, /* @__PURE__ */ React38.createElement(AdditionMethodChooser, {
|
|
2913
2951
|
send,
|
|
2914
2952
|
active: activeView === "addition method chooser"
|
|
2915
|
-
})), /* @__PURE__ */
|
|
2953
|
+
})), /* @__PURE__ */ React38.createElement(Viewport.View, {
|
|
2916
2954
|
classNames: stepStyles,
|
|
2917
|
-
id: "reset
|
|
2918
|
-
}, /* @__PURE__ */
|
|
2955
|
+
id: "reset storage confirmation"
|
|
2956
|
+
}, /* @__PURE__ */ React38.createElement(ConfirmResetComponent, {
|
|
2919
2957
|
send,
|
|
2920
|
-
|
|
2921
|
-
|
|
2922
|
-
|
|
2958
|
+
active: activeView === "reset identity confirmation",
|
|
2959
|
+
onCancel: onCancelResetStorage,
|
|
2960
|
+
onConfirm: onConfirmResetStorage
|
|
2961
|
+
})), /* @__PURE__ */ React38.createElement(Viewport.View, {
|
|
2923
2962
|
classNames: stepStyles,
|
|
2924
2963
|
id: "create identity input"
|
|
2925
|
-
}, /* @__PURE__ */
|
|
2964
|
+
}, /* @__PURE__ */ React38.createElement(IdentityInputComponent, {
|
|
2926
2965
|
send,
|
|
2927
2966
|
method: "create identity",
|
|
2928
2967
|
active: activeView === "create identity input"
|
|
2929
|
-
})), /* @__PURE__ */
|
|
2968
|
+
})), /* @__PURE__ */ React38.createElement(Viewport.View, {
|
|
2930
2969
|
classNames: stepStyles,
|
|
2931
2970
|
id: "recover identity input"
|
|
2932
|
-
}, /* @__PURE__ */
|
|
2971
|
+
}, /* @__PURE__ */ React38.createElement(IdentityInputComponent, {
|
|
2933
2972
|
send,
|
|
2934
2973
|
method: "recover identity",
|
|
2935
2974
|
active: activeView === "recover identity input"
|
|
2936
|
-
})), /* @__PURE__ */
|
|
2975
|
+
})), /* @__PURE__ */ React38.createElement(Viewport.View, {
|
|
2937
2976
|
classNames: stepStyles,
|
|
2938
2977
|
id: "halo invitation input"
|
|
2939
|
-
}, /* @__PURE__ */
|
|
2978
|
+
}, /* @__PURE__ */ React38.createElement(InvitationInput, {
|
|
2940
2979
|
send,
|
|
2941
2980
|
Kind: "Halo",
|
|
2942
2981
|
active: activeView === "halo invitation input",
|
|
@@ -2946,20 +2985,20 @@ var JoinPanelImpl = (props) => {
|
|
|
2946
2985
|
...succeededKeys?.Halo && {
|
|
2947
2986
|
succeededKeys: succeededKeys.Halo
|
|
2948
2987
|
}
|
|
2949
|
-
})), /* @__PURE__ */
|
|
2988
|
+
})), /* @__PURE__ */ React38.createElement(Viewport.View, {
|
|
2950
2989
|
classNames: stepStyles,
|
|
2951
2990
|
id: "halo invitation rescuer"
|
|
2952
|
-
}, /* @__PURE__ */
|
|
2991
|
+
}, /* @__PURE__ */ React38.createElement(InvitationRescuer, {
|
|
2953
2992
|
send,
|
|
2954
2993
|
Kind: "Halo",
|
|
2955
2994
|
active: activeView === "halo invitation rescuer",
|
|
2956
2995
|
invitationState: invitationStates?.Halo,
|
|
2957
2996
|
onInvitationCancel: onHaloInvitationCancel,
|
|
2958
2997
|
failReason: failReasons?.Halo
|
|
2959
|
-
})), /* @__PURE__ */
|
|
2998
|
+
})), /* @__PURE__ */ React38.createElement(Viewport.View, {
|
|
2960
2999
|
classNames: stepStyles,
|
|
2961
3000
|
id: "halo invitation authenticator"
|
|
2962
|
-
}, /* @__PURE__ */
|
|
3001
|
+
}, /* @__PURE__ */ React38.createElement(InvitationAuthenticator, {
|
|
2963
3002
|
send,
|
|
2964
3003
|
Kind: "Halo",
|
|
2965
3004
|
active: activeView === "halo invitation authenticator",
|
|
@@ -2968,28 +3007,28 @@ var JoinPanelImpl = (props) => {
|
|
|
2968
3007
|
...failed.has("Halo") && {
|
|
2969
3008
|
failed: true
|
|
2970
3009
|
}
|
|
2971
|
-
})), /* @__PURE__ */
|
|
3010
|
+
})), /* @__PURE__ */ React38.createElement(Viewport.View, {
|
|
2972
3011
|
classNames: stepStyles,
|
|
2973
3012
|
id: "halo invitation accepted"
|
|
2974
|
-
}, /* @__PURE__ */
|
|
3013
|
+
}, /* @__PURE__ */ React38.createElement(InvitationAccepted, {
|
|
2975
3014
|
send,
|
|
2976
3015
|
Kind: "Halo",
|
|
2977
3016
|
active: activeView === "halo invitation accepted",
|
|
2978
3017
|
doneActionParent,
|
|
2979
3018
|
onDone: onHaloDone
|
|
2980
|
-
})), /* @__PURE__ */
|
|
3019
|
+
})), /* @__PURE__ */ React38.createElement(Viewport.View, {
|
|
2981
3020
|
classNames: stepStyles,
|
|
2982
3021
|
id: "identity added"
|
|
2983
|
-
}, /* @__PURE__ */
|
|
3022
|
+
}, /* @__PURE__ */ React38.createElement(IdentityAdded, {
|
|
2984
3023
|
send,
|
|
2985
3024
|
mode,
|
|
2986
3025
|
active: activeView === "identity added",
|
|
2987
3026
|
doneActionParent,
|
|
2988
3027
|
onDone: onHaloDone
|
|
2989
|
-
})), /* @__PURE__ */
|
|
3028
|
+
})), /* @__PURE__ */ React38.createElement(Viewport.View, {
|
|
2990
3029
|
classNames: stepStyles,
|
|
2991
3030
|
id: "space invitation input"
|
|
2992
|
-
}, /* @__PURE__ */
|
|
3031
|
+
}, /* @__PURE__ */ React38.createElement(InvitationInput, {
|
|
2993
3032
|
send,
|
|
2994
3033
|
Kind: "Space",
|
|
2995
3034
|
active: activeView === "space invitation input",
|
|
@@ -3001,20 +3040,20 @@ var JoinPanelImpl = (props) => {
|
|
|
3001
3040
|
},
|
|
3002
3041
|
onExit,
|
|
3003
3042
|
exitActionParent
|
|
3004
|
-
})), /* @__PURE__ */
|
|
3043
|
+
})), /* @__PURE__ */ React38.createElement(Viewport.View, {
|
|
3005
3044
|
classNames: stepStyles,
|
|
3006
3045
|
id: "space invitation rescuer"
|
|
3007
|
-
}, /* @__PURE__ */
|
|
3046
|
+
}, /* @__PURE__ */ React38.createElement(InvitationRescuer, {
|
|
3008
3047
|
send,
|
|
3009
3048
|
Kind: "Space",
|
|
3010
3049
|
active: activeView === "space invitation rescuer",
|
|
3011
3050
|
invitationState: invitationStates?.Space,
|
|
3012
3051
|
onInvitationCancel: onSpaceInvitationCancel,
|
|
3013
3052
|
failReason: failReasons?.Space
|
|
3014
|
-
})), /* @__PURE__ */
|
|
3053
|
+
})), /* @__PURE__ */ React38.createElement(Viewport.View, {
|
|
3015
3054
|
classNames: stepStyles,
|
|
3016
3055
|
id: "space invitation authenticator"
|
|
3017
|
-
}, /* @__PURE__ */
|
|
3056
|
+
}, /* @__PURE__ */ React38.createElement(InvitationAuthenticator, {
|
|
3018
3057
|
send,
|
|
3019
3058
|
Kind: "Space",
|
|
3020
3059
|
active: activeView === "space invitation authenticator",
|
|
@@ -3023,10 +3062,10 @@ var JoinPanelImpl = (props) => {
|
|
|
3023
3062
|
...failed.has("Space") && {
|
|
3024
3063
|
failed: true
|
|
3025
3064
|
}
|
|
3026
|
-
})), /* @__PURE__ */
|
|
3065
|
+
})), /* @__PURE__ */ React38.createElement(Viewport.View, {
|
|
3027
3066
|
classNames: stepStyles,
|
|
3028
3067
|
id: "space invitation accepted"
|
|
3029
|
-
}, /* @__PURE__ */
|
|
3068
|
+
}, /* @__PURE__ */ React38.createElement(InvitationAccepted, {
|
|
3030
3069
|
send,
|
|
3031
3070
|
Kind: "Space",
|
|
3032
3071
|
active: activeView === "space invitation accepted",
|
|
@@ -3034,14 +3073,15 @@ var JoinPanelImpl = (props) => {
|
|
|
3034
3073
|
onDone: onSpaceDone
|
|
3035
3074
|
})))));
|
|
3036
3075
|
};
|
|
3037
|
-
var JoinPanel = ({ titleId: propsTitleId, mode = "default", initialInvitationCode, exitActionParent, onExit, doneActionParent, onDone: propsOnDone }) => {
|
|
3038
|
-
const client =
|
|
3076
|
+
var JoinPanel = ({ titleId: propsTitleId, mode = "default", initialDisposition = "default", initialInvitationCode, exitActionParent, onExit, doneActionParent, onDone: propsOnDone, onCancelResetStorage }) => {
|
|
3077
|
+
const client = useClient5();
|
|
3039
3078
|
const identity = useIdentity2();
|
|
3040
3079
|
const { hasIosKeyboard } = useThemeContext4();
|
|
3041
3080
|
const titleId = useId7("joinPanel__heading", propsTitleId);
|
|
3042
3081
|
const [joinState, joinSend, joinService] = useJoinMachine(client, {
|
|
3043
3082
|
context: {
|
|
3044
3083
|
mode,
|
|
3084
|
+
initialDisposition,
|
|
3045
3085
|
identity,
|
|
3046
3086
|
...initialInvitationCode && {
|
|
3047
3087
|
[mode === "halo-only" ? "halo" : "space"]: {
|
|
@@ -3054,7 +3094,7 @@ var JoinPanel = ({ titleId: propsTitleId, mode = "default", initialInvitationCod
|
|
|
3054
3094
|
const subscription = joinService.subscribe((state) => {
|
|
3055
3095
|
log10("[state]", state, {
|
|
3056
3096
|
F: __dxlog_file10,
|
|
3057
|
-
L:
|
|
3097
|
+
L: 204,
|
|
3058
3098
|
S: void 0,
|
|
3059
3099
|
C: (f, a) => f(...a)
|
|
3060
3100
|
});
|
|
@@ -3266,7 +3306,15 @@ var JoinPanel = ({ titleId: propsTitleId, mode = "default", initialInvitationCod
|
|
|
3266
3306
|
joinState,
|
|
3267
3307
|
propsOnDone
|
|
3268
3308
|
]);
|
|
3269
|
-
|
|
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, {
|
|
3270
3318
|
titleId,
|
|
3271
3319
|
mode,
|
|
3272
3320
|
send: joinSend,
|
|
@@ -3299,16 +3347,18 @@ var JoinPanel = ({ titleId: propsTitleId, mode = "default", initialInvitationCod
|
|
|
3299
3347
|
type: "authenticateSpaceVerificationCode"
|
|
3300
3348
|
});
|
|
3301
3349
|
return joinState.context.space.invitationObservable?.authenticate(authCode);
|
|
3302
|
-
}
|
|
3350
|
+
},
|
|
3351
|
+
onConfirmResetStorage,
|
|
3352
|
+
onCancelResetStorage
|
|
3303
3353
|
});
|
|
3304
3354
|
};
|
|
3305
3355
|
|
|
3306
3356
|
// packages/sdk/shell/src/panels/SpacePanel/SpacePanel.tsx
|
|
3307
3357
|
import { Planet } from "@phosphor-icons/react";
|
|
3308
|
-
import
|
|
3358
|
+
import React40, { useEffect as useEffect6, useMemo as useMemo5 } from "react";
|
|
3309
3359
|
import { log as log13 } from "@dxos/log";
|
|
3310
3360
|
import { useInvitationStatus as useInvitationStatus3 } from "@dxos/react-client/invitations";
|
|
3311
|
-
import { DensityProvider as DensityProvider4, useId as useId8, useTranslation as
|
|
3361
|
+
import { DensityProvider as DensityProvider4, useId as useId8, useTranslation as useTranslation25 } from "@dxos/react-ui";
|
|
3312
3362
|
|
|
3313
3363
|
// packages/sdk/shell/src/panels/SpacePanel/spaceMachine.ts
|
|
3314
3364
|
import { useMachine as useMachine3 } from "@xstate/react";
|
|
@@ -3374,18 +3424,18 @@ var useSpaceMachine = (options) => {
|
|
|
3374
3424
|
|
|
3375
3425
|
// packages/sdk/shell/src/panels/SpacePanel/steps/SpaceManager.tsx
|
|
3376
3426
|
import { Placeholder as Placeholder2, UserPlus, UsersThree } from "@phosphor-icons/react";
|
|
3377
|
-
import
|
|
3427
|
+
import React39, { useCallback as useCallback8, useState as useState10 } from "react";
|
|
3378
3428
|
import { log as log12 } from "@dxos/log";
|
|
3379
3429
|
import { useConfig } from "@dxos/react-client";
|
|
3380
3430
|
import { useSpaceInvitations as useSpaceInvitations2 } from "@dxos/react-client/echo";
|
|
3381
3431
|
import { Invitation as Invitation8, InvitationEncoder as InvitationEncoder4 } from "@dxos/react-client/invitations";
|
|
3382
|
-
import { ScrollArea, useTranslation as
|
|
3432
|
+
import { ScrollArea, useTranslation as useTranslation24 } from "@dxos/react-ui";
|
|
3383
3433
|
import { descriptionText as descriptionText10, mx as mx22 } from "@dxos/react-ui-theme";
|
|
3384
3434
|
var __dxlog_file12 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/SpacePanel/steps/SpaceManager.tsx";
|
|
3385
3435
|
var activeActionKey = "dxos:react-shell/space-manager/active-action";
|
|
3386
3436
|
var SpaceManager = (props) => {
|
|
3387
3437
|
const { space, target } = props;
|
|
3388
|
-
const { t } =
|
|
3438
|
+
const { t } = useTranslation24("os");
|
|
3389
3439
|
const config = useConfig();
|
|
3390
3440
|
const invitations = useSpaceInvitations2(space?.key);
|
|
3391
3441
|
const onInvitationEvent = useCallback8((invitation) => {
|
|
@@ -3438,7 +3488,7 @@ var SpaceManager = (props) => {
|
|
|
3438
3488
|
])
|
|
3439
3489
|
}
|
|
3440
3490
|
};
|
|
3441
|
-
return /* @__PURE__ */
|
|
3491
|
+
return /* @__PURE__ */ React39.createElement(SpaceManagerImpl, {
|
|
3442
3492
|
...props,
|
|
3443
3493
|
invitations,
|
|
3444
3494
|
inviteActions
|
|
@@ -3447,7 +3497,7 @@ var SpaceManager = (props) => {
|
|
|
3447
3497
|
var headingFragment = "pis-3 pie-1 plb-1 mbe-1 font-medium";
|
|
3448
3498
|
var SpaceManagerImpl = (props) => {
|
|
3449
3499
|
const { active, space, createInvitationUrl, send, inviteActions: propsInviteActions, invitations, showInactiveInvitations, SpaceMemberList: SpaceMemberListComponent = SpaceMemberList, InvitationList: InvitationListComponent = InvitationList } = props;
|
|
3450
|
-
const { t } =
|
|
3500
|
+
const { t } = useTranslation24("os");
|
|
3451
3501
|
const inviteActions = propsInviteActions ?? {
|
|
3452
3502
|
noopInvite: {
|
|
3453
3503
|
label: t("create space invitation label"),
|
|
@@ -3465,26 +3515,26 @@ var SpaceManagerImpl = (props) => {
|
|
|
3465
3515
|
const visibleInvitations = showInactiveInvitations ? invitations : invitations?.filter((invitation) => ![
|
|
3466
3516
|
Invitation8.State.CANCELLED
|
|
3467
3517
|
].includes(invitation.get().state));
|
|
3468
|
-
return /* @__PURE__ */
|
|
3518
|
+
return /* @__PURE__ */ React39.createElement(React39.Fragment, null, /* @__PURE__ */ React39.createElement(ScrollArea.Root, {
|
|
3469
3519
|
classNames: "grow shrink basis-28 -mli-2"
|
|
3470
|
-
}, /* @__PURE__ */
|
|
3520
|
+
}, /* @__PURE__ */ React39.createElement(ScrollArea.Viewport, {
|
|
3471
3521
|
classNames: "is-full pie-2"
|
|
3472
|
-
}, !!visibleInvitations?.length && /* @__PURE__ */
|
|
3522
|
+
}, !!visibleInvitations?.length && /* @__PURE__ */ React39.createElement(React39.Fragment, null, /* @__PURE__ */ React39.createElement("h3", {
|
|
3473
3523
|
className: mx22(headingFragment, descriptionText10)
|
|
3474
|
-
}, t("invitation list heading")), /* @__PURE__ */
|
|
3524
|
+
}, t("invitation list heading")), /* @__PURE__ */ React39.createElement(InvitationListComponent, {
|
|
3475
3525
|
className: "mb-2",
|
|
3476
3526
|
send,
|
|
3477
3527
|
invitations: visibleInvitations ?? [],
|
|
3478
3528
|
onClickRemove: (invitation) => invitation.cancel(),
|
|
3479
3529
|
createInvitationUrl
|
|
3480
|
-
}), /* @__PURE__ */
|
|
3530
|
+
}), /* @__PURE__ */ React39.createElement("h3", {
|
|
3481
3531
|
className: mx22(headingFragment, descriptionText10, "mbs-2")
|
|
3482
|
-
}, t("space member list heading"))), /* @__PURE__ */
|
|
3532
|
+
}, t("space member list heading"))), /* @__PURE__ */ React39.createElement(SpaceMemberListComponent, {
|
|
3483
3533
|
spaceKey: space.key,
|
|
3484
3534
|
includeSelf: true
|
|
3485
|
-
})), /* @__PURE__ */
|
|
3535
|
+
})), /* @__PURE__ */ React39.createElement(ScrollArea.Scrollbar, {
|
|
3486
3536
|
orientation: "vertical"
|
|
3487
|
-
}, /* @__PURE__ */
|
|
3537
|
+
}, /* @__PURE__ */ React39.createElement(ScrollArea.Thumb, null))), /* @__PURE__ */ React39.createElement(Actions, null, /* @__PURE__ */ React39.createElement(BifurcatedAction, {
|
|
3488
3538
|
disabled: !active,
|
|
3489
3539
|
actions: inviteActions,
|
|
3490
3540
|
activeAction,
|
|
@@ -3496,47 +3546,47 @@ var SpaceManagerImpl = (props) => {
|
|
|
3496
3546
|
// packages/sdk/shell/src/panels/SpacePanel/SpacePanel.tsx
|
|
3497
3547
|
var __dxlog_file13 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/SpacePanel/SpacePanel.tsx";
|
|
3498
3548
|
var SpacePanelHeading = ({ titleId, space, onDone }) => {
|
|
3499
|
-
const { t } =
|
|
3549
|
+
const { t } = useTranslation25("os");
|
|
3500
3550
|
const name = space.properties.name;
|
|
3501
|
-
return /* @__PURE__ */
|
|
3551
|
+
return /* @__PURE__ */ React40.createElement(Heading, {
|
|
3502
3552
|
titleId,
|
|
3503
3553
|
title: t("space panel heading"),
|
|
3504
|
-
corner: /* @__PURE__ */
|
|
3554
|
+
corner: /* @__PURE__ */ React40.createElement(CloseButton, {
|
|
3505
3555
|
"data-testid": "identity-panel-done",
|
|
3506
3556
|
onDone
|
|
3507
3557
|
})
|
|
3508
|
-
}, /* @__PURE__ */
|
|
3558
|
+
}, /* @__PURE__ */ React40.createElement("div", {
|
|
3509
3559
|
role: "none",
|
|
3510
3560
|
className: "flex gap-4 items-center justify-center mlb-4"
|
|
3511
|
-
}, /* @__PURE__ */
|
|
3561
|
+
}, /* @__PURE__ */ React40.createElement(Planet, {
|
|
3512
3562
|
size: 32,
|
|
3513
3563
|
weight: "light"
|
|
3514
|
-
}), /* @__PURE__ */
|
|
3564
|
+
}), /* @__PURE__ */ React40.createElement("div", {
|
|
3515
3565
|
className: "block text-start font-light text-xl"
|
|
3516
3566
|
}, name ?? space.key.truncate())));
|
|
3517
3567
|
};
|
|
3518
3568
|
var SpacePanelImpl = (props) => {
|
|
3519
3569
|
const { titleId, activeView, space, target, SpaceManager: SpaceManagerComponent = SpaceManager, InvitationManager: InvitationManagerComponent = InvitationManager, ...rest } = props;
|
|
3520
|
-
return /* @__PURE__ */
|
|
3570
|
+
return /* @__PURE__ */ React40.createElement(DensityProvider4, {
|
|
3521
3571
|
density: "fine"
|
|
3522
|
-
}, /* @__PURE__ */
|
|
3572
|
+
}, /* @__PURE__ */ React40.createElement(SpacePanelHeading, {
|
|
3523
3573
|
...rest,
|
|
3524
3574
|
titleId,
|
|
3525
3575
|
space
|
|
3526
|
-
}), /* @__PURE__ */
|
|
3576
|
+
}), /* @__PURE__ */ React40.createElement(Viewport.Root, {
|
|
3527
3577
|
activeView
|
|
3528
|
-
}, /* @__PURE__ */
|
|
3578
|
+
}, /* @__PURE__ */ React40.createElement(Viewport.Views, null, /* @__PURE__ */ React40.createElement(Viewport.View, {
|
|
3529
3579
|
id: "space manager",
|
|
3530
3580
|
classNames: stepStyles
|
|
3531
|
-
}, /* @__PURE__ */
|
|
3581
|
+
}, /* @__PURE__ */ React40.createElement(SpaceManagerComponent, {
|
|
3532
3582
|
active: activeView === "space manager",
|
|
3533
3583
|
space,
|
|
3534
3584
|
target,
|
|
3535
3585
|
...rest
|
|
3536
|
-
})), /* @__PURE__ */
|
|
3586
|
+
})), /* @__PURE__ */ React40.createElement(Viewport.View, {
|
|
3537
3587
|
id: "space invitation manager",
|
|
3538
3588
|
classNames: stepStyles
|
|
3539
|
-
}, /* @__PURE__ */
|
|
3589
|
+
}, /* @__PURE__ */ React40.createElement(InvitationManagerComponent, {
|
|
3540
3590
|
active: activeView === "space invitation manager",
|
|
3541
3591
|
...rest,
|
|
3542
3592
|
invitationUrl: props.invitationUrl
|
|
@@ -3544,7 +3594,7 @@ var SpacePanelImpl = (props) => {
|
|
|
3544
3594
|
};
|
|
3545
3595
|
var SpacePanelWithInvitationImpl = ({ invitation, ...props }) => {
|
|
3546
3596
|
const invitationStatus = useInvitationStatus3(invitation);
|
|
3547
|
-
return /* @__PURE__ */
|
|
3597
|
+
return /* @__PURE__ */ React40.createElement(SpacePanelImpl, {
|
|
3548
3598
|
...props,
|
|
3549
3599
|
...invitationStatus,
|
|
3550
3600
|
invitationUrl: props.createInvitationUrl(invitationStatus.invitationCode)
|
|
@@ -3591,16 +3641,31 @@ var SpacePanel = ({ titleId: propsTitleId, createInvitationUrl = (code) => code,
|
|
|
3591
3641
|
};
|
|
3592
3642
|
return spaceState.context.invitation ? (
|
|
3593
3643
|
// TODO(wittjosiah): Unused? Remove?
|
|
3594
|
-
/* @__PURE__ */
|
|
3644
|
+
/* @__PURE__ */ React40.createElement(SpacePanelWithInvitationImpl, {
|
|
3595
3645
|
...implProps,
|
|
3596
3646
|
invitation: spaceState.context.invitation
|
|
3597
3647
|
})
|
|
3598
|
-
) : /* @__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")));
|
|
3599
3664
|
};
|
|
3600
3665
|
|
|
3601
3666
|
// packages/sdk/shell/src/composites/IdentityDialog/IdentityDialog.tsx
|
|
3602
3667
|
var IdentityDialog = (props) => {
|
|
3603
|
-
const titleId = useId9("
|
|
3668
|
+
const titleId = useId9("identityDialog__title", props.title);
|
|
3604
3669
|
return /* @__PURE__ */ React42.createElement(Dialog.Root, {
|
|
3605
3670
|
defaultOpen: true,
|
|
3606
3671
|
onOpenChange: (open) => open || props.onDone?.()
|
|
@@ -3647,7 +3712,7 @@ var JoinDialog = (joinPanelProps) => {
|
|
|
3647
3712
|
};
|
|
3648
3713
|
|
|
3649
3714
|
// packages/sdk/shell/src/composites/Shell/run-shell.tsx
|
|
3650
|
-
import
|
|
3715
|
+
import React47, { StrictMode } from "react";
|
|
3651
3716
|
import { createRoot } from "react-dom/client";
|
|
3652
3717
|
import { DEFAULT_CLIENT_CHANNEL, DEFAULT_SHELL_CHANNEL } from "@dxos/client-protocol";
|
|
3653
3718
|
import { ShellRuntimeImpl } from "@dxos/client-services";
|
|
@@ -3657,9 +3722,9 @@ import { defaultTx } from "@dxos/react-ui-theme";
|
|
|
3657
3722
|
import { createIFramePort } from "@dxos/rpc-tunnel";
|
|
3658
3723
|
|
|
3659
3724
|
// packages/sdk/shell/src/composites/Shell/Shell.tsx
|
|
3660
|
-
import
|
|
3725
|
+
import React46, { useEffect as useEffect7, useState as useState11 } from "react";
|
|
3661
3726
|
import { log as log14 } from "@dxos/log";
|
|
3662
|
-
import { ShellDisplay, ShellLayout, useClient as
|
|
3727
|
+
import { ShellDisplay, ShellLayout, useClient as useClient6 } from "@dxos/react-client";
|
|
3663
3728
|
import { useSpace as useSpace2 } from "@dxos/react-client/echo";
|
|
3664
3729
|
|
|
3665
3730
|
// packages/sdk/shell/src/composites/SpaceDialog/SpaceDialog.tsx
|
|
@@ -3681,6 +3746,20 @@ var SpaceDialog = (spacePanelProps) => {
|
|
|
3681
3746
|
}))))));
|
|
3682
3747
|
};
|
|
3683
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
|
+
|
|
3684
3763
|
// packages/sdk/shell/src/composites/Shell/Shell.tsx
|
|
3685
3764
|
var __dxlog_file14 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/composites/Shell/Shell.tsx";
|
|
3686
3765
|
var Shell = ({ runtime, origin }) => {
|
|
@@ -3690,7 +3769,7 @@ var Shell = ({ runtime, origin }) => {
|
|
|
3690
3769
|
spaceKey: runtime.spaceKey,
|
|
3691
3770
|
target: runtime.target
|
|
3692
3771
|
});
|
|
3693
|
-
const client =
|
|
3772
|
+
const client = useClient6();
|
|
3694
3773
|
const space = useSpace2(spaceKey);
|
|
3695
3774
|
useEffect7(() => {
|
|
3696
3775
|
return runtime.layoutUpdate.on((request) => setLayout(request));
|
|
@@ -3701,7 +3780,7 @@ var Shell = ({ runtime, origin }) => {
|
|
|
3701
3780
|
if (layout === ShellLayout.SPACE && !space) {
|
|
3702
3781
|
log14.warn("No space found for shell space invitations.", void 0, {
|
|
3703
3782
|
F: __dxlog_file14,
|
|
3704
|
-
L:
|
|
3783
|
+
L: 33,
|
|
3705
3784
|
S: void 0,
|
|
3706
3785
|
C: (f, a) => f(...a)
|
|
3707
3786
|
});
|
|
@@ -3721,10 +3800,17 @@ var Shell = ({ runtime, origin }) => {
|
|
|
3721
3800
|
space
|
|
3722
3801
|
]);
|
|
3723
3802
|
switch (layout) {
|
|
3803
|
+
case ShellLayout.STATUS:
|
|
3804
|
+
return /* @__PURE__ */ React46.createElement(StatusDialog, null);
|
|
3724
3805
|
case ShellLayout.INITIALIZE_IDENTITY:
|
|
3725
|
-
|
|
3806
|
+
case ShellLayout.INITIALIZE_IDENTITY_FROM_INVITATION:
|
|
3807
|
+
return /* @__PURE__ */ React46.createElement(JoinDialog, {
|
|
3726
3808
|
mode: "halo-only",
|
|
3809
|
+
initialDisposition: layout === ShellLayout.INITIALIZE_IDENTITY_FROM_INVITATION ? "accept-halo-invitation" : "default",
|
|
3727
3810
|
initialInvitationCode: invitationCode,
|
|
3811
|
+
onCancelResetStorage: () => runtime.setLayout({
|
|
3812
|
+
layout: ShellLayout.IDENTITY
|
|
3813
|
+
}),
|
|
3728
3814
|
onDone: () => {
|
|
3729
3815
|
void runtime.setAppContext({
|
|
3730
3816
|
display: ShellDisplay.NONE
|
|
@@ -3737,18 +3823,27 @@ var Shell = ({ runtime, origin }) => {
|
|
|
3737
3823
|
case ShellLayout.IDENTITY:
|
|
3738
3824
|
case ShellLayout.SHARE_IDENTITY:
|
|
3739
3825
|
case ShellLayout.EDIT_PROFILE:
|
|
3740
|
-
return /* @__PURE__ */
|
|
3826
|
+
return /* @__PURE__ */ React46.createElement(IdentityDialog, {
|
|
3741
3827
|
createInvitationUrl: (invitationCode2) => `${origin}?deviceInvitationCode=${invitationCode2}`,
|
|
3742
|
-
|
|
3828
|
+
onResetStorage: async () => {
|
|
3829
|
+
runtime.setLayout({
|
|
3830
|
+
layout: ShellLayout.STATUS
|
|
3831
|
+
});
|
|
3743
3832
|
await client.reset();
|
|
3744
|
-
|
|
3833
|
+
return runtime.setAppContext({
|
|
3745
3834
|
display: ShellDisplay.NONE,
|
|
3746
3835
|
reload: true
|
|
3747
3836
|
});
|
|
3748
3837
|
},
|
|
3749
|
-
onJoinNewIdentity: () =>
|
|
3750
|
-
|
|
3751
|
-
|
|
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
|
+
},
|
|
3752
3847
|
onDone: async () => {
|
|
3753
3848
|
await runtime.setAppContext({
|
|
3754
3849
|
display: ShellDisplay.NONE
|
|
@@ -3756,10 +3851,11 @@ var Shell = ({ runtime, origin }) => {
|
|
|
3756
3851
|
runtime.setLayout({
|
|
3757
3852
|
layout: ShellLayout.DEFAULT
|
|
3758
3853
|
});
|
|
3759
|
-
}
|
|
3854
|
+
},
|
|
3855
|
+
initialDisposition: layout === ShellLayout.SHARE_IDENTITY ? "manage-device-invitation" : layout === ShellLayout.EDIT_PROFILE ? "manage-profile" : "default"
|
|
3760
3856
|
});
|
|
3761
3857
|
case ShellLayout.SPACE:
|
|
3762
|
-
return space ? /* @__PURE__ */
|
|
3858
|
+
return space ? /* @__PURE__ */ React46.createElement(SpaceDialog, {
|
|
3763
3859
|
space,
|
|
3764
3860
|
target,
|
|
3765
3861
|
createInvitationUrl: (invitationCode2) => `${origin}?spaceInvitationCode=${invitationCode2}`,
|
|
@@ -3773,7 +3869,7 @@ var Shell = ({ runtime, origin }) => {
|
|
|
3773
3869
|
}
|
|
3774
3870
|
}) : null;
|
|
3775
3871
|
case ShellLayout.JOIN_SPACE:
|
|
3776
|
-
return /* @__PURE__ */
|
|
3872
|
+
return /* @__PURE__ */ React46.createElement(JoinDialog, {
|
|
3777
3873
|
initialInvitationCode: invitationCode,
|
|
3778
3874
|
onDone: async (result) => {
|
|
3779
3875
|
const target2 = result?.target ?? void 0;
|
|
@@ -3876,7 +3972,8 @@ var os = {
|
|
|
3876
3972
|
"choose add device label": "Add device",
|
|
3877
3973
|
"choose devices label": "Manage devices",
|
|
3878
3974
|
"choose profile label": "Edit profile",
|
|
3879
|
-
"choose sign out label": "
|
|
3975
|
+
"choose sign out label": "Reset storage",
|
|
3976
|
+
"choose join new identity label": "Join existing device",
|
|
3880
3977
|
"empty space members message": "There is nobody in this space yet.",
|
|
3881
3978
|
"back to all invitations label": "Back to all invitations",
|
|
3882
3979
|
"invitation heading": "Invitation",
|
|
@@ -3900,18 +3997,20 @@ var os = {
|
|
|
3900
3997
|
"invite options label": "Change the active invite option.",
|
|
3901
3998
|
"reset in progress label": "Resetting...",
|
|
3902
3999
|
"confirm label": "Confirm",
|
|
3903
|
-
"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.",
|
|
3904
4002
|
"failed to reset identity message": "Failed to reset identity.",
|
|
3905
4003
|
"confirmation value": "CONFIRM",
|
|
3906
|
-
"sign out chooser title": "
|
|
3907
|
-
"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.",
|
|
3908
4006
|
"join new identity label": "Join a new identity",
|
|
3909
|
-
"reset device label": "Reset
|
|
4007
|
+
"reset device label": "Reset storage",
|
|
3910
4008
|
"reset device confirm message": "Are you sure you want to reset your device? All data will be lost.",
|
|
3911
4009
|
"emoji and color label": "Emoji and color",
|
|
3912
4010
|
"clear label": "Use default",
|
|
3913
4011
|
"select emoji label": "Choose an emoji to use in your avatar",
|
|
3914
4012
|
"select hue label": "Choose a hue to use in your avatar",
|
|
4013
|
+
"resetting message": "One moment while things are reset\u2026",
|
|
3915
4014
|
"red label": "Red",
|
|
3916
4015
|
"orange label": "Orange",
|
|
3917
4016
|
"amber label": "Amber",
|
|
@@ -3952,25 +4051,25 @@ var runShell = async (config = new Config()) => {
|
|
|
3952
4051
|
runtime.open(),
|
|
3953
4052
|
client.initialize()
|
|
3954
4053
|
]);
|
|
3955
|
-
createRoot(document.getElementById("root")).render(/* @__PURE__ */
|
|
4054
|
+
createRoot(document.getElementById("root")).render(/* @__PURE__ */ React47.createElement(StrictMode, null, /* @__PURE__ */ React47.createElement(ThemeProvider, {
|
|
3956
4055
|
tx: defaultTx,
|
|
3957
4056
|
resourceExtensions: [
|
|
3958
4057
|
osTranslations
|
|
3959
4058
|
]
|
|
3960
|
-
}, /* @__PURE__ */
|
|
4059
|
+
}, /* @__PURE__ */ React47.createElement(ClientContext.Provider, {
|
|
3961
4060
|
value: {
|
|
3962
4061
|
client,
|
|
3963
4062
|
status: SystemStatus.ACTIVE
|
|
3964
4063
|
}
|
|
3965
|
-
}, /* @__PURE__ */
|
|
4064
|
+
}, /* @__PURE__ */ React47.createElement(ClipboardProvider, null, /* @__PURE__ */ React47.createElement(Tooltip5.Provider, null, /* @__PURE__ */ React47.createElement(Shell, {
|
|
3966
4065
|
runtime,
|
|
3967
4066
|
origin: location.origin
|
|
3968
4067
|
})))))));
|
|
3969
4068
|
};
|
|
3970
4069
|
|
|
3971
4070
|
// packages/sdk/shell/src/composites/Shell/ShellContext.tsx
|
|
3972
|
-
import
|
|
3973
|
-
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";
|
|
3974
4073
|
import { useIdentity as useIdentity3 } from "@dxos/react-client/halo";
|
|
3975
4074
|
import { mx as mx23 } from "@dxos/react-ui-theme";
|
|
3976
4075
|
|
|
@@ -4008,7 +4107,7 @@ var MemoryShellRuntime = class {
|
|
|
4008
4107
|
// packages/sdk/shell/src/composites/Shell/ShellContext.tsx
|
|
4009
4108
|
var ShellContext = /* @__PURE__ */ createContext2({});
|
|
4010
4109
|
var useShell = () => {
|
|
4011
|
-
const client =
|
|
4110
|
+
const client = useClient7();
|
|
4012
4111
|
const { runtime, setDisplay } = useContext2(ShellContext);
|
|
4013
4112
|
const setLayout = async (layout, options) => {
|
|
4014
4113
|
if (runtime) {
|
|
@@ -4029,7 +4128,7 @@ var useShell = () => {
|
|
|
4029
4128
|
};
|
|
4030
4129
|
};
|
|
4031
4130
|
var ShellProvider = ({ space, deviceInvitationCode, spaceInvitationCode, onJoinedSpace, children }) => {
|
|
4032
|
-
const client =
|
|
4131
|
+
const client = useClient7();
|
|
4033
4132
|
const identity = useIdentity3();
|
|
4034
4133
|
const [display, setDisplay] = useState12(!identity || spaceInvitationCode || deviceInvitationCode ? ShellDisplay2.FULLSCREEN : ShellDisplay2.NONE);
|
|
4035
4134
|
const shellRuntime = useMemo6(() => {
|
|
@@ -4101,12 +4200,12 @@ var ShellProvider = ({ space, deviceInvitationCode, spaceInvitationCode, onJoine
|
|
|
4101
4200
|
}, [
|
|
4102
4201
|
shellRuntime
|
|
4103
4202
|
]);
|
|
4104
|
-
return /* @__PURE__ */
|
|
4203
|
+
return /* @__PURE__ */ React48.createElement(React48.Fragment, null, shellRuntime && /* @__PURE__ */ React48.createElement("div", {
|
|
4105
4204
|
className: mx23(display === ShellDisplay2.NONE ? "hidden" : "")
|
|
4106
|
-
}, /* @__PURE__ */
|
|
4205
|
+
}, /* @__PURE__ */ React48.createElement(Shell, {
|
|
4107
4206
|
runtime: shellRuntime,
|
|
4108
4207
|
origin: window.location.origin
|
|
4109
|
-
})), /* @__PURE__ */
|
|
4208
|
+
})), /* @__PURE__ */ React48.createElement(ShellContext.Provider, {
|
|
4110
4209
|
value: {
|
|
4111
4210
|
runtime: shellRuntime,
|
|
4112
4211
|
setDisplay
|
|
@@ -4123,6 +4222,8 @@ export {
|
|
|
4123
4222
|
ClipboardProvider,
|
|
4124
4223
|
CloseButton,
|
|
4125
4224
|
CompoundButton,
|
|
4225
|
+
ConfirmReset,
|
|
4226
|
+
ConfirmResetImpl,
|
|
4126
4227
|
CopyButton,
|
|
4127
4228
|
CopyButtonIconOnly,
|
|
4128
4229
|
DeviceList,
|
|
@@ -4153,6 +4254,7 @@ export {
|
|
|
4153
4254
|
SpaceMemberListImpl,
|
|
4154
4255
|
SpacePanel,
|
|
4155
4256
|
SpacePanelImpl,
|
|
4257
|
+
StatusPanel,
|
|
4156
4258
|
StepHeading,
|
|
4157
4259
|
Viewport,
|
|
4158
4260
|
activeBgColor,
|