@dxos/shell 0.6.14-main.7bd9c89 → 0.6.14-main.f49f251
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 +10917 -10231
- package/dist/bundle/shell.mjs.map +1 -1
- package/dist/bundle/shell.umd.js +146 -106
- 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 +144 -53
- package/dist/lib/browser/react.mjs.map +3 -3
- package/dist/types/src/components/CompoundButton/CompoundButton.stories.js +1 -1
- package/dist/types/src/components/CompoundButton/CompoundButton.stories.js.map +1 -1
- package/dist/types/src/components/DeviceList/DeviceList.d.ts +1 -1
- package/dist/types/src/components/DeviceList/DeviceList.d.ts.map +1 -1
- package/dist/types/src/components/DeviceList/DeviceList.js +2 -2
- package/dist/types/src/components/DeviceList/DeviceList.js.map +1 -1
- package/dist/types/src/components/DeviceList/DeviceListItem.d.ts.map +1 -1
- package/dist/types/src/components/DeviceList/DeviceListItem.js +4 -1
- package/dist/types/src/components/DeviceList/DeviceListItem.js.map +1 -1
- package/dist/types/src/components/DeviceList/DeviceListProps.d.ts +2 -0
- package/dist/types/src/components/DeviceList/DeviceListProps.d.ts.map +1 -1
- package/dist/types/src/components/IdentityList/SpaceMemberList.stories.js +1 -1
- package/dist/types/src/components/IdentityList/SpaceMemberList.stories.js.map +1 -1
- package/dist/types/src/components/InvitationList/InvitationList.stories.js +1 -1
- package/dist/types/src/components/InvitationList/InvitationList.stories.js.map +1 -1
- package/dist/types/src/components/InvitationList/InvitationListContainer.d.ts.map +1 -1
- package/dist/types/src/components/InvitationList/InvitationListContainer.js +2 -2
- package/dist/types/src/components/InvitationList/InvitationListContainer.js.map +1 -1
- package/dist/types/src/components/Panel/Panel.stories.js +1 -1
- package/dist/types/src/components/Panel/Panel.stories.js.map +1 -1
- package/dist/types/src/components/Viewport/Viewport.stories.js +1 -1
- package/dist/types/src/components/Viewport/Viewport.stories.js.map +1 -1
- package/dist/types/src/composites/Shell/Shell.d.ts.map +1 -1
- package/dist/types/src/composites/Shell/Shell.js +11 -1
- package/dist/types/src/composites/Shell/Shell.js.map +1 -1
- package/dist/types/src/panels/IdentityPanel/IdentityPanel.d.ts.map +1 -1
- package/dist/types/src/panels/IdentityPanel/IdentityPanel.js +43 -24
- package/dist/types/src/panels/IdentityPanel/IdentityPanel.js.map +1 -1
- package/dist/types/src/panels/IdentityPanel/IdentityPanel.stories.js +1 -1
- package/dist/types/src/panels/IdentityPanel/IdentityPanel.stories.js.map +1 -1
- package/dist/types/src/panels/IdentityPanel/IdentityPanelProps.d.ts +2 -1
- package/dist/types/src/panels/IdentityPanel/IdentityPanelProps.d.ts.map +1 -1
- package/dist/types/src/panels/IdentityPanel/identityMachine.d.ts +1 -1
- package/dist/types/src/panels/IdentityPanel/identityMachine.d.ts.map +1 -1
- package/dist/types/src/panels/IdentityPanel/identityMachine.js +2 -0
- package/dist/types/src/panels/IdentityPanel/identityMachine.js.map +1 -1
- package/dist/types/src/panels/IdentityPanel/steps/IdentityActionChooser.d.ts +3 -5
- package/dist/types/src/panels/IdentityPanel/steps/IdentityActionChooser.d.ts.map +1 -1
- package/dist/types/src/panels/IdentityPanel/steps/IdentityActionChooser.js +5 -3
- package/dist/types/src/panels/IdentityPanel/steps/IdentityActionChooser.js.map +1 -1
- package/dist/types/src/panels/JoinPanel/JoinPanel.stories.js +1 -1
- package/dist/types/src/panels/JoinPanel/JoinPanel.stories.js.map +1 -1
- package/dist/types/src/panels/JoinPanel/JoinPanelProps.d.ts +1 -1
- package/dist/types/src/panels/JoinPanel/JoinPanelProps.d.ts.map +1 -1
- package/dist/types/src/panels/JoinPanel/joinMachine.d.ts.map +1 -1
- package/dist/types/src/panels/JoinPanel/joinMachine.js +6 -0
- package/dist/types/src/panels/JoinPanel/joinMachine.js.map +1 -1
- package/dist/types/src/panels/JoinPanel/steps/AdditionMethodChooser.d.ts.map +1 -1
- package/dist/types/src/panels/JoinPanel/steps/AdditionMethodChooser.js +1 -3
- package/dist/types/src/panels/JoinPanel/steps/AdditionMethodChooser.js.map +1 -1
- package/dist/types/src/panels/JoinPanel/steps/IdentityInput.d.ts.map +1 -1
- package/dist/types/src/panels/JoinPanel/steps/IdentityInput.js +17 -7
- package/dist/types/src/panels/JoinPanel/steps/IdentityInput.js.map +1 -1
- package/dist/types/src/panels/Panels.stories.js +1 -1
- package/dist/types/src/panels/Panels.stories.js.map +1 -1
- package/dist/types/src/panels/SpacePanel/SpacePanel.stories.js +1 -1
- package/dist/types/src/panels/SpacePanel/SpacePanel.stories.js.map +1 -1
- package/dist/types/src/playwright/invitations-manager.d.ts.map +1 -1
- package/dist/types/src/playwright/invitations-manager.js +2 -2
- package/dist/types/src/playwright/invitations-manager.js.map +1 -1
- package/dist/types/src/playwright/invitations.spec.js +0 -16
- package/dist/types/src/playwright/invitations.spec.js.map +1 -1
- package/dist/types/src/steps/ConfirmReset.d.ts +1 -1
- package/dist/types/src/steps/ConfirmReset.d.ts.map +1 -1
- package/dist/types/src/steps/ConfirmReset.js +6 -2
- package/dist/types/src/steps/ConfirmReset.js.map +1 -1
- package/dist/types/src/stories/Invitations.e2e-stories.d.ts +1 -3
- package/dist/types/src/stories/Invitations.e2e-stories.d.ts.map +1 -1
- package/dist/types/src/stories/Invitations.e2e-stories.js +14 -6
- package/dist/types/src/stories/Invitations.e2e-stories.js.map +1 -1
- package/dist/types/src/translations/locales/en-US.d.ts +2 -0
- package/dist/types/src/translations/locales/en-US.d.ts.map +1 -1
- package/dist/types/src/translations/locales/en-US.js +2 -0
- package/dist/types/src/translations/locales/en-US.js.map +1 -1
- package/package.json +26 -25
- package/src/components/CompoundButton/CompoundButton.stories.tsx +1 -1
- package/src/components/DeviceList/DeviceList.tsx +2 -1
- package/src/components/DeviceList/DeviceListItem.tsx +8 -0
- package/src/components/DeviceList/DeviceListProps.ts +2 -0
- package/src/components/IdentityList/SpaceMemberList.stories.tsx +1 -1
- package/src/components/InvitationList/InvitationList.stories.tsx +1 -1
- package/src/components/InvitationList/InvitationListContainer.tsx +6 -3
- package/src/components/Panel/Panel.stories.tsx +1 -1
- package/src/components/Viewport/Viewport.stories.tsx +1 -1
- package/src/composites/Shell/Shell.tsx +12 -1
- package/src/panels/IdentityPanel/IdentityPanel.stories.tsx +1 -1
- package/src/panels/IdentityPanel/IdentityPanel.tsx +78 -44
- package/src/panels/IdentityPanel/IdentityPanelProps.ts +2 -0
- package/src/panels/IdentityPanel/identityMachine.ts +3 -1
- package/src/panels/IdentityPanel/steps/IdentityActionChooser.tsx +21 -10
- package/src/panels/JoinPanel/JoinPanel.stories.tsx +1 -1
- package/src/panels/JoinPanel/JoinPanelProps.ts +1 -1
- package/src/panels/JoinPanel/joinMachine.ts +7 -0
- package/src/panels/JoinPanel/steps/AdditionMethodChooser.tsx +0 -2
- package/src/panels/JoinPanel/steps/IdentityInput.tsx +22 -10
- package/src/panels/Panels.stories.tsx +1 -1
- package/src/panels/SpacePanel/SpacePanel.stories.tsx +1 -1
- package/src/playwright/invitations-manager.ts +3 -2
- package/src/playwright/invitations.spec.ts +0 -16
- package/src/steps/ConfirmReset.tsx +13 -5
- package/src/stories/Invitations.e2e-stories.tsx +17 -10
- package/src/translations/locales/en-US.ts +2 -0
|
@@ -571,7 +571,7 @@ import { Button as Button6, List as List2, useTranslation as useTranslation7 } f
|
|
|
571
571
|
import { descriptionText as descriptionText4, getSize as getSize6, mx as mx7 } from "@dxos/react-ui-theme";
|
|
572
572
|
|
|
573
573
|
// packages/sdk/shell/src/components/DeviceList/DeviceListItem.tsx
|
|
574
|
-
import { Compass, Desktop, DeviceMobile, Devices, DotsThree, ShareFat, Power as Power2, Robot, Database as Database2 } from "@phosphor-icons/react";
|
|
574
|
+
import { Compass, Desktop, DeviceMobile, Devices, DotsThree, ShareFat, Power as Power2, Robot, Database as Database2, FirstAidKit } from "@phosphor-icons/react";
|
|
575
575
|
import React9, { forwardRef as forwardRef2 } from "react";
|
|
576
576
|
import { generateName as generateName2 } from "@dxos/display-name";
|
|
577
577
|
import { Device, DeviceType, DeviceKind } from "@dxos/react-client/halo";
|
|
@@ -586,7 +586,7 @@ var iconProps = {
|
|
|
586
586
|
x: 8,
|
|
587
587
|
y: 8
|
|
588
588
|
};
|
|
589
|
-
var DeviceListItem = /* @__PURE__ */ forwardRef2(({ device, onClickAdd, onClickEdit, onClickReset, onClickJoinExisting, classNames, connectionState, onAgentDestroy, ...props }, forwardedRef) => {
|
|
589
|
+
var DeviceListItem = /* @__PURE__ */ forwardRef2(({ device, onClickAdd, onClickEdit, onClickReset, onClickRecover, onClickJoinExisting, classNames, connectionState, onAgentDestroy, ...props }, forwardedRef) => {
|
|
590
590
|
const { t } = useTranslation6("os");
|
|
591
591
|
const fallbackValue = keyToFallback2(device.deviceKey);
|
|
592
592
|
const labelId = useId3("identityListItem__label");
|
|
@@ -649,7 +649,12 @@ var DeviceListItem = /* @__PURE__ */ forwardRef2(({ device, onClickAdd, onClickE
|
|
|
649
649
|
onClick: onClickJoinExisting
|
|
650
650
|
}, /* @__PURE__ */ React9.createElement(ShareFat, {
|
|
651
651
|
className: getSize5(5)
|
|
652
|
-
}), t("choose join new identity label")), /* @__PURE__ */ React9.createElement(DropdownMenu2.Item, {
|
|
652
|
+
}), t("choose join new identity label")), onClickRecover && /* @__PURE__ */ React9.createElement(DropdownMenu2.Item, {
|
|
653
|
+
"data-testid": "device-list-item-current.recover",
|
|
654
|
+
onClick: onClickRecover
|
|
655
|
+
}, /* @__PURE__ */ React9.createElement(FirstAidKit, {
|
|
656
|
+
className: getSize5(5)
|
|
657
|
+
}), t("choose recover identity label")), /* @__PURE__ */ React9.createElement(DropdownMenu2.Item, {
|
|
653
658
|
"data-testid": "device-list-item-current.reset",
|
|
654
659
|
onClick: onClickReset
|
|
655
660
|
}, /* @__PURE__ */ React9.createElement(Power2, {
|
|
@@ -658,7 +663,7 @@ var DeviceListItem = /* @__PURE__ */ forwardRef2(({ device, onClickAdd, onClickE
|
|
|
658
663
|
});
|
|
659
664
|
|
|
660
665
|
// packages/sdk/shell/src/components/DeviceList/DeviceList.tsx
|
|
661
|
-
var DeviceList = ({ devices, connectionState, onClickAdd, onClickEdit, onClickReset, onClickJoinExisting, onAgentDestroy }) => {
|
|
666
|
+
var DeviceList = ({ devices, connectionState, onClickAdd, onClickEdit, onClickReset, onClickRecover, onClickJoinExisting, onAgentDestroy }) => {
|
|
662
667
|
const { t } = useTranslation7("os");
|
|
663
668
|
return /* @__PURE__ */ React10.createElement(React10.Fragment, null, /* @__PURE__ */ React10.createElement("h2", {
|
|
664
669
|
className: mx7(descriptionText4, "text-center mbs-4")
|
|
@@ -668,6 +673,7 @@ var DeviceList = ({ devices, connectionState, onClickAdd, onClickEdit, onClickRe
|
|
|
668
673
|
device,
|
|
669
674
|
onClickEdit: () => onClickEdit?.(device),
|
|
670
675
|
onClickReset,
|
|
676
|
+
onClickRecover,
|
|
671
677
|
onClickJoinExisting,
|
|
672
678
|
connectionState,
|
|
673
679
|
onAgentDestroy
|
|
@@ -925,14 +931,14 @@ var InvitationList = ({ invitations, send, ...invitationProps }) => {
|
|
|
925
931
|
var InvitationListContainer = ({ spaceKey, createInvitationUrl, send }) => {
|
|
926
932
|
const space = useSpace(spaceKey);
|
|
927
933
|
const invitations = useSpaceInvitations(spaceKey);
|
|
928
|
-
const
|
|
934
|
+
const handleClickRemove = useCallback3((invitation) => {
|
|
929
935
|
void invitation.cancel();
|
|
930
936
|
}, [
|
|
931
937
|
space
|
|
932
938
|
]);
|
|
933
939
|
return /* @__PURE__ */ React14.createElement(InvitationList, {
|
|
934
940
|
invitations,
|
|
935
|
-
onClickRemove,
|
|
941
|
+
onClickRemove: handleClickRemove,
|
|
936
942
|
createInvitationUrl,
|
|
937
943
|
send
|
|
938
944
|
});
|
|
@@ -1237,9 +1243,10 @@ import React42 from "react";
|
|
|
1237
1243
|
import { Dialog, useId as useId10 } from "@dxos/react-ui";
|
|
1238
1244
|
|
|
1239
1245
|
// packages/sdk/shell/src/panels/IdentityPanel/IdentityPanel.tsx
|
|
1240
|
-
import { Key, Plugs, PlugsConnected } from "@phosphor-icons/react";
|
|
1246
|
+
import { FirstAidKit as FirstAidKit2, Key, Plugs, PlugsConnected } from "@phosphor-icons/react";
|
|
1241
1247
|
import React29, { useEffect as useEffect4, useMemo as useMemo3, useState as useState9 } from "react";
|
|
1242
1248
|
import { generateName as generateName3 } from "@dxos/display-name";
|
|
1249
|
+
import { invariant as invariant3 } from "@dxos/invariant";
|
|
1243
1250
|
import { log as log6 } from "@dxos/log";
|
|
1244
1251
|
import { useClient as useClient6 } from "@dxos/react-client";
|
|
1245
1252
|
import { useIdentity, useDevices, useHaloInvitations as useHaloInvitations2 } from "@dxos/react-client/halo";
|
|
@@ -1282,6 +1289,7 @@ var identityMachine = createMachine({
|
|
|
1282
1289
|
choosingAction: {},
|
|
1283
1290
|
managingDeviceInvitation: {},
|
|
1284
1291
|
confirmingResetStorage: {},
|
|
1292
|
+
confirmingRecover: {},
|
|
1285
1293
|
confirmingJoinNewIdentity: {}
|
|
1286
1294
|
},
|
|
1287
1295
|
on: {
|
|
@@ -1310,6 +1318,10 @@ var identityMachine = createMachine({
|
|
|
1310
1318
|
target: ".confirmingJoinNewIdentity",
|
|
1311
1319
|
actions: "log"
|
|
1312
1320
|
},
|
|
1321
|
+
chooseRecoverIdentity: {
|
|
1322
|
+
target: ".confirmingRecover",
|
|
1323
|
+
actions: "log"
|
|
1324
|
+
},
|
|
1313
1325
|
chooseResetStorage: {
|
|
1314
1326
|
target: ".confirmingResetStorage",
|
|
1315
1327
|
actions: "log"
|
|
@@ -1335,7 +1347,7 @@ var identityMachine = createMachine({
|
|
|
1335
1347
|
context
|
|
1336
1348
|
}, {
|
|
1337
1349
|
F: __dxlog_file,
|
|
1338
|
-
L:
|
|
1350
|
+
L: 98,
|
|
1339
1351
|
S: void 0,
|
|
1340
1352
|
C: (f, a) => f(...a)
|
|
1341
1353
|
});
|
|
@@ -1392,12 +1404,22 @@ var IdentityActionChooser = (props) => {
|
|
|
1392
1404
|
invitation
|
|
1393
1405
|
});
|
|
1394
1406
|
};
|
|
1407
|
+
const isProduction = client.config.values.runtime?.app?.env?.DX_ENVIRONMENT === "production";
|
|
1395
1408
|
return /* @__PURE__ */ React25.createElement(IdentityActionChooserImpl, {
|
|
1396
1409
|
...props,
|
|
1397
|
-
|
|
1410
|
+
onClickAdd: createInvitation,
|
|
1411
|
+
onClickJoinExisting: () => send?.({
|
|
1412
|
+
type: "chooseJoinNewIdentity"
|
|
1413
|
+
}),
|
|
1414
|
+
onClickRecover: isProduction ? void 0 : () => send?.({
|
|
1415
|
+
type: "chooseRecoverIdentity"
|
|
1416
|
+
}),
|
|
1417
|
+
onClickReset: () => send?.({
|
|
1418
|
+
type: "chooseResetStorage"
|
|
1419
|
+
})
|
|
1398
1420
|
});
|
|
1399
1421
|
};
|
|
1400
|
-
var IdentityActionChooserImpl = ({
|
|
1422
|
+
var IdentityActionChooserImpl = ({ devices, connectionState, agentHostingEnabled, onClickAdd, onClickJoinExisting, onClickRecover, onClickReset, ...agentProps }) => {
|
|
1401
1423
|
const managedDeviceAvailable = devices.find((device) => device.profile?.type === DeviceType2.AGENT_MANAGED);
|
|
1402
1424
|
return /* @__PURE__ */ React25.createElement("div", {
|
|
1403
1425
|
role: "none",
|
|
@@ -1405,13 +1427,10 @@ var IdentityActionChooserImpl = ({ send, onCreateInvitationClick, devices, conne
|
|
|
1405
1427
|
}, /* @__PURE__ */ React25.createElement(DeviceList, {
|
|
1406
1428
|
devices,
|
|
1407
1429
|
connectionState,
|
|
1408
|
-
onClickAdd
|
|
1409
|
-
onClickJoinExisting
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
onClickReset: () => send?.({
|
|
1413
|
-
type: "chooseResetStorage"
|
|
1414
|
-
}),
|
|
1430
|
+
onClickAdd,
|
|
1431
|
+
onClickJoinExisting,
|
|
1432
|
+
onClickRecover,
|
|
1433
|
+
onClickReset,
|
|
1415
1434
|
onAgentDestroy: agentProps.onAgentDestroy
|
|
1416
1435
|
}), !managedDeviceAvailable && agentHostingEnabled && /* @__PURE__ */ React25.createElement(AgentConfig, agentProps));
|
|
1417
1436
|
};
|
|
@@ -1813,7 +1832,7 @@ var ConfirmResetImpl = ({ disabled, pending, validationMessage, onConfirm, onCan
|
|
|
1813
1832
|
const { t } = useTranslation13("os");
|
|
1814
1833
|
const confirmationValue = t("confirmation value");
|
|
1815
1834
|
const [inputValue, setInputValue] = useState8("");
|
|
1816
|
-
const testIdAffix = mode === "join new identity" ? "join-new-identity" : "reset-storage";
|
|
1835
|
+
const testIdAffix = mode === "join new identity" ? "join-new-identity" : mode === "recover" ? "recover" : "reset-storage";
|
|
1817
1836
|
return /* @__PURE__ */ React28.createElement(React28.Fragment, null, /* @__PURE__ */ React28.createElement("div", {
|
|
1818
1837
|
role: "none",
|
|
1819
1838
|
className: "grow flex flex-col gap-2 justify-center"
|
|
@@ -1825,7 +1844,7 @@ var ConfirmResetImpl = ({ disabled, pending, validationMessage, onConfirm, onCan
|
|
|
1825
1844
|
validationMessage,
|
|
1826
1845
|
label: /* @__PURE__ */ React28.createElement(StepHeading, {
|
|
1827
1846
|
className: "text-start mlb-2"
|
|
1828
|
-
}, t(mode === "join new identity" ? "join new identity input label" : "reset storage input label", {
|
|
1847
|
+
}, t(mode === "join new identity" ? "join new identity input label" : mode === "recover" ? "recover reset input label" : "reset storage input label", {
|
|
1829
1848
|
confirmationValue
|
|
1830
1849
|
})),
|
|
1831
1850
|
disabled,
|
|
@@ -1852,6 +1871,7 @@ var viewStyles = "pbs-1 pbe-3 pli-3";
|
|
|
1852
1871
|
var getHueValue = (identity) => identity?.profile?.data?.hue || hexToHue2(identity?.identityKey.toHex() ?? "0");
|
|
1853
1872
|
var getEmojiValue = (identity) => identity?.profile?.data?.emoji || hexToEmoji4(identity?.identityKey.toHex() ?? "0");
|
|
1854
1873
|
var IdentityHeading = ({ titleId, title, identity, onDone, onUpdateProfile, connectionState, onChangeConnectionState }) => {
|
|
1874
|
+
const client = useClient6();
|
|
1855
1875
|
const fallbackValue = keyToFallback3(identity.identityKey);
|
|
1856
1876
|
const { t } = useTranslation14("os");
|
|
1857
1877
|
const [displayName, setDisplayName] = useState9(identity.profile?.displayName ?? "");
|
|
@@ -1859,7 +1879,7 @@ var IdentityHeading = ({ titleId, title, identity, onDone, onUpdateProfile, conn
|
|
|
1859
1879
|
const [hue, setHueDirectly] = useState9(getHueValue(identity));
|
|
1860
1880
|
const { textValue, setTextValue } = useClipboardContext();
|
|
1861
1881
|
const identityHex = identity.identityKey.toHex();
|
|
1862
|
-
const
|
|
1882
|
+
const publicKeyCopied = textValue === identityHex;
|
|
1863
1883
|
const setEmoji = (nextEmoji) => {
|
|
1864
1884
|
setEmojiDirectly(nextEmoji);
|
|
1865
1885
|
void onUpdateProfile?.({
|
|
@@ -1880,8 +1900,21 @@ var IdentityHeading = ({ titleId, title, identity, onDone, onUpdateProfile, conn
|
|
|
1880
1900
|
}
|
|
1881
1901
|
});
|
|
1882
1902
|
};
|
|
1903
|
+
const handleRecoveryCode = async () => {
|
|
1904
|
+
invariant3(client.services.services.IdentityService, "IdentityService not available", {
|
|
1905
|
+
F: __dxlog_file6,
|
|
1906
|
+
L: 76,
|
|
1907
|
+
S: void 0,
|
|
1908
|
+
A: [
|
|
1909
|
+
"client.services.services.IdentityService",
|
|
1910
|
+
"'IdentityService not available'"
|
|
1911
|
+
]
|
|
1912
|
+
});
|
|
1913
|
+
const { seedphrase } = await client.services.services.IdentityService.createRecoveryPhrase();
|
|
1914
|
+
void setTextValue(seedphrase);
|
|
1915
|
+
};
|
|
1883
1916
|
const isConnected = connectionState === ConnectionState2.ONLINE;
|
|
1884
|
-
const
|
|
1917
|
+
const isProduction = client.config.values.runtime?.app?.env?.DX_ENVIRONMENT === "production";
|
|
1885
1918
|
return /* @__PURE__ */ React29.createElement(Heading, {
|
|
1886
1919
|
titleId,
|
|
1887
1920
|
title,
|
|
@@ -1925,7 +1958,7 @@ var IdentityHeading = ({ titleId, title, identity, onDone, onUpdateProfile, conn
|
|
|
1925
1958
|
hue,
|
|
1926
1959
|
onChangeHue: setHue,
|
|
1927
1960
|
classNames: "bs-[--rail-action]"
|
|
1928
|
-
}),
|
|
1961
|
+
}), /* @__PURE__ */ React29.createElement(Tooltip7.Root, null, /* @__PURE__ */ React29.createElement(Tooltip7.Trigger, {
|
|
1929
1962
|
asChild: true
|
|
1930
1963
|
}, /* @__PURE__ */ React29.createElement(Toolbar3.Button, {
|
|
1931
1964
|
classNames: "bs-[--rail-action]",
|
|
@@ -1933,12 +1966,22 @@ var IdentityHeading = ({ titleId, title, identity, onDone, onUpdateProfile, conn
|
|
|
1933
1966
|
onClick: () => setTextValue(identityHex)
|
|
1934
1967
|
}, /* @__PURE__ */ React29.createElement("span", {
|
|
1935
1968
|
className: "sr-only"
|
|
1936
|
-
}, t(
|
|
1969
|
+
}, t(publicKeyCopied ? "copy success label" : "copy self public key label")), /* @__PURE__ */ React29.createElement(Key, {
|
|
1937
1970
|
className: getSize13(5)
|
|
1938
1971
|
}))), /* @__PURE__ */ React29.createElement(Tooltip7.Portal, null, /* @__PURE__ */ React29.createElement(Tooltip7.Content, {
|
|
1939
1972
|
side: "bottom",
|
|
1940
1973
|
classNames: "z-50"
|
|
1941
|
-
}, t(
|
|
1974
|
+
}, t(publicKeyCopied ? "copy success label" : "copy self public key label"), /* @__PURE__ */ React29.createElement(Tooltip7.Arrow, null)))), !isProduction && /* @__PURE__ */ React29.createElement(Tooltip7.Root, null, /* @__PURE__ */ React29.createElement(Tooltip7.Trigger, {
|
|
1975
|
+
asChild: true
|
|
1976
|
+
}, /* @__PURE__ */ React29.createElement(Toolbar3.Button, {
|
|
1977
|
+
classNames: "bs-[--rail-action]",
|
|
1978
|
+
onClick: handleRecoveryCode
|
|
1979
|
+
}, /* @__PURE__ */ React29.createElement(FirstAidKit2, {
|
|
1980
|
+
className: getSize13(5)
|
|
1981
|
+
}))), /* @__PURE__ */ React29.createElement(Tooltip7.Portal, null, /* @__PURE__ */ React29.createElement(Tooltip7.Content, {
|
|
1982
|
+
side: "bottom",
|
|
1983
|
+
classNames: "z-50"
|
|
1984
|
+
}, t("create recovery code label"), /* @__PURE__ */ React29.createElement(Tooltip7.Arrow, null)))), /* @__PURE__ */ React29.createElement(Tooltip7.Root, null, /* @__PURE__ */ React29.createElement(Tooltip7.Trigger, {
|
|
1942
1985
|
asChild: true
|
|
1943
1986
|
}, /* @__PURE__ */ React29.createElement(Toolbar3.Button, {
|
|
1944
1987
|
classNames: [
|
|
@@ -1955,10 +1998,10 @@ var IdentityHeading = ({ titleId, title, identity, onDone, onUpdateProfile, conn
|
|
|
1955
1998
|
}))), /* @__PURE__ */ React29.createElement(Tooltip7.Portal, null, /* @__PURE__ */ React29.createElement(Tooltip7.Content, {
|
|
1956
1999
|
side: "bottom",
|
|
1957
2000
|
classNames: "z-50"
|
|
1958
|
-
}, t(isConnected ? "disconnect label" : "connect label"), /* @__PURE__ */ React29.createElement(Tooltip7.Arrow, null)))))))
|
|
2001
|
+
}, t(isConnected ? "disconnect label" : "connect label"), /* @__PURE__ */ React29.createElement(Tooltip7.Arrow, null)))))));
|
|
1959
2002
|
};
|
|
1960
2003
|
var IdentityPanelImpl = (props) => {
|
|
1961
|
-
const { identity, titleId, activeView, onUpdateProfile, onResetStorage, onJoinNewIdentity, IdentityActionChooser: IdentityActionChooserComponent = IdentityActionChooser, InvitationManager: InvitationManagerComponent = InvitationManager, connectionState, onChangeConnectionState, onDone, ...rest } = props;
|
|
2004
|
+
const { identity, titleId, activeView, onUpdateProfile, onResetStorage, onRecover, onJoinNewIdentity, IdentityActionChooser: IdentityActionChooserComponent = IdentityActionChooser, InvitationManager: InvitationManagerComponent = InvitationManager, connectionState, onChangeConnectionState, onDone, ...rest } = props;
|
|
1962
2005
|
const { t } = useTranslation14("os");
|
|
1963
2006
|
const title = useMemo3(() => {
|
|
1964
2007
|
switch (activeView) {
|
|
@@ -2005,6 +2048,15 @@ var IdentityPanelImpl = (props) => {
|
|
|
2005
2048
|
mode: "join new identity",
|
|
2006
2049
|
onConfirm: onJoinNewIdentity,
|
|
2007
2050
|
onCancel: onCancelReset
|
|
2051
|
+
})), /* @__PURE__ */ React29.createElement(Viewport.View, {
|
|
2052
|
+
classNames: viewStyles,
|
|
2053
|
+
id: "confirm recover"
|
|
2054
|
+
}, /* @__PURE__ */ React29.createElement(ConfirmReset, {
|
|
2055
|
+
active: activeView === "confirm recover",
|
|
2056
|
+
...rest,
|
|
2057
|
+
mode: "recover",
|
|
2058
|
+
onConfirm: onRecover,
|
|
2059
|
+
onCancel: onCancelReset
|
|
2008
2060
|
})), /* @__PURE__ */ React29.createElement(Viewport.View, {
|
|
2009
2061
|
classNames: viewStyles,
|
|
2010
2062
|
id: "confirm reset storage"
|
|
@@ -2036,7 +2088,7 @@ var IdentityPanel = ({ titleId: propsTitleId, createInvitationUrl = (code) => co
|
|
|
2036
2088
|
if (!identity) {
|
|
2037
2089
|
log6.error("IdentityPanel rendered with no active identity.", void 0, {
|
|
2038
2090
|
F: __dxlog_file6,
|
|
2039
|
-
L:
|
|
2091
|
+
L: 278,
|
|
2040
2092
|
S: void 0,
|
|
2041
2093
|
C: (f, a) => f(...a)
|
|
2042
2094
|
});
|
|
@@ -2053,7 +2105,7 @@ var IdentityPanel = ({ titleId: propsTitleId, createInvitationUrl = (code) => co
|
|
|
2053
2105
|
const subscription = identityService.subscribe((state) => {
|
|
2054
2106
|
log6("[state]", state, {
|
|
2055
2107
|
F: __dxlog_file6,
|
|
2056
|
-
L:
|
|
2108
|
+
L: 291,
|
|
2057
2109
|
S: void 0,
|
|
2058
2110
|
C: (f, a) => f(...a)
|
|
2059
2111
|
});
|
|
@@ -2070,6 +2122,8 @@ var IdentityPanel = ({ titleId: propsTitleId, createInvitationUrl = (code) => co
|
|
|
2070
2122
|
return "device invitation manager";
|
|
2071
2123
|
case identityState.matches("confirmingResetStorage"):
|
|
2072
2124
|
return "confirm reset storage";
|
|
2125
|
+
case identityState.matches("confirmingRecover"):
|
|
2126
|
+
return "confirm recover";
|
|
2073
2127
|
case identityState.matches("confirmingJoinNewIdentity"):
|
|
2074
2128
|
return "confirm join new identity";
|
|
2075
2129
|
default:
|
|
@@ -2480,6 +2534,11 @@ var joinMachine = createMachine2({
|
|
|
2480
2534
|
target: "#join.choosingIdentity.acceptingHaloInvitation",
|
|
2481
2535
|
actions: "log"
|
|
2482
2536
|
},
|
|
2537
|
+
{
|
|
2538
|
+
cond: "initiallyRecoveringIdentity",
|
|
2539
|
+
target: "#join.choosingIdentity.recoveringIdentity",
|
|
2540
|
+
actions: "log"
|
|
2541
|
+
},
|
|
2483
2542
|
{
|
|
2484
2543
|
cond: "noSelectedIdentity",
|
|
2485
2544
|
target: "choosingIdentity",
|
|
@@ -2565,6 +2624,7 @@ var joinMachine = createMachine2({
|
|
|
2565
2624
|
existingIdentity: ({ identity, mode }, _event) => mode === "halo-only" && !!identity,
|
|
2566
2625
|
noSelectedIdentity: ({ identity }, _event) => !identity,
|
|
2567
2626
|
initiallyAcceptingHaloInvitation: ({ identity, initialDisposition }, _event) => !identity && initialDisposition === "accept-halo-invitation",
|
|
2627
|
+
initiallyRecoveringIdentity: ({ identity, initialDisposition }, _event) => !identity && initialDisposition === "recover-identity",
|
|
2568
2628
|
hasHaloUnredeemedCode: ({ halo }, _event) => !!halo.unredeemedCode,
|
|
2569
2629
|
noSpaceInvitation: ({ space }, _event) => !space.invitation && !space.unredeemedCode
|
|
2570
2630
|
},
|
|
@@ -2622,7 +2682,7 @@ var joinMachine = createMachine2({
|
|
|
2622
2682
|
spaceInvitation: context.space.invitation
|
|
2623
2683
|
}, {
|
|
2624
2684
|
F: __dxlog_file7,
|
|
2625
|
-
L:
|
|
2685
|
+
L: 425,
|
|
2626
2686
|
S: void 0,
|
|
2627
2687
|
C: (f, a) => f(...a)
|
|
2628
2688
|
});
|
|
@@ -2636,7 +2696,7 @@ var defaultCodeFromUrl = (invitationType, text) => {
|
|
|
2636
2696
|
} catch (err) {
|
|
2637
2697
|
log7.catch(err, void 0, {
|
|
2638
2698
|
F: __dxlog_file7,
|
|
2639
|
-
L:
|
|
2699
|
+
L: 452,
|
|
2640
2700
|
S: void 0,
|
|
2641
2701
|
C: (f, a) => f(...a)
|
|
2642
2702
|
});
|
|
@@ -2657,7 +2717,7 @@ var useJoinMachine = (client, options) => {
|
|
|
2657
2717
|
} catch (err) {
|
|
2658
2718
|
log7.error("Could not redeem device invitation code", err, {
|
|
2659
2719
|
F: __dxlog_file7,
|
|
2660
|
-
L:
|
|
2720
|
+
L: 473,
|
|
2661
2721
|
S: void 0,
|
|
2662
2722
|
C: (f, a) => f(...a)
|
|
2663
2723
|
});
|
|
@@ -2682,7 +2742,7 @@ var useJoinMachine = (client, options) => {
|
|
|
2682
2742
|
} catch (err) {
|
|
2683
2743
|
log7.error("Could not redeem space invitation code", err, {
|
|
2684
2744
|
F: __dxlog_file7,
|
|
2685
|
-
L:
|
|
2745
|
+
L: 495,
|
|
2686
2746
|
S: void 0,
|
|
2687
2747
|
C: (f, a) => f(...a)
|
|
2688
2748
|
});
|
|
@@ -2787,8 +2847,6 @@ var AdditionMethodChooser = (viewStateProps) => {
|
|
|
2787
2847
|
"data-testid": "identity-chooser.join-identity"
|
|
2788
2848
|
}, t("join identity label")), /* @__PURE__ */ React31.createElement(CompoundButton, {
|
|
2789
2849
|
...sharedButtonProps,
|
|
2790
|
-
// TODO(mykola): Implement recover.
|
|
2791
|
-
disabled: true,
|
|
2792
2850
|
description: t("recover identity description"),
|
|
2793
2851
|
before: /* @__PURE__ */ React31.createElement(Textbox, {
|
|
2794
2852
|
className: getSize15(6)
|
|
@@ -2856,23 +2914,42 @@ var IdentityInput = (props) => {
|
|
|
2856
2914
|
const client = useClient7();
|
|
2857
2915
|
const { t } = useTranslation18("os");
|
|
2858
2916
|
const [validationMessage, setValidationMessage] = useState10("");
|
|
2859
|
-
const createIdentity = (
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
2917
|
+
const createIdentity = (value) => {
|
|
2918
|
+
if (isRecover) {
|
|
2919
|
+
void client.halo.recoverIdentity({
|
|
2920
|
+
seedphrase: value
|
|
2921
|
+
}).then((identity) => {
|
|
2922
|
+
send?.({
|
|
2923
|
+
type: "selectIdentity",
|
|
2924
|
+
identity
|
|
2925
|
+
});
|
|
2926
|
+
}, (error) => {
|
|
2927
|
+
log8.catch(error, void 0, {
|
|
2928
|
+
F: __dxlog_file8,
|
|
2929
|
+
L: 38,
|
|
2930
|
+
S: void 0,
|
|
2931
|
+
C: (f, a) => f(...a)
|
|
2932
|
+
});
|
|
2933
|
+
setValidationMessage(t("failed to recover identity message"));
|
|
2866
2934
|
});
|
|
2867
|
-
}
|
|
2868
|
-
|
|
2869
|
-
|
|
2870
|
-
|
|
2871
|
-
|
|
2872
|
-
|
|
2935
|
+
} else {
|
|
2936
|
+
void client.halo.createIdentity({
|
|
2937
|
+
displayName: value
|
|
2938
|
+
}).then((identity) => {
|
|
2939
|
+
send?.({
|
|
2940
|
+
type: "selectIdentity",
|
|
2941
|
+
identity
|
|
2942
|
+
});
|
|
2943
|
+
}, (error) => {
|
|
2944
|
+
log8.catch(error, void 0, {
|
|
2945
|
+
F: __dxlog_file8,
|
|
2946
|
+
L: 48,
|
|
2947
|
+
S: void 0,
|
|
2948
|
+
C: (f, a) => f(...a)
|
|
2949
|
+
});
|
|
2950
|
+
setValidationMessage(t("failed to create identity message"));
|
|
2873
2951
|
});
|
|
2874
|
-
|
|
2875
|
-
});
|
|
2952
|
+
}
|
|
2876
2953
|
};
|
|
2877
2954
|
return /* @__PURE__ */ React33.createElement(IdentityInputImpl, {
|
|
2878
2955
|
...props,
|
|
@@ -4067,9 +4144,10 @@ var Shell = ({ runtime }) => {
|
|
|
4067
4144
|
return /* @__PURE__ */ React46.createElement(StatusDialog, null);
|
|
4068
4145
|
case ShellLayout.INITIALIZE_IDENTITY:
|
|
4069
4146
|
case ShellLayout.INITIALIZE_IDENTITY_FROM_INVITATION:
|
|
4147
|
+
case ShellLayout.INITIALIZE_IDENTITY_FROM_RECOVERY:
|
|
4070
4148
|
return /* @__PURE__ */ React46.createElement(JoinDialog, {
|
|
4071
4149
|
mode: "halo-only",
|
|
4072
|
-
initialDisposition: layout === ShellLayout.INITIALIZE_IDENTITY_FROM_INVITATION ? "accept-halo-invitation" : "default",
|
|
4150
|
+
initialDisposition: layout === ShellLayout.INITIALIZE_IDENTITY_FROM_RECOVERY ? "recover-identity" : layout === ShellLayout.INITIALIZE_IDENTITY_FROM_INVITATION ? "accept-halo-invitation" : "default",
|
|
4073
4151
|
initialInvitationCode: invitationCode,
|
|
4074
4152
|
onCancelResetStorage: () => runtime.setLayout({
|
|
4075
4153
|
layout: ShellLayout.IDENTITY
|
|
@@ -4099,6 +4177,17 @@ var Shell = ({ runtime }) => {
|
|
|
4099
4177
|
reset: true
|
|
4100
4178
|
});
|
|
4101
4179
|
},
|
|
4180
|
+
onRecover: async () => {
|
|
4181
|
+
runtime.setLayout({
|
|
4182
|
+
layout: ShellLayout.STATUS
|
|
4183
|
+
});
|
|
4184
|
+
await client.reset();
|
|
4185
|
+
return runtime.setAppContext({
|
|
4186
|
+
display: ShellDisplay.NONE,
|
|
4187
|
+
reset: true,
|
|
4188
|
+
target: "recoverIdentity"
|
|
4189
|
+
});
|
|
4190
|
+
},
|
|
4102
4191
|
onJoinNewIdentity: async () => {
|
|
4103
4192
|
runtime.setLayout({
|
|
4104
4193
|
layout: ShellLayout.STATUS
|
|
@@ -4169,7 +4258,7 @@ var Shell = ({ runtime }) => {
|
|
|
4169
4258
|
// packages/sdk/shell/src/composites/Shell/shell-runtime.ts
|
|
4170
4259
|
import { Event } from "@dxos/async";
|
|
4171
4260
|
import { appServiceBundle, shellServiceBundle } from "@dxos/client-protocol";
|
|
4172
|
-
import { invariant as
|
|
4261
|
+
import { invariant as invariant4 } from "@dxos/invariant";
|
|
4173
4262
|
import { ShellLayout as ShellLayout2 } from "@dxos/protocols/proto/dxos/iframe";
|
|
4174
4263
|
import { createProtoRpcPeer } from "@dxos/rpc";
|
|
4175
4264
|
var __dxlog_file15 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/composites/Shell/shell-runtime.ts";
|
|
@@ -4228,7 +4317,7 @@ var ShellRuntimeImpl = class {
|
|
|
4228
4317
|
});
|
|
4229
4318
|
}
|
|
4230
4319
|
async setAppContext(context) {
|
|
4231
|
-
|
|
4320
|
+
invariant4(this._appRpc, "runtime not open", {
|
|
4232
4321
|
F: __dxlog_file15,
|
|
4233
4322
|
L: 83,
|
|
4234
4323
|
S: this,
|
|
@@ -4420,7 +4509,9 @@ var os = {
|
|
|
4420
4509
|
"getting agent label": "Checking agent status\u2026",
|
|
4421
4510
|
"agent requested label": "Agent requested",
|
|
4422
4511
|
"agent requested description": "The agent service is creating an agent for you. Once the agent connects, it will display in the devices list.",
|
|
4423
|
-
"authenticating label": "Authenticating\u2026"
|
|
4512
|
+
"authenticating label": "Authenticating\u2026",
|
|
4513
|
+
"create recovery code label": "Create recovery code",
|
|
4514
|
+
"choose recover identity label": "Recover identity"
|
|
4424
4515
|
};
|
|
4425
4516
|
|
|
4426
4517
|
// packages/sdk/shell/src/translations/index.ts
|