@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.
Files changed (43) hide show
  1. package/dist/lib/browser/{DevtoolsOverviewContainer-EPD6EWT5.mjs → DevtoolsOverviewContainer-JXVZVPHN.mjs} +2 -2
  2. package/dist/lib/browser/{DevtoolsOverviewContainer-EPD6EWT5.mjs.map → DevtoolsOverviewContainer-JXVZVPHN.mjs.map} +1 -1
  3. package/dist/lib/browser/{SpaceGenerator-VMWHGAJZ.mjs → SpaceGenerator-IFOX6XDJ.mjs} +82 -81
  4. package/dist/lib/browser/SpaceGenerator-IFOX6XDJ.mjs.map +7 -0
  5. package/dist/lib/browser/{app-graph-builder-I4IHBKKN.mjs → app-graph-builder-TWGU6RNG.mjs} +6 -6
  6. package/dist/lib/browser/app-graph-builder-TWGU6RNG.mjs.map +7 -0
  7. package/dist/lib/browser/chunk-WZFZ4ESO.mjs +20 -0
  8. package/dist/lib/browser/chunk-WZFZ4ESO.mjs.map +7 -0
  9. package/dist/lib/browser/index.mjs +6 -7
  10. package/dist/lib/browser/index.mjs.map +1 -1
  11. package/dist/lib/browser/meta.json +1 -1
  12. package/dist/lib/browser/{react-context-QLZE7VSQ.mjs → react-context-P2YDWEWI.mjs} +2 -2
  13. package/dist/lib/browser/{react-surface-GFORPA3A.mjs → react-surface-3OFB22IR.mjs} +33 -31
  14. package/dist/lib/browser/react-surface-3OFB22IR.mjs.map +7 -0
  15. package/dist/lib/browser/{settings-EBVICEEW.mjs → settings-SQXR3OAH.mjs} +2 -2
  16. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
  17. package/dist/types/src/components/DebugSettings.d.ts.map +1 -1
  18. package/dist/types/src/components/SpaceGenerator/ObjectGenerator.d.ts +1 -1
  19. package/dist/types/src/components/SpaceGenerator/ObjectGenerator.d.ts.map +1 -1
  20. package/dist/types/src/components/SpaceGenerator/presets.d.ts +2 -2
  21. package/dist/types/src/components/SpaceGenerator/presets.d.ts.map +1 -1
  22. package/dist/types/src/components/Wireframe.d.ts +1 -1
  23. package/dist/types/src/components/Wireframe.d.ts.map +1 -1
  24. package/dist/types/src/meta.d.ts.map +1 -1
  25. package/dist/types/tsconfig.tsbuildinfo +1 -1
  26. package/package.json +57 -56
  27. package/src/capabilities/app-graph-builder.ts +4 -4
  28. package/src/capabilities/react-surface.tsx +28 -9
  29. package/src/components/DebugSettings.tsx +36 -15
  30. package/src/components/DevtoolsOverviewContainer.tsx +1 -1
  31. package/src/components/SpaceGenerator/ObjectGenerator.tsx +12 -18
  32. package/src/components/SpaceGenerator/SchemaTable.tsx +2 -2
  33. package/src/components/SpaceGenerator/SpaceGenerator.tsx +6 -6
  34. package/src/components/SpaceGenerator/presets.ts +49 -46
  35. package/src/components/Wireframe.tsx +2 -3
  36. package/src/meta.ts +5 -2
  37. package/dist/lib/browser/SpaceGenerator-VMWHGAJZ.mjs.map +0 -7
  38. package/dist/lib/browser/app-graph-builder-I4IHBKKN.mjs.map +0 -7
  39. package/dist/lib/browser/chunk-SVCKCXCL.mjs +0 -16
  40. package/dist/lib/browser/chunk-SVCKCXCL.mjs.map +0 -7
  41. package/dist/lib/browser/react-surface-GFORPA3A.mjs.map +0 -7
  42. /package/dist/lib/browser/{react-context-QLZE7VSQ.mjs.map → react-context-P2YDWEWI.mjs.map} +0 -0
  43. /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.406dc2a",
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.406dc2a",
38
- "@dxos/assistant-testing": "0.8.4-main.406dc2a",
39
- "@dxos/async": "0.8.4-main.406dc2a",
40
- "@dxos/blueprints": "0.8.4-main.406dc2a",
41
- "@dxos/client-services": "0.8.4-main.406dc2a",
42
- "@dxos/compute": "0.8.4-main.406dc2a",
43
- "@dxos/conductor": "0.8.4-main.406dc2a",
44
- "@dxos/config": "0.8.4-main.406dc2a",
45
- "@dxos/devtools": "0.8.4-main.406dc2a",
46
- "@dxos/echo-generator": "0.8.4-main.406dc2a",
47
- "@dxos/echo-pipeline": "0.8.4-main.406dc2a",
48
- "@dxos/context": "0.8.4-main.406dc2a",
49
- "@dxos/echo": "0.8.4-main.406dc2a",
50
- "@dxos/functions": "0.8.4-main.406dc2a",
51
- "@dxos/invariant": "0.8.4-main.406dc2a",
52
- "@dxos/live-object": "0.8.4-main.406dc2a",
53
- "@dxos/log": "0.8.4-main.406dc2a",
54
- "@dxos/keys": "0.8.4-main.406dc2a",
55
- "@dxos/plugin-client": "0.8.4-main.406dc2a",
56
- "@dxos/plugin-deck": "0.8.4-main.406dc2a",
57
- "@dxos/plugin-graph": "0.8.4-main.406dc2a",
58
- "@dxos/local-storage": "0.8.4-main.406dc2a",
59
- "@dxos/plugin-inbox": "0.8.4-main.406dc2a",
60
- "@dxos/plugin-markdown": "0.8.4-main.406dc2a",
61
- "@dxos/plugin-sheet": "0.8.4-main.406dc2a",
62
- "@dxos/plugin-sketch": "0.8.4-main.406dc2a",
63
- "@dxos/plugin-meeting": "0.8.4-main.406dc2a",
64
- "@dxos/plugin-script": "0.8.4-main.406dc2a",
65
- "@dxos/plugin-status-bar": "0.8.4-main.406dc2a",
66
- "@dxos/plugin-space": "0.8.4-main.406dc2a",
67
- "@dxos/plugin-table": "0.8.4-main.406dc2a",
68
- "@dxos/plugin-theme": "0.8.4-main.406dc2a",
69
- "@dxos/protocols": "0.8.4-main.406dc2a",
70
- "@dxos/react-client": "0.8.4-main.406dc2a",
71
- "@dxos/random": "0.8.4-main.406dc2a",
72
- "@dxos/react-hooks": "0.8.4-main.406dc2a",
73
- "@dxos/react-ui-attention": "0.8.4-main.406dc2a",
74
- "@dxos/react-ui-canvas-editor": "0.8.4-main.406dc2a",
75
- "@dxos/react-ui-form": "0.8.4-main.406dc2a",
76
- "@dxos/react-ui-canvas-compute": "0.8.4-main.406dc2a",
77
- "@dxos/react-ui-kanban": "0.8.4-main.406dc2a",
78
- "@dxos/react-ui-stack": "0.8.4-main.406dc2a",
79
- "@dxos/react-ui-table": "0.8.4-main.406dc2a",
80
- "@dxos/react-ui-syntax-highlighter": "0.8.4-main.406dc2a",
81
- "@dxos/util": "0.8.4-main.406dc2a",
82
- "@dxos/schema": "0.8.4-main.406dc2a"
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-rx/rx-react": "0.42.4",
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.1",
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.406dc2a",
94
- "@dxos/react-ui-theme": "0.8.4-main.406dc2a",
95
- "@dxos/storybook-utils": "0.8.4-main.406dc2a"
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-rx/rx-react": "^0.34.1",
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/random": "0.8.4-main.406dc2a",
104
- "@dxos/react-ui-theme": "0.8.4-main.406dc2a",
105
- "@dxos/react-ui": "0.8.4-main.406dc2a"
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 { Rx } from '@effect-rx/rx-react';
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
- Rx.make((get) =>
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
- Rx.make((get) =>
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
- Rx.make((get) =>
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 { DataType } from '@dxos/schema';
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[DataType.Collection.typename]?.target;
116
- if (!Obj.instanceOf(DataType.Collection, collection)) {
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(createIntent(SpaceAction.AddObject, { target: collection, object }));
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
- () => dispatch(createIntent(LayoutAction.Open, { part: 'main', subject: [Devtools.Echo.Space] })),
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
- () => dispatch(createIntent(LayoutAction.Open, { part: 'main', subject: [Devtools.Echo.Feeds] })),
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, { part: 'main', subject: [`${space.id}:${result.data?.object.id}`] }),
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, useCapabilities } from '@dxos/app-framework';
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 { Button, Icon, Input, Select, Toast, useFileDownload, useTranslation } from '@dxos/react-ui';
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)], { type: 'text/plain' });
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), client.spaces.default);
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({ title: t('settings uploaded'), description: t('settings uploaded to clipboard') });
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({ title: t('settings uploaded'), description: t('settings uploaded to clipboard') });
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({ title: t('settings repair success'), description: JSON.stringify(info, undefined, 2) });
82
+ handleToast({
83
+ title: t('settings repair success'),
84
+ description: JSON.stringify(info, undefined, 2),
85
+ });
74
86
  } catch (err: any) {
75
- handleToast({ title: t('settings repair failed'), description: err.message });
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
- <Button onClick={handleDownload}>
91
- <Icon icon='ph--download-simple--regular' size={5} />
92
- </Button>
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
- <Button onClick={handleRepair}>
96
- <Icon icon='ph--first-aid-kit--regular' size={5} />
97
- </Button>
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
- ([name, value]) => value === storageConfig?.runtime?.client?.storage?.dataStore,
138
+ ([_name, value]) => value === storageConfig?.runtime?.client?.storage?.dataStore,
118
139
  )?.[0]
