@dxos/shell 0.6.14-main.2b6a0f3 → 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 +15116 -11401
- package/dist/bundle/shell.mjs.map +1 -1
- package/dist/bundle/shell.umd.js +134 -89
- 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 +465 -364
- package/dist/lib/browser/react.mjs.map +4 -4
- 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 -26
- 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
|
});
|
|
@@ -1233,21 +1239,22 @@ var SpaceListItem = /* @__PURE__ */ forwardRef8(({ space, onClick }, ref) => {
|
|
|
1233
1239
|
});
|
|
1234
1240
|
|
|
1235
1241
|
// packages/sdk/shell/src/composites/IdentityDialog/IdentityDialog.tsx
|
|
1236
|
-
import
|
|
1242
|
+
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";
|
|
1241
|
-
import
|
|
1246
|
+
import { FirstAidKit as FirstAidKit2, Key, Plugs, PlugsConnected } from "@phosphor-icons/react";
|
|
1247
|
+
import React29, { useEffect as useEffect4, useMemo as useMemo3, useState as useState9 } from "react";
|
|
1242
1248
|
import { generateName as generateName3 } from "@dxos/display-name";
|
|
1243
|
-
import {
|
|
1249
|
+
import { invariant as invariant3 } from "@dxos/invariant";
|
|
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";
|
|
1246
1253
|
import { useInvitationStatus as useInvitationStatus2 } from "@dxos/react-client/invitations";
|
|
1247
1254
|
import { useNetworkStatus, ConnectionState as ConnectionState2 } from "@dxos/react-client/mesh";
|
|
1248
|
-
import { Avatar as Avatar6, Input as Input2, Toolbar as Toolbar3, Tooltip as Tooltip7, useId as useId6, useTranslation as
|
|
1255
|
+
import { Avatar as Avatar6, Input as Input2, Toolbar as Toolbar3, Tooltip as Tooltip7, useId as useId6, useTranslation as useTranslation14 } from "@dxos/react-ui";
|
|
1249
1256
|
import { getSize as getSize13 } from "@dxos/react-ui-theme";
|
|
1250
|
-
import { hexToEmoji as
|
|
1257
|
+
import { hexToEmoji as hexToEmoji4, hexToHue as hexToHue2, keyToFallback as keyToFallback3 } from "@dxos/util";
|
|
1251
1258
|
|
|
1252
1259
|
// packages/sdk/shell/src/panels/IdentityPanel/identityMachine.ts
|
|
1253
1260
|
import { useMachine } from "@xstate/react";
|
|
@@ -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,30 +1427,33 @@ 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
|
};
|
|
1418
1437
|
|
|
1438
|
+
// packages/sdk/shell/src/panels/IdentityPanel/steps/ProfileForm.tsx
|
|
1439
|
+
import React26, { useState as useState5 } from "react";
|
|
1440
|
+
import { log as log3 } from "@dxos/log";
|
|
1441
|
+
import { useTranslation as useTranslation11 } from "@dxos/react-ui";
|
|
1442
|
+
import { hexToEmoji as hexToEmoji2, hexToHue } from "@dxos/util";
|
|
1443
|
+
|
|
1419
1444
|
// packages/sdk/shell/src/panels/IdentityPanel/useAgentHandlers.ts
|
|
1420
1445
|
import { useClient as useClient5 } from "@dxos/react-client";
|
|
1421
1446
|
|
|
1422
1447
|
// packages/sdk/shell/src/panels/IdentityPanel/useEdgeAgentsHandlers.ts
|
|
1423
|
-
import { useEffect as useEffect2, useState as
|
|
1448
|
+
import { useEffect as useEffect2, useState as useState6 } from "react";
|
|
1424
1449
|
import { invariant } from "@dxos/invariant";
|
|
1425
1450
|
import { QueryAgentStatusResponse } from "@dxos/protocols/proto/dxos/client/services";
|
|
1426
1451
|
import { useClient as useClient3 } from "@dxos/react-client";
|
|
1427
1452
|
var __dxlog_file3 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/IdentityPanel/useEdgeAgentsHandlers.ts";
|
|
1428
1453
|
var useEdgeAgentHandlers = ({ identity }) => {
|
|
1429
|
-
const [validationMessage, setValidationMessage] =
|
|
1430
|
-
const [lastReceivedStatus, setLastReceivedStatus] =
|
|
1431
|
-
const [agentStatus, setAgentStatus] =
|
|
1454
|
+
const [validationMessage, setValidationMessage] = useState6("");
|
|
1455
|
+
const [lastReceivedStatus, setLastReceivedStatus] = useState6(QueryAgentStatusResponse.AgentStatus.UNKNOWN);
|
|
1456
|
+
const [agentStatus, setAgentStatus] = useState6("getting");
|
|
1432
1457
|
const client = useClient3();
|
|
1433
1458
|
const agentHostingEnabled = Boolean(client.config.values.runtime?.client?.edgeFeatures?.agents);
|
|
1434
1459
|
const handleStatus = (status) => {
|
|
@@ -1505,15 +1530,15 @@ var useEdgeAgentHandlers = ({ identity }) => {
|
|
|
1505
1530
|
};
|
|
1506
1531
|
|
|
1507
1532
|
// packages/sdk/shell/src/panels/IdentityPanel/useKubeAgentHandlers.ts
|
|
1508
|
-
import { useCallback as useCallback4, useEffect as useEffect3, useState as
|
|
1533
|
+
import { useCallback as useCallback4, useEffect as useEffect3, useState as useState7 } from "react";
|
|
1509
1534
|
import { invariant as invariant2 } from "@dxos/invariant";
|
|
1510
|
-
import { log as
|
|
1535
|
+
import { log as log4 } from "@dxos/log";
|
|
1511
1536
|
import { useClient as useClient4, useAgentHostingClient } from "@dxos/react-client";
|
|
1512
1537
|
import { Invitation as Invitation3, InvitationEncoder as InvitationEncoder2 } from "@dxos/react-client/invitations";
|
|
1513
1538
|
var __dxlog_file4 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/IdentityPanel/useKubeAgentHandlers.ts";
|
|
1514
1539
|
var useKubeAgentHandlers = ({ invitations, identity }) => {
|
|
1515
|
-
const [validationMessage, setValidationMessage] =
|
|
1516
|
-
const [agentStatus, setAgentStatus] =
|
|
1540
|
+
const [validationMessage, setValidationMessage] = useState7("");
|
|
1541
|
+
const [agentStatus, setAgentStatus] = useState7("getting");
|
|
1517
1542
|
const agentHostingProviderClient = useAgentHostingClient();
|
|
1518
1543
|
const client = useClient4();
|
|
1519
1544
|
const updateAgentStatus = async () => {
|
|
@@ -1596,7 +1621,7 @@ var useKubeAgentHandlers = ({ invitations, identity }) => {
|
|
|
1596
1621
|
const handleAgentCreate = useCallback4(async (invitation) => {
|
|
1597
1622
|
const invitationCode = InvitationEncoder2.encode(invitation);
|
|
1598
1623
|
if (invitation.state === Invitation3.State.CONNECTING) {
|
|
1599
|
-
|
|
1624
|
+
log4.info(JSON.stringify({
|
|
1600
1625
|
invitationCode,
|
|
1601
1626
|
authCode: invitation.authCode
|
|
1602
1627
|
}), void 0, {
|
|
@@ -1643,11 +1668,11 @@ var useAgentHandlers = (params) => {
|
|
|
1643
1668
|
|
|
1644
1669
|
// packages/sdk/shell/src/steps/InvitationManager.tsx
|
|
1645
1670
|
import { Check as Check4, X as X3 } from "@phosphor-icons/react";
|
|
1646
|
-
import
|
|
1671
|
+
import React27, { useMemo as useMemo2 } from "react";
|
|
1647
1672
|
import { QR } from "react-qr-rounded";
|
|
1648
|
-
import { useId as useId5, useTranslation as
|
|
1673
|
+
import { useId as useId5, useTranslation as useTranslation12 } from "@dxos/react-ui";
|
|
1649
1674
|
import { descriptionText as descriptionText8, getSize as getSize11, mx as mx20 } from "@dxos/react-ui-theme";
|
|
1650
|
-
import { hexToEmoji as
|
|
1675
|
+
import { hexToEmoji as hexToEmoji3 } from "@dxos/util";
|
|
1651
1676
|
|
|
1652
1677
|
// packages/sdk/shell/src/util/invitationStatusValue.ts
|
|
1653
1678
|
import { Invitation as Invitation4 } from "@dxos/react-client/invitations";
|
|
@@ -1692,17 +1717,17 @@ var invitationStatusValue = /* @__PURE__ */ new Map([
|
|
|
1692
1717
|
|
|
1693
1718
|
// packages/sdk/shell/src/steps/InvitationManager.tsx
|
|
1694
1719
|
var InvitationManagerView = ({ children, ...props }) => {
|
|
1695
|
-
return /* @__PURE__ */
|
|
1720
|
+
return /* @__PURE__ */ React27.createElement(Viewport.View, {
|
|
1696
1721
|
...props,
|
|
1697
1722
|
classNames: "grow flex flex-col justify-around items-center"
|
|
1698
1723
|
}, children);
|
|
1699
1724
|
};
|
|
1700
1725
|
var InvitationManager = ({ invitationUrl, active, send, status, multiUse, authCode, id = "0" }) => {
|
|
1701
|
-
const { t } =
|
|
1726
|
+
const { t } = useTranslation12("os");
|
|
1702
1727
|
const qrLabel = useId5("invitation-manager__qr-code");
|
|
1703
1728
|
const statusValue = multiUse ? 0 : invitationStatusValue.get(status) ?? 0;
|
|
1704
1729
|
const showAuthCode = statusValue === 3;
|
|
1705
|
-
const emoji =
|
|
1730
|
+
const emoji = hexToEmoji3(id);
|
|
1706
1731
|
const activeView = useMemo2(() => {
|
|
1707
1732
|
if (multiUse) {
|
|
1708
1733
|
return "showing qr";
|
|
@@ -1719,18 +1744,18 @@ var InvitationManager = ({ invitationUrl, active, send, status, multiUse, authCo
|
|
|
1719
1744
|
}, [
|
|
1720
1745
|
statusValue
|
|
1721
1746
|
]);
|
|
1722
|
-
return /* @__PURE__ */
|
|
1747
|
+
return /* @__PURE__ */ React27.createElement(React27.Fragment, null, /* @__PURE__ */ React27.createElement(Viewport.Root, {
|
|
1723
1748
|
activeView,
|
|
1724
1749
|
classNames: "grow plb-1"
|
|
1725
|
-
}, /* @__PURE__ */
|
|
1750
|
+
}, /* @__PURE__ */ React27.createElement(Viewport.Views, null, /* @__PURE__ */ React27.createElement(InvitationManagerView, {
|
|
1726
1751
|
id: "showing qr",
|
|
1727
1752
|
emoji
|
|
1728
|
-
}, /* @__PURE__ */
|
|
1753
|
+
}, /* @__PURE__ */ React27.createElement("p", {
|
|
1729
1754
|
className: "text-sm mlb-1 font-normal text-center"
|
|
1730
|
-
}, t(multiUse ? "invite many qr label" : "invite one qr label")), /* @__PURE__ */
|
|
1755
|
+
}, t(multiUse ? "invite many qr label" : "invite one qr label")), /* @__PURE__ */ React27.createElement("div", {
|
|
1731
1756
|
role: "none",
|
|
1732
1757
|
className: mx20(descriptionText8, "is-full max-is-[14rem] relative")
|
|
1733
|
-
}, /* @__PURE__ */
|
|
1758
|
+
}, /* @__PURE__ */ React27.createElement(QR, {
|
|
1734
1759
|
rounding: 100,
|
|
1735
1760
|
backgroundColor: "transparent",
|
|
1736
1761
|
color: "currentColor",
|
|
@@ -1738,31 +1763,31 @@ var InvitationManager = ({ invitationUrl, active, send, status, multiUse, authCo
|
|
|
1738
1763
|
"aria-labelledby": qrLabel,
|
|
1739
1764
|
errorCorrectionLevel: "Q",
|
|
1740
1765
|
cutout: true
|
|
1741
|
-
}, invitationUrl ?? "never"), /* @__PURE__ */
|
|
1766
|
+
}, invitationUrl ?? "never"), /* @__PURE__ */ React27.createElement(Centered, null, /* @__PURE__ */ React27.createElement(Emoji, {
|
|
1742
1767
|
text: emoji
|
|
1743
|
-
}))), /* @__PURE__ */
|
|
1768
|
+
}))), /* @__PURE__ */ React27.createElement("span", {
|
|
1744
1769
|
id: qrLabel,
|
|
1745
1770
|
className: "sr-only"
|
|
1746
|
-
}, t("qr label")), /* @__PURE__ */
|
|
1771
|
+
}, t("qr label")), /* @__PURE__ */ React27.createElement(CopyButton, {
|
|
1747
1772
|
variant: "ghost",
|
|
1748
1773
|
value: invitationUrl ?? "never"
|
|
1749
|
-
})), /* @__PURE__ */
|
|
1774
|
+
})), /* @__PURE__ */ React27.createElement(InvitationManagerView, {
|
|
1750
1775
|
id: "showing auth code"
|
|
1751
|
-
}, /* @__PURE__ */
|
|
1776
|
+
}, /* @__PURE__ */ React27.createElement(Label, null, t("auth code message")), /* @__PURE__ */ React27.createElement(AuthCode, {
|
|
1752
1777
|
code: authCode,
|
|
1753
1778
|
large: true,
|
|
1754
1779
|
classNames: "text-black dark:text-white"
|
|
1755
|
-
}), /* @__PURE__ */
|
|
1780
|
+
}), /* @__PURE__ */ React27.createElement(Label, null, t("auth other device emoji message")), emoji && /* @__PURE__ */ React27.createElement(Emoji, {
|
|
1756
1781
|
text: emoji
|
|
1757
|
-
})), /* @__PURE__ */
|
|
1782
|
+
})), /* @__PURE__ */ React27.createElement(InvitationManagerView, {
|
|
1758
1783
|
id: "showing final"
|
|
1759
|
-
}, statusValue > 0 ? /* @__PURE__ */
|
|
1784
|
+
}, statusValue > 0 ? /* @__PURE__ */ React27.createElement(Check4, {
|
|
1760
1785
|
className: mx20("m-1.5", getSize11(6))
|
|
1761
|
-
}) : /* @__PURE__ */
|
|
1786
|
+
}) : /* @__PURE__ */ React27.createElement(X3, {
|
|
1762
1787
|
className: mx20("m-1.5", getSize11(6))
|
|
1763
|
-
})))), /* @__PURE__ */
|
|
1788
|
+
})))), /* @__PURE__ */ React27.createElement(Actions, {
|
|
1764
1789
|
classNames: "mbs-4"
|
|
1765
|
-
}, /* @__PURE__ */
|
|
1790
|
+
}, /* @__PURE__ */ React27.createElement(Action, {
|
|
1766
1791
|
disabled: !active,
|
|
1767
1792
|
onClick: () => send?.({
|
|
1768
1793
|
type: "deselectInvitation"
|
|
@@ -1772,19 +1797,19 @@ var InvitationManager = ({ invitationUrl, active, send, status, multiUse, authCo
|
|
|
1772
1797
|
|
|
1773
1798
|
// packages/sdk/shell/src/steps/ConfirmReset.tsx
|
|
1774
1799
|
import { Warning } from "@phosphor-icons/react";
|
|
1775
|
-
import
|
|
1776
|
-
import { log as
|
|
1777
|
-
import { Message, useTranslation as
|
|
1800
|
+
import React28, { useState as useState8 } from "react";
|
|
1801
|
+
import { log as log5 } from "@dxos/log";
|
|
1802
|
+
import { Message, useTranslation as useTranslation13 } from "@dxos/react-ui";
|
|
1778
1803
|
import { getSize as getSize12, mx as mx21 } from "@dxos/react-ui-theme";
|
|
1779
1804
|
var __dxlog_file5 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/steps/ConfirmReset.tsx";
|
|
1780
1805
|
var ConfirmReset = ({ active, onCancel, onConfirm, mode }) => {
|
|
1781
|
-
const { t } =
|
|
1782
|
-
const [validationMessage, setValidationMessage] =
|
|
1783
|
-
const [pending, setPending] =
|
|
1806
|
+
const { t } = useTranslation13("os");
|
|
1807
|
+
const [validationMessage, setValidationMessage] = useState8("");
|
|
1808
|
+
const [pending, setPending] = useState8(false);
|
|
1784
1809
|
const processReset = async () => {
|
|
1785
1810
|
setPending(true);
|
|
1786
1811
|
return onConfirm?.().then(() => setPending(false), (error) => {
|
|
1787
|
-
|
|
1812
|
+
log5.catch(error, void 0, {
|
|
1788
1813
|
F: __dxlog_file5,
|
|
1789
1814
|
L: 38,
|
|
1790
1815
|
S: void 0,
|
|
@@ -1794,7 +1819,7 @@ var ConfirmReset = ({ active, onCancel, onConfirm, mode }) => {
|
|
|
1794
1819
|
setPending(false);
|
|
1795
1820
|
});
|
|
1796
1821
|
};
|
|
1797
|
-
return /* @__PURE__ */
|
|
1822
|
+
return /* @__PURE__ */ React28.createElement(ConfirmResetImpl, {
|
|
1798
1823
|
disabled: !active,
|
|
1799
1824
|
pending,
|
|
1800
1825
|
validationMessage,
|
|
@@ -1804,22 +1829,22 @@ var ConfirmReset = ({ active, onCancel, onConfirm, mode }) => {
|
|
|
1804
1829
|
});
|
|
1805
1830
|
};
|
|
1806
1831
|
var ConfirmResetImpl = ({ disabled, pending, validationMessage, onConfirm, onCancel, mode }) => {
|
|
1807
|
-
const { t } =
|
|
1832
|
+
const { t } = useTranslation13("os");
|
|
1808
1833
|
const confirmationValue = t("confirmation value");
|
|
1809
|
-
const [inputValue, setInputValue] =
|
|
1810
|
-
const testIdAffix = mode === "join new identity" ? "join-new-identity" : "reset-storage";
|
|
1811
|
-
return /* @__PURE__ */
|
|
1834
|
+
const [inputValue, setInputValue] = useState8("");
|
|
1835
|
+
const testIdAffix = mode === "join new identity" ? "join-new-identity" : mode === "recover" ? "recover" : "reset-storage";
|
|
1836
|
+
return /* @__PURE__ */ React28.createElement(React28.Fragment, null, /* @__PURE__ */ React28.createElement("div", {
|
|
1812
1837
|
role: "none",
|
|
1813
1838
|
className: "grow flex flex-col gap-2 justify-center"
|
|
1814
|
-
}, /* @__PURE__ */
|
|
1839
|
+
}, /* @__PURE__ */ React28.createElement(Message.Root, {
|
|
1815
1840
|
valence: "error"
|
|
1816
|
-
}, /* @__PURE__ */
|
|
1841
|
+
}, /* @__PURE__ */ React28.createElement(Message.Title, null, /* @__PURE__ */ React28.createElement(Warning, {
|
|
1817
1842
|
className: mx21(getSize12(6), "inline mie-2")
|
|
1818
|
-
}), t("sign out chooser title")), /* @__PURE__ */
|
|
1843
|
+
}), t("sign out chooser title")), /* @__PURE__ */ React28.createElement(Message.Body, null, t("sign out chooser message"))), /* @__PURE__ */ React28.createElement(Input, {
|
|
1819
1844
|
validationMessage,
|
|
1820
|
-
label: /* @__PURE__ */
|
|
1845
|
+
label: /* @__PURE__ */ React28.createElement(StepHeading, {
|
|
1821
1846
|
className: "text-start mlb-2"
|
|
1822
|
-
}, 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", {
|
|
1823
1848
|
confirmationValue
|
|
1824
1849
|
})),
|
|
1825
1850
|
disabled,
|
|
@@ -1828,11 +1853,11 @@ var ConfirmResetImpl = ({ disabled, pending, validationMessage, onConfirm, onCan
|
|
|
1828
1853
|
confirmationValue
|
|
1829
1854
|
}),
|
|
1830
1855
|
onChange: ({ target: { value } }) => setInputValue(value)
|
|
1831
|
-
})), /* @__PURE__ */
|
|
1856
|
+
})), /* @__PURE__ */ React28.createElement(Actions, null, onCancel && /* @__PURE__ */ React28.createElement(Action, {
|
|
1832
1857
|
disabled,
|
|
1833
1858
|
onClick: onCancel,
|
|
1834
1859
|
"data-testid": `${testIdAffix}.reset-identity-cancel`
|
|
1835
|
-
}, t("cancel label")), onConfirm && /* @__PURE__ */
|
|
1860
|
+
}, t("cancel label")), onConfirm && /* @__PURE__ */ React28.createElement(Action, {
|
|
1836
1861
|
variant: "destructive",
|
|
1837
1862
|
disabled: disabled || pending || inputValue !== confirmationValue,
|
|
1838
1863
|
onClick: onConfirm,
|
|
@@ -1843,17 +1868,18 @@ var ConfirmResetImpl = ({ disabled, pending, validationMessage, onConfirm, onCan
|
|
|
1843
1868
|
// packages/sdk/shell/src/panels/IdentityPanel/IdentityPanel.tsx
|
|
1844
1869
|
var __dxlog_file6 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/IdentityPanel/IdentityPanel.tsx";
|
|
1845
1870
|
var viewStyles = "pbs-1 pbe-3 pli-3";
|
|
1846
|
-
var getHueValue = (identity) => identity?.profile?.data?.hue ||
|
|
1847
|
-
var getEmojiValue = (identity) => identity?.profile?.data?.emoji ||
|
|
1871
|
+
var getHueValue = (identity) => identity?.profile?.data?.hue || hexToHue2(identity?.identityKey.toHex() ?? "0");
|
|
1872
|
+
var getEmojiValue = (identity) => identity?.profile?.data?.emoji || hexToEmoji4(identity?.identityKey.toHex() ?? "0");
|
|
1848
1873
|
var IdentityHeading = ({ titleId, title, identity, onDone, onUpdateProfile, connectionState, onChangeConnectionState }) => {
|
|
1874
|
+
const client = useClient6();
|
|
1849
1875
|
const fallbackValue = keyToFallback3(identity.identityKey);
|
|
1850
|
-
const { t } =
|
|
1851
|
-
const [displayName, setDisplayName] =
|
|
1852
|
-
const [emoji, setEmojiDirectly] =
|
|
1853
|
-
const [hue, setHueDirectly] =
|
|
1876
|
+
const { t } = useTranslation14("os");
|
|
1877
|
+
const [displayName, setDisplayName] = useState9(identity.profile?.displayName ?? "");
|
|
1878
|
+
const [emoji, setEmojiDirectly] = useState9(getEmojiValue(identity));
|
|
1879
|
+
const [hue, setHueDirectly] = useState9(getHueValue(identity));
|
|
1854
1880
|
const { textValue, setTextValue } = useClipboardContext();
|
|
1855
1881
|
const identityHex = identity.identityKey.toHex();
|
|
1856
|
-
const
|
|
1882
|
+
const publicKeyCopied = textValue === identityHex;
|
|
1857
1883
|
const setEmoji = (nextEmoji) => {
|
|
1858
1884
|
setEmojiDirectly(nextEmoji);
|
|
1859
1885
|
void onUpdateProfile?.({
|
|
@@ -1874,31 +1900,44 @@ var IdentityHeading = ({ titleId, title, identity, onDone, onUpdateProfile, conn
|
|
|
1874
1900
|
}
|
|
1875
1901
|
});
|
|
1876
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
|
+
};
|
|
1877
1916
|
const isConnected = connectionState === ConnectionState2.ONLINE;
|
|
1878
|
-
const
|
|
1879
|
-
return /* @__PURE__ */
|
|
1917
|
+
const isProduction = client.config.values.runtime?.app?.env?.DX_ENVIRONMENT === "production";
|
|
1918
|
+
return /* @__PURE__ */ React29.createElement(Heading, {
|
|
1880
1919
|
titleId,
|
|
1881
1920
|
title,
|
|
1882
|
-
corner: /* @__PURE__ */
|
|
1921
|
+
corner: /* @__PURE__ */ React29.createElement(CloseButton, {
|
|
1883
1922
|
onDone
|
|
1884
1923
|
})
|
|
1885
|
-
}, /* @__PURE__ */
|
|
1924
|
+
}, /* @__PURE__ */ React29.createElement(Avatar6.Root, {
|
|
1886
1925
|
size: 16,
|
|
1887
1926
|
variant: "circle",
|
|
1888
1927
|
status: isConnected ? "active" : "error",
|
|
1889
1928
|
hue: hue || fallbackValue.hue
|
|
1890
|
-
}, /* @__PURE__ */
|
|
1929
|
+
}, /* @__PURE__ */ React29.createElement(Toolbar3.Root, {
|
|
1891
1930
|
classNames: "flex justify-center"
|
|
1892
|
-
}, /* @__PURE__ */
|
|
1931
|
+
}, /* @__PURE__ */ React29.createElement(Avatar6.Frame, {
|
|
1893
1932
|
classNames: "relative z-[2] -mli-4 chromatic-ignore"
|
|
1894
|
-
}, /* @__PURE__ */
|
|
1933
|
+
}, /* @__PURE__ */ React29.createElement(Avatar6.Fallback, {
|
|
1895
1934
|
text: emoji || fallbackValue.emoji
|
|
1896
|
-
}))), /* @__PURE__ */
|
|
1935
|
+
}))), /* @__PURE__ */ React29.createElement(Avatar6.Label, {
|
|
1897
1936
|
classNames: "sr-only",
|
|
1898
1937
|
"data-testid": "identityHeading.displayName"
|
|
1899
|
-
}, identity.profile?.displayName ?? generateName3(identity.identityKey.toHex())), /* @__PURE__ */
|
|
1938
|
+
}, identity.profile?.displayName ?? generateName3(identity.identityKey.toHex())), /* @__PURE__ */ React29.createElement(Input2.Root, null, /* @__PURE__ */ React29.createElement(Input2.Label, {
|
|
1900
1939
|
srOnly: true
|
|
1901
|
-
}, t("display name input label")), /* @__PURE__ */
|
|
1940
|
+
}, t("display name input label")), /* @__PURE__ */ React29.createElement(Input2.TextInput, {
|
|
1902
1941
|
variant: "subdued",
|
|
1903
1942
|
"data-testid": "display-name-input",
|
|
1904
1943
|
placeholder: t("display name input placeholder"),
|
|
@@ -1909,51 +1948,61 @@ var IdentityHeading = ({ titleId, title, identity, onDone, onUpdateProfile, conn
|
|
|
1909
1948
|
...identity.profile,
|
|
1910
1949
|
displayName: value
|
|
1911
1950
|
})
|
|
1912
|
-
})), /* @__PURE__ */
|
|
1951
|
+
})), /* @__PURE__ */ React29.createElement(Toolbar3.Root, {
|
|
1913
1952
|
classNames: "flex justify-center items-center gap-1 pt-3"
|
|
1914
|
-
}, /* @__PURE__ */
|
|
1953
|
+
}, /* @__PURE__ */ React29.createElement(EmojiPickerToolbarButton, {
|
|
1915
1954
|
emoji,
|
|
1916
1955
|
onChangeEmoji: setEmoji,
|
|
1917
1956
|
classNames: "bs-[--rail-action]"
|
|
1918
|
-
}), /* @__PURE__ */
|
|
1957
|
+
}), /* @__PURE__ */ React29.createElement(HuePickerToolbarButton, {
|
|
1919
1958
|
hue,
|
|
1920
1959
|
onChangeHue: setHue,
|
|
1921
1960
|
classNames: "bs-[--rail-action]"
|
|
1922
|
-
}),
|
|
1961
|
+
}), /* @__PURE__ */ React29.createElement(Tooltip7.Root, null, /* @__PURE__ */ React29.createElement(Tooltip7.Trigger, {
|
|
1923
1962
|
asChild: true
|
|
1924
|
-
}, /* @__PURE__ */
|
|
1963
|
+
}, /* @__PURE__ */ React29.createElement(Toolbar3.Button, {
|
|
1925
1964
|
classNames: "bs-[--rail-action]",
|
|
1926
1965
|
"data-testid": "update-profile-form-copy-key",
|
|
1927
1966
|
onClick: () => setTextValue(identityHex)
|
|
1928
|
-
}, /* @__PURE__ */
|
|
1967
|
+
}, /* @__PURE__ */ React29.createElement("span", {
|
|
1929
1968
|
className: "sr-only"
|
|
1930
|
-
}, t(
|
|
1969
|
+
}, t(publicKeyCopied ? "copy success label" : "copy self public key label")), /* @__PURE__ */ React29.createElement(Key, {
|
|
1970
|
+
className: getSize13(5)
|
|
1971
|
+
}))), /* @__PURE__ */ React29.createElement(Tooltip7.Portal, null, /* @__PURE__ */ React29.createElement(Tooltip7.Content, {
|
|
1972
|
+
side: "bottom",
|
|
1973
|
+
classNames: "z-50"
|
|
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, {
|
|
1931
1980
|
className: getSize13(5)
|
|
1932
|
-
}))), /* @__PURE__ */
|
|
1981
|
+
}))), /* @__PURE__ */ React29.createElement(Tooltip7.Portal, null, /* @__PURE__ */ React29.createElement(Tooltip7.Content, {
|
|
1933
1982
|
side: "bottom",
|
|
1934
1983
|
classNames: "z-50"
|
|
1935
|
-
}, t(
|
|
1984
|
+
}, t("create recovery code label"), /* @__PURE__ */ React29.createElement(Tooltip7.Arrow, null)))), /* @__PURE__ */ React29.createElement(Tooltip7.Root, null, /* @__PURE__ */ React29.createElement(Tooltip7.Trigger, {
|
|
1936
1985
|
asChild: true
|
|
1937
|
-
}, /* @__PURE__ */
|
|
1986
|
+
}, /* @__PURE__ */ React29.createElement(Toolbar3.Button, {
|
|
1938
1987
|
classNames: [
|
|
1939
1988
|
"bs-[--rail-action]",
|
|
1940
1989
|
!isConnected && "text-error-500"
|
|
1941
1990
|
],
|
|
1942
1991
|
onClick: () => onChangeConnectionState?.(isConnected ? ConnectionState2.OFFLINE : ConnectionState2.ONLINE)
|
|
1943
|
-
}, /* @__PURE__ */
|
|
1992
|
+
}, /* @__PURE__ */ React29.createElement("span", {
|
|
1944
1993
|
className: "sr-only"
|
|
1945
|
-
}, t(isConnected ? "disconnect label" : "connect label")), isConnected ? /* @__PURE__ */
|
|
1994
|
+
}, t(isConnected ? "disconnect label" : "connect label")), isConnected ? /* @__PURE__ */ React29.createElement(PlugsConnected, {
|
|
1946
1995
|
className: getSize13(5)
|
|
1947
|
-
}) : /* @__PURE__ */
|
|
1996
|
+
}) : /* @__PURE__ */ React29.createElement(Plugs, {
|
|
1948
1997
|
className: getSize13(5)
|
|
1949
|
-
}))), /* @__PURE__ */
|
|
1998
|
+
}))), /* @__PURE__ */ React29.createElement(Tooltip7.Portal, null, /* @__PURE__ */ React29.createElement(Tooltip7.Content, {
|
|
1950
1999
|
side: "bottom",
|
|
1951
2000
|
classNames: "z-50"
|
|
1952
|
-
}, t(isConnected ? "disconnect label" : "connect label"), /* @__PURE__ */
|
|
2001
|
+
}, t(isConnected ? "disconnect label" : "connect label"), /* @__PURE__ */ React29.createElement(Tooltip7.Arrow, null)))))));
|
|
1953
2002
|
};
|
|
1954
2003
|
var IdentityPanelImpl = (props) => {
|
|
1955
|
-
const { identity, titleId, activeView, onUpdateProfile, onResetStorage, onJoinNewIdentity, IdentityActionChooser: IdentityActionChooserComponent = IdentityActionChooser, InvitationManager: InvitationManagerComponent = InvitationManager, connectionState, onChangeConnectionState, onDone, ...rest } = props;
|
|
1956
|
-
const { t } =
|
|
2004
|
+
const { identity, titleId, activeView, onUpdateProfile, onResetStorage, onRecover, onJoinNewIdentity, IdentityActionChooser: IdentityActionChooserComponent = IdentityActionChooser, InvitationManager: InvitationManagerComponent = InvitationManager, connectionState, onChangeConnectionState, onDone, ...rest } = props;
|
|
2005
|
+
const { t } = useTranslation14("os");
|
|
1957
2006
|
const title = useMemo3(() => {
|
|
1958
2007
|
switch (activeView) {
|
|
1959
2008
|
case "device invitation manager":
|
|
@@ -1966,7 +2015,7 @@ var IdentityPanelImpl = (props) => {
|
|
|
1966
2015
|
t
|
|
1967
2016
|
]);
|
|
1968
2017
|
const onCancelReset = () => rest.send?.("unchooseAction");
|
|
1969
|
-
return /* @__PURE__ */
|
|
2018
|
+
return /* @__PURE__ */ React29.createElement(React29.Fragment, null, /* @__PURE__ */ React29.createElement(IdentityHeading, {
|
|
1970
2019
|
identity,
|
|
1971
2020
|
titleId,
|
|
1972
2021
|
title,
|
|
@@ -1974,35 +2023,44 @@ var IdentityPanelImpl = (props) => {
|
|
|
1974
2023
|
onUpdateProfile,
|
|
1975
2024
|
connectionState,
|
|
1976
2025
|
onChangeConnectionState
|
|
1977
|
-
}), /* @__PURE__ */
|
|
2026
|
+
}), /* @__PURE__ */ React29.createElement(Viewport.Root, {
|
|
1978
2027
|
activeView
|
|
1979
|
-
}, /* @__PURE__ */
|
|
2028
|
+
}, /* @__PURE__ */ React29.createElement(Viewport.Views, null, /* @__PURE__ */ React29.createElement(Viewport.View, {
|
|
1980
2029
|
id: "identity action chooser",
|
|
1981
2030
|
classNames: viewStyles
|
|
1982
|
-
}, /* @__PURE__ */
|
|
2031
|
+
}, /* @__PURE__ */ React29.createElement(IdentityActionChooserComponent, {
|
|
1983
2032
|
active: activeView === "identity action chooser",
|
|
1984
2033
|
...rest,
|
|
1985
2034
|
connectionState
|
|
1986
|
-
})), /* @__PURE__ */
|
|
2035
|
+
})), /* @__PURE__ */ React29.createElement(Viewport.View, {
|
|
1987
2036
|
id: "device invitation manager",
|
|
1988
2037
|
classNames: viewStyles
|
|
1989
|
-
}, /* @__PURE__ */
|
|
2038
|
+
}, /* @__PURE__ */ React29.createElement(InvitationManagerComponent, {
|
|
1990
2039
|
active: activeView === "device invitation manager",
|
|
1991
2040
|
...rest,
|
|
1992
2041
|
invitationUrl: rest.createInvitationUrl(rest.invitationCode)
|
|
1993
|
-
})), /* @__PURE__ */
|
|
2042
|
+
})), /* @__PURE__ */ React29.createElement(Viewport.View, {
|
|
1994
2043
|
classNames: viewStyles,
|
|
1995
2044
|
id: "confirm join new identity"
|
|
1996
|
-
}, /* @__PURE__ */
|
|
2045
|
+
}, /* @__PURE__ */ React29.createElement(ConfirmReset, {
|
|
1997
2046
|
active: activeView === "confirm join new identity",
|
|
1998
2047
|
...rest,
|
|
1999
2048
|
mode: "join new identity",
|
|
2000
2049
|
onConfirm: onJoinNewIdentity,
|
|
2001
2050
|
onCancel: onCancelReset
|
|
2002
|
-
})), /* @__PURE__ */
|
|
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
|
|
2060
|
+
})), /* @__PURE__ */ React29.createElement(Viewport.View, {
|
|
2003
2061
|
classNames: viewStyles,
|
|
2004
2062
|
id: "confirm reset storage"
|
|
2005
|
-
}, /* @__PURE__ */
|
|
2063
|
+
}, /* @__PURE__ */ React29.createElement(ConfirmReset, {
|
|
2006
2064
|
active: activeView === "confirm reset storage",
|
|
2007
2065
|
...rest,
|
|
2008
2066
|
mode: "reset storage",
|
|
@@ -2012,7 +2070,7 @@ var IdentityPanelImpl = (props) => {
|
|
|
2012
2070
|
};
|
|
2013
2071
|
var IdentityPanelWithInvitationImpl = ({ invitation, ...props }) => {
|
|
2014
2072
|
const invitationStatus = useInvitationStatus2(invitation);
|
|
2015
|
-
return /* @__PURE__ */
|
|
2073
|
+
return /* @__PURE__ */ React29.createElement(IdentityPanelImpl, {
|
|
2016
2074
|
...props,
|
|
2017
2075
|
...invitationStatus
|
|
2018
2076
|
});
|
|
@@ -2028,9 +2086,9 @@ var IdentityPanel = ({ titleId: propsTitleId, createInvitationUrl = (code) => co
|
|
|
2028
2086
|
invitations
|
|
2029
2087
|
});
|
|
2030
2088
|
if (!identity) {
|
|
2031
|
-
|
|
2089
|
+
log6.error("IdentityPanel rendered with no active identity.", void 0, {
|
|
2032
2090
|
F: __dxlog_file6,
|
|
2033
|
-
L:
|
|
2091
|
+
L: 278,
|
|
2034
2092
|
S: void 0,
|
|
2035
2093
|
C: (f, a) => f(...a)
|
|
2036
2094
|
});
|
|
@@ -2045,9 +2103,9 @@ var IdentityPanel = ({ titleId: propsTitleId, createInvitationUrl = (code) => co
|
|
|
2045
2103
|
const handleChangeConnectionState = async (nextState) => client?.mesh.updateConfig(nextState);
|
|
2046
2104
|
useEffect4(() => {
|
|
2047
2105
|
const subscription = identityService.subscribe((state) => {
|
|
2048
|
-
|
|
2106
|
+
log6("[state]", state, {
|
|
2049
2107
|
F: __dxlog_file6,
|
|
2050
|
-
L:
|
|
2108
|
+
L: 291,
|
|
2051
2109
|
S: void 0,
|
|
2052
2110
|
C: (f, a) => f(...a)
|
|
2053
2111
|
});
|
|
@@ -2064,6 +2122,8 @@ var IdentityPanel = ({ titleId: propsTitleId, createInvitationUrl = (code) => co
|
|
|
2064
2122
|
return "device invitation manager";
|
|
2065
2123
|
case identityState.matches("confirmingResetStorage"):
|
|
2066
2124
|
return "confirm reset storage";
|
|
2125
|
+
case identityState.matches("confirmingRecover"):
|
|
2126
|
+
return "confirm recover";
|
|
2067
2127
|
case identityState.matches("confirmingJoinNewIdentity"):
|
|
2068
2128
|
return "confirm join new identity";
|
|
2069
2129
|
default:
|
|
@@ -2091,40 +2151,40 @@ var IdentityPanel = ({ titleId: propsTitleId, createInvitationUrl = (code) => co
|
|
|
2091
2151
|
onChangeConnectionState: handleChangeConnectionState,
|
|
2092
2152
|
...agentProps
|
|
2093
2153
|
};
|
|
2094
|
-
return identityState.context.invitation ? /* @__PURE__ */
|
|
2154
|
+
return identityState.context.invitation ? /* @__PURE__ */ React29.createElement(IdentityPanelWithInvitationImpl, {
|
|
2095
2155
|
...implProps,
|
|
2096
2156
|
invitation: identityState.context.invitation
|
|
2097
|
-
}) : /* @__PURE__ */
|
|
2157
|
+
}) : /* @__PURE__ */ React29.createElement(IdentityPanelImpl, implProps);
|
|
2098
2158
|
};
|
|
2099
2159
|
|
|
2100
2160
|
// packages/sdk/shell/src/panels/JoinPanel/JoinPanel.tsx
|
|
2101
|
-
import
|
|
2102
|
-
import { log as
|
|
2161
|
+
import React38, { useCallback as useCallback6, useEffect as useEffect6, useMemo as useMemo4 } from "react";
|
|
2162
|
+
import { log as log10 } from "@dxos/log";
|
|
2103
2163
|
import { useClient as useClient8, useMulticastObservable } from "@dxos/react-client";
|
|
2104
2164
|
import { useIdentity as useIdentity2 } from "@dxos/react-client/halo";
|
|
2105
2165
|
import { useId as useId8, useThemeContext as useThemeContext5 } from "@dxos/react-ui";
|
|
2106
2166
|
|
|
2107
2167
|
// packages/sdk/shell/src/panels/JoinPanel/JoinHeading.tsx
|
|
2108
2168
|
import { X as X4 } from "@phosphor-icons/react";
|
|
2109
|
-
import
|
|
2110
|
-
import { Button as Button10, useTranslation as
|
|
2169
|
+
import React30, { cloneElement, forwardRef as forwardRef9 } from "react";
|
|
2170
|
+
import { Button as Button10, useTranslation as useTranslation15 } from "@dxos/react-ui";
|
|
2111
2171
|
import { descriptionText as descriptionText9, getSize as getSize14, mx as mx22 } from "@dxos/react-ui-theme";
|
|
2112
2172
|
var JoinHeading = /* @__PURE__ */ forwardRef9(({ mode, titleId, exitActionParent, onExit }, forwardedRef) => {
|
|
2113
|
-
const { t } =
|
|
2114
|
-
const exitButton = /* @__PURE__ */
|
|
2173
|
+
const { t } = useTranslation15("os");
|
|
2174
|
+
const exitButton = /* @__PURE__ */ React30.createElement(Button10, {
|
|
2115
2175
|
variant: "ghost",
|
|
2116
2176
|
...onExit && {
|
|
2117
2177
|
onClick: onExit
|
|
2118
2178
|
},
|
|
2119
2179
|
classNames: mx22(descriptionText9, "plb-0 pli-2 absolute block-start-0 inline-end-0 z-[1]"),
|
|
2120
2180
|
"data-testid": "join-exit"
|
|
2121
|
-
}, /* @__PURE__ */
|
|
2181
|
+
}, /* @__PURE__ */ React30.createElement(X4, {
|
|
2122
2182
|
weight: "bold",
|
|
2123
2183
|
className: getSize14(4)
|
|
2124
|
-
}), /* @__PURE__ */
|
|
2184
|
+
}), /* @__PURE__ */ React30.createElement("span", {
|
|
2125
2185
|
className: "sr-only"
|
|
2126
2186
|
}, t("exit label")));
|
|
2127
|
-
return /* @__PURE__ */
|
|
2187
|
+
return /* @__PURE__ */ React30.createElement(Heading, {
|
|
2128
2188
|
ref: forwardedRef,
|
|
2129
2189
|
titleId,
|
|
2130
2190
|
title: t(mode === "halo-only" ? "selecting identity heading" : "joining space heading"),
|
|
@@ -2141,12 +2201,12 @@ var JoinHeading = /* @__PURE__ */ forwardRef9(({ mode, titleId, exitActionParent
|
|
|
2141
2201
|
import { useMachine as useMachine2 } from "@xstate/react";
|
|
2142
2202
|
import { useCallback as useCallback5 } from "react";
|
|
2143
2203
|
import { assign as assign2, createMachine as createMachine2 } from "xstate";
|
|
2144
|
-
import { log as
|
|
2204
|
+
import { log as log7 } from "@dxos/log";
|
|
2145
2205
|
import { AlreadyJoinedError } from "@dxos/react-client";
|
|
2146
2206
|
import { Invitation as Invitation5, InvitationEncoder as InvitationEncoder3 } from "@dxos/react-client/invitations";
|
|
2147
2207
|
var __dxlog_file7 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/JoinPanel/joinMachine.ts";
|
|
2148
2208
|
var getInvitationSubscribable = (Kind, invitation) => {
|
|
2149
|
-
|
|
2209
|
+
log7("[subscribing to invitation]", invitation, {
|
|
2150
2210
|
F: __dxlog_file7,
|
|
2151
2211
|
L: 90,
|
|
2152
2212
|
S: void 0,
|
|
@@ -2156,7 +2216,7 @@ var getInvitationSubscribable = (Kind, invitation) => {
|
|
|
2156
2216
|
subscribe: (next, onError, complete) => invitation.subscribe((invitation2) => {
|
|
2157
2217
|
switch (invitation2.state) {
|
|
2158
2218
|
case Invitation5.State.CONNECTING: {
|
|
2159
|
-
|
|
2219
|
+
log7("[invitation connecting]", {
|
|
2160
2220
|
Kind,
|
|
2161
2221
|
invitation: invitation2
|
|
2162
2222
|
}, {
|
|
@@ -2171,7 +2231,7 @@ var getInvitationSubscribable = (Kind, invitation) => {
|
|
|
2171
2231
|
});
|
|
2172
2232
|
}
|
|
2173
2233
|
case Invitation5.State.CONNECTED: {
|
|
2174
|
-
|
|
2234
|
+
log7("[invitation connected]", {
|
|
2175
2235
|
Kind,
|
|
2176
2236
|
invitation: invitation2
|
|
2177
2237
|
}, {
|
|
@@ -2186,7 +2246,7 @@ var getInvitationSubscribable = (Kind, invitation) => {
|
|
|
2186
2246
|
});
|
|
2187
2247
|
}
|
|
2188
2248
|
case Invitation5.State.READY_FOR_AUTHENTICATION: {
|
|
2189
|
-
|
|
2249
|
+
log7("[invitation ready for authentication]", {
|
|
2190
2250
|
Kind,
|
|
2191
2251
|
invitation: invitation2
|
|
2192
2252
|
}, {
|
|
@@ -2201,7 +2261,7 @@ var getInvitationSubscribable = (Kind, invitation) => {
|
|
|
2201
2261
|
});
|
|
2202
2262
|
}
|
|
2203
2263
|
case Invitation5.State.AUTHENTICATING: {
|
|
2204
|
-
|
|
2264
|
+
log7("[invitation authenticating]", {
|
|
2205
2265
|
Kind,
|
|
2206
2266
|
invitation: invitation2
|
|
2207
2267
|
}, {
|
|
@@ -2216,7 +2276,7 @@ var getInvitationSubscribable = (Kind, invitation) => {
|
|
|
2216
2276
|
});
|
|
2217
2277
|
}
|
|
2218
2278
|
case Invitation5.State.SUCCESS: {
|
|
2219
|
-
|
|
2279
|
+
log7("[invitation success]", {
|
|
2220
2280
|
Kind,
|
|
2221
2281
|
invitation: invitation2
|
|
2222
2282
|
}, {
|
|
@@ -2232,7 +2292,7 @@ var getInvitationSubscribable = (Kind, invitation) => {
|
|
|
2232
2292
|
return complete?.();
|
|
2233
2293
|
}
|
|
2234
2294
|
case Invitation5.State.CANCELLED: {
|
|
2235
|
-
|
|
2295
|
+
log7.warn("[invitation cancelled]", {
|
|
2236
2296
|
Kind
|
|
2237
2297
|
}, {
|
|
2238
2298
|
F: __dxlog_file7,
|
|
@@ -2246,7 +2306,7 @@ var getInvitationSubscribable = (Kind, invitation) => {
|
|
|
2246
2306
|
});
|
|
2247
2307
|
}
|
|
2248
2308
|
case Invitation5.State.TIMEOUT: {
|
|
2249
|
-
|
|
2309
|
+
log7.error("[invitation timeout]", {
|
|
2250
2310
|
Kind
|
|
2251
2311
|
}, {
|
|
2252
2312
|
F: __dxlog_file7,
|
|
@@ -2262,7 +2322,7 @@ var getInvitationSubscribable = (Kind, invitation) => {
|
|
|
2262
2322
|
}
|
|
2263
2323
|
}, (error) => {
|
|
2264
2324
|
if (error instanceof AlreadyJoinedError) {
|
|
2265
|
-
|
|
2325
|
+
log7("[already joined]", {
|
|
2266
2326
|
Kind,
|
|
2267
2327
|
error
|
|
2268
2328
|
}, {
|
|
@@ -2277,7 +2337,7 @@ var getInvitationSubscribable = (Kind, invitation) => {
|
|
|
2277
2337
|
});
|
|
2278
2338
|
return complete?.();
|
|
2279
2339
|
}
|
|
2280
|
-
|
|
2340
|
+
log7.error("[invitation errored]", {
|
|
2281
2341
|
Kind,
|
|
2282
2342
|
error
|
|
2283
2343
|
}, {
|
|
@@ -2474,6 +2534,11 @@ var joinMachine = createMachine2({
|
|
|
2474
2534
|
target: "#join.choosingIdentity.acceptingHaloInvitation",
|
|
2475
2535
|
actions: "log"
|
|
2476
2536
|
},
|
|
2537
|
+
{
|
|
2538
|
+
cond: "initiallyRecoveringIdentity",
|
|
2539
|
+
target: "#join.choosingIdentity.recoveringIdentity",
|
|
2540
|
+
actions: "log"
|
|
2541
|
+
},
|
|
2477
2542
|
{
|
|
2478
2543
|
cond: "noSelectedIdentity",
|
|
2479
2544
|
target: "choosingIdentity",
|
|
@@ -2559,6 +2624,7 @@ var joinMachine = createMachine2({
|
|
|
2559
2624
|
existingIdentity: ({ identity, mode }, _event) => mode === "halo-only" && !!identity,
|
|
2560
2625
|
noSelectedIdentity: ({ identity }, _event) => !identity,
|
|
2561
2626
|
initiallyAcceptingHaloInvitation: ({ identity, initialDisposition }, _event) => !identity && initialDisposition === "accept-halo-invitation",
|
|
2627
|
+
initiallyRecoveringIdentity: ({ identity, initialDisposition }, _event) => !identity && initialDisposition === "recover-identity",
|
|
2562
2628
|
hasHaloUnredeemedCode: ({ halo }, _event) => !!halo.unredeemedCode,
|
|
2563
2629
|
noSpaceInvitation: ({ space }, _event) => !space.invitation && !space.unredeemedCode
|
|
2564
2630
|
},
|
|
@@ -2610,13 +2676,13 @@ var joinMachine = createMachine2({
|
|
|
2610
2676
|
} : context.space
|
|
2611
2677
|
}),
|
|
2612
2678
|
log: (context, event) => {
|
|
2613
|
-
|
|
2679
|
+
log7("[transition]", {
|
|
2614
2680
|
event,
|
|
2615
2681
|
haloInvitation: context.halo.invitation,
|
|
2616
2682
|
spaceInvitation: context.space.invitation
|
|
2617
2683
|
}, {
|
|
2618
2684
|
F: __dxlog_file7,
|
|
2619
|
-
L:
|
|
2685
|
+
L: 425,
|
|
2620
2686
|
S: void 0,
|
|
2621
2687
|
C: (f, a) => f(...a)
|
|
2622
2688
|
});
|
|
@@ -2628,9 +2694,9 @@ var defaultCodeFromUrl = (invitationType, text) => {
|
|
|
2628
2694
|
const searchParams = new URLSearchParams(text.substring(text.lastIndexOf("?")));
|
|
2629
2695
|
return searchParams.get(`${invitationType}InvitationCode`) ?? searchParams.get(`${invitationType}Invitation`) ?? searchParams.get("invitationCode") ?? searchParams.get("invitation") ?? text;
|
|
2630
2696
|
} catch (err) {
|
|
2631
|
-
|
|
2697
|
+
log7.catch(err, void 0, {
|
|
2632
2698
|
F: __dxlog_file7,
|
|
2633
|
-
L:
|
|
2699
|
+
L: 452,
|
|
2634
2700
|
S: void 0,
|
|
2635
2701
|
C: (f, a) => f(...a)
|
|
2636
2702
|
});
|
|
@@ -2649,9 +2715,9 @@ var useJoinMachine = (client, options) => {
|
|
|
2649
2715
|
invitationSubscribable: getInvitationSubscribable("Halo", invitationObservable)
|
|
2650
2716
|
};
|
|
2651
2717
|
} catch (err) {
|
|
2652
|
-
|
|
2718
|
+
log7.error("Could not redeem device invitation code", err, {
|
|
2653
2719
|
F: __dxlog_file7,
|
|
2654
|
-
L:
|
|
2720
|
+
L: 473,
|
|
2655
2721
|
S: void 0,
|
|
2656
2722
|
C: (f, a) => f(...a)
|
|
2657
2723
|
});
|
|
@@ -2674,9 +2740,9 @@ var useJoinMachine = (client, options) => {
|
|
|
2674
2740
|
invitationSubscribable: getInvitationSubscribable("Space", invitationObservable)
|
|
2675
2741
|
};
|
|
2676
2742
|
} catch (err) {
|
|
2677
|
-
|
|
2743
|
+
log7.error("Could not redeem space invitation code", err, {
|
|
2678
2744
|
F: __dxlog_file7,
|
|
2679
|
-
L:
|
|
2745
|
+
L: 495,
|
|
2680
2746
|
S: void 0,
|
|
2681
2747
|
C: (f, a) => f(...a)
|
|
2682
2748
|
});
|
|
@@ -2736,16 +2802,16 @@ var useJoinMachine = (client, options) => {
|
|
|
2736
2802
|
|
|
2737
2803
|
// packages/sdk/shell/src/panels/JoinPanel/steps/AdditionMethodChooser.tsx
|
|
2738
2804
|
import { CaretRight as CaretRight2, Plus as Plus3, QrCode, Textbox } from "@phosphor-icons/react";
|
|
2739
|
-
import
|
|
2740
|
-
import { useTranslation as
|
|
2805
|
+
import React31 from "react";
|
|
2806
|
+
import { useTranslation as useTranslation16 } from "@dxos/react-ui";
|
|
2741
2807
|
import { getSize as getSize15 } from "@dxos/react-ui-theme";
|
|
2742
2808
|
var AdditionMethodChooser = (viewStateProps) => {
|
|
2743
2809
|
const disabled = !viewStateProps.active;
|
|
2744
2810
|
const { send } = viewStateProps;
|
|
2745
|
-
const { t } =
|
|
2811
|
+
const { t } = useTranslation16("os");
|
|
2746
2812
|
const sharedButtonProps = {
|
|
2747
2813
|
disabled,
|
|
2748
|
-
after: /* @__PURE__ */
|
|
2814
|
+
after: /* @__PURE__ */ React31.createElement(CaretRight2, {
|
|
2749
2815
|
className: getSize15(4),
|
|
2750
2816
|
weight: "bold"
|
|
2751
2817
|
}),
|
|
@@ -2755,13 +2821,13 @@ var AdditionMethodChooser = (viewStateProps) => {
|
|
|
2755
2821
|
}
|
|
2756
2822
|
}
|
|
2757
2823
|
};
|
|
2758
|
-
return /* @__PURE__ */
|
|
2824
|
+
return /* @__PURE__ */ React31.createElement(React31.Fragment, null, /* @__PURE__ */ React31.createElement(StepHeading, null, t("addition method chooser title")), /* @__PURE__ */ React31.createElement("div", {
|
|
2759
2825
|
role: "none",
|
|
2760
2826
|
className: "flex flex-col gap-1 grow"
|
|
2761
|
-
}, /* @__PURE__ */
|
|
2827
|
+
}, /* @__PURE__ */ React31.createElement(CompoundButton, {
|
|
2762
2828
|
...sharedButtonProps,
|
|
2763
2829
|
description: t("create identity description"),
|
|
2764
|
-
before: /* @__PURE__ */
|
|
2830
|
+
before: /* @__PURE__ */ React31.createElement(Plus3, {
|
|
2765
2831
|
className: getSize15(6)
|
|
2766
2832
|
}),
|
|
2767
2833
|
onClick: () => send({
|
|
@@ -2769,22 +2835,20 @@ var AdditionMethodChooser = (viewStateProps) => {
|
|
|
2769
2835
|
}),
|
|
2770
2836
|
"data-autofocus": "choosingAuthMethod",
|
|
2771
2837
|
"data-testid": "identity-chooser.create-identity"
|
|
2772
|
-
}, t("create identity label")), /* @__PURE__ */
|
|
2838
|
+
}, t("create identity label")), /* @__PURE__ */ React31.createElement(CompoundButton, {
|
|
2773
2839
|
...sharedButtonProps,
|
|
2774
2840
|
description: t("join identity description"),
|
|
2775
|
-
before: /* @__PURE__ */
|
|
2841
|
+
before: /* @__PURE__ */ React31.createElement(QrCode, {
|
|
2776
2842
|
className: getSize15(6)
|
|
2777
2843
|
}),
|
|
2778
2844
|
onClick: () => send({
|
|
2779
2845
|
type: "acceptHaloInvitation"
|
|
2780
2846
|
}),
|
|
2781
2847
|
"data-testid": "identity-chooser.join-identity"
|
|
2782
|
-
}, t("join identity label")), /* @__PURE__ */
|
|
2848
|
+
}, t("join identity label")), /* @__PURE__ */ React31.createElement(CompoundButton, {
|
|
2783
2849
|
...sharedButtonProps,
|
|
2784
|
-
// TODO(mykola): Implement recover.
|
|
2785
|
-
disabled: true,
|
|
2786
2850
|
description: t("recover identity description"),
|
|
2787
|
-
before: /* @__PURE__ */
|
|
2851
|
+
before: /* @__PURE__ */ React31.createElement(Textbox, {
|
|
2788
2852
|
className: getSize15(6)
|
|
2789
2853
|
}),
|
|
2790
2854
|
onClick: () => send({
|
|
@@ -2795,39 +2859,39 @@ var AdditionMethodChooser = (viewStateProps) => {
|
|
|
2795
2859
|
};
|
|
2796
2860
|
|
|
2797
2861
|
// packages/sdk/shell/src/panels/JoinPanel/steps/IdentityAdded.tsx
|
|
2798
|
-
import
|
|
2862
|
+
import React32, { cloneElement as cloneElement2 } from "react";
|
|
2799
2863
|
import { generateName as generateName4 } from "@dxos/display-name";
|
|
2800
|
-
import { Avatar as Avatar7, useId as useId7, useTranslation as
|
|
2864
|
+
import { Avatar as Avatar7, useId as useId7, useTranslation as useTranslation17 } from "@dxos/react-ui";
|
|
2801
2865
|
import { mx as mx23 } from "@dxos/react-ui-theme";
|
|
2802
2866
|
import { hexToFallback } from "@dxos/util";
|
|
2803
2867
|
var IdentityAdded = (props) => {
|
|
2804
2868
|
const { mode, addedIdentity, active, send, onDone, doneActionParent } = props;
|
|
2805
2869
|
const disabled = !active;
|
|
2806
|
-
const { t } =
|
|
2870
|
+
const { t } = useTranslation17("os");
|
|
2807
2871
|
const addedIdentityHex = addedIdentity?.identityKey.toHex() ?? "0";
|
|
2808
2872
|
const fallbackValue = hexToFallback(addedIdentityHex);
|
|
2809
2873
|
const labelId = useId7("identityListItem__label");
|
|
2810
2874
|
const displayName = addedIdentity?.profile?.displayName ?? (addedIdentity && generateName4(addedIdentityHex));
|
|
2811
|
-
const doneAction = /* @__PURE__ */
|
|
2875
|
+
const doneAction = /* @__PURE__ */ React32.createElement(Action, {
|
|
2812
2876
|
...onDone && {
|
|
2813
2877
|
onClick: () => onDone(null)
|
|
2814
2878
|
},
|
|
2815
2879
|
disabled,
|
|
2816
2880
|
"data-autofocus": "confirmingAddedIdentity",
|
|
2817
2881
|
"data-testid": "identity-added-done"
|
|
2818
|
-
}, /* @__PURE__ */
|
|
2819
|
-
return /* @__PURE__ */
|
|
2882
|
+
}, /* @__PURE__ */ React32.createElement("span", null, t("done label")));
|
|
2883
|
+
return /* @__PURE__ */ React32.createElement(React32.Fragment, null, /* @__PURE__ */ React32.createElement(StepHeading, null, t("identity added label")), /* @__PURE__ */ React32.createElement("div", {
|
|
2820
2884
|
role: "none",
|
|
2821
2885
|
className: "grow flex flex-col items-center justify-center text-center gap-2"
|
|
2822
|
-
}, /* @__PURE__ */
|
|
2886
|
+
}, /* @__PURE__ */ React32.createElement(Avatar7.Root, {
|
|
2823
2887
|
status: "active",
|
|
2824
2888
|
labelId,
|
|
2825
2889
|
hue: addedIdentity?.profile?.data?.hue || fallbackValue.hue
|
|
2826
|
-
}, /* @__PURE__ */
|
|
2890
|
+
}, /* @__PURE__ */ React32.createElement(Avatar7.Frame, null, /* @__PURE__ */ React32.createElement(Avatar7.Fallback, {
|
|
2827
2891
|
text: addedIdentity?.profile?.data?.emoji || fallbackValue.emoji
|
|
2828
|
-
})), /* @__PURE__ */
|
|
2892
|
+
})), /* @__PURE__ */ React32.createElement(Avatar7.Label, {
|
|
2829
2893
|
classNames: mx23("text-lg truncate", !addedIdentity?.profile?.displayName && "font-mono")
|
|
2830
|
-
}, displayName))), /* @__PURE__ */
|
|
2894
|
+
}, displayName))), /* @__PURE__ */ React32.createElement(Actions, null, mode === "halo-only" ? doneActionParent ? /* @__PURE__ */ cloneElement2(doneActionParent, {}, doneAction) : doneAction : /* @__PURE__ */ React32.createElement(Action, {
|
|
2831
2895
|
variant: "primary",
|
|
2832
2896
|
disabled: disabled || !addedIdentity,
|
|
2833
2897
|
onClick: () => addedIdentity && send({
|
|
@@ -2839,36 +2903,55 @@ var IdentityAdded = (props) => {
|
|
|
2839
2903
|
};
|
|
2840
2904
|
|
|
2841
2905
|
// packages/sdk/shell/src/panels/JoinPanel/steps/IdentityInput.tsx
|
|
2842
|
-
import
|
|
2843
|
-
import { log as
|
|
2906
|
+
import React33, { useState as useState10 } from "react";
|
|
2907
|
+
import { log as log8 } from "@dxos/log";
|
|
2844
2908
|
import { useClient as useClient7 } from "@dxos/react-client";
|
|
2845
|
-
import { useTranslation as
|
|
2909
|
+
import { useTranslation as useTranslation18 } from "@dxos/react-ui";
|
|
2846
2910
|
var __dxlog_file8 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/JoinPanel/steps/IdentityInput.tsx";
|
|
2847
2911
|
var IdentityInput = (props) => {
|
|
2848
2912
|
const { send, method } = props;
|
|
2849
2913
|
const isRecover = method === "recover identity";
|
|
2850
2914
|
const client = useClient7();
|
|
2851
|
-
const { t } =
|
|
2852
|
-
const [validationMessage, setValidationMessage] =
|
|
2853
|
-
const createIdentity = (
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
|
|
2915
|
+
const { t } = useTranslation18("os");
|
|
2916
|
+
const [validationMessage, setValidationMessage] = useState10("");
|
|
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"));
|
|
2860
2934
|
});
|
|
2861
|
-
}
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
|
|
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"));
|
|
2867
2951
|
});
|
|
2868
|
-
|
|
2869
|
-
});
|
|
2952
|
+
}
|
|
2870
2953
|
};
|
|
2871
|
-
return /* @__PURE__ */
|
|
2954
|
+
return /* @__PURE__ */ React33.createElement(IdentityInputImpl, {
|
|
2872
2955
|
...props,
|
|
2873
2956
|
onDisplayNameConfirm: createIdentity,
|
|
2874
2957
|
validationMessage
|
|
@@ -2877,27 +2960,27 @@ var IdentityInput = (props) => {
|
|
|
2877
2960
|
var IdentityInputImpl = (props) => {
|
|
2878
2961
|
const { method, send, active, onDisplayNameConfirm, validationMessage } = props;
|
|
2879
2962
|
const disabled = !active;
|
|
2880
|
-
const { t } =
|
|
2881
|
-
const [inputValue, setInputValue] =
|
|
2963
|
+
const { t } = useTranslation18("os");
|
|
2964
|
+
const [inputValue, setInputValue] = useState10("");
|
|
2882
2965
|
const isRecover = method === "recover identity";
|
|
2883
|
-
return /* @__PURE__ */
|
|
2966
|
+
return /* @__PURE__ */ React33.createElement(React33.Fragment, null, /* @__PURE__ */ React33.createElement("div", {
|
|
2884
2967
|
role: "none",
|
|
2885
2968
|
className: "grow flex flex-col justify-center"
|
|
2886
|
-
}, /* @__PURE__ */
|
|
2969
|
+
}, /* @__PURE__ */ React33.createElement(Input, {
|
|
2887
2970
|
validationMessage,
|
|
2888
|
-
label: /* @__PURE__ */
|
|
2971
|
+
label: /* @__PURE__ */ React33.createElement(StepHeading, null, t(isRecover ? "recover identity input label" : "new identity input label")),
|
|
2889
2972
|
disabled,
|
|
2890
2973
|
"data-testid": "identity-input",
|
|
2891
2974
|
placeholder: isRecover ? "Type your recovery phrase" : "Type a display name",
|
|
2892
2975
|
onChange: ({ target: { value } }) => setInputValue(value)
|
|
2893
|
-
})), /* @__PURE__ */
|
|
2976
|
+
})), /* @__PURE__ */ React33.createElement(Actions, null, /* @__PURE__ */ React33.createElement(Action, {
|
|
2894
2977
|
variant: "ghost",
|
|
2895
2978
|
disabled,
|
|
2896
2979
|
onClick: () => send?.({
|
|
2897
2980
|
type: "deselectAuthMethod"
|
|
2898
2981
|
}),
|
|
2899
2982
|
"data-testid": `${method === "recover identity" ? "recover" : "create"}-identity-input-back`
|
|
2900
|
-
}, t("back label")), /* @__PURE__ */
|
|
2983
|
+
}, t("back label")), /* @__PURE__ */ React33.createElement(Action, {
|
|
2901
2984
|
variant: "primary",
|
|
2902
2985
|
disabled,
|
|
2903
2986
|
onClick: () => onDisplayNameConfirm?.(inputValue),
|
|
@@ -2905,10 +2988,14 @@ var IdentityInputImpl = (props) => {
|
|
|
2905
2988
|
}, t("continue label"))));
|
|
2906
2989
|
};
|
|
2907
2990
|
|
|
2991
|
+
// packages/sdk/shell/src/panels/JoinPanel/steps/InvitationAccepted.tsx
|
|
2992
|
+
import React34, { cloneElement as cloneElement3 } from "react";
|
|
2993
|
+
import { useTranslation as useTranslation19 } from "@dxos/react-ui";
|
|
2994
|
+
|
|
2908
2995
|
// packages/sdk/shell/src/panels/JoinPanel/steps/InvitationInput.tsx
|
|
2909
|
-
import
|
|
2910
|
-
import { log as
|
|
2911
|
-
import { useTranslation as
|
|
2996
|
+
import React35, { useState as useState11, useEffect as useEffect5, cloneElement as cloneElement4 } from "react";
|
|
2997
|
+
import { log as log9 } from "@dxos/log";
|
|
2998
|
+
import { useTranslation as useTranslation20 } from "@dxos/react-ui";
|
|
2912
2999
|
var __dxlog_file9 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/JoinPanel/steps/InvitationInput.tsx";
|
|
2913
3000
|
var invitationCodeFromUrl = (text) => {
|
|
2914
3001
|
try {
|
|
@@ -2916,7 +3003,7 @@ var invitationCodeFromUrl = (text) => {
|
|
|
2916
3003
|
const invitation = searchParams.get("spaceInvitationCode") ?? searchParams.get("deviceInvitationCode");
|
|
2917
3004
|
return invitation ?? text;
|
|
2918
3005
|
} catch (err) {
|
|
2919
|
-
|
|
3006
|
+
log9.catch(err, void 0, {
|
|
2920
3007
|
F: __dxlog_file9,
|
|
2921
3008
|
L: 25,
|
|
2922
3009
|
S: void 0,
|
|
@@ -2928,8 +3015,8 @@ var invitationCodeFromUrl = (text) => {
|
|
|
2928
3015
|
var InvitationInput = (props) => {
|
|
2929
3016
|
const { Kind, active, send, unredeemedCode, onExit, exitActionParent, onDone, doneActionParent, succeededKeys } = props;
|
|
2930
3017
|
const disabled = !active;
|
|
2931
|
-
const { t } =
|
|
2932
|
-
const [inputValue, setInputValue] =
|
|
3018
|
+
const { t } = useTranslation20("os");
|
|
3019
|
+
const [inputValue, setInputValue] = useState11(unredeemedCode ?? "");
|
|
2933
3020
|
useEffect5(() => {
|
|
2934
3021
|
unredeemedCode && setInputValue(unredeemedCode ?? "");
|
|
2935
3022
|
}, [
|
|
@@ -2947,7 +3034,7 @@ var InvitationInput = (props) => {
|
|
|
2947
3034
|
}
|
|
2948
3035
|
});
|
|
2949
3036
|
};
|
|
2950
|
-
const exitAction = /* @__PURE__ */
|
|
3037
|
+
const exitAction = /* @__PURE__ */ React35.createElement(Action, {
|
|
2951
3038
|
variant: "ghost",
|
|
2952
3039
|
disabled,
|
|
2953
3040
|
...onExit ? {
|
|
@@ -2957,11 +3044,11 @@ var InvitationInput = (props) => {
|
|
|
2957
3044
|
},
|
|
2958
3045
|
"data-testid": "join-exit"
|
|
2959
3046
|
}, t("cancel label"));
|
|
2960
|
-
return /* @__PURE__ */
|
|
3047
|
+
return /* @__PURE__ */ React35.createElement(React35.Fragment, null, /* @__PURE__ */ React35.createElement("div", {
|
|
2961
3048
|
role: "none",
|
|
2962
3049
|
className: "grow flex flex-col justify-center"
|
|
2963
|
-
}, /* @__PURE__ */
|
|
2964
|
-
label: /* @__PURE__ */
|
|
3050
|
+
}, /* @__PURE__ */ React35.createElement(Input, {
|
|
3051
|
+
label: /* @__PURE__ */ React35.createElement(StepHeading, null, t("invitation input label")),
|
|
2965
3052
|
// TODO(burdon): Translation.
|
|
2966
3053
|
placeholder: "Type an invitation code",
|
|
2967
3054
|
disabled,
|
|
@@ -2970,7 +3057,7 @@ var InvitationInput = (props) => {
|
|
|
2970
3057
|
"data-autofocus": `inputting${Kind}InvitationCode`,
|
|
2971
3058
|
"data-testid": `${Kind.toLowerCase()}-invitation-input`,
|
|
2972
3059
|
onKeyUp: ({ key }) => key === "Enter" && handleNext()
|
|
2973
|
-
})), /* @__PURE__ */
|
|
3060
|
+
})), /* @__PURE__ */ React35.createElement(Actions, null, Kind === "Halo" ? null : exitActionParent ? /* @__PURE__ */ cloneElement4(exitActionParent, {}, exitAction) : doneActionParent ? /* @__PURE__ */ cloneElement4(doneActionParent, {}, exitAction) : exitAction, /* @__PURE__ */ React35.createElement(Action, {
|
|
2974
3061
|
variant: "primary",
|
|
2975
3062
|
disabled: disabled || inputValue.trim().length === 0,
|
|
2976
3063
|
onClick: handleNext,
|
|
@@ -2979,8 +3066,8 @@ var InvitationInput = (props) => {
|
|
|
2979
3066
|
};
|
|
2980
3067
|
|
|
2981
3068
|
// packages/sdk/shell/src/panels/JoinPanel/steps/InvitationRescuer.tsx
|
|
2982
|
-
import
|
|
2983
|
-
import { useTranslation as
|
|
3069
|
+
import React36 from "react";
|
|
3070
|
+
import { useTranslation as useTranslation21 } from "@dxos/react-ui";
|
|
2984
3071
|
import { descriptionText as descriptionText10 } from "@dxos/react-ui-theme";
|
|
2985
3072
|
var InvitationActions = ({
|
|
2986
3073
|
// `invitationState` does report correct state, but here we evaluate whether `failReason` is a better source of truth
|
|
@@ -2992,14 +3079,14 @@ var InvitationActions = ({
|
|
|
2992
3079
|
Kind,
|
|
2993
3080
|
failReason
|
|
2994
3081
|
}) => {
|
|
2995
|
-
const { t } =
|
|
3082
|
+
const { t } = useTranslation21("os");
|
|
2996
3083
|
if (failReason) {
|
|
2997
|
-
return /* @__PURE__ */
|
|
3084
|
+
return /* @__PURE__ */ React36.createElement(React36.Fragment, null, /* @__PURE__ */ React36.createElement(StepHeading, {
|
|
2998
3085
|
className: descriptionText10
|
|
2999
|
-
}, t(failReason === "timeout" ? "timeout status label" : failReason === "cancelled" ? "cancelled status label" : "error status label")), /* @__PURE__ */
|
|
3086
|
+
}, t(failReason === "timeout" ? "timeout status label" : failReason === "cancelled" ? "cancelled status label" : "error status label")), /* @__PURE__ */ React36.createElement("div", {
|
|
3000
3087
|
role: "none",
|
|
3001
3088
|
className: "grow"
|
|
3002
|
-
}), /* @__PURE__ */
|
|
3089
|
+
}), /* @__PURE__ */ React36.createElement(Actions, null, /* @__PURE__ */ React36.createElement(Action, {
|
|
3003
3090
|
disabled: !active,
|
|
3004
3091
|
onClick: () => send({
|
|
3005
3092
|
type: `reset${Kind}Invitation`
|
|
@@ -3007,16 +3094,16 @@ var InvitationActions = ({
|
|
|
3007
3094
|
"data-testid": "invitation-rescuer-reset"
|
|
3008
3095
|
}, t("reset label"))));
|
|
3009
3096
|
} else {
|
|
3010
|
-
return /* @__PURE__ */
|
|
3097
|
+
return /* @__PURE__ */ React36.createElement(React36.Fragment, null, /* @__PURE__ */ React36.createElement(StepHeading, {
|
|
3011
3098
|
className: descriptionText10
|
|
3012
|
-
}, t("connecting status label")), /* @__PURE__ */
|
|
3099
|
+
}, t("connecting status label")), /* @__PURE__ */ React36.createElement("div", {
|
|
3013
3100
|
role: "none",
|
|
3014
3101
|
className: "grow"
|
|
3015
|
-
}), /* @__PURE__ */
|
|
3102
|
+
}), /* @__PURE__ */ React36.createElement(Actions, null, /* @__PURE__ */ React36.createElement(Action, {
|
|
3016
3103
|
disabled: true,
|
|
3017
3104
|
classNames: "order-2",
|
|
3018
3105
|
"data-testid": "next"
|
|
3019
|
-
}, t("next label")), /* @__PURE__ */
|
|
3106
|
+
}, t("next label")), /* @__PURE__ */ React36.createElement(Action, {
|
|
3020
3107
|
disabled: !active,
|
|
3021
3108
|
onClick: onInvitationCancel,
|
|
3022
3109
|
"data-testid": "invitation-rescuer-cancel"
|
|
@@ -3025,52 +3112,52 @@ var InvitationActions = ({
|
|
|
3025
3112
|
};
|
|
3026
3113
|
var InvitationRescuer = (props) => {
|
|
3027
3114
|
const { Kind, invitationState, active, send } = props;
|
|
3028
|
-
const { t } =
|
|
3029
|
-
return /* @__PURE__ */
|
|
3115
|
+
const { t } = useTranslation21("os");
|
|
3116
|
+
return /* @__PURE__ */ React36.createElement(React36.Fragment, null, typeof invitationState === "undefined" ? /* @__PURE__ */ React36.createElement(React36.Fragment, null, /* @__PURE__ */ React36.createElement("div", {
|
|
3030
3117
|
role: "none",
|
|
3031
3118
|
className: "grow flex flex-col justify-center"
|
|
3032
|
-
}, /* @__PURE__ */
|
|
3119
|
+
}, /* @__PURE__ */ React36.createElement(StepHeading, {
|
|
3033
3120
|
className: descriptionText10
|
|
3034
|
-
}, "There was a problem joining the space")), /* @__PURE__ */
|
|
3121
|
+
}, "There was a problem joining the space")), /* @__PURE__ */ React36.createElement(Actions, null, /* @__PURE__ */ React36.createElement(Action, {
|
|
3035
3122
|
disabled: !active,
|
|
3036
3123
|
"data-testid": "invitation-rescuer-blank-reset",
|
|
3037
3124
|
onClick: () => send({
|
|
3038
3125
|
type: `reset${Kind}Invitation`
|
|
3039
3126
|
})
|
|
3040
|
-
}, t("reset label")))) : /* @__PURE__ */
|
|
3127
|
+
}, t("reset label")))) : /* @__PURE__ */ React36.createElement(InvitationActions, props));
|
|
3041
3128
|
};
|
|
3042
3129
|
|
|
3043
3130
|
// packages/sdk/shell/src/panels/JoinPanel/steps/InvitationAuthenticator.tsx
|
|
3044
|
-
import
|
|
3131
|
+
import React37, { useState as useState12 } from "react";
|
|
3045
3132
|
import { Invitation as Invitation6 } from "@dxos/react-client/invitations";
|
|
3046
|
-
import { Input as Input3, useTranslation as
|
|
3133
|
+
import { Input as Input3, useTranslation as useTranslation22 } from "@dxos/react-ui";
|
|
3047
3134
|
import { descriptionText as descriptionText11 } from "@dxos/react-ui-theme";
|
|
3048
|
-
import { hexToEmoji as
|
|
3135
|
+
import { hexToEmoji as hexToEmoji5 } from "@dxos/util";
|
|
3049
3136
|
var pinLength = 6;
|
|
3050
3137
|
var InvitationAuthenticator = ({ failed, Kind, authMethod, active, pending, invitationId, onInvitationAuthenticate, onInvitationCancel }) => {
|
|
3051
3138
|
const disabled = !active || pending;
|
|
3052
|
-
const { t } =
|
|
3139
|
+
const { t } = useTranslation22("os");
|
|
3053
3140
|
const invitationType = Kind.toLowerCase();
|
|
3054
|
-
const [authCode, setAuthCode] =
|
|
3141
|
+
const [authCode, setAuthCode] = useState12("");
|
|
3055
3142
|
const onChange = ({ target: { value } }) => {
|
|
3056
3143
|
setAuthCode(value);
|
|
3057
3144
|
if (value.length === pinLength) {
|
|
3058
3145
|
document.querySelector(`[data-autofocus-pinlength="${invitationType}"]`)?.focus();
|
|
3059
3146
|
}
|
|
3060
3147
|
};
|
|
3061
|
-
return /* @__PURE__ */
|
|
3148
|
+
return /* @__PURE__ */ React37.createElement(React37.Fragment, null, /* @__PURE__ */ React37.createElement("div", {
|
|
3062
3149
|
role: "none",
|
|
3063
3150
|
className: "grow flex flex-col justify-center gap-4"
|
|
3064
|
-
}, /* @__PURE__ */
|
|
3151
|
+
}, /* @__PURE__ */ React37.createElement(Input3.Root, failed && {
|
|
3065
3152
|
validationValence: "error"
|
|
3066
|
-
}, /* @__PURE__ */
|
|
3153
|
+
}, /* @__PURE__ */ React37.createElement(Input3.Label, {
|
|
3067
3154
|
asChild: true
|
|
3068
|
-
}, authMethod === Invitation6.AuthMethod.SHARED_SECRET ? /* @__PURE__ */
|
|
3155
|
+
}, authMethod === Invitation6.AuthMethod.SHARED_SECRET ? /* @__PURE__ */ React37.createElement(StepHeading, null, t("auth code input label")) : /* @__PURE__ */ React37.createElement(React37.Fragment, null, /* @__PURE__ */ React37.createElement(StepHeading, {
|
|
3069
3156
|
className: descriptionText11
|
|
3070
|
-
}, t("authenticating label")), /* @__PURE__ */
|
|
3157
|
+
}, t("authenticating label")), /* @__PURE__ */ React37.createElement("div", {
|
|
3071
3158
|
role: "none",
|
|
3072
3159
|
className: "grow"
|
|
3073
|
-
}))), authMethod === Invitation6.AuthMethod.SHARED_SECRET && /* @__PURE__ */
|
|
3160
|
+
}))), authMethod === Invitation6.AuthMethod.SHARED_SECRET && /* @__PURE__ */ React37.createElement(Input3.PinInput, {
|
|
3074
3161
|
disabled,
|
|
3075
3162
|
length: pinLength,
|
|
3076
3163
|
onChange,
|
|
@@ -3081,18 +3168,18 @@ var InvitationAuthenticator = ({ failed, Kind, authMethod, active, pending, invi
|
|
|
3081
3168
|
"data-prevent-ios-autofocus": true,
|
|
3082
3169
|
"data-testid": `${invitationType}-auth-code-input`,
|
|
3083
3170
|
"data-1p-ignore": true
|
|
3084
|
-
}), failed && /* @__PURE__ */
|
|
3171
|
+
}), failed && /* @__PURE__ */ React37.createElement(Input3.DescriptionAndValidation, {
|
|
3085
3172
|
classNames: "text-center"
|
|
3086
|
-
}, /* @__PURE__ */
|
|
3173
|
+
}, /* @__PURE__ */ React37.createElement(Input3.Validation, null, t("failed to authenticate message")))), invitationId && authMethod === Invitation6.AuthMethod.SHARED_SECRET && /* @__PURE__ */ React37.createElement(React37.Fragment, null, /* @__PURE__ */ React37.createElement(Label, null, t("auth other device emoji message")), /* @__PURE__ */ React37.createElement("div", {
|
|
3087
3174
|
className: "flex justify-center"
|
|
3088
|
-
}, /* @__PURE__ */
|
|
3089
|
-
text:
|
|
3090
|
-
})))), /* @__PURE__ */
|
|
3175
|
+
}, /* @__PURE__ */ React37.createElement(Emoji, {
|
|
3176
|
+
text: hexToEmoji5(invitationId)
|
|
3177
|
+
})))), /* @__PURE__ */ React37.createElement(Actions, null, /* @__PURE__ */ React37.createElement(Action, {
|
|
3091
3178
|
variant: "ghost",
|
|
3092
3179
|
disabled,
|
|
3093
3180
|
onClick: () => onInvitationCancel?.(),
|
|
3094
3181
|
"data-testid": `${invitationType}-invitation-authenticator-cancel`
|
|
3095
|
-
}, t("cancel label")), /* @__PURE__ */
|
|
3182
|
+
}, t("cancel label")), /* @__PURE__ */ React37.createElement(Action, {
|
|
3096
3183
|
variant: "primary",
|
|
3097
3184
|
disabled,
|
|
3098
3185
|
onClick: () => onInvitationAuthenticate?.(authCode),
|
|
@@ -3154,46 +3241,46 @@ var JoinPanelImpl = (props) => {
|
|
|
3154
3241
|
IdentityInput: IdentityInputComponent = IdentityInput,
|
|
3155
3242
|
ConfirmReset: ConfirmResetComponent = ConfirmReset
|
|
3156
3243
|
} = props;
|
|
3157
|
-
return /* @__PURE__ */
|
|
3244
|
+
return /* @__PURE__ */ React38.createElement(React38.Fragment, null, mode !== "halo-only" && /* @__PURE__ */ React38.createElement(JoinHeading, {
|
|
3158
3245
|
titleId,
|
|
3159
3246
|
mode,
|
|
3160
3247
|
onExit,
|
|
3161
3248
|
exitActionParent
|
|
3162
|
-
}), /* @__PURE__ */
|
|
3249
|
+
}), /* @__PURE__ */ React38.createElement(Viewport.Root, {
|
|
3163
3250
|
focusManaged: true,
|
|
3164
3251
|
activeView
|
|
3165
|
-
}, /* @__PURE__ */
|
|
3252
|
+
}, /* @__PURE__ */ React38.createElement(Viewport.Views, null, /* @__PURE__ */ React38.createElement(Viewport.View, {
|
|
3166
3253
|
classNames: stepStyles,
|
|
3167
3254
|
id: "addition method chooser"
|
|
3168
|
-
}, /* @__PURE__ */
|
|
3255
|
+
}, /* @__PURE__ */ React38.createElement(AdditionMethodChooser, {
|
|
3169
3256
|
send,
|
|
3170
3257
|
active: activeView === "addition method chooser"
|
|
3171
|
-
})), /* @__PURE__ */
|
|
3258
|
+
})), /* @__PURE__ */ React38.createElement(Viewport.View, {
|
|
3172
3259
|
classNames: stepStyles,
|
|
3173
3260
|
id: "reset storage confirmation"
|
|
3174
|
-
}, /* @__PURE__ */
|
|
3261
|
+
}, /* @__PURE__ */ React38.createElement(ConfirmResetComponent, {
|
|
3175
3262
|
send,
|
|
3176
3263
|
active: activeView === "reset storage confirmation",
|
|
3177
3264
|
onCancel: onCancelResetStorage,
|
|
3178
3265
|
onConfirm: onConfirmResetStorage
|
|
3179
|
-
})), /* @__PURE__ */
|
|
3266
|
+
})), /* @__PURE__ */ React38.createElement(Viewport.View, {
|
|
3180
3267
|
classNames: stepStyles,
|
|
3181
3268
|
id: "create identity input"
|
|
3182
|
-
}, /* @__PURE__ */
|
|
3269
|
+
}, /* @__PURE__ */ React38.createElement(IdentityInputComponent, {
|
|
3183
3270
|
send,
|
|
3184
3271
|
method: "create identity",
|
|
3185
3272
|
active: activeView === "create identity input"
|
|
3186
|
-
})), /* @__PURE__ */
|
|
3273
|
+
})), /* @__PURE__ */ React38.createElement(Viewport.View, {
|
|
3187
3274
|
classNames: stepStyles,
|
|
3188
3275
|
id: "recover identity input"
|
|
3189
|
-
}, /* @__PURE__ */
|
|
3276
|
+
}, /* @__PURE__ */ React38.createElement(IdentityInputComponent, {
|
|
3190
3277
|
send,
|
|
3191
3278
|
method: "recover identity",
|
|
3192
3279
|
active: activeView === "recover identity input"
|
|
3193
|
-
})), /* @__PURE__ */
|
|
3280
|
+
})), /* @__PURE__ */ React38.createElement(Viewport.View, {
|
|
3194
3281
|
classNames: stepStyles,
|
|
3195
3282
|
id: "halo invitation input"
|
|
3196
|
-
}, /* @__PURE__ */
|
|
3283
|
+
}, /* @__PURE__ */ React38.createElement(InvitationInput, {
|
|
3197
3284
|
send,
|
|
3198
3285
|
Kind: "Halo",
|
|
3199
3286
|
active: activeView === "halo invitation input",
|
|
@@ -3203,20 +3290,20 @@ var JoinPanelImpl = (props) => {
|
|
|
3203
3290
|
...succeededKeys?.Halo && {
|
|
3204
3291
|
succeededKeys: succeededKeys.Halo
|
|
3205
3292
|
}
|
|
3206
|
-
})), /* @__PURE__ */
|
|
3293
|
+
})), /* @__PURE__ */ React38.createElement(Viewport.View, {
|
|
3207
3294
|
classNames: stepStyles,
|
|
3208
3295
|
id: "halo invitation rescuer"
|
|
3209
|
-
}, /* @__PURE__ */
|
|
3296
|
+
}, /* @__PURE__ */ React38.createElement(InvitationRescuer, {
|
|
3210
3297
|
send,
|
|
3211
3298
|
Kind: "Halo",
|
|
3212
3299
|
active: activeView === "halo invitation rescuer",
|
|
3213
3300
|
invitationState: invitationStates?.Halo,
|
|
3214
3301
|
onInvitationCancel: onHaloInvitationCancel,
|
|
3215
3302
|
failReason: failReasons?.Halo
|
|
3216
|
-
})), /* @__PURE__ */
|
|
3303
|
+
})), /* @__PURE__ */ React38.createElement(Viewport.View, {
|
|
3217
3304
|
classNames: stepStyles,
|
|
3218
3305
|
id: "halo invitation authenticator"
|
|
3219
|
-
}, /* @__PURE__ */
|
|
3306
|
+
}, /* @__PURE__ */ React38.createElement(InvitationAuthenticator, {
|
|
3220
3307
|
send,
|
|
3221
3308
|
Kind: "Halo",
|
|
3222
3309
|
invitationId: invitationIds?.Halo,
|
|
@@ -3227,19 +3314,19 @@ var JoinPanelImpl = (props) => {
|
|
|
3227
3314
|
...failed.has("Halo") && {
|
|
3228
3315
|
failed: true
|
|
3229
3316
|
}
|
|
3230
|
-
})), /* @__PURE__ */
|
|
3317
|
+
})), /* @__PURE__ */ React38.createElement(Viewport.View, {
|
|
3231
3318
|
classNames: stepStyles,
|
|
3232
3319
|
id: "identity added"
|
|
3233
|
-
}, /* @__PURE__ */
|
|
3320
|
+
}, /* @__PURE__ */ React38.createElement(IdentityAdded, {
|
|
3234
3321
|
send,
|
|
3235
3322
|
mode,
|
|
3236
3323
|
active: activeView === "identity added",
|
|
3237
3324
|
doneActionParent,
|
|
3238
3325
|
onDone: onHaloDone
|
|
3239
|
-
})), /* @__PURE__ */
|
|
3326
|
+
})), /* @__PURE__ */ React38.createElement(Viewport.View, {
|
|
3240
3327
|
classNames: stepStyles,
|
|
3241
3328
|
id: "space invitation input"
|
|
3242
|
-
}, /* @__PURE__ */
|
|
3329
|
+
}, /* @__PURE__ */ React38.createElement(InvitationInput, {
|
|
3243
3330
|
send,
|
|
3244
3331
|
Kind: "Space",
|
|
3245
3332
|
active: activeView === "space invitation input",
|
|
@@ -3251,20 +3338,20 @@ var JoinPanelImpl = (props) => {
|
|
|
3251
3338
|
},
|
|
3252
3339
|
onExit,
|
|
3253
3340
|
exitActionParent
|
|
3254
|
-
})), /* @__PURE__ */
|
|
3341
|
+
})), /* @__PURE__ */ React38.createElement(Viewport.View, {
|
|
3255
3342
|
classNames: stepStyles,
|
|
3256
3343
|
id: "space invitation rescuer"
|
|
3257
|
-
}, /* @__PURE__ */
|
|
3344
|
+
}, /* @__PURE__ */ React38.createElement(InvitationRescuer, {
|
|
3258
3345
|
send,
|
|
3259
3346
|
Kind: "Space",
|
|
3260
3347
|
active: activeView === "space invitation rescuer",
|
|
3261
3348
|
invitationState: invitationStates?.Space,
|
|
3262
3349
|
onInvitationCancel: onSpaceInvitationCancel,
|
|
3263
3350
|
failReason: failReasons?.Space
|
|
3264
|
-
})), /* @__PURE__ */
|
|
3351
|
+
})), /* @__PURE__ */ React38.createElement(Viewport.View, {
|
|
3265
3352
|
classNames: stepStyles,
|
|
3266
3353
|
id: "space invitation authenticator"
|
|
3267
|
-
}, /* @__PURE__ */
|
|
3354
|
+
}, /* @__PURE__ */ React38.createElement(InvitationAuthenticator, {
|
|
3268
3355
|
send,
|
|
3269
3356
|
Kind: "Space",
|
|
3270
3357
|
invitationId: invitationIds?.Space,
|
|
@@ -3296,7 +3383,7 @@ var JoinPanel = ({ titleId: propsTitleId, mode = "default", initialDisposition =
|
|
|
3296
3383
|
});
|
|
3297
3384
|
useEffect6(() => {
|
|
3298
3385
|
const subscription = joinService.subscribe((state) => {
|
|
3299
|
-
|
|
3386
|
+
log10("[state]", state, {
|
|
3300
3387
|
F: __dxlog_file10,
|
|
3301
3388
|
L: 210,
|
|
3302
3389
|
S: void 0,
|
|
@@ -3542,7 +3629,7 @@ var JoinPanel = ({ titleId: propsTitleId, mode = "default", initialDisposition =
|
|
|
3542
3629
|
client,
|
|
3543
3630
|
joinSend
|
|
3544
3631
|
]);
|
|
3545
|
-
return /* @__PURE__ */
|
|
3632
|
+
return /* @__PURE__ */ React38.createElement(JoinPanelImpl, {
|
|
3546
3633
|
titleId,
|
|
3547
3634
|
mode,
|
|
3548
3635
|
send: joinSend,
|
|
@@ -3585,15 +3672,15 @@ var JoinPanel = ({ titleId: propsTitleId, mode = "default", initialDisposition =
|
|
|
3585
3672
|
|
|
3586
3673
|
// packages/sdk/shell/src/panels/SpacePanel/SpacePanel.tsx
|
|
3587
3674
|
import { Planet } from "@phosphor-icons/react";
|
|
3588
|
-
import
|
|
3589
|
-
import { log as
|
|
3675
|
+
import React40, { useEffect as useEffect7, useMemo as useMemo5 } from "react";
|
|
3676
|
+
import { log as log13 } from "@dxos/log";
|
|
3590
3677
|
import { useInvitationStatus as useInvitationStatus3 } from "@dxos/react-client/invitations";
|
|
3591
|
-
import { useId as useId9, useTranslation as
|
|
3678
|
+
import { useId as useId9, useTranslation as useTranslation24 } from "@dxos/react-ui";
|
|
3592
3679
|
|
|
3593
3680
|
// packages/sdk/shell/src/panels/SpacePanel/spaceMachine.ts
|
|
3594
3681
|
import { useMachine as useMachine3 } from "@xstate/react";
|
|
3595
3682
|
import { assign as assign3, createMachine as createMachine3 } from "xstate";
|
|
3596
|
-
import { log as
|
|
3683
|
+
import { log as log11 } from "@dxos/log";
|
|
3597
3684
|
var __dxlog_file11 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/SpacePanel/spaceMachine.ts";
|
|
3598
3685
|
var spaceMachine = createMachine3({
|
|
3599
3686
|
id: "space",
|
|
@@ -3631,7 +3718,7 @@ var spaceMachine = createMachine3({
|
|
|
3631
3718
|
invitation: () => void 0
|
|
3632
3719
|
}),
|
|
3633
3720
|
log: (context, event) => {
|
|
3634
|
-
|
|
3721
|
+
log11("[transition]", {
|
|
3635
3722
|
event,
|
|
3636
3723
|
context
|
|
3637
3724
|
}, {
|
|
@@ -3654,19 +3741,19 @@ var useSpaceMachine = (options) => {
|
|
|
3654
3741
|
|
|
3655
3742
|
// packages/sdk/shell/src/panels/SpacePanel/steps/SpaceManager.tsx
|
|
3656
3743
|
import { Placeholder as Placeholder2, UserPlus, UsersThree } from "@phosphor-icons/react";
|
|
3657
|
-
import
|
|
3658
|
-
import { log as
|
|
3744
|
+
import React39, { useCallback as useCallback7, useState as useState13 } from "react";
|
|
3745
|
+
import { log as log12 } from "@dxos/log";
|
|
3659
3746
|
import { useConfig } from "@dxos/react-client";
|
|
3660
3747
|
import { useSpaceInvitations as useSpaceInvitations2 } from "@dxos/react-client/echo";
|
|
3661
3748
|
import { Invitation as Invitation8, InvitationEncoder as InvitationEncoder4 } from "@dxos/react-client/invitations";
|
|
3662
|
-
import { ScrollArea, useTranslation as
|
|
3749
|
+
import { ScrollArea, useTranslation as useTranslation23 } from "@dxos/react-ui";
|
|
3663
3750
|
import { descriptionText as descriptionText12, mx as mx24 } from "@dxos/react-ui-theme";
|
|
3664
3751
|
var __dxlog_file12 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/SpacePanel/steps/SpaceManager.tsx";
|
|
3665
3752
|
var activeActionKey = "dxos:react-shell/space-manager/active-action";
|
|
3666
3753
|
var handleInvitationEvent = (invitation, subscription) => {
|
|
3667
3754
|
const invitationCode = InvitationEncoder4.encode(invitation);
|
|
3668
3755
|
if (invitation.state === Invitation8.State.CONNECTING) {
|
|
3669
|
-
|
|
3756
|
+
log12.info(JSON.stringify({
|
|
3670
3757
|
invitationCode,
|
|
3671
3758
|
authCode: invitation.authCode
|
|
3672
3759
|
}), void 0, {
|
|
@@ -3680,7 +3767,7 @@ var handleInvitationEvent = (invitation, subscription) => {
|
|
|
3680
3767
|
};
|
|
3681
3768
|
var SpaceManager = (props) => {
|
|
3682
3769
|
const { space, target } = props;
|
|
3683
|
-
const { t } =
|
|
3770
|
+
const { t } = useTranslation23("os");
|
|
3684
3771
|
const config = useConfig();
|
|
3685
3772
|
const invitations = useSpaceInvitations2(space?.key);
|
|
3686
3773
|
const inviteActions = {
|
|
@@ -3721,7 +3808,7 @@ var SpaceManager = (props) => {
|
|
|
3721
3808
|
])
|
|
3722
3809
|
}
|
|
3723
3810
|
};
|
|
3724
|
-
return /* @__PURE__ */
|
|
3811
|
+
return /* @__PURE__ */ React39.createElement(SpaceManagerImpl, {
|
|
3725
3812
|
...props,
|
|
3726
3813
|
invitations,
|
|
3727
3814
|
inviteActions
|
|
@@ -3730,7 +3817,7 @@ var SpaceManager = (props) => {
|
|
|
3730
3817
|
var headingFragment = "pis-3 pie-1 plb-1 mbe-1 font-medium";
|
|
3731
3818
|
var SpaceManagerImpl = (props) => {
|
|
3732
3819
|
const { active, space, createInvitationUrl, send, inviteActions: propsInviteActions, invitations, showInactiveInvitations, SpaceMemberList: SpaceMemberListComponent = SpaceMemberList, InvitationList: InvitationListComponent = InvitationList } = props;
|
|
3733
|
-
const { t } =
|
|
3820
|
+
const { t } = useTranslation23("os");
|
|
3734
3821
|
const inviteActions = propsInviteActions ?? {
|
|
3735
3822
|
noopInvite: {
|
|
3736
3823
|
label: t("create space invitation label"),
|
|
@@ -3740,7 +3827,7 @@ var SpaceManagerImpl = (props) => {
|
|
|
3740
3827
|
}
|
|
3741
3828
|
}
|
|
3742
3829
|
};
|
|
3743
|
-
const [activeAction, setInternalActiveAction] =
|
|
3830
|
+
const [activeAction, setInternalActiveAction] = useState13(localStorage.getItem(activeActionKey) ?? "inviteOne");
|
|
3744
3831
|
const setActiveAction = (nextAction) => {
|
|
3745
3832
|
setInternalActiveAction(nextAction);
|
|
3746
3833
|
localStorage.setItem(activeActionKey, nextAction);
|
|
@@ -3748,26 +3835,26 @@ var SpaceManagerImpl = (props) => {
|
|
|
3748
3835
|
const visibleInvitations = showInactiveInvitations ? invitations : invitations?.filter((invitation) => ![
|
|
3749
3836
|
Invitation8.State.CANCELLED
|
|
3750
3837
|
].includes(invitation.get().state));
|
|
3751
|
-
return /* @__PURE__ */
|
|
3838
|
+
return /* @__PURE__ */ React39.createElement(React39.Fragment, null, /* @__PURE__ */ React39.createElement(ScrollArea.Root, {
|
|
3752
3839
|
classNames: "grow shrink basis-28 -mli-2"
|
|
3753
|
-
}, /* @__PURE__ */
|
|
3840
|
+
}, /* @__PURE__ */ React39.createElement(ScrollArea.Viewport, {
|
|
3754
3841
|
classNames: "is-full pie-2"
|
|
3755
|
-
}, !!visibleInvitations?.length && /* @__PURE__ */
|
|
3842
|
+
}, !!visibleInvitations?.length && /* @__PURE__ */ React39.createElement(React39.Fragment, null, /* @__PURE__ */ React39.createElement("h3", {
|
|
3756
3843
|
className: mx24(headingFragment, descriptionText12)
|
|
3757
|
-
}, t("invitation list heading")), /* @__PURE__ */
|
|
3844
|
+
}, t("invitation list heading")), /* @__PURE__ */ React39.createElement(InvitationListComponent, {
|
|
3758
3845
|
className: "mb-2",
|
|
3759
3846
|
send,
|
|
3760
3847
|
invitations: visibleInvitations ?? [],
|
|
3761
3848
|
onClickRemove: (invitation) => invitation.cancel(),
|
|
3762
3849
|
createInvitationUrl
|
|
3763
|
-
}), /* @__PURE__ */
|
|
3850
|
+
}), /* @__PURE__ */ React39.createElement("h3", {
|
|
3764
3851
|
className: mx24(headingFragment, descriptionText12, "mbs-2")
|
|
3765
|
-
}, t("space member list heading"))), /* @__PURE__ */
|
|
3852
|
+
}, t("space member list heading"))), /* @__PURE__ */ React39.createElement(SpaceMemberListComponent, {
|
|
3766
3853
|
spaceKey: space.key,
|
|
3767
3854
|
includeSelf: true
|
|
3768
|
-
})), /* @__PURE__ */
|
|
3855
|
+
})), /* @__PURE__ */ React39.createElement(ScrollArea.Scrollbar, {
|
|
3769
3856
|
orientation: "vertical"
|
|
3770
|
-
}, /* @__PURE__ */
|
|
3857
|
+
}, /* @__PURE__ */ React39.createElement(ScrollArea.Thumb, null))), /* @__PURE__ */ React39.createElement(Actions, null, /* @__PURE__ */ React39.createElement(BifurcatedAction, {
|
|
3771
3858
|
disabled: !active,
|
|
3772
3859
|
actions: inviteActions,
|
|
3773
3860
|
activeAction,
|
|
@@ -3779,45 +3866,45 @@ var SpaceManagerImpl = (props) => {
|
|
|
3779
3866
|
// packages/sdk/shell/src/panels/SpacePanel/SpacePanel.tsx
|
|
3780
3867
|
var __dxlog_file13 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/SpacePanel/SpacePanel.tsx";
|
|
3781
3868
|
var SpacePanelHeading = ({ titleId, space, onDone }) => {
|
|
3782
|
-
const { t } =
|
|
3869
|
+
const { t } = useTranslation24("os");
|
|
3783
3870
|
const name = space.properties.name;
|
|
3784
|
-
return /* @__PURE__ */
|
|
3871
|
+
return /* @__PURE__ */ React40.createElement(Heading, {
|
|
3785
3872
|
titleId,
|
|
3786
3873
|
title: t("space panel heading"),
|
|
3787
|
-
corner: /* @__PURE__ */
|
|
3874
|
+
corner: /* @__PURE__ */ React40.createElement(CloseButton, {
|
|
3788
3875
|
"data-testid": "identity-panel-done",
|
|
3789
3876
|
onDone
|
|
3790
3877
|
})
|
|
3791
|
-
}, /* @__PURE__ */
|
|
3878
|
+
}, /* @__PURE__ */ React40.createElement("div", {
|
|
3792
3879
|
role: "none",
|
|
3793
3880
|
className: "flex gap-4 items-center justify-center mlb-4"
|
|
3794
|
-
}, /* @__PURE__ */
|
|
3881
|
+
}, /* @__PURE__ */ React40.createElement(Planet, {
|
|
3795
3882
|
size: 32,
|
|
3796
3883
|
weight: "light"
|
|
3797
|
-
}), /* @__PURE__ */
|
|
3884
|
+
}), /* @__PURE__ */ React40.createElement("div", {
|
|
3798
3885
|
className: "block text-start font-light text-xl"
|
|
3799
3886
|
}, name ?? space.key.truncate())));
|
|
3800
3887
|
};
|
|
3801
3888
|
var SpacePanelImpl = (props) => {
|
|
3802
3889
|
const { titleId, activeView, space, target, SpaceManager: SpaceManagerComponent = SpaceManager, InvitationManager: InvitationManagerComponent = InvitationManager, ...rest } = props;
|
|
3803
|
-
return /* @__PURE__ */
|
|
3890
|
+
return /* @__PURE__ */ React40.createElement(React40.Fragment, null, /* @__PURE__ */ React40.createElement(SpacePanelHeading, {
|
|
3804
3891
|
...rest,
|
|
3805
3892
|
titleId,
|
|
3806
3893
|
space
|
|
3807
|
-
}), /* @__PURE__ */
|
|
3894
|
+
}), /* @__PURE__ */ React40.createElement(Viewport.Root, {
|
|
3808
3895
|
activeView
|
|
3809
|
-
}, /* @__PURE__ */
|
|
3896
|
+
}, /* @__PURE__ */ React40.createElement(Viewport.Views, null, /* @__PURE__ */ React40.createElement(Viewport.View, {
|
|
3810
3897
|
id: "space manager",
|
|
3811
3898
|
classNames: stepStyles
|
|
3812
|
-
}, /* @__PURE__ */
|
|
3899
|
+
}, /* @__PURE__ */ React40.createElement(SpaceManagerComponent, {
|
|
3813
3900
|
active: activeView === "space manager",
|
|
3814
3901
|
space,
|
|
3815
3902
|
target,
|
|
3816
3903
|
...rest
|
|
3817
|
-
})), /* @__PURE__ */
|
|
3904
|
+
})), /* @__PURE__ */ React40.createElement(Viewport.View, {
|
|
3818
3905
|
id: "space invitation manager",
|
|
3819
3906
|
classNames: stepStyles
|
|
3820
|
-
}, /* @__PURE__ */
|
|
3907
|
+
}, /* @__PURE__ */ React40.createElement(InvitationManagerComponent, {
|
|
3821
3908
|
active: activeView === "space invitation manager",
|
|
3822
3909
|
...rest,
|
|
3823
3910
|
invitationUrl: props.invitationUrl
|
|
@@ -3825,7 +3912,7 @@ var SpacePanelImpl = (props) => {
|
|
|
3825
3912
|
};
|
|
3826
3913
|
var SpacePanelWithInvitationImpl = ({ invitation, ...props }) => {
|
|
3827
3914
|
const invitationStatus = useInvitationStatus3(invitation);
|
|
3828
|
-
return /* @__PURE__ */
|
|
3915
|
+
return /* @__PURE__ */ React40.createElement(SpacePanelImpl, {
|
|
3829
3916
|
...props,
|
|
3830
3917
|
...invitationStatus,
|
|
3831
3918
|
invitationUrl: props.createInvitationUrl(invitationStatus.invitationCode)
|
|
@@ -3840,7 +3927,7 @@ var SpacePanel = ({ titleId: propsTitleId, createInvitationUrl = (code) => code,
|
|
|
3840
3927
|
});
|
|
3841
3928
|
useEffect7(() => {
|
|
3842
3929
|
const subscription = spaceService.subscribe((state) => {
|
|
3843
|
-
|
|
3930
|
+
log13("[state]", state, {
|
|
3844
3931
|
F: __dxlog_file13,
|
|
3845
3932
|
L: 94,
|
|
3846
3933
|
S: void 0,
|
|
@@ -3872,24 +3959,24 @@ var SpacePanel = ({ titleId: propsTitleId, createInvitationUrl = (code) => code,
|
|
|
3872
3959
|
};
|
|
3873
3960
|
return spaceState.context.invitation ? (
|
|
3874
3961
|
// TODO(wittjosiah): Unused? Remove?
|
|
3875
|
-
/* @__PURE__ */
|
|
3962
|
+
/* @__PURE__ */ React40.createElement(SpacePanelWithInvitationImpl, {
|
|
3876
3963
|
...implProps,
|
|
3877
3964
|
invitation: spaceState.context.invitation
|
|
3878
3965
|
})
|
|
3879
|
-
) : /* @__PURE__ */
|
|
3966
|
+
) : /* @__PURE__ */ React40.createElement(SpacePanelImpl, implProps);
|
|
3880
3967
|
};
|
|
3881
3968
|
|
|
3882
3969
|
// packages/sdk/shell/src/panels/StatusPanel/StatusPanel.tsx
|
|
3883
|
-
import
|
|
3884
|
-
import { Status, useTranslation as
|
|
3970
|
+
import React41 from "react";
|
|
3971
|
+
import { Status, useTranslation as useTranslation25 } from "@dxos/react-ui";
|
|
3885
3972
|
var StatusPanel = ({ titleId }) => {
|
|
3886
|
-
const { t } =
|
|
3887
|
-
return /* @__PURE__ */
|
|
3973
|
+
const { t } = useTranslation25("os");
|
|
3974
|
+
return /* @__PURE__ */ React41.createElement("div", {
|
|
3888
3975
|
className: "grid place-items-center p-2 gap-2"
|
|
3889
|
-
}, /* @__PURE__ */
|
|
3976
|
+
}, /* @__PURE__ */ React41.createElement("p", {
|
|
3890
3977
|
id: titleId,
|
|
3891
3978
|
className: "font-medium text-center"
|
|
3892
|
-
}, t("resetting message")), /* @__PURE__ */
|
|
3979
|
+
}, t("resetting message")), /* @__PURE__ */ React41.createElement(Status, {
|
|
3893
3980
|
indeterminate: true
|
|
3894
3981
|
}, t("resetting message")));
|
|
3895
3982
|
};
|
|
@@ -3897,96 +3984,96 @@ var StatusPanel = ({ titleId }) => {
|
|
|
3897
3984
|
// packages/sdk/shell/src/composites/IdentityDialog/IdentityDialog.tsx
|
|
3898
3985
|
var IdentityDialog = (props) => {
|
|
3899
3986
|
const titleId = useId10("identityDialog__title", props.title);
|
|
3900
|
-
return /* @__PURE__ */
|
|
3987
|
+
return /* @__PURE__ */ React42.createElement(Dialog.Root, {
|
|
3901
3988
|
defaultOpen: true,
|
|
3902
3989
|
onOpenChange: (open) => open || props.onDone?.()
|
|
3903
|
-
}, /* @__PURE__ */
|
|
3990
|
+
}, /* @__PURE__ */ React42.createElement(Dialog.Portal, null, /* @__PURE__ */ React42.createElement(Dialog.Overlay, null, /* @__PURE__ */ React42.createElement(Dialog.Content, {
|
|
3904
3991
|
"aria-labelledby": titleId,
|
|
3905
3992
|
onOpenAutoFocus: (e) => e.preventDefault()
|
|
3906
|
-
}, /* @__PURE__ */
|
|
3993
|
+
}, /* @__PURE__ */ React42.createElement(ClipboardProvider, null, /* @__PURE__ */ React42.createElement(IdentityPanel, {
|
|
3907
3994
|
...props,
|
|
3908
3995
|
titleId,
|
|
3909
|
-
doneActionParent: /* @__PURE__ */
|
|
3996
|
+
doneActionParent: /* @__PURE__ */ React42.createElement(Dialog.Close, {
|
|
3910
3997
|
asChild: true
|
|
3911
3998
|
})
|
|
3912
3999
|
}))))));
|
|
3913
4000
|
};
|
|
3914
4001
|
|
|
3915
4002
|
// packages/sdk/shell/src/composites/JoinDialog/JoinDialog.tsx
|
|
3916
|
-
import
|
|
4003
|
+
import React43 from "react";
|
|
3917
4004
|
import { AlertDialog, useId as useId11, useVisualViewport } from "@dxos/react-ui";
|
|
3918
4005
|
var JoinDialog = (joinPanelProps) => {
|
|
3919
4006
|
const titleId = useId11("joinDialog__title");
|
|
3920
4007
|
const { height } = useVisualViewport();
|
|
3921
|
-
return /* @__PURE__ */
|
|
4008
|
+
return /* @__PURE__ */ React43.createElement(AlertDialog.Root, {
|
|
3922
4009
|
defaultOpen: true,
|
|
3923
4010
|
onOpenChange: (open) => open || (joinPanelProps.onExit ? joinPanelProps.onExit() : joinPanelProps.onDone?.(null))
|
|
3924
|
-
}, /* @__PURE__ */
|
|
4011
|
+
}, /* @__PURE__ */ React43.createElement(AlertDialog.Portal, null, /* @__PURE__ */ React43.createElement(AlertDialog.Overlay, {
|
|
3925
4012
|
classNames: "backdrop-blur",
|
|
3926
4013
|
...height && {
|
|
3927
4014
|
style: {
|
|
3928
4015
|
blockSize: `${height}px`
|
|
3929
4016
|
}
|
|
3930
4017
|
}
|
|
3931
|
-
}, /* @__PURE__ */
|
|
4018
|
+
}, /* @__PURE__ */ React43.createElement(AlertDialog.Content, {
|
|
3932
4019
|
"aria-labelledby": titleId
|
|
3933
|
-
}, /* @__PURE__ */
|
|
4020
|
+
}, /* @__PURE__ */ React43.createElement(JoinPanel, {
|
|
3934
4021
|
...joinPanelProps,
|
|
3935
4022
|
titleId,
|
|
3936
|
-
exitActionParent: /* @__PURE__ */
|
|
4023
|
+
exitActionParent: /* @__PURE__ */ React43.createElement(AlertDialog.Cancel, {
|
|
3937
4024
|
asChild: true
|
|
3938
4025
|
}),
|
|
3939
|
-
doneActionParent: /* @__PURE__ */
|
|
4026
|
+
doneActionParent: /* @__PURE__ */ React43.createElement(AlertDialog.Action, {
|
|
3940
4027
|
asChild: true
|
|
3941
4028
|
})
|
|
3942
4029
|
})))));
|
|
3943
4030
|
};
|
|
3944
4031
|
|
|
3945
4032
|
// packages/sdk/shell/src/composites/Shell/run-shell.tsx
|
|
3946
|
-
import
|
|
4033
|
+
import React47, { StrictMode } from "react";
|
|
3947
4034
|
import { createRoot } from "react-dom/client";
|
|
3948
4035
|
import { DEFAULT_CLIENT_CHANNEL, DEFAULT_SHELL_CHANNEL } from "@dxos/client-protocol";
|
|
3949
4036
|
import { AgentHostingProvider, ClientProvider, ClientServicesProxy, Config, ShellDisplay as ShellDisplay2 } from "@dxos/react-client";
|
|
3950
|
-
import { Button as Button11, Dialog as Dialog3, ThemeProvider, Tooltip as Tooltip8, useTranslation as
|
|
4037
|
+
import { Button as Button11, Dialog as Dialog3, ThemeProvider, Tooltip as Tooltip8, useTranslation as useTranslation26 } from "@dxos/react-ui";
|
|
3951
4038
|
import { defaultTx } from "@dxos/react-ui-theme";
|
|
3952
4039
|
import { createIFramePort } from "@dxos/rpc-tunnel";
|
|
3953
4040
|
|
|
3954
4041
|
// packages/sdk/shell/src/composites/Shell/Shell.tsx
|
|
3955
|
-
import
|
|
3956
|
-
import { log as
|
|
4042
|
+
import React46, { useEffect as useEffect8, useState as useState14 } from "react";
|
|
4043
|
+
import { log as log14 } from "@dxos/log";
|
|
3957
4044
|
import { useClient as useClient9 } from "@dxos/react-client";
|
|
3958
4045
|
import { ShellDisplay, ShellLayout } from "@dxos/react-client";
|
|
3959
4046
|
import { useSpace as useSpace2 } from "@dxos/react-client/echo";
|
|
3960
4047
|
|
|
3961
4048
|
// packages/sdk/shell/src/composites/SpaceDialog/SpaceDialog.tsx
|
|
3962
|
-
import
|
|
4049
|
+
import React44 from "react";
|
|
3963
4050
|
import { Dialog as Dialog2, useId as useId12 } from "@dxos/react-ui";
|
|
3964
4051
|
var SpaceDialog = (spacePanelProps) => {
|
|
3965
4052
|
const titleId = useId12("spaceDialog__title");
|
|
3966
|
-
return /* @__PURE__ */
|
|
4053
|
+
return /* @__PURE__ */ React44.createElement(Dialog2.Root, {
|
|
3967
4054
|
defaultOpen: true,
|
|
3968
4055
|
onOpenChange: (open) => open || spacePanelProps.onDone?.()
|
|
3969
|
-
}, /* @__PURE__ */
|
|
4056
|
+
}, /* @__PURE__ */ React44.createElement(Dialog2.Portal, null, /* @__PURE__ */ React44.createElement(Dialog2.Overlay, null, /* @__PURE__ */ React44.createElement(Dialog2.Content, {
|
|
3970
4057
|
"aria-labelledby": titleId
|
|
3971
|
-
}, /* @__PURE__ */
|
|
4058
|
+
}, /* @__PURE__ */ React44.createElement(ClipboardProvider, null, /* @__PURE__ */ React44.createElement(SpacePanel, {
|
|
3972
4059
|
...spacePanelProps,
|
|
3973
4060
|
titleId,
|
|
3974
|
-
doneActionParent: /* @__PURE__ */
|
|
4061
|
+
doneActionParent: /* @__PURE__ */ React44.createElement(Dialog2.Close, {
|
|
3975
4062
|
asChild: true
|
|
3976
4063
|
})
|
|
3977
4064
|
}))))));
|
|
3978
4065
|
};
|
|
3979
4066
|
|
|
3980
4067
|
// packages/sdk/shell/src/composites/StatusDialog/StatusDialog.tsx
|
|
3981
|
-
import
|
|
4068
|
+
import React45 from "react";
|
|
3982
4069
|
import { AlertDialog as AlertDialog2, useId as useId13 } from "@dxos/react-ui";
|
|
3983
4070
|
var StatusDialog = () => {
|
|
3984
4071
|
const titleId = useId13("statusDialog__title");
|
|
3985
|
-
return /* @__PURE__ */
|
|
4072
|
+
return /* @__PURE__ */ React45.createElement(AlertDialog2.Root, {
|
|
3986
4073
|
open: true
|
|
3987
|
-
}, /* @__PURE__ */
|
|
4074
|
+
}, /* @__PURE__ */ React45.createElement(AlertDialog2.Portal, null, /* @__PURE__ */ React45.createElement(AlertDialog2.Overlay, null, /* @__PURE__ */ React45.createElement(AlertDialog2.Content, {
|
|
3988
4075
|
"aria-labelledby": titleId
|
|
3989
|
-
}, /* @__PURE__ */
|
|
4076
|
+
}, /* @__PURE__ */ React45.createElement(StatusPanel, {
|
|
3990
4077
|
titleId
|
|
3991
4078
|
})))));
|
|
3992
4079
|
};
|
|
@@ -3995,14 +4082,14 @@ var StatusDialog = () => {
|
|
|
3995
4082
|
var __dxlog_file14 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/composites/Shell/Shell.tsx";
|
|
3996
4083
|
var blurActiveElement = () => document.activeElement?.blur?.();
|
|
3997
4084
|
var Shell = ({ runtime }) => {
|
|
3998
|
-
const [{ layout, invitationCode, spaceKey, spaceId, target }, setLayout] =
|
|
4085
|
+
const [{ layout, invitationCode, spaceKey, spaceId, target }, setLayout] = useState14({
|
|
3999
4086
|
layout: runtime.layout,
|
|
4000
4087
|
invitationCode: runtime.invitationCode,
|
|
4001
4088
|
spaceKey: runtime.spaceKey,
|
|
4002
4089
|
spaceId: runtime.spaceId,
|
|
4003
4090
|
target: runtime.target
|
|
4004
4091
|
});
|
|
4005
|
-
const [{ invitationUrl, deviceInvitationParam, spaceInvitationParam }, setInvitationUrl] =
|
|
4092
|
+
const [{ invitationUrl, deviceInvitationParam, spaceInvitationParam }, setInvitationUrl] = useState14({
|
|
4006
4093
|
invitationUrl: runtime.invitationUrl,
|
|
4007
4094
|
deviceInvitationParam: runtime.deviceInvitationParam,
|
|
4008
4095
|
spaceInvitationParam: runtime.spaceInvitationParam
|
|
@@ -4031,7 +4118,7 @@ var Shell = ({ runtime }) => {
|
|
|
4031
4118
|
]);
|
|
4032
4119
|
useEffect8(() => {
|
|
4033
4120
|
if (layout === ShellLayout.SPACE && !space) {
|
|
4034
|
-
|
|
4121
|
+
log14.warn("No space found for shell space invitations.", void 0, {
|
|
4035
4122
|
F: __dxlog_file14,
|
|
4036
4123
|
L: 67,
|
|
4037
4124
|
S: void 0,
|
|
@@ -4054,12 +4141,13 @@ var Shell = ({ runtime }) => {
|
|
|
4054
4141
|
]);
|
|
4055
4142
|
switch (layout) {
|
|
4056
4143
|
case ShellLayout.STATUS:
|
|
4057
|
-
return /* @__PURE__ */
|
|
4144
|
+
return /* @__PURE__ */ React46.createElement(StatusDialog, null);
|
|
4058
4145
|
case ShellLayout.INITIALIZE_IDENTITY:
|
|
4059
4146
|
case ShellLayout.INITIALIZE_IDENTITY_FROM_INVITATION:
|
|
4060
|
-
|
|
4147
|
+
case ShellLayout.INITIALIZE_IDENTITY_FROM_RECOVERY:
|
|
4148
|
+
return /* @__PURE__ */ React46.createElement(JoinDialog, {
|
|
4061
4149
|
mode: "halo-only",
|
|
4062
|
-
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",
|
|
4063
4151
|
initialInvitationCode: invitationCode,
|
|
4064
4152
|
onCancelResetStorage: () => runtime.setLayout({
|
|
4065
4153
|
layout: ShellLayout.IDENTITY
|
|
@@ -4077,7 +4165,7 @@ var Shell = ({ runtime }) => {
|
|
|
4077
4165
|
case ShellLayout.IDENTITY:
|
|
4078
4166
|
case ShellLayout.SHARE_IDENTITY:
|
|
4079
4167
|
case ShellLayout.EDIT_PROFILE:
|
|
4080
|
-
return /* @__PURE__ */
|
|
4168
|
+
return /* @__PURE__ */ React46.createElement(IdentityDialog, {
|
|
4081
4169
|
createInvitationUrl: createDeviceInvitationUrl,
|
|
4082
4170
|
onResetStorage: async () => {
|
|
4083
4171
|
runtime.setLayout({
|
|
@@ -4089,6 +4177,17 @@ var Shell = ({ runtime }) => {
|
|
|
4089
4177
|
reset: true
|
|
4090
4178
|
});
|
|
4091
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
|
+
},
|
|
4092
4191
|
onJoinNewIdentity: async () => {
|
|
4093
4192
|
runtime.setLayout({
|
|
4094
4193
|
layout: ShellLayout.STATUS
|
|
@@ -4112,7 +4211,7 @@ var Shell = ({ runtime }) => {
|
|
|
4112
4211
|
initialDisposition: layout === ShellLayout.SHARE_IDENTITY ? "manage-device-invitation" : "default"
|
|
4113
4212
|
});
|
|
4114
4213
|
case ShellLayout.SPACE:
|
|
4115
|
-
return space ? /* @__PURE__ */
|
|
4214
|
+
return space ? /* @__PURE__ */ React46.createElement(SpaceDialog, {
|
|
4116
4215
|
space,
|
|
4117
4216
|
target,
|
|
4118
4217
|
createInvitationUrl: createSpaceInvitationUrl,
|
|
@@ -4127,7 +4226,7 @@ var Shell = ({ runtime }) => {
|
|
|
4127
4226
|
}
|
|
4128
4227
|
}) : null;
|
|
4129
4228
|
case ShellLayout.JOIN_SPACE:
|
|
4130
|
-
return /* @__PURE__ */
|
|
4229
|
+
return /* @__PURE__ */ React46.createElement(JoinDialog, {
|
|
4131
4230
|
initialInvitationCode: invitationCode,
|
|
4132
4231
|
onDone: async (result) => {
|
|
4133
4232
|
blurActiveElement();
|
|
@@ -4159,7 +4258,7 @@ var Shell = ({ runtime }) => {
|
|
|
4159
4258
|
// packages/sdk/shell/src/composites/Shell/shell-runtime.ts
|
|
4160
4259
|
import { Event } from "@dxos/async";
|
|
4161
4260
|
import { appServiceBundle, shellServiceBundle } from "@dxos/client-protocol";
|
|
4162
|
-
import { invariant as
|
|
4261
|
+
import { invariant as invariant4 } from "@dxos/invariant";
|
|
4163
4262
|
import { ShellLayout as ShellLayout2 } from "@dxos/protocols/proto/dxos/iframe";
|
|
4164
4263
|
import { createProtoRpcPeer } from "@dxos/rpc";
|
|
4165
4264
|
var __dxlog_file15 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/composites/Shell/shell-runtime.ts";
|
|
@@ -4218,7 +4317,7 @@ var ShellRuntimeImpl = class {
|
|
|
4218
4317
|
});
|
|
4219
4318
|
}
|
|
4220
4319
|
async setAppContext(context) {
|
|
4221
|
-
|
|
4320
|
+
invariant4(this._appRpc, "runtime not open", {
|
|
4222
4321
|
F: __dxlog_file15,
|
|
4223
4322
|
L: 83,
|
|
4224
4323
|
S: this,
|
|
@@ -4410,7 +4509,9 @@ var os = {
|
|
|
4410
4509
|
"getting agent label": "Checking agent status\u2026",
|
|
4411
4510
|
"agent requested label": "Agent requested",
|
|
4412
4511
|
"agent requested description": "The agent service is creating an agent for you. Once the agent connects, it will display in the devices list.",
|
|
4413
|
-
"authenticating label": "Authenticating\u2026"
|
|
4512
|
+
"authenticating label": "Authenticating\u2026",
|
|
4513
|
+
"create recovery code label": "Create recovery code",
|
|
4514
|
+
"choose recover identity label": "Recover identity"
|
|
4414
4515
|
};
|
|
4415
4516
|
|
|
4416
4517
|
// packages/sdk/shell/src/translations/index.ts
|
|
@@ -4428,25 +4529,25 @@ var runShell = async (config = new Config()) => {
|
|
|
4428
4529
|
const services = new ClientServicesProxy(createIFramePort({
|
|
4429
4530
|
channel: DEFAULT_CLIENT_CHANNEL
|
|
4430
4531
|
}));
|
|
4431
|
-
createRoot(document.getElementById("root")).render(/* @__PURE__ */
|
|
4532
|
+
createRoot(document.getElementById("root")).render(/* @__PURE__ */ React47.createElement(StrictMode, null, /* @__PURE__ */ React47.createElement(ThemeProvider, {
|
|
4432
4533
|
tx: defaultTx,
|
|
4433
4534
|
resourceExtensions: [
|
|
4434
4535
|
osTranslations
|
|
4435
4536
|
]
|
|
4436
|
-
}, /* @__PURE__ */
|
|
4537
|
+
}, /* @__PURE__ */ React47.createElement(ClientProvider, {
|
|
4437
4538
|
config,
|
|
4438
4539
|
services,
|
|
4439
4540
|
noBanner: true
|
|
4440
|
-
}, /* @__PURE__ */
|
|
4541
|
+
}, /* @__PURE__ */ React47.createElement(ClipboardProvider, null, /* @__PURE__ */ React47.createElement(Tooltip8.Provider, null, /* @__PURE__ */ React47.createElement(AgentHostingProvider, null, /* @__PURE__ */ React47.createElement(Shell, {
|
|
4441
4542
|
runtime
|
|
4442
4543
|
}))))))));
|
|
4443
4544
|
} catch {
|
|
4444
|
-
createRoot(document.getElementById("root")).render(/* @__PURE__ */
|
|
4545
|
+
createRoot(document.getElementById("root")).render(/* @__PURE__ */ React47.createElement(StrictMode, null, /* @__PURE__ */ React47.createElement(ThemeProvider, {
|
|
4445
4546
|
tx: defaultTx,
|
|
4446
4547
|
resourceExtensions: [
|
|
4447
4548
|
osTranslations
|
|
4448
4549
|
]
|
|
4449
|
-
}, /* @__PURE__ */
|
|
4550
|
+
}, /* @__PURE__ */ React47.createElement(Fallback, {
|
|
4450
4551
|
onClose: () => runtime.setAppContext({
|
|
4451
4552
|
display: ShellDisplay2.NONE
|
|
4452
4553
|
})
|
|
@@ -4454,21 +4555,21 @@ var runShell = async (config = new Config()) => {
|
|
|
4454
4555
|
}
|
|
4455
4556
|
};
|
|
4456
4557
|
var Fallback = ({ onClose }) => {
|
|
4457
|
-
const { t } =
|
|
4458
|
-
return /* @__PURE__ */
|
|
4558
|
+
const { t } = useTranslation26("os");
|
|
4559
|
+
return /* @__PURE__ */ React47.createElement(Dialog3.Root, {
|
|
4459
4560
|
modal: true,
|
|
4460
4561
|
open: true,
|
|
4461
4562
|
onOpenChange: () => onClose?.()
|
|
4462
|
-
}, /* @__PURE__ */
|
|
4563
|
+
}, /* @__PURE__ */ React47.createElement(Dialog3.Overlay, null, /* @__PURE__ */ React47.createElement(Dialog3.Content, null, /* @__PURE__ */ React47.createElement(Dialog3.Title, null, t("shell fallback title")), /* @__PURE__ */ React47.createElement(Dialog3.Close, {
|
|
4463
4564
|
asChild: true,
|
|
4464
4565
|
onClick: () => onClose?.()
|
|
4465
|
-
}, /* @__PURE__ */
|
|
4566
|
+
}, /* @__PURE__ */ React47.createElement(Button11, {
|
|
4466
4567
|
variant: "primary"
|
|
4467
4568
|
}, t("close label"))))));
|
|
4468
4569
|
};
|
|
4469
4570
|
|
|
4470
4571
|
// packages/sdk/shell/src/composites/Shell/ShellContext.tsx
|
|
4471
|
-
import
|
|
4572
|
+
import React48, { createContext as createContext2, useCallback as useCallback8, useContext as useContext2, useEffect as useEffect9, useMemo as useMemo6, useState as useState15 } from "react";
|
|
4472
4573
|
import { useClient as useClient10, ShellDisplay as ShellDisplay3, ShellLayout as ShellLayout4 } from "@dxos/react-client";
|
|
4473
4574
|
import { useIdentity as useIdentity3 } from "@dxos/react-client/halo";
|
|
4474
4575
|
import { mx as mx25 } from "@dxos/react-ui-theme";
|
|
@@ -4549,7 +4650,7 @@ var useShell = () => {
|
|
|
4549
4650
|
var ShellProvider = ({ space, deviceInvitationCode, spaceInvitationCode, onJoinedSpace, children }) => {
|
|
4550
4651
|
const client = useClient10();
|
|
4551
4652
|
const identity = useIdentity3();
|
|
4552
|
-
const [display, setDisplay] =
|
|
4653
|
+
const [display, setDisplay] = useState15(!identity || spaceInvitationCode || deviceInvitationCode ? ShellDisplay3.FULLSCREEN : ShellDisplay3.NONE);
|
|
4553
4654
|
const shellRuntime = useMemo6(() => {
|
|
4554
4655
|
if (client.config.get("runtime.app.env.DX_VAULT") !== "false") {
|
|
4555
4656
|
return;
|
|
@@ -4619,11 +4720,11 @@ var ShellProvider = ({ space, deviceInvitationCode, spaceInvitationCode, onJoine
|
|
|
4619
4720
|
}, [
|
|
4620
4721
|
shellRuntime
|
|
4621
4722
|
]);
|
|
4622
|
-
return /* @__PURE__ */
|
|
4723
|
+
return /* @__PURE__ */ React48.createElement(React48.Fragment, null, shellRuntime && /* @__PURE__ */ React48.createElement("div", {
|
|
4623
4724
|
className: mx25(display === ShellDisplay3.NONE ? "hidden" : "")
|
|
4624
|
-
}, /* @__PURE__ */
|
|
4725
|
+
}, /* @__PURE__ */ React48.createElement(Shell, {
|
|
4625
4726
|
runtime: shellRuntime
|
|
4626
|
-
})), /* @__PURE__ */
|
|
4727
|
+
})), /* @__PURE__ */ React48.createElement(ShellContext.Provider, {
|
|
4627
4728
|
value: {
|
|
4628
4729
|
runtime: shellRuntime,
|
|
4629
4730
|
setDisplay
|