@dxos/plugin-client 0.8.4-main.21d9917 → 0.8.4-main.2244d791bb
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-3FGBMLTF.mjs → app-graph-builder-DTETNB5U.mjs} +4 -3
- package/dist/lib/browser/app-graph-builder-DTETNB5U.mjs.map +7 -0
- package/dist/lib/browser/{chunk-F7H2Y3Z2.mjs → chunk-MY6BJCB6.mjs} +4 -4
- package/dist/lib/browser/cli/index.mjs +22 -21
- package/dist/lib/browser/cli/index.mjs.map +3 -3
- package/dist/lib/browser/{client-IX5LMWV4.mjs → client-XOQQ5POJ.mjs} +3 -3
- package/dist/lib/browser/client-XOQQ5POJ.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +20 -19
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{migrations-3EBTAW3N.mjs → migrations-YNQ7L5GT.mjs} +4 -4
- package/dist/lib/browser/migrations-YNQ7L5GT.mjs.map +7 -0
- package/dist/lib/browser/{operation-resolver-2NT3ISVP.mjs → operation-resolver-N4YCJ4KS.mjs} +18 -17
- package/dist/lib/browser/operation-resolver-N4YCJ4KS.mjs.map +7 -0
- package/dist/lib/browser/{react-context-4UABG3GP.mjs → react-context-FDXHIBZL.mjs} +4 -4
- package/dist/lib/browser/react-context-FDXHIBZL.mjs.map +7 -0
- package/dist/lib/browser/{react-surface-RSQ74XCT.mjs → react-surface-ZP3FLVRS.mjs} +50 -49
- package/dist/lib/browser/react-surface-ZP3FLVRS.mjs.map +7 -0
- package/dist/lib/browser/{schema-defs-O7VLP745.mjs → schema-defs-AYXOYD2M.mjs} +6 -5
- package/dist/lib/browser/schema-defs-AYXOYD2M.mjs.map +7 -0
- package/dist/lib/node-esm/{app-graph-builder-2PIYVUNC.mjs → app-graph-builder-PFKVFRXI.mjs} +4 -3
- package/dist/lib/node-esm/app-graph-builder-PFKVFRXI.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-BCELGXRI.mjs → chunk-MUOMX53G.mjs} +4 -4
- package/dist/lib/node-esm/cli/index.mjs +22 -21
- package/dist/lib/node-esm/cli/index.mjs.map +3 -3
- package/dist/lib/node-esm/{client-FFPK5UFP.mjs → client-3YIMWKR7.mjs} +3 -3
- package/dist/lib/node-esm/client-3YIMWKR7.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +20 -19
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{migrations-WSZSFGDK.mjs → migrations-ZH5GNG4U.mjs} +4 -4
- package/dist/lib/node-esm/migrations-ZH5GNG4U.mjs.map +7 -0
- package/dist/lib/node-esm/{operation-resolver-VW5R2BE4.mjs → operation-resolver-CHGWI5P2.mjs} +18 -17
- package/dist/lib/node-esm/operation-resolver-CHGWI5P2.mjs.map +7 -0
- package/dist/lib/node-esm/{react-context-UVXMGPW4.mjs → react-context-7Z2TVUTV.mjs} +4 -4
- package/dist/lib/node-esm/react-context-7Z2TVUTV.mjs.map +7 -0
- package/dist/lib/node-esm/{react-surface-KBHANGGC.mjs → react-surface-BHJMHIMH.mjs} +50 -49
- package/dist/lib/node-esm/react-surface-BHJMHIMH.mjs.map +7 -0
- package/dist/lib/node-esm/{schema-defs-QLRGBIKY.mjs → schema-defs-TV2SCKSH.mjs} +6 -5
- package/dist/lib/node-esm/schema-defs-TV2SCKSH.mjs.map +7 -0
- package/dist/types/src/ClientPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/client/client.d.ts.map +1 -1
- package/dist/types/src/capabilities/client/index.d.ts +1 -0
- package/dist/types/src/capabilities/client/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/migrations/migrations.d.ts.map +1 -1
- package/dist/types/src/capabilities/operation-resolver/index.d.ts +1 -1
- package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +2 -2
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-context/react-context.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface/index.d.ts +1 -1
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts +2 -2
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/schema-defs/schema-defs.d.ts.map +1 -1
- package/dist/types/src/cli/commands/halo/create/create.d.ts.map +1 -1
- package/dist/types/src/cli/plugin.d.ts.map +1 -1
- package/dist/types/src/components/DevicesContainer.d.ts.map +1 -1
- package/dist/types/src/components/DevicesContainer.stories.d.ts +1 -1
- package/dist/types/src/components/DevicesContainer.stories.d.ts.map +1 -1
- package/dist/types/src/components/ProfileContainer.d.ts.map +1 -1
- package/dist/types/src/components/ResetDialog.d.ts.map +1 -1
- package/dist/types/src/components/ResetDialog.stories.d.ts +1 -1
- package/dist/types/src/components/ResetDialog.stories.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +35 -34
- package/src/ClientPlugin.ts +9 -8
- package/src/capabilities/app-graph-builder/app-graph-builder.ts +3 -2
- package/src/capabilities/client/client.ts +2 -2
- package/src/capabilities/migrations/migrations.ts +3 -3
- package/src/capabilities/operation-resolver/operation-resolver.ts +10 -9
- package/src/capabilities/react-context/react-context.tsx +3 -3
- package/src/capabilities/react-surface/react-surface.tsx +9 -8
- package/src/capabilities/schema-defs/schema-defs.ts +5 -4
- package/src/cli/commands/halo/create/create.ts +2 -2
- package/src/cli/plugin.ts +7 -6
- package/src/components/DevicesContainer.stories.tsx +3 -2
- package/src/components/DevicesContainer.tsx +26 -36
- package/src/components/JoinDialog.tsx +3 -3
- package/src/components/ProfileContainer.stories.tsx +1 -1
- package/src/components/ProfileContainer.tsx +17 -25
- package/src/components/RecoveryCodeDialog.stories.tsx +1 -1
- package/src/components/RecoveryCredentialsContainer.stories.tsx +1 -1
- package/src/components/RecoveryCredentialsContainer.tsx +14 -14
- package/src/components/ResetDialog.stories.tsx +22 -10
- package/src/components/ResetDialog.tsx +11 -8
- package/src/translations.ts +1 -1
- package/dist/lib/browser/app-graph-builder-3FGBMLTF.mjs.map +0 -7
- package/dist/lib/browser/client-IX5LMWV4.mjs.map +0 -7
- package/dist/lib/browser/migrations-3EBTAW3N.mjs.map +0 -7
- package/dist/lib/browser/operation-resolver-2NT3ISVP.mjs.map +0 -7
- package/dist/lib/browser/react-context-4UABG3GP.mjs.map +0 -7
- package/dist/lib/browser/react-surface-RSQ74XCT.mjs.map +0 -7
- package/dist/lib/browser/schema-defs-O7VLP745.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-2PIYVUNC.mjs.map +0 -7
- package/dist/lib/node-esm/client-FFPK5UFP.mjs.map +0 -7
- package/dist/lib/node-esm/migrations-WSZSFGDK.mjs.map +0 -7
- package/dist/lib/node-esm/operation-resolver-VW5R2BE4.mjs.map +0 -7
- package/dist/lib/node-esm/react-context-UVXMGPW4.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-KBHANGGC.mjs.map +0 -7
- package/dist/lib/node-esm/schema-defs-QLRGBIKY.mjs.map +0 -7
- /package/dist/lib/browser/{chunk-F7H2Y3Z2.mjs.map → chunk-MY6BJCB6.mjs.map} +0 -0
- /package/dist/lib/node-esm/{chunk-BCELGXRI.mjs.map → chunk-MUOMX53G.mjs.map} +0 -0
|
@@ -5,9 +5,9 @@ import {
|
|
|
5
5
|
|
|
6
6
|
// src/capabilities/migrations/migrations.ts
|
|
7
7
|
import * as Effect from "effect/Effect";
|
|
8
|
-
import {
|
|
8
|
+
import { Capabilities, Capability } from "@dxos/app-framework";
|
|
9
9
|
var migrations_default = Capability.makeModule(Effect.fnUntraced(function* () {
|
|
10
|
-
const registry = yield* Capability.get(
|
|
10
|
+
const registry = yield* Capability.get(Capabilities.AtomRegistry);
|
|
11
11
|
const client = yield* Capability.get(ClientCapabilities.Client);
|
|
12
12
|
const migrationsAtom = yield* Capability.atom(ClientCapabilities.Migration);
|
|
13
13
|
const cancel = registry.subscribe(migrationsAtom, (_migrations) => {
|
|
@@ -17,9 +17,9 @@ var migrations_default = Capability.makeModule(Effect.fnUntraced(function* () {
|
|
|
17
17
|
}, {
|
|
18
18
|
immediate: true
|
|
19
19
|
});
|
|
20
|
-
return Capability.contributes(
|
|
20
|
+
return Capability.contributes(Capabilities.Null, null, () => Effect.sync(() => cancel()));
|
|
21
21
|
}));
|
|
22
22
|
export {
|
|
23
23
|
migrations_default as default
|
|
24
24
|
};
|
|
25
|
-
//# sourceMappingURL=migrations-
|
|
25
|
+
//# sourceMappingURL=migrations-ZH5GNG4U.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/capabilities/migrations/migrations.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capabilities, Capability } from '@dxos/app-framework';\n\nimport { ClientCapabilities } from '../../types';\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n const registry = yield* Capability.get(Capabilities.AtomRegistry);\n const client = yield* Capability.get(ClientCapabilities.Client);\n const migrationsAtom = yield* Capability.atom(ClientCapabilities.Migration);\n\n // NOTE: Migrations are currently unidirectional and idempotent.\n const cancel = registry.subscribe(\n migrationsAtom,\n (_migrations: any[]) => {\n const migrations = Array.from(new Set(_migrations.flat()));\n const spaces = client.spaces.get();\n void Promise.all(spaces.map((space: any) => space.internal.db.runMigrations(migrations)));\n },\n { immediate: true },\n );\n\n return Capability.contributes(Capabilities.Null, null, () => Effect.sync(() => cancel()));\n }),\n);\n"],
|
|
5
|
+
"mappings": ";;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,cAAcC,kBAAkB;AAIzC,IAAA,qBAAeC,WAAWC,WACjBC,kBAAW,aAAA;AAChB,QAAMC,WAAW,OAAOH,WAAWI,IAAIC,aAAaC,YAAY;AAChE,QAAMC,SAAS,OAAOP,WAAWI,IAAII,mBAAmBC,MAAM;AAC9D,QAAMC,iBAAiB,OAAOV,WAAWW,KAAKH,mBAAmBI,SAAS;AAG1E,QAAMC,SAASV,SAASW,UACtBJ,gBACA,CAACK,gBAAAA;AACC,UAAMC,aAAaC,MAAMC,KAAK,IAAIC,IAAIJ,YAAYK,KAAI,CAAA,CAAA;AACtD,UAAMC,SAASd,OAAOc,OAAOjB,IAAG;AAChC,SAAKkB,QAAQC,IAAIF,OAAOG,IAAI,CAACC,UAAeA,MAAMC,SAASC,GAAGC,cAAcZ,UAAAA,CAAAA,CAAAA;EAC9E,GACA;IAAEa,WAAW;EAAK,CAAA;AAGpB,SAAO7B,WAAW8B,YAAYzB,aAAa0B,MAAM,MAAM,MAAaC,YAAK,MAAMnB,OAAAA,CAAAA,CAAAA;AACjF,CAAA,CAAA;",
|
|
6
|
+
"names": ["Effect", "Capabilities", "Capability", "Capability", "makeModule", "fnUntraced", "registry", "get", "Capabilities", "AtomRegistry", "client", "ClientCapabilities", "Client", "migrationsAtom", "atom", "Migration", "cancel", "subscribe", "_migrations", "migrations", "Array", "from", "Set", "flat", "spaces", "Promise", "all", "map", "space", "internal", "db", "runMigrations", "immediate", "contributes", "Null", "sync"]
|
|
7
|
+
}
|
package/dist/lib/node-esm/{operation-resolver-VW5R2BE4.mjs → operation-resolver-CHGWI5P2.mjs}
RENAMED
|
@@ -13,7 +13,8 @@ import {
|
|
|
13
13
|
|
|
14
14
|
// src/capabilities/operation-resolver/operation-resolver.ts
|
|
15
15
|
import * as Effect from "effect/Effect";
|
|
16
|
-
import {
|
|
16
|
+
import { Capabilities, Capability } from "@dxos/app-framework";
|
|
17
|
+
import { LayoutOperation } from "@dxos/app-toolkit";
|
|
17
18
|
import { PublicKey } from "@dxos/client";
|
|
18
19
|
import { runAndForwardErrors } from "@dxos/effect";
|
|
19
20
|
import { invariant } from "@dxos/invariant";
|
|
@@ -24,14 +25,14 @@ var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-client/src/capabiliti
|
|
|
24
25
|
var RECOVER_IDENTITY_RPC_TIMEOUT = 2e4;
|
|
25
26
|
var operation_resolver_default = Capability.makeModule(Effect.fnUntraced(function* (props) {
|
|
26
27
|
const { appName = "Composer" } = props ?? {};
|
|
27
|
-
return Capability.contributes(
|
|
28
|
+
return Capability.contributes(Capabilities.OperationResolver, [
|
|
28
29
|
//
|
|
29
30
|
// CreateIdentity
|
|
30
31
|
//
|
|
31
32
|
OperationResolver.make({
|
|
32
33
|
operation: ClientOperation.CreateIdentity,
|
|
33
34
|
handler: Effect.fnUntraced(function* (profile) {
|
|
34
|
-
const manager = yield* Capability.get(
|
|
35
|
+
const manager = yield* Capability.get(Capabilities.PluginManager);
|
|
35
36
|
const client = yield* Capability.get(ClientCapabilities.Client);
|
|
36
37
|
const data = yield* Effect.promise(() => client.halo.createIdentity(profile));
|
|
37
38
|
yield* Effect.promise(() => runAndForwardErrors(manager.activate(ClientEvents.IdentityCreated)));
|
|
@@ -47,7 +48,7 @@ var operation_resolver_default = Capability.makeModule(Effect.fnUntraced(functio
|
|
|
47
48
|
OperationResolver.make({
|
|
48
49
|
operation: ClientOperation.JoinIdentity,
|
|
49
50
|
handler: Effect.fnUntraced(function* (data) {
|
|
50
|
-
yield* Operation.invoke(
|
|
51
|
+
yield* Operation.invoke(LayoutOperation.UpdateDialog, {
|
|
51
52
|
subject: JOIN_DIALOG,
|
|
52
53
|
blockAlign: "start",
|
|
53
54
|
props: {
|
|
@@ -63,10 +64,10 @@ var operation_resolver_default = Capability.makeModule(Effect.fnUntraced(functio
|
|
|
63
64
|
OperationResolver.make({
|
|
64
65
|
operation: ClientOperation.ShareIdentity,
|
|
65
66
|
handler: Effect.fnUntraced(function* () {
|
|
66
|
-
yield* Operation.invoke(
|
|
67
|
+
yield* Operation.invoke(LayoutOperation.SwitchWorkspace, {
|
|
67
68
|
subject: Account.id
|
|
68
69
|
});
|
|
69
|
-
yield* Operation.invoke(
|
|
70
|
+
yield* Operation.invoke(LayoutOperation.Open, {
|
|
70
71
|
subject: [
|
|
71
72
|
Account.Profile
|
|
72
73
|
]
|
|
@@ -82,7 +83,7 @@ var operation_resolver_default = Capability.makeModule(Effect.fnUntraced(functio
|
|
|
82
83
|
OperationResolver.make({
|
|
83
84
|
operation: ClientOperation.RecoverIdentity,
|
|
84
85
|
handler: Effect.fnUntraced(function* () {
|
|
85
|
-
yield* Operation.invoke(
|
|
86
|
+
yield* Operation.invoke(LayoutOperation.UpdateDialog, {
|
|
86
87
|
subject: JOIN_DIALOG,
|
|
87
88
|
blockAlign: "start",
|
|
88
89
|
props: {
|
|
@@ -97,7 +98,7 @@ var operation_resolver_default = Capability.makeModule(Effect.fnUntraced(functio
|
|
|
97
98
|
OperationResolver.make({
|
|
98
99
|
operation: ClientOperation.ResetStorage,
|
|
99
100
|
handler: Effect.fnUntraced(function* (data) {
|
|
100
|
-
yield* Operation.invoke(
|
|
101
|
+
yield* Operation.invoke(LayoutOperation.UpdateDialog, {
|
|
101
102
|
subject: RESET_DIALOG,
|
|
102
103
|
blockAlign: "start",
|
|
103
104
|
props: {
|
|
@@ -115,7 +116,7 @@ var operation_resolver_default = Capability.makeModule(Effect.fnUntraced(functio
|
|
|
115
116
|
const client = yield* Capability.get(ClientCapabilities.Client);
|
|
116
117
|
invariant(client.services.services.EdgeAgentService, "Missing EdgeAgentService", {
|
|
117
118
|
F: __dxlog_file,
|
|
118
|
-
L:
|
|
119
|
+
L: 115,
|
|
119
120
|
S: this,
|
|
120
121
|
A: [
|
|
121
122
|
"client.services.services.EdgeAgentService",
|
|
@@ -136,7 +137,7 @@ var operation_resolver_default = Capability.makeModule(Effect.fnUntraced(functio
|
|
|
136
137
|
const client = yield* Capability.get(ClientCapabilities.Client);
|
|
137
138
|
invariant(client.services.services.IdentityService, "IdentityService not available", {
|
|
138
139
|
F: __dxlog_file,
|
|
139
|
-
L:
|
|
140
|
+
L: 129,
|
|
140
141
|
S: this,
|
|
141
142
|
A: [
|
|
142
143
|
"client.services.services.IdentityService",
|
|
@@ -144,7 +145,7 @@ var operation_resolver_default = Capability.makeModule(Effect.fnUntraced(functio
|
|
|
144
145
|
]
|
|
145
146
|
});
|
|
146
147
|
const { recoveryCode } = yield* Effect.promise(() => client.services.services.IdentityService.createRecoveryCredential({}));
|
|
147
|
-
yield* Operation.invoke(
|
|
148
|
+
yield* Operation.invoke(LayoutOperation.UpdateDialog, {
|
|
148
149
|
subject: RECOVERY_CODE_DIALOG,
|
|
149
150
|
blockAlign: "start",
|
|
150
151
|
type: "alert",
|
|
@@ -164,7 +165,7 @@ var operation_resolver_default = Capability.makeModule(Effect.fnUntraced(functio
|
|
|
164
165
|
const identity = client.halo.identity.get();
|
|
165
166
|
invariant(identity, "Identity not available", {
|
|
166
167
|
F: __dxlog_file,
|
|
167
|
-
L:
|
|
168
|
+
L: 150,
|
|
168
169
|
S: this,
|
|
169
170
|
A: [
|
|
170
171
|
"identity",
|
|
@@ -202,7 +203,7 @@ var operation_resolver_default = Capability.makeModule(Effect.fnUntraced(functio
|
|
|
202
203
|
}));
|
|
203
204
|
invariant(credential, "Credential not available", {
|
|
204
205
|
F: __dxlog_file,
|
|
205
|
-
L:
|
|
206
|
+
L: 175,
|
|
206
207
|
S: this,
|
|
207
208
|
A: [
|
|
208
209
|
"credential",
|
|
@@ -213,7 +214,7 @@ var operation_resolver_default = Capability.makeModule(Effect.fnUntraced(functio
|
|
|
213
214
|
const algorithm = credential.response.getPublicKeyAlgorithm() === -7 ? "ES256" : "ED25519";
|
|
214
215
|
invariant(client.services.services.IdentityService, "IdentityService not available", {
|
|
215
216
|
F: __dxlog_file,
|
|
216
|
-
L:
|
|
217
|
+
L: 179,
|
|
217
218
|
S: this,
|
|
218
219
|
A: [
|
|
219
220
|
"client.services.services.IdentityService",
|
|
@@ -238,7 +239,7 @@ var operation_resolver_default = Capability.makeModule(Effect.fnUntraced(functio
|
|
|
238
239
|
const client = yield* Capability.get(ClientCapabilities.Client);
|
|
239
240
|
invariant(client.services.services.IdentityService, "IdentityService not available", {
|
|
240
241
|
F: __dxlog_file,
|
|
241
|
-
L:
|
|
242
|
+
L: 199,
|
|
242
243
|
S: this,
|
|
243
244
|
A: [
|
|
244
245
|
"client.services.services.IdentityService",
|
|
@@ -277,7 +278,7 @@ var operation_resolver_default = Capability.makeModule(Effect.fnUntraced(functio
|
|
|
277
278
|
const client = yield* Capability.get(ClientCapabilities.Client);
|
|
278
279
|
invariant(client.services.services.IdentityService, "IdentityService not available", {
|
|
279
280
|
F: __dxlog_file,
|
|
280
|
-
L:
|
|
281
|
+
L: 238,
|
|
281
282
|
S: this,
|
|
282
283
|
A: [
|
|
283
284
|
"client.services.services.IdentityService",
|
|
@@ -296,4 +297,4 @@ var operation_resolver_default = Capability.makeModule(Effect.fnUntraced(functio
|
|
|
296
297
|
export {
|
|
297
298
|
operation_resolver_default as default
|
|
298
299
|
};
|
|
299
|
-
//# sourceMappingURL=operation-resolver-
|
|
300
|
+
//# sourceMappingURL=operation-resolver-CHGWI5P2.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/capabilities/operation-resolver/operation-resolver.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capabilities, Capability } from '@dxos/app-framework';\nimport { LayoutOperation } from '@dxos/app-toolkit';\nimport { PublicKey } from '@dxos/client';\nimport { runAndForwardErrors } from '@dxos/effect';\nimport { invariant } from '@dxos/invariant';\nimport { OperationResolver } from '@dxos/operation';\nimport { Operation } from '@dxos/operation';\nimport { ObservabilityOperation } from '@dxos/plugin-observability/types';\nimport { type JoinPanelProps } from '@dxos/shell/react';\n\nimport { JOIN_DIALOG, RECOVERY_CODE_DIALOG, RESET_DIALOG } from '../../constants';\nimport { ClientEvents } from '../../types';\nimport { Account, ClientCapabilities, ClientOperation } from '../../types';\n\ntype OperationResolverOptions = {\n appName?: string;\n};\n\nconst RECOVER_IDENTITY_RPC_TIMEOUT = 20_000;\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* (props?: OperationResolverOptions) {\n const { appName = 'Composer' } = props ?? {};\n\n return Capability.contributes(Capabilities.OperationResolver, [\n //\n // CreateIdentity\n //\n OperationResolver.make({\n operation: ClientOperation.CreateIdentity,\n handler: Effect.fnUntraced(function* (profile) {\n const manager = yield* Capability.get(Capabilities.PluginManager);\n const client = yield* Capability.get(ClientCapabilities.Client);\n const data = yield* Effect.promise(() => client.halo.createIdentity(profile));\n yield* Effect.promise(() => runAndForwardErrors(manager.activate(ClientEvents.IdentityCreated)));\n yield* Operation.schedule(ObservabilityOperation.SendEvent, { name: 'identity.create' });\n return data;\n }),\n }),\n\n //\n // JoinIdentity\n //\n OperationResolver.make({\n operation: ClientOperation.JoinIdentity,\n handler: Effect.fnUntraced(function* (data) {\n yield* Operation.invoke(LayoutOperation.UpdateDialog, {\n subject: JOIN_DIALOG,\n blockAlign: 'start',\n props: {\n initialInvitationCode: data.invitationCode,\n initialDisposition: 'accept-halo-invitation',\n },\n });\n }),\n }),\n\n //\n // ShareIdentity\n //\n OperationResolver.make({\n operation: ClientOperation.ShareIdentity,\n handler: Effect.fnUntraced(function* () {\n yield* Operation.invoke(LayoutOperation.SwitchWorkspace, { subject: Account.id });\n yield* Operation.invoke(LayoutOperation.Open, { subject: [Account.Profile] });\n yield* Operation.schedule(ObservabilityOperation.SendEvent, { name: 'identity.share' });\n }),\n }),\n\n //\n // RecoverIdentity\n //\n OperationResolver.make({\n operation: ClientOperation.RecoverIdentity,\n handler: Effect.fnUntraced(function* () {\n yield* Operation.invoke(LayoutOperation.UpdateDialog, {\n subject: JOIN_DIALOG,\n blockAlign: 'start',\n props: {\n initialDisposition: 'recover-identity',\n } satisfies Partial<JoinPanelProps>,\n });\n }),\n }),\n\n //\n // ResetStorage\n //\n OperationResolver.make({\n operation: ClientOperation.ResetStorage,\n handler: Effect.fnUntraced(function* (data) {\n yield* Operation.invoke(LayoutOperation.UpdateDialog, {\n subject: RESET_DIALOG,\n blockAlign: 'start',\n props: {\n mode: data.mode ?? 'reset storage',\n },\n });\n }),\n }),\n\n //\n // CreateAgent\n //\n OperationResolver.make({\n operation: ClientOperation.CreateAgent,\n handler: Effect.fnUntraced(function* () {\n const client = yield* Capability.get(ClientCapabilities.Client);\n invariant(client.services.services.EdgeAgentService, 'Missing EdgeAgentService');\n yield* Effect.promise(() =>\n client.services.services.EdgeAgentService!.createAgent(undefined, { timeout: 10_000 }),\n );\n }),\n }),\n\n //\n // CreateRecoveryCode\n //\n OperationResolver.make({\n operation: ClientOperation.CreateRecoveryCode,\n handler: Effect.fnUntraced(function* () {\n const client = yield* Capability.get(ClientCapabilities.Client);\n invariant(client.services.services.IdentityService, 'IdentityService not available');\n const { recoveryCode } = yield* Effect.promise(() =>\n client.services.services.IdentityService!.createRecoveryCredential({}),\n );\n yield* Operation.invoke(LayoutOperation.UpdateDialog, {\n subject: RECOVERY_CODE_DIALOG,\n blockAlign: 'start',\n type: 'alert',\n props: { code: recoveryCode },\n });\n }),\n }),\n\n //\n // CreatePasskey\n //\n OperationResolver.make({\n operation: ClientOperation.CreatePasskey,\n handler: Effect.fnUntraced(function* () {\n const client = yield* Capability.get(ClientCapabilities.Client);\n const identity = client.halo.identity.get();\n invariant(identity, 'Identity not available');\n\n const lookupKey = PublicKey.random();\n const credential = yield* Effect.promise(() =>\n navigator.credentials.create({\n publicKey: {\n challenge: new Uint8Array(),\n rp: { id: location.hostname, name: appName },\n user: {\n id: lookupKey.asUint8Array() as Uint8Array<ArrayBuffer>,\n name: identity.did,\n displayName: identity.profile?.displayName ?? '',\n },\n pubKeyCredParams: [\n { type: 'public-key', alg: -8 }, // Ed25519 (not yet supported across all browsers)\n { type: 'public-key', alg: -7 }, // ES256\n ],\n authenticatorSelection: {\n residentKey: 'required',\n requireResidentKey: true,\n },\n },\n }),\n );\n\n invariant(credential, 'Credential not available');\n const recoveryKey = PublicKey.from(new Uint8Array((credential as any).response.getPublicKey()));\n const algorithm = (credential as any).response.getPublicKeyAlgorithm() === -7 ? 'ES256' : 'ED25519';\n\n invariant(client.services.services.IdentityService, 'IdentityService not available');\n yield* Effect.promise(() =>\n client.services.services.IdentityService!.createRecoveryCredential({\n data: {\n recoveryKey,\n algorithm,\n lookupKey,\n },\n }),\n );\n }),\n }),\n\n //\n // RedeemPasskey\n //\n OperationResolver.make({\n operation: ClientOperation.RedeemPasskey,\n handler: Effect.fnUntraced(function* () {\n const client = yield* Capability.get(ClientCapabilities.Client);\n invariant(client.services.services.IdentityService, 'IdentityService not available');\n const { deviceKey, controlFeedKey, challenge } = yield* Effect.promise(() =>\n client.services.services.IdentityService!.requestRecoveryChallenge(),\n );\n const credential = yield* Effect.promise(() =>\n navigator.credentials.get({\n publicKey: {\n challenge: Buffer.from(challenge, 'base64'),\n rpId: location.hostname,\n userVerification: 'required',\n },\n }),\n );\n const lookupKey = PublicKey.from(new Uint8Array((credential as any).response.userHandle));\n yield* Effect.promise(() =>\n client.services.services.IdentityService!.recoverIdentity(\n {\n external: {\n lookupKey,\n deviceKey,\n controlFeedKey,\n signature: Buffer.from((credential as any).response.signature),\n clientDataJson: Buffer.from((credential as any).response.clientDataJSON),\n authenticatorData: Buffer.from((credential as any).response.authenticatorData),\n },\n },\n { timeout: RECOVER_IDENTITY_RPC_TIMEOUT },\n ),\n );\n }),\n }),\n\n //\n // RedeemToken\n //\n OperationResolver.make({\n operation: ClientOperation.RedeemToken,\n handler: Effect.fnUntraced(function* (data) {\n const client = yield* Capability.get(ClientCapabilities.Client);\n invariant(client.services.services.IdentityService, 'IdentityService not available');\n yield* Effect.promise(() =>\n client.services.services.IdentityService!.recoverIdentity(\n { token: data.token },\n { timeout: RECO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nG,SAAgBV,kBAAW,WAAWkB,MAAI;AACxC,cAAMH,SAAS,OAAOjB,WAAWe,IAAIG,mBAAmBC,MAAM;AAC9DmC,kBAAUrC,OAAOsC,SAASA,SAASM,iBAAiB,iCAAA;;;;;;;;;AACpD,eAAcxC,eAAQ,MACpBJ,OAAOsC,SAASA,SAASM,gBAAiB4C,gBACxC;UAAEO,OAAO5F,KAAK4F;QAAM,GACpB;UAAErD,SAAS5D;QAA6B,CAAA,CAAA;MAG9C,CAAA;IACF,CAAA;GACD;AACH,CAAA,CAAA;",
|
|
6
|
+
"names": ["Effect", "Capabilities", "Capability", "LayoutOperation", "PublicKey", "runAndForwardErrors", "invariant", "OperationResolver", "Operation", "ObservabilityOperation", "RECOVER_IDENTITY_RPC_TIMEOUT", "Capability", "makeModule", "fnUntraced", "props", "appName", "contributes", "Capabilities", "OperationResolver", "make", "operation", "ClientOperation", "CreateIdentity", "handler", "profile", "manager", "get", "PluginManager", "client", "ClientCapabilities", "Client", "data", "promise", "halo", "createIdentity", "runAndForwardErrors", "activate", "ClientEvents", "IdentityCreated", "Operation", "schedule", "ObservabilityOperation", "SendEvent", "name", "JoinIdentity", "invoke", "LayoutOperation", "UpdateDialog", "subject", "JOIN_DIALOG", "blockAlign", "initialInvitationCode", "invitationCode", "initialDisposition", "ShareIdentity", "SwitchWorkspace", "Account", "id", "Open", "Profile", "RecoverIdentity", "ResetStorage", "RESET_DIALOG", "mode", "CreateAgent", "invariant", "services", "EdgeAgentService", "createAgent", "undefined", "timeout", "CreateRecoveryCode", "IdentityService", "recoveryCode", "createRecoveryCredential", "RECOVERY_CODE_DIALOG", "type", "code", "CreatePasskey", "identity", "lookupKey", "PublicKey", "random", "credential", "navigator", "credentials", "create", "publicKey", "challenge", "Uint8Array", "rp", "location", "hostname", "user", "asUint8Array", "did", "displayName", "pubKeyCredParams", "alg", "authenticatorSelection", "residentKey", "requireResidentKey", "recoveryKey", "from", "response", "getPublicKey", "algorithm", "getPublicKeyAlgorithm", "RedeemPasskey", "deviceKey", "controlFeedKey", "requestRecoveryChallenge", "Buffer", "rpId", "userVerification", "userHandle", "recoverIdentity", "external", "signature", "clientDataJson", "clientDataJSON", "authenticatorData", "RedeemToken", "token"]
|
|
7
|
+
}
|
|
@@ -7,10 +7,10 @@ import {
|
|
|
7
7
|
// src/capabilities/react-context/react-context.tsx
|
|
8
8
|
import * as Effect from "effect/Effect";
|
|
9
9
|
import React from "react";
|
|
10
|
-
import {
|
|
11
|
-
import { useCapability } from "@dxos/app-framework/
|
|
10
|
+
import { Capabilities, Capability } from "@dxos/app-framework";
|
|
11
|
+
import { useCapability } from "@dxos/app-framework/ui";
|
|
12
12
|
import { ClientProvider } from "@dxos/react-client";
|
|
13
|
-
var react_context_default = Capability.makeModule(() => Effect.succeed(Capability.contributes(
|
|
13
|
+
var react_context_default = Capability.makeModule(() => Effect.succeed(Capability.contributes(Capabilities.ReactContext, {
|
|
14
14
|
id: meta.id,
|
|
15
15
|
context: ({ children }) => {
|
|
16
16
|
const client = useCapability(ClientCapabilities.Client);
|
|
@@ -22,4 +22,4 @@ var react_context_default = Capability.makeModule(() => Effect.succeed(Capabilit
|
|
|
22
22
|
export {
|
|
23
23
|
react_context_default as default
|
|
24
24
|
};
|
|
25
|
-
//# sourceMappingURL=react-context-
|
|
25
|
+
//# sourceMappingURL=react-context-7Z2TVUTV.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/capabilities/react-context/react-context.tsx"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport React from 'react';\n\nimport { Capabilities, Capability } from '@dxos/app-framework';\nimport { useCapability } from '@dxos/app-framework/ui';\nimport { ClientProvider } from '@dxos/react-client';\n\nimport { meta } from '../../meta';\nimport { ClientCapabilities } from '../../types';\n\nexport default Capability.makeModule(() =>\n Effect.succeed(\n Capability.contributes(Capabilities.ReactContext, {\n id: meta.id,\n context: ({ children }: { children?: React.ReactNode }) => {\n const client = useCapability(ClientCapabilities.Client);\n return <ClientProvider client={client}>{children}</ClientProvider>;\n },\n }),\n ),\n);\n"],
|
|
5
|
+
"mappings": ";;;;;;;AAIA,YAAYA,YAAY;AACxB,OAAOC,WAAW;AAElB,SAASC,cAAcC,kBAAkB;AACzC,SAASC,qBAAqB;AAC9B,SAASC,sBAAsB;AAK/B,IAAA,wBAAeC,WAAWC,WAAW,MAC5BC,eACLF,WAAWG,YAAYC,aAAaC,cAAc;EAChDC,IAAIC,KAAKD;EACTE,SAAS,CAAC,EAAEC,SAAQ,MAAkC;AACpD,UAAMC,SAASC,cAAcC,mBAAmBC,MAAM;AACtD,WAAO,sBAAA,cAACC,gBAAAA;MAAeJ;OAAiBD,QAAAA;EAC1C;AACF,CAAA,CAAA,CAAA;",
|
|
6
|
+
"names": ["Effect", "React", "Capabilities", "Capability", "useCapability", "ClientProvider", "Capability", "makeModule", "succeed", "contributes", "Capabilities", "ReactContext", "id", "meta", "context", "children", "client", "useCapability", "ClientCapabilities", "Client", "ClientProvider"]
|
|
7
|
+
}
|
|
@@ -13,21 +13,21 @@ import {
|
|
|
13
13
|
// src/capabilities/react-surface/react-surface.tsx
|
|
14
14
|
import * as Effect2 from "effect/Effect";
|
|
15
15
|
import React7 from "react";
|
|
16
|
-
import { Capability as Capability2
|
|
16
|
+
import { Capabilities, Capability as Capability2 } from "@dxos/app-framework";
|
|
17
|
+
import { Surface } from "@dxos/app-framework/ui";
|
|
17
18
|
|
|
18
19
|
// src/components/DevicesContainer.tsx
|
|
19
20
|
import React, { useCallback, useEffect, useState } from "react";
|
|
20
21
|
import { QR } from "react-qr-rounded";
|
|
21
|
-
import { useOperationInvoker } from "@dxos/app-framework/
|
|
22
|
+
import { useOperationInvoker } from "@dxos/app-framework/ui";
|
|
22
23
|
import { log } from "@dxos/log";
|
|
23
24
|
import { useClient, useMulticastObservable } from "@dxos/react-client";
|
|
24
25
|
import { useDevices } from "@dxos/react-client/halo";
|
|
25
26
|
import { Invitation, InvitationEncoder } from "@dxos/react-client/invitations";
|
|
26
27
|
import { useNetworkStatus } from "@dxos/react-client/mesh";
|
|
27
28
|
import { Button, Clipboard, Icon, IconButton, List, useId, useTranslation } from "@dxos/react-ui";
|
|
28
|
-
import {
|
|
29
|
-
import { translationKey } from "@dxos/shell/react";
|
|
30
|
-
import { AuthCode, Centered, DeviceListItem, Emoji, Viewport } from "@dxos/shell/react";
|
|
29
|
+
import { Settings } from "@dxos/react-ui-form";
|
|
30
|
+
import { AuthCode, Centered, DeviceListItem, Emoji, Viewport, translationKey } from "@dxos/shell/react";
|
|
31
31
|
import { osTranslations } from "@dxos/ui-theme";
|
|
32
32
|
import { hexToEmoji } from "@dxos/util";
|
|
33
33
|
var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-client/src/components/DevicesContainer.tsx";
|
|
@@ -49,35 +49,33 @@ var DevicesContainer = ({ createInvitationUrl }) => {
|
|
|
49
49
|
}), [
|
|
50
50
|
invokePromise
|
|
51
51
|
]);
|
|
52
|
-
return /* @__PURE__ */ React.createElement(Clipboard.Provider, null, /* @__PURE__ */ React.createElement(
|
|
52
|
+
return /* @__PURE__ */ React.createElement(Clipboard.Provider, null, /* @__PURE__ */ React.createElement(Settings.Root, null, /* @__PURE__ */ React.createElement(Settings.Section, {
|
|
53
53
|
title: t("devices verbose label", {
|
|
54
54
|
ns: meta.id
|
|
55
55
|
}),
|
|
56
56
|
description: t("devices description", {
|
|
57
57
|
ns: meta.id
|
|
58
58
|
})
|
|
59
|
-
}, /* @__PURE__ */ React.createElement(
|
|
59
|
+
}, /* @__PURE__ */ React.createElement(Settings.Frame, null, /* @__PURE__ */ React.createElement(Settings.FrameItem, {
|
|
60
60
|
title: t("devices label", {
|
|
61
61
|
ns: meta.id
|
|
62
62
|
})
|
|
63
|
-
}, /* @__PURE__ */ React.createElement(List, null, devices.map((device) => {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
});
|
|
69
|
-
}))), createInvitationUrl && /* @__PURE__ */ React.createElement(ControlFrameItem, {
|
|
63
|
+
}, /* @__PURE__ */ React.createElement(List, null, devices.map((device) => /* @__PURE__ */ React.createElement(DeviceListItem, {
|
|
64
|
+
key: device.deviceKey.toHex(),
|
|
65
|
+
device,
|
|
66
|
+
connectionState
|
|
67
|
+
})))), createInvitationUrl && /* @__PURE__ */ React.createElement(Settings.FrameItem, {
|
|
70
68
|
title: "Add device"
|
|
71
69
|
}, /* @__PURE__ */ React.createElement(DeviceInvitation, {
|
|
72
70
|
createInvitationUrl
|
|
73
|
-
})))), /* @__PURE__ */ React.createElement(
|
|
71
|
+
})))), /* @__PURE__ */ React.createElement(Settings.Section, {
|
|
74
72
|
title: t("danger zone title", {
|
|
75
73
|
ns: meta.id
|
|
76
74
|
}),
|
|
77
75
|
description: t("danger zone description", {
|
|
78
76
|
ns: meta.id
|
|
79
77
|
})
|
|
80
|
-
}, /* @__PURE__ */ React.createElement(
|
|
78
|
+
}, /* @__PURE__ */ React.createElement(Settings.Group, null, /* @__PURE__ */ React.createElement(Settings.Item, {
|
|
81
79
|
title: t("reset device label"),
|
|
82
80
|
description: t("reset device description", {
|
|
83
81
|
ns: meta.id
|
|
@@ -86,7 +84,7 @@ var DevicesContainer = ({ createInvitationUrl }) => {
|
|
|
86
84
|
variant: "destructive",
|
|
87
85
|
onClick: handleResetStorage,
|
|
88
86
|
"data-testid": "devicesContainer.reset"
|
|
89
|
-
}, t("reset device label"))), /* @__PURE__ */ React.createElement(
|
|
87
|
+
}, t("reset device label"))), /* @__PURE__ */ React.createElement(Settings.Item, {
|
|
90
88
|
title: t("recover identity label"),
|
|
91
89
|
description: t("recover identity description", {
|
|
92
90
|
ns: meta.id
|
|
@@ -95,7 +93,7 @@ var DevicesContainer = ({ createInvitationUrl }) => {
|
|
|
95
93
|
variant: "destructive",
|
|
96
94
|
onClick: handleRecover,
|
|
97
95
|
"data-testid": "devicesContainer.recover"
|
|
98
|
-
}, t("recover identity label"))), /* @__PURE__ */ React.createElement(
|
|
96
|
+
}, t("recover identity label"))), /* @__PURE__ */ React.createElement(Settings.Item, {
|
|
99
97
|
title: t("join new identity label"),
|
|
100
98
|
description: t("join new identity description", {
|
|
101
99
|
ns: meta.id
|
|
@@ -120,7 +118,7 @@ var DeviceInvitation = (props) => {
|
|
|
120
118
|
authCode: invitation3.authCode
|
|
121
119
|
}), void 0, {
|
|
122
120
|
F: __dxlog_file,
|
|
123
|
-
L:
|
|
121
|
+
L: 117,
|
|
124
122
|
S: void 0,
|
|
125
123
|
C: (f, a) => f(...a)
|
|
126
124
|
});
|
|
@@ -273,8 +271,8 @@ var InvitationComplete = ({ statusValue }) => {
|
|
|
273
271
|
|
|
274
272
|
// src/components/JoinDialog.tsx
|
|
275
273
|
import React2, { useCallback as useCallback2 } from "react";
|
|
276
|
-
import {
|
|
277
|
-
import {
|
|
274
|
+
import { useOperationInvoker as useOperationInvoker2 } from "@dxos/app-framework/ui";
|
|
275
|
+
import { LayoutOperation } from "@dxos/app-toolkit";
|
|
278
276
|
import { ObservabilityOperation } from "@dxos/plugin-observability/types";
|
|
279
277
|
import { Dialog, useTranslation as useTranslation2 } from "@dxos/react-ui";
|
|
280
278
|
import { JoinPanel } from "@dxos/shell/react";
|
|
@@ -288,7 +286,7 @@ var JoinDialog = (props) => {
|
|
|
288
286
|
const handleDone = useCallback2(async (result) => {
|
|
289
287
|
if (result?.identityKey) {
|
|
290
288
|
await Promise.all([
|
|
291
|
-
invokePromise(
|
|
289
|
+
invokePromise(LayoutOperation.UpdateDialog, {
|
|
292
290
|
state: false
|
|
293
291
|
}),
|
|
294
292
|
invokePromise(ObservabilityOperation.SendEvent, {
|
|
@@ -324,7 +322,7 @@ import { debounce } from "@dxos/async";
|
|
|
324
322
|
import { useClient as useClient2 } from "@dxos/react-client";
|
|
325
323
|
import { useIdentity } from "@dxos/react-client/halo";
|
|
326
324
|
import { ButtonGroup, Clipboard as Clipboard2, Input, useTranslation as useTranslation3 } from "@dxos/react-ui";
|
|
327
|
-
import {
|
|
325
|
+
import { Form, Settings as Settings2 } from "@dxos/react-ui-form";
|
|
328
326
|
import { EmojiPickerBlock, HuePicker } from "@dxos/react-ui-pickers";
|
|
329
327
|
import { hexToEmoji as hexToEmoji2, hexToHue } from "@dxos/util";
|
|
330
328
|
var UserProfile = Schema.Struct({
|
|
@@ -398,7 +396,7 @@ var ProfileContainer = () => {
|
|
|
398
396
|
onValueChange,
|
|
399
397
|
type
|
|
400
398
|
]);
|
|
401
|
-
return /* @__PURE__ */ React3.createElement(
|
|
399
|
+
return /* @__PURE__ */ React3.createElement(Settings2.ItemInput, {
|
|
402
400
|
title: label,
|
|
403
401
|
description: t("display name description")
|
|
404
402
|
}, /* @__PURE__ */ React3.createElement(Input.TextInput, {
|
|
@@ -417,7 +415,7 @@ var ProfileContainer = () => {
|
|
|
417
415
|
onValueChange,
|
|
418
416
|
type
|
|
419
417
|
]);
|
|
420
|
-
return /* @__PURE__ */ React3.createElement(
|
|
418
|
+
return /* @__PURE__ */ React3.createElement(Settings2.Item, {
|
|
421
419
|
title: label,
|
|
422
420
|
description: t("icon description")
|
|
423
421
|
}, /* @__PURE__ */ React3.createElement(EmojiPickerBlock, {
|
|
@@ -437,7 +435,7 @@ var ProfileContainer = () => {
|
|
|
437
435
|
onValueChange,
|
|
438
436
|
type
|
|
439
437
|
]);
|
|
440
|
-
return /* @__PURE__ */ React3.createElement(
|
|
438
|
+
return /* @__PURE__ */ React3.createElement(Settings2.Item, {
|
|
441
439
|
title: label,
|
|
442
440
|
description: t("hue description")
|
|
443
441
|
}, /* @__PURE__ */ React3.createElement("div", {
|
|
@@ -451,10 +449,12 @@ var ProfileContainer = () => {
|
|
|
451
449
|
},
|
|
452
450
|
// TODO(wittjosiah): We need text input annotations for disabled and copyable.
|
|
453
451
|
did: ({ label, getValue }) => {
|
|
454
|
-
return /* @__PURE__ */ React3.createElement(
|
|
452
|
+
return /* @__PURE__ */ React3.createElement(Settings2.ItemInput, {
|
|
455
453
|
title: label,
|
|
456
454
|
description: t("did description")
|
|
457
|
-
}, /* @__PURE__ */ React3.createElement(ButtonGroup,
|
|
455
|
+
}, /* @__PURE__ */ React3.createElement(ButtonGroup, {
|
|
456
|
+
classNames: "is-full"
|
|
457
|
+
}, /* @__PURE__ */ React3.createElement(Input.TextInput, {
|
|
458
458
|
value: getValue(),
|
|
459
459
|
disabled: true,
|
|
460
460
|
classNames: "min-is-64"
|
|
@@ -465,7 +465,7 @@ var ProfileContainer = () => {
|
|
|
465
465
|
}), [
|
|
466
466
|
t
|
|
467
467
|
]);
|
|
468
|
-
return /* @__PURE__ */ React3.createElement(
|
|
468
|
+
return /* @__PURE__ */ React3.createElement(Clipboard2.Provider, null, /* @__PURE__ */ React3.createElement(Settings2.Root, null, /* @__PURE__ */ React3.createElement(Settings2.Section, {
|
|
469
469
|
title: t("profile label"),
|
|
470
470
|
description: t("profile description")
|
|
471
471
|
}, /* @__PURE__ */ React3.createElement(Form.Root, {
|
|
@@ -474,7 +474,7 @@ var ProfileContainer = () => {
|
|
|
474
474
|
fieldMap,
|
|
475
475
|
onValuesChanged: handleChange
|
|
476
476
|
}, /* @__PURE__ */ React3.createElement(Form.Content, null, /* @__PURE__ */ React3.createElement(Form.FieldSet, {
|
|
477
|
-
classNames: "
|
|
477
|
+
classNames: "space-y-trimMd"
|
|
478
478
|
}))))));
|
|
479
479
|
};
|
|
480
480
|
|
|
@@ -530,20 +530,20 @@ var Code = ({ code }) => {
|
|
|
530
530
|
|
|
531
531
|
// src/components/RecoveryCredentialsContainer.tsx
|
|
532
532
|
import React5 from "react";
|
|
533
|
-
import { useOperationInvoker as useOperationInvoker3 } from "@dxos/app-framework/
|
|
533
|
+
import { useOperationInvoker as useOperationInvoker3 } from "@dxos/app-framework/ui";
|
|
534
534
|
import { useCredentials } from "@dxos/react-client/halo";
|
|
535
535
|
import { Icon as Icon2, IconButton as IconButton2, List as List2, ListItem, Message, useTranslation as useTranslation5 } from "@dxos/react-ui";
|
|
536
|
-
import {
|
|
536
|
+
import { Settings as Settings3 } from "@dxos/react-ui-form";
|
|
537
537
|
var MANAGE_CREDENTIALS_DIALOG = `${meta.id}/ManageCredentialsDialog`;
|
|
538
538
|
var RecoveryCredentialsContainer = () => {
|
|
539
539
|
const { t } = useTranslation5(meta.id);
|
|
540
540
|
const { invokePromise } = useOperationInvoker3();
|
|
541
541
|
const credentials = useCredentials();
|
|
542
542
|
const recoveryCredentials = credentials.filter((credential) => credential.subject.assertion["@type"] === "dxos.halo.credentials.IdentityRecovery");
|
|
543
|
-
return /* @__PURE__ */ React5.createElement(
|
|
543
|
+
return /* @__PURE__ */ React5.createElement(Settings3.Root, null, /* @__PURE__ */ React5.createElement(Settings3.Section, {
|
|
544
544
|
title: t("recovery setup dialog title"),
|
|
545
545
|
description: t("recovery setup dialog description")
|
|
546
|
-
}, /* @__PURE__ */ React5.createElement(
|
|
546
|
+
}, /* @__PURE__ */ React5.createElement(Settings3.Group, null, /* @__PURE__ */ React5.createElement(Settings3.Item, {
|
|
547
547
|
title: t("create passkey label"),
|
|
548
548
|
description: t("create passkey description")
|
|
549
549
|
}, /* @__PURE__ */ React5.createElement(IconButton2, {
|
|
@@ -551,7 +551,7 @@ var RecoveryCredentialsContainer = () => {
|
|
|
551
551
|
icon: "ph--key--duotone",
|
|
552
552
|
variant: "primary",
|
|
553
553
|
onClick: () => invokePromise(ClientOperation.CreatePasskey)
|
|
554
|
-
})), /* @__PURE__ */ React5.createElement(
|
|
554
|
+
})), /* @__PURE__ */ React5.createElement(Settings3.Item, {
|
|
555
555
|
title: t("create recovery code label"),
|
|
556
556
|
description: t("create recovery code description")
|
|
557
557
|
}, /* @__PURE__ */ React5.createElement(IconButton2, {
|
|
@@ -559,7 +559,7 @@ var RecoveryCredentialsContainer = () => {
|
|
|
559
559
|
icon: "ph--receipt--duotone",
|
|
560
560
|
variant: "default",
|
|
561
561
|
onClick: () => invokePromise(ClientOperation.CreateRecoveryCode)
|
|
562
|
-
})))), /* @__PURE__ */ React5.createElement(
|
|
562
|
+
})))), /* @__PURE__ */ React5.createElement(Settings3.Section, {
|
|
563
563
|
title: t("credentials list label")
|
|
564
564
|
}, recoveryCredentials.length < 1 ? /* @__PURE__ */ React5.createElement(Message.Root, {
|
|
565
565
|
valence: "error",
|
|
@@ -578,8 +578,9 @@ var RecoveryCredentialsContainer = () => {
|
|
|
578
578
|
// src/components/ResetDialog.tsx
|
|
579
579
|
import * as Effect from "effect/Effect";
|
|
580
580
|
import React6, { useCallback as useCallback5 } from "react";
|
|
581
|
-
import { Capability
|
|
582
|
-
import { useOperationInvoker as useOperationInvoker4 } from "@dxos/app-framework/
|
|
581
|
+
import { Capability } from "@dxos/app-framework";
|
|
582
|
+
import { useOperationInvoker as useOperationInvoker4 } from "@dxos/app-framework/ui";
|
|
583
|
+
import { LayoutOperation as LayoutOperation2 } from "@dxos/app-toolkit";
|
|
583
584
|
import { runAndForwardErrors } from "@dxos/effect";
|
|
584
585
|
import { useClient as useClient3 } from "@dxos/react-client";
|
|
585
586
|
import { Dialog as Dialog2, useTranslation as useTranslation6 } from "@dxos/react-ui";
|
|
@@ -603,13 +604,13 @@ var ResetDialog = ({ mode, onReset, capabilityManager }) => {
|
|
|
603
604
|
capabilityManager
|
|
604
605
|
]);
|
|
605
606
|
const handleCancel = useCallback5(() => {
|
|
606
|
-
void invokePromise(
|
|
607
|
+
void invokePromise(LayoutOperation2.UpdateDialog, {
|
|
607
608
|
state: false
|
|
608
609
|
});
|
|
609
610
|
}, [
|
|
610
611
|
invokePromise
|
|
611
612
|
]);
|
|
612
|
-
return /* @__PURE__ */ React6.createElement(Dialog2.Content, null, /* @__PURE__ */ React6.createElement(Dialog2.Title, {
|
|
613
|
+
return /* @__PURE__ */ React6.createElement(React6.Fragment, null, /* @__PURE__ */ React6.createElement(Dialog2.Content, null, /* @__PURE__ */ React6.createElement(Dialog2.Title, {
|
|
613
614
|
classNames: "sr-only"
|
|
614
615
|
}, t("reset dialog title")), /* @__PURE__ */ React6.createElement(Dialog2.Description, {
|
|
615
616
|
classNames: "sr-only"
|
|
@@ -618,21 +619,21 @@ var ResetDialog = ({ mode, onReset, capabilityManager }) => {
|
|
|
618
619
|
mode,
|
|
619
620
|
onConfirm: handleReset,
|
|
620
621
|
onCancel: handleCancel
|
|
621
|
-
}));
|
|
622
|
+
})));
|
|
622
623
|
};
|
|
623
624
|
|
|
624
625
|
// src/capabilities/react-surface/react-surface.tsx
|
|
625
626
|
var react_surface_default = Capability2.makeModule(Effect2.fnUntraced(function* (props) {
|
|
626
627
|
const { createInvitationUrl, onReset } = props;
|
|
627
628
|
const capabilityManager = yield* Capability2.Service;
|
|
628
|
-
return Capability2.contributes(
|
|
629
|
-
|
|
629
|
+
return Capability2.contributes(Capabilities.ReactSurface, [
|
|
630
|
+
Surface.create({
|
|
630
631
|
id: Account.Profile,
|
|
631
632
|
role: "article",
|
|
632
633
|
filter: (data) => data.subject === Account.Profile,
|
|
633
634
|
component: () => /* @__PURE__ */ React7.createElement(ProfileContainer, null)
|
|
634
635
|
}),
|
|
635
|
-
|
|
636
|
+
Surface.create({
|
|
636
637
|
id: Account.Devices,
|
|
637
638
|
role: "article",
|
|
638
639
|
filter: (data) => data.subject === Account.Devices,
|
|
@@ -640,25 +641,25 @@ var react_surface_default = Capability2.makeModule(Effect2.fnUntraced(function*
|
|
|
640
641
|
createInvitationUrl
|
|
641
642
|
})
|
|
642
643
|
}),
|
|
643
|
-
|
|
644
|
+
Surface.create({
|
|
644
645
|
id: Account.Security,
|
|
645
646
|
role: "article",
|
|
646
647
|
filter: (data) => data.subject === Account.Security,
|
|
647
648
|
component: () => /* @__PURE__ */ React7.createElement(RecoveryCredentialsContainer, null)
|
|
648
649
|
}),
|
|
649
|
-
|
|
650
|
+
Surface.create({
|
|
650
651
|
id: JOIN_DIALOG,
|
|
651
652
|
role: "dialog",
|
|
652
653
|
filter: (data) => data.component === JOIN_DIALOG,
|
|
653
654
|
component: ({ data }) => /* @__PURE__ */ React7.createElement(JoinDialog, data.props)
|
|
654
655
|
}),
|
|
655
|
-
|
|
656
|
+
Surface.create({
|
|
656
657
|
id: RECOVERY_CODE_DIALOG,
|
|
657
658
|
role: "dialog",
|
|
658
659
|
filter: (data) => data.component === RECOVERY_CODE_DIALOG,
|
|
659
660
|
component: ({ data }) => /* @__PURE__ */ React7.createElement(RecoveryCodeDialog, data.props)
|
|
660
661
|
}),
|
|
661
|
-
|
|
662
|
+
Surface.create({
|
|
662
663
|
id: RESET_DIALOG,
|
|
663
664
|
role: "dialog",
|
|
664
665
|
filter: (data) => data.component === RESET_DIALOG,
|
|
@@ -673,4 +674,4 @@ var react_surface_default = Capability2.makeModule(Effect2.fnUntraced(function*
|
|
|
673
674
|
export {
|
|
674
675
|
react_surface_default as default
|
|
675
676
|
};
|
|
676
|
-
//# sourceMappingURL=react-surface-
|
|
677
|
+
//# sourceMappingURL=react-surface-BHJMHIMH.mjs.map
|