@dxos/plugin-client 0.7.5-main.9d26e3a → 0.7.5-main.9d2a38b
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/browser/app-graph-builder-6LOTDB4T.mjs +44 -0
- package/dist/lib/browser/app-graph-builder-6LOTDB4T.mjs.map +7 -0
- package/dist/lib/browser/chunk-6IF6PREG.mjs +158 -0
- package/dist/lib/browser/chunk-6IF6PREG.mjs.map +7 -0
- package/dist/lib/browser/{chunk-52IJQ35F.mjs → chunk-E3OUNOEL.mjs} +4 -6
- package/dist/lib/browser/chunk-E3OUNOEL.mjs.map +7 -0
- package/dist/lib/browser/{chunk-X4QUPYC6.mjs → chunk-NHIL4T3L.mjs} +3 -3
- package/dist/lib/browser/chunk-NHIL4T3L.mjs.map +7 -0
- package/dist/lib/browser/chunk-R4Q6H7RD.mjs +18 -0
- package/dist/lib/browser/chunk-R4Q6H7RD.mjs.map +7 -0
- package/dist/lib/browser/chunk-SVBQRT7I.mjs +17 -0
- package/dist/lib/browser/chunk-SVBQRT7I.mjs.map +7 -0
- package/dist/lib/browser/client-25GYH6TN.mjs +45 -0
- package/dist/lib/browser/client-25GYH6TN.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +69 -369
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/intent-resolver-IWWLWOZD.mjs +132 -0
- package/dist/lib/browser/intent-resolver-IWWLWOZD.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/react-context-M3RT6SSG.mjs +24 -0
- package/dist/lib/browser/react-context-M3RT6SSG.mjs.map +7 -0
- package/dist/lib/browser/react-surface-XXONPG5T.mjs +41 -0
- package/dist/lib/browser/react-surface-XXONPG5T.mjs.map +7 -0
- package/dist/lib/browser/types.mjs +4 -6
- package/dist/lib/node/app-graph-builder-JCND3P6G.cjs +58 -0
- package/dist/lib/node/app-graph-builder-JCND3P6G.cjs.map +7 -0
- package/dist/lib/node/{meta.cjs → chunk-3OB25QN2.cjs} +14 -8
- package/dist/lib/node/chunk-3OB25QN2.cjs.map +7 -0
- package/dist/lib/node/chunk-IXVWJCYB.cjs +37 -0
- package/dist/lib/node/chunk-IXVWJCYB.cjs.map +7 -0
- package/dist/lib/node/chunk-N3U7KVO3.cjs +186 -0
- package/dist/lib/node/chunk-N3U7KVO3.cjs.map +7 -0
- package/dist/lib/node/{chunk-NFO3ADQC.cjs → chunk-NVYWMDF3.cjs} +8 -11
- package/dist/lib/node/chunk-NVYWMDF3.cjs.map +7 -0
- package/dist/lib/node/{chunk-RUA5KXVW.cjs → chunk-OIFPM5ZW.cjs} +7 -7
- package/dist/lib/node/chunk-OIFPM5ZW.cjs.map +7 -0
- package/dist/lib/node/client-52L4TUYU.cjs +59 -0
- package/dist/lib/node/client-52L4TUYU.cjs.map +7 -0
- package/dist/lib/node/index.cjs +66 -358
- package/dist/lib/node/index.cjs.map +4 -4
- package/dist/lib/node/intent-resolver-H3Y64MIP.cjs +140 -0
- package/dist/lib/node/intent-resolver-H3Y64MIP.cjs.map +7 -0
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/react-context-B2DNULH4.cjs +48 -0
- package/dist/lib/node/react-context-B2DNULH4.cjs.map +7 -0
- package/dist/lib/node/react-surface-7USN5NOO.cjs +62 -0
- package/dist/lib/node/react-surface-7USN5NOO.cjs.map +7 -0
- package/dist/lib/node/types.cjs +4 -6
- package/dist/lib/node/types.cjs.map +2 -2
- package/dist/lib/node-esm/app-graph-builder-ZLGKFBLY.mjs +45 -0
- package/dist/lib/node-esm/app-graph-builder-ZLGKFBLY.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-73M5MK5Q.mjs +19 -0
- package/dist/lib/node-esm/chunk-73M5MK5Q.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-TI4GNGMM.mjs → chunk-74T33KTB.mjs} +4 -6
- package/dist/lib/node-esm/chunk-74T33KTB.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-EHGD3UJH.mjs +159 -0
- package/dist/lib/node-esm/chunk-EHGD3UJH.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-GMGRQ5Q7.mjs → chunk-HO7WDE7C.mjs} +3 -3
- package/dist/lib/node-esm/chunk-HO7WDE7C.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-OBGRL3DF.mjs +18 -0
- package/dist/lib/node-esm/chunk-OBGRL3DF.mjs.map +7 -0
- package/dist/lib/node-esm/client-K52NWOUN.mjs +46 -0
- package/dist/lib/node-esm/client-K52NWOUN.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +69 -369
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/intent-resolver-JCKD6R6L.mjs +133 -0
- package/dist/lib/node-esm/intent-resolver-JCKD6R6L.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/react-context-IGEHJQK5.mjs +25 -0
- package/dist/lib/node-esm/react-context-IGEHJQK5.mjs.map +7 -0
- package/dist/lib/node-esm/react-surface-CXLBCMPN.mjs +42 -0
- package/dist/lib/node-esm/react-surface-CXLBCMPN.mjs.map +7 -0
- package/dist/lib/node-esm/types.mjs +4 -6
- package/dist/types/src/ClientPlugin.d.ts +2 -3
- package/dist/types/src/ClientPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts +181 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -0
- package/dist/types/src/capabilities/capabilities.d.ts +8 -0
- package/dist/types/src/capabilities/capabilities.d.ts.map +1 -0
- package/dist/types/src/capabilities/client.d.ts +9 -0
- package/dist/types/src/capabilities/client.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +193 -0
- package/dist/types/src/capabilities/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/intent-resolver.d.ts +8 -0
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-context.d.ts +8 -0
- package/dist/types/src/capabilities/react-context.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface.d.ts +7 -0
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
- package/dist/types/src/events.d.ts +7 -0
- package/dist/types/src/events.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +3 -2
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +1 -2
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/types.d.ts +5 -17
- package/dist/types/src/types.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +15 -22
- package/src/ClientPlugin.ts +59 -0
- package/src/capabilities/app-graph-builder.ts +39 -0
- package/src/capabilities/capabilities.ts +15 -0
- package/src/capabilities/client.ts +48 -0
- package/src/capabilities/index.ts +13 -0
- package/src/capabilities/intent-resolver.ts +101 -0
- package/src/capabilities/react-context.tsx +20 -0
- package/src/capabilities/react-surface.tsx +44 -0
- package/src/events.ts +14 -0
- package/src/index.ts +4 -4
- package/src/meta.ts +1 -1
- package/src/types.ts +5 -31
- package/dist/lib/browser/chunk-52IJQ35F.mjs.map +0 -7
- package/dist/lib/browser/chunk-X4QUPYC6.mjs.map +0 -7
- package/dist/lib/browser/meta.mjs +0 -9
- package/dist/lib/browser/meta.mjs.map +0 -7
- package/dist/lib/node/chunk-NFO3ADQC.cjs.map +0 -7
- package/dist/lib/node/chunk-RUA5KXVW.cjs.map +0 -7
- package/dist/lib/node/meta.cjs.map +0 -7
- package/dist/lib/node-esm/chunk-GMGRQ5Q7.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-TI4GNGMM.mjs.map +0 -7
- package/dist/lib/node-esm/meta.mjs +0 -10
- package/dist/lib/node-esm/meta.mjs.map +0 -7
- package/src/ClientPlugin.tsx +0 -227
|
@@ -1,162 +1,24 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
} from "./chunk-
|
|
2
|
+
ClientEvents
|
|
3
|
+
} from "./chunk-R4Q6H7RD.mjs";
|
|
4
|
+
import {
|
|
5
|
+
ClientCapabilities
|
|
6
|
+
} from "./chunk-SVBQRT7I.mjs";
|
|
4
7
|
import {
|
|
5
8
|
CLIENT_PLUGIN,
|
|
6
|
-
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
|
|
9
|
-
// packages/plugins/plugin-client/src/ClientPlugin.tsx
|
|
10
|
-
import React4 from "react";
|
|
11
|
-
import { LayoutAction as LayoutAction3, parseIntentPlugin, resolvePlugin, createSurface, createIntent as createIntent3, createResolver } from "@dxos/app-framework";
|
|
12
|
-
import { Config, Defaults, Envs, Local, Storage } from "@dxos/config";
|
|
13
|
-
import { registerSignalsRuntime } from "@dxos/echo-signals/react";
|
|
14
|
-
import { invariant } from "@dxos/invariant";
|
|
15
|
-
import { createExtension } from "@dxos/plugin-graph";
|
|
16
|
-
import { ObservabilityAction as ObservabilityAction2 } from "@dxos/plugin-observability/types";
|
|
17
|
-
import { Client, ClientProvider } from "@dxos/react-client";
|
|
9
|
+
meta
|
|
10
|
+
} from "./chunk-NHIL4T3L.mjs";
|
|
18
11
|
|
|
19
|
-
// packages/plugins/plugin-client/src/
|
|
20
|
-
import
|
|
21
|
-
import { createIntent, LayoutAction, useIntentDispatcher } from "@dxos/app-framework";
|
|
22
|
-
import { useClient } from "@dxos/react-client";
|
|
23
|
-
import { Clipboard, Dialog } from "@dxos/react-ui";
|
|
24
|
-
import { IdentityPanel } from "@dxos/shell/react";
|
|
25
|
-
var IDENTITY_DIALOG = `${CLIENT_PLUGIN}/IdentityDialog`;
|
|
26
|
-
var IdentityDialog = (props) => {
|
|
27
|
-
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
28
|
-
const client = useClient();
|
|
29
|
-
const handleDone = useCallback(() => dispatch(createIntent(LayoutAction.SetLayout, {
|
|
30
|
-
element: "dialog",
|
|
31
|
-
state: false
|
|
32
|
-
})), [
|
|
33
|
-
dispatch
|
|
34
|
-
]);
|
|
35
|
-
const handleResetStorage = useCallback(async () => {
|
|
36
|
-
await client.reset();
|
|
37
|
-
await dispatch(createIntent(ClientAction.ResetStorage));
|
|
38
|
-
}, [
|
|
39
|
-
dispatch
|
|
40
|
-
]);
|
|
41
|
-
const handleRecover = useCallback(async () => {
|
|
42
|
-
await client.reset();
|
|
43
|
-
await dispatch(createIntent(ClientAction.ResetStorage, {
|
|
44
|
-
target: "recoverIdentity"
|
|
45
|
-
}));
|
|
46
|
-
}, [
|
|
47
|
-
dispatch
|
|
48
|
-
]);
|
|
49
|
-
const handleJoinNewIdentity = useCallback(async () => {
|
|
50
|
-
await client.reset();
|
|
51
|
-
await dispatch(createIntent(ClientAction.ResetStorage, {
|
|
52
|
-
target: "deviceInvitation"
|
|
53
|
-
}));
|
|
54
|
-
}, [
|
|
55
|
-
dispatch
|
|
56
|
-
]);
|
|
57
|
-
return /* @__PURE__ */ React.createElement(Dialog.Content, null, /* @__PURE__ */ React.createElement(Clipboard.Provider, null, /* @__PURE__ */ React.createElement(IdentityPanel, {
|
|
58
|
-
...props,
|
|
59
|
-
doneActionParent: /* @__PURE__ */ React.createElement(Dialog.Close, {
|
|
60
|
-
asChild: true
|
|
61
|
-
}),
|
|
62
|
-
onDone: handleDone,
|
|
63
|
-
onResetStorage: handleResetStorage,
|
|
64
|
-
onRecover: handleRecover,
|
|
65
|
-
onJoinNewIdentity: handleJoinNewIdentity
|
|
66
|
-
})));
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
// packages/plugins/plugin-client/src/components/JoinDialog.tsx
|
|
70
|
-
import React2, { useCallback as useCallback2 } from "react";
|
|
71
|
-
import { createIntent as createIntent2, LayoutAction as LayoutAction2, useIntentDispatcher as useIntentDispatcher2 } from "@dxos/app-framework";
|
|
72
|
-
import { ObservabilityAction } from "@dxos/plugin-observability/types";
|
|
73
|
-
import { Dialog as Dialog2 } from "@dxos/react-ui";
|
|
74
|
-
import { JoinPanel } from "@dxos/shell/react";
|
|
75
|
-
var JOIN_DIALOG = `${CLIENT_PLUGIN}/JoinDialog`;
|
|
76
|
-
var JoinDialog = (props) => {
|
|
77
|
-
const { dispatchPromise: dispatch } = useIntentDispatcher2();
|
|
78
|
-
const handleCancelResetStorage = useCallback2(() => dispatch(createIntent2(ClientAction.ShareIdentity)), [
|
|
79
|
-
dispatch
|
|
80
|
-
]);
|
|
81
|
-
const handleDone = useCallback2(async (result) => {
|
|
82
|
-
if (result?.identityKey) {
|
|
83
|
-
await Promise.all([
|
|
84
|
-
dispatch(createIntent2(LayoutAction2.SetLayout, {
|
|
85
|
-
element: "dialog",
|
|
86
|
-
state: false
|
|
87
|
-
})),
|
|
88
|
-
dispatch(createIntent2(ObservabilityAction.SendEvent, {
|
|
89
|
-
name: props.initialDisposition === "recover-identity" ? "identity.recover" : "identity.join"
|
|
90
|
-
}))
|
|
91
|
-
]);
|
|
92
|
-
}
|
|
93
|
-
}, [
|
|
94
|
-
dispatch
|
|
95
|
-
]);
|
|
96
|
-
return /* @__PURE__ */ React2.createElement(Dialog2.Content, null, /* @__PURE__ */ React2.createElement(JoinPanel, {
|
|
97
|
-
mode: "halo-only",
|
|
98
|
-
...props,
|
|
99
|
-
exitActionParent: /* @__PURE__ */ React2.createElement(Dialog2.Close, {
|
|
100
|
-
asChild: true
|
|
101
|
-
}),
|
|
102
|
-
doneActionParent: /* @__PURE__ */ React2.createElement(Dialog2.Close, {
|
|
103
|
-
asChild: true
|
|
104
|
-
}),
|
|
105
|
-
onCancelResetStorage: handleCancelResetStorage,
|
|
106
|
-
onDone: handleDone
|
|
107
|
-
}));
|
|
108
|
-
};
|
|
12
|
+
// packages/plugins/plugin-client/src/ClientPlugin.ts
|
|
13
|
+
import { Capabilities, contributes, defineModule, definePlugin, Events } from "@dxos/app-framework";
|
|
109
14
|
|
|
110
|
-
// packages/plugins/plugin-client/src/
|
|
111
|
-
import
|
|
112
|
-
|
|
113
|
-
var
|
|
114
|
-
var
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
const handleConfirmation = useCallback3((checked) => setConfirmation(checked), []);
|
|
118
|
-
return /* @__PURE__ */ React3.createElement(AlertDialog.Content, {
|
|
119
|
-
classNames: "bs-content min-bs-[15rem] max-bs-full md:max-is-[40rem] overflow-hidden"
|
|
120
|
-
}, /* @__PURE__ */ React3.createElement(AlertDialog.Title, null, t("recovery code dialog title")), /* @__PURE__ */ React3.createElement("p", {
|
|
121
|
-
className: "py-4"
|
|
122
|
-
}, t("recovery code dialog description")), /* @__PURE__ */ React3.createElement(Clipboard2.Provider, null, /* @__PURE__ */ React3.createElement(Code, {
|
|
123
|
-
code
|
|
124
|
-
})), /* @__PURE__ */ React3.createElement("div", {
|
|
125
|
-
className: "flex flex-col py-4 gap-2"
|
|
126
|
-
}, /* @__PURE__ */ React3.createElement("p", null, t("recovery code dialog warning 1")), /* @__PURE__ */ React3.createElement("p", null, t("recovery code dialog warning 2"))), /* @__PURE__ */ React3.createElement("div", {
|
|
127
|
-
className: "flex items-center gap-2 pbe-4"
|
|
128
|
-
}, /* @__PURE__ */ React3.createElement(Input.Root, null, /* @__PURE__ */ React3.createElement(Input.Checkbox, {
|
|
129
|
-
"data-testid": "recoveryCode.confirm",
|
|
130
|
-
checked: confirmation,
|
|
131
|
-
onCheckedChange: handleConfirmation
|
|
132
|
-
}), /* @__PURE__ */ React3.createElement(Input.Label, null, t("recovery code confirmation label")))), /* @__PURE__ */ React3.createElement("div", {
|
|
133
|
-
className: "flex justify-end"
|
|
134
|
-
}, /* @__PURE__ */ React3.createElement(AlertDialog.Action, {
|
|
135
|
-
asChild: true
|
|
136
|
-
}, /* @__PURE__ */ React3.createElement(Button, {
|
|
137
|
-
"data-testid": "recoveryCode.continue",
|
|
138
|
-
variant: "primary",
|
|
139
|
-
disabled: !confirmation
|
|
140
|
-
}, t("continue label")))));
|
|
141
|
-
};
|
|
142
|
-
var Code = ({ code }) => {
|
|
143
|
-
const words = code.split(" ");
|
|
144
|
-
return /* @__PURE__ */ React3.createElement("div", {
|
|
145
|
-
className: "relative p-2 border border-separator rounded group"
|
|
146
|
-
}, /* @__PURE__ */ React3.createElement(Clipboard2.IconButton, {
|
|
147
|
-
value: code,
|
|
148
|
-
classNames: "absolute top-2 right-2 invisible group-hover:visible"
|
|
149
|
-
}), /* @__PURE__ */ React3.createElement("div", {
|
|
150
|
-
className: "grid grid-cols-4"
|
|
151
|
-
}, words.map((word, i) => /* @__PURE__ */ React3.createElement("div", {
|
|
152
|
-
key: i,
|
|
153
|
-
className: "flex items-center p-2 gap-2 items-center"
|
|
154
|
-
}, /* @__PURE__ */ React3.createElement("div", {
|
|
155
|
-
className: "w-4 text-xs text-center text-subdued"
|
|
156
|
-
}, i + 1), /* @__PURE__ */ React3.createElement("div", {
|
|
157
|
-
className: "text-sm"
|
|
158
|
-
}, word)))));
|
|
159
|
-
};
|
|
15
|
+
// packages/plugins/plugin-client/src/capabilities/index.ts
|
|
16
|
+
import { lazy } from "@dxos/app-framework";
|
|
17
|
+
var AppGraphBuilder = lazy(async () => import("./app-graph-builder-6LOTDB4T.mjs"));
|
|
18
|
+
var Client = lazy(async () => import("./client-25GYH6TN.mjs"));
|
|
19
|
+
var IntentResolver = lazy(async () => import("./intent-resolver-IWWLWOZD.mjs"));
|
|
20
|
+
var ReactContext = lazy(async () => import("./react-context-M3RT6SSG.mjs"));
|
|
21
|
+
var ReactSurface = lazy(async () => import("./react-surface-XXONPG5T.mjs"));
|
|
160
22
|
|
|
161
23
|
// packages/plugins/plugin-client/src/translations.ts
|
|
162
24
|
var translations_default = [
|
|
@@ -175,227 +37,65 @@ var translations_default = [
|
|
|
175
37
|
}
|
|
176
38
|
];
|
|
177
39
|
|
|
178
|
-
// packages/plugins/plugin-client/src/ClientPlugin.
|
|
179
|
-
var
|
|
180
|
-
|
|
181
|
-
registerSignalsRuntime();
|
|
182
|
-
let client;
|
|
183
|
-
let error = null;
|
|
184
|
-
const createDeviceInvitationUrl = (invitationCode) => {
|
|
40
|
+
// packages/plugins/plugin-client/src/ClientPlugin.ts
|
|
41
|
+
var ClientPlugin = ({ invitationUrl = window.location.origin, invitationParam = "deviceInvitationCode", onReset, ...options }) => {
|
|
42
|
+
const createInvitationUrl = (invitationCode) => {
|
|
185
43
|
const baseUrl = new URL(invitationUrl);
|
|
186
44
|
baseUrl.searchParams.set(invitationParam, invitationCode);
|
|
187
45
|
return baseUrl.toString();
|
|
188
46
|
};
|
|
189
|
-
return
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
...data.subject,
|
|
236
|
-
createInvitationUrl: createDeviceInvitationUrl
|
|
237
|
-
})
|
|
238
|
-
}),
|
|
239
|
-
createSurface({
|
|
240
|
-
id: JOIN_DIALOG,
|
|
241
|
-
role: "dialog",
|
|
242
|
-
filter: (data) => data.component === JOIN_DIALOG,
|
|
243
|
-
component: ({ data }) => /* @__PURE__ */ React4.createElement(JoinDialog, data.subject)
|
|
244
|
-
}),
|
|
245
|
-
createSurface({
|
|
246
|
-
id: RECOVER_CODE_DIALOG,
|
|
247
|
-
role: "dialog",
|
|
248
|
-
filter: (data) => data.component === RECOVER_CODE_DIALOG,
|
|
249
|
-
component: ({ data }) => /* @__PURE__ */ React4.createElement(RecoveryCodeDialog, data.subject)
|
|
250
|
-
})
|
|
251
|
-
]
|
|
252
|
-
},
|
|
253
|
-
graph: {
|
|
254
|
-
builder: (plugins) => {
|
|
255
|
-
const dispatch = resolvePlugin(plugins, parseIntentPlugin)?.provides.intent.dispatchPromise;
|
|
256
|
-
const id = `${CLIENT_PLUGIN}/open-shell`;
|
|
257
|
-
return createExtension({
|
|
258
|
-
id: CLIENT_PLUGIN,
|
|
259
|
-
filter: (node) => node.id === "root",
|
|
260
|
-
actions: () => [
|
|
261
|
-
{
|
|
262
|
-
id,
|
|
263
|
-
data: async () => {
|
|
264
|
-
await dispatch?.(createIntent3(ClientAction.ShareIdentity));
|
|
265
|
-
},
|
|
266
|
-
properties: {
|
|
267
|
-
label: [
|
|
268
|
-
"open shell label",
|
|
269
|
-
{
|
|
270
|
-
ns: CLIENT_PLUGIN
|
|
271
|
-
}
|
|
272
|
-
],
|
|
273
|
-
icon: "ph--address-book--regular",
|
|
274
|
-
keyBinding: {
|
|
275
|
-
macos: "meta+shift+.",
|
|
276
|
-
// TODO(wittjosiah): Test on windows to see if it behaves the same as linux.
|
|
277
|
-
windows: "alt+shift+.",
|
|
278
|
-
linux: "alt+shift+>"
|
|
279
|
-
},
|
|
280
|
-
testId: "clientPlugin.openShell"
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
]
|
|
284
|
-
});
|
|
285
|
-
}
|
|
286
|
-
},
|
|
287
|
-
intent: {
|
|
288
|
-
resolvers: () => [
|
|
289
|
-
createResolver(ClientAction.CreateIdentity, async () => {
|
|
290
|
-
const data = await client.halo.createIdentity();
|
|
291
|
-
return {
|
|
292
|
-
data,
|
|
293
|
-
intents: [
|
|
294
|
-
createIntent3(ObservabilityAction2.SendEvent, {
|
|
295
|
-
name: "identity.create"
|
|
296
|
-
})
|
|
297
|
-
]
|
|
298
|
-
};
|
|
299
|
-
}),
|
|
300
|
-
createResolver(ClientAction.JoinIdentity, async (data) => {
|
|
301
|
-
return {
|
|
302
|
-
intents: [
|
|
303
|
-
createIntent3(LayoutAction3.SetLayout, {
|
|
304
|
-
element: "dialog",
|
|
305
|
-
component: JOIN_DIALOG,
|
|
306
|
-
dialogBlockAlign: "start",
|
|
307
|
-
subject: {
|
|
308
|
-
initialInvitationCode: data.invitationCode,
|
|
309
|
-
initialDisposition: "accept-halo-invitation"
|
|
310
|
-
}
|
|
311
|
-
})
|
|
312
|
-
]
|
|
313
|
-
};
|
|
314
|
-
}),
|
|
315
|
-
createResolver(ClientAction.ShareIdentity, async () => {
|
|
316
|
-
return {
|
|
317
|
-
intents: [
|
|
318
|
-
createIntent3(LayoutAction3.SetLayout, {
|
|
319
|
-
element: "dialog",
|
|
320
|
-
component: IDENTITY_DIALOG,
|
|
321
|
-
dialogBlockAlign: "start"
|
|
322
|
-
}),
|
|
323
|
-
createIntent3(ObservabilityAction2.SendEvent, {
|
|
324
|
-
name: "identity.share"
|
|
325
|
-
})
|
|
326
|
-
]
|
|
327
|
-
};
|
|
328
|
-
}),
|
|
329
|
-
createResolver(ClientAction.RecoverIdentity, async () => {
|
|
330
|
-
return {
|
|
331
|
-
intents: [
|
|
332
|
-
createIntent3(LayoutAction3.SetLayout, {
|
|
333
|
-
element: "dialog",
|
|
334
|
-
component: JOIN_DIALOG,
|
|
335
|
-
dialogBlockAlign: "start",
|
|
336
|
-
subject: {
|
|
337
|
-
initialDisposition: "recover-identity"
|
|
338
|
-
}
|
|
339
|
-
})
|
|
340
|
-
]
|
|
341
|
-
};
|
|
342
|
-
}),
|
|
343
|
-
createResolver(ClientAction.ResetStorage, async (data) => {
|
|
344
|
-
await onReset?.({
|
|
345
|
-
target: data.target
|
|
346
|
-
});
|
|
347
|
-
return {};
|
|
348
|
-
}),
|
|
349
|
-
createResolver(ClientAction.CreateAgent, async () => {
|
|
350
|
-
invariant(client.services.services.EdgeAgentService, "Missing EdgeAgentService", {
|
|
351
|
-
F: __dxlog_file,
|
|
352
|
-
L: 203,
|
|
353
|
-
S: void 0,
|
|
354
|
-
A: [
|
|
355
|
-
"client.services.services.EdgeAgentService",
|
|
356
|
-
"'Missing EdgeAgentService'"
|
|
357
|
-
]
|
|
358
|
-
});
|
|
359
|
-
await client.services.services.EdgeAgentService.createAgent(null, {
|
|
360
|
-
timeout: 1e4
|
|
361
|
-
});
|
|
362
|
-
}),
|
|
363
|
-
createResolver(ClientAction.CreateRecoveryCode, async () => {
|
|
364
|
-
invariant(client.services.services.IdentityService, "IdentityService not available", {
|
|
365
|
-
F: __dxlog_file,
|
|
366
|
-
L: 207,
|
|
367
|
-
S: void 0,
|
|
368
|
-
A: [
|
|
369
|
-
"client.services.services.IdentityService",
|
|
370
|
-
"'IdentityService not available'"
|
|
371
|
-
]
|
|
372
|
-
});
|
|
373
|
-
const { seedphrase } = await client.services.services.IdentityService.createRecoveryPhrase();
|
|
374
|
-
return {
|
|
375
|
-
intents: [
|
|
376
|
-
createIntent3(LayoutAction3.SetLayout, {
|
|
377
|
-
element: "dialog",
|
|
378
|
-
dialogBlockAlign: "start",
|
|
379
|
-
dialogType: "alert",
|
|
380
|
-
state: true,
|
|
381
|
-
component: RECOVER_CODE_DIALOG,
|
|
382
|
-
subject: {
|
|
383
|
-
code: seedphrase
|
|
384
|
-
}
|
|
385
|
-
})
|
|
386
|
-
]
|
|
387
|
-
};
|
|
388
|
-
})
|
|
389
|
-
]
|
|
390
|
-
}
|
|
391
|
-
}
|
|
392
|
-
};
|
|
47
|
+
return definePlugin(meta, [
|
|
48
|
+
defineModule({
|
|
49
|
+
id: `${meta.id}/module/client`,
|
|
50
|
+
activatesOn: Events.Startup,
|
|
51
|
+
activatesBefore: [
|
|
52
|
+
ClientEvents.SetupClient
|
|
53
|
+
],
|
|
54
|
+
activatesAfter: [
|
|
55
|
+
ClientEvents.ClientReady
|
|
56
|
+
],
|
|
57
|
+
activate: (context) => Client({
|
|
58
|
+
...options,
|
|
59
|
+
context
|
|
60
|
+
})
|
|
61
|
+
}),
|
|
62
|
+
defineModule({
|
|
63
|
+
id: `${meta.id}/module/react-context`,
|
|
64
|
+
activatesOn: Events.Startup,
|
|
65
|
+
activate: ReactContext
|
|
66
|
+
}),
|
|
67
|
+
defineModule({
|
|
68
|
+
id: `${meta.id}/module/react-surface`,
|
|
69
|
+
activatesOn: Events.Startup,
|
|
70
|
+
activate: () => ReactSurface({
|
|
71
|
+
createInvitationUrl
|
|
72
|
+
})
|
|
73
|
+
}),
|
|
74
|
+
defineModule({
|
|
75
|
+
id: `${meta.id}/module/app-graph-builder`,
|
|
76
|
+
activatesOn: Events.SetupAppGraph,
|
|
77
|
+
activate: AppGraphBuilder
|
|
78
|
+
}),
|
|
79
|
+
defineModule({
|
|
80
|
+
id: `${meta.id}/module/intent-resolver`,
|
|
81
|
+
activatesOn: Events.SetupIntents,
|
|
82
|
+
activate: (context) => IntentResolver({
|
|
83
|
+
context,
|
|
84
|
+
onReset
|
|
85
|
+
})
|
|
86
|
+
}),
|
|
87
|
+
defineModule({
|
|
88
|
+
id: `${meta.id}/module/translations`,
|
|
89
|
+
activatesOn: Events.SetupTranslations,
|
|
90
|
+
activate: () => contributes(Capabilities.Translations, translations_default)
|
|
91
|
+
})
|
|
92
|
+
]);
|
|
393
93
|
};
|
|
394
|
-
|
|
395
|
-
// packages/plugins/plugin-client/src/index.ts
|
|
396
|
-
var src_default = ClientPlugin;
|
|
397
94
|
export {
|
|
95
|
+
CLIENT_PLUGIN,
|
|
96
|
+
ClientCapabilities,
|
|
97
|
+
ClientEvents,
|
|
398
98
|
ClientPlugin,
|
|
399
|
-
|
|
99
|
+
meta
|
|
400
100
|
};
|
|
401
101
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../src/ClientPlugin.
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport React from 'react';\n\nimport {\n LayoutAction,\n parseIntentPlugin,\n resolvePlugin,\n type PluginDefinition,\n createSurface,\n createIntent,\n createResolver,\n} from '@dxos/app-framework';\nimport { Config, Defaults, Envs, Local, Storage } from '@dxos/config';\nimport { registerSignalsRuntime } from '@dxos/echo-signals/react';\nimport { invariant } from '@dxos/invariant';\nimport { createExtension, type Node } from '@dxos/plugin-graph';\nimport { ObservabilityAction } from '@dxos/plugin-observability/types';\nimport { Client, ClientProvider } from '@dxos/react-client';\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 RecoveryCodeDialog,\n type RecoveryCodeDialogProps,\n} from './components';\nimport meta, { CLIENT_PLUGIN } from './meta';\nimport translations from './translations';\nimport { ClientAction, type ClientPluginOptions, type ClientPluginProvides } from './types';\n\nexport const ClientPlugin = ({\n appKey,\n invitationUrl = window.location.origin,\n invitationParam = 'deviceInvitationCode',\n onClientInitialized,\n onReady,\n onReset,\n ...options\n}: ClientPluginOptions): PluginDefinition<\n Omit<ClientPluginProvides, 'client'>,\n Pick<ClientPluginProvides, 'client'>\n> => {\n registerSignalsRuntime();\n\n let client: Client;\n let error: unknown = null;\n\n const createDeviceInvitationUrl = (invitationCode: string) => {\n const baseUrl = new URL(invitationUrl);\n baseUrl.searchParams.set(invitationParam, invitationCode);\n return baseUrl.toString();\n };\n\n return {\n meta,\n initialize: async () => {\n const config = new Config(await Storage(), Envs(), Local(), Defaults());\n client = new Client({ config, ...options });\n\n try {\n await client.initialize();\n await onClientInitialized?.(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 } catch (err) {\n error = err;\n }\n\n return {\n client,\n context: ({ children }) => <ClientProvider client={client}>{children}</ClientProvider>,\n };\n },\n ready: async ({ plugins }) => {\n if (error) {\n throw error;\n }\n\n await onReady?.(client, plugins);\n },\n unload: async () => {\n await client.destroy();\n },\n provides: {\n translations,\n surface: {\n definitions: () => [\n createSurface({\n id: IDENTITY_DIALOG,\n role: 'dialog',\n filter: (data): data is { subject: IdentityPanelProps } => data.component === IDENTITY_DIALOG,\n component: ({ data }) => (\n <IdentityDialog {...data.subject} createInvitationUrl={createDeviceInvitationUrl} />\n ),\n }),\n createSurface({\n id: JOIN_DIALOG,\n role: 'dialog',\n filter: (data): data is { subject: JoinPanelProps } => data.component === JOIN_DIALOG,\n component: ({ data }) => <JoinDialog {...data.subject} />,\n }),\n createSurface({\n id: RECOVER_CODE_DIALOG,\n role: 'dialog',\n filter: (data): data is { subject: RecoveryCodeDialogProps } => data.component === RECOVER_CODE_DIALOG,\n component: ({ data }) => <RecoveryCodeDialog {...data.subject} />,\n }),\n ],\n },\n graph: {\n builder: (plugins) => {\n const dispatch = resolvePlugin(plugins, parseIntentPlugin)?.provides.intent.dispatchPromise;\n const id = `${CLIENT_PLUGIN}/open-shell`;\n\n return createExtension({\n id: CLIENT_PLUGIN,\n filter: (node): node is Node<null> => node.id === 'root',\n actions: () => [\n {\n id,\n data: async () => {\n await dispatch?.(createIntent(ClientAction.ShareIdentity));\n },\n properties: {\n label: ['open shell label', { ns: CLIENT_PLUGIN }],\n icon: 'ph--address-book--regular',\n keyBinding: {\n macos: 'meta+shift+.',\n // TODO(wittjosiah): Test on windows to see if it behaves the same as linux.\n windows: 'alt+shift+.',\n linux: 'alt+shift+>',\n },\n testId: 'clientPlugin.openShell',\n },\n },\n ],\n });\n },\n },\n intent: {\n resolvers: () => [\n createResolver(ClientAction.CreateIdentity, async () => {\n const data = await client.halo.createIdentity();\n return { data, intents: [createIntent(ObservabilityAction.SendEvent, { name: 'identity.create' })] };\n }),\n createResolver(ClientAction.JoinIdentity, async (data) => {\n return {\n intents: [\n createIntent(LayoutAction.SetLayout, {\n element: 'dialog',\n component: JOIN_DIALOG,\n dialogBlockAlign: 'start',\n subject: {\n initialInvitationCode: data.invitationCode,\n initialDisposition: 'accept-halo-invitation',\n } satisfies Partial<JoinPanelProps>,\n }),\n ],\n };\n }),\n createResolver(ClientAction.ShareIdentity, async () => {\n return {\n intents: [\n createIntent(LayoutAction.SetLayout, {\n element: 'dialog',\n component: IDENTITY_DIALOG,\n dialogBlockAlign: 'start',\n }),\n createIntent(ObservabilityAction.SendEvent, { name: 'identity.share' }),\n ],\n };\n }),\n createResolver(ClientAction.RecoverIdentity, async () => {\n return {\n intents: [\n createIntent(LayoutAction.SetLayout, {\n element: 'dialog',\n component: JOIN_DIALOG,\n dialogBlockAlign: 'start',\n subject: { initialDisposition: 'recover-identity' } satisfies Partial<JoinPanelProps>,\n }),\n ],\n };\n }),\n createResolver(ClientAction.ResetStorage, async (data) => {\n await onReset?.({ target: data.target });\n return {};\n }),\n createResolver(ClientAction.CreateAgent, async () => {\n invariant(client.services.services.EdgeAgentService, 'Missing EdgeAgentService');\n await client.services.services.EdgeAgentService.createAgent(null as any, { timeout: 10_000 });\n }),\n createResolver(ClientAction.CreateRecoveryCode, async () => {\n invariant(client.services.services.IdentityService, 'IdentityService not available');\n // TODO(wittjosiah): This needs a proper api. Rename property.\n const { seedphrase } = await client.services.services.IdentityService.createRecoveryPhrase();\n return {\n intents: [\n createIntent(LayoutAction.SetLayout, {\n element: 'dialog',\n dialogBlockAlign: 'start',\n dialogType: 'alert',\n state: true,\n component: RECOVER_CODE_DIALOG,\n subject: { code: seedphrase },\n }),\n ],\n };\n }),\n ],\n },\n },\n };\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { useCallback } from 'react';\n\nimport { createIntent, LayoutAction, useIntentDispatcher } from '@dxos/app-framework';\nimport { useClient } from '@dxos/react-client';\nimport { Clipboard, Dialog } from '@dxos/react-ui';\nimport { IdentityPanel, type IdentityPanelProps } from '@dxos/shell/react';\n\nimport { 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.SetLayout, {\n element: 'dialog',\n 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.SetLayout, { element: 'dialog', 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", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { CLIENT_PLUGIN } from './meta';\n\nexport default [\n {\n 'en-US': {\n [CLIENT_PLUGIN]: {\n 'open shell label': 'Open HALO',\n 'recovery code dialog title': 'Account Recovery',\n 'recovery code dialog description':\n 'This is your identity recovery code, store it in a safe place. You can use it to recover your identity if you ever lose access to your devices.',\n 'recovery code dialog warning 1': 'NOTE: This code will not be displayed again.',\n 'recovery code dialog warning 2':\n 'It is your private key for recovering DXOS data. Anyone with this key will be able to gain access to your account.',\n 'recovery code confirmation label': 'Please confirm you have saved the code.',\n 'continue label': 'Continue',\n },\n },\n },\n];\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { ClientPlugin } from './ClientPlugin';\n\nexport default ClientPlugin;\n\nexport * from './ClientPlugin';\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": ["
|
|
3
|
+
"sources": ["../../../src/ClientPlugin.ts", "../../../src/capabilities/index.ts", "../../../src/translations.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capabilities, contributes, defineModule, definePlugin, Events } from '@dxos/app-framework';\n\nimport { Client, AppGraphBuilder, IntentResolver, ReactContext, ReactSurface } from './capabilities';\nimport { ClientEvents } from './events';\nimport { meta } from './meta';\nimport translations from './translations';\nimport { type ClientPluginOptions } from './types';\n\nexport const ClientPlugin = ({\n invitationUrl = window.location.origin,\n invitationParam = 'deviceInvitationCode',\n onReset,\n ...options\n}: ClientPluginOptions) => {\n const createInvitationUrl = (invitationCode: string) => {\n const baseUrl = new URL(invitationUrl);\n baseUrl.searchParams.set(invitationParam, invitationCode);\n return baseUrl.toString();\n };\n\n return definePlugin(meta, [\n defineModule({\n id: `${meta.id}/module/client`,\n activatesOn: Events.Startup,\n activatesBefore: [ClientEvents.SetupClient],\n activatesAfter: [ClientEvents.ClientReady],\n activate: (context) => Client({ ...options, context }),\n }),\n defineModule({\n id: `${meta.id}/module/react-context`,\n activatesOn: Events.Startup,\n activate: ReactContext,\n }),\n defineModule({\n id: `${meta.id}/module/react-surface`,\n activatesOn: Events.Startup,\n activate: () => ReactSurface({ createInvitationUrl }),\n }),\n defineModule({\n id: `${meta.id}/module/app-graph-builder`,\n activatesOn: Events.SetupAppGraph,\n activate: AppGraphBuilder,\n }),\n defineModule({\n id: `${meta.id}/module/intent-resolver`,\n activatesOn: Events.SetupIntents,\n activate: (context) => IntentResolver({ context, onReset }),\n }),\n defineModule({\n id: `${meta.id}/module/translations`,\n activatesOn: Events.SetupTranslations,\n activate: () => contributes(Capabilities.Translations, translations),\n }),\n ]);\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { lazy } from '@dxos/app-framework';\n\nexport const AppGraphBuilder = lazy(async () => import('./app-graph-builder'));\nexport const Client = lazy(async () => import('./client'));\nexport const IntentResolver = lazy(async () => import('./intent-resolver'));\nexport const ReactContext = lazy(async () => import('./react-context'));\nexport const ReactSurface = lazy(async () => import('./react-surface'));\n\nexport * from './capabilities';\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { CLIENT_PLUGIN } from './meta';\n\nexport default [\n {\n 'en-US': {\n [CLIENT_PLUGIN]: {\n 'open shell label': 'Open HALO',\n 'recovery code dialog title': 'Account Recovery',\n 'recovery code dialog description':\n 'This is your identity recovery code, store it in a safe place. You can use it to recover your identity if you ever lose access to your devices.',\n 'recovery code dialog warning 1': 'NOTE: This code will not be displayed again.',\n 'recovery code dialog warning 2':\n 'It is your private key for recovering DXOS data. Anyone with this key will be able to gain access to your account.',\n 'recovery code confirmation label': 'Please confirm you have saved the code.',\n 'continue label': 'Continue',\n },\n },\n },\n];\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;AAIA,SAASA,cAAcC,aAAaC,cAAcC,cAAcC,cAAc;;;ACA9E,SAASC,YAAY;AAEd,IAAMC,kBAAkBC,KAAK,YAAY,OAAO,kCAAA,CAAA;AAChD,IAAMC,SAASD,KAAK,YAAY,OAAO,uBAAA,CAAA;AACvC,IAAME,iBAAiBF,KAAK,YAAY,OAAO,gCAAA,CAAA;AAC/C,IAAMG,eAAeH,KAAK,YAAY,OAAO,8BAAA,CAAA;AAC7C,IAAMI,eAAeJ,KAAK,YAAY,OAAO,8BAAA,CAAA;;;ACJpD,IAAA,uBAAe;EACb;IACE,SAAS;MACP,CAACK,aAAAA,GAAgB;QACf,oBAAoB;QACpB,8BAA8B;QAC9B,oCACE;QACF,kCAAkC;QAClC,kCACE;QACF,oCAAoC;QACpC,kBAAkB;MACpB;IACF;EACF;;;;AFTK,IAAMC,eAAe,CAAC,EAC3BC,gBAAgBC,OAAOC,SAASC,QAChCC,kBAAkB,wBAClBC,SACA,GAAGC,QAAAA,MACiB;AACpB,QAAMC,sBAAsB,CAACC,mBAAAA;AAC3B,UAAMC,UAAU,IAAIC,IAAIV,aAAAA;AACxBS,YAAQE,aAAaC,IAAIR,iBAAiBI,cAAAA;AAC1C,WAAOC,QAAQI,SAAQ;EACzB;AAEA,SAAOC,aAAaC,MAAM;IACxBC,aAAa;MACXC,IAAI,GAAGF,KAAKE,EAAE;MACdC,aAAaC,OAAOC;MACpBC,iBAAiB;QAACC,aAAaC;;MAC/BC,gBAAgB;QAACF,aAAaG;;MAC9BC,UAAU,CAACC,YAAYC,OAAO;QAAE,GAAGtB;QAASqB;MAAQ,CAAA;IACtD,CAAA;IACAX,aAAa;MACXC,IAAI,GAAGF,KAAKE,EAAE;MACdC,aAAaC,OAAOC;MACpBM,UAAUG;IACZ,CAAA;IACAb,aAAa;MACXC,IAAI,GAAGF,KAAKE,EAAE;MACdC,aAAaC,OAAOC;MACpBM,UAAU,MAAMI,aAAa;QAAEvB;MAAoB,CAAA;IACrD,CAAA;IACAS,aAAa;MACXC,IAAI,GAAGF,KAAKE,EAAE;MACdC,aAAaC,OAAOY;MACpBL,UAAUM;IACZ,CAAA;IACAhB,aAAa;MACXC,IAAI,GAAGF,KAAKE,EAAE;MACdC,aAAaC,OAAOc;MACpBP,UAAU,CAACC,YAAYO,eAAe;QAAEP;QAAStB;MAAQ,CAAA;IAC3D,CAAA;IACAW,aAAa;MACXC,IAAI,GAAGF,KAAKE,EAAE;MACdC,aAAaC,OAAOgB;MACpBT,UAAU,MAAMU,YAAYC,aAAaC,cAAcC,oBAAAA;IACzD,CAAA;GACD;AACH;",
|
|
6
|
+
"names": ["Capabilities", "contributes", "defineModule", "definePlugin", "Events", "lazy", "AppGraphBuilder", "lazy", "Client", "IntentResolver", "ReactContext", "ReactSurface", "CLIENT_PLUGIN", "ClientPlugin", "invitationUrl", "window", "location", "origin", "invitationParam", "onReset", "options", "createInvitationUrl", "invitationCode", "baseUrl", "URL", "searchParams", "set", "toString", "definePlugin", "meta", "defineModule", "id", "activatesOn", "Events", "Startup", "activatesBefore", "ClientEvents", "SetupClient", "activatesAfter", "ClientReady", "activate", "context", "Client", "ReactContext", "ReactSurface", "SetupAppGraph", "AppGraphBuilder", "SetupIntents", "IntentResolver", "SetupTranslations", "contributes", "Capabilities", "Translations", "translations"]
|
|
7
7
|
}
|