@dxos/plugin-client 0.8.4-main.b97322e → 0.8.4-main.dedc0f3
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/lib/browser/{app-graph-builder-JNIES5L4.mjs → app-graph-builder-ENKIVZWH.mjs} +3 -3
- package/dist/lib/browser/app-graph-builder-ENKIVZWH.mjs.map +7 -0
- package/dist/lib/browser/{chunk-SV3MHIKI.mjs → chunk-FOCQEA72.mjs} +16 -25
- package/dist/lib/browser/chunk-FOCQEA72.mjs.map +7 -0
- package/dist/lib/browser/{chunk-RMHBOY3Y.mjs → chunk-HLWIF3AW.mjs} +1 -1
- package/dist/lib/browser/{chunk-RMHBOY3Y.mjs.map → chunk-HLWIF3AW.mjs.map} +2 -2
- package/dist/lib/browser/{client-SKVKXPLY.mjs → client-F73MIXMT.mjs} +9 -3
- package/dist/lib/browser/client-F73MIXMT.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +8 -8
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-resolver-LNPLD5CA.mjs → intent-resolver-LNPFUWU5.mjs} +11 -11
- package/dist/lib/browser/intent-resolver-LNPFUWU5.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{migrations-D76RCG72.mjs → migrations-YJSO7JXY.mjs} +1 -1
- package/dist/lib/{node-esm/migrations-YISDI7LF.mjs.map → browser/migrations-YJSO7JXY.mjs.map} +2 -2
- package/dist/lib/browser/{react-context-YWVPZUMU.mjs → react-context-QBXCHNH2.mjs} +1 -1
- package/dist/lib/browser/{react-context-YWVPZUMU.mjs.map → react-context-QBXCHNH2.mjs.map} +2 -2
- package/dist/lib/browser/{react-surface-QFZTDNLS.mjs → react-surface-3AH7INFU.mjs} +4 -4
- package/dist/lib/browser/{react-surface-QFZTDNLS.mjs.map → react-surface-3AH7INFU.mjs.map} +3 -3
- package/dist/lib/browser/{schema-defs-HKW6VNZB.mjs → schema-defs-AMSX6T3B.mjs} +1 -1
- package/dist/lib/{node-esm/schema-defs-5ZNI63RW.mjs.map → browser/schema-defs-AMSX6T3B.mjs.map} +2 -2
- package/dist/lib/browser/types/index.mjs +1 -1
- package/dist/lib/node-esm/{app-graph-builder-SWFB4FID.mjs → app-graph-builder-D4XJCLPN.mjs} +3 -3
- package/dist/lib/node-esm/app-graph-builder-D4XJCLPN.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-5V3RCXZV.mjs → chunk-JG6AFSFU.mjs} +1 -1
- package/dist/lib/node-esm/{chunk-5V3RCXZV.mjs.map → chunk-JG6AFSFU.mjs.map} +2 -2
- package/dist/lib/node-esm/{chunk-FBYODKEL.mjs → chunk-MUWDSQ65.mjs} +16 -25
- package/dist/lib/node-esm/chunk-MUWDSQ65.mjs.map +7 -0
- package/dist/lib/node-esm/{client-SLL6GDC2.mjs → client-A7CNP37P.mjs} +9 -3
- package/dist/lib/node-esm/client-A7CNP37P.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +8 -8
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/{intent-resolver-L7C6YRWV.mjs → intent-resolver-C4INMPH7.mjs} +11 -11
- package/dist/lib/node-esm/intent-resolver-C4INMPH7.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{migrations-YISDI7LF.mjs → migrations-UOEK7HB7.mjs} +1 -1
- package/dist/lib/{browser/migrations-D76RCG72.mjs.map → node-esm/migrations-UOEK7HB7.mjs.map} +2 -2
- package/dist/lib/node-esm/{react-context-EEHS4S3L.mjs → react-context-JIH7YBFI.mjs} +1 -1
- package/dist/lib/node-esm/{react-context-EEHS4S3L.mjs.map → react-context-JIH7YBFI.mjs.map} +2 -2
- package/dist/lib/node-esm/{react-surface-2K6W37R4.mjs → react-surface-4TMUCPEW.mjs} +4 -4
- package/dist/lib/node-esm/{react-surface-2K6W37R4.mjs.map → react-surface-4TMUCPEW.mjs.map} +3 -3
- package/dist/lib/node-esm/{schema-defs-5ZNI63RW.mjs → schema-defs-4UTKKRTF.mjs} +1 -1
- package/dist/lib/{browser/schema-defs-HKW6VNZB.mjs.map → node-esm/schema-defs-4UTKKRTF.mjs.map} +2 -2
- package/dist/lib/node-esm/types/index.mjs +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/client.d.ts +1 -1
- package/dist/types/src/capabilities/client.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +8 -8
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/migrations.d.ts +1 -1
- package/dist/types/src/capabilities/migrations.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-context.d.ts +2 -2
- package/dist/types/src/capabilities/react-context.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/schema-defs.d.ts +1 -1
- package/dist/types/src/capabilities/schema-defs.d.ts.map +1 -1
- package/dist/types/src/components/DevicesContainer.d.ts.map +1 -1
- package/dist/types/src/components/DevicesContainer.stories.d.ts +225 -4
- package/dist/types/src/components/DevicesContainer.stories.d.ts.map +1 -1
- package/dist/types/src/components/ProfileContainer.d.ts.map +1 -1
- package/dist/types/src/components/ProfileContainer.stories.d.ts +57 -4
- package/dist/types/src/components/ProfileContainer.stories.d.ts.map +1 -1
- package/dist/types/src/components/RecoveryCodeDialog.stories.d.ts +59 -4
- package/dist/types/src/components/RecoveryCodeDialog.stories.d.ts.map +1 -1
- package/dist/types/src/components/RecoveryCredentialsContainer.d.ts.map +1 -1
- package/dist/types/src/components/RecoveryCredentialsContainer.stories.d.ts +58 -4
- package/dist/types/src/components/RecoveryCredentialsContainer.stories.d.ts.map +1 -1
- package/dist/types/src/components/ResetDialog.stories.d.ts +59 -3
- package/dist/types/src/components/ResetDialog.stories.d.ts.map +1 -1
- package/dist/types/src/types/schema.d.ts +9 -3
- package/dist/types/src/types/schema.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +29 -27
- package/src/ClientPlugin.ts +2 -2
- package/src/capabilities/app-graph-builder.ts +4 -3
- package/src/capabilities/client.ts +6 -4
- package/src/capabilities/intent-resolver.ts +5 -4
- package/src/capabilities/migrations.ts +1 -1
- package/src/capabilities/react-context.tsx +2 -1
- package/src/capabilities/react-surface.tsx +3 -3
- package/src/capabilities/schema-defs.ts +1 -1
- package/src/components/DevicesContainer.stories.tsx +8 -7
- package/src/components/DevicesContainer.tsx +54 -65
- package/src/components/JoinDialog.tsx +1 -1
- package/src/components/ProfileContainer.stories.tsx +7 -6
- package/src/components/ProfileContainer.tsx +19 -22
- package/src/components/RecoveryCodeDialog.stories.tsx +8 -7
- package/src/components/RecoveryCredentialsContainer.stories.tsx +8 -7
- package/src/components/RecoveryCredentialsContainer.tsx +44 -47
- package/src/components/ResetDialog.stories.tsx +7 -6
- package/src/components/ResetDialog.tsx +1 -1
- package/src/types/schema.ts +3 -3
- package/dist/lib/browser/app-graph-builder-JNIES5L4.mjs.map +0 -7
- package/dist/lib/browser/chunk-SV3MHIKI.mjs.map +0 -7
- package/dist/lib/browser/client-SKVKXPLY.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-LNPLD5CA.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-SWFB4FID.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-FBYODKEL.mjs.map +0 -7
- package/dist/lib/node-esm/client-SLL6GDC2.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-L7C6YRWV.mjs.map +0 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-client",
|
|
3
|
-
"version": "0.8.4-main.
|
|
3
|
+
"version": "0.8.4-main.dedc0f3",
|
|
4
4
|
"description": "DXOS Surface plugin for DXOS Client",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -10,11 +10,13 @@
|
|
|
10
10
|
"type": "module",
|
|
11
11
|
"exports": {
|
|
12
12
|
".": {
|
|
13
|
+
"source": "./src/index.ts",
|
|
13
14
|
"types": "./dist/types/src/index.d.ts",
|
|
14
15
|
"browser": "./dist/lib/browser/index.mjs",
|
|
15
16
|
"node": "./dist/lib/node-esm/index.mjs"
|
|
16
17
|
},
|
|
17
18
|
"./types": {
|
|
19
|
+
"source": "./src/types/index.ts",
|
|
18
20
|
"types": "./dist/types/src/types/index.d.ts",
|
|
19
21
|
"browser": "./dist/lib/browser/types/index.mjs",
|
|
20
22
|
"node": "./dist/lib/node-esm/types/index.mjs"
|
|
@@ -36,37 +38,37 @@
|
|
|
36
38
|
"@preact-signals/safe-react": "^0.9.0",
|
|
37
39
|
"@preact/signals-core": "^1.9.0",
|
|
38
40
|
"react-qr-rounded": "^1.0.0",
|
|
39
|
-
"@dxos/app-framework": "0.8.4-main.
|
|
40
|
-
"@dxos/
|
|
41
|
-
"@dxos/
|
|
42
|
-
"@dxos/echo
|
|
43
|
-
"@dxos/echo": "0.8.4-main.
|
|
44
|
-
"@dxos/echo-signals": "0.8.4-main.
|
|
45
|
-
"@dxos/invariant": "0.8.4-main.
|
|
46
|
-
"@dxos/log": "0.8.4-main.
|
|
47
|
-
"@dxos/
|
|
48
|
-
"@dxos/plugin-
|
|
49
|
-
"@dxos/
|
|
50
|
-
"@dxos/react-client": "0.8.4-main.
|
|
51
|
-
"@dxos/react-ui-form": "0.8.4-main.
|
|
52
|
-
"@dxos/react-ui-pickers": "0.8.4-main.
|
|
53
|
-
"@dxos/react-ui-stack": "0.8.4-main.
|
|
54
|
-
"@dxos/
|
|
55
|
-
"@dxos/
|
|
41
|
+
"@dxos/app-framework": "0.8.4-main.dedc0f3",
|
|
42
|
+
"@dxos/config": "0.8.4-main.dedc0f3",
|
|
43
|
+
"@dxos/async": "0.8.4-main.dedc0f3",
|
|
44
|
+
"@dxos/echo": "0.8.4-main.dedc0f3",
|
|
45
|
+
"@dxos/echo-schema": "0.8.4-main.dedc0f3",
|
|
46
|
+
"@dxos/echo-signals": "0.8.4-main.dedc0f3",
|
|
47
|
+
"@dxos/invariant": "0.8.4-main.dedc0f3",
|
|
48
|
+
"@dxos/log": "0.8.4-main.dedc0f3",
|
|
49
|
+
"@dxos/plugin-graph": "0.8.4-main.dedc0f3",
|
|
50
|
+
"@dxos/plugin-observability": "0.8.4-main.dedc0f3",
|
|
51
|
+
"@dxos/local-storage": "0.8.4-main.dedc0f3",
|
|
52
|
+
"@dxos/react-client": "0.8.4-main.dedc0f3",
|
|
53
|
+
"@dxos/react-ui-form": "0.8.4-main.dedc0f3",
|
|
54
|
+
"@dxos/react-ui-pickers": "0.8.4-main.dedc0f3",
|
|
55
|
+
"@dxos/react-ui-stack": "0.8.4-main.dedc0f3",
|
|
56
|
+
"@dxos/shell": "0.8.4-main.dedc0f3",
|
|
57
|
+
"@dxos/util": "0.8.4-main.dedc0f3"
|
|
56
58
|
},
|
|
57
59
|
"devDependencies": {
|
|
58
60
|
"@effect-rx/rx-react": "0.38.0",
|
|
59
|
-
"@effect/platform": "0.
|
|
61
|
+
"@effect/platform": "0.90.2",
|
|
60
62
|
"@types/react": "~18.2.0",
|
|
61
63
|
"@types/react-dom": "~18.2.0",
|
|
62
|
-
"effect": "3.17.
|
|
64
|
+
"effect": "3.17.7",
|
|
63
65
|
"react": "~18.2.0",
|
|
64
66
|
"react-dom": "~18.2.0",
|
|
65
|
-
"vite": "
|
|
66
|
-
"@dxos/live-object": "0.8.4-main.
|
|
67
|
-
"@dxos/react-ui
|
|
68
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
69
|
-
"@dxos/storybook-utils": "0.8.4-main.
|
|
67
|
+
"vite": "7.1.1",
|
|
68
|
+
"@dxos/live-object": "0.8.4-main.dedc0f3",
|
|
69
|
+
"@dxos/react-ui": "0.8.4-main.dedc0f3",
|
|
70
|
+
"@dxos/react-ui-theme": "0.8.4-main.dedc0f3",
|
|
71
|
+
"@dxos/storybook-utils": "0.8.4-main.dedc0f3"
|
|
70
72
|
},
|
|
71
73
|
"peerDependencies": {
|
|
72
74
|
"@effect-rx/rx-react": "^0.34.1",
|
|
@@ -74,8 +76,8 @@
|
|
|
74
76
|
"effect": "^3.13.3",
|
|
75
77
|
"react": "~18.2.0",
|
|
76
78
|
"react-dom": "~18.2.0",
|
|
77
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
78
|
-
"@dxos/react-ui-theme": "0.8.4-main.
|
|
79
|
+
"@dxos/react-ui": "0.8.4-main.dedc0f3",
|
|
80
|
+
"@dxos/react-ui-theme": "0.8.4-main.dedc0f3"
|
|
79
81
|
},
|
|
80
82
|
"publishConfig": {
|
|
81
83
|
"access": "public"
|
package/src/ClientPlugin.ts
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { Capabilities, contributes, defineModule, definePlugin,
|
|
5
|
+
import { Capabilities, Events, contributes, defineModule, definePlugin, oneOf } from '@dxos/app-framework';
|
|
6
6
|
|
|
7
7
|
import {
|
|
8
|
-
Client,
|
|
9
8
|
AppGraphBuilder,
|
|
9
|
+
Client,
|
|
10
10
|
IntentResolver,
|
|
11
11
|
Migrations,
|
|
12
12
|
ReactContext,
|
|
@@ -6,14 +6,15 @@ import { Rx } from '@effect-rx/rx-react';
|
|
|
6
6
|
import { Option, pipe } from 'effect';
|
|
7
7
|
|
|
8
8
|
import { createIntent } from '@dxos/app-framework';
|
|
9
|
-
import { Capabilities,
|
|
10
|
-
import { createExtension, rxFromObservable
|
|
9
|
+
import { Capabilities, type PluginContext, contributes } from '@dxos/app-framework';
|
|
10
|
+
import { ROOT_ID, createExtension, rxFromObservable } from '@dxos/plugin-graph';
|
|
11
11
|
import { ConnectionState } from '@dxos/react-client/mesh';
|
|
12
12
|
|
|
13
|
-
import { ClientCapabilities } from './capabilities';
|
|
14
13
|
import { CLIENT_PLUGIN } from '../meta';
|
|
15
14
|
import { Account, ClientAction } from '../types';
|
|
16
15
|
|
|
16
|
+
import { ClientCapabilities } from './capabilities';
|
|
17
|
+
|
|
17
18
|
export default (context: PluginContext) =>
|
|
18
19
|
contributes(
|
|
19
20
|
Capabilities.AppGraphBuilder,
|
|
@@ -2,13 +2,14 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { type PluginContext, contributes } from '@dxos/app-framework';
|
|
6
6
|
import { Client } from '@dxos/react-client';
|
|
7
7
|
|
|
8
|
-
import { ClientCapabilities } from './capabilities';
|
|
9
8
|
import { ClientEvents } from '../events';
|
|
10
9
|
import { type ClientPluginOptions } from '../types';
|
|
11
10
|
|
|
11
|
+
import { ClientCapabilities } from './capabilities';
|
|
12
|
+
|
|
12
13
|
type ClientCapabilityOptions = Omit<ClientPluginOptions, 'appKey' | 'invitationUrl' | 'invitationParam' | 'onReset'> & {
|
|
13
14
|
context: PluginContext;
|
|
14
15
|
};
|
|
@@ -16,7 +17,7 @@ type ClientCapabilityOptions = Omit<ClientPluginOptions, 'appKey' | 'invitationU
|
|
|
16
17
|
export default async ({ context, onClientInitialized, onSpacesReady, ...options }: ClientCapabilityOptions) => {
|
|
17
18
|
const client = new Client(options);
|
|
18
19
|
await client.initialize();
|
|
19
|
-
await onClientInitialized?.(context, client);
|
|
20
|
+
await onClientInitialized?.({ context, client });
|
|
20
21
|
|
|
21
22
|
// TODO(wittjosiah): Remove. This is a hack to get the app to boot with the new identity after a reset.
|
|
22
23
|
client.reloaded.on(() => {
|
|
@@ -27,10 +28,11 @@ export default async ({ context, onClientInitialized, onSpacesReady, ...options
|
|
|
27
28
|
});
|
|
28
29
|
});
|
|
29
30
|
|
|
31
|
+
// TODO(burdon): The callback isn't called?
|
|
30
32
|
const subscription = client.spaces.isReady.subscribe(async (ready) => {
|
|
31
33
|
if (ready) {
|
|
32
34
|
await context.activatePromise(ClientEvents.SpacesReady);
|
|
33
|
-
await onSpacesReady?.(context, client);
|
|
35
|
+
await onSpacesReady?.({ context, client });
|
|
34
36
|
}
|
|
35
37
|
});
|
|
36
38
|
|
|
@@ -6,23 +6,24 @@ import { pipe } from 'effect';
|
|
|
6
6
|
|
|
7
7
|
import {
|
|
8
8
|
Capabilities,
|
|
9
|
+
LayoutAction,
|
|
10
|
+
type PluginContext,
|
|
9
11
|
chain,
|
|
10
12
|
contributes,
|
|
11
13
|
createIntent,
|
|
12
14
|
createResolver,
|
|
13
|
-
LayoutAction,
|
|
14
|
-
type PluginContext,
|
|
15
15
|
} from '@dxos/app-framework';
|
|
16
16
|
import { invariant } from '@dxos/invariant';
|
|
17
17
|
import { ObservabilityAction } from '@dxos/plugin-observability/types';
|
|
18
18
|
import { PublicKey } from '@dxos/react-client';
|
|
19
19
|
import { type JoinPanelProps } from '@dxos/shell/react';
|
|
20
20
|
|
|
21
|
-
import { ClientCapabilities } from './capabilities';
|
|
22
21
|
import { JOIN_DIALOG, RECOVERY_CODE_DIALOG, RESET_DIALOG } from '../components';
|
|
23
22
|
import { ClientEvents } from '../events';
|
|
24
23
|
import { Account, ClientAction } from '../types';
|
|
25
24
|
|
|
25
|
+
import { ClientCapabilities } from './capabilities';
|
|
26
|
+
|
|
26
27
|
type IntentResolverOptions = {
|
|
27
28
|
context: PluginContext;
|
|
28
29
|
appName?: string;
|
|
@@ -173,7 +174,7 @@ export default ({ context, appName = 'Composer' }: IntentResolverOptions) =>
|
|
|
173
174
|
challenge: new Uint8Array(),
|
|
174
175
|
rp: { id: location.hostname, name: appName },
|
|
175
176
|
user: {
|
|
176
|
-
id: lookupKey.asUint8Array()
|
|
177
|
+
id: lookupKey.asUint8Array() as Uint8Array<ArrayBuffer>,
|
|
177
178
|
name: identity.did,
|
|
178
179
|
displayName: identity.profile?.displayName ?? '',
|
|
179
180
|
},
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { Capabilities,
|
|
5
|
+
import { Capabilities, type PluginContext, contributes } from '@dxos/app-framework';
|
|
6
6
|
|
|
7
7
|
import { ClientCapabilities } from './capabilities';
|
|
8
8
|
|
|
@@ -7,9 +7,10 @@ import React from 'react';
|
|
|
7
7
|
import { Capabilities, contributes, useCapability } from '@dxos/app-framework';
|
|
8
8
|
import { ClientProvider } from '@dxos/react-client';
|
|
9
9
|
|
|
10
|
-
import { ClientCapabilities } from './capabilities';
|
|
11
10
|
import { CLIENT_PLUGIN } from '../meta';
|
|
12
11
|
|
|
12
|
+
import { ClientCapabilities } from './capabilities';
|
|
13
|
+
|
|
13
14
|
export default () =>
|
|
14
15
|
contributes(Capabilities.ReactContext, {
|
|
15
16
|
id: CLIENT_PLUGIN,
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { Capabilities, contributes, createSurface } from '@dxos/app-framework';
|
|
8
8
|
import { type JoinPanelProps } from '@dxos/shell/react';
|
|
9
9
|
|
|
10
10
|
import {
|
|
@@ -13,12 +13,12 @@ import {
|
|
|
13
13
|
JoinDialog,
|
|
14
14
|
ProfileContainer,
|
|
15
15
|
RECOVERY_CODE_DIALOG,
|
|
16
|
+
RESET_DIALOG,
|
|
16
17
|
RecoveryCodeDialog,
|
|
18
|
+
type RecoveryCodeDialogProps,
|
|
17
19
|
RecoveryCredentialsContainer,
|
|
18
|
-
RESET_DIALOG,
|
|
19
20
|
ResetDialog,
|
|
20
21
|
type ResetDialogProps,
|
|
21
|
-
type RecoveryCodeDialogProps,
|
|
22
22
|
} from '../components';
|
|
23
23
|
import { Account, type ClientPluginOptions } from '../types';
|
|
24
24
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { Capabilities,
|
|
5
|
+
import { Capabilities, type PluginContext, contributes } from '@dxos/app-framework';
|
|
6
6
|
import { type Type } from '@dxos/echo';
|
|
7
7
|
|
|
8
8
|
import { ClientCapabilities } from './capabilities';
|
|
@@ -4,25 +4,26 @@
|
|
|
4
4
|
|
|
5
5
|
import '@dxos-theme';
|
|
6
6
|
|
|
7
|
-
import { type
|
|
7
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
8
8
|
|
|
9
9
|
import { IntentPlugin } from '@dxos/app-framework';
|
|
10
10
|
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
11
11
|
import { translations as shellTranslations } from '@dxos/shell/react';
|
|
12
|
-
import {
|
|
12
|
+
import { withLayout, withTheme } from '@dxos/storybook-utils';
|
|
13
13
|
|
|
14
|
-
import { DevicesContainer } from './DevicesContainer';
|
|
15
14
|
import { ClientPlugin } from '../ClientPlugin';
|
|
16
15
|
import { translations } from '../translations';
|
|
17
16
|
|
|
18
|
-
|
|
17
|
+
import { DevicesContainer } from './DevicesContainer';
|
|
18
|
+
|
|
19
|
+
const meta = {
|
|
19
20
|
title: 'plugins/plugin-client/DevicesContainer',
|
|
20
21
|
component: DevicesContainer,
|
|
21
22
|
decorators: [
|
|
22
23
|
withPluginManager({
|
|
23
24
|
plugins: [
|
|
24
25
|
ClientPlugin({
|
|
25
|
-
onClientInitialized: async (
|
|
26
|
+
onClientInitialized: async ({ client }) => {
|
|
26
27
|
await client.halo.createIdentity();
|
|
27
28
|
},
|
|
28
29
|
}),
|
|
@@ -36,11 +37,11 @@ const meta: Meta = {
|
|
|
36
37
|
layout: 'fullscreen',
|
|
37
38
|
translations: [...translations, ...shellTranslations],
|
|
38
39
|
},
|
|
39
|
-
}
|
|
40
|
+
} satisfies Meta<typeof DevicesContainer>;
|
|
40
41
|
|
|
41
42
|
export default meta;
|
|
42
43
|
|
|
43
|
-
type Story = StoryObj<typeof
|
|
44
|
+
type Story = StoryObj<typeof meta>;
|
|
44
45
|
|
|
45
46
|
export const Default: Story = {
|
|
46
47
|
args: {
|
|
@@ -11,7 +11,7 @@ import { useClient, useMulticastObservable } from '@dxos/react-client';
|
|
|
11
11
|
import { type Device, useDevices } from '@dxos/react-client/halo';
|
|
12
12
|
import { type CancellableInvitationObservable, Invitation, InvitationEncoder } from '@dxos/react-client/invitations';
|
|
13
13
|
import { useNetworkStatus } from '@dxos/react-client/mesh';
|
|
14
|
-
import { Button, Clipboard, IconButton, List, useId, useTranslation
|
|
14
|
+
import { Button, Clipboard, Icon, IconButton, List, useId, useTranslation } from '@dxos/react-ui';
|
|
15
15
|
import {
|
|
16
16
|
ControlFrame,
|
|
17
17
|
ControlFrameItem,
|
|
@@ -20,7 +20,6 @@ import {
|
|
|
20
20
|
ControlPage,
|
|
21
21
|
ControlSection,
|
|
22
22
|
} from '@dxos/react-ui-form';
|
|
23
|
-
import { StackItem } from '@dxos/react-ui-stack';
|
|
24
23
|
import { AuthCode, Centered, DeviceListItem, Emoji, Viewport } from '@dxos/shell/react';
|
|
25
24
|
import { hexToEmoji } from '@dxos/util';
|
|
26
25
|
|
|
@@ -51,70 +50,60 @@ export const DevicesContainer = ({ createInvitationUrl }: DevicesContainerProps)
|
|
|
51
50
|
|
|
52
51
|
return (
|
|
53
52
|
<Clipboard.Provider>
|
|
54
|
-
<
|
|
55
|
-
<
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
>
|
|
60
|
-
<
|
|
61
|
-
<
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
</List>
|
|
53
|
+
<ControlPage>
|
|
54
|
+
<ControlSection
|
|
55
|
+
title={t('devices verbose label', { ns: CLIENT_PLUGIN })}
|
|
56
|
+
description={t('devices description', { ns: CLIENT_PLUGIN })}
|
|
57
|
+
>
|
|
58
|
+
<ControlFrame>
|
|
59
|
+
<ControlFrameItem title={t('devices label', { ns: CLIENT_PLUGIN })}>
|
|
60
|
+
<List>
|
|
61
|
+
{devices.map((device: Device) => {
|
|
62
|
+
return (
|
|
63
|
+
<DeviceListItem key={device.deviceKey.toHex()} device={device} connectionState={connectionState} />
|
|
64
|
+
);
|
|
65
|
+
})}
|
|
66
|
+
</List>
|
|
67
|
+
</ControlFrameItem>
|
|
68
|
+
{createInvitationUrl && (
|
|
69
|
+
<ControlFrameItem title='Add device'>
|
|
70
|
+
<DeviceInvitation createInvitationUrl={createInvitationUrl} />
|
|
73
71
|
</ControlFrameItem>
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
<
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
<
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
<
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
<
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
data-testid='devicesContainer.joinExisting'
|
|
110
|
-
>
|
|
111
|
-
{t('join new identity label')}
|
|
112
|
-
</Button>
|
|
113
|
-
</ControlItem>
|
|
114
|
-
</ControlGroup>
|
|
115
|
-
</ControlSection>
|
|
116
|
-
</ControlPage>
|
|
117
|
-
</StackItem.Content>
|
|
72
|
+
)}
|
|
73
|
+
</ControlFrame>
|
|
74
|
+
</ControlSection>
|
|
75
|
+
<ControlSection
|
|
76
|
+
title={t('danger zone title', { ns: CLIENT_PLUGIN })}
|
|
77
|
+
description={t('danger zone description', { ns: CLIENT_PLUGIN })}
|
|
78
|
+
>
|
|
79
|
+
<ControlGroup>
|
|
80
|
+
<ControlItem
|
|
81
|
+
title={t('reset device label')}
|
|
82
|
+
description={t('reset device description', { ns: CLIENT_PLUGIN })}
|
|
83
|
+
>
|
|
84
|
+
<Button variant='destructive' onClick={handleResetStorage} data-testid='devicesContainer.reset'>
|
|
85
|
+
{t('reset device label')}
|
|
86
|
+
</Button>
|
|
87
|
+
</ControlItem>
|
|
88
|
+
<ControlItem
|
|
89
|
+
title={t('recover identity label')}
|
|
90
|
+
description={t('recover identity description', { ns: CLIENT_PLUGIN })}
|
|
91
|
+
>
|
|
92
|
+
<Button variant='destructive' onClick={handleRecover} data-testid='devicesContainer.recover'>
|
|
93
|
+
{t('recover identity label')}
|
|
94
|
+
</Button>
|
|
95
|
+
</ControlItem>
|
|
96
|
+
<ControlItem
|
|
97
|
+
title={t('join new identity label')}
|
|
98
|
+
description={t('join new identity description', { ns: CLIENT_PLUGIN })}
|
|
99
|
+
>
|
|
100
|
+
<Button variant='destructive' onClick={handleJoinNewIdentity} data-testid='devicesContainer.joinExisting'>
|
|
101
|
+
{t('join new identity label')}
|
|
102
|
+
</Button>
|
|
103
|
+
</ControlItem>
|
|
104
|
+
</ControlGroup>
|
|
105
|
+
</ControlSection>
|
|
106
|
+
</ControlPage>
|
|
118
107
|
</Clipboard.Provider>
|
|
119
108
|
);
|
|
120
109
|
};
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { useCallback } from 'react';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { LayoutAction, createIntent, useIntentDispatcher } from '@dxos/app-framework';
|
|
8
8
|
import { ObservabilityAction } from '@dxos/plugin-observability/types';
|
|
9
9
|
import { type InvitationResult } from '@dxos/react-client/invitations';
|
|
10
10
|
import { Dialog, useTranslation } from '@dxos/react-ui';
|
|
@@ -4,15 +4,16 @@
|
|
|
4
4
|
|
|
5
5
|
import '@dxos-theme';
|
|
6
6
|
|
|
7
|
-
import { type
|
|
7
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
8
8
|
|
|
9
9
|
import { withClientProvider } from '@dxos/react-client/testing';
|
|
10
|
-
import {
|
|
10
|
+
import { withLayout, withTheme } from '@dxos/storybook-utils';
|
|
11
11
|
|
|
12
|
-
import { ProfileContainer } from './ProfileContainer';
|
|
13
12
|
import { translations } from '../translations';
|
|
14
13
|
|
|
15
|
-
|
|
14
|
+
import { ProfileContainer } from './ProfileContainer';
|
|
15
|
+
|
|
16
|
+
const meta = {
|
|
16
17
|
title: 'plugins/plugin-client/ProfileContainer',
|
|
17
18
|
component: ProfileContainer,
|
|
18
19
|
decorators: [withClientProvider({ createIdentity: true }), withTheme, withLayout()],
|
|
@@ -20,10 +21,10 @@ const meta: Meta = {
|
|
|
20
21
|
layout: 'fullscreen',
|
|
21
22
|
translations,
|
|
22
23
|
},
|
|
23
|
-
}
|
|
24
|
+
} satisfies Meta<typeof ProfileContainer>;
|
|
24
25
|
|
|
25
26
|
export default meta;
|
|
26
27
|
|
|
27
|
-
type Story = StoryObj<typeof
|
|
28
|
+
type Story = StoryObj<typeof meta>;
|
|
28
29
|
|
|
29
30
|
export const Default: Story = {};
|
|
@@ -10,16 +10,15 @@ import { useClient } from '@dxos/react-client';
|
|
|
10
10
|
import { type Identity, useIdentity } from '@dxos/react-client/halo';
|
|
11
11
|
import { ButtonGroup, Clipboard, Input, useTranslation } from '@dxos/react-ui';
|
|
12
12
|
import {
|
|
13
|
-
Form,
|
|
14
|
-
type InputComponent,
|
|
15
13
|
ControlItem,
|
|
16
14
|
ControlItemInput,
|
|
17
|
-
ControlSection,
|
|
18
15
|
ControlPage,
|
|
16
|
+
ControlSection,
|
|
17
|
+
Form,
|
|
18
|
+
type InputComponent,
|
|
19
19
|
} from '@dxos/react-ui-form';
|
|
20
20
|
import { EmojiPickerBlock, HuePicker } from '@dxos/react-ui-pickers';
|
|
21
|
-
import {
|
|
22
|
-
import { hexToHue, hexToEmoji } from '@dxos/util';
|
|
21
|
+
import { hexToEmoji, hexToHue } from '@dxos/util';
|
|
23
22
|
|
|
24
23
|
import { CLIENT_PLUGIN } from '../meta';
|
|
25
24
|
|
|
@@ -143,23 +142,21 @@ export const ProfileContainer = () => {
|
|
|
143
142
|
);
|
|
144
143
|
|
|
145
144
|
return (
|
|
146
|
-
<
|
|
147
|
-
<
|
|
148
|
-
<
|
|
149
|
-
<
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
</ControlPage>
|
|
162
|
-
</StackItem.Content>
|
|
145
|
+
<ControlPage>
|
|
146
|
+
<Clipboard.Provider>
|
|
147
|
+
<ControlSection title={t('profile label')} description={t('profile description')}>
|
|
148
|
+
<Form
|
|
149
|
+
schema={ProfileSchema}
|
|
150
|
+
values={values}
|
|
151
|
+
autoSave
|
|
152
|
+
onSave={handleSave}
|
|
153
|
+
Custom={customElements}
|
|
154
|
+
classNames='container-max-width grid grid-cols-1 md:grid-cols-[1fr_min-content]'
|
|
155
|
+
outerSpacing={false}
|
|
156
|
+
/>
|
|
157
|
+
</ControlSection>
|
|
158
|
+
</Clipboard.Provider>
|
|
159
|
+
</ControlPage>
|
|
163
160
|
);
|
|
164
161
|
};
|
|
165
162
|
|
|
@@ -4,17 +4,18 @@
|
|
|
4
4
|
|
|
5
5
|
import '@dxos-theme';
|
|
6
6
|
|
|
7
|
-
import { type
|
|
7
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
8
8
|
import React, { useState } from 'react';
|
|
9
9
|
|
|
10
10
|
import { useClient } from '@dxos/react-client';
|
|
11
11
|
import { withClientProvider } from '@dxos/react-client/testing';
|
|
12
12
|
import { AlertDialog, useAsyncEffect } from '@dxos/react-ui';
|
|
13
|
-
import {
|
|
13
|
+
import { withLayout, withTheme } from '@dxos/storybook-utils';
|
|
14
14
|
|
|
15
|
-
import { RecoveryCodeDialog, type RecoveryCodeDialogProps } from './RecoveryCodeDialog';
|
|
16
15
|
import { translations } from '../translations';
|
|
17
16
|
|
|
17
|
+
import { RecoveryCodeDialog } from './RecoveryCodeDialog';
|
|
18
|
+
|
|
18
19
|
const DefaultStory = () => {
|
|
19
20
|
const client = useClient();
|
|
20
21
|
const [recoveryCode, setRecoveryCode] = useState<string>();
|
|
@@ -32,19 +33,19 @@ const DefaultStory = () => {
|
|
|
32
33
|
);
|
|
33
34
|
};
|
|
34
35
|
|
|
35
|
-
const meta
|
|
36
|
+
const meta = {
|
|
36
37
|
title: 'plugins/plugin-client/RecoveryCodeDialog',
|
|
37
|
-
component: RecoveryCodeDialog,
|
|
38
|
+
component: RecoveryCodeDialog as any,
|
|
38
39
|
render: DefaultStory,
|
|
39
40
|
decorators: [withClientProvider({ createIdentity: true }), withTheme, withLayout()],
|
|
40
41
|
parameters: {
|
|
41
42
|
layout: 'fullscreen',
|
|
42
43
|
translations,
|
|
43
44
|
},
|
|
44
|
-
}
|
|
45
|
+
} satisfies Meta<typeof DefaultStory>;
|
|
45
46
|
|
|
46
47
|
export default meta;
|
|
47
48
|
|
|
48
|
-
type Story = StoryObj<
|
|
49
|
+
type Story = StoryObj<typeof meta>;
|
|
49
50
|
|
|
50
51
|
export const Default: Story = {};
|
|
@@ -4,24 +4,25 @@
|
|
|
4
4
|
|
|
5
5
|
import '@dxos-theme';
|
|
6
6
|
|
|
7
|
-
import { type
|
|
7
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
8
8
|
|
|
9
9
|
import { IntentPlugin } from '@dxos/app-framework';
|
|
10
10
|
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
11
|
-
import {
|
|
11
|
+
import { withLayout, withTheme } from '@dxos/storybook-utils';
|
|
12
12
|
|
|
13
|
-
import { RecoveryCredentialsContainer } from './RecoveryCredentialsContainer';
|
|
14
13
|
import { ClientPlugin } from '../ClientPlugin';
|
|
15
14
|
import { translations } from '../translations';
|
|
16
15
|
|
|
17
|
-
|
|
16
|
+
import { RecoveryCredentialsContainer } from './RecoveryCredentialsContainer';
|
|
17
|
+
|
|
18
|
+
const meta = {
|
|
18
19
|
title: 'plugins/plugin-client/RecoveryCredentialsContainer',
|
|
19
20
|
component: RecoveryCredentialsContainer,
|
|
20
21
|
decorators: [
|
|
21
22
|
withPluginManager({
|
|
22
23
|
plugins: [
|
|
23
24
|
ClientPlugin({
|
|
24
|
-
onClientInitialized: async (
|
|
25
|
+
onClientInitialized: async ({ client }) => {
|
|
25
26
|
await client.halo.createIdentity();
|
|
26
27
|
},
|
|
27
28
|
}),
|
|
@@ -35,10 +36,10 @@ const meta: Meta = {
|
|
|
35
36
|
layout: 'fullscreen',
|
|
36
37
|
translations,
|
|
37
38
|
},
|
|
38
|
-
}
|
|
39
|
+
} satisfies Meta<typeof RecoveryCredentialsContainer>;
|
|
39
40
|
|
|
40
41
|
export default meta;
|
|
41
42
|
|
|
42
|
-
type Story = StoryObj<typeof
|
|
43
|
+
type Story = StoryObj<typeof meta>;
|
|
43
44
|
|
|
44
45
|
export const Default: Story = {};
|