@dxos/plugin-client 0.8.4-main.fd6878d → 0.8.4-main.fffef41
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-ENKIVZWH.mjs → app-graph-builder-ARY4H3VC.mjs} +26 -25
- package/dist/lib/browser/app-graph-builder-ARY4H3VC.mjs.map +7 -0
- package/dist/lib/browser/{chunk-56EADSTE.mjs → chunk-4G4YWIUQ.mjs} +45 -54
- package/dist/lib/browser/chunk-4G4YWIUQ.mjs.map +7 -0
- package/dist/lib/browser/chunk-4LRO3Y2O.mjs +19 -0
- package/dist/lib/browser/chunk-4LRO3Y2O.mjs.map +7 -0
- package/dist/lib/browser/chunk-N5UR2HOE.mjs +18 -0
- package/dist/lib/browser/chunk-N5UR2HOE.mjs.map +7 -0
- package/dist/lib/browser/{chunk-HLWIF3AW.mjs → chunk-RDIG75CA.mjs} +3 -3
- package/dist/lib/browser/chunk-RDIG75CA.mjs.map +7 -0
- package/dist/lib/browser/chunk-ZRVMXLDR.mjs +15 -0
- package/dist/lib/browser/chunk-ZRVMXLDR.mjs.map +7 -0
- package/dist/lib/browser/{client-F73MIXMT.mjs → client-O7U3MQ6J.mjs} +6 -6
- package/dist/lib/browser/{client-F73MIXMT.mjs.map → client-O7U3MQ6J.mjs.map} +1 -1
- package/dist/lib/browser/index.mjs +23 -19
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/{intent-resolver-S3PUYK5Q.mjs → intent-resolver-KLK7PJZK.mjs} +10 -10
- package/dist/lib/browser/intent-resolver-KLK7PJZK.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{migrations-YJSO7JXY.mjs → migrations-RUAKBBTF.mjs} +6 -6
- package/dist/lib/browser/migrations-RUAKBBTF.mjs.map +7 -0
- package/dist/lib/browser/{react-context-QBXCHNH2.mjs → react-context-PCT5C3BN.mjs} +9 -8
- package/dist/lib/browser/react-context-PCT5C3BN.mjs.map +7 -0
- package/dist/lib/browser/{react-surface-YON76BFE.mjs → react-surface-RCXEA65V.mjs} +6 -6
- package/dist/lib/browser/{react-surface-YON76BFE.mjs.map → react-surface-RCXEA65V.mjs.map} +1 -1
- package/dist/lib/browser/{schema-defs-AMSX6T3B.mjs → schema-defs-UNNBAEFW.mjs} +6 -6
- package/dist/lib/browser/schema-defs-UNNBAEFW.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +2 -2
- package/dist/lib/node-esm/{app-graph-builder-D4XJCLPN.mjs → app-graph-builder-LLM25DRR.mjs} +26 -25
- package/dist/lib/node-esm/app-graph-builder-LLM25DRR.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-6ANOJ7ZM.mjs +19 -0
- package/dist/lib/node-esm/chunk-6ANOJ7ZM.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-7M7VWQJW.mjs +20 -0
- package/dist/lib/node-esm/chunk-7M7VWQJW.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-J6I6JZPI.mjs → chunk-DJ6XKSE4.mjs} +45 -54
- package/dist/lib/node-esm/chunk-DJ6XKSE4.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-QT3EQXDU.mjs +17 -0
- package/dist/lib/node-esm/chunk-QT3EQXDU.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-JG6AFSFU.mjs → chunk-VENKFPBC.mjs} +3 -3
- package/dist/lib/node-esm/chunk-VENKFPBC.mjs.map +7 -0
- package/dist/lib/node-esm/{client-A7CNP37P.mjs → client-6MTNT7M6.mjs} +6 -6
- package/dist/lib/node-esm/{client-A7CNP37P.mjs.map → client-6MTNT7M6.mjs.map} +1 -1
- package/dist/lib/node-esm/index.mjs +23 -19
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/{intent-resolver-EBJABYM3.mjs → intent-resolver-YR2C224X.mjs} +10 -10
- package/dist/lib/node-esm/intent-resolver-YR2C224X.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{migrations-UOEK7HB7.mjs → migrations-ASF2SAUR.mjs} +6 -6
- package/dist/lib/node-esm/migrations-ASF2SAUR.mjs.map +7 -0
- package/dist/lib/node-esm/{react-context-JIH7YBFI.mjs → react-context-F4QOBWSP.mjs} +9 -8
- package/dist/lib/node-esm/react-context-F4QOBWSP.mjs.map +7 -0
- package/dist/lib/node-esm/{react-surface-YKCZF43D.mjs → react-surface-SQBRXVMZ.mjs} +6 -6
- package/dist/lib/node-esm/{react-surface-YKCZF43D.mjs.map → react-surface-SQBRXVMZ.mjs.map} +1 -1
- package/dist/lib/node-esm/{schema-defs-4UTKKRTF.mjs → schema-defs-MSIT2KK2.mjs} +6 -6
- package/dist/lib/node-esm/schema-defs-MSIT2KK2.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +2 -2
- package/dist/types/src/ClientPlugin.d.ts +1 -1
- package/dist/types/src/ClientPlugin.d.ts.map +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/capabilities.d.ts.map +1 -1
- package/dist/types/src/capabilities/client.d.ts +1 -1
- package/dist/types/src/capabilities/index.d.ts +10 -10
- 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/migrations.d.ts +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/schema-defs.d.ts +1 -1
- package/dist/types/src/components/DevicesContainer.d.ts.map +1 -1
- package/dist/types/src/components/DevicesContainer.stories.d.ts +224 -5
- package/dist/types/src/components/DevicesContainer.stories.d.ts.map +1 -1
- package/dist/types/src/components/JoinDialog.d.ts +1 -1
- package/dist/types/src/components/JoinDialog.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 -5
- package/dist/types/src/components/ProfileContainer.stories.d.ts.map +1 -1
- package/dist/types/src/components/RecoveryCodeDialog.d.ts +1 -1
- package/dist/types/src/components/RecoveryCodeDialog.d.ts.map +1 -1
- package/dist/types/src/components/RecoveryCodeDialog.stories.d.ts +59 -5
- package/dist/types/src/components/RecoveryCodeDialog.stories.d.ts.map +1 -1
- package/dist/types/src/components/RecoveryCredentialsContainer.d.ts +1 -1
- package/dist/types/src/components/RecoveryCredentialsContainer.d.ts.map +1 -1
- package/dist/types/src/components/RecoveryCredentialsContainer.stories.d.ts +57 -5
- package/dist/types/src/components/RecoveryCredentialsContainer.stories.d.ts.map +1 -1
- package/dist/types/src/components/ResetDialog.d.ts +1 -1
- package/dist/types/src/components/ResetDialog.d.ts.map +1 -1
- package/dist/types/src/components/ResetDialog.stories.d.ts +59 -4
- package/dist/types/src/components/ResetDialog.stories.d.ts.map +1 -1
- package/dist/types/src/events.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +3 -2
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +0 -1
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/types/schema.d.ts +1 -1
- package/dist/types/src/types/schema.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +35 -36
- package/src/ClientPlugin.ts +55 -57
- package/src/capabilities/app-graph-builder.ts +22 -21
- package/src/capabilities/capabilities.ts +5 -5
- package/src/capabilities/intent-resolver.ts +2 -2
- package/src/capabilities/migrations.ts +1 -1
- package/src/capabilities/react-context.tsx +4 -3
- package/src/capabilities/schema-defs.ts +1 -1
- package/src/components/DevicesContainer.stories.tsx +5 -8
- package/src/components/DevicesContainer.tsx +55 -68
- package/src/components/JoinDialog.tsx +5 -4
- package/src/components/ProfileContainer.stories.tsx +5 -7
- package/src/components/ProfileContainer.tsx +19 -27
- package/src/components/RecoveryCodeDialog.stories.tsx +7 -9
- package/src/components/RecoveryCodeDialog.tsx +6 -6
- package/src/components/RecoveryCredentialsContainer.stories.tsx +5 -8
- package/src/components/RecoveryCredentialsContainer.tsx +46 -50
- package/src/components/ResetDialog.stories.tsx +7 -9
- package/src/components/ResetDialog.tsx +5 -4
- package/src/events.ts +6 -6
- package/src/index.ts +4 -3
- package/src/meta.ts +6 -3
- package/src/types/schema.ts +1 -1
- package/dist/lib/browser/app-graph-builder-ENKIVZWH.mjs.map +0 -7
- package/dist/lib/browser/chunk-3F2Q2RKC.mjs +0 -18
- package/dist/lib/browser/chunk-3F2Q2RKC.mjs.map +0 -7
- package/dist/lib/browser/chunk-56EADSTE.mjs.map +0 -7
- package/dist/lib/browser/chunk-CAF2COXW.mjs +0 -19
- package/dist/lib/browser/chunk-CAF2COXW.mjs.map +0 -7
- package/dist/lib/browser/chunk-GS3LDHYD.mjs +0 -12
- package/dist/lib/browser/chunk-GS3LDHYD.mjs.map +0 -7
- package/dist/lib/browser/chunk-HLWIF3AW.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-S3PUYK5Q.mjs.map +0 -7
- package/dist/lib/browser/migrations-YJSO7JXY.mjs.map +0 -7
- package/dist/lib/browser/react-context-QBXCHNH2.mjs.map +0 -7
- package/dist/lib/browser/schema-defs-AMSX6T3B.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-D4XJCLPN.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-IOGTQFLM.mjs +0 -19
- package/dist/lib/node-esm/chunk-IOGTQFLM.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-J6I6JZPI.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-JG6AFSFU.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-SZLX4BVJ.mjs +0 -14
- package/dist/lib/node-esm/chunk-SZLX4BVJ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-UMO3ETDV.mjs +0 -20
- package/dist/lib/node-esm/chunk-UMO3ETDV.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-EBJABYM3.mjs.map +0 -7
- package/dist/lib/node-esm/migrations-UOEK7HB7.mjs.map +0 -7
- package/dist/lib/node-esm/react-context-JIH7YBFI.mjs.map +0 -7
- package/dist/lib/node-esm/schema-defs-4UTKKRTF.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.fffef41",
|
|
4
4
|
"description": "DXOS Surface plugin for DXOS Client",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -36,48 +36,47 @@
|
|
|
36
36
|
],
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@preact-signals/safe-react": "^0.9.0",
|
|
39
|
-
"@preact/signals-core": "^1.
|
|
39
|
+
"@preact/signals-core": "^1.12.1",
|
|
40
40
|
"react-qr-rounded": "^1.0.0",
|
|
41
|
-
"@dxos/app-framework": "0.8.4-main.
|
|
42
|
-
"@dxos/
|
|
43
|
-
"@dxos/
|
|
44
|
-
"@dxos/echo-
|
|
45
|
-
"@dxos/
|
|
46
|
-
"@dxos/
|
|
47
|
-
"@dxos/
|
|
48
|
-
"@dxos/
|
|
49
|
-
"@dxos/
|
|
50
|
-
"@dxos/plugin-
|
|
51
|
-
"@dxos/react-
|
|
52
|
-
"@dxos/react-ui-form": "0.8.4-main.
|
|
53
|
-
"@dxos/
|
|
54
|
-
"@dxos/
|
|
55
|
-
"@dxos/util": "0.8.4-main.
|
|
56
|
-
"@dxos/
|
|
57
|
-
"@dxos/plugin-graph": "0.8.4-main.fd6878d"
|
|
41
|
+
"@dxos/app-framework": "0.8.4-main.fffef41",
|
|
42
|
+
"@dxos/config": "0.8.4-main.fffef41",
|
|
43
|
+
"@dxos/echo": "0.8.4-main.fffef41",
|
|
44
|
+
"@dxos/echo-signals": "0.8.4-main.fffef41",
|
|
45
|
+
"@dxos/invariant": "0.8.4-main.fffef41",
|
|
46
|
+
"@dxos/local-storage": "0.8.4-main.fffef41",
|
|
47
|
+
"@dxos/log": "0.8.4-main.fffef41",
|
|
48
|
+
"@dxos/react-client": "0.8.4-main.fffef41",
|
|
49
|
+
"@dxos/plugin-observability": "0.8.4-main.fffef41",
|
|
50
|
+
"@dxos/plugin-graph": "0.8.4-main.fffef41",
|
|
51
|
+
"@dxos/react-ui-pickers": "0.8.4-main.fffef41",
|
|
52
|
+
"@dxos/react-ui-form": "0.8.4-main.fffef41",
|
|
53
|
+
"@dxos/react-ui-stack": "0.8.4-main.fffef41",
|
|
54
|
+
"@dxos/shell": "0.8.4-main.fffef41",
|
|
55
|
+
"@dxos/util": "0.8.4-main.fffef41",
|
|
56
|
+
"@dxos/async": "0.8.4-main.fffef41"
|
|
58
57
|
},
|
|
59
58
|
"devDependencies": {
|
|
60
|
-
"@effect-
|
|
61
|
-
"@effect/platform": "0.
|
|
62
|
-
"@types/react": "~
|
|
63
|
-
"@types/react-dom": "~
|
|
64
|
-
"effect": "3.
|
|
65
|
-
"react": "~
|
|
66
|
-
"react-dom": "~
|
|
67
|
-
"vite": "
|
|
68
|
-
"@dxos/live-object": "0.8.4-main.
|
|
69
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
70
|
-
"@dxos/react-ui-theme": "0.8.4-main.
|
|
71
|
-
"@dxos/storybook-utils": "0.8.4-main.
|
|
59
|
+
"@effect-atom/atom-react": "^0.3.4",
|
|
60
|
+
"@effect/platform": "0.92.1",
|
|
61
|
+
"@types/react": "~19.2.2",
|
|
62
|
+
"@types/react-dom": "~19.2.2",
|
|
63
|
+
"effect": "3.18.3",
|
|
64
|
+
"react": "~19.2.0",
|
|
65
|
+
"react-dom": "~19.2.0",
|
|
66
|
+
"vite": "7.1.9",
|
|
67
|
+
"@dxos/live-object": "0.8.4-main.fffef41",
|
|
68
|
+
"@dxos/react-ui": "0.8.4-main.fffef41",
|
|
69
|
+
"@dxos/react-ui-theme": "0.8.4-main.fffef41",
|
|
70
|
+
"@dxos/storybook-utils": "0.8.4-main.fffef41"
|
|
72
71
|
},
|
|
73
72
|
"peerDependencies": {
|
|
74
|
-
"@effect-
|
|
73
|
+
"@effect-atom/atom-react": "^0.3.4",
|
|
75
74
|
"@effect/platform": "^0.80.12",
|
|
76
75
|
"effect": "^3.13.3",
|
|
77
|
-
"react": "
|
|
78
|
-
"react-dom": "
|
|
79
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
80
|
-
"@dxos/react-ui-theme": "0.8.4-main.
|
|
76
|
+
"react": "^19.0.0",
|
|
77
|
+
"react-dom": "^19.0.0",
|
|
78
|
+
"@dxos/react-ui": "0.8.4-main.fffef41",
|
|
79
|
+
"@dxos/react-ui-theme": "0.8.4-main.fffef41"
|
|
81
80
|
},
|
|
82
81
|
"publishConfig": {
|
|
83
82
|
"access": "public"
|
package/src/ClientPlugin.ts
CHANGED
|
@@ -18,61 +18,59 @@ import { meta } from './meta';
|
|
|
18
18
|
import { translations } from './translations';
|
|
19
19
|
import { type ClientPluginOptions } from './types';
|
|
20
20
|
|
|
21
|
-
export const ClientPlugin = (
|
|
22
|
-
|
|
23
|
-
invitationParam = 'deviceInvitationCode',
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
baseUrl.searchParams.set(invitationParam, invitationCode);
|
|
30
|
-
return baseUrl.toString();
|
|
31
|
-
};
|
|
21
|
+
export const ClientPlugin = definePlugin<ClientPluginOptions>(
|
|
22
|
+
meta,
|
|
23
|
+
({ invitationUrl = window.location.origin, invitationParam = 'deviceInvitationCode', onReset, ...options }) => {
|
|
24
|
+
const createInvitationUrl = (invitationCode: string) => {
|
|
25
|
+
const baseUrl = new URL(invitationUrl);
|
|
26
|
+
baseUrl.searchParams.set(invitationParam, invitationCode);
|
|
27
|
+
return baseUrl.toString();
|
|
28
|
+
};
|
|
32
29
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
}
|
|
30
|
+
return [
|
|
31
|
+
defineModule({
|
|
32
|
+
id: `${meta.id}/module/client`,
|
|
33
|
+
activatesOn: oneOf(Events.Startup, Events.SetupAppGraph),
|
|
34
|
+
activatesAfter: [ClientEvents.ClientReady],
|
|
35
|
+
activate: (context) => Client({ ...options, context }),
|
|
36
|
+
}),
|
|
37
|
+
defineModule({
|
|
38
|
+
id: `${meta.id}/module/schema`,
|
|
39
|
+
activatesOn: ClientEvents.ClientReady,
|
|
40
|
+
activatesBefore: [ClientEvents.SetupSchema],
|
|
41
|
+
activate: SchemaDefs,
|
|
42
|
+
}),
|
|
43
|
+
defineModule({
|
|
44
|
+
id: `${meta.id}/module/migration`,
|
|
45
|
+
activatesOn: ClientEvents.ClientReady,
|
|
46
|
+
activatesBefore: [ClientEvents.SetupMigration],
|
|
47
|
+
activate: Migrations,
|
|
48
|
+
}),
|
|
49
|
+
defineModule({
|
|
50
|
+
id: `${meta.id}/module/react-context`,
|
|
51
|
+
activatesOn: Events.Startup,
|
|
52
|
+
activate: ReactContext,
|
|
53
|
+
}),
|
|
54
|
+
defineModule({
|
|
55
|
+
id: `${meta.id}/module/react-surface`,
|
|
56
|
+
activatesOn: Events.SetupReactSurface,
|
|
57
|
+
activate: () => ReactSurface({ createInvitationUrl, onReset }),
|
|
58
|
+
}),
|
|
59
|
+
defineModule({
|
|
60
|
+
id: `${meta.id}/module/app-graph-builder`,
|
|
61
|
+
activatesOn: Events.SetupAppGraph,
|
|
62
|
+
activate: AppGraphBuilder,
|
|
63
|
+
}),
|
|
64
|
+
defineModule({
|
|
65
|
+
id: `${meta.id}/module/intent-resolver`,
|
|
66
|
+
activatesOn: Events.SetupIntentResolver,
|
|
67
|
+
activate: (context) => IntentResolver({ context }),
|
|
68
|
+
}),
|
|
69
|
+
defineModule({
|
|
70
|
+
id: `${meta.id}/module/translations`,
|
|
71
|
+
activatesOn: Events.SetupTranslations,
|
|
72
|
+
activate: () => contributes(Capabilities.Translations, translations),
|
|
73
|
+
}),
|
|
74
|
+
];
|
|
75
|
+
},
|
|
76
|
+
);
|
|
@@ -2,15 +2,16 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
5
|
+
import { Atom } from '@effect-atom/atom-react';
|
|
6
|
+
import * as Function from 'effect/Function';
|
|
7
|
+
import * as Option from 'effect/Option';
|
|
7
8
|
|
|
8
9
|
import { createIntent } from '@dxos/app-framework';
|
|
9
10
|
import { Capabilities, type PluginContext, contributes } from '@dxos/app-framework';
|
|
10
|
-
import { ROOT_ID,
|
|
11
|
+
import { ROOT_ID, atomFromObservable, createExtension } from '@dxos/plugin-graph';
|
|
11
12
|
import { ConnectionState } from '@dxos/react-client/mesh';
|
|
12
13
|
|
|
13
|
-
import {
|
|
14
|
+
import { meta } from '../meta';
|
|
14
15
|
import { Account, ClientAction } from '../types';
|
|
15
16
|
|
|
16
17
|
import { ClientCapabilities } from './capabilities';
|
|
@@ -19,22 +20,22 @@ export default (context: PluginContext) =>
|
|
|
19
20
|
contributes(
|
|
20
21
|
Capabilities.AppGraphBuilder,
|
|
21
22
|
createExtension({
|
|
22
|
-
id:
|
|
23
|
+
id: meta.id,
|
|
23
24
|
actions: (node) =>
|
|
24
|
-
|
|
25
|
-
pipe(
|
|
25
|
+
Atom.make((get) =>
|
|
26
|
+
Function.pipe(
|
|
26
27
|
get(node),
|
|
27
28
|
Option.flatMap((node) => (node.id === ROOT_ID ? Option.some(node) : Option.none())),
|
|
28
29
|
Option.map(() => {
|
|
29
30
|
return [
|
|
30
31
|
{
|
|
31
|
-
id: `${
|
|
32
|
+
id: `${meta.id}/open-user-account`,
|
|
32
33
|
data: async () => {
|
|
33
34
|
const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);
|
|
34
35
|
await dispatch(createIntent(ClientAction.ShareIdentity));
|
|
35
36
|
},
|
|
36
37
|
properties: {
|
|
37
|
-
label: ['open user account label', { ns:
|
|
38
|
+
label: ['open user account label', { ns: meta.id }],
|
|
38
39
|
icon: 'ph--user--regular',
|
|
39
40
|
disposition: 'menu',
|
|
40
41
|
keyBinding: {
|
|
@@ -51,21 +52,21 @@ export default (context: PluginContext) =>
|
|
|
51
52
|
),
|
|
52
53
|
),
|
|
53
54
|
connector: (node) =>
|
|
54
|
-
|
|
55
|
-
pipe(
|
|
55
|
+
Atom.make((get) =>
|
|
56
|
+
Function.pipe(
|
|
56
57
|
get(node),
|
|
57
58
|
Option.flatMap((node) => (node.id === ROOT_ID ? Option.some(node) : Option.none())),
|
|
58
59
|
Option.map(() => {
|
|
59
60
|
const client = context.getCapability(ClientCapabilities.Client);
|
|
60
|
-
const identity = get(
|
|
61
|
-
const status = get(
|
|
61
|
+
const identity = get(atomFromObservable(client.halo.identity));
|
|
62
|
+
const status = get(atomFromObservable(client.mesh.networkStatus));
|
|
62
63
|
|
|
63
64
|
return [
|
|
64
65
|
{
|
|
65
66
|
id: Account.id,
|
|
66
|
-
type:
|
|
67
|
+
type: meta.id,
|
|
67
68
|
properties: {
|
|
68
|
-
label: ['account label', { ns:
|
|
69
|
+
label: ['account label', { ns: meta.id }],
|
|
69
70
|
icon: 'ph--user--regular',
|
|
70
71
|
disposition: 'user-account',
|
|
71
72
|
// NOTE: This currently needs to be the identity key because the fallback is generated from hex.
|
|
@@ -78,18 +79,18 @@ export default (context: PluginContext) =>
|
|
|
78
79
|
{
|
|
79
80
|
id: Account.Profile,
|
|
80
81
|
data: Account.Profile,
|
|
81
|
-
type:
|
|
82
|
+
type: meta.id,
|
|
82
83
|
properties: {
|
|
83
|
-
label: ['profile label', { ns:
|
|
84
|
+
label: ['profile label', { ns: meta.id }],
|
|
84
85
|
icon: 'ph--user--regular',
|
|
85
86
|
},
|
|
86
87
|
},
|
|
87
88
|
{
|
|
88
89
|
id: Account.Devices,
|
|
89
90
|
data: Account.Devices,
|
|
90
|
-
type:
|
|
91
|
+
type: meta.id,
|
|
91
92
|
properties: {
|
|
92
|
-
label: ['devices label', { ns:
|
|
93
|
+
label: ['devices label', { ns: meta.id }],
|
|
93
94
|
icon: 'ph--devices--regular',
|
|
94
95
|
testId: 'clientPlugin.devices',
|
|
95
96
|
},
|
|
@@ -97,9 +98,9 @@ export default (context: PluginContext) =>
|
|
|
97
98
|
{
|
|
98
99
|
id: Account.Security,
|
|
99
100
|
data: Account.Security,
|
|
100
|
-
type:
|
|
101
|
+
type: meta.id,
|
|
101
102
|
properties: {
|
|
102
|
-
label: ['security label', { ns:
|
|
103
|
+
label: ['security label', { ns: meta.id }],
|
|
103
104
|
icon: 'ph--key--regular',
|
|
104
105
|
},
|
|
105
106
|
},
|
|
@@ -7,12 +7,12 @@ import { type Client } from '@dxos/client';
|
|
|
7
7
|
import { type ObjectMigration } from '@dxos/client/echo';
|
|
8
8
|
import { type Type } from '@dxos/echo';
|
|
9
9
|
|
|
10
|
-
import {
|
|
10
|
+
import { meta } from '../meta';
|
|
11
11
|
|
|
12
12
|
export namespace ClientCapabilities {
|
|
13
|
-
export const Client = defineCapability<Client>(`${
|
|
14
|
-
export const Schema = defineCapability<Type.Obj.Any[]>(`${
|
|
13
|
+
export const Client = defineCapability<Client>(`${meta.id}/capability/client`);
|
|
14
|
+
export const Schema = defineCapability<Type.Obj.Any[]>(`${meta.id}/capability/schema`);
|
|
15
15
|
// TODO(wittjosiah): More descriptive name.
|
|
16
|
-
export const SchemaWhiteList = defineCapability<Type.Obj.Any[]>(`${
|
|
17
|
-
export const Migration = defineCapability<ObjectMigration[]>(`${
|
|
16
|
+
export const SchemaWhiteList = defineCapability<Type.Obj.Any[]>(`${meta.id}/capability/schema-whitelist`);
|
|
17
|
+
export const Migration = defineCapability<ObjectMigration[]>(`${meta.id}/capability/migration`);
|
|
18
18
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import * as Function from 'effect/Function';
|
|
6
6
|
|
|
7
7
|
import {
|
|
8
8
|
Capabilities,
|
|
@@ -75,7 +75,7 @@ export default ({ context, appName = 'Composer' }: IntentResolverOptions) =>
|
|
|
75
75
|
resolve: async () => {
|
|
76
76
|
return {
|
|
77
77
|
intents: [
|
|
78
|
-
pipe(
|
|
78
|
+
Function.pipe(
|
|
79
79
|
createIntent(LayoutAction.SwitchWorkspace, {
|
|
80
80
|
part: 'workspace',
|
|
81
81
|
subject: Account.id,
|
|
@@ -7,7 +7,7 @@ import { Capabilities, type PluginContext, contributes } from '@dxos/app-framewo
|
|
|
7
7
|
import { ClientCapabilities } from './capabilities';
|
|
8
8
|
|
|
9
9
|
export default (context: PluginContext) => {
|
|
10
|
-
const registry = context.getCapability(Capabilities.
|
|
10
|
+
const registry = context.getCapability(Capabilities.AtomRegistry);
|
|
11
11
|
const client = context.getCapability(ClientCapabilities.Client);
|
|
12
12
|
|
|
13
13
|
// NOTE: Migrations are currently unidirectional and idempotent.
|
|
@@ -4,16 +4,17 @@
|
|
|
4
4
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
|
-
import { Capabilities, contributes
|
|
7
|
+
import { Capabilities, contributes } from '@dxos/app-framework';
|
|
8
|
+
import { useCapability } from '@dxos/app-framework/react';
|
|
8
9
|
import { ClientProvider } from '@dxos/react-client';
|
|
9
10
|
|
|
10
|
-
import {
|
|
11
|
+
import { meta } from '../meta';
|
|
11
12
|
|
|
12
13
|
import { ClientCapabilities } from './capabilities';
|
|
13
14
|
|
|
14
15
|
export default () =>
|
|
15
16
|
contributes(Capabilities.ReactContext, {
|
|
16
|
-
id:
|
|
17
|
+
id: meta.id,
|
|
17
18
|
context: ({ children }) => {
|
|
18
19
|
const client = useCapability(ClientCapabilities.Client);
|
|
19
20
|
return <ClientProvider client={client}>{children}</ClientProvider>;
|
|
@@ -8,7 +8,7 @@ import { type Type } from '@dxos/echo';
|
|
|
8
8
|
import { ClientCapabilities } from './capabilities';
|
|
9
9
|
|
|
10
10
|
export default (context: PluginContext) => {
|
|
11
|
-
const registry = context.getCapability(Capabilities.
|
|
11
|
+
const registry = context.getCapability(Capabilities.AtomRegistry);
|
|
12
12
|
const client = context.getCapability(ClientCapabilities.Client);
|
|
13
13
|
|
|
14
14
|
// TODO(wittjosiah): Unregister schemas when they are disabled.
|
|
@@ -2,24 +2,23 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import '@dxos-theme';
|
|
6
|
-
|
|
7
5
|
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
8
6
|
|
|
9
7
|
import { IntentPlugin } from '@dxos/app-framework';
|
|
10
8
|
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
9
|
+
import { withTheme } from '@dxos/react-ui/testing';
|
|
11
10
|
import { translations as shellTranslations } from '@dxos/shell/react';
|
|
12
|
-
import { withLayout, withTheme } from '@dxos/storybook-utils';
|
|
13
11
|
|
|
14
12
|
import { ClientPlugin } from '../ClientPlugin';
|
|
15
13
|
import { translations } from '../translations';
|
|
16
14
|
|
|
17
15
|
import { DevicesContainer } from './DevicesContainer';
|
|
18
16
|
|
|
19
|
-
const meta
|
|
17
|
+
const meta = {
|
|
20
18
|
title: 'plugins/plugin-client/DevicesContainer',
|
|
21
19
|
component: DevicesContainer,
|
|
22
20
|
decorators: [
|
|
21
|
+
withTheme,
|
|
23
22
|
withPluginManager({
|
|
24
23
|
plugins: [
|
|
25
24
|
ClientPlugin({
|
|
@@ -30,18 +29,16 @@ const meta: Meta = {
|
|
|
30
29
|
IntentPlugin(),
|
|
31
30
|
],
|
|
32
31
|
}),
|
|
33
|
-
withTheme,
|
|
34
|
-
withLayout(),
|
|
35
32
|
],
|
|
36
33
|
parameters: {
|
|
37
34
|
layout: 'fullscreen',
|
|
38
35
|
translations: [...translations, ...shellTranslations],
|
|
39
36
|
},
|
|
40
|
-
}
|
|
37
|
+
} satisfies Meta<typeof DevicesContainer>;
|
|
41
38
|
|
|
42
39
|
export default meta;
|
|
43
40
|
|
|
44
|
-
type Story = StoryObj<typeof
|
|
41
|
+
type Story = StoryObj<typeof meta>;
|
|
45
42
|
|
|
46
43
|
export const Default: Story = {
|
|
47
44
|
args: {
|
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
import React, { useCallback, useEffect, useState } from 'react';
|
|
6
6
|
import { QR } from 'react-qr-rounded';
|
|
7
7
|
|
|
8
|
-
import { createIntent
|
|
8
|
+
import { createIntent } from '@dxos/app-framework';
|
|
9
|
+
import { useIntentDispatcher } from '@dxos/app-framework/react';
|
|
9
10
|
import { log } from '@dxos/log';
|
|
10
11
|
import { useClient, useMulticastObservable } from '@dxos/react-client';
|
|
11
12
|
import { type Device, useDevices } from '@dxos/react-client/halo';
|
|
@@ -20,11 +21,10 @@ import {
|
|
|
20
21
|
ControlPage,
|
|
21
22
|
ControlSection,
|
|
22
23
|
} from '@dxos/react-ui-form';
|
|
23
|
-
import { StackItem } from '@dxos/react-ui-stack';
|
|
24
24
|
import { AuthCode, Centered, DeviceListItem, Emoji, Viewport } from '@dxos/shell/react';
|
|
25
25
|
import { hexToEmoji } from '@dxos/util';
|
|
26
26
|
|
|
27
|
-
import {
|
|
27
|
+
import { meta } from '../meta';
|
|
28
28
|
import { ClientAction } from '../types';
|
|
29
29
|
|
|
30
30
|
export type DevicesContainerProps = {
|
|
@@ -51,70 +51,57 @@ export const DevicesContainer = ({ createInvitationUrl }: DevicesContainerProps)
|
|
|
51
51
|
|
|
52
52
|
return (
|
|
53
53
|
<Clipboard.Provider>
|
|
54
|
-
<
|
|
55
|
-
<
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
>
|
|
60
|
-
<
|
|
61
|
-
<
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
</List>
|
|
54
|
+
<ControlPage>
|
|
55
|
+
<ControlSection
|
|
56
|
+
title={t('devices verbose label', { ns: meta.id })}
|
|
57
|
+
description={t('devices description', { ns: meta.id })}
|
|
58
|
+
>
|
|
59
|
+
<ControlFrame>
|
|
60
|
+
<ControlFrameItem title={t('devices label', { ns: meta.id })}>
|
|
61
|
+
<List>
|
|
62
|
+
{devices.map((device: Device) => {
|
|
63
|
+
return (
|
|
64
|
+
<DeviceListItem key={device.deviceKey.toHex()} device={device} connectionState={connectionState} />
|
|
65
|
+
);
|
|
66
|
+
})}
|
|
67
|
+
</List>
|
|
68
|
+
</ControlFrameItem>
|
|
69
|
+
{createInvitationUrl && (
|
|
70
|
+
<ControlFrameItem title='Add device'>
|
|
71
|
+
<DeviceInvitation createInvitationUrl={createInvitationUrl} />
|
|
73
72
|
</ControlFrameItem>
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
<
|
|
82
|
-
title={t('
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
</
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
</
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
<Button
|
|
107
|
-
variant='destructive'
|
|
108
|
-
onClick={handleJoinNewIdentity}
|
|
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>
|
|
73
|
+
)}
|
|
74
|
+
</ControlFrame>
|
|
75
|
+
</ControlSection>
|
|
76
|
+
<ControlSection
|
|
77
|
+
title={t('danger zone title', { ns: meta.id })}
|
|
78
|
+
description={t('danger zone description', { ns: meta.id })}
|
|
79
|
+
>
|
|
80
|
+
<ControlGroup>
|
|
81
|
+
<ControlItem title={t('reset device label')} description={t('reset device description', { ns: meta.id })}>
|
|
82
|
+
<Button variant='destructive' onClick={handleResetStorage} data-testid='devicesContainer.reset'>
|
|
83
|
+
{t('reset device label')}
|
|
84
|
+
</Button>
|
|
85
|
+
</ControlItem>
|
|
86
|
+
<ControlItem
|
|
87
|
+
title={t('recover identity label')}
|
|
88
|
+
description={t('recover identity description', { ns: meta.id })}
|
|
89
|
+
>
|
|
90
|
+
<Button variant='destructive' onClick={handleRecover} data-testid='devicesContainer.recover'>
|
|
91
|
+
{t('recover identity label')}
|
|
92
|
+
</Button>
|
|
93
|
+
</ControlItem>
|
|
94
|
+
<ControlItem
|
|
95
|
+
title={t('join new identity label')}
|
|
96
|
+
description={t('join new identity description', { ns: meta.id })}
|
|
97
|
+
>
|
|
98
|
+
<Button variant='destructive' onClick={handleJoinNewIdentity} data-testid='devicesContainer.joinExisting'>
|
|
99
|
+
{t('join new identity label')}
|
|
100
|
+
</Button>
|
|
101
|
+
</ControlItem>
|
|
102
|
+
</ControlGroup>
|
|
103
|
+
</ControlSection>
|
|
104
|
+
</ControlPage>
|
|
118
105
|
</Clipboard.Provider>
|
|
119
106
|
);
|
|
120
107
|
};
|
|
@@ -189,7 +176,7 @@ const InvitationSection = ({
|
|
|
189
176
|
onInvitationDone = () => {},
|
|
190
177
|
onInvitationCreate = () => {},
|
|
191
178
|
}: InvitationComponentProps) => {
|
|
192
|
-
const { t } = useTranslation(
|
|
179
|
+
const { t } = useTranslation(meta.id);
|
|
193
180
|
const activeView =
|
|
194
181
|
state < 0
|
|
195
182
|
? 'init'
|
|
@@ -236,7 +223,7 @@ const InvitationQR = ({ id, url, onCancel }: { id: string; url: string; onCancel
|
|
|
236
223
|
const emoji = hexToEmoji(id);
|
|
237
224
|
return (
|
|
238
225
|
<>
|
|
239
|
-
<p className='text-description'>{t('qr code description', { ns:
|
|
226
|
+
<p className='text-description'>{t('qr code description', { ns: meta.id })}</p>
|
|
240
227
|
<div role='group' className='grid grid-cols-[1fr_min-content] mlb-2 gap-2'>
|
|
241
228
|
<div role='none' className='is-full aspect-square relative text-description'>
|
|
242
229
|
<QR
|
|
@@ -4,20 +4,21 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { useCallback } from 'react';
|
|
6
6
|
|
|
7
|
-
import { LayoutAction, createIntent
|
|
7
|
+
import { LayoutAction, createIntent } from '@dxos/app-framework';
|
|
8
|
+
import { useIntentDispatcher } from '@dxos/app-framework/react';
|
|
8
9
|
import { ObservabilityAction } from '@dxos/plugin-observability/types';
|
|
9
10
|
import { type InvitationResult } from '@dxos/react-client/invitations';
|
|
10
11
|
import { Dialog, useTranslation } from '@dxos/react-ui';
|
|
11
12
|
import { JoinPanel, type JoinPanelProps } from '@dxos/shell/react';
|
|
12
13
|
|
|
13
|
-
import {
|
|
14
|
+
import { meta } from '../meta';
|
|
14
15
|
import { ClientAction } from '../types';
|
|
15
16
|
|
|
16
|
-
export const JOIN_DIALOG = `${
|
|
17
|
+
export const JOIN_DIALOG = `${meta.id}/JoinDialog`;
|
|
17
18
|
|
|
18
19
|
export const JoinDialog = (props: JoinPanelProps) => {
|
|
19
20
|
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
20
|
-
const { t } = useTranslation(
|
|
21
|
+
const { t } = useTranslation(meta.id);
|
|
21
22
|
|
|
22
23
|
const handleCancelResetStorage = useCallback(() => dispatch(createIntent(ClientAction.ShareIdentity)), [dispatch]);
|
|
23
24
|
|