@dxos/plugin-debug 0.6.14-main.2b6a0f3 → 0.6.14-main.f49f251
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/{DebugSpace-2G2PBGCC.mjs → DebugSpace-I6BNZKI2.mjs} +2 -2
- package/dist/lib/browser/{chunk-6Y463JSP.mjs → chunk-NHHLZV45.mjs} +9 -2
- package/dist/lib/browser/chunk-NHHLZV45.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +127 -50
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/types/src/DebugPlugin.d.ts +1 -3
- package/dist/types/src/DebugPlugin.d.ts.map +1 -1
- package/dist/types/src/types.d.ts +8 -5
- package/dist/types/src/types.d.ts.map +1 -1
- package/package.json +42 -42
- package/src/DebugPlugin.tsx +116 -35
- package/src/components/DebugSettings.tsx +13 -13
- package/src/components/DebugStatus.tsx +1 -1
- package/src/types.ts +10 -5
- package/dist/lib/browser/chunk-6Y463JSP.mjs.map +0 -7
- /package/dist/lib/browser/{DebugSpace-2G2PBGCC.mjs.map → DebugSpace-I6BNZKI2.mjs.map} +0 -0
package/package.json
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-debug",
|
|
3
|
-
"version": "0.6.14-main.
|
|
3
|
+
"version": "0.6.14-main.f49f251",
|
|
4
4
|
"description": "DXOS Surface plugin for testing.",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"author": "DXOS.org",
|
|
9
|
-
"sideEffects":
|
|
9
|
+
"sideEffects": true,
|
|
10
10
|
"exports": {
|
|
11
11
|
".": {
|
|
12
|
-
"
|
|
13
|
-
"
|
|
12
|
+
"types": "./dist/types/src/index.d.ts",
|
|
13
|
+
"browser": "./dist/lib/browser/index.mjs"
|
|
14
14
|
},
|
|
15
15
|
"./meta": {
|
|
16
|
-
"
|
|
17
|
-
"
|
|
16
|
+
"types": "./dist/types/src/meta.d.ts",
|
|
17
|
+
"browser": "./dist/lib/browser/meta.mjs"
|
|
18
18
|
}
|
|
19
19
|
},
|
|
20
20
|
"types": "dist/types/src/index.d.ts",
|
|
@@ -36,36 +36,36 @@
|
|
|
36
36
|
"lodash.get": "^4.4.2",
|
|
37
37
|
"react-json-tree": "^0.18.0",
|
|
38
38
|
"react-resize-detector": "^11.0.1",
|
|
39
|
-
"@dxos/
|
|
40
|
-
"@dxos/
|
|
41
|
-
"@dxos/
|
|
42
|
-
"@dxos/
|
|
43
|
-
"@dxos/
|
|
44
|
-
"@dxos/
|
|
45
|
-
"@dxos/echo-generator": "0.6.14-main.
|
|
46
|
-
"@dxos/invariant": "0.6.14-main.
|
|
47
|
-
"@dxos/echo-schema": "0.6.14-main.
|
|
48
|
-
"@dxos/echo-pipeline": "0.6.14-main.
|
|
49
|
-
"@dxos/
|
|
50
|
-
"@dxos/
|
|
51
|
-
"@dxos/plugin-client": "0.6.14-main.
|
|
52
|
-
"@dxos/log": "0.6.14-main.
|
|
53
|
-
"@dxos/plugin-graph": "0.6.14-main.
|
|
54
|
-
"@dxos/plugin-markdown": "0.6.14-main.
|
|
55
|
-
"@dxos/plugin-
|
|
56
|
-
"@dxos/plugin-
|
|
57
|
-
"@dxos/plugin-
|
|
58
|
-
"@dxos/plugin-
|
|
59
|
-
"@dxos/
|
|
60
|
-
"@dxos/plugin-theme": "0.6.14-main.
|
|
61
|
-
"@dxos/
|
|
62
|
-
"@dxos/
|
|
63
|
-
"@dxos/
|
|
64
|
-
"@dxos/react-
|
|
65
|
-
"@dxos/react-ui-
|
|
66
|
-
"@dxos/react-ui-
|
|
67
|
-
"@dxos/react-ui-
|
|
68
|
-
"@dxos/util": "0.6.14-main.
|
|
39
|
+
"@dxos/app-framework": "0.6.14-main.f49f251",
|
|
40
|
+
"@dxos/async": "0.6.14-main.f49f251",
|
|
41
|
+
"@dxos/automerge": "0.6.14-main.f49f251",
|
|
42
|
+
"@dxos/config": "0.6.14-main.f49f251",
|
|
43
|
+
"@dxos/devtools": "0.6.14-main.f49f251",
|
|
44
|
+
"@dxos/client-services": "0.6.14-main.f49f251",
|
|
45
|
+
"@dxos/echo-generator": "0.6.14-main.f49f251",
|
|
46
|
+
"@dxos/invariant": "0.6.14-main.f49f251",
|
|
47
|
+
"@dxos/echo-schema": "0.6.14-main.f49f251",
|
|
48
|
+
"@dxos/echo-pipeline": "0.6.14-main.f49f251",
|
|
49
|
+
"@dxos/local-storage": "0.6.14-main.f49f251",
|
|
50
|
+
"@dxos/keys": "0.6.14-main.f49f251",
|
|
51
|
+
"@dxos/plugin-client": "0.6.14-main.f49f251",
|
|
52
|
+
"@dxos/log": "0.6.14-main.f49f251",
|
|
53
|
+
"@dxos/plugin-graph": "0.6.14-main.f49f251",
|
|
54
|
+
"@dxos/plugin-markdown": "0.6.14-main.f49f251",
|
|
55
|
+
"@dxos/plugin-sketch": "0.6.14-main.f49f251",
|
|
56
|
+
"@dxos/plugin-status-bar": "0.6.14-main.f49f251",
|
|
57
|
+
"@dxos/plugin-space": "0.6.14-main.f49f251",
|
|
58
|
+
"@dxos/plugin-table": "0.6.14-main.f49f251",
|
|
59
|
+
"@dxos/protocols": "0.6.14-main.f49f251",
|
|
60
|
+
"@dxos/plugin-theme": "0.6.14-main.f49f251",
|
|
61
|
+
"@dxos/react-client": "0.6.14-main.f49f251",
|
|
62
|
+
"@dxos/react-hooks": "0.6.14-main.f49f251",
|
|
63
|
+
"@dxos/random": "0.6.14-main.f49f251",
|
|
64
|
+
"@dxos/react-ui-attention": "0.6.14-main.f49f251",
|
|
65
|
+
"@dxos/react-ui-syntax-highlighter": "0.6.14-main.f49f251",
|
|
66
|
+
"@dxos/react-ui-data": "0.6.14-main.f49f251",
|
|
67
|
+
"@dxos/react-ui-table": "0.6.14-main.f49f251",
|
|
68
|
+
"@dxos/util": "0.6.14-main.f49f251"
|
|
69
69
|
},
|
|
70
70
|
"devDependencies": {
|
|
71
71
|
"@phosphor-icons/react": "^2.1.5",
|
|
@@ -75,17 +75,17 @@
|
|
|
75
75
|
"react": "~18.2.0",
|
|
76
76
|
"react-dom": "~18.2.0",
|
|
77
77
|
"vite": "5.4.7",
|
|
78
|
-
"@dxos/react-ui
|
|
79
|
-
"@dxos/
|
|
80
|
-
"@dxos/
|
|
78
|
+
"@dxos/react-ui": "0.6.14-main.f49f251",
|
|
79
|
+
"@dxos/storybook-utils": "0.6.14-main.f49f251",
|
|
80
|
+
"@dxos/react-ui-theme": "0.6.14-main.f49f251"
|
|
81
81
|
},
|
|
82
82
|
"peerDependencies": {
|
|
83
83
|
"@phosphor-icons/react": "^2.1.5",
|
|
84
84
|
"react": "~18.2.0",
|
|
85
85
|
"react-dom": "~18.2.0",
|
|
86
|
-
"@dxos/random": "0.6.14-main.
|
|
87
|
-
"@dxos/react-ui": "0.6.14-main.
|
|
88
|
-
"@dxos/react-ui-theme": "0.6.14-main.
|
|
86
|
+
"@dxos/random": "0.6.14-main.f49f251",
|
|
87
|
+
"@dxos/react-ui": "0.6.14-main.f49f251",
|
|
88
|
+
"@dxos/react-ui-theme": "0.6.14-main.f49f251"
|
|
89
89
|
},
|
|
90
90
|
"publishConfig": {
|
|
91
91
|
"access": "public"
|
package/src/DebugPlugin.tsx
CHANGED
|
@@ -5,23 +5,22 @@
|
|
|
5
5
|
import React, { type ReactNode, useEffect, useState } from 'react';
|
|
6
6
|
|
|
7
7
|
import {
|
|
8
|
-
|
|
8
|
+
definePlugin,
|
|
9
9
|
parseGraphPlugin,
|
|
10
10
|
parseIntentPlugin,
|
|
11
|
+
parseMetadataResolverPlugin,
|
|
12
|
+
parseSettingsPlugin,
|
|
11
13
|
resolvePlugin,
|
|
12
|
-
type IntentPluginProvides,
|
|
13
|
-
type Plugin,
|
|
14
|
-
type PluginDefinition,
|
|
15
14
|
} from '@dxos/app-framework';
|
|
16
15
|
import { Timer } from '@dxos/async';
|
|
17
16
|
import { Devtools } from '@dxos/devtools';
|
|
18
|
-
import {
|
|
19
|
-
import { type ClientPluginProvides } from '@dxos/plugin-client';
|
|
20
|
-
import { createExtension, Graph, type Node } from '@dxos/plugin-graph';
|
|
17
|
+
import { invariant } from '@dxos/invariant';
|
|
18
|
+
import { type ClientPluginProvides, parseClientPlugin } from '@dxos/plugin-client';
|
|
19
|
+
import { createExtension, Graph, type Node, toSignal } from '@dxos/plugin-graph';
|
|
21
20
|
import { SpaceAction } from '@dxos/plugin-space';
|
|
22
21
|
import { CollectionType } from '@dxos/plugin-space/types';
|
|
23
22
|
import { type Client } from '@dxos/react-client';
|
|
24
|
-
import {
|
|
23
|
+
import { create, getTypename, isEchoObject, isSpace, parseId, type Space, SpaceState } from '@dxos/react-client/echo';
|
|
25
24
|
import { Main } from '@dxos/react-ui';
|
|
26
25
|
import {
|
|
27
26
|
baseSurface,
|
|
@@ -30,25 +29,32 @@ import {
|
|
|
30
29
|
topbarBlockPaddingStart,
|
|
31
30
|
} from '@dxos/react-ui-theme';
|
|
32
31
|
|
|
33
|
-
import { DebugGlobal, DebugSettings, DebugSpace,
|
|
32
|
+
import { DebugGlobal, DebugObjectPanel, DebugSettings, DebugSpace, DebugStatus, Wireframe } from './components';
|
|
34
33
|
import meta, { DEBUG_PLUGIN } from './meta';
|
|
35
34
|
import translations from './translations';
|
|
36
|
-
import {
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
import {
|
|
36
|
+
DebugAction,
|
|
37
|
+
DebugContext,
|
|
38
|
+
type DebugPluginProvides,
|
|
39
|
+
type DebugSettingsProps,
|
|
40
|
+
DebugSettingsSchema,
|
|
41
|
+
} from './types';
|
|
39
42
|
|
|
40
|
-
export const DebugPlugin =
|
|
41
|
-
const settings =
|
|
42
|
-
|
|
43
|
+
export const DebugPlugin = definePlugin<DebugPluginProvides>((context) => {
|
|
44
|
+
const settings = create<DebugSettingsProps>({
|
|
45
|
+
debug: true,
|
|
46
|
+
devtools: true,
|
|
47
|
+
});
|
|
43
48
|
|
|
44
49
|
return {
|
|
45
50
|
meta,
|
|
46
51
|
ready: async (plugins) => {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
+
context.init(plugins);
|
|
53
|
+
context.resolvePlugin(parseSettingsPlugin).provides.settingsStore.createStore({
|
|
54
|
+
schema: DebugSettingsSchema,
|
|
55
|
+
prefix: DEBUG_PLUGIN,
|
|
56
|
+
value: settings,
|
|
57
|
+
});
|
|
52
58
|
|
|
53
59
|
// TODO(burdon): Remove hacky dependency on global variable.
|
|
54
60
|
// Used to test how composer handles breaking protocol changes.
|
|
@@ -65,10 +71,10 @@ export const DebugPlugin = (): PluginDefinition<DebugPluginProvides> => {
|
|
|
65
71
|
};
|
|
66
72
|
},
|
|
67
73
|
unload: async () => {
|
|
68
|
-
|
|
74
|
+
context.dispose();
|
|
69
75
|
},
|
|
70
76
|
provides: {
|
|
71
|
-
settings
|
|
77
|
+
settings,
|
|
72
78
|
translations,
|
|
73
79
|
context: ({ children }) => {
|
|
74
80
|
const [timer, setTimer] = useState<Timer>();
|
|
@@ -94,15 +100,19 @@ export const DebugPlugin = (): PluginDefinition<DebugPluginProvides> => {
|
|
|
94
100
|
},
|
|
95
101
|
graph: {
|
|
96
102
|
builder: (plugins) => {
|
|
103
|
+
const clientPlugin = resolvePlugin(plugins, parseClientPlugin);
|
|
104
|
+
const metadataPlugin = resolvePlugin(plugins, parseMetadataResolverPlugin);
|
|
97
105
|
const graphPlugin = resolvePlugin(plugins, parseGraphPlugin);
|
|
98
|
-
|
|
99
|
-
|
|
106
|
+
const resolve = metadataPlugin?.provides.metadata.resolver;
|
|
107
|
+
const client = clientPlugin?.provides.client;
|
|
108
|
+
invariant(resolve);
|
|
109
|
+
invariant(client);
|
|
100
110
|
|
|
101
111
|
return [
|
|
102
112
|
// Devtools node.
|
|
103
113
|
createExtension({
|
|
104
114
|
id: 'dxos.org/plugin/debug/devtools',
|
|
105
|
-
filter: (node): node is Node<null> => !!settings.
|
|
115
|
+
filter: (node): node is Node<null> => !!settings.devtools && node.id === 'root',
|
|
106
116
|
connector: () => [
|
|
107
117
|
{
|
|
108
118
|
// TODO(zan): Removed `/` because it breaks deck layout reload. Fix?
|
|
@@ -120,7 +130,7 @@ export const DebugPlugin = (): PluginDefinition<DebugPluginProvides> => {
|
|
|
120
130
|
// Debug node.
|
|
121
131
|
createExtension({
|
|
122
132
|
id: 'dxos.org/plugin/debug/debug',
|
|
123
|
-
filter: (node): node is Node<null> => !!settings.
|
|
133
|
+
filter: (node): node is Node<null> => !!settings.debug && node.id === 'root',
|
|
124
134
|
connector: () => [
|
|
125
135
|
{
|
|
126
136
|
id: 'dxos.org/plugin/debug/debug',
|
|
@@ -137,7 +147,7 @@ export const DebugPlugin = (): PluginDefinition<DebugPluginProvides> => {
|
|
|
137
147
|
// Space debug nodes.
|
|
138
148
|
createExtension({
|
|
139
149
|
id: 'dxos.org/plugin/debug/spaces',
|
|
140
|
-
filter: (node): node is Node<Space> => !!settings.
|
|
150
|
+
filter: (node): node is Node<Space> => !!settings.debug && isSpace(node.data),
|
|
141
151
|
connector: ({ node }) => {
|
|
142
152
|
const space = node.data;
|
|
143
153
|
return [
|
|
@@ -153,6 +163,77 @@ export const DebugPlugin = (): PluginDefinition<DebugPluginProvides> => {
|
|
|
153
163
|
];
|
|
154
164
|
},
|
|
155
165
|
}),
|
|
166
|
+
|
|
167
|
+
// Create nodes for debug sidebar.
|
|
168
|
+
createExtension({
|
|
169
|
+
id: `${DEBUG_PLUGIN}/debug-for-subject`,
|
|
170
|
+
resolver: ({ id }) => {
|
|
171
|
+
// TODO(Zan): Find util (or make one).
|
|
172
|
+
if (!id.endsWith('~debug')) {
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
const type = 'orphan-settings-for-subject';
|
|
177
|
+
const icon = 'ph--bug--regular';
|
|
178
|
+
|
|
179
|
+
const [subjectId] = id.split('~');
|
|
180
|
+
const { spaceId, objectId } = parseId(subjectId);
|
|
181
|
+
const space = client.spaces.get().find((space) => space.id === spaceId);
|
|
182
|
+
if (!objectId) {
|
|
183
|
+
// TODO(burdon): Ref SPACE_PLUGIN ns.
|
|
184
|
+
const label = space
|
|
185
|
+
? space.properties.name || ['unnamed space label', { ns: DEBUG_PLUGIN }]
|
|
186
|
+
: ['unnamed object settings label', { ns: DEBUG_PLUGIN }];
|
|
187
|
+
|
|
188
|
+
// TODO(wittjosiah): Support comments for arbitrary subjects.
|
|
189
|
+
// This is to ensure that the comments panel is not stuck on an old object.
|
|
190
|
+
return {
|
|
191
|
+
id,
|
|
192
|
+
type,
|
|
193
|
+
data: null,
|
|
194
|
+
properties: {
|
|
195
|
+
icon,
|
|
196
|
+
label,
|
|
197
|
+
showResolvedThreads: false,
|
|
198
|
+
object: null,
|
|
199
|
+
space,
|
|
200
|
+
},
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
const object = toSignal(
|
|
205
|
+
(onChange) => {
|
|
206
|
+
const timeout = setTimeout(async () => {
|
|
207
|
+
await space?.db.loadObjectById(objectId);
|
|
208
|
+
onChange();
|
|
209
|
+
});
|
|
210
|
+
|
|
211
|
+
return () => clearTimeout(timeout);
|
|
212
|
+
},
|
|
213
|
+
() => space?.db.getObjectById(objectId),
|
|
214
|
+
subjectId,
|
|
215
|
+
);
|
|
216
|
+
if (!object || !subjectId) {
|
|
217
|
+
return;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
const meta = resolve(getTypename(object) ?? '');
|
|
221
|
+
const label = meta.label?.(object) ||
|
|
222
|
+
object.name ||
|
|
223
|
+
meta.placeholder || ['unnamed object settings label', { ns: DEBUG_PLUGIN }];
|
|
224
|
+
|
|
225
|
+
return {
|
|
226
|
+
id,
|
|
227
|
+
type,
|
|
228
|
+
data: null,
|
|
229
|
+
properties: {
|
|
230
|
+
icon,
|
|
231
|
+
label,
|
|
232
|
+
object,
|
|
233
|
+
},
|
|
234
|
+
};
|
|
235
|
+
},
|
|
236
|
+
}),
|
|
156
237
|
];
|
|
157
238
|
},
|
|
158
239
|
},
|
|
@@ -160,7 +241,7 @@ export const DebugPlugin = (): PluginDefinition<DebugPluginProvides> => {
|
|
|
160
241
|
resolver: async (intent, plugins) => {
|
|
161
242
|
switch (intent.action) {
|
|
162
243
|
case DebugAction.OPEN_DEVTOOLS: {
|
|
163
|
-
const clientPlugin = getPlugin<ClientPluginProvides>(
|
|
244
|
+
const clientPlugin = context.getPlugin<ClientPluginProvides>('dxos.org/plugin/client');
|
|
164
245
|
const client = clientPlugin.provides.client;
|
|
165
246
|
const vaultUrl = client.config.values?.runtime?.client?.remoteSource ?? 'https://halo.dxos.org';
|
|
166
247
|
|
|
@@ -185,7 +266,7 @@ export const DebugPlugin = (): PluginDefinition<DebugPluginProvides> => {
|
|
|
185
266
|
component: ({ name, data, role }) => {
|
|
186
267
|
switch (role) {
|
|
187
268
|
case 'settings':
|
|
188
|
-
return data.plugin === meta.id ? <DebugSettings settings={settings
|
|
269
|
+
return data.plugin === meta.id ? <DebugSettings settings={settings} /> : null;
|
|
189
270
|
case 'status':
|
|
190
271
|
return <DebugStatus />;
|
|
191
272
|
case 'complementary--debug':
|
|
@@ -195,9 +276,9 @@ export const DebugPlugin = (): PluginDefinition<DebugPluginProvides> => {
|
|
|
195
276
|
const primary = data.active ?? data.object;
|
|
196
277
|
let component: ReactNode;
|
|
197
278
|
if (role === 'main' || role === 'article') {
|
|
198
|
-
if (primary === 'devtools' && settings.
|
|
279
|
+
if (primary === 'devtools' && settings.devtools) {
|
|
199
280
|
component = <Devtools />;
|
|
200
|
-
} else if (!primary || typeof primary !== 'object' || !settings.
|
|
281
|
+
} else if (!primary || typeof primary !== 'object' || !settings.debug) {
|
|
201
282
|
component = null;
|
|
202
283
|
} else if ('space' in primary && isSpace(primary.space)) {
|
|
203
284
|
component = (
|
|
@@ -215,7 +296,7 @@ export const DebugPlugin = (): PluginDefinition<DebugPluginProvides> => {
|
|
|
215
296
|
return;
|
|
216
297
|
}
|
|
217
298
|
|
|
218
|
-
void
|
|
299
|
+
void context.resolvePlugin(parseIntentPlugin).provides.intent.dispatch(
|
|
219
300
|
objects.map((object) => ({
|
|
220
301
|
action: SpaceAction.ADD_OBJECT,
|
|
221
302
|
data: { target: collection, object },
|
|
@@ -232,17 +313,17 @@ export const DebugPlugin = (): PluginDefinition<DebugPluginProvides> => {
|
|
|
232
313
|
}
|
|
233
314
|
|
|
234
315
|
if (!component) {
|
|
235
|
-
if (settings.
|
|
316
|
+
if (settings.wireframe) {
|
|
236
317
|
if (role === 'main' || role === 'article' || role === 'section') {
|
|
237
318
|
const primary = data.active ?? data.object;
|
|
238
319
|
const isCollection = primary instanceof CollectionType;
|
|
239
320
|
// TODO(burdon): Move into Container abstraction.
|
|
240
321
|
if (!isCollection) {
|
|
241
322
|
return {
|
|
242
|
-
disposition: 'hoist',
|
|
243
323
|
node: (
|
|
244
324
|
<Wireframe label={`${role}:${name}`} object={primary} classNames='row-span-2 overflow-hidden' />
|
|
245
325
|
),
|
|
326
|
+
disposition: 'hoist',
|
|
246
327
|
};
|
|
247
328
|
}
|
|
248
329
|
}
|
|
@@ -273,4 +354,4 @@ export const DebugPlugin = (): PluginDefinition<DebugPluginProvides> => {
|
|
|
273
354
|
},
|
|
274
355
|
},
|
|
275
356
|
};
|
|
276
|
-
};
|
|
357
|
+
});
|
|
@@ -8,9 +8,9 @@ import React, { useEffect, useState } from 'react';
|
|
|
8
8
|
import { parseFileManagerPlugin, useResolvePlugin } from '@dxos/app-framework';
|
|
9
9
|
import { type ConfigProto, defs, SaveConfig, Storage } from '@dxos/config';
|
|
10
10
|
import { log } from '@dxos/log';
|
|
11
|
-
import { SettingsValue } from '@dxos/plugin-settings';
|
|
12
11
|
import { useClient } from '@dxos/react-client';
|
|
13
12
|
import { useTranslation, Button, Toast, Input, useFileDownload, Select } from '@dxos/react-ui';
|
|
13
|
+
import { FormInput } from '@dxos/react-ui-data';
|
|
14
14
|
import { getSize, mx } from '@dxos/react-ui-theme';
|
|
15
15
|
import { setDeep } from '@dxos/util';
|
|
16
16
|
|
|
@@ -80,25 +80,25 @@ export const DebugSettings = ({ settings }: { settings: DebugSettingsProps }) =>
|
|
|
80
80
|
|
|
81
81
|
return (
|
|
82
82
|
<>
|
|
83
|
-
<
|
|
83
|
+
<FormInput label={t('settings show debug panel')}>
|
|
84
84
|
<Input.Switch checked={settings.debug} onCheckedChange={(checked) => (settings.debug = !!checked)} />
|
|
85
|
-
</
|
|
86
|
-
<
|
|
85
|
+
</FormInput>
|
|
86
|
+
<FormInput label={t('settings show devtools panel')}>
|
|
87
87
|
<Input.Switch checked={settings.devtools} onCheckedChange={(checked) => (settings.devtools = !!checked)} />
|
|
88
|
-
</
|
|
89
|
-
<
|
|
88
|
+
</FormInput>
|
|
89
|
+
<FormInput label={t('settings wireframe')}>
|
|
90
90
|
<Input.Switch checked={settings.wireframe} onCheckedChange={(checked) => (settings.wireframe = !!checked)} />
|
|
91
|
-
</
|
|
92
|
-
<
|
|
91
|
+
</FormInput>
|
|
92
|
+
<FormInput label={t('settings download diagnostics')}>
|
|
93
93
|
<Button onClick={handleDownload}>
|
|
94
94
|
<DownloadSimple className={getSize(5)} />
|
|
95
95
|
</Button>
|
|
96
|
-
</
|
|
97
|
-
<
|
|
96
|
+
</FormInput>
|
|
97
|
+
<FormInput label={t('settings repair')}>
|
|
98
98
|
<Button onClick={handleRepair}>
|
|
99
99
|
<FirstAidKit className={getSize(5)} />
|
|
100
100
|
</Button>
|
|
101
|
-
</
|
|
101
|
+
</FormInput>
|
|
102
102
|
|
|
103
103
|
{/* TODO(burdon): Move to layout? */}
|
|
104
104
|
{toast && (
|
|
@@ -113,7 +113,7 @@ export const DebugSettings = ({ settings }: { settings: DebugSettingsProps }) =>
|
|
|
113
113
|
</Toast.Root>
|
|
114
114
|
)}
|
|
115
115
|
|
|
116
|
-
<
|
|
116
|
+
<FormInput label={t('settings choose storage adaptor')}>
|
|
117
117
|
<Select.Root
|
|
118
118
|
value={
|
|
119
119
|
Object.entries(StorageAdapters).find(
|
|
@@ -144,7 +144,7 @@ export const DebugSettings = ({ settings }: { settings: DebugSettingsProps }) =>
|
|
|
144
144
|
</Select.Content>
|
|
145
145
|
</Select.Portal>
|
|
146
146
|
</Select.Root>
|
|
147
|
-
</
|
|
147
|
+
</FormInput>
|
|
148
148
|
</>
|
|
149
149
|
);
|
|
150
150
|
};
|
|
@@ -199,7 +199,7 @@ const PerformanceIndicator = () => {
|
|
|
199
199
|
{visible && (
|
|
200
200
|
<div
|
|
201
201
|
className={mx(
|
|
202
|
-
'z-20 absolute bottom-[--statusbar-size] right-
|
|
202
|
+
'z-20 absolute bottom-[--statusbar-size] right-4 w-[450px]',
|
|
203
203
|
'overflow-x-hidden overflow-y-auto scrollbar-thin',
|
|
204
204
|
'border-x border-y border-separator',
|
|
205
205
|
)}
|
package/src/types.ts
CHANGED
|
@@ -12,6 +12,7 @@ import type {
|
|
|
12
12
|
TranslationsProvides,
|
|
13
13
|
} from '@dxos/app-framework';
|
|
14
14
|
import type { TimerCallback, TimerOptions } from '@dxos/async';
|
|
15
|
+
import { S } from '@dxos/echo-schema';
|
|
15
16
|
|
|
16
17
|
import { DEBUG_PLUGIN } from './meta';
|
|
17
18
|
|
|
@@ -32,11 +33,15 @@ export const DebugContext: Context<DebugContextType> = createContext<DebugContex
|
|
|
32
33
|
stop: () => {},
|
|
33
34
|
});
|
|
34
35
|
|
|
35
|
-
export
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
36
|
+
export const DebugSettingsSchema = S.mutable(
|
|
37
|
+
S.Struct({
|
|
38
|
+
devtools: S.optional(S.Boolean),
|
|
39
|
+
debug: S.optional(S.Boolean),
|
|
40
|
+
wireframe: S.optional(S.Boolean),
|
|
41
|
+
}),
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
export interface DebugSettingsProps extends S.Schema.Type<typeof DebugSettingsSchema> {}
|
|
40
45
|
|
|
41
46
|
export type DebugPluginProvides = SurfaceProvides &
|
|
42
47
|
IntentResolverProvides &
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/types.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Context, createContext } from 'react';\n\nimport type {\n GraphBuilderProvides,\n IntentResolverProvides,\n SettingsProvides,\n SurfaceProvides,\n TranslationsProvides,\n} from '@dxos/app-framework';\nimport type { TimerCallback, TimerOptions } from '@dxos/async';\n\nimport { DEBUG_PLUGIN } from './meta';\n\nconst DEBUG_ACTION = `${DEBUG_PLUGIN}/action`;\nexport enum DebugAction {\n OPEN_DEVTOOLS = `${DEBUG_ACTION}/open-devtools`,\n}\n\nexport type DebugContextType = {\n running: boolean;\n start: (cb: TimerCallback, options: TimerOptions) => void;\n stop: () => void;\n};\n\nexport const DebugContext: Context<DebugContextType> = createContext<DebugContextType>({\n running: false,\n start: () => {},\n stop: () => {},\n});\n\nexport type DebugSettingsProps = {\n devtools?: boolean;\n debug?: boolean;\n wireframe?: boolean;\n};\n\nexport type DebugPluginProvides = SurfaceProvides &\n IntentResolverProvides &\n GraphBuilderProvides &\n SettingsProvides<DebugSettingsProps> &\n TranslationsProvides;\n"],
|
|
5
|
-
"mappings": ";;;;;AAIA,SAAuBA,qBAAqB;AAa5C,IAAMC,eAAe,GAAGC,YAAAA;;UACZC,cAAAA;+CACM,GAAGF,YAAAA,gBAA4B,IAAA;GADrCE,gBAAAA,cAAAA,CAAAA,EAAAA;AAUL,IAAMC,eAA0CC,cAAgC;EACrFC,SAAS;EACTC,OAAO,MAAA;EAAO;EACdC,MAAM,MAAA;EAAO;AACf,CAAA;",
|
|
6
|
-
"names": ["createContext", "DEBUG_ACTION", "DEBUG_PLUGIN", "DebugAction", "DebugContext", "createContext", "running", "start", "stop"]
|
|
7
|
-
}
|
|
File without changes
|