@dxos/plugin-client 0.7.5-main.9d26e3a → 0.7.5-main.b19bfc8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/browser/app-graph-builder-ON64R7SO.mjs +44 -0
- package/dist/lib/browser/app-graph-builder-ON64R7SO.mjs.map +7 -0
- package/dist/lib/browser/{chunk-52IJQ35F.mjs → chunk-7DPLXOMO.mjs} +17 -7
- package/dist/lib/browser/chunk-7DPLXOMO.mjs.map +7 -0
- package/dist/lib/browser/chunk-EYBZZHSM.mjs +271 -0
- package/dist/lib/browser/chunk-EYBZZHSM.mjs.map +7 -0
- package/dist/lib/browser/chunk-GHEQL2E6.mjs +16 -0
- package/dist/lib/browser/chunk-GHEQL2E6.mjs.map +7 -0
- package/dist/lib/browser/{chunk-X4QUPYC6.mjs → chunk-NHIL4T3L.mjs} +3 -3
- package/dist/lib/browser/chunk-NHIL4T3L.mjs.map +7 -0
- package/dist/lib/browser/chunk-RGMLBYIF.mjs +18 -0
- package/dist/lib/browser/chunk-RGMLBYIF.mjs.map +7 -0
- package/dist/lib/browser/client-A7YSVURS.mjs +36 -0
- package/dist/lib/browser/client-A7YSVURS.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +83 -370
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/intent-resolver-SSM6WXAW.mjs +263 -0
- package/dist/lib/browser/intent-resolver-SSM6WXAW.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/react-context-R3SG55F5.mjs +24 -0
- package/dist/lib/browser/react-context-R3SG55F5.mjs.map +7 -0
- package/dist/lib/browser/react-surface-XGOUHVIH.mjs +57 -0
- package/dist/lib/browser/react-surface-XGOUHVIH.mjs.map +7 -0
- package/dist/lib/browser/schema-J4MJIXRP.mjs +23 -0
- package/dist/lib/browser/schema-J4MJIXRP.mjs.map +7 -0
- package/dist/lib/browser/types.mjs +4 -6
- package/dist/lib/node/app-graph-builder-RW7ESEX3.cjs +58 -0
- package/dist/lib/node/app-graph-builder-RW7ESEX3.cjs.map +7 -0
- package/dist/lib/node/chunk-7LVBFGKQ.cjs +299 -0
- package/dist/lib/node/chunk-7LVBFGKQ.cjs.map +7 -0
- package/dist/lib/node/{chunk-RUA5KXVW.cjs → chunk-OIFPM5ZW.cjs} +7 -7
- package/dist/lib/node/chunk-OIFPM5ZW.cjs.map +7 -0
- package/dist/lib/node/{chunk-NFO3ADQC.cjs → chunk-TREVKZCJ.cjs} +21 -12
- package/dist/lib/node/chunk-TREVKZCJ.cjs.map +7 -0
- package/dist/lib/node/{meta.cjs → chunk-UHIGZJQL.cjs} +13 -8
- package/dist/lib/node/chunk-UHIGZJQL.cjs.map +7 -0
- package/dist/lib/node/chunk-XPC4JOPP.cjs +37 -0
- package/dist/lib/node/chunk-XPC4JOPP.cjs.map +7 -0
- package/dist/lib/node/client-2RQATBB6.cjs +50 -0
- package/dist/lib/node/client-2RQATBB6.cjs.map +7 -0
- package/dist/lib/node/index.cjs +80 -359
- package/dist/lib/node/index.cjs.map +4 -4
- package/dist/lib/node/intent-resolver-RIHCW2KJ.cjs +271 -0
- package/dist/lib/node/intent-resolver-RIHCW2KJ.cjs.map +7 -0
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/react-context-TD6VGBVA.cjs +48 -0
- package/dist/lib/node/react-context-TD6VGBVA.cjs.map +7 -0
- package/dist/lib/node/react-surface-IY7GXEGU.cjs +74 -0
- package/dist/lib/node/react-surface-IY7GXEGU.cjs.map +7 -0
- package/dist/lib/node/schema-JXJS75HQ.cjs +39 -0
- package/dist/lib/node/schema-JXJS75HQ.cjs.map +7 -0
- package/dist/lib/node/types.cjs +4 -6
- package/dist/lib/node/types.cjs.map +2 -2
- package/dist/lib/node-esm/app-graph-builder-TDYRWNI7.mjs +45 -0
- package/dist/lib/node-esm/app-graph-builder-TDYRWNI7.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-CRF22MJJ.mjs +272 -0
- package/dist/lib/node-esm/chunk-CRF22MJJ.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-GMGRQ5Q7.mjs → chunk-HO7WDE7C.mjs} +3 -3
- package/dist/lib/node-esm/chunk-HO7WDE7C.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-TI4GNGMM.mjs → chunk-QJMF2MWP.mjs} +17 -7
- package/dist/lib/node-esm/chunk-QJMF2MWP.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-QR72BXJK.mjs +19 -0
- package/dist/lib/node-esm/chunk-QR72BXJK.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-T35SFKK3.mjs +17 -0
- package/dist/lib/node-esm/chunk-T35SFKK3.mjs.map +7 -0
- package/dist/lib/node-esm/client-36DKBSB7.mjs +37 -0
- package/dist/lib/node-esm/client-36DKBSB7.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +83 -370
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/intent-resolver-WWTVE6T6.mjs +264 -0
- package/dist/lib/node-esm/intent-resolver-WWTVE6T6.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/react-context-ZOGDOWJ2.mjs +25 -0
- package/dist/lib/node-esm/react-context-ZOGDOWJ2.mjs.map +7 -0
- package/dist/lib/node-esm/react-surface-F3PDFJMV.mjs +58 -0
- package/dist/lib/node-esm/react-surface-F3PDFJMV.mjs.map +7 -0
- package/dist/lib/node-esm/schema-XM4HBLIX.mjs +24 -0
- package/dist/lib/node-esm/schema-XM4HBLIX.mjs.map +7 -0
- package/dist/lib/node-esm/types.mjs +4 -6
- package/dist/types/src/ClientPlugin.d.ts +2 -3
- package/dist/types/src/ClientPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts +181 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -0
- package/dist/types/src/capabilities/capabilities.d.ts +7 -0
- package/dist/types/src/capabilities/capabilities.d.ts.map +1 -0
- package/dist/types/src/capabilities/client.d.ts +9 -0
- package/dist/types/src/capabilities/client.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +195 -0
- package/dist/types/src/capabilities/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/intent-resolver.d.ts +9 -0
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-context.d.ts +8 -0
- package/dist/types/src/capabilities/react-context.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface.d.ts +7 -0
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
- package/dist/types/src/capabilities/schema.d.ts +4 -0
- package/dist/types/src/capabilities/schema.d.ts.map +1 -0
- package/dist/types/src/components/IdentityDialog.d.ts +1 -2
- package/dist/types/src/components/IdentityDialog.d.ts.map +1 -1
- package/dist/types/src/components/JoinDialog.d.ts +1 -2
- package/dist/types/src/components/JoinDialog.d.ts.map +1 -1
- package/dist/types/src/components/ManageCredentialsDialog.d.ts +3 -0
- package/dist/types/src/components/ManageCredentialsDialog.d.ts.map +1 -0
- package/dist/types/src/components/ManageCredentialsDialog.stories.d.ts +8 -0
- package/dist/types/src/components/ManageCredentialsDialog.stories.d.ts.map +1 -0
- package/dist/types/src/components/RecoveryCodeDialog.d.ts +1 -2
- package/dist/types/src/components/RecoveryCodeDialog.d.ts.map +1 -1
- package/dist/types/src/components/RecoverySetupDialog.d.ts +3 -0
- package/dist/types/src/components/RecoverySetupDialog.d.ts.map +1 -0
- package/dist/types/src/components/RecoverySetupDialog.stories.d.ts +8 -0
- package/dist/types/src/components/RecoverySetupDialog.stories.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +1 -0
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/events.d.ts +7 -0
- package/dist/types/src/events.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +3 -2
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +1 -2
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +7 -0
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types.d.ts +22 -18
- package/dist/types/src/types.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +23 -24
- package/src/ClientPlugin.ts +64 -0
- package/src/capabilities/app-graph-builder.ts +39 -0
- package/src/capabilities/capabilities.ts +14 -0
- package/src/capabilities/client.ts +40 -0
- package/src/capabilities/index.ts +14 -0
- package/src/capabilities/intent-resolver.ts +198 -0
- package/src/capabilities/react-context.tsx +20 -0
- package/src/capabilities/react-surface.tsx +59 -0
- package/src/capabilities/schema.ts +26 -0
- package/src/components/IdentityDialog.tsx +15 -3
- package/src/components/JoinDialog.tsx +1 -1
- package/src/components/ManageCredentialsDialog.stories.tsx +57 -0
- package/src/components/ManageCredentialsDialog.tsx +64 -0
- package/src/components/RecoveryCodeDialog.stories.tsx +5 -5
- package/src/components/RecoveryCodeDialog.tsx +2 -1
- package/src/components/RecoverySetupDialog.stories.tsx +77 -0
- package/src/components/RecoverySetupDialog.tsx +52 -0
- package/src/components/index.ts +1 -0
- package/src/events.ts +14 -0
- package/src/index.ts +4 -4
- package/src/meta.ts +1 -1
- package/src/translations.ts +10 -1
- package/src/types.ts +16 -32
- package/dist/lib/browser/chunk-52IJQ35F.mjs.map +0 -7
- package/dist/lib/browser/chunk-X4QUPYC6.mjs.map +0 -7
- package/dist/lib/browser/meta.mjs +0 -9
- package/dist/lib/browser/meta.mjs.map +0 -7
- package/dist/lib/node/chunk-NFO3ADQC.cjs.map +0 -7
- package/dist/lib/node/chunk-RUA5KXVW.cjs.map +0 -7
- package/dist/lib/node/meta.cjs.map +0 -7
- package/dist/lib/node-esm/chunk-GMGRQ5Q7.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-TI4GNGMM.mjs.map +0 -7
- package/dist/lib/node-esm/meta.mjs +0 -10
- package/dist/lib/node-esm/meta.mjs.map +0 -7
- package/src/ClientPlugin.tsx +0 -227
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ClientAction
|
|
3
|
+
} from "./chunk-7DPLXOMO.mjs";
|
|
4
|
+
import {
|
|
5
|
+
CLIENT_PLUGIN
|
|
6
|
+
} from "./chunk-NHIL4T3L.mjs";
|
|
7
|
+
|
|
8
|
+
// packages/plugins/plugin-client/src/capabilities/app-graph-builder.ts
|
|
9
|
+
import { createIntent } from "@dxos/app-framework";
|
|
10
|
+
import { Capabilities, contributes } from "@dxos/app-framework";
|
|
11
|
+
import { createExtension } from "@dxos/plugin-graph";
|
|
12
|
+
var app_graph_builder_default = (context) => contributes(Capabilities.AppGraphBuilder, createExtension({
|
|
13
|
+
id: CLIENT_PLUGIN,
|
|
14
|
+
filter: (node) => node.id === "root",
|
|
15
|
+
actions: () => [
|
|
16
|
+
{
|
|
17
|
+
id: `${CLIENT_PLUGIN}/open-shell`,
|
|
18
|
+
data: async () => {
|
|
19
|
+
const { dispatchPromise: dispatch } = context.requestCapability(Capabilities.IntentDispatcher);
|
|
20
|
+
await dispatch(createIntent(ClientAction.ShareIdentity));
|
|
21
|
+
},
|
|
22
|
+
properties: {
|
|
23
|
+
label: [
|
|
24
|
+
"open shell label",
|
|
25
|
+
{
|
|
26
|
+
ns: CLIENT_PLUGIN
|
|
27
|
+
}
|
|
28
|
+
],
|
|
29
|
+
icon: "ph--address-book--regular",
|
|
30
|
+
keyBinding: {
|
|
31
|
+
macos: "meta+shift+.",
|
|
32
|
+
// TODO(wittjosiah): Test on windows to see if it behaves the same as linux.
|
|
33
|
+
windows: "alt+shift+.",
|
|
34
|
+
linux: "alt+shift+>"
|
|
35
|
+
},
|
|
36
|
+
testId: "clientPlugin.openShell"
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
]
|
|
40
|
+
}));
|
|
41
|
+
export {
|
|
42
|
+
app_graph_builder_default as default
|
|
43
|
+
};
|
|
44
|
+
//# sourceMappingURL=app-graph-builder-ON64R7SO.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 { createIntent } from '@dxos/app-framework';\nimport { Capabilities, contributes, type PluginsContext } from '@dxos/app-framework';\nimport { createExtension, type Node } from '@dxos/plugin-graph';\n\nimport { CLIENT_PLUGIN } from '../meta';\nimport { ClientAction } from '../types';\n\nexport default (context: PluginsContext) =>\n contributes(\n Capabilities.AppGraphBuilder,\n createExtension({\n id: CLIENT_PLUGIN,\n filter: (node): node is Node<null> => node.id === 'root',\n actions: () => [\n {\n id: `${CLIENT_PLUGIN}/open-shell`,\n data: async () => {\n const { dispatchPromise: dispatch } = context.requestCapability(Capabilities.IntentDispatcher);\n await dispatch(createIntent(ClientAction.ShareIdentity));\n },\n properties: {\n label: ['open shell label', { ns: CLIENT_PLUGIN }],\n icon: 'ph--address-book--regular',\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 testId: 'clientPlugin.openShell',\n },\n },\n ],\n }),\n );\n"],
|
|
5
|
+
"mappings": ";;;;;;;;AAIA,SAASA,oBAAoB;AAC7B,SAASC,cAAcC,mBAAwC;AAC/D,SAASC,uBAAkC;AAK3C,IAAA,4BAAe,CAACC,YACdC,YACEC,aAAaC,iBACbC,gBAAgB;EACdC,IAAIC;EACJC,QAAQ,CAACC,SAA6BA,KAAKH,OAAO;EAClDI,SAAS,MAAM;IACb;MACEJ,IAAI,GAAGC,aAAAA;MACPI,MAAM,YAAA;AACJ,cAAM,EAAEC,iBAAiBC,SAAQ,IAAKZ,QAAQa,kBAAkBX,aAAaY,gBAAgB;AAC7F,cAAMF,SAASG,aAAaC,aAAaC,aAAa,CAAA;MACxD;MACAC,YAAY;QACVC,OAAO;UAAC;UAAoB;YAAEC,IAAId;UAAc;;QAChDe,MAAM;QACNC,YAAY;UACVC,OAAO;;UAEPC,SAAS;UACTC,OAAO;QACT;QACAC,QAAQ;MACV;IACF;;AAEJ,CAAA,CAAA;",
|
|
6
|
+
"names": ["createIntent", "Capabilities", "contributes", "createExtension", "context", "contributes", "Capabilities", "AppGraphBuilder", "createExtension", "id", "CLIENT_PLUGIN", "filter", "node", "actions", "data", "dispatchPromise", "dispatch", "requestCapability", "IntentDispatcher", "createIntent", "ClientAction", "ShareIdentity", "properties", "label", "ns", "icon", "keyBinding", "macos", "windows", "linux", "testId"]
|
|
7
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CLIENT_PLUGIN
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-NHIL4T3L.mjs";
|
|
4
4
|
|
|
5
5
|
// packages/plugins/plugin-client/src/types.ts
|
|
6
6
|
import { S } from "@dxos/echo-schema";
|
|
7
|
-
import {
|
|
7
|
+
import { PublicKey } from "@dxos/react-client";
|
|
8
8
|
var IdentitySchema = S.Struct({
|
|
9
9
|
identityKey: S.instanceOf(PublicKey),
|
|
10
10
|
spaceKey: S.optional(S.instanceOf(PublicKey)),
|
|
@@ -30,7 +30,7 @@ var ClientAction;
|
|
|
30
30
|
ClientAction2.CreateIdentity = CreateIdentity;
|
|
31
31
|
class JoinIdentity extends S.TaggedClass()(`${CLIENT_ACTION}/join-identity`, {
|
|
32
32
|
input: S.Struct({
|
|
33
|
-
invitationCode: S.String
|
|
33
|
+
invitationCode: S.optional(S.String)
|
|
34
34
|
}),
|
|
35
35
|
output: S.Void
|
|
36
36
|
}) {
|
|
@@ -68,11 +68,21 @@ var ClientAction;
|
|
|
68
68
|
}) {
|
|
69
69
|
}
|
|
70
70
|
ClientAction2.CreateRecoveryCode = CreateRecoveryCode;
|
|
71
|
+
class CreatePasskey extends S.TaggedClass()(`${CLIENT_ACTION}/create-passkey`, {
|
|
72
|
+
input: S.Void,
|
|
73
|
+
output: S.Void
|
|
74
|
+
}) {
|
|
75
|
+
}
|
|
76
|
+
ClientAction2.CreatePasskey = CreatePasskey;
|
|
77
|
+
class RedeemPasskey extends S.TaggedClass()(`${CLIENT_ACTION}/redeem-passkey`, {
|
|
78
|
+
input: S.Void,
|
|
79
|
+
output: S.Void
|
|
80
|
+
}) {
|
|
81
|
+
}
|
|
82
|
+
ClientAction2.RedeemPasskey = RedeemPasskey;
|
|
71
83
|
})(ClientAction || (ClientAction = {}));
|
|
72
|
-
var parseClientPlugin = (plugin) => (plugin?.provides).client instanceof Client ? plugin : void 0;
|
|
73
84
|
|
|
74
85
|
export {
|
|
75
|
-
ClientAction
|
|
76
|
-
parseClientPlugin
|
|
86
|
+
ClientAction
|
|
77
87
|
};
|
|
78
|
-
//# sourceMappingURL=chunk-
|
|
88
|
+
//# sourceMappingURL=chunk-7DPLXOMO.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/types.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { type PluginsContext } from '@dxos/app-framework';\nimport { S } from '@dxos/echo-schema';\nimport { type Client, PublicKey, type ClientOptions } from '@dxos/react-client';\nimport { type MaybePromise } from '@dxos/util';\n\nimport { CLIENT_PLUGIN } from './meta';\n\n// TODO(wittjosiah): Factor out. Generate?\nconst IdentitySchema = S.Struct({\n identityKey: S.instanceOf(PublicKey),\n spaceKey: S.optional(S.instanceOf(PublicKey)),\n profile: S.optional(\n S.Struct({\n displayName: S.optional(S.String),\n avatarCid: S.optional(S.String),\n data: S.optional(S.Record({ key: S.String, value: S.Any })),\n }),\n ),\n});\n\nconst CLIENT_ACTION = `${CLIENT_PLUGIN}/action`;\nexport namespace ClientAction {\n export class CreateIdentity extends S.TaggedClass<CreateIdentity>()(`${CLIENT_ACTION}/create-identity`, {\n input: S.Struct({\n displayName: S.optional(S.String),\n }),\n output: IdentitySchema,\n }) {}\n\n export class JoinIdentity extends S.TaggedClass<JoinIdentity>()(`${CLIENT_ACTION}/join-identity`, {\n input: S.Struct({\n invitationCode: S.optional(S.String),\n }),\n output: S.Void,\n }) {}\n\n export class ShareIdentity extends S.TaggedClass<ShareIdentity>()(`${CLIENT_ACTION}/share-identity`, {\n input: S.Void,\n output: S.Void,\n }) {}\n\n export class RecoverIdentity extends S.TaggedClass<RecoverIdentity>()(`${CLIENT_ACTION}/recover-identity`, {\n input: S.Void,\n output: S.Void,\n }) {}\n\n export class ResetStorage extends S.TaggedClass<ResetStorage>()(`${CLIENT_ACTION}/reset-storage`, {\n input: S.Struct({\n target: S.optional(S.String),\n }),\n output: S.Void,\n }) {}\n\n export class CreateAgent extends S.TaggedClass<CreateAgent>()(`${CLIENT_ACTION}/create-agent`, {\n input: S.Void,\n output: S.Void,\n }) {}\n\n export class CreateRecoveryCode extends S.TaggedClass<CreateRecoveryCode>()(`${CLIENT_ACTION}/create-recovery-code`, {\n input: S.Void,\n output: S.Void,\n }) {}\n\n export class CreatePasskey extends S.TaggedClass<CreatePasskey>()(`${CLIENT_ACTION}/create-passkey`, {\n input: S.Void,\n output: S.Void,\n }) {}\n\n export class RedeemPasskey extends S.TaggedClass<RedeemPasskey>()(`${CLIENT_ACTION}/redeem-passkey`, {\n input: S.Void,\n output: S.Void,\n }) {}\n}\n\nexport type ClientPluginOptions = ClientOptions & {\n /**\n * Base URL for the invitation link.\n */\n invitationUrl?: string;\n\n /**\n * Query parameter for the invitation code.\n */\n invitationParam?: string;\n\n /**\n * Run after the client has been initialized.\n */\n onClientInitialized?: (context: PluginsContext, client: Client) => MaybePromise<void>;\n\n /**\n * Called when the client is reset.\n */\n onReset?: (params: { target?: string }) => MaybePromise<void>;\n};\n"],
|
|
5
|
+
"mappings": ";;;;;AAKA,SAASA,SAAS;AAClB,SAAsBC,iBAAqC;AAM3D,IAAMC,iBAAiBC,EAAEC,OAAO;EAC9BC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7B,EAAEM,SAASN,EAAES,MAAM;IAC7B,CAAA;IACAa,QAAQtB,EAAEyB;EACZ,CAAA,EAAA;EAAI;gBALSG,eAAAA;EAON,MAAME,oBAAoB9B,EAAEoB,YAAW,EAAgB,GAAGJ,aAAAA,iBAA8B;IAC7FK,OAAOrB,EAAEyB;IACTH,QAAQtB,EAAEyB;EACZ,CAAA,EAAA;EAAI;gBAHSK,cAAAA;EAKN,MAAMC,2BAA2B/B,EAAEoB,YAAW,EAAuB,GAAGJ,aAAAA,yBAAsC;IACnHK,OAAOrB,EAAEyB;IACTH,QAAQtB,EAAEyB;EACZ,CAAA,EAAA;EAAI;gBAHSM,qBAAAA;EAKN,MAAMC,sBAAsBhC,EAAEoB,YAAW,EAAkB,GAAGJ,aAAAA,mBAAgC;IACnGK,OAAOrB,EAAEyB;IACTH,QAAQtB,EAAEyB;EACZ,CAAA,EAAA;EAAI;gBAHSO,gBAAAA;EAKN,MAAMC,sBAAsBjC,EAAEoB,YAAW,EAAkB,GAAGJ,aAAAA,mBAAgC;IACnGK,OAAOrB,EAAEyB;IACTH,QAAQtB,EAAEyB;EACZ,CAAA,EAAA;EAAI;gBAHSQ,gBAAAA;AAIf,GAnDiBf,iBAAAA,eAAAA,CAAAA,EAAAA;",
|
|
6
|
+
"names": ["S", "PublicKey", "IdentitySchema", "S", "Struct", "identityKey", "instanceOf", "PublicKey", "spaceKey", "optional", "profile", "displayName", "String", "avatarCid", "data", "Record", "key", "value", "Any", "CLIENT_ACTION", "CLIENT_PLUGIN", "ClientAction", "CreateIdentity", "TaggedClass", "input", "output", "JoinIdentity", "invitationCode", "Void", "ShareIdentity", "RecoverIdentity", "ResetStorage", "target", "CreateAgent", "CreateRecoveryCode", "CreatePasskey", "RedeemPasskey"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ClientAction
|
|
3
|
+
} from "./chunk-7DPLXOMO.mjs";
|
|
4
|
+
import {
|
|
5
|
+
CLIENT_PLUGIN
|
|
6
|
+
} from "./chunk-NHIL4T3L.mjs";
|
|
7
|
+
|
|
8
|
+
// packages/plugins/plugin-client/src/components/ManageCredentialsDialog.tsx
|
|
9
|
+
import { Receipt, Key } from "@phosphor-icons/react";
|
|
10
|
+
import React, { useMemo } from "react";
|
|
11
|
+
import { createIntent, useIntentDispatcher } from "@dxos/app-framework";
|
|
12
|
+
import { useCredentials } from "@dxos/react-client/halo";
|
|
13
|
+
import { Dialog, Icon, List, ListItem, useTranslation } from "@dxos/react-ui";
|
|
14
|
+
import { BifurcatedAction } from "@dxos/shell/react";
|
|
15
|
+
var MANAGE_CREDENTIALS_DIALOG = `${CLIENT_PLUGIN}/ManageCredentialsDialog`;
|
|
16
|
+
var ManageCredentialsDialog = () => {
|
|
17
|
+
const { t } = useTranslation(CLIENT_PLUGIN);
|
|
18
|
+
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
19
|
+
const credentials = useCredentials();
|
|
20
|
+
const recoveryCredentials = credentials.filter((credential) => credential.subject.assertion["@type"] === "dxos.halo.credentials.IdentityRecovery");
|
|
21
|
+
const actions = useMemo(() => ({
|
|
22
|
+
createPasskey: {
|
|
23
|
+
label: t("create passkey label"),
|
|
24
|
+
description: t("create passkey description"),
|
|
25
|
+
// TODO(wittjosiah): Ideally this would be a `user-key` icon.
|
|
26
|
+
icon: Key,
|
|
27
|
+
onClick: () => dispatch(createIntent(ClientAction.CreatePasskey))
|
|
28
|
+
},
|
|
29
|
+
createRecoveryCode: {
|
|
30
|
+
label: t("create recovery code label"),
|
|
31
|
+
description: t("create recovery code description"),
|
|
32
|
+
icon: Receipt,
|
|
33
|
+
onClick: () => dispatch(createIntent(ClientAction.CreateRecoveryCode))
|
|
34
|
+
}
|
|
35
|
+
}), [
|
|
36
|
+
t
|
|
37
|
+
]);
|
|
38
|
+
return /* @__PURE__ */ React.createElement(Dialog.Content, {
|
|
39
|
+
classNames: "bs-content min-bs-[15rem] max-bs-full md:max-is-[25rem] overflow-hidden"
|
|
40
|
+
}, /* @__PURE__ */ React.createElement(Dialog.Title, null, t("manage credentials dialog title")), /* @__PURE__ */ React.createElement(List, {
|
|
41
|
+
classNames: "py-4"
|
|
42
|
+
}, recoveryCredentials.map((credential) => /* @__PURE__ */ React.createElement(ListItem.Root, {
|
|
43
|
+
key: credential.id?.toHex()
|
|
44
|
+
}, /* @__PURE__ */ React.createElement(ListItem.Endcap, null, /* @__PURE__ */ React.createElement(Icon, {
|
|
45
|
+
icon: "ph--key--regular",
|
|
46
|
+
size: 5
|
|
47
|
+
})), /* @__PURE__ */ React.createElement(ListItem.Heading, null, credential.issuanceDate.toLocaleString())))), /* @__PURE__ */ React.createElement("div", {
|
|
48
|
+
className: "grow"
|
|
49
|
+
}), /* @__PURE__ */ React.createElement(BifurcatedAction, {
|
|
50
|
+
actions
|
|
51
|
+
}));
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
// packages/plugins/plugin-client/src/components/IdentityDialog.tsx
|
|
55
|
+
import React2, { useCallback } from "react";
|
|
56
|
+
import { createIntent as createIntent2, LayoutAction, useIntentDispatcher as useIntentDispatcher2 } from "@dxos/app-framework";
|
|
57
|
+
import { useClient } from "@dxos/react-client";
|
|
58
|
+
import { Clipboard, Dialog as Dialog2 } from "@dxos/react-ui";
|
|
59
|
+
import { IdentityPanel } from "@dxos/shell/react";
|
|
60
|
+
var IDENTITY_DIALOG = `${CLIENT_PLUGIN}/IdentityDialog`;
|
|
61
|
+
var IdentityDialog = (props) => {
|
|
62
|
+
const { dispatchPromise: dispatch } = useIntentDispatcher2();
|
|
63
|
+
const client = useClient();
|
|
64
|
+
const handleDone = useCallback(() => dispatch(createIntent2(LayoutAction.UpdateDialog, {
|
|
65
|
+
part: "dialog",
|
|
66
|
+
options: {
|
|
67
|
+
state: false
|
|
68
|
+
}
|
|
69
|
+
})), [
|
|
70
|
+
dispatch
|
|
71
|
+
]);
|
|
72
|
+
const handleResetStorage = useCallback(async () => {
|
|
73
|
+
await client.reset();
|
|
74
|
+
await dispatch(createIntent2(ClientAction.ResetStorage));
|
|
75
|
+
}, [
|
|
76
|
+
dispatch
|
|
77
|
+
]);
|
|
78
|
+
const handleRecover = useCallback(async () => {
|
|
79
|
+
await client.reset();
|
|
80
|
+
await dispatch(createIntent2(ClientAction.ResetStorage, {
|
|
81
|
+
target: "recoverIdentity"
|
|
82
|
+
}));
|
|
83
|
+
}, [
|
|
84
|
+
dispatch
|
|
85
|
+
]);
|
|
86
|
+
const handleJoinNewIdentity = useCallback(async () => {
|
|
87
|
+
await client.reset();
|
|
88
|
+
await dispatch(createIntent2(ClientAction.ResetStorage, {
|
|
89
|
+
target: "deviceInvitation"
|
|
90
|
+
}));
|
|
91
|
+
}, [
|
|
92
|
+
dispatch
|
|
93
|
+
]);
|
|
94
|
+
const handleManageCredentials = useCallback(async () => {
|
|
95
|
+
await dispatch(createIntent2(LayoutAction.UpdateDialog, {
|
|
96
|
+
part: "dialog",
|
|
97
|
+
subject: MANAGE_CREDENTIALS_DIALOG,
|
|
98
|
+
options: {
|
|
99
|
+
state: true,
|
|
100
|
+
blockAlign: "start"
|
|
101
|
+
}
|
|
102
|
+
}));
|
|
103
|
+
}, [
|
|
104
|
+
dispatch
|
|
105
|
+
]);
|
|
106
|
+
return /* @__PURE__ */ React2.createElement(Dialog2.Content, null, /* @__PURE__ */ React2.createElement(Clipboard.Provider, null, /* @__PURE__ */ React2.createElement(IdentityPanel, {
|
|
107
|
+
...props,
|
|
108
|
+
doneActionParent: /* @__PURE__ */ React2.createElement(Dialog2.Close, {
|
|
109
|
+
asChild: true
|
|
110
|
+
}),
|
|
111
|
+
onDone: handleDone,
|
|
112
|
+
onResetStorage: handleResetStorage,
|
|
113
|
+
onRecover: handleRecover,
|
|
114
|
+
onJoinNewIdentity: handleJoinNewIdentity,
|
|
115
|
+
onManageCredentials: handleManageCredentials
|
|
116
|
+
})));
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
// packages/plugins/plugin-client/src/components/JoinDialog.tsx
|
|
120
|
+
import React3, { useCallback as useCallback2 } from "react";
|
|
121
|
+
import { createIntent as createIntent3, LayoutAction as LayoutAction2, useIntentDispatcher as useIntentDispatcher3 } from "@dxos/app-framework";
|
|
122
|
+
import { ObservabilityAction } from "@dxos/plugin-observability/types";
|
|
123
|
+
import { Dialog as Dialog3 } from "@dxos/react-ui";
|
|
124
|
+
import { JoinPanel } from "@dxos/shell/react";
|
|
125
|
+
var JOIN_DIALOG = `${CLIENT_PLUGIN}/JoinDialog`;
|
|
126
|
+
var JoinDialog = (props) => {
|
|
127
|
+
const { dispatchPromise: dispatch } = useIntentDispatcher3();
|
|
128
|
+
const handleCancelResetStorage = useCallback2(() => dispatch(createIntent3(ClientAction.ShareIdentity)), [
|
|
129
|
+
dispatch
|
|
130
|
+
]);
|
|
131
|
+
const handleDone = useCallback2(async (result) => {
|
|
132
|
+
if (result?.identityKey) {
|
|
133
|
+
await Promise.all([
|
|
134
|
+
dispatch(createIntent3(LayoutAction2.UpdateDialog, {
|
|
135
|
+
part: "dialog",
|
|
136
|
+
options: {
|
|
137
|
+
state: false
|
|
138
|
+
}
|
|
139
|
+
})),
|
|
140
|
+
dispatch(createIntent3(ObservabilityAction.SendEvent, {
|
|
141
|
+
name: props.initialDisposition === "recover-identity" ? "identity.recover" : "identity.join"
|
|
142
|
+
}))
|
|
143
|
+
]);
|
|
144
|
+
}
|
|
145
|
+
}, [
|
|
146
|
+
dispatch
|
|
147
|
+
]);
|
|
148
|
+
return /* @__PURE__ */ React3.createElement(Dialog3.Content, null, /* @__PURE__ */ React3.createElement(JoinPanel, {
|
|
149
|
+
mode: "halo-only",
|
|
150
|
+
...props,
|
|
151
|
+
exitActionParent: /* @__PURE__ */ React3.createElement(Dialog3.Close, {
|
|
152
|
+
asChild: true
|
|
153
|
+
}),
|
|
154
|
+
doneActionParent: /* @__PURE__ */ React3.createElement(Dialog3.Close, {
|
|
155
|
+
asChild: true
|
|
156
|
+
}),
|
|
157
|
+
onCancelResetStorage: handleCancelResetStorage,
|
|
158
|
+
onDone: handleDone
|
|
159
|
+
}));
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
// packages/plugins/plugin-client/src/components/RecoveryCodeDialog.tsx
|
|
163
|
+
import React4, { useCallback as useCallback3, useState } from "react";
|
|
164
|
+
import { AlertDialog, Button, Clipboard as Clipboard2, Input, useTranslation as useTranslation2 } from "@dxos/react-ui";
|
|
165
|
+
var RECOVER_CODE_DIALOG = `${CLIENT_PLUGIN}/RecoveryCodeDialog`;
|
|
166
|
+
var RecoveryCodeDialog = ({ code }) => {
|
|
167
|
+
const { t } = useTranslation2(CLIENT_PLUGIN);
|
|
168
|
+
const [confirmation, setConfirmation] = useState(false);
|
|
169
|
+
const handleConfirmation = useCallback3((checked) => setConfirmation(checked), []);
|
|
170
|
+
return /* @__PURE__ */ React4.createElement(AlertDialog.Content, {
|
|
171
|
+
classNames: "bs-content min-bs-[15rem] max-bs-full md:max-is-[40rem] overflow-hidden"
|
|
172
|
+
}, /* @__PURE__ */ React4.createElement(AlertDialog.Title, null, t("recovery code dialog title")), /* @__PURE__ */ React4.createElement("p", {
|
|
173
|
+
className: "py-4"
|
|
174
|
+
}, t("recovery code dialog description")), /* @__PURE__ */ React4.createElement(Clipboard2.Provider, null, /* @__PURE__ */ React4.createElement(Code, {
|
|
175
|
+
code
|
|
176
|
+
})), /* @__PURE__ */ React4.createElement("div", {
|
|
177
|
+
className: "flex flex-col py-4 gap-2"
|
|
178
|
+
}, /* @__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", {
|
|
179
|
+
className: "flex items-center gap-2 pbe-4"
|
|
180
|
+
}, /* @__PURE__ */ React4.createElement(Input.Root, null, /* @__PURE__ */ React4.createElement(Input.Checkbox, {
|
|
181
|
+
"data-testid": "recoveryCode.confirm",
|
|
182
|
+
checked: confirmation,
|
|
183
|
+
onCheckedChange: handleConfirmation
|
|
184
|
+
}), /* @__PURE__ */ React4.createElement(Input.Label, null, t("recovery code confirmation label")))), /* @__PURE__ */ React4.createElement("div", {
|
|
185
|
+
className: "flex justify-end"
|
|
186
|
+
}, /* @__PURE__ */ React4.createElement(AlertDialog.Action, {
|
|
187
|
+
asChild: true
|
|
188
|
+
}, /* @__PURE__ */ React4.createElement(Button, {
|
|
189
|
+
"data-testid": "recoveryCode.continue",
|
|
190
|
+
variant: "primary",
|
|
191
|
+
disabled: !confirmation
|
|
192
|
+
}, t("continue label")))));
|
|
193
|
+
};
|
|
194
|
+
var Code = ({ code }) => {
|
|
195
|
+
const words = code.split(" ");
|
|
196
|
+
return /* @__PURE__ */ React4.createElement("div", {
|
|
197
|
+
className: "relative p-2 border border-separator rounded group"
|
|
198
|
+
}, /* @__PURE__ */ React4.createElement(Clipboard2.IconButton, {
|
|
199
|
+
value: code,
|
|
200
|
+
classNames: "absolute top-2 right-2 invisible group-hover:visible"
|
|
201
|
+
}), /* @__PURE__ */ React4.createElement("div", {
|
|
202
|
+
className: "grid grid-cols-4"
|
|
203
|
+
}, words.map((word, i) => /* @__PURE__ */ React4.createElement("div", {
|
|
204
|
+
key: i,
|
|
205
|
+
className: "flex items-center p-2 gap-2"
|
|
206
|
+
}, /* @__PURE__ */ React4.createElement("div", {
|
|
207
|
+
className: "w-4 text-xs text-center text-subdued"
|
|
208
|
+
}, i + 1), /* @__PURE__ */ React4.createElement("div", {
|
|
209
|
+
className: "text-sm"
|
|
210
|
+
}, word)))));
|
|
211
|
+
};
|
|
212
|
+
|
|
213
|
+
// packages/plugins/plugin-client/src/components/RecoverySetupDialog.tsx
|
|
214
|
+
import { Key as Key2, Receipt as Receipt2 } from "@phosphor-icons/react";
|
|
215
|
+
import React5, { useMemo as useMemo2 } from "react";
|
|
216
|
+
import { createIntent as createIntent4, LayoutAction as LayoutAction3, useIntentDispatcher as useIntentDispatcher4 } from "@dxos/app-framework";
|
|
217
|
+
import { AlertDialog as AlertDialog2, useTranslation as useTranslation3 } from "@dxos/react-ui";
|
|
218
|
+
import { BifurcatedAction as BifurcatedAction2 } from "@dxos/shell/react";
|
|
219
|
+
var RECOVER_SETUP_DIALOG = `${CLIENT_PLUGIN}/RecoverySetupDialog`;
|
|
220
|
+
var RecoverySetupDialog = () => {
|
|
221
|
+
const { t } = useTranslation3(CLIENT_PLUGIN);
|
|
222
|
+
const { dispatchPromise: dispatch } = useIntentDispatcher4();
|
|
223
|
+
const actions = useMemo2(() => ({
|
|
224
|
+
createPasskey: {
|
|
225
|
+
label: t("create passkey label"),
|
|
226
|
+
description: t("create passkey description"),
|
|
227
|
+
// TODO(wittjosiah): Ideally this would be a `user-key` icon.
|
|
228
|
+
icon: Key2,
|
|
229
|
+
onClick: async () => {
|
|
230
|
+
await dispatch(createIntent4(ClientAction.CreatePasskey));
|
|
231
|
+
await dispatch(createIntent4(LayoutAction3.UpdateDialog, {
|
|
232
|
+
part: "dialog",
|
|
233
|
+
options: {
|
|
234
|
+
state: false
|
|
235
|
+
}
|
|
236
|
+
}));
|
|
237
|
+
}
|
|
238
|
+
},
|
|
239
|
+
createRecoveryCode: {
|
|
240
|
+
label: t("create recovery code label"),
|
|
241
|
+
description: t("create recovery code description"),
|
|
242
|
+
icon: Receipt2,
|
|
243
|
+
onClick: () => dispatch(createIntent4(ClientAction.CreateRecoveryCode))
|
|
244
|
+
}
|
|
245
|
+
}), [
|
|
246
|
+
t
|
|
247
|
+
]);
|
|
248
|
+
return /* @__PURE__ */ React5.createElement(AlertDialog2.Content, {
|
|
249
|
+
classNames: "bs-content min-bs-[15rem] max-bs-full md:max-is-[25rem] overflow-hidden"
|
|
250
|
+
}, /* @__PURE__ */ React5.createElement(AlertDialog2.Title, null, t("recovery setup dialog title")), /* @__PURE__ */ React5.createElement("p", {
|
|
251
|
+
className: "py-4"
|
|
252
|
+
}, t("recovery setup dialog description")), /* @__PURE__ */ React5.createElement("div", {
|
|
253
|
+
className: "grow"
|
|
254
|
+
}), /* @__PURE__ */ React5.createElement(BifurcatedAction2, {
|
|
255
|
+
actions
|
|
256
|
+
}));
|
|
257
|
+
};
|
|
258
|
+
|
|
259
|
+
export {
|
|
260
|
+
MANAGE_CREDENTIALS_DIALOG,
|
|
261
|
+
ManageCredentialsDialog,
|
|
262
|
+
IDENTITY_DIALOG,
|
|
263
|
+
IdentityDialog,
|
|
264
|
+
JOIN_DIALOG,
|
|
265
|
+
JoinDialog,
|
|
266
|
+
RECOVER_CODE_DIALOG,
|
|
267
|
+
RecoveryCodeDialog,
|
|
268
|
+
RECOVER_SETUP_DIALOG,
|
|
269
|
+
RecoverySetupDialog
|
|
270
|
+
};
|
|
271
|
+
//# sourceMappingURL=chunk-EYBZZHSM.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/ManageCredentialsDialog.tsx", "../../../src/components/IdentityDialog.tsx", "../../../src/components/JoinDialog.tsx", "../../../src/components/RecoveryCodeDialog.tsx", "../../../src/components/RecoverySetupDialog.tsx"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { Receipt, Key } from '@phosphor-icons/react';\nimport React, { useMemo } from 'react';\n\nimport { createIntent, useIntentDispatcher } from '@dxos/app-framework';\nimport { useCredentials } from '@dxos/react-client/halo';\nimport { Dialog, Icon, List, ListItem, useTranslation } from '@dxos/react-ui';\nimport { BifurcatedAction, type ActionMenuItem } from '@dxos/shell/react';\n\nimport { CLIENT_PLUGIN } from '../meta';\nimport { ClientAction } from '../types';\n\nexport const MANAGE_CREDENTIALS_DIALOG = `${CLIENT_PLUGIN}/ManageCredentialsDialog`;\n\n// TODO(wittjosiah): Factor panel out to @dxos/shell.\nexport const ManageCredentialsDialog = () => {\n const { t } = useTranslation(CLIENT_PLUGIN);\n const { dispatchPromise: dispatch } = useIntentDispatcher();\n const credentials = useCredentials();\n const recoveryCredentials = credentials.filter(\n (credential) => credential.subject.assertion['@type'] === 'dxos.halo.credentials.IdentityRecovery',\n );\n\n // TODO(wittjosiah): Reconsile w/ RecoverySetupDialog actions.\n const actions: Record<string, ActionMenuItem> = useMemo(\n () => ({\n createPasskey: {\n label: t('create passkey label'),\n description: t('create passkey description'),\n // TODO(wittjosiah): Ideally this would be a `user-key` icon.\n icon: Key,\n onClick: () => dispatch(createIntent(ClientAction.CreatePasskey)),\n },\n createRecoveryCode: {\n label: t('create recovery code label'),\n description: t('create recovery code description'),\n icon: Receipt,\n onClick: () => dispatch(createIntent(ClientAction.CreateRecoveryCode)),\n },\n }),\n [t],\n );\n\n return (\n <Dialog.Content classNames='bs-content min-bs-[15rem] max-bs-full md:max-is-[25rem] overflow-hidden'>\n <Dialog.Title>{t('manage credentials dialog title')}</Dialog.Title>\n <List classNames='py-4'>\n {recoveryCredentials.map((credential) => (\n <ListItem.Root key={credential.id?.toHex()}>\n <ListItem.Endcap>\n <Icon icon='ph--key--regular' size={5} />\n </ListItem.Endcap>\n <ListItem.Heading>{credential.issuanceDate.toLocaleString()}</ListItem.Heading>\n </ListItem.Root>\n ))}\n </List>\n <div className='grow' />\n <BifurcatedAction actions={actions} />\n </Dialog.Content>\n );\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { useCallback } from 'react';\n\nimport { createIntent, LayoutAction, useIntentDispatcher } from '@dxos/app-framework';\nimport { useClient } from '@dxos/react-client';\nimport { Clipboard, Dialog } from '@dxos/react-ui';\nimport { IdentityPanel, type IdentityPanelProps } from '@dxos/shell/react';\n\nimport { MANAGE_CREDENTIALS_DIALOG } from './ManageCredentialsDialog';\nimport { CLIENT_PLUGIN } from '../meta';\nimport { ClientAction } from '../types';\n\nexport const IDENTITY_DIALOG = `${CLIENT_PLUGIN}/IdentityDialog`;\n\nexport const IdentityDialog = (props: IdentityPanelProps) => {\n const { dispatchPromise: dispatch } = useIntentDispatcher();\n const client = useClient();\n\n const handleDone = useCallback(\n () =>\n dispatch(\n createIntent(LayoutAction.UpdateDialog, {\n part: 'dialog',\n options: { state: false },\n }),\n ),\n [dispatch],\n );\n\n const handleResetStorage = useCallback(async () => {\n await client.reset();\n await dispatch(createIntent(ClientAction.ResetStorage));\n }, [dispatch]);\n\n const handleRecover = useCallback(async () => {\n await client.reset();\n await dispatch(createIntent(ClientAction.ResetStorage, { target: 'recoverIdentity' }));\n }, [dispatch]);\n\n const handleJoinNewIdentity = useCallback(async () => {\n await client.reset();\n await dispatch(createIntent(ClientAction.ResetStorage, { target: 'deviceInvitation' }));\n }, [dispatch]);\n\n const handleManageCredentials = useCallback(async () => {\n await dispatch(\n createIntent(LayoutAction.UpdateDialog, {\n part: 'dialog',\n subject: MANAGE_CREDENTIALS_DIALOG,\n options: { state: true, blockAlign: 'start' },\n }),\n );\n }, [dispatch]);\n\n return (\n <Dialog.Content>\n <Clipboard.Provider>\n <IdentityPanel\n {...props}\n doneActionParent={<Dialog.Close asChild />}\n onDone={handleDone}\n onResetStorage={handleResetStorage}\n onRecover={handleRecover}\n onJoinNewIdentity={handleJoinNewIdentity}\n onManageCredentials={handleManageCredentials}\n />\n </Clipboard.Provider>\n </Dialog.Content>\n );\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { useCallback } from 'react';\n\nimport { createIntent, LayoutAction, useIntentDispatcher } from '@dxos/app-framework';\nimport { ObservabilityAction } from '@dxos/plugin-observability/types';\nimport { type InvitationResult } from '@dxos/react-client/invitations';\nimport { Dialog } from '@dxos/react-ui';\nimport { JoinPanel, type JoinPanelProps } from '@dxos/shell/react';\n\nimport { CLIENT_PLUGIN } from '../meta';\nimport { ClientAction } from '../types';\n\nexport const JOIN_DIALOG = `${CLIENT_PLUGIN}/JoinDialog`;\n\nexport const JoinDialog = (props: JoinPanelProps) => {\n const { dispatchPromise: dispatch } = useIntentDispatcher();\n\n const handleCancelResetStorage = useCallback(() => dispatch(createIntent(ClientAction.ShareIdentity)), [dispatch]);\n\n const handleDone = useCallback(\n async (result: InvitationResult | null) => {\n if (result?.identityKey) {\n await Promise.all([\n dispatch(createIntent(LayoutAction.UpdateDialog, { part: 'dialog', options: { state: false } })),\n dispatch(\n createIntent(ObservabilityAction.SendEvent, {\n name: props.initialDisposition === 'recover-identity' ? 'identity.recover' : 'identity.join',\n }),\n ),\n ]);\n }\n },\n [dispatch],\n );\n\n return (\n <Dialog.Content>\n <JoinPanel\n mode='halo-only'\n {...props}\n exitActionParent={<Dialog.Close asChild />}\n doneActionParent={<Dialog.Close asChild />}\n onCancelResetStorage={handleCancelResetStorage}\n onDone={handleDone}\n />\n </Dialog.Content>\n );\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { useCallback, useState } from 'react';\n\nimport { AlertDialog, Button, Clipboard, Input, useTranslation } from '@dxos/react-ui';\n\nimport { CLIENT_PLUGIN } from '../meta';\n\nexport const RECOVER_CODE_DIALOG = `${CLIENT_PLUGIN}/RecoveryCodeDialog`;\n\nexport type RecoveryCodeDialogProps = {\n code: string;\n};\n\n// TODO(wittjosiah): Factor panel out to @dxos/shell.\nexport const RecoveryCodeDialog = ({ code }: RecoveryCodeDialogProps) => {\n const { t } = useTranslation(CLIENT_PLUGIN);\n const [confirmation, setConfirmation] = useState(false);\n\n const handleConfirmation = useCallback((checked: boolean) => setConfirmation(checked), []);\n\n return (\n <AlertDialog.Content classNames='bs-content min-bs-[15rem] max-bs-full md:max-is-[40rem] overflow-hidden'>\n <AlertDialog.Title>{t('recovery code dialog title')}</AlertDialog.Title>\n <p className='py-4'>{t('recovery code dialog description')}</p>\n <Clipboard.Provider>\n <Code code={code} />\n </Clipboard.Provider>\n <div className='flex flex-col py-4 gap-2'>\n <p>{t('recovery code dialog warning 1')}</p>\n <p>{t('recovery code dialog warning 2')}</p>\n </div>\n <div className='flex items-center gap-2 pbe-4'>\n <Input.Root>\n <Input.Checkbox\n data-testid='recoveryCode.confirm'\n checked={confirmation}\n onCheckedChange={handleConfirmation}\n />\n <Input.Label>{t('recovery code confirmation label')}</Input.Label>\n </Input.Root>\n </div>\n <div className='flex justify-end'>\n <AlertDialog.Action asChild>\n <Button data-testid='recoveryCode.continue' variant='primary' disabled={!confirmation}>\n {t('continue label')}\n </Button>\n </AlertDialog.Action>\n </div>\n </AlertDialog.Content>\n );\n};\n\nconst Code = ({ code }: { code: string }) => {\n const words = code.split(' ');\n return (\n <div className='relative p-2 border border-separator rounded group'>\n <Clipboard.IconButton value={code} classNames='absolute top-2 right-2 invisible group-hover:visible' />\n <div className='grid grid-cols-4'>\n {words.map((word, i) => (\n <div key={i} className='flex items-center p-2 gap-2'>\n <div className='w-4 text-xs text-center text-subdued'>{i + 1}</div>\n <div className='text-sm'>{word}</div>\n </div>\n ))}\n </div>\n </div>\n );\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { Key, Receipt } from '@phosphor-icons/react';\nimport React, { useMemo } from 'react';\n\nimport { createIntent, LayoutAction, useIntentDispatcher } from '@dxos/app-framework';\nimport { AlertDialog, useTranslation } from '@dxos/react-ui';\nimport { type ActionMenuItem, BifurcatedAction } from '@dxos/shell/react';\n\nimport { CLIENT_PLUGIN } from '../meta';\nimport { ClientAction } from '../types';\n\nexport const RECOVER_SETUP_DIALOG = `${CLIENT_PLUGIN}/RecoverySetupDialog`;\n\n// TODO(wittjosiah): Factor panel out to @dxos/shell.\nexport const RecoverySetupDialog = () => {\n const { t } = useTranslation(CLIENT_PLUGIN);\n const { dispatchPromise: dispatch } = useIntentDispatcher();\n\n const actions: Record<string, ActionMenuItem> = useMemo(\n () => ({\n createPasskey: {\n label: t('create passkey label'),\n description: t('create passkey description'),\n // TODO(wittjosiah): Ideally this would be a `user-key` icon.\n icon: Key,\n onClick: async () => {\n await dispatch(createIntent(ClientAction.CreatePasskey));\n await dispatch(createIntent(LayoutAction.UpdateDialog, { part: 'dialog', options: { state: false } }));\n },\n },\n createRecoveryCode: {\n label: t('create recovery code label'),\n description: t('create recovery code description'),\n icon: Receipt,\n onClick: () => dispatch(createIntent(ClientAction.CreateRecoveryCode)),\n },\n }),\n [t],\n );\n\n return (\n <AlertDialog.Content classNames='bs-content min-bs-[15rem] max-bs-full md:max-is-[25rem] overflow-hidden'>\n <AlertDialog.Title>{t('recovery setup dialog title')}</AlertDialog.Title>\n <p className='py-4'>{t('recovery setup dialog description')}</p>\n <div className='grow' />\n <BifurcatedAction actions={actions} />\n </AlertDialog.Content>\n );\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;AAIA,SAASA,SAASC,WAAW;AAC7B,OAAOC,SAASC,eAAe;AAE/B,SAASC,cAAcC,2BAA2B;AAClD,SAASC,sBAAsB;AAC/B,SAASC,QAAQC,MAAMC,MAAMC,UAAUC,sBAAsB;AAC7D,SAASC,wBAA6C;AAK/C,IAAMC,4BAA4B,GAAGC,aAAAA;AAGrC,IAAMC,0BAA0B,MAAA;AACrC,QAAM,EAAEC,EAAC,IAAKC,eAAeH,aAAAA;AAC7B,QAAM,EAAEI,iBAAiBC,SAAQ,IAAKC,oBAAAA;AACtC,QAAMC,cAAcC,eAAAA;AACpB,QAAMC,sBAAsBF,YAAYG,OACtC,CAACC,eAAeA,WAAWC,QAAQC,UAAU,OAAA,MAAa,wCAAA;AAI5D,QAAMC,UAA0CC,QAC9C,OAAO;IACLC,eAAe;MACbC,OAAOf,EAAE,sBAAA;MACTgB,aAAahB,EAAE,4BAAA;;MAEfiB,MAAMC;MACNC,SAAS,MAAMhB,SAASiB,aAAaC,aAAaC,aAAa,CAAA;IACjE;IACAC,oBAAoB;MAClBR,OAAOf,EAAE,4BAAA;MACTgB,aAAahB,EAAE,kCAAA;MACfiB,MAAMO;MACNL,SAAS,MAAMhB,SAASiB,aAAaC,aAAaI,kBAAkB,CAAA;IACtE;EACF,IACA;IAACzB;GAAE;AAGL,SACE,sBAAA,cAAC0B,OAAOC,SAAO;IAACC,YAAW;KACzB,sBAAA,cAACF,OAAOG,OAAK,MAAE7B,EAAE,iCAAA,CAAA,GACjB,sBAAA,cAAC8B,MAAAA;IAAKF,YAAW;KACdrB,oBAAoBwB,IAAI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B,QAAM,EAAEI,iBAAiBC,SAAQ,IAAKC,qBAAAA;AAEtC,QAAMC,UAA0CC,SAC9C,OAAO;IACLC,eAAe;MACbC,OAAOR,EAAE,sBAAA;MACTS,aAAaT,EAAE,4BAAA;;MAEfU,MAAMC;MACNC,SAAS,YAAA;AACP,cAAMT,SAASU,cAAaC,aAAaC,aAAa,CAAA;AACtD,cAAMZ,SAASU,cAAaG,cAAaC,cAAc;UAAEC,MAAM;UAAUC,SAAS;YAAEC,OAAO;UAAM;QAAE,CAAA,CAAA;MACrG;IACF;IACAC,oBAAoB;MAClBb,OAAOR,EAAE,4BAAA;MACTS,aAAaT,EAAE,kCAAA;MACfU,MAAMY;MACNV,SAAS,MAAMT,SAASU,cAAaC,aAAaS,kBAAkB,CAAA;IACtE;EACF,IACA;IAACvB;GAAE;AAGL,SACE,gBAAAwB,OAAA,cAACC,aAAYC,SAAO;IAACC,YAAW;KAC9B,gBAAAH,OAAA,cAACC,aAAYG,OAAK,MAAE5B,EAAE,6BAAA,CAAA,GACtB,gBAAAwB,OAAA,cAACK,KAAAA;IAAEC,WAAU;KAAQ9B,EAAE,mCAAA,CAAA,GACvB,gBAAAwB,OAAA,cAACO,OAAAA;IAAID,WAAU;MACf,gBAAAN,OAAA,cAACQ,mBAAAA;IAAiB3B;;AAGxB;",
|
|
6
|
+
"names": ["Receipt", "Key", "React", "useMemo", "createIntent", "useIntentDispatcher", "useCredentials", "Dialog", "Icon", "List", "ListItem", "useTranslation", "BifurcatedAction", "MANAGE_CREDENTIALS_DIALOG", "CLIENT_PLUGIN", "ManageCredentialsDialog", "t", "useTranslation", "dispatchPromise", "dispatch", "useIntentDispatcher", "credentials", "useCredentials", "recoveryCredentials", "filter", "credential", "subject", "assertion", "actions", "useMemo", "createPasskey", "label", "description", "icon", "Key", "onClick", "createIntent", "ClientAction", "CreatePasskey", "createRecoveryCode", "Receipt", "CreateRecoveryCode", "Dialog", "Content", "classNames", "Title", "List", "map", "ListItem", "Root", "key", "id", "toHex", "Endcap", "Icon", "size", "Heading", "issuanceDate", "toLocaleString", "div", "className", "BifurcatedAction", "React", "useCallback", "createIntent", "LayoutAction", "useIntentDispatcher", "useClient", "Clipboard", "Dialog", "IdentityPanel", "IDENTITY_DIALOG", "CLIENT_PLUGIN", "IdentityDialog", "props", "dispatchPromise", "dispatch", "useIntentDispatcher", "client", "useClient", "handleDone", "useCallback", "createIntent", "LayoutAction", "UpdateDialog", "part", "options", "state", "handleResetStorage", "reset", "ClientAction", "ResetStorage", "handleRecover", "target", "handleJoinNewIdentity", "handleManageCredentials", "subject", "MANAGE_CREDENTIALS_DIALOG", "blockAlign", "React", "Dialog", "Content", "Clipboard", "Provider", "IdentityPanel", "doneActionParent", "Close", "asChild", "onDone", "onResetStorage", "onRecover", "onJoinNewIdentity", "onManageCredentials", "React", "useCallback", "createIntent", "LayoutAction", "useIntentDispatcher", "ObservabilityAction", "Dialog", "JoinPanel", "JOIN_DIALOG", "CLIENT_PLUGIN", "JoinDialog", "props", "dispatchPromise", "dispatch", "useIntentDispatcher", "handleCancelResetStorage", "useCallback", "createIntent", "ClientAction", "ShareIdentity", "handleDone", "result", "identityKey", "Promise", "all", "LayoutAction", "UpdateDialog", "part", "options", "state", "ObservabilityAction", "SendEvent", "name", "initialDisposition", "React", "Dialog", "Content", "JoinPanel", "mode", "exitActionParent", "Close", "asChild", "doneActionParent", "onCancelResetStorage", "onDone", "React", "useCallback", "useState", "AlertDialog", "Button", "Clipboard", "Input", "useTranslation", "RECOVER_CODE_DIALOG", "CLIENT_PLUGIN", "RecoveryCodeDialog", "code", "t", "useTranslation", "confirmation", "setConfirmation", "useState", "handleConfirmation", "useCallback", "checked", "React", "AlertDialog", "Content", "classNames", "Title", "p", "className", "Clipboard", "Provider", "Code", "div", "Input", "Root", "Checkbox", "data-testid", "onCheckedChange", "Label", "Action", "asChild", "Button", "variant", "disabled", "words", "split", "IconButton", "value", "map", "word", "i", "key", "Key", "Receipt", "React", "useMemo", "createIntent", "LayoutAction", "useIntentDispatcher", "AlertDialog", "useTranslation", "BifurcatedAction", "RECOVER_SETUP_DIALOG", "CLIENT_PLUGIN", "RecoverySetupDialog", "t", "useTranslation", "dispatchPromise", "dispatch", "useIntentDispatcher", "actions", "useMemo", "createPasskey", "label", "description", "icon", "Key", "onClick", "createIntent", "ClientAction", "CreatePasskey", "LayoutAction", "UpdateDialog", "part", "options", "state", "createRecoveryCode", "Receipt", "CreateRecoveryCode", "React", "AlertDialog", "Content", "classNames", "Title", "p", "className", "div", "BifurcatedAction"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CLIENT_PLUGIN
|
|
3
|
+
} from "./chunk-NHIL4T3L.mjs";
|
|
4
|
+
|
|
5
|
+
// packages/plugins/plugin-client/src/capabilities/capabilities.ts
|
|
6
|
+
import { defineCapability } from "@dxos/app-framework";
|
|
7
|
+
var ClientCapabilities;
|
|
8
|
+
(function(ClientCapabilities2) {
|
|
9
|
+
ClientCapabilities2.Client = defineCapability(`${CLIENT_PLUGIN}/capability/client`);
|
|
10
|
+
ClientCapabilities2.Schema = defineCapability(`${CLIENT_PLUGIN}/capability/schema`);
|
|
11
|
+
})(ClientCapabilities || (ClientCapabilities = {}));
|
|
12
|
+
|
|
13
|
+
export {
|
|
14
|
+
ClientCapabilities
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=chunk-GHEQL2E6.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/capabilities/capabilities.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { defineCapability } from '@dxos/app-framework';\nimport { type TypedObject } from '@dxos/echo-schema';\nimport { type Client } from '@dxos/react-client';\n\nimport { CLIENT_PLUGIN } from '../meta';\n\nexport namespace ClientCapabilities {\n export const Client = defineCapability<Client>(`${CLIENT_PLUGIN}/capability/client`);\n export const Schema = defineCapability<TypedObject[]>(`${CLIENT_PLUGIN}/capability/schema`);\n}\n"],
|
|
5
|
+
"mappings": ";;;;;AAIA,SAASA,wBAAwB;;UAMhBC,qBAAAA;sBACFC,SAASC,iBAAyB,GAAGC,aAAAA,oBAAiC;sBACtEC,SAASF,iBAAgC,GAAGC,aAAAA,oBAAiC;AAC5F,GAHiBH,uBAAAA,qBAAAA,CAAAA,EAAAA;",
|
|
6
|
+
"names": ["defineCapability", "ClientCapabilities", "Client", "defineCapability", "CLIENT_PLUGIN", "Schema"]
|
|
7
|
+
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
// packages/plugins/plugin-client/src/meta.ts
|
|
2
2
|
var CLIENT_PLUGIN = "dxos.org/plugin/client";
|
|
3
|
-
var
|
|
3
|
+
var meta = {
|
|
4
4
|
id: CLIENT_PLUGIN,
|
|
5
5
|
name: "Client"
|
|
6
6
|
};
|
|
7
7
|
|
|
8
8
|
export {
|
|
9
9
|
CLIENT_PLUGIN,
|
|
10
|
-
|
|
10
|
+
meta
|
|
11
11
|
};
|
|
12
|
-
//# sourceMappingURL=chunk-
|
|
12
|
+
//# sourceMappingURL=chunk-NHIL4T3L.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/meta.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type PluginMeta } from '@dxos/app-framework';\n\nexport const CLIENT_PLUGIN = 'dxos.org/plugin/client';\n\nexport const meta = {\n id: CLIENT_PLUGIN,\n name: 'Client',\n} satisfies PluginMeta;\n"],
|
|
5
|
+
"mappings": ";AAMO,IAAMA,gBAAgB;AAEtB,IAAMC,OAAO;EAClBC,IAAIF;EACJG,MAAM;AACR;",
|
|
6
|
+
"names": ["CLIENT_PLUGIN", "meta", "id", "name"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CLIENT_PLUGIN
|
|
3
|
+
} from "./chunk-NHIL4T3L.mjs";
|
|
4
|
+
|
|
5
|
+
// packages/plugins/plugin-client/src/events.ts
|
|
6
|
+
import { defineEvent } from "@dxos/app-framework";
|
|
7
|
+
var ClientEvents;
|
|
8
|
+
(function(ClientEvents2) {
|
|
9
|
+
ClientEvents2.ClientReady = defineEvent(`${CLIENT_PLUGIN}/event/client-ready`);
|
|
10
|
+
ClientEvents2.SetupSchema = defineEvent(`${CLIENT_PLUGIN}/event/setup-schema`);
|
|
11
|
+
ClientEvents2.IdentityCreated = defineEvent(`${CLIENT_PLUGIN}/event/identity-created`);
|
|
12
|
+
ClientEvents2.SpacesReady = defineEvent(`${CLIENT_PLUGIN}/event/spaces-ready`);
|
|
13
|
+
})(ClientEvents || (ClientEvents = {}));
|
|
14
|
+
|
|
15
|
+
export {
|
|
16
|
+
ClientEvents
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=chunk-RGMLBYIF.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 { CLIENT_PLUGIN } from './meta';\n\nexport namespace ClientEvents {\n export const ClientReady = defineEvent(`${CLIENT_PLUGIN}/event/client-ready`);\n export const SetupSchema = defineEvent(`${CLIENT_PLUGIN}/event/setup-schema`);\n export const IdentityCreated = defineEvent(`${CLIENT_PLUGIN}/event/identity-created`);\n export const SpacesReady = defineEvent(`${CLIENT_PLUGIN}/event/spaces-ready`);\n}\n"],
|
|
5
|
+
"mappings": ";;;;;AAIA,SAASA,mBAAmB;;UAIXC,eAAAA;gBACFC,cAAcC,YAAY,GAAGC,aAAAA,qBAAkC;gBAC/DC,cAAcF,YAAY,GAAGC,aAAAA,qBAAkC;gBAC/DE,kBAAkBH,YAAY,GAAGC,aAAAA,yBAAsC;gBACvEG,cAAcJ,YAAY,GAAGC,aAAAA,qBAAkC;AAC9E,GALiBH,iBAAAA,eAAAA,CAAAA,EAAAA;",
|
|
6
|
+
"names": ["defineEvent", "ClientEvents", "ClientReady", "defineEvent", "CLIENT_PLUGIN", "SetupSchema", "IdentityCreated", "SpacesReady"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ClientEvents
|
|
3
|
+
} from "./chunk-RGMLBYIF.mjs";
|
|
4
|
+
import {
|
|
5
|
+
ClientCapabilities
|
|
6
|
+
} from "./chunk-GHEQL2E6.mjs";
|
|
7
|
+
import "./chunk-NHIL4T3L.mjs";
|
|
8
|
+
|
|
9
|
+
// packages/plugins/plugin-client/src/capabilities/client.ts
|
|
10
|
+
import { contributes } from "@dxos/app-framework";
|
|
11
|
+
import { Client } from "@dxos/react-client";
|
|
12
|
+
var client_default = async ({ context, onClientInitialized, ...options }) => {
|
|
13
|
+
const client = new Client(options);
|
|
14
|
+
await client.initialize();
|
|
15
|
+
await onClientInitialized?.(context, client);
|
|
16
|
+
client.reloaded.on(() => {
|
|
17
|
+
client.halo.identity.subscribe(async (identity) => {
|
|
18
|
+
if (identity) {
|
|
19
|
+
window.location.href = window.location.origin;
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
const subscription = client.spaces.isReady.subscribe(async (ready) => {
|
|
24
|
+
if (ready) {
|
|
25
|
+
await context.activate(ClientEvents.SpacesReady);
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
return contributes(ClientCapabilities.Client, client, async () => {
|
|
29
|
+
subscription.unsubscribe();
|
|
30
|
+
await client.destroy();
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
export {
|
|
34
|
+
client_default as default
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=client-A7YSVURS.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/capabilities/client.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { contributes, type PluginsContext } from '@dxos/app-framework';\nimport { Client } from '@dxos/react-client';\n\nimport { ClientCapabilities } from './capabilities';\nimport { ClientEvents } from '../events';\nimport { type ClientPluginOptions } from '../types';\n\ntype ClientCapabilityOptions = Omit<ClientPluginOptions, 'appKey' | 'invitationUrl' | 'invitationParam' | 'onReset'> & {\n context: PluginsContext;\n};\n\nexport default async ({ context, onClientInitialized, ...options }: ClientCapabilityOptions) => {\n const client = new Client(options);\n await client.initialize();\n await onClientInitialized?.(context, client);\n\n // TODO(wittjosiah): Remove. This is a hack to get the app to boot with the new identity after a reset.\n client.reloaded.on(() => {\n client.halo.identity.subscribe(async (identity) => {\n if (identity) {\n window.location.href = window.location.origin;\n }\n });\n });\n\n const subscription = client.spaces.isReady.subscribe(async (ready) => {\n if (ready) {\n await context.activate(ClientEvents.SpacesReady);\n }\n });\n\n return contributes(ClientCapabilities.Client, client, async () => {\n subscription.unsubscribe();\n await client.destroy();\n });\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;AAIA,SAASA,mBAAwC;AACjD,SAASC,cAAc;AAUvB,IAAA,iBAAe,OAAO,EAAEC,SAASC,qBAAqB,GAAGC,QAAAA,MAAkC;AACzF,QAAMC,SAAS,IAAIC,OAAOF,OAAAA;AAC1B,QAAMC,OAAOE,WAAU;AACvB,QAAMJ,sBAAsBD,SAASG,MAAAA;AAGrCA,SAAOG,SAASC,GAAG,MAAA;AACjBJ,WAAOK,KAAKC,SAASC,UAAU,OAAOD,aAAAA;AACpC,UAAIA,UAAU;AACZE,eAAOC,SAASC,OAAOF,OAAOC,SAASE;MACzC;IACF,CAAA;EACF,CAAA;AAEA,QAAMC,eAAeZ,OAAOa,OAAOC,QAAQP,UAAU,OAAOQ,UAAAA;AAC1D,QAAIA,OAAO;AACT,YAAMlB,QAAQmB,SAASC,aAAaC,WAAW;IACjD;EACF,CAAA;AAEA,SAAOC,YAAYC,mBAAmBnB,QAAQD,QAAQ,YAAA;AACpDY,iBAAaS,YAAW;AACxB,UAAMrB,OAAOsB,QAAO;EACtB,CAAA;AACF;",
|
|
6
|
+
"names": ["contributes", "Client", "context", "onClientInitialized", "options", "client", "Client", "initialize", "reloaded", "on", "halo", "identity", "subscribe", "window", "location", "href", "origin", "subscription", "spaces", "isReady", "ready", "activate", "ClientEvents", "SpacesReady", "contributes", "ClientCapabilities", "unsubscribe", "destroy"]
|
|
7
|
+
}
|