@dxos/plugin-debug 0.7.4 → 0.7.5-main.937ce75

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 (37) hide show
  1. package/dist/lib/browser/{DebugApp-HCHR6GKO.mjs → DebugApp-LQHFFK3Y.mjs} +4 -2
  2. package/dist/lib/browser/{DebugApp-HCHR6GKO.mjs.map → DebugApp-LQHFFK3Y.mjs.map} +3 -3
  3. package/dist/lib/browser/{DebugSpace-DHKEAMIC.mjs → DebugSpace-NC3324L4.mjs} +5 -4
  4. package/dist/lib/browser/DebugSpace-NC3324L4.mjs.map +7 -0
  5. package/dist/lib/browser/{SpaceGenerator-BQ3645OS.mjs → SpaceGenerator-ZPQBRL6R.mjs} +21 -15
  6. package/dist/lib/browser/SpaceGenerator-ZPQBRL6R.mjs.map +7 -0
  7. package/dist/lib/browser/{chunk-LZEK532R.mjs → chunk-6CGQHKET.mjs} +1 -11
  8. package/dist/lib/browser/chunk-6CGQHKET.mjs.map +7 -0
  9. package/dist/lib/browser/index.mjs +87 -112
  10. package/dist/lib/browser/index.mjs.map +3 -3
  11. package/dist/lib/browser/meta.json +1 -1
  12. package/dist/types/src/DebugPlugin.d.ts.map +1 -1
  13. package/dist/types/src/components/DebugSpace/DebugSpace.stories.d.ts.map +1 -1
  14. package/dist/types/src/components/DebugSpace/ObjectCreator.stories.d.ts.map +1 -1
  15. package/dist/types/src/components/SpaceGenerator/ObjectGenerator.d.ts +2 -2
  16. package/dist/types/src/components/SpaceGenerator/ObjectGenerator.d.ts.map +1 -1
  17. package/dist/types/src/components/SpaceGenerator/draw-util.d.ts.map +1 -1
  18. package/dist/types/src/components/Wireframe.d.ts +2 -1
  19. package/dist/types/src/components/Wireframe.d.ts.map +1 -1
  20. package/dist/types/src/types.d.ts +2 -5
  21. package/dist/types/src/types.d.ts.map +1 -1
  22. package/dist/types/tsconfig.tsbuildinfo +1 -0
  23. package/package.json +43 -42
  24. package/src/DebugPlugin.tsx +92 -126
  25. package/src/components/DebugApp/DebugApp.tsx +1 -1
  26. package/src/components/DebugSpace/DebugSpace.stories.tsx +4 -3
  27. package/src/components/DebugSpace/DebugSpace.tsx +1 -1
  28. package/src/components/DebugSpace/ObjectCreator.stories.tsx +4 -3
  29. package/src/components/DebugSurface.tsx +2 -2
  30. package/src/components/SpaceGenerator/ObjectGenerator.tsx +13 -13
  31. package/src/components/SpaceGenerator/SpaceGenerator.tsx +3 -3
  32. package/src/components/SpaceGenerator/draw-util.ts +7 -6
  33. package/src/components/Wireframe.tsx +2 -2
  34. package/src/types.ts +0 -9
  35. package/dist/lib/browser/DebugSpace-DHKEAMIC.mjs.map +0 -7
  36. package/dist/lib/browser/SpaceGenerator-BQ3645OS.mjs.map +0 -7
  37. package/dist/lib/browser/chunk-LZEK532R.mjs.map +0 -7
@@ -2,9 +2,11 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import React, { type ReactNode, useEffect, useState } from 'react';
5
+ import React, { useCallback, useEffect, useState } from 'react';
6
6
 
