@dxos/plugin-client 0.8.1-main.ae460ac → 0.8.1-staging.31c3ee1
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-WAS4YZNA.mjs +119 -0
- package/dist/lib/browser/app-graph-builder-WAS4YZNA.mjs.map +7 -0
- package/dist/lib/browser/{chunk-OLUST5AO.mjs → chunk-4PLF3BEB.mjs} +2 -2
- package/dist/lib/browser/{chunk-7DPLXOMO.mjs → chunk-AN7FJKIJ.mjs} +21 -4
- package/dist/lib/browser/{chunk-7DPLXOMO.mjs.map → chunk-AN7FJKIJ.mjs.map} +3 -3
- package/dist/lib/browser/{chunk-XK4HM5M7.mjs → chunk-BGY6BSUC.mjs} +3 -2
- package/dist/lib/browser/{chunk-XK4HM5M7.mjs.map → chunk-BGY6BSUC.mjs.map} +3 -3
- package/dist/lib/browser/chunk-CAM6IWZ2.mjs +619 -0
- package/dist/lib/browser/chunk-CAM6IWZ2.mjs.map +7 -0
- package/dist/lib/browser/{chunk-NHIL4T3L.mjs → chunk-MCEXD5XH.mjs} +1 -1
- package/dist/lib/browser/{chunk-NHIL4T3L.mjs.map → chunk-MCEXD5XH.mjs.map} +2 -2
- package/dist/lib/browser/{client-UUGITHCW.mjs → client-LV67Q3R7.mjs} +5 -5
- package/dist/lib/browser/{client-UUGITHCW.mjs.map → client-LV67Q3R7.mjs.map} +3 -3
- package/dist/lib/browser/index.mjs +51 -22
- package/dist/lib/browser/index.mjs.map +2 -2
- package/dist/lib/browser/{intent-resolver-AIUHL34E.mjs → intent-resolver-JAQCJLKQ.mjs} +65 -27
- package/dist/lib/browser/intent-resolver-JAQCJLKQ.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{migrations-XODC625X.mjs → migrations-3DWFOL5Q.mjs} +3 -3
- package/dist/lib/browser/{react-context-JBD7Y3SN.mjs → react-context-WEH7SL4I.mjs} +3 -3
- package/dist/lib/browser/react-surface-M6Q6RT3Q.mjs +66 -0
- package/dist/lib/browser/react-surface-M6Q6RT3Q.mjs.map +7 -0
- package/dist/lib/browser/{schema-Y7ZNXYSL.mjs → schema-JQAT6Q7S.mjs} +3 -3
- package/dist/lib/browser/types.mjs +4 -2
- package/dist/lib/node/app-graph-builder-PXOJZJO5.cjs +130 -0
- package/dist/lib/node/app-graph-builder-PXOJZJO5.cjs.map +7 -0
- package/dist/lib/node/chunk-ARZVO2AR.cjs +644 -0
- package/dist/lib/node/chunk-ARZVO2AR.cjs.map +7 -0
- package/dist/lib/node/{chunk-OIFPM5ZW.cjs → chunk-DJKWB5L6.cjs} +4 -4
- package/dist/lib/node/{chunk-OIFPM5ZW.cjs.map → chunk-DJKWB5L6.cjs.map} +2 -2
- package/dist/lib/node/{chunk-TREVKZCJ.cjs → chunk-FROKBEVH.cjs} +25 -7
- package/dist/lib/node/chunk-FROKBEVH.cjs.map +7 -0
- package/dist/lib/node/{chunk-FR2K56EV.cjs → chunk-W64EOF2B.cjs} +10 -10
- package/dist/lib/node/{chunk-T4K27K2F.cjs → chunk-ZVQIICEN.cjs} +9 -8
- package/dist/lib/node/{chunk-T4K27K2F.cjs.map → chunk-ZVQIICEN.cjs.map} +3 -3
- package/dist/lib/node/{client-5BHSU35T.cjs → client-BKTGRBYM.cjs} +9 -9
- package/dist/lib/node/{client-5BHSU35T.cjs.map → client-BKTGRBYM.cjs.map} +3 -3
- package/dist/lib/node/index.cjs +70 -41
- package/dist/lib/node/index.cjs.map +2 -2
- package/dist/lib/node/{intent-resolver-PWCHHNV3.cjs → intent-resolver-Y73DGA7F.cjs} +81 -44
- package/dist/lib/node/intent-resolver-Y73DGA7F.cjs.map +7 -0
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/{migrations-YCBZUPWO.cjs → migrations-TGNI4FVL.cjs} +8 -8
- package/dist/lib/node/{react-context-MPHNGZHT.cjs → react-context-SF3M3YLR.cjs} +8 -8
- package/dist/lib/node/{react-surface-TPISDIHR.cjs → react-surface-KWTTP7ZX.cjs} +34 -26
- package/dist/lib/node/react-surface-KWTTP7ZX.cjs.map +7 -0
- package/dist/lib/node/{schema-NMMCMK64.cjs → schema-INQ72F54.cjs} +8 -8
- package/dist/lib/node/types.cjs +5 -3
- package/dist/lib/node/types.cjs.map +2 -2
- package/dist/lib/node-esm/app-graph-builder-KIN6NWFI.mjs +120 -0
- package/dist/lib/node-esm/app-graph-builder-KIN6NWFI.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-6WHEPWQD.mjs +620 -0
- package/dist/lib/node-esm/chunk-6WHEPWQD.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-QJMF2MWP.mjs → chunk-AD5W5QCQ.mjs} +21 -4
- package/dist/lib/node-esm/{chunk-QJMF2MWP.mjs.map → chunk-AD5W5QCQ.mjs.map} +3 -3
- package/dist/lib/node-esm/{chunk-XLLNVLWU.mjs → chunk-BP56BGZR.mjs} +2 -2
- package/dist/lib/node-esm/{chunk-HO7WDE7C.mjs → chunk-HM7VB4ZV.mjs} +1 -1
- package/dist/lib/node-esm/{chunk-HO7WDE7C.mjs.map → chunk-HM7VB4ZV.mjs.map} +2 -2
- package/dist/lib/node-esm/{chunk-3OU2ZXLK.mjs → chunk-K3KGGSJZ.mjs} +3 -2
- package/dist/lib/node-esm/{chunk-3OU2ZXLK.mjs.map → chunk-K3KGGSJZ.mjs.map} +3 -3
- package/dist/lib/node-esm/{client-ZDGFGLX4.mjs → client-QQD6WFOB.mjs} +5 -5
- package/dist/lib/node-esm/{client-ZDGFGLX4.mjs.map → client-QQD6WFOB.mjs.map} +3 -3
- package/dist/lib/node-esm/index.mjs +51 -22
- package/dist/lib/node-esm/index.mjs.map +2 -2
- package/dist/lib/node-esm/{intent-resolver-FIXGPH7C.mjs → intent-resolver-K3CA4JRC.mjs} +65 -27
- package/dist/lib/node-esm/intent-resolver-K3CA4JRC.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{migrations-VIEIPYJW.mjs → migrations-IVGATGZR.mjs} +3 -3
- package/dist/lib/node-esm/{react-context-KUEOXWWK.mjs → react-context-EAKKTE5A.mjs} +3 -3
- package/dist/lib/node-esm/react-surface-ORRNXP2X.mjs +67 -0
- package/dist/lib/node-esm/react-surface-ORRNXP2X.mjs.map +7 -0
- package/dist/lib/node-esm/{schema-NE5IYLMD.mjs → schema-OK7HY3JJ.mjs} +3 -3
- package/dist/lib/node-esm/types.mjs +4 -2
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/capabilities.d.ts +1 -0
- package/dist/types/src/capabilities/capabilities.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +4 -4
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +2 -3
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts +3 -2
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/components/DevicesContainer.d.ts +5 -0
- package/dist/types/src/components/DevicesContainer.d.ts.map +1 -0
- package/dist/types/src/components/DevicesContainer.stories.d.ts +8 -0
- package/dist/types/src/components/DevicesContainer.stories.d.ts.map +1 -0
- package/dist/types/src/components/JoinDialog.d.ts +2 -1
- package/dist/types/src/components/JoinDialog.d.ts.map +1 -1
- package/dist/types/src/components/ProfileContainer.d.ts +3 -0
- package/dist/types/src/components/ProfileContainer.d.ts.map +1 -0
- package/dist/types/src/components/ProfileContainer.stories.d.ts +8 -0
- package/dist/types/src/components/ProfileContainer.stories.d.ts.map +1 -0
- package/dist/types/src/components/RecoveryCodeDialog.d.ts +3 -2
- package/dist/types/src/components/RecoveryCodeDialog.d.ts.map +1 -1
- package/dist/types/src/components/RecoveryCredentialsContainer.d.ts +4 -0
- package/dist/types/src/components/RecoveryCredentialsContainer.d.ts.map +1 -0
- package/dist/types/src/components/RecoveryCredentialsContainer.stories.d.ts +8 -0
- package/dist/types/src/components/RecoveryCredentialsContainer.stories.d.ts.map +1 -0
- package/dist/types/src/components/ResetDialog.d.ts +7 -0
- package/dist/types/src/components/ResetDialog.d.ts.map +1 -0
- package/dist/types/src/components/ResetDialog.stories.d.ts +10 -0
- package/dist/types/src/components/ResetDialog.stories.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +4 -2
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +2 -4
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +28 -1
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types.d.ts +17 -1
- package/dist/types/src/types.d.ts.map +1 -1
- package/package.json +26 -19
- package/src/ClientPlugin.ts +2 -2
- package/src/capabilities/app-graph-builder.ts +62 -6
- package/src/capabilities/capabilities.ts +1 -0
- package/src/capabilities/client.ts +1 -1
- package/src/capabilities/intent-resolver.ts +68 -23
- package/src/capabilities/react-surface.tsx +32 -24
- package/src/components/DevicesContainer.stories.tsx +45 -0
- package/src/components/DevicesContainer.tsx +268 -0
- package/src/components/ProfileContainer.stories.tsx +29 -0
- package/src/components/ProfileContainer.tsx +163 -0
- package/src/components/RecoveryCodeDialog.stories.tsx +2 -2
- package/src/components/RecoveryCodeDialog.tsx +1 -2
- package/src/components/{ManageCredentialsDialog.stories.tsx → RecoveryCredentialsContainer.stories.tsx} +4 -17
- package/src/components/RecoveryCredentialsContainer.tsx +74 -0
- package/src/components/ResetDialog.stories.tsx +47 -0
- package/src/components/ResetDialog.tsx +49 -0
- package/src/components/index.ts +4 -2
- package/src/meta.ts +2 -2
- package/src/translations.ts +45 -9
- package/src/types.ts +20 -1
- package/dist/lib/browser/app-graph-builder-ON64R7SO.mjs +0 -44
- package/dist/lib/browser/app-graph-builder-ON64R7SO.mjs.map +0 -7
- package/dist/lib/browser/chunk-HNJZ74DZ.mjs +0 -281
- package/dist/lib/browser/chunk-HNJZ74DZ.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-AIUHL34E.mjs.map +0 -7
- package/dist/lib/browser/react-surface-QGPWIUFR.mjs +0 -57
- package/dist/lib/browser/react-surface-QGPWIUFR.mjs.map +0 -7
- package/dist/lib/node/app-graph-builder-RW7ESEX3.cjs +0 -58
- package/dist/lib/node/app-graph-builder-RW7ESEX3.cjs.map +0 -7
- package/dist/lib/node/chunk-TREVKZCJ.cjs.map +0 -7
- package/dist/lib/node/chunk-UTG3UR3N.cjs +0 -309
- package/dist/lib/node/chunk-UTG3UR3N.cjs.map +0 -7
- package/dist/lib/node/intent-resolver-PWCHHNV3.cjs.map +0 -7
- package/dist/lib/node/react-surface-TPISDIHR.cjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-TDYRWNI7.mjs +0 -45
- package/dist/lib/node-esm/app-graph-builder-TDYRWNI7.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-SHJBU4QR.mjs +0 -282
- package/dist/lib/node-esm/chunk-SHJBU4QR.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-FIXGPH7C.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-KBROL4VH.mjs +0 -58
- package/dist/lib/node-esm/react-surface-KBROL4VH.mjs.map +0 -7
- package/dist/types/src/components/IdentityDialog.d.ts +0 -4
- package/dist/types/src/components/IdentityDialog.d.ts.map +0 -1
- package/dist/types/src/components/ManageCredentialsDialog.d.ts +0 -3
- package/dist/types/src/components/ManageCredentialsDialog.d.ts.map +0 -1
- package/dist/types/src/components/ManageCredentialsDialog.stories.d.ts +0 -8
- package/dist/types/src/components/ManageCredentialsDialog.stories.d.ts.map +0 -1
- package/dist/types/src/components/RecoverySetupDialog.d.ts +0 -3
- package/dist/types/src/components/RecoverySetupDialog.d.ts.map +0 -1
- package/dist/types/src/components/RecoverySetupDialog.stories.d.ts +0 -8
- package/dist/types/src/components/RecoverySetupDialog.stories.d.ts.map +0 -1
- package/src/components/IdentityDialog.tsx +0 -75
- package/src/components/ManageCredentialsDialog.tsx +0 -64
- package/src/components/RecoverySetupDialog.stories.tsx +0 -77
- package/src/components/RecoverySetupDialog.tsx +0 -52
- /package/dist/lib/browser/{chunk-OLUST5AO.mjs.map → chunk-4PLF3BEB.mjs.map} +0 -0
- /package/dist/lib/browser/{migrations-XODC625X.mjs.map → migrations-3DWFOL5Q.mjs.map} +0 -0
- /package/dist/lib/browser/{react-context-JBD7Y3SN.mjs.map → react-context-WEH7SL4I.mjs.map} +0 -0
- /package/dist/lib/browser/{schema-Y7ZNXYSL.mjs.map → schema-JQAT6Q7S.mjs.map} +0 -0
- /package/dist/lib/node/{chunk-FR2K56EV.cjs.map → chunk-W64EOF2B.cjs.map} +0 -0
- /package/dist/lib/node/{migrations-YCBZUPWO.cjs.map → migrations-TGNI4FVL.cjs.map} +0 -0
- /package/dist/lib/node/{react-context-MPHNGZHT.cjs.map → react-context-SF3M3YLR.cjs.map} +0 -0
- /package/dist/lib/node/{schema-NMMCMK64.cjs.map → schema-INQ72F54.cjs.map} +0 -0
- /package/dist/lib/node-esm/{chunk-XLLNVLWU.mjs.map → chunk-BP56BGZR.mjs.map} +0 -0
- /package/dist/lib/node-esm/{migrations-VIEIPYJW.mjs.map → migrations-IVGATGZR.mjs.map} +0 -0
- /package/dist/lib/node-esm/{react-context-KUEOXWWK.mjs.map → react-context-EAKKTE5A.mjs.map} +0 -0
- /package/dist/lib/node-esm/{schema-NE5IYLMD.mjs.map → schema-OK7HY3JJ.mjs.map} +0 -0
|
@@ -1,281 +0,0 @@
|
|
|
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, useTranslation as useTranslation2 } 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 { t } = useTranslation2(CLIENT_PLUGIN);
|
|
65
|
-
const handleDone = useCallback(() => dispatch(createIntent2(LayoutAction.UpdateDialog, {
|
|
66
|
-
part: "dialog",
|
|
67
|
-
options: {
|
|
68
|
-
state: false
|
|
69
|
-
}
|
|
70
|
-
})), [
|
|
71
|
-
dispatch
|
|
72
|
-
]);
|
|
73
|
-
const handleResetStorage = useCallback(async () => {
|
|
74
|
-
await client.reset();
|
|
75
|
-
await dispatch(createIntent2(ClientAction.ResetStorage));
|
|
76
|
-
}, [
|
|
77
|
-
dispatch
|
|
78
|
-
]);
|
|
79
|
-
const handleRecover = useCallback(async () => {
|
|
80
|
-
await client.reset();
|
|
81
|
-
await dispatch(createIntent2(ClientAction.ResetStorage, {
|
|
82
|
-
target: "recoverIdentity"
|
|
83
|
-
}));
|
|
84
|
-
}, [
|
|
85
|
-
dispatch
|
|
86
|
-
]);
|
|
87
|
-
const handleJoinNewIdentity = useCallback(async () => {
|
|
88
|
-
await client.reset();
|
|
89
|
-
await dispatch(createIntent2(ClientAction.ResetStorage, {
|
|
90
|
-
target: "deviceInvitation"
|
|
91
|
-
}));
|
|
92
|
-
}, [
|
|
93
|
-
dispatch
|
|
94
|
-
]);
|
|
95
|
-
const handleManageCredentials = useCallback(async () => {
|
|
96
|
-
await dispatch(createIntent2(LayoutAction.UpdateDialog, {
|
|
97
|
-
part: "dialog",
|
|
98
|
-
subject: MANAGE_CREDENTIALS_DIALOG,
|
|
99
|
-
options: {
|
|
100
|
-
state: true,
|
|
101
|
-
blockAlign: "start"
|
|
102
|
-
}
|
|
103
|
-
}));
|
|
104
|
-
}, [
|
|
105
|
-
dispatch
|
|
106
|
-
]);
|
|
107
|
-
return /* @__PURE__ */ React2.createElement(Dialog2.Content, null, /* @__PURE__ */ React2.createElement(Dialog2.Title, {
|
|
108
|
-
classNames: "sr-only"
|
|
109
|
-
}, t("manage profile label", {
|
|
110
|
-
ns: "os"
|
|
111
|
-
})), /* @__PURE__ */ React2.createElement(Clipboard.Provider, null, /* @__PURE__ */ React2.createElement(IdentityPanel, {
|
|
112
|
-
...props,
|
|
113
|
-
doneActionParent: /* @__PURE__ */ React2.createElement(Dialog2.Close, {
|
|
114
|
-
asChild: true
|
|
115
|
-
}),
|
|
116
|
-
onDone: handleDone,
|
|
117
|
-
onResetStorage: handleResetStorage,
|
|
118
|
-
onRecover: handleRecover,
|
|
119
|
-
onJoinNewIdentity: handleJoinNewIdentity,
|
|
120
|
-
onManageCredentials: handleManageCredentials
|
|
121
|
-
})));
|
|
122
|
-
};
|
|
123
|
-
|
|
124
|
-
// packages/plugins/plugin-client/src/components/JoinDialog.tsx
|
|
125
|
-
import React3, { useCallback as useCallback2 } from "react";
|
|
126
|
-
import { createIntent as createIntent3, LayoutAction as LayoutAction2, useIntentDispatcher as useIntentDispatcher3 } from "@dxos/app-framework";
|
|
127
|
-
import { ObservabilityAction } from "@dxos/plugin-observability/types";
|
|
128
|
-
import { Dialog as Dialog3, useTranslation as useTranslation3 } from "@dxos/react-ui";
|
|
129
|
-
import { JoinPanel } from "@dxos/shell/react";
|
|
130
|
-
var JOIN_DIALOG = `${CLIENT_PLUGIN}/JoinDialog`;
|
|
131
|
-
var JoinDialog = (props) => {
|
|
132
|
-
const { dispatchPromise: dispatch } = useIntentDispatcher3();
|
|
133
|
-
const { t } = useTranslation3(CLIENT_PLUGIN);
|
|
134
|
-
const handleCancelResetStorage = useCallback2(() => dispatch(createIntent3(ClientAction.ShareIdentity)), [
|
|
135
|
-
dispatch
|
|
136
|
-
]);
|
|
137
|
-
const handleDone = useCallback2(async (result) => {
|
|
138
|
-
if (result?.identityKey) {
|
|
139
|
-
await Promise.all([
|
|
140
|
-
dispatch(createIntent3(LayoutAction2.UpdateDialog, {
|
|
141
|
-
part: "dialog",
|
|
142
|
-
options: {
|
|
143
|
-
state: false
|
|
144
|
-
}
|
|
145
|
-
})),
|
|
146
|
-
dispatch(createIntent3(ObservabilityAction.SendEvent, {
|
|
147
|
-
name: props.initialDisposition === "recover-identity" ? "identity.recover" : "identity.join"
|
|
148
|
-
}))
|
|
149
|
-
]);
|
|
150
|
-
}
|
|
151
|
-
}, [
|
|
152
|
-
dispatch
|
|
153
|
-
]);
|
|
154
|
-
return /* @__PURE__ */ React3.createElement(Dialog3.Content, null, /* @__PURE__ */ React3.createElement(Dialog3.Title, {
|
|
155
|
-
classNames: "sr-only"
|
|
156
|
-
}, t("join space label", {
|
|
157
|
-
ns: "os"
|
|
158
|
-
})), /* @__PURE__ */ React3.createElement(JoinPanel, {
|
|
159
|
-
mode: "halo-only",
|
|
160
|
-
...props,
|
|
161
|
-
exitActionParent: /* @__PURE__ */ React3.createElement(Dialog3.Close, {
|
|
162
|
-
asChild: true
|
|
163
|
-
}),
|
|
164
|
-
doneActionParent: /* @__PURE__ */ React3.createElement(Dialog3.Close, {
|
|
165
|
-
asChild: true
|
|
166
|
-
}),
|
|
167
|
-
onCancelResetStorage: handleCancelResetStorage,
|
|
168
|
-
onDone: handleDone
|
|
169
|
-
}));
|
|
170
|
-
};
|
|
171
|
-
|
|
172
|
-
// packages/plugins/plugin-client/src/components/RecoveryCodeDialog.tsx
|
|
173
|
-
import React4, { useCallback as useCallback3, useState } from "react";
|
|
174
|
-
import { AlertDialog, Button, Clipboard as Clipboard2, Input, useTranslation as useTranslation4 } from "@dxos/react-ui";
|
|
175
|
-
var RECOVER_CODE_DIALOG = `${CLIENT_PLUGIN}/RecoveryCodeDialog`;
|
|
176
|
-
var RecoveryCodeDialog = ({ code }) => {
|
|
177
|
-
const { t } = useTranslation4(CLIENT_PLUGIN);
|
|
178
|
-
const [confirmation, setConfirmation] = useState(false);
|
|
179
|
-
const handleConfirmation = useCallback3((checked) => setConfirmation(checked), []);
|
|
180
|
-
return /* @__PURE__ */ React4.createElement(AlertDialog.Content, {
|
|
181
|
-
classNames: "bs-content min-bs-[15rem] max-bs-full md:max-is-[40rem] overflow-hidden"
|
|
182
|
-
}, /* @__PURE__ */ React4.createElement(AlertDialog.Title, null, t("recovery code dialog title")), /* @__PURE__ */ React4.createElement("p", {
|
|
183
|
-
className: "py-4"
|
|
184
|
-
}, t("recovery code dialog description")), /* @__PURE__ */ React4.createElement(Clipboard2.Provider, null, /* @__PURE__ */ React4.createElement(Code, {
|
|
185
|
-
code
|
|
186
|
-
})), /* @__PURE__ */ React4.createElement("div", {
|
|
187
|
-
className: "flex flex-col py-4 gap-2"
|
|
188
|
-
}, /* @__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", {
|
|
189
|
-
className: "flex items-center gap-2 pbe-4"
|
|
190
|
-
}, /* @__PURE__ */ React4.createElement(Input.Root, null, /* @__PURE__ */ React4.createElement(Input.Checkbox, {
|
|
191
|
-
"data-testid": "recoveryCode.confirm",
|
|
192
|
-
checked: confirmation,
|
|
193
|
-
onCheckedChange: handleConfirmation
|
|
194
|
-
}), /* @__PURE__ */ React4.createElement(Input.Label, null, t("recovery code confirmation label")))), /* @__PURE__ */ React4.createElement("div", {
|
|
195
|
-
className: "flex justify-end"
|
|
196
|
-
}, /* @__PURE__ */ React4.createElement(AlertDialog.Action, {
|
|
197
|
-
asChild: true
|
|
198
|
-
}, /* @__PURE__ */ React4.createElement(Button, {
|
|
199
|
-
"data-testid": "recoveryCode.continue",
|
|
200
|
-
variant: "primary",
|
|
201
|
-
disabled: !confirmation
|
|
202
|
-
}, t("continue label")))));
|
|
203
|
-
};
|
|
204
|
-
var Code = ({ code }) => {
|
|
205
|
-
const words = code.split(" ");
|
|
206
|
-
return /* @__PURE__ */ React4.createElement("div", {
|
|
207
|
-
className: "relative p-2 border border-separator rounded group"
|
|
208
|
-
}, /* @__PURE__ */ React4.createElement(Clipboard2.IconButton, {
|
|
209
|
-
value: code,
|
|
210
|
-
classNames: "absolute top-2 right-2 invisible group-hover:visible"
|
|
211
|
-
}), /* @__PURE__ */ React4.createElement("div", {
|
|
212
|
-
className: "grid grid-cols-4"
|
|
213
|
-
}, words.map((word, i) => /* @__PURE__ */ React4.createElement("div", {
|
|
214
|
-
key: i,
|
|
215
|
-
className: "flex items-center p-2 gap-2"
|
|
216
|
-
}, /* @__PURE__ */ React4.createElement("div", {
|
|
217
|
-
className: "w-4 text-xs text-center text-subdued"
|
|
218
|
-
}, i + 1), /* @__PURE__ */ React4.createElement("div", {
|
|
219
|
-
className: "text-sm"
|
|
220
|
-
}, word)))));
|
|
221
|
-
};
|
|
222
|
-
|
|
223
|
-
// packages/plugins/plugin-client/src/components/RecoverySetupDialog.tsx
|
|
224
|
-
import { Key as Key2, Receipt as Receipt2 } from "@phosphor-icons/react";
|
|
225
|
-
import React5, { useMemo as useMemo2 } from "react";
|
|
226
|
-
import { createIntent as createIntent4, LayoutAction as LayoutAction3, useIntentDispatcher as useIntentDispatcher4 } from "@dxos/app-framework";
|
|
227
|
-
import { AlertDialog as AlertDialog2, useTranslation as useTranslation5 } from "@dxos/react-ui";
|
|
228
|
-
import { BifurcatedAction as BifurcatedAction2 } from "@dxos/shell/react";
|
|
229
|
-
var RECOVER_SETUP_DIALOG = `${CLIENT_PLUGIN}/RecoverySetupDialog`;
|
|
230
|
-
var RecoverySetupDialog = () => {
|
|
231
|
-
const { t } = useTranslation5(CLIENT_PLUGIN);
|
|
232
|
-
const { dispatchPromise: dispatch } = useIntentDispatcher4();
|
|
233
|
-
const actions = useMemo2(() => ({
|
|
234
|
-
createPasskey: {
|
|
235
|
-
label: t("create passkey label"),
|
|
236
|
-
description: t("create passkey description"),
|
|
237
|
-
// TODO(wittjosiah): Ideally this would be a `user-key` icon.
|
|
238
|
-
icon: Key2,
|
|
239
|
-
onClick: async () => {
|
|
240
|
-
await dispatch(createIntent4(ClientAction.CreatePasskey));
|
|
241
|
-
await dispatch(createIntent4(LayoutAction3.UpdateDialog, {
|
|
242
|
-
part: "dialog",
|
|
243
|
-
options: {
|
|
244
|
-
state: false
|
|
245
|
-
}
|
|
246
|
-
}));
|
|
247
|
-
}
|
|
248
|
-
},
|
|
249
|
-
createRecoveryCode: {
|
|
250
|
-
label: t("create recovery code label"),
|
|
251
|
-
description: t("create recovery code description"),
|
|
252
|
-
icon: Receipt2,
|
|
253
|
-
onClick: () => dispatch(createIntent4(ClientAction.CreateRecoveryCode))
|
|
254
|
-
}
|
|
255
|
-
}), [
|
|
256
|
-
t
|
|
257
|
-
]);
|
|
258
|
-
return /* @__PURE__ */ React5.createElement(AlertDialog2.Content, {
|
|
259
|
-
classNames: "bs-content min-bs-[15rem] max-bs-full md:max-is-[25rem] overflow-hidden"
|
|
260
|
-
}, /* @__PURE__ */ React5.createElement(AlertDialog2.Title, null, t("recovery setup dialog title")), /* @__PURE__ */ React5.createElement("p", {
|
|
261
|
-
className: "py-4"
|
|
262
|
-
}, t("recovery setup dialog description")), /* @__PURE__ */ React5.createElement("div", {
|
|
263
|
-
className: "grow"
|
|
264
|
-
}), /* @__PURE__ */ React5.createElement(BifurcatedAction2, {
|
|
265
|
-
actions
|
|
266
|
-
}));
|
|
267
|
-
};
|
|
268
|
-
|
|
269
|
-
export {
|
|
270
|
-
MANAGE_CREDENTIALS_DIALOG,
|
|
271
|
-
ManageCredentialsDialog,
|
|
272
|
-
IDENTITY_DIALOG,
|
|
273
|
-
IdentityDialog,
|
|
274
|
-
JOIN_DIALOG,
|
|
275
|
-
JoinDialog,
|
|
276
|
-
RECOVER_CODE_DIALOG,
|
|
277
|
-
RecoveryCodeDialog,
|
|
278
|
-
RECOVER_SETUP_DIALOG,
|
|
279
|
-
RecoverySetupDialog
|
|
280
|
-
};
|
|
281
|
-
//# sourceMappingURL=chunk-HNJZ74DZ.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
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, useTranslation } 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 const { t } = useTranslation(CLIENT_PLUGIN);\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 <Dialog.Title classNames='sr-only'>{t('manage profile label', { ns: 'os' })}</Dialog.Title>\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, useTranslation } 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 const { t } = useTranslation(CLIENT_PLUGIN);\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 <Dialog.Title classNames='sr-only'>{t('join space label', { ns: 'os' })}</Dialog.Title>\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,a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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", "useTranslation", "IdentityPanel", "IDENTITY_DIALOG", "CLIENT_PLUGIN", "IdentityDialog", "props", "dispatchPromise", "dispatch", "useIntentDispatcher", "client", "useClient", "t", "useTranslation", "handleDone", "useCallback", "createIntent", "LayoutAction", "UpdateDialog", "part", "options", "state", "handleResetStorage", "reset", "ClientAction", "ResetStorage", "handleRecover", "target", "handleJoinNewIdentity", "handleManageCredentials", "subject", "MANAGE_CREDENTIALS_DIALOG", "blockAlign", "React", "Dialog", "Content", "Title", "classNames", "ns", "Clipboard", "Provider", "IdentityPanel", "doneActionParent", "Close", "asChild", "onDone", "onResetStorage", "onRecover", "onJoinNewIdentity", "onManageCredentials", "React", "useCallback", "createIntent", "LayoutAction", "useIntentDispatcher", "ObservabilityAction", "Dialog", "useTranslation", "JoinPanel", "JOIN_DIALOG", "CLIENT_PLUGIN", "JoinDialog", "props", "dispatchPromise", "dispatch", "useIntentDispatcher", "t", "useTranslation", "handleCancelResetStorage", "useCallback", "createIntent", "ClientAction", "ShareIdentity", "handleDone", "result", "identityKey", "Promise", "all", "LayoutAction", "UpdateDialog", "part", "options", "state", "ObservabilityAction", "SendEvent", "name", "initialDisposition", "React", "Dialog", "Content", "Title", "classNames", "ns", "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
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/intent-resolver.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport {\n Capabilities,\n contributes,\n createIntent,\n createResolver,\n LayoutAction,\n type PluginsContext,\n} from '@dxos/app-framework';\nimport { invariant } from '@dxos/invariant';\nimport { ObservabilityAction } from '@dxos/plugin-observability/types';\nimport { PublicKey } from '@dxos/react-client';\nimport { type JoinPanelProps } from '@dxos/shell/react';\n\nimport { ClientCapabilities } from './capabilities';\nimport { IDENTITY_DIALOG, JOIN_DIALOG, RECOVER_CODE_DIALOG } from '../components';\nimport { ClientEvents } from '../events';\nimport { ClientAction, type ClientPluginOptions } from '../types';\n\ntype IntentResolverOptions = Pick<ClientPluginOptions, 'onReset'> & {\n context: PluginsContext;\n appName?: string;\n};\n\nexport default ({ context, appName = 'Composer', onReset }: IntentResolverOptions) =>\n contributes(Capabilities.IntentResolver, [\n createResolver({\n intent: ClientAction.CreateIdentity,\n resolve: async () => {\n const manager = context.requestCapability(Capabilities.PluginManager);\n const client = context.requestCapability(ClientCapabilities.Client);\n const data = await client.halo.createIdentity();\n await manager.activate(ClientEvents.IdentityCreated);\n return { data, intents: [createIntent(ObservabilityAction.SendEvent, { name: 'identity.create' })] };\n },\n }),\n createResolver({\n intent: ClientAction.JoinIdentity,\n resolve: async (data) => {\n return {\n intents: [\n createIntent(LayoutAction.UpdateDialog, {\n part: 'dialog',\n subject: JOIN_DIALOG,\n options: {\n blockAlign: 'start',\n props: {\n initialInvitationCode: data.invitationCode,\n initialDisposition: 'accept-halo-invitation',\n },\n },\n }),\n ],\n };\n },\n }),\n createResolver({\n intent: ClientAction.ShareIdentity,\n resolve: async () => {\n return {\n intents: [\n createIntent(LayoutAction.UpdateDialog, {\n part: 'dialog',\n subject: IDENTITY_DIALOG,\n options: {\n blockAlign: 'start',\n },\n }),\n createIntent(ObservabilityAction.SendEvent, { name: 'identity.share' }),\n ],\n };\n },\n }),\n createResolver({\n intent: ClientAction.RecoverIdentity,\n resolve: async () => {\n return {\n intents: [\n createIntent(LayoutAction.UpdateDialog, {\n part: 'dialog',\n subject: JOIN_DIALOG,\n options: {\n blockAlign: 'start',\n props: {\n initialDisposition: 'recover-identity',\n } satisfies Partial<JoinPanelProps>,\n },\n }),\n ],\n };\n },\n }),\n createResolver({\n intent: ClientAction.ResetStorage,\n resolve: async (data) => {\n await onReset?.({ target: data.target });\n },\n }),\n createResolver({\n intent: ClientAction.CreateAgent,\n resolve: async () => {\n const client = context.requestCapability(ClientCapabilities.Client);\n invariant(client.services.services.EdgeAgentService, 'Missing EdgeAgentService');\n await client.services.services.EdgeAgentService.createAgent(null as any, { timeout: 10_000 });\n },\n }),\n createResolver({\n intent: ClientAction.CreateRecoveryCode,\n resolve: async () => {\n const client = context.requestCapability(ClientCapabilities.Client);\n invariant(client.services.services.IdentityService, 'IdentityService not available');\n // TODO(wittjosiah): This needs a proper api.\n const { recoveryCode } = await client.services.services.IdentityService.createRecoveryCredential({});\n return {\n intents: [\n createIntent(LayoutAction.UpdateDialog, {\n part: 'dialog',\n subject: RECOVER_CODE_DIALOG,\n options: {\n blockAlign: 'start',\n type: 'alert',\n props: { code: recoveryCode },\n },\n }),\n ],\n };\n },\n }),\n createResolver({\n intent: ClientAction.CreatePasskey,\n resolve: async () => {\n const client = context.requestCapability(ClientCapabilities.Client);\n const identity = client.halo.identity.get();\n invariant(identity, 'Identity not available');\n\n // TODO(wittjosiah): Consider factoring out passkey creation to the halo api.\n const lookupKey = PublicKey.random();\n const credential = await navigator.credentials.create({\n publicKey: {\n challenge: new Uint8Array(),\n rp: { id: location.hostname, name: appName },\n user: {\n id: lookupKey.asUint8Array(),\n name: identity.did,\n displayName: identity.profile?.displayName ?? '',\n },\n pubKeyCredParams: [\n { type: 'public-key', alg: -8 }, // Ed25519 (not yet supported across all browsers)\n { type: 'public-key', alg: -7 }, // ES256\n ],\n // https://web.dev/articles/webauthn-discoverable-credentials#resident-key\n authenticatorSelection: {\n residentKey: 'required',\n requireResidentKey: true,\n },\n },\n });\n\n invariant(credential, 'Credential not available');\n const recoveryKey = PublicKey.from(new Uint8Array((credential as any).response.getPublicKey()));\n const algorithm = (credential as any).response.getPublicKeyAlgorithm() === -7 ? 'ES256' : 'ED25519';\n\n // TODO(wittjosiah): This needs a proper api.\n invariant(client.services.services.IdentityService, 'IdentityService not available');\n await client.services.services.IdentityService.createRecoveryCredential({\n data: {\n recoveryKey,\n algorithm,\n lookupKey,\n },\n });\n },\n }),\n createResolver({\n intent: ClientAction.RedeemPasskey,\n resolve: async () => {\n const client = context.requestCapability(ClientCapabilities.Client);\n // TODO(wittjosiah): This needs a proper api.\n invariant(client.services.services.IdentityService, 'IdentityService not available');\n const { deviceKey, controlFeedKey, challenge } =\n await client.services.services.IdentityService.requestRecoveryChallenge();\n const credential = await navigator.credentials.get({\n publicKey: {\n challenge: Buffer.from(challenge, 'base64'),\n rpId: location.hostname,\n userVerification: 'required',\n },\n });\n const lookupKey = PublicKey.from(new Uint8Array((credential as any).response.userHandle));\n await client.services.services.IdentityService.recoverIdentity({\n external: {\n lookupKey,\n deviceKey,\n controlFeedKey,\n signature: Buffer.from((credential as any).response.signature),\n clientDataJson: Buffer.from((credential as any).response.clientDataJSON),\n authenticatorData: Buffer.from((credential as any).response.authenticatorData),\n },\n });\n },\n }),\n ]);\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;AAIA,SACEA,cACAC,aACAC,cACAC,gBACAC,oBAEK;AACP,SAASC,iBAAiB;AAC1B,SAASC,2BAA2B;AACpC,SAASC,iBAAiB;;AAa1B,IAAA,0BAAe,CAAC,EAAEC,SAASC,UAAU,YAAYC,QAAO,MACtDC,YAAYC,aAAaC,gBAAgB;EACvCC,eAAe;IACbC,QAAQC,aAAaC;IACrBC,SAAS,YAAA;AACP,YAAMC,UAAUX,QAAQY,kBAAkBR,aAAaS,aAAa;AACpE,YAAMC,SAASd,QAAQY,kBAAkBG,mBAAmBC,MAAM;AAClE,YAAMC,OAAO,MAAMH,OAAOI,KAAKC,eAAc;AA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AAK,IAAIhB,WAAYN,WAAmBuB,SAASC,aAAY,CAAA,CAAA;AAC3F,YAAMC,YAAazB,WAAmBuB,SAASG,sBAAqB,MAAO,KAAK,UAAU;AAG1F5C,gBAAUhC,OAAOiC,SAASA,SAASK,iBAAiB,iCAAA;;;;;;;;;AACpD,YAAMtC,OAAOiC,SAASA,SAASK,gBAAgBE,yBAAyB;QACtErC,MAAM;UACJoE;UACAI;UACA5B;QACF;MACF,CAAA;IACF;EACF,CAAA;EACAvD,eAAe;IACbC,QAAQC,aAAamF;IACrBjF,SAAS,YAAA;AACP,YAAMI,SAASd,QAAQY,kBAAkBG,mBAAmBC,MAAM;AAElE8B,gBAAUhC,OAAOiC,SAASA,SAASK,iBAAiB,iCAAA;;;;;;;;;AACpD,YAAM,EAAEwC,WAAWC,gBAAgBxB,UAAS,IAC1C,MAAMvD,OAAOiC,SAASA,SAASK,gBAAgB0C,yBAAwB;AACzE,YAAM9B,aAAa,MAAMC,UAAUC,YAAYN,IAAI;QACjDQ,WAAW;UACTC,WAAW0B,OAAOT,KAAKjB,WAAW,QAAA;UAClC2B,MAAMvB,SAASC;UACfuB,kBAAkB;QACpB;MACF,CAAA;AACA,YAAMpC,YAAYC,UAAUwB,KAAK,IAAIhB,WAAYN,WAAmBuB,SAASW,UAAU,CAAA;AACvF,YAAMpF,OAAOiC,SAASA,SAASK,gBAAgB+C,gBAAgB;QAC7DC,UAAU;UACRvC;UACA+B;UACAC;UACAQ,WAAWN,OAAOT,KAAMtB,WAAmBuB,SAASc,SAAS;UAC7DC,gBAAgBP,OAAOT,KAAMtB,WAAmBuB,SAASgB,cAAc;UACvEC,mBAAmBT,OAAOT,KAAMtB,WAAmBuB,SAASiB,iBAAiB;QAC/E;MACF,CAAA;IACF;EACF,CAAA;CACD;",
|
|
6
|
-
"names": ["Capabilities", "contributes", "createIntent", "createResolver", "LayoutAction", "invariant", "ObservabilityAction", "PublicKey", "context", "appName", "onReset", "contributes", "Capabilities", "IntentResolver", "createResolver", "intent", "ClientAction", "CreateIdentity", "resolve", "manager", "requestCapability", "PluginManager", "client", "ClientCapabilities", "Client", "data", "halo", "createIdentity", "activate", "ClientEvents", "IdentityCreated", "intents", "createIntent", "ObservabilityAction", "SendEvent", "name", "JoinIdentity", "LayoutAction", "UpdateDialog", "part", "subject", "JOIN_DIALOG", "options", "blockAlign", "props", "initialInvitationCode", "invitationCode", "initialDisposition", "ShareIdentity", "IDENTITY_DIALOG", "RecoverIdentity", "ResetStorage", "target", "CreateAgent", "invariant", "services", "EdgeAgentService", "createAgent", "timeout", "CreateRecoveryCode", "IdentityService", "recoveryCode", "createRecoveryCredential", "RECOVER_CODE_DIALOG", "type", "code", "CreatePasskey", "identity", "get", "lookupKey", "PublicKey", "random", "credential", "navigator", "credentials", "create", "publicKey", "challenge", "Uint8Array", "rp", "id", "location", "hostname", "user", "asUint8Array", "did", "displayName", "profile", "pubKeyCredParams", "alg", "authenticatorSelection", "residentKey", "requireResidentKey", "recoveryKey", "from", "response", "getPublicKey", "algorithm", "getPublicKeyAlgorithm", "RedeemPasskey", "deviceKey", "controlFeedKey", "requestRecoveryChallenge", "Buffer", "rpId", "userVerification", "userHandle", "recoverIdentity", "external", "signature", "clientDataJson", "clientDataJSON", "authenticatorData"]
|
|
7
|
-
}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
IDENTITY_DIALOG,
|
|
3
|
-
IdentityDialog,
|
|
4
|
-
JOIN_DIALOG,
|
|
5
|
-
JoinDialog,
|
|
6
|
-
MANAGE_CREDENTIALS_DIALOG,
|
|
7
|
-
ManageCredentialsDialog,
|
|
8
|
-
RECOVER_CODE_DIALOG,
|
|
9
|
-
RECOVER_SETUP_DIALOG,
|
|
10
|
-
RecoveryCodeDialog,
|
|
11
|
-
RecoverySetupDialog
|
|
12
|
-
} from "./chunk-HNJZ74DZ.mjs";
|
|
13
|
-
import "./chunk-7DPLXOMO.mjs";
|
|
14
|
-
import "./chunk-NHIL4T3L.mjs";
|
|
15
|
-
|
|
16
|
-
// packages/plugins/plugin-client/src/capabilities/react-surface.tsx
|
|
17
|
-
import React from "react";
|
|
18
|
-
import { createSurface, Capabilities, contributes } from "@dxos/app-framework";
|
|
19
|
-
var react_surface_default = ({ createInvitationUrl }) => contributes(Capabilities.ReactSurface, [
|
|
20
|
-
createSurface({
|
|
21
|
-
id: IDENTITY_DIALOG,
|
|
22
|
-
role: "dialog",
|
|
23
|
-
filter: (data) => data.component === IDENTITY_DIALOG,
|
|
24
|
-
component: ({ data }) => /* @__PURE__ */ React.createElement(IdentityDialog, {
|
|
25
|
-
...data.props,
|
|
26
|
-
createInvitationUrl
|
|
27
|
-
})
|
|
28
|
-
}),
|
|
29
|
-
createSurface({
|
|
30
|
-
id: JOIN_DIALOG,
|
|
31
|
-
role: "dialog",
|
|
32
|
-
filter: (data) => data.component === JOIN_DIALOG,
|
|
33
|
-
component: ({ data }) => /* @__PURE__ */ React.createElement(JoinDialog, data.props)
|
|
34
|
-
}),
|
|
35
|
-
createSurface({
|
|
36
|
-
id: RECOVER_CODE_DIALOG,
|
|
37
|
-
role: "dialog",
|
|
38
|
-
filter: (data) => data.component === RECOVER_CODE_DIALOG,
|
|
39
|
-
component: ({ data }) => /* @__PURE__ */ React.createElement(RecoveryCodeDialog, data.props)
|
|
40
|
-
}),
|
|
41
|
-
createSurface({
|
|
42
|
-
id: RECOVER_SETUP_DIALOG,
|
|
43
|
-
role: "dialog",
|
|
44
|
-
filter: (data) => data.component === RECOVER_SETUP_DIALOG,
|
|
45
|
-
component: () => /* @__PURE__ */ React.createElement(RecoverySetupDialog, null)
|
|
46
|
-
}),
|
|
47
|
-
createSurface({
|
|
48
|
-
id: MANAGE_CREDENTIALS_DIALOG,
|
|
49
|
-
role: "dialog",
|
|
50
|
-
filter: (data) => data.component === MANAGE_CREDENTIALS_DIALOG,
|
|
51
|
-
component: () => /* @__PURE__ */ React.createElement(ManageCredentialsDialog, null)
|
|
52
|
-
})
|
|
53
|
-
]);
|
|
54
|
-
export {
|
|
55
|
-
react_surface_default as default
|
|
56
|
-
};
|
|
57
|
-
//# sourceMappingURL=react-surface-QGPWIUFR.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/react-surface.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport React from 'react';\n\nimport { createSurface, Capabilities, contributes } from '@dxos/app-framework';\nimport { type IdentityPanelProps, type JoinPanelProps } from '@dxos/shell/react';\n\nimport {\n IDENTITY_DIALOG,\n IdentityDialog,\n JOIN_DIALOG,\n JoinDialog,\n RECOVER_CODE_DIALOG,\n RECOVER_SETUP_DIALOG,\n RecoveryCodeDialog,\n RecoverySetupDialog,\n type RecoveryCodeDialogProps,\n} from '../components';\nimport { MANAGE_CREDENTIALS_DIALOG, ManageCredentialsDialog } from '../components/ManageCredentialsDialog';\n\ntype ReactSurfaceOptions = {\n createInvitationUrl: (invitationCode: string) => string;\n};\n\nexport default ({ createInvitationUrl }: ReactSurfaceOptions) =>\n contributes(Capabilities.ReactSurface, [\n createSurface({\n id: IDENTITY_DIALOG,\n role: 'dialog',\n filter: (data): data is { props: IdentityPanelProps } => data.component === IDENTITY_DIALOG,\n component: ({ data }) => <IdentityDialog {...data.props} createInvitationUrl={createInvitationUrl} />,\n }),\n createSurface({\n id: JOIN_DIALOG,\n role: 'dialog',\n filter: (data): data is { props: JoinPanelProps } => data.component === JOIN_DIALOG,\n component: ({ data }) => <JoinDialog {...data.props} />,\n }),\n createSurface({\n id: RECOVER_CODE_DIALOG,\n role: 'dialog',\n filter: (data): data is { props: RecoveryCodeDialogProps } => data.component === RECOVER_CODE_DIALOG,\n component: ({ data }) => <RecoveryCodeDialog {...data.props} />,\n }),\n createSurface({\n id: RECOVER_SETUP_DIALOG,\n role: 'dialog',\n filter: (data): data is any => data.component === RECOVER_SETUP_DIALOG,\n component: () => <RecoverySetupDialog />,\n }),\n createSurface({\n id: MANAGE_CREDENTIALS_DIALOG,\n role: 'dialog',\n filter: (data): data is any => data.component === MANAGE_CREDENTIALS_DIALOG,\n component: () => <ManageCredentialsDialog />,\n }),\n ]);\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;AAIA,OAAOA,WAAW;AAElB,SAASC,eAAeC,cAAcC,mBAAmB;AAoBzD,IAAA,wBAAe,CAAC,EAAEC,oBAAmB,MACnCC,YAAYC,aAAaC,cAAc;EACrCC,cAAc;IACZC,IAAIC;IACJC,MAAM;IACNC,QAAQ,CAACC,SAAgDA,KAAKC,cAAcJ;IAC5EI,WAAW,CAAC,EAAED,KAAI,MAAO,sBAAA,cAACE,gBAAAA;MAAgB,GAAGF,KAAKG;MAAOZ;;EAC3D,CAAA;EACAI,cAAc;IACZC,IAAIQ;IACJN,MAAM;IACNC,QAAQ,CAACC,SAA4CA,KAAKC,cAAcG;IACxEH,WAAW,CAAC,EAAED,KAAI,MAAO,sBAAA,cAACK,YAAeL,KAAKG,KAAK;EACrD,CAAA;EACAR,cAAc;IACZC,IAAIU;IACJR,MAAM;IACNC,QAAQ,CAACC,SAAqDA,KAAKC,cAAcK;IACjFL,WAAW,CAAC,EAAED,KAAI,MAAO,sBAAA,cAACO,oBAAuBP,KAAKG,KAAK;EAC7D,CAAA;EACAR,cAAc;IACZC,IAAIY;IACJV,MAAM;IACNC,QAAQ,CAACC,SAAsBA,KAAKC,cAAcO;IAClDP,WAAW,MAAM,sBAAA,cAACQ,qBAAAA,IAAAA;EACpB,CAAA;EACAd,cAAc;IACZC,IAAIc;IACJZ,MAAM;IACNC,QAAQ,CAACC,SAAsBA,KAAKC,cAAcS;IAClDT,WAAW,MAAM,sBAAA,cAACU,yBAAAA,IAAAA;EACpB,CAAA;CACD;",
|
|
6
|
-
"names": ["React", "createSurface", "Capabilities", "contributes", "createInvitationUrl", "contributes", "Capabilities", "ReactSurface", "createSurface", "id", "IDENTITY_DIALOG", "role", "filter", "data", "component", "IdentityDialog", "props", "JOIN_DIALOG", "JoinDialog", "RECOVER_CODE_DIALOG", "RecoveryCodeDialog", "RECOVER_SETUP_DIALOG", "RecoverySetupDialog", "MANAGE_CREDENTIALS_DIALOG", "ManageCredentialsDialog"]
|
|
7
|
-
}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var app_graph_builder_RW7ESEX3_exports = {};
|
|
20
|
-
__export(app_graph_builder_RW7ESEX3_exports, {
|
|
21
|
-
default: () => app_graph_builder_default
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(app_graph_builder_RW7ESEX3_exports);
|
|
24
|
-
var import_chunk_TREVKZCJ = require("./chunk-TREVKZCJ.cjs");
|
|
25
|
-
var import_chunk_OIFPM5ZW = require("./chunk-OIFPM5ZW.cjs");
|
|
26
|
-
var import_app_framework = require("@dxos/app-framework");
|
|
27
|
-
var import_app_framework2 = require("@dxos/app-framework");
|
|
28
|
-
var import_plugin_graph = require("@dxos/plugin-graph");
|
|
29
|
-
var app_graph_builder_default = (context) => (0, import_app_framework2.contributes)(import_app_framework2.Capabilities.AppGraphBuilder, (0, import_plugin_graph.createExtension)({
|
|
30
|
-
id: import_chunk_OIFPM5ZW.CLIENT_PLUGIN,
|
|
31
|
-
filter: (node) => node.id === "root",
|
|
32
|
-
actions: () => [
|
|
33
|
-
{
|
|
34
|
-
id: `${import_chunk_OIFPM5ZW.CLIENT_PLUGIN}/open-shell`,
|
|
35
|
-
data: async () => {
|
|
36
|
-
const { dispatchPromise: dispatch } = context.requestCapability(import_app_framework2.Capabilities.IntentDispatcher);
|
|
37
|
-
await dispatch((0, import_app_framework.createIntent)(import_chunk_TREVKZCJ.ClientAction.ShareIdentity));
|
|
38
|
-
},
|
|
39
|
-
properties: {
|
|
40
|
-
label: [
|
|
41
|
-
"open shell label",
|
|
42
|
-
{
|
|
43
|
-
ns: import_chunk_OIFPM5ZW.CLIENT_PLUGIN
|
|
44
|
-
}
|
|
45
|
-
],
|
|
46
|
-
icon: "ph--address-book--regular",
|
|
47
|
-
keyBinding: {
|
|
48
|
-
macos: "meta+shift+.",
|
|
49
|
-
// TODO(wittjosiah): Test on windows to see if it behaves the same as linux.
|
|
50
|
-
windows: "alt+shift+.",
|
|
51
|
-
linux: "alt+shift+>"
|
|
52
|
-
},
|
|
53
|
-
testId: "clientPlugin.openShell"
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
]
|
|
57
|
-
}));
|
|
58
|
-
//# sourceMappingURL=app-graph-builder-RW7ESEX3.cjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
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,2BAA6B;AAC7B,IAAAA,wBAA+D;AAC/D,0BAA2C;AAK3C,IAAA,4BAAe,CAACC,gBACdC,mCACEC,mCAAaC,qBACbC,qCAAgB;EACdC,IAAIC;EACJC,QAAQ,CAACC,SAA6BA,KAAKH,OAAO;EAClDI,SAAS,MAAM;IACb;MACEJ,IAAI,GAAGC,mCAAAA;MACPI,MAAM,YAAA;AACJ,cAAM,EAAEC,iBAAiBC,SAAQ,IAAKZ,QAAQa,kBAAkBX,mCAAaY,gBAAgB;AAC7F,cAAMF,aAASG,mCAAaC,mCAAaC,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": ["import_app_framework", "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,7 +0,0 @@
|
|
|
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,yBAAkB;AAClB,0BAA2D;AAM3D,IAAMA,iBAAiBC,qBAAEC,OAAO;EAC9BC,aAAaF,qBAAEG,WAAWC,6BAAAA;EAC1BC,UAAUL,qBAAEM,SAASN,qBAAEG,WAAWC,6BAAAA,CAAAA;EAClCG,SAASP,qBAAEM,SACTN,qBAAEC,OAAO;IACPO,aAAaR,qBAAEM,SAASN,qBAAES,MAAM;IAChCC,WAAWV,qBAAEM,SAASN,qBAAES,MAAM;IAC9BE,MAAMX,qBAAEM,SAASN,qBAAEY,OAAO;MAAEC,KAAKb,qBAAES;MAAQK,OAAOd,qBAAEe;IAAI,CAAA,CAAA;EAC1D,CAAA,CAAA;AAEJ,CAAA;AAEA,IAAMC,gBAAgB,GAAGC,mCAAAA;;UACRC,eAAAA;EACR,MAAMC,uBAAuBnB,qBAAEoB,YAAW,EAAmB,GAAGJ,a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;EAKN,MAAMC,sBAAsBhC,qBAAEoB,YAAW,EAAkB,GAAGJ,aAAAA,mBAAgC;IACnGK,OAAOrB,qBAAEyB;IACTH,QAAQtB,qBAAEyB;EACZ,CAAA,EAAA;EAAI;gBAHSO,gBAAAA;EAKN,MAAMC,sBAAsBjC,qBAAEoB,YAAW,EAAkB,GAAGJ,aAAAA,mBAAgC;IACnGK,OAAOrB,qBAAEyB;IACTH,QAAQtB,qBAAEyB;EACZ,CAAA,EAAA;EAAI;gBAHSQ,gBAAAA;AAIf,GAnDiBf,iBAAAA,eAAAA,CAAAA,EAAAA;",
|
|
6
|
-
"names": ["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
|
-
}
|