@dxos/plugin-client 0.8.4-main.dedc0f3 → 0.8.4-main.e8ec1fe
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-FOCQEA72.mjs → chunk-4G4YWIUQ.mjs} +38 -38
- 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-LNPFUWU5.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-3AH7INFU.mjs → react-surface-RCXEA65V.mjs} +6 -6
- package/dist/lib/browser/{react-surface-3AH7INFU.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-MUWDSQ65.mjs → chunk-DJ6XKSE4.mjs} +38 -38
- 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-C4INMPH7.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-4TMUCPEW.mjs → react-surface-SQBRXVMZ.mjs} +6 -6
- package/dist/lib/node-esm/{react-surface-4TMUCPEW.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.map +1 -1
- package/dist/types/src/capabilities/capabilities.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +2 -2
- package/dist/types/src/capabilities/react-context.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 -3
- 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 +0 -1
- 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 +0 -1
- 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 +1 -3
- 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 +0 -1
- 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 +2 -5
- package/src/components/DevicesContainer.tsx +13 -15
- package/src/components/JoinDialog.tsx +5 -4
- package/src/components/ProfileContainer.stories.tsx +2 -4
- package/src/components/ProfileContainer.tsx +4 -9
- package/src/components/RecoveryCodeDialog.stories.tsx +2 -4
- package/src/components/RecoveryCodeDialog.tsx +6 -6
- package/src/components/RecoveryCredentialsContainer.stories.tsx +2 -5
- package/src/components/RecoveryCredentialsContainer.tsx +6 -7
- package/src/components/ResetDialog.stories.tsx +4 -6
- 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-CAF2COXW.mjs +0 -19
- package/dist/lib/browser/chunk-CAF2COXW.mjs.map +0 -7
- package/dist/lib/browser/chunk-FOCQEA72.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-LNPFUWU5.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-JG6AFSFU.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-MUWDSQ65.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-C4INMPH7.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.e8ec1fe",
|
|
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": "0.8.4-main.
|
|
45
|
-
"@dxos/echo
|
|
46
|
-
"@dxos/
|
|
47
|
-
"@dxos/
|
|
48
|
-
"@dxos/
|
|
49
|
-
"@dxos/plugin-
|
|
50
|
-
"@dxos/plugin-
|
|
51
|
-
"@dxos/
|
|
52
|
-
"@dxos/react-
|
|
53
|
-
"@dxos/
|
|
54
|
-
"@dxos/react-ui-pickers": "0.8.4-main.
|
|
55
|
-
"@dxos/
|
|
56
|
-
"@dxos/
|
|
57
|
-
"@dxos/util": "0.8.4-main.dedc0f3"
|
|
41
|
+
"@dxos/app-framework": "0.8.4-main.e8ec1fe",
|
|
42
|
+
"@dxos/async": "0.8.4-main.e8ec1fe",
|
|
43
|
+
"@dxos/config": "0.8.4-main.e8ec1fe",
|
|
44
|
+
"@dxos/echo-signals": "0.8.4-main.e8ec1fe",
|
|
45
|
+
"@dxos/echo": "0.8.4-main.e8ec1fe",
|
|
46
|
+
"@dxos/local-storage": "0.8.4-main.e8ec1fe",
|
|
47
|
+
"@dxos/log": "0.8.4-main.e8ec1fe",
|
|
48
|
+
"@dxos/invariant": "0.8.4-main.e8ec1fe",
|
|
49
|
+
"@dxos/plugin-observability": "0.8.4-main.e8ec1fe",
|
|
50
|
+
"@dxos/plugin-graph": "0.8.4-main.e8ec1fe",
|
|
51
|
+
"@dxos/react-ui-stack": "0.8.4-main.e8ec1fe",
|
|
52
|
+
"@dxos/react-ui-form": "0.8.4-main.e8ec1fe",
|
|
53
|
+
"@dxos/shell": "0.8.4-main.e8ec1fe",
|
|
54
|
+
"@dxos/react-ui-pickers": "0.8.4-main.e8ec1fe",
|
|
55
|
+
"@dxos/util": "0.8.4-main.e8ec1fe",
|
|
56
|
+
"@dxos/react-client": "0.8.4-main.e8ec1fe"
|
|
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": "7.1.
|
|
68
|
-
"@dxos/live-object": "0.8.4-main.
|
|
69
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
70
|
-
"@dxos/
|
|
71
|
-
"@dxos/
|
|
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.e8ec1fe",
|
|
68
|
+
"@dxos/react-ui-theme": "0.8.4-main.e8ec1fe",
|
|
69
|
+
"@dxos/storybook-utils": "0.8.4-main.e8ec1fe",
|
|
70
|
+
"@dxos/react-ui": "0.8.4-main.e8ec1fe"
|
|
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.e8ec1fe",
|
|
79
|
+
"@dxos/react-ui-theme": "0.8.4-main.e8ec1fe"
|
|
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,14 +2,12 @@
|
|
|
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';
|
|
@@ -20,6 +18,7 @@ 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,8 +29,6 @@ const meta = {
|
|
|
30
29
|
IntentPlugin(),
|
|
31
30
|
],
|
|
32
31
|
}),
|
|
33
|
-
withTheme,
|
|
34
|
-
withLayout(),
|
|
35
32
|
],
|
|
36
33
|
parameters: {
|
|
37
34
|
layout: 'fullscreen',
|
|
@@ -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';
|
|
@@ -23,7 +24,7 @@ import {
|
|
|
23
24
|
import { AuthCode, Centered, DeviceListItem, Emoji, Viewport } from '@dxos/shell/react';
|
|
24
25
|
import { hexToEmoji } from '@dxos/util';
|
|
25
26
|
|
|
26
|
-
import {
|
|
27
|
+
import { meta } from '../meta';
|
|
27
28
|
import { ClientAction } from '../types';
|
|
28
29
|
|
|
29
30
|
export type DevicesContainerProps = {
|
|
@@ -52,11 +53,11 @@ export const DevicesContainer = ({ createInvitationUrl }: DevicesContainerProps)
|
|
|
52
53
|
<Clipboard.Provider>
|
|
53
54
|
<ControlPage>
|
|
54
55
|
<ControlSection
|
|
55
|
-
title={t('devices verbose label', { ns:
|
|
56
|
-
description={t('devices description', { ns:
|
|
56
|
+
title={t('devices verbose label', { ns: meta.id })}
|
|
57
|
+
description={t('devices description', { ns: meta.id })}
|
|
57
58
|
>
|
|
58
59
|
<ControlFrame>
|
|
59
|
-
<ControlFrameItem title={t('devices label', { ns:
|
|
60
|
+
<ControlFrameItem title={t('devices label', { ns: meta.id })}>
|
|
60
61
|
<List>
|
|
61
62
|
{devices.map((device: Device) => {
|
|
62
63
|
return (
|
|
@@ -73,21 +74,18 @@ export const DevicesContainer = ({ createInvitationUrl }: DevicesContainerProps)
|
|
|
73
74
|
</ControlFrame>
|
|
74
75
|
</ControlSection>
|
|
75
76
|
<ControlSection
|
|
76
|
-
title={t('danger zone title', { ns:
|
|
77
|
-
description={t('danger zone description', { ns:
|
|
77
|
+
title={t('danger zone title', { ns: meta.id })}
|
|
78
|
+
description={t('danger zone description', { ns: meta.id })}
|
|
78
79
|
>
|
|
79
80
|
<ControlGroup>
|
|
80
|
-
<ControlItem
|
|
81
|
-
title={t('reset device label')}
|
|
82
|
-
description={t('reset device description', { ns: CLIENT_PLUGIN })}
|
|
83
|
-
>
|
|
81
|
+
<ControlItem title={t('reset device label')} description={t('reset device description', { ns: meta.id })}>
|
|
84
82
|
<Button variant='destructive' onClick={handleResetStorage} data-testid='devicesContainer.reset'>
|
|
85
83
|
{t('reset device label')}
|
|
86
84
|
</Button>
|
|
87
85
|
</ControlItem>
|
|
88
86
|
<ControlItem
|
|
89
87
|
title={t('recover identity label')}
|
|
90
|
-
description={t('recover identity description', { ns:
|
|
88
|
+
description={t('recover identity description', { ns: meta.id })}
|
|
91
89
|
>
|
|
92
90
|
<Button variant='destructive' onClick={handleRecover} data-testid='devicesContainer.recover'>
|
|
93
91
|
{t('recover identity label')}
|
|
@@ -95,7 +93,7 @@ export const DevicesContainer = ({ createInvitationUrl }: DevicesContainerProps)
|
|
|
95
93
|
</ControlItem>
|
|
96
94
|
<ControlItem
|
|
97
95
|
title={t('join new identity label')}
|
|
98
|
-
description={t('join new identity description', { ns:
|
|
96
|
+
description={t('join new identity description', { ns: meta.id })}
|
|
99
97
|
>
|
|
100
98
|
<Button variant='destructive' onClick={handleJoinNewIdentity} data-testid='devicesContainer.joinExisting'>
|
|
101
99
|
{t('join new identity label')}
|
|
@@ -178,7 +176,7 @@ const InvitationSection = ({
|
|
|
178
176
|
onInvitationDone = () => {},
|
|
179
177
|
onInvitationCreate = () => {},
|
|
180
178
|
}: InvitationComponentProps) => {
|
|
181
|
-
const { t } = useTranslation(
|
|
179
|
+
const { t } = useTranslation(meta.id);
|
|
182
180
|
const activeView =
|
|
183
181
|
state < 0
|
|
184
182
|
? 'init'
|
|
@@ -225,7 +223,7 @@ const InvitationQR = ({ id, url, onCancel }: { id: string; url: string; onCancel
|
|
|
225
223
|
const emoji = hexToEmoji(id);
|
|
226
224
|
return (
|
|
227
225
|
<>
|
|
228
|
-
<p className='text-description'>{t('qr code description', { ns:
|
|
226
|
+
<p className='text-description'>{t('qr code description', { ns: meta.id })}</p>
|
|
229
227
|
<div role='group' className='grid grid-cols-[1fr_min-content] mlb-2 gap-2'>
|
|
230
228
|
<div role='none' className='is-full aspect-square relative text-description'>
|
|
231
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
|
|
|
@@ -2,12 +2,10 @@
|
|
|
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 { withClientProvider } from '@dxos/react-client/testing';
|
|
10
|
-
import {
|
|
8
|
+
import { withTheme } from '@dxos/react-ui/testing';
|
|
11
9
|
|
|
12
10
|
import { translations } from '../translations';
|
|
13
11
|
|
|
@@ -16,7 +14,7 @@ import { ProfileContainer } from './ProfileContainer';
|
|
|
16
14
|
const meta = {
|
|
17
15
|
title: 'plugins/plugin-client/ProfileContainer',
|
|
18
16
|
component: ProfileContainer,
|
|
19
|
-
decorators: [withClientProvider({ createIdentity: true })
|
|
17
|
+
decorators: [withTheme, withClientProvider({ createIdentity: true })],
|
|
20
18
|
parameters: {
|
|
21
19
|
layout: 'fullscreen',
|
|
22
20
|
translations,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import * as Schema from 'effect/Schema';
|
|
6
6
|
import React, { type ChangeEvent, useCallback, useMemo, useState } from 'react';
|
|
7
7
|
|
|
8
8
|
import { debounce } from '@dxos/async';
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
import { EmojiPickerBlock, HuePicker } from '@dxos/react-ui-pickers';
|
|
21
21
|
import { hexToEmoji, hexToHue } from '@dxos/util';
|
|
22
22
|
|
|
23
|
-
import {
|
|
23
|
+
import { meta } from '../meta';
|
|
24
24
|
|
|
25
25
|
// TODO(thure): Factor out?
|
|
26
26
|
const getDefaultHueValue = (identity: Identity | null) => hexToHue(identity?.identityKey.toHex() ?? '0');
|
|
@@ -29,7 +29,7 @@ const getHueValue = (identity: Identity | null) => identity?.profile?.data?.hue
|
|
|
29
29
|
const getEmojiValue = (identity: Identity | null) => identity?.profile?.data?.emoji || getDefaultEmojiValue(identity);
|
|
30
30
|
|
|
31
31
|
export const ProfileContainer = () => {
|
|
32
|
-
const { t } = useTranslation(
|
|
32
|
+
const { t } = useTranslation(meta.id);
|
|
33
33
|
const client = useClient();
|
|
34
34
|
const identity = useIdentity();
|
|
35
35
|
const [displayName, setDisplayNameDirectly] = useState(identity?.profile?.displayName ?? '');
|
|
@@ -117,12 +117,7 @@ export const ProfileContainer = () => {
|
|
|
117
117
|
);
|
|
118
118
|
return (
|
|
119
119
|
<ControlItem title={label} description={t('hue description')}>
|
|
120
|
-
<HuePicker
|
|
121
|
-
value={getValue()}
|
|
122
|
-
onChange={handleChange}
|
|
123
|
-
onReset={handleHueReset}
|
|
124
|
-
classNames='[--hue-preview-size:1.5rem] justify-self-end'
|
|
125
|
-
/>
|
|
120
|
+
<HuePicker value={getValue()} onChange={handleChange} onReset={handleHueReset} />
|
|
126
121
|
</ControlItem>
|
|
127
122
|
);
|
|
128
123
|
},
|
|
@@ -2,15 +2,13 @@
|
|
|
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
|
import React, { useState } from 'react';
|
|
9
7
|
|
|
10
8
|
import { useClient } from '@dxos/react-client';
|
|
11
9
|
import { withClientProvider } from '@dxos/react-client/testing';
|
|
12
10
|
import { AlertDialog, useAsyncEffect } from '@dxos/react-ui';
|
|
13
|
-
import {
|
|
11
|
+
import { withTheme } from '@dxos/react-ui/testing';
|
|
14
12
|
|
|
15
13
|
import { translations } from '../translations';
|
|
16
14
|
|
|
@@ -37,7 +35,7 @@ const meta = {
|
|
|
37
35
|
title: 'plugins/plugin-client/RecoveryCodeDialog',
|
|
38
36
|
component: RecoveryCodeDialog as any,
|
|
39
37
|
render: DefaultStory,
|
|
40
|
-
decorators: [withClientProvider({ createIdentity: true })
|
|
38
|
+
decorators: [withTheme, withClientProvider({ createIdentity: true })],
|
|
41
39
|
parameters: {
|
|
42
40
|
layout: 'fullscreen',
|
|
43
41
|
translations,
|