@dxos/plugin-explorer 0.8.4-main.69d29f4 → 0.8.4-main.6fa680abb7

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 (92) hide show
  1. package/dist/lib/browser/{ExplorerContainer-BFAWRIAJ.mjs → ExplorerContainer-JBCVWH3M.mjs} +19 -16
  2. package/dist/lib/browser/ExplorerContainer-JBCVWH3M.mjs.map +7 -0
  3. package/dist/lib/browser/{chunk-HIFLWHXR.mjs → chunk-3Y7INKYN.mjs} +6 -21
  4. package/dist/lib/browser/chunk-3Y7INKYN.mjs.map +7 -0
  5. package/dist/lib/browser/{chunk-YNQF4CPY.mjs → chunk-LSUP47BZ.mjs} +2 -2
  6. package/dist/lib/browser/{chunk-YNQF4CPY.mjs.map → chunk-LSUP47BZ.mjs.map} +1 -1
  7. package/dist/lib/{node-esm/chunk-QLMTN2XI.mjs → browser/chunk-WX7QIZMF.mjs} +218 -18
  8. package/dist/lib/browser/{chunk-AGZAGILW.mjs.map → chunk-WX7QIZMF.mjs.map} +4 -4
  9. package/dist/lib/browser/index.mjs +18 -22
  10. package/dist/lib/browser/index.mjs.map +3 -3
  11. package/dist/lib/browser/meta.json +1 -1
  12. package/dist/lib/browser/meta.mjs +1 -1
  13. package/dist/lib/browser/{react-surface-RWVHQL3J.mjs → react-surface-FWNW2HFX.mjs} +13 -10
  14. package/dist/lib/browser/react-surface-FWNW2HFX.mjs.map +7 -0
  15. package/dist/lib/browser/types/index.mjs +1 -1
  16. package/dist/lib/node-esm/{ExplorerContainer-YQ2KKBVS.mjs → ExplorerContainer-5JTSMOCL.mjs} +19 -16
  17. package/dist/lib/node-esm/ExplorerContainer-5JTSMOCL.mjs.map +7 -0
  18. package/dist/lib/{browser/chunk-AGZAGILW.mjs → node-esm/chunk-3Z2WBI3N.mjs} +220 -16
  19. package/dist/lib/node-esm/{chunk-QLMTN2XI.mjs.map → chunk-3Z2WBI3N.mjs.map} +4 -4
  20. package/dist/lib/node-esm/{chunk-3OE6TBJI.mjs → chunk-6OG6G75N.mjs} +6 -21
  21. package/dist/lib/node-esm/chunk-6OG6G75N.mjs.map +7 -0
  22. package/dist/lib/node-esm/{chunk-DK77RB6M.mjs → chunk-EN3JZNEY.mjs} +2 -2
  23. package/dist/lib/node-esm/{chunk-DK77RB6M.mjs.map → chunk-EN3JZNEY.mjs.map} +1 -1
  24. package/dist/lib/node-esm/index.mjs +18 -22
  25. package/dist/lib/node-esm/index.mjs.map +3 -3
  26. package/dist/lib/node-esm/meta.json +1 -1
  27. package/dist/lib/node-esm/meta.mjs +1 -1
  28. package/dist/lib/node-esm/{react-surface-3REUS7KW.mjs → react-surface-BDRG4ZLM.mjs} +13 -10
  29. package/dist/lib/node-esm/react-surface-BDRG4ZLM.mjs.map +7 -0
  30. package/dist/lib/node-esm/types/index.mjs +1 -1
  31. package/dist/types/src/ExplorerPlugin.d.ts.map +1 -1
  32. package/dist/types/src/capabilities/react-surface/index.d.ts +1 -1
  33. package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -1
  34. package/dist/types/src/capabilities/react-surface/react-surface.d.ts +2 -2
  35. package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -1
  36. package/dist/types/src/components/Graph/D3ForceGraph.d.ts +3 -3
  37. package/dist/types/src/components/Graph/D3ForceGraph.d.ts.map +1 -1
  38. package/dist/types/src/components/Graph/D3ForceGraph.stories.d.ts +2 -2
  39. package/dist/types/src/components/Graph/ForceGraph.stories.d.ts +1 -1
  40. package/dist/types/src/components/Tree/types/tree.d.ts +3 -3
  41. package/dist/types/src/components/Tree/types/tree.d.ts.map +1 -1
  42. package/dist/types/src/components/index.d.ts +0 -2
  43. package/dist/types/src/components/index.d.ts.map +1 -1
  44. package/dist/types/src/containers/ExplorerContainer/ExplorerContainer.d.ts +6 -0
  45. package/dist/types/src/containers/ExplorerContainer/ExplorerContainer.d.ts.map +1 -0
  46. package/dist/types/src/containers/ExplorerContainer/index.d.ts +3 -0
  47. package/dist/types/src/containers/ExplorerContainer/index.d.ts.map +1 -0
  48. package/dist/types/src/containers/index.d.ts +3 -0
  49. package/dist/types/src/containers/index.d.ts.map +1 -0
  50. package/dist/types/src/hooks/useGraphModel.d.ts.map +1 -1
  51. package/dist/types/src/translations.d.ts +2 -0
  52. package/dist/types/src/translations.d.ts.map +1 -1
  53. package/dist/types/src/types/ExplorerAction.d.ts.map +1 -1
  54. package/dist/types/src/types/Graph.d.ts +2 -9
  55. package/dist/types/src/types/Graph.d.ts.map +1 -1
  56. package/dist/types/tsconfig.tsbuildinfo +1 -1
  57. package/package.json +38 -37
  58. package/src/ExplorerPlugin.tsx +8 -7
  59. package/src/capabilities/react-surface/react-surface.tsx +7 -6
  60. package/src/components/Chart/Chart.stories.tsx +2 -2
  61. package/src/components/Globe/Globe.stories.tsx +2 -2
  62. package/src/components/Graph/D3ForceGraph.stories.tsx +10 -10
  63. package/src/components/Graph/D3ForceGraph.tsx +6 -5
  64. package/src/components/Graph/ForceGraph.stories.tsx +10 -10
  65. package/src/components/Graph/testing.ts +2 -2
  66. package/src/components/Tree/Tree.stories.tsx +2 -2
  67. package/src/components/Tree/types/tree.ts +3 -3
  68. package/src/components/index.ts +0 -4
  69. package/src/{components → containers/ExplorerContainer}/ExplorerContainer.tsx +19 -18
  70. package/src/containers/ExplorerContainer/index.ts +7 -0
  71. package/src/containers/index.ts +7 -0
  72. package/src/hooks/useGraphModel.ts +4 -3
  73. package/src/meta.ts +1 -1
  74. package/src/translations.ts +1 -0
  75. package/src/types/ExplorerAction.ts +0 -1
  76. package/src/types/Graph.ts +5 -22
  77. package/dist/lib/browser/ExplorerContainer-BFAWRIAJ.mjs.map +0 -7
  78. package/dist/lib/browser/chunk-BZMTFAP3.mjs +0 -34
  79. package/dist/lib/browser/chunk-BZMTFAP3.mjs.map +0 -7
  80. package/dist/lib/browser/chunk-HIFLWHXR.mjs.map +0 -7
  81. package/dist/lib/browser/chunk-MGBT2ZFU.mjs +0 -177
  82. package/dist/lib/browser/chunk-MGBT2ZFU.mjs.map +0 -7
  83. package/dist/lib/browser/react-surface-RWVHQL3J.mjs.map +0 -7
  84. package/dist/lib/node-esm/ExplorerContainer-YQ2KKBVS.mjs.map +0 -7
  85. package/dist/lib/node-esm/chunk-3OE6TBJI.mjs.map +0 -7
  86. package/dist/lib/node-esm/chunk-IPIGIQHX.mjs +0 -36
  87. package/dist/lib/node-esm/chunk-IPIGIQHX.mjs.map +0 -7
  88. package/dist/lib/node-esm/chunk-YWJBDETV.mjs +0 -179
  89. package/dist/lib/node-esm/chunk-YWJBDETV.mjs.map +0 -7
  90. package/dist/lib/node-esm/react-surface-3REUS7KW.mjs.map +0 -7
  91. package/dist/types/src/components/ExplorerContainer.d.ts +0 -7
  92. package/dist/types/src/components/ExplorerContainer.d.ts.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/plugin-explorer",
