@dxos/shell 0.6.13-main.ed424a1 → 0.6.13-staging.1e988a3
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 +10165 -9870
- package/dist/bundle/shell.mjs.map +1 -1
- package/dist/bundle/shell.umd.js +78 -76
- 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 +96 -195
- package/dist/lib/browser/react.mjs.map +4 -4
- 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.stories.d.ts.map +1 -1
- package/dist/types/src/panels/IdentityPanel/IdentityPanel.stories.js +1 -6
- package/dist/types/src/panels/IdentityPanel/IdentityPanel.stories.js.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 +108 -10
- package/dist/types/src/panels/IdentityPanel/useAgentHandlers.js.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 +10 -4
- package/dist/types/src/playwright/invitations-manager.js.map +1 -1
- package/dist/types/src/playwright/invitations.spec.js +32 -31
- 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 +2 -12
- package/dist/types/src/playwright/playwright.config.js.map +1 -1
- package/package.json +26 -27
- package/src/composites/Shell/run-shell.tsx +1 -1
- package/src/panels/IdentityPanel/IdentityPanel.stories.tsx +1 -6
- package/src/panels/IdentityPanel/useAgentHandlers.ts +114 -9
- package/src/playwright/invitations-manager.ts +8 -4
- package/src/playwright/invitations.spec.ts +33 -32
- package/src/playwright/playwright.config.ts +2 -13
- package/dist/types/src/panels/IdentityPanel/useEdgeAgentsHandlers.d.ts +0 -8
- package/dist/types/src/panels/IdentityPanel/useEdgeAgentsHandlers.d.ts.map +0 -1
- package/dist/types/src/panels/IdentityPanel/useEdgeAgentsHandlers.js +0 -84
- package/dist/types/src/panels/IdentityPanel/useEdgeAgentsHandlers.js.map +0 -1
- package/dist/types/src/panels/IdentityPanel/useKubeAgentHandlers.d.ts +0 -8
- package/dist/types/src/panels/IdentityPanel/useKubeAgentHandlers.d.ts.map +0 -1
- package/dist/types/src/panels/IdentityPanel/useKubeAgentHandlers.js +0 -119
- package/dist/types/src/panels/IdentityPanel/useKubeAgentHandlers.js.map +0 -1
- package/src/panels/IdentityPanel/useEdgeAgentsHandlers.ts +0 -96
- package/src/panels/IdentityPanel/useKubeAgentHandlers.ts +0 -128
|
@@ -1238,10 +1238,10 @@ 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 useEffect3, useMemo as useMemo3, useState as useState8 } 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 useClient4 } 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";
|
|
@@ -1423,105 +1423,17 @@ 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 {
|
|
1427
|
-
|
|
1428
|
-
// packages/sdk/shell/src/panels/IdentityPanel/useEdgeAgentsHandlers.ts
|
|
1429
|
-
import { useEffect as useEffect2, useState as useState6 } from "react";
|
|
1426
|
+
import { useCallback as useCallback4, useEffect as useEffect2, useState as useState6 } from "react";
|
|
1430
1427
|
import { invariant } from "@dxos/invariant";
|
|
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 }) => {
|
|
1435
|
-
const [validationMessage, setValidationMessage] = useState6("");
|
|
1436
|
-
const [lastReceivedStatus, setLastReceivedStatus] = useState6(QueryAgentStatusResponse.AgentStatus.UNKNOWN);
|
|
1437
|
-
const [agentStatus, setAgentStatus] = useState6("getting");
|
|
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
1428
|
import { log as log4 } from "@dxos/log";
|
|
1517
|
-
import { useClient as
|
|
1429
|
+
import { useClient as useClient3, useAgentHostingClient } from "@dxos/react-client";
|
|
1518
1430
|
import { Invitation as Invitation3, InvitationEncoder as InvitationEncoder2 } from "@dxos/react-client/invitations";
|
|
1519
|
-
var
|
|
1520
|
-
var
|
|
1521
|
-
const [validationMessage, setValidationMessage] =
|
|
1522
|
-
const [agentStatus, setAgentStatus] =
|
|
1431
|
+
var __dxlog_file3 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/IdentityPanel/useAgentHandlers.ts";
|
|
1432
|
+
var useAgentHandlers = ({ invitations, identity }) => {
|
|
1433
|
+
const [validationMessage, setValidationMessage] = useState6("");
|
|
1434
|
+
const [agentStatus, setAgentStatus] = useState6("getting");
|
|
1523
1435
|
const agentHostingProviderClient = useAgentHostingClient();
|
|
1524
|
-
const client =
|
|
1436
|
+
const client = useClient3();
|
|
1525
1437
|
const updateAgentStatus = async () => {
|
|
1526
1438
|
if (agentHostingProviderClient) {
|
|
1527
1439
|
setAgentStatus("getting");
|
|
@@ -1542,8 +1454,8 @@ var useKubeAgentHandlers = ({ invitations, identity }) => {
|
|
|
1542
1454
|
}
|
|
1543
1455
|
};
|
|
1544
1456
|
const createAgent = async (invitationCode) => {
|
|
1545
|
-
|
|
1546
|
-
F:
|
|
1457
|
+
invariant(identity, "Identity not found", {
|
|
1458
|
+
F: __dxlog_file3,
|
|
1547
1459
|
L: 50,
|
|
1548
1460
|
S: void 0,
|
|
1549
1461
|
A: [
|
|
@@ -1572,8 +1484,8 @@ var useKubeAgentHandlers = ({ invitations, identity }) => {
|
|
|
1572
1484
|
}
|
|
1573
1485
|
};
|
|
1574
1486
|
const destroyAgent = async () => {
|
|
1575
|
-
|
|
1576
|
-
F:
|
|
1487
|
+
invariant(identity, "Identity not found", {
|
|
1488
|
+
F: __dxlog_file3,
|
|
1577
1489
|
L: 73,
|
|
1578
1490
|
S: void 0,
|
|
1579
1491
|
A: [
|
|
@@ -1596,7 +1508,7 @@ var useKubeAgentHandlers = ({ invitations, identity }) => {
|
|
|
1596
1508
|
setValidationMessage("No agent provider configured.");
|
|
1597
1509
|
}
|
|
1598
1510
|
};
|
|
1599
|
-
|
|
1511
|
+
useEffect2(() => {
|
|
1600
1512
|
void updateAgentStatus();
|
|
1601
1513
|
}, []);
|
|
1602
1514
|
const handleAgentCreate = useCallback4(async (invitation) => {
|
|
@@ -1606,7 +1518,7 @@ var useKubeAgentHandlers = ({ invitations, identity }) => {
|
|
|
1606
1518
|
invitationCode,
|
|
1607
1519
|
authCode: invitation.authCode
|
|
1608
1520
|
}), void 0, {
|
|
1609
|
-
F:
|
|
1521
|
+
F: __dxlog_file3,
|
|
1610
1522
|
L: 97,
|
|
1611
1523
|
S: void 0,
|
|
1612
1524
|
C: (f, a) => f(...a)
|
|
@@ -1637,16 +1549,6 @@ var useKubeAgentHandlers = ({ invitations, identity }) => {
|
|
|
1637
1549
|
};
|
|
1638
1550
|
};
|
|
1639
1551
|
|
|
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
|
-
|
|
1650
1552
|
// packages/sdk/shell/src/steps/InvitationManager.tsx
|
|
1651
1553
|
import { Check as Check4, X as X3 } from "@phosphor-icons/react";
|
|
1652
1554
|
import React27, { useMemo as useMemo2 } from "react";
|
|
@@ -1778,20 +1680,20 @@ var InvitationManager = ({ invitationUrl, active, send, status, multiUse, authCo
|
|
|
1778
1680
|
|
|
1779
1681
|
// packages/sdk/shell/src/steps/ConfirmReset.tsx
|
|
1780
1682
|
import { Warning } from "@phosphor-icons/react";
|
|
1781
|
-
import React28, { useState as
|
|
1683
|
+
import React28, { useState as useState7 } from "react";
|
|
1782
1684
|
import { log as log5 } from "@dxos/log";
|
|
1783
1685
|
import { Message, useTranslation as useTranslation13 } from "@dxos/react-ui";
|
|
1784
1686
|
import { getSize as getSize12, mx as mx21 } from "@dxos/react-ui-theme";
|
|
1785
|
-
var
|
|
1687
|
+
var __dxlog_file4 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/steps/ConfirmReset.tsx";
|
|
1786
1688
|
var ConfirmReset = ({ active, onCancel, onConfirm, mode }) => {
|
|
1787
1689
|
const { t } = useTranslation13("os");
|
|
1788
|
-
const [validationMessage, setValidationMessage] =
|
|
1789
|
-
const [pending, setPending] =
|
|
1690
|
+
const [validationMessage, setValidationMessage] = useState7("");
|
|
1691
|
+
const [pending, setPending] = useState7(false);
|
|
1790
1692
|
const processReset = async () => {
|
|
1791
1693
|
setPending(true);
|
|
1792
1694
|
return onConfirm?.().then(() => setPending(false), (error) => {
|
|
1793
1695
|
log5.catch(error, void 0, {
|
|
1794
|
-
F:
|
|
1696
|
+
F: __dxlog_file4,
|
|
1795
1697
|
L: 38,
|
|
1796
1698
|
S: void 0,
|
|
1797
1699
|
C: (f, a) => f(...a)
|
|
@@ -1812,7 +1714,7 @@ var ConfirmReset = ({ active, onCancel, onConfirm, mode }) => {
|
|
|
1812
1714
|
var ConfirmResetImpl = ({ disabled, pending, validationMessage, onConfirm, onCancel, mode }) => {
|
|
1813
1715
|
const { t } = useTranslation13("os");
|
|
1814
1716
|
const confirmationValue = t("confirmation value");
|
|
1815
|
-
const [inputValue, setInputValue] =
|
|
1717
|
+
const [inputValue, setInputValue] = useState7("");
|
|
1816
1718
|
const testIdAffix = mode === "join new identity" ? "join-new-identity" : "reset-storage";
|
|
1817
1719
|
return /* @__PURE__ */ React28.createElement(React28.Fragment, null, /* @__PURE__ */ React28.createElement("div", {
|
|
1818
1720
|
role: "none",
|
|
@@ -1847,16 +1749,16 @@ var ConfirmResetImpl = ({ disabled, pending, validationMessage, onConfirm, onCan
|
|
|
1847
1749
|
};
|
|
1848
1750
|
|
|
1849
1751
|
// packages/sdk/shell/src/panels/IdentityPanel/IdentityPanel.tsx
|
|
1850
|
-
var
|
|
1752
|
+
var __dxlog_file5 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/IdentityPanel/IdentityPanel.tsx";
|
|
1851
1753
|
var viewStyles = "pbs-1 pbe-3 pli-3";
|
|
1852
1754
|
var getHueValue = (identity) => identity?.profile?.data?.hue || hexToHue2(identity?.identityKey.toHex() ?? "0");
|
|
1853
1755
|
var getEmojiValue = (identity) => identity?.profile?.data?.emoji || hexToEmoji4(identity?.identityKey.toHex() ?? "0");
|
|
1854
1756
|
var IdentityHeading = ({ titleId, title, identity, onDone, onUpdateProfile, connectionState, onChangeConnectionState }) => {
|
|
1855
1757
|
const fallbackValue = keyToFallback3(identity.identityKey);
|
|
1856
1758
|
const { t } = useTranslation14("os");
|
|
1857
|
-
const [displayName, setDisplayName] =
|
|
1858
|
-
const [emoji, setEmojiDirectly] =
|
|
1859
|
-
const [hue, setHueDirectly] =
|
|
1759
|
+
const [displayName, setDisplayName] = useState8(identity.profile?.displayName ?? "");
|
|
1760
|
+
const [emoji, setEmojiDirectly] = useState8(getEmojiValue(identity));
|
|
1761
|
+
const [hue, setHueDirectly] = useState8(getHueValue(identity));
|
|
1860
1762
|
const { textValue, setTextValue } = useClipboardContext();
|
|
1861
1763
|
const identityHex = identity.identityKey.toHex();
|
|
1862
1764
|
const copied = textValue === identityHex;
|
|
@@ -2027,7 +1929,7 @@ var IdentityPanelWithInvitationImpl = ({ invitation, ...props }) => {
|
|
|
2027
1929
|
};
|
|
2028
1930
|
var IdentityPanel = ({ titleId: propsTitleId, createInvitationUrl = (code) => code, initialDisposition = "default", ...props }) => {
|
|
2029
1931
|
const titleId = useId6("identityPanel__heading", propsTitleId);
|
|
2030
|
-
const client =
|
|
1932
|
+
const client = useClient4();
|
|
2031
1933
|
const devices = useDevices();
|
|
2032
1934
|
const identity = useIdentity();
|
|
2033
1935
|
const invitations = useHaloInvitations2();
|
|
@@ -2037,7 +1939,7 @@ var IdentityPanel = ({ titleId: propsTitleId, createInvitationUrl = (code) => co
|
|
|
2037
1939
|
});
|
|
2038
1940
|
if (!identity) {
|
|
2039
1941
|
log6.error("IdentityPanel rendered with no active identity.", void 0, {
|
|
2040
|
-
F:
|
|
1942
|
+
F: __dxlog_file5,
|
|
2041
1943
|
L: 246,
|
|
2042
1944
|
S: void 0,
|
|
2043
1945
|
C: (f, a) => f(...a)
|
|
@@ -2051,10 +1953,10 @@ var IdentityPanel = ({ titleId: propsTitleId, createInvitationUrl = (code) => co
|
|
|
2051
1953
|
});
|
|
2052
1954
|
const { swarm: connectionState } = useNetworkStatus();
|
|
2053
1955
|
const handleChangeConnectionState = async (nextState) => client?.mesh.updateConfig(nextState);
|
|
2054
|
-
|
|
1956
|
+
useEffect3(() => {
|
|
2055
1957
|
const subscription = identityService.subscribe((state) => {
|
|
2056
1958
|
log6("[state]", state, {
|
|
2057
|
-
F:
|
|
1959
|
+
F: __dxlog_file5,
|
|
2058
1960
|
L: 259,
|
|
2059
1961
|
S: void 0,
|
|
2060
1962
|
C: (f, a) => f(...a)
|
|
@@ -2106,9 +2008,9 @@ var IdentityPanel = ({ titleId: propsTitleId, createInvitationUrl = (code) => co
|
|
|
2106
2008
|
};
|
|
2107
2009
|
|
|
2108
2010
|
// packages/sdk/shell/src/panels/JoinPanel/JoinPanel.tsx
|
|
2109
|
-
import React38, { useCallback as useCallback6, useEffect as
|
|
2011
|
+
import React38, { useCallback as useCallback6, useEffect as useEffect5, useMemo as useMemo4 } from "react";
|
|
2110
2012
|
import { log as log10 } from "@dxos/log";
|
|
2111
|
-
import { useClient as
|
|
2013
|
+
import { useClient as useClient6, useMulticastObservable } from "@dxos/react-client";
|
|
2112
2014
|
import { useIdentity as useIdentity2 } from "@dxos/react-client/halo";
|
|
2113
2015
|
import { DensityProvider as DensityProvider2, useId as useId8, useThemeContext as useThemeContext5 } from "@dxos/react-ui";
|
|
2114
2016
|
|
|
@@ -2152,10 +2054,10 @@ import { assign as assign2, createMachine as createMachine2 } from "xstate";
|
|
|
2152
2054
|
import { log as log7 } from "@dxos/log";
|
|
2153
2055
|
import { AlreadyJoinedError } from "@dxos/react-client";
|
|
2154
2056
|
import { Invitation as Invitation5, InvitationEncoder as InvitationEncoder3 } from "@dxos/react-client/invitations";
|
|
2155
|
-
var
|
|
2057
|
+
var __dxlog_file6 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/JoinPanel/joinMachine.ts";
|
|
2156
2058
|
var getInvitationSubscribable = (Kind, invitation) => {
|
|
2157
2059
|
log7("[subscribing to invitation]", invitation, {
|
|
2158
|
-
F:
|
|
2060
|
+
F: __dxlog_file6,
|
|
2159
2061
|
L: 90,
|
|
2160
2062
|
S: void 0,
|
|
2161
2063
|
C: (f, a) => f(...a)
|
|
@@ -2168,7 +2070,7 @@ var getInvitationSubscribable = (Kind, invitation) => {
|
|
|
2168
2070
|
Kind,
|
|
2169
2071
|
invitation: invitation2
|
|
2170
2072
|
}, {
|
|
2171
|
-
F:
|
|
2073
|
+
F: __dxlog_file6,
|
|
2172
2074
|
L: 101,
|
|
2173
2075
|
S: void 0,
|
|
2174
2076
|
C: (f, a) => f(...a)
|
|
@@ -2183,7 +2085,7 @@ var getInvitationSubscribable = (Kind, invitation) => {
|
|
|
2183
2085
|
Kind,
|
|
2184
2086
|
invitation: invitation2
|
|
2185
2087
|
}, {
|
|
2186
|
-
F:
|
|
2088
|
+
F: __dxlog_file6,
|
|
2187
2089
|
L: 106,
|
|
2188
2090
|
S: void 0,
|
|
2189
2091
|
C: (f, a) => f(...a)
|
|
@@ -2198,7 +2100,7 @@ var getInvitationSubscribable = (Kind, invitation) => {
|
|
|
2198
2100
|
Kind,
|
|
2199
2101
|
invitation: invitation2
|
|
2200
2102
|
}, {
|
|
2201
|
-
F:
|
|
2103
|
+
F: __dxlog_file6,
|
|
2202
2104
|
L: 111,
|
|
2203
2105
|
S: void 0,
|
|
2204
2106
|
C: (f, a) => f(...a)
|
|
@@ -2213,7 +2115,7 @@ var getInvitationSubscribable = (Kind, invitation) => {
|
|
|
2213
2115
|
Kind,
|
|
2214
2116
|
invitation: invitation2
|
|
2215
2117
|
}, {
|
|
2216
|
-
F:
|
|
2118
|
+
F: __dxlog_file6,
|
|
2217
2119
|
L: 116,
|
|
2218
2120
|
S: void 0,
|
|
2219
2121
|
C: (f, a) => f(...a)
|
|
@@ -2228,7 +2130,7 @@ var getInvitationSubscribable = (Kind, invitation) => {
|
|
|
2228
2130
|
Kind,
|
|
2229
2131
|
invitation: invitation2
|
|
2230
2132
|
}, {
|
|
2231
|
-
F:
|
|
2133
|
+
F: __dxlog_file6,
|
|
2232
2134
|
L: 121,
|
|
2233
2135
|
S: void 0,
|
|
2234
2136
|
C: (f, a) => f(...a)
|
|
@@ -2243,7 +2145,7 @@ var getInvitationSubscribable = (Kind, invitation) => {
|
|
|
2243
2145
|
log7.warn("[invitation cancelled]", {
|
|
2244
2146
|
Kind
|
|
2245
2147
|
}, {
|
|
2246
|
-
F:
|
|
2148
|
+
F: __dxlog_file6,
|
|
2247
2149
|
L: 127,
|
|
2248
2150
|
S: void 0,
|
|
2249
2151
|
C: (f, a) => f(...a)
|
|
@@ -2257,7 +2159,7 @@ var getInvitationSubscribable = (Kind, invitation) => {
|
|
|
2257
2159
|
log7.error("[invitation timeout]", {
|
|
2258
2160
|
Kind
|
|
2259
2161
|
}, {
|
|
2260
|
-
F:
|
|
2162
|
+
F: __dxlog_file6,
|
|
2261
2163
|
L: 132,
|
|
2262
2164
|
S: void 0,
|
|
2263
2165
|
C: (f, a) => f(...a)
|
|
@@ -2274,7 +2176,7 @@ var getInvitationSubscribable = (Kind, invitation) => {
|
|
|
2274
2176
|
Kind,
|
|
2275
2177
|
error
|
|
2276
2178
|
}, {
|
|
2277
|
-
F:
|
|
2179
|
+
F: __dxlog_file6,
|
|
2278
2180
|
L: 139,
|
|
2279
2181
|
S: void 0,
|
|
2280
2182
|
C: (f, a) => f(...a)
|
|
@@ -2289,7 +2191,7 @@ var getInvitationSubscribable = (Kind, invitation) => {
|
|
|
2289
2191
|
Kind,
|
|
2290
2192
|
error
|
|
2291
2193
|
}, {
|
|
2292
|
-
F:
|
|
2194
|
+
F: __dxlog_file6,
|
|
2293
2195
|
L: 144,
|
|
2294
2196
|
S: void 0,
|
|
2295
2197
|
C: (f, a) => f(...a)
|
|
@@ -2621,7 +2523,7 @@ var joinMachine = createMachine2({
|
|
|
2621
2523
|
haloInvitation: context.halo.invitation,
|
|
2622
2524
|
spaceInvitation: context.space.invitation
|
|
2623
2525
|
}, {
|
|
2624
|
-
F:
|
|
2526
|
+
F: __dxlog_file6,
|
|
2625
2527
|
L: 416,
|
|
2626
2528
|
S: void 0,
|
|
2627
2529
|
C: (f, a) => f(...a)
|
|
@@ -2635,7 +2537,7 @@ var defaultCodeFromUrl = (invitationType, text) => {
|
|
|
2635
2537
|
return searchParams.get(`${invitationType}InvitationCode`) ?? searchParams.get(`${invitationType}Invitation`) ?? searchParams.get("invitationCode") ?? searchParams.get("invitation") ?? text;
|
|
2636
2538
|
} catch (err) {
|
|
2637
2539
|
log7.catch(err, void 0, {
|
|
2638
|
-
F:
|
|
2540
|
+
F: __dxlog_file6,
|
|
2639
2541
|
L: 443,
|
|
2640
2542
|
S: void 0,
|
|
2641
2543
|
C: (f, a) => f(...a)
|
|
@@ -2656,7 +2558,7 @@ var useJoinMachine = (client, options) => {
|
|
|
2656
2558
|
};
|
|
2657
2559
|
} catch (err) {
|
|
2658
2560
|
log7.error("Could not redeem device invitation code", err, {
|
|
2659
|
-
F:
|
|
2561
|
+
F: __dxlog_file6,
|
|
2660
2562
|
L: 464,
|
|
2661
2563
|
S: void 0,
|
|
2662
2564
|
C: (f, a) => f(...a)
|
|
@@ -2681,7 +2583,7 @@ var useJoinMachine = (client, options) => {
|
|
|
2681
2583
|
};
|
|
2682
2584
|
} catch (err) {
|
|
2683
2585
|
log7.error("Could not redeem space invitation code", err, {
|
|
2684
|
-
F:
|
|
2586
|
+
F: __dxlog_file6,
|
|
2685
2587
|
L: 486,
|
|
2686
2588
|
S: void 0,
|
|
2687
2589
|
C: (f, a) => f(...a)
|
|
@@ -2845,17 +2747,17 @@ var IdentityAdded = (props) => {
|
|
|
2845
2747
|
};
|
|
2846
2748
|
|
|
2847
2749
|
// packages/sdk/shell/src/panels/JoinPanel/steps/IdentityInput.tsx
|
|
2848
|
-
import React33, { useState as
|
|
2750
|
+
import React33, { useState as useState9 } from "react";
|
|
2849
2751
|
import { log as log8 } from "@dxos/log";
|
|
2850
|
-
import { useClient as
|
|
2752
|
+
import { useClient as useClient5 } from "@dxos/react-client";
|
|
2851
2753
|
import { useTranslation as useTranslation18 } from "@dxos/react-ui";
|
|
2852
|
-
var
|
|
2754
|
+
var __dxlog_file7 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/JoinPanel/steps/IdentityInput.tsx";
|
|
2853
2755
|
var IdentityInput = (props) => {
|
|
2854
2756
|
const { send, method } = props;
|
|
2855
2757
|
const isRecover = method === "recover identity";
|
|
2856
|
-
const client =
|
|
2758
|
+
const client = useClient5();
|
|
2857
2759
|
const { t } = useTranslation18("os");
|
|
2858
|
-
const [validationMessage, setValidationMessage] =
|
|
2760
|
+
const [validationMessage, setValidationMessage] = useState9("");
|
|
2859
2761
|
const createIdentity = (displayName) => {
|
|
2860
2762
|
void client.halo.createIdentity({
|
|
2861
2763
|
[isRecover ? "seedphrase" : "displayName"]: displayName
|
|
@@ -2866,7 +2768,7 @@ var IdentityInput = (props) => {
|
|
|
2866
2768
|
});
|
|
2867
2769
|
}, (error) => {
|
|
2868
2770
|
log8.catch(error, void 0, {
|
|
2869
|
-
F:
|
|
2771
|
+
F: __dxlog_file7,
|
|
2870
2772
|
L: 37,
|
|
2871
2773
|
S: void 0,
|
|
2872
2774
|
C: (f, a) => f(...a)
|
|
@@ -2884,7 +2786,7 @@ var IdentityInputImpl = (props) => {
|
|
|
2884
2786
|
const { method, send, active, onDisplayNameConfirm, validationMessage } = props;
|
|
2885
2787
|
const disabled = !active;
|
|
2886
2788
|
const { t } = useTranslation18("os");
|
|
2887
|
-
const [inputValue, setInputValue] =
|
|
2789
|
+
const [inputValue, setInputValue] = useState9("");
|
|
2888
2790
|
const isRecover = method === "recover identity";
|
|
2889
2791
|
return /* @__PURE__ */ React33.createElement(React33.Fragment, null, /* @__PURE__ */ React33.createElement("div", {
|
|
2890
2792
|
role: "none",
|
|
@@ -2934,10 +2836,10 @@ var InvitationAccepted = (props) => {
|
|
|
2934
2836
|
};
|
|
2935
2837
|
|
|
2936
2838
|
// packages/sdk/shell/src/panels/JoinPanel/steps/InvitationInput.tsx
|
|
2937
|
-
import React35, { useState as
|
|
2839
|
+
import React35, { useState as useState10, useEffect as useEffect4, cloneElement as cloneElement4 } from "react";
|
|
2938
2840
|
import { log as log9 } from "@dxos/log";
|
|
2939
2841
|
import { useTranslation as useTranslation20 } from "@dxos/react-ui";
|
|
2940
|
-
var
|
|
2842
|
+
var __dxlog_file8 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/JoinPanel/steps/InvitationInput.tsx";
|
|
2941
2843
|
var invitationCodeFromUrl = (text) => {
|
|
2942
2844
|
try {
|
|
2943
2845
|
const searchParams = new URLSearchParams(text.substring(text.lastIndexOf("?")));
|
|
@@ -2945,7 +2847,7 @@ var invitationCodeFromUrl = (text) => {
|
|
|
2945
2847
|
return invitation ?? text;
|
|
2946
2848
|
} catch (err) {
|
|
2947
2849
|
log9.catch(err, void 0, {
|
|
2948
|
-
F:
|
|
2850
|
+
F: __dxlog_file8,
|
|
2949
2851
|
L: 25,
|
|
2950
2852
|
S: void 0,
|
|
2951
2853
|
C: (f, a) => f(...a)
|
|
@@ -2957,8 +2859,8 @@ var InvitationInput = (props) => {
|
|
|
2957
2859
|
const { Kind, active, send, unredeemedCode, onExit, exitActionParent, onDone, doneActionParent, succeededKeys } = props;
|
|
2958
2860
|
const disabled = !active;
|
|
2959
2861
|
const { t } = useTranslation20("os");
|
|
2960
|
-
const [inputValue, setInputValue] =
|
|
2961
|
-
|
|
2862
|
+
const [inputValue, setInputValue] = useState10(unredeemedCode ?? "");
|
|
2863
|
+
useEffect4(() => {
|
|
2962
2864
|
unredeemedCode && setInputValue(unredeemedCode ?? "");
|
|
2963
2865
|
}, [
|
|
2964
2866
|
unredeemedCode
|
|
@@ -3076,7 +2978,7 @@ var InvitationRescuer = (props) => {
|
|
|
3076
2978
|
};
|
|
3077
2979
|
|
|
3078
2980
|
// packages/sdk/shell/src/panels/JoinPanel/steps/InvitationAuthenticator.tsx
|
|
3079
|
-
import React37, { useState as
|
|
2981
|
+
import React37, { useState as useState11 } from "react";
|
|
3080
2982
|
import { Input as Input3, useTranslation as useTranslation22 } from "@dxos/react-ui";
|
|
3081
2983
|
import { hexToEmoji as hexToEmoji5 } from "@dxos/util";
|
|
3082
2984
|
var pinLength = 6;
|
|
@@ -3084,7 +2986,7 @@ var InvitationAuthenticator = ({ failed, Kind, active, pending, invitationId, on
|
|
|
3084
2986
|
const disabled = !active || pending;
|
|
3085
2987
|
const { t } = useTranslation22("os");
|
|
3086
2988
|
const invitationType = Kind.toLowerCase();
|
|
3087
|
-
const [authCode, setAuthCode] =
|
|
2989
|
+
const [authCode, setAuthCode] = useState11("");
|
|
3088
2990
|
const onChange = ({ target: { value } }) => {
|
|
3089
2991
|
setAuthCode(value);
|
|
3090
2992
|
if (value.length === pinLength) {
|
|
@@ -3154,7 +3056,7 @@ var resolvedBgColor = (status) => status === Invitation6.State.ERROR ? errorBgCo
|
|
|
3154
3056
|
var resolvedTextColor = (status) => status === Invitation6.State.ERROR ? errorTextColor : status === Invitation6.State.CANCELLED || status === Invitation6.State.TIMEOUT ? cancelledTextColor : successTextColor;
|
|
3155
3057
|
|
|
3156
3058
|
// packages/sdk/shell/src/panels/JoinPanel/JoinPanel.tsx
|
|
3157
|
-
var
|
|
3059
|
+
var __dxlog_file9 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/JoinPanel/JoinPanel.tsx";
|
|
3158
3060
|
var JoinPanelImpl = (props) => {
|
|
3159
3061
|
const { titleId, send, activeView, failed, mode, unredeemedCodes, invitationIds, invitationStates, succeededKeys, failReasons, onExit, onHaloDone, onSpaceDone, exitActionParent, doneActionParent, onHaloInvitationCancel, onSpaceInvitationCancel, onHaloInvitationAuthenticate, onSpaceInvitationAuthenticate, onCancelResetStorage, onConfirmResetStorage, IdentityInput: IdentityInputComponent = IdentityInput, ConfirmReset: ConfirmResetComponent = ConfirmReset } = props;
|
|
3160
3062
|
return /* @__PURE__ */ React38.createElement(DensityProvider2, {
|
|
@@ -3299,7 +3201,7 @@ var JoinPanelImpl = (props) => {
|
|
|
3299
3201
|
})))));
|
|
3300
3202
|
};
|
|
3301
3203
|
var JoinPanel = ({ titleId: propsTitleId, mode = "default", initialDisposition = "default", initialInvitationCode, exitActionParent, onExit, doneActionParent, onDone: propsOnDone, onCancelResetStorage }) => {
|
|
3302
|
-
const client =
|
|
3204
|
+
const client = useClient6();
|
|
3303
3205
|
const identity = useIdentity2();
|
|
3304
3206
|
const { hasIosKeyboard } = useThemeContext5();
|
|
3305
3207
|
const titleId = useId8("joinPanel__heading", propsTitleId);
|
|
@@ -3315,10 +3217,10 @@ var JoinPanel = ({ titleId: propsTitleId, mode = "default", initialDisposition =
|
|
|
3315
3217
|
}
|
|
3316
3218
|
}
|
|
3317
3219
|
});
|
|
3318
|
-
|
|
3220
|
+
useEffect5(() => {
|
|
3319
3221
|
const subscription = joinService.subscribe((state) => {
|
|
3320
3222
|
log10("[state]", state, {
|
|
3321
|
-
F:
|
|
3223
|
+
F: __dxlog_file9,
|
|
3322
3224
|
L: 208,
|
|
3323
3225
|
S: void 0,
|
|
3324
3226
|
C: (f, a) => f(...a)
|
|
@@ -3328,7 +3230,7 @@ var JoinPanel = ({ titleId: propsTitleId, mode = "default", initialDisposition =
|
|
|
3328
3230
|
}, [
|
|
3329
3231
|
joinService
|
|
3330
3232
|
]);
|
|
3331
|
-
|
|
3233
|
+
useEffect5(() => {
|
|
3332
3234
|
const stateStack = joinState.configuration[0].id.split(".");
|
|
3333
3235
|
const innermostState = stateStack[stateStack.length - 1];
|
|
3334
3236
|
const autoFocusValue = innermostState === "finishingJoining" ? "successSpaceInvitation" : innermostState;
|
|
@@ -3587,7 +3489,7 @@ var JoinPanel = ({ titleId: propsTitleId, mode = "default", initialDisposition =
|
|
|
3587
3489
|
|
|
3588
3490
|
// packages/sdk/shell/src/panels/SpacePanel/SpacePanel.tsx
|
|
3589
3491
|
import { Planet } from "@phosphor-icons/react";
|
|
3590
|
-
import React40, { useEffect as
|
|
3492
|
+
import React40, { useEffect as useEffect6, useMemo as useMemo5 } from "react";
|
|
3591
3493
|
import { log as log13 } from "@dxos/log";
|
|
3592
3494
|
import { useInvitationStatus as useInvitationStatus3 } from "@dxos/react-client/invitations";
|
|
3593
3495
|
import { DensityProvider as DensityProvider3, useId as useId9, useTranslation as useTranslation24 } from "@dxos/react-ui";
|
|
@@ -3596,7 +3498,7 @@ import { DensityProvider as DensityProvider3, useId as useId9, useTranslation as
|
|
|
3596
3498
|
import { useMachine as useMachine3 } from "@xstate/react";
|
|
3597
3499
|
import { assign as assign3, createMachine as createMachine3 } from "xstate";
|
|
3598
3500
|
import { log as log11 } from "@dxos/log";
|
|
3599
|
-
var
|
|
3501
|
+
var __dxlog_file10 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/SpacePanel/spaceMachine.ts";
|
|
3600
3502
|
var spaceMachine = createMachine3({
|
|
3601
3503
|
id: "space",
|
|
3602
3504
|
predictableActionArguments: true,
|
|
@@ -3637,7 +3539,7 @@ var spaceMachine = createMachine3({
|
|
|
3637
3539
|
event,
|
|
3638
3540
|
context
|
|
3639
3541
|
}, {
|
|
3640
|
-
F:
|
|
3542
|
+
F: __dxlog_file10,
|
|
3641
3543
|
L: 53,
|
|
3642
3544
|
S: void 0,
|
|
3643
3545
|
C: (f, a) => f(...a)
|
|
@@ -3656,14 +3558,14 @@ var useSpaceMachine = (options) => {
|
|
|
3656
3558
|
|
|
3657
3559
|
// packages/sdk/shell/src/panels/SpacePanel/steps/SpaceManager.tsx
|
|
3658
3560
|
import { Placeholder as Placeholder2, UserPlus, UsersThree } from "@phosphor-icons/react";
|
|
3659
|
-
import React39, { useCallback as useCallback7, useState as
|
|
3561
|
+
import React39, { useCallback as useCallback7, useState as useState12 } from "react";
|
|
3660
3562
|
import { log as log12 } from "@dxos/log";
|
|
3661
3563
|
import { useConfig } from "@dxos/react-client";
|
|
3662
3564
|
import { useSpaceInvitations as useSpaceInvitations2 } from "@dxos/react-client/echo";
|
|
3663
3565
|
import { Invitation as Invitation7, InvitationEncoder as InvitationEncoder4 } from "@dxos/react-client/invitations";
|
|
3664
3566
|
import { ScrollArea, useTranslation as useTranslation23 } from "@dxos/react-ui";
|
|
3665
3567
|
import { descriptionText as descriptionText11, mx as mx24 } from "@dxos/react-ui-theme";
|
|
3666
|
-
var
|
|
3568
|
+
var __dxlog_file11 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/SpacePanel/steps/SpaceManager.tsx";
|
|
3667
3569
|
var activeActionKey = "dxos:react-shell/space-manager/active-action";
|
|
3668
3570
|
var handleInvitationEvent = (invitation, subscription) => {
|
|
3669
3571
|
const invitationCode = InvitationEncoder4.encode(invitation);
|
|
@@ -3672,7 +3574,7 @@ var handleInvitationEvent = (invitation, subscription) => {
|
|
|
3672
3574
|
invitationCode,
|
|
3673
3575
|
authCode: invitation.authCode
|
|
3674
3576
|
}), void 0, {
|
|
3675
|
-
F:
|
|
3577
|
+
F: __dxlog_file11,
|
|
3676
3578
|
L: 40,
|
|
3677
3579
|
S: void 0,
|
|
3678
3580
|
C: (f, a) => f(...a)
|
|
@@ -3742,7 +3644,7 @@ var SpaceManagerImpl = (props) => {
|
|
|
3742
3644
|
}
|
|
3743
3645
|
}
|
|
3744
3646
|
};
|
|
3745
|
-
const [activeAction, setInternalActiveAction] =
|
|
3647
|
+
const [activeAction, setInternalActiveAction] = useState12(localStorage.getItem(activeActionKey) ?? "inviteOne");
|
|
3746
3648
|
const setActiveAction = (nextAction) => {
|
|
3747
3649
|
setInternalActiveAction(nextAction);
|
|
3748
3650
|
localStorage.setItem(activeActionKey, nextAction);
|
|
@@ -3779,7 +3681,7 @@ var SpaceManagerImpl = (props) => {
|
|
|
3779
3681
|
};
|
|
3780
3682
|
|
|
3781
3683
|
// packages/sdk/shell/src/panels/SpacePanel/SpacePanel.tsx
|
|
3782
|
-
var
|
|
3684
|
+
var __dxlog_file12 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/SpacePanel/SpacePanel.tsx";
|
|
3783
3685
|
var SpacePanelHeading = ({ titleId, space, onDone }) => {
|
|
3784
3686
|
const { t } = useTranslation24("os");
|
|
3785
3687
|
const name = space.properties.name;
|
|
@@ -3842,10 +3744,10 @@ var SpacePanel = ({ titleId: propsTitleId, createInvitationUrl = (code) => code,
|
|
|
3842
3744
|
space: props.space
|
|
3843
3745
|
}
|
|
3844
3746
|
});
|
|
3845
|
-
|
|
3747
|
+
useEffect6(() => {
|
|
3846
3748
|
const subscription = spaceService.subscribe((state) => {
|
|
3847
3749
|
log13("[state]", state, {
|
|
3848
|
-
F:
|
|
3750
|
+
F: __dxlog_file12,
|
|
3849
3751
|
L: 94,
|
|
3850
3752
|
S: void 0,
|
|
3851
3753
|
C: (f, a) => f(...a)
|
|
@@ -3956,9 +3858,9 @@ import { defaultTx } from "@dxos/react-ui-theme";
|
|
|
3956
3858
|
import { createIFramePort } from "@dxos/rpc-tunnel";
|
|
3957
3859
|
|
|
3958
3860
|
// packages/sdk/shell/src/composites/Shell/Shell.tsx
|
|
3959
|
-
import React46, { useEffect as
|
|
3861
|
+
import React46, { useEffect as useEffect7, useState as useState13 } from "react";
|
|
3960
3862
|
import { log as log14 } from "@dxos/log";
|
|
3961
|
-
import { useClient as
|
|
3863
|
+
import { useClient as useClient7 } from "@dxos/react-client";
|
|
3962
3864
|
import { ShellDisplay, ShellLayout } from "@dxos/react-client";
|
|
3963
3865
|
import { useSpace as useSpace2 } from "@dxos/react-client/echo";
|
|
3964
3866
|
|
|
@@ -3996,22 +3898,22 @@ var StatusDialog = () => {
|
|
|
3996
3898
|
};
|
|
3997
3899
|
|
|
3998
3900
|
// packages/sdk/shell/src/composites/Shell/Shell.tsx
|
|
3999
|
-
var
|
|
3901
|
+
var __dxlog_file13 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/composites/Shell/Shell.tsx";
|
|
4000
3902
|
var blurActiveElement = () => document.activeElement?.blur?.();
|
|
4001
3903
|
var Shell = ({ runtime }) => {
|
|
4002
|
-
const [{ layout, invitationCode, spaceKey, spaceId, target }, setLayout] =
|
|
3904
|
+
const [{ layout, invitationCode, spaceKey, spaceId, target }, setLayout] = useState13({
|
|
4003
3905
|
layout: runtime.layout,
|
|
4004
3906
|
invitationCode: runtime.invitationCode,
|
|
4005
3907
|
spaceKey: runtime.spaceKey,
|
|
4006
3908
|
spaceId: runtime.spaceId,
|
|
4007
3909
|
target: runtime.target
|
|
4008
3910
|
});
|
|
4009
|
-
const [{ invitationUrl, deviceInvitationParam, spaceInvitationParam }, setInvitationUrl] =
|
|
3911
|
+
const [{ invitationUrl, deviceInvitationParam, spaceInvitationParam }, setInvitationUrl] = useState13({
|
|
4010
3912
|
invitationUrl: runtime.invitationUrl,
|
|
4011
3913
|
deviceInvitationParam: runtime.deviceInvitationParam,
|
|
4012
3914
|
spaceInvitationParam: runtime.spaceInvitationParam
|
|
4013
3915
|
});
|
|
4014
|
-
const client =
|
|
3916
|
+
const client = useClient7();
|
|
4015
3917
|
const space = useSpace2(spaceId ?? spaceKey);
|
|
4016
3918
|
const createDeviceInvitationUrl = (invitationCode2) => {
|
|
4017
3919
|
const baseUrl = new URL(invitationUrl);
|
|
@@ -4023,7 +3925,7 @@ var Shell = ({ runtime }) => {
|
|
|
4023
3925
|
baseUrl.searchParams.set(spaceInvitationParam, invitationCode2);
|
|
4024
3926
|
return baseUrl.toString();
|
|
4025
3927
|
};
|
|
4026
|
-
|
|
3928
|
+
useEffect7(() => {
|
|
4027
3929
|
const unsubscribeLayout = runtime.layoutUpdate.on((request) => setLayout(request));
|
|
4028
3930
|
const unsubscribeInvitationUrl = runtime.invitationUrlUpdate.on((request) => setInvitationUrl(request));
|
|
4029
3931
|
return () => {
|
|
@@ -4033,10 +3935,10 @@ var Shell = ({ runtime }) => {
|
|
|
4033
3935
|
}, [
|
|
4034
3936
|
runtime
|
|
4035
3937
|
]);
|
|
4036
|
-
|
|
3938
|
+
useEffect7(() => {
|
|
4037
3939
|
if (layout === ShellLayout.SPACE && !space) {
|
|
4038
3940
|
log14.warn("No space found for shell space invitations.", void 0, {
|
|
4039
|
-
F:
|
|
3941
|
+
F: __dxlog_file13,
|
|
4040
3942
|
L: 67,
|
|
4041
3943
|
S: void 0,
|
|
4042
3944
|
C: (f, a) => f(...a)
|
|
@@ -4161,10 +4063,10 @@ var Shell = ({ runtime }) => {
|
|
|
4161
4063
|
// packages/sdk/shell/src/composites/Shell/shell-runtime.ts
|
|
4162
4064
|
import { Event } from "@dxos/async";
|
|
4163
4065
|
import { appServiceBundle, shellServiceBundle } from "@dxos/client-protocol";
|
|
4164
|
-
import { invariant as
|
|
4066
|
+
import { invariant as invariant2 } from "@dxos/invariant";
|
|
4165
4067
|
import { ShellLayout as ShellLayout2 } from "@dxos/protocols/proto/dxos/iframe";
|
|
4166
4068
|
import { createProtoRpcPeer } from "@dxos/rpc";
|
|
4167
|
-
var
|
|
4069
|
+
var __dxlog_file14 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/composites/Shell/shell-runtime.ts";
|
|
4168
4070
|
var ShellRuntimeImpl = class {
|
|
4169
4071
|
constructor(_port) {
|
|
4170
4072
|
this._port = _port;
|
|
@@ -4220,8 +4122,8 @@ var ShellRuntimeImpl = class {
|
|
|
4220
4122
|
});
|
|
4221
4123
|
}
|
|
4222
4124
|
async setAppContext(context) {
|
|
4223
|
-
|
|
4224
|
-
F:
|
|
4125
|
+
invariant2(this._appRpc, "runtime not open", {
|
|
4126
|
+
F: __dxlog_file14,
|
|
4225
4127
|
L: 83,
|
|
4226
4128
|
S: this,
|
|
4227
4129
|
A: [
|
|
@@ -4436,8 +4338,7 @@ var runShell = async (config = new Config()) => {
|
|
|
4436
4338
|
]
|
|
4437
4339
|
}, /* @__PURE__ */ React47.createElement(ClientProvider, {
|
|
4438
4340
|
config,
|
|
4439
|
-
services
|
|
4440
|
-
noBanner: true
|
|
4341
|
+
services
|
|
4441
4342
|
}, /* @__PURE__ */ React47.createElement(ClipboardProvider, null, /* @__PURE__ */ React47.createElement(Tooltip8.Provider, null, /* @__PURE__ */ React47.createElement(AgentHostingProvider, null, /* @__PURE__ */ React47.createElement(Shell, {
|
|
4442
4343
|
runtime
|
|
4443
4344
|
}))))))));
|
|
@@ -4469,8 +4370,8 @@ var Fallback = ({ onClose }) => {
|
|
|
4469
4370
|
};
|
|
4470
4371
|
|
|
4471
4372
|
// packages/sdk/shell/src/composites/Shell/ShellContext.tsx
|
|
4472
|
-
import React48, { createContext as createContext2, useCallback as useCallback8, useContext as useContext2, useEffect as
|
|
4473
|
-
import { useClient as
|
|
4373
|
+
import React48, { createContext as createContext2, useCallback as useCallback8, useContext as useContext2, useEffect as useEffect8, useMemo as useMemo6, useState as useState14 } from "react";
|
|
4374
|
+
import { useClient as useClient8, ShellDisplay as ShellDisplay3, ShellLayout as ShellLayout4 } from "@dxos/react-client";
|
|
4474
4375
|
import { useIdentity as useIdentity3 } from "@dxos/react-client/halo";
|
|
4475
4376
|
import { mx as mx25 } from "@dxos/react-ui-theme";
|
|
4476
4377
|
|
|
@@ -4527,7 +4428,7 @@ var MemoryShellRuntime = class {
|
|
|
4527
4428
|
// packages/sdk/shell/src/composites/Shell/ShellContext.tsx
|
|
4528
4429
|
var ShellContext = /* @__PURE__ */ createContext2({});
|
|
4529
4430
|
var useShell = () => {
|
|
4530
|
-
const client =
|
|
4431
|
+
const client = useClient8();
|
|
4531
4432
|
const { runtime, setDisplay } = useContext2(ShellContext);
|
|
4532
4433
|
const setLayout = async (layout, options) => {
|
|
4533
4434
|
if (runtime) {
|
|
@@ -4548,9 +4449,9 @@ var useShell = () => {
|
|
|
4548
4449
|
};
|
|
4549
4450
|
};
|
|
4550
4451
|
var ShellProvider = ({ space, deviceInvitationCode, spaceInvitationCode, onJoinedSpace, children }) => {
|
|
4551
|
-
const client =
|
|
4452
|
+
const client = useClient8();
|
|
4552
4453
|
const identity = useIdentity3();
|
|
4553
|
-
const [display, setDisplay] =
|
|
4454
|
+
const [display, setDisplay] = useState14(!identity || spaceInvitationCode || deviceInvitationCode ? ShellDisplay3.FULLSCREEN : ShellDisplay3.NONE);
|
|
4554
4455
|
const shellRuntime = useMemo6(() => {
|
|
4555
4456
|
if (client.config.get("runtime.app.env.DX_VAULT") !== "false") {
|
|
4556
4457
|
return;
|
|
@@ -4597,7 +4498,7 @@ var ShellProvider = ({ space, deviceInvitationCode, spaceInvitationCode, onJoine
|
|
|
4597
4498
|
space,
|
|
4598
4499
|
shellRuntime
|
|
4599
4500
|
]);
|
|
4600
|
-
|
|
4501
|
+
useEffect8(() => {
|
|
4601
4502
|
if (!shellRuntime) {
|
|
4602
4503
|
return;
|
|
4603
4504
|
}
|
|
@@ -4607,7 +4508,7 @@ var ShellProvider = ({ space, deviceInvitationCode, spaceInvitationCode, onJoine
|
|
|
4607
4508
|
shellRuntime,
|
|
4608
4509
|
handleKeyDown
|
|
4609
4510
|
]);
|
|
4610
|
-
|
|
4511
|
+
useEffect8(() => {
|
|
4611
4512
|
if (!shellRuntime) {
|
|
4612
4513
|
return;
|
|
4613
4514
|
}
|