@dxos/plugin-debug 0.7.4 → 0.7.5-labs.a279d8c

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 (80) hide show
  1. package/dist/lib/browser/{DebugApp-HCHR6GKO.mjs → DebugApp-LQHFFK3Y.mjs} +4 -2
  2. package/dist/lib/browser/{DebugApp-HCHR6GKO.mjs.map → DebugApp-LQHFFK3Y.mjs.map} +3 -3
  3. package/dist/lib/browser/{DebugSpace-DHKEAMIC.mjs → DebugSpace-4JHYA7FG.mjs} +7 -6
  4. package/dist/lib/browser/DebugSpace-4JHYA7FG.mjs.map +7 -0
  5. package/dist/lib/browser/{SpaceGenerator-BQ3645OS.mjs → SpaceGenerator-YNT3WDFI.mjs} +226 -20
  6. package/dist/lib/browser/SpaceGenerator-YNT3WDFI.mjs.map +7 -0
  7. package/dist/lib/browser/app-graph-builder-FXELWOFS.mjs +177 -0
  8. package/dist/lib/browser/app-graph-builder-FXELWOFS.mjs.map +7 -0
  9. package/dist/lib/browser/{chunk-CAENAAHY.mjs → chunk-I3ON45JK.mjs} +3 -3
  10. package/dist/lib/browser/chunk-I3ON45JK.mjs.map +7 -0
  11. package/dist/lib/browser/{chunk-LZEK532R.mjs → chunk-P7GHHMDB.mjs} +1 -11
  12. package/dist/lib/browser/chunk-P7GHHMDB.mjs.map +7 -0
  13. package/dist/lib/browser/index.mjs +66 -737
  14. package/dist/lib/browser/index.mjs.map +4 -4
  15. package/dist/lib/browser/meta.json +1 -1
  16. package/dist/lib/browser/react-context-OZU6J7G3.mjs +37 -0
  17. package/dist/lib/browser/react-context-OZU6J7G3.mjs.map +7 -0
  18. package/dist/lib/browser/react-surface-ACHNR2UU.mjs +481 -0
  19. package/dist/lib/browser/react-surface-ACHNR2UU.mjs.map +7 -0
  20. package/dist/lib/browser/settings-JCZUA643.mjs +25 -0
  21. package/dist/lib/browser/settings-JCZUA643.mjs.map +7 -0
  22. package/dist/types/src/DebugPlugin.d.ts +1 -2
  23. package/dist/types/src/DebugPlugin.d.ts.map +1 -1
  24. package/dist/types/src/capabilities/app-graph-builder.d.ts +181 -0
  25. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -0
  26. package/dist/types/src/capabilities/index.d.ts +185 -0
  27. package/dist/types/src/capabilities/index.d.ts.map +1 -0
  28. package/dist/types/src/capabilities/react-context.d.ts +8 -0
  29. package/dist/types/src/capabilities/react-context.d.ts.map +1 -0
  30. package/dist/types/src/capabilities/react-surface.d.ts +4 -0
  31. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
  32. package/dist/types/src/capabilities/settings.d.ts +4 -0
  33. package/dist/types/src/capabilities/settings.d.ts.map +1 -0
  34. package/dist/types/src/components/DebugObjectPanel.d.ts.map +1 -1
  35. package/dist/types/src/components/DebugSpace/DebugSpace.stories.d.ts.map +1 -1
  36. package/dist/types/src/components/DebugSpace/ObjectCreator.stories.d.ts.map +1 -1
  37. package/dist/types/src/components/DebugStatus.d.ts.map +1 -1
  38. package/dist/types/src/components/SpaceGenerator/ObjectGenerator.d.ts +2 -2
  39. package/dist/types/src/components/SpaceGenerator/ObjectGenerator.d.ts.map +1 -1
  40. package/dist/types/src/components/SpaceGenerator/SpaceGenerator.d.ts.map +1 -1
  41. package/dist/types/src/components/SpaceGenerator/draw-util.d.ts.map +1 -1
  42. package/dist/types/src/components/Wireframe.d.ts +2 -1
  43. package/dist/types/src/components/Wireframe.d.ts.map +1 -1
  44. package/dist/types/src/index.d.ts +1 -2
  45. package/dist/types/src/index.d.ts.map +1 -1
  46. package/dist/types/src/meta.d.ts +1 -2
  47. package/dist/types/src/meta.d.ts.map +1 -1
  48. package/dist/types/src/types.d.ts +0 -6
  49. package/dist/types/src/types.d.ts.map +1 -1
  50. package/dist/types/tsconfig.tsbuildinfo +1 -0
  51. package/package.json +48 -51
  52. package/src/DebugPlugin.tsx +60 -381
  53. package/src/capabilities/app-graph-builder.ts +177 -0
  54. package/src/capabilities/index.ts +10 -0
  55. package/src/capabilities/react-context.tsx +38 -0
  56. package/src/capabilities/react-surface.tsx +138 -0
  57. package/src/capabilities/settings.ts +18 -0
  58. package/src/components/DebugApp/DebugApp.tsx +1 -1
  59. package/src/components/DebugObjectPanel.tsx +17 -5
  60. package/src/components/DebugSettings.tsx +4 -4
  61. package/src/components/DebugSpace/DebugSpace.stories.tsx +4 -3
  62. package/src/components/DebugSpace/DebugSpace.tsx +1 -1
  63. package/src/components/DebugSpace/ObjectCreator.stories.tsx +4 -3
  64. package/src/components/DebugStatus.tsx +3 -9
  65. package/src/components/SpaceGenerator/ObjectGenerator.tsx +126 -18
  66. package/src/components/SpaceGenerator/SpaceGenerator.tsx +6 -4
  67. package/src/components/SpaceGenerator/draw-util.ts +7 -6
  68. package/src/components/Wireframe.tsx +2 -2
  69. package/src/index.ts +1 -4
  70. package/src/meta.ts +1 -1
  71. package/src/types.ts +0 -22
  72. package/dist/lib/browser/DebugSpace-DHKEAMIC.mjs.map +0 -7
  73. package/dist/lib/browser/SpaceGenerator-BQ3645OS.mjs.map +0 -7
  74. package/dist/lib/browser/chunk-CAENAAHY.mjs.map +0 -7
  75. package/dist/lib/browser/chunk-LZEK532R.mjs.map +0 -7
  76. package/dist/lib/browser/meta.mjs +0 -9
  77. package/dist/lib/browser/meta.mjs.map +0 -7
  78. package/dist/types/src/components/DebugSurface.d.ts +0 -9
  79. package/dist/types/src/components/DebugSurface.d.ts.map +0 -1
  80. package/src/components/DebugSurface.tsx +0 -55
