@dxos/plugin-client 0.7.5-main.9d2a38b → 0.7.5-main.e94eead
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-6LOTDB4T.mjs → app-graph-builder-ON64R7SO.mjs} +2 -2
- package/dist/lib/browser/{chunk-E3OUNOEL.mjs → chunk-7DPLXOMO.mjs} +14 -2
- package/dist/lib/browser/chunk-7DPLXOMO.mjs.map +7 -0
- package/dist/lib/browser/chunk-EYBZZHSM.mjs +271 -0
- package/dist/lib/browser/chunk-EYBZZHSM.mjs.map +7 -0
- package/dist/lib/browser/{chunk-SVBQRT7I.mjs → chunk-GHEQL2E6.mjs} +1 -2
- package/dist/lib/browser/{chunk-SVBQRT7I.mjs.map → chunk-GHEQL2E6.mjs.map} +3 -3
- package/dist/lib/browser/{chunk-R4Q6H7RD.mjs → chunk-RGMLBYIF.mjs} +2 -2
- package/dist/lib/browser/{chunk-R4Q6H7RD.mjs.map → chunk-RGMLBYIF.mjs.map} +2 -2
- package/dist/lib/browser/{client-25GYH6TN.mjs → client-A7YSVURS.mjs} +4 -13
- package/dist/lib/browser/client-A7YSVURS.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +28 -15
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/intent-resolver-A6SKE7WJ.mjs +267 -0
- package/dist/lib/browser/intent-resolver-A6SKE7WJ.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-context-M3RT6SSG.mjs → react-context-R3SG55F5.mjs} +2 -2
- package/dist/lib/browser/{react-surface-XXONPG5T.mjs → react-surface-XGOUHVIH.mjs} +23 -7
- package/dist/lib/browser/react-surface-XGOUHVIH.mjs.map +7 -0
- package/dist/lib/browser/schema-J4MJIXRP.mjs +23 -0
- package/dist/lib/browser/schema-J4MJIXRP.mjs.map +7 -0
- package/dist/lib/browser/types.mjs +1 -1
- package/dist/lib/node/{app-graph-builder-JCND3P6G.cjs → app-graph-builder-RW7ESEX3.cjs} +6 -6
- package/dist/lib/node/chunk-7LVBFGKQ.cjs +299 -0
- package/dist/lib/node/chunk-7LVBFGKQ.cjs.map +7 -0
- package/dist/lib/node/{chunk-NVYWMDF3.cjs → chunk-TREVKZCJ.cjs} +17 -5
- package/dist/lib/node/chunk-TREVKZCJ.cjs.map +7 -0
- package/dist/lib/node/{chunk-3OB25QN2.cjs → chunk-UHIGZJQL.cjs} +4 -5
- package/dist/lib/node/{chunk-3OB25QN2.cjs.map → chunk-UHIGZJQL.cjs.map} +3 -3
- package/dist/lib/node/{chunk-IXVWJCYB.cjs → chunk-XPC4JOPP.cjs} +5 -5
- package/dist/lib/node/{chunk-IXVWJCYB.cjs.map → chunk-XPC4JOPP.cjs.map} +2 -2
- package/dist/lib/node/{client-52L4TUYU.cjs → client-2RQATBB6.cjs} +9 -18
- package/dist/lib/node/client-2RQATBB6.cjs.map +7 -0
- package/dist/lib/node/index.cjs +30 -17
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/intent-resolver-DKQHARC2.cjs +275 -0
- package/dist/lib/node/intent-resolver-DKQHARC2.cjs.map +7 -0
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/{react-context-B2DNULH4.cjs → react-context-TD6VGBVA.cjs} +6 -6
- package/dist/lib/node/{react-surface-7USN5NOO.cjs → react-surface-IY7GXEGU.cjs} +28 -16
- package/dist/lib/node/react-surface-IY7GXEGU.cjs.map +7 -0
- package/dist/lib/node/schema-JXJS75HQ.cjs +39 -0
- package/dist/lib/node/schema-JXJS75HQ.cjs.map +7 -0
- package/dist/lib/node/types.cjs +2 -2
- package/dist/lib/node/types.cjs.map +1 -1
- package/dist/lib/node-esm/{app-graph-builder-ZLGKFBLY.mjs → app-graph-builder-TDYRWNI7.mjs} +2 -2
- package/dist/lib/node-esm/chunk-CRF22MJJ.mjs +272 -0
- package/dist/lib/node-esm/chunk-CRF22MJJ.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-74T33KTB.mjs → chunk-QJMF2MWP.mjs} +14 -2
- package/dist/lib/node-esm/chunk-QJMF2MWP.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-73M5MK5Q.mjs → chunk-QR72BXJK.mjs} +2 -2
- package/dist/lib/node-esm/{chunk-73M5MK5Q.mjs.map → chunk-QR72BXJK.mjs.map} +2 -2
- package/dist/lib/node-esm/{chunk-OBGRL3DF.mjs → chunk-T35SFKK3.mjs} +1 -2
- package/dist/lib/node-esm/{chunk-OBGRL3DF.mjs.map → chunk-T35SFKK3.mjs.map} +3 -3
- package/dist/lib/node-esm/{client-K52NWOUN.mjs → client-36DKBSB7.mjs} +4 -13
- package/dist/lib/node-esm/client-36DKBSB7.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +28 -15
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/intent-resolver-HFYRSXUG.mjs +268 -0
- package/dist/lib/node-esm/intent-resolver-HFYRSXUG.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-context-IGEHJQK5.mjs → react-context-ZOGDOWJ2.mjs} +2 -2
- package/dist/lib/node-esm/{react-surface-CXLBCMPN.mjs → react-surface-F3PDFJMV.mjs} +23 -7
- package/dist/lib/node-esm/react-surface-F3PDFJMV.mjs.map +7 -0
- package/dist/lib/node-esm/schema-XM4HBLIX.mjs +24 -0
- package/dist/lib/node-esm/schema-XM4HBLIX.mjs.map +7 -0
- package/dist/lib/node-esm/types.mjs +1 -1
- package/dist/types/src/ClientPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts +110 -110
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/capabilities.d.ts +0 -1
- package/dist/types/src/capabilities/capabilities.d.ts.map +1 -1
- package/dist/types/src/capabilities/client.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +119 -117
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +2 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/schema.d.ts +4 -0
- package/dist/types/src/capabilities/schema.d.ts.map +1 -0
- package/dist/types/src/components/IdentityDialog.d.ts +1 -2
- package/dist/types/src/components/IdentityDialog.d.ts.map +1 -1
- package/dist/types/src/components/JoinDialog.d.ts +1 -2
- package/dist/types/src/components/JoinDialog.d.ts.map +1 -1
- package/dist/types/src/components/ManageCredentialsDialog.d.ts +3 -0
- package/dist/types/src/components/ManageCredentialsDialog.d.ts.map +1 -0
- package/dist/types/src/components/ManageCredentialsDialog.stories.d.ts +8 -0
- package/dist/types/src/components/ManageCredentialsDialog.stories.d.ts.map +1 -0
- package/dist/types/src/components/RecoveryCodeDialog.d.ts +1 -2
- package/dist/types/src/components/RecoveryCodeDialog.d.ts.map +1 -1
- package/dist/types/src/components/RecoverySetupDialog.d.ts +3 -0
- package/dist/types/src/components/RecoverySetupDialog.d.ts.map +1 -0
- package/dist/types/src/components/RecoverySetupDialog.stories.d.ts +8 -0
- package/dist/types/src/components/RecoverySetupDialog.stories.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +1 -0
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/events.d.ts +1 -1
- package/dist/types/src/translations.d.ts +7 -0
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types.d.ts +17 -1
- package/dist/types/src/types.d.ts.map +1 -1
- package/package.json +23 -17
- package/src/ClientPlugin.ts +11 -6
- package/src/capabilities/capabilities.ts +0 -1
- package/src/capabilities/client.ts +1 -9
- package/src/capabilities/index.ts +1 -0
- package/src/capabilities/intent-resolver.ts +171 -67
- package/src/capabilities/react-surface.tsx +21 -6
- package/src/capabilities/schema.ts +26 -0
- package/src/components/IdentityDialog.tsx +15 -3
- package/src/components/JoinDialog.tsx +1 -1
- package/src/components/ManageCredentialsDialog.stories.tsx +57 -0
- package/src/components/ManageCredentialsDialog.tsx +64 -0
- package/src/components/RecoveryCodeDialog.stories.tsx +5 -5
- package/src/components/RecoveryCodeDialog.tsx +2 -1
- package/src/components/RecoverySetupDialog.stories.tsx +77 -0
- package/src/components/RecoverySetupDialog.tsx +52 -0
- package/src/components/index.ts +1 -0
- package/src/events.ts +1 -1
- package/src/translations.ts +10 -1
- package/src/types.ts +11 -1
- package/dist/lib/browser/chunk-6IF6PREG.mjs +0 -158
- package/dist/lib/browser/chunk-6IF6PREG.mjs.map +0 -7
- package/dist/lib/browser/chunk-E3OUNOEL.mjs.map +0 -7
- package/dist/lib/browser/client-25GYH6TN.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-IWWLWOZD.mjs +0 -132
- package/dist/lib/browser/intent-resolver-IWWLWOZD.mjs.map +0 -7
- package/dist/lib/browser/react-surface-XXONPG5T.mjs.map +0 -7
- package/dist/lib/node/chunk-N3U7KVO3.cjs +0 -186
- package/dist/lib/node/chunk-N3U7KVO3.cjs.map +0 -7
- package/dist/lib/node/chunk-NVYWMDF3.cjs.map +0 -7
- package/dist/lib/node/client-52L4TUYU.cjs.map +0 -7
- package/dist/lib/node/intent-resolver-H3Y64MIP.cjs +0 -140
- package/dist/lib/node/intent-resolver-H3Y64MIP.cjs.map +0 -7
- package/dist/lib/node/react-surface-7USN5NOO.cjs.map +0 -7
- package/dist/lib/node-esm/chunk-74T33KTB.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-EHGD3UJH.mjs +0 -159
- package/dist/lib/node-esm/chunk-EHGD3UJH.mjs.map +0 -7
- package/dist/lib/node-esm/client-K52NWOUN.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-JCKD6R6L.mjs +0 -133
- package/dist/lib/node-esm/intent-resolver-JCKD6R6L.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-CXLBCMPN.mjs.map +0 -7
- /package/dist/lib/browser/{app-graph-builder-6LOTDB4T.mjs.map → app-graph-builder-ON64R7SO.mjs.map} +0 -0
- /package/dist/lib/browser/{react-context-M3RT6SSG.mjs.map → react-context-R3SG55F5.mjs.map} +0 -0
- /package/dist/lib/node/{app-graph-builder-JCND3P6G.cjs.map → app-graph-builder-RW7ESEX3.cjs.map} +0 -0
- /package/dist/lib/node/{react-context-B2DNULH4.cjs.map → react-context-TD6VGBVA.cjs.map} +0 -0
- /package/dist/lib/node-esm/{app-graph-builder-ZLGKFBLY.mjs.map → app-graph-builder-TDYRWNI7.mjs.map} +0 -0
- /package/dist/lib/node-esm/{react-context-IGEHJQK5.mjs.map → react-context-ZOGDOWJ2.mjs.map} +0 -0
|
@@ -26,12 +26,12 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var
|
|
30
|
-
__export(
|
|
29
|
+
var react_context_TD6VGBVA_exports = {};
|
|
30
|
+
__export(react_context_TD6VGBVA_exports, {
|
|
31
31
|
default: () => react_context_default
|
|
32
32
|
});
|
|
33
|
-
module.exports = __toCommonJS(
|
|
34
|
-
var
|
|
33
|
+
module.exports = __toCommonJS(react_context_TD6VGBVA_exports);
|
|
34
|
+
var import_chunk_UHIGZJQL = require("./chunk-UHIGZJQL.cjs");
|
|
35
35
|
var import_chunk_OIFPM5ZW = require("./chunk-OIFPM5ZW.cjs");
|
|
36
36
|
var import_react = __toESM(require("react"));
|
|
37
37
|
var import_app_framework = require("@dxos/app-framework");
|
|
@@ -39,10 +39,10 @@ var import_react_client = require("@dxos/react-client");
|
|
|
39
39
|
var react_context_default = () => (0, import_app_framework.contributes)(import_app_framework.Capabilities.ReactContext, {
|
|
40
40
|
id: import_chunk_OIFPM5ZW.CLIENT_PLUGIN,
|
|
41
41
|
context: ({ children }) => {
|
|
42
|
-
const client = (0, import_app_framework.useCapability)(
|
|
42
|
+
const client = (0, import_app_framework.useCapability)(import_chunk_UHIGZJQL.ClientCapabilities.Client);
|
|
43
43
|
return /* @__PURE__ */ import_react.default.createElement(import_react_client.ClientProvider, {
|
|
44
44
|
client
|
|
45
45
|
}, children);
|
|
46
46
|
}
|
|
47
47
|
});
|
|
48
|
-
//# sourceMappingURL=react-context-
|
|
48
|
+
//# sourceMappingURL=react-context-TD6VGBVA.cjs.map
|
|
@@ -26,37 +26,49 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var
|
|
30
|
-
__export(
|
|
29
|
+
var react_surface_IY7GXEGU_exports = {};
|
|
30
|
+
__export(react_surface_IY7GXEGU_exports, {
|
|
31
31
|
default: () => react_surface_default
|
|
32
32
|
});
|
|
33
|
-
module.exports = __toCommonJS(
|
|
34
|
-
var
|
|
35
|
-
var
|
|
33
|
+
module.exports = __toCommonJS(react_surface_IY7GXEGU_exports);
|
|
34
|
+
var import_chunk_7LVBFGKQ = require("./chunk-7LVBFGKQ.cjs");
|
|
35
|
+
var import_chunk_TREVKZCJ = require("./chunk-TREVKZCJ.cjs");
|
|
36
36
|
var import_chunk_OIFPM5ZW = require("./chunk-OIFPM5ZW.cjs");
|
|
37
37
|
var import_react = __toESM(require("react"));
|
|
38
38
|
var import_app_framework = require("@dxos/app-framework");
|
|
39
39
|
var react_surface_default = ({ createInvitationUrl }) => (0, import_app_framework.contributes)(import_app_framework.Capabilities.ReactSurface, [
|
|
40
40
|
(0, import_app_framework.createSurface)({
|
|
41
|
-
id:
|
|
41
|
+
id: import_chunk_7LVBFGKQ.IDENTITY_DIALOG,
|
|
42
42
|
role: "dialog",
|
|
43
|
-
filter: (data) => data.component ===
|
|
44
|
-
component: ({ data }) => /* @__PURE__ */ import_react.default.createElement(
|
|
45
|
-
...data.
|
|
43
|
+
filter: (data) => data.component === import_chunk_7LVBFGKQ.IDENTITY_DIALOG,
|
|
44
|
+
component: ({ data }) => /* @__PURE__ */ import_react.default.createElement(import_chunk_7LVBFGKQ.IdentityDialog, {
|
|
45
|
+
...data.props,
|
|
46
46
|
createInvitationUrl
|
|
47
47
|
})
|
|
48
48
|
}),
|
|
49
49
|
(0, import_app_framework.createSurface)({
|
|
50
|
-
id:
|
|
50
|
+
id: import_chunk_7LVBFGKQ.JOIN_DIALOG,
|
|
51
51
|
role: "dialog",
|
|
52
|
-
filter: (data) => data.component ===
|
|
53
|
-
component: ({ data }) => /* @__PURE__ */ import_react.default.createElement(
|
|
52
|
+
filter: (data) => data.component === import_chunk_7LVBFGKQ.JOIN_DIALOG,
|
|
53
|
+
component: ({ data }) => /* @__PURE__ */ import_react.default.createElement(import_chunk_7LVBFGKQ.JoinDialog, data.props)
|
|
54
54
|
}),
|
|
55
55
|
(0, import_app_framework.createSurface)({
|
|
56
|
-
id:
|
|
56
|
+
id: import_chunk_7LVBFGKQ.RECOVER_CODE_DIALOG,
|
|
57
57
|
role: "dialog",
|
|
58
|
-
filter: (data) => data.component ===
|
|
59
|
-
component: ({ data }) => /* @__PURE__ */ import_react.default.createElement(
|
|
58
|
+
filter: (data) => data.component === import_chunk_7LVBFGKQ.RECOVER_CODE_DIALOG,
|
|
59
|
+
component: ({ data }) => /* @__PURE__ */ import_react.default.createElement(import_chunk_7LVBFGKQ.RecoveryCodeDialog, data.props)
|
|
60
|
+
}),
|
|
61
|
+
(0, import_app_framework.createSurface)({
|
|
62
|
+
id: import_chunk_7LVBFGKQ.RECOVER_SETUP_DIALOG,
|
|
63
|
+
role: "dialog",
|
|
64
|
+
filter: (data) => data.component === import_chunk_7LVBFGKQ.RECOVER_SETUP_DIALOG,
|
|
65
|
+
component: () => /* @__PURE__ */ import_react.default.createElement(import_chunk_7LVBFGKQ.RecoverySetupDialog, null)
|
|
66
|
+
}),
|
|
67
|
+
(0, import_app_framework.createSurface)({
|
|
68
|
+
id: import_chunk_7LVBFGKQ.MANAGE_CREDENTIALS_DIALOG,
|
|
69
|
+
role: "dialog",
|
|
70
|
+
filter: (data) => data.component === import_chunk_7LVBFGKQ.MANAGE_CREDENTIALS_DIALOG,
|
|
71
|
+
component: () => /* @__PURE__ */ import_react.default.createElement(import_chunk_7LVBFGKQ.ManageCredentialsDialog, null)
|
|
60
72
|
})
|
|
61
73
|
]);
|
|
62
|
-
//# sourceMappingURL=react-surface-
|
|
74
|
+
//# sourceMappingURL=react-surface-IY7GXEGU.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
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 schema_JXJS75HQ_exports = {};
|
|
20
|
+
__export(schema_JXJS75HQ_exports, {
|
|
21
|
+
default: () => schema_default
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(schema_JXJS75HQ_exports);
|
|
24
|
+
var import_chunk_UHIGZJQL = require("./chunk-UHIGZJQL.cjs");
|
|
25
|
+
var import_chunk_OIFPM5ZW = require("./chunk-OIFPM5ZW.cjs");
|
|
26
|
+
var import_signals_core = require("@preact/signals-core");
|
|
27
|
+
var import_app_framework = require("@dxos/app-framework");
|
|
28
|
+
var schema_default = (context) => {
|
|
29
|
+
const client = context.requestCapability(import_chunk_UHIGZJQL.ClientCapabilities.Client);
|
|
30
|
+
let previous = [];
|
|
31
|
+
const unsubscribe = (0, import_signals_core.effect)(() => {
|
|
32
|
+
const schemas = Array.from(new Set(context.requestCapabilities(import_chunk_UHIGZJQL.ClientCapabilities.Schema).flat()));
|
|
33
|
+
const newSchemas = schemas.filter((schema) => !previous.includes(schema));
|
|
34
|
+
previous = schemas;
|
|
35
|
+
client.addTypes(newSchemas);
|
|
36
|
+
});
|
|
37
|
+
return (0, import_app_framework.contributes)(import_app_framework.Capabilities.Null, null, () => unsubscribe());
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=schema-JXJS75HQ.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/capabilities/schema.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { effect } from '@preact/signals-core';\n\nimport { Capabilities, contributes, type PluginsContext } from '@dxos/app-framework';\nimport { type TypedObject } from '@dxos/echo-schema';\n\nimport { ClientCapabilities } from './capabilities';\n\nexport default (context: PluginsContext) => {\n const client = context.requestCapability(ClientCapabilities.Client);\n\n // TODO(wittjosiah): Unregister schemas when they are disabled.\n let previous: TypedObject[] = [];\n const unsubscribe = effect(() => {\n const schemas = Array.from(new Set(context.requestCapabilities(ClientCapabilities.Schema).flat()));\n // TODO(wittjosiah): Filter out schemas which the client has already registered.\n const newSchemas = schemas.filter((schema) => !previous.includes(schema));\n previous = schemas;\n client.addTypes(newSchemas);\n });\n\n return contributes(Capabilities.Null, null, () => unsubscribe());\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;AAIA,0BAAuB;AAEvB,2BAA+D;AAK/D,IAAA,iBAAe,CAACA,YAAAA;AACd,QAAMC,SAASD,QAAQE,kBAAkBC,yCAAmBC,MAAM;AAGlE,MAAIC,WAA0B,CAAA;AAC9B,QAAMC,kBAAcC,4BAAO,MAAA;AACzB,UAAMC,UAAUC,MAAMC,KAAK,IAAIC,IAAIX,QAAQY,oBAAoBT,yCAAmBU,MAAM,EAAEC,KAAI,CAAA,CAAA;AAE9F,UAAMC,aAAaP,QAAQQ,OAAO,CAACC,WAAW,CAACZ,SAASa,SAASD,MAAAA,CAAAA;AACjEZ,eAAWG;AACXP,WAAOkB,SAASJ,UAAAA;EAClB,CAAA;AAEA,aAAOK,kCAAYC,kCAAaC,MAAM,MAAM,MAAMhB,YAAAA,CAAAA;AACpD;",
|
|
6
|
+
"names": ["context", "client", "requestCapability", "ClientCapabilities", "Client", "previous", "unsubscribe", "effect", "schemas", "Array", "from", "Set", "requestCapabilities", "Schema", "flat", "newSchemas", "filter", "schema", "includes", "addTypes", "contributes", "Capabilities", "Null"]
|
|
7
|
+
}
|
package/dist/lib/node/types.cjs
CHANGED
|
@@ -18,10 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var types_exports = {};
|
|
20
20
|
__export(types_exports, {
|
|
21
|
-
ClientAction: () =>
|
|
21
|
+
ClientAction: () => import_chunk_TREVKZCJ.ClientAction
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(types_exports);
|
|
24
|
-
var
|
|
24
|
+
var import_chunk_TREVKZCJ = require("./chunk-TREVKZCJ.cjs");
|
|
25
25
|
var import_chunk_OIFPM5ZW = require("./chunk-OIFPM5ZW.cjs");
|
|
26
26
|
// Annotate the CommonJS export names for ESM import in node:
|
|
27
27
|
0 && (module.exports = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["types.cjs"],
|
|
4
|
-
"sourcesContent": ["import {\n ClientAction\n} from \"./chunk-
|
|
4
|
+
"sourcesContent": ["import {\n ClientAction\n} from \"./chunk-TREVKZCJ.cjs\";\nimport \"./chunk-OIFPM5ZW.cjs\";\nexport {\n ClientAction\n};\n//# sourceMappingURL=types.cjs.map\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4BAEO;AACP,4BAAO;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
ClientAction
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-QJMF2MWP.mjs";
|
|
5
5
|
import {
|
|
6
6
|
CLIENT_PLUGIN
|
|
7
7
|
} from "./chunk-HO7WDE7C.mjs";
|
|
@@ -42,4 +42,4 @@ var app_graph_builder_default = (context) => contributes(Capabilities.AppGraphBu
|
|
|
42
42
|
export {
|
|
43
43
|
app_graph_builder_default as default
|
|
44
44
|
};
|
|
45
|
-
//# sourceMappingURL=app-graph-builder-
|
|
45
|
+
//# sourceMappingURL=app-graph-builder-TDYRWNI7.mjs.map
|
|
@@ -0,0 +1,272 @@
|
|
|
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/components/ManageCredentialsDialog.tsx
|
|
10
|
+
import { Receipt, Key } from "@phosphor-icons/react";
|
|
11
|
+
import React, { useMemo } from "react";
|
|
12
|
+
import { createIntent, useIntentDispatcher } from "@dxos/app-framework";
|
|
13
|
+
import { useCredentials } from "@dxos/react-client/halo";
|
|
14
|
+
import { Dialog, Icon, List, ListItem, useTranslation } from "@dxos/react-ui";
|
|
15
|
+
import { BifurcatedAction } from "@dxos/shell/react";
|
|
16
|
+
var MANAGE_CREDENTIALS_DIALOG = `${CLIENT_PLUGIN}/ManageCredentialsDialog`;
|
|
17
|
+
var ManageCredentialsDialog = () => {
|
|
18
|
+
const { t } = useTranslation(CLIENT_PLUGIN);
|
|
19
|
+
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
20
|
+
const credentials = useCredentials();
|
|
21
|
+
const recoveryCredentials = credentials.filter((credential) => credential.subject.assertion["@type"] === "dxos.halo.credentials.IdentityRecovery");
|
|
22
|
+
const actions = useMemo(() => ({
|
|
23
|
+
createPasskey: {
|
|
24
|
+
label: t("create passkey label"),
|
|
25
|
+
description: t("create passkey description"),
|
|
26
|
+
// TODO(wittjosiah): Ideally this would be a `user-key` icon.
|
|
27
|
+
icon: Key,
|
|
28
|
+
onClick: () => dispatch(createIntent(ClientAction.CreatePasskey))
|
|
29
|
+
},
|
|
30
|
+
createRecoveryCode: {
|
|
31
|
+
label: t("create recovery code label"),
|
|
32
|
+
description: t("create recovery code description"),
|
|
33
|
+
icon: Receipt,
|
|
34
|
+
onClick: () => dispatch(createIntent(ClientAction.CreateRecoveryCode))
|
|
35
|
+
}
|
|
36
|
+
}), [
|
|
37
|
+
t
|
|
38
|
+
]);
|
|
39
|
+
return /* @__PURE__ */ React.createElement(Dialog.Content, {
|
|
40
|
+
classNames: "bs-content min-bs-[15rem] max-bs-full md:max-is-[25rem] overflow-hidden"
|
|
41
|
+
}, /* @__PURE__ */ React.createElement(Dialog.Title, null, t("manage credentials dialog title")), /* @__PURE__ */ React.createElement(List, {
|
|
42
|
+
classNames: "py-4"
|
|
43
|
+
}, recoveryCredentials.map((credential) => /* @__PURE__ */ React.createElement(ListItem.Root, {
|
|
44
|
+
key: credential.id?.toHex()
|
|
45
|
+
}, /* @__PURE__ */ React.createElement(ListItem.Endcap, null, /* @__PURE__ */ React.createElement(Icon, {
|
|
46
|
+
icon: "ph--key--regular",
|
|
47
|
+
size: 5
|
|
48
|
+
})), /* @__PURE__ */ React.createElement(ListItem.Heading, null, credential.issuanceDate.toLocaleString())))), /* @__PURE__ */ React.createElement("div", {
|
|
49
|
+
className: "grow"
|
|
50
|
+
}), /* @__PURE__ */ React.createElement(BifurcatedAction, {
|
|
51
|
+
actions
|
|
52
|
+
}));
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
// packages/plugins/plugin-client/src/components/IdentityDialog.tsx
|
|
56
|
+
import React2, { useCallback } from "react";
|
|
57
|
+
import { createIntent as createIntent2, LayoutAction, useIntentDispatcher as useIntentDispatcher2 } from "@dxos/app-framework";
|
|
58
|
+
import { useClient } from "@dxos/react-client";
|
|
59
|
+
import { Clipboard, Dialog as Dialog2 } from "@dxos/react-ui";
|
|
60
|
+
import { IdentityPanel } from "@dxos/shell/react";
|
|
61
|
+
var IDENTITY_DIALOG = `${CLIENT_PLUGIN}/IdentityDialog`;
|
|
62
|
+
var IdentityDialog = (props) => {
|
|
63
|
+
const { dispatchPromise: dispatch } = useIntentDispatcher2();
|
|
64
|
+
const client = useClient();
|
|
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(Clipboard.Provider, null, /* @__PURE__ */ React2.createElement(IdentityPanel, {
|
|
108
|
+
...props,
|
|
109
|
+
doneActionParent: /* @__PURE__ */ React2.createElement(Dialog2.Close, {
|
|
110
|
+
asChild: true
|
|
111
|
+
}),
|
|
112
|
+
onDone: handleDone,
|
|
113
|
+
onResetStorage: handleResetStorage,
|
|
114
|
+
onRecover: handleRecover,
|
|
115
|
+
onJoinNewIdentity: handleJoinNewIdentity,
|
|
116
|
+
onManageCredentials: handleManageCredentials
|
|
117
|
+
})));
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
// packages/plugins/plugin-client/src/components/JoinDialog.tsx
|
|
121
|
+
import React3, { useCallback as useCallback2 } from "react";
|
|
122
|
+
import { createIntent as createIntent3, LayoutAction as LayoutAction2, useIntentDispatcher as useIntentDispatcher3 } from "@dxos/app-framework";
|
|
123
|
+
import { ObservabilityAction } from "@dxos/plugin-observability/types";
|
|
124
|
+
import { Dialog as Dialog3 } from "@dxos/react-ui";
|
|
125
|
+
import { JoinPanel } from "@dxos/shell/react";
|
|
126
|
+
var JOIN_DIALOG = `${CLIENT_PLUGIN}/JoinDialog`;
|
|
127
|
+
var JoinDialog = (props) => {
|
|
128
|
+
const { dispatchPromise: dispatch } = useIntentDispatcher3();
|
|
129
|
+
const handleCancelResetStorage = useCallback2(() => dispatch(createIntent3(ClientAction.ShareIdentity)), [
|
|
130
|
+
dispatch
|
|
131
|
+
]);
|
|
132
|
+
const handleDone = useCallback2(async (result) => {
|
|
133
|
+
if (result?.identityKey) {
|
|
134
|
+
await Promise.all([
|
|
135
|
+
dispatch(createIntent3(LayoutAction2.UpdateDialog, {
|
|
136
|
+
part: "dialog",
|
|
137
|
+
options: {
|
|
138
|
+
state: false
|
|
139
|
+
}
|
|
140
|
+
})),
|
|
141
|
+
dispatch(createIntent3(ObservabilityAction.SendEvent, {
|
|
142
|
+
name: props.initialDisposition === "recover-identity" ? "identity.recover" : "identity.join"
|
|
143
|
+
}))
|
|
144
|
+
]);
|
|
145
|
+
}
|
|
146
|
+
}, [
|
|
147
|
+
dispatch
|
|
148
|
+
]);
|
|
149
|
+
return /* @__PURE__ */ React3.createElement(Dialog3.Content, null, /* @__PURE__ */ React3.createElement(JoinPanel, {
|
|
150
|
+
mode: "halo-only",
|
|
151
|
+
...props,
|
|
152
|
+
exitActionParent: /* @__PURE__ */ React3.createElement(Dialog3.Close, {
|
|
153
|
+
asChild: true
|
|
154
|
+
}),
|
|
155
|
+
doneActionParent: /* @__PURE__ */ React3.createElement(Dialog3.Close, {
|
|
156
|
+
asChild: true
|
|
157
|
+
}),
|
|
158
|
+
onCancelResetStorage: handleCancelResetStorage,
|
|
159
|
+
onDone: handleDone
|
|
160
|
+
}));
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
// packages/plugins/plugin-client/src/components/RecoveryCodeDialog.tsx
|
|
164
|
+
import React4, { useCallback as useCallback3, useState } from "react";
|
|
165
|
+
import { AlertDialog, Button, Clipboard as Clipboard2, Input, useTranslation as useTranslation2 } from "@dxos/react-ui";
|
|
166
|
+
var RECOVER_CODE_DIALOG = `${CLIENT_PLUGIN}/RecoveryCodeDialog`;
|
|
167
|
+
var RecoveryCodeDialog = ({ code }) => {
|
|
168
|
+
const { t } = useTranslation2(CLIENT_PLUGIN);
|
|
169
|
+
const [confirmation, setConfirmation] = useState(false);
|
|
170
|
+
const handleConfirmation = useCallback3((checked) => setConfirmation(checked), []);
|
|
171
|
+
return /* @__PURE__ */ React4.createElement(AlertDialog.Content, {
|
|
172
|
+
classNames: "bs-content min-bs-[15rem] max-bs-full md:max-is-[40rem] overflow-hidden"
|
|
173
|
+
}, /* @__PURE__ */ React4.createElement(AlertDialog.Title, null, t("recovery code dialog title")), /* @__PURE__ */ React4.createElement("p", {
|
|
174
|
+
className: "py-4"
|
|
175
|
+
}, t("recovery code dialog description")), /* @__PURE__ */ React4.createElement(Clipboard2.Provider, null, /* @__PURE__ */ React4.createElement(Code, {
|
|
176
|
+
code
|
|
177
|
+
})), /* @__PURE__ */ React4.createElement("div", {
|
|
178
|
+
className: "flex flex-col py-4 gap-2"
|
|
179
|
+
}, /* @__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", {
|
|
180
|
+
className: "flex items-center gap-2 pbe-4"
|
|
181
|
+
}, /* @__PURE__ */ React4.createElement(Input.Root, null, /* @__PURE__ */ React4.createElement(Input.Checkbox, {
|
|
182
|
+
"data-testid": "recoveryCode.confirm",
|
|
183
|
+
checked: confirmation,
|
|
184
|
+
onCheckedChange: handleConfirmation
|
|
185
|
+
}), /* @__PURE__ */ React4.createElement(Input.Label, null, t("recovery code confirmation label")))), /* @__PURE__ */ React4.createElement("div", {
|
|
186
|
+
className: "flex justify-end"
|
|
187
|
+
}, /* @__PURE__ */ React4.createElement(AlertDialog.Action, {
|
|
188
|
+
asChild: true
|
|
189
|
+
}, /* @__PURE__ */ React4.createElement(Button, {
|
|
190
|
+
"data-testid": "recoveryCode.continue",
|
|
191
|
+
variant: "primary",
|
|
192
|
+
disabled: !confirmation
|
|
193
|
+
}, t("continue label")))));
|
|
194
|
+
};
|
|
195
|
+
var Code = ({ code }) => {
|
|
196
|
+
const words = code.split(" ");
|
|
197
|
+
return /* @__PURE__ */ React4.createElement("div", {
|
|
198
|
+
className: "relative p-2 border border-separator rounded group"
|
|
199
|
+
}, /* @__PURE__ */ React4.createElement(Clipboard2.IconButton, {
|
|
200
|
+
value: code,
|
|
201
|
+
classNames: "absolute top-2 right-2 invisible group-hover:visible"
|
|
202
|
+
}), /* @__PURE__ */ React4.createElement("div", {
|
|
203
|
+
className: "grid grid-cols-4"
|
|
204
|
+
}, words.map((word, i) => /* @__PURE__ */ React4.createElement("div", {
|
|
205
|
+
key: i,
|
|
206
|
+
className: "flex items-center p-2 gap-2"
|
|
207
|
+
}, /* @__PURE__ */ React4.createElement("div", {
|
|
208
|
+
className: "w-4 text-xs text-center text-subdued"
|
|
209
|
+
}, i + 1), /* @__PURE__ */ React4.createElement("div", {
|
|
210
|
+
className: "text-sm"
|
|
211
|
+
}, word)))));
|
|
212
|
+
};
|
|
213
|
+
|
|
214
|
+
// packages/plugins/plugin-client/src/components/RecoverySetupDialog.tsx
|
|
215
|
+
import { Key as Key2, Receipt as Receipt2 } from "@phosphor-icons/react";
|
|
216
|
+
import React5, { useMemo as useMemo2 } from "react";
|
|
217
|
+
import { createIntent as createIntent4, LayoutAction as LayoutAction3, useIntentDispatcher as useIntentDispatcher4 } from "@dxos/app-framework";
|
|
218
|
+
import { AlertDialog as AlertDialog2, useTranslation as useTranslation3 } from "@dxos/react-ui";
|
|
219
|
+
import { BifurcatedAction as BifurcatedAction2 } from "@dxos/shell/react";
|
|
220
|
+
var RECOVER_SETUP_DIALOG = `${CLIENT_PLUGIN}/RecoverySetupDialog`;
|
|
221
|
+
var RecoverySetupDialog = () => {
|
|
222
|
+
const { t } = useTranslation3(CLIENT_PLUGIN);
|
|
223
|
+
const { dispatchPromise: dispatch } = useIntentDispatcher4();
|
|
224
|
+
const actions = useMemo2(() => ({
|
|
225
|
+
createPasskey: {
|
|
226
|
+
label: t("create passkey label"),
|
|
227
|
+
description: t("create passkey description"),
|
|
228
|
+
// TODO(wittjosiah): Ideally this would be a `user-key` icon.
|
|
229
|
+
icon: Key2,
|
|
230
|
+
onClick: async () => {
|
|
231
|
+
await dispatch(createIntent4(ClientAction.CreatePasskey));
|
|
232
|
+
await dispatch(createIntent4(LayoutAction3.UpdateDialog, {
|
|
233
|
+
part: "dialog",
|
|
234
|
+
options: {
|
|
235
|
+
state: false
|
|
236
|
+
}
|
|
237
|
+
}));
|
|
238
|
+
}
|
|
239
|
+
},
|
|
240
|
+
createRecoveryCode: {
|
|
241
|
+
label: t("create recovery code label"),
|
|
242
|
+
description: t("create recovery code description"),
|
|
243
|
+
icon: Receipt2,
|
|
244
|
+
onClick: () => dispatch(createIntent4(ClientAction.CreateRecoveryCode))
|
|
245
|
+
}
|
|
246
|
+
}), [
|
|
247
|
+
t
|
|
248
|
+
]);
|
|
249
|
+
return /* @__PURE__ */ React5.createElement(AlertDialog2.Content, {
|
|
250
|
+
classNames: "bs-content min-bs-[15rem] max-bs-full md:max-is-[25rem] overflow-hidden"
|
|
251
|
+
}, /* @__PURE__ */ React5.createElement(AlertDialog2.Title, null, t("recovery setup dialog title")), /* @__PURE__ */ React5.createElement("p", {
|
|
252
|
+
className: "py-4"
|
|
253
|
+
}, t("recovery setup dialog description")), /* @__PURE__ */ React5.createElement("div", {
|
|
254
|
+
className: "grow"
|
|
255
|
+
}), /* @__PURE__ */ React5.createElement(BifurcatedAction2, {
|
|
256
|
+
actions
|
|
257
|
+
}));
|
|
258
|
+
};
|
|
259
|
+
|
|
260
|
+
export {
|
|
261
|
+
MANAGE_CREDENTIALS_DIALOG,
|
|
262
|
+
ManageCredentialsDialog,
|
|
263
|
+
IDENTITY_DIALOG,
|
|
264
|
+
IdentityDialog,
|
|
265
|
+
JOIN_DIALOG,
|
|
266
|
+
JoinDialog,
|
|
267
|
+
RECOVER_CODE_DIALOG,
|
|
268
|
+
RecoveryCodeDialog,
|
|
269
|
+
RECOVER_SETUP_DIALOG,
|
|
270
|
+
RecoverySetupDialog
|
|
271
|
+
};
|
|
272
|
+
//# sourceMappingURL=chunk-CRF22MJJ.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/ManageCredentialsDialog.tsx", "../../../src/components/IdentityDialog.tsx", "../../../src/components/JoinDialog.tsx", "../../../src/components/RecoveryCodeDialog.tsx", "../../../src/components/RecoverySetupDialog.tsx"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { Receipt, Key } from '@phosphor-icons/react';\nimport React, { useMemo } from 'react';\n\nimport { createIntent, useIntentDispatcher } from '@dxos/app-framework';\nimport { useCredentials } from '@dxos/react-client/halo';\nimport { Dialog, Icon, List, ListItem, useTranslation } from '@dxos/react-ui';\nimport { BifurcatedAction, type ActionMenuItem } from '@dxos/shell/react';\n\nimport { CLIENT_PLUGIN } from '../meta';\nimport { ClientAction } from '../types';\n\nexport const MANAGE_CREDENTIALS_DIALOG = `${CLIENT_PLUGIN}/ManageCredentialsDialog`;\n\n// TODO(wittjosiah): Factor panel out to @dxos/shell.\nexport const ManageCredentialsDialog = () => {\n const { t } = useTranslation(CLIENT_PLUGIN);\n const { dispatchPromise: dispatch } = useIntentDispatcher();\n const credentials = useCredentials();\n const recoveryCredentials = credentials.filter(\n (credential) => credential.subject.assertion['@type'] === 'dxos.halo.credentials.IdentityRecovery',\n );\n\n // TODO(wittjosiah): Reconsile w/ RecoverySetupDialog actions.\n const actions: Record<string, ActionMenuItem> = useMemo(\n () => ({\n createPasskey: {\n label: t('create passkey label'),\n description: t('create passkey description'),\n // TODO(wittjosiah): Ideally this would be a `user-key` icon.\n icon: Key,\n onClick: () => dispatch(createIntent(ClientAction.CreatePasskey)),\n },\n createRecoveryCode: {\n label: t('create recovery code label'),\n description: t('create recovery code description'),\n icon: Receipt,\n onClick: () => dispatch(createIntent(ClientAction.CreateRecoveryCode)),\n },\n }),\n [t],\n );\n\n return (\n <Dialog.Content classNames='bs-content min-bs-[15rem] max-bs-full md:max-is-[25rem] overflow-hidden'>\n <Dialog.Title>{t('manage credentials dialog title')}</Dialog.Title>\n <List classNames='py-4'>\n {recoveryCredentials.map((credential) => (\n <ListItem.Root key={credential.id?.toHex()}>\n <ListItem.Endcap>\n <Icon icon='ph--key--regular' size={5} />\n </ListItem.Endcap>\n <ListItem.Heading>{credential.issuanceDate.toLocaleString()}</ListItem.Heading>\n </ListItem.Root>\n ))}\n </List>\n <div className='grow' />\n <BifurcatedAction actions={actions} />\n </Dialog.Content>\n );\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { useCallback } from 'react';\n\nimport { createIntent, LayoutAction, useIntentDispatcher } from '@dxos/app-framework';\nimport { useClient } from '@dxos/react-client';\nimport { Clipboard, Dialog } from '@dxos/react-ui';\nimport { IdentityPanel, type IdentityPanelProps } from '@dxos/shell/react';\n\nimport { MANAGE_CREDENTIALS_DIALOG } from './ManageCredentialsDialog';\nimport { CLIENT_PLUGIN } from '../meta';\nimport { ClientAction } from '../types';\n\nexport const IDENTITY_DIALOG = `${CLIENT_PLUGIN}/IdentityDialog`;\n\nexport const IdentityDialog = (props: IdentityPanelProps) => {\n const { dispatchPromise: dispatch } = useIntentDispatcher();\n const client = useClient();\n\n const handleDone = useCallback(\n () =>\n dispatch(\n createIntent(LayoutAction.UpdateDialog, {\n part: 'dialog',\n options: { state: false },\n }),\n ),\n [dispatch],\n );\n\n const handleResetStorage = useCallback(async () => {\n await client.reset();\n await dispatch(createIntent(ClientAction.ResetStorage));\n }, [dispatch]);\n\n const handleRecover = useCallback(async () => {\n await client.reset();\n await dispatch(createIntent(ClientAction.ResetStorage, { target: 'recoverIdentity' }));\n }, [dispatch]);\n\n const handleJoinNewIdentity = useCallback(async () => {\n await client.reset();\n await dispatch(createIntent(ClientAction.ResetStorage, { target: 'deviceInvitation' }));\n }, [dispatch]);\n\n const handleManageCredentials = useCallback(async () => {\n await dispatch(\n createIntent(LayoutAction.UpdateDialog, {\n part: 'dialog',\n subject: MANAGE_CREDENTIALS_DIALOG,\n options: { state: true, blockAlign: 'start' },\n }),\n );\n }, [dispatch]);\n\n return (\n <Dialog.Content>\n <Clipboard.Provider>\n <IdentityPanel\n {...props}\n doneActionParent={<Dialog.Close asChild />}\n onDone={handleDone}\n onResetStorage={handleResetStorage}\n onRecover={handleRecover}\n onJoinNewIdentity={handleJoinNewIdentity}\n onManageCredentials={handleManageCredentials}\n />\n </Clipboard.Provider>\n </Dialog.Content>\n );\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { useCallback } from 'react';\n\nimport { createIntent, LayoutAction, useIntentDispatcher } from '@dxos/app-framework';\nimport { ObservabilityAction } from '@dxos/plugin-observability/types';\nimport { type InvitationResult } from '@dxos/react-client/invitations';\nimport { Dialog } from '@dxos/react-ui';\nimport { JoinPanel, type JoinPanelProps } from '@dxos/shell/react';\n\nimport { CLIENT_PLUGIN } from '../meta';\nimport { ClientAction } from '../types';\n\nexport const JOIN_DIALOG = `${CLIENT_PLUGIN}/JoinDialog`;\n\nexport const JoinDialog = (props: JoinPanelProps) => {\n const { dispatchPromise: dispatch } = useIntentDispatcher();\n\n const handleCancelResetStorage = useCallback(() => dispatch(createIntent(ClientAction.ShareIdentity)), [dispatch]);\n\n const handleDone = useCallback(\n async (result: InvitationResult | null) => {\n if (result?.identityKey) {\n await Promise.all([\n dispatch(createIntent(LayoutAction.UpdateDialog, { part: 'dialog', options: { state: false } })),\n dispatch(\n createIntent(ObservabilityAction.SendEvent, {\n name: props.initialDisposition === 'recover-identity' ? 'identity.recover' : 'identity.join',\n }),\n ),\n ]);\n }\n },\n [dispatch],\n );\n\n return (\n <Dialog.Content>\n <JoinPanel\n mode='halo-only'\n {...props}\n exitActionParent={<Dialog.Close asChild />}\n doneActionParent={<Dialog.Close asChild />}\n onCancelResetStorage={handleCancelResetStorage}\n onDone={handleDone}\n />\n </Dialog.Content>\n );\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { useCallback, useState } from 'react';\n\nimport { AlertDialog, Button, Clipboard, Input, useTranslation } from '@dxos/react-ui';\n\nimport { CLIENT_PLUGIN } from '../meta';\n\nexport const RECOVER_CODE_DIALOG = `${CLIENT_PLUGIN}/RecoveryCodeDialog`;\n\nexport type RecoveryCodeDialogProps = {\n code: string;\n};\n\n// TODO(wittjosiah): Factor panel out to @dxos/shell.\nexport const RecoveryCodeDialog = ({ code }: RecoveryCodeDialogProps) => {\n const { t } = useTranslation(CLIENT_PLUGIN);\n const [confirmation, setConfirmation] = useState(false);\n\n const handleConfirmation = useCallback((checked: boolean) => setConfirmation(checked), []);\n\n return (\n <AlertDialog.Content classNames='bs-content min-bs-[15rem] max-bs-full md:max-is-[40rem] overflow-hidden'>\n <AlertDialog.Title>{t('recovery code dialog title')}</AlertDialog.Title>\n <p className='py-4'>{t('recovery code dialog description')}</p>\n <Clipboard.Provider>\n <Code code={code} />\n </Clipboard.Provider>\n <div className='flex flex-col py-4 gap-2'>\n <p>{t('recovery code dialog warning 1')}</p>\n <p>{t('recovery code dialog warning 2')}</p>\n </div>\n <div className='flex items-center gap-2 pbe-4'>\n <Input.Root>\n <Input.Checkbox\n data-testid='recoveryCode.confirm'\n checked={confirmation}\n onCheckedChange={handleConfirmation}\n />\n <Input.Label>{t('recovery code confirmation label')}</Input.Label>\n </Input.Root>\n </div>\n <div className='flex justify-end'>\n <AlertDialog.Action asChild>\n <Button data-testid='recoveryCode.continue' variant='primary' disabled={!confirmation}>\n {t('continue label')}\n </Button>\n </AlertDialog.Action>\n </div>\n </AlertDialog.Content>\n );\n};\n\nconst Code = ({ code }: { code: string }) => {\n const words = code.split(' ');\n return (\n <div className='relative p-2 border border-separator rounded group'>\n <Clipboard.IconButton value={code} classNames='absolute top-2 right-2 invisible group-hover:visible' />\n <div className='grid grid-cols-4'>\n {words.map((word, i) => (\n <div key={i} className='flex items-center p-2 gap-2'>\n <div className='w-4 text-xs text-center text-subdued'>{i + 1}</div>\n <div className='text-sm'>{word}</div>\n </div>\n ))}\n </div>\n </div>\n );\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { Key, Receipt } from '@phosphor-icons/react';\nimport React, { useMemo } from 'react';\n\nimport { createIntent, LayoutAction, useIntentDispatcher } from '@dxos/app-framework';\nimport { AlertDialog, useTranslation } from '@dxos/react-ui';\nimport { type ActionMenuItem, BifurcatedAction } from '@dxos/shell/react';\n\nimport { CLIENT_PLUGIN } from '../meta';\nimport { ClientAction } from '../types';\n\nexport const RECOVER_SETUP_DIALOG = `${CLIENT_PLUGIN}/RecoverySetupDialog`;\n\n// TODO(wittjosiah): Factor panel out to @dxos/shell.\nexport const RecoverySetupDialog = () => {\n const { t } = useTranslation(CLIENT_PLUGIN);\n const { dispatchPromise: dispatch } = useIntentDispatcher();\n\n const actions: Record<string, ActionMenuItem> = useMemo(\n () => ({\n createPasskey: {\n label: t('create passkey label'),\n description: t('create passkey description'),\n // TODO(wittjosiah): Ideally this would be a `user-key` icon.\n icon: Key,\n onClick: async () => {\n await dispatch(createIntent(ClientAction.CreatePasskey));\n await dispatch(createIntent(LayoutAction.UpdateDialog, { part: 'dialog', options: { state: false } }));\n },\n },\n createRecoveryCode: {\n label: t('create recovery code label'),\n description: t('create recovery code description'),\n icon: Receipt,\n onClick: () => dispatch(createIntent(ClientAction.CreateRecoveryCode)),\n },\n }),\n [t],\n );\n\n return (\n <AlertDialog.Content classNames='bs-content min-bs-[15rem] max-bs-full md:max-is-[25rem] overflow-hidden'>\n <AlertDialog.Title>{t('recovery setup dialog title')}</AlertDialog.Title>\n <p className='py-4'>{t('recovery setup dialog description')}</p>\n <div className='grow' />\n <BifurcatedAction actions={actions} />\n </AlertDialog.Content>\n );\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;AAIA,SAASA,SAASC,WAAW;AAC7B,OAAOC,SAASC,eAAe;AAE/B,SAASC,cAAcC,2BAA2B;AAClD,SAASC,sBAAsB;AAC/B,SAASC,QAAQC,MAAMC,MAAMC,UAAUC,sBAAsB;AAC7D,SAASC,wBAA6C;AAK/C,IAAMC,4BAA4B,GAAGC,aAAAA;AAGrC,IAAMC,0BAA0B,MAAA;AACrC,QAAM,EAAEC,EAAC,IAAKC,eAAeH,aAAAA;AAC7B,QAAM,EAAEI,iBAAiBC,SAAQ,IAAKC,oBAAAA;AACtC,QAAMC,cAAcC,eAAAA;AACpB,QAAMC,sBAAsBF,YAAYG,OACtC,CAACC,eAAeA,WAAWC,QAAQC,UAAU,OAAA,MAAa,wCAAA;AAI5D,QAAMC,UAA0CC,QAC9C,OAAO;IACLC,eAAe;MACbC,OAAOf,EAAE,sBAAA;MACTgB,aAAahB,EAAE,4BAAA;;MAEfiB,MAAMC;MACNC,SAAS,MAAMhB,SAASiB,aAAaC,aAAaC,aAAa,CAAA;IACjE;IACAC,oBAAoB;MAClBR,OAAOf,EAAE,4BAAA;MACTgB,aAAahB,EAAE,kCAAA;MACfiB,MAAMO;MACNL,SAAS,MAAMhB,SAASiB,aAAaC,aAAaI,kBAAkB,CAAA;IACtE;EACF,IACA;IAACzB;GAAE;AAGL,SACE,sBAAA,cAAC0B,OAAOC,SAAO;IAACC,YAAW;KACzB,sBAAA,cAACF,OAAOG,OAAK,MAAE7B,EAAE,iCAAA,CAAA,GACjB,sBAAA,cAAC8B,MAAAA;IAAKF,YAAW;KACdrB,oBAAoBwB,IAAI,CAACtB,eACxB,sBAAA,cAACuB,SAASC,MAAI;IAACC,KAAKzB,WAAW0B,IAAIC,MAAAA;KACjC,sBAAA,cAACJ,SAASK,QAAM,MACd,sBAAA,cAACC,M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AAaT,EAAE,4BAAA;;MAEfU,MAAMC;MACNC,SAAS,YAAA;AACP,cAAMT,SAASU,cAAaC,aAAaC,aAAa,CAAA;AACtD,cAAMZ,SAASU,cAAaG,cAAaC,cAAc;UAAEC,MAAM;UAAUC,SAAS;YAAEC,OAAO;UAAM;QAAE,CAAA,CAAA;MACrG;IACF;IACAC,oBAAoB;MAClBb,OAAOR,EAAE,4BAAA;MACTS,aAAaT,EAAE,kCAAA;MACfU,MAAMY;MACNV,SAAS,MAAMT,SAASU,cAAaC,aAAaS,kBAAkB,CAAA;IACtE;EACF,IACA;IAACvB;GAAE;AAGL,SACE,gBAAAwB,OAAA,cAACC,aAAYC,SAAO;IAACC,YAAW;KAC9B,gBAAAH,OAAA,cAACC,aAAYG,OAAK,MAAE5B,EAAE,6BAAA,CAAA,GACtB,gBAAAwB,OAAA,cAACK,KAAAA;IAAEC,WAAU;KAAQ9B,EAAE,mCAAA,CAAA,GACvB,gBAAAwB,OAAA,cAACO,OAAAA;IAAID,WAAU;MACf,gBAAAN,OAAA,cAACQ,mBAAAA;IAAiB3B;;AAGxB;",
|
|
6
|
+
"names": ["Receipt", "Key", "React", "useMemo", "createIntent", "useIntentDispatcher", "useCredentials", "Dialog", "Icon", "List", "ListItem", "useTranslation", "BifurcatedAction", "MANAGE_CREDENTIALS_DIALOG", "CLIENT_PLUGIN", "ManageCredentialsDialog", "t", "useTranslation", "dispatchPromise", "dispatch", "useIntentDispatcher", "credentials", "useCredentials", "recoveryCredentials", "filter", "credential", "subject", "assertion", "actions", "useMemo", "createPasskey", "label", "description", "icon", "Key", "onClick", "createIntent", "ClientAction", "CreatePasskey", "createRecoveryCode", "Receipt", "CreateRecoveryCode", "Dialog", "Content", "classNames", "Title", "List", "map", "ListItem", "Root", "key", "id", "toHex", "Endcap", "Icon", "size", "Heading", "issuanceDate", "toLocaleString", "div", "className", "BifurcatedAction", "React", "useCallback", "createIntent", "LayoutAction", "useIntentDispatcher", "useClient", "Clipboard", "Dialog", "IdentityPanel", "IDENTITY_DIALOG", "CLIENT_PLUGIN", "IdentityDialog", "props", "dispatchPromise", "dispatch", "useIntentDispatcher", "client", "useClient", "handleDone", "useCallback", "createIntent", "LayoutAction", "UpdateDialog", "part", "options", "state", "handleResetStorage", "reset", "ClientAction", "ResetStorage", "handleRecover", "target", "handleJoinNewIdentity", "handleManageCredentials", "subject", "MANAGE_CREDENTIALS_DIALOG", "blockAlign", "React", "Dialog", "Content", "Clipboard", "Provider", "IdentityPanel", "doneActionParent", "Close", "asChild", "onDone", "onResetStorage", "onRecover", "onJoinNewIdentity", "onManageCredentials", "React", "useCallback", "createIntent", "LayoutAction", "useIntentDispatcher", "ObservabilityAction", "Dialog", "JoinPanel", "JOIN_DIALOG", "CLIENT_PLUGIN", "JoinDialog", "props", "dispatchPromise", "dispatch", "useIntentDispatcher", "handleCancelResetStorage", "useCallback", "createIntent", "ClientAction", "ShareIdentity", "handleDone", "result", "identityKey", "Promise", "all", "LayoutAction", "UpdateDialog", "part", "options", "state", "ObservabilityAction", "SendEvent", "name", "initialDisposition", "React", "Dialog", "Content", "JoinPanel", "mode", "exitActionParent", "Close", "asChild", "doneActionParent", "onCancelResetStorage", "onDone", "React", "useCallback", "useState", "AlertDialog", "Button", "Clipboard", "Input", "useTranslation", "RECOVER_CODE_DIALOG", "CLIENT_PLUGIN", "RecoveryCodeDialog", "code", "t", "useTranslation", "confirmation", "setConfirmation", "useState", "handleConfirmation", "useCallback", "checked", "React", "AlertDialog", "Content", "classNames", "Title", "p", "className", "Clipboard", "Provider", "Code", "div", "Input", "Root", "Checkbox", "data-testid", "onCheckedChange", "Label", "Action", "asChild", "Button", "variant", "disabled", "words", "split", "IconButton", "value", "map", "word", "i", "key", "Key", "Receipt", "React", "useMemo", "createIntent", "LayoutAction", "useIntentDispatcher", "AlertDialog", "useTranslation", "BifurcatedAction", "RECOVER_SETUP_DIALOG", "CLIENT_PLUGIN", "RecoverySetupDialog", "t", "useTranslation", "dispatchPromise", "dispatch", "useIntentDispatcher", "actions", "useMemo", "createPasskey", "label", "description", "icon", "Key", "onClick", "createIntent", "ClientAction", "CreatePasskey", "LayoutAction", "UpdateDialog", "part", "options", "state", "createRecoveryCode", "Receipt", "CreateRecoveryCode", "React", "AlertDialog", "Content", "classNames", "Title", "p", "className", "div", "BifurcatedAction"]
|
|
7
|
+
}
|
|
@@ -31,7 +31,7 @@ var ClientAction;
|
|
|
31
31
|
ClientAction2.CreateIdentity = CreateIdentity;
|
|
32
32
|
class JoinIdentity extends S.TaggedClass()(`${CLIENT_ACTION}/join-identity`, {
|
|
33
33
|
input: S.Struct({
|
|
34
|
-
invitationCode: S.String
|
|
34
|
+
invitationCode: S.optional(S.String)
|
|
35
35
|
}),
|
|
36
36
|
output: S.Void
|
|
37
37
|
}) {
|
|
@@ -69,9 +69,21 @@ var ClientAction;
|
|
|
69
69
|
}) {
|
|
70
70
|
}
|
|
71
71
|
ClientAction2.CreateRecoveryCode = CreateRecoveryCode;
|
|
72
|
+
class CreatePasskey extends S.TaggedClass()(`${CLIENT_ACTION}/create-passkey`, {
|
|
73
|
+
input: S.Void,
|
|
74
|
+
output: S.Void
|
|
75
|
+
}) {
|
|
76
|
+
}
|
|
77
|
+
ClientAction2.CreatePasskey = CreatePasskey;
|
|
78
|
+
class RedeemPasskey extends S.TaggedClass()(`${CLIENT_ACTION}/redeem-passkey`, {
|
|
79
|
+
input: S.Void,
|
|
80
|
+
output: S.Void
|
|
81
|
+
}) {
|
|
82
|
+
}
|
|
83
|
+
ClientAction2.RedeemPasskey = RedeemPasskey;
|
|
72
84
|
})(ClientAction || (ClientAction = {}));
|
|
73
85
|
|
|
74
86
|
export {
|
|
75
87
|
ClientAction
|
|
76
88
|
};
|
|
77
|
-
//# sourceMappingURL=chunk-
|
|
89
|
+
//# sourceMappingURL=chunk-QJMF2MWP.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/types.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { type PluginsContext } from '@dxos/app-framework';\nimport { S } from '@dxos/echo-schema';\nimport { type Client, PublicKey, type ClientOptions } from '@dxos/react-client';\nimport { type MaybePromise } from '@dxos/util';\n\nimport { CLIENT_PLUGIN } from './meta';\n\n// TODO(wittjosiah): Factor out. Generate?\nconst IdentitySchema = S.Struct({\n identityKey: S.instanceOf(PublicKey),\n spaceKey: S.optional(S.instanceOf(PublicKey)),\n profile: S.optional(\n S.Struct({\n displayName: S.optional(S.String),\n avatarCid: S.optional(S.String),\n data: S.optional(S.Record({ key: S.String, value: S.Any })),\n }),\n ),\n});\n\nconst CLIENT_ACTION = `${CLIENT_PLUGIN}/action`;\nexport namespace ClientAction {\n export class CreateIdentity extends S.TaggedClass<CreateIdentity>()(`${CLIENT_ACTION}/create-identity`, {\n input: S.Struct({\n displayName: S.optional(S.String),\n }),\n output: IdentitySchema,\n }) {}\n\n export class JoinIdentity extends S.TaggedClass<JoinIdentity>()(`${CLIENT_ACTION}/join-identity`, {\n input: S.Struct({\n invitationCode: S.optional(S.String),\n }),\n output: S.Void,\n }) {}\n\n export class ShareIdentity extends S.TaggedClass<ShareIdentity>()(`${CLIENT_ACTION}/share-identity`, {\n input: S.Void,\n output: S.Void,\n }) {}\n\n export class RecoverIdentity extends S.TaggedClass<RecoverIdentity>()(`${CLIENT_ACTION}/recover-identity`, {\n input: S.Void,\n output: S.Void,\n }) {}\n\n export class ResetStorage extends S.TaggedClass<ResetStorage>()(`${CLIENT_ACTION}/reset-storage`, {\n input: S.Struct({\n target: S.optional(S.String),\n }),\n output: S.Void,\n }) {}\n\n export class CreateAgent extends S.TaggedClass<CreateAgent>()(`${CLIENT_ACTION}/create-agent`, {\n input: S.Void,\n output: S.Void,\n }) {}\n\n export class CreateRecoveryCode extends S.TaggedClass<CreateRecoveryCode>()(`${CLIENT_ACTION}/create-recovery-code`, {\n input: S.Void,\n output: S.Void,\n }) {}\n\n export class CreatePasskey extends S.TaggedClass<CreatePasskey>()(`${CLIENT_ACTION}/create-passkey`, {\n input: S.Void,\n output: S.Void,\n }) {}\n\n export class RedeemPasskey extends S.TaggedClass<RedeemPasskey>()(`${CLIENT_ACTION}/redeem-passkey`, {\n input: S.Void,\n output: S.Void,\n }) {}\n}\n\nexport type ClientPluginOptions = ClientOptions & {\n /**\n * Base URL for the invitation link.\n */\n invitationUrl?: string;\n\n /**\n * Query parameter for the invitation code.\n */\n invitationParam?: string;\n\n /**\n * Run after the client has been initialized.\n */\n onClientInitialized?: (context: PluginsContext, client: Client) => MaybePromise<void>;\n\n /**\n * Called when the client is reset.\n */\n onReset?: (params: { target?: string }) => MaybePromise<void>;\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;AAKA,SAASA,SAAS;AAClB,SAAsBC,iBAAqC;AAM3D,IAAMC,iBAAiBC,EAAEC,OAAO;EAC9BC,aAAaF,EAAEG,WAAWC,SAAAA;EAC1BC,UAAUL,EAAEM,SAASN,EAAEG,WAAWC,SAAAA,CAAAA;EAClCG,SAASP,EAAEM,SACTN,EAAEC,OAAO;IACPO,aAAaR,EAAEM,SAASN,EAAES,MAAM;IAChCC,WAAWV,EAAEM,SAASN,EAAES,MAAM;IAC9BE,MAAMX,EAAEM,SAASN,EAAEY,OAAO;MAAEC,KAAKb,EAAES;MAAQK,OAAOd,EAAEe;IAAI,CAAA,CAAA;EAC1D,CAAA,CAAA;AAEJ,CAAA;AAEA,IAAMC,gBAAgB,GAAGC,aAAAA;;UACRC,eAAAA;EACR,MAAMC,uBAAuBnB,EAAEoB,YAAW,EAAmB,GAAGJ,aAAAA,oBAAiC;IACtGK,OAAOrB,EAAEC,OAAO;MACdO,aAAaR,EAAEM,SAASN,EAAES,MAAM;IAClC,CAAA;IACAa,QAAQvB;EACV,CAAA,EAAA;EAAI;gBALSoB,iBAAAA;EAON,MAAMI,qBAAqBvB,EAAEoB,YAAW,EAAiB,GAAGJ,aAAAA,kBAA+B;IAChGK,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ACTH,QAAQtB,EAAEyB;EACZ,CAAA,EAAA;EAAI;gBAHSQ,gBAAAA;AAIf,GAnDiBf,iBAAAA,eAAAA,CAAAA,EAAAA;",
|
|
6
|
+
"names": ["S", "PublicKey", "IdentitySchema", "S", "Struct", "identityKey", "instanceOf", "PublicKey", "spaceKey", "optional", "profile", "displayName", "String", "avatarCid", "data", "Record", "key", "value", "Any", "CLIENT_ACTION", "CLIENT_PLUGIN", "ClientAction", "CreateIdentity", "TaggedClass", "input", "output", "JoinIdentity", "invitationCode", "Void", "ShareIdentity", "RecoverIdentity", "ResetStorage", "target", "CreateAgent", "CreateRecoveryCode", "CreatePasskey", "RedeemPasskey"]
|
|
7
|
+
}
|
|
@@ -7,8 +7,8 @@ import {
|
|
|
7
7
|
import { defineEvent } from "@dxos/app-framework";
|
|
8
8
|
var ClientEvents;
|
|
9
9
|
(function(ClientEvents2) {
|
|
10
|
-
ClientEvents2.SetupClient = defineEvent(`${CLIENT_PLUGIN}/event/setup-client`);
|
|
11
10
|
ClientEvents2.ClientReady = defineEvent(`${CLIENT_PLUGIN}/event/client-ready`);
|
|
11
|
+
ClientEvents2.SetupSchema = defineEvent(`${CLIENT_PLUGIN}/event/setup-schema`);
|
|
12
12
|
ClientEvents2.IdentityCreated = defineEvent(`${CLIENT_PLUGIN}/event/identity-created`);
|
|
13
13
|
ClientEvents2.SpacesReady = defineEvent(`${CLIENT_PLUGIN}/event/spaces-ready`);
|
|
14
14
|
})(ClientEvents || (ClientEvents = {}));
|
|
@@ -16,4 +16,4 @@ var ClientEvents;
|
|
|
16
16
|
export {
|
|
17
17
|
ClientEvents
|
|
18
18
|
};
|
|
19
|
-
//# sourceMappingURL=chunk-
|
|
19
|
+
//# sourceMappingURL=chunk-QR72BXJK.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/events.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { defineEvent } from '@dxos/app-framework';\n\nimport { CLIENT_PLUGIN } from './meta';\n\nexport namespace ClientEvents {\n export const
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { defineEvent } from '@dxos/app-framework';\n\nimport { CLIENT_PLUGIN } from './meta';\n\nexport namespace ClientEvents {\n export const ClientReady = defineEvent(`${CLIENT_PLUGIN}/event/client-ready`);\n export const SetupSchema = defineEvent(`${CLIENT_PLUGIN}/event/setup-schema`);\n export const IdentityCreated = defineEvent(`${CLIENT_PLUGIN}/event/identity-created`);\n export const SpacesReady = defineEvent(`${CLIENT_PLUGIN}/event/spaces-ready`);\n}\n"],
|
|
5
5
|
"mappings": ";;;;;;AAIA,SAASA,mBAAmB;;UAIXC,eAAAA;gBACFC,cAAcC,YAAY,GAAGC,aAAAA,qBAAkC;gBAC/DC,cAAcF,YAAY,GAAGC,aAAAA,qBAAkC;gBAC/DE,kBAAkBH,YAAY,GAAGC,aAAAA,yBAAsC;gBACvEG,cAAcJ,YAAY,GAAGC,aAAAA,qBAAkC;AAC9E,GALiBH,iBAAAA,eAAAA,CAAAA,EAAAA;",
|
|
6
|
-
"names": ["defineEvent", "ClientEvents", "
|
|
6
|
+
"names": ["defineEvent", "ClientEvents", "ClientReady", "defineEvent", "CLIENT_PLUGIN", "SetupSchema", "IdentityCreated", "SpacesReady"]
|
|
7
7
|
}
|
|
@@ -9,10 +9,9 @@ var ClientCapabilities;
|
|
|
9
9
|
(function(ClientCapabilities2) {
|
|
10
10
|
ClientCapabilities2.Client = defineCapability(`${CLIENT_PLUGIN}/capability/client`);
|
|
11
11
|
ClientCapabilities2.Schema = defineCapability(`${CLIENT_PLUGIN}/capability/schema`);
|
|
12
|
-
ClientCapabilities2.SystemSchema = defineCapability(`${CLIENT_PLUGIN}/capability/system-schema`);
|
|
13
12
|
})(ClientCapabilities || (ClientCapabilities = {}));
|
|
14
13
|
|
|
15
14
|
export {
|
|
16
15
|
ClientCapabilities
|
|
17
16
|
};
|
|
18
|
-
//# sourceMappingURL=chunk-
|
|
17
|
+
//# sourceMappingURL=chunk-T35SFKK3.mjs.map
|