@dxos/plugin-client 0.8.4-main.f9ba587 → 0.8.4-main.fd6878d
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-3EILEBWW.mjs → app-graph-builder-ENKIVZWH.mjs} +4 -4
- package/dist/lib/browser/app-graph-builder-ENKIVZWH.mjs.map +7 -0
- package/dist/lib/browser/{chunk-AWXKL4UR.mjs → chunk-3F2Q2RKC.mjs} +1 -1
- package/dist/lib/browser/chunk-3F2Q2RKC.mjs.map +7 -0
- package/dist/lib/browser/{chunk-64ANQXYZ.mjs → chunk-56EADSTE.mjs} +19 -17
- package/dist/lib/browser/chunk-56EADSTE.mjs.map +7 -0
- package/dist/lib/browser/{chunk-Q7TFRFHI.mjs → chunk-HLWIF3AW.mjs} +13 -14
- package/dist/lib/browser/chunk-HLWIF3AW.mjs.map +7 -0
- package/dist/lib/browser/{client-JFNMEFOK.mjs → client-F73MIXMT.mjs} +10 -4
- package/dist/lib/browser/client-F73MIXMT.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +9 -9
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-resolver-YGAQVXI2.mjs → intent-resolver-S3PUYK5Q.mjs} +12 -12
- package/dist/lib/browser/intent-resolver-S3PUYK5Q.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{migrations-5COKGS4E.mjs → migrations-YJSO7JXY.mjs} +2 -2
- package/dist/lib/{node-esm/migrations-FE4PDX6W.mjs.map → browser/migrations-YJSO7JXY.mjs.map} +2 -2
- package/dist/lib/browser/{react-context-GBNYT5QK.mjs → react-context-QBXCHNH2.mjs} +2 -2
- package/dist/lib/browser/{react-context-GBNYT5QK.mjs.map → react-context-QBXCHNH2.mjs.map} +2 -2
- package/dist/lib/browser/{react-surface-YKQAUE2M.mjs → react-surface-YON76BFE.mjs} +4 -4
- package/dist/lib/browser/{react-surface-YKQAUE2M.mjs.map → react-surface-YON76BFE.mjs.map} +3 -3
- package/dist/lib/browser/{schema-defs-6L7W2RHL.mjs → schema-defs-AMSX6T3B.mjs} +2 -2
- package/dist/lib/browser/schema-defs-AMSX6T3B.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +10 -0
- package/dist/lib/node-esm/{app-graph-builder-GINHOE7A.mjs → app-graph-builder-D4XJCLPN.mjs} +4 -4
- package/dist/lib/node-esm/app-graph-builder-D4XJCLPN.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-3BUB64JB.mjs → chunk-IOGTQFLM.mjs} +1 -1
- package/dist/lib/node-esm/chunk-IOGTQFLM.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-K4PIKBQQ.mjs → chunk-J6I6JZPI.mjs} +19 -17
- package/dist/lib/node-esm/chunk-J6I6JZPI.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-GDJMDBWM.mjs → chunk-JG6AFSFU.mjs} +13 -14
- package/dist/lib/node-esm/chunk-JG6AFSFU.mjs.map +7 -0
- package/dist/lib/node-esm/{client-XDYQARBL.mjs → client-A7CNP37P.mjs} +10 -4
- package/dist/lib/node-esm/client-A7CNP37P.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +9 -9
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/{intent-resolver-IN7YG7N7.mjs → intent-resolver-EBJABYM3.mjs} +12 -12
- package/dist/lib/node-esm/intent-resolver-EBJABYM3.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{migrations-FE4PDX6W.mjs → migrations-UOEK7HB7.mjs} +2 -2
- package/dist/lib/{browser/migrations-5COKGS4E.mjs.map → node-esm/migrations-UOEK7HB7.mjs.map} +2 -2
- package/dist/lib/node-esm/{react-context-UCK43H3Z.mjs → react-context-JIH7YBFI.mjs} +2 -2
- package/dist/lib/node-esm/{react-context-UCK43H3Z.mjs.map → react-context-JIH7YBFI.mjs.map} +2 -2
- package/dist/lib/node-esm/{react-surface-HDHC6XHQ.mjs → react-surface-YKCZF43D.mjs} +4 -4
- package/dist/lib/node-esm/{react-surface-HDHC6XHQ.mjs.map → react-surface-YKCZF43D.mjs.map} +3 -3
- package/dist/lib/node-esm/{schema-defs-GZIVMHLW.mjs → schema-defs-4UTKKRTF.mjs} +2 -2
- package/dist/lib/node-esm/schema-defs-4UTKKRTF.mjs.map +7 -0
- package/dist/lib/node-esm/{types.mjs → types/index.mjs} +3 -3
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/capabilities.d.ts +2 -3
- package/dist/types/src/capabilities/capabilities.d.ts.map +1 -1
- package/dist/types/src/capabilities/client.d.ts.map +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/migrations.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-context.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +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 +1 -1
- package/dist/types/src/components/DevicesContainer.stories.d.ts.map +1 -1
- package/dist/types/src/components/ProfileContainer.stories.d.ts +1 -1
- package/dist/types/src/components/ProfileContainer.stories.d.ts.map +1 -1
- package/dist/types/src/components/RecoveryCodeDialog.stories.d.ts +1 -1
- package/dist/types/src/components/RecoveryCodeDialog.stories.d.ts.map +1 -1
- package/dist/types/src/components/RecoveryCredentialsContainer.stories.d.ts +1 -1
- package/dist/types/src/components/RecoveryCredentialsContainer.stories.d.ts.map +1 -1
- package/dist/types/src/components/ResetDialog.stories.d.ts +1 -1
- package/dist/types/src/components/ResetDialog.stories.d.ts.map +1 -1
- package/dist/types/src/types/index.d.ts +2 -0
- package/dist/types/src/types/index.d.ts.map +1 -0
- package/dist/types/src/{types.d.ts → types/schema.d.ts} +30 -24
- package/dist/types/src/types/schema.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +32 -32
- package/src/ClientPlugin.ts +2 -2
- package/src/capabilities/app-graph-builder.ts +4 -3
- package/src/capabilities/capabilities.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 +3 -3
- package/src/components/DevicesContainer.stories.tsx +5 -4
- package/src/components/DevicesContainer.tsx +6 -4
- package/src/components/JoinDialog.tsx +1 -1
- package/src/components/ProfileContainer.stories.tsx +4 -3
- package/src/components/ProfileContainer.tsx +5 -5
- package/src/components/RecoveryCodeDialog.stories.tsx +4 -3
- package/src/components/RecoveryCredentialsContainer.stories.tsx +5 -4
- package/src/components/RecoveryCredentialsContainer.tsx +1 -1
- package/src/components/ResetDialog.stories.tsx +4 -3
- package/src/components/ResetDialog.tsx +1 -1
- package/src/types/index.ts +5 -0
- package/src/{types.ts → types/schema.ts} +14 -15
- package/dist/lib/browser/app-graph-builder-3EILEBWW.mjs.map +0 -7
- package/dist/lib/browser/chunk-64ANQXYZ.mjs.map +0 -7
- package/dist/lib/browser/chunk-AWXKL4UR.mjs.map +0 -7
- package/dist/lib/browser/chunk-Q7TFRFHI.mjs.map +0 -7
- package/dist/lib/browser/client-JFNMEFOK.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-YGAQVXI2.mjs.map +0 -7
- package/dist/lib/browser/schema-defs-6L7W2RHL.mjs.map +0 -7
- package/dist/lib/browser/types.mjs +0 -10
- package/dist/lib/node-esm/app-graph-builder-GINHOE7A.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-3BUB64JB.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-GDJMDBWM.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-K4PIKBQQ.mjs.map +0 -7
- package/dist/lib/node-esm/client-XDYQARBL.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-IN7YG7N7.mjs.map +0 -7
- package/dist/lib/node-esm/schema-defs-GZIVMHLW.mjs.map +0 -7
- package/dist/types/src/types.d.ts.map +0 -1
- /package/dist/lib/browser/{types.mjs.map → types/index.mjs.map} +0 -0
- /package/dist/lib/node-esm/{types.mjs.map → types/index.mjs.map} +0 -0
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.fd6878d",
|
|
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,21 +10,23 @@
|
|
|
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": {
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
19
|
+
"source": "./src/types/index.ts",
|
|
20
|
+
"types": "./dist/types/src/types/index.d.ts",
|
|
21
|
+
"browser": "./dist/lib/browser/types/index.mjs",
|
|
22
|
+
"node": "./dist/lib/node-esm/types/index.mjs"
|
|
21
23
|
}
|
|
22
24
|
},
|
|
23
25
|
"types": "dist/types/src/index.d.ts",
|
|
24
26
|
"typesVersions": {
|
|
25
27
|
"*": {
|
|
26
28
|
"types": [
|
|
27
|
-
"dist/types/src/types.d.ts"
|
|
29
|
+
"dist/types/src/types/index.d.ts"
|
|
28
30
|
]
|
|
29
31
|
}
|
|
30
32
|
},
|
|
@@ -36,48 +38,46 @@
|
|
|
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/
|
|
43
|
-
"@dxos/
|
|
44
|
-
"@dxos/
|
|
45
|
-
"@dxos/
|
|
46
|
-
"@dxos/
|
|
47
|
-
"@dxos/
|
|
48
|
-
"@dxos/
|
|
49
|
-
"@dxos/
|
|
50
|
-
"@dxos/react-
|
|
51
|
-
"@dxos/
|
|
52
|
-
"@dxos/react-ui-
|
|
53
|
-
"@dxos/
|
|
54
|
-
"@dxos/
|
|
55
|
-
"@dxos/
|
|
41
|
+
"@dxos/app-framework": "0.8.4-main.fd6878d",
|
|
42
|
+
"@dxos/echo": "0.8.4-main.fd6878d",
|
|
43
|
+
"@dxos/async": "0.8.4-main.fd6878d",
|
|
44
|
+
"@dxos/echo-schema": "0.8.4-main.fd6878d",
|
|
45
|
+
"@dxos/config": "0.8.4-main.fd6878d",
|
|
46
|
+
"@dxos/invariant": "0.8.4-main.fd6878d",
|
|
47
|
+
"@dxos/echo-signals": "0.8.4-main.fd6878d",
|
|
48
|
+
"@dxos/local-storage": "0.8.4-main.fd6878d",
|
|
49
|
+
"@dxos/log": "0.8.4-main.fd6878d",
|
|
50
|
+
"@dxos/plugin-observability": "0.8.4-main.fd6878d",
|
|
51
|
+
"@dxos/react-client": "0.8.4-main.fd6878d",
|
|
52
|
+
"@dxos/react-ui-form": "0.8.4-main.fd6878d",
|
|
53
|
+
"@dxos/shell": "0.8.4-main.fd6878d",
|
|
54
|
+
"@dxos/react-ui-stack": "0.8.4-main.fd6878d",
|
|
55
|
+
"@dxos/util": "0.8.4-main.fd6878d",
|
|
56
|
+
"@dxos/react-ui-pickers": "0.8.4-main.fd6878d",
|
|
57
|
+
"@dxos/plugin-graph": "0.8.4-main.fd6878d"
|
|
56
58
|
},
|
|
57
59
|
"devDependencies": {
|
|
58
60
|
"@effect-rx/rx-react": "0.38.0",
|
|
59
|
-
"@effect/platform": "0.
|
|
60
|
-
"@phosphor-icons/react": "^2.1.5",
|
|
61
|
+
"@effect/platform": "0.90.2",
|
|
61
62
|
"@types/react": "~18.2.0",
|
|
62
63
|
"@types/react-dom": "~18.2.0",
|
|
63
|
-
"effect": "3.
|
|
64
|
+
"effect": "3.17.7",
|
|
64
65
|
"react": "~18.2.0",
|
|
65
66
|
"react-dom": "~18.2.0",
|
|
66
67
|
"vite": "5.4.7",
|
|
67
|
-
"@dxos/live-object": "0.8.4-main.
|
|
68
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
69
|
-
"@dxos/react-ui-theme": "0.8.4-main.
|
|
70
|
-
"@dxos/storybook-utils": "0.8.4-main.
|
|
68
|
+
"@dxos/live-object": "0.8.4-main.fd6878d",
|
|
69
|
+
"@dxos/react-ui": "0.8.4-main.fd6878d",
|
|
70
|
+
"@dxos/react-ui-theme": "0.8.4-main.fd6878d",
|
|
71
|
+
"@dxos/storybook-utils": "0.8.4-main.fd6878d"
|
|
71
72
|
},
|
|
72
73
|
"peerDependencies": {
|
|
73
74
|
"@effect-rx/rx-react": "^0.34.1",
|
|
74
75
|
"@effect/platform": "^0.80.12",
|
|
75
|
-
"@phosphor-icons/react": "^2.1.5",
|
|
76
76
|
"effect": "^3.13.3",
|
|
77
77
|
"react": "~18.2.0",
|
|
78
78
|
"react-dom": "~18.2.0",
|
|
79
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
80
|
-
"@dxos/react-ui-theme": "0.8.4-main.
|
|
79
|
+
"@dxos/react-ui": "0.8.4-main.fd6878d",
|
|
80
|
+
"@dxos/react-ui-theme": "0.8.4-main.fd6878d"
|
|
81
81
|
},
|
|
82
82
|
"publishConfig": {
|
|
83
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,
|
|
@@ -5,13 +5,14 @@
|
|
|
5
5
|
import { defineCapability } from '@dxos/app-framework';
|
|
6
6
|
import { type Client } from '@dxos/client';
|
|
7
7
|
import { type ObjectMigration } from '@dxos/client/echo';
|
|
8
|
-
import { type
|
|
8
|
+
import { type Type } from '@dxos/echo';
|
|
9
9
|
|
|
10
10
|
import { CLIENT_PLUGIN } from '../meta';
|
|
11
11
|
|
|
12
12
|
export namespace ClientCapabilities {
|
|
13
13
|
export const Client = defineCapability<Client>(`${CLIENT_PLUGIN}/capability/client`);
|
|
14
|
-
export const Schema = defineCapability<
|
|
15
|
-
|
|
14
|
+
export const Schema = defineCapability<Type.Obj.Any[]>(`${CLIENT_PLUGIN}/capability/schema`);
|
|
15
|
+
// TODO(wittjosiah): More descriptive name.
|
|
16
|
+
export const SchemaWhiteList = defineCapability<Type.Obj.Any[]>(`${CLIENT_PLUGIN}/capability/schema-whitelist`);
|
|
16
17
|
export const Migration = defineCapability<ObjectMigration[]>(`${CLIENT_PLUGIN}/capability/migration`);
|
|
17
18
|
}
|
|
@@ -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,8 +2,8 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { Capabilities,
|
|
6
|
-
import { type
|
|
5
|
+
import { Capabilities, type PluginContext, contributes } from '@dxos/app-framework';
|
|
6
|
+
import { type Type } from '@dxos/echo';
|
|
7
7
|
|
|
8
8
|
import { ClientCapabilities } from './capabilities';
|
|
9
9
|
|
|
@@ -12,7 +12,7 @@ export default (context: PluginContext) => {
|
|
|
12
12
|
const client = context.getCapability(ClientCapabilities.Client);
|
|
13
13
|
|
|
14
14
|
// TODO(wittjosiah): Unregister schemas when they are disabled.
|
|
15
|
-
let previous:
|
|
15
|
+
let previous: Type.Obj.Any[] = [];
|
|
16
16
|
const cancel = registry.subscribe(
|
|
17
17
|
context.capabilities(ClientCapabilities.Schema),
|
|
18
18
|
(_schemas) => {
|
|
@@ -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
|
|
|
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
|
|
|
17
|
+
import { DevicesContainer } from './DevicesContainer';
|
|
18
|
+
|
|
18
19
|
const meta: Meta = {
|
|
19
20
|
title: 'plugins/plugin-client/DevicesContainer',
|
|
20
21
|
component: DevicesContainer,
|
|
@@ -22,7 +23,7 @@ const meta: Meta = {
|
|
|
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
|
}),
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { Check, X } from '@phosphor-icons/react';
|
|
6
5
|
import React, { useCallback, useEffect, useState } from 'react';
|
|
7
6
|
import { QR } from 'react-qr-rounded';
|
|
8
7
|
|
|
@@ -12,7 +11,7 @@ import { useClient, useMulticastObservable } from '@dxos/react-client';
|
|
|
12
11
|
import { type Device, useDevices } from '@dxos/react-client/halo';
|
|
13
12
|
import { type CancellableInvitationObservable, Invitation, InvitationEncoder } from '@dxos/react-client/invitations';
|
|
14
13
|
import { useNetworkStatus } from '@dxos/react-client/mesh';
|
|
15
|
-
import { Button, Clipboard, IconButton, List, useId, useTranslation } from '@dxos/react-ui';
|
|
14
|
+
import { Button, Clipboard, Icon, IconButton, List, useId, useTranslation } from '@dxos/react-ui';
|
|
16
15
|
import {
|
|
17
16
|
ControlFrame,
|
|
18
17
|
ControlFrameItem,
|
|
@@ -22,7 +21,6 @@ import {
|
|
|
22
21
|
ControlSection,
|
|
23
22
|
} from '@dxos/react-ui-form';
|
|
24
23
|
import { StackItem } from '@dxos/react-ui-stack';
|
|
25
|
-
import { getSize, mx } from '@dxos/react-ui-theme';
|
|
26
24
|
import { AuthCode, Centered, DeviceListItem, Emoji, Viewport } from '@dxos/shell/react';
|
|
27
25
|
import { hexToEmoji } from '@dxos/util';
|
|
28
26
|
|
|
@@ -290,5 +288,9 @@ const InvitationAuthCode = ({ id, code, onCancel }: { id: string; code: string;
|
|
|
290
288
|
};
|
|
291
289
|
|
|
292
290
|
const InvitationComplete = ({ statusValue }: { statusValue: number }) => {
|
|
293
|
-
return statusValue > 0 ?
|
|
291
|
+
return statusValue > 0 ? (
|
|
292
|
+
<Icon icon='ph--check--regular' size={6} classNames='m-1.5' />
|
|
293
|
+
) : (
|
|
294
|
+
<Icon icon='ph--x--regular' size={6} classNames='m-1.5' />
|
|
295
|
+
);
|
|
294
296
|
};
|
|
@@ -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,14 +4,15 @@
|
|
|
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
|
|
|
14
|
+
import { ProfileContainer } from './ProfileContainer';
|
|
15
|
+
|
|
15
16
|
const meta: Meta = {
|
|
16
17
|
title: 'plugins/plugin-client/ProfileContainer',
|
|
17
18
|
component: ProfileContainer,
|
|
@@ -10,16 +10,16 @@ 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
21
|
import { StackItem } from '@dxos/react-ui-stack';
|
|
22
|
-
import {
|
|
22
|
+
import { hexToEmoji, hexToHue } from '@dxos/util';
|
|
23
23
|
|
|
24
24
|
import { CLIENT_PLUGIN } from '../meta';
|
|
25
25
|
|
|
@@ -58,7 +58,7 @@ export const ProfileContainer = () => {
|
|
|
58
58
|
setDisplayNameDirectly(profile.displayName);
|
|
59
59
|
setEmojiDirectly(profile.emoji);
|
|
60
60
|
setHueDirectly(profile.hue);
|
|
61
|
-
updateProfile(profile);
|
|
61
|
+
void updateProfile(profile);
|
|
62
62
|
},
|
|
63
63
|
[identity],
|
|
64
64
|
);
|
|
@@ -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, type RecoveryCodeDialogProps } from './RecoveryCodeDialog';
|
|
18
|
+
|
|
18
19
|
const DefaultStory = () => {
|
|
19
20
|
const client = useClient();
|
|
20
21
|
const [recoveryCode, setRecoveryCode] = useState<string>();
|
|
@@ -4,16 +4,17 @@
|
|
|
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
|
|
|
16
|
+
import { RecoveryCredentialsContainer } from './RecoveryCredentialsContainer';
|
|
17
|
+
|
|
17
18
|
const meta: Meta = {
|
|
18
19
|
title: 'plugins/plugin-client/RecoveryCredentialsContainer',
|
|
19
20
|
component: RecoveryCredentialsContainer,
|
|
@@ -21,7 +22,7 @@ const meta: Meta = {
|
|
|
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
|
}),
|
|
@@ -6,7 +6,7 @@ import React from 'react';
|
|
|
6
6
|
|
|
7
7
|
import { createIntent, useIntentDispatcher } from '@dxos/app-framework';
|
|
8
8
|
import { useCredentials } from '@dxos/react-client/halo';
|
|
9
|
-
import { Icon, IconButton, List, ListItem,
|
|
9
|
+
import { Icon, IconButton, List, ListItem, Message, useTranslation } from '@dxos/react-ui';
|
|
10
10
|
import { ControlGroup, ControlItem, ControlPage, ControlSection } from '@dxos/react-ui-form';
|
|
11
11
|
import { StackItem } from '@dxos/react-ui-stack';
|
|
12
12
|
|
|
@@ -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 from 'react';
|
|
9
9
|
|
|
10
10
|
import { IntentPlugin } from '@dxos/app-framework';
|
|
11
11
|
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
12
12
|
import { Dialog } from '@dxos/react-ui';
|
|
13
|
-
import {
|
|
13
|
+
import { withLayout, withTheme } from '@dxos/storybook-utils';
|
|
14
14
|
|
|
15
|
-
import { ResetDialog, type ResetDialogProps } from './ResetDialog';
|
|
16
15
|
import { translations } from '../translations';
|
|
17
16
|
|
|
17
|
+
import { ResetDialog, type ResetDialogProps } from './ResetDialog';
|
|
18
|
+
|
|
18
19
|
const Render = (props: ResetDialogProps) => {
|
|
19
20
|
return (
|
|
20
21
|
<Dialog.Root open>
|
|
@@ -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 { useClient } from '@dxos/react-client';
|
|
9
9
|
import { Dialog, useTranslation } from '@dxos/react-ui';
|
|
10
10
|
import { ConfirmReset, type ConfirmResetProps } from '@dxos/shell/react';
|
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
import { Schema } from 'effect';
|
|
6
6
|
|
|
7
7
|
import { type PluginContext } from '@dxos/app-framework';
|
|
8
|
-
import { type Client,
|
|
8
|
+
import { type Client, type ClientOptions, PublicKey } from '@dxos/react-client';
|
|
9
9
|
import { type MaybePromise } from '@dxos/util';
|
|
10
10
|
|
|
11
|
-
import {
|
|
11
|
+
import { meta } from '../meta';
|
|
12
12
|
|
|
13
13
|
// TODO(wittjosiah): Factor out. Generate?
|
|
14
14
|
const IdentitySchema = Schema.Struct({
|
|
@@ -23,7 +23,6 @@ const IdentitySchema = Schema.Struct({
|
|
|
23
23
|
),
|
|
24
24
|
});
|
|
25
25
|
|
|
26
|
-
const CLIENT_ACTION = `${CLIENT_PLUGIN}/action`;
|
|
27
26
|
export namespace ClientAction {
|
|
28
27
|
const ProfileSchema = Schema.Struct({
|
|
29
28
|
displayName: Schema.optional(Schema.String),
|
|
@@ -31,59 +30,59 @@ export namespace ClientAction {
|
|
|
31
30
|
data: Schema.optional(Schema.Record({ key: Schema.String, value: Schema.Any })),
|
|
32
31
|
});
|
|
33
32
|
|
|
34
|
-
export class CreateIdentity extends Schema.TaggedClass<CreateIdentity>()(`${
|
|
33
|
+
export class CreateIdentity extends Schema.TaggedClass<CreateIdentity>()(`${meta.id}/action/create-identity`, {
|
|
35
34
|
input: ProfileSchema,
|
|
36
35
|
output: IdentitySchema,
|
|
37
36
|
}) {}
|
|
38
37
|
|
|
39
|
-
export class JoinIdentity extends Schema.TaggedClass<JoinIdentity>()(`${
|
|
38
|
+
export class JoinIdentity extends Schema.TaggedClass<JoinIdentity>()(`${meta.id}/action/join-identity`, {
|
|
40
39
|
input: Schema.Struct({
|
|
41
40
|
invitationCode: Schema.optional(Schema.String),
|
|
42
41
|
}),
|
|
43
42
|
output: Schema.Void,
|
|
44
43
|
}) {}
|
|
45
44
|
|
|
46
|
-
export class ShareIdentity extends Schema.TaggedClass<ShareIdentity>()(`${
|
|
45
|
+
export class ShareIdentity extends Schema.TaggedClass<ShareIdentity>()(`${meta.id}/action/share-identity`, {
|
|
47
46
|
input: Schema.Void,
|
|
48
47
|
output: Schema.Void,
|
|
49
48
|
}) {}
|
|
50
49
|
|
|
51
|
-
export class RecoverIdentity extends Schema.TaggedClass<RecoverIdentity>()(`${
|
|
50
|
+
export class RecoverIdentity extends Schema.TaggedClass<RecoverIdentity>()(`${meta.id}/action/recover-identity`, {
|
|
52
51
|
input: Schema.Void,
|
|
53
52
|
output: Schema.Void,
|
|
54
53
|
}) {}
|
|
55
54
|
|
|
56
|
-
export class ResetStorage extends Schema.TaggedClass<ResetStorage>()(`${
|
|
55
|
+
export class ResetStorage extends Schema.TaggedClass<ResetStorage>()(`${meta.id}/action/reset-storage`, {
|
|
57
56
|
input: Schema.Struct({
|
|
58
57
|
mode: Schema.optional(Schema.String),
|
|
59
58
|
}),
|
|
60
59
|
output: Schema.Void,
|
|
61
60
|
}) {}
|
|
62
61
|
|
|
63
|
-
export class CreateAgent extends Schema.TaggedClass<CreateAgent>()(`${
|
|
62
|
+
export class CreateAgent extends Schema.TaggedClass<CreateAgent>()(`${meta.id}/action/create-agent`, {
|
|
64
63
|
input: Schema.Void,
|
|
65
64
|
output: Schema.Void,
|
|
66
65
|
}) {}
|
|
67
66
|
|
|
68
67
|
export class CreateRecoveryCode extends Schema.TaggedClass<CreateRecoveryCode>()(
|
|
69
|
-
`${
|
|
68
|
+
`${meta.id}/action/create-recovery-code`,
|
|
70
69
|
{
|
|
71
70
|
input: Schema.Void,
|
|
72
71
|
output: Schema.Void,
|
|
73
72
|
},
|
|
74
73
|
) {}
|
|
75
74
|
|
|
76
|
-
export class CreatePasskey extends Schema.TaggedClass<CreatePasskey>()(`${
|
|
75
|
+
export class CreatePasskey extends Schema.TaggedClass<CreatePasskey>()(`${meta.id}/action/create-passkey`, {
|
|
77
76
|
input: Schema.Void,
|
|
78
77
|
output: Schema.Void,
|
|
79
78
|
}) {}
|
|
80
79
|
|
|
81
|
-
export class RedeemPasskey extends Schema.TaggedClass<RedeemPasskey>()(`${
|
|
80
|
+
export class RedeemPasskey extends Schema.TaggedClass<RedeemPasskey>()(`${meta.id}/action/redeem-passkey`, {
|
|
82
81
|
input: Schema.Void,
|
|
83
82
|
output: Schema.Void,
|
|
84
83
|
}) {}
|
|
85
84
|
|
|
86
|
-
export class RedeemToken extends Schema.TaggedClass<RedeemToken>()(`${
|
|
85
|
+
export class RedeemToken extends Schema.TaggedClass<RedeemToken>()(`${meta.id}/action/redeem-token`, {
|
|
87
86
|
input: Schema.Struct({
|
|
88
87
|
token: Schema.String,
|
|
89
88
|
}),
|
|
@@ -105,12 +104,12 @@ export type ClientPluginOptions = ClientOptions & {
|
|
|
105
104
|
/**
|
|
106
105
|
* Run after the client has been initialized.
|
|
107
106
|
*/
|
|
108
|
-
onClientInitialized?: (context: PluginContext
|
|
107
|
+
onClientInitialized?: (params: { context: PluginContext; client: Client }) => MaybePromise<void>;
|
|
109
108
|
|
|
110
109
|
/**
|
|
111
110
|
* Called when spaces are ready.
|
|
112
111
|
*/
|
|
113
|
-
onSpacesReady?: (context: PluginContext
|
|
112
|
+
onSpacesReady?: (params: { context: PluginContext; client: Client }) => MaybePromise<void>;
|
|
114
113
|
|
|
115
114
|
/**
|
|
116
115
|
* Called when the client is reset.
|