@dxos/shell 0.5.1-next.2ad6c47 → 0.5.1-next.39e0ee2
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-C6f21e0q.mjs +0 -96625
- package/dist/bundle/index-C6f21e0q.mjs.map +0 -1
- package/dist/bundle/index-CJ-3oETH.mjs +0 -110
- package/dist/bundle/index-CJ-3oETH.mjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"en-US.d.ts","sourceRoot":"","sources":["../../../../../src/translations/locales/en-US.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,EAAE
|
|
1
|
+
{"version":3,"file":"en-US.d.ts","sourceRoot":"","sources":["../../../../../src/translations/locales/en-US.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6Id,CAAC"}
|
|
@@ -87,14 +87,14 @@ exports.os = {
|
|
|
87
87
|
'auth code message': 'Enter the following auth code on the joining device.',
|
|
88
88
|
'display name input label': 'Display name',
|
|
89
89
|
'display name input placeholder': 'Enter a display name',
|
|
90
|
-
'invite one label': '
|
|
90
|
+
'invite one label': 'Single-use invitation',
|
|
91
91
|
'invite one description': 'Only one user may join.',
|
|
92
|
-
'invite one qr label': 'Single-use',
|
|
92
|
+
'invite one qr label': 'Single-use invitation',
|
|
93
93
|
'invite one list item label': 'Active single-use invitation',
|
|
94
|
-
'invite many label': '
|
|
94
|
+
'invite many label': 'Standing invitation',
|
|
95
95
|
'invite many description': 'Anyone with the link can join.',
|
|
96
|
-
'invite many qr label': '
|
|
97
|
-
'invite many list item label': 'Active
|
|
96
|
+
'invite many qr label': 'Standing invitation',
|
|
97
|
+
'invite many list item label': 'Active standing invitation',
|
|
98
98
|
'invite options label': 'Change the active invite option.',
|
|
99
99
|
'reset in progress label': 'Resetting...',
|
|
100
100
|
'confirm label': 'Confirm',
|
|
@@ -141,5 +141,6 @@ exports.os = {
|
|
|
141
141
|
'create agent label': 'Start an agent',
|
|
142
142
|
'destroy agent label': 'Shut down agent',
|
|
143
143
|
'agent device label': 'Your agent',
|
|
144
|
+
'shell fallback title': 'Shell failed to connect',
|
|
144
145
|
};
|
|
145
146
|
//# sourceMappingURL=en-US.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"en-US.js","sourceRoot":"","sources":["../../../../../src/translations/locales/en-US.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;AAEW,QAAA,EAAE,GAAG;IAChB,s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AgB;IACtC,qBAAqB,EAAE,iBAAiB;IACxC,oBAAoB,EAAE,YAAY;IAClC,sBAAsB,EAAE,yBAAyB;CAClD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/shell",
|
|
3
|
-
"version": "0.5.1-next.
|
|
3
|
+
"version": "0.5.1-next.39e0ee2",
|
|
4
4
|
"description": "DXOS’s OS experiences",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -42,19 +42,18 @@
|
|
|
42
42
|
"react-qr-rounded": "^1.0.0",
|
|
43
43
|
"url-join": "^5.0.0",
|
|
44
44
|
"xstate": "^4.37.0",
|
|
45
|
-
"@dxos/async": "0.5.1-next.
|
|
46
|
-
"@dxos/client-
|
|
47
|
-
"@dxos/
|
|
48
|
-
"@dxos/
|
|
49
|
-
"@dxos/
|
|
50
|
-
"@dxos/
|
|
51
|
-
"@dxos/
|
|
52
|
-
"@dxos/react-
|
|
53
|
-
"@dxos/react-ui": "0.5.1-next.
|
|
54
|
-
"@dxos/react-ui-
|
|
55
|
-
"@dxos/
|
|
56
|
-
"@dxos/util": "0.5.1-next.
|
|
57
|
-
"@dxos/rpc-tunnel": "0.5.1-next.2ad6c47"
|
|
45
|
+
"@dxos/async": "0.5.1-next.39e0ee2",
|
|
46
|
+
"@dxos/client-services": "0.5.1-next.39e0ee2",
|
|
47
|
+
"@dxos/debug": "0.5.1-next.39e0ee2",
|
|
48
|
+
"@dxos/client-protocol": "0.5.1-next.39e0ee2",
|
|
49
|
+
"@dxos/display-name": "0.5.1-next.39e0ee2",
|
|
50
|
+
"@dxos/log": "0.5.1-next.39e0ee2",
|
|
51
|
+
"@dxos/invariant": "0.5.1-next.39e0ee2",
|
|
52
|
+
"@dxos/react-ui-theme": "0.5.1-next.39e0ee2",
|
|
53
|
+
"@dxos/react-ui": "0.5.1-next.39e0ee2",
|
|
54
|
+
"@dxos/react-ui-types": "0.5.1-next.39e0ee2",
|
|
55
|
+
"@dxos/rpc-tunnel": "0.5.1-next.39e0ee2",
|
|
56
|
+
"@dxos/util": "0.5.1-next.39e0ee2"
|
|
58
57
|
},
|
|
59
58
|
"devDependencies": {
|
|
60
59
|
"@phosphor-icons/react": "^2.1.5",
|
|
@@ -65,17 +64,19 @@
|
|
|
65
64
|
"react-dom": "^18.2.0",
|
|
66
65
|
"vite": "^5.2.9",
|
|
67
66
|
"vite-plugin-turbosnap": "^1.0.2",
|
|
68
|
-
"@dxos/
|
|
69
|
-
"@dxos/
|
|
70
|
-
"@dxos/react-
|
|
71
|
-
"@dxos/
|
|
72
|
-
"@dxos/react-async": "0.5.1-next.
|
|
73
|
-
"@dxos/
|
|
67
|
+
"@dxos/protocols": "0.5.1-next.39e0ee2",
|
|
68
|
+
"@dxos/react-ui-theme": "0.5.1-next.39e0ee2",
|
|
69
|
+
"@dxos/react-client": "0.5.1-next.39e0ee2",
|
|
70
|
+
"@dxos/random": "0.5.1-next.39e0ee2",
|
|
71
|
+
"@dxos/react-async": "0.5.1-next.39e0ee2",
|
|
72
|
+
"@dxos/storybook-utils": "0.5.1-next.39e0ee2",
|
|
73
|
+
"@dxos/config": "0.5.1-next.39e0ee2"
|
|
74
74
|
},
|
|
75
75
|
"peerDependencies": {
|
|
76
76
|
"@phosphor-icons/react": "^2.0.5",
|
|
77
77
|
"react": "^18.2.0",
|
|
78
|
-
"react-dom": "^18.2.0"
|
|
78
|
+
"react-dom": "^18.2.0",
|
|
79
|
+
"@dxos/react-client": "0.5.1-next.39e0ee2"
|
|
79
80
|
},
|
|
80
81
|
"publishConfig": {
|
|
81
82
|
"access": "public"
|
|
@@ -5,7 +5,14 @@
|
|
|
5
5
|
import React, { useEffect, useState } from 'react';
|
|
6
6
|
|
|
7
7
|
import { log } from '@dxos/log';
|
|
8
|
-
import {
|
|
8
|
+
import {
|
|
9
|
+
type LayoutRequest,
|
|
10
|
+
ShellDisplay,
|
|
11
|
+
ShellLayout,
|
|
12
|
+
type ShellRuntime,
|
|
13
|
+
useClient,
|
|
14
|
+
type InvitationUrlRequest,
|
|
15
|
+
} from '@dxos/react-client';
|
|
9
16
|
import { useSpace } from '@dxos/react-client/echo';
|
|
10
17
|
|
|
11
18
|
import { IdentityDialog } from '../IdentityDialog';
|
|
@@ -13,19 +20,43 @@ import { JoinDialog } from '../JoinDialog';
|
|
|
13
20
|
import { SpaceDialog } from '../SpaceDialog';
|
|
14
21
|
import { StatusDialog } from '../StatusDialog';
|
|
15
22
|
|
|
16
|
-
export const Shell = ({ runtime
|
|
23
|
+
export const Shell = ({ runtime }: { runtime: ShellRuntime }) => {
|
|
17
24
|
const [{ layout, invitationCode, spaceKey, target }, setLayout] = useState<LayoutRequest>({
|
|
18
25
|
layout: runtime.layout,
|
|
19
26
|
invitationCode: runtime.invitationCode,
|
|
20
27
|
spaceKey: runtime.spaceKey,
|
|
21
28
|
target: runtime.target,
|
|
22
29
|
});
|
|
30
|
+
const [{ invitationUrl, deviceInvitationParam, spaceInvitationParam }, setInvitationUrl] =
|
|
31
|
+
useState<InvitationUrlRequest>({
|
|
32
|
+
invitationUrl: runtime.invitationUrl,
|
|
33
|
+
deviceInvitationParam: runtime.deviceInvitationParam,
|
|
34
|
+
spaceInvitationParam: runtime.spaceInvitationParam,
|
|
35
|
+
});
|
|
23
36
|
|
|
24
37
|
const client = useClient();
|
|
25
38
|
const space = useSpace(spaceKey);
|
|
26
39
|
|
|
40
|
+
const createDeviceInvitationUrl = (invitationCode: string) => {
|
|
41
|
+
const baseUrl = new URL(invitationUrl);
|
|
42
|
+
baseUrl.searchParams.set(deviceInvitationParam, invitationCode);
|
|
43
|
+
return baseUrl.toString();
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
const createSpaceInvitationUrl = (invitationCode: string) => {
|
|
47
|
+
const baseUrl = new URL(invitationUrl);
|
|
48
|
+
baseUrl.searchParams.set(spaceInvitationParam, invitationCode);
|
|
49
|
+
return baseUrl.toString();
|
|
50
|
+
};
|
|
51
|
+
|
|
27
52
|
useEffect(() => {
|
|
28
|
-
|
|
53
|
+
const unsubscribeLayout = runtime.layoutUpdate.on((request) => setLayout(request));
|
|
54
|
+
const unsubscribeInvitationUrl = runtime.invitationUrlUpdate.on((request) => setInvitationUrl(request));
|
|
55
|
+
|
|
56
|
+
return () => {
|
|
57
|
+
unsubscribeLayout();
|
|
58
|
+
unsubscribeInvitationUrl();
|
|
59
|
+
};
|
|
29
60
|
}, [runtime]);
|
|
30
61
|
|
|
31
62
|
useEffect(() => {
|
|
@@ -66,7 +97,7 @@ export const Shell = ({ runtime, origin }: { runtime: ShellRuntime; origin: stri
|
|
|
66
97
|
case ShellLayout.EDIT_PROFILE:
|
|
67
98
|
return (
|
|
68
99
|
<IdentityDialog
|
|
69
|
-
createInvitationUrl={
|
|
100
|
+
createInvitationUrl={createDeviceInvitationUrl}
|
|
70
101
|
onResetStorage={async () => {
|
|
71
102
|
runtime.setLayout({ layout: ShellLayout.STATUS });
|
|
72
103
|
await client.reset();
|
|
@@ -90,7 +121,7 @@ export const Shell = ({ runtime, origin }: { runtime: ShellRuntime; origin: stri
|
|
|
90
121
|
<SpaceDialog
|
|
91
122
|
space={space}
|
|
92
123
|
target={target}
|
|
93
|
-
createInvitationUrl={
|
|
124
|
+
createInvitationUrl={createSpaceInvitationUrl}
|
|
94
125
|
onDone={async () => {
|
|
95
126
|
await runtime.setAppContext({ display: ShellDisplay.NONE });
|
|
96
127
|
runtime.setLayout({ layout: ShellLayout.DEFAULT });
|
|
@@ -153,7 +153,7 @@ export const ShellProvider = ({
|
|
|
153
153
|
<>
|
|
154
154
|
{shellRuntime && (
|
|
155
155
|
<div className={mx(display === ShellDisplay.NONE ? 'hidden' : '')}>
|
|
156
|
-
<Shell runtime={shellRuntime}
|
|
156
|
+
<Shell runtime={shellRuntime} />
|
|
157
157
|
</div>
|
|
158
158
|
)}
|
|
159
159
|
|
|
@@ -4,25 +4,40 @@
|
|
|
4
4
|
|
|
5
5
|
import { Event } from '@dxos/async';
|
|
6
6
|
import {
|
|
7
|
+
ShellLayout,
|
|
7
8
|
type AppContextRequest,
|
|
9
|
+
type InvitationUrlRequest,
|
|
8
10
|
type LayoutRequest,
|
|
9
11
|
type PublicKey,
|
|
10
|
-
ShellLayout,
|
|
11
12
|
type ShellRuntime,
|
|
12
13
|
} from '@dxos/react-client';
|
|
13
14
|
|
|
14
15
|
// TODO(wittjosiah): Remove?
|
|
15
16
|
export class MemoryShellRuntime implements ShellRuntime {
|
|
16
17
|
readonly layoutUpdate = new Event<LayoutRequest>();
|
|
18
|
+
readonly invitationUrlUpdate = new Event<InvitationUrlRequest>();
|
|
17
19
|
readonly contextUpdate = new Event<AppContextRequest>();
|
|
18
20
|
private _layout: ShellLayout;
|
|
19
21
|
private _invitationCode?: string;
|
|
20
22
|
private _spaceKey?: PublicKey;
|
|
23
|
+
private _invitationUrl: string;
|
|
24
|
+
private _deviceInvitationParam: string;
|
|
25
|
+
private _spaceInvitationParam: string;
|
|
21
26
|
|
|
22
|
-
constructor({
|
|
27
|
+
constructor({
|
|
28
|
+
layout,
|
|
29
|
+
invitationCode,
|
|
30
|
+
spaceKey,
|
|
31
|
+
invitationUrl,
|
|
32
|
+
deviceInvitationParam,
|
|
33
|
+
spaceInvitationParam,
|
|
34
|
+
}: Partial<LayoutRequest> & Partial<AppContextRequest> & Partial<InvitationUrlRequest> = {}) {
|
|
23
35
|
this._layout = layout ?? ShellLayout.DEFAULT;
|
|
24
36
|
this._invitationCode = invitationCode;
|
|
25
37
|
this._spaceKey = spaceKey;
|
|
38
|
+
this._invitationUrl = invitationUrl ?? window.location.origin;
|
|
39
|
+
this._deviceInvitationParam = deviceInvitationParam ?? 'deviceInvitationCode';
|
|
40
|
+
this._spaceInvitationParam = spaceInvitationParam ?? 'spaceInvitationCode';
|
|
26
41
|
}
|
|
27
42
|
|
|
28
43
|
get layout() {
|
|
@@ -37,6 +52,18 @@ export class MemoryShellRuntime implements ShellRuntime {
|
|
|
37
52
|
return this._spaceKey;
|
|
38
53
|
}
|
|
39
54
|
|
|
55
|
+
get invitationUrl() {
|
|
56
|
+
return this._invitationUrl;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
get deviceInvitationParam() {
|
|
60
|
+
return this._deviceInvitationParam;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
get spaceInvitationParam() {
|
|
64
|
+
return this._spaceInvitationParam;
|
|
65
|
+
}
|
|
66
|
+
|
|
40
67
|
setLayout(request: LayoutRequest) {
|
|
41
68
|
this._layout = request.layout;
|
|
42
69
|
this._invitationCode = request.invitationCode;
|
|
@@ -44,6 +71,13 @@ export class MemoryShellRuntime implements ShellRuntime {
|
|
|
44
71
|
this.layoutUpdate.emit(request);
|
|
45
72
|
}
|
|
46
73
|
|
|
74
|
+
setInvitationUrl(request: InvitationUrlRequest) {
|
|
75
|
+
this._invitationUrl = request.invitationUrl;
|
|
76
|
+
this._deviceInvitationParam = request.deviceInvitationParam;
|
|
77
|
+
this._spaceInvitationParam = request.spaceInvitationParam;
|
|
78
|
+
this.invitationUrlUpdate.emit(request);
|
|
79
|
+
}
|
|
80
|
+
|
|
47
81
|
async setAppContext(context: AppContextRequest) {
|
|
48
82
|
this.contextUpdate.emit(context);
|
|
49
83
|
}
|
|
@@ -7,8 +7,16 @@ import { createRoot } from 'react-dom/client';
|
|
|
7
7
|
|
|
8
8
|
import { DEFAULT_CLIENT_CHANNEL, DEFAULT_SHELL_CHANNEL } from '@dxos/client-protocol';
|
|
9
9
|
import { ShellRuntimeImpl } from '@dxos/client-services';
|
|
10
|
-
import {
|
|
11
|
-
|
|
10
|
+
import {
|
|
11
|
+
AgentHostingProvider,
|
|
12
|
+
Client,
|
|
13
|
+
ClientContext,
|
|
14
|
+
ClientServicesProxy,
|
|
15
|
+
Config,
|
|
16
|
+
ShellDisplay,
|
|
17
|
+
SystemStatus,
|
|
18
|
+
} from '@dxos/react-client';
|
|
19
|
+
import { Button, Dialog, ThemeProvider, Tooltip, useTranslation } from '@dxos/react-ui';
|
|
12
20
|
import { defaultTx } from '@dxos/react-ui-theme';
|
|
13
21
|
import { createIFramePort } from '@dxos/rpc-tunnel';
|
|
14
22
|
|
|
@@ -17,22 +25,55 @@ import { ClipboardProvider } from '../../components';
|
|
|
17
25
|
import { osTranslations } from '../../translations';
|
|
18
26
|
|
|
19
27
|
export const runShell = async (config: Config = new Config()) => {
|
|
20
|
-
|
|
21
|
-
const client = new Client({ config, services });
|
|
28
|
+
// If runtime fails to open then the shell will not be openable.
|
|
22
29
|
const runtime = new ShellRuntimeImpl(createIFramePort({ channel: DEFAULT_SHELL_CHANNEL }));
|
|
23
|
-
await
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
30
|
+
await runtime.open();
|
|
31
|
+
|
|
32
|
+
try {
|
|
33
|
+
const services = new ClientServicesProxy(createIFramePort({ channel: DEFAULT_CLIENT_CHANNEL }));
|
|
34
|
+
const client = new Client({ config, services });
|
|
35
|
+
await client.initialize();
|
|
36
|
+
|
|
37
|
+
createRoot(document.getElementById('root')!).render(
|
|
38
|
+
<StrictMode>
|
|
39
|
+
<ThemeProvider tx={defaultTx} resourceExtensions={[osTranslations]}>
|
|
40
|
+
<ClientContext.Provider value={{ client, status: SystemStatus.ACTIVE }}>
|
|
41
|
+
<ClipboardProvider>
|
|
42
|
+
<Tooltip.Provider>
|
|
43
|
+
<AgentHostingProvider>
|
|
44
|
+
<Shell runtime={runtime} />
|
|
45
|
+
</AgentHostingProvider>
|
|
46
|
+
</Tooltip.Provider>
|
|
47
|
+
</ClipboardProvider>
|
|
48
|
+
</ClientContext.Provider>
|
|
49
|
+
</ThemeProvider>
|
|
50
|
+
</StrictMode>,
|
|
51
|
+
);
|
|
52
|
+
} catch {
|
|
53
|
+
// If shell's client fails to initialize, ensure that the shell is still closeable.
|
|
54
|
+
createRoot(document.getElementById('root')!).render(
|
|
55
|
+
<StrictMode>
|
|
56
|
+
<ThemeProvider tx={defaultTx} resourceExtensions={[osTranslations]}>
|
|
57
|
+
<Fallback onClose={() => runtime.setAppContext({ display: ShellDisplay.NONE })} />
|
|
58
|
+
</ThemeProvider>
|
|
59
|
+
</StrictMode>,
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
const Fallback = ({ onClose }: { onClose?: () => void }) => {
|
|
65
|
+
const { t } = useTranslation('os');
|
|
66
|
+
|
|
67
|
+
return (
|
|
68
|
+
<Dialog.Root modal open onOpenChange={() => onClose?.()}>
|
|
69
|
+
<Dialog.Overlay>
|
|
70
|
+
<Dialog.Content>
|
|
71
|
+
<Dialog.Title>{t('shell fallback title')}</Dialog.Title>
|
|
72
|
+
<Dialog.Close asChild onClick={() => onClose?.()}>
|
|
73
|
+
<Button variant='primary'>{t('close label')}</Button>
|
|
74
|
+
</Dialog.Close>
|
|
75
|
+
</Dialog.Content>
|
|
76
|
+
</Dialog.Overlay>
|
|
77
|
+
</Dialog.Root>
|
|
37
78
|
);
|
|
38
79
|
};
|
|
@@ -235,7 +235,7 @@ export const IdentityPanel = ({
|
|
|
235
235
|
const devices = useDevices();
|
|
236
236
|
const identity = useIdentity();
|
|
237
237
|
const invitations = useHaloInvitations();
|
|
238
|
-
const agentProps = useAgentHandlers({
|
|
238
|
+
const agentProps = useAgentHandlers({ identity, invitations });
|
|
239
239
|
if (!identity) {
|
|
240
240
|
log.error('IdentityPanel rendered with no active identity.');
|
|
241
241
|
return null;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import React, { useCallback } from 'react';
|
|
6
6
|
|
|
7
7
|
import { log } from '@dxos/log';
|
|
8
|
-
import {
|
|
8
|
+
import { useAgentHostingClient, useClient } from '@dxos/react-client';
|
|
9
9
|
import { useHaloInvitations } from '@dxos/react-client/halo';
|
|
10
10
|
import { Invitation, InvitationEncoder } from '@dxos/react-client/invitations';
|
|
11
11
|
|
|
@@ -18,7 +18,7 @@ export const IdentityActionChooser = (props: IdentityPanelStepProps) => {
|
|
|
18
18
|
const { send } = props;
|
|
19
19
|
const client = useClient();
|
|
20
20
|
const invitations = useHaloInvitations();
|
|
21
|
-
const agentHostingProviderClient =
|
|
21
|
+
const agentHostingProviderClient = useAgentHostingClient();
|
|
22
22
|
const onInvitationEvent = useCallback((invitation: Invitation) => {
|
|
23
23
|
const invitationCode = InvitationEncoder.encode(invitation);
|
|
24
24
|
if (invitation.state === Invitation.State.CONNECTING) {
|
|
@@ -7,23 +7,22 @@ import { useCallback, useEffect, useState } from 'react';
|
|
|
7
7
|
import { type CancellableInvitation } from '@dxos/client-protocol';
|
|
8
8
|
import { invariant } from '@dxos/invariant';
|
|
9
9
|
import { log } from '@dxos/log';
|
|
10
|
-
import {
|
|
10
|
+
import { useAgentHostingClient, useClient } from '@dxos/react-client';
|
|
11
11
|
import { type Identity } from '@dxos/react-client/halo';
|
|
12
12
|
import { Invitation, InvitationEncoder } from '@dxos/react-client/invitations';
|
|
13
13
|
|
|
14
14
|
export const useAgentHandlers = ({
|
|
15
|
-
client,
|
|
16
15
|
invitations,
|
|
17
16
|
identity,
|
|
18
17
|
}: {
|
|
19
|
-
client: Client;
|
|
20
18
|
invitations: CancellableInvitation[];
|
|
21
19
|
identity: Identity | null;
|
|
22
20
|
}) => {
|
|
23
21
|
const [validationMessage, setValidationMessage] = useState('');
|
|
24
22
|
const [agentStatus, setAgentStatus] = useState('');
|
|
25
23
|
const [agentActive, setAgentActive] = useState(false);
|
|
26
|
-
const agentHostingProviderClient =
|
|
24
|
+
const agentHostingProviderClient = useAgentHostingClient();
|
|
25
|
+
const client = useClient();
|
|
27
26
|
|
|
28
27
|
useEffect(() => {
|
|
29
28
|
const fetchAgentStatus = async () => {
|
|
@@ -60,7 +60,7 @@ export const JoinPanelImpl = (props: JoinPanelImplProps) => {
|
|
|
60
60
|
<Viewport.View classNames={stepStyles} id='reset storage confirmation'>
|
|
61
61
|
<ConfirmResetComponent
|
|
62
62
|
send={send}
|
|
63
|
-
active={activeView === 'reset
|
|
63
|
+
active={activeView === 'reset storage confirmation'}
|
|
64
64
|
onCancel={onCancelResetStorage}
|
|
65
65
|
onConfirm={onConfirmResetStorage}
|
|
66
66
|
/>
|
|
@@ -222,7 +222,7 @@ export const JoinPanel = ({
|
|
|
222
222
|
case joinState.matches({ choosingIdentity: 'choosingAuthMethod' }):
|
|
223
223
|
return 'addition method chooser';
|
|
224
224
|
case joinState.matches('resettingIdentity'):
|
|
225
|
-
return 'reset
|
|
225
|
+
return 'reset storage confirmation';
|
|
226
226
|
case joinState.matches({ choosingIdentity: 'creatingIdentity' }):
|
|
227
227
|
return 'create identity input';
|
|
228
228
|
case joinState.matches({ choosingIdentity: 'recoveringIdentity' }):
|
|
@@ -73,8 +73,8 @@ export const SpaceManager = (props: SpaceManagerProps) => {
|
|
|
73
73
|
icon: UsersThree,
|
|
74
74
|
onClick: useCallback(() => {
|
|
75
75
|
const invitation = space.share?.({
|
|
76
|
-
type: Invitation.Type.
|
|
77
|
-
authMethod: Invitation.AuthMethod.
|
|
76
|
+
type: Invitation.Type.DELEGATED,
|
|
77
|
+
authMethod: Invitation.AuthMethod.KNOWN_PUBLIC_KEY,
|
|
78
78
|
multiUse: true,
|
|
79
79
|
target,
|
|
80
80
|
});
|
|
@@ -83,22 +83,6 @@ export const SpaceManager = (props: SpaceManagerProps) => {
|
|
|
83
83
|
}
|
|
84
84
|
}, [space]),
|
|
85
85
|
},
|
|
86
|
-
// inviteNonPersistent: {
|
|
87
|
-
// label: 'Invite one (nonpersistent)',
|
|
88
|
-
// description: 'Only one user may join. Invitation does not resume if client is restarted.',
|
|
89
|
-
// icon: UserPlus,
|
|
90
|
-
// onClick: useCallback(() => {
|
|
91
|
-
// const invitation = space.share?.({
|
|
92
|
-
// type: Invitation.Type.INTERACTIVE,
|
|
93
|
-
// authMethod: Invitation.AuthMethod.SHARED_SECRET,
|
|
94
|
-
// persistent: false,
|
|
95
|
-
// target,
|
|
96
|
-
// });
|
|
97
|
-
// if (invitation && config.values.runtime?.app?.env?.DX_ENVIRONMENT !== 'production') {
|
|
98
|
-
// invitation.subscribe(onInvitationEvent);
|
|
99
|
-
// }
|
|
100
|
-
// }, [space]),
|
|
101
|
-
// },
|
|
102
86
|
};
|
|
103
87
|
|
|
104
88
|
return <SpaceManagerImpl {...props} invitations={invitations} inviteActions={inviteActions} />;
|
|
@@ -53,6 +53,9 @@ export const InvitationManager = ({
|
|
|
53
53
|
const showAuthCode = statusValue === 3;
|
|
54
54
|
const emoji = hexToEmoji(id);
|
|
55
55
|
const activeView = useMemo(() => {
|
|
56
|
+
if (multiUse) {
|
|
57
|
+
return 'showing qr';
|
|
58
|
+
}
|
|
56
59
|
switch (true) {
|
|
57
60
|
case statusValue === 5:
|
|
58
61
|
case statusValue < 0:
|
|
@@ -85,14 +85,14 @@ export const os = {
|
|
|
85
85
|
'auth code message': 'Enter the following auth code on the joining device.',
|
|
86
86
|
'display name input label': 'Display name',
|
|
87
87
|
'display name input placeholder': 'Enter a display name',
|
|
88
|
-
'invite one label': '
|
|
88
|
+
'invite one label': 'Single-use invitation',
|
|
89
89
|
'invite one description': 'Only one user may join.',
|
|
90
|
-
'invite one qr label': 'Single-use',
|
|
90
|
+
'invite one qr label': 'Single-use invitation',
|
|
91
91
|
'invite one list item label': 'Active single-use invitation',
|
|
92
|
-
'invite many label': '
|
|
92
|
+
'invite many label': 'Standing invitation',
|
|
93
93
|
'invite many description': 'Anyone with the link can join.',
|
|
94
|
-
'invite many qr label': '
|
|
95
|
-
'invite many list item label': 'Active
|
|
94
|
+
'invite many qr label': 'Standing invitation',
|
|
95
|
+
'invite many list item label': 'Active standing invitation',
|
|
96
96
|
'invite options label': 'Change the active invite option.',
|
|
97
97
|
'reset in progress label': 'Resetting...',
|
|
98
98
|
'confirm label': 'Confirm',
|
|
@@ -142,4 +142,5 @@ export const os = {
|
|
|
142
142
|
'create agent label': 'Start an agent',
|
|
143
143
|
'destroy agent label': 'Shut down agent',
|
|
144
144
|
'agent device label': 'Your agent',
|
|
145
|
+
'shell fallback title': 'Shell failed to connect',
|
|
145
146
|
};
|