@dxos/plugin-client 0.8.4-main.3a94e84 → 0.8.4-main.3c1ae3b
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-JNIES5L4.mjs → app-graph-builder-7LBCMPIW.mjs} +26 -25
- package/dist/lib/browser/app-graph-builder-7LBCMPIW.mjs.map +7 -0
- package/dist/lib/browser/chunk-4LRO3Y2O.mjs +19 -0
- package/dist/lib/browser/chunk-4LRO3Y2O.mjs.map +7 -0
- package/dist/lib/browser/{chunk-SV3MHIKI.mjs → chunk-HZSIIWH5.mjs} +76 -82
- package/dist/lib/browser/chunk-HZSIIWH5.mjs.map +7 -0
- package/dist/lib/browser/{chunk-RMHBOY3Y.mjs → chunk-RDIG75CA.mjs} +3 -3
- package/dist/lib/browser/chunk-RDIG75CA.mjs.map +7 -0
- package/dist/lib/browser/chunk-UZTC5O5A.mjs +17 -0
- package/dist/lib/browser/chunk-UZTC5O5A.mjs.map +7 -0
- package/dist/lib/browser/chunk-ZRVMXLDR.mjs +15 -0
- package/dist/lib/browser/chunk-ZRVMXLDR.mjs.map +7 -0
- package/dist/lib/browser/{client-SKVKXPLY.mjs → client-KIPUUVWJ.mjs} +14 -8
- package/dist/lib/browser/client-KIPUUVWJ.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +23 -19
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/{intent-resolver-LNPLD5CA.mjs → intent-resolver-N4J2B5KF.mjs} +18 -18
- package/dist/lib/browser/intent-resolver-N4J2B5KF.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{migrations-D76RCG72.mjs → migrations-RCNZRP3I.mjs} +6 -6
- package/dist/lib/browser/migrations-RCNZRP3I.mjs.map +7 -0
- package/dist/lib/browser/{react-context-YWVPZUMU.mjs → react-context-JYJ63L5S.mjs} +9 -8
- package/dist/lib/browser/react-context-JYJ63L5S.mjs.map +7 -0
- package/dist/lib/browser/{react-surface-QFZTDNLS.mjs → react-surface-X6YMVGZZ.mjs} +8 -8
- package/dist/lib/browser/react-surface-X6YMVGZZ.mjs.map +7 -0
- package/dist/lib/browser/{schema-defs-HKW6VNZB.mjs → schema-defs-DKGLMWWM.mjs} +8 -8
- package/dist/lib/browser/schema-defs-DKGLMWWM.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +2 -2
- package/dist/lib/node-esm/{app-graph-builder-SWFB4FID.mjs → app-graph-builder-4CVWKYZ6.mjs} +26 -25
- package/dist/lib/node-esm/app-graph-builder-4CVWKYZ6.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-7M7VWQJW.mjs +20 -0
- package/dist/lib/node-esm/chunk-7M7VWQJW.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-DQDFIOXV.mjs +18 -0
- package/dist/lib/node-esm/chunk-DQDFIOXV.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-QT3EQXDU.mjs +17 -0
- package/dist/lib/node-esm/chunk-QT3EQXDU.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-FBYODKEL.mjs → chunk-RGCZX67B.mjs} +76 -82
- package/dist/lib/node-esm/chunk-RGCZX67B.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-5V3RCXZV.mjs → chunk-VENKFPBC.mjs} +3 -3
- package/dist/lib/node-esm/chunk-VENKFPBC.mjs.map +7 -0
- package/dist/lib/node-esm/{client-SLL6GDC2.mjs → client-W5DQW2E7.mjs} +14 -8
- package/dist/lib/node-esm/client-W5DQW2E7.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +23 -19
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/{intent-resolver-L7C6YRWV.mjs → intent-resolver-F2ZP2UQJ.mjs} +18 -18
- package/dist/lib/node-esm/intent-resolver-F2ZP2UQJ.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{migrations-YISDI7LF.mjs → migrations-TZFOPRPE.mjs} +6 -6
- package/dist/lib/node-esm/migrations-TZFOPRPE.mjs.map +7 -0
- package/dist/lib/node-esm/{react-context-EEHS4S3L.mjs → react-context-7BJGZI5D.mjs} +9 -8
- package/dist/lib/node-esm/react-context-7BJGZI5D.mjs.map +7 -0
- package/dist/lib/node-esm/{react-surface-2K6W37R4.mjs → react-surface-BWX37JGM.mjs} +8 -8
- package/dist/lib/node-esm/react-surface-BWX37JGM.mjs.map +7 -0
- package/dist/lib/node-esm/{schema-defs-5ZNI63RW.mjs → schema-defs-SLSDRMGM.mjs} +8 -8
- package/dist/lib/node-esm/schema-defs-SLSDRMGM.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +2 -2
- package/dist/types/src/ClientPlugin.d.ts +1 -1
- package/dist/types/src/ClientPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/capabilities.d.ts +2 -2
- package/dist/types/src/capabilities/capabilities.d.ts.map +1 -1
- package/dist/types/src/capabilities/client.d.ts +1 -1
- package/dist/types/src/capabilities/client.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +10 -10
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/migrations.d.ts +1 -1
- package/dist/types/src/capabilities/migrations.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-context.d.ts +2 -2
- package/dist/types/src/capabilities/react-context.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/schema-defs.d.ts +1 -1
- package/dist/types/src/capabilities/schema-defs.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 +224 -5
- package/dist/types/src/components/DevicesContainer.stories.d.ts.map +1 -1
- package/dist/types/src/components/JoinDialog.d.ts +1 -1
- package/dist/types/src/components/JoinDialog.d.ts.map +1 -1
- package/dist/types/src/components/ProfileContainer.d.ts.map +1 -1
- package/dist/types/src/components/ProfileContainer.stories.d.ts +57 -5
- package/dist/types/src/components/ProfileContainer.stories.d.ts.map +1 -1
- package/dist/types/src/components/RecoveryCodeDialog.d.ts +1 -1
- package/dist/types/src/components/RecoveryCodeDialog.d.ts.map +1 -1
- package/dist/types/src/components/RecoveryCodeDialog.stories.d.ts +59 -5
- package/dist/types/src/components/RecoveryCodeDialog.stories.d.ts.map +1 -1
- package/dist/types/src/components/RecoveryCredentialsContainer.d.ts +1 -1
- package/dist/types/src/components/RecoveryCredentialsContainer.d.ts.map +1 -1
- package/dist/types/src/components/RecoveryCredentialsContainer.stories.d.ts +57 -5
- package/dist/types/src/components/RecoveryCredentialsContainer.stories.d.ts.map +1 -1
- package/dist/types/src/components/ResetDialog.d.ts +1 -1
- package/dist/types/src/components/ResetDialog.d.ts.map +1 -1
- package/dist/types/src/components/ResetDialog.stories.d.ts +59 -4
- package/dist/types/src/components/ResetDialog.stories.d.ts.map +1 -1
- package/dist/types/src/events.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +3 -2
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +0 -1
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/types/schema.d.ts +10 -4
- package/dist/types/src/types/schema.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +37 -36
- package/src/ClientPlugin.ts +57 -59
- package/src/capabilities/app-graph-builder.ts +25 -23
- package/src/capabilities/capabilities.ts +4 -6
- package/src/capabilities/client.ts +6 -4
- package/src/capabilities/intent-resolver.ts +7 -6
- package/src/capabilities/migrations.ts +2 -2
- package/src/capabilities/react-context.tsx +5 -3
- package/src/capabilities/react-surface.tsx +4 -4
- package/src/capabilities/schema-defs.ts +6 -5
- package/src/components/DevicesContainer.stories.tsx +9 -11
- package/src/components/DevicesContainer.tsx +56 -69
- package/src/components/JoinDialog.tsx +5 -4
- package/src/components/ProfileContainer.stories.tsx +8 -9
- package/src/components/ProfileContainer.tsx +40 -45
- package/src/components/RecoveryCodeDialog.stories.tsx +9 -10
- package/src/components/RecoveryCodeDialog.tsx +6 -6
- package/src/components/RecoveryCredentialsContainer.stories.tsx +9 -11
- package/src/components/RecoveryCredentialsContainer.tsx +47 -51
- package/src/components/ResetDialog.stories.tsx +10 -11
- package/src/components/ResetDialog.tsx +5 -4
- package/src/events.ts +6 -6
- package/src/index.ts +4 -3
- package/src/meta.ts +6 -3
- package/src/types/schema.ts +4 -4
- package/dist/lib/browser/app-graph-builder-JNIES5L4.mjs.map +0 -7
- package/dist/lib/browser/chunk-3F2Q2RKC.mjs +0 -18
- package/dist/lib/browser/chunk-3F2Q2RKC.mjs.map +0 -7
- package/dist/lib/browser/chunk-CAF2COXW.mjs +0 -19
- package/dist/lib/browser/chunk-CAF2COXW.mjs.map +0 -7
- package/dist/lib/browser/chunk-GS3LDHYD.mjs +0 -12
- package/dist/lib/browser/chunk-GS3LDHYD.mjs.map +0 -7
- package/dist/lib/browser/chunk-RMHBOY3Y.mjs.map +0 -7
- package/dist/lib/browser/chunk-SV3MHIKI.mjs.map +0 -7
- package/dist/lib/browser/client-SKVKXPLY.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-LNPLD5CA.mjs.map +0 -7
- package/dist/lib/browser/migrations-D76RCG72.mjs.map +0 -7
- package/dist/lib/browser/react-context-YWVPZUMU.mjs.map +0 -7
- package/dist/lib/browser/react-surface-QFZTDNLS.mjs.map +0 -7
- package/dist/lib/browser/schema-defs-HKW6VNZB.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-SWFB4FID.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-5V3RCXZV.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-FBYODKEL.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-IOGTQFLM.mjs +0 -19
- package/dist/lib/node-esm/chunk-IOGTQFLM.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-SZLX4BVJ.mjs +0 -14
- package/dist/lib/node-esm/chunk-SZLX4BVJ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-UMO3ETDV.mjs +0 -20
- package/dist/lib/node-esm/chunk-UMO3ETDV.mjs.map +0 -7
- package/dist/lib/node-esm/client-SLL6GDC2.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-L7C6YRWV.mjs.map +0 -7
- package/dist/lib/node-esm/migrations-YISDI7LF.mjs.map +0 -7
- package/dist/lib/node-esm/react-context-EEHS4S3L.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-2K6W37R4.mjs.map +0 -7
- package/dist/lib/node-esm/schema-defs-5ZNI63RW.mjs.map +0 -7
|
@@ -1,27 +1,28 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ClientCapabilities
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-UZTC5O5A.mjs";
|
|
4
4
|
import {
|
|
5
5
|
Account,
|
|
6
6
|
ClientAction
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-RDIG75CA.mjs";
|
|
8
8
|
import {
|
|
9
|
-
|
|
10
|
-
} from "./chunk-
|
|
9
|
+
meta
|
|
10
|
+
} from "./chunk-ZRVMXLDR.mjs";
|
|
11
11
|
|
|
12
12
|
// src/capabilities/app-graph-builder.ts
|
|
13
|
-
import {
|
|
14
|
-
import
|
|
13
|
+
import { Atom } from "@effect-atom/atom-react";
|
|
14
|
+
import * as Function from "effect/Function";
|
|
15
|
+
import * as Option from "effect/Option";
|
|
15
16
|
import { createIntent } from "@dxos/app-framework";
|
|
16
17
|
import { Capabilities, contributes } from "@dxos/app-framework";
|
|
17
|
-
import {
|
|
18
|
+
import { ROOT_ID, atomFromObservable, createExtension } from "@dxos/plugin-graph";
|
|
18
19
|
import { ConnectionState } from "@dxos/react-client/mesh";
|
|
19
|
-
var app_graph_builder_default = (context) => contributes(Capabilities.AppGraphBuilder, createExtension({
|
|
20
|
-
id:
|
|
21
|
-
actions: (node) =>
|
|
20
|
+
var app_graph_builder_default = ((context) => contributes(Capabilities.AppGraphBuilder, createExtension({
|
|
21
|
+
id: meta.id,
|
|
22
|
+
actions: (node) => Atom.make((get) => Function.pipe(get(node), Option.flatMap((node2) => node2.id === ROOT_ID ? Option.some(node2) : Option.none()), Option.map(() => {
|
|
22
23
|
return [
|
|
23
24
|
{
|
|
24
|
-
id: `${
|
|
25
|
+
id: `${meta.id}/open-user-account`,
|
|
25
26
|
data: async () => {
|
|
26
27
|
const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);
|
|
27
28
|
await dispatch(createIntent(ClientAction.ShareIdentity));
|
|
@@ -30,7 +31,7 @@ var app_graph_builder_default = (context) => contributes(Capabilities.AppGraphBu
|
|
|
30
31
|
label: [
|
|
31
32
|
"open user account label",
|
|
32
33
|
{
|
|
33
|
-
ns:
|
|
34
|
+
ns: meta.id
|
|
34
35
|
}
|
|
35
36
|
],
|
|
36
37
|
icon: "ph--user--regular",
|
|
@@ -45,19 +46,19 @@ var app_graph_builder_default = (context) => contributes(Capabilities.AppGraphBu
|
|
|
45
46
|
}
|
|
46
47
|
];
|
|
47
48
|
}), Option.getOrElse(() => []))),
|
|
48
|
-
connector: (node) =>
|
|
49
|
+
connector: (node) => Atom.make((get) => Function.pipe(get(node), Option.flatMap((node2) => node2.id === ROOT_ID ? Option.some(node2) : Option.none()), Option.map(() => {
|
|
49
50
|
const client = context.getCapability(ClientCapabilities.Client);
|
|
50
|
-
const identity = get(
|
|
51
|
-
const status = get(
|
|
51
|
+
const identity = get(atomFromObservable(client.halo.identity));
|
|
52
|
+
const status = get(atomFromObservable(client.mesh.networkStatus));
|
|
52
53
|
return [
|
|
53
54
|
{
|
|
54
55
|
id: Account.id,
|
|
55
|
-
type:
|
|
56
|
+
type: meta.id,
|
|
56
57
|
properties: {
|
|
57
58
|
label: [
|
|
58
59
|
"account label",
|
|
59
60
|
{
|
|
60
|
-
ns:
|
|
61
|
+
ns: meta.id
|
|
61
62
|
}
|
|
62
63
|
],
|
|
63
64
|
icon: "ph--user--regular",
|
|
@@ -72,12 +73,12 @@ var app_graph_builder_default = (context) => contributes(Capabilities.AppGraphBu
|
|
|
72
73
|
{
|
|
73
74
|
id: Account.Profile,
|
|
74
75
|
data: Account.Profile,
|
|
75
|
-
type:
|
|
76
|
+
type: meta.id,
|
|
76
77
|
properties: {
|
|
77
78
|
label: [
|
|
78
79
|
"profile label",
|
|
79
80
|
{
|
|
80
|
-
ns:
|
|
81
|
+
ns: meta.id
|
|
81
82
|
}
|
|
82
83
|
],
|
|
83
84
|
icon: "ph--user--regular"
|
|
@@ -86,12 +87,12 @@ var app_graph_builder_default = (context) => contributes(Capabilities.AppGraphBu
|
|
|
86
87
|
{
|
|
87
88
|
id: Account.Devices,
|
|
88
89
|
data: Account.Devices,
|
|
89
|
-
type:
|
|
90
|
+
type: meta.id,
|
|
90
91
|
properties: {
|
|
91
92
|
label: [
|
|
92
93
|
"devices label",
|
|
93
94
|
{
|
|
94
|
-
ns:
|
|
95
|
+
ns: meta.id
|
|
95
96
|
}
|
|
96
97
|
],
|
|
97
98
|
icon: "ph--devices--regular",
|
|
@@ -101,12 +102,12 @@ var app_graph_builder_default = (context) => contributes(Capabilities.AppGraphBu
|
|
|
101
102
|
{
|
|
102
103
|
id: Account.Security,
|
|
103
104
|
data: Account.Security,
|
|
104
|
-
type:
|
|
105
|
+
type: meta.id,
|
|
105
106
|
properties: {
|
|
106
107
|
label: [
|
|
107
108
|
"security label",
|
|
108
109
|
{
|
|
109
|
-
ns:
|
|
110
|
+
ns: meta.id
|
|
110
111
|
}
|
|
111
112
|
],
|
|
112
113
|
icon: "ph--key--regular"
|
|
@@ -116,8 +117,8 @@ var app_graph_builder_default = (context) => contributes(Capabilities.AppGraphBu
|
|
|
116
117
|
}
|
|
117
118
|
];
|
|
118
119
|
}), Option.getOrElse(() => [])))
|
|
119
|
-
}));
|
|
120
|
+
})));
|
|
120
121
|
export {
|
|
121
122
|
app_graph_builder_default as default
|
|
122
123
|
};
|
|
123
|
-
//# sourceMappingURL=app-graph-builder-
|
|
124
|
+
//# sourceMappingURL=app-graph-builder-7LBCMPIW.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/capabilities/app-graph-builder.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Atom } from '@effect-atom/atom-react';\nimport * as Function from 'effect/Function';\nimport * as Option from 'effect/Option';\n\nimport { createIntent } from '@dxos/app-framework';\nimport { Capabilities, type PluginContext, contributes } from '@dxos/app-framework';\nimport { ROOT_ID, atomFromObservable, createExtension } from '@dxos/plugin-graph';\nimport { ConnectionState } from '@dxos/react-client/mesh';\n\nimport { meta } from '../meta';\nimport { Account, ClientAction } from '../types';\n\nimport { ClientCapabilities } from './capabilities';\n\nexport default (context: PluginContext) =>\n contributes(\n Capabilities.AppGraphBuilder,\n createExtension({\n id: meta.id,\n actions: (node) =>\n Atom.make((get) =>\n Function.pipe(\n get(node),\n Option.flatMap((node) => (node.id === ROOT_ID ? Option.some(node) : Option.none())),\n Option.map(() => {\n return [\n {\n id: `${meta.id}/open-user-account`,\n data: async () => {\n const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);\n await dispatch(createIntent(ClientAction.ShareIdentity));\n },\n properties: {\n label: ['open user account label', { ns: meta.id }],\n icon: 'ph--user--regular',\n disposition: 'menu',\n keyBinding: {\n macos: 'meta+shift+.',\n // TODO(wittjosiah): Test on windows to see if it behaves the same as linux.\n windows: 'alt+shift+.',\n linux: 'alt+shift+>',\n },\n },\n },\n ];\n }),\n Option.getOrElse(() => []),\n ),\n ),\n connector: (node) =>\n Atom.make((get) =>\n Function.pipe(\n get(node),\n Option.flatMap((node) => (node.id === ROOT_ID ? Option.some(node) : Option.none())),\n Option.map(() => {\n const client = context.getCapability(ClientCapabilities.Client);\n const identity = get(atomFromObservable(client.halo.identity));\n const status = get(atomFromObservable(client.mesh.networkStatus));\n\n return [\n {\n id: Account.id,\n type: meta.id,\n properties: {\n label: ['account label', { ns: meta.id }],\n icon: 'ph--user--regular',\n disposition: 'user-account',\n // NOTE: This currently needs to be the identity key because the fallback is generated from hex.\n userId: identity?.identityKey.toHex(),\n hue: identity?.profile?.data?.hue,\n emoji: identity?.profile?.data?.emoji,\n status: status.swarm === ConnectionState.OFFLINE ? 'error' : 'active',\n },\n nodes: [\n {\n id: Account.Profile,\n data: Account.Profile,\n type: meta.id,\n properties: {\n label: ['profile label', { ns: meta.id }],\n icon: 'ph--user--regular',\n },\n },\n {\n id: Account.Devices,\n data: Account.Devices,\n type: meta.id,\n properties: {\n label: ['devices label', { ns: meta.id }],\n icon: 'ph--devices--regular',\n testId: 'clientPlugin.devices',\n },\n },\n {\n id: Account.Security,\n data: Account.Security,\n type: meta.id,\n properties: {\n label: ['security label', { ns: meta.id }],\n icon: 'ph--key--regular',\n },\n },\n ],\n },\n ];\n }),\n Option.getOrElse(() => []),\n ),\n ),\n }),\n );\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;AAIA,SAASA,YAAY;AACrB,YAAYC,cAAc;AAC1B,YAAYC,YAAY;AAExB,SAASC,oBAAoB;AAC7B,SAASC,cAAkCC,mBAAmB;AAC9D,SAASC,SAASC,oBAAoBC,uBAAuB;AAC7D,SAASC,uBAAuB;AAOhC,IAAA,6BAAe,CAACC,YACdC,YACEC,aAAaC,iBACbC,gBAAgB;EACdC,IAAIC,KAAKD;EACTE,SAAS,CAACC,SACRC,KAAKC,KAAK,CAACC,QACAC,cACPD,IAAIH,IAAAA,GACGK,eAAQ,CAACL,UAAUA,MAAKH,OAAOS,UAAiBC,YAAKP,KAAAA,IAAeQ,YAAI,CAAA,GACxEC,WAAI,MAAA;AACT,WAAO;MACL;QACEZ,IAAI,GAAGC,KAAKD,EAAE;QACda,MAAM,YAAA;AACJ,gBAAM,EAAEC,iBAAiBC,SAAQ,IAAKpB,QAAQqB,cAAcnB,aAAaoB,gBAAgB;AACzF,gBAAMF,SAASG,aAAaC,aAAaC,aAAa,CAAA;QACxD;QACAC,YAAY;UACVC,OAAO;YAAC;YAA2B;cAAEC,IAAItB,KAAKD;YAAG;;UACjDwB,MAAM;UACNC,aAAa;UACbC,YAAY;YACVC,OAAO;;YAEPC,SAAS;YACTC,OAAO;UACT;QACF;MACF;;EAEJ,CAAA,GACOC,iBAAU,MAAM,CAAA,CAAE,CAAA,CAAA;EAG/BC,WAAW,CAAC5B,SACVC,KAAKC,KAAK,CAACC,QACAC,cACPD,IAAIH,IAAAA,GACGK,eAAQ,CAACL,UAAUA,MAAKH,OAAOS,UAAiBC,YAAKP,KAAAA,IAAeQ,YAAI,CAAA,GACxEC,WAAI,MAAA;AACT,UAAMoB,SAASrC,QAAQqB,cAAciB,mBAAmBC,MAAM;AAC9D,UAAMC,WAAW7B,IAAI8B,mBAAmBJ,OAAOK,KAAKF,QAAQ,CAAA;AAC5D,UAAMG,SAAShC,IAAI8B,mBAAmBJ,OAAOO,KAAKC,aAAa,CAAA;AAE/D,WAAO;MACL;QACExC,IAAIyC,QAAQzC;QACZ0C,MAAMzC,KAAKD;QACXqB,YAAY;UACVC,OAAO;YAAC;YAAiB;cAAEC,IAAItB,KAAKD;YAAG;;UACvCwB,MAAM;UACNC,aAAa;;UAEbkB,QAAQR,UAAUS,YAAYC,MAAAA;UAC9BC,KAAKX,UAAUY,SAASlC,MAAMiC;UAC9BE,OAAOb,UAAUY,SAASlC,MAAMmC;UAChCV,QAAQA,OAAOW,UAAUC,gBAAgBC,UAAU,UAAU;QAC/D;QACAC,OAAO;UACL;YACEpD,IAAIyC,QAAQY;YACZxC,MAAM4B,QAAQY;YACdX,MAAMzC,KAAKD;YACXqB,YAAY;cACVC,OAAO;gBAAC;gBAAiB;kBAAEC,IAAItB,KAAKD;gBAAG;;cACvCwB,MAAM;YACR;UACF;UACA;YACExB,IAAIyC,QAAQa;YACZzC,MAAM4B,QAAQa;YACdZ,MAAMzC,KAAKD;YACXqB,YAAY;cACVC,OAAO;gBAAC;gBAAiB;kBAAEC,IAAItB,KAAKD;gBAAG;;cACvCwB,MAAM;cACN+B,QAAQ;YACV;UACF;UACA;YACEvD,IAAIyC,QAAQe;YACZ3C,MAAM4B,QAAQe;YACdd,MAAMzC,KAAKD;YACXqB,YAAY;cACVC,OAAO;gBAAC;gBAAkB;kBAAEC,IAAItB,KAAKD;gBAAG;;cACxCwB,MAAM;YACR;UACF;;MAEJ;;EAEJ,CAAA,GACOM,iBAAU,MAAM,CAAA,CAAE,CAAA,CAAA;AAGjC,CAAA,CAAA;",
|
|
6
|
+
"names": ["Atom", "Function", "Option", "createIntent", "Capabilities", "contributes", "ROOT_ID", "atomFromObservable", "createExtension", "ConnectionState", "context", "contributes", "Capabilities", "AppGraphBuilder", "createExtension", "id", "meta", "actions", "node", "Atom", "make", "get", "pipe", "flatMap", "ROOT_ID", "some", "none", "map", "data", "dispatchPromise", "dispatch", "getCapability", "IntentDispatcher", "createIntent", "ClientAction", "ShareIdentity", "properties", "label", "ns", "icon", "disposition", "keyBinding", "macos", "windows", "linux", "getOrElse", "connector", "client", "ClientCapabilities", "Client", "identity", "atomFromObservable", "halo", "status", "mesh", "networkStatus", "Account", "type", "userId", "identityKey", "toHex", "hue", "profile", "emoji", "swarm", "ConnectionState", "OFFLINE", "nodes", "Profile", "Devices", "testId", "Security"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import {
|
|
2
|
+
meta
|
|
3
|
+
} from "./chunk-ZRVMXLDR.mjs";
|
|
4
|
+
|
|
5
|
+
// src/events.ts
|
|
6
|
+
import { defineEvent } from "@dxos/app-framework";
|
|
7
|
+
(function(ClientEvents2) {
|
|
8
|
+
ClientEvents2.ClientReady = defineEvent(`${meta.id}/event/client-ready`);
|
|
9
|
+
ClientEvents2.SetupSchema = defineEvent(`${meta.id}/event/setup-schema`);
|
|
10
|
+
ClientEvents2.SetupMigration = defineEvent(`${meta.id}/event/setup-migration`);
|
|
11
|
+
ClientEvents2.IdentityCreated = defineEvent(`${meta.id}/event/identity-created`);
|
|
12
|
+
ClientEvents2.SpacesReady = defineEvent(`${meta.id}/event/spaces-ready`);
|
|
13
|
+
})(ClientEvents || (ClientEvents = {}));
|
|
14
|
+
var ClientEvents;
|
|
15
|
+
|
|
16
|
+
export {
|
|
17
|
+
ClientEvents
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=chunk-4LRO3Y2O.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/events.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { defineEvent } from '@dxos/app-framework';\n\nimport { meta } from './meta';\n\nexport namespace ClientEvents {\n export const ClientReady = defineEvent(`${meta.id}/event/client-ready`);\n export const SetupSchema = defineEvent(`${meta.id}/event/setup-schema`);\n export const SetupMigration = defineEvent(`${meta.id}/event/setup-migration`);\n export const IdentityCreated = defineEvent(`${meta.id}/event/identity-created`);\n export const SpacesReady = defineEvent(`${meta.id}/event/spaces-ready`);\n}\n"],
|
|
5
|
+
"mappings": ";;;;;AAIA,SAASA,mBAAmB;UAIXC,eAAAA;gBACFC,cAAcC,YAAY,GAAGC,KAAKC,EAAE,qBAAqB;gBACzDC,cAAcH,YAAY,GAAGC,KAAKC,EAAE,qBAAqB;gBACzDE,iBAAiBJ,YAAY,GAAGC,KAAKC,EAAE,wBAAwB;gBAC/DG,kBAAkBL,YAAY,GAAGC,KAAKC,EAAE,yBAAyB;gBACjEI,cAAcN,YAAY,GAAGC,KAAKC,EAAE,qBAAqB;AACxE,GANiBJ,iBAAAA,eAAAA,CAAAA,EAAAA;;",
|
|
6
|
+
"names": ["defineEvent", "ClientEvents", "ClientReady", "defineEvent", "meta", "id", "SetupSchema", "SetupMigration", "IdentityCreated", "SpacesReady"]
|
|
7
|
+
}
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ClientAction
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-RDIG75CA.mjs";
|
|
4
4
|
import {
|
|
5
|
-
|
|
6
|
-
} from "./chunk-
|
|
5
|
+
meta
|
|
6
|
+
} from "./chunk-ZRVMXLDR.mjs";
|
|
7
7
|
|
|
8
8
|
// src/components/DevicesContainer.tsx
|
|
9
9
|
import { useSignals as _useSignals } from "@preact-signals/safe-react/tracking";
|
|
10
10
|
import React, { useCallback, useEffect, useState } from "react";
|
|
11
11
|
import { QR } from "react-qr-rounded";
|
|
12
|
-
import { createIntent
|
|
12
|
+
import { createIntent } from "@dxos/app-framework";
|
|
13
|
+
import { useIntentDispatcher } from "@dxos/app-framework/react";
|
|
13
14
|
import { log } from "@dxos/log";
|
|
14
15
|
import { useClient, useMulticastObservable } from "@dxos/react-client";
|
|
15
16
|
import { useDevices } from "@dxos/react-client/halo";
|
|
16
17
|
import { Invitation, InvitationEncoder } from "@dxos/react-client/invitations";
|
|
17
18
|
import { useNetworkStatus } from "@dxos/react-client/mesh";
|
|
18
|
-
import { Button, Clipboard, IconButton, List, useId, useTranslation
|
|
19
|
+
import { Button, Clipboard, Icon, IconButton, List, useId, useTranslation } from "@dxos/react-ui";
|
|
19
20
|
import { ControlFrame, ControlFrameItem, ControlGroup, ControlItem, ControlPage, ControlSection } from "@dxos/react-ui-form";
|
|
20
|
-
import { StackItem } from "@dxos/react-ui-stack";
|
|
21
21
|
import { AuthCode, Centered, DeviceListItem, Emoji, Viewport } from "@dxos/shell/react";
|
|
22
22
|
import { hexToEmoji } from "@dxos/util";
|
|
23
23
|
var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-client/src/components/DevicesContainer.tsx";
|
|
@@ -41,18 +41,16 @@ var DevicesContainer = ({ createInvitationUrl }) => {
|
|
|
41
41
|
})), [
|
|
42
42
|
dispatch
|
|
43
43
|
]);
|
|
44
|
-
return /* @__PURE__ */ React.createElement(Clipboard.Provider, null, /* @__PURE__ */ React.createElement(
|
|
45
|
-
classNames: "block overflow-y-auto"
|
|
46
|
-
}, /* @__PURE__ */ React.createElement(ControlPage, null, /* @__PURE__ */ React.createElement(ControlSection, {
|
|
44
|
+
return /* @__PURE__ */ React.createElement(Clipboard.Provider, null, /* @__PURE__ */ React.createElement(ControlPage, null, /* @__PURE__ */ React.createElement(ControlSection, {
|
|
47
45
|
title: t("devices verbose label", {
|
|
48
|
-
ns:
|
|
46
|
+
ns: meta.id
|
|
49
47
|
}),
|
|
50
48
|
description: t("devices description", {
|
|
51
|
-
ns:
|
|
49
|
+
ns: meta.id
|
|
52
50
|
})
|
|
53
51
|
}, /* @__PURE__ */ React.createElement(ControlFrame, null, /* @__PURE__ */ React.createElement(ControlFrameItem, {
|
|
54
52
|
title: t("devices label", {
|
|
55
|
-
ns:
|
|
53
|
+
ns: meta.id
|
|
56
54
|
})
|
|
57
55
|
}, /* @__PURE__ */ React.createElement(List, null, devices.map((device) => {
|
|
58
56
|
return /* @__PURE__ */ React.createElement(DeviceListItem, {
|
|
@@ -66,15 +64,15 @@ var DevicesContainer = ({ createInvitationUrl }) => {
|
|
|
66
64
|
createInvitationUrl
|
|
67
65
|
})))), /* @__PURE__ */ React.createElement(ControlSection, {
|
|
68
66
|
title: t("danger zone title", {
|
|
69
|
-
ns:
|
|
67
|
+
ns: meta.id
|
|
70
68
|
}),
|
|
71
69
|
description: t("danger zone description", {
|
|
72
|
-
ns:
|
|
70
|
+
ns: meta.id
|
|
73
71
|
})
|
|
74
72
|
}, /* @__PURE__ */ React.createElement(ControlGroup, null, /* @__PURE__ */ React.createElement(ControlItem, {
|
|
75
73
|
title: t("reset device label"),
|
|
76
74
|
description: t("reset device description", {
|
|
77
|
-
ns:
|
|
75
|
+
ns: meta.id
|
|
78
76
|
})
|
|
79
77
|
}, /* @__PURE__ */ React.createElement(Button, {
|
|
80
78
|
variant: "destructive",
|
|
@@ -83,7 +81,7 @@ var DevicesContainer = ({ createInvitationUrl }) => {
|
|
|
83
81
|
}, t("reset device label"))), /* @__PURE__ */ React.createElement(ControlItem, {
|
|
84
82
|
title: t("recover identity label"),
|
|
85
83
|
description: t("recover identity description", {
|
|
86
|
-
ns:
|
|
84
|
+
ns: meta.id
|
|
87
85
|
})
|
|
88
86
|
}, /* @__PURE__ */ React.createElement(Button, {
|
|
89
87
|
variant: "destructive",
|
|
@@ -92,13 +90,13 @@ var DevicesContainer = ({ createInvitationUrl }) => {
|
|
|
92
90
|
}, t("recover identity label"))), /* @__PURE__ */ React.createElement(ControlItem, {
|
|
93
91
|
title: t("join new identity label"),
|
|
94
92
|
description: t("join new identity description", {
|
|
95
|
-
ns:
|
|
93
|
+
ns: meta.id
|
|
96
94
|
})
|
|
97
95
|
}, /* @__PURE__ */ React.createElement(Button, {
|
|
98
96
|
variant: "destructive",
|
|
99
97
|
onClick: handleJoinNewIdentity,
|
|
100
98
|
"data-testid": "devicesContainer.joinExisting"
|
|
101
|
-
}, t("join new identity label")))))))
|
|
99
|
+
}, t("join new identity label")))))));
|
|
102
100
|
} finally {
|
|
103
101
|
_effect.f();
|
|
104
102
|
}
|
|
@@ -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: 126,
|
|
123
121
|
S: void 0,
|
|
124
122
|
C: (f, a) => f(...a)
|
|
125
123
|
});
|
|
@@ -179,7 +177,7 @@ var InvitationSection = ({ state = -1, authCode, invitationId = "never", url = "
|
|
|
179
177
|
} }) => {
|
|
180
178
|
var _effect = _useSignals();
|
|
181
179
|
try {
|
|
182
|
-
const { t } = useTranslation(
|
|
180
|
+
const { t } = useTranslation(meta.id);
|
|
183
181
|
const activeView = state < 0 ? "init" : state >= Invitation.State.CANCELLED ? "complete" : state >= Invitation.State.READY_FOR_AUTHENTICATION && authCode ? "auth-code" : "qr-code";
|
|
184
182
|
return activeView === "init" ? /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("p", {
|
|
185
183
|
className: "text-description mbe-2"
|
|
@@ -224,7 +222,7 @@ var InvitationQR = ({ id, url, onCancel }) => {
|
|
|
224
222
|
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("p", {
|
|
225
223
|
className: "text-description"
|
|
226
224
|
}, t("qr code description", {
|
|
227
|
-
ns:
|
|
225
|
+
ns: meta.id
|
|
228
226
|
})), /* @__PURE__ */ React.createElement("div", {
|
|
229
227
|
role: "group",
|
|
230
228
|
className: "grid grid-cols-[1fr_min-content] mlb-2 gap-2"
|
|
@@ -301,16 +299,17 @@ var InvitationComplete = ({ statusValue }) => {
|
|
|
301
299
|
// src/components/JoinDialog.tsx
|
|
302
300
|
import { useSignals as _useSignals2 } from "@preact-signals/safe-react/tracking";
|
|
303
301
|
import React2, { useCallback as useCallback2 } from "react";
|
|
304
|
-
import {
|
|
302
|
+
import { LayoutAction, createIntent as createIntent2 } from "@dxos/app-framework";
|
|
303
|
+
import { useIntentDispatcher as useIntentDispatcher2 } from "@dxos/app-framework/react";
|
|
305
304
|
import { ObservabilityAction } from "@dxos/plugin-observability/types";
|
|
306
305
|
import { Dialog, useTranslation as useTranslation2 } from "@dxos/react-ui";
|
|
307
306
|
import { JoinPanel } from "@dxos/shell/react";
|
|
308
|
-
var JOIN_DIALOG = `${
|
|
307
|
+
var JOIN_DIALOG = `${meta.id}/JoinDialog`;
|
|
309
308
|
var JoinDialog = (props) => {
|
|
310
309
|
var _effect = _useSignals2();
|
|
311
310
|
try {
|
|
312
311
|
const { dispatchPromise: dispatch } = useIntentDispatcher2();
|
|
313
|
-
const { t } = useTranslation2(
|
|
312
|
+
const { t } = useTranslation2(meta.id);
|
|
314
313
|
const handleCancelResetStorage = useCallback2(() => dispatch(createIntent2(ClientAction.ShareIdentity)), [
|
|
315
314
|
dispatch
|
|
316
315
|
]);
|
|
@@ -354,24 +353,37 @@ var JoinDialog = (props) => {
|
|
|
354
353
|
|
|
355
354
|
// src/components/ProfileContainer.tsx
|
|
356
355
|
import { useSignals as _useSignals3 } from "@preact-signals/safe-react/tracking";
|
|
357
|
-
import
|
|
356
|
+
import * as Schema from "effect/Schema";
|
|
358
357
|
import React3, { useCallback as useCallback3, useMemo, useState as useState2 } from "react";
|
|
359
358
|
import { debounce } from "@dxos/async";
|
|
360
359
|
import { useClient as useClient2 } from "@dxos/react-client";
|
|
361
360
|
import { useIdentity } from "@dxos/react-client/halo";
|
|
362
361
|
import { ButtonGroup, Clipboard as Clipboard2, Input, useTranslation as useTranslation3 } from "@dxos/react-ui";
|
|
363
|
-
import {
|
|
362
|
+
import { ControlItem as ControlItem2, ControlItemInput, ControlPage as ControlPage2, ControlSection as ControlSection2, Form } from "@dxos/react-ui-form";
|
|
364
363
|
import { EmojiPickerBlock, HuePicker } from "@dxos/react-ui-pickers";
|
|
365
|
-
import {
|
|
366
|
-
|
|
364
|
+
import { hexToEmoji as hexToEmoji2, hexToHue } from "@dxos/util";
|
|
365
|
+
var UserProfile = Schema.Struct({
|
|
366
|
+
did: Schema.String.annotations({
|
|
367
|
+
title: "DID"
|
|
368
|
+
}),
|
|
369
|
+
displayName: Schema.String.annotations({
|
|
370
|
+
title: "Display name"
|
|
371
|
+
}),
|
|
372
|
+
emoji: Schema.String.annotations({
|
|
373
|
+
title: "Avatar"
|
|
374
|
+
}),
|
|
375
|
+
hue: Schema.String.annotations({
|
|
376
|
+
title: "Color"
|
|
377
|
+
})
|
|
378
|
+
});
|
|
367
379
|
var getDefaultHueValue = (identity) => hexToHue(identity?.identityKey.toHex() ?? "0");
|
|
368
|
-
var getDefaultEmojiValue = (identity) => hexToEmoji2(identity?.identityKey.toHex() ?? "0");
|
|
369
380
|
var getHueValue = (identity) => identity?.profile?.data?.hue || getDefaultHueValue(identity);
|
|
381
|
+
var getDefaultEmojiValue = (identity) => hexToEmoji2(identity?.identityKey.toHex() ?? "0");
|
|
370
382
|
var getEmojiValue = (identity) => identity?.profile?.data?.emoji || getDefaultEmojiValue(identity);
|
|
371
383
|
var ProfileContainer = () => {
|
|
372
384
|
var _effect = _useSignals3();
|
|
373
385
|
try {
|
|
374
|
-
const { t } = useTranslation3(
|
|
386
|
+
const { t } = useTranslation3(meta.id);
|
|
375
387
|
const client = useClient2();
|
|
376
388
|
const identity = useIdentity();
|
|
377
389
|
const [displayName, setDisplayNameDirectly] = useState2(identity?.profile?.displayName ?? "");
|
|
@@ -393,17 +405,17 @@ var ProfileContainer = () => {
|
|
|
393
405
|
identity
|
|
394
406
|
]);
|
|
395
407
|
const values = useMemo(() => ({
|
|
408
|
+
did: identity?.did,
|
|
396
409
|
displayName,
|
|
397
410
|
emoji,
|
|
398
|
-
hue
|
|
399
|
-
did: identity?.did
|
|
411
|
+
hue
|
|
400
412
|
}), [
|
|
401
413
|
identity,
|
|
402
414
|
displayName,
|
|
403
415
|
emoji,
|
|
404
416
|
hue
|
|
405
417
|
]);
|
|
406
|
-
const
|
|
418
|
+
const fieldMap = useMemo(() => ({
|
|
407
419
|
displayName: ({ type, label, getValue, onValueChange }) => {
|
|
408
420
|
const handleChange = useCallback3(({ target: { value } }) => onValueChange(type, value), [
|
|
409
421
|
onValueChange,
|
|
@@ -451,12 +463,14 @@ var ProfileContainer = () => {
|
|
|
451
463
|
return /* @__PURE__ */ React3.createElement(ControlItem2, {
|
|
452
464
|
title: label,
|
|
453
465
|
description: t("hue description")
|
|
466
|
+
}, /* @__PURE__ */ React3.createElement("div", {
|
|
467
|
+
role: "none",
|
|
468
|
+
className: "flex justify-self-end"
|
|
454
469
|
}, /* @__PURE__ */ React3.createElement(HuePicker, {
|
|
455
470
|
value: getValue(),
|
|
456
471
|
onChange: handleChange,
|
|
457
|
-
onReset: handleHueReset
|
|
458
|
-
|
|
459
|
-
}));
|
|
472
|
+
onReset: handleHueReset
|
|
473
|
+
})));
|
|
460
474
|
},
|
|
461
475
|
// TODO(wittjosiah): We need text input annotations for disabled and copyable.
|
|
462
476
|
did: ({ label, getValue }) => {
|
|
@@ -474,58 +488,42 @@ var ProfileContainer = () => {
|
|
|
474
488
|
}), [
|
|
475
489
|
t
|
|
476
490
|
]);
|
|
477
|
-
return /* @__PURE__ */ React3.createElement(
|
|
478
|
-
classNames: "block overflow-y-auto"
|
|
479
|
-
}, /* @__PURE__ */ React3.createElement(ControlPage2, null, /* @__PURE__ */ React3.createElement(Clipboard2.Provider, null, /* @__PURE__ */ React3.createElement(ControlSection2, {
|
|
491
|
+
return /* @__PURE__ */ React3.createElement(ControlPage2, null, /* @__PURE__ */ React3.createElement(Clipboard2.Provider, null, /* @__PURE__ */ React3.createElement(ControlSection2, {
|
|
480
492
|
title: t("profile label"),
|
|
481
493
|
description: t("profile description")
|
|
482
|
-
}, /* @__PURE__ */ React3.createElement(Form, {
|
|
483
|
-
schema:
|
|
494
|
+
}, /* @__PURE__ */ React3.createElement(Form.Root, {
|
|
495
|
+
schema: UserProfile,
|
|
484
496
|
values,
|
|
497
|
+
fieldMap,
|
|
485
498
|
autoSave: true,
|
|
486
|
-
onSave: handleSave
|
|
487
|
-
|
|
488
|
-
classNames: "container-max-width grid grid-cols-1 md:grid-cols-[1fr_min-content]
|
|
489
|
-
|
|
490
|
-
})))));
|
|
499
|
+
onSave: handleSave
|
|
500
|
+
}, /* @__PURE__ */ React3.createElement(Form.Content, null, /* @__PURE__ */ React3.createElement(Form.FieldSet, {
|
|
501
|
+
classNames: "container-max-width grid grid-cols-1 md:grid-cols-[1fr_min-content]"
|
|
502
|
+
}))))));
|
|
491
503
|
} finally {
|
|
492
504
|
_effect.f();
|
|
493
505
|
}
|
|
494
506
|
};
|
|
495
|
-
var ProfileSchema = Schema.Struct({
|
|
496
|
-
displayName: Schema.String.annotations({
|
|
497
|
-
title: "Display name"
|
|
498
|
-
}),
|
|
499
|
-
emoji: Schema.String.annotations({
|
|
500
|
-
title: "Avatar"
|
|
501
|
-
}),
|
|
502
|
-
hue: Schema.String.annotations({
|
|
503
|
-
title: "Color"
|
|
504
|
-
}),
|
|
505
|
-
did: Schema.String.annotations({
|
|
506
|
-
title: "DID"
|
|
507
|
-
})
|
|
508
|
-
});
|
|
509
507
|
|
|
510
508
|
// src/components/RecoveryCodeDialog.tsx
|
|
511
509
|
import { useSignals as _useSignals4 } from "@preact-signals/safe-react/tracking";
|
|
512
510
|
import React4, { useCallback as useCallback4, useState as useState3 } from "react";
|
|
513
511
|
import { AlertDialog, Button as Button2, Clipboard as Clipboard3, Input as Input2, useTranslation as useTranslation4 } from "@dxos/react-ui";
|
|
514
|
-
var RECOVERY_CODE_DIALOG = `${
|
|
512
|
+
var RECOVERY_CODE_DIALOG = `${meta.id}/RecoveryCodeDialog`;
|
|
515
513
|
var RecoveryCodeDialog = ({ code }) => {
|
|
516
514
|
var _effect = _useSignals4();
|
|
517
515
|
try {
|
|
518
|
-
const { t } = useTranslation4(
|
|
516
|
+
const { t } = useTranslation4(meta.id);
|
|
519
517
|
const [confirmation, setConfirmation] = useState3(false);
|
|
520
518
|
const handleConfirmation = useCallback4((checked) => setConfirmation(checked), []);
|
|
521
519
|
return /* @__PURE__ */ React4.createElement(AlertDialog.Content, {
|
|
522
520
|
classNames: "bs-content min-bs-[15rem] max-bs-full md:max-is-[40rem] overflow-hidden"
|
|
523
521
|
}, /* @__PURE__ */ React4.createElement(AlertDialog.Title, null, t("recovery code dialog title")), /* @__PURE__ */ React4.createElement("p", {
|
|
524
|
-
className: "
|
|
522
|
+
className: "plb-4"
|
|
525
523
|
}, t("recovery code dialog description")), /* @__PURE__ */ React4.createElement(Clipboard3.Provider, null, /* @__PURE__ */ React4.createElement(Code, {
|
|
526
524
|
code
|
|
527
525
|
})), /* @__PURE__ */ React4.createElement("div", {
|
|
528
|
-
className: "flex flex-col
|
|
526
|
+
className: "flex flex-col plb-4 gap-2"
|
|
529
527
|
}, /* @__PURE__ */ React4.createElement("p", null, t("recovery code dialog warning 1")), /* @__PURE__ */ React4.createElement("p", null, t("recovery code dialog warning 2"))), /* @__PURE__ */ React4.createElement("div", {
|
|
530
528
|
className: "flex items-center gap-2 pbe-4"
|
|
531
529
|
}, /* @__PURE__ */ React4.createElement(Input2.Root, null, /* @__PURE__ */ React4.createElement(Input2.Checkbox, {
|
|
@@ -560,7 +558,7 @@ var Code = ({ code }) => {
|
|
|
560
558
|
key: i,
|
|
561
559
|
className: "flex items-center p-2 gap-2"
|
|
562
560
|
}, /* @__PURE__ */ React4.createElement("div", {
|
|
563
|
-
className: "
|
|
561
|
+
className: "is-4 text-xs text-center text-subdued"
|
|
564
562
|
}, i + 1), /* @__PURE__ */ React4.createElement("div", {
|
|
565
563
|
className: "text-sm"
|
|
566
564
|
}, word)))));
|
|
@@ -572,22 +570,20 @@ var Code = ({ code }) => {
|
|
|
572
570
|
// src/components/RecoveryCredentialsContainer.tsx
|
|
573
571
|
import { useSignals as _useSignals5 } from "@preact-signals/safe-react/tracking";
|
|
574
572
|
import React5 from "react";
|
|
575
|
-
import { createIntent as createIntent3
|
|
573
|
+
import { createIntent as createIntent3 } from "@dxos/app-framework";
|
|
574
|
+
import { useIntentDispatcher as useIntentDispatcher3 } from "@dxos/app-framework/react";
|
|
576
575
|
import { useCredentials } from "@dxos/react-client/halo";
|
|
577
|
-
import { Icon as Icon2, IconButton as IconButton2, List as List2, ListItem, useTranslation as useTranslation5
|
|
576
|
+
import { Icon as Icon2, IconButton as IconButton2, List as List2, ListItem, Message, useTranslation as useTranslation5 } from "@dxos/react-ui";
|
|
578
577
|
import { ControlGroup as ControlGroup2, ControlItem as ControlItem3, ControlPage as ControlPage3, ControlSection as ControlSection3 } from "@dxos/react-ui-form";
|
|
579
|
-
|
|
580
|
-
var MANAGE_CREDENTIALS_DIALOG = `${CLIENT_PLUGIN}/ManageCredentialsDialog`;
|
|
578
|
+
var MANAGE_CREDENTIALS_DIALOG = `${meta.id}/ManageCredentialsDialog`;
|
|
581
579
|
var RecoveryCredentialsContainer = () => {
|
|
582
580
|
var _effect = _useSignals5();
|
|
583
581
|
try {
|
|
584
|
-
const { t } = useTranslation5(
|
|
582
|
+
const { t } = useTranslation5(meta.id);
|
|
585
583
|
const { dispatchPromise: dispatch } = useIntentDispatcher3();
|
|
586
584
|
const credentials = useCredentials();
|
|
587
585
|
const recoveryCredentials = credentials.filter((credential) => credential.subject.assertion["@type"] === "dxos.halo.credentials.IdentityRecovery");
|
|
588
|
-
return /* @__PURE__ */ React5.createElement(
|
|
589
|
-
classNames: "block overflow-y-auto"
|
|
590
|
-
}, /* @__PURE__ */ React5.createElement(ControlPage3, null, /* @__PURE__ */ React5.createElement(ControlSection3, {
|
|
586
|
+
return /* @__PURE__ */ React5.createElement(ControlPage3, null, /* @__PURE__ */ React5.createElement(ControlSection3, {
|
|
591
587
|
title: t("recovery setup dialog title"),
|
|
592
588
|
description: t("recovery setup dialog description")
|
|
593
589
|
}, /* @__PURE__ */ React5.createElement(ControlGroup2, null, /* @__PURE__ */ React5.createElement(ControlItem3, {
|
|
@@ -597,7 +593,6 @@ var RecoveryCredentialsContainer = () => {
|
|
|
597
593
|
label: t("create passkey label"),
|
|
598
594
|
icon: "ph--key--duotone",
|
|
599
595
|
variant: "primary",
|
|
600
|
-
size: 5,
|
|
601
596
|
onClick: () => dispatch(createIntent3(ClientAction.CreatePasskey))
|
|
602
597
|
})), /* @__PURE__ */ React5.createElement(ControlItem3, {
|
|
603
598
|
title: t("create recovery code label"),
|
|
@@ -606,7 +601,6 @@ var RecoveryCredentialsContainer = () => {
|
|
|
606
601
|
label: t("create recovery code label"),
|
|
607
602
|
icon: "ph--receipt--duotone",
|
|
608
603
|
variant: "default",
|
|
609
|
-
size: 5,
|
|
610
604
|
onClick: () => dispatch(createIntent3(ClientAction.CreateRecoveryCode))
|
|
611
605
|
})))), /* @__PURE__ */ React5.createElement(ControlSection3, {
|
|
612
606
|
title: t("credentials list label")
|
|
@@ -620,9 +614,8 @@ var RecoveryCredentialsContainer = () => {
|
|
|
620
614
|
}, recoveryCredentials.map((credential) => /* @__PURE__ */ React5.createElement(ListItem.Root, {
|
|
621
615
|
key: credential.id?.toHex()
|
|
622
616
|
}, /* @__PURE__ */ React5.createElement(ListItem.Endcap, null, /* @__PURE__ */ React5.createElement(Icon2, {
|
|
623
|
-
icon: "ph--key--regular"
|
|
624
|
-
|
|
625
|
-
})), /* @__PURE__ */ React5.createElement(ListItem.Heading, null, credential.issuanceDate.toLocaleString())))))));
|
|
617
|
+
icon: "ph--key--regular"
|
|
618
|
+
})), /* @__PURE__ */ React5.createElement(ListItem.Heading, null, credential.issuanceDate.toLocaleString()))))));
|
|
626
619
|
} finally {
|
|
627
620
|
_effect.f();
|
|
628
621
|
}
|
|
@@ -631,15 +624,16 @@ var RecoveryCredentialsContainer = () => {
|
|
|
631
624
|
// src/components/ResetDialog.tsx
|
|
632
625
|
import { useSignals as _useSignals6 } from "@preact-signals/safe-react/tracking";
|
|
633
626
|
import React6, { useCallback as useCallback5 } from "react";
|
|
634
|
-
import {
|
|
627
|
+
import { LayoutAction as LayoutAction2, createIntent as createIntent4 } from "@dxos/app-framework";
|
|
628
|
+
import { useIntentDispatcher as useIntentDispatcher4 } from "@dxos/app-framework/react";
|
|
635
629
|
import { useClient as useClient3 } from "@dxos/react-client";
|
|
636
630
|
import { Dialog as Dialog2, useTranslation as useTranslation6 } from "@dxos/react-ui";
|
|
637
631
|
import { ConfirmReset } from "@dxos/shell/react";
|
|
638
|
-
var RESET_DIALOG = `${
|
|
632
|
+
var RESET_DIALOG = `${meta.id}/ResetDialog`;
|
|
639
633
|
var ResetDialog = ({ mode, onReset }) => {
|
|
640
634
|
var _effect = _useSignals6();
|
|
641
635
|
try {
|
|
642
|
-
const { t } = useTranslation6(
|
|
636
|
+
const { t } = useTranslation6(meta.id);
|
|
643
637
|
const { dispatchPromise: dispatch } = useIntentDispatcher4();
|
|
644
638
|
const client = useClient3();
|
|
645
639
|
const handleReset = useCallback5(async () => {
|
|
@@ -692,4 +686,4 @@ export {
|
|
|
692
686
|
RESET_DIALOG,
|
|
693
687
|
ResetDialog
|
|
694
688
|
};
|
|
695
|
-
//# sourceMappingURL=chunk-
|
|
689
|
+
//# sourceMappingURL=chunk-HZSIIWH5.mjs.map
|