7
7
  import {
8
+ createIntent,
9
+ createSurface,
8
10
  definePlugin,
9
11
  parseGraphPlugin,
10
12
  parseIntentPlugin,
@@ -15,7 +17,7 @@ import {
15
17
  import { Timer } from '@dxos/async';
16
18
  import { Devtools } from '@dxos/devtools';
17
19
  import { invariant } from '@dxos/invariant';
18
- import { type ClientPluginProvides, parseClientPlugin } from '@dxos/plugin-client';
20
+ import { parseClientPlugin } from '@dxos/plugin-client/types';
19
21
  import { createExtension, Graph, type Node, toSignal } from '@dxos/plugin-graph';
20
22
  import { memoizeQuery, SpaceAction } from '@dxos/plugin-space';
21
23
  import { CollectionType } from '@dxos/plugin-space/types';
@@ -26,17 +28,11 @@ import {
26
28
  isEchoObject,
27
29
  isSpace,
28
30
  parseId,
31
+ type ReactiveEchoObject,
29
32
  type ReactiveObject,
30
33
  type Space,
31
34
  SpaceState,
32
35
  } from '@dxos/react-client/echo';
33
- import { Main } from '@dxos/react-ui';
34
- import {
35
- baseSurface,
36
- bottombarBlockPaddingEnd,
37
- fixedInsetFlexLayout,
38
- topbarBlockPaddingStart,
39
- } from '@dxos/react-ui-theme';
40
36
 
41
37
  import {
42
38
  DebugApp,
@@ -49,13 +45,19 @@ import {
49
45
  } from './components';
50
46
  import meta, { DEBUG_PLUGIN } from './meta';
51
47
  import translations from './translations';
52
- import {
53
- DebugAction,
54
- DebugContext,
55
- type DebugPluginProvides,
56
- type DebugSettingsProps,
57
- DebugSettingsSchema,
58
- } from './types';
48
+ import { DebugContext, type DebugPluginProvides, type DebugSettingsProps, DebugSettingsSchema } from './types';
49
+
50
+ type SpaceDebug = {
51
+ type: string;
52
+ space: Space;
53
+ };
54
+
55
+ type GraphDebug = {
56
+ graph: Graph;
57
+ };
58
+
59
+ const isSpaceDebug = (data: any): data is SpaceDebug => data.type === `${DEBUG_PLUGIN}/space` && isSpace(data.space);
60
+ const isGraphDebug = (data: any): data is GraphDebug => data.graph instanceof Graph;
59
61
 
60
62
  export const DebugPlugin = definePlugin<DebugPluginProvides>((context) => {
61
63
  const settings = create<DebugSettingsProps>({
@@ -65,7 +67,7 @@ export const DebugPlugin = definePlugin<DebugPluginProvides>((context) => {
65
67
 
66
68
  return {
67
69
  meta,
68
- ready: async (plugins) => {
70
+ ready: async ({ plugins }) => {
69
71
  context.init(plugins);
70
72
  context.resolvePlugin(parseSettingsPlugin).provides.settingsStore.createStore({
71
73
  schema: DebugSettingsSchema,
@@ -182,7 +184,7 @@ export const DebugPlugin = definePlugin<DebugPluginProvides>((context) => {
182
184
  // Not adding the debug node until the root collection is available aligns the behaviour of this
183
185
  // extension with that of the space plugin adding objects. This ensures that the debug node is added at
184
186
  // the same time as objects and prevents order from changing as the nodes are added.
185
- const collection = space.properties[CollectionType.typename] as CollectionType | undefined;
187
+ const collection = space.properties[CollectionType.typename]?.target as CollectionType | undefined;
186
188
  if (!collection) {
187
189
  return;
188
190
  }
@@ -269,121 +271,85 @@ export const DebugPlugin = definePlugin<DebugPluginProvides>((context) => {
269
271
  ];
270
272
  },
271
273
  },
272
- intent: {
273
- resolver: async (intent, plugins) => {
274
- switch (intent.action) {
275
- case DebugAction.OPEN_DEVTOOLS: {
276
- const clientPlugin = context.getPlugin<ClientPluginProvides>('dxos.org/plugin/client');
277
- const client = clientPlugin.provides.client;
278
- const vaultUrl = client.config.values?.runtime?.client?.remoteSource ?? 'https://halo.dxos.org';
279
-
280
- // Check if we're serving devtools locally on the usual port.
281
- let devtoolsUrl = 'http://localhost:5174';
282
- try {
283
- // TODO(burdon): Test header to see if this is actually devtools.
284
- await fetch(devtoolsUrl);
285
- } catch {
286
- // Match devtools to running app.
287
- const isDev = window.location.href.includes('.dev.') || window.location.href.includes('localhost');
288
- devtoolsUrl = `https://devtools${isDev ? '.dev.' : '.'}dxos.org`;
289
- }
290
-
291
- window.open(`${devtoolsUrl}?target=${vaultUrl}`, '_blank');
292
- return { data: true };
293
- }
294
- }
295
- },
296
- },
297
274
  surface: {
298
- component: ({ name, data, role }) => {
299
- switch (role) {
300
- case 'settings':
301
- return data.plugin === meta.id ? <DebugSettings settings={settings} /> : null;
302
- case 'status':
303
- return <DebugStatus />;
304
- case 'complementary--debug':
305
- return isEchoObject(data.subject) ? <DebugObjectPanel object={data.subject} /> : null;
306
- }
307
-
308
- const primary = data.active ?? data.object;
309
- let component: ReactNode = null;
310
- if (role === 'main' || role === 'article') {
311
- if (primary === 'devtools' && settings.devtools) {
312
- component = <Devtools />;
313
- } else if (!primary || typeof primary !== 'object' || !settings.debug) {
314
- component = null;
315
- } else if (
316
- 'type' in primary &&
317
- primary.type === 'dxos.org/plugin/debug/space' &&
318
- 'space' in primary &&
319
- isSpace(primary.space)
320
- ) {
321
- const handleCreateObject = (objects: ReactiveObject<any>[]) => {
322
- if (!isSpace(primary.space)) {
323
- return;
324
- }
275
+ definitions: () => [
276
+ createSurface({
277
+ id: `${DEBUG_PLUGIN}/settings`,
278
+ role: 'settings',
279
+ filter: (data): data is any => data.subject === DEBUG_PLUGIN,
280
+ component: () => <DebugSettings settings={settings} />,
281
+ }),
282
+ createSurface({
283
+ id: `${DEBUG_PLUGIN}/status`,
284
+ role: 'status',
285
+ component: () => <DebugStatus />,
286
+ }),
287
+ createSurface({
288
+ id: `${DEBUG_PLUGIN}/complementary`,
289
+ role: 'complementary--debug',
290
+ filter: (data): data is { subject: ReactiveEchoObject<any> } => isEchoObject(data.subject),
291
+ component: ({ data }) => <DebugObjectPanel object={data.subject} />,
292
+ }),
293
+ createSurface({
294
+ id: `${DEBUG_PLUGIN}/devtools`,
295
+ role: 'article',
296
+ filter: (data): data is any => data.subject === 'devtools' && !!settings.devtools,
297
+ component: () => <Devtools />,
298
+ }),
299
+ createSurface({
300
+ id: `${DEBUG_PLUGIN}/space`,
301
+ role: 'article',
302
+ filter: (data): data is { subject: SpaceDebug } => isSpaceDebug(data.subject),
303
+ component: ({ data }) => {
304
+ const handleCreateObject = useCallback(
305
+ (objects: ReactiveObject<any>[]) => {
306
+ if (!isSpace(data.subject.space)) {
307
+ return;
308
+ }
325
309
 
326
- const collection =
327
- primary.space.state.get() === SpaceState.SPACE_READY &&
328
- primary.space.properties[CollectionType.typename];
329
- if (!(collection instanceof CollectionType)) {
330
- return;
331
- }
310
+ const collection =
311
+ data.subject.space.state.get() === SpaceState.SPACE_READY &&
312
+ data.subject.space.properties[CollectionType.typename]?.target;
313
+ if (!(collection instanceof CollectionType)) {
314
+ return;
315
+ }
332
316
 
333
- void context.resolvePlugin(parseIntentPlugin).provides.intent.dispatch(
334
- objects.map((object) => ({
335
- action: SpaceAction.ADD_OBJECT,
336
- data: { target: collection, object },
337
- })),
338
- );
339
- };
317
+ objects.forEach((object) => {
318
+ void context
319
+ .resolvePlugin(parseIntentPlugin)
320
+ .provides.intent.dispatchPromise(
321
+ createIntent(SpaceAction.AddObject, { target: collection, object }),
322
+ );
323
+ });
324
+ },
325
+ [data.subject.space],
326
+ );
340
327
 
341
328
  const deprecated = false;
342
- component = deprecated ? (
343
- <DebugSpace space={primary.space} onAddObjects={handleCreateObject} />
329
+ return deprecated ? (
330
+ <DebugSpace space={data.subject.space} onAddObjects={handleCreateObject} />
344
331
  ) : (
345
- <SpaceGenerator space={primary.space} onCreateObjects={handleCreateObject} />
332
+ <SpaceGenerator space={data.subject.space} onCreateObjects={handleCreateObject} />
346
333
  );
347
- } else if ('graph' in primary && primary.graph instanceof Graph) {
348
- component = <DebugApp graph={primary.graph} />;
349
- }
350
- }
351
-
352
- if (!component) {
353
- if (settings.wireframe) {
354
- if (role === 'main' || role === 'article' || role === 'section') {
355
- const primary = data.active ?? data.object;
356
- const isCollection = primary instanceof CollectionType;
357
- // TODO(burdon): Move into Container abstraction.
358
- if (!isCollection) {
359
- return {
360
- node: (
361
- <Wireframe label={`${role}:${name}`} object={primary} classNames='row-span-2 overflow-hidden' />
362
- ),
363
- disposition: 'hoist',
364
- };
365
- }
366
- }
367
- }
368
-
369
- return null;
370
- }
371
-
372
- switch (role) {
373
- case 'article':
374
- return <>{component}</>;
375
- case 'main':
376
- return (
377
- <Main.Content
378
- classNames={[baseSurface, fixedInsetFlexLayout, topbarBlockPaddingStart, bottombarBlockPaddingEnd]}
379
- >
380
- {component}
381
- </Main.Content>
382
- );
383
- }
384
-
385
- return null;
386
- },
334
+ },
335
+ }),
336
+ createSurface({
337
+ id: `${DEBUG_PLUGIN}/graph`,
338
+ role: 'article',
339
+ filter: (data): data is { subject: GraphDebug } => isGraphDebug(data.subject),
340
+ component: ({ data }) => <DebugApp graph={data.subject.graph} />,
341
+ }),
342
+ createSurface({
343
+ id: `${DEBUG_PLUGIN}/wireframe`,
344
+ role: ['article', 'section'],
345
+ disposition: 'hoist',
346
+ filter: (data): data is { subject: ReactiveEchoObject<any> } =>
347
+ isEchoObject(data.subject) && !!settings.wireframe,
348
+ component: ({ data, role }) => (
349
+ <Wireframe label={`${role}:${name}`} object={data.subject} classNames='row-span-2 overflow-hidden' />
350
+ ),
351
+ }),
352
+ ],
387
353
  },
388
354
  },
389
355
  };
@@ -59,7 +59,7 @@ export const DebugApp: FC<{ graph: Graph }> = ({ graph }) => {
59
59
  </ToggleGroupItem>
60
60
  </ToggleGroup>
61
61
 
62
- <Toolbar.Expander />
62
+ <Toolbar.Separator variant='gap' />
63
63
  <Button onClick={(event) => handleResetClient(event.shiftKey)} title='Reset client'>
64
64
  <Warning className={mx(getSize(5), 'text-red-700')} />
65
65
  </Button>
@@ -5,21 +5,22 @@
5
5
  import '@dxos-theme';
6
6
 
7
7
  import { type Meta } from '@storybook/react';
8
- import React, { useEffect } from 'react';
8
+ import React from 'react';
9
9
 
10
10
  import { createSpaceObjectGenerator } from '@dxos/echo-generator';
11
11
  import { useSpaces } from '@dxos/react-client/echo';
12
12
  import { withClientProvider } from '@dxos/react-client/testing';
13
+ import { useAsyncEffect } from '@dxos/react-hooks';
13
14
  import { render, withLayout, withTheme } from '@dxos/storybook-utils';
14
15
 
15
16
  import { DebugSpace } from './DebugSpace';
16
17
 
17
18
  const DefaultStory = () => {
18
19
  const [space] = useSpaces();
19
- useEffect(() => {
20
+ useAsyncEffect(async () => {
20
21
  if (space) {
21
22
  const generator = createSpaceObjectGenerator(space);
22
- generator.addSchemas();
23
+ await generator.addSchemas();
23
24
  }
24
25
  }, [space]);
25
26
 
@@ -158,7 +158,7 @@ export const DebugSpace: FC<{
158
158
  <IconButton icon='ph--arrow-clockwise--regular' iconOnly label='Refresh' size={5} onClick={handleUpdate} />
159
159
  <IconButton icon='ph--download-simple--regular' iconOnly label='Download' size={5} onClick={handleDownload} />
160
160
 
161
- <Toolbar.Expander />
161
+ <Toolbar.Separator variant='gap' />
162
162
  <IconButton
163
163
  icon='ph--flag-pennant--regular'
164
164
  iconOnly
@@ -5,22 +5,23 @@
5
5
  import '@dxos-theme';
6
6
 
7
7
  import { type Meta } from '@storybook/react';
8
- import React, { useEffect } from 'react';
8
+ import React from 'react';
9
9
 
10
10
  import { createSpaceObjectGenerator } from '@dxos/echo-generator';
11
11
  import { log } from '@dxos/log';
12
12
  import { useSpaces } from '@dxos/react-client/echo';
13
13
  import { withClientProvider } from '@dxos/react-client/testing';
14
+ import { useAsyncEffect } from '@dxos/react-hooks';
14
15
  import { render, withLayout, withTheme } from '@dxos/storybook-utils';
15
16
 
16
17
  import { ObjectCreator, type ObjectCreatorProps } from './ObjectCreator';
17
18
 
18
19
  const DefaultStory = () => {
19
20
  const [space] = useSpaces();
20
- useEffect(() => {
21
+ useAsyncEffect(async () => {
21
22
  if (space) {
22
23
  const generator = createSpaceObjectGenerator(space);
23
- generator.addSchemas();
24
+ await generator.addSchemas();
24
25
  }
25
26
  }, [space]);
26
27
 
@@ -37,9 +37,9 @@ export const DebugSurface = ({ classNames }: SurfaceDebugProps) => {
37
37
  return (
38
38
  <div className={mx('flex flex-col border border-separator overflow-hidden bg-modalSurface', classNames)}>
39
39
  <div className='flex flex-col h-full w-full p-2'>
40
- {surfaces.map(({ id, name, renderCount }) => (
40
+ {surfaces.map(({ id, role, renderCount }) => (
41
41
  <div key={id} className='grid grid-cols-[1fr_3rem_3rem] items-center text-xs font-mono whitespace-nowrap'>
42
- <span className='px-1 truncate'>{name}</span>
42
+ <span className='px-1 truncate'>{role}</span>
43
43
  <span className='px-1 text-right'>{renderCount}</span>
44
44
  <span className='px-1 text-right'>{renderMap.get(id)?.delta}</span>
45
45
  </div>
@@ -2,12 +2,12 @@
2
2
  // Copyright 2024 DXOS.org
3
3
  //
4
4
 
5
- import { type AbstractSchema, type BaseObject } from '@dxos/echo-schema';
6
- import { create, type ReactiveObject } from '@dxos/live-object';
5
+ import { addressToA1Notation } from '@dxos/compute';
6
+ import { type BaseObject, type TypedObject } from '@dxos/echo-schema';
7
+ import { create, makeRef, type ReactiveObject } from '@dxos/live-object';
7
8
  import { DocumentType, TextType } from '@dxos/plugin-markdown/types';
8
- import { addressToA1Notation, createSheet } from '@dxos/plugin-sheet';
9
- import { type CellValue } from '@dxos/plugin-sheet/types';
10
- import { SheetType } from '@dxos/plugin-sheet/types';
9
+ import { createSheet } from '@dxos/plugin-sheet';
10
+ import { SheetType, type CellValue } from '@dxos/plugin-sheet/types';
11
11
  import { CanvasType, DiagramType } from '@dxos/plugin-sketch/types';
12
12
  import { faker } from '@dxos/random';
13
13
  import { Filter, type Space } from '@dxos/react-client/echo';
@@ -40,7 +40,7 @@ export const staticGenerators = new Map<string, ObjectGenerator<any>>([
40
40
  const obj = space.db.add(
41
41
  create(DocumentType, {
42
42
  name: faker.commerce.productName(),
43
- content: create(TextType, { content: faker.lorem.sentences(5) }),
43
+ content: makeRef(create(TextType, { content: faker.lorem.sentences(5) })),
44
44
  threads: [],
45
45
  }),
46
46
  );
@@ -60,7 +60,7 @@ export const staticGenerators = new Map<string, ObjectGenerator<any>>([
60
60
  const obj = space.db.add(
61
61
  create(DiagramType, {
62
62
  name: faker.commerce.productName(),
63
- canvas: create(CanvasType, { content: {} }),
63
+ canvas: makeRef(create(CanvasType, { content: {} })),
64
64
  }),
65
65
  );
66
66
 
@@ -111,28 +111,28 @@ export const staticGenerators = new Map<string, ObjectGenerator<any>>([
111
111
  ],
112
112
  ]);
113
113
 
114
- export const createGenerator = <T extends BaseObject>(type: AbstractSchema<T>): ObjectGenerator<T> => {
114
+ export const createGenerator = <T extends BaseObject>(type: TypedObject<T>): ObjectGenerator<T> => {
115
115
  return async (
116
116
  space: Space,
117
117
  n: number,
118
118
  cb?: (objects: ReactiveObject<any>[]) => void,
119
119
  ): Promise<ReactiveObject<T>[]> => {
120
120
  // Find or create mutable schema.
121
- const mutableSchema = await space.db.schemaRegistry.query();
122
121
  const schema =
123
- mutableSchema.find((schema) => schema.typename === type.typename) ?? space.db.schemaRegistry.addSchema(type);
122
+ (await space.db.schemaRegistry.query({ typename: type.typename }).firstOrUndefined()) ??
123
+ (await space.db.schemaRegistry.register([type]))[0];
124
124
 
125
125
  // Create objects.
126
- const generate = createAsyncGenerator(generator, schema.schema, { db: space.db });
126
+ const generate = createAsyncGenerator(generator, schema.getSchemaSnapshot(), { db: space.db });
127
127
  const objects = await generate.createObjects(n);
128
128
 
129
129
  // Find or create table and view.
130
130
  const { objects: tables } = await space.db.query(Filter.schema(TableType)).run();
131
- const table = tables.find((table) => table.view?.query?.type === type.typename);
131
+ const table = tables.find((table) => table.view?.target?.query?.type === type.typename);
132
132
  if (!table) {
133
133
  const name = type.typename.split('/').pop() ?? type.typename;
134
134
  const view = createView({ name, typename: type.typename, jsonSchema: schema.jsonSchema });
135
- const table = space.db.add(create(TableType, { name, view }));
135
+ const table = space.db.add(create(TableType, { name, view: makeRef(view) }));
136
136
  cb?.([table]);
137
137
  }
138
138
 
@@ -43,7 +43,7 @@ export const SpaceGenerator = ({ space, onCreateObjects }: SpaceGeneratorProps)
43
43
  // Query space to get info.
44
44
  const updateInfo = async () => {
45
45
  // Create schema map.
46
- const mutableSchema = await space.db.schemaRegistry.query();
46
+ const echoSchema = await space.db.schemaRegistry.query().run();
47
47
  const staticSchema = space.db.graph.schemaRegistry.schemas;
48
48
 
49
49
  // Create object map.
@@ -62,7 +62,7 @@ export const SpaceGenerator = ({ space, onCreateObjects }: SpaceGeneratorProps)
62
62
  setInfo({
63
63
  schema: {
64
64
  static: staticSchema.length,
65
- mutable: mutableSchema.length,
65
+ mutable: echoSchema.length,
66
66
  },
67
67
  objects: objectMap,
68
68
  });
@@ -86,7 +86,7 @@ export const SpaceGenerator = ({ space, onCreateObjects }: SpaceGeneratorProps)
86
86
  <div role='none' className='flex flex-col divide-y divide-separator'>
87
87
  <Toolbar.Root classNames='p-1'>
88
88
  <IconButton icon='ph--arrow-clockwise--regular' iconOnly label='Refresh' onClick={updateInfo} />
89
- <Toolbar.Expander />
89
+ <Toolbar.Separator variant='gap' />
90
90
  <div className='flex'>
91
91
  <Input.Root>
92
92
  <Input.TextInput
@@ -86,20 +86,21 @@ export const drawGraph = async (
86
86
  editor: Editor,
87
87
  graph: Graph<PlainObject, PlainObject>,
88
88
  ): Promise<SerializedStore<TLRecord>> => {
89
- const grid = 40;
89
+ const gridSize = 40;
90
90
  const nodeSize = 80;
91
91
 
92
- const snap = (n: number) => Math.round(n / grid) * grid;
92
+ const snap = (n: number) => Math.round(n / gridSize) * gridSize;
93
93
 
94
+ // TODO(burdon): Util.
94
95
  type Intersection<Types extends readonly unknown[]> = Types extends [infer First, ...infer Rest]
95
96
  ? First & Intersection<Rest>
96
97
  : unknown;
97
98
 
98
99
  const defaultOptions: Intersection<[D3ForceLayoutOptions, GridLayoutOptions, RadialLayoutOptions]> = {
99
100
  center: [0, 0],
100
- width: grid * 20,
101
- height: grid * 20,
102
- linkDistance: grid * 2,
101
+ width: gridSize * 20,
102
+ height: gridSize * 20,
103
+ linkDistance: gridSize * 2,
103
104
  nodeSize,
104
105
  nodeSpacing: nodeSize,
105
106
  preventOverlap: true,
@@ -129,7 +130,7 @@ export const drawGraph = async (
129
130
  layout = new RadialLayout({
130
131
  ...defaultOptions,
131
132
  focusNode: graph.getAllNodes()[0],
132
- unitRadius: grid * 2,
133
+ unitRadius: gridSize * 2,
133
134
  });
134
135
  }
135
136
  }
@@ -5,7 +5,7 @@
5
5
  import React from 'react';
6
6
  import { useResizeDetector } from 'react-resize-detector';
7
7
 
8
- import { fullyQualifiedId } from '@dxos/react-client/echo';
8
+ import { fullyQualifiedId, type ReactiveEchoObject } from '@dxos/react-client/echo';
9
9
  import { type ThemedClassName } from '@dxos/react-ui';
10
10
  import { useAttendableAttributes } from '@dxos/react-ui-attention';
11
11
  import { SyntaxHighlighter } from '@dxos/react-ui-syntax-highlighter';
@@ -14,7 +14,7 @@ import { mx } from '@dxos/react-ui-theme';
14
14
  // TODO(burdon): Create generic container with wireframe mode.
15
15
  export type WireframeProps = ThemedClassName<{
16
16
  label?: string;
17
- object?: any;
17
+ object: ReactiveEchoObject<any>;
18
18
  }>;
19
19
 
20
20
  // TODO(burdon): Make focusable and attendable with input.
package/src/types.ts CHANGED
@@ -6,7 +6,6 @@ import { type Context, createContext } from 'react';
6
6
 
7
7
  import type {
8
8
  GraphBuilderProvides,
9
- IntentResolverProvides,
10
9
  SettingsProvides,
11
10
  SurfaceProvides,
12
11
  TranslationsProvides,
@@ -15,13 +14,6 @@ import type { TimerCallback, TimerOptions } from '@dxos/async';
15
14
  import { S } from '@dxos/echo-schema';
16
15
  import { type PanelProvides } from '@dxos/plugin-deck/types';
17
16
 
18
- import { DEBUG_PLUGIN } from './meta';
19
-
20
- const DEBUG_ACTION = `${DEBUG_PLUGIN}/action`;
21
- export enum DebugAction {
22
- OPEN_DEVTOOLS = `${DEBUG_ACTION}/open-devtools`,
23
- }
24
-
25
17
  export type DebugContextType = {
26
18
  running: boolean;
27
19
  start: (cb: TimerCallback, options: TimerOptions) => void;
@@ -45,7 +37,6 @@ export const DebugSettingsSchema = S.mutable(
45
37
  export interface DebugSettingsProps extends S.Schema.Type<typeof DebugSettingsSchema> {}
46
38
 
47
39
  export type DebugPluginProvides = SurfaceProvides &
48
- IntentResolverProvides &
49
40
  GraphBuilderProvides &
50
41
  SettingsProvides<DebugSettingsProps> &
51
42
  TranslationsProvides &
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/components/DebugSpace/DebugSpace.tsx", "../../../src/components/DebugSpace/ObjectCreator.tsx", "../../../src/components/DebugSpace/index.ts"],
4
- "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { type FC, useContext, useMemo, useState } from 'react';\n\nimport { createSpaceObjectGenerator } from '@dxos/echo-generator';\nimport { type ReactiveObject } from '@dxos/live-object';\nimport { DocumentType } from '@dxos/plugin-markdown/types';\nimport { Invitation } from '@dxos/protocols/proto/dxos/client/services';\nimport { faker } from '@dxos/random';\nimport { useClient } from '@dxos/react-client';\nimport { Filter, type Space, useSpaceInvitation } from '@dxos/react-client/echo';\nimport { InvitationEncoder } from '@dxos/react-client/invitations';\nimport { useAsyncEffect } from '@dxos/react-hooks';\nimport { Icon, IconButton, Input, type IconProps, type TextInputProps, Toolbar, useFileDownload } from '@dxos/react-ui';\nimport { safeParseInt } from '@dxos/util';\n\nimport { ObjectCreator } from './ObjectCreator';\nimport { DebugContext } from '../../types';\nimport { Container } from '../Container';\n\nconst DEFAULT_COUNT = 100;\nconst DEFAULT_PERIOD = 500;\nconst DEFAULT_JITTER = 50;\n\nconst useRefresh = (): [any, () => void] => {\n const [update, setUpdate] = useState({});\n return [update, () => setUpdate({})];\n};\n\nconst CustomInput = ({ icon, ...props }: Pick<IconProps, 'icon'> & TextInputProps) => {\n return (\n <div role='none' className='relative'>\n <Input.Root>\n <Input.TextInput classNames='w-[100px] text-right pie-[22px]' size={5} {...props} />\n </Input.Root>\n <Icon icon={icon} size={3} classNames='absolute inline-end-1 block-start-1 mt-[6px]' />\n </div>\n );\n};\n\nexport const DebugSpace: FC<{\n space: Space;\n onAddObjects?: (objects: ReactiveObject<any>[]) => void;\n}> = ({ space, onAddObjects }) => {\n const { connect } = useSpaceInvitation(space?.key);\n const client = useClient();\n const [data, setData] = useState<any>({});\n\n const [update, handleUpdate] = useRefresh();\n useAsyncEffect(\n async (isMounted) => {\n const data = await client.diagnostics({ truncate: true });\n if (isMounted()) {\n setData(\n data?.diagnostics?.spaces?.find(({ key }: any) => {\n return space.key.toHex().startsWith(key);\n }),\n );\n }\n },\n [space, update],\n );\n\n const download = useFileDownload();\n const handleDownload = async () => {\n download(\n new Blob([JSON.stringify(data, undefined, 2)], { type: 'text/plain' }),\n `${new Date().toISOString().replace(/\\W/g, '-')}.json`,\n );\n };\n\n const [mutationCount, setMutationCount] = useState(String(DEFAULT_COUNT));\n const [mutationInterval, setMutationInterval] = useState(String(DEFAULT_PERIOD));\n const [mutationJitter, setMutationJitter] = useState(String(DEFAULT_JITTER));\n\n const generator = useMemo(() => createSpaceObjectGenerator(space), [space]);\n\n // TODO(burdon): Note: this is shared across all spaces!\n const { running, start, stop } = useContext(DebugContext);\n const handleToggleRunning = () => {\n if (running) {\n stop();\n handleUpdate();\n } else {\n start(\n async () => {\n const { objects } = await space.db.query(Filter.schema(DocumentType)).run();\n if (objects.length) {\n const object = faker.helpers.arrayElement(objects);\n await generator.mutateObject(object, { count: 10, mutationSize: 10, maxContentLength: 1000 });\n }\n },\n {\n count: safeParseInt(mutationCount) ?? 0,\n interval: safeParseInt(mutationInterval) ?? 0,\n jitter: safeParseInt(mutationJitter) ?? 0,\n },\n );\n }\n };\n\n const handleCreateInvitation = () => {\n const invitation = space.share({\n type: Invitation.Type.INTERACTIVE,\n authMethod: Invitation.AuthMethod.NONE,\n multiUse: true,\n });\n\n // TODO(burdon): Refactor.\n // TODO(burdon): Unsubscribe?\n connect(invitation);\n const code = InvitationEncoder.encode(invitation.get());\n new URL(window.origin).searchParams.set('spaceInvitationCode', code);\n const url = `${window.origin}?spaceInvitationCode=${code}`;\n void navigator.clipboard.writeText(url);\n };\n\n const handleCreateEpoch = async () => {\n await space.internal.createEpoch();\n handleUpdate();\n };\n\n return (\n <Container\n toolbar={\n <Toolbar.Root classNames='p-1'>\n <CustomInput\n icon='ph--flag--regular'\n autoComplete='off'\n placeholder='Count'\n value={mutationCount}\n onChange={({ target: { value } }) => setMutationCount(value)}\n />\n <CustomInput\n icon='ph--timer--regular'\n autoComplete='off'\n placeholder='Interval'\n value={mutationInterval}\n onChange={({ target: { value } }) => setMutationInterval(value)}\n />\n <CustomInput\n icon='ph--plus-minus--regular'\n autoComplete='off'\n placeholder='Jitter'\n value={mutationJitter}\n onChange={({ target: { value } }) => setMutationJitter(value)}\n />\n\n <IconButton\n icon={running ? 'ph--pause-circle--regular' : 'ph--play-circle--regular'}\n iconOnly\n label='Start/stop'\n size={5}\n onClick={handleToggleRunning}\n />\n <IconButton icon='ph--arrow-clockwise--regular' iconOnly label='Refresh' size={5} onClick={handleUpdate} />\n <IconButton icon='ph--download-simple--regular' iconOnly label='Download' size={5} onClick={handleDownload} />\n\n <Toolbar.Expander />\n <IconButton\n icon='ph--flag-pennant--regular'\n iconOnly\n label='Create epoch'\n size={5}\n onClick={handleCreateEpoch}\n />\n <IconButton\n icon='ph--user-circle-plus--regular'\n iconOnly\n iconClassNames='text-blue-500'\n label='Create Invitation'\n size={5}\n onClick={handleCreateInvitation}\n />\n </Toolbar.Root>\n }\n >\n <ObjectCreator space={space} onAddObjects={onAddObjects} />\n </Container>\n );\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { useMemo, useState } from 'react';\n\nimport { type MutationsProviderParams, TestSchemaType, createSpaceObjectGenerator } from '@dxos/echo-generator';\nimport { type ReactiveEchoObject, type ReactiveObject, type Space } from '@dxos/react-client/echo';\nimport { IconButton, Toolbar } from '@dxos/react-ui';\nimport { createColumnBuilder, type TableColumnDef, Table } from '@dxos/react-ui-table/deprecated';\n\nconst BATCH_SIZE = 10;\n\nexport type CreateObjectsParams = {\n schema: string;\n enabled: boolean;\n objects: number;\n mutations: Pick<MutationsProviderParams, 'count' | 'mutationSize' | 'maxContentLength'>;\n};\n\nexport type ObjectCreatorProps = {\n space: Space;\n onAddObjects?: (objects: ReactiveObject<any>[]) => void;\n};\n\nexport const ObjectCreator = ({ space, onAddObjects }: ObjectCreatorProps) => {\n const generator = useMemo(() => createSpaceObjectGenerator(space), [space]);\n\n const [objects, setObjects] = useState<CreateObjectsParams[]>(\n Object.values(TestSchemaType).map((schema) => ({\n schema,\n enabled: true,\n objects: 10,\n mutations: {\n count: 10,\n mutationSize: 10,\n maxContentLength: 1000,\n },\n })),\n );\n\n const handleCreate = async () => {\n for (const params of objects) {\n if (!params.enabled) {\n continue;\n }\n\n let objectsCreated = 0;\n while (objectsCreated < params.objects) {\n const objects = (await generator.createObjects({\n [params.schema]: Math.min(BATCH_SIZE, params.objects - objectsCreated),\n })) as ReactiveEchoObject<any>[];\n\n await generator.mutateObjects(objects, params.mutations);\n objectsCreated += objects.length;\n onAddObjects?.(objects);\n }\n }\n\n await space.db.flush();\n };\n\n const handleUpdate = (row: CreateObjectsParams, key: string, value: any) => {\n const newObjects = [...objects];\n Object.assign(newObjects.find((object) => object.schema === row.schema)!, { [key]: value });\n setObjects(newObjects);\n };\n\n const { helper, builder } = createColumnBuilder<CreateObjectsParams>();\n const columns: TableColumnDef<CreateObjectsParams>[] = [\n helper.accessor('enabled', builder.switch({ label: 'Live', onUpdate: handleUpdate })),\n helper.accessor('schema', builder.string({ label: 'Schema', classNames: 'font-mono' })),\n helper.accessor('objects', builder.number({ label: 'Objects', onUpdate: handleUpdate })),\n helper.accessor((obj) => obj.mutations.count, {\n id: 'mutations',\n ...builder.number({ label: 'Mutations', onUpdate: handleUpdate }),\n }),\n helper.accessor((obj) => obj.mutations.mutationSize, {\n id: 'mutationSize',\n ...builder.number({ label: 'Mut. Size', onUpdate: handleUpdate }),\n }),\n helper.accessor((obj) => obj.mutations.maxContentLength, {\n id: 'mutationMaxContentLength',\n ...builder.number({ label: 'Length', onUpdate: handleUpdate }),\n }),\n ];\n\n return (\n <>\n <Table.Root>\n <Table.Viewport>\n <Table.Main<CreateObjectsParams> columns={columns} data={objects} />\n </Table.Viewport>\n </Table.Root>\n <Toolbar.Root classNames='p-1'>\n <IconButton icon='ph--plus--regular' label='Create' onClick={handleCreate} />\n </Toolbar.Root>\n </>\n );\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { DebugSpace } from './DebugSpace';\n\nexport default DebugSpace;\n"],
5
- "mappings": ";;;;;;;;;AAIA,OAAOA,UAAkBC,YAAYC,WAAAA,UAASC,YAAAA,iBAAgB;AAE9D,SAASC,8BAAAA,mCAAkC;AAE3C,SAASC,oBAAoB;AAC7B,SAASC,kBAAkB;AAC3B,SAASC,aAAa;AACtB,SAASC,iBAAiB;AAC1B,SAASC,QAAoBC,0BAA0B;AACvD,SAASC,yBAAyB;AAClC,SAASC,sBAAsB;AAC/B,SAASC,MAAMC,cAAAA,aAAYC,OAA4CC,WAAAA,UAASC,uBAAuB;AACvG,SAASC,oBAAoB;;;ACZ7B,OAAOC,SAASC,SAASC,gBAAgB;AAEzC,SAAuCC,gBAAgBC,kCAAkC;AAEzF,SAASC,YAAYC,eAAe;AACpC,SAASC,qBAA0CC,aAAa;AAEhE,IAAM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invitation", "faker", "useClient", "Filter", "useSpaceInvitation", "InvitationEncoder", "useAsyncEffect", "Icon", "IconButton", "Input", "Toolbar", "useFileDownload", "safeParseInt", "React", "useMemo", "useState", "TestSchemaType", "createSpaceObjectGenerator", "IconButton", "Toolbar", "createColumnBuilder", "Table", "BATCH_SIZE", "ObjectCreator", "space", "onAddObjects", "generator", "useMemo", "createSpaceObjectGenerator", "objects", "setObjects", "useState", "Object", "values", "TestSchemaType", "map", "schema", "enabled", "mutations", "count", "mutationSize", "maxContentLength", "handleCreate", "params", "objectsCreated", "createObjects", "Math", "min", "mutateObjects", "length", "db", "flush", "handleUpdate", "row", "key", "value", "newObjects", "assign", "find", "object", "helper", "builder", "createColumnBuilder", "columns", "accessor", "switch", "label", "onUpdate", "string", "classNames", "number", "obj", "id", "Table", "Root", "Viewport", "Main", "data", "Toolbar", "IconButton", "icon", "onClick", "DEFAULT_COUNT", "DEFAULT_PERIOD", "DEFAULT_JITTER", "useRefresh", "update", "setUpdate", "useState", "CustomInput", "icon", "props", "React", "div", "role", "className", "Input", "Root", "TextInput", "classNames", "size", "Icon", "DebugSpace", "space", "onAddObjects", "connect", "useSpaceInvitation", "key", "client", "useClient", "data", "setData", "handleUpdate", "useAsyncEffect", "isMounted", "diagnostics", "truncate", "spaces", "find", "toHex", "startsWith", "download", "useFileDownload", "handleDownload", "Blob", "JSON", "stringify", "undefined", "type", "Date", "toISOString", "replace", "mutationCount", "setMutationCount", "String", "mutationInterval", "setMutationInterval", "mutationJitter", "setMutationJitter", "generator", "useMemo", "createSpaceObjectGenerator", "running", "start", "stop", "useContext", "DebugContext", "handleToggleRunning", "objects", "db", "query", "Filter", "schema", "DocumentType", "run", "length", "object", "faker", "helpers", "arrayElement", "mutateObject", "count", "mutationSize", "maxContentLength", "safeParseInt", "interval", "jitter", "handleCreateInvitation", "invitation", "share", "Invitation", "Type", "INTERACTIVE", "authMethod", "AuthMethod", "NONE", "multiUse", "code", "InvitationEncoder", "encode", "get", "URL", "window", "origin", "searchParams", "set", "url", "navigator", "clipboard", "writeText", "handleCreateEpoch", "internal", "createEpoch", "Container", "toolbar", "Toolbar", "autoComplete", "placeholder", "value", "onChange", "target", "IconButton", "iconOnly", "label", "onClick", "Expander", "iconClassNames", "ObjectCreator", "DebugSpace"]
7
- }