@@ -0,0 +1,481 @@
1
+ import {
2
+ DEBUG_PLUGIN
3
+ } from "./chunk-I3ON45JK.mjs";
4
+
5
+ // packages/plugins/plugin-debug/src/capabilities/react-surface.tsx
6
+ import React5, { useCallback } from "react";
7
+ import { Capabilities as Capabilities3, contributes, createIntent, createSurface, useCapability as useCapability2 } from "@dxos/app-framework";
8
+ import { Devtools } from "@dxos/devtools";
9
+ import { Graph } from "@dxos/plugin-graph";
10
+ import { SpaceAction, CollectionType } from "@dxos/plugin-space/types";
11
+ import { SpaceState, isSpace, isEchoObject } from "@dxos/react-client/echo";
12
+
13
+ // packages/plugins/plugin-debug/src/components/index.ts
14
+ import { lazy } from "react";
15
+
16
+ // packages/plugins/plugin-debug/src/components/DebugObjectPanel.tsx
17
+ import React from "react";
18
+ import { Clipboard, Input } from "@dxos/react-ui";
19
+ import { SyntaxHighlighter } from "@dxos/react-ui-syntax-highlighter";
20
+ var DebugObjectPanel = ({ object }) => {
21
+ const dxn = `dxn:echo:@:${object.id}`;
22
+ return /* @__PURE__ */ React.createElement(Clipboard.Provider, null, /* @__PURE__ */ React.createElement("div", {
23
+ className: "flex flex-col"
24
+ }, /* @__PURE__ */ React.createElement(Input.Root, null, /* @__PURE__ */ React.createElement("div", {
25
+ role: "none",
26
+ className: "flex flex-col gap-1"
27
+ }, /* @__PURE__ */ React.createElement("div", {
28
+ role: "none",
29
+ className: "flex gap-1"
30
+ }, /* @__PURE__ */ React.createElement(Input.TextInput, {
31
+ disabled: true,
32
+ value: dxn
33
+ }), /* @__PURE__ */ React.createElement(Clipboard.IconButton, {
34
+ value: dxn
35
+ })))), /* @__PURE__ */ React.createElement(SyntaxHighlighter, {
36
+ classNames: "flex text-xs",
37
+ language: "json"
38
+ }, JSON.stringify(object, null, 2))));
39
+ };
40
+
41
+ // packages/plugins/plugin-debug/src/components/DebugSettings.tsx
42
+ import { Gift, DownloadSimple, FirstAidKit } from "@phosphor-icons/react";
43
+ import React2, { useEffect, useState } from "react";
44
+ import { Capabilities, useCapabilities } from "@dxos/app-framework";
45
+ import { defs, SaveConfig, Storage } from "@dxos/config";
46
+ import { log } from "@dxos/log";
47
+ import { useClient } from "@dxos/react-client";
48
+ import { useTranslation, Button, Toast, Input as Input2, useFileDownload, Select } from "@dxos/react-ui";
49
+ import { DeprecatedFormInput } from "@dxos/react-ui-form";
50
+ import { getSize, mx } from "@dxos/react-ui-theme";
51
+ import { setDeep } from "@dxos/util";
52
+ var __dxlog_file = "/home/runner/work/dxos/dxos/packages/plugins/plugin-debug/src/components/DebugSettings.tsx";
53
+ var StorageAdapters = {
54
+ opfs: defs.Runtime.Client.Storage.StorageDriver.WEBFS,
55
+ idb: defs.Runtime.Client.Storage.StorageDriver.IDB
56
+ };
57
+ var DebugSettings = ({ settings }) => {
58
+ const { t } = useTranslation(DEBUG_PLUGIN);
59
+ const [toast, setToast] = useState();
60
+ const client = useClient();
61
+ const download = useFileDownload();
62
+ const [storageConfig, setStorageConfig] = useState({});
63
+ const [upload] = useCapabilities(Capabilities.FileUploader);
64
+ useEffect(() => {
65
+ void Storage().then((config) => setStorageConfig(config));
66
+ }, []);
67
+ const handleToast = (toast2) => {
68
+ setToast(toast2);
69
+ const t2 = setTimeout(() => setToast(void 0), 5e3);
70
+ return () => clearTimeout(t2);
71
+ };
72
+ const handleDownload = async () => {
73
+ const data = await client.diagnostics();
74
+ const file = new Blob([
75
+ JSON.stringify(data, void 0, 2)
76
+ ], {
77
+ type: "text/plain"
78
+ });
79
+ const fileName = `composer-${(/* @__PURE__ */ new Date()).toISOString().replace(/\W/g, "-")}.json`;
80
+ download(file, fileName);
81
+ if (upload) {
82
+ const info = await upload(new File([
83
+ file
84
+ ], fileName), client.spaces.default);
85
+ if (!info) {
86
+ log.error("diagnostics failed to upload to IPFS", void 0, {
87
+ F: __dxlog_file,
88
+ L: 58,
89
+ S: void 0,
90
+ C: (f, a) => f(...a)
91
+ });
92
+ return;
93
+ }
94
+ handleToast({
95
+ title: t("settings uploaded"),
96
+ description: t("settings uploaded to clipboard")
97
+ });
98
+ const url = client.config.values.runtime.services.ipfs.gateway + "/" + info.cid;
99
+ void navigator.clipboard.writeText(url);
100
+ handleToast({
101
+ title: t("settings uploaded"),
102
+ description: t("settings uploaded to clipboard")
103
+ });
104
+ log.info("diagnostics", {
105
+ url
106
+ }, {
107
+ F: __dxlog_file,
108
+ L: 67,
109
+ S: void 0,
110
+ C: (f, a) => f(...a)
111
+ });
112
+ }
113
+ };
114
+ const handleRepair = async () => {
115
+ try {
116
+ const info = await client.repair();
117
+ setStorageConfig(await Storage());
118
+ handleToast({
119
+ title: t("settings repair success"),
120
+ description: JSON.stringify(info, void 0, 2)
121
+ });
122
+ } catch (err) {
123
+ handleToast({
124
+ title: t("settings repair failed"),
125
+ description: err.message
126
+ });
127
+ }
128
+ };
129
+ return /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement(DeprecatedFormInput, {
130
+ label: t("settings show debug panel")
131
+ }, /* @__PURE__ */ React2.createElement(Input2.Switch, {
132
+ checked: settings.debug,
133
+ onCheckedChange: (checked) => settings.debug = !!checked
134
+ })), /* @__PURE__ */ React2.createElement(DeprecatedFormInput, {
135
+ label: t("settings show devtools panel")
136
+ }, /* @__PURE__ */ React2.createElement(Input2.Switch, {
137
+ checked: settings.devtools,
138
+ onCheckedChange: (checked) => settings.devtools = !!checked
139
+ })), /* @__PURE__ */ React2.createElement(DeprecatedFormInput, {
140
+ label: t("settings wireframe")
141
+ }, /* @__PURE__ */ React2.createElement(Input2.Switch, {
142
+ checked: settings.wireframe,
143
+ onCheckedChange: (checked) => settings.wireframe = !!checked
144
+ })), /* @__PURE__ */ React2.createElement(DeprecatedFormInput, {
145
+ label: t("settings download diagnostics")
146
+ }, /* @__PURE__ */ React2.createElement(Button, {
147
+ onClick: handleDownload
148
+ }, /* @__PURE__ */ React2.createElement(DownloadSimple, {
149
+ className: getSize(5)
150
+ }))), /* @__PURE__ */ React2.createElement(DeprecatedFormInput, {
151
+ label: t("settings repair")
152
+ }, /* @__PURE__ */ React2.createElement(Button, {
153
+ onClick: handleRepair
154
+ }, /* @__PURE__ */ React2.createElement(FirstAidKit, {
155
+ className: getSize(5)
156
+ }))), toast && /* @__PURE__ */ React2.createElement(Toast.Root, null, /* @__PURE__ */ React2.createElement(Toast.Body, null, /* @__PURE__ */ React2.createElement(Toast.Title, null, /* @__PURE__ */ React2.createElement(Gift, {
157
+ className: mx(getSize(5), "inline mr-1"),
158
+ weight: "duotone"
159
+ }), /* @__PURE__ */ React2.createElement("span", null, toast.title)), toast.description && /* @__PURE__ */ React2.createElement(Toast.Description, null, toast.description))), /* @__PURE__ */ React2.createElement(DeprecatedFormInput, {
160
+ label: t("settings choose storage adaptor")
161
+ }, /* @__PURE__ */ React2.createElement(Select.Root, {
162
+ value: Object.entries(StorageAdapters).find(([name2, value]) => value === storageConfig?.runtime?.client?.storage?.dataStore)?.[0],
163
+ onValueChange: (value) => {
164
+ if (confirm(t("settings storage adapter changed alert"))) {
165
+ updateConfig(storageConfig, setStorageConfig, [
166
+ "runtime",
167
+ "client",
168
+ "storage",
169
+ "dataStore"
170
+ ], StorageAdapters[value]);
171
+ }
172
+ }
173
+ }, /* @__PURE__ */ React2.createElement(Select.TriggerButton, {
174
+ placeholder: t("settings data store label")
175
+ }), /* @__PURE__ */ React2.createElement(Select.Portal, null, /* @__PURE__ */ React2.createElement(Select.Content, null, /* @__PURE__ */ React2.createElement(Select.Viewport, null, Object.keys(StorageAdapters).map((key) => /* @__PURE__ */ React2.createElement(Select.Option, {
176
+ key,
177
+ value: key
178
+ }, t(`settings storage adaptor ${key} label`)))))))));
179
+ };
180
+ var updateConfig = (config, setConfig, path, value) => {
181
+ const storageConfigCopy = JSON.parse(JSON.stringify(config ?? {}));
182
+ setDeep(storageConfigCopy, path, value);
183
+ setConfig(storageConfigCopy);
184
+ queueMicrotask(async () => {
185
+ await SaveConfig(storageConfigCopy);
186
+ });
187
+ };
188
+
189
+ // packages/plugins/plugin-debug/src/components/DebugStatus.tsx
190
+ import React3, { useEffect as useEffect2, useRef, useState as useState2 } from "react";
191
+ import { Capabilities as Capabilities2, firstIdInPart, useCapability } from "@dxos/app-framework";
192
+ import { TimeoutError } from "@dxos/async";
193
+ import { StatsPanel, useStats } from "@dxos/devtools";
194
+ import { getActiveSpace } from "@dxos/plugin-space";
195
+ import { StatusBar } from "@dxos/plugin-status-bar";
196
+ import { ConnectionState } from "@dxos/protocols/proto/dxos/client/services";
197
+ import { useNetworkStatus } from "@dxos/react-client/mesh";
198
+ import { Icon } from "@dxos/react-ui";
199
+ import { mx as mx2 } from "@dxos/react-ui-theme";
200
+ var styles = {
201
+ success: "text-sky-300 dark:text-green-700",
202
+ warning: "text-orange-300 dark:text-orange-600",
203
+ error: "text-red-300 dark:text-red-600"
204
+ };
205
+ var ErrorIndicator = () => {
206
+ const [, forceUpdate] = useState2({});
207
+ const errorRef = useRef();
208
+ useEffect2(() => {
209
+ const errorListener = (event) => {
210
+ const error = event.error ?? event.reason;
211
+ if (errorRef.current !== error) {
212
+ errorRef.current = error;
213
+ forceUpdate({});
214
+ }
215
+ };
216
+ window.addEventListener("error", errorListener);
217
+ window.addEventListener("unhandledrejection", errorListener);
218
+ return () => {
219
+ window.removeEventListener("error", errorListener);
220
+ window.removeEventListener("unhandledrejection", errorListener);
221
+ };
222
+ }, []);
223
+ const handleReset = () => {
224
+ errorRef.current = void 0;
225
+ forceUpdate({});
226
+ };
227
+ if (errorRef.current) {
228
+ return /* @__PURE__ */ React3.createElement(StatusBar.Button, {
229
+ title: errorRef.current.message,
230
+ onClick: handleReset
231
+ }, /* @__PURE__ */ React3.createElement(Icon, {
232
+ icon: "ph--warning-circle--duotone",
233
+ size: 4,
234
+ classNames: styles.error
235
+ }));
236
+ } else {
237
+ return /* @__PURE__ */ React3.createElement(StatusBar.Item, {
238
+ title: "No errors."
239
+ }, /* @__PURE__ */ React3.createElement(Icon, {
240
+ icon: "ph--check--regular",
241
+ size: 4
242
+ }));
243
+ }
244
+ };
245
+ var SwarmIndicator = () => {
246
+ const [state, setState] = useState2(0);
247
+ const { swarm } = useNetworkStatus();
248
+ useEffect2(() => {
249
+ setState(swarm === ConnectionState.ONLINE ? 0 : 1);
250
+ }, [
251
+ swarm
252
+ ]);
253
+ if (state === 0) {
254
+ return /* @__PURE__ */ React3.createElement(StatusBar.Item, {
255
+ title: "Connected to swarm."
256
+ }, /* @__PURE__ */ React3.createElement(Icon, {
257
+ icon: "ph--lightning--regular",
258
+ size: 4
259
+ }));
260
+ } else {
261
+ return /* @__PURE__ */ React3.createElement(StatusBar.Item, {
262
+ title: "Disconnected from swarm."
263
+ }, /* @__PURE__ */ React3.createElement(Icon, {
264
+ icon: "ph--lightning-slash--regular",
265
+ size: 4,
266
+ classNames: styles.warning
267
+ }));
268
+ }
269
+ };
270
+ var SavingIndicator = () => {
271
+ const [state, _setState] = useState2(0);
272
+ const location = useCapability(Capabilities2.Location);
273
+ const { graph } = useCapability(Capabilities2.AppGraph);
274
+ const _space = location && graph ? getActiveSpace(graph, firstIdInPart(location.active, "main")) : void 0;
275
+ switch (state) {
276
+ case 2:
277
+ return /* @__PURE__ */ React3.createElement(StatusBar.Item, {
278
+ title: "Edit not saved."
279
+ }, /* @__PURE__ */ React3.createElement(Icon, {
280
+ icon: "ph--circle--duotone",
281
+ size: 4,
282
+ classNames: styles.warning
283
+ }));
284
+ case 1:
285
+ return /* @__PURE__ */ React3.createElement(StatusBar.Item, {
286
+ title: "Saving..."
287
+ }, /* @__PURE__ */ React3.createElement(Icon, {
288
+ icon: "ph--circle--duotone",
289
+ size: 4,
290
+ classNames: styles.success
291
+ }));
292
+ case 0:
293
+ default:
294
+ return /* @__PURE__ */ React3.createElement(StatusBar.Item, {
295
+ title: "Modified indicator."
296
+ }, /* @__PURE__ */ React3.createElement(Icon, {
297
+ icon: "ph--circle--duotone",
298
+ size: 4
299
+ }));
300
+ }
301
+ };
302
+ var PerformanceIndicator = () => {
303
+ const [visible, setVisible] = useState2(false);
304
+ const [stats, refreshStats] = useStats();
305
+ return /* @__PURE__ */ React3.createElement(React3.Fragment, null, /* @__PURE__ */ React3.createElement(StatusBar.Button, {
306
+ onClick: () => setVisible((visible2) => !visible2),
307
+ title: "Performance panels"
308
+ }, /* @__PURE__ */ React3.createElement(Icon, {
309
+ icon: "ph--chart-bar--regular",
310
+ size: 4
311
+ })), visible && /* @__PURE__ */ React3.createElement("div", {
312
+ className: mx2("z-20 absolute bottom-[--statusbar-size] right-4 w-[450px]", "overflow-x-hidden overflow-y-auto scrollbar-thin", "border-x border-y border-separator")
313
+ }, /* @__PURE__ */ React3.createElement(StatsPanel, {
314
+ stats,
315
+ onRefresh: refreshStats
316
+ })));
317
+ };
318
+ var indicators = [
319
+ SavingIndicator,
320
+ SwarmIndicator,
321
+ PerformanceIndicator,
322
+ ErrorIndicator
323
+ ];
324
+ var DebugStatus = () => {
325
+ return /* @__PURE__ */ React3.createElement(React3.Fragment, null, indicators.map((Indicator) => /* @__PURE__ */ React3.createElement(Indicator, {
326
+ key: Indicator.name
327
+ })));
328
+ };
329
+
330
+ // packages/plugins/plugin-debug/src/components/Wireframe.tsx
331
+ import React4 from "react";
332
+ import { useResizeDetector } from "react-resize-detector";
333
+ import { fullyQualifiedId } from "@dxos/react-client/echo";
334
+ import { useAttendableAttributes } from "@dxos/react-ui-attention";
335
+ import { SyntaxHighlighter as SyntaxHighlighter2 } from "@dxos/react-ui-syntax-highlighter";
336
+ import { mx as mx3 } from "@dxos/react-ui-theme";
337
+ var Wireframe = ({ classNames, label, object }) => {
338
+ const attendableAttrs = useAttendableAttributes(fullyQualifiedId(object));
339
+ const { width, height, ref } = useResizeDetector();
340
+ return /* @__PURE__ */ React4.createElement("div", {
341
+ ref,
342
+ className: mx3("relative grow min-bs-96", classNames),
343
+ ...attendableAttrs
344
+ }, /* @__PURE__ */ React4.createElement("div", {
345
+ className: "absolute inset-2 flex flex-col gap-2 overflow-hidden font-mono"
346
+ }, /* @__PURE__ */ React4.createElement("div", {
347
+ className: "flex justify-between"
348
+ }, /* @__PURE__ */ React4.createElement("div", null, label), /* @__PURE__ */ React4.createElement("div", null, `[${width}x${height}]`)), object && /* @__PURE__ */ React4.createElement(SyntaxHighlighter2, {
349
+ language: "json",
350
+ classNames: "flex w-full text-xs opacity-75 rounded"
351
+ }, JSON.stringify(object, void 0, 2))), /* @__PURE__ */ React4.createElement("svg", {
352
+ width,
353
+ height,
354
+ className: "bg-transparent [&>*]:text-subdued"
355
+ }, /* @__PURE__ */ React4.createElement("rect", {
356
+ x: 0,
357
+ y: 0,
358
+ width,
359
+ height,
360
+ strokeWidth: 1,
361
+ fill: "none"
362
+ }), /* @__PURE__ */ React4.createElement("line", {
363
+ x1: 0,
364
+ y1: 0,
365
+ x2: width,
366
+ y2: height,
367
+ strokeWidth: 1
368
+ }), /* @__PURE__ */ React4.createElement("line", {
369
+ x1: 0,
370
+ y1: height,
371
+ x2: width,
372
+ y2: 0,
373
+ strokeWidth: 1
374
+ })));
375
+ };
376
+
377
+ // packages/plugins/plugin-debug/src/components/index.ts
378
+ var DebugApp = lazy(() => import("./DebugApp-LQHFFK3Y.mjs"));
379
+ var DebugSpace = lazy(() => import("./DebugSpace-4JHYA7FG.mjs"));
380
+ var SpaceGenerator = lazy(() => import("./SpaceGenerator-YNT3WDFI.mjs"));
381
+
382
+ // packages/plugins/plugin-debug/src/capabilities/react-surface.tsx
383
+ var isSpaceDebug = (data) => data.type === `${DEBUG_PLUGIN}/space` && isSpace(data.space);
384
+ var isGraphDebug = (data) => data.graph instanceof Graph;
385
+ var react_surface_default = (context) => contributes(Capabilities3.ReactSurface, [
386
+ createSurface({
387
+ id: `${DEBUG_PLUGIN}/settings`,
388
+ role: "settings",
389
+ filter: (data) => data.subject === DEBUG_PLUGIN,
390
+ component: () => {
391
+ const settings = useCapability2(Capabilities3.SettingsStore).getStore(DEBUG_PLUGIN).value;
392
+ return /* @__PURE__ */ React5.createElement(DebugSettings, {
393
+ settings
394
+ });
395
+ }
396
+ }),
397
+ createSurface({
398
+ id: `${DEBUG_PLUGIN}/status`,
399
+ role: "status",
400
+ component: () => /* @__PURE__ */ React5.createElement(DebugStatus, null)
401
+ }),
402
+ createSurface({
403
+ id: `${DEBUG_PLUGIN}/complementary`,
404
+ role: "complementary--debug",
405
+ filter: (data) => isEchoObject(data.subject),
406
+ component: ({ data }) => /* @__PURE__ */ React5.createElement(DebugObjectPanel, {
407
+ object: data.subject
408
+ })
409
+ }),
410
+ createSurface({
411
+ id: `${DEBUG_PLUGIN}/devtools`,
412
+ role: "article",
413
+ filter: (data) => {
414
+ const settings = context.requestCapability(Capabilities3.SettingsStore).getStore(DEBUG_PLUGIN).value;
415
+ return data.subject === "devtools" && !!settings.devtools;
416
+ },
417
+ component: () => /* @__PURE__ */ React5.createElement(Devtools, null)
418
+ }),
419
+ createSurface({
420
+ id: `${DEBUG_PLUGIN}/space`,
421
+ role: "article",
422
+ filter: (data) => isSpaceDebug(data.subject),
423
+ component: ({ data }) => {
424
+ const handleCreateObject = useCallback((objects) => {
425
+ if (!isSpace(data.subject.space)) {
426
+ return;
427
+ }
428
+ const collection = data.subject.space.state.get() === SpaceState.SPACE_READY && data.subject.space.properties[CollectionType.typename]?.target;
429
+ if (!(collection instanceof CollectionType)) {
430
+ return;
431
+ }
432
+ const { dispatchPromise: dispatch } = context.requestCapability(Capabilities3.IntentDispatcher);
433
+ objects.forEach((object) => {
434
+ void dispatch(createIntent(SpaceAction.AddObject, {
435
+ target: collection,
436
+ object
437
+ }));
438
+ });
439
+ }, [
440
+ data.subject.space
441
+ ]);
442
+ const deprecated = false;
443
+ return deprecated ? /* @__PURE__ */ React5.createElement(DebugSpace, {
444
+ space: data.subject.space,
445
+ onAddObjects: handleCreateObject
446
+ }) : /* @__PURE__ */ React5.createElement(SpaceGenerator, {
447
+ space: data.subject.space,
448
+ onCreateObjects: handleCreateObject
449
+ });
450
+ }
451
+ }),
452
+ createSurface({
453
+ id: `${DEBUG_PLUGIN}/graph`,
454
+ role: "article",
455
+ filter: (data) => isGraphDebug(data.subject),
456
+ component: ({ data }) => /* @__PURE__ */ React5.createElement(DebugApp, {
457
+ graph: data.subject.graph
458
+ })
459
+ }),
460
+ createSurface({
461
+ id: `${DEBUG_PLUGIN}/wireframe`,
462
+ role: [
463
+ "article",
464
+ "section"
465
+ ],
466
+ disposition: "hoist",
467
+ filter: (data) => {
468
+ const settings = context.requestCapability(Capabilities3.SettingsStore).getStore(DEBUG_PLUGIN).value;
469
+ return isEchoObject(data.subject) && !!settings.wireframe;
470
+ },
471
+ component: ({ data, role }) => /* @__PURE__ */ React5.createElement(Wireframe, {
472
+ label: `${role}:${name}`,
473
+ object: data.subject,
474
+ classNames: "row-span-2 overflow-hidden"
475
+ })
476
+ })
477
+ ]);
478
+ export {
479
+ react_surface_default as default
480
+ };
481
+ //# sourceMappingURL=react-surface-ACHNR2UU.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/capabilities/react-surface.tsx", "../../../src/components/index.ts", "../../../src/components/DebugObjectPanel.tsx", "../../../src/components/DebugSettings.tsx", "../../../src/components/DebugStatus.tsx", "../../../src/components/Wireframe.tsx"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport React, { useCallback } from 'react';\n\nimport {\n Capabilities,\n contributes,\n createIntent,\n createSurface,\n useCapability,\n type PluginsContext,\n} from '@dxos/app-framework';\nimport { Devtools } from '@dxos/devtools';\nimport { Graph } from '@dxos/plugin-graph';\nimport { SpaceAction, CollectionType } from '@dxos/plugin-space/types';\nimport {\n SpaceState,\n isSpace,\n isEchoObject,\n type ReactiveEchoObject,\n type ReactiveObject,\n type Space,\n} from '@dxos/react-client/echo';\n\nimport {\n DebugApp,\n DebugObjectPanel,\n DebugSettings,\n DebugSpace,\n DebugStatus,\n SpaceGenerator,\n Wireframe,\n} from '../components';\nimport { DEBUG_PLUGIN } from '../meta';\nimport { type DebugSettingsProps } from '../types';\n\ntype SpaceDebug = {\n type: string;\n space: Space;\n};\n\ntype GraphDebug = {\n graph: Graph;\n};\n\nconst isSpaceDebug = (data: any): data is SpaceDebug => data.type === `${DEBUG_PLUGIN}/space` && isSpace(data.space);\nconst isGraphDebug = (data: any): data is GraphDebug => data.graph instanceof Graph;\n\nexport default (context: PluginsContext) =>\n contributes(Capabilities.ReactSurface, [\n createSurface({\n id: `${DEBUG_PLUGIN}/settings`,\n role: 'settings',\n filter: (data): data is any => data.subject === DEBUG_PLUGIN,\n component: () => {\n const settings = useCapability(Capabilities.SettingsStore).getStore<DebugSettingsProps>(DEBUG_PLUGIN)!.value;\n return <DebugSettings settings={settings} />;\n },\n }),\n createSurface({\n id: `${DEBUG_PLUGIN}/status`,\n role: 'status',\n component: () => <DebugStatus />,\n }),\n createSurface({\n id: `${DEBUG_PLUGIN}/complementary`,\n role: 'complementary--debug',\n filter: (data): data is { subject: ReactiveEchoObject<any> } => isEchoObject(data.subject),\n component: ({ data }) => <DebugObjectPanel object={data.subject} />,\n }),\n createSurface({\n id: `${DEBUG_PLUGIN}/devtools`,\n role: 'article',\n filter: (data): data is any => {\n const settings = context\n .requestCapability(Capabilities.SettingsStore)\n .getStore<DebugSettingsProps>(DEBUG_PLUGIN)!.value;\n return data.subject === 'devtools' && !!settings.devtools;\n },\n component: () => <Devtools />,\n }),\n createSurface({\n id: `${DEBUG_PLUGIN}/space`,\n role: 'article',\n filter: (data): data is { subject: SpaceDebug } => isSpaceDebug(data.subject),\n component: ({ data }) => {\n const handleCreateObject = useCallback(\n (objects: ReactiveObject<any>[]) => {\n if (!isSpace(data.subject.space)) {\n return;\n }\n\n const collection =\n data.subject.space.state.get() === SpaceState.SPACE_READY &&\n data.subject.space.properties[CollectionType.typename]?.target;\n if (!(collection instanceof CollectionType)) {\n return;\n }\n\n const { dispatchPromise: dispatch } = context.requestCapability(Capabilities.IntentDispatcher);\n objects.forEach((object) => {\n void dispatch(createIntent(SpaceAction.AddObject, { target: collection, object }));\n });\n },\n [data.subject.space],\n );\n\n const deprecated = false;\n return deprecated ? (\n <DebugSpace space={data.subject.space} onAddObjects={handleCreateObject} />\n ) : (\n <SpaceGenerator space={data.subject.space} onCreateObjects={handleCreateObject} />\n );\n },\n }),\n createSurface({\n id: `${DEBUG_PLUGIN}/graph`,\n role: 'article',\n filter: (data): data is { subject: GraphDebug } => isGraphDebug(data.subject),\n component: ({ data }) => <DebugApp graph={data.subject.graph} />,\n }),\n createSurface({\n id: `${DEBUG_PLUGIN}/wireframe`,\n role: ['article', 'section'],\n disposition: 'hoist',\n filter: (data): data is { subject: ReactiveEchoObject<any> } => {\n const settings = context\n .requestCapability(Capabilities.SettingsStore)\n .getStore<DebugSettingsProps>(DEBUG_PLUGIN)!.value;\n return isEchoObject(data.subject) && !!settings.wireframe;\n },\n component: ({ data, role }) => (\n <Wireframe label={`${role}:${name}`} object={data.subject} classNames='row-span-2 overflow-hidden' />\n ),\n }),\n ]);\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { lazy } from 'react';\n\nexport const DebugApp = lazy(() => import('./DebugApp'));\nexport const DebugSpace = lazy(() => import('./DebugSpace'));\nexport const SpaceGenerator = lazy(() => import('./SpaceGenerator'));\n\nexport * from './DebugObjectPanel';\nexport * from './DebugSettings';\nexport * from './DebugStatus';\nexport * from './Wireframe';\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React from 'react';\n\nimport { type ReactiveEchoObject } from '@dxos/client/echo';\nimport { Clipboard, Input } from '@dxos/react-ui';\nimport { SyntaxHighlighter } from '@dxos/react-ui-syntax-highlighter';\n\nexport type DebugObjectPanelProps = {\n object: ReactiveEchoObject<any>;\n};\n\n// TODO(burdon): Get schema and traverse references.\nexport const DebugObjectPanel = ({ object }: DebugObjectPanelProps) => {\n const dxn = `dxn:echo:@:${object.id}`;\n return (\n <Clipboard.Provider>\n <div className='flex flex-col'>\n <Input.Root>\n <div role='none' className='flex flex-col gap-1'>\n <div role='none' className='flex gap-1'>\n <Input.TextInput disabled value={dxn} />\n <Clipboard.IconButton value={dxn} />\n </div>\n </div>\n </Input.Root>\n <SyntaxHighlighter classNames='flex text-xs' language='json'>\n {JSON.stringify(object, null, 2)}\n </SyntaxHighlighter>\n </div>\n </Clipboard.Provider>\n );\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { Gift, DownloadSimple, FirstAidKit } from '@phosphor-icons/react';\nimport React, { useEffect, useState } from 'react';\n\nimport { Capabilities, useCapabilities } from '@dxos/app-framework';\nimport { type ConfigProto, defs, SaveConfig, Storage } from '@dxos/config';\nimport { log } from '@dxos/log';\nimport { useClient } from '@dxos/react-client';\nimport { useTranslation, Button, Toast, Input, useFileDownload, Select } from '@dxos/react-ui';\nimport { DeprecatedFormInput } from '@dxos/react-ui-form';\nimport { getSize, mx } from '@dxos/react-ui-theme';\nimport { setDeep } from '@dxos/util';\n\nimport { DEBUG_PLUGIN } from '../meta';\nimport { type DebugSettingsProps } from '../types';\n\ntype Toast = {\n title: string;\n description?: string;\n};\n\nconst StorageAdapters = {\n opfs: defs.Runtime.Client.Storage.StorageDriver.WEBFS,\n idb: defs.Runtime.Client.Storage.StorageDriver.IDB,\n} as const;\n\nexport const DebugSettings = ({ settings }: { settings: DebugSettingsProps }) => {\n const { t } = useTranslation(DEBUG_PLUGIN);\n const [toast, setToast] = useState<Toast>();\n const client = useClient();\n const download = useFileDownload();\n // TODO(mykola): Get updates from other places that change Config.\n const [storageConfig, setStorageConfig] = useState<ConfigProto>({});\n const [upload] = useCapabilities(Capabilities.FileUploader);\n\n useEffect(() => {\n void Storage().then((config) => setStorageConfig(config));\n }, []);\n\n const handleToast = (toast: Toast) => {\n setToast(toast);\n const t = setTimeout(() => setToast(undefined), 5_000);\n return () => clearTimeout(t);\n };\n\n const handleDownload = async () => {\n const data = await client.diagnostics();\n const file = new Blob([JSON.stringify(data, undefined, 2)], { type: 'text/plain' });\n const fileName = `composer-${new Date().toISOString().replace(/\\W/g, '-')}.json`;\n download(file, fileName);\n\n if (upload) {\n const info = await upload(new File([file], fileName), client.spaces.default);\n if (!info) {\n log.error('diagnostics failed to upload to IPFS');\n return;\n }\n handleToast({ title: t('settings uploaded'), description: t('settings uploaded to clipboard') });\n\n // TODO(nf): move to IpfsPlugin?\n const url = client.config.values.runtime!.services!.ipfs!.gateway + '/' + info.cid;\n void navigator.clipboard.writeText(url);\n handleToast({ title: t('settings uploaded'), description: t('settings uploaded to clipboard') });\n log.info('diagnostics', { url });\n }\n };\n\n const handleRepair = async () => {\n try {\n const info = await client.repair();\n setStorageConfig(await Storage());\n handleToast({ title: t('settings repair success'), description: JSON.stringify(info, undefined, 2) });\n } catch (err: any) {\n handleToast({ title: t('settings repair failed'), description: err.message });\n }\n };\n\n return (\n <>\n <DeprecatedFormInput label={t('settings show debug panel')}>\n <Input.Switch checked={settings.debug} onCheckedChange={(checked) => (settings.debug = !!checked)} />\n </DeprecatedFormInput>\n <DeprecatedFormInput label={t('settings show devtools panel')}>\n <Input.Switch checked={settings.devtools} onCheckedChange={(checked) => (settings.devtools = !!checked)} />\n </DeprecatedFormInput>\n <DeprecatedFormInput label={t('settings wireframe')}>\n <Input.Switch checked={settings.wireframe} onCheckedChange={(checked) => (settings.wireframe = !!checked)} />\n </DeprecatedFormInput>\n <DeprecatedFormInput label={t('settings download diagnostics')}>\n <Button onClick={handleDownload}>\n <DownloadSimple className={getSize(5)} />\n </Button>\n </DeprecatedFormInput>\n <DeprecatedFormInput label={t('settings repair')}>\n <Button onClick={handleRepair}>\n <FirstAidKit className={getSize(5)} />\n </Button>\n </DeprecatedFormInput>\n\n {/* TODO(burdon): Move to layout? */}\n {toast && (\n <Toast.Root>\n <Toast.Body>\n <Toast.Title>\n <Gift className={mx(getSize(5), 'inline mr-1')} weight='duotone' />\n <span>{toast.title}</span>\n </Toast.Title>\n {toast.description && <Toast.Description>{toast.description}</Toast.Description>}\n </Toast.Body>\n </Toast.Root>\n )}\n\n <DeprecatedFormInput label={t('settings choose storage adaptor')}>\n <Select.Root\n value={\n Object.entries(StorageAdapters).find(\n ([name, value]) => value === storageConfig?.runtime?.client?.storage?.dataStore,\n )?.[0]\n }\n onValueChange={(value) => {\n if (confirm(t('settings storage adapter changed alert'))) {\n updateConfig(\n storageConfig,\n setStorageConfig,\n ['runtime', 'client', 'storage', 'dataStore'],\n StorageAdapters[value as keyof typeof StorageAdapters],\n );\n }\n }}\n >\n <Select.TriggerButton placeholder={t('settings data store label')} />\n <Select.Portal>\n <Select.Content>\n <Select.Viewport>\n {Object.keys(StorageAdapters).map((key) => (\n <Select.Option key={key} value={key}>\n {t(`settings storage adaptor ${key} label`)}\n </Select.Option>\n ))}\n </Select.Viewport>\n </Select.Content>\n </Select.Portal>\n </Select.Root>\n </DeprecatedFormInput>\n </>\n );\n};\n\nconst updateConfig = (config: ConfigProto, setConfig: (newConfig: ConfigProto) => void, path: string[], value: any) => {\n const storageConfigCopy = JSON.parse(JSON.stringify(config ?? {}));\n setDeep(storageConfigCopy, path, value);\n setConfig(storageConfigCopy);\n queueMicrotask(async () => {\n await SaveConfig(storageConfigCopy);\n });\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { useEffect, useRef, useState } from 'react';\n\nimport { Capabilities, firstIdInPart, useCapability } from '@dxos/app-framework';\nimport { TimeoutError } from '@dxos/async';\nimport { StatsPanel, useStats } from '@dxos/devtools';\nimport { getActiveSpace } from '@dxos/plugin-space';\nimport { StatusBar } from '@dxos/plugin-status-bar';\nimport { ConnectionState } from '@dxos/protocols/proto/dxos/client/services';\nimport { useNetworkStatus } from '@dxos/react-client/mesh';\nimport { Icon } from '@dxos/react-ui';\nimport { mx } from '@dxos/react-ui-theme';\n\nconst styles = {\n success: 'text-sky-300 dark:text-green-700',\n warning: 'text-orange-300 dark:text-orange-600',\n error: 'text-red-300 dark:text-red-600',\n};\n\n// TODO(burdon): Move out of debug plugin.\n// TODO(burdon): Make pluggable (move indicators to relevant plugins).\n// TODO(burdon): Vault heartbeat indicator (global scope)?\n\n/**\n * Ensure light doesn't flicker immediately after start.\n */\n// TODO(burdon): Move to @dxos/async (debounce?)\nconst _timer = (cb: (err?: Error) => void, options?: { min?: number; max?: number }) => {\n const min = options?.min ?? 500;\n let start: number;\n let pending: NodeJS.Timeout;\n let timeout: NodeJS.Timeout;\n return {\n start: () => {\n start = Date.now();\n clearTimeout(pending);\n if (options?.max) {\n clearTimeout(timeout);\n timeout = setTimeout(() => {\n cb(new TimeoutError(options.max));\n }, options.max);\n }\n },\n stop: () => {\n clearTimeout(timeout);\n const delta = Date.now() - start;\n if (delta < min) {\n pending = setTimeout(() => {\n cb();\n }, min - delta);\n }\n },\n };\n};\n\n/**\n * Global error handler.\n */\n// TODO(burdon): Integrate with Sentry?\nconst ErrorIndicator = () => {\n const [, forceUpdate] = useState({});\n const errorRef = useRef<Error>();\n useEffect(() => {\n const errorListener = (event: any) => {\n const error: Error = event.error ?? event.reason;\n if (errorRef.current !== error) {\n errorRef.current = error;\n forceUpdate({});\n }\n };\n\n // TODO(burdon): Register globally?\n // https://developer.mozilla.org/en-US/docs/Web/API/Window/error_event\n window.addEventListener('error', errorListener);\n\n // https://developer.mozilla.org/en-US/docs/Web/API/Window/unhandledrejection_event\n window.addEventListener('unhandledrejection', errorListener);\n\n return () => {\n window.removeEventListener('error', errorListener);\n window.removeEventListener('unhandledrejection', errorListener);\n };\n }, []);\n\n const handleReset = () => {\n errorRef.current = undefined;\n forceUpdate({});\n };\n\n if (errorRef.current) {\n return (\n <StatusBar.Button title={errorRef.current.message} onClick={handleReset}>\n <Icon icon='ph--warning-circle--duotone' size={4} classNames={styles.error} />\n </StatusBar.Button>\n );\n } else {\n return (\n <StatusBar.Item title='No errors.'>\n <Icon icon='ph--check--regular' size={4} />\n </StatusBar.Item>\n );\n }\n};\n\n/**\n * Swarm connection handler.\n */\nconst SwarmIndicator = () => {\n const [state, setState] = useState(0);\n const { swarm } = useNetworkStatus();\n useEffect(() => {\n setState(swarm === ConnectionState.ONLINE ? 0 : 1);\n }, [swarm]);\n\n if (state === 0) {\n return (\n <StatusBar.Item title='Connected to swarm.'>\n <Icon icon='ph--lightning--regular' size={4} />\n </StatusBar.Item>\n );\n } else {\n return (\n <StatusBar.Item title='Disconnected from swarm.'>\n <Icon icon='ph--lightning-slash--regular' size={4} classNames={styles.warning} />\n </StatusBar.Item>\n );\n }\n};\n\n/**\n * Data saving indicator.\n */\n// TODO(burdon): Merge with SaveStatus.\nconst SavingIndicator = () => {\n const [state, _setState] = useState(0);\n const location = useCapability(Capabilities.Location);\n const { graph } = useCapability(Capabilities.AppGraph);\n const _space = location && graph ? getActiveSpace(graph, firstIdInPart(location.active, 'main')) : undefined;\n // TODO(dmaretskyi): Fix this when we have save status for automerge.\n // useEffect(() => {\n // if (!space) {\n // return;\n // }\n // const { start, stop } = timer(() => setState(0), { min: 250 });\n // return space.db.pendingBatch.on(({ duration, error }) => {\n // if (error) {\n // setState(2);\n // stop();\n // } else if (duration === undefined) {\n // setState(1);\n // start();\n // } else {\n // stop();\n // }\n // });\n // }, [space]);\n\n switch (state) {\n case 2:\n return (\n <StatusBar.Item title='Edit not saved.'>\n <Icon icon='ph--circle--duotone' size={4} classNames={styles.warning} />\n </StatusBar.Item>\n );\n case 1:\n return (\n <StatusBar.Item title='Saving...'>\n <Icon icon='ph--circle--duotone' size={4} classNames={styles.success} />\n </StatusBar.Item>\n );\n case 0:\n default:\n return (\n <StatusBar.Item title='Modified indicator.'>\n <Icon icon='ph--circle--duotone' size={4} />\n </StatusBar.Item>\n );\n }\n};\n\nconst PerformanceIndicator = () => {\n const [visible, setVisible] = useState(false);\n const [stats, refreshStats] = useStats();\n\n return (\n <>\n <StatusBar.Button onClick={() => setVisible((visible) => !visible)} title='Performance panels'>\n <Icon icon='ph--chart-bar--regular' size={4} />\n </StatusBar.Button>\n {visible && (\n <div\n className={mx(\n 'z-20 absolute bottom-[--statusbar-size] right-4 w-[450px]',\n 'overflow-x-hidden overflow-y-auto scrollbar-thin',\n 'border-x border-y border-separator',\n )}\n >\n <StatsPanel stats={stats} onRefresh={refreshStats} />\n </div>\n )}\n </>\n );\n};\n\nconst indicators = [SavingIndicator, SwarmIndicator, PerformanceIndicator, ErrorIndicator];\n\nexport const DebugStatus = () => {\n return (\n <>\n {indicators.map((Indicator) => (\n <Indicator key={Indicator.name} />\n ))}\n </>\n );\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React from 'react';\nimport { useResizeDetector } from 'react-resize-detector';\n\nimport { fullyQualifiedId, type ReactiveEchoObject } from '@dxos/react-client/echo';\nimport { type ThemedClassName } from '@dxos/react-ui';\nimport { useAttendableAttributes } from '@dxos/react-ui-attention';\nimport { SyntaxHighlighter } from '@dxos/react-ui-syntax-highlighter';\nimport { mx } from '@dxos/react-ui-theme';\n\n// TODO(burdon): Create generic container with wireframe mode.\nexport type WireframeProps = ThemedClassName<{\n label?: string;\n object: ReactiveEchoObject<any>;\n}>;\n\n// TODO(burdon): Make focusable and attendable with input.\nexport const Wireframe = ({ classNames, label, object }: WireframeProps) => {\n const attendableAttrs = useAttendableAttributes(fullyQualifiedId(object));\n const { width, height, ref } = useResizeDetector();\n return (\n <div ref={ref} className={mx('relative grow min-bs-96', classNames)} {...attendableAttrs}>\n <div className='absolute inset-2 flex flex-col gap-2 overflow-hidden font-mono'>\n <div className='flex justify-between'>\n <div>{label}</div>\n <div>{`[${width}x${height}]`}</div>\n </div>\n {object && (\n <SyntaxHighlighter language='json' classNames='flex w-full text-xs opacity-75 rounded'>\n {JSON.stringify(object, undefined, 2)}\n </SyntaxHighlighter>\n )}\n </div>\n <svg width={width} height={height} className='bg-transparent [&>*]:text-subdued'>\n <rect x={0} y={0} width={width} height={height} strokeWidth={1} fill='none' />\n <line x1={0} y1={0} x2={width} y2={height} strokeWidth={1} />\n <line x1={0} y1={height} x2={width} y2={0} strokeWidth={1} />\n </svg>\n </div>\n );\n};\n"],
5
+ "mappings": ";;;;;AAIA,OAAOA,UAASC,mBAAmB;AAEnC,SACEC,gBAAAA,eACAC,aACAC,cACAC,eACAC,iBAAAA,sBAEK;AACP,SAASC,gBAAgB;AACzB,SAASC,aAAa;AACtB,SAASC,aAAaC,sBAAsB;AAC5C,SACEC,YACAC,SACAC,oBAIK;;;ACpBP,SAASC,YAAY;;;ACArB,OAAOC,WAAW;AAGlB,SAASC,WAAWC,aAAa;AACjC,SAASC,yBAAyB;AAO3B,IAAMC,mBAAmB,CAAC,EAAEC,OAAM,MAAyB;AAChE,QAAMC,MAAM,cAAcD,OAAOE,EAAE;AACnC,SACE,sBAAA,cAACC,UAAUC,UAAQ,MACjB,sBA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contributes", "createIntent", "createSurface", "useCapability", "Devtools", "Graph", "SpaceAction", "CollectionType", "SpaceState", "isSpace", "isEchoObject", "lazy", "React", "Clipboard", "Input", "SyntaxHighlighter", "DebugObjectPanel", "object", "dxn", "id", "Clipboard", "Provider", "div", "className", "Input", "Root", "role", "TextInput", "disabled", "value", "IconButton", "SyntaxHighlighter", "classNames", "language", "JSON", "stringify", "Gift", "DownloadSimple", "FirstAidKit", "React", "useEffect", "useState", "Capabilities", "useCapabilities", "defs", "SaveConfig", "Storage", "log", "useClient", "useTranslation", "Button", "Toast", "Input", "useFileDownload", "Select", "DeprecatedFormInput", "getSize", "mx", "setDeep", "StorageAdapters", "opfs", "defs", "Runtime", "Client", "Storage", "StorageDriver", "WEBFS", "idb", "IDB", "DebugSettings", "settings", "t", "useTranslation", "DEBUG_PLUGIN", "toast", "setToast", "useState", "client", "useClient", "download", "useFileDownload", "storageConfig", "setStorageConfig", "upload", "useCapabilities", "Capabilities", "FileUploader", "useEffect", "then", "config", "handleToast", "setTimeout", "undefined", "clearTimeout", "handleDownload", "data", "diagnostics", "file", "Blob", "JSON", "stringify", "type", "fileName", "Date", "toISOString", "replace", "info", "File", "spaces", "default", "log", "error", "title", "description", "url", "values", "runtime", "services", "ipfs", "gateway", "cid", "navigator", "clipboard", "writeText", "handleRepair", "repair", "err", "message", "React", "DeprecatedFormInput", "label", "Input", "Switch", "checked", "debug", "onCheckedChange", "devtools", "wireframe", "Button", "onClick", "DownloadSimple", "className", "getSize", "FirstAidKit", "Toast", "Root", "Body", "Title", "Gift", "mx", "weight", "span", "Description", "Select", "value", "Object", "entries", "find", "name", "storage", "dataStore", "onValueChange", "confirm", "updateConfig", "TriggerButton", "placeholder", "Portal", "Content", "Viewport", "keys", "map", "key", "Option", "setConfig", "path", "storageConfigCopy", "parse", "setDeep", "queueMicrotask", "SaveConfig", "React", "useEffect", "useRef", "useState", "Capabilities", "firstIdInPart", "useCapability", "TimeoutError", "StatsPanel", "useStats", "getActiveSpace", "StatusBar", "ConnectionState", "useNetworkStatus", "Icon", "mx", "styles", "success", "warning", "error", "ErrorIndicator", "forceUpdate", "useState", "errorRef", "useRef", "useEffect", "errorListener", "event", "error", "reason", "current", "window", "addEventListener", "removeEventListener", "handleReset", "undefined", "React", "StatusBar", "Button", "title", "message", "onClick", "Icon", "icon", "size", "classNames", "styles", "Item", "SwarmIndicator", "state", "setState", "swarm", "useNetworkStatus", "ConnectionState", "ONLINE", "warning", "SavingIndicator", "_setState", "location", "useCapability", "Capabilities", "Location", "graph", "AppGraph", "_space", "getActiveSpace", "firstIdInPart", "active", "success", "PerformanceIndicator", "visible", "setVisible", "stats", "refreshStats", "useStats", "div", "className", "mx", "StatsPanel", "onRefresh", "indicators", "DebugStatus", "map", "Indicator", "key", "name", "React", "useResizeDetector", "fullyQualifiedId", "useAttendableAttributes", "SyntaxHighlighter", "mx", "Wireframe", "classNames", "label", "object", "attendableAttrs", "useAttendableAttributes", "fullyQualifiedId", "width", "height", "ref", "useResizeDetector", "React", "div", "className", "mx", "SyntaxHighlighter", "language", "JSON", "stringify", "undefined", "svg", "rect", "x", "y", "strokeWidth", "fill", "line", "x1", "y1", "x2", "y2", "DebugApp", "lazy", "DebugSpace", "SpaceGenerator", "isSpaceDebug", "data", "type", "DEBUG_PLUGIN", "isSpace", "space", "isGraphDebug", "graph", "Graph", "context", "contributes", "Capabilities", "ReactSurface", "createSurface", "id", "role", "filter", "subject", "component", "settings", "useCapability", "SettingsStore", "getStore", "value", "React", "DebugSettings", "DebugStatus", "isEchoObject", "DebugObjectPanel", "object", "requestCapability", "devtools", "Devtools", "handleCreateObject", "useCallback", "objects", "collection", "state", "get", "SpaceState", "SPACE_READY", "properties", "CollectionType", "typename", "target", "dispatchPromise", "dispatch", "IntentDispatcher", "forEach", "createIntent", "SpaceAction", "AddObject", "deprecated", "DebugSpace", "onAddObjects", "SpaceGenerator", "onCreateObjects", "DebugApp", "disposition", "wireframe", "Wireframe", "label", "name", "classNames"]
7
+ }
@@ -0,0 +1,25 @@
1
+ import {
2
+ DebugSettingsSchema
3
+ } from "./chunk-P7GHHMDB.mjs";
4
+ import {
5
+ DEBUG_PLUGIN
6
+ } from "./chunk-I3ON45JK.mjs";
7
+
8
+ // packages/plugins/plugin-debug/src/capabilities/settings.ts
9
+ import { Capabilities, contributes } from "@dxos/app-framework";
10
+ import { create } from "@dxos/react-client/echo";
11
+ var settings_default = () => {
12
+ const settings = create({
13
+ debug: true,
14
+ devtools: true
15
+ });
16
+ return contributes(Capabilities.Settings, {
17
+ schema: DebugSettingsSchema,
18
+ prefix: DEBUG_PLUGIN,
19
+ value: settings
20
+ });
21
+ };
22
+ export {
23
+ settings_default as default
24
+ };
25
+ //# sourceMappingURL=settings-JCZUA643.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/capabilities/settings.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capabilities, contributes } from '@dxos/app-framework';\nimport { create } from '@dxos/react-client/echo';\n\nimport { DEBUG_PLUGIN } from '../meta';\nimport { type DebugSettingsProps, DebugSettingsSchema } from '../types';\n\nexport default () => {\n const settings = create<DebugSettingsProps>({\n debug: true,\n devtools: true,\n });\n\n return contributes(Capabilities.Settings, { schema: DebugSettingsSchema, prefix: DEBUG_PLUGIN, value: settings });\n};\n"],
5
+ "mappings": ";;;;;;;;AAIA,SAASA,cAAcC,mBAAmB;AAC1C,SAASC,cAAc;AAKvB,IAAA,mBAAe,MAAA;AACb,QAAMC,WAAWC,OAA2B;IAC1CC,OAAO;IACPC,UAAU;EACZ,CAAA;AAEA,SAAOC,YAAYC,aAAaC,UAAU;IAAEC,QAAQC;IAAqBC,QAAQC;IAAcC,OAAOX;EAAS,CAAA;AACjH;",
6
+ "names": ["Capabilities", "contributes", "create", "settings", "create", "debug", "devtools", "contributes", "Capabilities", "Settings", "schema", "DebugSettingsSchema", "prefix", "DEBUG_PLUGIN", "value"]
7
+ }
@@ -1,3 +1,2 @@
1
- import { type DebugPluginProvides } from './types';
2
- export declare const DebugPlugin: () => import("@dxos/app-framework").PluginDefinition<DebugPluginProvides>;
1
+ export declare const DebugPlugin: () => import("@dxos/app-framework").Plugin;
3
2
  //# sourceMappingURL=DebugPlugin.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DebugPlugin.d.ts","sourceRoot":"","sources":["../../../src/DebugPlugin.tsx"],"names":[],"mappings":"AAmDA,OAAO,EAGL,KAAK,mBAAmB,EAGzB,MAAM,SAAS,CAAC;AAEjB,eAAO,MAAM,WAAW,2EA0UtB,CAAC"}
1
+ {"version":3,"file":"DebugPlugin.d.ts","sourceRoot":"","sources":["../../../src/DebugPlugin.tsx"],"names":[],"mappings":"AAYA,eAAO,MAAM,WAAW,4CAwCvB,CAAC"}