3
- "version": "0.8.4-main.69d29f4",
3
+ "version": "0.8.4-main.6fa680abb7",
4
4
  "description": "Braneframe data visualization plugin",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
@@ -14,21 +14,21 @@
14
14
  "type": "module",
15
15
  "exports": {
16
16
  ".": {
17
+ "source": "./src/index.ts",
17
18
  "browser": "./dist/lib/browser/index.mjs",
18
19
  "node": "./dist/lib/node-esm/index.mjs",
19
- "source": "./src/index.ts",
20
20
  "types": "./dist/types/src/index.d.ts"
21
21
  },
22
22
  "./meta": {
23
+ "source": "./src/meta.ts",
23
24
  "browser": "./dist/lib/browser/meta.mjs",
24
25
  "node": "./dist/lib/node-esm/meta.mjs",
25
- "source": "./src/meta.ts",
26
26
  "types": "./dist/types/src/meta.d.ts"
27
27
  },
28
28
  "./types": {
29
+ "source": "./src/types/index.ts",
29
30
  "browser": "./dist/lib/browser/types/index.mjs",
30
31
  "node": "./dist/lib/node-esm/types/index.mjs",
31
- "source": "./src/types/index.ts",
32
32
  "types": "./dist/types/src/types/index.d.ts"
33
33
  }
34
34
  },
@@ -49,37 +49,38 @@
49
49
  ],
