@dxos/plugin-debug 0.8.2-main.fbd8ed0 → 0.8.2-staging.4d6ad0f
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/browser/DebugApp-WSEJPCKY.mjs +225 -0
- package/dist/lib/browser/{DebugApp-7PFYN52J.mjs.map → DebugApp-WSEJPCKY.mjs.map} +1 -1
- package/dist/lib/browser/DevtoolsOverviewContainer-IIIWO77Q.mjs +25 -0
- package/dist/lib/browser/{DevtoolsOverviewContainer-HYNZTH2Z.mjs.map → DevtoolsOverviewContainer-IIIWO77Q.mjs.map} +1 -1
- package/dist/lib/browser/{SpaceGenerator-CGRY2M6A.mjs → SpaceGenerator-RHQLPN44.mjs} +216 -205
- package/dist/lib/browser/SpaceGenerator-RHQLPN44.mjs.map +7 -0
- package/dist/lib/browser/{app-graph-builder-SSTQU7MF.mjs → app-graph-builder-PIPBIN6P.mjs} +3 -3
- package/dist/lib/browser/{chunk-RORUXVAC.mjs → chunk-47JOZTT2.mjs} +1 -4
- package/dist/lib/browser/{chunk-RORUXVAC.mjs.map → chunk-47JOZTT2.mjs.map} +3 -3
- package/dist/lib/browser/chunk-KS3YBEL7.mjs +68 -0
- package/dist/lib/browser/{chunk-ZJTKMYOG.mjs.map → chunk-KS3YBEL7.mjs.map} +1 -1
- package/dist/lib/browser/index.mjs +5 -5
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-context-ZRLN5KUI.mjs → react-context-ZQRD2WG2.mjs} +2 -2
- package/dist/lib/browser/{react-surface-BQSJLXPZ.mjs → react-surface-PHUWS5WD.mjs} +292 -253
- package/dist/lib/browser/{react-surface-BQSJLXPZ.mjs.map → react-surface-PHUWS5WD.mjs.map} +1 -1
- package/dist/lib/browser/{settings-6SG54GZO.mjs → settings-N4Q6YB7L.mjs} +3 -3
- package/dist/types/src/components/SpaceGenerator/ObjectGenerator.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts.map +1 -1
- package/package.json +54 -55
- package/src/components/SpaceGenerator/ObjectGenerator.tsx +0 -1
- package/src/components/SpaceGenerator/SpaceGenerator.tsx +5 -5
- package/src/meta.ts +0 -1
- package/dist/lib/browser/DebugApp-7PFYN52J.mjs +0 -182
- package/dist/lib/browser/DevtoolsOverviewContainer-HYNZTH2Z.mjs +0 -19
- package/dist/lib/browser/SpaceGenerator-CGRY2M6A.mjs.map +0 -7
- package/dist/lib/browser/chunk-ZJTKMYOG.mjs +0 -74
- /package/dist/lib/browser/{app-graph-builder-SSTQU7MF.mjs.map → app-graph-builder-PIPBIN6P.mjs.map} +0 -0
- /package/dist/lib/browser/{react-context-ZRLN5KUI.mjs.map → react-context-ZQRD2WG2.mjs.map} +0 -0
- /package/dist/lib/browser/{settings-6SG54GZO.mjs.map → settings-N4Q6YB7L.mjs.map} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DEBUG_PLUGIN
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-47JOZTT2.mjs";
|
|
4
4
|
|
|
5
5
|
// packages/plugins/plugin-debug/src/capabilities/react-context.tsx
|
|
6
6
|
import React from "react";
|
|
@@ -13,4 +13,4 @@ var react_context_default = () => contributes(Capabilities.ReactContext, {
|
|
|
13
13
|
export {
|
|
14
14
|
react_context_default as default
|
|
15
15
|
};
|
|
16
|
-
//# sourceMappingURL=react-context-
|
|
16
|
+
//# sourceMappingURL=react-context-ZQRD2WG2.mjs.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Devtools
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-KS3YBEL7.mjs";
|
|
4
4
|
import {
|
|
5
5
|
DEBUG_PLUGIN
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-47JOZTT2.mjs";
|
|
7
7
|
|
|
8
8
|
// packages/plugins/plugin-debug/src/capabilities/react-surface.tsx
|
|
9
9
|
import { pipe } from "effect";
|
|
@@ -22,31 +22,38 @@ import { SpaceState, isSpace, isEchoObject, parseId } from "@dxos/react-client/e
|
|
|
22
22
|
import { lazy } from "react";
|
|
23
23
|
|
|
24
24
|
// packages/plugins/plugin-debug/src/components/DebugObjectPanel.tsx
|
|
25
|
+
import { useSignals as _useSignals } from "@preact-signals/safe-react/tracking";
|
|
25
26
|
import React from "react";
|
|
26
27
|
import { Clipboard, Input } from "@dxos/react-ui";
|
|
27
28
|
import { SyntaxHighlighter } from "@dxos/react-ui-syntax-highlighter";
|
|
28
29
|
var DebugObjectPanel = ({ object }) => {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
30
|
+
var _effect = _useSignals();
|
|
31
|
+
try {
|
|
32
|
+
const dxn = `dxn:echo:@:${object.id}`;
|
|
33
|
+
return /* @__PURE__ */ React.createElement(Clipboard.Provider, null, /* @__PURE__ */ React.createElement("div", {
|
|
34
|
+
className: "flex flex-col"
|
|
35
|
+
}, /* @__PURE__ */ React.createElement(Input.Root, null, /* @__PURE__ */ React.createElement("div", {
|
|
36
|
+
role: "none",
|
|
37
|
+
className: "flex flex-col gap-1"
|
|
38
|
+
}, /* @__PURE__ */ React.createElement("div", {
|
|
39
|
+
role: "none",
|
|
40
|
+
className: "flex gap-1"
|
|
41
|
+
}, /* @__PURE__ */ React.createElement(Input.TextInput, {
|
|
42
|
+
disabled: true,
|
|
43
|
+
value: dxn
|
|
44
|
+
}), /* @__PURE__ */ React.createElement(Clipboard.IconButton, {
|
|
45
|
+
value: dxn
|
|
46
|
+
})))), /* @__PURE__ */ React.createElement(SyntaxHighlighter, {
|
|
47
|
+
classNames: "flex text-xs",
|
|
48
|
+
language: "json"
|
|
49
|
+
}, JSON.stringify(object, null, 2))));
|
|
50
|
+
} finally {
|
|
51
|
+
_effect.f();
|
|
52
|
+
}
|
|
47
53
|
};
|
|
48
54
|
|
|
49
55
|
// packages/plugins/plugin-debug/src/components/DebugSettings.tsx
|
|
56
|
+
import { useSignals as _useSignals2 } from "@preact-signals/safe-react/tracking";
|
|
50
57
|
import React2, { useEffect, useState } from "react";
|
|
51
58
|
import { Capabilities, useCapabilities } from "@dxos/app-framework";
|
|
52
59
|
import { defs, SaveConfig, Storage } from "@dxos/config";
|
|
@@ -61,120 +68,125 @@ var StorageAdapters = {
|
|
|
61
68
|
idb: defs.Runtime.Client.Storage.StorageDriver.IDB
|
|
62
69
|
};
|
|
63
70
|
var DebugSettings = ({ settings }) => {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
const
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
const
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
71
|
+
var _effect = _useSignals2();
|
|
72
|
+
try {
|
|
73
|
+
const { t } = useTranslation(DEBUG_PLUGIN);
|
|
74
|
+
const [toast, setToast] = useState();
|
|
75
|
+
const client = useClient();
|
|
76
|
+
const download = useFileDownload();
|
|
77
|
+
const [storageConfig, setStorageConfig] = useState({});
|
|
78
|
+
const [upload] = useCapabilities(Capabilities.FileUploader);
|
|
79
|
+
useEffect(() => {
|
|
80
|
+
void Storage().then((config) => setStorageConfig(config));
|
|
81
|
+
}, []);
|
|
82
|
+
const handleToast = (toast2) => {
|
|
83
|
+
setToast(toast2);
|
|
84
|
+
const t2 = setTimeout(() => setToast(void 0), 5e3);
|
|
85
|
+
return () => clearTimeout(t2);
|
|
86
|
+
};
|
|
87
|
+
const handleDownload = async () => {
|
|
88
|
+
const data = await client.diagnostics();
|
|
89
|
+
const file = new Blob([
|
|
90
|
+
JSON.stringify(data, void 0, 2)
|
|
91
|
+
], {
|
|
92
|
+
type: "text/plain"
|
|
93
|
+
});
|
|
94
|
+
const fileName = `composer-${(/* @__PURE__ */ new Date()).toISOString().replace(/\W/g, "-")}.json`;
|
|
95
|
+
download(file, fileName);
|
|
96
|
+
if (upload) {
|
|
97
|
+
const info = await upload(new File([
|
|
98
|
+
file
|
|
99
|
+
], fileName), client.spaces.default);
|
|
100
|
+
if (!info) {
|
|
101
|
+
log.error("diagnostics failed to upload to IPFS", void 0, {
|
|
102
|
+
F: __dxlog_file,
|
|
103
|
+
L: 56,
|
|
104
|
+
S: void 0,
|
|
105
|
+
C: (f, a) => f(...a)
|
|
106
|
+
});
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
handleToast({
|
|
110
|
+
title: t("settings uploaded"),
|
|
111
|
+
description: t("settings uploaded to clipboard")
|
|
112
|
+
});
|
|
113
|
+
const url = client.config.values.runtime.services.ipfs.gateway + "/" + info.cid;
|
|
114
|
+
void navigator.clipboard.writeText(url);
|
|
115
|
+
handleToast({
|
|
116
|
+
title: t("settings uploaded"),
|
|
117
|
+
description: t("settings uploaded to clipboard")
|
|
118
|
+
});
|
|
119
|
+
log.info("diagnostics", {
|
|
120
|
+
url
|
|
121
|
+
}, {
|
|
93
122
|
F: __dxlog_file,
|
|
94
|
-
L:
|
|
123
|
+
L: 65,
|
|
95
124
|
S: void 0,
|
|
96
125
|
C: (f, a) => f(...a)
|
|
97
126
|
});
|
|
98
|
-
return;
|
|
99
127
|
}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
})
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
L: 65,
|
|
115
|
-
S: void 0,
|
|
116
|
-
C: (f, a) => f(...a)
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
|
-
};
|
|
120
|
-
const handleRepair = async () => {
|
|
121
|
-
try {
|
|
122
|
-
const info = await client.repair();
|
|
123
|
-
setStorageConfig(await Storage());
|
|
124
|
-
handleToast({
|
|
125
|
-
title: t("settings repair success"),
|
|
126
|
-
description: JSON.stringify(info, void 0, 2)
|
|
127
|
-
});
|
|
128
|
-
} catch (err) {
|
|
129
|
-
handleToast({
|
|
130
|
-
title: t("settings repair failed"),
|
|
131
|
-
description: err.message
|
|
132
|
-
});
|
|
133
|
-
}
|
|
134
|
-
};
|
|
135
|
-
return /* @__PURE__ */ React2.createElement(DeprecatedFormContainer, null, /* @__PURE__ */ React2.createElement(DeprecatedFormInput, {
|
|
136
|
-
label: t("settings wireframe")
|
|
137
|
-
}, /* @__PURE__ */ React2.createElement(Input2.Switch, {
|
|
138
|
-
checked: settings.wireframe,
|
|
139
|
-
onCheckedChange: (checked) => settings.wireframe = !!checked
|
|
140
|
-
})), /* @__PURE__ */ React2.createElement(DeprecatedFormInput, {
|
|
141
|
-
label: t("settings download diagnostics")
|
|
142
|
-
}, /* @__PURE__ */ React2.createElement(Button, {
|
|
143
|
-
onClick: handleDownload
|
|
144
|
-
}, /* @__PURE__ */ React2.createElement(Icon, {
|
|
145
|
-
icon: "ph--download-simple--regular",
|
|
146
|
-
size: 5
|
|
147
|
-
}))), /* @__PURE__ */ React2.createElement(DeprecatedFormInput, {
|
|
148
|
-
label: t("settings repair")
|
|
149
|
-
}, /* @__PURE__ */ React2.createElement(Button, {
|
|
150
|
-
onClick: handleRepair
|
|
151
|
-
}, /* @__PURE__ */ React2.createElement(Icon, {
|
|
152
|
-
icon: "ph--first-aid-kit--regular",
|
|
153
|
-
size: 5
|
|
154
|
-
}))), toast && /* @__PURE__ */ React2.createElement(Toast.Root, null, /* @__PURE__ */ React2.createElement(Toast.Body, null, /* @__PURE__ */ React2.createElement(Toast.Title, null, /* @__PURE__ */ React2.createElement(Icon, {
|
|
155
|
-
icon: "ph--gift--duotone",
|
|
156
|
-
size: 5,
|
|
157
|
-
classNames: "inline mr-1"
|
|
158
|
-
}), /* @__PURE__ */ React2.createElement("span", null, toast.title)), toast.description && /* @__PURE__ */ React2.createElement(Toast.Description, null, toast.description))), /* @__PURE__ */ React2.createElement(DeprecatedFormInput, {
|
|
159
|
-
label: t("settings choose storage adaptor")
|
|
160
|
-
}, /* @__PURE__ */ React2.createElement(Select.Root, {
|
|
161
|
-
value: Object.entries(StorageAdapters).find(([name2, value]) => value === storageConfig?.runtime?.client?.storage?.dataStore)?.[0],
|
|
162
|
-
onValueChange: (value) => {
|
|
163
|
-
if (confirm(t("settings storage adapter changed alert"))) {
|
|
164
|
-
updateConfig(storageConfig, setStorageConfig, [
|
|
165
|
-
"runtime",
|
|
166
|
-
"client",
|
|
167
|
-
"storage",
|
|
168
|
-
"dataStore"
|
|
169
|
-
], StorageAdapters[value]);
|
|
128
|
+
};
|
|
129
|
+
const handleRepair = async () => {
|
|
130
|
+
try {
|
|
131
|
+
const info = await client.repair();
|
|
132
|
+
setStorageConfig(await Storage());
|
|
133
|
+
handleToast({
|
|
134
|
+
title: t("settings repair success"),
|
|
135
|
+
description: JSON.stringify(info, void 0, 2)
|
|
136
|
+
});
|
|
137
|
+
} catch (err) {
|
|
138
|
+
handleToast({
|
|
139
|
+
title: t("settings repair failed"),
|
|
140
|
+
description: err.message
|
|
141
|
+
});
|
|
170
142
|
}
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
143
|
+
};
|
|
144
|
+
return /* @__PURE__ */ React2.createElement(DeprecatedFormContainer, null, /* @__PURE__ */ React2.createElement(DeprecatedFormInput, {
|
|
145
|
+
label: t("settings wireframe")
|
|
146
|
+
}, /* @__PURE__ */ React2.createElement(Input2.Switch, {
|
|
147
|
+
checked: settings.wireframe,
|
|
148
|
+
onCheckedChange: (checked) => settings.wireframe = !!checked
|
|
149
|
+
})), /* @__PURE__ */ React2.createElement(DeprecatedFormInput, {
|
|
150
|
+
label: t("settings download diagnostics")
|
|
151
|
+
}, /* @__PURE__ */ React2.createElement(Button, {
|
|
152
|
+
onClick: handleDownload
|
|
153
|
+
}, /* @__PURE__ */ React2.createElement(Icon, {
|
|
154
|
+
icon: "ph--download-simple--regular",
|
|
155
|
+
size: 5
|
|
156
|
+
}))), /* @__PURE__ */ React2.createElement(DeprecatedFormInput, {
|
|
157
|
+
label: t("settings repair")
|
|
158
|
+
}, /* @__PURE__ */ React2.createElement(Button, {
|
|
159
|
+
onClick: handleRepair
|
|
160
|
+
}, /* @__PURE__ */ React2.createElement(Icon, {
|
|
161
|
+
icon: "ph--first-aid-kit--regular",
|
|
162
|
+
size: 5
|
|
163
|
+
}))), toast && /* @__PURE__ */ React2.createElement(Toast.Root, null, /* @__PURE__ */ React2.createElement(Toast.Body, null, /* @__PURE__ */ React2.createElement(Toast.Title, null, /* @__PURE__ */ React2.createElement(Icon, {
|
|
164
|
+
icon: "ph--gift--duotone",
|
|
165
|
+
size: 5,
|
|
166
|
+
classNames: "inline mr-1"
|
|
167
|
+
}), /* @__PURE__ */ React2.createElement("span", null, toast.title)), toast.description && /* @__PURE__ */ React2.createElement(Toast.Description, null, toast.description))), /* @__PURE__ */ React2.createElement(DeprecatedFormInput, {
|
|
168
|
+
label: t("settings choose storage adaptor")
|
|
169
|
+
}, /* @__PURE__ */ React2.createElement(Select.Root, {
|
|
170
|
+
value: Object.entries(StorageAdapters).find(([name2, value]) => value === storageConfig?.runtime?.client?.storage?.dataStore)?.[0],
|
|
171
|
+
onValueChange: (value) => {
|
|
172
|
+
if (confirm(t("settings storage adapter changed alert"))) {
|
|
173
|
+
updateConfig(storageConfig, setStorageConfig, [
|
|
174
|
+
"runtime",
|
|
175
|
+
"client",
|
|
176
|
+
"storage",
|
|
177
|
+
"dataStore"
|
|
178
|
+
], StorageAdapters[value]);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}, /* @__PURE__ */ React2.createElement(Select.TriggerButton, {
|
|
182
|
+
placeholder: t("settings data store label")
|
|
183
|
+
}), /* @__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, {
|
|
184
|
+
key,
|
|
185
|
+
value: key
|
|
186
|
+
}, t(`settings storage adaptor ${key} label`)))))))));
|
|
187
|
+
} finally {
|
|
188
|
+
_effect.f();
|
|
189
|
+
}
|
|
178
190
|
};
|
|
179
191
|
var updateConfig = (config, setConfig, path, value) => {
|
|
180
192
|
const storageConfigCopy = JSON.parse(JSON.stringify(config ?? {}));
|
|
@@ -186,6 +198,7 @@ var updateConfig = (config, setConfig, path, value) => {
|
|
|
186
198
|
};
|
|
187
199
|
|
|
188
200
|
// packages/plugins/plugin-debug/src/components/DebugStatus.tsx
|
|
201
|
+
import { useSignals as _useSignals3 } from "@preact-signals/safe-react/tracking";
|
|
189
202
|
import React3, { useEffect as useEffect2, useRef, useState as useState2 } from "react";
|
|
190
203
|
import { TimeoutError } from "@dxos/async";
|
|
191
204
|
import { useActiveSpace } from "@dxos/plugin-space";
|
|
@@ -199,98 +212,113 @@ var styles = {
|
|
|
199
212
|
error: "text-red-300 dark:text-red-600"
|
|
200
213
|
};
|
|
201
214
|
var ErrorIndicator = () => {
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
const
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
window.
|
|
216
|
-
|
|
215
|
+
var _effect = _useSignals3();
|
|
216
|
+
try {
|
|
217
|
+
const [, forceUpdate] = useState2({});
|
|
218
|
+
const errorRef = useRef();
|
|
219
|
+
useEffect2(() => {
|
|
220
|
+
const errorListener = (event) => {
|
|
221
|
+
const error = event.error ?? event.reason;
|
|
222
|
+
if (errorRef.current !== error) {
|
|
223
|
+
errorRef.current = error;
|
|
224
|
+
forceUpdate({});
|
|
225
|
+
}
|
|
226
|
+
};
|
|
227
|
+
window.addEventListener("error", errorListener);
|
|
228
|
+
window.addEventListener("unhandledrejection", errorListener);
|
|
229
|
+
return () => {
|
|
230
|
+
window.removeEventListener("error", errorListener);
|
|
231
|
+
window.removeEventListener("unhandledrejection", errorListener);
|
|
232
|
+
};
|
|
233
|
+
}, []);
|
|
234
|
+
const handleReset = () => {
|
|
235
|
+
errorRef.current = void 0;
|
|
236
|
+
forceUpdate({});
|
|
217
237
|
};
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
};
|
|
223
|
-
if (errorRef.current) {
|
|
224
|
-
return /* @__PURE__ */ React3.createElement(StatusBar.Button, {
|
|
225
|
-
title: errorRef.current.message,
|
|
226
|
-
onClick: handleReset
|
|
227
|
-
}, /* @__PURE__ */ React3.createElement(Icon2, {
|
|
228
|
-
icon: "ph--warning-circle--duotone",
|
|
229
|
-
size: 4,
|
|
230
|
-
classNames: styles.error
|
|
231
|
-
}));
|
|
232
|
-
} else {
|
|
233
|
-
return /* @__PURE__ */ React3.createElement(StatusBar.Item, {
|
|
234
|
-
title: "No errors."
|
|
235
|
-
}, /* @__PURE__ */ React3.createElement(Icon2, {
|
|
236
|
-
icon: "ph--check--regular",
|
|
237
|
-
size: 4
|
|
238
|
-
}));
|
|
239
|
-
}
|
|
240
|
-
};
|
|
241
|
-
var SwarmIndicator = () => {
|
|
242
|
-
const [state, setState] = useState2(0);
|
|
243
|
-
const { swarm } = useNetworkStatus();
|
|
244
|
-
useEffect2(() => {
|
|
245
|
-
setState(swarm === ConnectionState.ONLINE ? 0 : 1);
|
|
246
|
-
}, [
|
|
247
|
-
swarm
|
|
248
|
-
]);
|
|
249
|
-
if (state === 0) {
|
|
250
|
-
return /* @__PURE__ */ React3.createElement(StatusBar.Item, {
|
|
251
|
-
title: "Connected to swarm."
|
|
252
|
-
}, /* @__PURE__ */ React3.createElement(Icon2, {
|
|
253
|
-
icon: "ph--lightning--regular",
|
|
254
|
-
size: 4
|
|
255
|
-
}));
|
|
256
|
-
} else {
|
|
257
|
-
return /* @__PURE__ */ React3.createElement(StatusBar.Item, {
|
|
258
|
-
title: "Disconnected from swarm."
|
|
259
|
-
}, /* @__PURE__ */ React3.createElement(Icon2, {
|
|
260
|
-
icon: "ph--lightning-slash--regular",
|
|
261
|
-
size: 4,
|
|
262
|
-
classNames: styles.warning
|
|
263
|
-
}));
|
|
264
|
-
}
|
|
265
|
-
};
|
|
266
|
-
var SavingIndicator = () => {
|
|
267
|
-
const [state, _setState] = useState2(0);
|
|
268
|
-
const _space = useActiveSpace();
|
|
269
|
-
switch (state) {
|
|
270
|
-
case 2:
|
|
271
|
-
return /* @__PURE__ */ React3.createElement(StatusBar.Item, {
|
|
272
|
-
title: "Edit not saved."
|
|
238
|
+
if (errorRef.current) {
|
|
239
|
+
return /* @__PURE__ */ React3.createElement(StatusBar.Button, {
|
|
240
|
+
title: errorRef.current.message,
|
|
241
|
+
onClick: handleReset
|
|
273
242
|
}, /* @__PURE__ */ React3.createElement(Icon2, {
|
|
274
|
-
icon: "ph--circle--duotone",
|
|
243
|
+
icon: "ph--warning-circle--duotone",
|
|
275
244
|
size: 4,
|
|
276
|
-
classNames: styles.
|
|
245
|
+
classNames: styles.error
|
|
277
246
|
}));
|
|
278
|
-
|
|
247
|
+
} else {
|
|
279
248
|
return /* @__PURE__ */ React3.createElement(StatusBar.Item, {
|
|
280
|
-
title: "
|
|
249
|
+
title: "No errors."
|
|
281
250
|
}, /* @__PURE__ */ React3.createElement(Icon2, {
|
|
282
|
-
icon: "ph--
|
|
283
|
-
size: 4
|
|
284
|
-
classNames: styles.success
|
|
251
|
+
icon: "ph--check--regular",
|
|
252
|
+
size: 4
|
|
285
253
|
}));
|
|
286
|
-
|
|
287
|
-
|
|
254
|
+
}
|
|
255
|
+
} finally {
|
|
256
|
+
_effect.f();
|
|
257
|
+
}
|
|
258
|
+
};
|
|
259
|
+
var SwarmIndicator = () => {
|
|
260
|
+
var _effect = _useSignals3();
|
|
261
|
+
try {
|
|
262
|
+
const [state, setState] = useState2(0);
|
|
263
|
+
const { swarm } = useNetworkStatus();
|
|
264
|
+
useEffect2(() => {
|
|
265
|
+
setState(swarm === ConnectionState.ONLINE ? 0 : 1);
|
|
266
|
+
}, [
|
|
267
|
+
swarm
|
|
268
|
+
]);
|
|
269
|
+
if (state === 0) {
|
|
288
270
|
return /* @__PURE__ */ React3.createElement(StatusBar.Item, {
|
|
289
|
-
title: "
|
|
271
|
+
title: "Connected to swarm."
|
|
290
272
|
}, /* @__PURE__ */ React3.createElement(Icon2, {
|
|
291
|
-
icon: "ph--
|
|
273
|
+
icon: "ph--lightning--regular",
|
|
292
274
|
size: 4
|
|
293
275
|
}));
|
|
276
|
+
} else {
|
|
277
|
+
return /* @__PURE__ */ React3.createElement(StatusBar.Item, {
|
|
278
|
+
title: "Disconnected from swarm."
|
|
279
|
+
}, /* @__PURE__ */ React3.createElement(Icon2, {
|
|
280
|
+
icon: "ph--lightning-slash--regular",
|
|
281
|
+
size: 4,
|
|
282
|
+
classNames: styles.warning
|
|
283
|
+
}));
|
|
284
|
+
}
|
|
285
|
+
} finally {
|
|
286
|
+
_effect.f();
|
|
287
|
+
}
|
|
288
|
+
};
|
|
289
|
+
var SavingIndicator = () => {
|
|
290
|
+
var _effect = _useSignals3();
|
|
291
|
+
try {
|
|
292
|
+
const [state, _setState] = useState2(0);
|
|
293
|
+
const _space = useActiveSpace();
|
|
294
|
+
switch (state) {
|
|
295
|
+
case 2:
|
|
296
|
+
return /* @__PURE__ */ React3.createElement(StatusBar.Item, {
|
|
297
|
+
title: "Edit not saved."
|
|
298
|
+
}, /* @__PURE__ */ React3.createElement(Icon2, {
|
|
299
|
+
icon: "ph--circle--duotone",
|
|
300
|
+
size: 4,
|
|
301
|
+
classNames: styles.warning
|
|
302
|
+
}));
|
|
303
|
+
case 1:
|
|
304
|
+
return /* @__PURE__ */ React3.createElement(StatusBar.Item, {
|
|
305
|
+
title: "Saving..."
|
|
306
|
+
}, /* @__PURE__ */ React3.createElement(Icon2, {
|
|
307
|
+
icon: "ph--circle--duotone",
|
|
308
|
+
size: 4,
|
|
309
|
+
classNames: styles.success
|
|
310
|
+
}));
|
|
311
|
+
case 0:
|
|
312
|
+
default:
|
|
313
|
+
return /* @__PURE__ */ React3.createElement(StatusBar.Item, {
|
|
314
|
+
title: "Modified indicator."
|
|
315
|
+
}, /* @__PURE__ */ React3.createElement(Icon2, {
|
|
316
|
+
icon: "ph--circle--duotone",
|
|
317
|
+
size: 4
|
|
318
|
+
}));
|
|
319
|
+
}
|
|
320
|
+
} finally {
|
|
321
|
+
_effect.f();
|
|
294
322
|
}
|
|
295
323
|
};
|
|
296
324
|
var indicators = [
|
|
@@ -299,12 +327,18 @@ var indicators = [
|
|
|
299
327
|
ErrorIndicator
|
|
300
328
|
];
|
|
301
329
|
var DebugStatus = () => {
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
330
|
+
var _effect = _useSignals3();
|
|
331
|
+
try {
|
|
332
|
+
return /* @__PURE__ */ React3.createElement(React3.Fragment, null, indicators.map((Indicator) => /* @__PURE__ */ React3.createElement(Indicator, {
|
|
333
|
+
key: Indicator.name
|
|
334
|
+
})));
|
|
335
|
+
} finally {
|
|
336
|
+
_effect.f();
|
|
337
|
+
}
|
|
305
338
|
};
|
|
306
339
|
|
|
307
340
|
// packages/plugins/plugin-debug/src/components/Wireframe.tsx
|
|
341
|
+
import { useSignals as _useSignals4 } from "@preact-signals/safe-react/tracking";
|
|
308
342
|
import React4 from "react";
|
|
309
343
|
import { useResizeDetector } from "react-resize-detector";
|
|
310
344
|
import { fullyQualifiedId } from "@dxos/react-client/echo";
|
|
@@ -312,49 +346,54 @@ import { useAttendableAttributes } from "@dxos/react-ui-attention";
|
|
|
312
346
|
import { SyntaxHighlighter as SyntaxHighlighter2 } from "@dxos/react-ui-syntax-highlighter";
|
|
313
347
|
import { mx } from "@dxos/react-ui-theme";
|
|
314
348
|
var Wireframe = ({ classNames, label, object }) => {
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
ref
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
349
|
+
var _effect = _useSignals4();
|
|
350
|
+
try {
|
|
351
|
+
const attendableAttrs = useAttendableAttributes(fullyQualifiedId(object));
|
|
352
|
+
const { width, height, ref } = useResizeDetector();
|
|
353
|
+
return /* @__PURE__ */ React4.createElement("div", {
|
|
354
|
+
ref,
|
|
355
|
+
className: mx("relative grow min-bs-96", classNames),
|
|
356
|
+
...attendableAttrs
|
|
357
|
+
}, /* @__PURE__ */ React4.createElement("div", {
|
|
358
|
+
className: "absolute inset-2 flex flex-col gap-2 overflow-hidden font-mono"
|
|
359
|
+
}, /* @__PURE__ */ React4.createElement("div", {
|
|
360
|
+
className: "flex justify-between"
|
|
361
|
+
}, /* @__PURE__ */ React4.createElement("div", null, label), /* @__PURE__ */ React4.createElement("div", null, `[${width}x${height}]`)), object && /* @__PURE__ */ React4.createElement(SyntaxHighlighter2, {
|
|
362
|
+
language: "json",
|
|
363
|
+
classNames: "flex w-full text-xs opacity-75 rounded"
|
|
364
|
+
}, JSON.stringify(object, void 0, 2))), /* @__PURE__ */ React4.createElement("svg", {
|
|
365
|
+
width,
|
|
366
|
+
height,
|
|
367
|
+
className: "bg-transparent [&>*]:text-subdued"
|
|
368
|
+
}, /* @__PURE__ */ React4.createElement("rect", {
|
|
369
|
+
x: 0,
|
|
370
|
+
y: 0,
|
|
371
|
+
width,
|
|
372
|
+
height,
|
|
373
|
+
strokeWidth: 1,
|
|
374
|
+
fill: "none"
|
|
375
|
+
}), /* @__PURE__ */ React4.createElement("line", {
|
|
376
|
+
x1: 0,
|
|
377
|
+
y1: 0,
|
|
378
|
+
x2: width,
|
|
379
|
+
y2: height,
|
|
380
|
+
strokeWidth: 1
|
|
381
|
+
}), /* @__PURE__ */ React4.createElement("line", {
|
|
382
|
+
x1: 0,
|
|
383
|
+
y1: height,
|
|
384
|
+
x2: width,
|
|
385
|
+
y2: 0,
|
|
386
|
+
strokeWidth: 1
|
|
387
|
+
})));
|
|
388
|
+
} finally {
|
|
389
|
+
_effect.f();
|
|
390
|
+
}
|
|
352
391
|
};
|
|
353
392
|
|
|
354
393
|
// packages/plugins/plugin-debug/src/components/index.ts
|
|
355
|
-
var DebugApp = lazy(() => import("./DebugApp-
|
|
356
|
-
var DevtoolsOverviewContainer = lazy(() => import("./DevtoolsOverviewContainer-
|
|
357
|
-
var SpaceGenerator = lazy(() => import("./SpaceGenerator-
|
|
394
|
+
var DebugApp = lazy(() => import("./DebugApp-WSEJPCKY.mjs"));
|
|
395
|
+
var DevtoolsOverviewContainer = lazy(() => import("./DevtoolsOverviewContainer-IIIWO77Q.mjs"));
|
|
396
|
+
var SpaceGenerator = lazy(() => import("./SpaceGenerator-RHQLPN44.mjs"));
|
|
358
397
|
|
|
359
398
|
// packages/plugins/plugin-debug/src/capabilities/react-surface.tsx
|
|
360
399
|
var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-debug/src/capabilities/react-surface.tsx";
|
|
@@ -727,4 +766,4 @@ var react_surface_default = (context) => contributes(Capabilities2.ReactSurface,
|
|
|
727
766
|
export {
|
|
728
767
|
react_surface_default as default
|
|
729
768
|
};
|
|
730
|
-
//# sourceMappingURL=react-surface-
|
|
769
|
+
//# sourceMappingURL=react-surface-PHUWS5WD.mjs.map
|