@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
|
@@ -4,9 +4,9 @@ import {
|
|
|
4
4
|
|
|
5
5
|
// src/capabilities/migrations/migrations.ts
|
|
6
6
|
import * as Effect from "effect/Effect";
|
|
7
|
-
import {
|
|
7
|
+
import { Capabilities, Capability } from "@dxos/app-framework";
|
|
8
8
|
var migrations_default = Capability.makeModule(Effect.fnUntraced(function* () {
|
|
9
|
-
const registry = yield* Capability.get(
|
|
9
|
+
const registry = yield* Capability.get(Capabilities.AtomRegistry);
|
|
10
10
|
const client = yield* Capability.get(ClientCapabilities.Client);
|
|
11
11
|
const migrationsAtom = yield* Capability.atom(ClientCapabilities.Migration);
|
|
12
12
|
const cancel = registry.subscribe(migrationsAtom, (_migrations) => {
|
|
@@ -16,9 +16,9 @@ var migrations_default = Capability.makeModule(Effect.fnUntraced(function* () {
|
|
|
16
16
|
}, {
|
|
17
17
|
immediate: true
|
|
18
18
|
});
|
|
19
|
-
return Capability.contributes(
|
|
19
|
+
return Capability.contributes(Capabilities.Null, null, () => Effect.sync(() => cancel()));
|
|
20
20
|
}));
|
|
21
21
|
export {
|
|
22
22
|
migrations_default as default
|
|
23
23
|
};
|
|
24
|
-
//# sourceMappingURL=migrations-
|
|
24
|
+
//# sourceMappingURL=migrations-YNQ7L5GT.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/browser/{operation-resolver-2NT3ISVP.mjs → operation-resolver-N4YCJ4KS.mjs}
RENAMED
|
@@ -12,7 +12,8 @@ import {
|
|
|
12
12
|
|
|
13
13
|
// src/capabilities/operation-resolver/operation-resolver.ts
|
|
14
14
|
import * as Effect from "effect/Effect";
|
|
15
|
-
import {
|
|
15
|
+
import { Capabilities, Capability } from "@dxos/app-framework";
|
|
16
|
+
import { LayoutOperation } from "@dxos/app-toolkit";
|
|
16
17
|
import { PublicKey } from "@dxos/client";
|
|
17
18
|
import { runAndForwardErrors } from "@dxos/effect";
|
|
18
19
|
import { invariant } from "@dxos/invariant";
|
|
@@ -23,14 +24,14 @@ var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-client/src/capabiliti
|
|
|
23
24
|
var RECOVER_IDENTITY_RPC_TIMEOUT = 2e4;
|
|
24
25
|
var operation_resolver_default = Capability.makeModule(Effect.fnUntraced(function* (props) {
|
|
25
26
|
const { appName = "Composer" } = props ?? {};
|
|
26
|
-
return Capability.contributes(
|
|
27
|
+
return Capability.contributes(Capabilities.OperationResolver, [
|
|
27
28
|
//
|
|
28
29
|
// CreateIdentity
|
|
29
30
|
//
|
|
30
31
|
OperationResolver.make({
|
|
31
32
|
operation: ClientOperation.CreateIdentity,
|
|
32
33
|
handler: Effect.fnUntraced(function* (profile) {
|
|
33
|
-
const manager = yield* Capability.get(
|
|
34
|
+
const manager = yield* Capability.get(Capabilities.PluginManager);
|
|
34
35
|
const client = yield* Capability.get(ClientCapabilities.Client);
|
|
35
36
|
const data = yield* Effect.promise(() => client.halo.createIdentity(profile));
|
|
36
37
|
yield* Effect.promise(() => runAndForwardErrors(manager.activate(ClientEvents.IdentityCreated)));
|
|
@@ -46,7 +47,7 @@ var operation_resolver_default = Capability.makeModule(Effect.fnUntraced(functio
|
|
|
46
47
|
OperationResolver.make({
|
|
47
48
|
operation: ClientOperation.JoinIdentity,
|
|
48
49
|
handler: Effect.fnUntraced(function* (data) {
|
|
49
|
-
yield* Operation.invoke(
|
|
50
|
+
yield* Operation.invoke(LayoutOperation.UpdateDialog, {
|
|
50
51
|
subject: JOIN_DIALOG,
|
|
51
52
|
blockAlign: "start",
|
|
52
53
|
props: {
|
|
@@ -62,10 +63,10 @@ var operation_resolver_default = Capability.makeModule(Effect.fnUntraced(functio
|
|
|
62
63
|
OperationResolver.make({
|
|
63
64
|
operation: ClientOperation.ShareIdentity,
|
|
64
65
|
handler: Effect.fnUntraced(function* () {
|
|
65
|
-
yield* Operation.invoke(
|
|
66
|
+
yield* Operation.invoke(LayoutOperation.SwitchWorkspace, {
|
|
66
67
|
subject: Account.id
|
|
67
68
|
});
|
|
68
|
-
yield* Operation.invoke(
|
|
69
|
+
yield* Operation.invoke(LayoutOperation.Open, {
|
|
69
70
|
subject: [
|
|
70
71
|
Account.Profile
|
|
71
72
|
]
|
|
@@ -81,7 +82,7 @@ var operation_resolver_default = Capability.makeModule(Effect.fnUntraced(functio
|
|
|
81
82
|
OperationResolver.make({
|
|
82
83
|
operation: ClientOperation.RecoverIdentity,
|
|
83
84
|
handler: Effect.fnUntraced(function* () {
|
|
84
|
-
yield* Operation.invoke(
|
|
85
|
+
yield* Operation.invoke(LayoutOperation.UpdateDialog, {
|
|
85
86
|
subject: JOIN_DIALOG,
|
|
86
87
|
blockAlign: "start",
|
|
87
88
|
props: {
|
|
@@ -96,7 +97,7 @@ var operation_resolver_default = Capability.makeModule(Effect.fnUntraced(functio
|
|
|
96
97
|
OperationResolver.make({
|
|
97
98
|
operation: ClientOperation.ResetStorage,
|
|
98
99
|
handler: Effect.fnUntraced(function* (data) {
|
|
99
|
-
yield* Operation.invoke(
|
|
100
|
+
yield* Operation.invoke(LayoutOperation.UpdateDialog, {
|
|
100
101
|
subject: RESET_DIALOG,
|
|
101
102
|
blockAlign: "start",
|
|
102
103
|
props: {
|
|
@@ -114,7 +115,7 @@ var operation_resolver_default = Capability.makeModule(Effect.fnUntraced(functio
|
|
|
114
115
|
const client = yield* Capability.get(ClientCapabilities.Client);
|
|
115
116
|
invariant(client.services.services.EdgeAgentService, "Missing EdgeAgentService", {
|
|
116
117
|
F: __dxlog_file,
|
|
117
|
-
L:
|
|
118
|
+
L: 115,
|
|
118
119
|
S: this,
|
|
119
120
|
A: [
|
|
120
121
|
"client.services.services.EdgeAgentService",
|
|
@@ -135,7 +136,7 @@ var operation_resolver_default = Capability.makeModule(Effect.fnUntraced(functio
|
|
|
135
136
|
const client = yield* Capability.get(ClientCapabilities.Client);
|
|
136
137
|
invariant(client.services.services.IdentityService, "IdentityService not available", {
|
|
137
138
|
F: __dxlog_file,
|
|
138
|
-
L:
|
|
139
|
+
L: 129,
|
|
139
140
|
S: this,
|
|
140
141
|
A: [
|
|
141
142
|
"client.services.services.IdentityService",
|
|
@@ -143,7 +144,7 @@ var operation_resolver_default = Capability.makeModule(Effect.fnUntraced(functio
|
|
|
143
144
|
]
|
|
144
145
|
});
|
|
145
146
|
const { recoveryCode } = yield* Effect.promise(() => client.services.services.IdentityService.createRecoveryCredential({}));
|
|
146
|
-
yield* Operation.invoke(
|
|
147
|
+
yield* Operation.invoke(LayoutOperation.UpdateDialog, {
|
|
147
148
|
subject: RECOVERY_CODE_DIALOG,
|
|
148
149
|
blockAlign: "start",
|
|
149
150
|
type: "alert",
|
|
@@ -163,7 +164,7 @@ var operation_resolver_default = Capability.makeModule(Effect.fnUntraced(functio
|
|
|
163
164
|
const identity = client.halo.identity.get();
|
|
164
165
|
invariant(identity, "Identity not available", {
|
|
165
166
|
F: __dxlog_file,
|
|
166
|
-
L:
|
|
167
|
+
L: 150,
|
|
167
168
|
S: this,
|
|
168
169
|
A: [
|
|
169
170
|
"identity",
|
|
@@ -201,7 +202,7 @@ var operation_resolver_default = Capability.makeModule(Effect.fnUntraced(functio
|
|
|
201
202
|
}));
|
|
202
203
|
invariant(credential, "Credential not available", {
|
|
203
204
|
F: __dxlog_file,
|
|
204
|
-
L:
|
|
205
|
+
L: 175,
|
|
205
206
|
S: this,
|
|
206
207
|
A: [
|
|
207
208
|
"credential",
|
|
@@ -212,7 +213,7 @@ var operation_resolver_default = Capability.makeModule(Effect.fnUntraced(functio
|
|
|
212
213
|
const algorithm = credential.response.getPublicKeyAlgorithm() === -7 ? "ES256" : "ED25519";
|
|
213
214
|
invariant(client.services.services.IdentityService, "IdentityService not available", {
|
|
214
215
|
F: __dxlog_file,
|
|
215
|
-
L:
|
|
216
|
+
L: 179,
|
|
216
217
|
S: this,
|
|
217
218
|
A: [
|
|
218
219
|
"client.services.services.IdentityService",
|
|
@@ -237,7 +238,7 @@ var operation_resolver_default = Capability.makeModule(Effect.fnUntraced(functio
|
|
|
237
238
|
const client = yield* Capability.get(ClientCapabilities.Client);
|
|
238
239
|
invariant(client.services.services.IdentityService, "IdentityService not available", {
|
|
239
240
|
F: __dxlog_file,
|
|
240
|
-
L:
|
|
241
|
+
L: 199,
|
|
241
242
|
S: this,
|
|
242
243
|
A: [
|
|
243
244
|
"client.services.services.IdentityService",
|
|
@@ -276,7 +277,7 @@ var operation_resolver_default = Capability.makeModule(Effect.fnUntraced(functio
|
|
|
276
277
|
const client = yield* Capability.get(ClientCapabilities.Client);
|
|
277
278
|
invariant(client.services.services.IdentityService, "IdentityService not available", {
|
|
278
279
|
F: __dxlog_file,
|
|
279
|
-
L:
|
|
280
|
+
L: 238,
|
|
280
281
|
S: this,
|
|
281
282
|
A: [
|
|
282
283
|
"client.services.services.IdentityService",
|
|
@@ -295,4 +296,4 @@ var operation_resolver_default = Capability.makeModule(Effect.fnUntraced(functio
|
|
|
295
296
|
export {
|
|
296
297
|
operation_resolver_default as default
|
|
297
298
|
};
|
|
298
|
-
//# sourceMappingURL=operation-resolver-
|
|
299
|
+
//# sourceMappingURL=operation-resolver-N4YCJ4KS.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: RECOV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,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
|
+
}
|
|
@@ -6,10 +6,10 @@ import {
|
|
|
6
6
|
// src/capabilities/react-context/react-context.tsx
|
|
7
7
|
import * as Effect from "effect/Effect";
|
|
8
8
|
import React from "react";
|
|
9
|
-
import {
|
|
10
|
-
import { useCapability } from "@dxos/app-framework/
|
|
9
|
+
import { Capabilities, Capability } from "@dxos/app-framework";
|
|
10
|
+
import { useCapability } from "@dxos/app-framework/ui";
|
|
11
11
|
import { ClientProvider } from "@dxos/react-client";
|
|
12
|
-
var react_context_default = Capability.makeModule(() => Effect.succeed(Capability.contributes(
|
|
12
|
+
var react_context_default = Capability.makeModule(() => Effect.succeed(Capability.contributes(Capabilities.ReactContext, {
|
|
13
13
|
id: meta.id,
|
|
14
14
|
context: ({ children }) => {
|
|
15
15
|
const client = useCapability(ClientCapabilities.Client);
|
|
@@ -21,4 +21,4 @@ var react_context_default = Capability.makeModule(() => Effect.succeed(Capabilit
|
|
|
21
21
|
export {
|
|
22
22
|
react_context_default as default
|
|
23
23
|
};
|
|
24
|
-
//# sourceMappingURL=react-context-
|
|
24
|
+
//# sourceMappingURL=react-context-FDXHIBZL.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
|
+
}
|
|
@@ -12,21 +12,21 @@ import {
|
|
|
12
12
|
// src/capabilities/react-surface/react-surface.tsx
|
|
13
13
|
import * as Effect2 from "effect/Effect";
|
|
14
14
|
import React7 from "react";
|
|
15
|
-
import { Capability as Capability2
|
|
15
|
+
import { Capabilities, Capability as Capability2 } from "@dxos/app-framework";
|
|
16
|
+
import { Surface } from "@dxos/app-framework/ui";
|
|
16
17
|
|
|
17
18
|
// src/components/DevicesContainer.tsx
|
|
18
19
|
import React, { useCallback, useEffect, useState } from "react";
|
|
19
20
|
import { QR } from "react-qr-rounded";
|
|
20
|
-
import { useOperationInvoker } from "@dxos/app-framework/
|
|
21
|
+
import { useOperationInvoker } from "@dxos/app-framework/ui";
|
|
21
22
|
import { log } from "@dxos/log";
|
|
22
23
|
import { useClient, useMulticastObservable } from "@dxos/react-client";
|
|
23
24
|
import { useDevices } from "@dxos/react-client/halo";
|
|
24
25
|
import { Invitation, InvitationEncoder } from "@dxos/react-client/invitations";
|
|
25
26
|
import { useNetworkStatus } from "@dxos/react-client/mesh";
|
|
26
27
|
import { Button, Clipboard, Icon, IconButton, List, useId, useTranslation } from "@dxos/react-ui";
|
|
27
|
-
import {
|
|
28
|
-
import { translationKey } from "@dxos/shell/react";
|
|
29
|
-
import { AuthCode, Centered, DeviceListItem, Emoji, Viewport } from "@dxos/shell/react";
|
|
28
|
+
import { Settings } from "@dxos/react-ui-form";
|
|
29
|
+
import { AuthCode, Centered, DeviceListItem, Emoji, Viewport, translationKey } from "@dxos/shell/react";
|
|
30
30
|
import { osTranslations } from "@dxos/ui-theme";
|
|
31
31
|
import { hexToEmoji } from "@dxos/util";
|
|
32
32
|
var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-client/src/components/DevicesContainer.tsx";
|
|
@@ -48,35 +48,33 @@ var DevicesContainer = ({ createInvitationUrl }) => {
|
|
|
48
48
|
}), [
|
|
49
49
|
invokePromise
|
|
50
50
|
]);
|
|
51
|
-
return /* @__PURE__ */ React.createElement(Clipboard.Provider, null, /* @__PURE__ */ React.createElement(
|
|
51
|
+
return /* @__PURE__ */ React.createElement(Clipboard.Provider, null, /* @__PURE__ */ React.createElement(Settings.Root, null, /* @__PURE__ */ React.createElement(Settings.Section, {
|
|
52
52
|
title: t("devices verbose label", {
|
|
53
53
|
ns: meta.id
|
|
54
54
|
}),
|
|
55
55
|
description: t("devices description", {
|
|
56
56
|
ns: meta.id
|
|
57
57
|
})
|
|
58
|
-
}, /* @__PURE__ */ React.createElement(
|
|
58
|
+
}, /* @__PURE__ */ React.createElement(Settings.Frame, null, /* @__PURE__ */ React.createElement(Settings.FrameItem, {
|
|
59
59
|
title: t("devices label", {
|
|
60
60
|
ns: meta.id
|
|
61
61
|
})
|
|
62
|
-
}, /* @__PURE__ */ React.createElement(List, null, devices.map((device) => {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
});
|
|
68
|
-
}))), createInvitationUrl && /* @__PURE__ */ React.createElement(ControlFrameItem, {
|
|
62
|
+
}, /* @__PURE__ */ React.createElement(List, null, devices.map((device) => /* @__PURE__ */ React.createElement(DeviceListItem, {
|
|
63
|
+
key: device.deviceKey.toHex(),
|
|
64
|
+
device,
|
|
65
|
+
connectionState
|
|
66
|
+
})))), createInvitationUrl && /* @__PURE__ */ React.createElement(Settings.FrameItem, {
|
|
69
67
|
title: "Add device"
|
|
70
68
|
}, /* @__PURE__ */ React.createElement(DeviceInvitation, {
|
|
71
69
|
createInvitationUrl
|
|
72
|
-
})))), /* @__PURE__ */ React.createElement(
|
|
70
|
+
})))), /* @__PURE__ */ React.createElement(Settings.Section, {
|
|
73
71
|
title: t("danger zone title", {
|
|
74
72
|
ns: meta.id
|
|
75
73
|
}),
|
|
76
74
|
description: t("danger zone description", {
|
|
77
75
|
ns: meta.id
|
|
78
76
|
})
|
|
79
|
-
}, /* @__PURE__ */ React.createElement(
|
|
77
|
+
}, /* @__PURE__ */ React.createElement(Settings.Group, null, /* @__PURE__ */ React.createElement(Settings.Item, {
|
|
80
78
|
title: t("reset device label"),
|
|
81
79
|
description: t("reset device description", {
|
|
82
80
|
ns: meta.id
|
|
@@ -85,7 +83,7 @@ var DevicesContainer = ({ createInvitationUrl }) => {
|
|
|
85
83
|
variant: "destructive",
|
|
86
84
|
onClick: handleResetStorage,
|
|
87
85
|
"data-testid": "devicesContainer.reset"
|
|
88
|
-
}, t("reset device label"))), /* @__PURE__ */ React.createElement(
|
|
86
|
+
}, t("reset device label"))), /* @__PURE__ */ React.createElement(Settings.Item, {
|
|
89
87
|
title: t("recover identity label"),
|
|
90
88
|
description: t("recover identity description", {
|
|
91
89
|
ns: meta.id
|
|
@@ -94,7 +92,7 @@ var DevicesContainer = ({ createInvitationUrl }) => {
|
|
|
94
92
|
variant: "destructive",
|
|
95
93
|
onClick: handleRecover,
|
|
96
94
|
"data-testid": "devicesContainer.recover"
|
|
97
|
-
}, t("recover identity label"))), /* @__PURE__ */ React.createElement(
|
|
95
|
+
}, t("recover identity label"))), /* @__PURE__ */ React.createElement(Settings.Item, {
|
|
98
96
|
title: t("join new identity label"),
|
|
99
97
|
description: t("join new identity description", {
|
|
100
98
|
ns: meta.id
|
|
@@ -119,7 +117,7 @@ var DeviceInvitation = (props) => {
|
|
|
119
117
|
authCode: invitation3.authCode
|
|
120
118
|
}), void 0, {
|
|
121
119
|
F: __dxlog_file,
|
|
122
|
-
L:
|
|
120
|
+
L: 117,
|
|
123
121
|
S: void 0,
|
|
124
122
|
C: (f, a) => f(...a)
|
|
125
123
|
});
|
|
@@ -272,8 +270,8 @@ var InvitationComplete = ({ statusValue }) => {
|
|
|
272
270
|
|
|
273
271
|
// src/components/JoinDialog.tsx
|
|
274
272
|
import React2, { useCallback as useCallback2 } from "react";
|
|
275
|
-
import {
|
|
276
|
-
import {
|
|
273
|
+
import { useOperationInvoker as useOperationInvoker2 } from "@dxos/app-framework/ui";
|
|
274
|
+
import { LayoutOperation } from "@dxos/app-toolkit";
|
|
277
275
|
import { ObservabilityOperation } from "@dxos/plugin-observability/types";
|
|
278
276
|
import { Dialog, useTranslation as useTranslation2 } from "@dxos/react-ui";
|
|
279
277
|
import { JoinPanel } from "@dxos/shell/react";
|
|
@@ -287,7 +285,7 @@ var JoinDialog = (props) => {
|
|
|
287
285
|
const handleDone = useCallback2(async (result) => {
|
|
288
286
|
if (result?.identityKey) {
|
|
289
287
|
await Promise.all([
|
|
290
|
-
invokePromise(
|
|
288
|
+
invokePromise(LayoutOperation.UpdateDialog, {
|
|
291
289
|
state: false
|
|
292
290
|
}),
|
|
293
291
|
invokePromise(ObservabilityOperation.SendEvent, {
|
|
@@ -323,7 +321,7 @@ import { debounce } from "@dxos/async";
|
|
|
323
321
|
import { useClient as useClient2 } from "@dxos/react-client";
|
|
324
322
|
import { useIdentity } from "@dxos/react-client/halo";
|
|
325
323
|
import { ButtonGroup, Clipboard as Clipboard2, Input, useTranslation as useTranslation3 } from "@dxos/react-ui";
|
|
326
|
-
import {
|
|
324
|
+
import { Form, Settings as Settings2 } from "@dxos/react-ui-form";
|
|
327
325
|
import { EmojiPickerBlock, HuePicker } from "@dxos/react-ui-pickers";
|
|
328
326
|
import { hexToEmoji as hexToEmoji2, hexToHue } from "@dxos/util";
|
|
329
327
|
var UserProfile = Schema.Struct({
|
|
@@ -397,7 +395,7 @@ var ProfileContainer = () => {
|
|
|
397
395
|
onValueChange,
|
|
398
396
|
type
|
|
399
397
|
]);
|
|
400
|
-
return /* @__PURE__ */ React3.createElement(
|
|
398
|
+
return /* @__PURE__ */ React3.createElement(Settings2.ItemInput, {
|
|
401
399
|
title: label,
|
|
402
400
|
description: t("display name description")
|
|
403
401
|
}, /* @__PURE__ */ React3.createElement(Input.TextInput, {
|
|
@@ -416,7 +414,7 @@ var ProfileContainer = () => {
|
|
|
416
414
|
onValueChange,
|
|
417
415
|
type
|
|
418
416
|
]);
|
|
419
|
-
return /* @__PURE__ */ React3.createElement(
|
|
417
|
+
return /* @__PURE__ */ React3.createElement(Settings2.Item, {
|
|
420
418
|
title: label,
|
|
421
419
|
description: t("icon description")
|
|
422
420
|
}, /* @__PURE__ */ React3.createElement(EmojiPickerBlock, {
|
|
@@ -436,7 +434,7 @@ var ProfileContainer = () => {
|
|
|
436
434
|
onValueChange,
|
|
437
435
|
type
|
|
438
436
|
]);
|
|
439
|
-
return /* @__PURE__ */ React3.createElement(
|
|
437
|
+
return /* @__PURE__ */ React3.createElement(Settings2.Item, {
|
|
440
438
|
title: label,
|
|
441
439
|
description: t("hue description")
|
|
442
440
|
}, /* @__PURE__ */ React3.createElement("div", {
|
|
@@ -450,10 +448,12 @@ var ProfileContainer = () => {
|
|
|
450
448
|
},
|
|
451
449
|
// TODO(wittjosiah): We need text input annotations for disabled and copyable.
|
|
452
450
|
did: ({ label, getValue }) => {
|
|
453
|
-
return /* @__PURE__ */ React3.createElement(
|
|
451
|
+
return /* @__PURE__ */ React3.createElement(Settings2.ItemInput, {
|
|
454
452
|
title: label,
|
|
455
453
|
description: t("did description")
|
|
456
|
-
}, /* @__PURE__ */ React3.createElement(ButtonGroup,
|
|
454
|
+
}, /* @__PURE__ */ React3.createElement(ButtonGroup, {
|
|
455
|
+
classNames: "is-full"
|
|
456
|
+
}, /* @__PURE__ */ React3.createElement(Input.TextInput, {
|
|
457
457
|
value: getValue(),
|
|
458
458
|
disabled: true,
|
|
459
459
|
classNames: "min-is-64"
|
|
@@ -464,7 +464,7 @@ var ProfileContainer = () => {
|
|
|
464
464
|
}), [
|
|
465
465
|
t
|
|
466
466
|
]);
|
|
467
|
-
return /* @__PURE__ */ React3.createElement(
|
|
467
|
+
return /* @__PURE__ */ React3.createElement(Clipboard2.Provider, null, /* @__PURE__ */ React3.createElement(Settings2.Root, null, /* @__PURE__ */ React3.createElement(Settings2.Section, {
|
|
468
468
|
title: t("profile label"),
|
|
469
469
|
description: t("profile description")
|
|
470
470
|
}, /* @__PURE__ */ React3.createElement(Form.Root, {
|
|
@@ -473,7 +473,7 @@ var ProfileContainer = () => {
|
|
|
473
473
|
fieldMap,
|
|
474
474
|
onValuesChanged: handleChange
|
|
475
475
|
}, /* @__PURE__ */ React3.createElement(Form.Content, null, /* @__PURE__ */ React3.createElement(Form.FieldSet, {
|
|
476
|
-
classNames: "
|
|
476
|
+
classNames: "space-y-trimMd"
|
|
477
477
|
}))))));
|
|
478
478
|
};
|
|
479
479
|
|
|
@@ -529,20 +529,20 @@ var Code = ({ code }) => {
|
|
|
529
529
|
|
|
530
530
|
// src/components/RecoveryCredentialsContainer.tsx
|
|
531
531
|
import React5 from "react";
|
|
532
|
-
import { useOperationInvoker as useOperationInvoker3 } from "@dxos/app-framework/
|
|
532
|
+
import { useOperationInvoker as useOperationInvoker3 } from "@dxos/app-framework/ui";
|
|
533
533
|
import { useCredentials } from "@dxos/react-client/halo";
|
|
534
534
|
import { Icon as Icon2, IconButton as IconButton2, List as List2, ListItem, Message, useTranslation as useTranslation5 } from "@dxos/react-ui";
|
|
535
|
-
import {
|
|
535
|
+
import { Settings as Settings3 } from "@dxos/react-ui-form";
|
|
536
536
|
var MANAGE_CREDENTIALS_DIALOG = `${meta.id}/ManageCredentialsDialog`;
|
|
537
537
|
var RecoveryCredentialsContainer = () => {
|
|
538
538
|
const { t } = useTranslation5(meta.id);
|
|
539
539
|
const { invokePromise } = useOperationInvoker3();
|
|
540
540
|
const credentials = useCredentials();
|
|
541
541
|
const recoveryCredentials = credentials.filter((credential) => credential.subject.assertion["@type"] === "dxos.halo.credentials.IdentityRecovery");
|
|
542
|
-
return /* @__PURE__ */ React5.createElement(
|
|
542
|
+
return /* @__PURE__ */ React5.createElement(Settings3.Root, null, /* @__PURE__ */ React5.createElement(Settings3.Section, {
|
|
543
543
|
title: t("recovery setup dialog title"),
|
|
544
544
|
description: t("recovery setup dialog description")
|
|
545
|
-
}, /* @__PURE__ */ React5.createElement(
|
|
545
|
+
}, /* @__PURE__ */ React5.createElement(Settings3.Group, null, /* @__PURE__ */ React5.createElement(Settings3.Item, {
|
|
546
546
|
title: t("create passkey label"),
|
|
547
547
|
description: t("create passkey description")
|
|
548
548
|
}, /* @__PURE__ */ React5.createElement(IconButton2, {
|
|
@@ -550,7 +550,7 @@ var RecoveryCredentialsContainer = () => {
|
|
|
550
550
|
icon: "ph--key--duotone",
|
|
551
551
|
variant: "primary",
|
|
552
552
|
onClick: () => invokePromise(ClientOperation.CreatePasskey)
|
|
553
|
-
})), /* @__PURE__ */ React5.createElement(
|
|
553
|
+
})), /* @__PURE__ */ React5.createElement(Settings3.Item, {
|
|
554
554
|
title: t("create recovery code label"),
|
|
555
555
|
description: t("create recovery code description")
|
|
556
556
|
}, /* @__PURE__ */ React5.createElement(IconButton2, {
|
|
@@ -558,7 +558,7 @@ var RecoveryCredentialsContainer = () => {
|
|
|
558
558
|
icon: "ph--receipt--duotone",
|
|
559
559
|
variant: "default",
|
|
560
560
|
onClick: () => invokePromise(ClientOperation.CreateRecoveryCode)
|
|
561
|
-
})))), /* @__PURE__ */ React5.createElement(
|
|
561
|
+
})))), /* @__PURE__ */ React5.createElement(Settings3.Section, {
|
|
562
562
|
title: t("credentials list label")
|
|
563
563
|
}, recoveryCredentials.length < 1 ? /* @__PURE__ */ React5.createElement(Message.Root, {
|
|
564
564
|
valence: "error",
|
|
@@ -577,8 +577,9 @@ var RecoveryCredentialsContainer = () => {
|
|
|
577
577
|
// src/components/ResetDialog.tsx
|
|
578
578
|
import * as Effect from "effect/Effect";
|
|
579
579
|
import React6, { useCallback as useCallback5 } from "react";
|
|
580
|
-
import { Capability
|
|
581
|
-
import { useOperationInvoker as useOperationInvoker4 } from "@dxos/app-framework/
|
|
580
|
+
import { Capability } from "@dxos/app-framework";
|
|
581
|
+
import { useOperationInvoker as useOperationInvoker4 } from "@dxos/app-framework/ui";
|
|
582
|
+
import { LayoutOperation as LayoutOperation2 } from "@dxos/app-toolkit";
|
|
582
583
|
import { runAndForwardErrors } from "@dxos/effect";
|
|
583
584
|
import { useClient as useClient3 } from "@dxos/react-client";
|
|
584
585
|
import { Dialog as Dialog2, useTranslation as useTranslation6 } from "@dxos/react-ui";
|
|
@@ -602,13 +603,13 @@ var ResetDialog = ({ mode, onReset, capabilityManager }) => {
|
|
|
602
603
|
capabilityManager
|
|
603
604
|
]);
|
|
604
605
|
const handleCancel = useCallback5(() => {
|
|
605
|
-
void invokePromise(
|
|
606
|
+
void invokePromise(LayoutOperation2.UpdateDialog, {
|
|
606
607
|
state: false
|
|
607
608
|
});
|
|
608
609
|
}, [
|
|
609
610
|
invokePromise
|
|
610
611
|
]);
|
|
611
|
-
return /* @__PURE__ */ React6.createElement(Dialog2.Content, null, /* @__PURE__ */ React6.createElement(Dialog2.Title, {
|
|
612
|
+
return /* @__PURE__ */ React6.createElement(React6.Fragment, null, /* @__PURE__ */ React6.createElement(Dialog2.Content, null, /* @__PURE__ */ React6.createElement(Dialog2.Title, {
|
|
612
613
|
classNames: "sr-only"
|
|
613
614
|
}, t("reset dialog title")), /* @__PURE__ */ React6.createElement(Dialog2.Description, {
|
|
614
615
|
classNames: "sr-only"
|
|
@@ -617,21 +618,21 @@ var ResetDialog = ({ mode, onReset, capabilityManager }) => {
|
|
|
617
618
|
mode,
|
|
618
619
|
onConfirm: handleReset,
|
|
619
620
|
onCancel: handleCancel
|
|
620
|
-
}));
|
|
621
|
+
})));
|
|
621
622
|
};
|
|
622
623
|
|
|
623
624
|
// src/capabilities/react-surface/react-surface.tsx
|
|
624
625
|
var react_surface_default = Capability2.makeModule(Effect2.fnUntraced(function* (props) {
|
|
625
626
|
const { createInvitationUrl, onReset } = props;
|
|
626
627
|
const capabilityManager = yield* Capability2.Service;
|
|
627
|
-
return Capability2.contributes(
|
|
628
|
-
|
|
628
|
+
return Capability2.contributes(Capabilities.ReactSurface, [
|
|
629
|
+
Surface.create({
|
|
629
630
|
id: Account.Profile,
|
|
630
631
|
role: "article",
|
|
631
632
|
filter: (data) => data.subject === Account.Profile,
|
|
632
633
|
component: () => /* @__PURE__ */ React7.createElement(ProfileContainer, null)
|
|
633
634
|
}),
|
|
634
|
-
|
|
635
|
+
Surface.create({
|
|
635
636
|
id: Account.Devices,
|
|
636
637
|
role: "article",
|
|
637
638
|
filter: (data) => data.subject === Account.Devices,
|
|
@@ -639,25 +640,25 @@ var react_surface_default = Capability2.makeModule(Effect2.fnUntraced(function*
|
|
|
639
640
|
createInvitationUrl
|
|
640
641
|
})
|
|
641
642
|
}),
|
|
642
|
-
|
|
643
|
+
Surface.create({
|
|
643
644
|
id: Account.Security,
|
|
644
645
|
role: "article",
|
|
645
646
|
filter: (data) => data.subject === Account.Security,
|
|
646
647
|
component: () => /* @__PURE__ */ React7.createElement(RecoveryCredentialsContainer, null)
|
|
647
648
|
}),
|
|
648
|
-
|
|
649
|
+
Surface.create({
|
|
649
650
|
id: JOIN_DIALOG,
|
|
650
651
|
role: "dialog",
|
|
651
652
|
filter: (data) => data.component === JOIN_DIALOG,
|
|
652
653
|
component: ({ data }) => /* @__PURE__ */ React7.createElement(JoinDialog, data.props)
|
|
653
654
|
}),
|
|
654
|
-
|
|
655
|
+
Surface.create({
|
|
655
656
|
id: RECOVERY_CODE_DIALOG,
|
|
656
657
|
role: "dialog",
|
|
657
658
|
filter: (data) => data.component === RECOVERY_CODE_DIALOG,
|
|
658
659
|
component: ({ data }) => /* @__PURE__ */ React7.createElement(RecoveryCodeDialog, data.props)
|
|
659
660
|
}),
|
|
660
|
-
|
|
661
|
+
Surface.create({
|
|
661
662
|
id: RESET_DIALOG,
|
|
662
663
|
role: "dialog",
|
|
663
664
|
filter: (data) => data.component === RESET_DIALOG,
|
|
@@ -672,4 +673,4 @@ var react_surface_default = Capability2.makeModule(Effect2.fnUntraced(function*
|
|
|
672
673
|
export {
|
|
673
674
|
react_surface_default as default
|
|
674
675
|
};
|
|
675
|
-
//# sourceMappingURL=react-surface-
|
|
676
|
+
//# sourceMappingURL=react-surface-ZP3FLVRS.mjs.map
|