@dxos/shell 0.6.13 → 0.6.14-main.7bd9c89
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 +10438 -10740
- package/dist/bundle/shell.mjs.map +1 -1
- package/dist/bundle/shell.umd.js +75 -77
- 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 +292 -184
- package/dist/lib/browser/react.mjs.map +4 -4
- package/dist/lib/browser/testing/index.mjs +2 -7
- package/dist/lib/browser/testing/index.mjs.map +3 -3
- package/dist/types/src/components/CompoundButton/CompoundButton.stories.js +1 -1
- package/dist/types/src/components/CompoundButton/CompoundButton.stories.js.map +1 -1
- package/dist/types/src/components/IdentityList/SpaceMemberList.stories.d.ts +0 -3
- package/dist/types/src/components/IdentityList/SpaceMemberList.stories.d.ts.map +1 -1
- package/dist/types/src/components/IdentityList/SpaceMemberList.stories.js +1 -2
- package/dist/types/src/components/IdentityList/SpaceMemberList.stories.js.map +1 -1
- package/dist/types/src/components/InvitationList/InvitationList.stories.d.ts +0 -3
- package/dist/types/src/components/InvitationList/InvitationList.stories.d.ts.map +1 -1
- package/dist/types/src/components/InvitationList/InvitationList.stories.js +1 -2
- package/dist/types/src/components/InvitationList/InvitationList.stories.js.map +1 -1
- package/dist/types/src/components/Panel/Panel.stories.d.ts +0 -3
- package/dist/types/src/components/Panel/Panel.stories.d.ts.map +1 -1
- package/dist/types/src/components/Panel/Panel.stories.js +1 -2
- 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 +4 -3
- package/dist/types/src/composites/Shell/Shell.js.map +1 -1
- package/dist/types/src/composites/Shell/run-shell.js +1 -1
- package/dist/types/src/composites/Shell/run-shell.js.map +1 -1
- package/dist/types/src/panels/IdentityPanel/IdentityPanel.js +1 -1
- package/dist/types/src/panels/IdentityPanel/IdentityPanel.js.map +1 -1
- package/dist/types/src/panels/IdentityPanel/IdentityPanel.stories.d.ts.map +1 -1
- package/dist/types/src/panels/IdentityPanel/IdentityPanel.stories.js +7 -2
- package/dist/types/src/panels/IdentityPanel/IdentityPanel.stories.js.map +1 -1
- package/dist/types/src/panels/IdentityPanel/IdentityPanelProps.d.ts +4 -4
- package/dist/types/src/panels/IdentityPanel/IdentityPanelProps.d.ts.map +1 -1
- package/dist/types/src/panels/IdentityPanel/useAgentHandlers.d.ts +1 -1
- package/dist/types/src/panels/IdentityPanel/useAgentHandlers.d.ts.map +1 -1
- package/dist/types/src/panels/IdentityPanel/useAgentHandlers.js +10 -108
- package/dist/types/src/panels/IdentityPanel/useAgentHandlers.js.map +1 -1
- package/dist/types/src/panels/IdentityPanel/useEdgeAgentsHandlers.d.ts +8 -0
- package/dist/types/src/panels/IdentityPanel/useEdgeAgentsHandlers.d.ts.map +1 -0
- package/dist/types/src/panels/IdentityPanel/useEdgeAgentsHandlers.js +84 -0
- package/dist/types/src/panels/IdentityPanel/useEdgeAgentsHandlers.js.map +1 -0
- package/dist/types/src/panels/IdentityPanel/useKubeAgentHandlers.d.ts +8 -0
- package/dist/types/src/panels/IdentityPanel/useKubeAgentHandlers.d.ts.map +1 -0
- package/dist/types/src/panels/IdentityPanel/useKubeAgentHandlers.js +119 -0
- package/dist/types/src/panels/IdentityPanel/useKubeAgentHandlers.js.map +1 -0
- package/dist/types/src/panels/JoinPanel/JoinPanel.d.ts.map +1 -1
- package/dist/types/src/panels/JoinPanel/JoinPanel.js +24 -16
- package/dist/types/src/panels/JoinPanel/JoinPanel.js.map +1 -1
- package/dist/types/src/panels/JoinPanel/JoinPanel.stories.d.ts +3 -0
- package/dist/types/src/panels/JoinPanel/JoinPanel.stories.d.ts.map +1 -1
- package/dist/types/src/panels/JoinPanel/JoinPanel.stories.js +3 -2
- package/dist/types/src/panels/JoinPanel/JoinPanel.stories.js.map +1 -1
- package/dist/types/src/panels/JoinPanel/JoinPanelProps.d.ts +7 -3
- 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 +2 -0
- package/dist/types/src/panels/JoinPanel/joinMachine.js.map +1 -1
- package/dist/types/src/panels/JoinPanel/steps/InvitationAuthenticator.d.ts +3 -1
- package/dist/types/src/panels/JoinPanel/steps/InvitationAuthenticator.d.ts.map +1 -1
- package/dist/types/src/panels/JoinPanel/steps/InvitationAuthenticator.js +9 -6
- package/dist/types/src/panels/JoinPanel/steps/InvitationAuthenticator.js.map +1 -1
- package/dist/types/src/panels/JoinPanel/steps/InvitationInput.d.ts.map +1 -1
- package/dist/types/src/panels/JoinPanel/steps/InvitationInput.js +8 -2
- package/dist/types/src/panels/JoinPanel/steps/InvitationInput.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.js +1 -1
- package/dist/types/src/panels/SpacePanel/SpacePanel.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/panels/SpacePanel/SpacePanelProps.d.ts +4 -4
- package/dist/types/src/panels/SpacePanel/SpacePanelProps.d.ts.map +1 -1
- package/dist/types/src/playwright/invitations-manager.d.ts +1 -1
- package/dist/types/src/playwright/invitations-manager.d.ts.map +1 -1
- package/dist/types/src/playwright/invitations-manager.js +4 -10
- package/dist/types/src/playwright/invitations-manager.js.map +1 -1
- package/dist/types/src/playwright/invitations.spec.js +31 -32
- package/dist/types/src/playwright/invitations.spec.js.map +1 -1
- package/dist/types/src/playwright/playwright.config.d.ts +2 -2
- package/dist/types/src/playwright/playwright.config.d.ts.map +1 -1
- package/dist/types/src/playwright/playwright.config.js +12 -2
- package/dist/types/src/playwright/playwright.config.js.map +1 -1
- package/dist/types/src/testing/shell-manager.d.ts +1 -0
- package/dist/types/src/testing/shell-manager.d.ts.map +1 -1
- package/dist/types/src/testing/shell-manager.js +2 -7
- package/dist/types/src/testing/shell-manager.js.map +1 -1
- package/dist/types/src/translations/locales/en-US.d.ts +1 -0
- package/dist/types/src/translations/locales/en-US.d.ts.map +1 -1
- package/dist/types/src/translations/locales/en-US.js +4 -3
- package/dist/types/src/translations/locales/en-US.js.map +1 -1
- package/package.json +28 -27
- package/src/components/CompoundButton/CompoundButton.stories.tsx +1 -1
- package/src/components/IdentityList/SpaceMemberList.stories.tsx +1 -2
- package/src/components/InvitationList/InvitationList.stories.tsx +1 -2
- package/src/components/Panel/Panel.stories.tsx +1 -2
- package/src/components/Viewport/Viewport.stories.tsx +1 -1
- package/src/composites/Shell/Shell.tsx +4 -3
- package/src/composites/Shell/run-shell.tsx +1 -1
- package/src/panels/IdentityPanel/IdentityPanel.stories.tsx +7 -2
- package/src/panels/IdentityPanel/IdentityPanel.tsx +3 -3
- package/src/panels/IdentityPanel/IdentityPanelProps.ts +4 -4
- package/src/panels/IdentityPanel/useAgentHandlers.ts +9 -114
- package/src/panels/IdentityPanel/useEdgeAgentsHandlers.ts +96 -0
- package/src/panels/IdentityPanel/useKubeAgentHandlers.ts +128 -0
- package/src/panels/JoinPanel/JoinPanel.stories.tsx +3 -2
- package/src/panels/JoinPanel/JoinPanel.tsx +31 -9
- package/src/panels/JoinPanel/JoinPanelProps.ts +7 -3
- package/src/panels/JoinPanel/joinMachine.ts +2 -0
- package/src/panels/JoinPanel/steps/InvitationAuthenticator.tsx +29 -16
- package/src/panels/JoinPanel/steps/InvitationInput.tsx +9 -17
- package/src/panels/Panels.stories.tsx +1 -1
- package/src/panels/SpacePanel/SpacePanel.stories.tsx +1 -1
- package/src/panels/SpacePanel/SpacePanel.tsx +3 -3
- package/src/panels/SpacePanel/SpacePanelProps.ts +4 -4
- package/src/playwright/invitations-manager.ts +4 -8
- package/src/playwright/invitations.spec.ts +32 -33
- package/src/playwright/playwright.config.ts +13 -2
- package/src/testing/shell-manager.ts +4 -9
- package/src/translations/locales/en-US.ts +4 -3
|
@@ -1238,14 +1238,14 @@ import { Dialog, useId as useId10 } from "@dxos/react-ui";
|
|
|
1238
1238
|
|
|
1239
1239
|
// packages/sdk/shell/src/panels/IdentityPanel/IdentityPanel.tsx
|
|
1240
1240
|
import { Key, Plugs, PlugsConnected } from "@phosphor-icons/react";
|
|
1241
|
-
import React29, { useEffect as
|
|
1241
|
+
import React29, { useEffect as useEffect4, useMemo as useMemo3, useState as useState9 } from "react";
|
|
1242
1242
|
import { generateName as generateName3 } from "@dxos/display-name";
|
|
1243
1243
|
import { log as log6 } from "@dxos/log";
|
|
1244
|
-
import { useClient as
|
|
1244
|
+
import { useClient as useClient6 } from "@dxos/react-client";
|
|
1245
1245
|
import { useIdentity, useDevices, useHaloInvitations as useHaloInvitations2 } from "@dxos/react-client/halo";
|
|
1246
1246
|
import { useInvitationStatus as useInvitationStatus2 } from "@dxos/react-client/invitations";
|
|
1247
1247
|
import { useNetworkStatus, ConnectionState as ConnectionState2 } from "@dxos/react-client/mesh";
|
|
1248
|
-
import { Avatar as Avatar6,
|
|
1248
|
+
import { Avatar as Avatar6, Input as Input2, Toolbar as Toolbar3, Tooltip as Tooltip7, useId as useId6, useTranslation as useTranslation14 } from "@dxos/react-ui";
|
|
1249
1249
|
import { getSize as getSize13 } from "@dxos/react-ui-theme";
|
|
1250
1250
|
import { hexToEmoji as hexToEmoji4, hexToHue as hexToHue2, keyToFallback as keyToFallback3 } from "@dxos/util";
|
|
1251
1251
|
|
|
@@ -1423,17 +1423,105 @@ import { useTranslation as useTranslation11 } from "@dxos/react-ui";
|
|
|
1423
1423
|
import { hexToEmoji as hexToEmoji2, hexToHue } from "@dxos/util";
|
|
1424
1424
|
|
|
1425
1425
|
// packages/sdk/shell/src/panels/IdentityPanel/useAgentHandlers.ts
|
|
1426
|
-
import {
|
|
1426
|
+
import { useClient as useClient5 } from "@dxos/react-client";
|
|
1427
|
+
|
|
1428
|
+
// packages/sdk/shell/src/panels/IdentityPanel/useEdgeAgentsHandlers.ts
|
|
1429
|
+
import { useEffect as useEffect2, useState as useState6 } from "react";
|
|
1427
1430
|
import { invariant } from "@dxos/invariant";
|
|
1428
|
-
import {
|
|
1429
|
-
import { useClient as useClient3
|
|
1430
|
-
|
|
1431
|
-
var
|
|
1432
|
-
var useAgentHandlers = ({ invitations, identity }) => {
|
|
1431
|
+
import { QueryAgentStatusResponse } from "@dxos/protocols/proto/dxos/client/services";
|
|
1432
|
+
import { useClient as useClient3 } from "@dxos/react-client";
|
|
1433
|
+
var __dxlog_file3 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/IdentityPanel/useEdgeAgentsHandlers.ts";
|
|
1434
|
+
var useEdgeAgentHandlers = ({ identity }) => {
|
|
1433
1435
|
const [validationMessage, setValidationMessage] = useState6("");
|
|
1436
|
+
const [lastReceivedStatus, setLastReceivedStatus] = useState6(QueryAgentStatusResponse.AgentStatus.UNKNOWN);
|
|
1434
1437
|
const [agentStatus, setAgentStatus] = useState6("getting");
|
|
1435
|
-
const agentHostingProviderClient = useAgentHostingClient();
|
|
1436
1438
|
const client = useClient3();
|
|
1439
|
+
const agentHostingEnabled = Boolean(client.config.values.runtime?.client?.edgeFeatures?.agents);
|
|
1440
|
+
const handleStatus = (status) => {
|
|
1441
|
+
switch (status) {
|
|
1442
|
+
case QueryAgentStatusResponse.AgentStatus.ACTIVE:
|
|
1443
|
+
case QueryAgentStatusResponse.AgentStatus.INACTIVE:
|
|
1444
|
+
setAgentStatus("created");
|
|
1445
|
+
break;
|
|
1446
|
+
case QueryAgentStatusResponse.AgentStatus.NOT_FOUND:
|
|
1447
|
+
setAgentStatus("creatable");
|
|
1448
|
+
break;
|
|
1449
|
+
case QueryAgentStatusResponse.AgentStatus.UNKNOWN:
|
|
1450
|
+
setAgentStatus("getting");
|
|
1451
|
+
break;
|
|
1452
|
+
}
|
|
1453
|
+
};
|
|
1454
|
+
useEffect2(() => {
|
|
1455
|
+
const stream = client.services.services.EdgeAgentService?.queryAgentStatus();
|
|
1456
|
+
stream?.subscribe(({ status }) => {
|
|
1457
|
+
setLastReceivedStatus(status);
|
|
1458
|
+
handleStatus(status);
|
|
1459
|
+
});
|
|
1460
|
+
return () => {
|
|
1461
|
+
void stream?.close().catch(() => {
|
|
1462
|
+
});
|
|
1463
|
+
};
|
|
1464
|
+
}, []);
|
|
1465
|
+
const onAgentCreate = async () => {
|
|
1466
|
+
invariant(identity, "Identity not found", {
|
|
1467
|
+
F: __dxlog_file3,
|
|
1468
|
+
L: 56,
|
|
1469
|
+
S: void 0,
|
|
1470
|
+
A: [
|
|
1471
|
+
"identity",
|
|
1472
|
+
"'Identity not found'"
|
|
1473
|
+
]
|
|
1474
|
+
});
|
|
1475
|
+
const service = client.services.services.EdgeAgentService;
|
|
1476
|
+
if (!service) {
|
|
1477
|
+
setAgentStatus("error");
|
|
1478
|
+
setValidationMessage("Agent service not initialized.");
|
|
1479
|
+
return;
|
|
1480
|
+
}
|
|
1481
|
+
if (!agentHostingEnabled) {
|
|
1482
|
+
setAgentStatus("error");
|
|
1483
|
+
setValidationMessage("Edge agents are disabled in config.");
|
|
1484
|
+
return;
|
|
1485
|
+
}
|
|
1486
|
+
setAgentStatus("creating");
|
|
1487
|
+
setValidationMessage("");
|
|
1488
|
+
try {
|
|
1489
|
+
await service.createAgent();
|
|
1490
|
+
setAgentStatus("created");
|
|
1491
|
+
} catch (err) {
|
|
1492
|
+
setAgentStatus("error");
|
|
1493
|
+
setValidationMessage(`Error creating an agent: ${err.message}`);
|
|
1494
|
+
}
|
|
1495
|
+
};
|
|
1496
|
+
const onAgentDestroy = async () => {
|
|
1497
|
+
setValidationMessage("Agents are non-destructible.");
|
|
1498
|
+
};
|
|
1499
|
+
const onAgentRefresh = async () => {
|
|
1500
|
+
setValidationMessage("");
|
|
1501
|
+
handleStatus(lastReceivedStatus);
|
|
1502
|
+
};
|
|
1503
|
+
return {
|
|
1504
|
+
onAgentCreate,
|
|
1505
|
+
onAgentDestroy,
|
|
1506
|
+
onAgentRefresh,
|
|
1507
|
+
validationMessage,
|
|
1508
|
+
agentStatus,
|
|
1509
|
+
agentHostingEnabled
|
|
1510
|
+
};
|
|
1511
|
+
};
|
|
1512
|
+
|
|
1513
|
+
// packages/sdk/shell/src/panels/IdentityPanel/useKubeAgentHandlers.ts
|
|
1514
|
+
import { useCallback as useCallback4, useEffect as useEffect3, useState as useState7 } from "react";
|
|
1515
|
+
import { invariant as invariant2 } from "@dxos/invariant";
|
|
1516
|
+
import { log as log4 } from "@dxos/log";
|
|
1517
|
+
import { useClient as useClient4, useAgentHostingClient } from "@dxos/react-client";
|
|
1518
|
+
import { Invitation as Invitation3, InvitationEncoder as InvitationEncoder2 } from "@dxos/react-client/invitations";
|
|
1519
|
+
var __dxlog_file4 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/IdentityPanel/useKubeAgentHandlers.ts";
|
|
1520
|
+
var useKubeAgentHandlers = ({ invitations, identity }) => {
|
|
1521
|
+
const [validationMessage, setValidationMessage] = useState7("");
|
|
1522
|
+
const [agentStatus, setAgentStatus] = useState7("getting");
|
|
1523
|
+
const agentHostingProviderClient = useAgentHostingClient();
|
|
1524
|
+
const client = useClient4();
|
|
1437
1525
|
const updateAgentStatus = async () => {
|
|
1438
1526
|
if (agentHostingProviderClient) {
|
|
1439
1527
|
setAgentStatus("getting");
|
|
@@ -1454,8 +1542,8 @@ var useAgentHandlers = ({ invitations, identity }) => {
|
|
|
1454
1542
|
}
|
|
1455
1543
|
};
|
|
1456
1544
|
const createAgent = async (invitationCode) => {
|
|
1457
|
-
|
|
1458
|
-
F:
|
|
1545
|
+
invariant2(identity, "Identity not found", {
|
|
1546
|
+
F: __dxlog_file4,
|
|
1459
1547
|
L: 50,
|
|
1460
1548
|
S: void 0,
|
|
1461
1549
|
A: [
|
|
@@ -1484,8 +1572,8 @@ var useAgentHandlers = ({ invitations, identity }) => {
|
|
|
1484
1572
|
}
|
|
1485
1573
|
};
|
|
1486
1574
|
const destroyAgent = async () => {
|
|
1487
|
-
|
|
1488
|
-
F:
|
|
1575
|
+
invariant2(identity, "Identity not found", {
|
|
1576
|
+
F: __dxlog_file4,
|
|
1489
1577
|
L: 73,
|
|
1490
1578
|
S: void 0,
|
|
1491
1579
|
A: [
|
|
@@ -1508,7 +1596,7 @@ var useAgentHandlers = ({ invitations, identity }) => {
|
|
|
1508
1596
|
setValidationMessage("No agent provider configured.");
|
|
1509
1597
|
}
|
|
1510
1598
|
};
|
|
1511
|
-
|
|
1599
|
+
useEffect3(() => {
|
|
1512
1600
|
void updateAgentStatus();
|
|
1513
1601
|
}, []);
|
|
1514
1602
|
const handleAgentCreate = useCallback4(async (invitation) => {
|
|
@@ -1518,7 +1606,7 @@ var useAgentHandlers = ({ invitations, identity }) => {
|
|
|
1518
1606
|
invitationCode,
|
|
1519
1607
|
authCode: invitation.authCode
|
|
1520
1608
|
}), void 0, {
|
|
1521
|
-
F:
|
|
1609
|
+
F: __dxlog_file4,
|
|
1522
1610
|
L: 97,
|
|
1523
1611
|
S: void 0,
|
|
1524
1612
|
C: (f, a) => f(...a)
|
|
@@ -1549,6 +1637,16 @@ var useAgentHandlers = ({ invitations, identity }) => {
|
|
|
1549
1637
|
};
|
|
1550
1638
|
};
|
|
1551
1639
|
|
|
1640
|
+
// packages/sdk/shell/src/panels/IdentityPanel/useAgentHandlers.ts
|
|
1641
|
+
var useAgentHandlers = (params) => {
|
|
1642
|
+
const client = useClient5();
|
|
1643
|
+
if (client.config.values?.runtime?.client?.edgeFeatures?.agents) {
|
|
1644
|
+
return useEdgeAgentHandlers(params);
|
|
1645
|
+
} else {
|
|
1646
|
+
return useKubeAgentHandlers(params);
|
|
1647
|
+
}
|
|
1648
|
+
};
|
|
1649
|
+
|
|
1552
1650
|
// packages/sdk/shell/src/steps/InvitationManager.tsx
|
|
1553
1651
|
import { Check as Check4, X as X3 } from "@phosphor-icons/react";
|
|
1554
1652
|
import React27, { useMemo as useMemo2 } from "react";
|
|
@@ -1680,20 +1778,20 @@ var InvitationManager = ({ invitationUrl, active, send, status, multiUse, authCo
|
|
|
1680
1778
|
|
|
1681
1779
|
// packages/sdk/shell/src/steps/ConfirmReset.tsx
|
|
1682
1780
|
import { Warning } from "@phosphor-icons/react";
|
|
1683
|
-
import React28, { useState as
|
|
1781
|
+
import React28, { useState as useState8 } from "react";
|
|
1684
1782
|
import { log as log5 } from "@dxos/log";
|
|
1685
1783
|
import { Message, useTranslation as useTranslation13 } from "@dxos/react-ui";
|
|
1686
1784
|
import { getSize as getSize12, mx as mx21 } from "@dxos/react-ui-theme";
|
|
1687
|
-
var
|
|
1785
|
+
var __dxlog_file5 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/steps/ConfirmReset.tsx";
|
|
1688
1786
|
var ConfirmReset = ({ active, onCancel, onConfirm, mode }) => {
|
|
1689
1787
|
const { t } = useTranslation13("os");
|
|
1690
|
-
const [validationMessage, setValidationMessage] =
|
|
1691
|
-
const [pending, setPending] =
|
|
1788
|
+
const [validationMessage, setValidationMessage] = useState8("");
|
|
1789
|
+
const [pending, setPending] = useState8(false);
|
|
1692
1790
|
const processReset = async () => {
|
|
1693
1791
|
setPending(true);
|
|
1694
1792
|
return onConfirm?.().then(() => setPending(false), (error) => {
|
|
1695
1793
|
log5.catch(error, void 0, {
|
|
1696
|
-
F:
|
|
1794
|
+
F: __dxlog_file5,
|
|
1697
1795
|
L: 38,
|
|
1698
1796
|
S: void 0,
|
|
1699
1797
|
C: (f, a) => f(...a)
|
|
@@ -1714,7 +1812,7 @@ var ConfirmReset = ({ active, onCancel, onConfirm, mode }) => {
|
|
|
1714
1812
|
var ConfirmResetImpl = ({ disabled, pending, validationMessage, onConfirm, onCancel, mode }) => {
|
|
1715
1813
|
const { t } = useTranslation13("os");
|
|
1716
1814
|
const confirmationValue = t("confirmation value");
|
|
1717
|
-
const [inputValue, setInputValue] =
|
|
1815
|
+
const [inputValue, setInputValue] = useState8("");
|
|
1718
1816
|
const testIdAffix = mode === "join new identity" ? "join-new-identity" : "reset-storage";
|
|
1719
1817
|
return /* @__PURE__ */ React28.createElement(React28.Fragment, null, /* @__PURE__ */ React28.createElement("div", {
|
|
1720
1818
|
role: "none",
|
|
@@ -1749,16 +1847,16 @@ var ConfirmResetImpl = ({ disabled, pending, validationMessage, onConfirm, onCan
|
|
|
1749
1847
|
};
|
|
1750
1848
|
|
|
1751
1849
|
// packages/sdk/shell/src/panels/IdentityPanel/IdentityPanel.tsx
|
|
1752
|
-
var
|
|
1850
|
+
var __dxlog_file6 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/IdentityPanel/IdentityPanel.tsx";
|
|
1753
1851
|
var viewStyles = "pbs-1 pbe-3 pli-3";
|
|
1754
1852
|
var getHueValue = (identity) => identity?.profile?.data?.hue || hexToHue2(identity?.identityKey.toHex() ?? "0");
|
|
1755
1853
|
var getEmojiValue = (identity) => identity?.profile?.data?.emoji || hexToEmoji4(identity?.identityKey.toHex() ?? "0");
|
|
1756
1854
|
var IdentityHeading = ({ titleId, title, identity, onDone, onUpdateProfile, connectionState, onChangeConnectionState }) => {
|
|
1757
1855
|
const fallbackValue = keyToFallback3(identity.identityKey);
|
|
1758
1856
|
const { t } = useTranslation14("os");
|
|
1759
|
-
const [displayName, setDisplayName] =
|
|
1760
|
-
const [emoji, setEmojiDirectly] =
|
|
1761
|
-
const [hue, setHueDirectly] =
|
|
1857
|
+
const [displayName, setDisplayName] = useState9(identity.profile?.displayName ?? "");
|
|
1858
|
+
const [emoji, setEmojiDirectly] = useState9(getEmojiValue(identity));
|
|
1859
|
+
const [hue, setHueDirectly] = useState9(getHueValue(identity));
|
|
1762
1860
|
const { textValue, setTextValue } = useClipboardContext();
|
|
1763
1861
|
const identityHex = identity.identityKey.toHex();
|
|
1764
1862
|
const copied = textValue === identityHex;
|
|
@@ -1874,9 +1972,7 @@ var IdentityPanelImpl = (props) => {
|
|
|
1874
1972
|
t
|
|
1875
1973
|
]);
|
|
1876
1974
|
const onCancelReset = () => rest.send?.("unchooseAction");
|
|
1877
|
-
return /* @__PURE__ */ React29.createElement(
|
|
1878
|
-
density: "fine"
|
|
1879
|
-
}, /* @__PURE__ */ React29.createElement(IdentityHeading, {
|
|
1975
|
+
return /* @__PURE__ */ React29.createElement(React29.Fragment, null, /* @__PURE__ */ React29.createElement(IdentityHeading, {
|
|
1880
1976
|
identity,
|
|
1881
1977
|
titleId,
|
|
1882
1978
|
title,
|
|
@@ -1929,7 +2025,7 @@ var IdentityPanelWithInvitationImpl = ({ invitation, ...props }) => {
|
|
|
1929
2025
|
};
|
|
1930
2026
|
var IdentityPanel = ({ titleId: propsTitleId, createInvitationUrl = (code) => code, initialDisposition = "default", ...props }) => {
|
|
1931
2027
|
const titleId = useId6("identityPanel__heading", propsTitleId);
|
|
1932
|
-
const client =
|
|
2028
|
+
const client = useClient6();
|
|
1933
2029
|
const devices = useDevices();
|
|
1934
2030
|
const identity = useIdentity();
|
|
1935
2031
|
const invitations = useHaloInvitations2();
|
|
@@ -1939,7 +2035,7 @@ var IdentityPanel = ({ titleId: propsTitleId, createInvitationUrl = (code) => co
|
|
|
1939
2035
|
});
|
|
1940
2036
|
if (!identity) {
|
|
1941
2037
|
log6.error("IdentityPanel rendered with no active identity.", void 0, {
|
|
1942
|
-
F:
|
|
2038
|
+
F: __dxlog_file6,
|
|
1943
2039
|
L: 246,
|
|
1944
2040
|
S: void 0,
|
|
1945
2041
|
C: (f, a) => f(...a)
|
|
@@ -1953,10 +2049,10 @@ var IdentityPanel = ({ titleId: propsTitleId, createInvitationUrl = (code) => co
|
|
|
1953
2049
|
});
|
|
1954
2050
|
const { swarm: connectionState } = useNetworkStatus();
|
|
1955
2051
|
const handleChangeConnectionState = async (nextState) => client?.mesh.updateConfig(nextState);
|
|
1956
|
-
|
|
2052
|
+
useEffect4(() => {
|
|
1957
2053
|
const subscription = identityService.subscribe((state) => {
|
|
1958
2054
|
log6("[state]", state, {
|
|
1959
|
-
F:
|
|
2055
|
+
F: __dxlog_file6,
|
|
1960
2056
|
L: 259,
|
|
1961
2057
|
S: void 0,
|
|
1962
2058
|
C: (f, a) => f(...a)
|
|
@@ -2008,11 +2104,11 @@ var IdentityPanel = ({ titleId: propsTitleId, createInvitationUrl = (code) => co
|
|
|
2008
2104
|
};
|
|
2009
2105
|
|
|
2010
2106
|
// packages/sdk/shell/src/panels/JoinPanel/JoinPanel.tsx
|
|
2011
|
-
import React38, { useCallback as useCallback6, useEffect as
|
|
2107
|
+
import React38, { useCallback as useCallback6, useEffect as useEffect6, useMemo as useMemo4 } from "react";
|
|
2012
2108
|
import { log as log10 } from "@dxos/log";
|
|
2013
|
-
import { useClient as
|
|
2109
|
+
import { useClient as useClient8, useMulticastObservable } from "@dxos/react-client";
|
|
2014
2110
|
import { useIdentity as useIdentity2 } from "@dxos/react-client/halo";
|
|
2015
|
-
import {
|
|
2111
|
+
import { useId as useId8, useThemeContext as useThemeContext5 } from "@dxos/react-ui";
|
|
2016
2112
|
|
|
2017
2113
|
// packages/sdk/shell/src/panels/JoinPanel/JoinHeading.tsx
|
|
2018
2114
|
import { X as X4 } from "@phosphor-icons/react";
|
|
@@ -2054,10 +2150,10 @@ import { assign as assign2, createMachine as createMachine2 } from "xstate";
|
|
|
2054
2150
|
import { log as log7 } from "@dxos/log";
|
|
2055
2151
|
import { AlreadyJoinedError } from "@dxos/react-client";
|
|
2056
2152
|
import { Invitation as Invitation5, InvitationEncoder as InvitationEncoder3 } from "@dxos/react-client/invitations";
|
|
2057
|
-
var
|
|
2153
|
+
var __dxlog_file7 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/JoinPanel/joinMachine.ts";
|
|
2058
2154
|
var getInvitationSubscribable = (Kind, invitation) => {
|
|
2059
2155
|
log7("[subscribing to invitation]", invitation, {
|
|
2060
|
-
F:
|
|
2156
|
+
F: __dxlog_file7,
|
|
2061
2157
|
L: 90,
|
|
2062
2158
|
S: void 0,
|
|
2063
2159
|
C: (f, a) => f(...a)
|
|
@@ -2070,7 +2166,7 @@ var getInvitationSubscribable = (Kind, invitation) => {
|
|
|
2070
2166
|
Kind,
|
|
2071
2167
|
invitation: invitation2
|
|
2072
2168
|
}, {
|
|
2073
|
-
F:
|
|
2169
|
+
F: __dxlog_file7,
|
|
2074
2170
|
L: 101,
|
|
2075
2171
|
S: void 0,
|
|
2076
2172
|
C: (f, a) => f(...a)
|
|
@@ -2085,7 +2181,7 @@ var getInvitationSubscribable = (Kind, invitation) => {
|
|
|
2085
2181
|
Kind,
|
|
2086
2182
|
invitation: invitation2
|
|
2087
2183
|
}, {
|
|
2088
|
-
F:
|
|
2184
|
+
F: __dxlog_file7,
|
|
2089
2185
|
L: 106,
|
|
2090
2186
|
S: void 0,
|
|
2091
2187
|
C: (f, a) => f(...a)
|
|
@@ -2100,7 +2196,7 @@ var getInvitationSubscribable = (Kind, invitation) => {
|
|
|
2100
2196
|
Kind,
|
|
2101
2197
|
invitation: invitation2
|
|
2102
2198
|
}, {
|
|
2103
|
-
F:
|
|
2199
|
+
F: __dxlog_file7,
|
|
2104
2200
|
L: 111,
|
|
2105
2201
|
S: void 0,
|
|
2106
2202
|
C: (f, a) => f(...a)
|
|
@@ -2115,7 +2211,7 @@ var getInvitationSubscribable = (Kind, invitation) => {
|
|
|
2115
2211
|
Kind,
|
|
2116
2212
|
invitation: invitation2
|
|
2117
2213
|
}, {
|
|
2118
|
-
F:
|
|
2214
|
+
F: __dxlog_file7,
|
|
2119
2215
|
L: 116,
|
|
2120
2216
|
S: void 0,
|
|
2121
2217
|
C: (f, a) => f(...a)
|
|
@@ -2130,7 +2226,7 @@ var getInvitationSubscribable = (Kind, invitation) => {
|
|
|
2130
2226
|
Kind,
|
|
2131
2227
|
invitation: invitation2
|
|
2132
2228
|
}, {
|
|
2133
|
-
F:
|
|
2229
|
+
F: __dxlog_file7,
|
|
2134
2230
|
L: 121,
|
|
2135
2231
|
S: void 0,
|
|
2136
2232
|
C: (f, a) => f(...a)
|
|
@@ -2145,7 +2241,7 @@ var getInvitationSubscribable = (Kind, invitation) => {
|
|
|
2145
2241
|
log7.warn("[invitation cancelled]", {
|
|
2146
2242
|
Kind
|
|
2147
2243
|
}, {
|
|
2148
|
-
F:
|
|
2244
|
+
F: __dxlog_file7,
|
|
2149
2245
|
L: 127,
|
|
2150
2246
|
S: void 0,
|
|
2151
2247
|
C: (f, a) => f(...a)
|
|
@@ -2159,7 +2255,7 @@ var getInvitationSubscribable = (Kind, invitation) => {
|
|
|
2159
2255
|
log7.error("[invitation timeout]", {
|
|
2160
2256
|
Kind
|
|
2161
2257
|
}, {
|
|
2162
|
-
F:
|
|
2258
|
+
F: __dxlog_file7,
|
|
2163
2259
|
L: 132,
|
|
2164
2260
|
S: void 0,
|
|
2165
2261
|
C: (f, a) => f(...a)
|
|
@@ -2176,7 +2272,7 @@ var getInvitationSubscribable = (Kind, invitation) => {
|
|
|
2176
2272
|
Kind,
|
|
2177
2273
|
error
|
|
2178
2274
|
}, {
|
|
2179
|
-
F:
|
|
2275
|
+
F: __dxlog_file7,
|
|
2180
2276
|
L: 139,
|
|
2181
2277
|
S: void 0,
|
|
2182
2278
|
C: (f, a) => f(...a)
|
|
@@ -2191,7 +2287,7 @@ var getInvitationSubscribable = (Kind, invitation) => {
|
|
|
2191
2287
|
Kind,
|
|
2192
2288
|
error
|
|
2193
2289
|
}, {
|
|
2194
|
-
F:
|
|
2290
|
+
F: __dxlog_file7,
|
|
2195
2291
|
L: 144,
|
|
2196
2292
|
S: void 0,
|
|
2197
2293
|
C: (f, a) => f(...a)
|
|
@@ -2395,6 +2491,7 @@ var joinMachine = createMachine2({
|
|
|
2395
2491
|
}
|
|
2396
2492
|
]
|
|
2397
2493
|
},
|
|
2494
|
+
// TODO(wittjosiah): Remove.
|
|
2398
2495
|
choosingIdentity: {
|
|
2399
2496
|
initial: "unknownAuthMethod",
|
|
2400
2497
|
states: {
|
|
@@ -2447,6 +2544,7 @@ var joinMachine = createMachine2({
|
|
|
2447
2544
|
}
|
|
2448
2545
|
}
|
|
2449
2546
|
},
|
|
2547
|
+
// TODO(wittjosiah): Factor out to a machine handling recovery and device invitations.
|
|
2450
2548
|
resettingIdentity: {},
|
|
2451
2549
|
acceptingSpaceInvitation: acceptingInvitationTemplate("Space", "#join.finishingJoiningSpace"),
|
|
2452
2550
|
finishingJoiningSpace: {
|
|
@@ -2523,8 +2621,8 @@ var joinMachine = createMachine2({
|
|
|
2523
2621
|
haloInvitation: context.halo.invitation,
|
|
2524
2622
|
spaceInvitation: context.space.invitation
|
|
2525
2623
|
}, {
|
|
2526
|
-
F:
|
|
2527
|
-
L:
|
|
2624
|
+
F: __dxlog_file7,
|
|
2625
|
+
L: 418,
|
|
2528
2626
|
S: void 0,
|
|
2529
2627
|
C: (f, a) => f(...a)
|
|
2530
2628
|
});
|
|
@@ -2537,8 +2635,8 @@ var defaultCodeFromUrl = (invitationType, text) => {
|
|
|
2537
2635
|
return searchParams.get(`${invitationType}InvitationCode`) ?? searchParams.get(`${invitationType}Invitation`) ?? searchParams.get("invitationCode") ?? searchParams.get("invitation") ?? text;
|
|
2538
2636
|
} catch (err) {
|
|
2539
2637
|
log7.catch(err, void 0, {
|
|
2540
|
-
F:
|
|
2541
|
-
L:
|
|
2638
|
+
F: __dxlog_file7,
|
|
2639
|
+
L: 445,
|
|
2542
2640
|
S: void 0,
|
|
2543
2641
|
C: (f, a) => f(...a)
|
|
2544
2642
|
});
|
|
@@ -2558,8 +2656,8 @@ var useJoinMachine = (client, options) => {
|
|
|
2558
2656
|
};
|
|
2559
2657
|
} catch (err) {
|
|
2560
2658
|
log7.error("Could not redeem device invitation code", err, {
|
|
2561
|
-
F:
|
|
2562
|
-
L:
|
|
2659
|
+
F: __dxlog_file7,
|
|
2660
|
+
L: 466,
|
|
2563
2661
|
S: void 0,
|
|
2564
2662
|
C: (f, a) => f(...a)
|
|
2565
2663
|
});
|
|
@@ -2583,8 +2681,8 @@ var useJoinMachine = (client, options) => {
|
|
|
2583
2681
|
};
|
|
2584
2682
|
} catch (err) {
|
|
2585
2683
|
log7.error("Could not redeem space invitation code", err, {
|
|
2586
|
-
F:
|
|
2587
|
-
L:
|
|
2684
|
+
F: __dxlog_file7,
|
|
2685
|
+
L: 488,
|
|
2588
2686
|
S: void 0,
|
|
2589
2687
|
C: (f, a) => f(...a)
|
|
2590
2688
|
});
|
|
@@ -2747,17 +2845,17 @@ var IdentityAdded = (props) => {
|
|
|
2747
2845
|
};
|
|
2748
2846
|
|
|
2749
2847
|
// packages/sdk/shell/src/panels/JoinPanel/steps/IdentityInput.tsx
|
|
2750
|
-
import React33, { useState as
|
|
2848
|
+
import React33, { useState as useState10 } from "react";
|
|
2751
2849
|
import { log as log8 } from "@dxos/log";
|
|
2752
|
-
import { useClient as
|
|
2850
|
+
import { useClient as useClient7 } from "@dxos/react-client";
|
|
2753
2851
|
import { useTranslation as useTranslation18 } from "@dxos/react-ui";
|
|
2754
|
-
var
|
|
2852
|
+
var __dxlog_file8 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/JoinPanel/steps/IdentityInput.tsx";
|
|
2755
2853
|
var IdentityInput = (props) => {
|
|
2756
2854
|
const { send, method } = props;
|
|
2757
2855
|
const isRecover = method === "recover identity";
|
|
2758
|
-
const client =
|
|
2856
|
+
const client = useClient7();
|
|
2759
2857
|
const { t } = useTranslation18("os");
|
|
2760
|
-
const [validationMessage, setValidationMessage] =
|
|
2858
|
+
const [validationMessage, setValidationMessage] = useState10("");
|
|
2761
2859
|
const createIdentity = (displayName) => {
|
|
2762
2860
|
void client.halo.createIdentity({
|
|
2763
2861
|
[isRecover ? "seedphrase" : "displayName"]: displayName
|
|
@@ -2768,7 +2866,7 @@ var IdentityInput = (props) => {
|
|
|
2768
2866
|
});
|
|
2769
2867
|
}, (error) => {
|
|
2770
2868
|
log8.catch(error, void 0, {
|
|
2771
|
-
F:
|
|
2869
|
+
F: __dxlog_file8,
|
|
2772
2870
|
L: 37,
|
|
2773
2871
|
S: void 0,
|
|
2774
2872
|
C: (f, a) => f(...a)
|
|
@@ -2786,7 +2884,7 @@ var IdentityInputImpl = (props) => {
|
|
|
2786
2884
|
const { method, send, active, onDisplayNameConfirm, validationMessage } = props;
|
|
2787
2885
|
const disabled = !active;
|
|
2788
2886
|
const { t } = useTranslation18("os");
|
|
2789
|
-
const [inputValue, setInputValue] =
|
|
2887
|
+
const [inputValue, setInputValue] = useState10("");
|
|
2790
2888
|
const isRecover = method === "recover identity";
|
|
2791
2889
|
return /* @__PURE__ */ React33.createElement(React33.Fragment, null, /* @__PURE__ */ React33.createElement("div", {
|
|
2792
2890
|
role: "none",
|
|
@@ -2816,30 +2914,12 @@ var IdentityInputImpl = (props) => {
|
|
|
2816
2914
|
// packages/sdk/shell/src/panels/JoinPanel/steps/InvitationAccepted.tsx
|
|
2817
2915
|
import React34, { cloneElement as cloneElement3 } from "react";
|
|
2818
2916
|
import { useTranslation as useTranslation19 } from "@dxos/react-ui";
|
|
2819
|
-
var InvitationAccepted = (props) => {
|
|
2820
|
-
const { active, Kind, doneActionParent, onDone } = props;
|
|
2821
|
-
const disabled = !active;
|
|
2822
|
-
const { t } = useTranslation19("os");
|
|
2823
|
-
const doneAction = /* @__PURE__ */ React34.createElement(Action, {
|
|
2824
|
-
variant: "primary",
|
|
2825
|
-
onClick: onDone,
|
|
2826
|
-
disabled,
|
|
2827
|
-
"data-autofocus": `success${Kind}Invitation finishingJoining${Kind}`,
|
|
2828
|
-
"data-testid": `${Kind.toLowerCase()}-invitation-accepted-done`
|
|
2829
|
-
}, t("done label"));
|
|
2830
|
-
return /* @__PURE__ */ React34.createElement(React34.Fragment, null, /* @__PURE__ */ React34.createElement("div", {
|
|
2831
|
-
role: "none",
|
|
2832
|
-
className: "grow flex flex-col justify-center"
|
|
2833
|
-
}, /* @__PURE__ */ React34.createElement("p", {
|
|
2834
|
-
className: "text-center text-sm font-normal"
|
|
2835
|
-
}, t("welcome message"))), /* @__PURE__ */ React34.createElement(Actions, null, doneActionParent ? /* @__PURE__ */ cloneElement3(doneActionParent, {}, doneAction) : doneAction));
|
|
2836
|
-
};
|
|
2837
2917
|
|
|
2838
2918
|
// packages/sdk/shell/src/panels/JoinPanel/steps/InvitationInput.tsx
|
|
2839
|
-
import React35, { useState as
|
|
2919
|
+
import React35, { useState as useState11, useEffect as useEffect5, cloneElement as cloneElement4 } from "react";
|
|
2840
2920
|
import { log as log9 } from "@dxos/log";
|
|
2841
2921
|
import { useTranslation as useTranslation20 } from "@dxos/react-ui";
|
|
2842
|
-
var
|
|
2922
|
+
var __dxlog_file9 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/JoinPanel/steps/InvitationInput.tsx";
|
|
2843
2923
|
var invitationCodeFromUrl = (text) => {
|
|
2844
2924
|
try {
|
|
2845
2925
|
const searchParams = new URLSearchParams(text.substring(text.lastIndexOf("?")));
|
|
@@ -2847,7 +2927,7 @@ var invitationCodeFromUrl = (text) => {
|
|
|
2847
2927
|
return invitation ?? text;
|
|
2848
2928
|
} catch (err) {
|
|
2849
2929
|
log9.catch(err, void 0, {
|
|
2850
|
-
F:
|
|
2930
|
+
F: __dxlog_file9,
|
|
2851
2931
|
L: 25,
|
|
2852
2932
|
S: void 0,
|
|
2853
2933
|
C: (f, a) => f(...a)
|
|
@@ -2859,8 +2939,8 @@ var InvitationInput = (props) => {
|
|
|
2859
2939
|
const { Kind, active, send, unredeemedCode, onExit, exitActionParent, onDone, doneActionParent, succeededKeys } = props;
|
|
2860
2940
|
const disabled = !active;
|
|
2861
2941
|
const { t } = useTranslation20("os");
|
|
2862
|
-
const [inputValue, setInputValue] =
|
|
2863
|
-
|
|
2942
|
+
const [inputValue, setInputValue] = useState11(unredeemedCode ?? "");
|
|
2943
|
+
useEffect5(() => {
|
|
2864
2944
|
unredeemedCode && setInputValue(unredeemedCode ?? "");
|
|
2865
2945
|
}, [
|
|
2866
2946
|
unredeemedCode
|
|
@@ -2900,16 +2980,9 @@ var InvitationInput = (props) => {
|
|
|
2900
2980
|
"data-autofocus": `inputting${Kind}InvitationCode`,
|
|
2901
2981
|
"data-testid": `${Kind.toLowerCase()}-invitation-input`,
|
|
2902
2982
|
onKeyUp: ({ key }) => key === "Enter" && handleNext()
|
|
2903
|
-
})), /* @__PURE__ */ React35.createElement(Actions, null, Kind === "Halo" ? /* @__PURE__ */ React35.createElement(Action, {
|
|
2904
|
-
variant: "ghost",
|
|
2905
|
-
disabled,
|
|
2906
|
-
onClick: () => send({
|
|
2907
|
-
type: "deselectAuthMethod"
|
|
2908
|
-
}),
|
|
2909
|
-
"data-testid": `${Kind.toLowerCase()}-invitation-input-back`
|
|
2910
|
-
}, t("back label")) : exitActionParent ? /* @__PURE__ */ cloneElement4(exitActionParent, {}, exitAction) : doneActionParent ? /* @__PURE__ */ cloneElement4(doneActionParent, {}, exitAction) : exitAction, /* @__PURE__ */ React35.createElement(Action, {
|
|
2983
|
+
})), /* @__PURE__ */ React35.createElement(Actions, null, Kind === "Halo" ? null : exitActionParent ? /* @__PURE__ */ cloneElement4(exitActionParent, {}, exitAction) : doneActionParent ? /* @__PURE__ */ cloneElement4(doneActionParent, {}, exitAction) : exitAction, /* @__PURE__ */ React35.createElement(Action, {
|
|
2911
2984
|
variant: "primary",
|
|
2912
|
-
disabled,
|
|
2985
|
+
disabled: disabled || inputValue.trim().length === 0,
|
|
2913
2986
|
onClick: handleNext,
|
|
2914
2987
|
"data-testid": `${Kind.toLowerCase()}-invitation-input-continue`
|
|
2915
2988
|
}, t("continue label"))));
|
|
@@ -2978,15 +3051,17 @@ var InvitationRescuer = (props) => {
|
|
|
2978
3051
|
};
|
|
2979
3052
|
|
|
2980
3053
|
// packages/sdk/shell/src/panels/JoinPanel/steps/InvitationAuthenticator.tsx
|
|
2981
|
-
import React37, { useState as
|
|
3054
|
+
import React37, { useState as useState12 } from "react";
|
|
3055
|
+
import { Invitation as Invitation6 } from "@dxos/react-client/invitations";
|
|
2982
3056
|
import { Input as Input3, useTranslation as useTranslation22 } from "@dxos/react-ui";
|
|
3057
|
+
import { descriptionText as descriptionText11 } from "@dxos/react-ui-theme";
|
|
2983
3058
|
import { hexToEmoji as hexToEmoji5 } from "@dxos/util";
|
|
2984
3059
|
var pinLength = 6;
|
|
2985
|
-
var InvitationAuthenticator = ({ failed, Kind, active, pending, invitationId, onInvitationAuthenticate, onInvitationCancel }) => {
|
|
3060
|
+
var InvitationAuthenticator = ({ failed, Kind, authMethod, active, pending, invitationId, onInvitationAuthenticate, onInvitationCancel }) => {
|
|
2986
3061
|
const disabled = !active || pending;
|
|
2987
3062
|
const { t } = useTranslation22("os");
|
|
2988
3063
|
const invitationType = Kind.toLowerCase();
|
|
2989
|
-
const [authCode, setAuthCode] =
|
|
3064
|
+
const [authCode, setAuthCode] = useState12("");
|
|
2990
3065
|
const onChange = ({ target: { value } }) => {
|
|
2991
3066
|
setAuthCode(value);
|
|
2992
3067
|
if (value.length === pinLength) {
|
|
@@ -3000,7 +3075,12 @@ var InvitationAuthenticator = ({ failed, Kind, active, pending, invitationId, on
|
|
|
3000
3075
|
validationValence: "error"
|
|
3001
3076
|
}, /* @__PURE__ */ React37.createElement(Input3.Label, {
|
|
3002
3077
|
asChild: true
|
|
3003
|
-
}, /* @__PURE__ */ React37.createElement(StepHeading, null, t("auth code input label"))
|
|
3078
|
+
}, 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, {
|
|
3079
|
+
className: descriptionText11
|
|
3080
|
+
}, t("authenticating label")), /* @__PURE__ */ React37.createElement("div", {
|
|
3081
|
+
role: "none",
|
|
3082
|
+
className: "grow"
|
|
3083
|
+
}))), authMethod === Invitation6.AuthMethod.SHARED_SECRET && /* @__PURE__ */ React37.createElement(Input3.PinInput, {
|
|
3004
3084
|
disabled,
|
|
3005
3085
|
length: pinLength,
|
|
3006
3086
|
onChange,
|
|
@@ -3013,7 +3093,7 @@ var InvitationAuthenticator = ({ failed, Kind, active, pending, invitationId, on
|
|
|
3013
3093
|
"data-1p-ignore": true
|
|
3014
3094
|
}), failed && /* @__PURE__ */ React37.createElement(Input3.DescriptionAndValidation, {
|
|
3015
3095
|
classNames: "text-center"
|
|
3016
|
-
}, /* @__PURE__ */ React37.createElement(Input3.Validation, null, t("failed to authenticate message")))), invitationId && /* @__PURE__ */ React37.createElement(React37.Fragment, null, /* @__PURE__ */ React37.createElement(Label, null, t("auth other device emoji message")), /* @__PURE__ */ React37.createElement("div", {
|
|
3096
|
+
}, /* @__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", {
|
|
3017
3097
|
className: "flex justify-center"
|
|
3018
3098
|
}, /* @__PURE__ */ React37.createElement(Emoji, {
|
|
3019
3099
|
text: hexToEmoji5(invitationId)
|
|
@@ -3035,7 +3115,7 @@ var InvitationAuthenticator = ({ failed, Kind, active, pending, invitationId, on
|
|
|
3035
3115
|
var stepStyles = "pbs-1 pbe-3 pli-3";
|
|
3036
3116
|
|
|
3037
3117
|
// packages/sdk/shell/src/styles/invitationStatusStyles.ts
|
|
3038
|
-
import { Invitation as
|
|
3118
|
+
import { Invitation as Invitation7 } from "@dxos/react-client/invitations";
|
|
3039
3119
|
var inactiveBgColor = "bg-neutral-100 dark:bg-neutral-600";
|
|
3040
3120
|
var activeBgColor = "bg-primary-500 dark:bg-primary-400";
|
|
3041
3121
|
var successBgColor = "bg-success-500 dark:bg-success-400";
|
|
@@ -3051,17 +3131,40 @@ var activeStrokeColor = "stroke-primary-400 dark:stroke-primary-150";
|
|
|
3051
3131
|
var successStrokeColor = "stroke-success-300 dark:stroke-primary-400";
|
|
3052
3132
|
var errorStrokeColor = "stroke-error-300 dark:stroke-error-500";
|
|
3053
3133
|
var cancelledStrokeColor = "stroke-warning-300 dark:stroke-warning-500";
|
|
3054
|
-
var resolvedStrokeColor = (status) => status ===
|
|
3055
|
-
var resolvedBgColor = (status) => status ===
|
|
3056
|
-
var resolvedTextColor = (status) => status ===
|
|
3134
|
+
var resolvedStrokeColor = (status) => status === Invitation7.State.ERROR ? errorStrokeColor : status === Invitation7.State.CANCELLED || status === Invitation7.State.TIMEOUT ? cancelledStrokeColor : successStrokeColor;
|
|
3135
|
+
var resolvedBgColor = (status) => status === Invitation7.State.ERROR ? errorBgColor : status === Invitation7.State.CANCELLED || status === Invitation7.State.TIMEOUT ? cancelledBgColor : successBgColor;
|
|
3136
|
+
var resolvedTextColor = (status) => status === Invitation7.State.ERROR ? errorTextColor : status === Invitation7.State.CANCELLED || status === Invitation7.State.TIMEOUT ? cancelledTextColor : successTextColor;
|
|
3057
3137
|
|
|
3058
3138
|
// packages/sdk/shell/src/panels/JoinPanel/JoinPanel.tsx
|
|
3059
|
-
var
|
|
3139
|
+
var __dxlog_file10 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/JoinPanel/JoinPanel.tsx";
|
|
3060
3140
|
var JoinPanelImpl = (props) => {
|
|
3061
|
-
const {
|
|
3062
|
-
|
|
3063
|
-
|
|
3064
|
-
|
|
3141
|
+
const {
|
|
3142
|
+
titleId,
|
|
3143
|
+
send,
|
|
3144
|
+
activeView,
|
|
3145
|
+
failed,
|
|
3146
|
+
mode,
|
|
3147
|
+
unredeemedCodes,
|
|
3148
|
+
invitationIds,
|
|
3149
|
+
invitationStates,
|
|
3150
|
+
invitationAuthMethods,
|
|
3151
|
+
succeededKeys,
|
|
3152
|
+
failReasons,
|
|
3153
|
+
onExit,
|
|
3154
|
+
onHaloDone,
|
|
3155
|
+
// onSpaceDone,
|
|
3156
|
+
exitActionParent,
|
|
3157
|
+
doneActionParent,
|
|
3158
|
+
onHaloInvitationCancel,
|
|
3159
|
+
onSpaceInvitationCancel,
|
|
3160
|
+
onHaloInvitationAuthenticate,
|
|
3161
|
+
onSpaceInvitationAuthenticate,
|
|
3162
|
+
onCancelResetStorage,
|
|
3163
|
+
onConfirmResetStorage,
|
|
3164
|
+
IdentityInput: IdentityInputComponent = IdentityInput,
|
|
3165
|
+
ConfirmReset: ConfirmResetComponent = ConfirmReset
|
|
3166
|
+
} = props;
|
|
3167
|
+
return /* @__PURE__ */ React38.createElement(React38.Fragment, null, mode !== "halo-only" && /* @__PURE__ */ React38.createElement(JoinHeading, {
|
|
3065
3168
|
titleId,
|
|
3066
3169
|
mode,
|
|
3067
3170
|
onExit,
|
|
@@ -3127,21 +3230,13 @@ var JoinPanelImpl = (props) => {
|
|
|
3127
3230
|
send,
|
|
3128
3231
|
Kind: "Halo",
|
|
3129
3232
|
invitationId: invitationIds?.Halo,
|
|
3233
|
+
authMethod: invitationAuthMethods?.Halo,
|
|
3130
3234
|
active: activeView === "halo invitation authenticator",
|
|
3131
3235
|
onInvitationCancel: onHaloInvitationCancel,
|
|
3132
3236
|
onInvitationAuthenticate: onHaloInvitationAuthenticate,
|
|
3133
3237
|
...failed.has("Halo") && {
|
|
3134
3238
|
failed: true
|
|
3135
3239
|
}
|
|
3136
|
-
})), /* @__PURE__ */ React38.createElement(Viewport.View, {
|
|
3137
|
-
classNames: stepStyles,
|
|
3138
|
-
id: "halo invitation accepted"
|
|
3139
|
-
}, /* @__PURE__ */ React38.createElement(InvitationAccepted, {
|
|
3140
|
-
send,
|
|
3141
|
-
Kind: "Halo",
|
|
3142
|
-
active: activeView === "halo invitation accepted",
|
|
3143
|
-
doneActionParent,
|
|
3144
|
-
onDone: onHaloDone
|
|
3145
3240
|
})), /* @__PURE__ */ React38.createElement(Viewport.View, {
|
|
3146
3241
|
classNames: stepStyles,
|
|
3147
3242
|
id: "identity added"
|
|
@@ -3183,25 +3278,17 @@ var JoinPanelImpl = (props) => {
|
|
|
3183
3278
|
send,
|
|
3184
3279
|
Kind: "Space",
|
|
3185
3280
|
invitationId: invitationIds?.Space,
|
|
3281
|
+
authMethod: invitationAuthMethods?.Space,
|
|
3186
3282
|
active: activeView === "space invitation authenticator",
|
|
3187
3283
|
onInvitationCancel: onSpaceInvitationCancel,
|
|
3188
3284
|
onInvitationAuthenticate: onSpaceInvitationAuthenticate,
|
|
3189
3285
|
...failed.has("Space") && {
|
|
3190
3286
|
failed: true
|
|
3191
3287
|
}
|
|
3192
|
-
})), /* @__PURE__ */ React38.createElement(Viewport.View, {
|
|
3193
|
-
classNames: stepStyles,
|
|
3194
|
-
id: "space invitation accepted"
|
|
3195
|
-
}, /* @__PURE__ */ React38.createElement(InvitationAccepted, {
|
|
3196
|
-
send,
|
|
3197
|
-
Kind: "Space",
|
|
3198
|
-
active: activeView === "space invitation accepted",
|
|
3199
|
-
doneActionParent,
|
|
3200
|
-
onDone: onSpaceDone
|
|
3201
3288
|
})))));
|
|
3202
3289
|
};
|
|
3203
3290
|
var JoinPanel = ({ titleId: propsTitleId, mode = "default", initialDisposition = "default", initialInvitationCode, exitActionParent, onExit, doneActionParent, onDone: propsOnDone, onCancelResetStorage }) => {
|
|
3204
|
-
const client =
|
|
3291
|
+
const client = useClient8();
|
|
3205
3292
|
const identity = useIdentity2();
|
|
3206
3293
|
const { hasIosKeyboard } = useThemeContext5();
|
|
3207
3294
|
const titleId = useId8("joinPanel__heading", propsTitleId);
|
|
@@ -3217,11 +3304,11 @@ var JoinPanel = ({ titleId: propsTitleId, mode = "default", initialDisposition =
|
|
|
3217
3304
|
}
|
|
3218
3305
|
}
|
|
3219
3306
|
});
|
|
3220
|
-
|
|
3307
|
+
useEffect6(() => {
|
|
3221
3308
|
const subscription = joinService.subscribe((state) => {
|
|
3222
3309
|
log10("[state]", state, {
|
|
3223
|
-
F:
|
|
3224
|
-
L:
|
|
3310
|
+
F: __dxlog_file10,
|
|
3311
|
+
L: 210,
|
|
3225
3312
|
S: void 0,
|
|
3226
3313
|
C: (f, a) => f(...a)
|
|
3227
3314
|
});
|
|
@@ -3230,7 +3317,7 @@ var JoinPanel = ({ titleId: propsTitleId, mode = "default", initialDisposition =
|
|
|
3230
3317
|
}, [
|
|
3231
3318
|
joinService
|
|
3232
3319
|
]);
|
|
3233
|
-
|
|
3320
|
+
useEffect6(() => {
|
|
3234
3321
|
const stateStack = joinState.configuration[0].id.split(".");
|
|
3235
3322
|
const innermostState = stateStack[stateStack.length - 1];
|
|
3236
3323
|
const autoFocusValue = innermostState === "finishingJoining" ? "successSpaceInvitation" : innermostState;
|
|
@@ -3363,6 +3450,18 @@ var JoinPanel = ({ titleId: propsTitleId, mode = "default", initialDisposition =
|
|
|
3363
3450
|
}, [
|
|
3364
3451
|
joinState
|
|
3365
3452
|
]);
|
|
3453
|
+
useEffect6(() => {
|
|
3454
|
+
switch (activeView) {
|
|
3455
|
+
case "halo invitation accepted":
|
|
3456
|
+
onHaloDone();
|
|
3457
|
+
break;
|
|
3458
|
+
case "space invitation accepted":
|
|
3459
|
+
onSpaceDone();
|
|
3460
|
+
break;
|
|
3461
|
+
}
|
|
3462
|
+
}, [
|
|
3463
|
+
activeView
|
|
3464
|
+
]);
|
|
3366
3465
|
const failed = useMemo4(() => {
|
|
3367
3466
|
const result = /* @__PURE__ */ new Set();
|
|
3368
3467
|
switch (true) {
|
|
@@ -3405,6 +3504,12 @@ var JoinPanel = ({ titleId: propsTitleId, mode = "default", initialDisposition =
|
|
|
3405
3504
|
}), [
|
|
3406
3505
|
joinState
|
|
3407
3506
|
]);
|
|
3507
|
+
const invitationAuthMethods = useMemo4(() => ({
|
|
3508
|
+
Halo: joinState.context.halo.invitationObservable?.get().authMethod,
|
|
3509
|
+
Space: joinState.context.space.invitationObservable?.get().authMethod
|
|
3510
|
+
}), [
|
|
3511
|
+
joinState
|
|
3512
|
+
]);
|
|
3408
3513
|
const invitationIds = useMemo4(() => ({
|
|
3409
3514
|
Halo: joinState.context.halo.invitationObservable?.get().invitationId,
|
|
3410
3515
|
Space: joinState.context.space.invitationObservable?.get().invitationId
|
|
@@ -3461,6 +3566,7 @@ var JoinPanel = ({ titleId: propsTitleId, mode = "default", initialDisposition =
|
|
|
3461
3566
|
unredeemedCodes,
|
|
3462
3567
|
invitationIds,
|
|
3463
3568
|
invitationStates,
|
|
3569
|
+
invitationAuthMethods,
|
|
3464
3570
|
succeededKeys,
|
|
3465
3571
|
identity,
|
|
3466
3572
|
onExit,
|
|
@@ -3489,16 +3595,16 @@ var JoinPanel = ({ titleId: propsTitleId, mode = "default", initialDisposition =
|
|
|
3489
3595
|
|
|
3490
3596
|
// packages/sdk/shell/src/panels/SpacePanel/SpacePanel.tsx
|
|
3491
3597
|
import { Planet } from "@phosphor-icons/react";
|
|
3492
|
-
import React40, { useEffect as
|
|
3598
|
+
import React40, { useEffect as useEffect7, useMemo as useMemo5 } from "react";
|
|
3493
3599
|
import { log as log13 } from "@dxos/log";
|
|
3494
3600
|
import { useInvitationStatus as useInvitationStatus3 } from "@dxos/react-client/invitations";
|
|
3495
|
-
import {
|
|
3601
|
+
import { useId as useId9, useTranslation as useTranslation24 } from "@dxos/react-ui";
|
|
3496
3602
|
|
|
3497
3603
|
// packages/sdk/shell/src/panels/SpacePanel/spaceMachine.ts
|
|
3498
3604
|
import { useMachine as useMachine3 } from "@xstate/react";
|
|
3499
3605
|
import { assign as assign3, createMachine as createMachine3 } from "xstate";
|
|
3500
3606
|
import { log as log11 } from "@dxos/log";
|
|
3501
|
-
var
|
|
3607
|
+
var __dxlog_file11 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/SpacePanel/spaceMachine.ts";
|
|
3502
3608
|
var spaceMachine = createMachine3({
|
|
3503
3609
|
id: "space",
|
|
3504
3610
|
predictableActionArguments: true,
|
|
@@ -3539,7 +3645,7 @@ var spaceMachine = createMachine3({
|
|
|
3539
3645
|
event,
|
|
3540
3646
|
context
|
|
3541
3647
|
}, {
|
|
3542
|
-
F:
|
|
3648
|
+
F: __dxlog_file11,
|
|
3543
3649
|
L: 53,
|
|
3544
3650
|
S: void 0,
|
|
3545
3651
|
C: (f, a) => f(...a)
|
|
@@ -3558,23 +3664,23 @@ var useSpaceMachine = (options) => {
|
|
|
3558
3664
|
|
|
3559
3665
|
// packages/sdk/shell/src/panels/SpacePanel/steps/SpaceManager.tsx
|
|
3560
3666
|
import { Placeholder as Placeholder2, UserPlus, UsersThree } from "@phosphor-icons/react";
|
|
3561
|
-
import React39, { useCallback as useCallback7, useState as
|
|
3667
|
+
import React39, { useCallback as useCallback7, useState as useState13 } from "react";
|
|
3562
3668
|
import { log as log12 } from "@dxos/log";
|
|
3563
3669
|
import { useConfig } from "@dxos/react-client";
|
|
3564
3670
|
import { useSpaceInvitations as useSpaceInvitations2 } from "@dxos/react-client/echo";
|
|
3565
|
-
import { Invitation as
|
|
3671
|
+
import { Invitation as Invitation8, InvitationEncoder as InvitationEncoder4 } from "@dxos/react-client/invitations";
|
|
3566
3672
|
import { ScrollArea, useTranslation as useTranslation23 } from "@dxos/react-ui";
|
|
3567
|
-
import { descriptionText as
|
|
3568
|
-
var
|
|
3673
|
+
import { descriptionText as descriptionText12, mx as mx24 } from "@dxos/react-ui-theme";
|
|
3674
|
+
var __dxlog_file12 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/SpacePanel/steps/SpaceManager.tsx";
|
|
3569
3675
|
var activeActionKey = "dxos:react-shell/space-manager/active-action";
|
|
3570
3676
|
var handleInvitationEvent = (invitation, subscription) => {
|
|
3571
3677
|
const invitationCode = InvitationEncoder4.encode(invitation);
|
|
3572
|
-
if (invitation.state ===
|
|
3678
|
+
if (invitation.state === Invitation8.State.CONNECTING) {
|
|
3573
3679
|
log12.info(JSON.stringify({
|
|
3574
3680
|
invitationCode,
|
|
3575
3681
|
authCode: invitation.authCode
|
|
3576
3682
|
}), void 0, {
|
|
3577
|
-
F:
|
|
3683
|
+
F: __dxlog_file12,
|
|
3578
3684
|
L: 40,
|
|
3579
3685
|
S: void 0,
|
|
3580
3686
|
C: (f, a) => f(...a)
|
|
@@ -3594,8 +3700,8 @@ var SpaceManager = (props) => {
|
|
|
3594
3700
|
icon: UserPlus,
|
|
3595
3701
|
onClick: useCallback7(() => {
|
|
3596
3702
|
const invitation = space.share?.({
|
|
3597
|
-
type:
|
|
3598
|
-
authMethod:
|
|
3703
|
+
type: Invitation8.Type.INTERACTIVE,
|
|
3704
|
+
authMethod: Invitation8.AuthMethod.SHARED_SECRET,
|
|
3599
3705
|
multiUse: false,
|
|
3600
3706
|
target
|
|
3601
3707
|
});
|
|
@@ -3612,8 +3718,8 @@ var SpaceManager = (props) => {
|
|
|
3612
3718
|
icon: UsersThree,
|
|
3613
3719
|
onClick: useCallback7(() => {
|
|
3614
3720
|
const invitation = space.share?.({
|
|
3615
|
-
type:
|
|
3616
|
-
authMethod:
|
|
3721
|
+
type: Invitation8.Type.DELEGATED,
|
|
3722
|
+
authMethod: Invitation8.AuthMethod.KNOWN_PUBLIC_KEY,
|
|
3617
3723
|
multiUse: true,
|
|
3618
3724
|
target
|
|
3619
3725
|
});
|
|
@@ -3644,20 +3750,20 @@ var SpaceManagerImpl = (props) => {
|
|
|
3644
3750
|
}
|
|
3645
3751
|
}
|
|
3646
3752
|
};
|
|
3647
|
-
const [activeAction, setInternalActiveAction] =
|
|
3753
|
+
const [activeAction, setInternalActiveAction] = useState13(localStorage.getItem(activeActionKey) ?? "inviteOne");
|
|
3648
3754
|
const setActiveAction = (nextAction) => {
|
|
3649
3755
|
setInternalActiveAction(nextAction);
|
|
3650
3756
|
localStorage.setItem(activeActionKey, nextAction);
|
|
3651
3757
|
};
|
|
3652
3758
|
const visibleInvitations = showInactiveInvitations ? invitations : invitations?.filter((invitation) => ![
|
|
3653
|
-
|
|
3759
|
+
Invitation8.State.CANCELLED
|
|
3654
3760
|
].includes(invitation.get().state));
|
|
3655
3761
|
return /* @__PURE__ */ React39.createElement(React39.Fragment, null, /* @__PURE__ */ React39.createElement(ScrollArea.Root, {
|
|
3656
3762
|
classNames: "grow shrink basis-28 -mli-2"
|
|
3657
3763
|
}, /* @__PURE__ */ React39.createElement(ScrollArea.Viewport, {
|
|
3658
3764
|
classNames: "is-full pie-2"
|
|
3659
3765
|
}, !!visibleInvitations?.length && /* @__PURE__ */ React39.createElement(React39.Fragment, null, /* @__PURE__ */ React39.createElement("h3", {
|
|
3660
|
-
className: mx24(headingFragment,
|
|
3766
|
+
className: mx24(headingFragment, descriptionText12)
|
|
3661
3767
|
}, t("invitation list heading")), /* @__PURE__ */ React39.createElement(InvitationListComponent, {
|
|
3662
3768
|
className: "mb-2",
|
|
3663
3769
|
send,
|
|
@@ -3665,7 +3771,7 @@ var SpaceManagerImpl = (props) => {
|
|
|
3665
3771
|
onClickRemove: (invitation) => invitation.cancel(),
|
|
3666
3772
|
createInvitationUrl
|
|
3667
3773
|
}), /* @__PURE__ */ React39.createElement("h3", {
|
|
3668
|
-
className: mx24(headingFragment,
|
|
3774
|
+
className: mx24(headingFragment, descriptionText12, "mbs-2")
|
|
3669
3775
|
}, t("space member list heading"))), /* @__PURE__ */ React39.createElement(SpaceMemberListComponent, {
|
|
3670
3776
|
spaceKey: space.key,
|
|
3671
3777
|
includeSelf: true
|
|
@@ -3681,7 +3787,7 @@ var SpaceManagerImpl = (props) => {
|
|
|
3681
3787
|
};
|
|
3682
3788
|
|
|
3683
3789
|
// packages/sdk/shell/src/panels/SpacePanel/SpacePanel.tsx
|
|
3684
|
-
var
|
|
3790
|
+
var __dxlog_file13 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/SpacePanel/SpacePanel.tsx";
|
|
3685
3791
|
var SpacePanelHeading = ({ titleId, space, onDone }) => {
|
|
3686
3792
|
const { t } = useTranslation24("os");
|
|
3687
3793
|
const name = space.properties.name;
|
|
@@ -3704,9 +3810,7 @@ var SpacePanelHeading = ({ titleId, space, onDone }) => {
|
|
|
3704
3810
|
};
|
|
3705
3811
|
var SpacePanelImpl = (props) => {
|
|
3706
3812
|
const { titleId, activeView, space, target, SpaceManager: SpaceManagerComponent = SpaceManager, InvitationManager: InvitationManagerComponent = InvitationManager, ...rest } = props;
|
|
3707
|
-
return /* @__PURE__ */ React40.createElement(
|
|
3708
|
-
density: "fine"
|
|
3709
|
-
}, /* @__PURE__ */ React40.createElement(SpacePanelHeading, {
|
|
3813
|
+
return /* @__PURE__ */ React40.createElement(React40.Fragment, null, /* @__PURE__ */ React40.createElement(SpacePanelHeading, {
|
|
3710
3814
|
...rest,
|
|
3711
3815
|
titleId,
|
|
3712
3816
|
space
|
|
@@ -3744,10 +3848,10 @@ var SpacePanel = ({ titleId: propsTitleId, createInvitationUrl = (code) => code,
|
|
|
3744
3848
|
space: props.space
|
|
3745
3849
|
}
|
|
3746
3850
|
});
|
|
3747
|
-
|
|
3851
|
+
useEffect7(() => {
|
|
3748
3852
|
const subscription = spaceService.subscribe((state) => {
|
|
3749
3853
|
log13("[state]", state, {
|
|
3750
|
-
F:
|
|
3854
|
+
F: __dxlog_file13,
|
|
3751
3855
|
L: 94,
|
|
3752
3856
|
S: void 0,
|
|
3753
3857
|
C: (f, a) => f(...a)
|
|
@@ -3858,9 +3962,9 @@ import { defaultTx } from "@dxos/react-ui-theme";
|
|
|
3858
3962
|
import { createIFramePort } from "@dxos/rpc-tunnel";
|
|
3859
3963
|
|
|
3860
3964
|
// packages/sdk/shell/src/composites/Shell/Shell.tsx
|
|
3861
|
-
import React46, { useEffect as
|
|
3965
|
+
import React46, { useEffect as useEffect8, useState as useState14 } from "react";
|
|
3862
3966
|
import { log as log14 } from "@dxos/log";
|
|
3863
|
-
import { useClient as
|
|
3967
|
+
import { useClient as useClient9 } from "@dxos/react-client";
|
|
3864
3968
|
import { ShellDisplay, ShellLayout } from "@dxos/react-client";
|
|
3865
3969
|
import { useSpace as useSpace2 } from "@dxos/react-client/echo";
|
|
3866
3970
|
|
|
@@ -3898,22 +4002,22 @@ var StatusDialog = () => {
|
|
|
3898
4002
|
};
|
|
3899
4003
|
|
|
3900
4004
|
// packages/sdk/shell/src/composites/Shell/Shell.tsx
|
|
3901
|
-
var
|
|
4005
|
+
var __dxlog_file14 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/composites/Shell/Shell.tsx";
|
|
3902
4006
|
var blurActiveElement = () => document.activeElement?.blur?.();
|
|
3903
4007
|
var Shell = ({ runtime }) => {
|
|
3904
|
-
const [{ layout, invitationCode, spaceKey, spaceId, target }, setLayout] =
|
|
4008
|
+
const [{ layout, invitationCode, spaceKey, spaceId, target }, setLayout] = useState14({
|
|
3905
4009
|
layout: runtime.layout,
|
|
3906
4010
|
invitationCode: runtime.invitationCode,
|
|
3907
4011
|
spaceKey: runtime.spaceKey,
|
|
3908
4012
|
spaceId: runtime.spaceId,
|
|
3909
4013
|
target: runtime.target
|
|
3910
4014
|
});
|
|
3911
|
-
const [{ invitationUrl, deviceInvitationParam, spaceInvitationParam }, setInvitationUrl] =
|
|
4015
|
+
const [{ invitationUrl, deviceInvitationParam, spaceInvitationParam }, setInvitationUrl] = useState14({
|
|
3912
4016
|
invitationUrl: runtime.invitationUrl,
|
|
3913
4017
|
deviceInvitationParam: runtime.deviceInvitationParam,
|
|
3914
4018
|
spaceInvitationParam: runtime.spaceInvitationParam
|
|
3915
4019
|
});
|
|
3916
|
-
const client =
|
|
4020
|
+
const client = useClient9();
|
|
3917
4021
|
const space = useSpace2(spaceId ?? spaceKey);
|
|
3918
4022
|
const createDeviceInvitationUrl = (invitationCode2) => {
|
|
3919
4023
|
const baseUrl = new URL(invitationUrl);
|
|
@@ -3925,7 +4029,7 @@ var Shell = ({ runtime }) => {
|
|
|
3925
4029
|
baseUrl.searchParams.set(spaceInvitationParam, invitationCode2);
|
|
3926
4030
|
return baseUrl.toString();
|
|
3927
4031
|
};
|
|
3928
|
-
|
|
4032
|
+
useEffect8(() => {
|
|
3929
4033
|
const unsubscribeLayout = runtime.layoutUpdate.on((request) => setLayout(request));
|
|
3930
4034
|
const unsubscribeInvitationUrl = runtime.invitationUrlUpdate.on((request) => setInvitationUrl(request));
|
|
3931
4035
|
return () => {
|
|
@@ -3935,10 +4039,10 @@ var Shell = ({ runtime }) => {
|
|
|
3935
4039
|
}, [
|
|
3936
4040
|
runtime
|
|
3937
4041
|
]);
|
|
3938
|
-
|
|
4042
|
+
useEffect8(() => {
|
|
3939
4043
|
if (layout === ShellLayout.SPACE && !space) {
|
|
3940
4044
|
log14.warn("No space found for shell space invitations.", void 0, {
|
|
3941
|
-
F:
|
|
4045
|
+
F: __dxlog_file14,
|
|
3942
4046
|
L: 67,
|
|
3943
4047
|
S: void 0,
|
|
3944
4048
|
C: (f, a) => f(...a)
|
|
@@ -3970,9 +4074,9 @@ var Shell = ({ runtime }) => {
|
|
|
3970
4074
|
onCancelResetStorage: () => runtime.setLayout({
|
|
3971
4075
|
layout: ShellLayout.IDENTITY
|
|
3972
4076
|
}),
|
|
3973
|
-
onDone: () => {
|
|
4077
|
+
onDone: async () => {
|
|
3974
4078
|
blurActiveElement();
|
|
3975
|
-
|
|
4079
|
+
await runtime.setAppContext({
|
|
3976
4080
|
display: ShellDisplay.NONE
|
|
3977
4081
|
});
|
|
3978
4082
|
runtime.setLayout({
|
|
@@ -4000,8 +4104,10 @@ var Shell = ({ runtime }) => {
|
|
|
4000
4104
|
layout: ShellLayout.STATUS
|
|
4001
4105
|
});
|
|
4002
4106
|
await client.reset();
|
|
4003
|
-
return runtime.
|
|
4004
|
-
|
|
4107
|
+
return runtime.setAppContext({
|
|
4108
|
+
display: ShellDisplay.NONE,
|
|
4109
|
+
reset: true,
|
|
4110
|
+
target: "deviceInvitation"
|
|
4005
4111
|
});
|
|
4006
4112
|
},
|
|
4007
4113
|
onDone: async () => {
|
|
@@ -4063,10 +4169,10 @@ var Shell = ({ runtime }) => {
|
|
|
4063
4169
|
// packages/sdk/shell/src/composites/Shell/shell-runtime.ts
|
|
4064
4170
|
import { Event } from "@dxos/async";
|
|
4065
4171
|
import { appServiceBundle, shellServiceBundle } from "@dxos/client-protocol";
|
|
4066
|
-
import { invariant as
|
|
4172
|
+
import { invariant as invariant3 } from "@dxos/invariant";
|
|
4067
4173
|
import { ShellLayout as ShellLayout2 } from "@dxos/protocols/proto/dxos/iframe";
|
|
4068
4174
|
import { createProtoRpcPeer } from "@dxos/rpc";
|
|
4069
|
-
var
|
|
4175
|
+
var __dxlog_file15 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/composites/Shell/shell-runtime.ts";
|
|
4070
4176
|
var ShellRuntimeImpl = class {
|
|
4071
4177
|
constructor(_port) {
|
|
4072
4178
|
this._port = _port;
|
|
@@ -4122,8 +4228,8 @@ var ShellRuntimeImpl = class {
|
|
|
4122
4228
|
});
|
|
4123
4229
|
}
|
|
4124
4230
|
async setAppContext(context) {
|
|
4125
|
-
|
|
4126
|
-
F:
|
|
4231
|
+
invariant3(this._appRpc, "runtime not open", {
|
|
4232
|
+
F: __dxlog_file15,
|
|
4127
4233
|
L: 83,
|
|
4128
4234
|
S: this,
|
|
4129
4235
|
A: [
|
|
@@ -4201,7 +4307,7 @@ var os = {
|
|
|
4201
4307
|
"recover identity input label": "Type or paste your seed phrase",
|
|
4202
4308
|
"failed to create identity message": "Failed to create an identity.",
|
|
4203
4309
|
"failed to recover identity message": "Failed to recover an identity from the provided seed phrase.",
|
|
4204
|
-
"failed to authenticate message": "Incorrect
|
|
4310
|
+
"failed to authenticate message": "Incorrect code.",
|
|
4205
4311
|
"identity added label": "Created identity & added to this device:",
|
|
4206
4312
|
"join space as identity heading": "<part>as </part><part><icon/><label>{{labelValue}}</label></part>",
|
|
4207
4313
|
"error status label": "Failed",
|
|
@@ -4209,8 +4315,8 @@ var os = {
|
|
|
4209
4315
|
"cancelled status label": "Cancelled",
|
|
4210
4316
|
"init status label": "Ready to connect",
|
|
4211
4317
|
"connecting status label": "Connecting\u2026",
|
|
4212
|
-
"connected status label": "Enter
|
|
4213
|
-
"authenticating status label": "Enter
|
|
4318
|
+
"connected status label": "Enter authentication code",
|
|
4319
|
+
"authenticating status label": "Enter authentication code",
|
|
4214
4320
|
"success status label": "Success",
|
|
4215
4321
|
"cancel label": "Cancel",
|
|
4216
4322
|
"done label": "Done",
|
|
@@ -4313,7 +4419,8 @@ var os = {
|
|
|
4313
4419
|
"destroying agent label": "Stopping agent\u2026",
|
|
4314
4420
|
"getting agent label": "Checking agent status\u2026",
|
|
4315
4421
|
"agent requested label": "Agent requested",
|
|
4316
|
-
"agent requested description": "The agent service is creating an agent for you. Once the agent connects, it will display in the devices list."
|
|
4422
|
+
"agent requested description": "The agent service is creating an agent for you. Once the agent connects, it will display in the devices list.",
|
|
4423
|
+
"authenticating label": "Authenticating\u2026"
|
|
4317
4424
|
};
|
|
4318
4425
|
|
|
4319
4426
|
// packages/sdk/shell/src/translations/index.ts
|
|
@@ -4338,7 +4445,8 @@ var runShell = async (config = new Config()) => {
|
|
|
4338
4445
|
]
|
|
4339
4446
|
}, /* @__PURE__ */ React47.createElement(ClientProvider, {
|
|
4340
4447
|
config,
|
|
4341
|
-
services
|
|
4448
|
+
services,
|
|
4449
|
+
noBanner: true
|
|
4342
4450
|
}, /* @__PURE__ */ React47.createElement(ClipboardProvider, null, /* @__PURE__ */ React47.createElement(Tooltip8.Provider, null, /* @__PURE__ */ React47.createElement(AgentHostingProvider, null, /* @__PURE__ */ React47.createElement(Shell, {
|
|
4343
4451
|
runtime
|
|
4344
4452
|
}))))))));
|
|
@@ -4370,8 +4478,8 @@ var Fallback = ({ onClose }) => {
|
|
|
4370
4478
|
};
|
|
4371
4479
|
|
|
4372
4480
|
// packages/sdk/shell/src/composites/Shell/ShellContext.tsx
|
|
4373
|
-
import React48, { createContext as createContext2, useCallback as useCallback8, useContext as useContext2, useEffect as
|
|
4374
|
-
import { useClient as
|
|
4481
|
+
import React48, { createContext as createContext2, useCallback as useCallback8, useContext as useContext2, useEffect as useEffect9, useMemo as useMemo6, useState as useState15 } from "react";
|
|
4482
|
+
import { useClient as useClient10, ShellDisplay as ShellDisplay3, ShellLayout as ShellLayout4 } from "@dxos/react-client";
|
|
4375
4483
|
import { useIdentity as useIdentity3 } from "@dxos/react-client/halo";
|
|
4376
4484
|
import { mx as mx25 } from "@dxos/react-ui-theme";
|
|
4377
4485
|
|
|
@@ -4428,7 +4536,7 @@ var MemoryShellRuntime = class {
|
|
|
4428
4536
|
// packages/sdk/shell/src/composites/Shell/ShellContext.tsx
|
|
4429
4537
|
var ShellContext = /* @__PURE__ */ createContext2({});
|
|
4430
4538
|
var useShell = () => {
|
|
4431
|
-
const client =
|
|
4539
|
+
const client = useClient10();
|
|
4432
4540
|
const { runtime, setDisplay } = useContext2(ShellContext);
|
|
4433
4541
|
const setLayout = async (layout, options) => {
|
|
4434
4542
|
if (runtime) {
|
|
@@ -4449,9 +4557,9 @@ var useShell = () => {
|
|
|
4449
4557
|
};
|
|
4450
4558
|
};
|
|
4451
4559
|
var ShellProvider = ({ space, deviceInvitationCode, spaceInvitationCode, onJoinedSpace, children }) => {
|
|
4452
|
-
const client =
|
|
4560
|
+
const client = useClient10();
|
|
4453
4561
|
const identity = useIdentity3();
|
|
4454
|
-
const [display, setDisplay] =
|
|
4562
|
+
const [display, setDisplay] = useState15(!identity || spaceInvitationCode || deviceInvitationCode ? ShellDisplay3.FULLSCREEN : ShellDisplay3.NONE);
|
|
4455
4563
|
const shellRuntime = useMemo6(() => {
|
|
4456
4564
|
if (client.config.get("runtime.app.env.DX_VAULT") !== "false") {
|
|
4457
4565
|
return;
|
|
@@ -4498,7 +4606,7 @@ var ShellProvider = ({ space, deviceInvitationCode, spaceInvitationCode, onJoine
|
|
|
4498
4606
|
space,
|
|
4499
4607
|
shellRuntime
|
|
4500
4608
|
]);
|
|
4501
|
-
|
|
4609
|
+
useEffect9(() => {
|
|
4502
4610
|
if (!shellRuntime) {
|
|
4503
4611
|
return;
|
|
4504
4612
|
}
|
|
@@ -4508,7 +4616,7 @@ var ShellProvider = ({ space, deviceInvitationCode, spaceInvitationCode, onJoine
|
|
|
4508
4616
|
shellRuntime,
|
|
4509
4617
|
handleKeyDown
|
|
4510
4618
|
]);
|
|
4511
|
-
|
|
4619
|
+
useEffect9(() => {
|
|
4512
4620
|
if (!shellRuntime) {
|
|
4513
4621
|
return;
|
|
4514
4622
|
}
|