@dxos/plugin-client 0.8.1-main.ba2dec9 → 0.8.1-staging.31c3ee1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (176) hide show
  1. package/dist/lib/browser/app-graph-builder-WAS4YZNA.mjs +119 -0
  2. package/dist/lib/browser/app-graph-builder-WAS4YZNA.mjs.map +7 -0
  3. package/dist/lib/browser/{chunk-OLUST5AO.mjs → chunk-4PLF3BEB.mjs} +2 -2
  4. package/dist/lib/browser/{chunk-7DPLXOMO.mjs → chunk-AN7FJKIJ.mjs} +21 -4
  5. package/dist/lib/browser/{chunk-7DPLXOMO.mjs.map → chunk-AN7FJKIJ.mjs.map} +3 -3
  6. package/dist/lib/browser/{chunk-XK4HM5M7.mjs → chunk-BGY6BSUC.mjs} +3 -2
  7. package/dist/lib/browser/{chunk-XK4HM5M7.mjs.map → chunk-BGY6BSUC.mjs.map} +3 -3
  8. package/dist/lib/browser/chunk-CAM6IWZ2.mjs +619 -0
  9. package/dist/lib/browser/chunk-CAM6IWZ2.mjs.map +7 -0
  10. package/dist/lib/browser/{chunk-NHIL4T3L.mjs → chunk-MCEXD5XH.mjs} +1 -1
  11. package/dist/lib/browser/{chunk-NHIL4T3L.mjs.map → chunk-MCEXD5XH.mjs.map} +2 -2
  12. package/dist/lib/browser/{client-UUGITHCW.mjs → client-LV67Q3R7.mjs} +5 -5
  13. package/dist/lib/browser/{client-UUGITHCW.mjs.map → client-LV67Q3R7.mjs.map} +3 -3
  14. package/dist/lib/browser/index.mjs +51 -22
  15. package/dist/lib/browser/index.mjs.map +2 -2
  16. package/dist/lib/browser/{intent-resolver-AIUHL34E.mjs → intent-resolver-JAQCJLKQ.mjs} +65 -27
  17. package/dist/lib/browser/intent-resolver-JAQCJLKQ.mjs.map +7 -0
  18. package/dist/lib/browser/meta.json +1 -1
  19. package/dist/lib/browser/{migrations-XODC625X.mjs → migrations-3DWFOL5Q.mjs} +3 -3
  20. package/dist/lib/browser/{react-context-JBD7Y3SN.mjs → react-context-WEH7SL4I.mjs} +3 -3
  21. package/dist/lib/browser/react-surface-M6Q6RT3Q.mjs +66 -0
  22. package/dist/lib/browser/react-surface-M6Q6RT3Q.mjs.map +7 -0
  23. package/dist/lib/browser/{schema-Y7ZNXYSL.mjs → schema-JQAT6Q7S.mjs} +3 -3
  24. package/dist/lib/browser/types.mjs +4 -2
  25. package/dist/lib/node/app-graph-builder-PXOJZJO5.cjs +130 -0
  26. package/dist/lib/node/app-graph-builder-PXOJZJO5.cjs.map +7 -0
  27. package/dist/lib/node/chunk-ARZVO2AR.cjs +644 -0
  28. package/dist/lib/node/chunk-ARZVO2AR.cjs.map +7 -0
  29. package/dist/lib/node/{chunk-OIFPM5ZW.cjs → chunk-DJKWB5L6.cjs} +4 -4
  30. package/dist/lib/node/{chunk-OIFPM5ZW.cjs.map → chunk-DJKWB5L6.cjs.map} +2 -2
  31. package/dist/lib/node/{chunk-TREVKZCJ.cjs → chunk-FROKBEVH.cjs} +25 -7
  32. package/dist/lib/node/chunk-FROKBEVH.cjs.map +7 -0
  33. package/dist/lib/node/{chunk-FR2K56EV.cjs → chunk-W64EOF2B.cjs} +10 -10
  34. package/dist/lib/node/{chunk-T4K27K2F.cjs → chunk-ZVQIICEN.cjs} +9 -8
  35. package/dist/lib/node/{chunk-T4K27K2F.cjs.map → chunk-ZVQIICEN.cjs.map} +3 -3
  36. package/dist/lib/node/{client-5BHSU35T.cjs → client-BKTGRBYM.cjs} +9 -9
  37. package/dist/lib/node/{client-5BHSU35T.cjs.map → client-BKTGRBYM.cjs.map} +3 -3
  38. package/dist/lib/node/index.cjs +70 -41
  39. package/dist/lib/node/index.cjs.map +2 -2
  40. package/dist/lib/node/{intent-resolver-PWCHHNV3.cjs → intent-resolver-Y73DGA7F.cjs} +81 -44
  41. package/dist/lib/node/intent-resolver-Y73DGA7F.cjs.map +7 -0
  42. package/dist/lib/node/meta.json +1 -1
  43. package/dist/lib/node/{migrations-YCBZUPWO.cjs → migrations-TGNI4FVL.cjs} +8 -8
  44. package/dist/lib/node/{react-context-MPHNGZHT.cjs → react-context-SF3M3YLR.cjs} +8 -8
  45. package/dist/lib/node/{react-surface-TPISDIHR.cjs → react-surface-KWTTP7ZX.cjs} +34 -26
  46. package/dist/lib/node/react-surface-KWTTP7ZX.cjs.map +7 -0
  47. package/dist/lib/node/{schema-NMMCMK64.cjs → schema-INQ72F54.cjs} +8 -8
  48. package/dist/lib/node/types.cjs +5 -3
  49. package/dist/lib/node/types.cjs.map +2 -2
  50. package/dist/lib/node-esm/app-graph-builder-KIN6NWFI.mjs +120 -0
  51. package/dist/lib/node-esm/app-graph-builder-KIN6NWFI.mjs.map +7 -0
  52. package/dist/lib/node-esm/chunk-6WHEPWQD.mjs +620 -0
  53. package/dist/lib/node-esm/chunk-6WHEPWQD.mjs.map +7 -0
  54. package/dist/lib/node-esm/{chunk-QJMF2MWP.mjs → chunk-AD5W5QCQ.mjs} +21 -4
  55. package/dist/lib/node-esm/{chunk-QJMF2MWP.mjs.map → chunk-AD5W5QCQ.mjs.map} +3 -3
  56. package/dist/lib/node-esm/{chunk-XLLNVLWU.mjs → chunk-BP56BGZR.mjs} +2 -2
  57. package/dist/lib/node-esm/{chunk-HO7WDE7C.mjs → chunk-HM7VB4ZV.mjs} +1 -1
  58. package/dist/lib/node-esm/{chunk-HO7WDE7C.mjs.map → chunk-HM7VB4ZV.mjs.map} +2 -2
  59. package/dist/lib/node-esm/{chunk-3OU2ZXLK.mjs → chunk-K3KGGSJZ.mjs} +3 -2
  60. package/dist/lib/node-esm/{chunk-3OU2ZXLK.mjs.map → chunk-K3KGGSJZ.mjs.map} +3 -3
  61. package/dist/lib/node-esm/{client-ZDGFGLX4.mjs → client-QQD6WFOB.mjs} +5 -5
  62. package/dist/lib/node-esm/{client-ZDGFGLX4.mjs.map → client-QQD6WFOB.mjs.map} +3 -3
  63. package/dist/lib/node-esm/index.mjs +51 -22
  64. package/dist/lib/node-esm/index.mjs.map +2 -2
  65. package/dist/lib/node-esm/{intent-resolver-FIXGPH7C.mjs → intent-resolver-K3CA4JRC.mjs} +65 -27
  66. package/dist/lib/node-esm/intent-resolver-K3CA4JRC.mjs.map +7 -0
  67. package/dist/lib/node-esm/meta.json +1 -1
  68. package/dist/lib/node-esm/{migrations-VIEIPYJW.mjs → migrations-IVGATGZR.mjs} +3 -3
  69. package/dist/lib/node-esm/{react-context-KUEOXWWK.mjs → react-context-EAKKTE5A.mjs} +3 -3
  70. package/dist/lib/node-esm/react-surface-ORRNXP2X.mjs +67 -0
  71. package/dist/lib/node-esm/react-surface-ORRNXP2X.mjs.map +7 -0
  72. package/dist/lib/node-esm/{schema-NE5IYLMD.mjs → schema-OK7HY3JJ.mjs} +3 -3
  73. package/dist/lib/node-esm/types.mjs +4 -2
  74. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
  75. package/dist/types/src/capabilities/capabilities.d.ts +1 -0
  76. package/dist/types/src/capabilities/capabilities.d.ts.map +1 -1
  77. package/dist/types/src/capabilities/index.d.ts +4 -4
  78. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  79. package/dist/types/src/capabilities/intent-resolver.d.ts +2 -3
  80. package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
  81. package/dist/types/src/capabilities/react-surface.d.ts +3 -2
  82. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
  83. package/dist/types/src/components/DevicesContainer.d.ts +5 -0
  84. package/dist/types/src/components/DevicesContainer.d.ts.map +1 -0
  85. package/dist/types/src/components/DevicesContainer.stories.d.ts +8 -0
  86. package/dist/types/src/components/DevicesContainer.stories.d.ts.map +1 -0
  87. package/dist/types/src/components/ProfileContainer.d.ts +3 -0
  88. package/dist/types/src/components/ProfileContainer.d.ts.map +1 -0
  89. package/dist/types/src/components/ProfileContainer.stories.d.ts +8 -0
  90. package/dist/types/src/components/ProfileContainer.stories.d.ts.map +1 -0
  91. package/dist/types/src/components/RecoveryCodeDialog.d.ts +1 -1
  92. package/dist/types/src/components/RecoveryCodeDialog.d.ts.map +1 -1
  93. package/dist/types/src/components/RecoveryCredentialsContainer.d.ts +4 -0
  94. package/dist/types/src/components/RecoveryCredentialsContainer.d.ts.map +1 -0
  95. package/dist/types/src/components/RecoveryCredentialsContainer.stories.d.ts +8 -0
  96. package/dist/types/src/components/RecoveryCredentialsContainer.stories.d.ts.map +1 -0
  97. package/dist/types/src/components/ResetDialog.d.ts +7 -0
  98. package/dist/types/src/components/ResetDialog.d.ts.map +1 -0
  99. package/dist/types/src/components/ResetDialog.stories.d.ts +10 -0
  100. package/dist/types/src/components/ResetDialog.stories.d.ts.map +1 -0
  101. package/dist/types/src/components/index.d.ts +4 -2
  102. package/dist/types/src/components/index.d.ts.map +1 -1
  103. package/dist/types/src/meta.d.ts +2 -4
  104. package/dist/types/src/meta.d.ts.map +1 -1
  105. package/dist/types/src/translations.d.ts +28 -1
  106. package/dist/types/src/translations.d.ts.map +1 -1
  107. package/dist/types/src/types.d.ts +17 -1
  108. package/dist/types/src/types.d.ts.map +1 -1
  109. package/package.json +26 -19
  110. package/src/ClientPlugin.ts +2 -2
  111. package/src/capabilities/app-graph-builder.ts +62 -6
  112. package/src/capabilities/capabilities.ts +1 -0
  113. package/src/capabilities/client.ts +1 -1
  114. package/src/capabilities/intent-resolver.ts +68 -23
  115. package/src/capabilities/react-surface.tsx +32 -24
  116. package/src/components/DevicesContainer.stories.tsx +45 -0
  117. package/src/components/DevicesContainer.tsx +268 -0
  118. package/src/components/ProfileContainer.stories.tsx +29 -0
  119. package/src/components/ProfileContainer.tsx +163 -0
  120. package/src/components/RecoveryCodeDialog.stories.tsx +2 -2
  121. package/src/components/RecoveryCodeDialog.tsx +1 -2
  122. package/src/components/{ManageCredentialsDialog.stories.tsx → RecoveryCredentialsContainer.stories.tsx} +4 -17
  123. package/src/components/RecoveryCredentialsContainer.tsx +74 -0
  124. package/src/components/ResetDialog.stories.tsx +47 -0
  125. package/src/components/ResetDialog.tsx +49 -0
  126. package/src/components/index.ts +4 -2
  127. package/src/meta.ts +2 -2
  128. package/src/translations.ts +45 -9
  129. package/src/types.ts +20 -1
  130. package/dist/lib/browser/app-graph-builder-ON64R7SO.mjs +0 -44
  131. package/dist/lib/browser/app-graph-builder-ON64R7SO.mjs.map +0 -7
  132. package/dist/lib/browser/chunk-HNJZ74DZ.mjs +0 -281
  133. package/dist/lib/browser/chunk-HNJZ74DZ.mjs.map +0 -7
  134. package/dist/lib/browser/intent-resolver-AIUHL34E.mjs.map +0 -7
  135. package/dist/lib/browser/react-surface-QGPWIUFR.mjs +0 -57
  136. package/dist/lib/browser/react-surface-QGPWIUFR.mjs.map +0 -7
  137. package/dist/lib/node/app-graph-builder-RW7ESEX3.cjs +0 -58
  138. package/dist/lib/node/app-graph-builder-RW7ESEX3.cjs.map +0 -7
  139. package/dist/lib/node/chunk-TREVKZCJ.cjs.map +0 -7
  140. package/dist/lib/node/chunk-UTG3UR3N.cjs +0 -309
  141. package/dist/lib/node/chunk-UTG3UR3N.cjs.map +0 -7
  142. package/dist/lib/node/intent-resolver-PWCHHNV3.cjs.map +0 -7
  143. package/dist/lib/node/react-surface-TPISDIHR.cjs.map +0 -7
  144. package/dist/lib/node-esm/app-graph-builder-TDYRWNI7.mjs +0 -45
  145. package/dist/lib/node-esm/app-graph-builder-TDYRWNI7.mjs.map +0 -7
  146. package/dist/lib/node-esm/chunk-SHJBU4QR.mjs +0 -282
  147. package/dist/lib/node-esm/chunk-SHJBU4QR.mjs.map +0 -7
  148. package/dist/lib/node-esm/intent-resolver-FIXGPH7C.mjs.map +0 -7
  149. package/dist/lib/node-esm/react-surface-KBROL4VH.mjs +0 -58
  150. package/dist/lib/node-esm/react-surface-KBROL4VH.mjs.map +0 -7
  151. package/dist/types/src/components/IdentityDialog.d.ts +0 -5
  152. package/dist/types/src/components/IdentityDialog.d.ts.map +0 -1
  153. package/dist/types/src/components/ManageCredentialsDialog.d.ts +0 -4
  154. package/dist/types/src/components/ManageCredentialsDialog.d.ts.map +0 -1
  155. package/dist/types/src/components/ManageCredentialsDialog.stories.d.ts +0 -8
  156. package/dist/types/src/components/ManageCredentialsDialog.stories.d.ts.map +0 -1
  157. package/dist/types/src/components/RecoverySetupDialog.d.ts +0 -4
  158. package/dist/types/src/components/RecoverySetupDialog.d.ts.map +0 -1
  159. package/dist/types/src/components/RecoverySetupDialog.stories.d.ts +0 -8
  160. package/dist/types/src/components/RecoverySetupDialog.stories.d.ts.map +0 -1
  161. package/src/components/IdentityDialog.tsx +0 -75
  162. package/src/components/ManageCredentialsDialog.tsx +0 -64
  163. package/src/components/RecoverySetupDialog.stories.tsx +0 -77
  164. package/src/components/RecoverySetupDialog.tsx +0 -52
  165. /package/dist/lib/browser/{chunk-OLUST5AO.mjs.map → chunk-4PLF3BEB.mjs.map} +0 -0
  166. /package/dist/lib/browser/{migrations-XODC625X.mjs.map → migrations-3DWFOL5Q.mjs.map} +0 -0
  167. /package/dist/lib/browser/{react-context-JBD7Y3SN.mjs.map → react-context-WEH7SL4I.mjs.map} +0 -0
  168. /package/dist/lib/browser/{schema-Y7ZNXYSL.mjs.map → schema-JQAT6Q7S.mjs.map} +0 -0
  169. /package/dist/lib/node/{chunk-FR2K56EV.cjs.map → chunk-W64EOF2B.cjs.map} +0 -0
  170. /package/dist/lib/node/{migrations-YCBZUPWO.cjs.map → migrations-TGNI4FVL.cjs.map} +0 -0
  171. /package/dist/lib/node/{react-context-MPHNGZHT.cjs.map → react-context-SF3M3YLR.cjs.map} +0 -0
  172. /package/dist/lib/node/{schema-NMMCMK64.cjs.map → schema-INQ72F54.cjs.map} +0 -0
  173. /package/dist/lib/node-esm/{chunk-XLLNVLWU.mjs.map → chunk-BP56BGZR.mjs.map} +0 -0
  174. /package/dist/lib/node-esm/{migrations-VIEIPYJW.mjs.map → migrations-IVGATGZR.mjs.map} +0 -0
  175. /package/dist/lib/node-esm/{react-context-KUEOXWWK.mjs.map → react-context-EAKKTE5A.mjs.map} +0 -0
  176. /package/dist/lib/node-esm/{schema-NE5IYLMD.mjs.map → schema-OK7HY3JJ.mjs.map} +0 -0
