@dxos/plugin-explorer 0.8.4-main.21d9917 → 0.8.4-main.2244d791bb
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/browser/{ExplorerContainer-BFAWRIAJ.mjs → ExplorerContainer-46BHUF6R.mjs} +6 -6
- package/dist/lib/browser/ExplorerContainer-46BHUF6R.mjs.map +7 -0
- package/dist/lib/browser/{chunk-DXORXPUJ.mjs → chunk-HIFLWHXR.mjs} +3 -3
- package/dist/lib/browser/{chunk-DXORXPUJ.mjs.map → chunk-HIFLWHXR.mjs.map} +3 -3
- package/dist/lib/browser/{chunk-AGZAGILW.mjs → chunk-JZSBQYJQ.mjs} +2 -2
- package/dist/lib/browser/{chunk-BZMTFAP3.mjs → chunk-KIXHZZ2C.mjs} +5 -4
- package/dist/lib/browser/chunk-KIXHZZ2C.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +11 -10
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-surface-24INQLMB.mjs → react-surface-TPQAT5EI.mjs} +6 -5
- package/dist/lib/browser/react-surface-TPQAT5EI.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +1 -1
- package/dist/lib/node-esm/{ExplorerContainer-YQ2KKBVS.mjs → ExplorerContainer-OZNG47QB.mjs} +6 -6
- package/dist/lib/node-esm/ExplorerContainer-OZNG47QB.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-UCH3WYRD.mjs → chunk-3OE6TBJI.mjs} +3 -3
- package/dist/lib/node-esm/{chunk-UCH3WYRD.mjs.map → chunk-3OE6TBJI.mjs.map} +3 -3
- package/dist/lib/node-esm/{chunk-IPIGIQHX.mjs → chunk-ASRWO2N5.mjs} +5 -4
- package/dist/lib/node-esm/chunk-ASRWO2N5.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-QLMTN2XI.mjs → chunk-K5BYG7BW.mjs} +2 -2
- package/dist/lib/node-esm/index.mjs +11 -10
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-surface-F465WXH7.mjs → react-surface-CYHGJJDU.mjs} +6 -5
- package/dist/lib/node-esm/react-surface-CYHGJJDU.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +1 -1
- package/dist/types/src/ExplorerPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface/index.d.ts +1 -1
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts +2 -2
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -1
- package/dist/types/src/components/ExplorerContainer.d.ts +1 -1
- package/dist/types/src/components/ExplorerContainer.d.ts.map +1 -1
- package/dist/types/src/hooks/useGraphModel.d.ts.map +1 -1
- package/dist/types/src/types/Graph.d.ts +4 -4
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +34 -33
- package/src/ExplorerPlugin.tsx +6 -5
- package/src/capabilities/react-surface/react-surface.tsx +4 -3
- package/src/components/Chart/Chart.stories.tsx +1 -1
- package/src/components/ExplorerContainer.tsx +5 -5
- package/src/components/Globe/Globe.stories.tsx +1 -1
- package/src/components/Graph/D3ForceGraph.stories.tsx +3 -3
- package/src/components/Graph/ForceGraph.stories.tsx +3 -3
- package/src/components/Graph/testing.ts +2 -2
- package/src/components/Tree/Tree.stories.tsx +1 -1
- package/src/hooks/useGraphModel.ts +4 -3
- package/src/types/Graph.ts +2 -2
- package/dist/lib/browser/ExplorerContainer-BFAWRIAJ.mjs.map +0 -7
- package/dist/lib/browser/chunk-BZMTFAP3.mjs.map +0 -7
- package/dist/lib/browser/react-surface-24INQLMB.mjs.map +0 -7
- package/dist/lib/node-esm/ExplorerContainer-YQ2KKBVS.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-IPIGIQHX.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-F465WXH7.mjs.map +0 -7
- /package/dist/lib/browser/{chunk-AGZAGILW.mjs.map → chunk-JZSBQYJQ.mjs.map} +0 -0
- /package/dist/lib/node-esm/{chunk-QLMTN2XI.mjs.map → chunk-K5BYG7BW.mjs.map} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-explorer",
|
|
3
|
-
"version": "0.8.4-main.
|
|
3
|
+
"version": "0.8.4-main.2244d791bb",
|
|
4
4
|
"description": "Braneframe data visualization plugin",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -49,37 +49,38 @@
|
|
|
49
49
|
],
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"3d-force-graph": "^1.76.1",
|
|
52
|
-
"@effect-atom/atom-react": "^0.
|
|
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.
|
|
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/app-framework": "0.8.4-main.
|
|
62
|
-
"@dxos/
|
|
63
|
-
"@dxos/
|
|
64
|
-
"@dxos/echo": "0.8.4-main.
|
|
65
|
-
"@dxos/
|
|
66
|
-
"@dxos/
|
|
67
|
-
"@dxos/
|
|
68
|
-
"@dxos/
|
|
69
|
-
"@dxos/
|
|
70
|
-
"@dxos/
|
|
71
|
-
"@dxos/plugin-
|
|
72
|
-
"@dxos/plugin-
|
|
73
|
-
"@dxos/
|
|
74
|
-
"@dxos/
|
|
75
|
-
"@dxos/react-
|
|
76
|
-
"@dxos/react-ui-
|
|
77
|
-
"@dxos/react-
|
|
78
|
-
"@dxos/react-ui-
|
|
79
|
-
"@dxos/react-ui-
|
|
80
|
-
"@dxos/
|
|
81
|
-
"@dxos/
|
|
82
|
-
"@dxos/types": "0.8.4-main.
|
|
61
|
+
"@dxos/app-framework": "0.8.4-main.2244d791bb",
|
|
62
|
+
"@dxos/app-toolkit": "0.8.4-main.2244d791bb",
|
|
63
|
+
"@dxos/async": "0.8.4-main.2244d791bb",
|
|
64
|
+
"@dxos/echo": "0.8.4-main.2244d791bb",
|
|
65
|
+
"@dxos/invariant": "0.8.4-main.2244d791bb",
|
|
66
|
+
"@dxos/echo-query": "0.8.4-main.2244d791bb",
|
|
67
|
+
"@dxos/graph": "0.8.4-main.2244d791bb",
|
|
68
|
+
"@dxos/client": "0.8.4-main.2244d791bb",
|
|
69
|
+
"@dxos/plugin-client": "0.8.4-main.2244d791bb",
|
|
70
|
+
"@dxos/operation": "0.8.4-main.2244d791bb",
|
|
71
|
+
"@dxos/plugin-space": "0.8.4-main.2244d791bb",
|
|
72
|
+
"@dxos/plugin-graph": "0.8.4-main.2244d791bb",
|
|
73
|
+
"@dxos/log": "0.8.4-main.2244d791bb",
|
|
74
|
+
"@dxos/plugin-search": "0.8.4-main.2244d791bb",
|
|
75
|
+
"@dxos/react-client": "0.8.4-main.2244d791bb",
|
|
76
|
+
"@dxos/react-ui-attention": "0.8.4-main.2244d791bb",
|
|
77
|
+
"@dxos/react-ui-components": "0.8.4-main.2244d791bb",
|
|
78
|
+
"@dxos/react-ui-graph": "0.8.4-main.2244d791bb",
|
|
79
|
+
"@dxos/react-ui-mosaic": "0.8.4-main.2244d791bb",
|
|
80
|
+
"@dxos/react-ui-stack": "0.8.4-main.2244d791bb",
|
|
81
|
+
"@dxos/schema": "0.8.4-main.2244d791bb",
|
|
82
|
+
"@dxos/types": "0.8.4-main.2244d791bb",
|
|
83
|
+
"@dxos/util": "0.8.4-main.2244d791bb"
|
|
83
84
|
},
|
|
84
85
|
"devDependencies": {
|
|
85
86
|
"@types/d3": "^7.4.3",
|
|
@@ -92,18 +93,18 @@
|
|
|
92
93
|
"react": "~19.2.3",
|
|
93
94
|
"react-dom": "~19.2.3",
|
|
94
95
|
"vite": "7.1.9",
|
|
95
|
-
"@dxos/
|
|
96
|
-
"@dxos/
|
|
97
|
-
"@dxos/
|
|
98
|
-
"@dxos/
|
|
99
|
-
"@dxos/ui
|
|
96
|
+
"@dxos/echo-generator": "0.8.4-main.2244d791bb",
|
|
97
|
+
"@dxos/random": "0.8.4-main.2244d791bb",
|
|
98
|
+
"@dxos/ui-theme": "0.8.4-main.2244d791bb",
|
|
99
|
+
"@dxos/storybook-utils": "0.8.4-main.2244d791bb",
|
|
100
|
+
"@dxos/react-ui": "0.8.4-main.2244d791bb"
|
|
100
101
|
},
|
|
101
102
|
"peerDependencies": {
|
|
102
|
-
"effect": "3.19.
|
|
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.
|
|
106
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
106
|
+
"@dxos/ui-theme": "0.8.4-main.2244d791bb",
|
|
107
|
+
"@dxos/react-ui": "0.8.4-main.2244d791bb"
|
|
107
108
|
},
|
|
108
109
|
"publishConfig": {
|
|
109
110
|
"access": "public"
|
package/src/ExplorerPlugin.tsx
CHANGED
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
import * as Effect from 'effect/Effect';
|
|
6
6
|
|
|
7
|
-
import {
|
|
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
11
|
import { View } from '@dxos/schema';
|
|
@@ -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
|
-
|
|
19
|
-
Common.Plugin.addMetadataModule({
|
|
19
|
+
AppPlugin.addMetadataModule({
|
|
20
20
|
metadata: {
|
|
21
21
|
id: Type.getTypename(Graph.Graph),
|
|
22
22
|
metadata: {
|
|
@@ -31,7 +31,8 @@ export const ExplorerPlugin = Plugin.define(meta).pipe(
|
|
|
31
31
|
},
|
|
32
32
|
},
|
|
33
33
|
}),
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
AppPlugin.addSchemaModule({ schema: [Graph.Graph] }),
|
|
35
|
+
AppPlugin.addSurfaceModule({ activate: ReactSurface }),
|
|
36
|
+
AppPlugin.addTranslationsModule({ translations }),
|
|
36
37
|
Plugin.make,
|
|
37
38
|
);
|
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
import * as Effect from 'effect/Effect';
|
|
6
6
|
import React from 'react';
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
9
|
+
import { Surface } from '@dxos/app-framework/ui';
|
|
9
10
|
import { Obj } from '@dxos/echo';
|
|
10
11
|
import { type View } from '@dxos/schema';
|
|
11
12
|
|
|
@@ -16,8 +17,8 @@ import { Graph } from '../../types';
|
|
|
16
17
|
export default Capability.makeModule(() =>
|
|
17
18
|
Effect.succeed(
|
|
18
19
|
Capability.contributes(
|
|
19
|
-
|
|
20
|
-
|
|
20
|
+
Capabilities.ReactSurface,
|
|
21
|
+
Surface.create({
|
|
21
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),
|
|
@@ -34,7 +34,7 @@ export const Default = () => <ClientRepeater component={Story} />;
|
|
|
34
34
|
const meta = {
|
|
35
35
|
title: 'plugins/plugin-explorer/Chart',
|
|
36
36
|
component: Chart,
|
|
37
|
-
decorators: [withTheme, withLayout()],
|
|
37
|
+
decorators: [withTheme(), withLayout()],
|
|
38
38
|
parameters: {
|
|
39
39
|
layout: 'fullscreen',
|
|
40
40
|
},
|
|
@@ -4,14 +4,13 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { useCallback, useMemo, useState } from 'react';
|
|
6
6
|
|
|
7
|
-
import { type SurfaceComponentProps } from '@dxos/app-
|
|
7
|
+
import { type SurfaceComponentProps } from '@dxos/app-toolkit/ui';
|
|
8
8
|
import { type Filter } from '@dxos/echo';
|
|
9
9
|
import { QueryBuilder } from '@dxos/echo-query';
|
|
10
10
|
import { useGlobalSearch } from '@dxos/plugin-search';
|
|
11
|
-
import { getSpace } from '@dxos/react-client/echo';
|
|
12
|
-
import { Toolbar } from '@dxos/react-ui';
|
|
11
|
+
import { getSpace, useObject } from '@dxos/react-client/echo';
|
|
12
|
+
import { Layout, Toolbar } from '@dxos/react-ui';
|
|
13
13
|
import { QueryEditor, type QueryEditorProps } from '@dxos/react-ui-components';
|
|
14
|
-
import { Layout } from '@dxos/react-ui-mosaic';
|
|
15
14
|
import { type View } from '@dxos/schema';
|
|
16
15
|
|
|
17
16
|
import { useGraphModel } from '../hooks';
|
|
@@ -21,7 +20,8 @@ import { D3ForceGraph } from './Graph';
|
|
|
21
20
|
export type ExplorerContainerProps = SurfaceComponentProps<View.View>;
|
|
22
21
|
|
|
23
22
|
const ExplorerContainer = ({ role, subject: view }: ExplorerContainerProps) => {
|
|
24
|
-
|
|
23
|
+
useObject(view);
|
|
24
|
+
const space = view && getSpace(view);
|
|
25
25
|
const [filter, setFilter] = useState<Filter.Any>();
|
|
26
26
|
const model = useGraphModel(space, filter);
|
|
27
27
|
const { match } = useGlobalSearch();
|
|
@@ -16,7 +16,7 @@ import { View } from '@dxos/schema';
|
|
|
16
16
|
import { type ValueGenerator } from '@dxos/schema/testing';
|
|
17
17
|
import { withRegistry } from '@dxos/storybook-utils';
|
|
18
18
|
import { render } from '@dxos/storybook-utils';
|
|
19
|
-
import { HasRelationship, Organization, Person,
|
|
19
|
+
import { HasRelationship, Organization, Person, Pipeline } from '@dxos/types';
|
|
20
20
|
|
|
21
21
|
import { useGraphModel } from '../../hooks';
|
|
22
22
|
import { Graph } from '../../types';
|
|
@@ -57,7 +57,7 @@ const meta = {
|
|
|
57
57
|
render: 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
|
-
|
|
68
|
+
Pipeline.Pipeline,
|
|
69
69
|
Person.Person,
|
|
70
70
|
HasRelationship.HasRelationship,
|
|
71
71
|
],
|
|
@@ -16,7 +16,7 @@ import { View } from '@dxos/schema';
|
|
|
16
16
|
import { type ValueGenerator } from '@dxos/schema/testing';
|
|
17
17
|
import { withRegistry } from '@dxos/storybook-utils';
|
|
18
18
|
import { render } from '@dxos/storybook-utils';
|
|
19
|
-
import { HasRelationship, Organization, Person,
|
|
19
|
+
import { HasRelationship, Organization, Person, Pipeline } from '@dxos/types';
|
|
20
20
|
|
|
21
21
|
import { useGraphModel } from '../../hooks';
|
|
22
22
|
import { Graph } from '../../types';
|
|
@@ -57,7 +57,7 @@ const meta = {
|
|
|
57
57
|
render: 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
|
-
|
|
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,
|
|
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:
|
|
15
|
+
{ type: Pipeline.Pipeline, count: 5 },
|
|
16
16
|
{ type: Person.Person, count: 10 },
|
|
17
17
|
];
|
|
18
18
|
|
|
@@ -47,7 +47,7 @@ const meta = {
|
|
|
47
47
|
title: 'plugins/plugin-explorer/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
|
},
|
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
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 =
|
|
19
|
+
const registry = useCapability(Capabilities.AtomRegistry);
|
|
19
20
|
const [model, setModel] = useState<SpaceGraphModel | undefined>(undefined);
|
|
20
21
|
useEffect(() => {
|
|
21
22
|
if (!space) {
|
package/src/types/Graph.ts
CHANGED
|
@@ -16,7 +16,7 @@ const GraphSchema = Schema.Struct({
|
|
|
16
16
|
query: Schema.Struct({
|
|
17
17
|
raw: Schema.optional(Schema.String),
|
|
18
18
|
ast: QueryAST.Query,
|
|
19
|
-
}).pipe(
|
|
19
|
+
}).pipe(FormInputAnnotation.set(false)),
|
|
20
20
|
}).pipe(
|
|
21
21
|
Type.object({
|
|
22
22
|
typename: 'dxos.org/type/Graph',
|
|
@@ -52,7 +52,7 @@ export const GraphV1 = Schema.Struct({
|
|
|
52
52
|
query: Schema.Struct({
|
|
53
53
|
raw: Schema.optional(Schema.String),
|
|
54
54
|
ast: QueryAST.Query,
|
|
55
|
-
})
|
|
55
|
+
}),
|
|
56
56
|
}).pipe(
|
|
57
57
|
Type.object({
|
|
58
58
|
typename: 'dxos.org/type/Graph',
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/ExplorerContainer.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { useCallback, useMemo, useState } from 'react';\n\nimport { type SurfaceComponentProps } from '@dxos/app-framework/react';\nimport { type Filter } from '@dxos/echo';\nimport { QueryBuilder } from '@dxos/echo-query';\nimport { useGlobalSearch } from '@dxos/plugin-search';\nimport { getSpace } from '@dxos/react-client/echo';\nimport { Toolbar } from '@dxos/react-ui';\nimport { QueryEditor, type QueryEditorProps } from '@dxos/react-ui-components';\nimport { Layout } from '@dxos/react-ui-mosaic';\nimport { type View } from '@dxos/schema';\n\nimport { useGraphModel } from '../hooks';\n\nimport { D3ForceGraph } from './Graph';\n\nexport type ExplorerContainerProps = SurfaceComponentProps<View.View>;\n\nconst ExplorerContainer = ({ role, subject: view }: ExplorerContainerProps) => {\n const space = getSpace(view);\n const [filter, setFilter] = useState<Filter.Any>();\n const model = useGraphModel(space, filter);\n const { match } = useGlobalSearch();\n\n const builder = useMemo(() => new QueryBuilder(), []);\n const handleChange = useCallback<NonNullable<QueryEditorProps['onChange']>>((value) => {\n setFilter(builder.build(value).filter);\n }, []);\n\n const showToolbar = role === 'article';\n\n if (!space || !model) {\n return null;\n }\n\n return (\n <Layout.Main role={role} toolbar={showToolbar}>\n {showToolbar && (\n <Toolbar.Root>\n <QueryEditor db={space.db} onChange={handleChange} />\n </Toolbar.Root>\n )}\n <D3ForceGraph model={model} match={match} />\n </Layout.Main>\n );\n};\n\nexport default ExplorerContainer;\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;AAIA,OAAOA,SAASC,aAAaC,SAASC,gBAAgB;AAItD,SAASC,oBAAoB;AAC7B,SAASC,uBAAuB;AAChC,SAASC,gBAAgB;AACzB,SAASC,eAAe;AACxB,SAASC,mBAA0C;AACnD,SAASC,cAAc;AASvB,IAAMC,oBAAoB,CAAC,EAAEC,MAAMC,SAASC,KAAI,MAA0B;AACxE,QAAMC,QAAQC,SAASF,IAAAA;AACvB,QAAM,CAACG,QAAQC,SAAAA,IAAaC,SAAAA;AAC5B,QAAMC,QAAQC,cAAcN,OAAOE,MAAAA;AACnC,QAAM,EAAEK,MAAK,IAAKC,gBAAAA;AAElB,QAAMC,UAAUC,QAAQ,MAAM,IAAIC,aAAAA,GAAgB,CAAA,CAAE;AACpD,QAAMC,eAAeC,YAAuD,CAACC,UAAAA;AAC3EX,cAAUM,QAAQM,MAAMD,KAAAA,EAAOZ,MAAM;EACvC,GAAG,CAAA,CAAE;AAEL,QAAMc,cAAcnB,SAAS;AAE7B,MAAI,CAACG,SAAS,CAACK,OAAO;AACpB,WAAO;EACT;AAEA,SACE,sBAAA,cAACY,OAAOC,MAAI;IAACrB;IAAYsB,SAASH;KAC/BA,eACC,sBAAA,cAACI,QAAQC,MAAI,MACX,sBAAA,cAACC,aAAAA;IAAYC,IAAIvB,MAAMuB;IAAIC,UAAUZ;OAGzC,sBAAA,cAACa,cAAAA;IAAapB;IAAcE;;AAGlC;AAEA,IAAA,4BAAeX;",
|
|
6
|
-
"names": ["React", "useCallback", "useMemo", "useState", "QueryBuilder", "useGlobalSearch", "getSpace", "Toolbar", "QueryEditor", "Layout", "ExplorerContainer", "role", "subject", "view", "space", "getSpace", "filter", "setFilter", "useState", "model", "useGraphModel", "match", "useGlobalSearch", "builder", "useMemo", "QueryBuilder", "handleChange", "useCallback", "value", "build", "showToolbar", "Layout", "Main", "toolbar", "Toolbar", "Root", "QueryEditor", "db", "onChange", "D3ForceGraph"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/hooks/useGraphModel.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { RegistryContext } from '@effect-atom/atom-react';\nimport { useContext, useEffect, useState } from 'react';\n\nimport { type Filter, type Queue, type Space } from '@dxos/client/echo';\nimport { SpaceGraphModel, type SpaceGraphModelOptions } from '@dxos/schema';\n\n// TODO(burdon): Factor out.\nexport const useGraphModel = (\n space: Space | undefined,\n filter?: Filter.Any | undefined,\n options?: SpaceGraphModelOptions,\n queue?: Queue,\n): SpaceGraphModel | undefined => {\n const registry = useContext(RegistryContext);\n const [model, setModel] = useState<SpaceGraphModel | undefined>(undefined);\n useEffect(() => {\n if (!space) {\n void model?.close();\n setModel(undefined);\n return;\n }\n\n // TODO(burdon): Does this need to be a dependency?\n if (!model || model.queue !== queue) {\n const model = new SpaceGraphModel(registry).setFilter(filter).setOptions(options);\n void model.open(space.db, queue);\n setModel(model);\n } else {\n model.setFilter(filter).setOptions(options);\n }\n }, [space, filter, options, queue, registry]);\n\n return model;\n};\n"],
|
|
5
|
-
"mappings": ";AAIA,SAASA,uBAAuB;AAChC,SAASC,YAAYC,WAAWC,gBAAgB;AAGhD,SAASC,uBAAoD;AAGtD,IAAMC,gBAAgB,CAC3BC,OACAC,QACAC,SACAC,UAAAA;AAEA,QAAMC,WAAWC,WAAWC,eAAAA;AAC5B,QAAM,CAACC,OAAOC,QAAAA,IAAYC,SAAsCC,MAAAA;AAChEC,YAAU,MAAA;AACR,QAAI,CAACX,OAAO;AACV,WAAKO,OAAOK,MAAAA;AACZJ,eAASE,MAAAA;AACT;IACF;AAGA,QAAI,CAACH,SAASA,MAAMJ,UAAUA,OAAO;AACnC,YAAMI,SAAQ,IAAIM,gBAAgBT,QAAAA,EAAUU,UAAUb,MAAAA,EAAQc,WAAWb,OAAAA;AACzE,WAAKK,OAAMS,KAAKhB,MAAMiB,IAAId,KAAAA;AAC1BK,eAASD,MAAAA;IACX,OAAO;AACLA,YAAMO,UAAUb,MAAAA,EAAQc,WAAWb,OAAAA;IACrC;EACF,GAAG;IAACF;IAAOC;IAAQC;IAASC;IAAOC;GAAS;AAE5C,SAAOG;AACT;",
|
|
6
|
-
"names": ["RegistryContext", "useContext", "useEffect", "useState", "SpaceGraphModel", "useGraphModel", "space", "filter", "options", "queue", "registry", "useContext", "RegistryContext", "model", "setModel", "useState", "undefined", "useEffect", "close", "SpaceGraphModel", "setFilter", "setOptions", "open", "db"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/react-surface/react-surface.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport React from 'react';\n\nimport { Capability, Common } from '@dxos/app-framework';\nimport { Obj } from '@dxos/echo';\nimport { type View } from '@dxos/schema';\n\nimport { ExplorerContainer } from '../../components';\nimport { meta } from '../../meta';\nimport { Graph } from '../../types';\n\nexport default Capability.makeModule(() =>\n Effect.succeed(\n Capability.contributes(\n Common.Capability.ReactSurface,\n Common.createSurface({\n id: `${meta.id}/article`,\n role: ['article', 'section'],\n filter: (data): data is { subject: View.View } => Obj.instanceOf(Graph.Graph, data.subject),\n component: ({ data, role }) => {\n return <ExplorerContainer role={role} subject={data.subject} />;\n },\n }),\n ),\n ),\n);\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;AAIA,YAAYA,YAAY;AACxB,OAAOC,WAAW;AAElB,SAASC,YAAYC,cAAc;AACnC,SAASC,WAAW;AAOpB,IAAA,wBAAeC,WAAWC,WAAW,MAC5BC,eACLF,WAAWG,YACTC,OAAOJ,WAAWK,cAClBD,OAAOE,cAAc;EACnBC,IAAI,GAAGC,KAAKD,EAAE;EACdE,MAAM;IAAC;IAAW;;EAClBC,QAAQ,CAACC,SAAyCC,IAAIC,WAAWC,cAAMA,OAAOH,KAAKI,OAAO;EAC1FC,WAAW,CAAC,EAAEL,MAAMF,KAAI,MAAE;AACxB,WAAO,sBAAA,cAACQ,mBAAAA;MAAkBR;MAAYM,SAASJ,KAAKI;;EACtD;AACF,CAAA,CAAA,CAAA,CAAA;",
|
|
6
|
-
"names": ["Effect", "React", "Capability", "Common", "Obj", "Capability", "makeModule", "succeed", "contributes", "Common", "ReactSurface", "createSurface", "id", "meta", "role", "filter", "data", "Obj", "instanceOf", "Graph", "subject", "component", "ExplorerContainer"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/ExplorerContainer.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { useCallback, useMemo, useState } from 'react';\n\nimport { type SurfaceComponentProps } from '@dxos/app-framework/react';\nimport { type Filter } from '@dxos/echo';\nimport { QueryBuilder } from '@dxos/echo-query';\nimport { useGlobalSearch } from '@dxos/plugin-search';\nimport { getSpace } from '@dxos/react-client/echo';\nimport { Toolbar } from '@dxos/react-ui';\nimport { QueryEditor, type QueryEditorProps } from '@dxos/react-ui-components';\nimport { Layout } from '@dxos/react-ui-mosaic';\nimport { type View } from '@dxos/schema';\n\nimport { useGraphModel } from '../hooks';\n\nimport { D3ForceGraph } from './Graph';\n\nexport type ExplorerContainerProps = SurfaceComponentProps<View.View>;\n\nconst ExplorerContainer = ({ role, subject: view }: ExplorerContainerProps) => {\n const space = getSpace(view);\n const [filter, setFilter] = useState<Filter.Any>();\n const model = useGraphModel(space, filter);\n const { match } = useGlobalSearch();\n\n const builder = useMemo(() => new QueryBuilder(), []);\n const handleChange = useCallback<NonNullable<QueryEditorProps['onChange']>>((value) => {\n setFilter(builder.build(value).filter);\n }, []);\n\n const showToolbar = role === 'article';\n\n if (!space || !model) {\n return null;\n }\n\n return (\n <Layout.Main role={role} toolbar={showToolbar}>\n {showToolbar && (\n <Toolbar.Root>\n <QueryEditor db={space.db} onChange={handleChange} />\n </Toolbar.Root>\n )}\n <D3ForceGraph model={model} match={match} />\n </Layout.Main>\n );\n};\n\nexport default ExplorerContainer;\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;AAIA,OAAOA,SAASC,aAAaC,SAASC,gBAAgB;AAItD,SAASC,oBAAoB;AAC7B,SAASC,uBAAuB;AAChC,SAASC,gBAAgB;AACzB,SAASC,eAAe;AACxB,SAASC,mBAA0C;AACnD,SAASC,cAAc;AASvB,IAAMC,oBAAoB,CAAC,EAAEC,MAAMC,SAASC,KAAI,MAA0B;AACxE,QAAMC,QAAQC,SAASF,IAAAA;AACvB,QAAM,CAACG,QAAQC,SAAAA,IAAaC,SAAAA;AAC5B,QAAMC,QAAQC,cAAcN,OAAOE,MAAAA;AACnC,QAAM,EAAEK,MAAK,IAAKC,gBAAAA;AAElB,QAAMC,UAAUC,QAAQ,MAAM,IAAIC,aAAAA,GAAgB,CAAA,CAAE;AACpD,QAAMC,eAAeC,YAAuD,CAACC,UAAAA;AAC3EX,cAAUM,QAAQM,MAAMD,KAAAA,EAAOZ,MAAM;EACvC,GAAG,CAAA,CAAE;AAEL,QAAMc,cAAcnB,SAAS;AAE7B,MAAI,CAACG,SAAS,CAACK,OAAO;AACpB,WAAO;EACT;AAEA,SACE,sBAAA,cAACY,OAAOC,MAAI;IAACrB;IAAYsB,SAASH;KAC/BA,eACC,sBAAA,cAACI,QAAQC,MAAI,MACX,sBAAA,cAACC,aAAAA;IAAYC,IAAIvB,MAAMuB;IAAIC,UAAUZ;OAGzC,sBAAA,cAACa,cAAAA;IAAapB;IAAcE;;AAGlC;AAEA,IAAA,4BAAeX;",
|
|
6
|
-
"names": ["React", "useCallback", "useMemo", "useState", "QueryBuilder", "useGlobalSearch", "getSpace", "Toolbar", "QueryEditor", "Layout", "ExplorerContainer", "role", "subject", "view", "space", "getSpace", "filter", "setFilter", "useState", "model", "useGraphModel", "match", "useGlobalSearch", "builder", "useMemo", "QueryBuilder", "handleChange", "useCallback", "value", "build", "showToolbar", "Layout", "Main", "toolbar", "Toolbar", "Root", "QueryEditor", "db", "onChange", "D3ForceGraph"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/hooks/useGraphModel.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { RegistryContext } from '@effect-atom/atom-react';\nimport { useContext, useEffect, useState } from 'react';\n\nimport { type Filter, type Queue, type Space } from '@dxos/client/echo';\nimport { SpaceGraphModel, type SpaceGraphModelOptions } from '@dxos/schema';\n\n// TODO(burdon): Factor out.\nexport const useGraphModel = (\n space: Space | undefined,\n filter?: Filter.Any | undefined,\n options?: SpaceGraphModelOptions,\n queue?: Queue,\n): SpaceGraphModel | undefined => {\n const registry = useContext(RegistryContext);\n const [model, setModel] = useState<SpaceGraphModel | undefined>(undefined);\n useEffect(() => {\n if (!space) {\n void model?.close();\n setModel(undefined);\n return;\n }\n\n // TODO(burdon): Does this need to be a dependency?\n if (!model || model.queue !== queue) {\n const model = new SpaceGraphModel(registry).setFilter(filter).setOptions(options);\n void model.open(space.db, queue);\n setModel(model);\n } else {\n model.setFilter(filter).setOptions(options);\n }\n }, [space, filter, options, queue, registry]);\n\n return model;\n};\n"],
|
|
5
|
-
"mappings": ";;;AAIA,SAASA,uBAAuB;AAChC,SAASC,YAAYC,WAAWC,gBAAgB;AAGhD,SAASC,uBAAoD;AAGtD,IAAMC,gBAAgB,CAC3BC,OACAC,QACAC,SACAC,UAAAA;AAEA,QAAMC,WAAWC,WAAWC,eAAAA;AAC5B,QAAM,CAACC,OAAOC,QAAAA,IAAYC,SAAsCC,MAAAA;AAChEC,YAAU,MAAA;AACR,QAAI,CAACX,OAAO;AACV,WAAKO,OAAOK,MAAAA;AACZJ,eAASE,MAAAA;AACT;IACF;AAGA,QAAI,CAACH,SAASA,MAAMJ,UAAUA,OAAO;AACnC,YAAMI,SAAQ,IAAIM,gBAAgBT,QAAAA,EAAUU,UAAUb,MAAAA,EAAQc,WAAWb,OAAAA;AACzE,WAAKK,OAAMS,KAAKhB,MAAMiB,IAAId,KAAAA;AAC1BK,eAASD,MAAAA;IACX,OAAO;AACLA,YAAMO,UAAUb,MAAAA,EAAQc,WAAWb,OAAAA;IACrC;EACF,GAAG;IAACF;IAAOC;IAAQC;IAASC;IAAOC;GAAS;AAE5C,SAAOG;AACT;",
|
|
6
|
-
"names": ["RegistryContext", "useContext", "useEffect", "useState", "SpaceGraphModel", "useGraphModel", "space", "filter", "options", "queue", "registry", "useContext", "RegistryContext", "model", "setModel", "useState", "undefined", "useEffect", "close", "SpaceGraphModel", "setFilter", "setOptions", "open", "db"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/react-surface/react-surface.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport React from 'react';\n\nimport { Capability, Common } from '@dxos/app-framework';\nimport { Obj } from '@dxos/echo';\nimport { type View } from '@dxos/schema';\n\nimport { ExplorerContainer } from '../../components';\nimport { meta } from '../../meta';\nimport { Graph } from '../../types';\n\nexport default Capability.makeModule(() =>\n Effect.succeed(\n Capability.contributes(\n Common.Capability.ReactSurface,\n Common.createSurface({\n id: `${meta.id}/article`,\n role: ['article', 'section'],\n filter: (data): data is { subject: View.View } => Obj.instanceOf(Graph.Graph, data.subject),\n component: ({ data, role }) => {\n return <ExplorerContainer role={role} subject={data.subject} />;\n },\n }),\n ),\n ),\n);\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;AAIA,YAAYA,YAAY;AACxB,OAAOC,WAAW;AAElB,SAASC,YAAYC,cAAc;AACnC,SAASC,WAAW;AAOpB,IAAA,wBAAeC,WAAWC,WAAW,MAC5BC,eACLF,WAAWG,YACTC,OAAOJ,WAAWK,cAClBD,OAAOE,cAAc;EACnBC,IAAI,GAAGC,KAAKD,EAAE;EACdE,MAAM;IAAC;IAAW;;EAClBC,QAAQ,CAACC,SAAyCC,IAAIC,WAAWC,cAAMA,OAAOH,KAAKI,OAAO;EAC1FC,WAAW,CAAC,EAAEL,MAAMF,KAAI,MAAE;AACxB,WAAO,sBAAA,cAACQ,mBAAAA;MAAkBR;MAAYM,SAASJ,KAAKI;;EACtD;AACF,CAAA,CAAA,CAAA,CAAA;",
|
|
6
|
-
"names": ["Effect", "React", "Capability", "Common", "Obj", "Capability", "makeModule", "succeed", "contributes", "Common", "ReactSurface", "createSurface", "id", "meta", "role", "filter", "data", "Obj", "instanceOf", "Graph", "subject", "component", "ExplorerContainer"]
|
|
7
|
-
}
|
|
File without changes
|
|
File without changes
|