@dxos/shell 0.5.1-main.ff7d242 → 0.5.1-next.0ef769d
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 +82506 -9
- package/dist/bundle/shell.mjs.map +1 -1
- package/dist/bundle/shell.umd.js +91 -146
- package/dist/bundle/shell.umd.js.map +1 -1
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/react.mjs +136 -71
- package/dist/lib/browser/react.mjs.map +3 -3
- package/dist/types/src/composites/Shell/Shell.d.ts +1 -2
- package/dist/types/src/composites/Shell/Shell.d.ts.map +1 -1
- package/dist/types/src/composites/Shell/Shell.js +24 -4
- package/dist/types/src/composites/Shell/Shell.js.map +1 -1
- package/dist/types/src/composites/Shell/ShellContext.js +1 -1
- package/dist/types/src/composites/Shell/ShellContext.js.map +1 -1
- package/dist/types/src/composites/Shell/memory-shell-runtime.d.ts +10 -2
- package/dist/types/src/composites/Shell/memory-shell-runtime.d.ts.map +1 -1
- package/dist/types/src/composites/Shell/memory-shell-runtime.js +20 -1
- package/dist/types/src/composites/Shell/memory-shell-runtime.js.map +1 -1
- package/dist/types/src/composites/Shell/run-shell.d.ts.map +1 -1
- package/dist/types/src/composites/Shell/run-shell.js +29 -9
- 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/steps/IdentityActionChooser.js +1 -1
- package/dist/types/src/panels/IdentityPanel/steps/IdentityActionChooser.js.map +1 -1
- package/dist/types/src/panels/IdentityPanel/useAgentHandlers.d.ts +1 -3
- package/dist/types/src/panels/IdentityPanel/useAgentHandlers.d.ts.map +1 -1
- package/dist/types/src/panels/IdentityPanel/useAgentHandlers.js +3 -2
- package/dist/types/src/panels/IdentityPanel/useAgentHandlers.js.map +1 -1
- package/dist/types/src/panels/JoinPanel/JoinPanel.js +2 -2
- package/dist/types/src/panels/JoinPanel/JoinPanel.js.map +1 -1
- package/dist/types/src/panels/SpacePanel/steps/SpaceManager.d.ts.map +1 -1
- package/dist/types/src/panels/SpacePanel/steps/SpaceManager.js +2 -18
- package/dist/types/src/panels/SpacePanel/steps/SpaceManager.js.map +1 -1
- package/dist/types/src/steps/InvitationManager.d.ts.map +1 -1
- package/dist/types/src/steps/InvitationManager.js +3 -0
- package/dist/types/src/steps/InvitationManager.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 +6 -5
- package/dist/types/src/translations/locales/en-US.js.map +1 -1
- package/package.json +22 -21
- package/src/composites/Shell/Shell.tsx +36 -5
- package/src/composites/Shell/ShellContext.tsx +1 -1
- package/src/composites/Shell/memory-shell-runtime.ts +36 -2
- package/src/composites/Shell/run-shell.tsx +59 -18
- package/src/panels/IdentityPanel/IdentityPanel.tsx +1 -1
- package/src/panels/IdentityPanel/steps/IdentityActionChooser.tsx +2 -2
- package/src/panels/IdentityPanel/useAgentHandlers.ts +3 -4
- package/src/panels/JoinPanel/JoinPanel.tsx +2 -2
- package/src/panels/SpacePanel/steps/SpaceManager.tsx +2 -18
- package/src/steps/InvitationManager.tsx +3 -0
- package/src/translations/locales/en-US.ts +6 -5
- package/dist/bundle/index-Ba9TfOfV.mjs +0 -110
- package/dist/bundle/index-Ba9TfOfV.mjs.map +0 -1
- package/dist/bundle/index-DaiI_12x.mjs +0 -96628
- package/dist/bundle/index-DaiI_12x.mjs.map +0 -1
|
@@ -1178,7 +1178,7 @@ import { CopySimple, Plugs, PlugsConnected } from "@phosphor-icons/react";
|
|
|
1178
1178
|
import React29, { useEffect as useEffect3, useMemo as useMemo3, useState as useState8 } from "react";
|
|
1179
1179
|
import { generateName as generateName3 } from "@dxos/display-name";
|
|
1180
1180
|
import { log as log6 } from "@dxos/log";
|
|
1181
|
-
import { useClient as
|
|
1181
|
+
import { useClient as useClient4 } from "@dxos/react-client";
|
|
1182
1182
|
import { useIdentity, useDevices, useHaloInvitations as useHaloInvitations2 } from "@dxos/react-client/halo";
|
|
1183
1183
|
import { useInvitationStatus as useInvitationStatus2 } from "@dxos/react-client/invitations";
|
|
1184
1184
|
import { useNetworkStatus, ConnectionState } from "@dxos/react-client/mesh";
|
|
@@ -1296,7 +1296,7 @@ var useIdentityMachine = (client, options) => {
|
|
|
1296
1296
|
// packages/sdk/shell/src/panels/IdentityPanel/steps/IdentityActionChooser.tsx
|
|
1297
1297
|
import React25, { useCallback as useCallback4 } from "react";
|
|
1298
1298
|
import { log as log2 } from "@dxos/log";
|
|
1299
|
-
import {
|
|
1299
|
+
import { useAgentHostingClient, useClient as useClient2 } from "@dxos/react-client";
|
|
1300
1300
|
import { useHaloInvitations } from "@dxos/react-client/halo";
|
|
1301
1301
|
import { Invitation as Invitation2, InvitationEncoder } from "@dxos/react-client/invitations";
|
|
1302
1302
|
var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/IdentityPanel/steps/IdentityActionChooser.tsx";
|
|
@@ -1304,7 +1304,7 @@ var IdentityActionChooser = (props) => {
|
|
|
1304
1304
|
const { send } = props;
|
|
1305
1305
|
const client = useClient2();
|
|
1306
1306
|
const invitations = useHaloInvitations();
|
|
1307
|
-
const agentHostingProviderClient =
|
|
1307
|
+
const agentHostingProviderClient = useAgentHostingClient();
|
|
1308
1308
|
const onInvitationEvent = useCallback4((invitation) => {
|
|
1309
1309
|
const invitationCode = InvitationEncoder.encode(invitation);
|
|
1310
1310
|
if (invitation.state === Invitation2.State.CONNECTING) {
|
|
@@ -1364,14 +1364,15 @@ import { hexToEmoji as hexToEmoji2, hexToHue } from "@dxos/util";
|
|
|
1364
1364
|
import { useCallback as useCallback5, useEffect as useEffect2, useState as useState6 } from "react";
|
|
1365
1365
|
import { invariant } from "@dxos/invariant";
|
|
1366
1366
|
import { log as log4 } from "@dxos/log";
|
|
1367
|
-
import {
|
|
1367
|
+
import { useAgentHostingClient as useAgentHostingClient2, useClient as useClient3 } from "@dxos/react-client";
|
|
1368
1368
|
import { Invitation as Invitation3, InvitationEncoder as InvitationEncoder2 } from "@dxos/react-client/invitations";
|
|
1369
1369
|
var __dxlog_file3 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/IdentityPanel/useAgentHandlers.ts";
|
|
1370
|
-
var useAgentHandlers = ({
|
|
1370
|
+
var useAgentHandlers = ({ invitations, identity }) => {
|
|
1371
1371
|
const [validationMessage, setValidationMessage] = useState6("");
|
|
1372
1372
|
const [agentStatus, setAgentStatus] = useState6("");
|
|
1373
1373
|
const [agentActive, setAgentActive] = useState6(false);
|
|
1374
|
-
const agentHostingProviderClient =
|
|
1374
|
+
const agentHostingProviderClient = useAgentHostingClient2();
|
|
1375
|
+
const client = useClient3();
|
|
1375
1376
|
useEffect2(() => {
|
|
1376
1377
|
const fetchAgentStatus = async () => {
|
|
1377
1378
|
if (agentHostingProviderClient) {
|
|
@@ -1397,13 +1398,13 @@ var useAgentHandlers = ({ client, invitations, identity }) => {
|
|
|
1397
1398
|
authCode: invitation.authCode
|
|
1398
1399
|
}), void 0, {
|
|
1399
1400
|
F: __dxlog_file3,
|
|
1400
|
-
L:
|
|
1401
|
+
L: 49,
|
|
1401
1402
|
S: void 0,
|
|
1402
1403
|
C: (f, a) => f(...a)
|
|
1403
1404
|
});
|
|
1404
1405
|
invariant(identity, "Identity not found", {
|
|
1405
1406
|
F: __dxlog_file3,
|
|
1406
|
-
L:
|
|
1407
|
+
L: 50,
|
|
1407
1408
|
S: void 0,
|
|
1408
1409
|
A: [
|
|
1409
1410
|
"identity",
|
|
@@ -1435,7 +1436,7 @@ var useAgentHandlers = ({ client, invitations, identity }) => {
|
|
|
1435
1436
|
const identity2 = client.halo.identity.get();
|
|
1436
1437
|
invariant(identity2, "Identity not found", {
|
|
1437
1438
|
F: __dxlog_file3,
|
|
1438
|
-
L:
|
|
1439
|
+
L: 80,
|
|
1439
1440
|
S: void 0,
|
|
1440
1441
|
A: [
|
|
1441
1442
|
"identity",
|
|
@@ -1523,6 +1524,9 @@ var InvitationManager = ({ invitationUrl, active, send, status, multiUse, authCo
|
|
|
1523
1524
|
const showAuthCode = statusValue === 3;
|
|
1524
1525
|
const emoji = hexToEmoji3(id);
|
|
1525
1526
|
const activeView = useMemo2(() => {
|
|
1527
|
+
if (multiUse) {
|
|
1528
|
+
return "showing qr";
|
|
1529
|
+
}
|
|
1526
1530
|
switch (true) {
|
|
1527
1531
|
case statusValue === 5:
|
|
1528
1532
|
case statusValue < 0:
|
|
@@ -1833,12 +1837,11 @@ var IdentityPanelWithInvitationImpl = ({ invitation, ...props }) => {
|
|
|
1833
1837
|
};
|
|
1834
1838
|
var IdentityPanel = ({ titleId: propsTitleId, createInvitationUrl = (code) => code, initialDisposition = "default", ...props }) => {
|
|
1835
1839
|
const titleId = useId6("identityPanel__heading", propsTitleId);
|
|
1836
|
-
const client =
|
|
1840
|
+
const client = useClient4();
|
|
1837
1841
|
const devices = useDevices();
|
|
1838
1842
|
const identity = useIdentity();
|
|
1839
1843
|
const invitations = useHaloInvitations2();
|
|
1840
1844
|
const agentProps = useAgentHandlers({
|
|
1841
|
-
client,
|
|
1842
1845
|
identity,
|
|
1843
1846
|
invitations
|
|
1844
1847
|
});
|
|
@@ -1915,7 +1918,7 @@ var IdentityPanel = ({ titleId: propsTitleId, createInvitationUrl = (code) => co
|
|
|
1915
1918
|
// packages/sdk/shell/src/panels/JoinPanel/JoinPanel.tsx
|
|
1916
1919
|
import React38, { useCallback as useCallback7, useEffect as useEffect5, useMemo as useMemo4 } from "react";
|
|
1917
1920
|
import { log as log10 } from "@dxos/log";
|
|
1918
|
-
import { useClient as
|
|
1921
|
+
import { useClient as useClient6, useMulticastObservable } from "@dxos/react-client";
|
|
1919
1922
|
import { useIdentity as useIdentity2 } from "@dxos/react-client/halo";
|
|
1920
1923
|
import { DensityProvider as DensityProvider2, useId as useId8, useThemeContext as useThemeContext4 } from "@dxos/react-ui";
|
|
1921
1924
|
|
|
@@ -2654,13 +2657,13 @@ var IdentityAdded = (props) => {
|
|
|
2654
2657
|
// packages/sdk/shell/src/panels/JoinPanel/steps/IdentityInput.tsx
|
|
2655
2658
|
import React33, { useState as useState9 } from "react";
|
|
2656
2659
|
import { log as log8 } from "@dxos/log";
|
|
2657
|
-
import { useClient as
|
|
2660
|
+
import { useClient as useClient5 } from "@dxos/react-client";
|
|
2658
2661
|
import { useTranslation as useTranslation18 } from "@dxos/react-ui";
|
|
2659
2662
|
var __dxlog_file7 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/JoinPanel/steps/IdentityInput.tsx";
|
|
2660
2663
|
var IdentityInput = (props) => {
|
|
2661
2664
|
const { send, method } = props;
|
|
2662
2665
|
const isRecover = method === "recover identity";
|
|
2663
|
-
const client =
|
|
2666
|
+
const client = useClient5();
|
|
2664
2667
|
const { t } = useTranslation18("os");
|
|
2665
2668
|
const [validationMessage, setValidationMessage] = useState9("");
|
|
2666
2669
|
const createIdentity = (displayName) => {
|
|
@@ -2983,7 +2986,7 @@ var JoinPanelImpl = (props) => {
|
|
|
2983
2986
|
id: "reset storage confirmation"
|
|
2984
2987
|
}, /* @__PURE__ */ React38.createElement(ConfirmResetComponent, {
|
|
2985
2988
|
send,
|
|
2986
|
-
active: activeView === "reset
|
|
2989
|
+
active: activeView === "reset storage confirmation",
|
|
2987
2990
|
onCancel: onCancelResetStorage,
|
|
2988
2991
|
onConfirm: onConfirmResetStorage
|
|
2989
2992
|
})), /* @__PURE__ */ React38.createElement(Viewport.View, {
|
|
@@ -3102,7 +3105,7 @@ var JoinPanelImpl = (props) => {
|
|
|
3102
3105
|
})))));
|
|
3103
3106
|
};
|
|
3104
3107
|
var JoinPanel = ({ titleId: propsTitleId, mode = "default", initialDisposition = "default", initialInvitationCode, exitActionParent, onExit, doneActionParent, onDone: propsOnDone, onCancelResetStorage }) => {
|
|
3105
|
-
const client =
|
|
3108
|
+
const client = useClient6();
|
|
3106
3109
|
const identity = useIdentity2();
|
|
3107
3110
|
const { hasIosKeyboard } = useThemeContext4();
|
|
3108
3111
|
const titleId = useId8("joinPanel__heading", propsTitleId);
|
|
@@ -3150,7 +3153,7 @@ var JoinPanel = ({ titleId: propsTitleId, mode = "default", initialDisposition =
|
|
|
3150
3153
|
}):
|
|
3151
3154
|
return "addition method chooser";
|
|
3152
3155
|
case joinState.matches("resettingIdentity"):
|
|
3153
|
-
return "reset
|
|
3156
|
+
return "reset storage confirmation";
|
|
3154
3157
|
case joinState.matches({
|
|
3155
3158
|
choosingIdentity: "creatingIdentity"
|
|
3156
3159
|
}):
|
|
@@ -3505,8 +3508,8 @@ var SpaceManager = (props) => {
|
|
|
3505
3508
|
icon: UsersThree,
|
|
3506
3509
|
onClick: useCallback8(() => {
|
|
3507
3510
|
const invitation = space.share?.({
|
|
3508
|
-
type: Invitation7.Type.
|
|
3509
|
-
authMethod: Invitation7.AuthMethod.
|
|
3511
|
+
type: Invitation7.Type.DELEGATED,
|
|
3512
|
+
authMethod: Invitation7.AuthMethod.KNOWN_PUBLIC_KEY,
|
|
3510
3513
|
multiUse: true,
|
|
3511
3514
|
target
|
|
3512
3515
|
});
|
|
@@ -3746,15 +3749,15 @@ import React47, { StrictMode } from "react";
|
|
|
3746
3749
|
import { createRoot } from "react-dom/client";
|
|
3747
3750
|
import { DEFAULT_CLIENT_CHANNEL, DEFAULT_SHELL_CHANNEL } from "@dxos/client-protocol";
|
|
3748
3751
|
import { ShellRuntimeImpl } from "@dxos/client-services";
|
|
3749
|
-
import { Client, ClientContext, ClientServicesProxy, Config, SystemStatus } from "@dxos/react-client";
|
|
3750
|
-
import { ThemeProvider, Tooltip as Tooltip7 } from "@dxos/react-ui";
|
|
3752
|
+
import { AgentHostingProvider, Client, ClientContext, ClientServicesProxy, Config, ShellDisplay as ShellDisplay2, SystemStatus } from "@dxos/react-client";
|
|
3753
|
+
import { Button as Button11, Dialog as Dialog3, ThemeProvider, Tooltip as Tooltip7, useTranslation as useTranslation26 } from "@dxos/react-ui";
|
|
3751
3754
|
import { defaultTx } from "@dxos/react-ui-theme";
|
|
3752
3755
|
import { createIFramePort } from "@dxos/rpc-tunnel";
|
|
3753
3756
|
|
|
3754
3757
|
// packages/sdk/shell/src/composites/Shell/Shell.tsx
|
|
3755
3758
|
import React46, { useEffect as useEffect7, useState as useState13 } from "react";
|
|
3756
3759
|
import { log as log14 } from "@dxos/log";
|
|
3757
|
-
import { ShellDisplay, ShellLayout, useClient as
|
|
3760
|
+
import { ShellDisplay, ShellLayout, useClient as useClient7 } from "@dxos/react-client";
|
|
3758
3761
|
import { useSpace as useSpace2 } from "@dxos/react-client/echo";
|
|
3759
3762
|
|
|
3760
3763
|
// packages/sdk/shell/src/composites/SpaceDialog/SpaceDialog.tsx
|
|
@@ -3792,17 +3795,37 @@ var StatusDialog = () => {
|
|
|
3792
3795
|
|
|
3793
3796
|
// packages/sdk/shell/src/composites/Shell/Shell.tsx
|
|
3794
3797
|
var __dxlog_file13 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/composites/Shell/Shell.tsx";
|
|
3795
|
-
var Shell = ({ runtime
|
|
3798
|
+
var Shell = ({ runtime }) => {
|
|
3796
3799
|
const [{ layout, invitationCode, spaceKey, target }, setLayout] = useState13({
|
|
3797
3800
|
layout: runtime.layout,
|
|
3798
3801
|
invitationCode: runtime.invitationCode,
|
|
3799
3802
|
spaceKey: runtime.spaceKey,
|
|
3800
3803
|
target: runtime.target
|
|
3801
3804
|
});
|
|
3802
|
-
const
|
|
3805
|
+
const [{ invitationUrl, deviceInvitationParam, spaceInvitationParam }, setInvitationUrl] = useState13({
|
|
3806
|
+
invitationUrl: runtime.invitationUrl,
|
|
3807
|
+
deviceInvitationParam: runtime.deviceInvitationParam,
|
|
3808
|
+
spaceInvitationParam: runtime.spaceInvitationParam
|
|
3809
|
+
});
|
|
3810
|
+
const client = useClient7();
|
|
3803
3811
|
const space = useSpace2(spaceKey);
|
|
3812
|
+
const createDeviceInvitationUrl = (invitationCode2) => {
|
|
3813
|
+
const baseUrl = new URL(invitationUrl);
|
|
3814
|
+
baseUrl.searchParams.set(deviceInvitationParam, invitationCode2);
|
|
3815
|
+
return baseUrl.toString();
|
|
3816
|
+
};
|
|
3817
|
+
const createSpaceInvitationUrl = (invitationCode2) => {
|
|
3818
|
+
const baseUrl = new URL(invitationUrl);
|
|
3819
|
+
baseUrl.searchParams.set(spaceInvitationParam, invitationCode2);
|
|
3820
|
+
return baseUrl.toString();
|
|
3821
|
+
};
|
|
3804
3822
|
useEffect7(() => {
|
|
3805
|
-
|
|
3823
|
+
const unsubscribeLayout = runtime.layoutUpdate.on((request) => setLayout(request));
|
|
3824
|
+
const unsubscribeInvitationUrl = runtime.invitationUrlUpdate.on((request) => setInvitationUrl(request));
|
|
3825
|
+
return () => {
|
|
3826
|
+
unsubscribeLayout();
|
|
3827
|
+
unsubscribeInvitationUrl();
|
|
3828
|
+
};
|
|
3806
3829
|
}, [
|
|
3807
3830
|
runtime
|
|
3808
3831
|
]);
|
|
@@ -3810,7 +3833,7 @@ var Shell = ({ runtime, origin }) => {
|
|
|
3810
3833
|
if (layout === ShellLayout.SPACE && !space) {
|
|
3811
3834
|
log14.warn("No space found for shell space invitations.", void 0, {
|
|
3812
3835
|
F: __dxlog_file13,
|
|
3813
|
-
L:
|
|
3836
|
+
L: 64,
|
|
3814
3837
|
S: void 0,
|
|
3815
3838
|
C: (f, a) => f(...a)
|
|
3816
3839
|
});
|
|
@@ -3854,7 +3877,7 @@ var Shell = ({ runtime, origin }) => {
|
|
|
3854
3877
|
case ShellLayout.SHARE_IDENTITY:
|
|
3855
3878
|
case ShellLayout.EDIT_PROFILE:
|
|
3856
3879
|
return /* @__PURE__ */ React46.createElement(IdentityDialog, {
|
|
3857
|
-
createInvitationUrl:
|
|
3880
|
+
createInvitationUrl: createDeviceInvitationUrl,
|
|
3858
3881
|
onResetStorage: async () => {
|
|
3859
3882
|
runtime.setLayout({
|
|
3860
3883
|
layout: ShellLayout.STATUS
|
|
@@ -3888,7 +3911,7 @@ var Shell = ({ runtime, origin }) => {
|
|
|
3888
3911
|
return space ? /* @__PURE__ */ React46.createElement(SpaceDialog, {
|
|
3889
3912
|
space,
|
|
3890
3913
|
target,
|
|
3891
|
-
createInvitationUrl:
|
|
3914
|
+
createInvitationUrl: createSpaceInvitationUrl,
|
|
3892
3915
|
onDone: async () => {
|
|
3893
3916
|
await runtime.setAppContext({
|
|
3894
3917
|
display: ShellDisplay.NONE
|
|
@@ -4014,14 +4037,14 @@ var os = {
|
|
|
4014
4037
|
"auth code message": "Enter the following auth code on the joining device.",
|
|
4015
4038
|
"display name input label": "Display name",
|
|
4016
4039
|
"display name input placeholder": "Enter a display name",
|
|
4017
|
-
"invite one label": "
|
|
4040
|
+
"invite one label": "Single-use invitation",
|
|
4018
4041
|
"invite one description": "Only one user may join.",
|
|
4019
|
-
"invite one qr label": "Single-use",
|
|
4042
|
+
"invite one qr label": "Single-use invitation",
|
|
4020
4043
|
"invite one list item label": "Active single-use invitation",
|
|
4021
|
-
"invite many label": "
|
|
4044
|
+
"invite many label": "Standing invitation",
|
|
4022
4045
|
"invite many description": "Anyone with the link can join.",
|
|
4023
|
-
"invite many qr label": "
|
|
4024
|
-
"invite many list item label": "Active
|
|
4046
|
+
"invite many qr label": "Standing invitation",
|
|
4047
|
+
"invite many list item label": "Active standing invitation",
|
|
4025
4048
|
"invite options label": "Change the active invite option.",
|
|
4026
4049
|
"reset in progress label": "Resetting...",
|
|
4027
4050
|
"confirm label": "Confirm",
|
|
@@ -4067,7 +4090,8 @@ var os = {
|
|
|
4067
4090
|
"agent message body": "Creating an agent helps keep your devices and peers in-sync. An agent is like any other device, but since it\u2019s always online your changes will sync even when all your physical devices are\xA0asleep.",
|
|
4068
4091
|
"create agent label": "Start an agent",
|
|
4069
4092
|
"destroy agent label": "Shut down agent",
|
|
4070
|
-
"agent device label": "Your agent"
|
|
4093
|
+
"agent device label": "Your agent",
|
|
4094
|
+
"shell fallback title": "Shell failed to connect"
|
|
4071
4095
|
};
|
|
4072
4096
|
|
|
4073
4097
|
// packages/sdk/shell/src/translations/index.ts
|
|
@@ -4077,39 +4101,62 @@ var osTranslations = {
|
|
|
4077
4101
|
|
|
4078
4102
|
// packages/sdk/shell/src/composites/Shell/run-shell.tsx
|
|
4079
4103
|
var runShell = async (config = new Config()) => {
|
|
4080
|
-
const services = new ClientServicesProxy(createIFramePort({
|
|
4081
|
-
channel: DEFAULT_CLIENT_CHANNEL
|
|
4082
|
-
}));
|
|
4083
|
-
const client = new Client({
|
|
4084
|
-
config,
|
|
4085
|
-
services
|
|
4086
|
-
});
|
|
4087
4104
|
const runtime = new ShellRuntimeImpl(createIFramePort({
|
|
4088
4105
|
channel: DEFAULT_SHELL_CHANNEL
|
|
4089
4106
|
}));
|
|
4090
|
-
await
|
|
4091
|
-
|
|
4092
|
-
|
|
4093
|
-
|
|
4094
|
-
|
|
4095
|
-
|
|
4096
|
-
|
|
4097
|
-
|
|
4098
|
-
|
|
4099
|
-
|
|
4100
|
-
|
|
4101
|
-
|
|
4102
|
-
|
|
4103
|
-
|
|
4104
|
-
|
|
4105
|
-
|
|
4106
|
-
|
|
4107
|
-
|
|
4107
|
+
await runtime.open();
|
|
4108
|
+
try {
|
|
4109
|
+
const services = new ClientServicesProxy(createIFramePort({
|
|
4110
|
+
channel: DEFAULT_CLIENT_CHANNEL
|
|
4111
|
+
}));
|
|
4112
|
+
const client = new Client({
|
|
4113
|
+
config,
|
|
4114
|
+
services
|
|
4115
|
+
});
|
|
4116
|
+
await client.initialize();
|
|
4117
|
+
createRoot(document.getElementById("root")).render(/* @__PURE__ */ React47.createElement(StrictMode, null, /* @__PURE__ */ React47.createElement(ThemeProvider, {
|
|
4118
|
+
tx: defaultTx,
|
|
4119
|
+
resourceExtensions: [
|
|
4120
|
+
osTranslations
|
|
4121
|
+
]
|
|
4122
|
+
}, /* @__PURE__ */ React47.createElement(ClientContext.Provider, {
|
|
4123
|
+
value: {
|
|
4124
|
+
client,
|
|
4125
|
+
status: SystemStatus.ACTIVE
|
|
4126
|
+
}
|
|
4127
|
+
}, /* @__PURE__ */ React47.createElement(ClipboardProvider, null, /* @__PURE__ */ React47.createElement(Tooltip7.Provider, null, /* @__PURE__ */ React47.createElement(AgentHostingProvider, null, /* @__PURE__ */ React47.createElement(Shell, {
|
|
4128
|
+
runtime
|
|
4129
|
+
}))))))));
|
|
4130
|
+
} catch {
|
|
4131
|
+
createRoot(document.getElementById("root")).render(/* @__PURE__ */ React47.createElement(StrictMode, null, /* @__PURE__ */ React47.createElement(ThemeProvider, {
|
|
4132
|
+
tx: defaultTx,
|
|
4133
|
+
resourceExtensions: [
|
|
4134
|
+
osTranslations
|
|
4135
|
+
]
|
|
4136
|
+
}, /* @__PURE__ */ React47.createElement(Fallback, {
|
|
4137
|
+
onClose: () => runtime.setAppContext({
|
|
4138
|
+
display: ShellDisplay2.NONE
|
|
4139
|
+
})
|
|
4140
|
+
}))));
|
|
4141
|
+
}
|
|
4142
|
+
};
|
|
4143
|
+
var Fallback = ({ onClose }) => {
|
|
4144
|
+
const { t } = useTranslation26("os");
|
|
4145
|
+
return /* @__PURE__ */ React47.createElement(Dialog3.Root, {
|
|
4146
|
+
modal: true,
|
|
4147
|
+
open: true,
|
|
4148
|
+
onOpenChange: () => onClose?.()
|
|
4149
|
+
}, /* @__PURE__ */ React47.createElement(Dialog3.Overlay, null, /* @__PURE__ */ React47.createElement(Dialog3.Content, null, /* @__PURE__ */ React47.createElement(Dialog3.Title, null, t("shell fallback title")), /* @__PURE__ */ React47.createElement(Dialog3.Close, {
|
|
4150
|
+
asChild: true,
|
|
4151
|
+
onClick: () => onClose?.()
|
|
4152
|
+
}, /* @__PURE__ */ React47.createElement(Button11, {
|
|
4153
|
+
variant: "primary"
|
|
4154
|
+
}, t("close label"))))));
|
|
4108
4155
|
};
|
|
4109
4156
|
|
|
4110
4157
|
// packages/sdk/shell/src/composites/Shell/ShellContext.tsx
|
|
4111
4158
|
import React48, { createContext as createContext2, useCallback as useCallback9, useContext as useContext2, useEffect as useEffect8, useMemo as useMemo6, useState as useState14 } from "react";
|
|
4112
|
-
import { ShellDisplay as
|
|
4159
|
+
import { ShellDisplay as ShellDisplay3, ShellLayout as ShellLayout3, useClient as useClient8 } from "@dxos/react-client";
|
|
4113
4160
|
import { useIdentity as useIdentity3 } from "@dxos/react-client/halo";
|
|
4114
4161
|
import { mx as mx25 } from "@dxos/react-ui-theme";
|
|
4115
4162
|
|
|
@@ -4117,12 +4164,16 @@ import { mx as mx25 } from "@dxos/react-ui-theme";
|
|
|
4117
4164
|
import { Event } from "@dxos/async";
|
|
4118
4165
|
import { ShellLayout as ShellLayout2 } from "@dxos/react-client";
|
|
4119
4166
|
var MemoryShellRuntime = class {
|
|
4120
|
-
constructor({ layout, invitationCode, spaceKey } = {}) {
|
|
4167
|
+
constructor({ layout, invitationCode, spaceKey, invitationUrl, deviceInvitationParam, spaceInvitationParam } = {}) {
|
|
4121
4168
|
this.layoutUpdate = new Event();
|
|
4169
|
+
this.invitationUrlUpdate = new Event();
|
|
4122
4170
|
this.contextUpdate = new Event();
|
|
4123
4171
|
this._layout = layout ?? ShellLayout2.DEFAULT;
|
|
4124
4172
|
this._invitationCode = invitationCode;
|
|
4125
4173
|
this._spaceKey = spaceKey;
|
|
4174
|
+
this._invitationUrl = invitationUrl ?? window.location.origin;
|
|
4175
|
+
this._deviceInvitationParam = deviceInvitationParam ?? "deviceInvitationCode";
|
|
4176
|
+
this._spaceInvitationParam = spaceInvitationParam ?? "spaceInvitationCode";
|
|
4126
4177
|
}
|
|
4127
4178
|
get layout() {
|
|
4128
4179
|
return this._layout;
|
|
@@ -4133,12 +4184,27 @@ var MemoryShellRuntime = class {
|
|
|
4133
4184
|
get spaceKey() {
|
|
4134
4185
|
return this._spaceKey;
|
|
4135
4186
|
}
|
|
4187
|
+
get invitationUrl() {
|
|
4188
|
+
return this._invitationUrl;
|
|
4189
|
+
}
|
|
4190
|
+
get deviceInvitationParam() {
|
|
4191
|
+
return this._deviceInvitationParam;
|
|
4192
|
+
}
|
|
4193
|
+
get spaceInvitationParam() {
|
|
4194
|
+
return this._spaceInvitationParam;
|
|
4195
|
+
}
|
|
4136
4196
|
setLayout(request) {
|
|
4137
4197
|
this._layout = request.layout;
|
|
4138
4198
|
this._invitationCode = request.invitationCode;
|
|
4139
4199
|
this._spaceKey = request.spaceKey;
|
|
4140
4200
|
this.layoutUpdate.emit(request);
|
|
4141
4201
|
}
|
|
4202
|
+
setInvitationUrl(request) {
|
|
4203
|
+
this._invitationUrl = request.invitationUrl;
|
|
4204
|
+
this._deviceInvitationParam = request.deviceInvitationParam;
|
|
4205
|
+
this._spaceInvitationParam = request.spaceInvitationParam;
|
|
4206
|
+
this.invitationUrlUpdate.emit(request);
|
|
4207
|
+
}
|
|
4142
4208
|
async setAppContext(context) {
|
|
4143
4209
|
this.contextUpdate.emit(context);
|
|
4144
4210
|
}
|
|
@@ -4147,14 +4213,14 @@ var MemoryShellRuntime = class {
|
|
|
4147
4213
|
// packages/sdk/shell/src/composites/Shell/ShellContext.tsx
|
|
4148
4214
|
var ShellContext = /* @__PURE__ */ createContext2({});
|
|
4149
4215
|
var useShell = () => {
|
|
4150
|
-
const client =
|
|
4216
|
+
const client = useClient8();
|
|
4151
4217
|
const { runtime, setDisplay } = useContext2(ShellContext);
|
|
4152
4218
|
const setLayout = async (layout, options) => {
|
|
4153
4219
|
if (runtime) {
|
|
4154
4220
|
if (layout === ShellLayout3.DEFAULT) {
|
|
4155
|
-
setDisplay?.(
|
|
4221
|
+
setDisplay?.(ShellDisplay3.NONE);
|
|
4156
4222
|
} else {
|
|
4157
|
-
setDisplay?.(
|
|
4223
|
+
setDisplay?.(ShellDisplay3.FULLSCREEN);
|
|
4158
4224
|
}
|
|
4159
4225
|
runtime.setLayout({
|
|
4160
4226
|
layout,
|
|
@@ -4168,9 +4234,9 @@ var useShell = () => {
|
|
|
4168
4234
|
};
|
|
4169
4235
|
};
|
|
4170
4236
|
var ShellProvider = ({ space, deviceInvitationCode, spaceInvitationCode, onJoinedSpace, children }) => {
|
|
4171
|
-
const client =
|
|
4237
|
+
const client = useClient8();
|
|
4172
4238
|
const identity = useIdentity3();
|
|
4173
|
-
const [display, setDisplay] = useState14(!identity || spaceInvitationCode || deviceInvitationCode ?
|
|
4239
|
+
const [display, setDisplay] = useState14(!identity || spaceInvitationCode || deviceInvitationCode ? ShellDisplay3.FULLSCREEN : ShellDisplay3.NONE);
|
|
4174
4240
|
const shellRuntime = useMemo6(() => {
|
|
4175
4241
|
if (client.config.get("runtime.app.env.DX_VAULT") !== "false") {
|
|
4176
4242
|
return;
|
|
@@ -4205,13 +4271,13 @@ var ShellProvider = ({ space, deviceInvitationCode, spaceInvitationCode, onJoine
|
|
|
4205
4271
|
shellRuntime.setLayout({
|
|
4206
4272
|
layout: ShellLayout3.SHARE_IDENTITY
|
|
4207
4273
|
});
|
|
4208
|
-
setDisplay(
|
|
4274
|
+
setDisplay(ShellDisplay3.FULLSCREEN);
|
|
4209
4275
|
} else if (event.key === "." && modifier) {
|
|
4210
4276
|
shellRuntime.setLayout({
|
|
4211
4277
|
layout: ShellLayout3.SPACE,
|
|
4212
4278
|
spaceKey: space.key
|
|
4213
4279
|
});
|
|
4214
|
-
setDisplay(
|
|
4280
|
+
setDisplay(ShellDisplay3.FULLSCREEN);
|
|
4215
4281
|
}
|
|
4216
4282
|
}, [
|
|
4217
4283
|
space,
|
|
@@ -4241,10 +4307,9 @@ var ShellProvider = ({ space, deviceInvitationCode, spaceInvitationCode, onJoine
|
|
|
4241
4307
|
shellRuntime
|
|
4242
4308
|
]);
|
|
4243
4309
|
return /* @__PURE__ */ React48.createElement(React48.Fragment, null, shellRuntime && /* @__PURE__ */ React48.createElement("div", {
|
|
4244
|
-
className: mx25(display ===
|
|
4310
|
+
className: mx25(display === ShellDisplay3.NONE ? "hidden" : "")
|
|
4245
4311
|
}, /* @__PURE__ */ React48.createElement(Shell, {
|
|
4246
|
-
runtime: shellRuntime
|
|
4247
|
-
origin: window.location.origin
|
|
4312
|
+
runtime: shellRuntime
|
|
4248
4313
|
})), /* @__PURE__ */ React48.createElement(ShellContext.Provider, {
|
|
4249
4314
|
value: {
|
|
4250
4315
|
runtime: shellRuntime,
|