@dxos/plugin-debug 0.7.4 → 0.7.5-labs.401163d

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 (81) 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-KYSK77VG.mjs +1100 -0
  6. package/dist/lib/browser/SpaceGenerator-KYSK77VG.mjs.map +7 -0
  7. package/dist/lib/browser/app-graph-builder-DCMGZAT3.mjs +181 -0
  8. package/dist/lib/browser/app-graph-builder-DCMGZAT3.mjs.map +7 -0
  9. package/dist/lib/browser/chunk-EF3UVAVI.mjs +21 -0
  10. package/dist/lib/browser/chunk-EF3UVAVI.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 +60 -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-surface-6GVTLM4O.mjs +484 -0
  17. package/dist/lib/browser/react-surface-6GVTLM4O.mjs.map +7 -0
  18. package/dist/lib/browser/settings-OIMSBZUC.mjs +25 -0
  19. package/dist/lib/browser/settings-OIMSBZUC.mjs.map +7 -0
  20. package/dist/types/src/DebugPlugin.d.ts +1 -2
  21. package/dist/types/src/DebugPlugin.d.ts.map +1 -1
  22. package/dist/types/src/capabilities/app-graph-builder.d.ts +181 -0
  23. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -0
  24. package/dist/types/src/capabilities/index.d.ts +180 -0
  25. package/dist/types/src/capabilities/index.d.ts.map +1 -0
  26. package/dist/types/src/capabilities/react-surface.d.ts +4 -0
  27. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
  28. package/dist/types/src/capabilities/settings.d.ts +4 -0
  29. package/dist/types/src/capabilities/settings.d.ts.map +1 -0
  30. package/dist/types/src/components/DebugObjectPanel.d.ts.map +1 -1
  31. package/dist/types/src/components/DebugSettings.d.ts.map +1 -1
  32. package/dist/types/src/components/DebugSpace/DebugSpace.stories.d.ts.map +1 -1
  33. package/dist/types/src/components/DebugSpace/ObjectCreator.stories.d.ts.map +1 -1
  34. package/dist/types/src/components/DebugStatus.d.ts.map +1 -1
  35. package/dist/types/src/components/SpaceGenerator/ObjectGenerator.d.ts +2 -2
  36. package/dist/types/src/components/SpaceGenerator/ObjectGenerator.d.ts.map +1 -1
  37. package/dist/types/src/components/SpaceGenerator/SpaceGenerator.d.ts.map +1 -1
  38. package/dist/types/src/components/SpaceGenerator/draw-util.d.ts.map +1 -1
  39. package/dist/types/src/components/SpaceGenerator/presets.d.ts +21 -0
  40. package/dist/types/src/components/SpaceGenerator/presets.d.ts.map +1 -0
  41. package/dist/types/src/components/Wireframe.d.ts +2 -1
  42. package/dist/types/src/components/Wireframe.d.ts.map +1 -1
  43. package/dist/types/src/index.d.ts +1 -2
  44. package/dist/types/src/index.d.ts.map +1 -1
  45. package/dist/types/src/meta.d.ts +2 -2
  46. package/dist/types/src/meta.d.ts.map +1 -1
  47. package/dist/types/src/types.d.ts +0 -6
  48. package/dist/types/src/types.d.ts.map +1 -1
  49. package/dist/types/tsconfig.tsbuildinfo +1 -0
  50. package/package.json +49 -51
  51. package/src/DebugPlugin.tsx +55 -381
  52. package/src/capabilities/app-graph-builder.ts +175 -0
  53. package/src/capabilities/index.ts +9 -0
  54. package/src/capabilities/react-surface.tsx +130 -0
  55. package/src/capabilities/settings.ts +18 -0
  56. package/src/components/DebugApp/DebugApp.tsx +1 -1
  57. package/src/components/DebugObjectPanel.tsx +17 -5
  58. package/src/components/DebugSettings.tsx +11 -13
  59. package/src/components/DebugSpace/DebugSpace.stories.tsx +4 -3
  60. package/src/components/DebugSpace/DebugSpace.tsx +1 -1
  61. package/src/components/DebugSpace/ObjectCreator.stories.tsx +4 -3
  62. package/src/components/DebugStatus.tsx +17 -27
  63. package/src/components/SpaceGenerator/ObjectGenerator.tsx +45 -18
  64. package/src/components/SpaceGenerator/SpaceGenerator.tsx +11 -8
  65. package/src/components/SpaceGenerator/draw-util.ts +7 -6
  66. package/src/components/SpaceGenerator/presets.ts +493 -0
  67. package/src/components/Wireframe.tsx +2 -2
  68. package/src/index.ts +1 -4
  69. package/src/meta.ts +4 -2
  70. package/src/types.ts +0 -22
  71. package/dist/lib/browser/DebugSpace-DHKEAMIC.mjs.map +0 -7
  72. package/dist/lib/browser/SpaceGenerator-BQ3645OS.mjs +0 -273
  73. package/dist/lib/browser/SpaceGenerator-BQ3645OS.mjs.map +0 -7
  74. package/dist/lib/browser/chunk-CAENAAHY.mjs +0 -18
  75. package/dist/lib/browser/chunk-CAENAAHY.mjs.map +0 -7
  76. package/dist/lib/browser/chunk-LZEK532R.mjs.map +0 -7
  77. package/dist/lib/browser/meta.mjs +0 -9
  78. package/dist/lib/browser/meta.mjs.map +0 -7
  79. package/dist/types/src/components/DebugSurface.d.ts +0 -9
  80. package/dist/types/src/components/DebugSurface.d.ts.map +0 -1
  81. package/src/components/DebugSurface.tsx +0 -55