50
50
  "dependencies": {
51
51
  "3d-force-graph": "^1.76.1",
52
- "@effect-atom/atom-react": "^0.4.6",
52
+ "@effect-atom/atom-react": "^0.5.0",
53
53
  "@observablehq/plot": "^0.6.11",
54
54
  "d3": "^7.9.0",
55
- "effect": "3.19.11",
55
+ "effect": "3.19.16",
56
56
  "force-graph": "^1.49.4",
57
57
  "lodash.defaultsdeep": "^4.6.1",
58
58
  "react-resize-detector": "^11.0.1",
59
59
  "three": "^0.178.0",
60
60
  "topojson-client": "^3.1.0",
61
- "@dxos/async": "0.8.4-main.69d29f4",
62
- "@dxos/client": "0.8.4-main.69d29f4",
63
- "@dxos/echo": "0.8.4-main.69d29f4",
64
- "@dxos/echo-query": "0.8.4-main.69d29f4",
65
- "@dxos/app-framework": "0.8.4-main.69d29f4",
66
- "@dxos/invariant": "0.8.4-main.69d29f4",
67
- "@dxos/graph": "0.8.4-main.69d29f4",
68
- "@dxos/operation": "0.8.4-main.69d29f4",
69
- "@dxos/log": "0.8.4-main.69d29f4",
70
- "@dxos/plugin-graph": "0.8.4-main.69d29f4",
71
- "@dxos/plugin-client": "0.8.4-main.69d29f4",
72
- "@dxos/plugin-space": "0.8.4-main.69d29f4",
73
- "@dxos/plugin-search": "0.8.4-main.69d29f4",
74
- "@dxos/react-ui-attention": "0.8.4-main.69d29f4",
75
- "@dxos/react-ui-components": "0.8.4-main.69d29f4",
76
- "@dxos/react-ui-graph": "0.8.4-main.69d29f4",
77
- "@dxos/react-ui-mosaic": "0.8.4-main.69d29f4",
78
- "@dxos/util": "0.8.4-main.69d29f4",
79
- "@dxos/react-ui-stack": "0.8.4-main.69d29f4",
80
- "@dxos/types": "0.8.4-main.69d29f4",
81
- "@dxos/react-client": "0.8.4-main.69d29f4",
82
- "@dxos/schema": "0.8.4-main.69d29f4"
61
+ "@dxos/app-framework": "0.8.4-main.6fa680abb7",
62
+ "@dxos/async": "0.8.4-main.6fa680abb7",
63
+ "@dxos/echo-query": "0.8.4-main.6fa680abb7",
64
+ "@dxos/echo": "0.8.4-main.6fa680abb7",
65
+ "@dxos/graph": "0.8.4-main.6fa680abb7",
66
+ "@dxos/invariant": "0.8.4-main.6fa680abb7",
67
+ "@dxos/log": "0.8.4-main.6fa680abb7",
68
+ "@dxos/operation": "0.8.4-main.6fa680abb7",
69
+ "@dxos/plugin-client": "0.8.4-main.6fa680abb7",
70
+ "@dxos/client": "0.8.4-main.6fa680abb7",
71
+ "@dxos/plugin-graph": "0.8.4-main.6fa680abb7",
72
+ "@dxos/plugin-search": "0.8.4-main.6fa680abb7",
73
+ "@dxos/react-client": "0.8.4-main.6fa680abb7",
74
+ "@dxos/plugin-space": "0.8.4-main.6fa680abb7",
75
+ "@dxos/react-ui-attention": "0.8.4-main.6fa680abb7",
76
+ "@dxos/react-ui-mosaic": "0.8.4-main.6fa680abb7",
77
+ "@dxos/react-ui-components": "0.8.4-main.6fa680abb7",
78
+ "@dxos/react-ui-stack": "0.8.4-main.6fa680abb7",
79
+ "@dxos/schema": "0.8.4-main.6fa680abb7",
80
+ "@dxos/util": "0.8.4-main.6fa680abb7",
81
+ "@dxos/react-ui-graph": "0.8.4-main.6fa680abb7",
82
+ "@dxos/types": "0.8.4-main.6fa680abb7",
83
+ "@dxos/app-toolkit": "0.8.4-main.6fa680abb7"
83
84
  },
84
85
  "devDependencies": {
85
86
  "@types/d3": "^7.4.3",
@@ -91,19 +92,19 @@
91
92
  "@types/topojson-specification": "^1.0.5",
92
93
  "react": "~19.2.3",
93
94
  "react-dom": "~19.2.3",
94
- "vite": "7.1.9",
95
- "@dxos/echo-generator": "0.8.4-main.69d29f4",
96
- "@dxos/random": "0.8.4-main.69d29f4",
97
- "@dxos/storybook-utils": "0.8.4-main.69d29f4",
98
- "@dxos/react-ui": "0.8.4-main.69d29f4",
99
- "@dxos/ui-theme": "0.8.4-main.69d29f4"
95
+ "vite": "^7.1.11",
96
+ "@dxos/echo-generator": "0.8.4-main.6fa680abb7",
97
+ "@dxos/random": "0.8.4-main.6fa680abb7",
98
+ "@dxos/react-ui": "0.8.4-main.6fa680abb7",
99
+ "@dxos/storybook-utils": "0.8.4-main.6fa680abb7",
100
+ "@dxos/ui-theme": "0.8.4-main.6fa680abb7"
100
101
  },
