@dxos/plugin-client 0.7.5-main.9d26e3a → 0.7.5-main.e9bb01b

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 (134) hide show
  1. package/dist/lib/browser/app-graph-builder-6LOTDB4T.mjs +44 -0
  2. package/dist/lib/browser/app-graph-builder-6LOTDB4T.mjs.map +7 -0
  3. package/dist/lib/browser/{chunk-52IJQ35F.mjs → chunk-E3OUNOEL.mjs} +4 -6
  4. package/dist/lib/browser/chunk-E3OUNOEL.mjs.map +7 -0
  5. package/dist/lib/browser/chunk-MSK3TLIH.mjs +17 -0
  6. package/dist/lib/browser/chunk-MSK3TLIH.mjs.map +7 -0
  7. package/dist/lib/browser/{chunk-X4QUPYC6.mjs → chunk-NHIL4T3L.mjs} +3 -3
  8. package/dist/lib/browser/chunk-NHIL4T3L.mjs.map +7 -0
  9. package/dist/lib/browser/chunk-PDSHZE3P.mjs +162 -0
  10. package/dist/lib/browser/chunk-PDSHZE3P.mjs.map +7 -0
  11. package/dist/lib/browser/chunk-RGMLBYIF.mjs +18 -0
  12. package/dist/lib/browser/chunk-RGMLBYIF.mjs.map +7 -0
  13. package/dist/lib/browser/client-BEJK55IM.mjs +41 -0
  14. package/dist/lib/browser/client-BEJK55IM.mjs.map +7 -0
  15. package/dist/lib/browser/index.mjs +75 -369
  16. package/dist/lib/browser/index.mjs.map +4 -4
  17. package/dist/lib/browser/intent-resolver-XNZZLRBY.mjs +159 -0
  18. package/dist/lib/browser/intent-resolver-XNZZLRBY.mjs.map +7 -0
  19. package/dist/lib/browser/meta.json +1 -1
  20. package/dist/lib/browser/react-context-PHX2CVI7.mjs +24 -0
  21. package/dist/lib/browser/react-context-PHX2CVI7.mjs.map +7 -0
  22. package/dist/lib/browser/react-surface-K5NKVCIB.mjs +41 -0
  23. package/dist/lib/browser/react-surface-K5NKVCIB.mjs.map +7 -0
  24. package/dist/lib/browser/schema-AL34NY2M.mjs +33 -0
  25. package/dist/lib/browser/schema-AL34NY2M.mjs.map +7 -0
  26. package/dist/lib/browser/types.mjs +4 -6
  27. package/dist/lib/node/app-graph-builder-JCND3P6G.cjs +58 -0
  28. package/dist/lib/node/app-graph-builder-JCND3P6G.cjs.map +7 -0
  29. package/dist/lib/node/{chunk-NFO3ADQC.cjs → chunk-NVYWMDF3.cjs} +8 -11
  30. package/dist/lib/node/chunk-NVYWMDF3.cjs.map +7 -0
  31. package/dist/lib/node/{chunk-RUA5KXVW.cjs → chunk-OIFPM5ZW.cjs} +7 -7
  32. package/dist/lib/node/chunk-OIFPM5ZW.cjs.map +7 -0
  33. package/dist/lib/node/chunk-VUJ3ZPK3.cjs +190 -0
  34. package/dist/lib/node/chunk-VUJ3ZPK3.cjs.map +7 -0
  35. package/dist/lib/node/chunk-XPC4JOPP.cjs +37 -0
  36. package/dist/lib/node/chunk-XPC4JOPP.cjs.map +7 -0
  37. package/dist/lib/node/{meta.cjs → chunk-ZI7AV5RP.cjs} +14 -8
  38. package/dist/lib/node/chunk-ZI7AV5RP.cjs.map +7 -0
  39. package/dist/lib/node/client-AHIW24VM.cjs +55 -0
  40. package/dist/lib/node/client-AHIW24VM.cjs.map +7 -0
  41. package/dist/lib/node/index.cjs +72 -358
  42. package/dist/lib/node/index.cjs.map +4 -4
  43. package/dist/lib/node/intent-resolver-UZEK4ODS.cjs +167 -0
  44. package/dist/lib/node/intent-resolver-UZEK4ODS.cjs.map +7 -0
  45. package/dist/lib/node/meta.json +1 -1
  46. package/dist/lib/node/react-context-WMOFXPT4.cjs +48 -0
  47. package/dist/lib/node/react-context-WMOFXPT4.cjs.map +7 -0
  48. package/dist/lib/node/react-surface-YQ2PKXNV.cjs +62 -0
  49. package/dist/lib/node/react-surface-YQ2PKXNV.cjs.map +7 -0
  50. package/dist/lib/node/schema-HW4W3QYU.cjs +49 -0
  51. package/dist/lib/node/schema-HW4W3QYU.cjs.map +7 -0
  52. package/dist/lib/node/types.cjs +4 -6
  53. package/dist/lib/node/types.cjs.map +2 -2
  54. package/dist/lib/node-esm/app-graph-builder-ZLGKFBLY.mjs +45 -0
  55. package/dist/lib/node-esm/app-graph-builder-ZLGKFBLY.mjs.map +7 -0
  56. package/dist/lib/node-esm/{chunk-TI4GNGMM.mjs → chunk-74T33KTB.mjs} +4 -6
  57. package/dist/lib/node-esm/chunk-74T33KTB.mjs.map +7 -0
  58. package/dist/lib/node-esm/chunk-B73LKPGU.mjs +18 -0
  59. package/dist/lib/node-esm/chunk-B73LKPGU.mjs.map +7 -0
  60. package/dist/lib/node-esm/{chunk-GMGRQ5Q7.mjs → chunk-HO7WDE7C.mjs} +3 -3
  61. package/dist/lib/node-esm/chunk-HO7WDE7C.mjs.map +7 -0
  62. package/dist/lib/node-esm/chunk-QR72BXJK.mjs +19 -0
  63. package/dist/lib/node-esm/chunk-QR72BXJK.mjs.map +7 -0
  64. package/dist/lib/node-esm/chunk-WS4CKCUR.mjs +163 -0
  65. package/dist/lib/node-esm/chunk-WS4CKCUR.mjs.map +7 -0
  66. package/dist/lib/node-esm/client-FY7IDNRL.mjs +42 -0
  67. package/dist/lib/node-esm/client-FY7IDNRL.mjs.map +7 -0
  68. package/dist/lib/node-esm/index.mjs +75 -369
  69. package/dist/lib/node-esm/index.mjs.map +4 -4
  70. package/dist/lib/node-esm/intent-resolver-DLCCRSFV.mjs +160 -0
  71. package/dist/lib/node-esm/intent-resolver-DLCCRSFV.mjs.map +7 -0
  72. package/dist/lib/node-esm/meta.json +1 -1
  73. package/dist/lib/node-esm/react-context-EEGDXBWA.mjs +25 -0
  74. package/dist/lib/node-esm/react-context-EEGDXBWA.mjs.map +7 -0
  75. package/dist/lib/node-esm/react-surface-H34XQPWC.mjs +42 -0
  76. package/dist/lib/node-esm/react-surface-H34XQPWC.mjs.map +7 -0
  77. package/dist/lib/node-esm/schema-74LVJ3EU.mjs +34 -0
  78. package/dist/lib/node-esm/schema-74LVJ3EU.mjs.map +7 -0
  79. package/dist/lib/node-esm/types.mjs +4 -6
  80. package/dist/types/src/ClientPlugin.d.ts +2 -3
  81. package/dist/types/src/ClientPlugin.d.ts.map +1 -1
  82. package/dist/types/src/capabilities/app-graph-builder.d.ts +181 -0
  83. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -0
  84. package/dist/types/src/capabilities/capabilities.d.ts +8 -0
  85. package/dist/types/src/capabilities/capabilities.d.ts.map +1 -0
  86. package/dist/types/src/capabilities/client.d.ts +9 -0
  87. package/dist/types/src/capabilities/client.d.ts.map +1 -0
  88. package/dist/types/src/capabilities/index.d.ts +194 -0
  89. package/dist/types/src/capabilities/index.d.ts.map +1 -0
  90. package/dist/types/src/capabilities/intent-resolver.d.ts +8 -0
  91. package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -0
  92. package/dist/types/src/capabilities/react-context.d.ts +8 -0
  93. package/dist/types/src/capabilities/react-context.d.ts.map +1 -0
  94. package/dist/types/src/capabilities/react-surface.d.ts +7 -0
  95. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
  96. package/dist/types/src/capabilities/schema.d.ts +4 -0
  97. package/dist/types/src/capabilities/schema.d.ts.map +1 -0
  98. package/dist/types/src/events.d.ts +7 -0
  99. package/dist/types/src/events.d.ts.map +1 -0
  100. package/dist/types/src/index.d.ts +3 -2
  101. package/dist/types/src/index.d.ts.map +1 -1
  102. package/dist/types/src/meta.d.ts +1 -2
  103. package/dist/types/src/meta.d.ts.map +1 -1
  104. package/dist/types/src/types.d.ts +5 -17
  105. package/dist/types/src/types.d.ts.map +1 -1
  106. package/dist/types/tsconfig.tsbuildinfo +1 -1
  107. package/package.json +17 -23
  108. package/src/ClientPlugin.ts +64 -0
  109. package/src/capabilities/app-graph-builder.ts +39 -0
  110. package/src/capabilities/capabilities.ts +16 -0
  111. package/src/capabilities/client.ts +42 -0
  112. package/src/capabilities/index.ts +14 -0
  113. package/src/capabilities/intent-resolver.ts +130 -0
  114. package/src/capabilities/react-context.tsx +20 -0
  115. package/src/capabilities/react-surface.tsx +44 -0
  116. package/src/capabilities/schema.ts +36 -0
  117. package/src/components/IdentityDialog.tsx +3 -3
  118. package/src/components/JoinDialog.tsx +1 -1
  119. package/src/events.ts +14 -0
  120. package/src/index.ts +4 -4
  121. package/src/meta.ts +1 -1
  122. package/src/types.ts +5 -31
  123. package/dist/lib/browser/chunk-52IJQ35F.mjs.map +0 -7
  124. package/dist/lib/browser/chunk-X4QUPYC6.mjs.map +0 -7
  125. package/dist/lib/browser/meta.mjs +0 -9
  126. package/dist/lib/browser/meta.mjs.map +0 -7
  127. package/dist/lib/node/chunk-NFO3ADQC.cjs.map +0 -7
  128. package/dist/lib/node/chunk-RUA5KXVW.cjs.map +0 -7
  129. package/dist/lib/node/meta.cjs.map +0 -7
  130. package/dist/lib/node-esm/chunk-GMGRQ5Q7.mjs.map +0 -7
  131. package/dist/lib/node-esm/chunk-TI4GNGMM.mjs.map +0 -7
  132. package/dist/lib/node-esm/meta.mjs +0 -10
  133. package/dist/lib/node-esm/meta.mjs.map +0 -7
  134. package/src/ClientPlugin.tsx +0 -227
