@dxos/plugin-debug 0.8.4-main.406dc2a → 0.8.4-main.548089c
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/{DevtoolsOverviewContainer-EPD6EWT5.mjs → DevtoolsOverviewContainer-JXVZVPHN.mjs} +2 -2
- package/dist/lib/browser/{DevtoolsOverviewContainer-EPD6EWT5.mjs.map → DevtoolsOverviewContainer-JXVZVPHN.mjs.map} +1 -1
- package/dist/lib/browser/{SpaceGenerator-VMWHGAJZ.mjs → SpaceGenerator-IFOX6XDJ.mjs} +82 -81
- package/dist/lib/browser/SpaceGenerator-IFOX6XDJ.mjs.map +7 -0
- package/dist/lib/browser/{app-graph-builder-I4IHBKKN.mjs → app-graph-builder-TWGU6RNG.mjs} +6 -6
- package/dist/lib/browser/app-graph-builder-TWGU6RNG.mjs.map +7 -0
- package/dist/lib/browser/chunk-WZFZ4ESO.mjs +20 -0
- package/dist/lib/browser/chunk-WZFZ4ESO.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +6 -7
- package/dist/lib/browser/index.mjs.map +1 -1
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-context-QLZE7VSQ.mjs → react-context-P2YDWEWI.mjs} +2 -2
- package/dist/lib/browser/{react-surface-GFORPA3A.mjs → react-surface-3OFB22IR.mjs} +33 -31
- package/dist/lib/browser/react-surface-3OFB22IR.mjs.map +7 -0
- package/dist/lib/browser/{settings-EBVICEEW.mjs → settings-SQXR3OAH.mjs} +2 -2
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/components/DebugSettings.d.ts.map +1 -1
- package/dist/types/src/components/SpaceGenerator/ObjectGenerator.d.ts +1 -1
- package/dist/types/src/components/SpaceGenerator/ObjectGenerator.d.ts.map +1 -1
- package/dist/types/src/components/SpaceGenerator/presets.d.ts +2 -2
- package/dist/types/src/components/SpaceGenerator/presets.d.ts.map +1 -1
- package/dist/types/src/components/Wireframe.d.ts +1 -1
- package/dist/types/src/components/Wireframe.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +57 -56
- package/src/capabilities/app-graph-builder.ts +4 -4
- package/src/capabilities/react-surface.tsx +28 -9
- package/src/components/DebugSettings.tsx +36 -15
- package/src/components/DevtoolsOverviewContainer.tsx +1 -1
- package/src/components/SpaceGenerator/ObjectGenerator.tsx +12 -18
- package/src/components/SpaceGenerator/SchemaTable.tsx +2 -2
- package/src/components/SpaceGenerator/SpaceGenerator.tsx +6 -6
- package/src/components/SpaceGenerator/presets.ts +49 -46
- package/src/components/Wireframe.tsx +2 -3
- package/src/meta.ts +5 -2
- package/dist/lib/browser/SpaceGenerator-VMWHGAJZ.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-I4IHBKKN.mjs.map +0 -7
- package/dist/lib/browser/chunk-SVCKCXCL.mjs +0 -16
- package/dist/lib/browser/chunk-SVCKCXCL.mjs.map +0 -7
- package/dist/lib/browser/react-surface-GFORPA3A.mjs.map +0 -7
- /package/dist/lib/browser/{react-context-QLZE7VSQ.mjs.map → react-context-P2YDWEWI.mjs.map} +0 -0
- /package/dist/lib/browser/{settings-EBVICEEW.mjs.map → settings-SQXR3OAH.mjs.map} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-debug",
|
|
3
|
-
"version": "0.8.4-main.
|
|
3
|
+
"version": "0.8.4-main.548089c",
|
|
4
4
|
"description": "DXOS Surface plugin for testing.",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -34,75 +34,76 @@
|
|
|
34
34
|
"react-json-tree": "^0.18.0",
|
|
35
35
|
"react-resize-detector": "^11.0.1",
|
|
36
36
|
"workerize-loader": "^2.0.2",
|
|
37
|
-
"@dxos/app-framework": "0.8.4-main.
|
|
38
|
-
"@dxos/
|
|
39
|
-
"@dxos/
|
|
40
|
-
"@dxos/
|
|
41
|
-
"@dxos/
|
|
42
|
-
"@dxos/
|
|
43
|
-
"@dxos/conductor": "0.8.4-main.
|
|
44
|
-
"@dxos/
|
|
45
|
-
"@dxos/
|
|
46
|
-
"@dxos/
|
|
47
|
-
"@dxos/echo-
|
|
48
|
-
"@dxos/
|
|
49
|
-
"@dxos/echo": "0.8.4-main.
|
|
50
|
-
"@dxos/functions": "0.8.4-main.
|
|
51
|
-
"@dxos/invariant": "0.8.4-main.
|
|
52
|
-
"@dxos/live-object": "0.8.4-main.
|
|
53
|
-
"@dxos/
|
|
54
|
-
"@dxos/
|
|
55
|
-
"@dxos/
|
|
56
|
-
"@dxos/plugin-
|
|
57
|
-
"@dxos/plugin-
|
|
58
|
-
"@dxos/
|
|
59
|
-
"@dxos/plugin-inbox": "0.8.4-main.
|
|
60
|
-
"@dxos/plugin-markdown": "0.8.4-main.
|
|
61
|
-
"@dxos/plugin-
|
|
62
|
-
"@dxos/plugin-
|
|
63
|
-
"@dxos/plugin-
|
|
64
|
-
"@dxos/plugin-
|
|
65
|
-
"@dxos/plugin-
|
|
66
|
-
"@dxos/plugin-
|
|
67
|
-
"@dxos/plugin-table": "0.8.4-main.
|
|
68
|
-
"@dxos/plugin-theme": "0.8.4-main.
|
|
69
|
-
"@dxos/protocols": "0.8.4-main.
|
|
70
|
-
"@dxos/
|
|
71
|
-
"@dxos/
|
|
72
|
-
"@dxos/react-
|
|
73
|
-
"@dxos/react-ui-
|
|
74
|
-
"@dxos/react-ui-canvas-editor": "0.8.4-main.
|
|
75
|
-
"@dxos/react-ui-form": "0.8.4-main.
|
|
76
|
-
"@dxos/react-
|
|
77
|
-
"@dxos/react-ui-kanban": "0.8.4-main.
|
|
78
|
-
"@dxos/react-ui-stack": "0.8.4-main.
|
|
79
|
-
"@dxos/react-ui-
|
|
80
|
-
"@dxos/react-ui-
|
|
81
|
-
"@dxos/
|
|
82
|
-
"@dxos/
|
|
37
|
+
"@dxos/app-framework": "0.8.4-main.548089c",
|
|
38
|
+
"@dxos/async": "0.8.4-main.548089c",
|
|
39
|
+
"@dxos/blueprints": "0.8.4-main.548089c",
|
|
40
|
+
"@dxos/client-services": "0.8.4-main.548089c",
|
|
41
|
+
"@dxos/compute": "0.8.4-main.548089c",
|
|
42
|
+
"@dxos/assistant-toolkit": "0.8.4-main.548089c",
|
|
43
|
+
"@dxos/conductor": "0.8.4-main.548089c",
|
|
44
|
+
"@dxos/context": "0.8.4-main.548089c",
|
|
45
|
+
"@dxos/config": "0.8.4-main.548089c",
|
|
46
|
+
"@dxos/devtools": "0.8.4-main.548089c",
|
|
47
|
+
"@dxos/echo-generator": "0.8.4-main.548089c",
|
|
48
|
+
"@dxos/echo-pipeline": "0.8.4-main.548089c",
|
|
49
|
+
"@dxos/echo": "0.8.4-main.548089c",
|
|
50
|
+
"@dxos/functions": "0.8.4-main.548089c",
|
|
51
|
+
"@dxos/invariant": "0.8.4-main.548089c",
|
|
52
|
+
"@dxos/live-object": "0.8.4-main.548089c",
|
|
53
|
+
"@dxos/keys": "0.8.4-main.548089c",
|
|
54
|
+
"@dxos/local-storage": "0.8.4-main.548089c",
|
|
55
|
+
"@dxos/log": "0.8.4-main.548089c",
|
|
56
|
+
"@dxos/plugin-client": "0.8.4-main.548089c",
|
|
57
|
+
"@dxos/plugin-deck": "0.8.4-main.548089c",
|
|
58
|
+
"@dxos/plugin-graph": "0.8.4-main.548089c",
|
|
59
|
+
"@dxos/plugin-inbox": "0.8.4-main.548089c",
|
|
60
|
+
"@dxos/plugin-markdown": "0.8.4-main.548089c",
|
|
61
|
+
"@dxos/plugin-meeting": "0.8.4-main.548089c",
|
|
62
|
+
"@dxos/plugin-script": "0.8.4-main.548089c",
|
|
63
|
+
"@dxos/plugin-sheet": "0.8.4-main.548089c",
|
|
64
|
+
"@dxos/plugin-sketch": "0.8.4-main.548089c",
|
|
65
|
+
"@dxos/plugin-space": "0.8.4-main.548089c",
|
|
66
|
+
"@dxos/plugin-status-bar": "0.8.4-main.548089c",
|
|
67
|
+
"@dxos/plugin-table": "0.8.4-main.548089c",
|
|
68
|
+
"@dxos/plugin-theme": "0.8.4-main.548089c",
|
|
69
|
+
"@dxos/protocols": "0.8.4-main.548089c",
|
|
70
|
+
"@dxos/random": "0.8.4-main.548089c",
|
|
71
|
+
"@dxos/react-client": "0.8.4-main.548089c",
|
|
72
|
+
"@dxos/react-ui-attention": "0.8.4-main.548089c",
|
|
73
|
+
"@dxos/react-ui-canvas-compute": "0.8.4-main.548089c",
|
|
74
|
+
"@dxos/react-ui-canvas-editor": "0.8.4-main.548089c",
|
|
75
|
+
"@dxos/react-ui-form": "0.8.4-main.548089c",
|
|
76
|
+
"@dxos/react-hooks": "0.8.4-main.548089c",
|
|
77
|
+
"@dxos/react-ui-kanban": "0.8.4-main.548089c",
|
|
78
|
+
"@dxos/react-ui-stack": "0.8.4-main.548089c",
|
|
79
|
+
"@dxos/react-ui-syntax-highlighter": "0.8.4-main.548089c",
|
|
80
|
+
"@dxos/react-ui-table": "0.8.4-main.548089c",
|
|
81
|
+
"@dxos/types": "0.8.4-main.548089c",
|
|
82
|
+
"@dxos/util": "0.8.4-main.548089c",
|
|
83
|
+
"@dxos/schema": "0.8.4-main.548089c"
|
|
83
84
|
},
|
|
84
85
|
"devDependencies": {
|
|
85
|
-
"@effect-
|
|
86
|
+
"@effect-atom/atom-react": "^0.3.4",
|
|
86
87
|
"@effect/platform": "0.92.1",
|
|
87
88
|
"@types/react": "~19.2.2",
|
|
88
|
-
"@types/react-dom": "~19.2.
|
|
89
|
+
"@types/react-dom": "~19.2.2",
|
|
89
90
|
"effect": "3.18.3",
|
|
90
91
|
"react": "~19.2.0",
|
|
91
92
|
"react-dom": "~19.2.0",
|
|
92
93
|
"vite": "7.1.9",
|
|
93
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
94
|
-
"@dxos/react-ui-theme": "0.8.4-main.
|
|
95
|
-
"@dxos/storybook-utils": "0.8.4-main.
|
|
94
|
+
"@dxos/react-ui": "0.8.4-main.548089c",
|
|
95
|
+
"@dxos/react-ui-theme": "0.8.4-main.548089c",
|
|
96
|
+
"@dxos/storybook-utils": "0.8.4-main.548089c"
|
|
96
97
|
},
|
|
97
98
|
"peerDependencies": {
|
|
98
|
-
"@effect-
|
|
99
|
+
"@effect-atom/atom-react": "^0.3.4",
|
|
99
100
|
"@effect/platform": "^0.80.12",
|
|
100
101
|
"effect": "^3.13.3",
|
|
101
102
|
"react": "~19.2.0",
|
|
102
103
|
"react-dom": "~19.2.0",
|
|
103
|
-
"@dxos/
|
|
104
|
-
"@dxos/
|
|
105
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
104
|
+
"@dxos/react-ui": "0.8.4-main.548089c",
|
|
105
|
+
"@dxos/random": "0.8.4-main.548089c",
|
|
106
|
+
"@dxos/react-ui-theme": "0.8.4-main.548089c"
|
|
106
107
|
},
|
|
107
108
|
"publishConfig": {
|
|
108
109
|
"access": "public"
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { Atom } from '@effect-atom/atom-react';
|
|
6
6
|
import * as Function from 'effect/Function';
|
|
7
7
|
import * as Option from 'effect/Option';
|
|
8
8
|
|
|
@@ -23,7 +23,7 @@ export default (context: PluginContext) =>
|
|
|
23
23
|
createExtension({
|
|
24
24
|
id: `${meta.id}/devtools`,
|
|
25
25
|
connector: (node) =>
|
|
26
|
-
|
|
26
|
+
Atom.make((get) =>
|
|
27
27
|
Function.pipe(
|
|
28
28
|
get(node),
|
|
29
29
|
Option.flatMap((node) =>
|
|
@@ -381,7 +381,7 @@ export default (context: PluginContext) =>
|
|
|
381
381
|
createExtension({
|
|
382
382
|
id: `${meta.id}/debug-object`,
|
|
383
383
|
connector: (node) =>
|
|
384
|
-
|
|
384
|
+
Atom.make((get) =>
|
|
385
385
|
Function.pipe(
|
|
386
386
|
get(node),
|
|
387
387
|
Option.flatMap((node) => (Obj.isObject(node.data) ? Option.some(node) : Option.none())),
|
|
@@ -407,7 +407,7 @@ export default (context: PluginContext) =>
|
|
|
407
407
|
createExtension({
|
|
408
408
|
id: `${meta.id}/devtools-overview`,
|
|
409
409
|
connector: (node) =>
|
|
410
|
-
|
|
410
|
+
Atom.make((get) =>
|
|
411
411
|
Function.pipe(
|
|
412
412
|
get(node),
|
|
413
413
|
Option.flatMap((node) => (node.id === ROOT_ID ? Option.some(node) : Option.none())),
|
|
@@ -13,9 +13,8 @@ import {
|
|
|
13
13
|
contributes,
|
|
14
14
|
createIntent,
|
|
15
15
|
createSurface,
|
|
16
|
-
useCapability,
|
|
17
|
-
useIntentDispatcher,
|
|
18
16
|
} from '@dxos/app-framework';
|
|
17
|
+
import { useCapability, useIntentDispatcher } from '@dxos/app-framework/react';
|
|
19
18
|
import {
|
|
20
19
|
AutomergePanel,
|
|
21
20
|
ConfigPanel,
|
|
@@ -52,7 +51,7 @@ import { ScriptAction } from '@dxos/plugin-script/types';
|
|
|
52
51
|
import { SpaceAction } from '@dxos/plugin-space/types';
|
|
53
52
|
import { type Space, SpaceState, isSpace, parseId } from '@dxos/react-client/echo';
|
|
54
53
|
import { StackItem } from '@dxos/react-ui-stack';
|
|
55
|
-
import {
|
|
54
|
+
import { Collection } from '@dxos/schema';
|
|
56
55
|
|
|
57
56
|
import {
|
|
58
57
|
DebugGraph,
|
|
@@ -112,13 +111,18 @@ export default (context: PluginContext) =>
|
|
|
112
111
|
|
|
113
112
|
const collection =
|
|
114
113
|
data.subject.space.state.get() === SpaceState.SPACE_READY &&
|
|
115
|
-
data.subject.space.properties[
|
|
116
|
-
if (!Obj.instanceOf(
|
|
114
|
+
data.subject.space.properties[Collection.Collection.typename]?.target;
|
|
115
|
+
if (!Obj.instanceOf(Collection.Collection, collection)) {
|
|
117
116
|
return;
|
|
118
117
|
}
|
|
119
118
|
|
|
120
119
|
objects.forEach((object) => {
|
|
121
|
-
void dispatch(
|
|
120
|
+
void dispatch(
|
|
121
|
+
createIntent(SpaceAction.AddObject, {
|
|
122
|
+
target: collection,
|
|
123
|
+
object,
|
|
124
|
+
}),
|
|
125
|
+
);
|
|
122
126
|
});
|
|
123
127
|
},
|
|
124
128
|
[data.subject.space],
|
|
@@ -234,7 +238,13 @@ export default (context: PluginContext) =>
|
|
|
234
238
|
component: () => {
|
|
235
239
|
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
236
240
|
const handleSelect = useCallback(
|
|
237
|
-
() =>
|
|
241
|
+
() =>
|
|
242
|
+
dispatch(
|
|
243
|
+
createIntent(LayoutAction.Open, {
|
|
244
|
+
part: 'main',
|
|
245
|
+
subject: [Devtools.Echo.Space],
|
|
246
|
+
}),
|
|
247
|
+
),
|
|
238
248
|
[dispatch],
|
|
239
249
|
);
|
|
240
250
|
return <SpaceListPanel onSelect={handleSelect} />;
|
|
@@ -248,7 +258,13 @@ export default (context: PluginContext) =>
|
|
|
248
258
|
const space = useCurrentSpace();
|
|
249
259
|
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
250
260
|
const handleSelect = useCallback(
|
|
251
|
-
() =>
|
|
261
|
+
() =>
|
|
262
|
+
dispatch(
|
|
263
|
+
createIntent(LayoutAction.Open, {
|
|
264
|
+
part: 'main',
|
|
265
|
+
subject: [Devtools.Echo.Feeds],
|
|
266
|
+
}),
|
|
267
|
+
),
|
|
252
268
|
[dispatch],
|
|
253
269
|
);
|
|
254
270
|
return <SpaceInfoPanel space={space} onSelectFeed={handleSelect} onSelectPipeline={handleSelect} />;
|
|
@@ -388,7 +404,10 @@ export default (context: PluginContext) =>
|
|
|
388
404
|
);
|
|
389
405
|
log.info('script created', { result });
|
|
390
406
|
await dispatch(
|
|
391
|
-
createIntent(LayoutAction.Open, {
|
|
407
|
+
createIntent(LayoutAction.Open, {
|
|
408
|
+
part: 'main',
|
|
409
|
+
subject: [`${space.id}:${result.data?.object.id}`],
|
|
410
|
+
}),
|
|
392
411
|
);
|
|
393
412
|
},
|
|
394
413
|
[dispatch],
|
|
@@ -4,11 +4,12 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { useEffect, useState } from 'react';
|
|
6
6
|
|
|
7
|
-
import { Capabilities
|
|
7
|
+
import { Capabilities } from '@dxos/app-framework';
|
|
8
|
+
import { useCapabilities } from '@dxos/app-framework/react';
|
|
8
9
|
import { type ConfigProto, SaveConfig, Storage, defs } from '@dxos/config';
|
|
9
10
|
import { log } from '@dxos/log';
|
|
10
11
|
import { useClient } from '@dxos/react-client';
|
|
11
|
-
import {
|
|
12
|
+
import { Icon, IconButton, Input, Select, Toast, useFileDownload, useTranslation } from '@dxos/react-ui';
|
|
12
13
|
import { ControlGroup, ControlItemInput, ControlPage, ControlSection } from '@dxos/react-ui-form';
|
|
13
14
|
import { setDeep } from '@dxos/util';
|
|
14
15
|
|
|
@@ -46,22 +47,30 @@ export const DebugSettings = ({ settings }: { settings: DebugSettingsProps }) =>
|
|
|
46
47
|
|
|
47
48
|
const handleDownload = async () => {
|
|
48
49
|
const data = await client.diagnostics();
|
|
49
|
-
const file = new Blob([JSON.stringify(data, undefined, 2)], {
|
|
50
|
+
const file = new Blob([JSON.stringify(data, undefined, 2)], {
|
|
51
|
+
type: 'text/plain',
|
|
52
|
+
});
|
|
50
53
|
const fileName = `composer-${new Date().toISOString().replace(/\W/g, '-')}.json`;
|
|
51
54
|
download(file, fileName);
|
|
52
55
|
|
|
53
56
|
if (upload) {
|
|
54
|
-
const info = await upload(new File([file], fileName)
|
|
57
|
+
const info = await upload(client.spaces.default, new File([file], fileName));
|
|
55
58
|
if (!info) {
|
|
56
59
|
log.error('diagnostics failed to upload to IPFS');
|
|
57
60
|
return;
|
|
58
61
|
}
|
|
59
|
-
handleToast({
|
|
62
|
+
handleToast({
|
|
63
|
+
title: t('settings uploaded'),
|
|
64
|
+
description: t('settings uploaded to clipboard'),
|
|
65
|
+
});
|
|
60
66
|
|
|
61
67
|
// TODO(nf): move to IpfsPlugin?
|
|
62
68
|
const url = client.config.values.runtime!.services!.ipfs!.gateway + '/' + info.cid;
|
|
63
69
|
void navigator.clipboard.writeText(url);
|
|
64
|
-
handleToast({
|
|
70
|
+
handleToast({
|
|
71
|
+
title: t('settings uploaded'),
|
|
72
|
+
description: t('settings uploaded to clipboard'),
|
|
73
|
+
});
|
|
65
74
|
log.info('diagnostics', { url });
|
|
66
75
|
}
|
|
67
76
|
};
|
|
@@ -70,9 +79,15 @@ export const DebugSettings = ({ settings }: { settings: DebugSettingsProps }) =>
|
|
|
70
79
|
try {
|
|
71
80
|
const info = await client.repair();
|
|
72
81
|
setStorageConfig(await Storage());
|
|
73
|
-
handleToast({
|
|
82
|
+
handleToast({
|
|
83
|
+
title: t('settings repair success'),
|
|
84
|
+
description: JSON.stringify(info, undefined, 2),
|
|
85
|
+
});
|
|
74
86
|
} catch (err: any) {
|
|
75
|
-
handleToast({
|
|
87
|
+
handleToast({
|
|
88
|
+
title: t('settings repair failed'),
|
|
89
|
+
description: err.message,
|
|
90
|
+
});
|
|
76
91
|
}
|
|
77
92
|
};
|
|
78
93
|
|
|
@@ -87,14 +102,20 @@ export const DebugSettings = ({ settings }: { settings: DebugSettingsProps }) =>
|
|
|
87
102
|
/>
|
|
88
103
|
</ControlItemInput>
|
|
89
104
|
<ControlItemInput title={t('settings download diagnostics')}>
|
|
90
|
-
<
|
|
91
|
-
|
|
92
|
-
|
|
105
|
+
<IconButton
|
|
106
|
+
icon='ph--download-simple--regular'
|
|
107
|
+
iconOnly
|
|
108
|
+
label={t('settings download diagnostics')}
|
|
109
|
+
onClick={handleDownload}
|
|
110
|
+
/>
|
|
93
111
|
</ControlItemInput>
|
|
94
112
|
<ControlItemInput title={t('settings repair')}>
|
|
95
|
-
<
|
|
96
|
-
|
|
97
|
-
|
|
113
|
+
<IconButton
|
|
114
|
+
icon='ph--first-aid-kit--regular'
|
|
115
|
+
iconOnly
|
|
116
|
+
label={t('settings repair')}
|
|
117
|
+
onClick={handleRepair}
|
|
118
|
+
/>
|
|
98
119
|
</ControlItemInput>
|
|
99
120
|
|
|
100
121
|
{/* TODO(burdon): Move to layout? */}
|
|
@@ -114,7 +135,7 @@ export const DebugSettings = ({ settings }: { settings: DebugSettingsProps }) =>
|
|
|
114
135
|
<Select.Root
|
|
115
136
|
value={
|
|
116
137
|
Object.entries(StorageAdapters).find(
|
|
117
|
-
([
|
|
138
|
+
([_name, value]) => value === storageConfig?.runtime?.client?.storage?.dataStore,
|
|
118
139
|
)?.[0]
|
|
119
140
|
}
|
|
120
141
|
onValueChange={(value) => {
|
|
@@ -5,23 +5,22 @@
|
|
|
5
5
|
import { type PromiseIntentDispatcher, createIntent } from '@dxos/app-framework';
|
|
6
6
|
import { addressToA1Notation } from '@dxos/compute';
|
|
7
7
|
import { ComputeGraph, ComputeGraphModel, DEFAULT_OUTPUT, NODE_INPUT, NODE_OUTPUT } from '@dxos/conductor';
|
|
8
|
-
import { DXN, Filter, Key, Obj,
|
|
8
|
+
import { DXN, Filter, Key, type Obj, Type } from '@dxos/echo';
|
|
9
9
|
import { type TypedObject } from '@dxos/echo/internal';
|
|
10
10
|
import { Markdown } from '@dxos/plugin-markdown/types';
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import { CanvasType, DiagramType } from '@dxos/plugin-sketch/types';
|
|
11
|
+
import { Sheet } from '@dxos/plugin-sheet/types';
|
|
12
|
+
import { Diagram } from '@dxos/plugin-sketch/types';
|
|
14
13
|
import { SpaceAction } from '@dxos/plugin-space/types';
|
|
15
14
|
import { faker } from '@dxos/random';
|
|
16
15
|
import { type Client } from '@dxos/react-client';
|
|
17
16
|
import { type Space } from '@dxos/react-client/echo';
|
|
18
|
-
import {
|
|
17
|
+
import { View, getTypenameFromQuery } from '@dxos/schema';
|
|
19
18
|
import { type ValueGenerator, createAsyncGenerator } from '@dxos/schema/testing';
|
|
20
19
|
import { range } from '@dxos/util';
|
|
21
20
|
|
|
22
21
|
const generator: ValueGenerator = faker as any;
|
|
23
22
|
|
|
24
|
-
const findViewByTypename = async (views:
|
|
23
|
+
const findViewByTypename = async (views: View.View[], typename: string) => {
|
|
25
24
|
return views.find((view) => getTypenameFromQuery(view.query.ast) === typename);
|
|
26
25
|
};
|
|
27
26
|
|
|
@@ -36,7 +35,7 @@ export const createGenerator = <T extends Obj.Any>(
|
|
|
36
35
|
const typename = schema.typename;
|
|
37
36
|
|
|
38
37
|
// Find or create table and view.
|
|
39
|
-
const { objects: views } = await space.db.query(Filter.type(
|
|
38
|
+
const { objects: views } = await space.db.query(Filter.type(View.View)).run();
|
|
40
39
|
const view = await findViewByTypename(views, typename);
|
|
41
40
|
const staticSchema = client?.graph.schemaRegistry.schemas.find((schema) => Type.getTypename(schema) === typename);
|
|
42
41
|
if (!view && !staticSchema) {
|
|
@@ -57,7 +56,7 @@ export const staticGenerators = new Map<string, ObjectGenerator<any>>([
|
|
|
57
56
|
async (space, n, cb) => {
|
|
58
57
|
const objects = range(n).map(() => {
|
|
59
58
|
return space.db.add(
|
|
60
|
-
Markdown.
|
|
59
|
+
Markdown.make({
|
|
61
60
|
name: faker.commerce.productName(),
|
|
62
61
|
content: faker.lorem.sentences(5),
|
|
63
62
|
}),
|
|
@@ -69,16 +68,11 @@ export const staticGenerators = new Map<string, ObjectGenerator<any>>([
|
|
|
69
68
|
},
|
|
70
69
|
],
|
|
71
70
|
[
|
|
72
|
-
|
|
71
|
+
Diagram.Diagram.typename,
|
|
73
72
|
async (space, n, cb) => {
|
|
74
73
|
const objects = range(n).map(() => {
|
|
75
74
|
// TODO(burdon): Generate diagram.
|
|
76
|
-
const obj = space.db.add(
|
|
77
|
-
Obj.make(DiagramType, {
|
|
78
|
-
name: faker.commerce.productName(),
|
|
79
|
-
canvas: Ref.make(Obj.make(CanvasType, { content: {} })),
|
|
80
|
-
}),
|
|
81
|
-
);
|
|
75
|
+
const obj = space.db.add(Diagram.make({ name: faker.commerce.productName() }));
|
|
82
76
|
|
|
83
77
|
return obj;
|
|
84
78
|
});
|
|
@@ -89,10 +83,10 @@ export const staticGenerators = new Map<string, ObjectGenerator<any>>([
|
|
|
89
83
|
],
|
|
90
84
|
// TODO(burdon): Create unit tests.
|
|
91
85
|
[
|
|
92
|
-
|
|
86
|
+
Sheet.Sheet.typename,
|
|
93
87
|
async (space, n, cb) => {
|
|
94
88
|
const objects = range(n).map(() => {
|
|
95
|
-
const cells: Record<string, CellValue> = {};
|
|
89
|
+
const cells: Record<string, Sheet.CellValue> = {};
|
|
96
90
|
const year = new Date().getFullYear();
|
|
97
91
|
const cols = 4;
|
|
98
92
|
const rows = 16;
|
|
@@ -114,7 +108,7 @@ export const staticGenerators = new Map<string, ObjectGenerator<any>>([
|
|
|
114
108
|
// TODO(burdon): Set width.
|
|
115
109
|
// TODO(burdon): Set formatting for columns.
|
|
116
110
|
return space.db.add(
|
|
117
|
-
|
|
111
|
+
Sheet.make({
|
|
118
112
|
name: faker.commerce.productName(),
|
|
119
113
|
cells,
|
|
120
114
|
}),
|
|
@@ -19,8 +19,8 @@ export const SchemaTable = ({ types, objects = {}, label, onClick }: SchemaTable
|
|
|
19
19
|
<h2 className='p-2'>{label}</h2>
|
|
20
20
|
{types.map((type) => (
|
|
21
21
|
<div key={type.typename} className='grid grid-cols-subgrid col-span-3 items-center'>
|
|
22
|
-
<div className='
|
|
23
|
-
<div className='
|
|
22
|
+
<div className='pli-2 text-sm font-mono text-subdued'>{type.typename}</div>
|
|
23
|
+
<div className='pli-2 text-right font-mono'>{objects[type.typename] ?? 0}</div>
|
|
24
24
|
<IconButton
|
|
25
25
|
variant='ghost'
|
|
26
26
|
icon='ph--plus--regular'
|
|
@@ -4,17 +4,17 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { useCallback, useMemo, useState } from 'react';
|
|
6
6
|
|
|
7
|
-
import { useIntentDispatcher } from '@dxos/app-framework';
|
|
7
|
+
import { useIntentDispatcher } from '@dxos/app-framework/react';
|
|
8
8
|
import { ComputeGraph } from '@dxos/conductor';
|
|
9
9
|
import { Filter, type Obj } from '@dxos/echo';
|
|
10
10
|
import { Markdown } from '@dxos/plugin-markdown/types';
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
11
|
+
import { Sheet } from '@dxos/plugin-sheet/types';
|
|
12
|
+
import { Diagram } from '@dxos/plugin-sketch/types';
|
|
13
13
|
import { useClient } from '@dxos/react-client';
|
|
14
14
|
import { type Space, getTypename } from '@dxos/react-client/echo';
|
|
15
15
|
import { IconButton, Input, Toolbar, useAsyncEffect } from '@dxos/react-ui';
|
|
16
16
|
import { SyntaxHighlighter } from '@dxos/react-ui-syntax-highlighter';
|
|
17
|
-
import {
|
|
17
|
+
import { Organization, Person, Task } from '@dxos/types';
|
|
18
18
|
import { jsonKeyReplacer, sortKeys } from '@dxos/util';
|
|
19
19
|
|
|
20
20
|
import { type ObjectGenerator, createGenerator, staticGenerators } from './ObjectGenerator';
|
|
@@ -29,8 +29,8 @@ export type SpaceGeneratorProps = {
|
|
|
29
29
|
export const SpaceGenerator = ({ space, onCreateObjects }: SpaceGeneratorProps) => {
|
|
30
30
|
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
31
31
|
const client = useClient();
|
|
32
|
-
const staticTypes = [Markdown.Document,
|
|
33
|
-
const recordTypes = [
|
|
32
|
+
const staticTypes = [Markdown.Document, Diagram.Diagram, Sheet.Sheet, ComputeGraph]; // TODO(burdon): Make extensible.
|
|
33
|
+
const recordTypes = [Organization.Organization, Person.Person, Task.Task];
|
|
34
34
|
const [count, setCount] = useState(1);
|
|
35
35
|
const [info, setInfo] = useState<any>({});
|
|
36
36
|
const presets = useMemo(() => generator(), []);
|