@@ -0,0 +1,484 @@
1
+ import {
2
+ DEBUG_PLUGIN
3
+ } from "./chunk-EF3UVAVI.mjs";
4
+
5
+ // packages/plugins/plugin-debug/src/capabilities/react-surface.tsx
6
+ import React5, { useCallback } from "react";
7
+ import { Capabilities as Capabilities2, contributes, createIntent, createSurface } from "@dxos/app-framework";
8
+ import { Devtools } from "@dxos/devtools";
9
+ import { SettingsStore } from "@dxos/local-storage";
10
+ import { Graph } from "@dxos/plugin-graph";
11
+ import { SpaceAction, CollectionType } from "@dxos/plugin-space/types";
12
+ import { SpaceState, isSpace, isEchoObject } from "@dxos/react-client/echo";
13
+
14
+ // packages/plugins/plugin-debug/src/components/index.ts
15
+ import { lazy } from "react";
16
+
17
+ // packages/plugins/plugin-debug/src/components/DebugObjectPanel.tsx
18
+ import React from "react";
19
+ import { Clipboard, Input } from "@dxos/react-ui";
20
+ import { SyntaxHighlighter } from "@dxos/react-ui-syntax-highlighter";
21
+ var DebugObjectPanel = ({ object }) => {
22
+ const dxn = `dxn:echo:@:${object.id}`;
23
+ return /* @__PURE__ */ React.createElement(Clipboard.Provider, null, /* @__PURE__ */ React.createElement("div", {
24
+ className: "flex flex-col"
25
+ }, /* @__PURE__ */ React.createElement(Input.Root, null, /* @__PURE__ */ React.createElement("div", {
26
+ role: "none",
27
+ className: "flex flex-col gap-1"
28
+ }, /* @__PURE__ */ React.createElement("div", {
29
+ role: "none",
30
+ className: "flex gap-1"
31
+ }, /* @__PURE__ */ React.createElement(Input.TextInput, {
32
+ disabled: true,
33
+ value: dxn
34
+ }), /* @__PURE__ */ React.createElement(Clipboard.IconButton, {
35
+ value: dxn
36
+ })))), /* @__PURE__ */ React.createElement(SyntaxHighlighter, {
37
+ classNames: "flex text-xs",
38
+ language: "json"
39
+ }, JSON.stringify(object, null, 2))));
40
+ };
41
+
42
+ // packages/plugins/plugin-debug/src/components/DebugSettings.tsx
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, Icon } from "@dxos/react-ui";
49
+ import { DeprecatedFormContainer, DeprecatedFormInput } from "@dxos/react-ui-form";
50
+ import { setDeep } from "@dxos/util";
51
+ var __dxlog_file = "/home/runner/work/dxos/dxos/packages/plugins/plugin-debug/src/components/DebugSettings.tsx";
52
+ var StorageAdapters = {
53
+ opfs: defs.Runtime.Client.Storage.StorageDriver.WEBFS,
54
+ idb: defs.Runtime.Client.Storage.StorageDriver.IDB
55
+ };
56
+ var DebugSettings = ({ settings }) => {
57
+ const { t } = useTranslation(DEBUG_PLUGIN);
58
+ const [toast, setToast] = useState();
59
+ const client = useClient();
60
+ const download = useFileDownload();
61
+ const [storageConfig, setStorageConfig] = useState({});
62
+ const [upload] = useCapabilities(Capabilities.FileUploader);
63
+ useEffect(() => {
64
+ void Storage().then((config) => setStorageConfig(config));
65
+ }, []);
66
+ const handleToast = (toast2) => {
67
+ setToast(toast2);
68
+ const t2 = setTimeout(() => setToast(void 0), 5e3);
69
+ return () => clearTimeout(t2);
70
+ };
71
+ const handleDownload = async () => {
72
+ const data = await client.diagnostics();
73
+ const file = new Blob([
74
+ JSON.stringify(data, void 0, 2)
75
+ ], {
76
+ type: "text/plain"
77
+ });
78
+ const fileName = `composer-${(/* @__PURE__ */ new Date()).toISOString().replace(/\W/g, "-")}.json`;
79
+ download(file, fileName);
80
+ if (upload) {
81
+ const info = await upload(new File([
82
+ file
83
+ ], fileName), client.spaces.default);
84
+ if (!info) {
85
+ log.error("diagnostics failed to upload to IPFS", void 0, {
86
+ F: __dxlog_file,
87
+ L: 56,
88
+ S: void 0,
89
+ C: (f, a) => f(...a)
90
+ });
91
+ return;
92
+ }
93
+ handleToast({
94
+ title: t("settings uploaded"),
95
+ description: t("settings uploaded to clipboard")
96
+ });
97
+ const url = client.config.values.runtime.services.ipfs.gateway + "/" + info.cid;
98
+ void navigator.clipboard.writeText(url);
99
+ handleToast({
100
+ title: t("settings uploaded"),
101
+ description: t("settings uploaded to clipboard")
102
+ });
103
+ log.info("diagnostics", {
104
+ url
105
+ }, {
106
+ F: __dxlog_file,
107
+ L: 65,
108
+ S: void 0,
109
+ C: (f, a) => f(...a)
110
+ });
111
+ }
112
+ };
113
+ const handleRepair = async () => {
114
+ try {
115
+ const info = await client.repair();
116
+ setStorageConfig(await Storage());
117
+ handleToast({
118
+ title: t("settings repair success"),
119
+ description: JSON.stringify(info, void 0, 2)
120
+ });
121
+ } catch (err) {
122
+ handleToast({
123
+ title: t("settings repair failed"),
124
+ description: err.message
125
+ });
126
+ }
127
+ };
128
+ return /* @__PURE__ */ React2.createElement(DeprecatedFormContainer, null, /* @__PURE__ */ React2.createElement(DeprecatedFormInput, {
129
+ label: t("settings show debug panel")
130
+ }, /* @__PURE__ */ React2.createElement(Input2.Switch, {
131
+ checked: settings.debug,
132
+ onCheckedChange: (checked) => settings.debug = !!checked
133
+ })), /* @__PURE__ */ React2.createElement(DeprecatedFormInput, {
134
+ label: t("settings show devtools panel")
135
+ }, /* @__PURE__ */ React2.createElement(Input2.Switch, {
136
+ checked: settings.devtools,
137
+ onCheckedChange: (checked) => settings.devtools = !!checked
138
+ })), /* @__PURE__ */ React2.createElement(DeprecatedFormInput, {
139
+ label: t("settings wireframe")
140
+ }, /* @__PURE__ */ React2.createElement(Input2.Switch, {
141
+ checked: settings.wireframe,
142
+ onCheckedChange: (checked) => settings.wireframe = !!checked
143
+ })), /* @__PURE__ */ React2.createElement(DeprecatedFormInput, {
144
+ label: t("settings download diagnostics")
145
+ }, /* @__PURE__ */ React2.createElement(Button, {
146
+ onClick: handleDownload
147
+ }, /* @__PURE__ */ React2.createElement(Icon, {
148
+ icon: "ph--download-simple--regular",
149
+ size: 5
150
+ }))), /* @__PURE__ */ React2.createElement(DeprecatedFormInput, {
151
+ label: t("settings repair")
152
+ }, /* @__PURE__ */ React2.createElement(Button, {
153
+ onClick: handleRepair
154
+ }, /* @__PURE__ */ React2.createElement(Icon, {
155
+ icon: "ph--first-aid-kit--regular",
156
+ size: 5
157
+ }))), toast && /* @__PURE__ */ React2.createElement(Toast.Root, null, /* @__PURE__ */ React2.createElement(Toast.Body, null, /* @__PURE__ */ React2.createElement(Toast.Title, null, /* @__PURE__ */ React2.createElement(Icon, {
158
+ icon: "ph--gift--duotone",
159
+ size: 5,
160
+ classNames: "inline mr-1"
161
+ }), /* @__PURE__ */ React2.createElement("span", null, toast.title)), toast.description && /* @__PURE__ */ React2.createElement(Toast.Description, null, toast.description))), /* @__PURE__ */ React2.createElement(DeprecatedFormInput, {
162
+ label: t("settings choose storage adaptor")
163
+ }, /* @__PURE__ */ React2.createElement(Select.Root, {
164
+ value: Object.entries(StorageAdapters).find(([name2, value]) => value === storageConfig?.runtime?.client?.storage?.dataStore)?.[0],
165
+ onValueChange: (value) => {
166
+ if (confirm(t("settings storage adapter changed alert"))) {
167
+ updateConfig(storageConfig, setStorageConfig, [
168
+ "runtime",
169
+ "client",
170
+ "storage",
171
+ "dataStore"
172
+ ], StorageAdapters[value]);
173
+ }
174
+ }
175
+ }, /* @__PURE__ */ React2.createElement(Select.TriggerButton, {
176
+ placeholder: t("settings data store label")
177
+ }), /* @__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, {
178
+ key,
179
+ value: key
180
+ }, t(`settings storage adaptor ${key} label`)))))))));
181
+ };
182
+ var updateConfig = (config, setConfig, path, value) => {
183
+ const storageConfigCopy = JSON.parse(JSON.stringify(config ?? {}));
184
+ setDeep(storageConfigCopy, path, value);
185
+ setConfig(storageConfigCopy);
186
+ queueMicrotask(async () => {
187
+ await SaveConfig(storageConfigCopy);
188
+ });
189
+ };
190
+
191
+ // packages/plugins/plugin-debug/src/components/DebugStatus.tsx
192
+ import React3, { useEffect as useEffect2, useRef, useState as useState2 } from "react";
193
+ import { useAppGraph, useLayout } from "@dxos/app-framework";
194
+ import { TimeoutError } from "@dxos/async";
195
+ import { StatsPanel, useStats } from "@dxos/devtools";
196
+ import { getActiveSpace } from "@dxos/plugin-space";
197
+ import { StatusBar } from "@dxos/plugin-status-bar";
198
+ import { ConnectionState } from "@dxos/protocols/proto/dxos/client/services";
199
+ import { useNetworkStatus } from "@dxos/react-client/mesh";
200
+ import { Icon as Icon2, Popover } from "@dxos/react-ui";
201
+ var styles = {
202
+ success: "text-sky-300 dark:text-green-700",
203
+ warning: "text-orange-300 dark:text-orange-600",
204
+ error: "text-red-300 dark:text-red-600"
205
+ };
206
+ var ErrorIndicator = () => {
207
+ const [, forceUpdate] = useState2({});
208
+ const errorRef = useRef();
209
+ useEffect2(() => {
210
+ const errorListener = (event) => {
211
+ const error = event.error ?? event.reason;
212
+ if (errorRef.current !== error) {
213
+ errorRef.current = error;
214
+ forceUpdate({});
215
+ }
216
+ };
217
+ window.addEventListener("error", errorListener);
218
+ window.addEventListener("unhandledrejection", errorListener);
219
+ return () => {
220
+ window.removeEventListener("error", errorListener);
221
+ window.removeEventListener("unhandledrejection", errorListener);
222
+ };
223
+ }, []);
224
+ const handleReset = () => {
225
+ errorRef.current = void 0;
226
+ forceUpdate({});
227
+ };
228
+ if (errorRef.current) {
229
+ return /* @__PURE__ */ React3.createElement(StatusBar.Button, {
230
+ title: errorRef.current.message,
231
+ onClick: handleReset
232
+ }, /* @__PURE__ */ React3.createElement(Icon2, {
233
+ icon: "ph--warning-circle--duotone",
234
+ size: 4,
235
+ classNames: styles.error
236
+ }));
237
+ } else {
238
+ return /* @__PURE__ */ React3.createElement(StatusBar.Item, {
239
+ title: "No errors."
240
+ }, /* @__PURE__ */ React3.createElement(Icon2, {
241
+ icon: "ph--check--regular",
242
+ size: 4
243
+ }));
244
+ }
245
+ };
246
+ var SwarmIndicator = () => {
247
+ const [state, setState] = useState2(0);
248
+ const { swarm } = useNetworkStatus();
249
+ useEffect2(() => {
250
+ setState(swarm === ConnectionState.ONLINE ? 0 : 1);
251
+ }, [
252
+ swarm
253
+ ]);
254
+ if (state === 0) {
255
+ return /* @__PURE__ */ React3.createElement(StatusBar.Item, {
256
+ title: "Connected to swarm."
257
+ }, /* @__PURE__ */ React3.createElement(Icon2, {
258
+ icon: "ph--lightning--regular",
259
+ size: 4
260
+ }));
261
+ } else {
262
+ return /* @__PURE__ */ React3.createElement(StatusBar.Item, {
263
+ title: "Disconnected from swarm."
264
+ }, /* @__PURE__ */ React3.createElement(Icon2, {
265
+ icon: "ph--lightning-slash--regular",
266
+ size: 4,
267
+ classNames: styles.warning
268
+ }));
269
+ }
270
+ };
271
+ var SavingIndicator = () => {
272
+ const [state, _setState] = useState2(0);
273
+ const layout = useLayout();
274
+ const { graph } = useAppGraph();
275
+ const _space = graph ? getActiveSpace(graph, layout.active[0]) : void 0;
276
+ switch (state) {
277
+ case 2:
278
+ return /* @__PURE__ */ React3.createElement(StatusBar.Item, {
279
+ title: "Edit not saved."
280
+ }, /* @__PURE__ */ React3.createElement(Icon2, {
281
+ icon: "ph--circle--duotone",
282
+ size: 4,
283
+ classNames: styles.warning
284
+ }));
285
+ case 1:
286
+ return /* @__PURE__ */ React3.createElement(StatusBar.Item, {
287
+ title: "Saving..."
288
+ }, /* @__PURE__ */ React3.createElement(Icon2, {
289
+ icon: "ph--circle--duotone",
290
+ size: 4,
291
+ classNames: styles.success
292
+ }));
293
+ case 0:
294
+ default:
295
+ return /* @__PURE__ */ React3.createElement(StatusBar.Item, {
296
+ title: "Modified indicator."
297
+ }, /* @__PURE__ */ React3.createElement(Icon2, {
298
+ icon: "ph--circle--duotone",
299
+ size: 4
300
+ }));
301
+ }
302
+ };
303
+ var PerformanceIndicator = () => {
304
+ const [visible, setVisible] = useState2(false);
305
+ const [stats, refreshStats] = useStats();
306
+ return /* @__PURE__ */ React3.createElement(Popover.Root, {
307
+ open: visible,
308
+ onOpenChange: setVisible
309
+ }, /* @__PURE__ */ React3.createElement(Popover.Trigger, {
310
+ asChild: true
311
+ }, /* @__PURE__ */ React3.createElement(StatusBar.Button, {
312
+ onClick: () => setVisible((visible2) => !visible2),
313
+ title: "Performance panels"
314
+ }, /* @__PURE__ */ React3.createElement(Icon2, {
315
+ icon: "ph--chart-bar--regular",
316
+ size: 4
317
+ }))), /* @__PURE__ */ React3.createElement(Popover.Portal, null, /* @__PURE__ */ React3.createElement(Popover.Content, {
318
+ classNames: "max-is-[min(var(--radix-popover-content-available-width),300px)] max-bs-[--radix-popover-content-available-height]"
319
+ }, /* @__PURE__ */ React3.createElement(StatsPanel, {
320
+ stats,
321
+ onRefresh: refreshStats
322
+ }), /* @__PURE__ */ React3.createElement(Popover.Arrow, null))));
323
+ };
324
+ var indicators = [
325
+ SavingIndicator,
326
+ SwarmIndicator,
327
+ PerformanceIndicator,
328
+ ErrorIndicator
329
+ ];
330
+ var DebugStatus = () => {
331
+ return /* @__PURE__ */ React3.createElement(React3.Fragment, null, indicators.map((Indicator) => /* @__PURE__ */ React3.createElement(Indicator, {
332
+ key: Indicator.name
333
+ })));
334
+ };
335
+
336
+ // packages/plugins/plugin-debug/src/components/Wireframe.tsx
337
+ import React4 from "react";
338
+ import { useResizeDetector } from "react-resize-detector";
339
+ import { fullyQualifiedId } from "@dxos/react-client/echo";
340
+ import { useAttendableAttributes } from "@dxos/react-ui-attention";
341
+ import { SyntaxHighlighter as SyntaxHighlighter2 } from "@dxos/react-ui-syntax-highlighter";
342
+ import { mx } from "@dxos/react-ui-theme";
343
+ var Wireframe = ({ classNames, label, object }) => {
344
+ const attendableAttrs = useAttendableAttributes(fullyQualifiedId(object));
345
+ const { width, height, ref } = useResizeDetector();
346
+ return /* @__PURE__ */ React4.createElement("div", {
347
+ ref,
348
+ className: mx("relative grow min-bs-96", classNames),
349
+ ...attendableAttrs
350
+ }, /* @__PURE__ */ React4.createElement("div", {
351
+ className: "absolute inset-2 flex flex-col gap-2 overflow-hidden font-mono"
352
+ }, /* @__PURE__ */ React4.createElement("div", {
353
+ className: "flex justify-between"
354
+ }, /* @__PURE__ */ React4.createElement("div", null, label), /* @__PURE__ */ React4.createElement("div", null, `[${width}x${height}]`)), object && /* @__PURE__ */ React4.createElement(SyntaxHighlighter2, {
355
+ language: "json",
356
+ classNames: "flex w-full text-xs opacity-75 rounded"
357
+ }, JSON.stringify(object, void 0, 2))), /* @__PURE__ */ React4.createElement("svg", {
358
+ width,
359
+ height,
360
+ className: "bg-transparent [&>*]:text-subdued"
361
+ }, /* @__PURE__ */ React4.createElement("rect", {
362
+ x: 0,
363
+ y: 0,
364
+ width,
365
+ height,
366
+ strokeWidth: 1,
367
+ fill: "none"
368
+ }), /* @__PURE__ */ React4.createElement("line", {
369
+ x1: 0,
370
+ y1: 0,
371
+ x2: width,
372
+ y2: height,
373
+ strokeWidth: 1
374
+ }), /* @__PURE__ */ React4.createElement("line", {
375
+ x1: 0,
376
+ y1: height,
377
+ x2: width,
378
+ y2: 0,
379
+ strokeWidth: 1
380
+ })));
381
+ };
382
+
383
+ // packages/plugins/plugin-debug/src/components/index.ts
384
+ var DebugApp = lazy(() => import("./DebugApp-LQHFFK3Y.mjs"));
385
+ var DebugSpace = lazy(() => import("./DebugSpace-4JHYA7FG.mjs"));
386
+ var SpaceGenerator = lazy(() => import("./SpaceGenerator-KYSK77VG.mjs"));
387
+
388
+ // packages/plugins/plugin-debug/src/capabilities/react-surface.tsx
389
+ var isSpaceDebug = (data) => data.type === `${DEBUG_PLUGIN}/space` && isSpace(data.space);
390
+ var isGraphDebug = (data) => data.graph instanceof Graph;
391
+ var react_surface_default = (context) => contributes(Capabilities2.ReactSurface, [
392
+ createSurface({
393
+ id: `${DEBUG_PLUGIN}/settings`,
394
+ role: "article",
395
+ filter: (data) => data.subject instanceof SettingsStore && data.subject.prefix === DEBUG_PLUGIN,
396
+ component: ({ data: { subject } }) => /* @__PURE__ */ React5.createElement(DebugSettings, {
397
+ settings: subject.value
398
+ })
399
+ }),
400
+ createSurface({
401
+ id: `${DEBUG_PLUGIN}/status`,
402
+ role: "status",
403
+ component: () => /* @__PURE__ */ React5.createElement(DebugStatus, null)
404
+ }),
405
+ createSurface({
406
+ id: `${DEBUG_PLUGIN}/complementary`,
407
+ role: "complementary--debug",
408
+ filter: (data) => isEchoObject(data.subject),
409
+ component: ({ data }) => /* @__PURE__ */ React5.createElement(DebugObjectPanel, {
410
+ object: data.subject
411
+ })
412
+ }),
413
+ createSurface({
414
+ id: `${DEBUG_PLUGIN}/devtools`,
415
+ role: "article",
416
+ filter: (data) => {
417
+ const settings = context.requestCapability(Capabilities2.SettingsStore).getStore(DEBUG_PLUGIN).value;
418
+ return data.subject === "devtools" && !!settings.devtools;
419
+ },
420
+ component: () => /* @__PURE__ */ React5.createElement(Devtools, null)
421
+ }),
422
+ createSurface({
423
+ id: `${DEBUG_PLUGIN}/space`,
424
+ role: "article",
425
+ filter: (data) => isSpaceDebug(data.subject),
426
+ component: ({ data }) => {
427
+ const handleCreateObject = useCallback((objects) => {
428
+ if (!isSpace(data.subject.space)) {
429
+ return;
430
+ }
431
+ const collection = data.subject.space.state.get() === SpaceState.SPACE_READY && data.subject.space.properties[CollectionType.typename]?.target;
432
+ if (!(collection instanceof CollectionType)) {
433
+ return;
434
+ }
435
+ const { dispatchPromise: dispatch } = context.requestCapability(Capabilities2.IntentDispatcher);
436
+ objects.forEach((object) => {
437
+ void dispatch(createIntent(SpaceAction.AddObject, {
438
+ target: collection,
439
+ object
440
+ }));
441
+ });
442
+ }, [
443
+ data.subject.space
444
+ ]);
445
+ const deprecated = false;
446
+ return deprecated ? /* @__PURE__ */ React5.createElement(DebugSpace, {
447
+ space: data.subject.space,
448
+ onAddObjects: handleCreateObject
449
+ }) : /* @__PURE__ */ React5.createElement(SpaceGenerator, {
450
+ space: data.subject.space,
451
+ onCreateObjects: handleCreateObject
452
+ });
453
+ }
454
+ }),
455
+ createSurface({
456
+ id: `${DEBUG_PLUGIN}/graph`,
457
+ role: "article",
458
+ filter: (data) => isGraphDebug(data.subject),
459
+ component: ({ data }) => /* @__PURE__ */ React5.createElement(DebugApp, {
460
+ graph: data.subject.graph
461
+ })
462
+ }),
463
+ createSurface({
464
+ id: `${DEBUG_PLUGIN}/wireframe`,
465
+ role: [
466
+ "article",
467
+ "section"
468
+ ],
469
+ position: "hoist",
470
+ filter: (data) => {
471
+ const settings = context.requestCapability(Capabilities2.SettingsStore).getStore(DEBUG_PLUGIN).value;
472
+ return isEchoObject(data.subject) && !!settings.wireframe;
473
+ },
474
+ component: ({ data, role }) => /* @__PURE__ */ React5.createElement(Wireframe, {
475
+ label: `${role}:${name}`,
476
+ object: data.subject,
477
+ classNames: "row-span-2 overflow-hidden"
478
+ })
479
+ })
480
+ ]);
481
+ export {
482
+ react_surface_default as default
483
+ };
484
+ //# sourceMappingURL=react-surface-6GVTLM4O.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 { Capabilities, contributes, createIntent, createSurface, type PluginsContext } from '@dxos/app-framework';\nimport { Devtools } from '@dxos/devtools';\nimport { SettingsStore } from '@dxos/local-storage';\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: 'article',\n filter: (data): data is { subject: SettingsStore<DebugSettingsProps> } =>\n data.subject instanceof SettingsStore && data.subject.prefix === DEBUG_PLUGIN,\n component: ({ data: { subject } }) => <DebugSettings settings={subject.value} />,\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 position: '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 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, Icon } from '@dxos/react-ui';\nimport { DeprecatedFormContainer, DeprecatedFormInput } from '@dxos/react-ui-form';\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 <DeprecatedFormContainer>\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 <Icon icon='ph--download-simple--regular' size={5} />\n </Button>\n </DeprecatedFormInput>\n <DeprecatedFormInput label={t('settings repair')}>\n <Button onClick={handleRepair}>\n <Icon icon='ph--first-aid-kit--regular' size={5} />\n </Button>\n </DeprecatedFormInput>\n\n {/* TODO(burdon): Move to layout? */}\n {toast && (\n <Toast.Root>\n <Toast.Body>\n <Toast.Title>\n <Icon icon='ph--gift--duotone' size={5} classNames='inline mr-1' />\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 </DeprecatedFormContainer>\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 { useAppGraph, useLayout } 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, Popover } from '@dxos/react-ui';\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 layout = useLayout();\n const { graph } = useAppGraph();\n const _space = graph ? getActiveSpace(graph, layout.active[0]) : 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 <Popover.Root open={visible} onOpenChange={setVisible}>\n <Popover.Trigger asChild>\n <StatusBar.Button onClick={() => setVisible((visible) => !visible)} title='Performance panels'>\n <Icon icon='ph--chart-bar--regular' size={4} />\n </StatusBar.Button>\n </Popover.Trigger>\n <Popover.Portal>\n <Popover.Content classNames='max-is-[min(var(--radix-popover-content-available-width),300px)] max-bs-[--radix-popover-content-available-height]'>\n <StatsPanel stats={stats} onRefresh={refreshStats} />\n <Popover.Arrow />\n </Popover.Content>\n </Popover.Portal>\n </Popover.Root>\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,SAASC,gBAAAA,eAAcC,aAAaC,cAAcC,qBAA0C;AAC5F,SAASC,gBAAgB;AACzB,SAASC,qBAAqB;AAC9B,SAASC,aAAa;AACtB,SAASC,aAAaC,sBAAsB;AAC5C,SACEC,YACAC,SACAC,oBAIK;;;ACdP,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,UA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back", "Capabilities", "contributes", "createIntent", "createSurface", "Devtools", "SettingsStore", "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", "React", "useEffect", "useState", "Capabilities", "useCapabilities", "defs", "SaveConfig", "Storage", "log", "useClient", "useTranslation", "Button", "Toast", "Input", "useFileDownload", "Select", "Icon", "DeprecatedFormContainer", "DeprecatedFormInput", "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", "DeprecatedFormContainer", "DeprecatedFormInput", "label", "Input", "Switch", "checked", "debug", "onCheckedChange", "devtools", "wireframe", "Button", "onClick", "Icon", "icon", "size", "Toast", "Root", "Body", "Title", "classNames", "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", "useAppGraph", "useLayout", "TimeoutError", "StatsPanel", "useStats", "getActiveSpace", "StatusBar", "ConnectionState", "useNetworkStatus", "Icon", "Popover", "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", "layout", "useLayout", "graph", "useAppGraph", "_space", "getActiveSpace", "active", "success", "PerformanceIndicator", "visible", "setVisible", "stats", "refreshStats", "useStats", "Popover", "Root", "open", "onOpenChange", "Trigger", "asChild", "Portal", "Content", "StatsPanel", "onRefresh", "Arrow", "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", "SettingsStore", "prefix", "component", "React", "DebugSettings", "settings", "value", "DebugStatus", "isEchoObject", "DebugObjectPanel", "object", "requestCapability", "getStore", "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", "position", "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-EF3UVAVI.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-OIMSBZUC.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,4CAmCvB,CAAC"}