@dxos/plugin-explorer 0.8.1 → 0.8.2-main.2f9c567
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-HL532ODG.mjs → ExplorerContainer-UJJIZBXP.mjs} +2 -2
- package/dist/lib/{node-esm/chunk-PZOORWFE.mjs → browser/chunk-AOQ4BVBH.mjs} +18 -19
- package/dist/lib/browser/{chunk-B2DMPSP5.mjs.map → chunk-AOQ4BVBH.mjs.map} +3 -3
- package/dist/lib/browser/{chunk-SBLNE7FL.mjs → chunk-DHAPRNIM.mjs} +5 -4
- package/dist/lib/browser/chunk-DHAPRNIM.mjs.map +7 -0
- package/dist/lib/browser/{chunk-QLQLPZNI.mjs → chunk-HKQSZX7S.mjs} +10 -9
- package/dist/lib/browser/chunk-HKQSZX7S.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +5 -5
- package/dist/lib/browser/{intent-resolver-NHHRWTOP.mjs → intent-resolver-7JF4DU2C.mjs} +4 -4
- package/dist/lib/browser/intent-resolver-7JF4DU2C.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-surface-N7TC6BMF.mjs → react-surface-VFVM6HNB.mjs} +4 -4
- package/dist/lib/browser/types/index.mjs +1 -1
- package/dist/lib/node/{ExplorerContainer-73AHSBAG.cjs → ExplorerContainer-XJUAYKA6.cjs} +6 -6
- package/dist/lib/node/{chunk-OIHH6TVE.cjs → chunk-4VLNAK7T.cjs} +7 -6
- package/dist/lib/node/chunk-4VLNAK7T.cjs.map +7 -0
- package/dist/lib/node/{chunk-YLL7H7CZ.cjs → chunk-6R5P3UVS.cjs} +12 -11
- package/dist/lib/node/chunk-6R5P3UVS.cjs.map +7 -0
- package/dist/lib/node/{chunk-HCDBN6NN.cjs → chunk-AUWXU65U.cjs} +22 -22
- package/dist/lib/node/{chunk-HCDBN6NN.cjs.map → chunk-AUWXU65U.cjs.map} +3 -3
- package/dist/lib/node/index.cjs +17 -17
- package/dist/lib/node/{intent-resolver-EEOTX3OZ.cjs → intent-resolver-VDAHQEE7.cjs} +7 -7
- package/dist/lib/node/intent-resolver-VDAHQEE7.cjs.map +7 -0
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/{react-surface-WD4G2NRS.cjs → react-surface-4YBNYQED.cjs} +9 -9
- package/dist/lib/node/types/index.cjs +3 -3
- package/dist/lib/node/types/index.cjs.map +1 -1
- package/dist/lib/node-esm/{ExplorerContainer-NMI55PYM.mjs → ExplorerContainer-5K4RALZR.mjs} +2 -2
- package/dist/lib/{browser/chunk-B2DMPSP5.mjs → node-esm/chunk-4C6UIJCM.mjs} +19 -18
- package/dist/lib/node-esm/{chunk-PZOORWFE.mjs.map → chunk-4C6UIJCM.mjs.map} +3 -3
- package/dist/lib/node-esm/{chunk-QZH2GDN5.mjs → chunk-QOJSLABX.mjs} +10 -9
- package/dist/lib/node-esm/chunk-QOJSLABX.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-SZRRNWYT.mjs → chunk-XMTM43JC.mjs} +5 -4
- package/dist/lib/node-esm/chunk-XMTM43JC.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +5 -5
- package/dist/lib/node-esm/{intent-resolver-PTFKXAT4.mjs → intent-resolver-XWRVHP6H.mjs} +4 -4
- package/dist/lib/node-esm/intent-resolver-XWRVHP6H.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-surface-J5SW7VF2.mjs → react-surface-6BTL55DB.mjs} +4 -4
- package/dist/lib/node-esm/types/index.mjs +1 -1
- package/dist/types/src/components/Graph/graph-model.d.ts +3 -3
- package/dist/types/src/components/Graph/graph-model.d.ts.map +1 -1
- package/dist/types/src/components/Tree/layout/HierarchicalEdgeBundling.d.ts.map +1 -1
- package/dist/types/src/components/Tree/layout/RadialTree.d.ts.map +1 -1
- package/dist/types/src/components/Tree/layout/TidyTree.d.ts.map +1 -1
- package/dist/types/src/types/schema.d.ts +6 -6
- package/dist/types/src/types/schema.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +6 -6
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/package.json +26 -24
- package/src/capabilities/intent-resolver.ts +2 -2
- package/src/components/Globe/Globe.stories.tsx +13 -13
- package/src/components/Graph/Graph.stories.tsx +2 -2
- package/src/components/Graph/graph-model.ts +7 -6
- package/src/components/Tree/layout/HierarchicalEdgeBundling.ts +17 -19
- package/src/components/Tree/layout/RadialTree.ts +5 -7
- package/src/components/Tree/layout/TidyTree.ts +5 -6
- package/src/types/schema.ts +5 -3
- package/src/types/types.ts +5 -5
- package/dist/lib/browser/chunk-QLQLPZNI.mjs.map +0 -7
- package/dist/lib/browser/chunk-SBLNE7FL.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-NHHRWTOP.mjs.map +0 -7
- package/dist/lib/node/chunk-OIHH6TVE.cjs.map +0 -7
- package/dist/lib/node/chunk-YLL7H7CZ.cjs.map +0 -7
- package/dist/lib/node/intent-resolver-EEOTX3OZ.cjs.map +0 -7
- package/dist/lib/node-esm/chunk-QZH2GDN5.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-SZRRNWYT.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-PTFKXAT4.mjs.map +0 -7
- /package/dist/lib/browser/{ExplorerContainer-HL532ODG.mjs.map → ExplorerContainer-UJJIZBXP.mjs.map} +0 -0
- /package/dist/lib/browser/{react-surface-N7TC6BMF.mjs.map → react-surface-VFVM6HNB.mjs.map} +0 -0
- /package/dist/lib/node/{ExplorerContainer-73AHSBAG.cjs.map → ExplorerContainer-XJUAYKA6.cjs.map} +0 -0
- /package/dist/lib/node/{react-surface-WD4G2NRS.cjs.map → react-surface-4YBNYQED.cjs.map} +0 -0
- /package/dist/lib/node-esm/{ExplorerContainer-NMI55PYM.mjs.map → ExplorerContainer-5K4RALZR.mjs.map} +0 -0
- /package/dist/lib/node-esm/{react-surface-J5SW7VF2.mjs.map → react-surface-6BTL55DB.mjs.map} +0 -0
|
@@ -4,12 +4,12 @@
|
|
|
4
4
|
|
|
5
5
|
import '@dxos-theme';
|
|
6
6
|
|
|
7
|
-
import
|
|
7
|
+
import { plot, sphere, geo, graticule, dot } from '@observablehq/plot';
|
|
8
8
|
import { type Meta } from '@storybook/react';
|
|
9
|
-
import
|
|
9
|
+
import { geoCircle } from 'd3';
|
|
10
10
|
import React, { useEffect } from 'react';
|
|
11
11
|
import { useResizeDetector } from 'react-resize-detector';
|
|
12
|
-
import
|
|
12
|
+
import { feature } from 'topojson-client';
|
|
13
13
|
|
|
14
14
|
import { ClientRepeater } from '@dxos/react-client/testing';
|
|
15
15
|
import { withLayout, withTheme } from '@dxos/storybook-utils';
|
|
@@ -37,18 +37,18 @@ const ExtendedStory = () => {
|
|
|
37
37
|
return;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
const land =
|
|
40
|
+
const land = feature(CountriesData as any, CountriesData.objects.land as any);
|
|
41
41
|
const items = CitiesData.features.map((feature: any) => ({
|
|
42
42
|
lat: feature.geometry.coordinates[0],
|
|
43
43
|
lng: feature.geometry.coordinates[1],
|
|
44
44
|
}));
|
|
45
45
|
|
|
46
46
|
const city = items[0];
|
|
47
|
-
const circle =
|
|
47
|
+
const circle = geoCircle().center([city.lat, city.lng]).radius(16)();
|
|
48
48
|
|
|
49
49
|
// https://observablehq.com/plot/marks/geo
|
|
50
50
|
// https://observablehq.com/@observablehq/plot-earthquake-globe?intent=fork
|
|
51
|
-
const
|
|
51
|
+
const drawing = plot({
|
|
52
52
|
// https://observablehq.com/plot/features/projections
|
|
53
53
|
projection: { type: 'orthographic', rotate: [-city.lat + 30, -30] },
|
|
54
54
|
// projection: { type: 'equirectangular', rotate: [-140, -30] },
|
|
@@ -58,11 +58,11 @@ const ExtendedStory = () => {
|
|
|
58
58
|
background: 'transparent',
|
|
59
59
|
},
|
|
60
60
|
marks: [
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
61
|
+
sphere({ fill: 'lightblue', fillOpacity: 0.5 }),
|
|
62
|
+
geo(land, { fill: 'green', fillOpacity: 0.3 }),
|
|
63
|
+
graticule(),
|
|
64
|
+
geo(circle, { stroke: 'black', fill: 'darkblue', fillOpacity: 0.1, strokeWidth: 2 }),
|
|
65
|
+
dot(items, {
|
|
66
66
|
x: 'lat',
|
|
67
67
|
y: 'lng',
|
|
68
68
|
r: 6,
|
|
@@ -73,8 +73,8 @@ const ExtendedStory = () => {
|
|
|
73
73
|
],
|
|
74
74
|
});
|
|
75
75
|
|
|
76
|
-
containerRef.current!.append(
|
|
77
|
-
return () =>
|
|
76
|
+
containerRef.current!.append(drawing);
|
|
77
|
+
return () => drawing?.remove();
|
|
78
78
|
}, [width, height]);
|
|
79
79
|
|
|
80
80
|
return <div ref={containerRef} className='grow p-8' />;
|
|
@@ -10,7 +10,7 @@ import React, { useEffect, useState } from 'react';
|
|
|
10
10
|
import { createSpaceObjectGenerator, TestSchemaType } from '@dxos/echo-generator';
|
|
11
11
|
import { faker } from '@dxos/random';
|
|
12
12
|
import { useClient } from '@dxos/react-client';
|
|
13
|
-
import {
|
|
13
|
+
import { live } from '@dxos/react-client/echo';
|
|
14
14
|
import { type Space } from '@dxos/react-client/echo';
|
|
15
15
|
import { ClientRepeater } from '@dxos/react-client/testing';
|
|
16
16
|
import { withLayout, withTheme } from '@dxos/storybook-utils';
|
|
@@ -35,7 +35,7 @@ const Story = () => {
|
|
|
35
35
|
});
|
|
36
36
|
});
|
|
37
37
|
|
|
38
|
-
const view = space.db.add(
|
|
38
|
+
const view = space.db.add(live(ViewType, { name: '', type: '' }));
|
|
39
39
|
setSpace(space);
|
|
40
40
|
setView(view);
|
|
41
41
|
}, []);
|
|
@@ -2,11 +2,12 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
import { SchemaAST } from 'effect';
|
|
6
|
+
|
|
5
7
|
import { type CleanupFn } from '@dxos/async';
|
|
6
8
|
import {
|
|
7
9
|
getSchema,
|
|
8
10
|
getSchemaDXN,
|
|
9
|
-
AST,
|
|
10
11
|
type EchoSchema,
|
|
11
12
|
ReferenceAnnotationId,
|
|
12
13
|
SchemaValidator,
|
|
@@ -15,7 +16,7 @@ import {
|
|
|
15
16
|
import { type GraphData, GraphModel } from '@dxos/gem-spore';
|
|
16
17
|
import { log } from '@dxos/log';
|
|
17
18
|
import { CollectionType } from '@dxos/plugin-space/types';
|
|
18
|
-
import { Filter, type
|
|
19
|
+
import { Filter, type AnyLiveObject, type Space } from '@dxos/react-client/echo';
|
|
19
20
|
|
|
20
21
|
export type SpaceGraphModelOptions = {
|
|
21
22
|
schema?: boolean;
|
|
@@ -32,7 +33,7 @@ type SchemaGraphNode = {
|
|
|
32
33
|
type ObjectGraphNode = {
|
|
33
34
|
id: string;
|
|
34
35
|
type: 'object';
|
|
35
|
-
data: { typename: string; object:
|
|
36
|
+
data: { typename: string; object: AnyLiveObject<any> };
|
|
36
37
|
};
|
|
37
38
|
|
|
38
39
|
export type EchoGraphNode = SchemaGraphNode | ObjectGraphNode;
|
|
@@ -48,7 +49,7 @@ export class SpaceGraphModel extends GraphModel<EchoGraphNode> {
|
|
|
48
49
|
|
|
49
50
|
private _schema?: EchoSchema[];
|
|
50
51
|
private _schemaSubscription?: CleanupFn;
|
|
51
|
-
private _objects?:
|
|
52
|
+
private _objects?: AnyLiveObject<any>[];
|
|
52
53
|
private _objectsSubscription?: CleanupFn;
|
|
53
54
|
|
|
54
55
|
constructor(private readonly _options: SpaceGraphModelOptions = {}) {
|
|
@@ -59,7 +60,7 @@ export class SpaceGraphModel extends GraphModel<EchoGraphNode> {
|
|
|
59
60
|
return this._graph;
|
|
60
61
|
}
|
|
61
62
|
|
|
62
|
-
get objects():
|
|
63
|
+
get objects(): AnyLiveObject<any>[] {
|
|
63
64
|
return this._objects ?? [];
|
|
64
65
|
}
|
|
65
66
|
|
|
@@ -149,7 +150,7 @@ export class SpaceGraphModel extends GraphModel<EchoGraphNode> {
|
|
|
149
150
|
|
|
150
151
|
// Link ot refs.
|
|
151
152
|
// TODO(burdon): This isn't working.
|
|
152
|
-
|
|
153
|
+
SchemaAST.getPropertySignatures(schema.ast).forEach((prop) => {
|
|
153
154
|
if (!SchemaValidator.hasTypeAnnotation(schema, prop.name.toString(), ReferenceAnnotationId)) {
|
|
154
155
|
return;
|
|
155
156
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// Copyright 2022 Observable, Inc.
|
|
4
4
|
//
|
|
5
5
|
|
|
6
|
-
import
|
|
6
|
+
import { cluster, curveBundle, hierarchy, lineRadial, select } from 'd3';
|
|
7
7
|
import { type HierarchyNode } from 'd3-hierarchy';
|
|
8
8
|
|
|
9
9
|
import { type TreeOptions } from '../Tree';
|
|
@@ -17,16 +17,16 @@ const getId = (node: HierarchyNode<TreeNode>): string =>
|
|
|
17
17
|
// https://github.com/d3/d3-hierarchy
|
|
18
18
|
// https://observablehq.com/@d3/hierarchical-edge-bundling?intent=fork
|
|
19
19
|
const HierarchicalEdgeBundling = (s: SVGSVGElement, data: TreeNode, options: TreeOptions) => {
|
|
20
|
-
const svg =
|
|
20
|
+
const svg = select(s);
|
|
21
21
|
svg.selectAll('*').remove();
|
|
22
22
|
|
|
23
23
|
const { radius = 600, padding = 100, slots } = options;
|
|
24
24
|
|
|
25
25
|
// https://d3js.org/d3-hierarchy/hierarchy
|
|
26
|
-
const root =
|
|
27
|
-
// .sort((a, b) =>
|
|
26
|
+
const root = hierarchy(flatten(data));
|
|
27
|
+
// .sort((a, b) => ascending(a.height, b.height) || ascending(getName(a.data), getName(b.data)));
|
|
28
28
|
|
|
29
|
-
const tree =
|
|
29
|
+
const tree = cluster<TreeNode>().size([2 * Math.PI, radius - padding]);
|
|
30
30
|
const layout = tree(addLinks(root));
|
|
31
31
|
|
|
32
32
|
// eslint-disable-next-line unused-imports/no-unused-vars
|
|
@@ -54,9 +54,8 @@ const HierarchicalEdgeBundling = (s: SVGSVGElement, data: TreeNode, options: Tre
|
|
|
54
54
|
);
|
|
55
55
|
|
|
56
56
|
// https://d3js.org/d3-shape/radial-line
|
|
57
|
-
const line =
|
|
58
|
-
.
|
|
59
|
-
.curve(d3.curveBundle.beta(0.85))
|
|
57
|
+
const line = lineRadial()
|
|
58
|
+
.curve(curveBundle.beta(0.85))
|
|
60
59
|
.radius((d: any) => d.y)
|
|
61
60
|
.angle((d: any) => d.x);
|
|
62
61
|
|
|
@@ -77,30 +76,30 @@ const HierarchicalEdgeBundling = (s: SVGSVGElement, data: TreeNode, options: Tre
|
|
|
77
76
|
|
|
78
77
|
// function overed(event: any, d: X) {
|
|
79
78
|
// link.style('mix-blend-mode', null);
|
|
80
|
-
//
|
|
81
|
-
//
|
|
79
|
+
// select(this).attr('font-weight', 'bold');
|
|
80
|
+
// selectAll(d.incoming.map((d) => d.path))
|
|
82
81
|
// .attr('stroke', color.in)
|
|
83
82
|
// .raise();
|
|
84
|
-
//
|
|
83
|
+
// selectAll((d as any).incoming.map(([d]) => d.text))
|
|
85
84
|
// .attr('fill', color.in)
|
|
86
85
|
// .attr('font-weight', 'bold');
|
|
87
|
-
//
|
|
86
|
+
// selectAll(d.outgoing.map((d) => d.path))
|
|
88
87
|
// .attr('stroke', color.out)
|
|
89
88
|
// .raise();
|
|
90
|
-
//
|
|
89
|
+
// selectAll(d.outgoing.map(([, d]) => d.text))
|
|
91
90
|
// .attr('fill', color.out)
|
|
92
91
|
// .attr('font-weight', 'bold');
|
|
93
92
|
// }
|
|
94
93
|
|
|
95
94
|
// function outed(event: any, d: HierarchyNode<Datum>) {
|
|
96
95
|
// // @ts-ignore
|
|
97
|
-
//
|
|
98
|
-
//
|
|
99
|
-
//
|
|
96
|
+
// select(this).attr('font-weight', null);
|
|
97
|
+
// selectAll(d.incoming.map((d) => d.path)).attr('stroke', null);
|
|
98
|
+
// selectAll(d.incoming.map(([d]) => d.text))
|
|
100
99
|
// .attr('fill', null)
|
|
101
100
|
// .attr('font-weight', null);
|
|
102
|
-
//
|
|
103
|
-
//
|
|
101
|
+
// selectAll(d.outgoing.map((d) => d.path)).attr('stroke', null);
|
|
102
|
+
// selectAll(d.outgoing.map(([, d]) => d.text))
|
|
104
103
|
// .attr('fill', null)
|
|
105
104
|
// .attr('font-weight', null);
|
|
106
105
|
// }
|
|
@@ -119,7 +118,6 @@ const addLinks = (root: HierarchyNode<TreeNode>) => {
|
|
|
119
118
|
|
|
120
119
|
for (const d of root.leaves()) {
|
|
121
120
|
// (d as any).incoming = [];
|
|
122
|
-
|
|
123
121
|
const parent = parents.get(d.data.id);
|
|
124
122
|
if (parent) {
|
|
125
123
|
// Skip the first node which is a placeholder created by flatten().
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// Copyright 2022 Observable, Inc.
|
|
4
4
|
//
|
|
5
5
|
|
|
6
|
-
import
|
|
6
|
+
import { hierarchy, linkRadial, select, tree } from 'd3';
|
|
7
7
|
|
|
8
8
|
import { type TreeOptions } from '../Tree';
|
|
9
9
|
|
|
@@ -11,7 +11,7 @@ import { type TreeOptions } from '../Tree';
|
|
|
11
11
|
// https://observablehq.com/@d3/radial-tree
|
|
12
12
|
// https://observablehq.com/@d3/tree
|
|
13
13
|
const RadialTree = (s: SVGSVGElement, data: any, options: TreeOptions) => {
|
|
14
|
-
const svg =
|
|
14
|
+
const svg = select(s);
|
|
15
15
|
svg.selectAll('*').remove();
|
|
16
16
|
|
|
17
17
|
const {
|
|
@@ -23,7 +23,7 @@ const RadialTree = (s: SVGSVGElement, data: any, options: TreeOptions) => {
|
|
|
23
23
|
|
|
24
24
|
const arc = 2 * Math.PI;
|
|
25
25
|
|
|
26
|
-
const root =
|
|
26
|
+
const root = hierarchy(data);
|
|
27
27
|
|
|
28
28
|
// Sort the nodes.
|
|
29
29
|
// if (sort) {
|
|
@@ -35,8 +35,7 @@ const RadialTree = (s: SVGSVGElement, data: any, options: TreeOptions) => {
|
|
|
35
35
|
const getLabel = label === null ? null : descendants.map((d) => label(d.data));
|
|
36
36
|
|
|
37
37
|
// Compute the layout.
|
|
38
|
-
const layout =
|
|
39
|
-
.tree()
|
|
38
|
+
const layout = tree()
|
|
40
39
|
.size([arc, radius])
|
|
41
40
|
.separation((a: any, b: any) => (a.parent === b.parent ? 1 : 2) / a.depth);
|
|
42
41
|
layout(root);
|
|
@@ -50,8 +49,7 @@ const RadialTree = (s: SVGSVGElement, data: any, options: TreeOptions) => {
|
|
|
50
49
|
.attr('class', slots?.path ?? '')
|
|
51
50
|
.attr(
|
|
52
51
|
'd',
|
|
53
|
-
|
|
54
|
-
.linkRadial()
|
|
52
|
+
linkRadial()
|
|
55
53
|
.angle((d: any) => d.x + Math.PI / 2)
|
|
56
54
|
.radius((d: any) => d.y) as any,
|
|
57
55
|
);
|
|
@@ -3,19 +3,19 @@
|
|
|
3
3
|
// Copyright 2021 Observable, Inc.
|
|
4
4
|
//
|
|
5
5
|
|
|
6
|
-
import
|
|
6
|
+
import { curveBumpX, hierarchy, link, select, tree } from 'd3';
|
|
7
7
|
|
|
8
8
|
import { type TreeOptions } from '../Tree';
|
|
9
9
|
|
|
10
10
|
// Released under the ISC license.
|
|
11
11
|
// https://observablehq.com/@d3/tree
|
|
12
12
|
const TidyTree = (s: SVGSVGElement, data: any, options: TreeOptions) => {
|
|
13
|
-
const svg =
|
|
13
|
+
const svg = select(s);
|
|
14
14
|
svg.selectAll('*').remove();
|
|
15
15
|
|
|
16
16
|
const { label, width, height, r = 4, padding = 4, margin = 60, slots } = options;
|
|
17
17
|
|
|
18
|
-
const root =
|
|
18
|
+
const root = hierarchy(data);
|
|
19
19
|
|
|
20
20
|
// Compute labels and titles.
|
|
21
21
|
const descendants = root.descendants();
|
|
@@ -24,7 +24,7 @@ const TidyTree = (s: SVGSVGElement, data: any, options: TreeOptions) => {
|
|
|
24
24
|
// Compute the layout.
|
|
25
25
|
const dx = 16;
|
|
26
26
|
const dy = width / (root.height + padding);
|
|
27
|
-
const layout =
|
|
27
|
+
const layout = tree().nodeSize([dx, dy]);
|
|
28
28
|
layout(root);
|
|
29
29
|
|
|
30
30
|
// Center the tree.
|
|
@@ -61,8 +61,7 @@ const TidyTree = (s: SVGSVGElement, data: any, options: TreeOptions) => {
|
|
|
61
61
|
.attr('class', slots?.path ?? '')
|
|
62
62
|
.attr(
|
|
63
63
|
'd',
|
|
64
|
-
|
|
65
|
-
.link(d3.curveBumpX)
|
|
64
|
+
link(curveBumpX)
|
|
66
65
|
.x((d: any) => d.y + oy)
|
|
67
66
|
.y((d: any) => d.x * sx) as any,
|
|
68
67
|
);
|
package/src/types/schema.ts
CHANGED
|
@@ -2,13 +2,15 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { Schema } from 'effect';
|
|
6
|
+
|
|
7
|
+
import { TypedObject } from '@dxos/echo-schema';
|
|
6
8
|
|
|
7
9
|
// TODO(burdon): Clashes with sdk/view.
|
|
8
10
|
export class ViewType extends TypedObject({
|
|
9
11
|
typename: 'dxos.org/type/ExplorerView',
|
|
10
12
|
version: '0.1.0',
|
|
11
13
|
})({
|
|
12
|
-
name:
|
|
13
|
-
type:
|
|
14
|
+
name: Schema.optional(Schema.String),
|
|
15
|
+
type: Schema.String,
|
|
14
16
|
}) {}
|
package/src/types/types.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { Schema } from 'effect';
|
|
6
6
|
|
|
7
7
|
import { ViewType } from './schema';
|
|
8
8
|
import { EXPLORER_PLUGIN } from '../meta';
|
|
@@ -10,11 +10,11 @@ import { EXPLORER_PLUGIN } from '../meta';
|
|
|
10
10
|
export namespace ExplorerAction {
|
|
11
11
|
const EXPLORER_ACTION = `${EXPLORER_PLUGIN}/action`;
|
|
12
12
|
|
|
13
|
-
export class Create extends
|
|
14
|
-
input:
|
|
15
|
-
name:
|
|
13
|
+
export class Create extends Schema.TaggedClass<Create>()(`${EXPLORER_ACTION}/create`, {
|
|
14
|
+
input: Schema.Struct({
|
|
15
|
+
name: Schema.optional(Schema.String),
|
|
16
16
|
}),
|
|
17
|
-
output:
|
|
17
|
+
output: Schema.Struct({
|
|
18
18
|
object: ViewType,
|
|
19
19
|
}),
|
|
20
20
|
}) {}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/types/schema.ts", "../../../src/types/types.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { S, TypedObject } from '@dxos/echo-schema';\n\n// TODO(burdon): Clashes with sdk/view.\nexport class ViewType extends TypedObject({\n typename: 'dxos.org/type/ExplorerView',\n version: '0.1.0',\n})({\n name: S.optional(S.String),\n type: S.String,\n}) {}\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { S } from '@dxos/echo-schema';\n\nimport { ViewType } from './schema';\nimport { EXPLORER_PLUGIN } from '../meta';\n\nexport namespace ExplorerAction {\n const EXPLORER_ACTION = `${EXPLORER_PLUGIN}/action`;\n\n export class Create extends S.TaggedClass<Create>()(`${EXPLORER_ACTION}/create`, {\n input: S.Struct({\n name: S.optional(S.String),\n }),\n output: S.Struct({\n object: ViewType,\n }),\n }) {}\n}\n"],
|
|
5
|
-
"mappings": ";;;;;AAIA,SAASA,GAAGC,mBAAmB;AAGxB,IAAMC,WAAN,cAAuBC,YAAY;EACxCC,UAAU;EACVC,SAAS;AACX,CAAA,EAAG;EACDC,MAAMC,EAAEC,SAASD,EAAEE,MAAM;EACzBC,MAAMH,EAAEE;AACV,CAAA,EAAA;AAAI;;;ACTJ,SAASE,KAAAA,UAAS;;UAKDC,iBAAAA;AACf,QAAMC,kBAAkB,GAAGC,eAAAA;EAEpB,MAAMC,eAAeC,GAAEC,YAAW,EAAW,GAAGJ,eAAAA,WAA0B;IAC/EK,OAAOF,GAAEG,OAAO;MACdC,MAAMJ,GAAEK,SAASL,GAAEM,MAAM;IAC3B,CAAA;IACAC,QAAQP,GAAEG,OAAO;MACfK,QAAQC;IACV,CAAA;EACF,CAAA,EAAA;EAAI;kBAPSV,SAAAA;AAQf,GAXiBH,mBAAAA,iBAAAA,CAAAA,EAAAA;",
|
|
6
|
-
"names": ["S", "TypedObject", "ViewType", "TypedObject", "typename", "version", "name", "S", "optional", "String", "type", "S", "ExplorerAction", "EXPLORER_ACTION", "EXPLORER_PLUGIN", "Create", "S", "TaggedClass", "input", "Struct", "name", "optional", "String", "output", "object", "ViewType"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/Graph/graph-model.ts", "../../../src/components/Graph/Graph.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type CleanupFn } from '@dxos/async';\nimport {\n getSchema,\n getSchemaDXN,\n AST,\n type EchoSchema,\n ReferenceAnnotationId,\n SchemaValidator,\n StoredSchema,\n} from '@dxos/echo-schema';\nimport { type GraphData, GraphModel } from '@dxos/gem-spore';\nimport { log } from '@dxos/log';\nimport { CollectionType } from '@dxos/plugin-space/types';\nimport { Filter, type ReactiveEchoObject, type Space } from '@dxos/react-client/echo';\n\nexport type SpaceGraphModelOptions = {\n schema?: boolean;\n};\n\n// TODO(burdon): Convert to common/graph.\n\ntype SchemaGraphNode = {\n id: string;\n type: 'schema';\n data: { typename: string };\n};\n\ntype ObjectGraphNode = {\n id: string;\n type: 'object';\n data: { typename: string; object: ReactiveEchoObject<any> };\n};\n\nexport type EchoGraphNode = SchemaGraphNode | ObjectGraphNode;\n\n/**\n * Converts ECHO objects to a graph.\n */\nexport class SpaceGraphModel extends GraphModel<EchoGraphNode> {\n private readonly _graph: GraphData<EchoGraphNode> = {\n nodes: [],\n links: [],\n };\n\n private _schema?: EchoSchema[];\n private _schemaSubscription?: CleanupFn;\n private _objects?: ReactiveEchoObject<any>[];\n private _objectsSubscription?: CleanupFn;\n\n constructor(private readonly _options: SpaceGraphModelOptions = {}) {\n super();\n }\n\n override get graph(): GraphData<EchoGraphNode> {\n return this._graph;\n }\n\n get objects(): ReactiveEchoObject<any>[] {\n return this._objects ?? [];\n }\n\n // TODO(burdon): Alternative diagram types:\n // - https://observablehq.com/@d3/radial-tree/2\n // - https://observablehq.com/@d3/disjoint-force-directed-graph/2\n // - https://observablehq.com/@mbostock/tadpoles\n // - https://observablehq.com/@d3/psr-b1919-21\n // - https://vasturiano.github.io/react-force-graph/example/basic (3D)\n\n async open(space: Space, objectId?: string) {\n // TODO(burdon): Factor out graph builder to lib (use common/graph abstraction).\n if (!this._schemaSubscription) {\n // TODO(burdon): Normalize unsubscribe callbacks and merge handlers.\n // TODO(burdon): Trigger initial subscription update.\n // TODO(burdon): Normalize subscription cb for objects, schema, etc.\n\n const schemaaQuery = space.db.schemaRegistry.query({});\n const schemas = await schemaaQuery.run();\n const onSchemaUpdate = ({ results }: { results: EchoSchema[] }) => (this._schema = results);\n this._schemaSubscription = schemaaQuery.subscribe(onSchemaUpdate);\n onSchemaUpdate({ results: schemas });\n\n this._objectsSubscription = space.db\n // TODO(burdon): ERROR: Cannot mix type and or filters.\n .query(Filter.not(Filter.or(Filter.schema(StoredSchema), Filter.schema(CollectionType))))\n .subscribe(\n ({ objects }) => {\n this._objects = objects;\n\n // Merge with current nodes.\n const currentNodes = this._graph.nodes;\n\n this._graph.nodes = [];\n this._graph.links = [];\n\n const addSchema = (typename: string) => {\n const current = currentNodes.find((node) => node.id === typename);\n if (typename) {\n this._graph.nodes.push({\n ...current,\n id: typename,\n type: 'schema',\n data: { typename },\n });\n }\n };\n\n // Runtime schema.\n space.db.graph.schemaRegistry.schemas.forEach((schema) => {\n const typename = getSchemaDXN(schema)?.typename;\n if (typename) {\n addSchema(typename);\n }\n });\n\n // Database Schema.\n this._schema?.forEach((schema) => {\n const typename = getSchemaDXN(schema)?.typename;\n if (typename) {\n addSchema(typename);\n }\n });\n\n // Database Objects.\n this._objects.forEach((object) => {\n const schema = getSchema(object);\n if (schema) {\n const typename = getSchemaDXN(schema)?.typename;\n if (typename) {\n const current = currentNodes.find((node) => node.id === object.id);\n this._graph.nodes.push({ ...current, id: object.id, type: 'object', data: { typename, object } });\n\n // Link to schema.\n const schemaNode = this._graph.nodes.find(\n (node) => node.type === 'schema' && node.data.typename === typename,\n );\n if (schemaNode) {\n this._graph.links.push({\n id: `${object.id}-${schemaNode.id}`,\n source: object.id,\n target: schemaNode.id,\n });\n } else {\n log.info('schema node not found', { typename });\n }\n\n // Link ot refs.\n // TODO(burdon): This isn't working.\n AST.getPropertySignatures(schema.ast).forEach((prop) => {\n if (!SchemaValidator.hasTypeAnnotation(schema, prop.name.toString(), ReferenceAnnotationId)) {\n return;\n }\n\n const value = object[String(prop.name)];\n if (value) {\n const refs = Array.isArray(value) ? value : [value];\n for (const ref of refs) {\n if (objects.findIndex((obj) => obj.id === ref.id) !== -1) {\n this._graph.links.push({\n id: `${object.id}-${String(prop.name)}-${ref.id}`,\n source: object.id,\n target: ref.id,\n });\n }\n }\n }\n });\n }\n }\n });\n\n this.triggerUpdate();\n },\n { fire: true },\n );\n }\n\n this.setSelected(objectId);\n return this;\n }\n\n close() {\n this._schemaSubscription?.();\n this._schemaSubscription = undefined;\n this._objectsSubscription?.();\n this._objectsSubscription = undefined;\n\n return this;\n }\n}\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { forceLink, forceManyBody } from 'd3';\nimport ForceGraph from 'force-graph';\nimport React, { type FC, useEffect, useRef } from 'react';\nimport { useResizeDetector } from 'react-resize-detector';\n\nimport { type Space } from '@dxos/client/echo';\nimport { filterObjectsSync, type SearchResult } from '@dxos/plugin-search';\nimport { useAsyncState } from '@dxos/react-ui';\n\nimport { SpaceGraphModel } from './graph-model';\n\nexport type GraphProps = {\n space: Space;\n match?: RegExp;\n};\n\nexport const Graph: FC<GraphProps> = ({ space, match }) => {\n const { ref, width, height } = useResizeDetector({ refreshRate: 200 });\n const rootRef = useRef<HTMLDivElement>(null);\n const forceGraph = useRef<ForceGraph>();\n\n const [model] = useAsyncState(\n async () => (space ? new SpaceGraphModel({ schema: true }).open(space) : undefined),\n [space],\n );\n\n const filteredRef = useRef<SearchResult[]>();\n filteredRef.current = filterObjectsSync(model?.objects ?? [], match);\n\n useEffect(() => {\n if (rootRef.current) {\n // https://github.com/vasturiano/force-graph\n // https://github.com/vasturiano/3d-force-graph\n forceGraph.current = new ForceGraph(rootRef.current)\n .nodeRelSize(6)\n .nodeLabel((node: any) => {\n if (node.type === 'schema') {\n return node.data.typename;\n }\n\n return node.id;\n })\n .nodeAutoColorBy((node: any) => (node.type === 'schema' ? 'schema' : node.data.typename))\n .linkColor(() => 'rgba(255,255,255,0.25)');\n }\n\n return () => {\n forceGraph.current?.pauseAnimation().graphData({ nodes: [], links: [] });\n forceGraph.current = undefined;\n };\n }, []);\n\n useEffect(() => {\n if (forceGraph.current && width && height && model) {\n forceGraph.current\n .pauseAnimation()\n .width(width)\n .height(height)\n .onEngineStop(() => {\n handleZoomToFit();\n })\n\n // https://github.com/vasturiano/force-graph?tab=readme-ov-file#force-engine-d3-force-configuration\n // .d3Force('center', forceCenter().strength(0.9))\n .d3Force('link', forceLink().distance(160).strength(0.5))\n .d3Force('charge', forceManyBody().strength(-30))\n // .d3AlphaDecay(0.0228)\n // .d3VelocityDecay(0.4)\n\n .graphData(model.graph)\n .warmupTicks(100)\n .cooldownTime(1000)\n .resumeAnimation();\n }\n }, [model, width, height]);\n\n const handleZoomToFit = () => {\n forceGraph.current?.zoomToFit(400, 40);\n };\n\n return (\n <div ref={ref} className='relative grow' onClick={handleZoomToFit}>\n <div ref={rootRef} className='absolute inset-0' />\n </div>\n );\n};\n"],
|
|
5
|
-
"mappings": ";AAKA,SACEA,WACAC,cACAC,KAEAC,uBACAC,iBACAC,oBACK;AACP,SA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KK;IAASyC,WAAU;;AAGnC;",
|
|
6
|
-
"names": ["getSchema", "getSchemaDXN", "AST", "ReferenceAnnotationId", "SchemaValidator", "StoredSchema", "GraphModel", "log", "CollectionType", "Filter", "SpaceGraphModel", "constructor", "_options", "_graph", "nodes", "links", "graph", "objects", "_objects", "open", "space", "objectId", "_schemaSubscription", "schemaaQuery", "db", "schemaRegistry", "query", "schemas", "run", "onSchemaUpdate", "results", "_schema", "subscribe", "_objectsSubscription", "not", "or", "schema", "currentNodes", "addSchema", "typename", "current", "find", "node", "id", "push", "type", "data", "forEach", "object", "schemaNode", "source", "target", "info", "getPropertySignatures", "ast", "prop", "hasTypeAnnotation", "name", "toString", "value", "String", "refs", "Array", "isArray", "ref", "findIndex", "obj", "triggerUpdate", "fire", "setSelected", "close", "undefined", "forceLink", "forceManyBody", "ForceGraph", "React", "useEffect", "useRef", "useResizeDetector", "filterObjectsSync", "useAsyncState", "Graph", "space", "match", "ref", "width", "height", "useResizeDetector", "refreshRate", "rootRef", "useRef", "forceGraph", "model", "useAsyncState", "SpaceGraphModel", "schema", "open", "undefined", "filteredRef", "current", "filterObjectsSync", "objects", "useEffect", "ForceGraph", "nodeRelSize", "nodeLabel", "node", "type", "data", "typename", "id", "nodeAutoColorBy", "linkColor", "pauseAnimation", "graphData", "nodes", "links", "onEngineStop", "handleZoomToFit", "d3Force", "forceLink", "distance", "strength", "forceManyBody", "graph", "warmupTicks", "cooldownTime", "resumeAnimation", "zoomToFit", "div", "className", "onClick"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/intent-resolver.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { contributes, Capabilities, createResolver } from '@dxos/app-framework';\nimport { create } from '@dxos/live-object';\n\nimport { ExplorerAction, ViewType } from '../types';\n\nexport default () =>\n contributes(\n Capabilities.IntentResolver,\n createResolver({\n intent: ExplorerAction.Create,\n resolve: ({ name }) => ({\n data: { object: create(ViewType, { name, type: '' }) },\n }),\n }),\n );\n"],
|
|
5
|
-
"mappings": ";;;;;;;AAIA,SAASA,aAAaC,cAAcC,sBAAsB;AAC1D,SAASC,cAAc;AAIvB,IAAA,0BAAe,MACbC,YACEC,aAAaC,gBACbC,eAAe;EACbC,QAAQC,eAAeC;EACvBC,SAAS,CAAC,EAAEC,KAAI,OAAQ;IACtBC,MAAM;MAAEC,QAAQC,OAAOC,UAAU;QAAEJ;QAAMK,MAAM;MAAG,CAAA;IAAG;EACvD;AACF,CAAA,CAAA;",
|
|
6
|
-
"names": ["contributes", "Capabilities", "createResolver", "create", "contributes", "Capabilities", "IntentResolver", "createResolver", "intent", "ExplorerAction", "Create", "resolve", "name", "data", "object", "create", "ViewType", "type"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/Graph/graph-model.ts", "../../../src/components/Graph/Graph.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type CleanupFn } from '@dxos/async';\nimport {\n getSchema,\n getSchemaDXN,\n AST,\n type EchoSchema,\n ReferenceAnnotationId,\n SchemaValidator,\n StoredSchema,\n} from '@dxos/echo-schema';\nimport { type GraphData, GraphModel } from '@dxos/gem-spore';\nimport { log } from '@dxos/log';\nimport { CollectionType } from '@dxos/plugin-space/types';\nimport { Filter, type ReactiveEchoObject, type Space } from '@dxos/react-client/echo';\n\nexport type SpaceGraphModelOptions = {\n schema?: boolean;\n};\n\n// TODO(burdon): Convert to common/graph.\n\ntype SchemaGraphNode = {\n id: string;\n type: 'schema';\n data: { typename: string };\n};\n\ntype ObjectGraphNode = {\n id: string;\n type: 'object';\n data: { typename: string; object: ReactiveEchoObject<any> };\n};\n\nexport type EchoGraphNode = SchemaGraphNode | ObjectGraphNode;\n\n/**\n * Converts ECHO objects to a graph.\n */\nexport class SpaceGraphModel extends GraphModel<EchoGraphNode> {\n private readonly _graph: GraphData<EchoGraphNode> = {\n nodes: [],\n links: [],\n };\n\n private _schema?: EchoSchema[];\n private _schemaSubscription?: CleanupFn;\n private _objects?: ReactiveEchoObject<any>[];\n private _objectsSubscription?: CleanupFn;\n\n constructor(private readonly _options: SpaceGraphModelOptions = {}) {\n super();\n }\n\n override get graph(): GraphData<EchoGraphNode> {\n return this._graph;\n }\n\n get objects(): ReactiveEchoObject<any>[] {\n return this._objects ?? [];\n }\n\n // TODO(burdon): Alternative diagram types:\n // - https://observablehq.com/@d3/radial-tree/2\n // - https://observablehq.com/@d3/disjoint-force-directed-graph/2\n // - https://observablehq.com/@mbostock/tadpoles\n // - https://observablehq.com/@d3/psr-b1919-21\n // - https://vasturiano.github.io/react-force-graph/example/basic (3D)\n\n async open(space: Space, objectId?: string) {\n // TODO(burdon): Factor out graph builder to lib (use common/graph abstraction).\n if (!this._schemaSubscription) {\n // TODO(burdon): Normalize unsubscribe callbacks and merge handlers.\n // TODO(burdon): Trigger initial subscription update.\n // TODO(burdon): Normalize subscription cb for objects, schema, etc.\n\n const schemaaQuery = space.db.schemaRegistry.query({});\n const schemas = await schemaaQuery.run();\n const onSchemaUpdate = ({ results }: { results: EchoSchema[] }) => (this._schema = results);\n this._schemaSubscription = schemaaQuery.subscribe(onSchemaUpdate);\n onSchemaUpdate({ results: schemas });\n\n this._objectsSubscription = space.db\n // TODO(burdon): ERROR: Cannot mix type and or filters.\n .query(Filter.not(Filter.or(Filter.schema(StoredSchema), Filter.schema(CollectionType))))\n .subscribe(\n ({ objects }) => {\n this._objects = objects;\n\n // Merge with current nodes.\n const currentNodes = this._graph.nodes;\n\n this._graph.nodes = [];\n this._graph.links = [];\n\n const addSchema = (typename: string) => {\n const current = currentNodes.find((node) => node.id === typename);\n if (typename) {\n this._graph.nodes.push({\n ...current,\n id: typename,\n type: 'schema',\n data: { typename },\n });\n }\n };\n\n // Runtime schema.\n space.db.graph.schemaRegistry.schemas.forEach((schema) => {\n const typename = getSchemaDXN(schema)?.typename;\n if (typename) {\n addSchema(typename);\n }\n });\n\n // Database Schema.\n this._schema?.forEach((schema) => {\n const typename = getSchemaDXN(schema)?.typename;\n if (typename) {\n addSchema(typename);\n }\n });\n\n // Database Objects.\n this._objects.forEach((object) => {\n const schema = getSchema(object);\n if (schema) {\n const typename = getSchemaDXN(schema)?.typename;\n if (typename) {\n const current = currentNodes.find((node) => node.id === object.id);\n this._graph.nodes.push({ ...current, id: object.id, type: 'object', data: { typename, object } });\n\n // Link to schema.\n const schemaNode = this._graph.nodes.find(\n (node) => node.type === 'schema' && node.data.typename === typename,\n );\n if (schemaNode) {\n this._graph.links.push({\n id: `${object.id}-${schemaNode.id}`,\n source: object.id,\n target: schemaNode.id,\n });\n } else {\n log.info('schema node not found', { typename });\n }\n\n // Link ot refs.\n // TODO(burdon): This isn't working.\n AST.getPropertySignatures(schema.ast).forEach((prop) => {\n if (!SchemaValidator.hasTypeAnnotation(schema, prop.name.toString(), ReferenceAnnotationId)) {\n return;\n }\n\n const value = object[String(prop.name)];\n if (value) {\n const refs = Array.isArray(value) ? value : [value];\n for (const ref of refs) {\n if (objects.findIndex((obj) => obj.id === ref.id) !== -1) {\n this._graph.links.push({\n id: `${object.id}-${String(prop.name)}-${ref.id}`,\n source: object.id,\n target: ref.id,\n });\n }\n }\n }\n });\n }\n }\n });\n\n this.triggerUpdate();\n },\n { fire: true },\n );\n }\n\n this.setSelected(objectId);\n return this;\n }\n\n close() {\n this._schemaSubscription?.();\n this._schemaSubscription = undefined;\n this._objectsSubscription?.();\n this._objectsSubscription = undefined;\n\n return this;\n }\n}\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { forceLink, forceManyBody } from 'd3';\nimport ForceGraph from 'force-graph';\nimport React, { type FC, useEffect, useRef } from 'react';\nimport { useResizeDetector } from 'react-resize-detector';\n\nimport { type Space } from '@dxos/client/echo';\nimport { filterObjectsSync, type SearchResult } from '@dxos/plugin-search';\nimport { useAsyncState } from '@dxos/react-ui';\n\nimport { SpaceGraphModel } from './graph-model';\n\nexport type GraphProps = {\n space: Space;\n match?: RegExp;\n};\n\nexport const Graph: FC<GraphProps> = ({ space, match }) => {\n const { ref, width, height } = useResizeDetector({ refreshRate: 200 });\n const rootRef = useRef<HTMLDivElement>(null);\n const forceGraph = useRef<ForceGraph>();\n\n const [model] = useAsyncState(\n async () => (space ? new SpaceGraphModel({ schema: true }).open(space) : undefined),\n [space],\n );\n\n const filteredRef = useRef<SearchResult[]>();\n filteredRef.current = filterObjectsSync(model?.objects ?? [], match);\n\n useEffect(() => {\n if (rootRef.current) {\n // https://github.com/vasturiano/force-graph\n // https://github.com/vasturiano/3d-force-graph\n forceGraph.current = new ForceGraph(rootRef.current)\n .nodeRelSize(6)\n .nodeLabel((node: any) => {\n if (node.type === 'schema') {\n return node.data.typename;\n }\n\n return node.id;\n })\n .nodeAutoColorBy((node: any) => (node.type === 'schema' ? 'schema' : node.data.typename))\n .linkColor(() => 'rgba(255,255,255,0.25)');\n }\n\n return () => {\n forceGraph.current?.pauseAnimation().graphData({ nodes: [], links: [] });\n forceGraph.current = undefined;\n };\n }, []);\n\n useEffect(() => {\n if (forceGraph.current && width && height && model) {\n forceGraph.current\n .pauseAnimation()\n .width(width)\n .height(height)\n .onEngineStop(() => {\n handleZoomToFit();\n })\n\n // https://github.com/vasturiano/force-graph?tab=readme-ov-file#force-engine-d3-force-configuration\n // .d3Force('center', forceCenter().strength(0.9))\n .d3Force('link', forceLink().distance(160).strength(0.5))\n .d3Force('charge', forceManyBody().strength(-30))\n // .d3AlphaDecay(0.0228)\n // .d3VelocityDecay(0.4)\n\n .graphData(model.graph)\n .warmupTicks(100)\n .cooldownTime(1000)\n .resumeAnimation();\n }\n }, [model, width, height]);\n\n const handleZoomToFit = () => {\n forceGraph.current?.zoomToFit(400, 40);\n };\n\n return (\n <div ref={ref} className='relative grow' onClick={handleZoomToFit}>\n <div ref={rootRef}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U0C,WAAU;IAAgBC,SAASb;KAChD,6BAAAU,QAAA,cAACC,OAAAA;IAAIzC,KAAKc;IAAS4B,WAAU;;AAGnC;",
|
|
6
|
-
"names": ["SpaceGraphModel", "GraphModel", "constructor", "_options", "_graph", "nodes", "links", "graph", "objects", "_objects", "open", "space", "objectId", "_schemaSubscription", "schemaaQuery", "db", "schemaRegistry", "query", "schemas", "run", "onSchemaUpdate", "results", "_schema", "subscribe", "_objectsSubscription", "Filter", "not", "or", "schema", "StoredSchema", "CollectionType", "currentNodes", "addSchema", "typename", "current", "find", "node", "id", "push", "type", "data", "forEach", "getSchemaDXN", "object", "getSchema", "schemaNode", "source", "target", "log", "info", "AST", "getPropertySignatures", "ast", "prop", "SchemaValidator", "hasTypeAnnotation", "name", "toString", "ReferenceAnnotationId", "value", "String", "refs", "Array", "isArray", "ref", "findIndex", "obj", "triggerUpdate", "fire", "setSelected", "close", "undefined", "Graph", "match", "width", "height", "useResizeDetector", "refreshRate", "rootRef", "useRef", "forceGraph", "model", "useAsyncState", "filteredRef", "filterObjectsSync", "useEffect", "ForceGraph", "nodeRelSize", "nodeLabel", "nodeAutoColorBy", "linkColor", "pauseAnimation", "graphData", "onEngineStop", "handleZoomToFit", "d3Force", "forceLink", "distance", "strength", "forceManyBody", "warmupTicks", "cooldownTime", "resumeAnimation", "zoomToFit", "React", "div", "className", "onClick"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/types/schema.ts", "../../../src/types/types.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { S, TypedObject } from '@dxos/echo-schema';\n\n// TODO(burdon): Clashes with sdk/view.\nexport class ViewType extends TypedObject({\n typename: 'dxos.org/type/ExplorerView',\n version: '0.1.0',\n})({\n name: S.optional(S.String),\n type: S.String,\n}) {}\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { S } from '@dxos/echo-schema';\n\nimport { ViewType } from './schema';\nimport { EXPLORER_PLUGIN } from '../meta';\n\nexport namespace ExplorerAction {\n const EXPLORER_ACTION = `${EXPLORER_PLUGIN}/action`;\n\n export class Create extends S.TaggedClass<Create>()(`${EXPLORER_ACTION}/create`, {\n input: S.Struct({\n name: S.optional(S.String),\n }),\n output: S.Struct({\n object: ViewType,\n }),\n }) {}\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;AAIA,yBAA+B;ACA/B,IAAAA,sBAAkB;ADGX,IAAMC,WAAN,kBAAuBC,gCAAY;EACxCC,UAAU;EACVC,SAAS;AACX,CAAA,EAAG;EACDC,MAAMC,qBAAEC,SAASD,qBAAEE,MAAM;EACzBC,MAAMH,qBAAEE;AACV,CAAA,EAAA;AAAI;;UCJaE,iBAAAA;AACf,QAAMC,kBAAkB,GAAGC,qCAAAA;EAEpB,MAAMC,eAAeP,oBAAAA,EAAEQ,YAAW,EAAW,GAAGH,eAAAA,WAA0B;IAC/EI,OAAOT,oBAAAA,EAAEU,OAAO;MACdX,MAAMC,oBAAAA,EAAEC,SAASD,oBAAAA,EAAEE,MAAM;IAC3B,CAAA;IACAS,QAAQX,oBAAAA,EAAEU,OAAO;MACfE,QAAQjB;IACV,CAAA;EACF,CAAA,EAAA;EAAI;kBAPSY,SAAAA;AAQf,GAXiBH,mBAAAA,iBAAAA,CAAAA,EAAAA;",
|
|
6
|
-
"names": ["import_echo_schema", "ViewType", "TypedObject", "typename", "version", "name", "S", "optional", "String", "type", "ExplorerAction", "EXPLORER_ACTION", "EXPLORER_PLUGIN", "Create", "TaggedClass", "input", "Struct", "output", "object"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/intent-resolver.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { contributes, Capabilities, createResolver } from '@dxos/app-framework';\nimport { create } from '@dxos/live-object';\n\nimport { ExplorerAction, ViewType } from '../types';\n\nexport default () =>\n contributes(\n Capabilities.IntentResolver,\n createResolver({\n intent: ExplorerAction.Create,\n resolve: ({ name }) => ({\n data: { object: create(ViewType, { name, type: '' }) },\n }),\n }),\n );\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;AAIA,2BAA0D;AAC1D,yBAAuB;AAIvB,IAAA,0BAAe,UACbA,kCACEC,kCAAaC,oBACbC,qCAAe;EACbC,QAAQC,qCAAeC;EACvBC,SAAS,CAAC,EAAEC,KAAI,OAAQ;IACtBC,MAAM;MAAEC,YAAQC,2BAAOC,gCAAU;QAAEJ;QAAMK,MAAM;MAAG,CAAA;IAAG;EACvD;AACF,CAAA,CAAA;",
|
|
6
|
-
"names": ["contributes", "Capabilities", "IntentResolver", "createResolver", "intent", "ExplorerAction", "Create", "resolve", "name", "data", "object", "create", "ViewType", "type"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/types/schema.ts", "../../../src/types/types.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { S, TypedObject } from '@dxos/echo-schema';\n\n// TODO(burdon): Clashes with sdk/view.\nexport class ViewType extends TypedObject({\n typename: 'dxos.org/type/ExplorerView',\n version: '0.1.0',\n})({\n name: S.optional(S.String),\n type: S.String,\n}) {}\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { S } from '@dxos/echo-schema';\n\nimport { ViewType } from './schema';\nimport { EXPLORER_PLUGIN } from '../meta';\n\nexport namespace ExplorerAction {\n const EXPLORER_ACTION = `${EXPLORER_PLUGIN}/action`;\n\n export class Create extends S.TaggedClass<Create>()(`${EXPLORER_ACTION}/create`, {\n input: S.Struct({\n name: S.optional(S.String),\n }),\n output: S.Struct({\n object: ViewType,\n }),\n }) {}\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;AAIA,SAASA,GAAGC,mBAAmB;AAGxB,IAAMC,WAAN,cAAuBC,YAAY;EACxCC,UAAU;EACVC,SAAS;AACX,CAAA,EAAG;EACDC,MAAMC,EAAEC,SAASD,EAAEE,MAAM;EACzBC,MAAMH,EAAEE;AACV,CAAA,EAAA;AAAI;;;ACTJ,SAASE,KAAAA,UAAS;;UAKDC,iBAAAA;AACf,QAAMC,kBAAkB,GAAGC,eAAAA;EAEpB,MAAMC,eAAeC,GAAEC,YAAW,EAAW,GAAGJ,eAAAA,WAA0B;IAC/EK,OAAOF,GAAEG,OAAO;MACdC,MAAMJ,GAAEK,SAASL,GAAEM,MAAM;IAC3B,CAAA;IACAC,QAAQP,GAAEG,OAAO;MACfK,QAAQC;IACV,CAAA;EACF,CAAA,EAAA;EAAI;kBAPSV,SAAAA;AAQf,GAXiBH,mBAAAA,iBAAAA,CAAAA,EAAAA;",
|
|
6
|
-
"names": ["S", "TypedObject", "ViewType", "TypedObject", "typename", "version", "name", "S", "optional", "String", "type", "S", "ExplorerAction", "EXPLORER_ACTION", "EXPLORER_PLUGIN", "Create", "S", "TaggedClass", "input", "Struct", "name", "optional", "String", "output", "object", "ViewType"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/Graph/graph-model.ts", "../../../src/components/Graph/Graph.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type CleanupFn } from '@dxos/async';\nimport {\n getSchema,\n getSchemaDXN,\n AST,\n type EchoSchema,\n ReferenceAnnotationId,\n SchemaValidator,\n StoredSchema,\n} from '@dxos/echo-schema';\nimport { type GraphData, GraphModel } from '@dxos/gem-spore';\nimport { log } from '@dxos/log';\nimport { CollectionType } from '@dxos/plugin-space/types';\nimport { Filter, type ReactiveEchoObject, type Space } from '@dxos/react-client/echo';\n\nexport type SpaceGraphModelOptions = {\n schema?: boolean;\n};\n\n// TODO(burdon): Convert to common/graph.\n\ntype SchemaGraphNode = {\n id: string;\n type: 'schema';\n data: { typename: string };\n};\n\ntype ObjectGraphNode = {\n id: string;\n type: 'object';\n data: { typename: string; object: ReactiveEchoObject<any> };\n};\n\nexport type EchoGraphNode = SchemaGraphNode | ObjectGraphNode;\n\n/**\n * Converts ECHO objects to a graph.\n */\nexport class SpaceGraphModel extends GraphModel<EchoGraphNode> {\n private readonly _graph: GraphData<EchoGraphNode> = {\n nodes: [],\n links: [],\n };\n\n private _schema?: EchoSchema[];\n private _schemaSubscription?: CleanupFn;\n private _objects?: ReactiveEchoObject<any>[];\n private _objectsSubscription?: CleanupFn;\n\n constructor(private readonly _options: SpaceGraphModelOptions = {}) {\n super();\n }\n\n override get graph(): GraphData<EchoGraphNode> {\n return this._graph;\n }\n\n get objects(): ReactiveEchoObject<any>[] {\n return this._objects ?? [];\n }\n\n // TODO(burdon): Alternative diagram types:\n // - https://observablehq.com/@d3/radial-tree/2\n // - https://observablehq.com/@d3/disjoint-force-directed-graph/2\n // - https://observablehq.com/@mbostock/tadpoles\n // - https://observablehq.com/@d3/psr-b1919-21\n // - https://vasturiano.github.io/react-force-graph/example/basic (3D)\n\n async open(space: Space, objectId?: string) {\n // TODO(burdon): Factor out graph builder to lib (use common/graph abstraction).\n if (!this._schemaSubscription) {\n // TODO(burdon): Normalize unsubscribe callbacks and merge handlers.\n // TODO(burdon): Trigger initial subscription update.\n // TODO(burdon): Normalize subscription cb for objects, schema, etc.\n\n const schemaaQuery = space.db.schemaRegistry.query({});\n const schemas = await schemaaQuery.run();\n const onSchemaUpdate = ({ results }: { results: EchoSchema[] }) => (this._schema = results);\n this._schemaSubscription = schemaaQuery.subscribe(onSchemaUpdate);\n onSchemaUpdate({ results: schemas });\n\n this._objectsSubscription = space.db\n // TODO(burdon): ERROR: Cannot mix type and or filters.\n .query(Filter.not(Filter.or(Filter.schema(StoredSchema), Filter.schema(CollectionType))))\n .subscribe(\n ({ objects }) => {\n this._objects = objects;\n\n // Merge with current nodes.\n const currentNodes = this._graph.nodes;\n\n this._graph.nodes = [];\n this._graph.links = [];\n\n const addSchema = (typename: string) => {\n const current = currentNodes.find((node) => node.id === typename);\n if (typename) {\n this._graph.nodes.push({\n ...current,\n id: typename,\n type: 'schema',\n data: { typename },\n });\n }\n };\n\n // Runtime schema.\n space.db.graph.schemaRegistry.schemas.forEach((schema) => {\n const typename = getSchemaDXN(schema)?.typename;\n if (typename) {\n addSchema(typename);\n }\n });\n\n // Database Schema.\n this._schema?.forEach((schema) => {\n const typename = getSchemaDXN(schema)?.typename;\n if (typename) {\n addSchema(typename);\n }\n });\n\n // Database Objects.\n this._objects.forEach((object) => {\n const schema = getSchema(object);\n if (schema) {\n const typename = getSchemaDXN(schema)?.typename;\n if (typename) {\n const current = currentNodes.find((node) => node.id === object.id);\n this._graph.nodes.push({ ...current, id: object.id, type: 'object', data: { typename, object } });\n\n // Link to schema.\n const schemaNode = this._graph.nodes.find(\n (node) => node.type === 'schema' && node.data.typename === typename,\n );\n if (schemaNode) {\n this._graph.links.push({\n id: `${object.id}-${schemaNode.id}`,\n source: object.id,\n target: schemaNode.id,\n });\n } else {\n log.info('schema node not found', { typename });\n }\n\n // Link ot refs.\n // TODO(burdon): This isn't working.\n AST.getPropertySignatures(schema.ast).forEach((prop) => {\n if (!SchemaValidator.hasTypeAnnotation(schema, prop.name.toString(), ReferenceAnnotationId)) {\n return;\n }\n\n const value = object[String(prop.name)];\n if (value) {\n const refs = Array.isArray(value) ? value : [value];\n for (const ref of refs) {\n if (objects.findIndex((obj) => obj.id === ref.id) !== -1) {\n this._graph.links.push({\n id: `${object.id}-${String(prop.name)}-${ref.id}`,\n source: object.id,\n target: ref.id,\n });\n }\n }\n }\n });\n }\n }\n });\n\n this.triggerUpdate();\n },\n { fire: true },\n );\n }\n\n this.setSelected(objectId);\n return this;\n }\n\n close() {\n this._schemaSubscription?.();\n this._schemaSubscription = undefined;\n this._objectsSubscription?.();\n this._objectsSubscription = undefined;\n\n return this;\n }\n}\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { forceLink, forceManyBody } from 'd3';\nimport ForceGraph from 'force-graph';\nimport React, { type FC, useEffect, useRef } from 'react';\nimport { useResizeDetector } from 'react-resize-detector';\n\nimport { type Space } from '@dxos/client/echo';\nimport { filterObjectsSync, type SearchResult } from '@dxos/plugin-search';\nimport { useAsyncState } from '@dxos/react-ui';\n\nimport { SpaceGraphModel } from './graph-model';\n\nexport type GraphProps = {\n space: Space;\n match?: RegExp;\n};\n\nexport const Graph: FC<GraphProps> = ({ space, match }) => {\n const { ref, width, height } = useResizeDetector({ refreshRate: 200 });\n const rootRef = useRef<HTMLDivElement>(null);\n const forceGraph = useRef<ForceGraph>();\n\n const [model] = useAsyncState(\n async () => (space ? new SpaceGraphModel({ schema: true }).open(space) : undefined),\n [space],\n );\n\n const filteredRef = useRef<SearchResult[]>();\n filteredRef.current = filterObjectsSync(model?.objects ?? [], match);\n\n useEffect(() => {\n if (rootRef.current) {\n // https://github.com/vasturiano/force-graph\n // https://github.com/vasturiano/3d-force-graph\n forceGraph.current = new ForceGraph(rootRef.current)\n .nodeRelSize(6)\n .nodeLabel((node: any) => {\n if (node.type === 'schema') {\n return node.data.typename;\n }\n\n return node.id;\n })\n .nodeAutoColorBy((node: any) => (node.type === 'schema' ? 'schema' : node.data.typename))\n .linkColor(() => 'rgba(255,255,255,0.25)');\n }\n\n return () => {\n forceGraph.current?.pauseAnimation().graphData({ nodes: [], links: [] });\n forceGraph.current = undefined;\n };\n }, []);\n\n useEffect(() => {\n if (forceGraph.current && width && height && model) {\n forceGraph.current\n .pauseAnimation()\n .width(width)\n .height(height)\n .onEngineStop(() => {\n handleZoomToFit();\n })\n\n // https://github.com/vasturiano/force-graph?tab=readme-ov-file#force-engine-d3-force-configuration\n // .d3Force('center', forceCenter().strength(0.9))\n .d3Force('link', forceLink().distance(160).strength(0.5))\n .d3Force('charge', forceManyBody().strength(-30))\n // .d3AlphaDecay(0.0228)\n // .d3VelocityDecay(0.4)\n\n .graphData(model.graph)\n .warmupTicks(100)\n .cooldownTime(1000)\n .resumeAnimation();\n }\n }, [model, width, height]);\n\n const handleZoomToFit = () => {\n forceGraph.current?.zoomToFit(400, 40);\n };\n\n return (\n <div ref={ref} className='relative grow' onClick={handleZoomToFit}>\n <div ref={rootRef} className='absolute inset-0' />\n </div>\n );\n};\n"],
|
|
5
|
-
"mappings": ";;;AAKA,SACEA,WACAC,cACAC,KAEAC,uBACAC,iBACAC,oBACK;AACP,SAAyBC,kBAAkB;AAC3C,SAASC,WAAW;AACpB,SAASC,sBAAsB;AAC/B,SAASC,cAAmD;;AAyBrD,IAAMC,kBAAN,cAA8BJ,WAAAA;EAWnCK,YAA6BC,WAAmC,CAAC,GAAG;AAClE,UAAK;SADsBA,WAAAA;SAVZC,SAAmC;MAClDC,OAAO,CAAA;MACPC,OAAO,CAAA;IACT;EASA;EAEA,IAAaC,QAAkC;AAC7C,WAAO,KAAKH;EACd;EAEA,IAAII,UAAqC;AACvC,WAAO,KAAKC,YAAY,CAAA;EAC1B;;;;;;;EASA,MAAMC,KAAKC,OAAcC,UAAmB;AAE1C,QAAI,CAAC,KAAKC,qBAAqB;AAK7B,YAAMC,eAAeH,MAAMI,GAAGC,eAAeC,MAAM,CAAC,CAAA;AACpD,YAAMC,UAAU,MAAMJ,aAAaK,IAAG;AACtC,YAAMC,iBAAiB,CAAC,EAAEC,QAAO,MAAmC,KAAKC,UAAUD;AACnF,WAAKR,sBAAsBC,aAAaS,UAAUH,cAAAA;AAClDA,qBAAe;QAAEC,SAASH;MAAQ,CAAA;AAElC,WAAKM,uBAAuBb,MAAMI,GAE/BE,MAAMjB,OAAOyB,IAAIzB,OAAO0B,GAAG1B,OAAO2B,OAAO/B,YAAAA,GAAeI,OAAO2B,OAAO5B,cAAAA,CAAAA,CAAAA,CAAAA,EACtEwB,UACC,CAAC,EAAEf,QAAO,MAAE;AACV,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,QAAQ,UAAUI,cAAAA,EAAgBD,SAAS,GAAC,CAAA,EAI5CR,UAAUtB,MAAMgC,KAAK,EACrBC,YAAY,GAAA,EACZC,aAAa,GAAA,EACbC,gBAAe;IACpB;EACF,GAAG;IAACnC;IAAOP;IAAOC;GAAO;AAEzB,QAAMgC,kBAAkB,MAAA;AACtB3B,eAAWQ,SAAS6B,UAAU,KAAK,EAAA;EACrC;AAEA,SACE,sBAAA,cAACC,OAAAA;IAAI7C;IAAU8C,WAAU;IAAgBC,SAASb;KAChD,sBAAA,cAACW,OAAAA;IAAI7C,KAAKK;IAASyC,WAAU;;AAGnC;",
|
|
6
|
-
"names": ["getSchema", "getSchemaDXN", "AST", "ReferenceAnnotationId", "SchemaValidator", "StoredSchema", "GraphModel", "log", "CollectionType", "Filter", "SpaceGraphModel", "constructor", "_options", "_graph", "nodes", "links", "graph", "objects", "_objects", "open", "space", "objectId", "_schemaSubscription", "schemaaQuery", "db", "schemaRegistry", "query", "schemas", "run", "onSchemaUpdate", "results", "_schema", "subscribe", "_objectsSubscription", "not", "or", "schema", "currentNodes", "addSchema", "typename", "current", "find", "node", "id", "push", "type", "data", "forEach", "object", "schemaNode", "source", "target", "info", "getPropertySignatures", "ast", "prop", "hasTypeAnnotation", "name", "toString", "value", "String", "refs", "Array", "isArray", "ref", "findIndex", "obj", "triggerUpdate", "fire", "setSelected", "close", "undefined", "forceLink", "forceManyBody", "ForceGraph", "React", "useEffect", "useRef", "useResizeDetector", "filterObjectsSync", "useAsyncState", "Graph", "space", "match", "ref", "width", "height", "useResizeDetector", "refreshRate", "rootRef", "useRef", "forceGraph", "model", "useAsyncState", "SpaceGraphModel", "schema", "open", "undefined", "filteredRef", "current", "filterObjectsSync", "objects", "useEffect", "ForceGraph", "nodeRelSize", "nodeLabel", "node", "type", "data", "typename", "id", "nodeAutoColorBy", "linkColor", "pauseAnimation", "graphData", "nodes", "links", "onEngineStop", "handleZoomToFit", "d3Force", "forceLink", "distance", "strength", "forceManyBody", "graph", "warmupTicks", "cooldownTime", "resumeAnimation", "zoomToFit", "div", "className", "onClick"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/intent-resolver.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { contributes, Capabilities, createResolver } from '@dxos/app-framework';\nimport { create } from '@dxos/live-object';\n\nimport { ExplorerAction, ViewType } from '../types';\n\nexport default () =>\n contributes(\n Capabilities.IntentResolver,\n createResolver({\n intent: ExplorerAction.Create,\n resolve: ({ name }) => ({\n data: { object: create(ViewType, { name, type: '' }) },\n }),\n }),\n );\n"],
|
|
5
|
-
"mappings": ";;;;;;;;AAIA,SAASA,aAAaC,cAAcC,sBAAsB;AAC1D,SAASC,cAAc;AAIvB,IAAA,0BAAe,MACbC,YACEC,aAAaC,gBACbC,eAAe;EACbC,QAAQC,eAAeC;EACvBC,SAAS,CAAC,EAAEC,KAAI,OAAQ;IACtBC,MAAM;MAAEC,QAAQC,OAAOC,UAAU;QAAEJ;QAAMK,MAAM;MAAG,CAAA;IAAG;EACvD;AACF,CAAA,CAAA;",
|
|
6
|
-
"names": ["contributes", "Capabilities", "createResolver", "create", "contributes", "Capabilities", "IntentResolver", "createResolver", "intent", "ExplorerAction", "Create", "resolve", "name", "data", "object", "create", "ViewType", "type"]
|
|
7
|
-
}
|
/package/dist/lib/browser/{ExplorerContainer-HL532ODG.mjs.map → ExplorerContainer-UJJIZBXP.mjs.map}
RENAMED
|
File without changes
|
|
File without changes
|
/package/dist/lib/node/{ExplorerContainer-73AHSBAG.cjs.map → ExplorerContainer-XJUAYKA6.cjs.map}
RENAMED
|
File without changes
|
|
File without changes
|
/package/dist/lib/node-esm/{ExplorerContainer-NMI55PYM.mjs.map → ExplorerContainer-5K4RALZR.mjs.map}
RENAMED
|
File without changes
|
/package/dist/lib/node-esm/{react-surface-J5SW7VF2.mjs.map → react-surface-6BTL55DB.mjs.map}
RENAMED
|
File without changes
|