@dxos/plugin-client 0.7.5-main.499c70c → 0.7.5-main.5ae2ba8
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-ON64R7SO.mjs +44 -0
- package/dist/lib/browser/app-graph-builder-ON64R7SO.mjs.map +7 -0
- package/dist/lib/browser/{chunk-52IJQ35F.mjs → chunk-7DPLXOMO.mjs} +17 -7
- package/dist/lib/browser/chunk-7DPLXOMO.mjs.map +7 -0
- package/dist/lib/browser/chunk-EYBZZHSM.mjs +271 -0
- package/dist/lib/browser/chunk-EYBZZHSM.mjs.map +7 -0
- package/dist/lib/browser/chunk-GHEQL2E6.mjs +16 -0
- package/dist/lib/browser/chunk-GHEQL2E6.mjs.map +7 -0
- package/dist/lib/browser/{chunk-X4QUPYC6.mjs → chunk-NHIL4T3L.mjs} +3 -3
- package/dist/lib/browser/chunk-NHIL4T3L.mjs.map +7 -0
- package/dist/lib/browser/chunk-RGMLBYIF.mjs +18 -0
- package/dist/lib/browser/chunk-RGMLBYIF.mjs.map +7 -0
- package/dist/lib/browser/client-A7YSVURS.mjs +36 -0
- package/dist/lib/browser/client-A7YSVURS.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +83 -370
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/intent-resolver-SSM6WXAW.mjs +263 -0
- package/dist/lib/browser/intent-resolver-SSM6WXAW.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/react-context-R3SG55F5.mjs +24 -0
- package/dist/lib/browser/react-context-R3SG55F5.mjs.map +7 -0
- package/dist/lib/browser/react-surface-XGOUHVIH.mjs +57 -0
- package/dist/lib/browser/react-surface-XGOUHVIH.mjs.map +7 -0
- package/dist/lib/browser/schema-J4MJIXRP.mjs +23 -0
- package/dist/lib/browser/schema-J4MJIXRP.mjs.map +7 -0
- package/dist/lib/browser/types.mjs +4 -6
- package/dist/lib/node/app-graph-builder-RW7ESEX3.cjs +58 -0
- package/dist/lib/node/app-graph-builder-RW7ESEX3.cjs.map +7 -0
- package/dist/lib/node/chunk-7LVBFGKQ.cjs +299 -0
- package/dist/lib/node/chunk-7LVBFGKQ.cjs.map +7 -0
- package/dist/lib/node/{chunk-RUA5KXVW.cjs → chunk-OIFPM5ZW.cjs} +7 -7
- package/dist/lib/node/chunk-OIFPM5ZW.cjs.map +7 -0
- package/dist/lib/node/{chunk-NFO3ADQC.cjs → chunk-TREVKZCJ.cjs} +21 -12
- package/dist/lib/node/chunk-TREVKZCJ.cjs.map +7 -0
- package/dist/lib/node/{meta.cjs → chunk-UHIGZJQL.cjs} +13 -8
- package/dist/lib/node/chunk-UHIGZJQL.cjs.map +7 -0
- package/dist/lib/node/chunk-XPC4JOPP.cjs +37 -0
- package/dist/lib/node/chunk-XPC4JOPP.cjs.map +7 -0
- package/dist/lib/node/client-2RQATBB6.cjs +50 -0
- package/dist/lib/node/client-2RQATBB6.cjs.map +7 -0
- package/dist/lib/node/index.cjs +80 -359
- package/dist/lib/node/index.cjs.map +4 -4
- package/dist/lib/node/intent-resolver-RIHCW2KJ.cjs +271 -0
- package/dist/lib/node/intent-resolver-RIHCW2KJ.cjs.map +7 -0
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/react-context-TD6VGBVA.cjs +48 -0
- package/dist/lib/node/react-context-TD6VGBVA.cjs.map +7 -0
- package/dist/lib/node/react-surface-IY7GXEGU.cjs +74 -0
- package/dist/lib/node/react-surface-IY7GXEGU.cjs.map +7 -0
- package/dist/lib/node/schema-JXJS75HQ.cjs +39 -0
- package/dist/lib/node/schema-JXJS75HQ.cjs.map +7 -0
- package/dist/lib/node/types.cjs +4 -6
- package/dist/lib/node/types.cjs.map +2 -2
- package/dist/lib/node-esm/app-graph-builder-TDYRWNI7.mjs +45 -0
- package/dist/lib/node-esm/app-graph-builder-TDYRWNI7.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-CRF22MJJ.mjs +272 -0
- package/dist/lib/node-esm/chunk-CRF22MJJ.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-GMGRQ5Q7.mjs → chunk-HO7WDE7C.mjs} +3 -3
- package/dist/lib/node-esm/chunk-HO7WDE7C.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-TI4GNGMM.mjs → chunk-QJMF2MWP.mjs} +17 -7
- package/dist/lib/node-esm/chunk-QJMF2MWP.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-QR72BXJK.mjs +19 -0
- package/dist/lib/node-esm/chunk-QR72BXJK.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-T35SFKK3.mjs +17 -0
- package/dist/lib/node-esm/chunk-T35SFKK3.mjs.map +7 -0
- package/dist/lib/node-esm/client-36DKBSB7.mjs +37 -0
- package/dist/lib/node-esm/client-36DKBSB7.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +83 -370
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/intent-resolver-WWTVE6T6.mjs +264 -0
- package/dist/lib/node-esm/intent-resolver-WWTVE6T6.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/react-context-ZOGDOWJ2.mjs +25 -0
- package/dist/lib/node-esm/react-context-ZOGDOWJ2.mjs.map +7 -0
- package/dist/lib/node-esm/react-surface-F3PDFJMV.mjs +58 -0
- package/dist/lib/node-esm/react-surface-F3PDFJMV.mjs.map +7 -0
- package/dist/lib/node-esm/schema-XM4HBLIX.mjs +24 -0
- package/dist/lib/node-esm/schema-XM4HBLIX.mjs.map +7 -0
- package/dist/lib/node-esm/types.mjs +4 -6
- package/dist/types/src/ClientPlugin.d.ts +2 -3
- package/dist/types/src/ClientPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts +181 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -0
- package/dist/types/src/capabilities/capabilities.d.ts +7 -0
- package/dist/types/src/capabilities/capabilities.d.ts.map +1 -0
- package/dist/types/src/capabilities/client.d.ts +9 -0
- package/dist/types/src/capabilities/client.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +195 -0
- package/dist/types/src/capabilities/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/intent-resolver.d.ts +9 -0
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-context.d.ts +8 -0
- package/dist/types/src/capabilities/react-context.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface.d.ts +7 -0
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
- package/dist/types/src/capabilities/schema.d.ts +4 -0
- package/dist/types/src/capabilities/schema.d.ts.map +1 -0
- package/dist/types/src/components/IdentityDialog.d.ts +1 -2
- package/dist/types/src/components/IdentityDialog.d.ts.map +1 -1
- package/dist/types/src/components/JoinDialog.d.ts +1 -2
- package/dist/types/src/components/JoinDialog.d.ts.map +1 -1
- package/dist/types/src/components/ManageCredentialsDialog.d.ts +3 -0
- package/dist/types/src/components/ManageCredentialsDialog.d.ts.map +1 -0
- package/dist/types/src/components/ManageCredentialsDialog.stories.d.ts +8 -0
- package/dist/types/src/components/ManageCredentialsDialog.stories.d.ts.map +1 -0
- package/dist/types/src/components/RecoveryCodeDialog.d.ts +1 -2
- package/dist/types/src/components/RecoveryCodeDialog.d.ts.map +1 -1
- package/dist/types/src/components/RecoverySetupDialog.d.ts +3 -0
- package/dist/types/src/components/RecoverySetupDialog.d.ts.map +1 -0
- package/dist/types/src/components/RecoverySetupDialog.stories.d.ts +8 -0
- package/dist/types/src/components/RecoverySetupDialog.stories.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +1 -0
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/events.d.ts +7 -0
- package/dist/types/src/events.d.ts.map +1 -0
- 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 +1 -2
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +7 -0
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types.d.ts +22 -18
- package/dist/types/src/types.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +23 -24
- package/src/ClientPlugin.ts +64 -0
- package/src/capabilities/app-graph-builder.ts +39 -0
- package/src/capabilities/capabilities.ts +14 -0
- package/src/capabilities/client.ts +40 -0
- package/src/capabilities/index.ts +14 -0
- package/src/capabilities/intent-resolver.ts +198 -0
- package/src/capabilities/react-context.tsx +20 -0
- package/src/capabilities/react-surface.tsx +59 -0
- package/src/capabilities/schema.ts +26 -0
- package/src/components/IdentityDialog.tsx +15 -3
- package/src/components/JoinDialog.tsx +1 -1
- package/src/components/ManageCredentialsDialog.stories.tsx +57 -0
- package/src/components/ManageCredentialsDialog.tsx +64 -0
- package/src/components/RecoveryCodeDialog.stories.tsx +5 -5
- package/src/components/RecoveryCodeDialog.tsx +2 -1
- package/src/components/RecoverySetupDialog.stories.tsx +77 -0
- package/src/components/RecoverySetupDialog.tsx +52 -0
- package/src/components/index.ts +1 -0
- package/src/events.ts +14 -0
- package/src/index.ts +4 -4
- package/src/meta.ts +1 -1
- package/src/translations.ts +10 -1
- package/src/types.ts +16 -32
- package/dist/lib/browser/chunk-52IJQ35F.mjs.map +0 -7
- package/dist/lib/browser/chunk-X4QUPYC6.mjs.map +0 -7
- package/dist/lib/browser/meta.mjs +0 -9
- package/dist/lib/browser/meta.mjs.map +0 -7
- package/dist/lib/node/chunk-NFO3ADQC.cjs.map +0 -7
- package/dist/lib/node/chunk-RUA5KXVW.cjs.map +0 -7
- package/dist/lib/node/meta.cjs.map +0 -7
- package/dist/lib/node-esm/chunk-GMGRQ5Q7.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-TI4GNGMM.mjs.map +0 -7
- package/dist/lib/node-esm/meta.mjs +0 -10
- package/dist/lib/node-esm/meta.mjs.map +0 -7
- package/src/ClientPlugin.tsx +0 -227
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../../src/translations.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../../src/translations.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAMA,wBAyBE"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type PluginsContext } from '@dxos/app-framework';
|
|
2
2
|
import { S } from '@dxos/echo-schema';
|
|
3
|
-
import { Client, PublicKey, type ClientOptions } from '@dxos/react-client';
|
|
3
|
+
import { type Client, PublicKey, type ClientOptions } from '@dxos/react-client';
|
|
4
|
+
import { type MaybePromise } from '@dxos/util';
|
|
4
5
|
export declare namespace ClientAction {
|
|
5
6
|
const CreateIdentity_base: S.TaggedClass<CreateIdentity, "dxos.org/plugin/client/action/create-identity", {
|
|
6
7
|
readonly _tag: S.tag<"dxos.org/plugin/client/action/create-identity">;
|
|
@@ -24,7 +25,7 @@ export declare namespace ClientAction {
|
|
|
24
25
|
readonly _tag: S.tag<"dxos.org/plugin/client/action/join-identity">;
|
|
25
26
|
} & {
|
|
26
27
|
input: S.Struct<{
|
|
27
|
-
invitationCode: typeof S.String
|
|
28
|
+
invitationCode: S.optional<typeof S.String>;
|
|
28
29
|
}>;
|
|
29
30
|
output: typeof S.Void;
|
|
30
31
|
}>;
|
|
@@ -72,13 +73,25 @@ export declare namespace ClientAction {
|
|
|
72
73
|
}>;
|
|
73
74
|
export class CreateRecoveryCode extends CreateRecoveryCode_base {
|
|
74
75
|
}
|
|
76
|
+
const CreatePasskey_base: S.TaggedClass<CreatePasskey, "dxos.org/plugin/client/action/create-passkey", {
|
|
77
|
+
readonly _tag: S.tag<"dxos.org/plugin/client/action/create-passkey">;
|
|
78
|
+
} & {
|
|
79
|
+
input: typeof S.Void;
|
|
80
|
+
output: typeof S.Void;
|
|
81
|
+
}>;
|
|
82
|
+
export class CreatePasskey extends CreatePasskey_base {
|
|
83
|
+
}
|
|
84
|
+
const RedeemPasskey_base: S.TaggedClass<RedeemPasskey, "dxos.org/plugin/client/action/redeem-passkey", {
|
|
85
|
+
readonly _tag: S.tag<"dxos.org/plugin/client/action/redeem-passkey">;
|
|
86
|
+
} & {
|
|
87
|
+
input: typeof S.Void;
|
|
88
|
+
output: typeof S.Void;
|
|
89
|
+
}>;
|
|
90
|
+
export class RedeemPasskey extends RedeemPasskey_base {
|
|
91
|
+
}
|
|
75
92
|
export {};
|
|
76
93
|
}
|
|
77
94
|
export type ClientPluginOptions = ClientOptions & {
|
|
78
|
-
/**
|
|
79
|
-
* Used to track app-specific state in spaces.
|
|
80
|
-
*/
|
|
81
|
-
appKey: string;
|
|
82
95
|
/**
|
|
83
96
|
* Base URL for the invitation link.
|
|
84
97
|
*/
|
|
@@ -90,21 +103,12 @@ export type ClientPluginOptions = ClientOptions & {
|
|
|
90
103
|
/**
|
|
91
104
|
* Run after the client has been initialized.
|
|
92
105
|
*/
|
|
93
|
-
onClientInitialized?: (client: Client) =>
|
|
94
|
-
/**
|
|
95
|
-
* Run after the identity has been successfully initialized.
|
|
96
|
-
* Run with client during plugin ready phase.
|
|
97
|
-
*/
|
|
98
|
-
onReady?: (client: Client, plugins: Plugin[]) => Promise<void>;
|
|
106
|
+
onClientInitialized?: (context: PluginsContext, client: Client) => MaybePromise<void>;
|
|
99
107
|
/**
|
|
100
108
|
* Called when the client is reset.
|
|
101
109
|
*/
|
|
102
110
|
onReset?: (params: {
|
|
103
111
|
target?: string;
|
|
104
|
-
}) =>
|
|
105
|
-
};
|
|
106
|
-
export type ClientPluginProvides = IntentResolverProvides & GraphBuilderProvides & SurfaceProvides & TranslationsProvides & {
|
|
107
|
-
client: Client;
|
|
112
|
+
}) => MaybePromise<void>;
|
|
108
113
|
};
|
|
109
|
-
export declare const parseClientPlugin: (plugin?: Plugin) => Plugin<ClientPluginProvides> | undefined;
|
|
110
114
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.ts"],"names":[],"mappings":"AAIA,OAAO,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AACtC,OAAO,EAAE,KAAK,MAAM,EAAE,SAAS,EAAE,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAChF,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAkB/C,yBAAiB,YAAY,CAAC;;;;;;;;;;;;;;;;;IAC5B,MAAM,OAAO,cAAe,SAAQ,mBAKlC;KAAG;;;;;;;;;IAEL,MAAM,OAAO,YAAa,SAAQ,iBAKhC;KAAG;;;;;;;IAEL,MAAM,OAAO,aAAc,SAAQ,kBAGjC;KAAG;;;;;;;IAEL,MAAM,OAAO,eAAgB,SAAQ,oBAGnC;KAAG;;;;;;;;;IAEL,MAAM,OAAO,YAAa,SAAQ,iBAKhC;KAAG;;;;;;;IAEL,MAAM,OAAO,WAAY,SAAQ,gBAG/B;KAAG;;;;;;;IAEL,MAAM,OAAO,kBAAmB,SAAQ,uBAGtC;KAAG;;;;;;;IAEL,MAAM,OAAO,aAAc,SAAQ,kBAGjC;KAAG;;;;;;;IAEL,MAAM,OAAO,aAAc,SAAQ,kBAGjC;KAAG;;CACN;AAED,MAAM,MAAM,mBAAmB,GAAG,aAAa,GAAG;IAChD;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;OAEG;IACH,mBAAmB,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,KAAK,YAAY,CAAC,IAAI,CAAC,CAAC;IAEtF;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE;QAAE,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,YAAY,CAAC,IAAI,CAAC,CAAC;CAC/D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"5.7.
|
|
1
|
+
{"version":"5.7.3"}
|
package/package.json
CHANGED
|
@@ -1,23 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-client",
|
|
3
|
-
"version": "0.7.5-main.
|
|
3
|
+
"version": "0.7.5-main.5ae2ba8",
|
|
4
4
|
"description": "DXOS Surface plugin for DXOS Client",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"author": "DXOS.org",
|
|
9
9
|
"sideEffects": true,
|
|
10
|
+
"type": "module",
|
|
10
11
|
"exports": {
|
|
11
12
|
".": {
|
|
12
13
|
"types": "./dist/types/src/index.d.ts",
|
|
13
14
|
"browser": "./dist/lib/browser/index.mjs",
|
|
14
15
|
"node": "./dist/lib/node-esm/index.mjs"
|
|
15
16
|
},
|
|
16
|
-
"./meta": {
|
|
17
|
-
"types": "./dist/types/src/meta.d.ts",
|
|
18
|
-
"browser": "./dist/lib/browser/meta.mjs",
|
|
19
|
-
"node": "./dist/lib/node-esm/meta.mjs"
|
|
20
|
-
},
|
|
21
17
|
"./types": {
|
|
22
18
|
"types": "./dist/types/src/types.d.ts",
|
|
23
19
|
"browser": "./dist/lib/browser/types.mjs",
|
|
@@ -27,9 +23,6 @@
|
|
|
27
23
|
"types": "dist/types/src/index.d.ts",
|
|
28
24
|
"typesVersions": {
|
|
29
25
|
"*": {
|
|
30
|
-
"meta": [
|
|
31
|
-
"dist/types/src/meta.d.ts"
|
|
32
|
-
],
|
|
33
26
|
"types": [
|
|
34
27
|
"dist/types/src/types.d.ts"
|
|
35
28
|
]
|
|
@@ -40,32 +33,38 @@
|
|
|
40
33
|
"src"
|
|
41
34
|
],
|
|
42
35
|
"dependencies": {
|
|
43
|
-
"@
|
|
44
|
-
"@dxos/
|
|
45
|
-
"@dxos/
|
|
46
|
-
"@dxos/echo-signals": "0.7.5-main.
|
|
47
|
-
"@dxos/
|
|
48
|
-
"@dxos/
|
|
49
|
-
"@dxos/
|
|
50
|
-
"@dxos/
|
|
51
|
-
"@dxos/plugin-graph": "0.7.5-main.
|
|
52
|
-
"@dxos/
|
|
53
|
-
"@dxos/
|
|
54
|
-
"@dxos/
|
|
55
|
-
"@dxos/
|
|
36
|
+
"@preact/signals-core": "^1.6.0",
|
|
37
|
+
"@dxos/app-framework": "0.7.5-main.5ae2ba8",
|
|
38
|
+
"@dxos/config": "0.7.5-main.5ae2ba8",
|
|
39
|
+
"@dxos/echo-signals": "0.7.5-main.5ae2ba8",
|
|
40
|
+
"@dxos/local-storage": "0.7.5-main.5ae2ba8",
|
|
41
|
+
"@dxos/echo-schema": "0.7.5-main.5ae2ba8",
|
|
42
|
+
"@dxos/log": "0.7.5-main.5ae2ba8",
|
|
43
|
+
"@dxos/invariant": "0.7.5-main.5ae2ba8",
|
|
44
|
+
"@dxos/plugin-graph": "0.7.5-main.5ae2ba8",
|
|
45
|
+
"@dxos/react-client": "0.7.5-main.5ae2ba8",
|
|
46
|
+
"@dxos/shell": "0.7.5-main.5ae2ba8",
|
|
47
|
+
"@dxos/plugin-observability": "0.7.5-main.5ae2ba8",
|
|
48
|
+
"@dxos/util": "0.7.5-main.5ae2ba8"
|
|
56
49
|
},
|
|
57
50
|
"devDependencies": {
|
|
51
|
+
"@phosphor-icons/react": "^2.1.5",
|
|
58
52
|
"@types/react": "~18.2.0",
|
|
59
53
|
"@types/react-dom": "~18.2.0",
|
|
60
54
|
"react": "~18.2.0",
|
|
61
55
|
"react-dom": "~18.2.0",
|
|
62
56
|
"vite": "5.4.7",
|
|
63
|
-
"@dxos/
|
|
57
|
+
"@dxos/live-object": "0.7.5-main.5ae2ba8",
|
|
58
|
+
"@dxos/react-ui": "0.7.5-main.5ae2ba8",
|
|
59
|
+
"@dxos/storybook-utils": "0.7.5-main.5ae2ba8",
|
|
60
|
+
"@dxos/react-ui-theme": "0.7.5-main.5ae2ba8"
|
|
64
61
|
},
|
|
65
62
|
"peerDependencies": {
|
|
66
63
|
"@phosphor-icons/react": "^2.1.5",
|
|
67
64
|
"react": "~18.2.0",
|
|
68
|
-
"react-dom": "~18.2.0"
|
|
65
|
+
"react-dom": "~18.2.0",
|
|
66
|
+
"@dxos/react-ui-theme": "0.7.5-main.5ae2ba8",
|
|
67
|
+
"@dxos/react-ui": "0.7.5-main.5ae2ba8"
|
|
69
68
|
},
|
|
70
69
|
"publishConfig": {
|
|
71
70
|
"access": "public"
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Capabilities, contributes, defineModule, definePlugin, Events, oneOf } from '@dxos/app-framework';
|
|
6
|
+
|
|
7
|
+
import { Client, AppGraphBuilder, IntentResolver, ReactContext, ReactSurface, Schema } from './capabilities';
|
|
8
|
+
import { ClientEvents } from './events';
|
|
9
|
+
import { meta } from './meta';
|
|
10
|
+
import translations from './translations';
|
|
11
|
+
import { type ClientPluginOptions } from './types';
|
|
12
|
+
|
|
13
|
+
export const ClientPlugin = ({
|
|
14
|
+
invitationUrl = window.location.origin,
|
|
15
|
+
invitationParam = 'deviceInvitationCode',
|
|
16
|
+
onReset,
|
|
17
|
+
...options
|
|
18
|
+
}: ClientPluginOptions) => {
|
|
19
|
+
const createInvitationUrl = (invitationCode: string) => {
|
|
20
|
+
const baseUrl = new URL(invitationUrl);
|
|
21
|
+
baseUrl.searchParams.set(invitationParam, invitationCode);
|
|
22
|
+
return baseUrl.toString();
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
return definePlugin(meta, [
|
|
26
|
+
defineModule({
|
|
27
|
+
id: `${meta.id}/module/client`,
|
|
28
|
+
activatesOn: oneOf(Events.Startup, Events.SetupAppGraph),
|
|
29
|
+
activatesAfter: [ClientEvents.ClientReady],
|
|
30
|
+
activate: (context) => Client({ ...options, context }),
|
|
31
|
+
}),
|
|
32
|
+
defineModule({
|
|
33
|
+
id: `${meta.id}/module/schema`,
|
|
34
|
+
activatesOn: ClientEvents.ClientReady,
|
|
35
|
+
activatesBefore: [ClientEvents.SetupSchema],
|
|
36
|
+
activate: Schema,
|
|
37
|
+
}),
|
|
38
|
+
defineModule({
|
|
39
|
+
id: `${meta.id}/module/react-context`,
|
|
40
|
+
activatesOn: Events.Startup,
|
|
41
|
+
activate: ReactContext,
|
|
42
|
+
}),
|
|
43
|
+
defineModule({
|
|
44
|
+
id: `${meta.id}/module/react-surface`,
|
|
45
|
+
activatesOn: Events.SetupReactSurface,
|
|
46
|
+
activate: () => ReactSurface({ createInvitationUrl }),
|
|
47
|
+
}),
|
|
48
|
+
defineModule({
|
|
49
|
+
id: `${meta.id}/module/app-graph-builder`,
|
|
50
|
+
activatesOn: Events.SetupAppGraph,
|
|
51
|
+
activate: AppGraphBuilder,
|
|
52
|
+
}),
|
|
53
|
+
defineModule({
|
|
54
|
+
id: `${meta.id}/module/intent-resolver`,
|
|
55
|
+
activatesOn: Events.SetupIntentResolver,
|
|
56
|
+
activate: (context) => IntentResolver({ context, onReset }),
|
|
57
|
+
}),
|
|
58
|
+
defineModule({
|
|
59
|
+
id: `${meta.id}/module/translations`,
|
|
60
|
+
activatesOn: Events.SetupTranslations,
|
|
61
|
+
activate: () => contributes(Capabilities.Translations, translations),
|
|
62
|
+
}),
|
|
63
|
+
]);
|
|
64
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { createIntent } from '@dxos/app-framework';
|
|
6
|
+
import { Capabilities, contributes, type PluginsContext } from '@dxos/app-framework';
|
|
7
|
+
import { createExtension, type Node } from '@dxos/plugin-graph';
|
|
8
|
+
|
|
9
|
+
import { CLIENT_PLUGIN } from '../meta';
|
|
10
|
+
import { ClientAction } from '../types';
|
|
11
|
+
|
|
12
|
+
export default (context: PluginsContext) =>
|
|
13
|
+
contributes(
|
|
14
|
+
Capabilities.AppGraphBuilder,
|
|
15
|
+
createExtension({
|
|
16
|
+
id: CLIENT_PLUGIN,
|
|
17
|
+
filter: (node): node is Node<null> => node.id === 'root',
|
|
18
|
+
actions: () => [
|
|
19
|
+
{
|
|
20
|
+
id: `${CLIENT_PLUGIN}/open-shell`,
|
|
21
|
+
data: async () => {
|
|
22
|
+
const { dispatchPromise: dispatch } = context.requestCapability(Capabilities.IntentDispatcher);
|
|
23
|
+
await dispatch(createIntent(ClientAction.ShareIdentity));
|
|
24
|
+
},
|
|
25
|
+
properties: {
|
|
26
|
+
label: ['open shell label', { ns: CLIENT_PLUGIN }],
|
|
27
|
+
icon: 'ph--address-book--regular',
|
|
28
|
+
keyBinding: {
|
|
29
|
+
macos: 'meta+shift+.',
|
|
30
|
+
// TODO(wittjosiah): Test on windows to see if it behaves the same as linux.
|
|
31
|
+
windows: 'alt+shift+.',
|
|
32
|
+
linux: 'alt+shift+>',
|
|
33
|
+
},
|
|
34
|
+
testId: 'clientPlugin.openShell',
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
],
|
|
38
|
+
}),
|
|
39
|
+
);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { defineCapability } from '@dxos/app-framework';
|
|
6
|
+
import { type TypedObject } from '@dxos/echo-schema';
|
|
7
|
+
import { type Client } from '@dxos/react-client';
|
|
8
|
+
|
|
9
|
+
import { CLIENT_PLUGIN } from '../meta';
|
|
10
|
+
|
|
11
|
+
export namespace ClientCapabilities {
|
|
12
|
+
export const Client = defineCapability<Client>(`${CLIENT_PLUGIN}/capability/client`);
|
|
13
|
+
export const Schema = defineCapability<TypedObject[]>(`${CLIENT_PLUGIN}/capability/schema`);
|
|
14
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { contributes, type PluginsContext } from '@dxos/app-framework';
|
|
6
|
+
import { Client } from '@dxos/react-client';
|
|
7
|
+
|
|
8
|
+
import { ClientCapabilities } from './capabilities';
|
|
9
|
+
import { ClientEvents } from '../events';
|
|
10
|
+
import { type ClientPluginOptions } from '../types';
|
|
11
|
+
|
|
12
|
+
type ClientCapabilityOptions = Omit<ClientPluginOptions, 'appKey' | 'invitationUrl' | 'invitationParam' | 'onReset'> & {
|
|
13
|
+
context: PluginsContext;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export default async ({ context, onClientInitialized, ...options }: ClientCapabilityOptions) => {
|
|
17
|
+
const client = new Client(options);
|
|
18
|
+
await client.initialize();
|
|
19
|
+
await onClientInitialized?.(context, client);
|
|
20
|
+
|
|
21
|
+
// TODO(wittjosiah): Remove. This is a hack to get the app to boot with the new identity after a reset.
|
|
22
|
+
client.reloaded.on(() => {
|
|
23
|
+
client.halo.identity.subscribe(async (identity) => {
|
|
24
|
+
if (identity) {
|
|
25
|
+
window.location.href = window.location.origin;
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
const subscription = client.spaces.isReady.subscribe(async (ready) => {
|
|
31
|
+
if (ready) {
|
|
32
|
+
await context.activate(ClientEvents.SpacesReady);
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
return contributes(ClientCapabilities.Client, client, async () => {
|
|
37
|
+
subscription.unsubscribe();
|
|
38
|
+
await client.destroy();
|
|
39
|
+
});
|
|
40
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { lazy } from '@dxos/app-framework';
|
|
6
|
+
|
|
7
|
+
export const AppGraphBuilder = lazy(async () => import('./app-graph-builder'));
|
|
8
|
+
export const Client = lazy(async () => import('./client'));
|
|
9
|
+
export const IntentResolver = lazy(async () => import('./intent-resolver'));
|
|
10
|
+
export const ReactContext = lazy(async () => import('./react-context'));
|
|
11
|
+
export const ReactSurface = lazy(async () => import('./react-surface'));
|
|
12
|
+
export const Schema = lazy(async () => import('./schema'));
|
|
13
|
+
|
|
14
|
+
export * from './capabilities';
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
Capabilities,
|
|
7
|
+
contributes,
|
|
8
|
+
createIntent,
|
|
9
|
+
createResolver,
|
|
10
|
+
LayoutAction,
|
|
11
|
+
type PluginsContext,
|
|
12
|
+
} from '@dxos/app-framework';
|
|
13
|
+
import { invariant } from '@dxos/invariant';
|
|
14
|
+
import { ObservabilityAction } from '@dxos/plugin-observability/types';
|
|
15
|
+
import { PublicKey } from '@dxos/react-client';
|
|
16
|
+
import { type JoinPanelProps } from '@dxos/shell/react';
|
|
17
|
+
|
|
18
|
+
import { ClientCapabilities } from './capabilities';
|
|
19
|
+
import { IDENTITY_DIALOG, JOIN_DIALOG, RECOVER_CODE_DIALOG } from '../components';
|
|
20
|
+
import { ClientEvents } from '../events';
|
|
21
|
+
import { ClientAction, type ClientPluginOptions } from '../types';
|
|
22
|
+
|
|
23
|
+
type IntentResolverOptions = Pick<ClientPluginOptions, 'onReset'> & {
|
|
24
|
+
context: PluginsContext;
|
|
25
|
+
appName?: string;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export default ({ context, appName = 'Composer', onReset }: IntentResolverOptions) =>
|
|
29
|
+
contributes(Capabilities.IntentResolver, [
|
|
30
|
+
createResolver({
|
|
31
|
+
intent: ClientAction.CreateIdentity,
|
|
32
|
+
resolve: async () => {
|
|
33
|
+
const manager = context.requestCapability(Capabilities.PluginManager);
|
|
34
|
+
const client = context.requestCapability(ClientCapabilities.Client);
|
|
35
|
+
const data = await client.halo.createIdentity();
|
|
36
|
+
await manager.activate(ClientEvents.IdentityCreated);
|
|
37
|
+
return { data, intents: [createIntent(ObservabilityAction.SendEvent, { name: 'identity.create' })] };
|
|
38
|
+
},
|
|
39
|
+
}),
|
|
40
|
+
createResolver({
|
|
41
|
+
intent: ClientAction.JoinIdentity,
|
|
42
|
+
resolve: async (data) => {
|
|
43
|
+
return {
|
|
44
|
+
intents: [
|
|
45
|
+
createIntent(LayoutAction.UpdateDialog, {
|
|
46
|
+
part: 'dialog',
|
|
47
|
+
subject: JOIN_DIALOG,
|
|
48
|
+
options: {
|
|
49
|
+
blockAlign: 'start',
|
|
50
|
+
props: {
|
|
51
|
+
initialInvitationCode: data.invitationCode,
|
|
52
|
+
initialDisposition: 'accept-halo-invitation',
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
}),
|
|
56
|
+
],
|
|
57
|
+
};
|
|
58
|
+
},
|
|
59
|
+
}),
|
|
60
|
+
createResolver({
|
|
61
|
+
intent: ClientAction.ShareIdentity,
|
|
62
|
+
resolve: async () => {
|
|
63
|
+
return {
|
|
64
|
+
intents: [
|
|
65
|
+
createIntent(LayoutAction.UpdateDialog, {
|
|
66
|
+
part: 'dialog',
|
|
67
|
+
subject: IDENTITY_DIALOG,
|
|
68
|
+
options: {
|
|
69
|
+
blockAlign: 'start',
|
|
70
|
+
},
|
|
71
|
+
}),
|
|
72
|
+
createIntent(ObservabilityAction.SendEvent, { name: 'identity.share' }),
|
|
73
|
+
],
|
|
74
|
+
};
|
|
75
|
+
},
|
|
76
|
+
}),
|
|
77
|
+
createResolver({
|
|
78
|
+
intent: ClientAction.RecoverIdentity,
|
|
79
|
+
resolve: async () => {
|
|
80
|
+
return {
|
|
81
|
+
intents: [
|
|
82
|
+
createIntent(LayoutAction.UpdateDialog, {
|
|
83
|
+
part: 'dialog',
|
|
84
|
+
subject: JOIN_DIALOG,
|
|
85
|
+
options: {
|
|
86
|
+
blockAlign: 'start',
|
|
87
|
+
props: {
|
|
88
|
+
initialDisposition: 'recover-identity',
|
|
89
|
+
} satisfies Partial<JoinPanelProps>,
|
|
90
|
+
},
|
|
91
|
+
}),
|
|
92
|
+
],
|
|
93
|
+
};
|
|
94
|
+
},
|
|
95
|
+
}),
|
|
96
|
+
createResolver({
|
|
97
|
+
intent: ClientAction.ResetStorage,
|
|
98
|
+
resolve: async (data) => {
|
|
99
|
+
await onReset?.({ target: data.target });
|
|
100
|
+
},
|
|
101
|
+
}),
|
|
102
|
+
createResolver({
|
|
103
|
+
intent: ClientAction.CreateAgent,
|
|
104
|
+
resolve: async () => {
|
|
105
|
+
const client = context.requestCapability(ClientCapabilities.Client);
|
|
106
|
+
invariant(client.services.services.EdgeAgentService, 'Missing EdgeAgentService');
|
|
107
|
+
await client.services.services.EdgeAgentService.createAgent(null as any, { timeout: 10_000 });
|
|
108
|
+
},
|
|
109
|
+
}),
|
|
110
|
+
createResolver({
|
|
111
|
+
intent: ClientAction.CreateRecoveryCode,
|
|
112
|
+
resolve: async () => {
|
|
113
|
+
const client = context.requestCapability(ClientCapabilities.Client);
|
|
114
|
+
invariant(client.services.services.IdentityService, 'IdentityService not available');
|
|
115
|
+
// TODO(wittjosiah): This needs a proper api.
|
|
116
|
+
const { recoveryCode } = await client.services.services.IdentityService.createRecoveryCredential({});
|
|
117
|
+
return {
|
|
118
|
+
intents: [
|
|
119
|
+
createIntent(LayoutAction.UpdateDialog, {
|
|
120
|
+
part: 'dialog',
|
|
121
|
+
subject: RECOVER_CODE_DIALOG,
|
|
122
|
+
options: {
|
|
123
|
+
blockAlign: 'start',
|
|
124
|
+
type: 'alert',
|
|
125
|
+
props: { code: recoveryCode },
|
|
126
|
+
},
|
|
127
|
+
}),
|
|
128
|
+
],
|
|
129
|
+
};
|
|
130
|
+
},
|
|
131
|
+
}),
|
|
132
|
+
createResolver({
|
|
133
|
+
intent: ClientAction.CreatePasskey,
|
|
134
|
+
resolve: async () => {
|
|
135
|
+
const client = context.requestCapability(ClientCapabilities.Client);
|
|
136
|
+
const identity = client.halo.identity.get();
|
|
137
|
+
invariant(identity, 'Identity not available');
|
|
138
|
+
|
|
139
|
+
// TODO(wittjosiah): Consider factoring out passkey creation to the halo api.
|
|
140
|
+
const credential = await navigator.credentials.create({
|
|
141
|
+
publicKey: {
|
|
142
|
+
challenge: new Uint8Array(),
|
|
143
|
+
rp: { id: location.hostname, name: appName },
|
|
144
|
+
user: {
|
|
145
|
+
id: new TextEncoder().encode(identity.did),
|
|
146
|
+
name: identity.did,
|
|
147
|
+
displayName: identity.profile?.displayName ?? '',
|
|
148
|
+
},
|
|
149
|
+
pubKeyCredParams: [
|
|
150
|
+
{ type: 'public-key', alg: -8 }, // Ed25519 (not yet supported across all browsers)
|
|
151
|
+
{ type: 'public-key', alg: -7 }, // ES256
|
|
152
|
+
],
|
|
153
|
+
// https://web.dev/articles/webauthn-discoverable-credentials#resident-key
|
|
154
|
+
authenticatorSelection: {
|
|
155
|
+
residentKey: 'required',
|
|
156
|
+
requireResidentKey: true,
|
|
157
|
+
},
|
|
158
|
+
},
|
|
159
|
+
});
|
|
160
|
+
|
|
161
|
+
invariant(credential, 'Credential not available');
|
|
162
|
+
const recoveryKey = PublicKey.from(new Uint8Array((credential as any).response.getPublicKey()));
|
|
163
|
+
const algorithm = (credential as any).response.getPublicKeyAlgorithm() === -7 ? 'ES256' : 'ED25519';
|
|
164
|
+
|
|
165
|
+
// TODO(wittjosiah): This needs a proper api.
|
|
166
|
+
invariant(client.services.services.IdentityService, 'IdentityService not available');
|
|
167
|
+
await client.services.services.IdentityService.createRecoveryCredential({ recoveryKey, algorithm });
|
|
168
|
+
},
|
|
169
|
+
}),
|
|
170
|
+
createResolver({
|
|
171
|
+
intent: ClientAction.RedeemPasskey,
|
|
172
|
+
resolve: async () => {
|
|
173
|
+
const client = context.requestCapability(ClientCapabilities.Client);
|
|
174
|
+
// TODO(wittjosiah): This needs a proper api.
|
|
175
|
+
invariant(client.services.services.IdentityService, 'IdentityService not available');
|
|
176
|
+
const { deviceKey, controlFeedKey, challenge } =
|
|
177
|
+
await client.services.services.IdentityService.requestRecoveryChallenge();
|
|
178
|
+
const credential = await navigator.credentials.get({
|
|
179
|
+
publicKey: {
|
|
180
|
+
challenge: Buffer.from(challenge, 'base64'),
|
|
181
|
+
rpId: location.hostname,
|
|
182
|
+
userVerification: 'required',
|
|
183
|
+
},
|
|
184
|
+
});
|
|
185
|
+
const identityDid = new TextDecoder().decode((credential as any).response.userHandle);
|
|
186
|
+
await client.services.services.IdentityService.recoverIdentity({
|
|
187
|
+
external: {
|
|
188
|
+
identityDid,
|
|
189
|
+
deviceKey,
|
|
190
|
+
controlFeedKey,
|
|
191
|
+
signature: Buffer.from((credential as any).response.signature),
|
|
192
|
+
clientDataJson: Buffer.from((credential as any).response.clientDataJSON),
|
|
193
|
+
authenticatorData: Buffer.from((credential as any).response.authenticatorData),
|
|
194
|
+
},
|
|
195
|
+
});
|
|
196
|
+
},
|
|
197
|
+
}),
|
|
198
|
+
]);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React from 'react';
|
|
6
|
+
|
|
7
|
+
import { Capabilities, contributes, useCapability } from '@dxos/app-framework';
|
|
8
|
+
import { ClientProvider } from '@dxos/react-client';
|
|
9
|
+
|
|
10
|
+
import { ClientCapabilities } from './capabilities';
|
|
11
|
+
import { CLIENT_PLUGIN } from '../meta';
|
|
12
|
+
|
|
13
|
+
export default () =>
|
|
14
|
+
contributes(Capabilities.ReactContext, {
|
|
15
|
+
id: CLIENT_PLUGIN,
|
|
16
|
+
context: ({ children }) => {
|
|
17
|
+
const client = useCapability(ClientCapabilities.Client);
|
|
18
|
+
return <ClientProvider client={client}>{children}</ClientProvider>;
|
|
19
|
+
},
|
|
20
|
+
});
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React from 'react';
|
|
6
|
+
|
|
7
|
+
import { createSurface, Capabilities, contributes } from '@dxos/app-framework';
|
|
8
|
+
import { type IdentityPanelProps, type JoinPanelProps } from '@dxos/shell/react';
|
|
9
|
+
|
|
10
|
+
import {
|
|
11
|
+
IDENTITY_DIALOG,
|
|
12
|
+
IdentityDialog,
|
|
13
|
+
JOIN_DIALOG,
|
|
14
|
+
JoinDialog,
|
|
15
|
+
RECOVER_CODE_DIALOG,
|
|
16
|
+
RECOVER_SETUP_DIALOG,
|
|
17
|
+
RecoveryCodeDialog,
|
|
18
|
+
RecoverySetupDialog,
|
|
19
|
+
type RecoveryCodeDialogProps,
|
|
20
|
+
} from '../components';
|
|
21
|
+
import { MANAGE_CREDENTIALS_DIALOG, ManageCredentialsDialog } from '../components/ManageCredentialsDialog';
|
|
22
|
+
|
|
23
|
+
type ReactSurfaceOptions = {
|
|
24
|
+
createInvitationUrl: (invitationCode: string) => string;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export default ({ createInvitationUrl }: ReactSurfaceOptions) =>
|
|
28
|
+
contributes(Capabilities.ReactSurface, [
|
|
29
|
+
createSurface({
|
|
30
|
+
id: IDENTITY_DIALOG,
|
|
31
|
+
role: 'dialog',
|
|
32
|
+
filter: (data): data is { props: IdentityPanelProps } => data.component === IDENTITY_DIALOG,
|
|
33
|
+
component: ({ data }) => <IdentityDialog {...data.props} createInvitationUrl={createInvitationUrl} />,
|
|
34
|
+
}),
|
|
35
|
+
createSurface({
|
|
36
|
+
id: JOIN_DIALOG,
|
|
37
|
+
role: 'dialog',
|
|
38
|
+
filter: (data): data is { props: JoinPanelProps } => data.component === JOIN_DIALOG,
|
|
39
|
+
component: ({ data }) => <JoinDialog {...data.props} />,
|
|
40
|
+
}),
|
|
41
|
+
createSurface({
|
|
42
|
+
id: RECOVER_CODE_DIALOG,
|
|
43
|
+
role: 'dialog',
|
|
44
|
+
filter: (data): data is { props: RecoveryCodeDialogProps } => data.component === RECOVER_CODE_DIALOG,
|
|
45
|
+
component: ({ data }) => <RecoveryCodeDialog {...data.props} />,
|
|
46
|
+
}),
|
|
47
|
+
createSurface({
|
|
48
|
+
id: RECOVER_SETUP_DIALOG,
|
|
49
|
+
role: 'dialog',
|
|
50
|
+
filter: (data): data is any => data.component === RECOVER_SETUP_DIALOG,
|
|
51
|
+
component: () => <RecoverySetupDialog />,
|
|
52
|
+
}),
|
|
53
|
+
createSurface({
|
|
54
|
+
id: MANAGE_CREDENTIALS_DIALOG,
|
|
55
|
+
role: 'dialog',
|
|
56
|
+
filter: (data): data is any => data.component === MANAGE_CREDENTIALS_DIALOG,
|
|
57
|
+
component: () => <ManageCredentialsDialog />,
|
|
58
|
+
}),
|
|
59
|
+
]);
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { effect } from '@preact/signals-core';
|
|
6
|
+
|
|
7
|
+
import { Capabilities, contributes, type PluginsContext } from '@dxos/app-framework';
|
|
8
|
+
import { type TypedObject } from '@dxos/echo-schema';
|
|
9
|
+
|
|
10
|
+
import { ClientCapabilities } from './capabilities';
|
|
11
|
+
|
|
12
|
+
export default (context: PluginsContext) => {
|
|
13
|
+
const client = context.requestCapability(ClientCapabilities.Client);
|
|
14
|
+
|
|
15
|
+
// TODO(wittjosiah): Unregister schemas when they are disabled.
|
|
16
|
+
let previous: TypedObject[] = [];
|
|
17
|
+
const unsubscribe = effect(() => {
|
|
18
|
+
const schemas = Array.from(new Set(context.requestCapabilities(ClientCapabilities.Schema).flat()));
|
|
19
|
+
// TODO(wittjosiah): Filter out schemas which the client has already registered.
|
|
20
|
+
const newSchemas = schemas.filter((schema) => !previous.includes(schema));
|
|
21
|
+
previous = schemas;
|
|
22
|
+
client.addTypes(newSchemas);
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
return contributes(Capabilities.Null, null, () => unsubscribe());
|
|
26
|
+
};
|