@dxos/plugin-explorer 0.8.4-main.406dc2a → 0.8.4-main.548089c
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/browser/{ExplorerContainer-6SHZJ6AK.mjs → ExplorerContainer-NOLLVUTE.mjs} +3 -3
- package/dist/lib/browser/{ExplorerContainer-6SHZJ6AK.mjs.map → ExplorerContainer-NOLLVUTE.mjs.map} +2 -2
- package/dist/lib/browser/{chunk-NXGP6NTP.mjs → chunk-6BVXZQPP.mjs} +10 -25
- package/dist/lib/browser/{chunk-NXGP6NTP.mjs.map → chunk-6BVXZQPP.mjs.map} +2 -2
- package/dist/lib/browser/{chunk-MOM5KCKC.mjs → chunk-ARBGXQFH.mjs} +4 -256
- package/dist/lib/browser/{chunk-MOM5KCKC.mjs.map → chunk-ARBGXQFH.mjs.map} +3 -3
- package/dist/lib/browser/{chunk-BZ65T5M3.mjs → chunk-JDSUIUNR.mjs} +7 -6
- package/dist/lib/browser/chunk-JDSUIUNR.mjs.map +7 -0
- package/dist/lib/browser/{chunk-2DGFNLRO.mjs → chunk-UBHZGWZQ.mjs} +7 -2
- package/dist/lib/browser/chunk-UBHZGWZQ.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +8 -7
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-resolver-K57C3LIX.mjs → intent-resolver-YS5LZC3A.mjs} +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/meta.mjs +1 -1
- package/dist/lib/browser/{react-surface-OPBND5W3.mjs → react-surface-BVTCOVLK.mjs} +7 -7
- package/dist/lib/browser/react-surface-BVTCOVLK.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +2 -2
- package/dist/lib/node-esm/{ExplorerContainer-FRTDXZI5.mjs → ExplorerContainer-N3S5KSUX.mjs} +3 -3
- package/dist/lib/node-esm/{ExplorerContainer-FRTDXZI5.mjs.map → ExplorerContainer-N3S5KSUX.mjs.map} +2 -2
- package/dist/lib/node-esm/{chunk-6JACZE7E.mjs → chunk-CRSVAZNA.mjs} +10 -25
- package/dist/lib/node-esm/{chunk-6JACZE7E.mjs.map → chunk-CRSVAZNA.mjs.map} +2 -2
- package/dist/lib/node-esm/{chunk-ES6AOMCY.mjs → chunk-MS72BATS.mjs} +7 -6
- package/dist/lib/node-esm/chunk-MS72BATS.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-ZCV4U7LT.mjs → chunk-NPIP4VEH.mjs} +4 -256
- package/dist/lib/node-esm/{chunk-ZCV4U7LT.mjs.map → chunk-NPIP4VEH.mjs.map} +3 -3
- package/dist/lib/node-esm/{chunk-PX6LHR2N.mjs → chunk-UXZM5VJB.mjs} +7 -2
- package/dist/lib/node-esm/chunk-UXZM5VJB.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +8 -7
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/{intent-resolver-BLPPTTEY.mjs → intent-resolver-VCEC67WX.mjs} +3 -3
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/meta.mjs +1 -1
- package/dist/lib/node-esm/{react-surface-HCKQSHKJ.mjs → react-surface-4HFEX52O.mjs} +7 -7
- package/dist/lib/node-esm/react-surface-4HFEX52O.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +2 -2
- package/dist/types/src/ExplorerPlugin.d.ts.map +1 -1
- package/dist/types/src/components/ExplorerContainer.d.ts +2 -2
- package/dist/types/src/components/ExplorerContainer.d.ts.map +1 -1
- package/dist/types/src/components/Graph/D3ForceGraph.stories.d.ts.map +1 -1
- package/dist/types/src/components/Graph/ForceGraph.stories.d.ts.map +1 -1
- package/dist/types/src/components/Graph/testing.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +2 -4
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/types/ExplorerAction.d.ts +2 -2
- package/dist/types/src/types/ExplorerAction.d.ts.map +1 -1
- package/dist/types/src/types/Graph.d.ts +3 -3
- package/dist/types/src/types/Graph.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +30 -29
- package/src/ExplorerPlugin.tsx +1 -0
- package/src/capabilities/react-surface.tsx +3 -3
- package/src/components/ExplorerContainer.tsx +3 -3
- package/src/components/Graph/D3ForceGraph.stories.tsx +8 -7
- package/src/components/Graph/ForceGraph.stories.tsx +8 -7
- package/src/components/Graph/testing.ts +6 -6
- package/src/components/Tree/types/tree.test.ts +2 -2
- package/src/components/index.ts +3 -3
- package/src/meta.ts +6 -1
- package/src/types/ExplorerAction.ts +3 -2
- package/src/types/Graph.ts +4 -3
- package/dist/lib/browser/chunk-2DGFNLRO.mjs.map +0 -7
- package/dist/lib/browser/chunk-BZ65T5M3.mjs.map +0 -7
- package/dist/lib/browser/react-surface-OPBND5W3.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-ES6AOMCY.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-PX6LHR2N.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-HCKQSHKJ.mjs.map +0 -7
- /package/dist/lib/browser/{intent-resolver-K57C3LIX.mjs.map → intent-resolver-YS5LZC3A.mjs.map} +0 -0
- /package/dist/lib/node-esm/{intent-resolver-BLPPTTEY.mjs.map → intent-resolver-VCEC67WX.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.548089c",
|
|
4
4
|
"description": "Braneframe data visualization plugin",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -55,50 +55,51 @@
|
|
|
55
55
|
"react-resize-detector": "^11.0.1",
|
|
56
56
|
"three": "^0.178.0",
|
|
57
57
|
"topojson-client": "^3.1.0",
|
|
58
|
-
"@dxos/app-framework": "0.8.4-main.
|
|
59
|
-
"@dxos/client": "0.8.4-main.
|
|
60
|
-
"@dxos/
|
|
61
|
-
"@dxos/
|
|
62
|
-
"@dxos/
|
|
63
|
-
"@dxos/
|
|
64
|
-
"@dxos/
|
|
65
|
-
"@dxos/
|
|
66
|
-
"@dxos/
|
|
67
|
-
"@dxos/
|
|
68
|
-
"@dxos/plugin-
|
|
69
|
-
"@dxos/plugin-search": "0.8.4-main.
|
|
70
|
-
"@dxos/
|
|
71
|
-
"@dxos/
|
|
72
|
-
"@dxos/react-ui-attention": "0.8.4-main.
|
|
73
|
-
"@dxos/react-ui-components": "0.8.4-main.
|
|
74
|
-
"@dxos/react-ui-
|
|
75
|
-
"@dxos/
|
|
76
|
-
"@dxos/
|
|
77
|
-
"@dxos/
|
|
58
|
+
"@dxos/app-framework": "0.8.4-main.548089c",
|
|
59
|
+
"@dxos/client": "0.8.4-main.548089c",
|
|
60
|
+
"@dxos/echo-query": "0.8.4-main.548089c",
|
|
61
|
+
"@dxos/async": "0.8.4-main.548089c",
|
|
62
|
+
"@dxos/graph": "0.8.4-main.548089c",
|
|
63
|
+
"@dxos/invariant": "0.8.4-main.548089c",
|
|
64
|
+
"@dxos/live-object": "0.8.4-main.548089c",
|
|
65
|
+
"@dxos/echo": "0.8.4-main.548089c",
|
|
66
|
+
"@dxos/plugin-graph": "0.8.4-main.548089c",
|
|
67
|
+
"@dxos/log": "0.8.4-main.548089c",
|
|
68
|
+
"@dxos/plugin-client": "0.8.4-main.548089c",
|
|
69
|
+
"@dxos/plugin-search": "0.8.4-main.548089c",
|
|
70
|
+
"@dxos/plugin-space": "0.8.4-main.548089c",
|
|
71
|
+
"@dxos/react-client": "0.8.4-main.548089c",
|
|
72
|
+
"@dxos/react-ui-attention": "0.8.4-main.548089c",
|
|
73
|
+
"@dxos/react-ui-components": "0.8.4-main.548089c",
|
|
74
|
+
"@dxos/react-ui-stack": "0.8.4-main.548089c",
|
|
75
|
+
"@dxos/schema": "0.8.4-main.548089c",
|
|
76
|
+
"@dxos/types": "0.8.4-main.548089c",
|
|
77
|
+
"@dxos/react-ui-graph": "0.8.4-main.548089c",
|
|
78
|
+
"@dxos/util": "0.8.4-main.548089c"
|
|
78
79
|
},
|
|
79
80
|
"devDependencies": {
|
|
80
81
|
"@types/d3": "^7.4.3",
|
|
81
82
|
"@types/d3-hierarchy": "^3.1.6",
|
|
82
83
|
"@types/lodash.defaultsdeep": "^4.6.6",
|
|
83
84
|
"@types/react": "~19.2.2",
|
|
84
|
-
"@types/react-dom": "~19.2.
|
|
85
|
+
"@types/react-dom": "~19.2.2",
|
|
85
86
|
"@types/topojson-client": "^3.1.4",
|
|
86
87
|
"@types/topojson-specification": "^1.0.5",
|
|
87
88
|
"react": "~19.2.0",
|
|
88
89
|
"react-dom": "~19.2.0",
|
|
89
90
|
"vite": "7.1.9",
|
|
90
|
-
"@dxos/
|
|
91
|
-
"@dxos/random": "0.8.4-main.
|
|
92
|
-
"@dxos/
|
|
93
|
-
"@dxos/
|
|
94
|
-
"@dxos/
|
|
91
|
+
"@dxos/echo-generator": "0.8.4-main.548089c",
|
|
92
|
+
"@dxos/random": "0.8.4-main.548089c",
|
|
93
|
+
"@dxos/react-ui-theme": "0.8.4-main.548089c",
|
|
94
|
+
"@dxos/storybook-utils": "0.8.4-main.548089c",
|
|
95
|
+
"@dxos/react-ui": "0.8.4-main.548089c"
|
|
95
96
|
},
|
|
96
97
|
"peerDependencies": {
|
|
97
98
|
"effect": "^3.13.3",
|
|
98
99
|
"react": "^19.0.0",
|
|
99
100
|
"react-dom": "^19.0.0",
|
|
100
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
101
|
-
"@dxos/react-ui-theme": "0.8.4-main.
|
|
101
|
+
"@dxos/react-ui": "0.8.4-main.548089c",
|
|
102
|
+
"@dxos/react-ui-theme": "0.8.4-main.548089c"
|
|
102
103
|
},
|
|
103
104
|
"publishConfig": {
|
|
104
105
|
"access": "public"
|
package/src/ExplorerPlugin.tsx
CHANGED
|
@@ -6,7 +6,7 @@ import React from 'react';
|
|
|
6
6
|
|
|
7
7
|
import { Capabilities, contributes, createSurface } from '@dxos/app-framework';
|
|
8
8
|
import { Obj } from '@dxos/echo';
|
|
9
|
-
import {
|
|
9
|
+
import { View } from '@dxos/schema';
|
|
10
10
|
|
|
11
11
|
import { ExplorerContainer } from '../components';
|
|
12
12
|
import { meta } from '../meta';
|
|
@@ -18,8 +18,8 @@ export default () =>
|
|
|
18
18
|
createSurface({
|
|
19
19
|
id: `${meta.id}/article`,
|
|
20
20
|
role: ['article', 'section'],
|
|
21
|
-
filter: (data): data is { subject:
|
|
22
|
-
Obj.instanceOf(
|
|
21
|
+
filter: (data): data is { subject: View.View } =>
|
|
22
|
+
Obj.instanceOf(View.View, data.subject) && Obj.instanceOf(Graph.Graph, data.subject.presentation.target),
|
|
23
23
|
component: ({ data, role }) => {
|
|
24
24
|
return <ExplorerContainer view={data.subject} role={role} />;
|
|
25
25
|
},
|
|
@@ -11,7 +11,7 @@ import { getSpace } from '@dxos/react-client/echo';
|
|
|
11
11
|
import { Toolbar } from '@dxos/react-ui';
|
|
12
12
|
import { QueryEditor, type QueryEditorProps } from '@dxos/react-ui-components';
|
|
13
13
|
import { StackItem } from '@dxos/react-ui-stack';
|
|
14
|
-
import { type
|
|
14
|
+
import { type View } from '@dxos/schema';
|
|
15
15
|
|
|
16
16
|
import { useGraphModel } from '../hooks';
|
|
17
17
|
|
|
@@ -19,7 +19,7 @@ import { D3ForceGraph } from './Graph';
|
|
|
19
19
|
|
|
20
20
|
type ExplorerContainerProps = {
|
|
21
21
|
role: string;
|
|
22
|
-
view:
|
|
22
|
+
view: View.View;
|
|
23
23
|
};
|
|
24
24
|
|
|
25
25
|
const ExplorerContainer = ({ role, view }: ExplorerContainerProps) => {
|
|
@@ -30,7 +30,7 @@ const ExplorerContainer = ({ role, view }: ExplorerContainerProps) => {
|
|
|
30
30
|
|
|
31
31
|
const builder = useMemo(() => new QueryBuilder(), []);
|
|
32
32
|
const handleChange = useCallback<NonNullable<QueryEditorProps['onChange']>>((value) => {
|
|
33
|
-
setFilter(builder.build(value));
|
|
33
|
+
setFilter(builder.build(value).filter);
|
|
34
34
|
}, []);
|
|
35
35
|
|
|
36
36
|
const showToolbar = role === 'article';
|
|
@@ -11,9 +11,10 @@ import { type Space } from '@dxos/react-client/echo';
|
|
|
11
11
|
import { withClientProvider } from '@dxos/react-client/testing';
|
|
12
12
|
import { useAsyncEffect } from '@dxos/react-ui';
|
|
13
13
|
import { withTheme } from '@dxos/react-ui/testing';
|
|
14
|
-
import {
|
|
14
|
+
import { View } from '@dxos/schema';
|
|
15
15
|
import { type ValueGenerator } from '@dxos/schema/testing';
|
|
16
16
|
import { render } from '@dxos/storybook-utils';
|
|
17
|
+
import { HasRelationship, Organization, Person, Project } from '@dxos/types';
|
|
17
18
|
|
|
18
19
|
import { useGraphModel } from '../../hooks';
|
|
19
20
|
import { Graph } from '../../types';
|
|
@@ -28,7 +29,7 @@ faker.seed(1);
|
|
|
28
29
|
const DefaultStory = () => {
|
|
29
30
|
const client = useClient();
|
|
30
31
|
const [space, setSpace] = useState<Space>();
|
|
31
|
-
const [view, setView] = useState<
|
|
32
|
+
const [view, setView] = useState<View.View>();
|
|
32
33
|
|
|
33
34
|
useAsyncEffect(async () => {
|
|
34
35
|
const space = client.spaces.default;
|
|
@@ -57,11 +58,11 @@ const meta = {
|
|
|
57
58
|
createSpace: true,
|
|
58
59
|
types: [
|
|
59
60
|
Graph.Graph,
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
61
|
+
View.View,
|
|
62
|
+
Organization.Organization,
|
|
63
|
+
Project.Project,
|
|
64
|
+
Person.Person,
|
|
65
|
+
HasRelationship.HasRelationship,
|
|
65
66
|
],
|
|
66
67
|
}),
|
|
67
68
|
],
|
|
@@ -11,9 +11,10 @@ import { type Space } from '@dxos/react-client/echo';
|
|
|
11
11
|
import { withClientProvider } from '@dxos/react-client/testing';
|
|
12
12
|
import { useAsyncEffect } from '@dxos/react-ui';
|
|
13
13
|
import { withTheme } from '@dxos/react-ui/testing';
|
|
14
|
-
import {
|
|
14
|
+
import { View } from '@dxos/schema';
|
|
15
15
|
import { type ValueGenerator } from '@dxos/schema/testing';
|
|
16
16
|
import { render } from '@dxos/storybook-utils';
|
|
17
|
+
import { HasRelationship, Organization, Person, Project } from '@dxos/types';
|
|
17
18
|
|
|
18
19
|
import { useGraphModel } from '../../hooks';
|
|
19
20
|
import { Graph } from '../../types';
|
|
@@ -28,7 +29,7 @@ faker.seed(1);
|
|
|
28
29
|
const DefaultStory = () => {
|
|
29
30
|
const client = useClient();
|
|
30
31
|
const [space, setSpace] = useState<Space>();
|
|
31
|
-
const [view, setView] = useState<
|
|
32
|
+
const [view, setView] = useState<View.View>();
|
|
32
33
|
|
|
33
34
|
useAsyncEffect(async () => {
|
|
34
35
|
const space = client.spaces.default;
|
|
@@ -57,11 +58,11 @@ const meta = {
|
|
|
57
58
|
createSpace: true,
|
|
58
59
|
types: [
|
|
59
60
|
Graph.Graph,
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
61
|
+
View.View,
|
|
62
|
+
HasRelationship.HasRelationship,
|
|
63
|
+
Organization.Organization,
|
|
64
|
+
Project.Project,
|
|
65
|
+
Person.Person,
|
|
65
66
|
],
|
|
66
67
|
}),
|
|
67
68
|
],
|
|
@@ -4,16 +4,16 @@
|
|
|
4
4
|
|
|
5
5
|
import { type Space } from '@dxos/client/echo';
|
|
6
6
|
import { type Obj, Query, Relation } from '@dxos/echo';
|
|
7
|
-
import { DataType } from '@dxos/schema';
|
|
8
7
|
import { type TypeSpec, type ValueGenerator, createObjectFactory } from '@dxos/schema/testing';
|
|
8
|
+
import { HasRelationship, Organization, Person, Project } from '@dxos/types';
|
|
9
9
|
import { range } from '@dxos/util';
|
|
10
10
|
|
|
11
11
|
const getObject = (objects: Obj.Any[]) => objects[Math.floor(Math.random() * objects.length)];
|
|
12
12
|
|
|
13
13
|
const defaultTypes: TypeSpec[] = [
|
|
14
|
-
{ type:
|
|
15
|
-
{ type:
|
|
16
|
-
{ type:
|
|
14
|
+
{ type: Organization.Organization, count: 5 },
|
|
15
|
+
{ type: Project.Project, count: 5 },
|
|
16
|
+
{ type: Person.Person, count: 10 },
|
|
17
17
|
];
|
|
18
18
|
|
|
19
19
|
export type GenerateOptions = {
|
|
@@ -38,13 +38,13 @@ export const generate = async (
|
|
|
38
38
|
await createObjects(spec);
|
|
39
39
|
|
|
40
40
|
// Add relations between objects.
|
|
41
|
-
const { objects: contacts } = await space.db.query(Query.type(
|
|
41
|
+
const { objects: contacts } = await space.db.query(Query.type(Person.Person)).run();
|
|
42
42
|
for (const _ of range(relations.count)) {
|
|
43
43
|
const source = getObject(contacts);
|
|
44
44
|
const target = getObject(contacts);
|
|
45
45
|
if (source.id !== target.id) {
|
|
46
46
|
space.db.add(
|
|
47
|
-
Relation.make(
|
|
47
|
+
Relation.make(HasRelationship.HasRelationship, {
|
|
48
48
|
[Relation.Source]: source,
|
|
49
49
|
[Relation.Target]: target,
|
|
50
50
|
kind: relations.kind,
|
|
@@ -6,7 +6,7 @@ import { describe, test } from 'vitest';
|
|
|
6
6
|
|
|
7
7
|
import { Obj, Ref } from '@dxos/echo';
|
|
8
8
|
import { faker } from '@dxos/random';
|
|
9
|
-
import {
|
|
9
|
+
import { Task } from '@dxos/types';
|
|
10
10
|
|
|
11
11
|
import { createTree } from '../testing';
|
|
12
12
|
|
|
@@ -124,7 +124,7 @@ describe('tree', () => {
|
|
|
124
124
|
});
|
|
125
125
|
|
|
126
126
|
test('task', ({ expect }) => {
|
|
127
|
-
const task = Obj.make(
|
|
127
|
+
const task = Obj.make(Task.Task, { title: 'Test task.' });
|
|
128
128
|
expect(task.title).to.eq('Test task.');
|
|
129
129
|
|
|
130
130
|
const tree = createTree();
|
package/src/components/index.ts
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { lazy } from 'react';
|
|
6
|
-
|
|
7
|
-
export const ExplorerContainer = lazy(() => import('./ExplorerContainer'));
|
|
5
|
+
import { type ComponentType, lazy } from 'react';
|
|
8
6
|
|
|
9
7
|
export * from './Chart';
|
|
10
8
|
export * from './Globe';
|
|
11
9
|
export * from './Graph';
|
|
12
10
|
export * from './Tree';
|
|
11
|
+
|
|
12
|
+
export const ExplorerContainer: ComponentType<any> = lazy(() => import('./ExplorerContainer'));
|
package/src/meta.ts
CHANGED
|
@@ -3,12 +3,17 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { type PluginMeta } from '@dxos/app-framework';
|
|
6
|
+
import { trim } from '@dxos/util';
|
|
6
7
|
|
|
7
8
|
export const meta: PluginMeta = {
|
|
8
9
|
id: 'dxos.org/plugin/explorer',
|
|
9
10
|
name: 'Explorer',
|
|
10
|
-
description:
|
|
11
|
+
description: trim`
|
|
12
|
+
Interactive hypergraph visualization that reveals relationships between objects in your workspace.
|
|
13
|
+
Navigate complex data structures and discover connections through a dynamic network view.
|
|
14
|
+
`,
|
|
11
15
|
icon: 'ph--graph--regular',
|
|
16
|
+
iconHue: 'green',
|
|
12
17
|
source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-explorer',
|
|
13
18
|
tags: ['labs'],
|
|
14
19
|
screenshots: ['https://dxos.network/plugin-details-explorer-dark.png'],
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import * as Schema from 'effect/Schema';
|
|
6
6
|
|
|
7
7
|
import { SpaceSchema } from '@dxos/react-client/echo';
|
|
8
|
-
import {
|
|
8
|
+
import { TypenameAnnotationId, View } from '@dxos/schema';
|
|
9
9
|
|
|
10
10
|
import { meta } from '../meta';
|
|
11
11
|
|
|
@@ -13,6 +13,7 @@ const EXPLORER_ACTION = `${meta.id}/action`;
|
|
|
13
13
|
|
|
14
14
|
export const GraphProps = Schema.Struct({
|
|
15
15
|
name: Schema.optional(Schema.String),
|
|
16
|
+
// TODO(wittjosiah): This should be a query input instead.
|
|
16
17
|
typename: Schema.String.annotations({
|
|
17
18
|
[TypenameAnnotationId]: ['used-static', 'dynamic'],
|
|
18
19
|
title: 'Select graph record type',
|
|
@@ -24,6 +25,6 @@ export class CreateGraph extends Schema.TaggedClass<CreateGraph>()(`${EXPLORER_A
|
|
|
24
25
|
space: SpaceSchema,
|
|
25
26
|
}).pipe(Schema.extend(GraphProps)),
|
|
26
27
|
output: Schema.Struct({
|
|
27
|
-
object:
|
|
28
|
+
object: View.View,
|
|
28
29
|
}),
|
|
29
30
|
}) {}
|
package/src/types/Graph.ts
CHANGED
|
@@ -6,7 +6,7 @@ import * as Schema from 'effect/Schema';
|
|
|
6
6
|
|
|
7
7
|
import { Filter, Obj, Query, QueryAST, Type } from '@dxos/echo';
|
|
8
8
|
import { LabelAnnotation, ViewAnnotation } from '@dxos/echo/internal';
|
|
9
|
-
import {
|
|
9
|
+
import { View } from '@dxos/schema';
|
|
10
10
|
|
|
11
11
|
export const Graph = Schema.Struct({
|
|
12
12
|
name: Schema.optional(Schema.String),
|
|
@@ -32,14 +32,15 @@ export const make = (
|
|
|
32
32
|
props: Obj.MakeProps<typeof Graph> = { query: { raw: '', ast: Query.select(Filter.nothing()).ast } },
|
|
33
33
|
) => Obj.make(Graph, props);
|
|
34
34
|
|
|
35
|
-
type MakeViewProps = Omit<
|
|
35
|
+
type MakeViewProps = Omit<View.MakeFromSpaceProps, 'presentation'> & {
|
|
36
36
|
presentation?: Omit<Obj.MakeProps<typeof Graph>, 'name'>;
|
|
37
37
|
};
|
|
38
38
|
|
|
39
39
|
/**
|
|
40
40
|
* Make a graph as a view of a data set.
|
|
41
41
|
*/
|
|
42
|
+
// TODO(burdon): Move to @dxos/schema.
|
|
42
43
|
export const makeView = async ({ presentation, ...props }: MakeViewProps) => {
|
|
43
44
|
const graph = make(presentation);
|
|
44
|
-
return
|
|
45
|
+
return View.makeFromSpace({ ...props, presentation: graph });
|
|
45
46
|
};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/meta.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type PluginMeta } from '@dxos/app-framework';\n\nexport const meta: PluginMeta = {\n id: 'dxos.org/plugin/explorer',\n name: 'Explorer',\n description: 'Install this plugin to view a hypergraph of all objects inside of your Space.',\n icon: 'ph--graph--regular',\n source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-explorer',\n tags: ['labs'],\n screenshots: ['https://dxos.network/plugin-details-explorer-dark.png'],\n};\n"],
|
|
5
|
-
"mappings": ";AAMO,IAAMA,OAAmB;EAC9BC,IAAI;EACJC,MAAM;EACNC,aAAa;EACbC,MAAM;EACNC,QAAQ;EACRC,MAAM;IAAC;;EACPC,aAAa;IAAC;;AAChB;",
|
|
6
|
-
"names": ["meta", "id", "name", "description", "icon", "source", "tags", "screenshots"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/types/ExplorerAction.ts", "../../../src/types/Graph.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { SpaceSchema } from '@dxos/react-client/echo';\nimport { DataType, TypenameAnnotationId } from '@dxos/schema';\n\nimport { meta } from '../meta';\n\nconst EXPLORER_ACTION = `${meta.id}/action`;\n\nexport const GraphProps = Schema.Struct({\n name: Schema.optional(Schema.String),\n typename: Schema.String.annotations({\n [TypenameAnnotationId]: ['used-static', 'dynamic'],\n title: 'Select graph record type',\n }),\n});\n\nexport class CreateGraph extends Schema.TaggedClass<CreateGraph>()(`${EXPLORER_ACTION}/create-graph`, {\n input: Schema.Struct({\n space: SpaceSchema,\n }).pipe(Schema.extend(GraphProps)),\n output: Schema.Struct({\n object: DataType.View,\n }),\n}) {}\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { Filter, Obj, Query, QueryAST, Type } from '@dxos/echo';\nimport { LabelAnnotation, ViewAnnotation } from '@dxos/echo/internal';\nimport { type CreateViewFromSpaceProps, createViewFromSpace } from '@dxos/schema';\n\nexport const Graph = Schema.Struct({\n name: Schema.optional(Schema.String),\n query: Schema.Struct({\n raw: Schema.optional(Schema.String),\n ast: QueryAST.Query,\n }).pipe(Schema.mutable),\n}).pipe(\n Type.Obj({\n typename: 'dxos.org/type/Graph',\n version: '0.1.0',\n }),\n LabelAnnotation.set(['name']),\n ViewAnnotation.set(true),\n);\n\nexport type Graph = Schema.Schema.Type<typeof Graph>;\n\n/**\n * Make a graph object.\n */\nexport const make = (\n props: Obj.MakeProps<typeof Graph> = { query: { raw: '', ast: Query.select(Filter.nothing()).ast } },\n) => Obj.make(Graph, props);\n\ntype MakeViewProps = Omit<CreateViewFromSpaceProps, 'presentation'> & {\n presentation?: Omit<Obj.MakeProps<typeof Graph>, 'name'>;\n};\n\n/**\n * Make a graph as a view of a data set.\n */\nexport const makeView = async ({ presentation, ...props }: MakeViewProps) => {\n const graph = make(presentation);\n return createViewFromSpace({ ...props, presentation: graph });\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;;;AAAA;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,mBAAmB;AAC5B,SAASC,UAAUC,4BAA4B;AAI/C,IAAMC,kBAAkB,GAAGC,KAAKC,EAAE;AAE3B,IAAMC,aAAoBC,cAAO;EACtCC,MAAaC,gBAAgBC,aAAM;EACnCC,UAAiBD,cAAOE,YAAY;IAClC,CAACC,oBAAAA,GAAuB;MAAC;MAAe;;IACxCC,OAAO;EACT,CAAA;AACF,CAAA;AAEO,IAAMC,cAAN,cAAiCC,mBAAW,EAAgB,GAAGb,eAAAA,iBAAgC;EACpGc,OAAcV,cAAO;IACnBW,OAAOC;EACT,CAAA,EAAGC,KAAYC,cAAOf,UAAAA,CAAAA;EACtBgB,QAAef,cAAO;IACpBgB,QAAQC,SAASC;EACnB,CAAA;AACF,CAAA,EAAA;AAAI;;;AC5BJ;;;;;;AAIA,YAAYC,aAAY;AAExB,SAASC,QAAQC,KAAKC,OAAOC,UAAUC,YAAY;AACnD,SAASC,iBAAiBC,sBAAsB;AAChD,SAAwCC,2BAA2B;AAE5D,IAAMC,QAAeC,eAAO;EACjCC,MAAaC,iBAAgBC,cAAM;EACnCC,OAAcJ,eAAO;IACnBK,KAAYH,iBAAgBC,cAAM;IAClCG,KAAKC,SAASC;EAChB,CAAA,EAAGC,KAAYC,eAAO;AACxB,CAAA,EAAGD,KACDE,KAAKC,IAAI;EACPC,UAAU;EACVC,SAAS;AACX,CAAA,GACAC,gBAAgBC,IAAI;EAAC;CAAO,GAC5BC,eAAeD,IAAI,IAAA,CAAA;AAQd,IAAME,OAAO,CAClBC,QAAqC;EAAEf,OAAO;IAAEC,KAAK;IAAIC,KAAKE,MAAMY,OAAOC,OAAOC,QAAO,CAAA,EAAIhB;EAAI;AAAE,MAChGM,IAAIM,KAAKnB,OAAOoB,KAAAA;AASd,IAAMI,WAAW,OAAO,EAAEC,cAAc,GAAGL,MAAAA,MAAsB;AACtE,QAAMM,QAAQP,KAAKM,YAAAA;AACnB,SAAOE,oBAAoB;IAAE,GAAGP;IAAOK,cAAcC;EAAM,CAAA;AAC7D;",
|
|
6
|
-
"names": ["Schema", "SpaceSchema", "DataType", "TypenameAnnotationId", "EXPLORER_ACTION", "meta", "id", "GraphProps", "Struct", "name", "optional", "String", "typename", "annotations", "TypenameAnnotationId", "title", "CreateGraph", "TaggedClass", "input", "space", "SpaceSchema", "pipe", "extend", "output", "object", "DataType", "View", "Schema", "Filter", "Obj", "Query", "QueryAST", "Type", "LabelAnnotation", "ViewAnnotation", "createViewFromSpace", "Graph", "Struct", "name", "optional", "String", "query", "raw", "ast", "QueryAST", "Query", "pipe", "mutable", "Type", "Obj", "typename", "version", "LabelAnnotation", "set", "ViewAnnotation", "make", "props", "select", "Filter", "nothing", "makeView", "presentation", "graph", "createViewFromSpace"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/react-surface.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport React from 'react';\n\nimport { Capabilities, contributes, createSurface } from '@dxos/app-framework';\nimport { Obj } from '@dxos/echo';\nimport { DataType } from '@dxos/schema';\n\nimport { ExplorerContainer } from '../components';\nimport { meta } from '../meta';\nimport { Graph } from '../types';\n\nexport default () =>\n contributes(\n Capabilities.ReactSurface,\n createSurface({\n id: `${meta.id}/article`,\n role: ['article', 'section'],\n filter: (data): data is { subject: DataType.View } =>\n Obj.instanceOf(DataType.View, data.subject) && Obj.instanceOf(Graph.Graph, data.subject.presentation.target),\n component: ({ data, role }) => {\n return <ExplorerContainer view={data.subject} role={role} />;\n },\n }),\n );\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;AAIA,OAAOA,WAAW;AAElB,SAASC,cAAcC,aAAaC,qBAAqB;AACzD,SAASC,WAAW;AACpB,SAASC,gBAAgB;AAMzB,IAAA,yBAAe,MACbC,YACEC,aAAaC,cACbC,cAAc;EACZC,IAAI,GAAGC,KAAKD,EAAE;EACdE,MAAM;IAAC;IAAW;;EAClBC,QAAQ,CAACC,SACPC,IAAIC,WAAWC,SAASC,MAAMJ,KAAKK,OAAO,KAAKJ,IAAIC,WAAWI,cAAMA,OAAON,KAAKK,QAAQE,aAAaC,MAAM;EAC7GC,WAAW,CAAC,EAAET,MAAMF,KAAI,MAAE;AACxB,WAAO,sBAAA,cAACY,mBAAAA;MAAkBC,MAAMX,KAAKK;MAASP;;EAChD;AACF,CAAA,CAAA;",
|
|
6
|
-
"names": ["React", "Capabilities", "contributes", "createSurface", "Obj", "DataType", "contributes", "Capabilities", "ReactSurface", "createSurface", "id", "meta", "role", "filter", "data", "Obj", "instanceOf", "DataType", "View", "subject", "Graph", "presentation", "target", "component", "ExplorerContainer", "view"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/types/ExplorerAction.ts", "../../../src/types/Graph.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { SpaceSchema } from '@dxos/react-client/echo';\nimport { DataType, TypenameAnnotationId } from '@dxos/schema';\n\nimport { meta } from '../meta';\n\nconst EXPLORER_ACTION = `${meta.id}/action`;\n\nexport const GraphProps = Schema.Struct({\n name: Schema.optional(Schema.String),\n typename: Schema.String.annotations({\n [TypenameAnnotationId]: ['used-static', 'dynamic'],\n title: 'Select graph record type',\n }),\n});\n\nexport class CreateGraph extends Schema.TaggedClass<CreateGraph>()(`${EXPLORER_ACTION}/create-graph`, {\n input: Schema.Struct({\n space: SpaceSchema,\n }).pipe(Schema.extend(GraphProps)),\n output: Schema.Struct({\n object: DataType.View,\n }),\n}) {}\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { Filter, Obj, Query, QueryAST, Type } from '@dxos/echo';\nimport { LabelAnnotation, ViewAnnotation } from '@dxos/echo/internal';\nimport { type CreateViewFromSpaceProps, createViewFromSpace } from '@dxos/schema';\n\nexport const Graph = Schema.Struct({\n name: Schema.optional(Schema.String),\n query: Schema.Struct({\n raw: Schema.optional(Schema.String),\n ast: QueryAST.Query,\n }).pipe(Schema.mutable),\n}).pipe(\n Type.Obj({\n typename: 'dxos.org/type/Graph',\n version: '0.1.0',\n }),\n LabelAnnotation.set(['name']),\n ViewAnnotation.set(true),\n);\n\nexport type Graph = Schema.Schema.Type<typeof Graph>;\n\n/**\n * Make a graph object.\n */\nexport const make = (\n props: Obj.MakeProps<typeof Graph> = { query: { raw: '', ast: Query.select(Filter.nothing()).ast } },\n) => Obj.make(Graph, props);\n\ntype MakeViewProps = Omit<CreateViewFromSpaceProps, 'presentation'> & {\n presentation?: Omit<Obj.MakeProps<typeof Graph>, 'name'>;\n};\n\n/**\n * Make a graph as a view of a data set.\n */\nexport const makeView = async ({ presentation, ...props }: MakeViewProps) => {\n const graph = make(presentation);\n return createViewFromSpace({ ...props, presentation: graph });\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;AAAA;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,mBAAmB;AAC5B,SAASC,UAAUC,4BAA4B;AAI/C,IAAMC,kBAAkB,GAAGC,KAAKC,EAAE;AAE3B,IAAMC,aAAoBC,cAAO;EACtCC,MAAaC,gBAAgBC,aAAM;EACnCC,UAAiBD,cAAOE,YAAY;IAClC,CAACC,oBAAAA,GAAuB;MAAC;MAAe;;IACxCC,OAAO;EACT,CAAA;AACF,CAAA;AAEO,IAAMC,cAAN,cAAiCC,mBAAW,EAAgB,GAAGb,eAAAA,iBAAgC;EACpGc,OAAcV,cAAO;IACnBW,OAAOC;EACT,CAAA,EAAGC,KAAYC,cAAOf,UAAAA,CAAAA;EACtBgB,QAAef,cAAO;IACpBgB,QAAQC,SAASC;EACnB,CAAA;AACF,CAAA,EAAA;AAAI;;;AC5BJ;;;;;;AAIA,YAAYC,aAAY;AAExB,SAASC,QAAQC,KAAKC,OAAOC,UAAUC,YAAY;AACnD,SAASC,iBAAiBC,sBAAsB;AAChD,SAAwCC,2BAA2B;AAE5D,IAAMC,QAAeC,eAAO;EACjCC,MAAaC,iBAAgBC,cAAM;EACnCC,OAAcJ,eAAO;IACnBK,KAAYH,iBAAgBC,cAAM;IAClCG,KAAKC,SAASC;EAChB,CAAA,EAAGC,KAAYC,eAAO;AACxB,CAAA,EAAGD,KACDE,KAAKC,IAAI;EACPC,UAAU;EACVC,SAAS;AACX,CAAA,GACAC,gBAAgBC,IAAI;EAAC;CAAO,GAC5BC,eAAeD,IAAI,IAAA,CAAA;AAQd,IAAME,OAAO,CAClBC,QAAqC;EAAEf,OAAO;IAAEC,KAAK;IAAIC,KAAKE,MAAMY,OAAOC,OAAOC,QAAO,CAAA,EAAIhB;EAAI;AAAE,MAChGM,IAAIM,KAAKnB,OAAOoB,KAAAA;AASd,IAAMI,WAAW,OAAO,EAAEC,cAAc,GAAGL,MAAAA,MAAsB;AACtE,QAAMM,QAAQP,KAAKM,YAAAA;AACnB,SAAOE,oBAAoB;IAAE,GAAGP;IAAOK,cAAcC;EAAM,CAAA;AAC7D;",
|
|
6
|
-
"names": ["Schema", "SpaceSchema", "DataType", "TypenameAnnotationId", "EXPLORER_ACTION", "meta", "id", "GraphProps", "Struct", "name", "optional", "String", "typename", "annotations", "TypenameAnnotationId", "title", "CreateGraph", "TaggedClass", "input", "space", "SpaceSchema", "pipe", "extend", "output", "object", "DataType", "View", "Schema", "Filter", "Obj", "Query", "QueryAST", "Type", "LabelAnnotation", "ViewAnnotation", "createViewFromSpace", "Graph", "Struct", "name", "optional", "String", "query", "raw", "ast", "QueryAST", "Query", "pipe", "mutable", "Type", "Obj", "typename", "version", "LabelAnnotation", "set", "ViewAnnotation", "make", "props", "select", "Filter", "nothing", "makeView", "presentation", "graph", "createViewFromSpace"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/meta.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type PluginMeta } from '@dxos/app-framework';\n\nexport const meta: PluginMeta = {\n id: 'dxos.org/plugin/explorer',\n name: 'Explorer',\n description: 'Install this plugin to view a hypergraph of all objects inside of your Space.',\n icon: 'ph--graph--regular',\n source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-explorer',\n tags: ['labs'],\n screenshots: ['https://dxos.network/plugin-details-explorer-dark.png'],\n};\n"],
|
|
5
|
-
"mappings": ";;;AAMO,IAAMA,OAAmB;EAC9BC,IAAI;EACJC,MAAM;EACNC,aAAa;EACbC,MAAM;EACNC,QAAQ;EACRC,MAAM;IAAC;;EACPC,aAAa;IAAC;;AAChB;",
|
|
6
|
-
"names": ["meta", "id", "name", "description", "icon", "source", "tags", "screenshots"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/react-surface.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport React from 'react';\n\nimport { Capabilities, contributes, createSurface } from '@dxos/app-framework';\nimport { Obj } from '@dxos/echo';\nimport { DataType } from '@dxos/schema';\n\nimport { ExplorerContainer } from '../components';\nimport { meta } from '../meta';\nimport { Graph } from '../types';\n\nexport default () =>\n contributes(\n Capabilities.ReactSurface,\n createSurface({\n id: `${meta.id}/article`,\n role: ['article', 'section'],\n filter: (data): data is { subject: DataType.View } =>\n Obj.instanceOf(DataType.View, data.subject) && Obj.instanceOf(Graph.Graph, data.subject.presentation.target),\n component: ({ data, role }) => {\n return <ExplorerContainer view={data.subject} role={role} />;\n },\n }),\n );\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;AAIA,OAAOA,WAAW;AAElB,SAASC,cAAcC,aAAaC,qBAAqB;AACzD,SAASC,WAAW;AACpB,SAASC,gBAAgB;AAMzB,IAAA,yBAAe,MACbC,YACEC,aAAaC,cACbC,cAAc;EACZC,IAAI,GAAGC,KAAKD,EAAE;EACdE,MAAM;IAAC;IAAW;;EAClBC,QAAQ,CAACC,SACPC,IAAIC,WAAWC,SAASC,MAAMJ,KAAKK,OAAO,KAAKJ,IAAIC,WAAWI,cAAMA,OAAON,KAAKK,QAAQE,aAAaC,MAAM;EAC7GC,WAAW,CAAC,EAAET,MAAMF,KAAI,MAAE;AACxB,WAAO,sBAAA,cAACY,mBAAAA;MAAkBC,MAAMX,KAAKK;MAASP;;EAChD;AACF,CAAA,CAAA;",
|
|
6
|
-
"names": ["React", "Capabilities", "contributes", "createSurface", "Obj", "DataType", "contributes", "Capabilities", "ReactSurface", "createSurface", "id", "meta", "role", "filter", "data", "Obj", "instanceOf", "DataType", "View", "subject", "Graph", "presentation", "target", "component", "ExplorerContainer", "view"]
|
|
7
|
-
}
|
/package/dist/lib/browser/{intent-resolver-K57C3LIX.mjs.map → intent-resolver-YS5LZC3A.mjs.map}
RENAMED
|
File without changes
|
/package/dist/lib/node-esm/{intent-resolver-BLPPTTEY.mjs.map → intent-resolver-VCEC67WX.mjs.map}
RENAMED
|
File without changes
|