119
140
  }
120
141
  onValueChange={(value) => {
@@ -4,7 +4,7 @@
4
4
 
5
5
  import React from 'react';
6
6
 
7
- import { Surface } from '@dxos/app-framework';
7
+ import { Surface } from '@dxos/app-framework/react';
8
8
  import { StatsPanel, useStats } from '@dxos/devtools';
9
9
 
10
10
  export const DevtoolsOverviewContainer = () => {
@@ -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, Ref, Type } from '@dxos/echo';
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 { createSheet } from '@dxos/plugin-sheet/types';
12
- import { type CellValue, SheetType } from '@dxos/plugin-sheet/types';
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 { DataType, getTypenameFromQuery } from '@dxos/schema';
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: DataType.View[], typename: string) => {
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(DataType.View)).run();
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.makeDocument({
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
- DiagramType.typename,
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
- SheetType.typename,
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
- createSheet({
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='px-2 text-sm font-mono text-subdued'>{type.typename}</div>
23
- <div className='px-2 text-right font-mono'>{objects[type.typename] ?? 0}</div>
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 { SheetType } from '@dxos/plugin-sheet/types';
12
- import { DiagramType } from '@dxos/plugin-sketch/types';
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 { DataType } from '@dxos/schema';
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, DiagramType, SheetType, ComputeGraph]; // TODO(burdon): Make extensible.
33
- const recordTypes = [DataType.Organization, DataType.Person, DataType.Task];
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(), []);