101
102
  "peerDependencies": {
102
- "effect": "3.19.11",
103
+ "effect": "3.19.16",
103
104
  "react": "~19.2.3",
104
105
  "react-dom": "~19.2.3",
105
- "@dxos/ui-theme": "0.8.4-main.69d29f4",
106
- "@dxos/react-ui": "0.8.4-main.69d29f4"
106
+ "@dxos/react-ui": "0.8.4-main.6fa680abb7",
107
+ "@dxos/ui-theme": "0.8.4-main.6fa680abb7"
107
108
  },
108
109
  "publishConfig": {
109
110
  "access": "public"
@@ -4,10 +4,11 @@
4
4
 
5
5
  import * as Effect from 'effect/Effect';
6
6
 
7
- import { Common, Plugin } from '@dxos/app-framework';
7
+ import { Plugin } from '@dxos/app-framework';
8
+ import { AppPlugin } from '@dxos/app-toolkit';
8
9
  import { Type } from '@dxos/echo';
9
10
  import { type CreateObject } from '@dxos/plugin-space/types';
10
- import { View } from '@dxos/schema';
11
+ import { ViewModel } from '@dxos/schema';
11
12
 
12
13
  import { ReactSurface } from './capabilities';
13
14
  import { meta } from './meta';
@@ -15,8 +16,7 @@ import { translations } from './translations';
15
16
  import { ExplorerAction, Graph } from './types';
16
17
 
17
18
  export const ExplorerPlugin = Plugin.define(meta).pipe(
18
- Common.Plugin.addTranslationsModule({ translations }),
19
- Common.Plugin.addMetadataModule({
19
+ AppPlugin.addMetadataModule({
20
20
  metadata: {
21
21
  id: Type.getTypename(Graph.Graph),
22
22
  metadata: {
@@ -25,13 +25,14 @@ export const ExplorerPlugin = Plugin.define(meta).pipe(
25
25
  inputSchema: ExplorerAction.GraphProps,
26
26
  createObject: ((props, { db }) =>
27
27
  Effect.promise(async () => {
28
- const { view } = await View.makeFromDatabase({ db, typename: props.typename });
28
+ const { view } = await ViewModel.makeFromDatabase({ db, typename: props.typename });
29
29
  return Graph.make({ name: props.name, view });
30
30
  })) satisfies CreateObject,
31
31
  },
32
32
  },
33
33
  }),
34
- Common.Plugin.addSchemaModule({ schema: [Graph.Graph] }),
35
- Common.Plugin.addSurfaceModule({ activate: ReactSurface }),
34
+ AppPlugin.addSchemaModule({ schema: [Graph.Graph] }),
35
+ AppPlugin.addSurfaceModule({ activate: ReactSurface }),
36
+ AppPlugin.addTranslationsModule({ translations }),
36
37
  Plugin.make,
37
38
  );
@@ -5,20 +5,21 @@
5
5
  import * as Effect from 'effect/Effect';
6
6
  import React from 'react';
7
7
 
8
- import { Capability, Common } from '@dxos/app-framework';
8
+ import { Capabilities, Capability } from '@dxos/app-framework';
9
+ import { Surface } from '@dxos/app-framework/ui';
9
10
  import { Obj } from '@dxos/echo';
10
- import { type View } from '@dxos/schema';
11
+ import { type View } from '@dxos/echo';
11
12
 
12
- import { ExplorerContainer } from '../../components';
13
+ import { ExplorerContainer } from '../../containers';
13
14
  import { meta } from '../../meta';
14
15
  import { Graph } from '../../types';
15
16
 
16
17
  export default Capability.makeModule(() =>
17
18
  Effect.succeed(
18
19
  Capability.contributes(
19
- Common.Capability.ReactSurface,
20
- Common.createSurface({
21
- id: `${meta.id}/article`,
20
+ Capabilities.ReactSurface,
21
+ Surface.create({
22
+ id: `${meta.id}.article`,
22
23
  role: ['article', 'section'],
23
24
  filter: (data): data is { subject: View.View } => Obj.instanceOf(Graph.Graph, data.subject),
24
25
  component: ({ data, role }) => {
@@ -32,9 +32,9 @@ const Story = () => {
32
32
  export const Default = () => <ClientRepeater component={Story} />;
33
33
 
34
34
  const meta = {
35
- title: 'plugins/plugin-explorer/Chart',
35
+ title: 'plugins/plugin-explorer/components/Chart',
36
36
  component: Chart,
37
- decorators: [withTheme, withLayout()],
37
+ decorators: [withTheme(), withLayout()],
38
38
  parameters: {
39
39
  layout: 'fullscreen',
40
40
  },
@@ -80,8 +80,8 @@ const ExtendedStory = () => {
80
80
  };
81
81
 
82
82
  const meta = {
83
- title: 'plugins/plugin-explorer/Globe',
84
- decorators: [withTheme, withLayout()],
83
+ title: 'plugins/plugin-explorer/components/Globe',
84
+ decorators: [withTheme(), withLayout()],
85
85
  parameters: {
86
86
  layout: 'fullscreen',
87
87
  },
@@ -6,17 +6,17 @@ import { type Meta, type StoryObj } from '@storybook/react-vite';
6
6
  import React, { useState } from 'react';
7
7
 
8
8
  import { Type } from '@dxos/echo';
9
+ import { View } from '@dxos/echo';
9
10
  import { faker } from '@dxos/random';
10
11
  import { useClient } from '@dxos/react-client';
11
12
  import { type Space } from '@dxos/react-client/echo';
12
13
  import { withClientProvider } from '@dxos/react-client/testing';
13
14
  import { useAsyncEffect } from '@dxos/react-ui';
14
- import { withLayout, withTheme } from '@dxos/react-ui/testing';
15
- import { View } from '@dxos/schema';
15
+ import { Loading, withLayout, withTheme } from '@dxos/react-ui/testing';
16
+ import { ViewModel } from '@dxos/schema';
16
17
  import { type ValueGenerator } from '@dxos/schema/testing';
17
18
  import { withRegistry } from '@dxos/storybook-utils';
18
- import { render } from '@dxos/storybook-utils';
19
- import { HasRelationship, Organization, Person, Project } from '@dxos/types';
19
+ import { HasRelationship, Organization, Person, Pipeline } from '@dxos/types';
20
20
 
21
21
  import { useGraphModel } from '../../hooks';
22
22
  import { Graph } from '../../types';
@@ -36,7 +36,7 @@ const DefaultStory = () => {
36
36
  useAsyncEffect(async () => {
37
37
  const space = client.spaces.default;
38
38
  void generate(space, generator);
39
- const { view } = await View.makeFromDatabase({ db: space.db, typename: Type.getTypename(Graph.Graph) });
39
+ const { view } = await ViewModel.makeFromDatabase({ db: space.db, typename: Type.getTypename(Graph.Graph) });
40
40
  const graph = Graph.make({ name: 'Test', view });
41
41
  space.db.add(graph);
42
42
  setSpace(space);
@@ -45,19 +45,19 @@ const DefaultStory = () => {
45
45
 
46
46
  const model = useGraphModel(space);
47
47
  if (!model || !space || !graph) {
48
- return null;
48
+ return <Loading data={{ model: !!model, space: !!space, graph: !!graph }} />;
49
49
  }
50
50
 
51
51
  return <D3ForceGraph model={model} />;
52
52
  };
53
53
 
54
54
  const meta = {
55
- title: 'plugins/plugin-explorer/D3ForceGraph',
55
+ title: 'plugins/plugin-explorer/components/D3ForceGraph',
56
56
  component: D3ForceGraph,
57
- render: render(DefaultStory),
57
+ render: DefaultStory,
58
58
  decorators: [
59
59
  withRegistry,
60
- withTheme,
60
+ withTheme(),
61
61
  withLayout(),
62
62
  withClientProvider({
63
63
  createSpace: true,
@@ -65,7 +65,7 @@ const meta = {
65
65
  Graph.Graph,
66
66
  View.View,
67
67
  Organization.Organization,
68
- Project.Project,
68
+ Pipeline.Pipeline,
69
69
  Person.Person,
70
70
  HasRelationship.HasRelationship,
71
71
  ],
@@ -2,7 +2,7 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import React, { useCallback, useEffect, useMemo, useRef } from 'react';
5
+ import React, { type ComponentPropsWithoutRef, useCallback, useEffect, useMemo, useRef } from 'react';
6
6
 
7
7
  import { Obj } from '@dxos/echo';
8
8
  import { SelectionModel } from '@dxos/graph';
@@ -26,10 +26,11 @@ export type D3ForceGraphProps = ThemedClassName<
26
26
  match?: RegExp;
27
27
  selection?: SelectionModel;
28
28
  grid?: boolean;
29
- } & Pick<GraphProps, 'drag'>
29
+ } & Pick<GraphProps, 'drag'> &
30
+ ComponentPropsWithoutRef<'div'>
30
31
  >;
31
32
 
32
- export const D3ForceGraph = ({ classNames, model, selection: _selection, grid, ...props }: D3ForceGraphProps) => {
33
+ export const D3ForceGraph = ({ classNames, model, selection: _selection, grid, drag, ...props }: D3ForceGraphProps) => {
33
34
  const context = useRef<SVGContext>(null);
34
35
  const projector = useMemo<GraphForceProjector | undefined>(() => {
35
36
  if (context.current) {
@@ -66,12 +67,12 @@ export const D3ForceGraph = ({ classNames, model, selection: _selection, grid, .
66
67
  );
67
68
 
68
69
  return (
69
- <SVG.Root ref={context} classNames={classNames}>
70
+ <SVG.Root ref={context} classNames={classNames} {...props}>
70
71
  <SVG.Markers />
71
72
  {grid && <SVG.Grid axis />}
72
73
  <SVG.Zoom extent={[1 / 2, 2]}>
73
74
  <SVG.Graph<SpaceGraphNode, SpaceGraphEdge>
74
- {...props}
75
+ drag={drag}
75
76
  ref={graph}
76
77
  model={model}
77
78
  projector={projector}
@@ -6,17 +6,17 @@ import { type Meta, type StoryObj } from '@storybook/react-vite';
6
6
  import React, { useState } from 'react';
7
7
 
8
8
  import { Type } from '@dxos/echo';
9
+ import { View } from '@dxos/echo';
9
10
  import { faker } from '@dxos/random';
10
11
  import { useClient } from '@dxos/react-client';
11
12
  import { type Space } from '@dxos/react-client/echo';
12
13
  import { withClientProvider } from '@dxos/react-client/testing';
13
14
  import { useAsyncEffect } from '@dxos/react-ui';
14
- import { withLayout, withTheme } from '@dxos/react-ui/testing';
15
- import { View } from '@dxos/schema';
15
+ import { Loading, withLayout, withTheme } from '@dxos/react-ui/testing';
16
+ import { ViewModel } from '@dxos/schema';
16
17
  import { type ValueGenerator } from '@dxos/schema/testing';
17
18
  import { withRegistry } from '@dxos/storybook-utils';
18
- import { render } from '@dxos/storybook-utils';
19
- import { HasRelationship, Organization, Person, Project } from '@dxos/types';
19
+ import { HasRelationship, Organization, Person, Pipeline } from '@dxos/types';
20
20
 
21
21
  import { useGraphModel } from '../../hooks';
22
22
  import { Graph } from '../../types';
@@ -36,7 +36,7 @@ const DefaultStory = () => {
36
36
  useAsyncEffect(async () => {
37
37
  const space = client.spaces.default;
38
38
  void generate(space, generator);
39
- const { view } = await View.makeFromDatabase({ db: space.db, typename: Type.getTypename(Graph.Graph) });
39
+ const { view } = await ViewModel.makeFromDatabase({ db: space.db, typename: Type.getTypename(Graph.Graph) });
40
40
  const graph = Graph.make({ name: 'Test', view });
41
41
  space.db.add(graph);
42
42
  setSpace(space);
@@ -45,19 +45,19 @@ const DefaultStory = () => {
45
45
 
46
46
  const model = useGraphModel(space);
47
47
  if (!model || !space || !graph) {
48
- return null;
48
+ return <Loading data={{ model: !!model, space: !!space, graph: !!graph }} />;
49
49
  }
50
50
 
51
51
  return <ForceGraph model={model} />;
52
52
  };
53
53
 
54
54
  const meta = {
55
- title: 'plugins/plugin-explorer/ForceGraph',
55
+ title: 'plugins/plugin-explorer/components/ForceGraph',
56
56
  component: ForceGraph,
57
- render: render(DefaultStory),
57
+ render: DefaultStory,
58
58
  decorators: [
59
59
  withRegistry,
60
- withTheme,
60
+ withTheme(),
61
61
  withLayout(),
62
62
  withClientProvider({
63
63
  createSpace: true,
@@ -66,7 +66,7 @@ const meta = {
66
66
  View.View,
67
67
  HasRelationship.HasRelationship,
68
68
  Organization.Organization,
69
- Project.Project,
69
+ Pipeline.Pipeline,
70
70
  Person.Person,
71
71
  ],
72
72
  }),
@@ -5,14 +5,14 @@
5
5
  import { type Space } from '@dxos/client/echo';
6
6
  import { type Obj, Query, Relation } from '@dxos/echo';
7
7
  import { type TypeSpec, type ValueGenerator, createObjectFactory } from '@dxos/schema/testing';
8
- import { HasRelationship, Organization, Person, Project } from '@dxos/types';
8
+ import { HasRelationship, Organization, Person, Pipeline } from '@dxos/types';
9
9
  import { range } from '@dxos/util';
10
10
 
11
11
  const getObject = (objects: Obj.Unknown[]) => objects[Math.floor(Math.random() * objects.length)];
12
12
 
13
13
  const defaultTypes: TypeSpec[] = [
14
14
  { type: Organization.Organization, count: 5 },
15
- { type: Project.Project, count: 5 },
15
+ { type: Pipeline.Pipeline, count: 5 },
16
16
  { type: Person.Person, count: 10 },
17
17
  ];
18
18
 
@@ -44,10 +44,10 @@ const DefaultStory = () => {
44
44
  };
45
45
 
46
46
  const meta = {
47
- title: 'plugins/plugin-explorer/Tree',
47
+ title: 'plugins/plugin-explorer/components/Tree',
48
48
  component: Tree as any,
49
49
  render: DefaultStory,
50
- decorators: [withRegistry, withTheme, withLayout()],
50
+ decorators: [withRegistry, withTheme(), withLayout()],
51
51
  parameters: {
52
52
  layout: 'fullscreen',
53
53
  },
@@ -4,7 +4,7 @@
4
4
 
5
5
  import * as Schema from 'effect/Schema';
6
6
 
7
- import { Key, Obj, Type } from '@dxos/echo';
7
+ import { Key, Obj, Ref, Type } from '@dxos/echo';
8
8
  import { TestSchema } from '@dxos/echo/testing';
9
9
  import { invariant } from '@dxos/invariant';
10
10
 
@@ -14,7 +14,7 @@ export const TreeNodeType = Schema.Struct({
14
14
  id: Key.ObjectId,
15
15
  children: Schema.mutable(Schema.Array(Key.ObjectId)),
16
16
  data: Schema.mutable(Schema.Record({ key: Schema.String, value: Schema.Any })),
17
- ref: Schema.optional(Type.Ref(TestSchema.Expando)),
17
+ ref: Schema.optional(Ref.Ref(TestSchema.Expando)),
18
18
  }).pipe(Schema.mutable);
19
19
 
20
20
  export interface TreeNodeType extends Schema.Schema.Type<typeof TreeNodeType> {}
@@ -24,7 +24,7 @@ export const TreeType = Schema.Struct({
24
24
  nodes: Schema.mutable(Schema.Record({ key: Key.ObjectId, value: TreeNodeType })),
25
25
  }).pipe(
26
26
  Type.object({
27
- typename: 'dxos.org/type/Tree',
27
+ typename: 'org.dxos.type.tree',
28
28
  version: '0.1.0',
29
29
  }),
30
30
  );
@@ -2,11 +2,7 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import { type ComponentType, lazy } from 'react';
6
-
7
5
  export * from './Chart';
8
6
  export * from './Globe';
9
7
  export * from './Graph';
10
8
  export * from './Tree';
11
-
12
- export const ExplorerContainer: ComponentType<any> = lazy(() => import('./ExplorerContainer'));
@@ -4,24 +4,23 @@
4
4
 
5
5
  import React, { useCallback, useMemo, useState } from 'react';
6
6
 
7
- import { type SurfaceComponentProps } from '@dxos/app-framework/react';
7
+ import { type SurfaceComponentProps } from '@dxos/app-toolkit/ui';
8
8
  import { type Filter } from '@dxos/echo';
9
+ import { type View } from '@dxos/echo';
9
10
  import { QueryBuilder } from '@dxos/echo-query';
10
11
  import { useGlobalSearch } from '@dxos/plugin-search';
11
- import { getSpace } from '@dxos/react-client/echo';
12
- import { Toolbar } from '@dxos/react-ui';
12
+ import { getSpace, useObject } from '@dxos/react-client/echo';
13
+ import { Panel, Toolbar } from '@dxos/react-ui';
13
14
  import { QueryEditor, type QueryEditorProps } from '@dxos/react-ui-components';
14
- import { Layout } from '@dxos/react-ui-mosaic';
15
- import { type View } from '@dxos/schema';
16
15
 
17
- import { useGraphModel } from '../hooks';
18
-
19
- import { D3ForceGraph } from './Graph';
16
+ import { D3ForceGraph } from '../../components';
17
+ import { useGraphModel } from '../../hooks';
20
18
 
21
19
  export type ExplorerContainerProps = SurfaceComponentProps<View.View>;
22
20
 
23
- const ExplorerContainer = ({ role, subject: view }: ExplorerContainerProps) => {
24
- const space = getSpace(view);
21
+ export const ExplorerContainer = ({ role, subject: view }: ExplorerContainerProps) => {
22
+ useObject(view);
23
+ const space = view && getSpace(view);
25
24
  const [filter, setFilter] = useState<Filter.Any>();
26
25
  const model = useGraphModel(space, filter);
27
26
  const { match } = useGlobalSearch();
@@ -38,15 +37,17 @@ const ExplorerContainer = ({ role, subject: view }: ExplorerContainerProps) => {
38
37
  }
39
38
 
40
39
  return (
41
- <Layout.Main role={role} toolbar={showToolbar}>
40
+ <Panel.Root role={role}>
42
41
  {showToolbar && (
43
- <Toolbar.Root>
44
- <QueryEditor db={space.db} onChange={handleChange} />
45
- </Toolbar.Root>
42
+ <Panel.Toolbar asChild>
43
+ <Toolbar.Root>
44
+ <QueryEditor db={space.db} onChange={handleChange} />
45
+ </Toolbar.Root>
46
+ </Panel.Toolbar>
46
47
  )}
47
- <D3ForceGraph model={model} match={match} />
48
- </Layout.Main>
48
+ <Panel.Content asChild>
49
+ <D3ForceGraph model={model} match={match} />
50
+ </Panel.Content>
51
+ </Panel.Root>
49
52
  );
50
53
  };
51
-
52
- export default ExplorerContainer;
@@ -0,0 +1,7 @@
1
+ //
2
+ // Copyright 2023 DXOS.org
3
+ //
4
+
5
+ import { ExplorerContainer } from './ExplorerContainer';
6
+
7
+ export default ExplorerContainer;
@@ -0,0 +1,7 @@
1
+ //
2
+ // Copyright 2023 DXOS.org
3
+ //
4
+
5
+ import { type ComponentType, lazy } from 'react';
6
+
7
+ export const ExplorerContainer: ComponentType<any> = lazy(() => import('./ExplorerContainer'));
@@ -2,9 +2,10 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import { RegistryContext } from '@effect-atom/atom-react';
6
- import { useContext, useEffect, useState } from 'react';
5
+ import { useEffect, useState } from 'react';
7
6
 
7
+ import { Capabilities } from '@dxos/app-framework';
8
+ import { useCapability } from '@dxos/app-framework/ui';
8
9
  import { type Filter, type Queue, type Space } from '@dxos/client/echo';
9
10
  import { SpaceGraphModel, type SpaceGraphModelOptions } from '@dxos/schema';
10
11
 
@@ -15,7 +16,7 @@ export const useGraphModel = (
15
16
  options?: SpaceGraphModelOptions,
16
17
  queue?: Queue,
17
18
  ): SpaceGraphModel | undefined => {
18
- const registry = useContext(RegistryContext);
19
+ const registry = useCapability(Capabilities.AtomRegistry);
19
20
  const [model, setModel] = useState<SpaceGraphModel | undefined>(undefined);
20
21
  useEffect(() => {
21
22
  if (!space) {
package/src/meta.ts CHANGED
@@ -6,7 +6,7 @@ import { type Plugin } from '@dxos/app-framework';
6
6
  import { trim } from '@dxos/util';
7
7
 
8
8
  export const meta: Plugin.Meta = {
9
- id: 'dxos.org/plugin/explorer',
9
+ id: 'org.dxos.plugin.explorer',
10
10
  name: 'Explorer',
11
11
  description: trim`
12
12
  Interactive hypergraph visualization that reveals relationships between objects in your workspace.
@@ -18,6 +18,7 @@ export const translations = [
18
18
  'typename label_one': 'Explorer',
19
19
  'typename label_other': 'Explorers',
20
20
  'object name placeholder': 'New explorer',
21
+ 'add object label': 'Add explorer',
21
22
  'rename object label': 'Rename explorer',
22
23
  'delete object label': 'Delete explorer',
23
24
  'object deleted label': 'Explorer deleted',
@@ -14,7 +14,6 @@ export const GraphProps = Schema.Struct({
14
14
  TypeInputOptionsAnnotation.set({
15
15
  location: ['database', 'runtime'],
16
16
  kind: ['user'],
17
- registered: ['registered'],
18
17
  }),
19
18
  Schema.optional,
20
19
  ),
@@ -5,13 +5,14 @@
5
5
  import * as Schema from 'effect/Schema';
6
6
 
7
7
  import { Filter, Obj, Query, QueryAST, Ref, Type } from '@dxos/echo';
8
+ import { View } from '@dxos/echo';
8
9
  import { FormInputAnnotation, LabelAnnotation } from '@dxos/echo/internal';
9
- import { View, ViewAnnotation } from '@dxos/schema';
10
+ import { ViewAnnotation } from '@dxos/schema';
10
11
 
11
12
  const GraphSchema = Schema.Struct({
12
13
  name: Schema.optional(Schema.String),
13
14
 
14
- view: Type.Ref(View.View).pipe(FormInputAnnotation.set(false)),
15
+ view: Ref.Ref(View.View).pipe(FormInputAnnotation.set(false)),
15
16
 
16
17
  query: Schema.Struct({
17
18
  raw: Schema.optional(Schema.String),
@@ -19,8 +20,8 @@ const GraphSchema = Schema.Struct({
19
20
  }).pipe(FormInputAnnotation.set(false)),
20
21
  }).pipe(
21
22
  Type.object({
22
- typename: 'dxos.org/type/Graph',
23
- version: '0.2.0',
23
+ typename: 'org.dxos.type.graph',
24
+ version: '0.1.0',
24
25
  }),
25
26
  LabelAnnotation.set(['name']),
26
27
  ViewAnnotation.set(true),
@@ -42,21 +43,3 @@ export const make = ({
42
43
  }: MakeProps): Graph => {
43
44
  return Obj.make(Graph, { name, view: Ref.make(view), query });
44
45
  };
45
-
46
- //
47
- // V1
48
- //
49
-
50
- export const GraphV1 = Schema.Struct({
51
- name: Schema.optional(Schema.String),
52
- query: Schema.Struct({
53
- raw: Schema.optional(Schema.String),
54
- ast: QueryAST.Query,
55
- }),
56
- }).pipe(
57
- Type.object({
58
- typename: 'dxos.org/type/Graph',
59
- version: '0.1.0',
60
- }),
61
- LabelAnnotation.set(['name']),
62
- );