@@ -0,0 +1,190 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var chunk_VUJ3ZPK3_exports = {};
30
+ __export(chunk_VUJ3ZPK3_exports, {
31
+ IDENTITY_DIALOG: () => IDENTITY_DIALOG,
32
+ IdentityDialog: () => IdentityDialog,
33
+ JOIN_DIALOG: () => JOIN_DIALOG,
34
+ JoinDialog: () => JoinDialog,
35
+ RECOVER_CODE_DIALOG: () => RECOVER_CODE_DIALOG,
36
+ RecoveryCodeDialog: () => RecoveryCodeDialog
37
+ });
38
+ module.exports = __toCommonJS(chunk_VUJ3ZPK3_exports);
39
+ var import_chunk_NVYWMDF3 = require("./chunk-NVYWMDF3.cjs");
40
+ var import_chunk_OIFPM5ZW = require("./chunk-OIFPM5ZW.cjs");
41
+ var import_react = __toESM(require("react"));
42
+ var import_app_framework = require("@dxos/app-framework");
43
+ var import_react_client = require("@dxos/react-client");
44
+ var import_react_ui = require("@dxos/react-ui");
45
+ var import_react2 = require("@dxos/shell/react");
46
+ var import_react3 = __toESM(require("react"));
47
+ var import_app_framework2 = require("@dxos/app-framework");
48
+ var import_types = require("@dxos/plugin-observability/types");
49
+ var import_react_ui2 = require("@dxos/react-ui");
50
+ var import_react4 = require("@dxos/shell/react");
51
+ var import_react5 = __toESM(require("react"));
52
+ var import_react_ui3 = require("@dxos/react-ui");
53
+ var IDENTITY_DIALOG = `${import_chunk_OIFPM5ZW.CLIENT_PLUGIN}/IdentityDialog`;
54
+ var IdentityDialog = (props) => {
55
+ const { dispatchPromise: dispatch } = (0, import_app_framework.useIntentDispatcher)();
56
+ const client = (0, import_react_client.useClient)();
57
+ const handleDone = (0, import_react.useCallback)(() => dispatch((0, import_app_framework.createIntent)(import_app_framework.LayoutAction.UpdateDialog, {
58
+ part: "dialog",
59
+ options: {
60
+ state: false
61
+ }
62
+ })), [
63
+ dispatch
64
+ ]);
65
+ const handleResetStorage = (0, import_react.useCallback)(async () => {
66
+ await client.reset();
67
+ await dispatch((0, import_app_framework.createIntent)(import_chunk_NVYWMDF3.ClientAction.ResetStorage));
68
+ }, [
69
+ dispatch
70
+ ]);
71
+ const handleRecover = (0, import_react.useCallback)(async () => {
72
+ await client.reset();
73
+ await dispatch((0, import_app_framework.createIntent)(import_chunk_NVYWMDF3.ClientAction.ResetStorage, {
74
+ target: "recoverIdentity"
75
+ }));
76
+ }, [
77
+ dispatch
78
+ ]);
79
+ const handleJoinNewIdentity = (0, import_react.useCallback)(async () => {
80
+ await client.reset();
81
+ await dispatch((0, import_app_framework.createIntent)(import_chunk_NVYWMDF3.ClientAction.ResetStorage, {
82
+ target: "deviceInvitation"
83
+ }));
84
+ }, [
85
+ dispatch
86
+ ]);
87
+ return /* @__PURE__ */ import_react.default.createElement(import_react_ui.Dialog.Content, null, /* @__PURE__ */ import_react.default.createElement(import_react_ui.Clipboard.Provider, null, /* @__PURE__ */ import_react.default.createElement(import_react2.IdentityPanel, {
88
+ ...props,
89
+ doneActionParent: /* @__PURE__ */ import_react.default.createElement(import_react_ui.Dialog.Close, {
90
+ asChild: true
91
+ }),
92
+ onDone: handleDone,
93
+ onResetStorage: handleResetStorage,
94
+ onRecover: handleRecover,
95
+ onJoinNewIdentity: handleJoinNewIdentity
96
+ })));
97
+ };
98
+ var JOIN_DIALOG = `${import_chunk_OIFPM5ZW.CLIENT_PLUGIN}/JoinDialog`;
99
+ var JoinDialog = (props) => {
100
+ const { dispatchPromise: dispatch } = (0, import_app_framework2.useIntentDispatcher)();
101
+ const handleCancelResetStorage = (0, import_react3.useCallback)(() => dispatch((0, import_app_framework2.createIntent)(import_chunk_NVYWMDF3.ClientAction.ShareIdentity)), [
102
+ dispatch
103
+ ]);
104
+ const handleDone = (0, import_react3.useCallback)(async (result) => {
105
+ if (result?.identityKey) {
106
+ await Promise.all([
107
+ dispatch((0, import_app_framework2.createIntent)(import_app_framework2.LayoutAction.UpdateDialog, {
108
+ part: "dialog",
109
+ options: {
110
+ state: false
111
+ }
112
+ })),
113
+ dispatch((0, import_app_framework2.createIntent)(import_types.ObservabilityAction.SendEvent, {
114
+ name: props.initialDisposition === "recover-identity" ? "identity.recover" : "identity.join"
115
+ }))
116
+ ]);
117
+ }
118
+ }, [
119
+ dispatch
120
+ ]);
121
+ return /* @__PURE__ */ import_react3.default.createElement(import_react_ui2.Dialog.Content, null, /* @__PURE__ */ import_react3.default.createElement(import_react4.JoinPanel, {
122
+ mode: "halo-only",
123
+ ...props,
124
+ exitActionParent: /* @__PURE__ */ import_react3.default.createElement(import_react_ui2.Dialog.Close, {
125
+ asChild: true
126
+ }),
127
+ doneActionParent: /* @__PURE__ */ import_react3.default.createElement(import_react_ui2.Dialog.Close, {
128
+ asChild: true
129
+ }),
130
+ onCancelResetStorage: handleCancelResetStorage,
131
+ onDone: handleDone
132
+ }));
133
+ };
134
+ var RECOVER_CODE_DIALOG = `${import_chunk_OIFPM5ZW.CLIENT_PLUGIN}/RecoveryCodeDialog`;
135
+ var RecoveryCodeDialog = ({ code }) => {
136
+ const { t } = (0, import_react_ui3.useTranslation)(import_chunk_OIFPM5ZW.CLIENT_PLUGIN);
137
+ const [confirmation, setConfirmation] = (0, import_react5.useState)(false);
138
+ const handleConfirmation = (0, import_react5.useCallback)((checked) => setConfirmation(checked), []);
139
+ return /* @__PURE__ */ import_react5.default.createElement(import_react_ui3.AlertDialog.Content, {
140
+ classNames: "bs-content min-bs-[15rem] max-bs-full md:max-is-[40rem] overflow-hidden"
141
+ }, /* @__PURE__ */ import_react5.default.createElement(import_react_ui3.AlertDialog.Title, null, t("recovery code dialog title")), /* @__PURE__ */ import_react5.default.createElement("p", {
142
+ className: "py-4"
143
+ }, t("recovery code dialog description")), /* @__PURE__ */ import_react5.default.createElement(import_react_ui3.Clipboard.Provider, null, /* @__PURE__ */ import_react5.default.createElement(Code, {
144
+ code
145
+ })), /* @__PURE__ */ import_react5.default.createElement("div", {
146
+ className: "flex flex-col py-4 gap-2"
147
+ }, /* @__PURE__ */ import_react5.default.createElement("p", null, t("recovery code dialog warning 1")), /* @__PURE__ */ import_react5.default.createElement("p", null, t("recovery code dialog warning 2"))), /* @__PURE__ */ import_react5.default.createElement("div", {
148
+ className: "flex items-center gap-2 pbe-4"
149
+ }, /* @__PURE__ */ import_react5.default.createElement(import_react_ui3.Input.Root, null, /* @__PURE__ */ import_react5.default.createElement(import_react_ui3.Input.Checkbox, {
150
+ "data-testid": "recoveryCode.confirm",
151
+ checked: confirmation,
152
+ onCheckedChange: handleConfirmation
153
+ }), /* @__PURE__ */ import_react5.default.createElement(import_react_ui3.Input.Label, null, t("recovery code confirmation label")))), /* @__PURE__ */ import_react5.default.createElement("div", {
154
+ className: "flex justify-end"
155
+ }, /* @__PURE__ */ import_react5.default.createElement(import_react_ui3.AlertDialog.Action, {
156
+ asChild: true
157
+ }, /* @__PURE__ */ import_react5.default.createElement(import_react_ui3.Button, {
158
+ "data-testid": "recoveryCode.continue",
159
+ variant: "primary",
160
+ disabled: !confirmation
161
+ }, t("continue label")))));
162
+ };
163
+ var Code = ({ code }) => {
164
+ const words = code.split(" ");
165
+ return /* @__PURE__ */ import_react5.default.createElement("div", {
166
+ className: "relative p-2 border border-separator rounded group"
167
+ }, /* @__PURE__ */ import_react5.default.createElement(import_react_ui3.Clipboard.IconButton, {
168
+ value: code,
169
+ classNames: "absolute top-2 right-2 invisible group-hover:visible"
170
+ }), /* @__PURE__ */ import_react5.default.createElement("div", {
171
+ className: "grid grid-cols-4"
172
+ }, words.map((word, i) => /* @__PURE__ */ import_react5.default.createElement("div", {
173
+ key: i,
174
+ className: "flex items-center p-2 gap-2 items-center"
175
+ }, /* @__PURE__ */ import_react5.default.createElement("div", {
176
+ className: "w-4 text-xs text-center text-subdued"
177
+ }, i + 1), /* @__PURE__ */ import_react5.default.createElement("div", {
178
+ className: "text-sm"
179
+ }, word)))));
180
+ };
181
+ // Annotate the CommonJS export names for ESM import in node:
182
+ 0 && (module.exports = {
183
+ IDENTITY_DIALOG,
184
+ IdentityDialog,
185
+ JOIN_DIALOG,
186
+ JoinDialog,
187
+ RECOVER_CODE_DIALOG,
188
+ RecoveryCodeDialog
189
+ });
190
+ //# sourceMappingURL=chunk-VUJ3ZPK3.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/components/IdentityDialog.tsx", "../../../src/components/JoinDialog.tsx", "../../../src/components/RecoveryCodeDialog.tsx"],
4
+ "sourcesContent": ["//\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 { 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 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 />\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\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 items-center'>\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"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,mBAAmC;AAEnC,2BAAgE;AAChE,0BAA0B;AAC1B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AAA,cAAC6C,OAAAA;IAAIF,WAAU;KACZa,MAAMI,IAAI,CAACC,MAAMC,MAChB9D,8BAAAA,QAAA,cAAC6C,OAAAA;IAAIkB,KAAKD;IAAGnB,WAAU;KACrB3C,8BAAAA,QAAA,cAAC6C,OAAAA;IAAIF,WAAU;KAAwCmB,IAAI,CAAA,GAC3D9D,8BAAAA,QAAA,cAAC6C,OAAAA;IAAIF,WAAU;KAAWkB,IAAAA,CAAAA,CAAAA,CAAAA,CAAAA;AAMtC;",
6
+ "names": ["import_react", "import_app_framework", "import_react_ui", "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", "React", "Dialog", "Content", "Clipboard", "Provider", "IdentityPanel", "doneActionParent", "Close", "asChild", "onDone", "onResetStorage", "onRecover", "onJoinNewIdentity", "JOIN_DIALOG", "JoinDialog", "handleCancelResetStorage", "ShareIdentity", "result", "identityKey", "Promise", "all", "ObservabilityAction", "SendEvent", "name", "initialDisposition", "JoinPanel", "mode", "exitActionParent", "onCancelResetStorage", "RECOVER_CODE_DIALOG", "RecoveryCodeDialog", "code", "t", "useTranslation", "confirmation", "setConfirmation", "useState", "handleConfirmation", "checked", "AlertDialog", "classNames", "Title", "p", "className", "Code", "div", "Input", "Root", "Checkbox", "data-testid", "onCheckedChange", "Label", "Action", "Button", "variant", "disabled", "words", "split", "IconButton", "value", "map", "word", "i", "key"]
7
+ }
@@ -0,0 +1,37 @@
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 chunk_XPC4JOPP_exports = {};
20
+ __export(chunk_XPC4JOPP_exports, {
21
+ ClientEvents: () => ClientEvents
22
+ });
23
+ module.exports = __toCommonJS(chunk_XPC4JOPP_exports);
24
+ var import_chunk_OIFPM5ZW = require("./chunk-OIFPM5ZW.cjs");
25
+ var import_app_framework = require("@dxos/app-framework");
26
+ var ClientEvents;
27
+ (function(ClientEvents2) {
28
+ ClientEvents2.ClientReady = (0, import_app_framework.defineEvent)(`${import_chunk_OIFPM5ZW.CLIENT_PLUGIN}/event/client-ready`);
29
+ ClientEvents2.SetupSchema = (0, import_app_framework.defineEvent)(`${import_chunk_OIFPM5ZW.CLIENT_PLUGIN}/event/setup-schema`);
30
+ ClientEvents2.IdentityCreated = (0, import_app_framework.defineEvent)(`${import_chunk_OIFPM5ZW.CLIENT_PLUGIN}/event/identity-created`);
31
+ ClientEvents2.SpacesReady = (0, import_app_framework.defineEvent)(`${import_chunk_OIFPM5ZW.CLIENT_PLUGIN}/event/spaces-ready`);
32
+ })(ClientEvents || (ClientEvents = {}));
33
+ // Annotate the CommonJS export names for ESM import in node:
34
+ 0 && (module.exports = {
35
+ ClientEvents
36
+ });
37
+ //# sourceMappingURL=chunk-XPC4JOPP.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/events.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { defineEvent } from '@dxos/app-framework';\n\nimport { CLIENT_PLUGIN } from './meta';\n\nexport namespace ClientEvents {\n export const ClientReady = defineEvent(`${CLIENT_PLUGIN}/event/client-ready`);\n export const SetupSchema = defineEvent(`${CLIENT_PLUGIN}/event/setup-schema`);\n export const IdentityCreated = defineEvent(`${CLIENT_PLUGIN}/event/identity-created`);\n export const SpacesReady = defineEvent(`${CLIENT_PLUGIN}/event/spaces-ready`);\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAIA,2BAA4B;;UAIXA,eAAAA;gBACFC,kBAAcC,kCAAY,GAAGC,mCAAAA,qBAAkC;gBAC/DC,kBAAcF,kCAAY,GAAGC,mCAAAA,qBAAkC;gBAC/DE,sBAAkBH,kCAAY,GAAGC,mCAAAA,yBAAsC;gBACvEG,kBAAcJ,kCAAY,GAAGC,mCAAAA,qBAAkC;AAC9E,GALiBH,iBAAAA,eAAAA,CAAAA,EAAAA;",
6
+ "names": ["ClientEvents", "ClientReady", "defineEvent", "CLIENT_PLUGIN", "SetupSchema", "IdentityCreated", "SpacesReady"]
7
+ }
@@ -16,15 +16,21 @@ var __copyProps = (to, from, except, desc) => {
16
16
  return to;
17
17
  };
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var meta_exports = {};
20
- __export(meta_exports, {
21
- CLIENT_PLUGIN: () => import_chunk_RUA5KXVW.CLIENT_PLUGIN,
22
- default: () => import_chunk_RUA5KXVW.meta_default
19
+ var chunk_ZI7AV5RP_exports = {};
20
+ __export(chunk_ZI7AV5RP_exports, {
21
+ ClientCapabilities: () => ClientCapabilities
23
22
  });
24
- module.exports = __toCommonJS(meta_exports);
25
- var import_chunk_RUA5KXVW = require("./chunk-RUA5KXVW.cjs");
23
+ module.exports = __toCommonJS(chunk_ZI7AV5RP_exports);
24
+ var import_chunk_OIFPM5ZW = require("./chunk-OIFPM5ZW.cjs");
25
+ var import_app_framework = require("@dxos/app-framework");
26
+ var ClientCapabilities;
27
+ (function(ClientCapabilities2) {
28
+ ClientCapabilities2.Client = (0, import_app_framework.defineCapability)(`${import_chunk_OIFPM5ZW.CLIENT_PLUGIN}/capability/client`);
29
+ ClientCapabilities2.Schema = (0, import_app_framework.defineCapability)(`${import_chunk_OIFPM5ZW.CLIENT_PLUGIN}/capability/schema`);
30
+ ClientCapabilities2.SystemSchema = (0, import_app_framework.defineCapability)(`${import_chunk_OIFPM5ZW.CLIENT_PLUGIN}/capability/system-schema`);
31
+ })(ClientCapabilities || (ClientCapabilities = {}));
26
32
  // Annotate the CommonJS export names for ESM import in node:
27
33
  0 && (module.exports = {
28
- CLIENT_PLUGIN
34
+ ClientCapabilities
29
35
  });
30
- //# sourceMappingURL=meta.cjs.map
36
+ //# sourceMappingURL=chunk-ZI7AV5RP.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/capabilities/capabilities.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { defineCapability } from '@dxos/app-framework';\nimport { type TypedObject } from '@dxos/echo-schema';\nimport { type Client } from '@dxos/react-client';\n\nimport { CLIENT_PLUGIN } from '../meta';\n\nexport namespace ClientCapabilities {\n export const Client = defineCapability<Client>(`${CLIENT_PLUGIN}/capability/client`);\n export const Schema = defineCapability<TypedObject[]>(`${CLIENT_PLUGIN}/capability/schema`);\n // TODO(wittjosiah): Rename this. Reserve \"system\" nomenclature for internal use.\n export const SystemSchema = defineCapability<TypedObject[]>(`${CLIENT_PLUGIN}/capability/system-schema`);\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAIA,2BAAiC;;UAMhBA,qBAAAA;sBACFC,aAASC,uCAAyB,GAAGC,mCAAAA,oBAAiC;sBACtEC,aAASF,uCAAgC,GAAGC,mCAAAA,oBAAiC;sBAE7EE,mBAAeH,uCAAgC,GAAGC,mCAAAA,2BAAwC;AACzG,GALiBH,uBAAAA,qBAAAA,CAAAA,EAAAA;",
6
+ "names": ["ClientCapabilities", "Client", "defineCapability", "CLIENT_PLUGIN", "Schema", "SystemSchema"]
7
+ }
@@ -0,0 +1,55 @@
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 client_AHIW24VM_exports = {};
20
+ __export(client_AHIW24VM_exports, {
21
+ default: () => client_default
22
+ });
23
+ module.exports = __toCommonJS(client_AHIW24VM_exports);
24
+ var import_chunk_XPC4JOPP = require("./chunk-XPC4JOPP.cjs");
25
+ var import_chunk_ZI7AV5RP = require("./chunk-ZI7AV5RP.cjs");
26
+ var import_chunk_OIFPM5ZW = require("./chunk-OIFPM5ZW.cjs");
27
+ var import_app_framework = require("@dxos/app-framework");
28
+ var import_config = require("@dxos/config");
29
+ var import_react_client = require("@dxos/react-client");
30
+ var client_default = async ({ context, onClientInitialized, ...options }) => {
31
+ const config = new import_config.Config(await (0, import_config.Storage)(), (0, import_config.Envs)(), (0, import_config.Local)(), (0, import_config.Defaults)());
32
+ const client = new import_react_client.Client({
33
+ config,
34
+ ...options
35
+ });
36
+ await client.initialize();
37
+ await onClientInitialized?.(context, client);
38
+ client.reloaded.on(() => {
39
+ client.halo.identity.subscribe(async (identity) => {
40
+ if (identity) {
41
+ window.location.href = window.location.origin;
42
+ }
43
+ });
44
+ });
45
+ const subscription = client.spaces.isReady.subscribe(async (ready) => {
46
+ if (ready) {
47
+ await context.activate(import_chunk_XPC4JOPP.ClientEvents.SpacesReady);
48
+ }
49
+ });
50
+ return (0, import_app_framework.contributes)(import_chunk_ZI7AV5RP.ClientCapabilities.Client, client, async () => {
51
+ subscription.unsubscribe();
52
+ await client.destroy();
53
+ });
54
+ };
55
+ //# sourceMappingURL=client-AHIW24VM.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/capabilities/client.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { contributes, type PluginsContext } from '@dxos/app-framework';\nimport { Config, Defaults, Envs, Local, Storage } from '@dxos/config';\nimport { Client } from '@dxos/react-client';\n\nimport { ClientCapabilities } from './capabilities';\nimport { ClientEvents } from '../events';\nimport { type ClientPluginOptions } from '../types';\n\ntype ClientCapabilityOptions = Omit<ClientPluginOptions, 'appKey' | 'invitationUrl' | 'invitationParam' | 'onReset'> & {\n context: PluginsContext;\n};\n\nexport default async ({ context, onClientInitialized, ...options }: ClientCapabilityOptions) => {\n const config = new Config(await Storage(), Envs(), Local(), Defaults());\n const client = new Client({ config, ...options });\n await client.initialize();\n await onClientInitialized?.(context, client);\n\n // TODO(wittjosiah): Remove. This is a hack to get the app to boot with the new identity after a reset.\n client.reloaded.on(() => {\n client.halo.identity.subscribe(async (identity) => {\n if (identity) {\n window.location.href = window.location.origin;\n }\n });\n });\n\n const subscription = client.spaces.isReady.subscribe(async (ready) => {\n if (ready) {\n await context.activate(ClientEvents.SpacesReady);\n }\n });\n\n return contributes(ClientCapabilities.Client, client, async () => {\n subscription.unsubscribe();\n await client.destroy();\n });\n};\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,2BAAiD;AACjD,oBAAuD;AACvD,0BAAuB;AAUvB,IAAA,iBAAe,OAAO,EAAEA,SAASC,qBAAqB,GAAGC,QAAAA,MAAkC;AACzF,QAAMC,SAAS,IAAIC,qBAAO,UAAMC,uBAAAA,OAAWC,oBAAAA,OAAQC,qBAAAA,OAASC,wBAAAA,CAAAA;AAC5D,QAAMC,SAAS,IAAIC,2BAAO;IAAEP;IAAQ,GAAGD;EAAQ,CAAA;AAC/C,QAAMO,OAAOE,WAAU;AACvB,QAAMV,sBAAsBD,SAASS,MAAAA;AAGrCA,SAAOG,SAASC,GAAG,MAAA;AACjBJ,WAAOK,KAAKC,SAASC,UAAU,OAAOD,aAAAA;AACpC,UAAIA,UAAU;AACZE,eAAOC,SAASC,OAAOF,OAAOC,SAASE;MACzC;IACF,CAAA;EACF,CAAA;AAEA,QAAMC,eAAeZ,OAAOa,OAAOC,QAAQP,UAAU,OAAOQ,UAAAA;AAC1D,QAAIA,OAAO;AACT,YAAMxB,QAAQyB,SAASC,mCAAaC,WAAW;IACjD;EACF,CAAA;AAEA,aAAOC,kCAAYC,yCAAmBnB,QAAQD,QAAQ,YAAA;AACpDY,iBAAaS,YAAW;AACxB,UAAMrB,OAAOsB,QAAO;EACtB,CAAA;AACF;",
6
+ "names": ["context", "onClientInitialized", "options", "config", "Config", "Storage", "Envs", "Local", "Defaults", "client", "Client", "initialize", "reloaded", "on", "halo", "identity", "subscribe", "window", "location", "href", "origin", "subscription", "spaces", "isReady", "ready", "activate", "ClientEvents", "SpacesReady", "contributes", "ClientCapabilities", "unsubscribe", "destroy"]
7
+ }