@@ -1,282 +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/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, useTranslation as useTranslation2 } 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 { t } = useTranslation2(CLIENT_PLUGIN);
66
- const handleDone = useCallback(() => dispatch(createIntent2(LayoutAction.UpdateDialog, {
67
- part: "dialog",
68
- options: {
69
- state: false
70
- }
71
- })), [
72
- dispatch
73
- ]);
74
- const handleResetStorage = useCallback(async () => {
75
- await client.reset();
76
- await dispatch(createIntent2(ClientAction.ResetStorage));
77
- }, [
78
- dispatch
79
- ]);
80
- const handleRecover = useCallback(async () => {
81
- await client.reset();
82
- await dispatch(createIntent2(ClientAction.ResetStorage, {
83
- target: "recoverIdentity"
84
- }));
85
- }, [
86
- dispatch
87
- ]);
88
- const handleJoinNewIdentity = useCallback(async () => {
89
- await client.reset();
90
- await dispatch(createIntent2(ClientAction.ResetStorage, {
91
- target: "deviceInvitation"
92
- }));
93
- }, [
94
- dispatch
95
- ]);
96
- const handleManageCredentials = useCallback(async () => {
97
- await dispatch(createIntent2(LayoutAction.UpdateDialog, {
98
- part: "dialog",
99
- subject: MANAGE_CREDENTIALS_DIALOG,
100
- options: {
101
- state: true,
102
- blockAlign: "start"
103
- }
104
- }));
105
- }, [
106
- dispatch
107
- ]);
108
- return /* @__PURE__ */ React2.createElement(Dialog2.Content, null, /* @__PURE__ */ React2.createElement(Dialog2.Title, {
109
- classNames: "sr-only"
110
- }, t("manage profile label", {
111
- ns: "os"
112
- })), /* @__PURE__ */ React2.createElement(Clipboard.Provider, null, /* @__PURE__ */ React2.createElement(IdentityPanel, {
113
- ...props,
114
- doneActionParent: /* @__PURE__ */ React2.createElement(Dialog2.Close, {
115
- asChild: true
116
- }),
117
- onDone: handleDone,
118
- onResetStorage: handleResetStorage,
119
- onRecover: handleRecover,
120
- onJoinNewIdentity: handleJoinNewIdentity,
121
- onManageCredentials: handleManageCredentials
122
- })));
123
- };
124
-
125
- // packages/plugins/plugin-client/src/components/JoinDialog.tsx
126
- import React3, { useCallback as useCallback2 } from "react";
127
- import { createIntent as createIntent3, LayoutAction as LayoutAction2, useIntentDispatcher as useIntentDispatcher3 } from "@dxos/app-framework";
128
- import { ObservabilityAction } from "@dxos/plugin-observability/types";
129
- import { Dialog as Dialog3, useTranslation as useTranslation3 } from "@dxos/react-ui";
130
- import { JoinPanel } from "@dxos/shell/react";
131
- var JOIN_DIALOG = `${CLIENT_PLUGIN}/JoinDialog`;
132
- var JoinDialog = (props) => {
133
- const { dispatchPromise: dispatch } = useIntentDispatcher3();
134
- const { t } = useTranslation3(CLIENT_PLUGIN);
135
- const handleCancelResetStorage = useCallback2(() => dispatch(createIntent3(ClientAction.ShareIdentity)), [
136
- dispatch
137
- ]);
138
- const handleDone = useCallback2(async (result) => {
139
- if (result?.identityKey) {
140
- await Promise.all([
141
- dispatch(createIntent3(LayoutAction2.UpdateDialog, {
142
- part: "dialog",
143
- options: {
144
- state: false
145
- }
146
- })),
147
- dispatch(createIntent3(ObservabilityAction.SendEvent, {
148
- name: props.initialDisposition === "recover-identity" ? "identity.recover" : "identity.join"
149
- }))
150
- ]);
151
- }
152
- }, [
153
- dispatch
154
- ]);
155
- return /* @__PURE__ */ React3.createElement(Dialog3.Content, null, /* @__PURE__ */ React3.createElement(Dialog3.Title, {
156
- classNames: "sr-only"
157
- }, t("join space label", {
158
- ns: "os"
159
- })), /* @__PURE__ */ React3.createElement(JoinPanel, {
160
- mode: "halo-only",
161
- ...props,
162
- exitActionParent: /* @__PURE__ */ React3.createElement(Dialog3.Close, {
163
- asChild: true
164
- }),
165
- doneActionParent: /* @__PURE__ */ React3.createElement(Dialog3.Close, {
166
- asChild: true
167
- }),
168
- onCancelResetStorage: handleCancelResetStorage,
169
- onDone: handleDone
170
- }));
171
- };
172
-
173
- // packages/plugins/plugin-client/src/components/RecoveryCodeDialog.tsx
174
- import React4, { useCallback as useCallback3, useState } from "react";
175
- import { AlertDialog, Button, Clipboard as Clipboard2, Input, useTranslation as useTranslation4 } from "@dxos/react-ui";
176
- var RECOVER_CODE_DIALOG = `${CLIENT_PLUGIN}/RecoveryCodeDialog`;
177
- var RecoveryCodeDialog = ({ code }) => {
178
- const { t } = useTranslation4(CLIENT_PLUGIN);
179
- const [confirmation, setConfirmation] = useState(false);
180
- const handleConfirmation = useCallback3((checked) => setConfirmation(checked), []);
181
- return /* @__PURE__ */ React4.createElement(AlertDialog.Content, {
182
- classNames: "bs-content min-bs-[15rem] max-bs-full md:max-is-[40rem] overflow-hidden"
183
- }, /* @__PURE__ */ React4.createElement(AlertDialog.Title, null, t("recovery code dialog title")), /* @__PURE__ */ React4.createElement("p", {
184
- className: "py-4"
185
- }, t("recovery code dialog description")), /* @__PURE__ */ React4.createElement(Clipboard2.Provider, null, /* @__PURE__ */ React4.createElement(Code, {
186
- code
187
- })), /* @__PURE__ */ React4.createElement("div", {
188
- className: "flex flex-col py-4 gap-2"
189
- }, /* @__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", {
190
- className: "flex items-center gap-2 pbe-4"
191
- }, /* @__PURE__ */ React4.createElement(Input.Root, null, /* @__PURE__ */ React4.createElement(Input.Checkbox, {
192
- "data-testid": "recoveryCode.confirm",
193
- checked: confirmation,
194
- onCheckedChange: handleConfirmation
195
- }), /* @__PURE__ */ React4.createElement(Input.Label, null, t("recovery code confirmation label")))), /* @__PURE__ */ React4.createElement("div", {
196
- className: "flex justify-end"
197
- }, /* @__PURE__ */ React4.createElement(AlertDialog.Action, {
198
- asChild: true
199
- }, /* @__PURE__ */ React4.createElement(Button, {
200
- "data-testid": "recoveryCode.continue",
201
- variant: "primary",
202
- disabled: !confirmation
203
- }, t("continue label")))));
204
- };
205
- var Code = ({ code }) => {
206
- const words = code.split(" ");
207
- return /* @__PURE__ */ React4.createElement("div", {
208
- className: "relative p-2 border border-separator rounded group"
209
- }, /* @__PURE__ */ React4.createElement(Clipboard2.IconButton, {
210
- value: code,
211
- classNames: "absolute top-2 right-2 invisible group-hover:visible"
212
- }), /* @__PURE__ */ React4.createElement("div", {
213
- className: "grid grid-cols-4"
214
- }, words.map((word, i) => /* @__PURE__ */ React4.createElement("div", {
215
- key: i,
216
- className: "flex items-center p-2 gap-2"
217
- }, /* @__PURE__ */ React4.createElement("div", {
218
- className: "w-4 text-xs text-center text-subdued"
219
- }, i + 1), /* @__PURE__ */ React4.createElement("div", {
220
- className: "text-sm"
221
- }, word)))));
222
- };
223
-
224
- // packages/plugins/plugin-client/src/components/RecoverySetupDialog.tsx
225
- import { Key as Key2, Receipt as Receipt2 } from "@phosphor-icons/react";
226
- import React5, { useMemo as useMemo2 } from "react";
227
- import { createIntent as createIntent4, LayoutAction as LayoutAction3, useIntentDispatcher as useIntentDispatcher4 } from "@dxos/app-framework";
228
- import { AlertDialog as AlertDialog2, useTranslation as useTranslation5 } from "@dxos/react-ui";
229
- import { BifurcatedAction as BifurcatedAction2 } from "@dxos/shell/react";
230
- var RECOVER_SETUP_DIALOG = `${CLIENT_PLUGIN}/RecoverySetupDialog`;
231
- var RecoverySetupDialog = () => {
232
- const { t } = useTranslation5(CLIENT_PLUGIN);
233
- const { dispatchPromise: dispatch } = useIntentDispatcher4();
234
- const actions = useMemo2(() => ({
235
- createPasskey: {
236
- label: t("create passkey label"),
237
- description: t("create passkey description"),
238
- // TODO(wittjosiah): Ideally this would be a `user-key` icon.
239
- icon: Key2,
240
- onClick: async () => {
241
- await dispatch(createIntent4(ClientAction.CreatePasskey));
242
- await dispatch(createIntent4(LayoutAction3.UpdateDialog, {
243
- part: "dialog",
244
- options: {
245
- state: false
246
- }
247
- }));
248
- }
249
- },
250
- createRecoveryCode: {
251
- label: t("create recovery code label"),
252
- description: t("create recovery code description"),
253
- icon: Receipt2,
254
- onClick: () => dispatch(createIntent4(ClientAction.CreateRecoveryCode))
255
- }
256
- }), [
257
- t
258
- ]);
259
- return /* @__PURE__ */ React5.createElement(AlertDialog2.Content, {
260
- classNames: "bs-content min-bs-[15rem] max-bs-full md:max-is-[25rem] overflow-hidden"
261
- }, /* @__PURE__ */ React5.createElement(AlertDialog2.Title, null, t("recovery setup dialog title")), /* @__PURE__ */ React5.createElement("p", {
262
- className: "py-4"
263
- }, t("recovery setup dialog description")), /* @__PURE__ */ React5.createElement("div", {
264
- className: "grow"
265
- }), /* @__PURE__ */ React5.createElement(BifurcatedAction2, {
266
- actions
267
- }));
268
- };
269
-
270
- export {
271
- MANAGE_CREDENTIALS_DIALOG,
272
- ManageCredentialsDialog,
273
- IDENTITY_DIALOG,
274
- IdentityDialog,
275
- JOIN_DIALOG,
276
- JoinDialog,
277
- RECOVER_CODE_DIALOG,
278
- RecoveryCodeDialog,
279
- RECOVER_SETUP_DIALOG,
280
- RecoverySetupDialog
281
- };
282
- //# sourceMappingURL=chunk-SHJBU4QR.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/components/ManageCredentialsDialog.tsx", "../../../src/components/IdentityDialog.tsx", "../../../src/components/JoinDialog.tsx", "../../../src/components/RecoveryCodeDialog.tsx", "../../../src/components/RecoverySetupDialog.tsx"],
4
- "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { Receipt, Key } from '@phosphor-icons/react';\nimport React, { useMemo } from 'react';\n\nimport { createIntent, useIntentDispatcher } from '@dxos/app-framework';\nimport { useCredentials } from '@dxos/react-client/halo';\nimport { Dialog, Icon, List, ListItem, useTranslation } from '@dxos/react-ui';\nimport { BifurcatedAction, type ActionMenuItem } from '@dxos/shell/react';\n\nimport { CLIENT_PLUGIN } from '../meta';\nimport { ClientAction } from '../types';\n\nexport const MANAGE_CREDENTIALS_DIALOG = `${CLIENT_PLUGIN}/ManageCredentialsDialog`;\n\n// TODO(wittjosiah): Factor panel out to @dxos/shell.\nexport const ManageCredentialsDialog = () => {\n const { t } = useTranslation(CLIENT_PLUGIN);\n const { dispatchPromise: dispatch } = useIntentDispatcher();\n const credentials = useCredentials();\n const recoveryCredentials = credentials.filter(\n (credential) => credential.subject.assertion['@type'] === 'dxos.halo.credentials.IdentityRecovery',\n );\n\n // TODO(wittjosiah): Reconsile w/ RecoverySetupDialog actions.\n const actions: Record<string, ActionMenuItem> = useMemo(\n () => ({\n createPasskey: {\n label: t('create passkey label'),\n description: t('create passkey description'),\n // TODO(wittjosiah): Ideally this would be a `user-key` icon.\n icon: Key,\n onClick: () => dispatch(createIntent(ClientAction.CreatePasskey)),\n },\n createRecoveryCode: {\n label: t('create recovery code label'),\n description: t('create recovery code description'),\n icon: Receipt,\n onClick: () => dispatch(createIntent(ClientAction.CreateRecoveryCode)),\n },\n }),\n [t],\n );\n\n return (\n <Dialog.Content classNames='bs-content min-bs-[15rem] max-bs-full md:max-is-[25rem] overflow-hidden'>\n <Dialog.Title>{t('manage credentials dialog title')}</Dialog.Title>\n <List classNames='py-4'>\n {recoveryCredentials.map((credential) => (\n <ListItem.Root key={credential.id?.toHex()}>\n <ListItem.Endcap>\n <Icon icon='ph--key--regular' size={5} />\n </ListItem.Endcap>\n <ListItem.Heading>{credential.issuanceDate.toLocaleString()}</ListItem.Heading>\n </ListItem.Root>\n ))}\n </List>\n <div className='grow' />\n <BifurcatedAction actions={actions} />\n </Dialog.Content>\n );\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { useCallback } from 'react';\n\nimport { createIntent, LayoutAction, useIntentDispatcher } from '@dxos/app-framework';\nimport { useClient } from '@dxos/react-client';\nimport { Clipboard, Dialog, useTranslation } from '@dxos/react-ui';\nimport { IdentityPanel, type IdentityPanelProps } from '@dxos/shell/react';\n\nimport { MANAGE_CREDENTIALS_DIALOG } from './ManageCredentialsDialog';\nimport { CLIENT_PLUGIN } from '../meta';\nimport { ClientAction } from '../types';\n\nexport const IDENTITY_DIALOG = `${CLIENT_PLUGIN}/IdentityDialog`;\n\nexport const IdentityDialog = (props: IdentityPanelProps) => {\n const { dispatchPromise: dispatch } = useIntentDispatcher();\n const client = useClient();\n const { t } = useTranslation(CLIENT_PLUGIN);\n\n const handleDone = useCallback(\n () =>\n dispatch(\n createIntent(LayoutAction.UpdateDialog, {\n part: 'dialog',\n options: { state: false },\n }),\n ),\n [dispatch],\n );\n\n const handleResetStorage = useCallback(async () => {\n await client.reset();\n await dispatch(createIntent(ClientAction.ResetStorage));\n }, [dispatch]);\n\n const handleRecover = useCallback(async () => {\n await client.reset();\n await dispatch(createIntent(ClientAction.ResetStorage, { target: 'recoverIdentity' }));\n }, [dispatch]);\n\n const handleJoinNewIdentity = useCallback(async () => {\n await client.reset();\n await dispatch(createIntent(ClientAction.ResetStorage, { target: 'deviceInvitation' }));\n }, [dispatch]);\n\n const handleManageCredentials = useCallback(async () => {\n await dispatch(\n createIntent(LayoutAction.UpdateDialog, {\n part: 'dialog',\n subject: MANAGE_CREDENTIALS_DIALOG,\n options: { state: true, blockAlign: 'start' },\n }),\n );\n }, [dispatch]);\n\n return (\n <Dialog.Content>\n <Dialog.Title classNames='sr-only'>{t('manage profile label', { ns: 'os' })}</Dialog.Title>\n <Clipboard.Provider>\n <IdentityPanel\n {...props}\n doneActionParent={<Dialog.Close asChild />}\n onDone={handleDone}\n onResetStorage={handleResetStorage}\n onRecover={handleRecover}\n onJoinNewIdentity={handleJoinNewIdentity}\n onManageCredentials={handleManageCredentials}\n />\n </Clipboard.Provider>\n </Dialog.Content>\n );\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { useCallback } from 'react';\n\nimport { createIntent, LayoutAction, useIntentDispatcher } from '@dxos/app-framework';\nimport { ObservabilityAction } from '@dxos/plugin-observability/types';\nimport { type InvitationResult } from '@dxos/react-client/invitations';\nimport { Dialog, useTranslation } from '@dxos/react-ui';\nimport { JoinPanel, type JoinPanelProps } from '@dxos/shell/react';\n\nimport { CLIENT_PLUGIN } from '../meta';\nimport { ClientAction } from '../types';\n\nexport const JOIN_DIALOG = `${CLIENT_PLUGIN}/JoinDialog`;\n\nexport const JoinDialog = (props: JoinPanelProps) => {\n const { dispatchPromise: dispatch } = useIntentDispatcher();\n const { t } = useTranslation(CLIENT_PLUGIN);\n\n const handleCancelResetStorage = useCallback(() => dispatch(createIntent(ClientAction.ShareIdentity)), [dispatch]);\n\n const handleDone = useCallback(\n async (result: InvitationResult | null) => {\n if (result?.identityKey) {\n await Promise.all([\n dispatch(createIntent(LayoutAction.UpdateDialog, { part: 'dialog', options: { state: false } })),\n dispatch(\n createIntent(ObservabilityAction.SendEvent, {\n name: props.initialDisposition === 'recover-identity' ? 'identity.recover' : 'identity.join',\n }),\n ),\n ]);\n }\n },\n [dispatch],\n );\n\n return (\n <Dialog.Content>\n <Dialog.Title classNames='sr-only'>{t('join space label', { ns: 'os' })}</Dialog.Title>\n <JoinPanel\n mode='halo-only'\n {...props}\n exitActionParent={<Dialog.Close asChild />}\n doneActionParent={<Dialog.Close asChild />}\n onCancelResetStorage={handleCancelResetStorage}\n onDone={handleDone}\n />\n </Dialog.Content>\n );\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { useCallback, useState } from 'react';\n\nimport { AlertDialog, Button, Clipboard, Input, useTranslation } from '@dxos/react-ui';\n\nimport { CLIENT_PLUGIN } from '../meta';\n\nexport const RECOVER_CODE_DIALOG = `${CLIENT_PLUGIN}/RecoveryCodeDialog`;\n\nexport type RecoveryCodeDialogProps = {\n code: string;\n};\n\n// TODO(wittjosiah): Factor panel out to @dxos/shell.\nexport const RecoveryCodeDialog = ({ code }: RecoveryCodeDialogProps) => {\n const { t } = useTranslation(CLIENT_PLUGIN);\n const [confirmation, setConfirmation] = useState(false);\n\n const handleConfirmation = useCallback((checked: boolean) => setConfirmation(checked), []);\n\n return (\n <AlertDialog.Content classNames='bs-content min-bs-[15rem] max-bs-full md:max-is-[40rem] overflow-hidden'>\n <AlertDialog.Title>{t('recovery code dialog title')}</AlertDialog.Title>\n <p className='py-4'>{t('recovery code dialog description')}</p>\n <Clipboard.Provider>\n <Code code={code} />\n </Clipboard.Provider>\n <div className='flex flex-col py-4 gap-2'>\n <p>{t('recovery code dialog warning 1')}</p>\n <p>{t('recovery code dialog warning 2')}</p>\n </div>\n <div className='flex items-center gap-2 pbe-4'>\n <Input.Root>\n <Input.Checkbox\n data-testid='recoveryCode.confirm'\n checked={confirmation}\n onCheckedChange={handleConfirmation}\n />\n <Input.Label>{t('recovery code confirmation label')}</Input.Label>\n </Input.Root>\n </div>\n <div className='flex justify-end'>\n <AlertDialog.Action asChild>\n <Button data-testid='recoveryCode.continue' variant='primary' disabled={!confirmation}>\n {t('continue label')}\n </Button>\n </AlertDialog.Action>\n </div>\n </AlertDialog.Content>\n );\n};\n\nconst Code = ({ code }: { code: string }) => {\n const words = code.split(' ');\n return (\n <div className='relative p-2 border border-separator rounded group'>\n <Clipboard.IconButton value={code} classNames='absolute top-2 right-2 invisible group-hover:visible' />\n <div className='grid grid-cols-4'>\n {words.map((word, i) => (\n <div key={i} className='flex items-center p-2 gap-2'>\n <div className='w-4 text-xs text-center text-subdued'>{i + 1}</div>\n <div className='text-sm'>{word}</div>\n </div>\n ))}\n </div>\n </div>\n );\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { Key, Receipt } from '@phosphor-icons/react';\nimport React, { useMemo } from 'react';\n\nimport { createIntent, LayoutAction, useIntentDispatcher } from '@dxos/app-framework';\nimport { AlertDialog, useTranslation } from '@dxos/react-ui';\nimport { type ActionMenuItem, BifurcatedAction } from '@dxos/shell/react';\n\nimport { CLIENT_PLUGIN } from '../meta';\nimport { ClientAction } from '../types';\n\nexport const RECOVER_SETUP_DIALOG = `${CLIENT_PLUGIN}/RecoverySetupDialog`;\n\n// TODO(wittjosiah): Factor panel out to @dxos/shell.\nexport const RecoverySetupDialog = () => {\n const { t } = useTranslation(CLIENT_PLUGIN);\n const { dispatchPromise: dispatch } = useIntentDispatcher();\n\n const actions: Record<string, ActionMenuItem> = useMemo(\n () => ({\n createPasskey: {\n label: t('create passkey label'),\n description: t('create passkey description'),\n // TODO(wittjosiah): Ideally this would be a `user-key` icon.\n icon: Key,\n onClick: async () => {\n await dispatch(createIntent(ClientAction.CreatePasskey));\n await dispatch(createIntent(LayoutAction.UpdateDialog, { part: 'dialog', options: { state: false } }));\n },\n },\n createRecoveryCode: {\n label: t('create recovery code label'),\n description: t('create recovery code description'),\n icon: Receipt,\n onClick: () => dispatch(createIntent(ClientAction.CreateRecoveryCode)),\n },\n }),\n [t],\n );\n\n return (\n <AlertDialog.Content classNames='bs-content min-bs-[15rem] max-bs-full md:max-is-[25rem] overflow-hidden'>\n <AlertDialog.Title>{t('recovery setup dialog title')}</AlertDialog.Title>\n <p className='py-4'>{t('recovery setup dialog description')}</p>\n <div className='grow' />\n <BifurcatedAction actions={actions} />\n </AlertDialog.Content>\n );\n};\n"],
5
- "mappings": ";;;;;;;;;AAIA,SAASA,SAASC,WAAW;AAC7B,OAAOC,SAASC,eAAe;AAE/B,SAASC,cAAcC,2BAA2B;AAClD,SAASC,sBAAsB;AAC/B,SAASC,QAAQC,MAAMC,MAAMC,UAAUC,sBA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;AAEtC,QAAMC,UAA0CC,SAC9C,OAAO;IACLC,eAAe;MACbC,OAAOR,EAAE,sBAAA;MACTS,aAAaT,EAAE,4BAAA;;MAEfU,MAAMC;MACNC,SAAS,YAAA;AACP,cAAMT,SAASU,cAAaC,aAAaC,aAAa,CAAA;AACtD,cAAMZ,SAASU,cAAaG,cAAaC,cAAc;UAAEC,MAAM;UAAUC,SAAS;YAAEC,OAAO;UAAM;QAAE,CAAA,CAAA;MACrG;IACF;IACAC,oBAAoB;MAClBb,OAAOR,EAAE,4BAAA;MACTS,aAAaT,EAAE,kCAAA;MACfU,MAAMY;MACNV,SAAS,MAAMT,SAASU,cAAaC,aAAaS,kBAAkB,CAAA;IACtE;EACF,IACA;IAACvB;GAAE;AAGL,SACE,gBAAAwB,OAAA,cAACC,aAAYC,SAAO;IAACC,YAAW;KAC9B,gBAAAH,OAAA,cAACC,aAAYG,OAAK,MAAE5B,EAAE,6BAAA,CAAA,GACtB,gBAAAwB,OAAA,cAACK,KAAAA;IAAEC,WAAU;KAAQ9B,EAAE,mCAAA,CAAA,GACvB,gBAAAwB,OAAA,cAACO,OAAAA;IAAID,WAAU;MACf,gBAAAN,OAAA,cAACQ,mBAAAA;IAAiB3B;;AAGxB;",
6
- "names": ["Receipt", "Key", "React", "useMemo", "createIntent", "useIntentDispatcher", "useCredentials", "Dialog", "Icon", "List", "ListItem", "useTranslation", "BifurcatedAction", "MANAGE_CREDENTIALS_DIALOG", "CLIENT_PLUGIN", "ManageCredentialsDialog", "t", "useTranslation", "dispatchPromise", "dispatch", "useIntentDispatcher", "credentials", "useCredentials", "recoveryCredentials", "filter", "credential", "subject", "assertion", "actions", "useMemo", "createPasskey", "label", "description", "icon", "Key", "onClick", "createIntent", "ClientAction", "CreatePasskey", "createRecoveryCode", "Receipt", "CreateRecoveryCode", "Dialog", "Content", "classNames", "Title", "List", "map", "ListItem", "Root", "key", "id", "toHex", "Endcap", "Icon", "size", "Heading", "issuanceDate", "toLocaleString", "div", "className", "BifurcatedAction", "React", "useCallback", "createIntent", "LayoutAction", "useIntentDispatcher", "useClient", "Clipboard", "Dialog", "useTranslation", "IdentityPanel", "IDENTITY_DIALOG", "CLIENT_PLUGIN", "IdentityDialog", "props", "dispatchPromise", "dispatch", "useIntentDispatcher", "client", "useClient", "t", "useTranslation", "handleDone", "useCallback", "createIntent", "LayoutAction", "UpdateDialog", "part", "options", "state", "handleResetStorage", "reset", "ClientAction", "ResetStorage", "handleRecover", "target", "handleJoinNewIdentity", "handleManageCredentials", "subject", "MANAGE_CREDENTIALS_DIALOG", "blockAlign", "React", "Dialog", "Content", "Title", "classNames", "ns", "Clipboard", "Provider", "IdentityPanel", "doneActionParent", "Close", "asChild", "onDone", "onResetStorage", "onRecover", "onJoinNewIdentity", "onManageCredentials", "React", "useCallback", "createIntent", "LayoutAction", "useIntentDispatcher", "ObservabilityAction", "Dialog", "useTranslation", "JoinPanel", "JOIN_DIALOG", "CLIENT_PLUGIN", "JoinDialog", "props", "dispatchPromise", "dispatch", "useIntentDispatcher", "t", "useTranslation", "handleCancelResetStorage", "useCallback", "createIntent", "ClientAction", "ShareIdentity", "handleDone", "result", "identityKey", "Promise", "all", "LayoutAction", "UpdateDialog", "part", "options", "state", "ObservabilityAction", "SendEvent", "name", "initialDisposition", "React", "Dialog", "Content", "Title", "classNames", "ns", "JoinPanel", "mode", "exitActionParent", "Close", "asChild", "doneActionParent", "onCancelResetStorage", "onDone", "React", "useCallback", "useState", "AlertDialog", "Button", "Clipboard", "Input", "useTranslation", "RECOVER_CODE_DIALOG", "CLIENT_PLUGIN", "RecoveryCodeDialog", "code", "t", "useTranslation", "confirmation", "setConfirmation", "useState", "handleConfirmation", "useCallback", "checked", "React", "AlertDialog", "Content", "classNames", "Title", "p", "className", "Clipboard", "Provider", "Code", "div", "Input", "Root", "Checkbox", "data-testid", "onCheckedChange", "Label", "Action", "asChild", "Button", "variant", "disabled", "words", "split", "IconButton", "value", "map", "word", "i", "key", "Key", "Receipt", "React", "useMemo", "createIntent", "LayoutAction", "useIntentDispatcher", "AlertDialog", "useTranslation", "BifurcatedAction", "RECOVER_SETUP_DIALOG", "CLIENT_PLUGIN", "RecoverySetupDialog", "t", "useTranslation", "dispatchPromise", "dispatch", "useIntentDispatcher", "actions", "useMemo", "createPasskey", "label", "description", "icon", "Key", "onClick", "createIntent", "ClientAction", "CreatePasskey", "LayoutAction", "UpdateDialog", "part", "options", "state", "createRecoveryCode", "Receipt", "CreateRecoveryCode", "React", "AlertDialog", "Content", "classNames", "Title", "p", "className", "div", "BifurcatedAction"]
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/capabilities/intent-resolver.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport {\n Capabilities,\n contributes,\n createIntent,\n createResolver,\n LayoutAction,\n type PluginsContext,\n} from '@dxos/app-framework';\nimport { invariant } from '@dxos/invariant';\nimport { ObservabilityAction } from '@dxos/plugin-observability/types';\nimport { PublicKey } from '@dxos/react-client';\nimport { type JoinPanelProps } from '@dxos/shell/react';\n\nimport { ClientCapabilities } from './capabilities';\nimport { IDENTITY_DIALOG, JOIN_DIALOG, RECOVER_CODE_DIALOG } from '../components';\nimport { ClientEvents } from '../events';\nimport { ClientAction, type ClientPluginOptions } from '../types';\n\ntype IntentResolverOptions = Pick<ClientPluginOptions, 'onReset'> & {\n context: PluginsContext;\n appName?: string;\n};\n\nexport default ({ context, appName = 'Composer', onReset }: IntentResolverOptions) =>\n contributes(Capabilities.IntentResolver, [\n createResolver({\n intent: ClientAction.CreateIdentity,\n resolve: async () => {\n const manager = context.requestCapability(Capabilities.PluginManager);\n const client = context.requestCapability(ClientCapabilities.Client);\n const data = await client.halo.createIdentity();\n await manager.activate(ClientEvents.IdentityCreated);\n return { data, intents: [createIntent(ObservabilityAction.SendEvent, { name: 'identity.create' })] };\n },\n }),\n createResolver({\n intent: ClientAction.JoinIdentity,\n resolve: async (data) => {\n return {\n intents: [\n createIntent(LayoutAction.UpdateDialog, {\n part: 'dialog',\n subject: JOIN_DIALOG,\n options: {\n blockAlign: 'start',\n props: {\n initialInvitationCode: data.invitationCode,\n initialDisposition: 'accept-halo-invitation',\n },\n },\n }),\n ],\n };\n },\n }),\n createResolver({\n intent: ClientAction.ShareIdentity,\n resolve: async () => {\n return {\n intents: [\n createIntent(LayoutAction.UpdateDialog, {\n part: 'dialog',\n subject: IDENTITY_DIALOG,\n options: {\n blockAlign: 'start',\n },\n }),\n createIntent(ObservabilityAction.SendEvent, { name: 'identity.share' }),\n ],\n };\n },\n }),\n createResolver({\n intent: ClientAction.RecoverIdentity,\n resolve: async () => {\n return {\n intents: [\n createIntent(LayoutAction.UpdateDialog, {\n part: 'dialog',\n subject: JOIN_DIALOG,\n options: {\n blockAlign: 'start',\n props: {\n initialDisposition: 'recover-identity',\n } satisfies Partial<JoinPanelProps>,\n },\n }),\n ],\n };\n },\n }),\n createResolver({\n intent: ClientAction.ResetStorage,\n resolve: async (data) => {\n await onReset?.({ target: data.target });\n },\n }),\n createResolver({\n intent: ClientAction.CreateAgent,\n resolve: async () => {\n const client = context.requestCapability(ClientCapabilities.Client);\n invariant(client.services.services.EdgeAgentService, 'Missing EdgeAgentService');\n await client.services.services.EdgeAgentService.createAgent(null as any, { timeout: 10_000 });\n },\n }),\n createResolver({\n intent: ClientAction.CreateRecoveryCode,\n resolve: async () => {\n const client = context.requestCapability(ClientCapabilities.Client);\n invariant(client.services.services.IdentityService, 'IdentityService not available');\n // TODO(wittjosiah): This needs a proper api.\n const { recoveryCode } = await client.services.services.IdentityService.createRecoveryCredential({});\n return {\n intents: [\n createIntent(LayoutAction.UpdateDialog, {\n part: 'dialog',\n subject: RECOVER_CODE_DIALOG,\n options: {\n blockAlign: 'start',\n type: 'alert',\n props: { code: recoveryCode },\n },\n }),\n ],\n };\n },\n }),\n createResolver({\n intent: ClientAction.CreatePasskey,\n resolve: async () => {\n const client = context.requestCapability(ClientCapabilities.Client);\n const identity = client.halo.identity.get();\n invariant(identity, 'Identity not available');\n\n // TODO(wittjosiah): Consider factoring out passkey creation to the halo api.\n const lookupKey = PublicKey.random();\n const credential = await navigator.credentials.create({\n publicKey: {\n challenge: new Uint8Array(),\n rp: { id: location.hostname, name: appName },\n user: {\n id: lookupKey.asUint8Array(),\n name: identity.did,\n displayName: identity.profile?.displayName ?? '',\n },\n pubKeyCredParams: [\n { type: 'public-key', alg: -8 }, // Ed25519 (not yet supported across all browsers)\n { type: 'public-key', alg: -7 }, // ES256\n ],\n // https://web.dev/articles/webauthn-discoverable-credentials#resident-key\n authenticatorSelection: {\n residentKey: 'required',\n requireResidentKey: true,\n },\n },\n });\n\n invariant(credential, 'Credential not available');\n const recoveryKey = PublicKey.from(new Uint8Array((credential as any).response.getPublicKey()));\n const algorithm = (credential as any).response.getPublicKeyAlgorithm() === -7 ? 'ES256' : 'ED25519';\n\n // TODO(wittjosiah): This needs a proper api.\n invariant(client.services.services.IdentityService, 'IdentityService not available');\n await client.services.services.IdentityService.createRecoveryCredential({\n data: {\n recoveryKey,\n algorithm,\n lookupKey,\n },\n });\n },\n }),\n createResolver({\n intent: ClientAction.RedeemPasskey,\n resolve: async () => {\n const client = context.requestCapability(ClientCapabilities.Client);\n // TODO(wittjosiah): This needs a proper api.\n invariant(client.services.services.IdentityService, 'IdentityService not available');\n const { deviceKey, controlFeedKey, challenge } =\n await client.services.services.IdentityService.requestRecoveryChallenge();\n const credential = await navigator.credentials.get({\n publicKey: {\n challenge: Buffer.from(challenge, 'base64'),\n rpId: location.hostname,\n userVerification: 'required',\n },\n });\n const lookupKey = PublicKey.from(new Uint8Array((credential as any).response.userHandle));\n await client.services.services.IdentityService.recoverIdentity({\n external: {\n lookupKey,\n deviceKey,\n controlFeedKey,\n signature: Buffer.from((credential as any).response.signature),\n clientDataJson: Buffer.from((credential as any).response.clientDataJSON),\n authenticatorData: Buffer.from((credential as any).response.authenticatorData),\n },\n });\n },\n }),\n ]);\n"],
5
- "mappings": ";;;;;;;;;;;;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OiC,SAASA,SAASK,gBAAgB+C,gBAAgB;QAC7DC,UAAU;UACRvC;UACA+B;UACAC;UACAQ,WAAWN,OAAOT,KAAMtB,WAAmBuB,SAASc,SAAS;UAC7DC,gBAAgBP,OAAOT,KAAMtB,WAAmBuB,SAASgB,cAAc;UACvEC,mBAAmBT,OAAOT,KAAMtB,WAAmBuB,SAASiB,iBAAiB;QAC/E;MACF,CAAA;IACF;EACF,CAAA;CACD;",
6
- "names": ["Capabilities", "contributes", "createIntent", "createResolver", "LayoutAction", "invariant", "ObservabilityAction", "PublicKey", "context", "appName", "onReset", "contributes", "Capabilities", "IntentResolver", "createResolver", "intent", "ClientAction", "CreateIdentity", "resolve", "manager", "requestCapability", "PluginManager", "client", "ClientCapabilities", "Client", "data", "halo", "createIdentity", "activate", "ClientEvents", "IdentityCreated", "intents", "createIntent", "ObservabilityAction", "SendEvent", "name", "JoinIdentity", "LayoutAction", "UpdateDialog", "part", "subject", "JOIN_DIALOG", "options", "blockAlign", "props", "initialInvitationCode", "invitationCode", "initialDisposition", "ShareIdentity", "IDENTITY_DIALOG", "RecoverIdentity", "ResetStorage", "target", "CreateAgent", "invariant", "services", "EdgeAgentService", "createAgent", "timeout", "CreateRecoveryCode", "IdentityService", "recoveryCode", "createRecoveryCredential", "RECOVER_CODE_DIALOG", "type", "code", "CreatePasskey", "identity", "get", "lookupKey", "PublicKey", "random", "credential", "navigator", "credentials", "create", "publicKey", "challenge", "Uint8Array", "rp", "id", "location", "hostname", "user", "asUint8Array", "did", "displayName", "profile", "pubKeyCredParams", "alg", "authenticatorSelection", "residentKey", "requireResidentKey", "recoveryKey", "from", "response", "getPublicKey", "algorithm", "getPublicKeyAlgorithm", "RedeemPasskey", "deviceKey", "controlFeedKey", "requestRecoveryChallenge", "Buffer", "rpId", "userVerification", "userHandle", "recoverIdentity", "external", "signature", "clientDataJson", "clientDataJSON", "authenticatorData"]
7
- }
@@ -1,58 +0,0 @@
1
- import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
- import {
3
- IDENTITY_DIALOG,
4
- IdentityDialog,
5
- JOIN_DIALOG,
6
- JoinDialog,
7
- MANAGE_CREDENTIALS_DIALOG,
8
- ManageCredentialsDialog,
9
- RECOVER_CODE_DIALOG,
10
- RECOVER_SETUP_DIALOG,
11
- RecoveryCodeDialog,
12
- RecoverySetupDialog
13
- } from "./chunk-SHJBU4QR.mjs";
14
- import "./chunk-QJMF2MWP.mjs";
15
- import "./chunk-HO7WDE7C.mjs";
16
-
17
- // packages/plugins/plugin-client/src/capabilities/react-surface.tsx
18
- import React from "react";
19
- import { createSurface, Capabilities, contributes } from "@dxos/app-framework";
20
- var react_surface_default = ({ createInvitationUrl }) => contributes(Capabilities.ReactSurface, [
21
- createSurface({
22
- id: IDENTITY_DIALOG,
23
- role: "dialog",
24
- filter: (data) => data.component === IDENTITY_DIALOG,
25
- component: ({ data }) => /* @__PURE__ */ React.createElement(IdentityDialog, {
26
- ...data.props,
27
- createInvitationUrl
28
- })
29
- }),
30
- createSurface({
31
- id: JOIN_DIALOG,
32
- role: "dialog",
33
- filter: (data) => data.component === JOIN_DIALOG,
34
- component: ({ data }) => /* @__PURE__ */ React.createElement(JoinDialog, data.props)
35
- }),
36
- createSurface({
37
- id: RECOVER_CODE_DIALOG,
38
- role: "dialog",
39
- filter: (data) => data.component === RECOVER_CODE_DIALOG,
40
- component: ({ data }) => /* @__PURE__ */ React.createElement(RecoveryCodeDialog, data.props)
41
- }),
42
- createSurface({
43
- id: RECOVER_SETUP_DIALOG,
44
- role: "dialog",
45
- filter: (data) => data.component === RECOVER_SETUP_DIALOG,
46
- component: () => /* @__PURE__ */ React.createElement(RecoverySetupDialog, null)
47
- }),
48
- createSurface({
49
- id: MANAGE_CREDENTIALS_DIALOG,
50
- role: "dialog",
51
- filter: (data) => data.component === MANAGE_CREDENTIALS_DIALOG,
52
- component: () => /* @__PURE__ */ React.createElement(ManageCredentialsDialog, null)
53
- })
54
- ]);
55
- export {
56
- react_surface_default as default
57
- };
58
- //# sourceMappingURL=react-surface-KBROL4VH.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,5 +0,0 @@
1
- import React from 'react';
2
- import { type IdentityPanelProps } from '@dxos/shell/react';
3
- export declare const IDENTITY_DIALOG = "dxos.org/plugin/client/IdentityDialog";
4
- export declare const IdentityDialog: (props: IdentityPanelProps) => React.JSX.Element;
5
- //# sourceMappingURL=IdentityDialog.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"IdentityDialog.d.ts","sourceRoot":"","sources":["../../../../src/components/IdentityDialog.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAK3C,OAAO,EAAiB,KAAK,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAM3E,eAAO,MAAM,eAAe,0CAAoC,CAAC;AAEjE,eAAO,MAAM,cAAc,UAAW,kBAAkB,sBAyDvD,CAAC"}
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- export declare const MANAGE_CREDENTIALS_DIALOG = "dxos.org/plugin/client/ManageCredentialsDialog";
3
- export declare const ManageCredentialsDialog: () => React.JSX.Element;
4
- //# sourceMappingURL=ManageCredentialsDialog.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ManageCredentialsDialog.d.ts","sourceRoot":"","sources":["../../../../src/components/ManageCredentialsDialog.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAUvC,eAAO,MAAM,yBAAyB,mDAA6C,CAAC;AAGpF,eAAO,MAAM,uBAAuB,yBA6CnC,CAAC"}
@@ -1,8 +0,0 @@
1
- import '@dxos-theme';
2
- import { type StoryObj, type Meta } from '@storybook/react';
3
- import { ManageCredentialsDialog } from './ManageCredentialsDialog';
4
- declare const meta: Meta;
5
- export default meta;
6
- type Story = StoryObj<typeof ManageCredentialsDialog>;
7
- export declare const Default: Story;
8
- //# sourceMappingURL=ManageCredentialsDialog.stories.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ManageCredentialsDialog.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/ManageCredentialsDialog.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAErB,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAQ5D,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAcpE,QAAA,MAAM,IAAI,EAAE,IAsBX,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAEtD,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC"}
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- export declare const RECOVER_SETUP_DIALOG = "dxos.org/plugin/client/RecoverySetupDialog";
3
- export declare const RecoverySetupDialog: () => React.JSX.Element;
4
- //# sourceMappingURL=RecoverySetupDialog.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"RecoverySetupDialog.d.ts","sourceRoot":"","sources":["../../../../src/components/RecoverySetupDialog.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAkB,MAAM,OAAO,CAAC;AASvC,eAAO,MAAM,oBAAoB,+CAAyC,CAAC;AAG3E,eAAO,MAAM,mBAAmB,yBAkC/B,CAAC"}
@@ -1,8 +0,0 @@
1
- import '@dxos-theme';
2
- import { type StoryObj, type Meta } from '@storybook/react';
3
- import { RecoverySetupDialog } from './RecoverySetupDialog';
4
- declare const meta: Meta;
5
- export default meta;
6
- type Story = StoryObj<typeof RecoverySetupDialog>;
7
- export declare const Default: Story;
8
- //# sourceMappingURL=RecoverySetupDialog.stories.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"RecoverySetupDialog.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/RecoverySetupDialog.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAErB,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAW5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAgB5D,QAAA,MAAM,IAAI,EAAE,IAqCX,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAElD,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC"}
@@ -1,75 +0,0 @@
1
- //
2
- // Copyright 2024 DXOS.org
3
- //
4
-
5
- import React, { useCallback } from 'react';
6
-
7
- import { createIntent, LayoutAction, useIntentDispatcher } from '@dxos/app-framework';
8
- import { useClient } from '@dxos/react-client';
9
- import { Clipboard, Dialog, useTranslation } from '@dxos/react-ui';
10
- import { IdentityPanel, type IdentityPanelProps } from '@dxos/shell/react';
11
-
12
- import { MANAGE_CREDENTIALS_DIALOG } from './ManageCredentialsDialog';
13
- import { CLIENT_PLUGIN } from '../meta';
14
- import { ClientAction } from '../types';
15
-
16
- export const IDENTITY_DIALOG = `${CLIENT_PLUGIN}/IdentityDialog`;
17
-
18
- export const IdentityDialog = (props: IdentityPanelProps) => {
19
- const { dispatchPromise: dispatch } = useIntentDispatcher();
20
- const client = useClient();
21
- const { t } = useTranslation(CLIENT_PLUGIN);
22
-
23
- const handleDone = useCallback(
24
- () =>
25
- dispatch(
26
- createIntent(LayoutAction.UpdateDialog, {
27
- part: 'dialog',
28
- options: { state: false },
29
- }),
30
- ),
31
- [dispatch],
32
- );
33
-
34
- const handleResetStorage = useCallback(async () => {
35
- await client.reset();
36
- await dispatch(createIntent(ClientAction.ResetStorage));
37
- }, [dispatch]);
38
-
39
- const handleRecover = useCallback(async () => {
40
- await client.reset();
41
- await dispatch(createIntent(ClientAction.ResetStorage, { target: 'recoverIdentity' }));
42
- }, [dispatch]);
43
-
44
- const handleJoinNewIdentity = useCallback(async () => {
45
- await client.reset();
46
- await dispatch(createIntent(ClientAction.ResetStorage, { target: 'deviceInvitation' }));
47
- }, [dispatch]);
48
-
49
- const handleManageCredentials = useCallback(async () => {
50
- await dispatch(
51
- createIntent(LayoutAction.UpdateDialog, {
52
- part: 'dialog',
53
- subject: MANAGE_CREDENTIALS_DIALOG,
54
- options: { state: true, blockAlign: 'start' },
55
- }),
56
- );
57
- }, [dispatch]);
58
-
59
- return (
60
- <Dialog.Content>
61
- <Dialog.Title classNames='sr-only'>{t('manage profile label', { ns: 'os' })}</Dialog.Title>
62
- <Clipboard.Provider>
63
- <IdentityPanel
64
- {...props}
65
- doneActionParent={<Dialog.Close asChild />}
66
- onDone={handleDone}
67
- onResetStorage={handleResetStorage}
68
- onRecover={handleRecover}
69
- onJoinNewIdentity={handleJoinNewIdentity}
70
- onManageCredentials={handleManageCredentials}
71
- />
72
- </Clipboard.Provider>
73
- </Dialog.Content>
74
- );
75
- };