@dxos/plugin-client 0.8.1-staging.391c573 → 0.8.1-staging.97aedb1
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-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/chunk-XZ4TQC56.mjs +619 -0
- package/dist/lib/browser/chunk-XZ4TQC56.mjs.map +7 -0
- 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-NCISOZW4.mjs} +65 -27
- package/dist/lib/browser/intent-resolver-NCISOZW4.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-J7SZR2J6.mjs +66 -0
- package/dist/lib/browser/react-surface-J7SZR2J6.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-3JE5BFCT.cjs +644 -0
- package/dist/lib/node/chunk-3JE5BFCT.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-U2576ALY.cjs} +81 -44
- package/dist/lib/node/intent-resolver-U2576ALY.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-BSTIXMER.cjs} +34 -26
- package/dist/lib/node/react-surface-BSTIXMER.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-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/chunk-LZN2UNN7.mjs +620 -0
- package/dist/lib/node-esm/chunk-LZN2UNN7.mjs.map +7 -0
- 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-G25U4UGI.mjs} +65 -27
- package/dist/lib/node-esm/intent-resolver-G25U4UGI.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-ZPI7T4EM.mjs +67 -0
- package/dist/lib/node-esm/react-surface-ZPI7T4EM.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/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 +1 -1
- 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 +270 -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 -5
- package/dist/types/src/components/IdentityDialog.d.ts.map +0 -1
- package/dist/types/src/components/ManageCredentialsDialog.d.ts +0 -4
- 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 -4
- 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,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,q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AA,EAAA;EAAI;gBAHSM,qBAAAA;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
|
-
}
|
|
@@ -1,309 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var chunk_UTG3UR3N_exports = {};
|
|
30
|
-
__export(chunk_UTG3UR3N_exports, {
|
|
31
|
-
IDENTITY_DIALOG: () => IDENTITY_DIALOG,
|
|
32
|
-
IdentityDialog: () => IdentityDialog,
|
|
33
|
-
JOIN_DIALOG: () => JOIN_DIALOG,
|
|
34
|
-
JoinDialog: () => JoinDialog,
|
|
35
|
-
MANAGE_CREDENTIALS_DIALOG: () => MANAGE_CREDENTIALS_DIALOG,
|
|
36
|
-
ManageCredentialsDialog: () => ManageCredentialsDialog,
|
|
37
|
-
RECOVER_CODE_DIALOG: () => RECOVER_CODE_DIALOG,
|
|
38
|
-
RECOVER_SETUP_DIALOG: () => RECOVER_SETUP_DIALOG,
|
|
39
|
-
RecoveryCodeDialog: () => RecoveryCodeDialog,
|
|
40
|
-
RecoverySetupDialog: () => RecoverySetupDialog
|
|
41
|
-
});
|
|
42
|
-
module.exports = __toCommonJS(chunk_UTG3UR3N_exports);
|
|
43
|
-
var import_chunk_TREVKZCJ = require("./chunk-TREVKZCJ.cjs");
|
|
44
|
-
var import_chunk_OIFPM5ZW = require("./chunk-OIFPM5ZW.cjs");
|
|
45
|
-
var import_react = require("@phosphor-icons/react");
|
|
46
|
-
var import_react2 = __toESM(require("react"));
|
|
47
|
-
var import_app_framework = require("@dxos/app-framework");
|
|
48
|
-
var import_halo = require("@dxos/react-client/halo");
|
|
49
|
-
var import_react_ui = require("@dxos/react-ui");
|
|
50
|
-
var import_react3 = require("@dxos/shell/react");
|
|
51
|
-
var import_react4 = __toESM(require("react"));
|
|
52
|
-
var import_app_framework2 = require("@dxos/app-framework");
|
|
53
|
-
var import_react_client = require("@dxos/react-client");
|
|
54
|
-
var import_react_ui2 = require("@dxos/react-ui");
|
|
55
|
-
var import_react5 = require("@dxos/shell/react");
|
|
56
|
-
var import_react6 = __toESM(require("react"));
|
|
57
|
-
var import_app_framework3 = require("@dxos/app-framework");
|
|
58
|
-
var import_types = require("@dxos/plugin-observability/types");
|
|
59
|
-
var import_react_ui3 = require("@dxos/react-ui");
|
|
60
|
-
var import_react7 = require("@dxos/shell/react");
|
|
61
|
-
var import_react8 = __toESM(require("react"));
|
|
62
|
-
var import_react_ui4 = require("@dxos/react-ui");
|
|
63
|
-
var import_react9 = require("@phosphor-icons/react");
|
|
64
|
-
var import_react10 = __toESM(require("react"));
|
|
65
|
-
var import_app_framework4 = require("@dxos/app-framework");
|
|
66
|
-
var import_react_ui5 = require("@dxos/react-ui");
|
|
67
|
-
var import_react11 = require("@dxos/shell/react");
|
|
68
|
-
var MANAGE_CREDENTIALS_DIALOG = `${import_chunk_OIFPM5ZW.CLIENT_PLUGIN}/ManageCredentialsDialog`;
|
|
69
|
-
var ManageCredentialsDialog = () => {
|
|
70
|
-
const { t } = (0, import_react_ui.useTranslation)(import_chunk_OIFPM5ZW.CLIENT_PLUGIN);
|
|
71
|
-
const { dispatchPromise: dispatch } = (0, import_app_framework.useIntentDispatcher)();
|
|
72
|
-
const credentials = (0, import_halo.useCredentials)();
|
|
73
|
-
const recoveryCredentials = credentials.filter((credential) => credential.subject.assertion["@type"] === "dxos.halo.credentials.IdentityRecovery");
|
|
74
|
-
const actions = (0, import_react2.useMemo)(() => ({
|
|
75
|
-
createPasskey: {
|
|
76
|
-
label: t("create passkey label"),
|
|
77
|
-
description: t("create passkey description"),
|
|
78
|
-
// TODO(wittjosiah): Ideally this would be a `user-key` icon.
|
|
79
|
-
icon: import_react.Key,
|
|
80
|
-
onClick: () => dispatch((0, import_app_framework.createIntent)(import_chunk_TREVKZCJ.ClientAction.CreatePasskey))
|
|
81
|
-
},
|
|
82
|
-
createRecoveryCode: {
|
|
83
|
-
label: t("create recovery code label"),
|
|
84
|
-
description: t("create recovery code description"),
|
|
85
|
-
icon: import_react.Receipt,
|
|
86
|
-
onClick: () => dispatch((0, import_app_framework.createIntent)(import_chunk_TREVKZCJ.ClientAction.CreateRecoveryCode))
|
|
87
|
-
}
|
|
88
|
-
}), [
|
|
89
|
-
t
|
|
90
|
-
]);
|
|
91
|
-
return /* @__PURE__ */ import_react2.default.createElement(import_react_ui.Dialog.Content, {
|
|
92
|
-
classNames: "bs-content min-bs-[15rem] max-bs-full md:max-is-[25rem] overflow-hidden"
|
|
93
|
-
}, /* @__PURE__ */ import_react2.default.createElement(import_react_ui.Dialog.Title, null, t("manage credentials dialog title")), /* @__PURE__ */ import_react2.default.createElement(import_react_ui.List, {
|
|
94
|
-
classNames: "py-4"
|
|
95
|
-
}, recoveryCredentials.map((credential) => /* @__PURE__ */ import_react2.default.createElement(import_react_ui.ListItem.Root, {
|
|
96
|
-
key: credential.id?.toHex()
|
|
97
|
-
}, /* @__PURE__ */ import_react2.default.createElement(import_react_ui.ListItem.Endcap, null, /* @__PURE__ */ import_react2.default.createElement(import_react_ui.Icon, {
|
|
98
|
-
icon: "ph--key--regular",
|
|
99
|
-
size: 5
|
|
100
|
-
})), /* @__PURE__ */ import_react2.default.createElement(import_react_ui.ListItem.Heading, null, credential.issuanceDate.toLocaleString())))), /* @__PURE__ */ import_react2.default.createElement("div", {
|
|
101
|
-
className: "grow"
|
|
102
|
-
}), /* @__PURE__ */ import_react2.default.createElement(import_react3.BifurcatedAction, {
|
|
103
|
-
actions
|
|
104
|
-
}));
|
|
105
|
-
};
|
|
106
|
-
var IDENTITY_DIALOG = `${import_chunk_OIFPM5ZW.CLIENT_PLUGIN}/IdentityDialog`;
|
|
107
|
-
var IdentityDialog = (props) => {
|
|
108
|
-
const { dispatchPromise: dispatch } = (0, import_app_framework2.useIntentDispatcher)();
|
|
109
|
-
const client = (0, import_react_client.useClient)();
|
|
110
|
-
const { t } = (0, import_react_ui2.useTranslation)(import_chunk_OIFPM5ZW.CLIENT_PLUGIN);
|
|
111
|
-
const handleDone = (0, import_react4.useCallback)(() => dispatch((0, import_app_framework2.createIntent)(import_app_framework2.LayoutAction.UpdateDialog, {
|
|
112
|
-
part: "dialog",
|
|
113
|
-
options: {
|
|
114
|
-
state: false
|
|
115
|
-
}
|
|
116
|
-
})), [
|
|
117
|
-
dispatch
|
|
118
|
-
]);
|
|
119
|
-
const handleResetStorage = (0, import_react4.useCallback)(async () => {
|
|
120
|
-
await client.reset();
|
|
121
|
-
await dispatch((0, import_app_framework2.createIntent)(import_chunk_TREVKZCJ.ClientAction.ResetStorage));
|
|
122
|
-
}, [
|
|
123
|
-
dispatch
|
|
124
|
-
]);
|
|
125
|
-
const handleRecover = (0, import_react4.useCallback)(async () => {
|
|
126
|
-
await client.reset();
|
|
127
|
-
await dispatch((0, import_app_framework2.createIntent)(import_chunk_TREVKZCJ.ClientAction.ResetStorage, {
|
|
128
|
-
target: "recoverIdentity"
|
|
129
|
-
}));
|
|
130
|
-
}, [
|
|
131
|
-
dispatch
|
|
132
|
-
]);
|
|
133
|
-
const handleJoinNewIdentity = (0, import_react4.useCallback)(async () => {
|
|
134
|
-
await client.reset();
|
|
135
|
-
await dispatch((0, import_app_framework2.createIntent)(import_chunk_TREVKZCJ.ClientAction.ResetStorage, {
|
|
136
|
-
target: "deviceInvitation"
|
|
137
|
-
}));
|
|
138
|
-
}, [
|
|
139
|
-
dispatch
|
|
140
|
-
]);
|
|
141
|
-
const handleManageCredentials = (0, import_react4.useCallback)(async () => {
|
|
142
|
-
await dispatch((0, import_app_framework2.createIntent)(import_app_framework2.LayoutAction.UpdateDialog, {
|
|
143
|
-
part: "dialog",
|
|
144
|
-
subject: MANAGE_CREDENTIALS_DIALOG,
|
|
145
|
-
options: {
|
|
146
|
-
state: true,
|
|
147
|
-
blockAlign: "start"
|
|
148
|
-
}
|
|
149
|
-
}));
|
|
150
|
-
}, [
|
|
151
|
-
dispatch
|
|
152
|
-
]);
|
|
153
|
-
return /* @__PURE__ */ import_react4.default.createElement(import_react_ui2.Dialog.Content, null, /* @__PURE__ */ import_react4.default.createElement(import_react_ui2.Dialog.Title, {
|
|
154
|
-
classNames: "sr-only"
|
|
155
|
-
}, t("manage profile label", {
|
|
156
|
-
ns: "os"
|
|
157
|
-
})), /* @__PURE__ */ import_react4.default.createElement(import_react_ui2.Clipboard.Provider, null, /* @__PURE__ */ import_react4.default.createElement(import_react5.IdentityPanel, {
|
|
158
|
-
...props,
|
|
159
|
-
doneActionParent: /* @__PURE__ */ import_react4.default.createElement(import_react_ui2.Dialog.Close, {
|
|
160
|
-
asChild: true
|
|
161
|
-
}),
|
|
162
|
-
onDone: handleDone,
|
|
163
|
-
onResetStorage: handleResetStorage,
|
|
164
|
-
onRecover: handleRecover,
|
|
165
|
-
onJoinNewIdentity: handleJoinNewIdentity,
|
|
166
|
-
onManageCredentials: handleManageCredentials
|
|
167
|
-
})));
|
|
168
|
-
};
|
|
169
|
-
var JOIN_DIALOG = `${import_chunk_OIFPM5ZW.CLIENT_PLUGIN}/JoinDialog`;
|
|
170
|
-
var JoinDialog = (props) => {
|
|
171
|
-
const { dispatchPromise: dispatch } = (0, import_app_framework3.useIntentDispatcher)();
|
|
172
|
-
const { t } = (0, import_react_ui3.useTranslation)(import_chunk_OIFPM5ZW.CLIENT_PLUGIN);
|
|
173
|
-
const handleCancelResetStorage = (0, import_react6.useCallback)(() => dispatch((0, import_app_framework3.createIntent)(import_chunk_TREVKZCJ.ClientAction.ShareIdentity)), [
|
|
174
|
-
dispatch
|
|
175
|
-
]);
|
|
176
|
-
const handleDone = (0, import_react6.useCallback)(async (result) => {
|
|
177
|
-
if (result?.identityKey) {
|
|
178
|
-
await Promise.all([
|
|
179
|
-
dispatch((0, import_app_framework3.createIntent)(import_app_framework3.LayoutAction.UpdateDialog, {
|
|
180
|
-
part: "dialog",
|
|
181
|
-
options: {
|
|
182
|
-
state: false
|
|
183
|
-
}
|
|
184
|
-
})),
|
|
185
|
-
dispatch((0, import_app_framework3.createIntent)(import_types.ObservabilityAction.SendEvent, {
|
|
186
|
-
name: props.initialDisposition === "recover-identity" ? "identity.recover" : "identity.join"
|
|
187
|
-
}))
|
|
188
|
-
]);
|
|
189
|
-
}
|
|
190
|
-
}, [
|
|
191
|
-
dispatch
|
|
192
|
-
]);
|
|
193
|
-
return /* @__PURE__ */ import_react6.default.createElement(import_react_ui3.Dialog.Content, null, /* @__PURE__ */ import_react6.default.createElement(import_react_ui3.Dialog.Title, {
|
|
194
|
-
classNames: "sr-only"
|
|
195
|
-
}, t("join space label", {
|
|
196
|
-
ns: "os"
|
|
197
|
-
})), /* @__PURE__ */ import_react6.default.createElement(import_react7.JoinPanel, {
|
|
198
|
-
mode: "halo-only",
|
|
199
|
-
...props,
|
|
200
|
-
exitActionParent: /* @__PURE__ */ import_react6.default.createElement(import_react_ui3.Dialog.Close, {
|
|
201
|
-
asChild: true
|
|
202
|
-
}),
|
|
203
|
-
doneActionParent: /* @__PURE__ */ import_react6.default.createElement(import_react_ui3.Dialog.Close, {
|
|
204
|
-
asChild: true
|
|
205
|
-
}),
|
|
206
|
-
onCancelResetStorage: handleCancelResetStorage,
|
|
207
|
-
onDone: handleDone
|
|
208
|
-
}));
|
|
209
|
-
};
|
|
210
|
-
var RECOVER_CODE_DIALOG = `${import_chunk_OIFPM5ZW.CLIENT_PLUGIN}/RecoveryCodeDialog`;
|
|
211
|
-
var RecoveryCodeDialog = ({ code }) => {
|
|
212
|
-
const { t } = (0, import_react_ui4.useTranslation)(import_chunk_OIFPM5ZW.CLIENT_PLUGIN);
|
|
213
|
-
const [confirmation, setConfirmation] = (0, import_react8.useState)(false);
|
|
214
|
-
const handleConfirmation = (0, import_react8.useCallback)((checked) => setConfirmation(checked), []);
|
|
215
|
-
return /* @__PURE__ */ import_react8.default.createElement(import_react_ui4.AlertDialog.Content, {
|
|
216
|
-
classNames: "bs-content min-bs-[15rem] max-bs-full md:max-is-[40rem] overflow-hidden"
|
|
217
|
-
}, /* @__PURE__ */ import_react8.default.createElement(import_react_ui4.AlertDialog.Title, null, t("recovery code dialog title")), /* @__PURE__ */ import_react8.default.createElement("p", {
|
|
218
|
-
className: "py-4"
|
|
219
|
-
}, t("recovery code dialog description")), /* @__PURE__ */ import_react8.default.createElement(import_react_ui4.Clipboard.Provider, null, /* @__PURE__ */ import_react8.default.createElement(Code, {
|
|
220
|
-
code
|
|
221
|
-
})), /* @__PURE__ */ import_react8.default.createElement("div", {
|
|
222
|
-
className: "flex flex-col py-4 gap-2"
|
|
223
|
-
}, /* @__PURE__ */ import_react8.default.createElement("p", null, t("recovery code dialog warning 1")), /* @__PURE__ */ import_react8.default.createElement("p", null, t("recovery code dialog warning 2"))), /* @__PURE__ */ import_react8.default.createElement("div", {
|
|
224
|
-
className: "flex items-center gap-2 pbe-4"
|
|
225
|
-
}, /* @__PURE__ */ import_react8.default.createElement(import_react_ui4.Input.Root, null, /* @__PURE__ */ import_react8.default.createElement(import_react_ui4.Input.Checkbox, {
|
|
226
|
-
"data-testid": "recoveryCode.confirm",
|
|
227
|
-
checked: confirmation,
|
|
228
|
-
onCheckedChange: handleConfirmation
|
|
229
|
-
}), /* @__PURE__ */ import_react8.default.createElement(import_react_ui4.Input.Label, null, t("recovery code confirmation label")))), /* @__PURE__ */ import_react8.default.createElement("div", {
|
|
230
|
-
className: "flex justify-end"
|
|
231
|
-
}, /* @__PURE__ */ import_react8.default.createElement(import_react_ui4.AlertDialog.Action, {
|
|
232
|
-
asChild: true
|
|
233
|
-
}, /* @__PURE__ */ import_react8.default.createElement(import_react_ui4.Button, {
|
|
234
|
-
"data-testid": "recoveryCode.continue",
|
|
235
|
-
variant: "primary",
|
|
236
|
-
disabled: !confirmation
|
|
237
|
-
}, t("continue label")))));
|
|
238
|
-
};
|
|
239
|
-
var Code = ({ code }) => {
|
|
240
|
-
const words = code.split(" ");
|
|
241
|
-
return /* @__PURE__ */ import_react8.default.createElement("div", {
|
|
242
|
-
className: "relative p-2 border border-separator rounded group"
|
|
243
|
-
}, /* @__PURE__ */ import_react8.default.createElement(import_react_ui4.Clipboard.IconButton, {
|
|
244
|
-
value: code,
|
|
245
|
-
classNames: "absolute top-2 right-2 invisible group-hover:visible"
|
|
246
|
-
}), /* @__PURE__ */ import_react8.default.createElement("div", {
|
|
247
|
-
className: "grid grid-cols-4"
|
|
248
|
-
}, words.map((word, i) => /* @__PURE__ */ import_react8.default.createElement("div", {
|
|
249
|
-
key: i,
|
|
250
|
-
className: "flex items-center p-2 gap-2"
|
|
251
|
-
}, /* @__PURE__ */ import_react8.default.createElement("div", {
|
|
252
|
-
className: "w-4 text-xs text-center text-subdued"
|
|
253
|
-
}, i + 1), /* @__PURE__ */ import_react8.default.createElement("div", {
|
|
254
|
-
className: "text-sm"
|
|
255
|
-
}, word)))));
|
|
256
|
-
};
|
|
257
|
-
var RECOVER_SETUP_DIALOG = `${import_chunk_OIFPM5ZW.CLIENT_PLUGIN}/RecoverySetupDialog`;
|
|
258
|
-
var RecoverySetupDialog = () => {
|
|
259
|
-
const { t } = (0, import_react_ui5.useTranslation)(import_chunk_OIFPM5ZW.CLIENT_PLUGIN);
|
|
260
|
-
const { dispatchPromise: dispatch } = (0, import_app_framework4.useIntentDispatcher)();
|
|
261
|
-
const actions = (0, import_react10.useMemo)(() => ({
|
|
262
|
-
createPasskey: {
|
|
263
|
-
label: t("create passkey label"),
|
|
264
|
-
description: t("create passkey description"),
|
|
265
|
-
// TODO(wittjosiah): Ideally this would be a `user-key` icon.
|
|
266
|
-
icon: import_react9.Key,
|
|
267
|
-
onClick: async () => {
|
|
268
|
-
await dispatch((0, import_app_framework4.createIntent)(import_chunk_TREVKZCJ.ClientAction.CreatePasskey));
|
|
269
|
-
await dispatch((0, import_app_framework4.createIntent)(import_app_framework4.LayoutAction.UpdateDialog, {
|
|
270
|
-
part: "dialog",
|
|
271
|
-
options: {
|
|
272
|
-
state: false
|
|
273
|
-
}
|
|
274
|
-
}));
|
|
275
|
-
}
|
|
276
|
-
},
|
|
277
|
-
createRecoveryCode: {
|
|
278
|
-
label: t("create recovery code label"),
|
|
279
|
-
description: t("create recovery code description"),
|
|
280
|
-
icon: import_react9.Receipt,
|
|
281
|
-
onClick: () => dispatch((0, import_app_framework4.createIntent)(import_chunk_TREVKZCJ.ClientAction.CreateRecoveryCode))
|
|
282
|
-
}
|
|
283
|
-
}), [
|
|
284
|
-
t
|
|
285
|
-
]);
|
|
286
|
-
return /* @__PURE__ */ import_react10.default.createElement(import_react_ui5.AlertDialog.Content, {
|
|
287
|
-
classNames: "bs-content min-bs-[15rem] max-bs-full md:max-is-[25rem] overflow-hidden"
|
|
288
|
-
}, /* @__PURE__ */ import_react10.default.createElement(import_react_ui5.AlertDialog.Title, null, t("recovery setup dialog title")), /* @__PURE__ */ import_react10.default.createElement("p", {
|
|
289
|
-
className: "py-4"
|
|
290
|
-
}, t("recovery setup dialog description")), /* @__PURE__ */ import_react10.default.createElement("div", {
|
|
291
|
-
className: "grow"
|
|
292
|
-
}), /* @__PURE__ */ import_react10.default.createElement(import_react11.BifurcatedAction, {
|
|
293
|
-
actions
|
|
294
|
-
}));
|
|
295
|
-
};
|
|
296
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
297
|
-
0 && (module.exports = {
|
|
298
|
-
IDENTITY_DIALOG,
|
|
299
|
-
IdentityDialog,
|
|
300
|
-
JOIN_DIALOG,
|
|
301
|
-
JoinDialog,
|
|
302
|
-
MANAGE_CREDENTIALS_DIALOG,
|
|
303
|
-
ManageCredentialsDialog,
|
|
304
|
-
RECOVER_CODE_DIALOG,
|
|
305
|
-
RECOVER_SETUP_DIALOG,
|
|
306
|
-
RecoveryCodeDialog,
|
|
307
|
-
RecoverySetupDialog
|
|
308
|
-
});
|
|
309
|
-
//# sourceMappingURL=chunk-UTG3UR3N.cjs.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,mBAA6B;AAC7B,IAAAA,gBAA+B;AAE/B,2BAAkD;AAClD,kBAA+B;AAC/B,sBAA6D;AAC7D,IAAAA,gBAAsD;ACNtD,IAAAA,gBAAmC;AAEnC,IAAAC,wBAAgE;AAChE,0BAA0B;AAC1B,IAAAC,mBAAkD;AAClD,IAAAF,gBAAuD;ACLvD,IAAAA,gBAAmC;AAEnC,IAAAC,wBAAgE;AAChE,mBAAoC;AAEpC,IAAAC,mBAAuC;AACvC,IAAAF,gBAA+C;ACN/C,IAAAA,gBAA6C;AAE7C,IAAAE,mBAAsE;ACFtE,IAAAF,gBAA6B;AAC7B,IAAAA,iBAA+B;AAE/B,IAAAC,wBAAgE;AAChE,IAAAC,mBAA4C;AAC5C,IAAAF,iBAAsD;AJM/C,IAAMG,4BAA4B,GAAGC,mCAAAA;AAGrC,IAAMC,0BAA0B,MAAA;AACrC,QAAM,EAAEC,EAAC,QAAKC,gCAAeH,mCAAAA;AAC7B,QAAM,EAAEI,iBAAiBC,SAAQ,QAAKC,0CAAAA;AACtC,QAAMC,kBAAcC,4BAAAA;AACpB,QAAMC,sBAAsBF,YAAYG,OACtC,CAACC,eAAeA,WAAWC,QAAQC,UAAU,OAAA,MAAa,wCAAA;AAI5D,QAAMC,cAA0CC,uBAC9C,OAAO;IACLC,eAAe;MACbC,OAAOf,EAAE,sBAAA;MACTgB,aAAahB,EAAE,4BAAA;;MAEfiB,MAAMC;MACNC,SAAS,MAAMhB,aAASiB,mCAAaC,mCAAaC,aAAa,CAAA;IACjE;IACAC,oBAAoB;MAClBR,OAAOf,EAAE,4B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AE3D,WAAU;KAAQ7C,EAAE,mCAAA,CAAA,GACvB0B,+BAAAA,QAAA,cAACkB,OAAAA;IAAIC,WAAU;MACfnB,+BAAAA,QAAA,cAACoB,eAAAA,kBAAAA;IAAiBlC;;AAGxB;",
|
|
6
|
-
"names": ["import_react", "import_app_framework", "import_react_ui", "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", "React", "Dialog", "Content", "classNames", "Title", "List", "map", "ListItem", "Root", "key", "id", "toHex", "Endcap", "Icon", "size", "Heading", "issuanceDate", "toLocaleString", "div", "className", "BifurcatedAction", "IDENTITY_DIALOG", "IdentityDialog", "props", "client", "useClient", "handleDone", "useCallback", "LayoutAction", "UpdateDialog", "part", "options", "state", "handleResetStorage", "reset", "ResetStorage", "handleRecover", "target", "handleJoinNewIdentity", "handleManageCredentials", "blockAlign", "ns", "Clipboard", "Provider", "IdentityPanel", "doneActionParent", "Close", "asChild", "onDone", "onResetStorage", "onRecover", "onJoinNewIdentity", "onManageCredentials", "JOIN_DIALOG", "JoinDialog", "handleCancelResetStorage", "ShareIdentity", "result", "identityKey", "Promise", "all", "ObservabilityAction", "SendEvent", "name", "initialDisposition", "JoinPanel", "mode", "exitActionParent", "onCancelResetStorage", "RECOVER_CODE_DIALOG", "RecoveryCodeDialog", "code", "confirmation", "setConfirmation", "useState", "handleConfirmation", "checked", "AlertDialog", "p", "Code", "Input", "Checkbox", "data-testid", "onCheckedChange", "Label", "Action", "Button", "variant", "disabled", "words", "split", "IconButton", "value", "word", "i", "RECOVER_SETUP_DIALOG", "RecoverySetupDialog"]
|
|
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,2BAOO;AACP,uBAA0B;AAC1B,mBAAoC;AACpC,0BAA0B;;AAa1B,IAAA,0BAAe,CAAC,EAAEA,SAASC,UAAU,YAAYC,QAAO,UACtDC,kCAAYC,kCAAaC,gBAAgB;MACvCC,qCAAe;IACbC,QAAQC,mCAAaC;IACrBC,SAAS,YAAA;AACP,YAAMC,UAAUX,QAAQY,kBAAkBR,kCAAaS,aAAa;AACpE,YAAMC,SAASd,QAAQY,kBAAkBG,yCAAmBC,MAAM;AAClE,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entResolver", "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,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,mBAAkB;AAElB,2BAAyD;AAoBzD,IAAA,wBAAe,CAAC,EAAEA,oBAAmB,UACnCC,kCAAYC,kCAAaC,cAAc;MACrCC,oCAAc;IACZC,IAAIC;IACJC,MAAM;IACNC,QAAQ,CAACC,SAAgDA,KAAKC,cAAcJ;IAC5EI,WAAW,CAAC,EAAED,KAAI,MAAO,6BAAAE,QAAA,cAACC,sCAAAA;MAAgB,GAAGH,KAAKI;MAAOb;;EAC3D,CAAA;MACAI,oCAAc;IACZC,IAAIS;IACJP,MAAM;IACNC,QAAQ,CAACC,SAA4CA,KAAKC,cAAcI;IACxEJ,WAAW,CAAC,EAAED,KAAI,MAAO,6BAAAE,QAAA,cAACI,kCAAeN,KAAKI,KAAK;EACrD,CAAA;MACAT,oCAAc;IACZC,IAAIW;IACJT,MAAM;IACNC,QAAQ,CAACC,SAAqDA,KAAKC,cAAcM;IACjFN,WAAW,CAAC,EAAED,KAAI,MAAO,6BAAAE,QAAA,cAACM,0CAAuBR,KAAKI,KAAK;EAC7D,CAAA;MACAT,oCAAc;IACZC,IAAIa;IACJX,MAAM;IACNC,QAAQ,CAACC,SAAsBA,KAAKC,cAAcQ;IAClDR,WAAW,MAAM,6BAAAC,QAAA,cAACQ,2CAAAA,IAAAA;EACpB,CAAA;MACAf,oCAAc;IACZC,IAAIe;IACJb,MAAM;IACNC,QAAQ,CAACC,SAAsBA,KAAKC,cAAcU;IAClDV,WAAW,MAAM,6BAAAC,QAAA,cAACU,+CAAAA,IAAAA;EACpB,CAAA;CACD;",
|
|
6
|
-
"names": ["createInvitationUrl", "contributes", "Capabilities", "ReactSurface", "createSurface", "id", "IDENTITY_DIALOG", "role", "filter", "data", "component", "React", "IdentityDialog", "props", "JOIN_DIALOG", "JoinDialog", "RECOVER_CODE_DIALOG", "RecoveryCodeDialog", "RECOVER_SETUP_DIALOG", "RecoverySetupDialog", "MANAGE_CREDENTIALS_DIALOG", "ManageCredentialsDialog"]
|
|
7
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
ClientAction
|
|
4
|
-
} from "./chunk-QJMF2MWP.mjs";
|
|
5
|
-
import {
|
|
6
|
-
CLIENT_PLUGIN
|
|
7
|
-
} from "./chunk-HO7WDE7C.mjs";
|
|
8
|
-
|
|
9
|
-
// packages/plugins/plugin-client/src/capabilities/app-graph-builder.ts
|
|
10
|
-
import { createIntent } from "@dxos/app-framework";
|
|
11
|
-
import { Capabilities, contributes } from "@dxos/app-framework";
|
|
12
|
-
import { createExtension } from "@dxos/plugin-graph";
|
|
13
|
-
var app_graph_builder_default = (context) => contributes(Capabilities.AppGraphBuilder, createExtension({
|
|
14
|
-
id: CLIENT_PLUGIN,
|
|
15
|
-
filter: (node) => node.id === "root",
|
|
16
|
-
actions: () => [
|
|
17
|
-
{
|
|
18
|
-
id: `${CLIENT_PLUGIN}/open-shell`,
|
|
19
|
-
data: async () => {
|
|
20
|
-
const { dispatchPromise: dispatch } = context.requestCapability(Capabilities.IntentDispatcher);
|
|
21
|
-
await dispatch(createIntent(ClientAction.ShareIdentity));
|
|
22
|
-
},
|
|
23
|
-
properties: {
|
|
24
|
-
label: [
|
|
25
|
-
"open shell label",
|
|
26
|
-
{
|
|
27
|
-
ns: CLIENT_PLUGIN
|
|
28
|
-
}
|
|
29
|
-
],
|
|
30
|
-
icon: "ph--address-book--regular",
|
|
31
|
-
keyBinding: {
|
|
32
|
-
macos: "meta+shift+.",
|
|
33
|
-
// TODO(wittjosiah): Test on windows to see if it behaves the same as linux.
|
|
34
|
-
windows: "alt+shift+.",
|
|
35
|
-
linux: "alt+shift+>"
|
|
36
|
-
},
|
|
37
|
-
testId: "clientPlugin.openShell"
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
]
|
|
41
|
-
}));
|
|
42
|
-
export {
|
|
43
|
-
app_graph_builder_default as default
|
|
44
|
-
};
|
|
45
|
-
//# sourceMappingURL=app-graph-builder-TDYRWNI7.mjs.map
|