@dxos/plugin-client 0.9.1-main.c7dcc2e112 → 0.10.0
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/neutral/{AccountContainer-LIMGLO2Y.mjs → AccountContainer-7SF53UON.mjs} +15 -11
- package/dist/lib/neutral/AccountContainer-7SF53UON.mjs.map +7 -0
- package/dist/lib/neutral/ClientPlugin.node.mjs +2 -2
- package/dist/lib/neutral/ClientPlugin.node.mjs.map +3 -3
- package/dist/lib/neutral/{DevicesContainer-X26OGLFK.mjs → DevicesContainer-PRWIN36N.mjs} +25 -16
- package/dist/lib/neutral/DevicesContainer-PRWIN36N.mjs.map +7 -0
- package/dist/lib/neutral/{InvitationsContainer-OBBCJ7CJ.mjs → InvitationsContainer-BI5RAWET.mjs} +42 -31
- package/dist/lib/neutral/InvitationsContainer-BI5RAWET.mjs.map +7 -0
- package/dist/lib/neutral/{ProfileContainer-FGS2MVWA.mjs → ProfileContainer-YEAYOTX5.mjs} +21 -20
- package/dist/lib/neutral/ProfileContainer-YEAYOTX5.mjs.map +7 -0
- package/dist/lib/neutral/{RecoveryCredentialsContainer-SL4LYHBE.mjs → RecoveryCredentialsContainer-6BZ2IWX7.mjs} +22 -13
- package/dist/lib/neutral/RecoveryCredentialsContainer-6BZ2IWX7.mjs.map +7 -0
- package/dist/lib/neutral/UsageContainer-2DWCVVE4.mjs +241 -0
- package/dist/lib/neutral/UsageContainer-2DWCVVE4.mjs.map +7 -0
- package/dist/lib/neutral/account-cache-YVQKLNV2.mjs +16 -0
- package/dist/lib/neutral/account-cache-YVQKLNV2.mjs.map +7 -0
- package/dist/lib/neutral/{app-graph-builder-FTXJNX37.mjs → app-graph-builder-RVXTD6OE.mjs} +3 -3
- package/dist/lib/neutral/app-graph-builder-RVXTD6OE.mjs.map +7 -0
- package/dist/lib/neutral/capabilities/index.mjs +4 -4
- package/dist/lib/neutral/capabilities/node.mjs +3 -3
- package/dist/lib/neutral/chunk-A7WDDIWY.mjs +162 -0
- package/dist/lib/neutral/chunk-A7WDDIWY.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-JEF2FQGB.mjs → chunk-JY35S2CN.mjs} +2 -2
- package/dist/lib/neutral/{chunk-JEF2FQGB.mjs.map → chunk-JY35S2CN.mjs.map} +1 -1
- package/dist/lib/neutral/chunk-ZFABGG2E.mjs +8 -0
- package/dist/lib/neutral/containers/index.mjs +6 -6
- package/dist/lib/neutral/{create-agent-U567RM7Z.mjs → create-agent-6UKJMZS5.mjs} +2 -2
- package/dist/lib/neutral/{create-identity-IKN2FJ5B.mjs → create-identity-ULCRB3YH.mjs} +2 -2
- package/dist/lib/neutral/{create-passkey-JAD3ACY7.mjs → create-passkey-I7VDS3AC.mjs} +2 -2
- package/dist/lib/neutral/{create-recovery-code-JZYXR4BY.mjs → create-recovery-code-DH2B6EGP.mjs} +2 -2
- package/dist/lib/neutral/index.mjs +4 -2
- package/dist/lib/neutral/{layer-specs-VQCJLV33.mjs → layer-specs-YI7BVWKZ.mjs} +6 -8
- package/dist/lib/neutral/layer-specs-YI7BVWKZ.mjs.map +7 -0
- package/dist/lib/neutral/meta.json +1 -1
- package/dist/lib/neutral/{navigation-handler-MPJAVHWY.mjs → navigation-handler-MQ6MZXLX.mjs} +2 -2
- package/dist/lib/neutral/{open-usage-24I7RAFL.mjs → open-usage-OJVTPGOY.mjs} +2 -2
- package/dist/lib/neutral/operations/index.mjs +1 -1
- package/dist/lib/neutral/plugin.mjs +1 -1
- package/dist/lib/neutral/{redeem-passkey-4DR7GPMU.mjs → redeem-passkey-TYP4XLHO.mjs} +2 -2
- package/dist/lib/neutral/{redeem-token-N5MBQG3I.mjs → redeem-token-2J33R3PV.mjs} +2 -2
- package/dist/lib/neutral/{share-identity-YJIFDIPJ.mjs → share-identity-TOROBLWL.mjs} +2 -2
- package/dist/lib/neutral/testing/index.mjs.map +2 -2
- package/dist/lib/neutral/types/index.mjs +3 -1
- package/dist/types/src/capabilities/account-cache.d.ts +1 -31
- package/dist/types/src/capabilities/app-graph-builder.d.ts +1 -2
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/client.d.ts +1 -2
- package/dist/types/src/capabilities/client.d.ts.map +1 -1
- package/dist/types/src/capabilities/hub-http-client.d.ts +1 -2
- package/dist/types/src/capabilities/hub-http-client.d.ts.map +1 -1
- package/dist/types/src/capabilities/layer-specs.d.ts +1 -2
- package/dist/types/src/capabilities/layer-specs.d.ts.map +1 -1
- package/dist/types/src/capabilities/migrations.d.ts +1 -1
- package/dist/types/src/capabilities/navigation-handler/navigation-handler.d.ts +1 -2
- package/dist/types/src/capabilities/navigation-handler/navigation-handler.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-context.d.ts +1 -6
- 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/containers/AccountContainer/AccountContainer.d.ts.map +1 -1
- package/dist/types/src/containers/AccountContainer/AccountContainer.stories.d.ts +14 -0
- package/dist/types/src/containers/AccountContainer/AccountContainer.stories.d.ts.map +1 -0
- package/dist/types/src/containers/DevicesContainer/DevicesContainer.d.ts.map +1 -1
- package/dist/types/src/containers/InvitationsContainer/InvitationsContainer.d.ts.map +1 -1
- package/dist/types/src/containers/InvitationsContainer/InvitationsContainer.stories.d.ts +14 -0
- package/dist/types/src/containers/InvitationsContainer/InvitationsContainer.stories.d.ts.map +1 -0
- package/dist/types/src/containers/ProfileContainer/ProfileContainer.d.ts.map +1 -1
- package/dist/types/src/containers/RecoveryCredentialsContainer/RecoveryCredentialsContainer.d.ts.map +1 -1
- package/dist/types/src/containers/UsageContainer/UsageContainer.d.ts.map +1 -1
- package/dist/types/src/containers/UsageContainer/UsageView.d.ts +16 -7
- package/dist/types/src/containers/UsageContainer/UsageView.d.ts.map +1 -1
- package/dist/types/src/containers/UsageContainer/UsageView.stories.d.ts +2 -0
- package/dist/types/src/containers/UsageContainer/UsageView.stories.d.ts.map +1 -1
- package/dist/types/src/hooks/index.d.ts +2 -0
- package/dist/types/src/hooks/index.d.ts.map +1 -0
- package/dist/types/src/{state/use-hub-http.d.ts → hooks/useHubClient.d.ts} +1 -1
- package/dist/types/src/hooks/useHubClient.d.ts.map +1 -0
- package/dist/types/src/meta.d.ts +4 -0
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/testing/initializeIdentity.d.ts.map +1 -1
- package/dist/types/src/{state → types}/account-cache.d.ts.map +1 -1
- package/dist/types/src/types/index.d.ts +1 -0
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +46 -45
- package/src/capabilities/account-cache.ts +1 -3
- package/src/capabilities/app-graph-builder.ts +80 -79
- package/src/capabilities/layer-specs.ts +4 -6
- package/src/commands/account/login/login.ts +2 -2
- package/src/containers/AccountContainer/AccountContainer.stories.tsx +46 -0
- package/src/containers/AccountContainer/AccountContainer.tsx +66 -62
- package/src/containers/DevicesContainer/DevicesContainer.tsx +69 -54
- package/src/containers/InvitationsContainer/InvitationsContainer.stories.tsx +46 -0
- package/src/containers/InvitationsContainer/InvitationsContainer.tsx +64 -61
- package/src/containers/ProfileContainer/ProfileContainer.tsx +37 -27
- package/src/containers/RecoveryCredentialsContainer/RecoveryCredentialsContainer.tsx +50 -41
- package/src/containers/UsageContainer/UsageContainer.tsx +11 -10
- package/src/containers/UsageContainer/UsageView.stories.tsx +13 -0
- package/src/containers/UsageContainer/UsageView.tsx +182 -150
- package/src/hooks/index.ts +5 -0
- package/src/testing/initializeIdentity.ts +1 -0
- package/src/types/capabilities.ts +1 -1
- package/src/types/index.ts +1 -0
- package/dist/lib/neutral/AccountContainer-LIMGLO2Y.mjs.map +0 -7
- package/dist/lib/neutral/DevicesContainer-X26OGLFK.mjs.map +0 -7
- package/dist/lib/neutral/InvitationsContainer-OBBCJ7CJ.mjs.map +0 -7
- package/dist/lib/neutral/ProfileContainer-FGS2MVWA.mjs.map +0 -7
- package/dist/lib/neutral/RecoveryCredentialsContainer-SL4LYHBE.mjs.map +0 -7
- package/dist/lib/neutral/UsageContainer-HBPMLIK7.mjs +0 -226
- package/dist/lib/neutral/UsageContainer-HBPMLIK7.mjs.map +0 -7
- package/dist/lib/neutral/account-cache-4EKGEUJI.mjs +0 -43
- package/dist/lib/neutral/account-cache-4EKGEUJI.mjs.map +0 -7
- package/dist/lib/neutral/app-graph-builder-FTXJNX37.mjs.map +0 -7
- package/dist/lib/neutral/chunk-54MDDWCV.mjs +0 -8
- package/dist/lib/neutral/chunk-DA3LZQSD.mjs +0 -136
- package/dist/lib/neutral/chunk-DA3LZQSD.mjs.map +0 -7
- package/dist/lib/neutral/layer-specs-VQCJLV33.mjs.map +0 -7
- package/dist/types/src/state/use-hub-http.d.ts.map +0 -1
- /package/dist/lib/neutral/{chunk-54MDDWCV.mjs.map → chunk-ZFABGG2E.mjs.map} +0 -0
- /package/dist/lib/neutral/{create-agent-U567RM7Z.mjs.map → create-agent-6UKJMZS5.mjs.map} +0 -0
- /package/dist/lib/neutral/{create-identity-IKN2FJ5B.mjs.map → create-identity-ULCRB3YH.mjs.map} +0 -0
- /package/dist/lib/neutral/{create-passkey-JAD3ACY7.mjs.map → create-passkey-I7VDS3AC.mjs.map} +0 -0
- /package/dist/lib/neutral/{create-recovery-code-JZYXR4BY.mjs.map → create-recovery-code-DH2B6EGP.mjs.map} +0 -0
- /package/dist/lib/neutral/{navigation-handler-MPJAVHWY.mjs.map → navigation-handler-MQ6MZXLX.mjs.map} +0 -0
- /package/dist/lib/neutral/{open-usage-24I7RAFL.mjs.map → open-usage-OJVTPGOY.mjs.map} +0 -0
- /package/dist/lib/neutral/{redeem-passkey-4DR7GPMU.mjs.map → redeem-passkey-TYP4XLHO.mjs.map} +0 -0
- /package/dist/lib/neutral/{redeem-token-N5MBQG3I.mjs.map → redeem-token-2J33R3PV.mjs.map} +0 -0
- /package/dist/lib/neutral/{share-identity-YJIFDIPJ.mjs.map → share-identity-TOROBLWL.mjs.map} +0 -0
- /package/dist/types/src/{state → types}/account-cache.d.ts +0 -0
- /package/src/{state/use-hub-http.ts → hooks/useHubClient.ts} +0 -0
- /package/src/{state → types}/account-cache.ts +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-client",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "DXOS Surface plugin for DXOS Client",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -104,62 +104,63 @@
|
|
|
104
104
|
],
|
|
105
105
|
"dependencies": {
|
|
106
106
|
"@effect/cli": "0.75.2",
|
|
107
|
-
"@effect/platform": "0.96.
|
|
108
|
-
"effect": "3.21.
|
|
107
|
+
"@effect/platform": "0.96.2",
|
|
108
|
+
"effect": "3.21.4",
|
|
109
109
|
"react-qr-rounded": "^1.0.0",
|
|
110
110
|
"yaml": "^2.8.2",
|
|
111
|
-
"@dxos/
|
|
112
|
-
"@dxos/
|
|
113
|
-
"@dxos/cli-util": "0.
|
|
114
|
-
"@dxos/client
|
|
115
|
-
"@dxos/
|
|
116
|
-
"@dxos/
|
|
117
|
-
"@dxos/compute": "0.
|
|
118
|
-
"@dxos/
|
|
119
|
-
"@dxos/credentials": "0.
|
|
120
|
-
"@dxos/
|
|
121
|
-
"@dxos/echo": "0.
|
|
122
|
-
"@dxos/
|
|
123
|
-
"@dxos/
|
|
124
|
-
"@dxos/
|
|
125
|
-
"@dxos/echo-
|
|
126
|
-
"@dxos/
|
|
127
|
-
"@dxos/
|
|
128
|
-
"@dxos/
|
|
129
|
-
"@dxos/
|
|
130
|
-
"@dxos/
|
|
131
|
-
"@dxos/plugin-
|
|
132
|
-
"@dxos/protocols": "0.
|
|
133
|
-
"@dxos/
|
|
134
|
-
"@dxos/react-
|
|
135
|
-
"@dxos/
|
|
136
|
-
"@dxos/react-ui-
|
|
137
|
-
"@dxos/
|
|
138
|
-
"@dxos/
|
|
139
|
-
"@dxos/
|
|
111
|
+
"@dxos/app-framework": "0.10.0",
|
|
112
|
+
"@dxos/app-toolkit": "0.10.0",
|
|
113
|
+
"@dxos/cli-util": "0.10.0",
|
|
114
|
+
"@dxos/client": "0.10.0",
|
|
115
|
+
"@dxos/client-protocol": "0.10.0",
|
|
116
|
+
"@dxos/context": "0.10.0",
|
|
117
|
+
"@dxos/compute": "0.10.0",
|
|
118
|
+
"@dxos/config": "0.10.0",
|
|
119
|
+
"@dxos/credentials": "0.10.0",
|
|
120
|
+
"@dxos/echo-client": "0.10.0",
|
|
121
|
+
"@dxos/echo": "0.10.0",
|
|
122
|
+
"@dxos/edge-client": "0.10.0",
|
|
123
|
+
"@dxos/effect": "0.10.0",
|
|
124
|
+
"@dxos/functions": "0.10.0",
|
|
125
|
+
"@dxos/echo-protocol": "0.10.0",
|
|
126
|
+
"@dxos/invariant": "0.10.0",
|
|
127
|
+
"@dxos/client-services": "0.10.0",
|
|
128
|
+
"@dxos/keys": "0.10.0",
|
|
129
|
+
"@dxos/log": "0.10.0",
|
|
130
|
+
"@dxos/plugin-graph": "0.10.0",
|
|
131
|
+
"@dxos/plugin-observability": "0.10.0",
|
|
132
|
+
"@dxos/protocols": "0.10.0",
|
|
133
|
+
"@dxos/react-client": "0.10.0",
|
|
134
|
+
"@dxos/react-ui-form": "0.10.0",
|
|
135
|
+
"@dxos/async": "0.10.0",
|
|
136
|
+
"@dxos/react-ui-list": "0.10.0",
|
|
137
|
+
"@dxos/react-ui-pickers": "0.10.0",
|
|
138
|
+
"@dxos/react-ui-syntax-highlighter": "0.10.0",
|
|
139
|
+
"@dxos/util": "0.10.0",
|
|
140
|
+
"@dxos/shell": "0.10.0"
|
|
140
141
|
},
|
|
141
142
|
"devDependencies": {
|
|
142
143
|
"@effect-atom/atom-react": "^0.5.0",
|
|
143
144
|
"@effect/printer": "0.49.0",
|
|
144
145
|
"@effect/printer-ansi": "0.49.0",
|
|
145
|
-
"@types/react": "~19.2.
|
|
146
|
+
"@types/react": "~19.2.17",
|
|
146
147
|
"@types/react-dom": "~19.2.3",
|
|
147
|
-
"react": "~19.2.
|
|
148
|
-
"react-dom": "~19.2.
|
|
148
|
+
"react": "~19.2.7",
|
|
149
|
+
"react-dom": "~19.2.7",
|
|
149
150
|
"vite": "^8.0.16",
|
|
150
|
-
"@dxos/
|
|
151
|
-
"@dxos/
|
|
152
|
-
"@dxos/storybook-utils": "0.
|
|
153
|
-
"@dxos/
|
|
151
|
+
"@dxos/react-ui": "0.10.0",
|
|
152
|
+
"@dxos/plugin-testing": "0.10.0",
|
|
153
|
+
"@dxos/storybook-utils": "0.10.0",
|
|
154
|
+
"@dxos/ui-theme": "0.10.0"
|
|
154
155
|
},
|
|
155
156
|
"peerDependencies": {
|
|
156
157
|
"@effect-atom/atom-react": "^0.5.0",
|
|
157
|
-
"@effect/platform": "0.96.
|
|
158
|
-
"effect": "3.21.
|
|
159
|
-
"react": "~19.2.
|
|
160
|
-
"react-dom": "~19.2.
|
|
161
|
-
"@dxos/
|
|
162
|
-
"@dxos/ui
|
|
158
|
+
"@effect/platform": "0.96.2",
|
|
159
|
+
"effect": "3.21.4",
|
|
160
|
+
"react": "~19.2.7",
|
|
161
|
+
"react-dom": "~19.2.7",
|
|
162
|
+
"@dxos/ui-theme": "0.10.0",
|
|
163
|
+
"@dxos/react-ui": "0.10.0"
|
|
163
164
|
},
|
|
164
165
|
"publishConfig": {
|
|
165
166
|
"access": "public"
|
|
@@ -7,9 +7,7 @@ import * as Effect from 'effect/Effect';
|
|
|
7
7
|
import { Capability } from '@dxos/app-framework';
|
|
8
8
|
import { createKvsStore } from '@dxos/effect';
|
|
9
9
|
|
|
10
|
-
import { ClientCapabilities } from '#types';
|
|
11
|
-
|
|
12
|
-
import { AccountCache } from '../state/account-cache';
|
|
10
|
+
import { AccountCache, ClientCapabilities } from '#types';
|
|
13
11
|
|
|
14
12
|
export default Capability.makeModule(() =>
|
|
15
13
|
Effect.succeed(
|
|
@@ -37,86 +37,87 @@ export default Capability.makeModule(
|
|
|
37
37
|
},
|
|
38
38
|
},
|
|
39
39
|
]),
|
|
40
|
-
connector:
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
40
|
+
connector: (node, get) =>
|
|
41
|
+
Effect.gen(function* () {
|
|
42
|
+
const client = yield* Capability.get(ClientCapabilities.Client);
|
|
43
|
+
const identity = get(CreateAtom.fromObservable(client.halo.identity));
|
|
44
|
+
const status = get(CreateAtom.fromObservable(client.mesh.networkStatus));
|
|
44
45
|
|
|
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
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
46
|
+
return [
|
|
47
|
+
Node.make({
|
|
48
|
+
id: Account.id,
|
|
49
|
+
type: meta.profile.key,
|
|
50
|
+
properties: {
|
|
51
|
+
label: ['account.label', { ns: meta.profile.key }],
|
|
52
|
+
icon: 'ph--user--regular',
|
|
53
|
+
disposition: 'user-account',
|
|
54
|
+
testId: 'clientPlugin.account',
|
|
55
|
+
// NOTE: This currently needs to be the identity key because the fallback is generated from hex.
|
|
56
|
+
userId: identity?.identityKey.toHex(),
|
|
57
|
+
hue: identity?.profile?.data?.hue,
|
|
58
|
+
emoji: identity?.profile?.data?.emoji,
|
|
59
|
+
status: status.swarm === ConnectionState.OFFLINE ? 'error' : 'active',
|
|
60
|
+
},
|
|
61
|
+
nodes: [
|
|
62
|
+
Node.make({
|
|
63
|
+
id: Account.Profile,
|
|
64
|
+
data: Account.Profile,
|
|
65
|
+
type: meta.profile.key,
|
|
66
|
+
properties: {
|
|
67
|
+
label: ['profile.label', { ns: meta.profile.key }],
|
|
68
|
+
icon: 'ph--user--regular',
|
|
69
|
+
},
|
|
70
|
+
}),
|
|
71
|
+
Node.make({
|
|
72
|
+
id: Account.Account,
|
|
73
|
+
data: Account.Account,
|
|
74
|
+
type: meta.profile.key,
|
|
75
|
+
properties: {
|
|
76
|
+
label: ['account-panel.label', { ns: meta.profile.key }],
|
|
77
|
+
icon: 'ph--identification-card--regular',
|
|
78
|
+
},
|
|
79
|
+
}),
|
|
80
|
+
Node.make({
|
|
81
|
+
id: Account.Devices,
|
|
82
|
+
data: Account.Devices,
|
|
83
|
+
type: meta.profile.key,
|
|
84
|
+
properties: {
|
|
85
|
+
label: ['devices.label', { ns: meta.profile.key }],
|
|
86
|
+
icon: 'ph--devices--regular',
|
|
87
|
+
testId: 'clientPlugin.devices',
|
|
88
|
+
},
|
|
89
|
+
}),
|
|
90
|
+
Node.make({
|
|
91
|
+
id: Account.Security,
|
|
92
|
+
data: Account.Security,
|
|
93
|
+
type: meta.profile.key,
|
|
94
|
+
properties: {
|
|
95
|
+
label: ['security.label', { ns: meta.profile.key }],
|
|
96
|
+
icon: 'ph--key--regular',
|
|
97
|
+
},
|
|
98
|
+
}),
|
|
99
|
+
Node.make({
|
|
100
|
+
id: Account.Invitations,
|
|
101
|
+
data: Account.Invitations,
|
|
102
|
+
type: meta.profile.key,
|
|
103
|
+
properties: {
|
|
104
|
+
label: ['invitations-panel.label', { ns: meta.profile.key }],
|
|
105
|
+
icon: 'ph--ticket--regular',
|
|
106
|
+
},
|
|
107
|
+
}),
|
|
108
|
+
Node.make({
|
|
109
|
+
id: Account.Usage,
|
|
110
|
+
data: Account.Usage,
|
|
111
|
+
type: meta.profile.key,
|
|
112
|
+
properties: {
|
|
113
|
+
label: ['usage-panel.label', { ns: meta.profile.key }],
|
|
114
|
+
icon: 'ph--chart-bar--regular',
|
|
115
|
+
},
|
|
116
|
+
}),
|
|
117
|
+
],
|
|
118
|
+
}),
|
|
119
|
+
];
|
|
120
|
+
}).pipe(Effect.orDie),
|
|
120
121
|
});
|
|
121
122
|
|
|
122
123
|
return Capability.contributes(AppCapabilities.AppGraphBuilder, extensions);
|
|
@@ -8,8 +8,7 @@ import * as Layer from 'effect/Layer';
|
|
|
8
8
|
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
9
9
|
import { ClientService } from '@dxos/client';
|
|
10
10
|
import { Credential, LayerSpec } from '@dxos/compute';
|
|
11
|
-
import { Database
|
|
12
|
-
import { createFeedServiceLayer } from '@dxos/echo-client';
|
|
11
|
+
import { Database } from '@dxos/echo';
|
|
13
12
|
import { credentialsLayerFromDatabase } from '@dxos/functions';
|
|
14
13
|
import { invariant } from '@dxos/invariant';
|
|
15
14
|
|
|
@@ -20,8 +19,7 @@ import { ClientCapabilities } from '#types';
|
|
|
20
19
|
//
|
|
21
20
|
// Contributes the core client/space service layer specs:
|
|
22
21
|
// - {@link ClientService} (application affinity).
|
|
23
|
-
// - {@link Database.Service}, {@link
|
|
24
|
-
// {@link Credential.CredentialsService} (space affinity).
|
|
22
|
+
// - {@link Database.Service}, {@link Credential.CredentialsService} (space affinity).
|
|
25
23
|
//
|
|
26
24
|
// Specs are declared at module level and resolve the underlying
|
|
27
25
|
// {@link ClientCapabilities.Client} through the Effect layer graph (via
|
|
@@ -59,7 +57,7 @@ const DatabaseLayerSpec = LayerSpec.make(
|
|
|
59
57
|
{
|
|
60
58
|
affinity: 'space',
|
|
61
59
|
requires: [ClientService],
|
|
62
|
-
provides: [Database.Service
|
|
60
|
+
provides: [Database.Service],
|
|
63
61
|
},
|
|
64
62
|
(context) =>
|
|
65
63
|
Layer.unwrapEffect(
|
|
@@ -69,7 +67,7 @@ const DatabaseLayerSpec = LayerSpec.make(
|
|
|
69
67
|
const space = client.spaces.get(context.space);
|
|
70
68
|
invariant(space, `space not found on client: ${context.space}`);
|
|
71
69
|
yield* Effect.promise(() => space.waitUntilReady());
|
|
72
|
-
return
|
|
70
|
+
return Database.layer(space.db);
|
|
73
71
|
}),
|
|
74
72
|
),
|
|
75
73
|
);
|
|
@@ -33,8 +33,8 @@ const METHOD_CHOICES = [
|
|
|
33
33
|
];
|
|
34
34
|
|
|
35
35
|
const INPUT_PROMPT: Record<LoginMethod, string> = {
|
|
36
|
-
email: 'Email address',
|
|
37
|
-
atproto: 'atproto handle or DID (e.g. alice.bsky.social)',
|
|
36
|
+
'email': 'Email address',
|
|
37
|
+
'atproto': 'atproto handle or DID (e.g. alice.bsky.social)',
|
|
38
38
|
'device-invitation': 'Invitation code or URL',
|
|
39
39
|
'recovery-code': 'Recovery code (seed phrase)',
|
|
40
40
|
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
6
|
+
import * as Effect from 'effect/Effect';
|
|
7
|
+
|
|
8
|
+
import { ProcessManagerPlugin } from '@dxos/app-framework';
|
|
9
|
+
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
10
|
+
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
11
|
+
|
|
12
|
+
import { initializeIdentity } from '#testing';
|
|
13
|
+
import { translations } from '#translations';
|
|
14
|
+
|
|
15
|
+
import { ClientPlugin } from '../../ClientPlugin';
|
|
16
|
+
import { AccountContainer } from './AccountContainer';
|
|
17
|
+
|
|
18
|
+
const meta = {
|
|
19
|
+
title: 'plugins/plugin-client/containers/AccountContainer',
|
|
20
|
+
component: AccountContainer,
|
|
21
|
+
decorators: [
|
|
22
|
+
withTheme(),
|
|
23
|
+
withLayout({ layout: 'fullscreen' }),
|
|
24
|
+
withPluginManager({
|
|
25
|
+
plugins: [
|
|
26
|
+
ClientPlugin({
|
|
27
|
+
onClientInitialized: ({ client }) =>
|
|
28
|
+
Effect.gen(function* () {
|
|
29
|
+
yield* initializeIdentity(client);
|
|
30
|
+
}),
|
|
31
|
+
}),
|
|
32
|
+
ProcessManagerPlugin(),
|
|
33
|
+
],
|
|
34
|
+
}),
|
|
35
|
+
],
|
|
36
|
+
parameters: {
|
|
37
|
+
layout: 'fullscreen',
|
|
38
|
+
translations,
|
|
39
|
+
},
|
|
40
|
+
} satisfies Meta<typeof AccountContainer>;
|
|
41
|
+
|
|
42
|
+
export default meta;
|
|
43
|
+
|
|
44
|
+
type Story = StoryObj<typeof meta>;
|
|
45
|
+
|
|
46
|
+
export const Default: Story = {};
|
|
@@ -11,13 +11,13 @@ import { Context } from '@dxos/context';
|
|
|
11
11
|
import { createDidFromIdentityKey } from '@dxos/credentials';
|
|
12
12
|
import { useIdentity } from '@dxos/react-client/halo';
|
|
13
13
|
import { Button, Icon, IconButton, Input, Message, useAsyncEffect, useTranslation } from '@dxos/react-ui';
|
|
14
|
-
import {
|
|
14
|
+
import { Form } from '@dxos/react-ui-form';
|
|
15
15
|
|
|
16
16
|
import { meta } from '#meta';
|
|
17
17
|
import { ClientCapabilities } from '#types';
|
|
18
18
|
|
|
19
19
|
import { RESET_DIALOG } from '../../constants';
|
|
20
|
-
import { useHubHttpClient } from '../../
|
|
20
|
+
import { useHubHttpClient } from '../../hooks';
|
|
21
21
|
|
|
22
22
|
type AccountState = 'loading' | 'present' | 'missing' | 'error';
|
|
23
23
|
|
|
@@ -114,66 +114,70 @@ export const AccountContainer = () => {
|
|
|
114
114
|
const account = cache.account;
|
|
115
115
|
|
|
116
116
|
return (
|
|
117
|
-
<
|
|
118
|
-
<
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
<
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
<
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
117
|
+
<Form.Root variant='settings'>
|
|
118
|
+
<Form.Viewport scroll>
|
|
119
|
+
<Form.Content>
|
|
120
|
+
<Form.Section title={t('account-section.title')} description={t('account-section.description')}>
|
|
121
|
+
{accountState === 'loading' ? null : accountState === 'missing' ? (
|
|
122
|
+
<>
|
|
123
|
+
<Message.Root valence='warning'>
|
|
124
|
+
<Message.Title icon='ph--warning--duotone'>{t('no-edge-access.title')}</Message.Title>
|
|
125
|
+
<Message.Content>{t('no-edge-access.description')}</Message.Content>
|
|
126
|
+
</Message.Root>
|
|
127
|
+
<Form.Row label={t('request-access.label')} description={t('request-access.description')}>
|
|
128
|
+
{requestSubmitted ? (
|
|
129
|
+
<span className='text-sm text-description'>{t('access-request-submitted.message')}</span>
|
|
130
|
+
) : (
|
|
131
|
+
<form onSubmit={handleRequestAccess} className='flex gap-2 items-center justify-end'>
|
|
132
|
+
<Input.Root>
|
|
133
|
+
<Input.TextInput
|
|
134
|
+
type='email'
|
|
135
|
+
required
|
|
136
|
+
placeholder={t('access-request-email.placeholder')}
|
|
137
|
+
value={requestEmail}
|
|
138
|
+
onChange={(event) => setRequestEmail(event.target.value)}
|
|
139
|
+
classNames='min-w-64'
|
|
140
|
+
/>
|
|
141
|
+
</Input.Root>
|
|
142
|
+
<Button type='submit' density='sm'>
|
|
143
|
+
{t('request-access.label')}
|
|
144
|
+
</Button>
|
|
145
|
+
</form>
|
|
146
|
+
)}
|
|
147
|
+
</Form.Row>
|
|
148
|
+
</>
|
|
149
|
+
) : accountState === 'error' && !account ? (
|
|
150
|
+
<Message.Root valence='error'>
|
|
151
|
+
<Message.Title icon='ph--cloud-x--duotone'>{t('account-offline.title')}</Message.Title>
|
|
152
|
+
<Message.Content>{t('account-offline.description')}</Message.Content>
|
|
153
|
+
</Message.Root>
|
|
154
|
+
) : account ? (
|
|
155
|
+
<>
|
|
156
|
+
<Form.Row label={t('email.label')} description={account.email}>
|
|
157
|
+
{account.emailVerified ? (
|
|
158
|
+
<Icon icon='ph--check-circle--duotone' size={5} classNames='text-success-text justify-self-end' />
|
|
159
|
+
) : (
|
|
160
|
+
<div className='flex flex-col gap-1 items-end'>
|
|
161
|
+
<IconButton
|
|
162
|
+
icon='ph--paper-plane-tilt--regular'
|
|
163
|
+
label={t('resend-verification.label')}
|
|
164
|
+
onClick={handleResend}
|
|
165
|
+
density='sm'
|
|
166
|
+
/>
|
|
167
|
+
{resendStatus ? <span className='text-xs text-description'>{resendStatus}</span> : null}
|
|
168
|
+
</div>
|
|
169
|
+
)}
|
|
170
|
+
</Form.Row>
|
|
171
|
+
<Form.Row label={t('delete-account.label')} description={t('delete-account.description')}>
|
|
172
|
+
<Button variant='destructive' density='sm' onClick={handleDeleteAccount}>
|
|
173
|
+
{t('delete-account.label')}
|
|
142
174
|
</Button>
|
|
143
|
-
</
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
<Message.Content>{t('account-offline.description')}</Message.Content>
|
|
151
|
-
</Message.Root>
|
|
152
|
-
) : account ? (
|
|
153
|
-
<>
|
|
154
|
-
<Settings.Item title={t('email.label')} description={account.email}>
|
|
155
|
-
{account.emailVerified ? (
|
|
156
|
-
<Icon icon='ph--check-circle--duotone' size={5} classNames='text-success-text justify-self-end' />
|
|
157
|
-
) : (
|
|
158
|
-
<div className='flex flex-col gap-1 items-end'>
|
|
159
|
-
<IconButton
|
|
160
|
-
icon='ph--paper-plane-tilt--regular'
|
|
161
|
-
label={t('resend-verification.label')}
|
|
162
|
-
onClick={handleResend}
|
|
163
|
-
density='sm'
|
|
164
|
-
/>
|
|
165
|
-
{resendStatus ? <span className='text-xs text-description'>{resendStatus}</span> : null}
|
|
166
|
-
</div>
|
|
167
|
-
)}
|
|
168
|
-
</Settings.Item>
|
|
169
|
-
<Settings.Item title={t('delete-account.label')} description={t('delete-account.description')}>
|
|
170
|
-
<Button variant='destructive' density='sm' onClick={handleDeleteAccount}>
|
|
171
|
-
{t('delete-account.label')}
|
|
172
|
-
</Button>
|
|
173
|
-
</Settings.Item>
|
|
174
|
-
</>
|
|
175
|
-
) : null}
|
|
176
|
-
</Settings.Section>
|
|
177
|
-
</Settings.Viewport>
|
|
175
|
+
</Form.Row>
|
|
176
|
+
</>
|
|
177
|
+
) : null}
|
|
178
|
+
</Form.Section>
|
|
179
|
+
</Form.Content>
|
|
180
|
+
</Form.Viewport>
|
|
181
|
+
</Form.Root>
|
|
178
182
|
);
|
|
179
183
|
};
|