@dxos/plugin-explorer 0.10.0 → 0.11.1
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/ExplorerPlugin.mjs +2 -0
- package/dist/lib/capabilities.mjs +9 -0
- package/dist/lib/capabilities.mjs.map +1 -0
- package/dist/lib/chunk-ExplorerArticle.mjs +90 -0
- package/dist/lib/chunk-ExplorerArticle.mjs.map +1 -0
- package/dist/lib/chunk-ExplorerPlugin.mjs +18 -0
- package/dist/lib/chunk-ExplorerPlugin.mjs.map +1 -0
- package/dist/lib/chunk-NeighborhoodCompanion.mjs +83 -0
- package/dist/lib/chunk-NeighborhoodCompanion.mjs.map +1 -0
- package/dist/lib/chunk-app-graph-builder.mjs +29 -0
- package/dist/lib/chunk-app-graph-builder.mjs.map +1 -0
- package/dist/lib/chunk-create-object.mjs +35 -0
- package/dist/lib/chunk-create-object.mjs.map +1 -0
- package/dist/lib/{neutral/chunk-C56B464A.mjs → chunk-meta.mjs} +20 -28
- package/dist/lib/chunk-meta.mjs.map +1 -0
- package/dist/lib/chunk-react-surface.mjs +29 -0
- package/dist/lib/chunk-react-surface.mjs.map +1 -0
- package/dist/lib/chunk-types.mjs +60 -0
- package/dist/lib/chunk-types.mjs.map +1 -0
- package/dist/lib/chunk-types2.mjs +231 -0
- package/dist/lib/chunk-types2.mjs.map +1 -0
- package/dist/lib/components.mjs +12314 -0
- package/dist/lib/components.mjs.map +1 -0
- package/dist/lib/containers.mjs +8 -0
- package/dist/lib/containers.mjs.map +1 -0
- package/dist/lib/hooks.mjs +101 -0
- package/dist/lib/hooks.mjs.map +1 -0
- package/dist/lib/index.mjs +3 -0
- package/dist/lib/meta.mjs +2 -0
- package/dist/lib/plugin.mjs +8 -0
- package/dist/lib/plugin.mjs.map +1 -0
- package/dist/lib/testing.mjs +118 -0
- package/dist/lib/testing.mjs.map +1 -0
- package/dist/lib/translations.mjs +29 -0
- package/dist/lib/translations.mjs.map +1 -0
- package/dist/lib/types.mjs +2 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/create-object.d.ts +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/components/Graph/CanvasForceGraph.d.ts +1 -1
- package/dist/types/src/components/Graph/CanvasForceGraph.d.ts.map +1 -1
- package/dist/types/src/components/Graph/CanvasForceGraph.stories.d.ts +1 -1
- package/dist/types/src/components/Graph/ForceGraph.d.ts +1 -1
- package/dist/types/src/components/Graph/ForceGraph.d.ts.map +1 -1
- package/dist/types/src/components/Graph/ForceGraph.stories.d.ts +1 -1
- package/dist/types/src/components/Visualization/Visualization.d.ts +1 -1
- package/dist/types/src/containers/ExplorerArticle/ExplorerArticle.d.ts +4 -1
- package/dist/types/src/containers/ExplorerArticle/ExplorerArticle.d.ts.map +1 -1
- package/dist/types/src/containers/ExplorerArticle/ExplorerArticle.stories.d.ts.map +1 -1
- package/dist/types/src/containers/NeighborhoodCompanion/NeighborhoodCompanion.d.ts +4 -5
- package/dist/types/src/containers/NeighborhoodCompanion/NeighborhoodCompanion.d.ts.map +1 -1
- package/dist/types/src/types/Graph.d.ts +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/dx.config.ts +1 -0
- package/package.json +49 -47
- package/src/capabilities/app-graph-builder.ts +1 -2
- package/src/capabilities/{react-surface.tsx → react-surface.ts} +4 -7
- package/src/components/Visualization/Visualization.stories.tsx +2 -2
- package/src/containers/ExplorerArticle/ExplorerArticle.stories.tsx +2 -1
- package/src/containers/ExplorerArticle/ExplorerArticle.tsx +5 -3
- package/src/containers/NeighborhoodCompanion/NeighborhoodCompanion.tsx +5 -3
- package/dist/lib/neutral/ExplorerArticle-2WPXYTXV.mjs +0 -101
- package/dist/lib/neutral/ExplorerArticle-2WPXYTXV.mjs.map +0 -7
- package/dist/lib/neutral/ExplorerPlugin.mjs +0 -10
- package/dist/lib/neutral/ExplorerPlugin.mjs.map +0 -7
- package/dist/lib/neutral/NeighborhoodCompanion-WC6E3YE6.mjs +0 -90
- package/dist/lib/neutral/NeighborhoodCompanion-WC6E3YE6.mjs.map +0 -7
- package/dist/lib/neutral/app-graph-builder-L2TJ6GNR.mjs +0 -37
- package/dist/lib/neutral/app-graph-builder-L2TJ6GNR.mjs.map +0 -7
- package/dist/lib/neutral/capabilities/index.mjs +0 -13
- package/dist/lib/neutral/capabilities/index.mjs.map +0 -7
- package/dist/lib/neutral/chunk-4F6AT7RA.mjs +0 -39
- package/dist/lib/neutral/chunk-4F6AT7RA.mjs.map +0 -7
- package/dist/lib/neutral/chunk-C56B464A.mjs.map +0 -7
- package/dist/lib/neutral/chunk-EZ52JY7X.mjs +0 -290
- package/dist/lib/neutral/chunk-EZ52JY7X.mjs.map +0 -7
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs +0 -10
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs.map +0 -7
- package/dist/lib/neutral/chunk-TTFPTHAQ.mjs +0 -69
- package/dist/lib/neutral/chunk-TTFPTHAQ.mjs.map +0 -7
- package/dist/lib/neutral/components/index.mjs +0 -11591
- package/dist/lib/neutral/components/index.mjs.map +0 -7
- package/dist/lib/neutral/containers/index.mjs +0 -11
- package/dist/lib/neutral/containers/index.mjs.map +0 -7
- package/dist/lib/neutral/create-object-WKIN3OB6.mjs +0 -38
- package/dist/lib/neutral/create-object-WKIN3OB6.mjs.map +0 -7
- package/dist/lib/neutral/hooks/index.mjs +0 -108
- package/dist/lib/neutral/hooks/index.mjs.map +0 -7
- package/dist/lib/neutral/index.mjs +0 -14
- package/dist/lib/neutral/index.mjs.map +0 -7
- package/dist/lib/neutral/meta.json +0 -1
- package/dist/lib/neutral/meta.mjs +0 -8
- package/dist/lib/neutral/meta.mjs.map +0 -7
- package/dist/lib/neutral/plugin.mjs +0 -12
- package/dist/lib/neutral/plugin.mjs.map +0 -7
- package/dist/lib/neutral/react-surface-EWPG5PUQ.mjs +0 -39
- package/dist/lib/neutral/react-surface-EWPG5PUQ.mjs.map +0 -7
- package/dist/lib/neutral/testing/index.mjs +0 -139
- package/dist/lib/neutral/testing/index.mjs.map +0 -7
- package/dist/lib/neutral/translations.mjs +0 -36
- package/dist/lib/neutral/translations.mjs.map +0 -7
- package/dist/lib/neutral/types/index.mjs +0 -10
- package/dist/lib/neutral/types/index.mjs.map +0 -7
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import "../chunk-J5LGTIGS.mjs";
|
|
2
|
-
|
|
3
|
-
// src/containers/index.ts
|
|
4
|
-
import { lazy } from "react";
|
|
5
|
-
var ExplorerArticle = lazy(() => import("../ExplorerArticle-2WPXYTXV.mjs"));
|
|
6
|
-
var NeighborhoodCompanion = lazy(() => import("../NeighborhoodCompanion-WC6E3YE6.mjs"));
|
|
7
|
-
export {
|
|
8
|
-
ExplorerArticle,
|
|
9
|
-
NeighborhoodCompanion
|
|
10
|
-
};
|
|
11
|
-
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../src/containers/index.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type ComponentType, lazy } from 'react';\n\nexport const ExplorerArticle: ComponentType<any> = lazy(() => import('./ExplorerArticle'));\nexport const NeighborhoodCompanion: ComponentType<any> = lazy(() => import('./NeighborhoodCompanion'));\n"],
|
|
5
|
-
"mappings": ";;;AAIA,SAA6BA,YAAY;AAElC,IAAMC,kBAAsCD,KAAK,MAAM,OAAO,iCAAA,CAAA;AAC9D,IAAME,wBAA4CF,KAAK,MAAM,OAAO,uCAAA,CAAA;",
|
|
6
|
-
"names": ["lazy", "ExplorerArticle", "NeighborhoodCompanion"]
|
|
7
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import "./chunk-J5LGTIGS.mjs";
|
|
2
|
-
|
|
3
|
-
// src/capabilities/create-object.ts
|
|
4
|
-
import * as Effect from "effect/Effect";
|
|
5
|
-
import { Capability } from "@dxos/app-framework";
|
|
6
|
-
import { Operation } from "@dxos/compute";
|
|
7
|
-
import { Type } from "@dxos/echo";
|
|
8
|
-
import { SpaceOperation } from "@dxos/plugin-space";
|
|
9
|
-
import { SpaceCapabilities } from "@dxos/plugin-space";
|
|
10
|
-
import { ViewModel } from "@dxos/schema";
|
|
11
|
-
import { ExplorerAction, Graph } from "#types";
|
|
12
|
-
var create_object_default = Capability.makeModule(Effect.fnUntraced(function* () {
|
|
13
|
-
return Capability.contributes(SpaceCapabilities.CreateObjectEntry, {
|
|
14
|
-
id: Type.getTypename(Graph.Graph),
|
|
15
|
-
inputSchema: ExplorerAction.GraphProps,
|
|
16
|
-
createObject: (props, options) => Effect.gen(function* () {
|
|
17
|
-
const object = yield* Effect.promise(async () => {
|
|
18
|
-
const view = props.typename ? (await ViewModel.makeFromDatabase({
|
|
19
|
-
db: options.db,
|
|
20
|
-
typename: props.typename
|
|
21
|
-
})).view : void 0;
|
|
22
|
-
return Graph.make({
|
|
23
|
-
name: props.name,
|
|
24
|
-
view
|
|
25
|
-
});
|
|
26
|
-
});
|
|
27
|
-
return yield* Operation.invoke(SpaceOperation.AddObject, {
|
|
28
|
-
object,
|
|
29
|
-
target: options.target,
|
|
30
|
-
targetNodeId: options.targetNodeId
|
|
31
|
-
});
|
|
32
|
-
})
|
|
33
|
-
});
|
|
34
|
-
}));
|
|
35
|
-
export {
|
|
36
|
-
create_object_default as default
|
|
37
|
-
};
|
|
38
|
-
//# sourceMappingURL=create-object-WKIN3OB6.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/create-object.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capability } from '@dxos/app-framework';\nimport { Operation } from '@dxos/compute';\nimport { Type } from '@dxos/echo';\nimport { SpaceOperation } from '@dxos/plugin-space';\nimport { SpaceCapabilities } from '@dxos/plugin-space';\nimport { ViewModel } from '@dxos/schema';\n\nimport { ExplorerAction, Graph } from '#types';\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n return Capability.contributes(SpaceCapabilities.CreateObjectEntry, {\n id: Type.getTypename(Graph.Graph),\n inputSchema: ExplorerAction.GraphProps,\n createObject: (props, options) =>\n Effect.gen(function* () {\n const object = yield* Effect.promise(async () => {\n const view = props.typename\n ? (await ViewModel.makeFromDatabase({ db: options.db, typename: props.typename })).view\n : undefined;\n return Graph.make({ name: props.name, view });\n });\n return yield* Operation.invoke(SpaceOperation.AddObject, {\n object,\n target: options.target,\n targetNodeId: options.targetNodeId,\n });\n }),\n });\n }),\n);\n"],
|
|
5
|
-
"mappings": ";;;AAIA,YAAYA,YAAY;AAExB,SAASC,kBAAkB;AAC3B,SAASC,iBAAiB;AAC1B,SAASC,YAAY;AACrB,SAASC,sBAAsB;AAC/B,SAASC,yBAAyB;AAClC,SAASC,iBAAiB;AAE1B,SAASC,gBAAgBC,aAAa;AAEtC,IAAA,wBAAeP,WAAWQ,WACjBC,kBAAW,aAAA;AAChB,SAAOT,WAAWU,YAAYN,kBAAkBO,mBAAmB;IACjEC,IAAIV,KAAKW,YAAYN,MAAMA,KAAK;IAChCO,aAAaR,eAAeS;IAC5BC,cAAc,CAACC,OAAOC,YACbC,WAAI,aAAA;AACT,YAAMC,SAAS,OAAcC,eAAQ,YAAA;AACnC,cAAMC,OAAOL,MAAMM,YACd,MAAMlB,UAAUmB,iBAAiB;UAAEC,IAAIP,QAAQO;UAAIF,UAAUN,MAAMM;QAAS,CAAA,GAAID,OACjFI;AACJ,eAAOnB,MAAMoB,KAAK;UAAEC,MAAMX,MAAMW;UAAMN;QAAK,CAAA;MAC7C,CAAA;AACA,aAAO,OAAOrB,UAAU4B,OAAO1B,eAAe2B,WAAW;QACvDV;QACAW,QAAQb,QAAQa;QAChBC,cAAcd,QAAQc;MACxB,CAAA;IACF,CAAA;EACJ,CAAA;AACF,CAAA,CAAA;",
|
|
6
|
-
"names": ["Effect", "Capability", "Operation", "Type", "SpaceOperation", "SpaceCapabilities", "ViewModel", "ExplorerAction", "Graph", "makeModule", "fnUntraced", "contributes", "CreateObjectEntry", "id", "getTypename", "inputSchema", "GraphProps", "createObject", "props", "options", "gen", "object", "promise", "view", "typename", "makeFromDatabase", "db", "undefined", "make", "name", "invoke", "AddObject", "target", "targetNodeId"]
|
|
7
|
-
}
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import "../chunk-J5LGTIGS.mjs";
|
|
2
|
-
|
|
3
|
-
// src/hooks/useGraphModel.ts
|
|
4
|
-
import { useEffect, useState } from "react";
|
|
5
|
-
import { Capabilities } from "@dxos/app-framework";
|
|
6
|
-
import { useCapability } from "@dxos/app-framework/ui";
|
|
7
|
-
import { SpaceGraphModel } from "@dxos/schema";
|
|
8
|
-
var useGraphModel = (db, filter, options, items) => {
|
|
9
|
-
const registry = useCapability(Capabilities.AtomRegistry);
|
|
10
|
-
const [model, setModel] = useState(void 0);
|
|
11
|
-
useEffect(() => {
|
|
12
|
-
if (!db) {
|
|
13
|
-
setModel(void 0);
|
|
14
|
-
return;
|
|
15
|
-
}
|
|
16
|
-
const newModel = new SpaceGraphModel(registry);
|
|
17
|
-
void newModel.open(db);
|
|
18
|
-
setModel(newModel);
|
|
19
|
-
return () => {
|
|
20
|
-
setModel(void 0);
|
|
21
|
-
void newModel.close();
|
|
22
|
-
};
|
|
23
|
-
}, [
|
|
24
|
-
db,
|
|
25
|
-
registry
|
|
26
|
-
]);
|
|
27
|
-
useEffect(() => {
|
|
28
|
-
model?.setFilter(filter).setOptions(options);
|
|
29
|
-
}, [
|
|
30
|
-
model,
|
|
31
|
-
filter,
|
|
32
|
-
options
|
|
33
|
-
]);
|
|
34
|
-
useEffect(() => {
|
|
35
|
-
model?.setItems(items);
|
|
36
|
-
}, [
|
|
37
|
-
model,
|
|
38
|
-
items
|
|
39
|
-
]);
|
|
40
|
-
return model;
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
// src/hooks/useNeighborhoodModel.ts
|
|
44
|
-
import { useEffect as useEffect2, useState as useState2 } from "react";
|
|
45
|
-
import { Obj } from "@dxos/echo";
|
|
46
|
-
var DEFAULT_NEIGHBORHOOD_DEPTH = 2;
|
|
47
|
-
var useNeighborhoodModel = (object, depth = DEFAULT_NEIGHBORHOOD_DEPTH) => {
|
|
48
|
-
const db = object ? Obj.getDatabase(object) : void 0;
|
|
49
|
-
const fullModel = useGraphModel(db);
|
|
50
|
-
const [model, setModel] = useState2(void 0);
|
|
51
|
-
useEffect2(() => {
|
|
52
|
-
if (!fullModel || !object) {
|
|
53
|
-
setModel(void 0);
|
|
54
|
-
return;
|
|
55
|
-
}
|
|
56
|
-
const recompute = () => setModel(buildNeighborhood(fullModel, object.id, depth));
|
|
57
|
-
recompute();
|
|
58
|
-
return fullModel.subscribe(recompute);
|
|
59
|
-
}, [
|
|
60
|
-
fullModel,
|
|
61
|
-
object?.id,
|
|
62
|
-
depth
|
|
63
|
-
]);
|
|
64
|
-
return model;
|
|
65
|
-
};
|
|
66
|
-
var buildNeighborhood = (fullModel, rootId, depth) => {
|
|
67
|
-
const { nodes, edges } = fullModel.graph;
|
|
68
|
-
const adjacency = /* @__PURE__ */ new Map();
|
|
69
|
-
const link = (from, to) => {
|
|
70
|
-
const list = adjacency.get(from) ?? [];
|
|
71
|
-
list.push(to);
|
|
72
|
-
adjacency.set(from, list);
|
|
73
|
-
};
|
|
74
|
-
for (const edge of edges) {
|
|
75
|
-
link(edge.source, edge.target);
|
|
76
|
-
link(edge.target, edge.source);
|
|
77
|
-
}
|
|
78
|
-
const included = /* @__PURE__ */ new Set([
|
|
79
|
-
rootId
|
|
80
|
-
]);
|
|
81
|
-
let frontier = [
|
|
82
|
-
rootId
|
|
83
|
-
];
|
|
84
|
-
for (let hop = 0; hop < depth && frontier.length; hop++) {
|
|
85
|
-
const next = [];
|
|
86
|
-
for (const id of frontier) {
|
|
87
|
-
for (const neighbour of adjacency.get(id) ?? []) {
|
|
88
|
-
if (!included.has(neighbour)) {
|
|
89
|
-
included.add(neighbour);
|
|
90
|
-
next.push(neighbour);
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
frontier = next;
|
|
95
|
-
}
|
|
96
|
-
const subNodes = nodes.filter((node) => included.has(node.id));
|
|
97
|
-
const subEdges = edges.filter((edge) => included.has(edge.source) && included.has(edge.target));
|
|
98
|
-
return fullModel.copy({
|
|
99
|
-
nodes: subNodes,
|
|
100
|
-
edges: subEdges
|
|
101
|
-
});
|
|
102
|
-
};
|
|
103
|
-
export {
|
|
104
|
-
DEFAULT_NEIGHBORHOOD_DEPTH,
|
|
105
|
-
useGraphModel,
|
|
106
|
-
useNeighborhoodModel
|
|
107
|
-
};
|
|
108
|
-
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../src/hooks/useGraphModel.ts", "../../../../src/hooks/useNeighborhoodModel.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { useEffect, useState } from 'react';\n\nimport { Capabilities } from '@dxos/app-framework';\nimport { useCapability } from '@dxos/app-framework/ui';\nimport { type Database, type Entity, type Filter } from '@dxos/echo';\nimport { SpaceGraphModel, type SpaceGraphModelOptions } from '@dxos/schema';\n\n// TODO(burdon): Factor out.\nexport const useGraphModel = (\n db: Database.Database | undefined,\n filter?: Filter.Any | undefined,\n options?: SpaceGraphModelOptions,\n items?: readonly Entity.Unknown[],\n): SpaceGraphModel | undefined => {\n const registry = useCapability(Capabilities.AtomRegistry);\n const [model, setModel] = useState<SpaceGraphModel | undefined>(undefined);\n\n useEffect(() => {\n if (!db) {\n setModel(undefined);\n return;\n }\n\n const newModel = new SpaceGraphModel(registry);\n void newModel.open(db);\n setModel(newModel);\n\n return () => {\n setModel(undefined);\n void newModel.close();\n };\n }, [db, registry]);\n\n useEffect(() => {\n model?.setFilter(filter).setOptions(options);\n }, [model, filter, options]);\n\n useEffect(() => {\n model?.setItems(items);\n }, [model, items]);\n\n return model;\n};\n", "//\n// Copyright 2026 DXOS.org\n//\n\nimport { useEffect, useState } from 'react';\n\nimport { Obj } from '@dxos/echo';\nimport { type SpaceGraphEdge, type SpaceGraphModel, type SpaceGraphNode } from '@dxos/schema';\n\nimport { useGraphModel } from './useGraphModel';\n\n/** Default traversal depth (hops) for the neighborhood graph. */\nexport const DEFAULT_NEIGHBORHOOD_DEPTH = 2;\n\n/**\n * Builds an ego graph around `object`: the n-hop neighbourhood reached by following refs and\n * relations from the active node. The full space graph is materialised (reactively) and then\n * narrowed to the nodes within `depth` hops, keeping only edges whose endpoints both survive.\n *\n * NOTE: Derives the subgraph from the whole-space model — the same cost the main explorer pays.\n * A direct ECHO traversal that loads only the reachable objects is a future optimisation.\n */\nexport const useNeighborhoodModel = (\n object: Obj.Unknown | undefined,\n depth = DEFAULT_NEIGHBORHOOD_DEPTH,\n): SpaceGraphModel | undefined => {\n const db = object ? Obj.getDatabase(object) : undefined;\n const fullModel = useGraphModel(db);\n const [model, setModel] = useState<SpaceGraphModel | undefined>(undefined);\n\n useEffect(() => {\n if (!fullModel || !object) {\n setModel(undefined);\n return;\n }\n\n const recompute = () => setModel(buildNeighborhood(fullModel, object.id, depth));\n recompute();\n return fullModel.subscribe(recompute);\n }, [fullModel, object?.id, depth]);\n\n return model;\n};\n\n/**\n * Narrow the full graph to the BFS neighbourhood of `rootId` within `depth` hops (edges treated as\n * undirected so the neighbourhood reads as graph distance regardless of ref/relation direction).\n */\nconst buildNeighborhood = (fullModel: SpaceGraphModel, rootId: string, depth: number): SpaceGraphModel => {\n const { nodes, edges } = fullModel.graph;\n\n const adjacency = new Map<string, string[]>();\n const link = (from: string, to: string) => {\n const list = adjacency.get(from) ?? [];\n list.push(to);\n adjacency.set(from, list);\n };\n for (const edge of edges) {\n link(edge.source, edge.target);\n link(edge.target, edge.source);\n }\n\n const included = new Set<string>([rootId]);\n let frontier = [rootId];\n for (let hop = 0; hop < depth && frontier.length; hop++) {\n const next: string[] = [];\n for (const id of frontier) {\n for (const neighbour of adjacency.get(id) ?? []) {\n if (!included.has(neighbour)) {\n included.add(neighbour);\n next.push(neighbour);\n }\n }\n }\n frontier = next;\n }\n\n const subNodes = nodes.filter((node: SpaceGraphNode) => included.has(node.id));\n const subEdges = edges.filter((edge: SpaceGraphEdge) => included.has(edge.source) && included.has(edge.target));\n return fullModel.copy({ nodes: subNodes, edges: subEdges });\n};\n"],
|
|
5
|
-
"mappings": "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",
|
|
6
|
-
"names": ["useEffect", "useState", "Capabilities", "useCapability", "SpaceGraphModel", "useGraphModel", "db", "filter", "options", "items", "registry", "AtomRegistry", "model", "setModel", "undefined", "newModel", "open", "close", "setFilter", "setOptions", "setItems", "useEffect", "useState", "Obj", "DEFAULT_NEIGHBORHOOD_DEPTH", "useNeighborhoodModel", "object", "depth", "db", "Obj", "getDatabase", "undefined", "fullModel", "useGraphModel", "model", "setModel", "useState", "useEffect", "recompute", "buildNeighborhood", "id", "subscribe", "rootId", "nodes", "edges", "graph", "adjacency", "Map", "link", "from", "to", "list", "get", "push", "set", "edge", "source", "target", "included", "Set", "frontier", "hop", "length", "next", "neighbour", "has", "add", "subNodes", "filter", "node", "subEdges", "copy"]
|
|
7
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ExplorerAction_exports,
|
|
3
|
-
Graph_exports
|
|
4
|
-
} from "./chunk-TTFPTHAQ.mjs";
|
|
5
|
-
import {
|
|
6
|
-
meta
|
|
7
|
-
} from "./chunk-C56B464A.mjs";
|
|
8
|
-
import "./chunk-J5LGTIGS.mjs";
|
|
9
|
-
export {
|
|
10
|
-
ExplorerAction_exports as ExplorerAction,
|
|
11
|
-
Graph_exports as Graph,
|
|
12
|
-
meta
|
|
13
|
-
};
|
|
14
|
-
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"inputs":{"dx.config.ts":{"bytes":5464,"imports":[{"path":"@dxos/app-framework/config","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"src/meta.ts":{"bytes":799,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"dx.config.ts","kind":"import-statement","original":"../dx.config"}],"format":"esm"},"src/types/ExplorerAction.ts":{"bytes":2116,"imports":[{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true}],"format":"esm"},"src/types/Graph.ts":{"bytes":4679,"imports":[{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo/Annotation","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true}],"format":"esm"},"src/types/index.ts":{"bytes":610,"imports":[{"path":"src/types/ExplorerAction.ts","kind":"import-statement","original":"./ExplorerAction"},{"path":"src/types/Graph.ts","kind":"import-statement","original":"./Graph"}],"format":"esm"},"src/index.ts":{"bytes":449,"imports":[{"path":"src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"raw-loader:/__w/dxos/dxos/packages/plugins/plugin-explorer/PLUGIN.mdl":{"bytes":10512,"imports":[]},"src/ExplorerPlugin.tsx":{"bytes":3941,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"#capabilities","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true},{"path":"#translations","kind":"import-statement","external":true},{"path":"#types","kind":"import-statement","external":true},{"path":"raw-loader:/__w/dxos/dxos/packages/plugins/plugin-explorer/PLUGIN.mdl","kind":"import-statement","original":"../PLUGIN.mdl?raw"}],"format":"esm"},"src/capabilities/app-graph-builder.ts":{"bytes":4868,"imports":[{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","kind":"import-statement","external":true},{"path":"@dxos/react-ui-attention","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true}],"format":"esm"},"src/capabilities/create-object.ts":{"bytes":4941,"imports":[{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/compute","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true},{"path":"#types","kind":"import-statement","external":true}],"format":"esm"},"src/capabilities/react-surface.tsx":{"bytes":5454,"imports":[{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-framework/ui","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit/ui","kind":"import-statement","external":true},{"path":"#containers","kind":"import-statement","external":true},{"path":"#types","kind":"import-statement","external":true}],"format":"esm"},"src/capabilities/index.ts":{"bytes":1492,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"src/capabilities/app-graph-builder.ts","kind":"dynamic-import","original":"./app-graph-builder"},{"path":"src/capabilities/create-object.ts","kind":"dynamic-import","original":"./create-object"},{"path":"src/capabilities/react-surface.tsx","kind":"dynamic-import","original":"./react-surface"}],"format":"esm"},"src/util/node-color.ts":{"bytes":2624,"imports":[{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true}],"format":"esm"},"src/util/plot.ts":{"bytes":1374,"imports":[],"format":"esm"},"src/util/index.ts":{"bytes":458,"imports":[{"path":"src/util/node-color.ts","kind":"import-statement","original":"./node-color"},{"path":"src/util/plot.ts","kind":"import-statement","original":"./plot"}],"format":"esm"},"src/components/Chart/Chart.tsx":{"bytes":4719,"imports":[{"path":"@observablehq/plot","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react-resize-detector","kind":"import-statement","external":true},{"path":"src/util/index.ts","kind":"import-statement","original":"../../util"}],"format":"esm"},"src/components/Chart/index.ts":{"bytes":369,"imports":[{"path":"src/components/Chart/Chart.tsx","kind":"import-statement","original":"./Chart"}],"format":"esm"},"data/countries-110m.js":{"bytes":187226,"imports":[],"format":"esm"},"src/components/Globe/Globe.tsx":{"bytes":7283,"imports":[{"path":"@observablehq/plot","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react-resize-detector","kind":"import-statement","external":true},{"path":"topojson-client","kind":"import-statement","external":true},{"path":"data/countries-110m.js","kind":"import-statement","original":"../../../data/countries-110m.js"},{"path":"src/util/index.ts","kind":"import-statement","original":"../../util"}],"format":"esm"},"src/components/Globe/index.ts":{"bytes":369,"imports":[{"path":"src/components/Globe/Globe.tsx","kind":"import-statement","original":"./Globe"}],"format":"esm"},"src/components/Graph/graph-adapter.ts":{"bytes":4073,"imports":[],"format":"esm"},"src/components/Graph/CanvasForceGraph.tsx":{"bytes":12816,"imports":[{"path":"d3","kind":"import-statement","external":true},{"path":"force-graph","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react-resize-detector","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"src/components/Graph/graph-adapter.ts","kind":"import-statement","original":"./graph-adapter"}],"format":"esm"},"src/components/Graph/ForceGraph.tsx":{"bytes":12153,"imports":[{"path":"@effect-atom/atom-react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/graph","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-graph","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"@dxos/react-ui-graph/styles/graph.css","kind":"import-statement","external":true}],"format":"esm"},"src/components/Graph/index.ts":{"bytes":490,"imports":[{"path":"src/components/Graph/CanvasForceGraph.tsx","kind":"import-statement","original":"./CanvasForceGraph"},{"path":"src/components/Graph/ForceGraph.tsx","kind":"import-statement","original":"./ForceGraph"}],"format":"esm"},"src/components/Lattice/Lattice.tsx":{"bytes":19089,"imports":[{"path":"d3","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-graph","kind":"import-statement","external":true},{"path":"src/util/node-color.ts","kind":"import-statement","original":"../../util/node-color"}],"format":"esm"},"src/components/Lattice/index.ts":{"bytes":375,"imports":[{"path":"src/components/Lattice/Lattice.tsx","kind":"import-statement","original":"./Lattice"}],"format":"esm"},"src/components/Tree/types/tree.ts":{"bytes":27746,"imports":[{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo/testing","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true}],"format":"esm"},"src/components/Tree/types/types.ts":{"bytes":3659,"imports":[],"format":"esm"},"src/components/Tree/types/index.ts":{"bytes":449,"imports":[{"path":"src/components/Tree/types/tree.ts","kind":"import-statement","original":"./tree"},{"path":"src/components/Tree/types/types.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"src/components/Tree/index.ts":{"bytes":852,"imports":[{"path":"src/components/Tree/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"src/components/Visualization/variants.ts":{"bytes":61137,"imports":[{"path":"d3","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-graph","kind":"import-statement","external":true},{"path":"src/util/index.ts","kind":"import-statement","original":"../../util"}],"format":"esm"},"src/components/Visualization/Visualization.tsx":{"bytes":21712,"imports":[{"path":"@radix-ui/react-context","kind":"import-statement","external":true},{"path":"@radix-ui/react-slot","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-graph","kind":"import-statement","external":true},{"path":"src/components/Visualization/variants.ts","kind":"import-statement","original":"./variants"}],"format":"esm"},"src/components/Visualization/index.ts":{"bytes":477,"imports":[{"path":"src/components/Visualization/Visualization.tsx","kind":"import-statement","original":"./Visualization"},{"path":"src/components/Visualization/variants.ts","kind":"import-statement","original":"./variants"}],"format":"esm"},"src/components/index.ts":{"bytes":799,"imports":[{"path":"src/components/Chart/index.ts","kind":"import-statement","original":"./Chart"},{"path":"src/components/Globe/index.ts","kind":"import-statement","original":"./Globe"},{"path":"src/components/Graph/index.ts","kind":"import-statement","original":"./Graph"},{"path":"src/components/Lattice/index.ts","kind":"import-statement","original":"./Lattice"},{"path":"src/components/Tree/index.ts","kind":"import-statement","original":"./Tree"},{"path":"src/components/Visualization/index.ts","kind":"import-statement","original":"./Visualization"}],"format":"esm"},"src/containers/ExplorerArticle/ExplorerArticle.tsx":{"bytes":13159,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit/ui","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-query","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-components","kind":"import-statement","external":true},{"path":"@dxos/react-ui-graph/styles/graph.css","kind":"import-statement","external":true},{"path":"#components","kind":"import-statement","external":true},{"path":"#hooks","kind":"import-statement","external":true}],"format":"esm"},"src/containers/ExplorerArticle/index.ts":{"bytes":524,"imports":[{"path":"src/containers/ExplorerArticle/ExplorerArticle.tsx","kind":"import-statement","original":"./ExplorerArticle"}],"format":"esm"},"src/containers/NeighborhoodCompanion/NeighborhoodCompanion.tsx":{"bytes":11695,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-graph/styles/graph.css","kind":"import-statement","external":true},{"path":"#components","kind":"import-statement","external":true},{"path":"#hooks","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true}],"format":"esm"},"src/containers/NeighborhoodCompanion/index.ts":{"bytes":560,"imports":[{"path":"src/containers/NeighborhoodCompanion/NeighborhoodCompanion.tsx","kind":"import-statement","original":"./NeighborhoodCompanion"}],"format":"esm"},"src/containers/index.ts":{"bytes":1046,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/containers/ExplorerArticle/index.ts","kind":"dynamic-import","original":"./ExplorerArticle"},{"path":"src/containers/NeighborhoodCompanion/index.ts","kind":"dynamic-import","original":"./NeighborhoodCompanion"}],"format":"esm"},"src/hooks/useGraphModel.ts":{"bytes":4086,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-framework/ui","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true}],"format":"esm"},"src/hooks/useNeighborhoodModel.ts":{"bytes":9467,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"src/hooks/useGraphModel.ts","kind":"import-statement","original":"./useGraphModel"}],"format":"esm"},"src/hooks/index.ts":{"bytes":509,"imports":[{"path":"src/hooks/useGraphModel.ts","kind":"import-statement","original":"./useGraphModel"},{"path":"src/hooks/useNeighborhoodModel.ts","kind":"import-statement","original":"./useNeighborhoodModel"}],"format":"esm"},"src/plugin.ts":{"bytes":865,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"#plugin","kind":"dynamic-import","external":true}],"format":"esm"},"src/testing/generator.ts":{"bytes":5095,"imports":[{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"src/components/Tree/types/index.ts","kind":"import-statement","original":"../components/Tree/types"}],"format":"esm"},"src/testing/relations.ts":{"bytes":12950,"imports":[{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/schema/testing","kind":"import-statement","external":true},{"path":"@dxos/types","kind":"import-statement","external":true}],"format":"esm"},"src/testing/index.ts":{"bytes":827,"imports":[{"path":"src/ExplorerPlugin.tsx","kind":"import-statement","original":"../ExplorerPlugin"},{"path":"src/testing/generator.ts","kind":"import-statement","original":"./generator"},{"path":"src/testing/relations.ts","kind":"import-statement","original":"./relations"}],"format":"esm"},"src/translations.ts":{"bytes":3697,"imports":[{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-components/translations","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true},{"path":"#types","kind":"import-statement","external":true}],"format":"esm"}},"outputs":{"dist/lib/neutral/testing/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":9423},"dist/lib/neutral/testing/index.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-4F6AT7RA.mjs","kind":"import-statement"},{"path":"dist/lib/neutral/chunk-EZ52JY7X.mjs","kind":"import-statement"},{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/schema/testing","kind":"import-statement","external":true},{"path":"@dxos/types","kind":"import-statement","external":true}],"exports":["ExplorerPlugin","buildOrgHierarchy","connectionsToEdges","createTree","generateConnectedOrgs"],"entryPoint":"src/testing/index.ts","inputs":{"src/testing/index.ts":{"bytesInOutput":0},"src/testing/generator.ts":{"bytesInOutput":1006},"src/testing/relations.ts":{"bytesInOutput":2485}},"bytes":3833},"dist/lib/neutral/translations.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1774},"dist/lib/neutral/translations.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-components/translations","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true},{"path":"#types","kind":"import-statement","external":true}],"exports":["translations"],"entryPoint":"src/translations.ts","inputs":{"src/translations.ts":{"bytesInOutput":990}},"bytes":1114},"dist/lib/neutral/types/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/neutral/types/index.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-TTFPTHAQ.mjs","kind":"import-statement"},{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"}],"exports":["ExplorerAction","Graph"],"entryPoint":"src/types/index.ts","inputs":{},"bytes":231},"dist/lib/neutral/app-graph-builder-L2TJ6GNR.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2385},"dist/lib/neutral/app-graph-builder-L2TJ6GNR.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","kind":"import-statement","external":true},{"path":"@dxos/react-ui-attention","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/capabilities/app-graph-builder.ts","inputs":{"src/capabilities/app-graph-builder.ts":{"bytesInOutput":1074}},"bytes":1254},"dist/lib/neutral/create-object-WKIN3OB6.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2506},"dist/lib/neutral/create-object-WKIN3OB6.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/compute","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true},{"path":"#types","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/capabilities/create-object.ts","inputs":{"src/capabilities/create-object.ts":{"bytesInOutput":1165}},"bytes":1333},"dist/lib/neutral/react-surface-EWPG5PUQ.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2713},"dist/lib/neutral/react-surface-EWPG5PUQ.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-framework/ui","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit/ui","kind":"import-statement","external":true},{"path":"#containers","kind":"import-statement","external":true},{"path":"#types","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/capabilities/react-surface.tsx","inputs":{"src/capabilities/react-surface.tsx":{"bytesInOutput":1399}},"bytes":1568},"dist/lib/neutral/ExplorerArticle-2WPXYTXV.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":7037},"dist/lib/neutral/ExplorerArticle-2WPXYTXV.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit/ui","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-query","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-components","kind":"import-statement","external":true},{"path":"@dxos/react-ui-graph/styles/graph.css","kind":"import-statement","external":true},{"path":"#components","kind":"import-statement","external":true},{"path":"#hooks","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/containers/ExplorerArticle/index.ts","inputs":{"src/containers/ExplorerArticle/ExplorerArticle.tsx":{"bytesInOutput":3046},"src/containers/ExplorerArticle/index.ts":{"bytesInOutput":0}},"bytes":3227},"dist/lib/neutral/NeighborhoodCompanion-WC6E3YE6.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":6245},"dist/lib/neutral/NeighborhoodCompanion-WC6E3YE6.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-graph/styles/graph.css","kind":"import-statement","external":true},{"path":"#components","kind":"import-statement","external":true},{"path":"#hooks","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/containers/NeighborhoodCompanion/index.ts","inputs":{"src/containers/NeighborhoodCompanion/NeighborhoodCompanion.tsx":{"bytesInOutput":2566},"src/containers/NeighborhoodCompanion/index.ts":{"bytesInOutput":0}},"bytes":2771},"dist/lib/neutral/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/neutral/index.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-TTFPTHAQ.mjs","kind":"import-statement"},{"path":"dist/lib/neutral/chunk-C56B464A.mjs","kind":"import-statement"},{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"}],"exports":["ExplorerAction","Graph","meta"],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":0}},"bytes":284},"dist/lib/neutral/chunk-TTFPTHAQ.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3473},"dist/lib/neutral/chunk-TTFPTHAQ.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo/Annotation","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true}],"exports":["ExplorerAction_exports","Graph_exports"],"inputs":{"src/types/ExplorerAction.ts":{"bytesInOutput":574},"src/types/index.ts":{"bytesInOutput":0},"src/types/Graph.ts":{"bytesInOutput":1074}},"bytes":1853},"dist/lib/neutral/ExplorerPlugin.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/neutral/ExplorerPlugin.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-4F6AT7RA.mjs","kind":"import-statement"},{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"}],"exports":["ExplorerPlugin","default"],"entryPoint":"src/ExplorerPlugin.tsx","inputs":{},"bytes":224},"dist/lib/neutral/chunk-4F6AT7RA.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":13451},"dist/lib/neutral/chunk-4F6AT7RA.mjs":{"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"#capabilities","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true},{"path":"#translations","kind":"import-statement","external":true},{"path":"#types","kind":"import-statement","external":true}],"exports":["ExplorerPlugin","ExplorerPlugin_default"],"inputs":{"src/ExplorerPlugin.tsx":{"bytesInOutput":854},"raw-loader:/__w/dxos/dxos/packages/plugins/plugin-explorer/PLUGIN.mdl":{"bytesInOutput":11240}},"bytes":12321},"dist/lib/neutral/capabilities/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":785},"dist/lib/neutral/capabilities/index.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"dist/lib/neutral/app-graph-builder-L2TJ6GNR.mjs","kind":"dynamic-import"},{"path":"dist/lib/neutral/create-object-WKIN3OB6.mjs","kind":"dynamic-import"},{"path":"dist/lib/neutral/react-surface-EWPG5PUQ.mjs","kind":"dynamic-import"}],"exports":["AppGraphBuilder","CreateObject","ReactSurface"],"entryPoint":"src/capabilities/index.ts","inputs":{"src/capabilities/index.ts":{"bytesInOutput":357}},"bytes":516},"dist/lib/neutral/components/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":521040},"dist/lib/neutral/components/index.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-EZ52JY7X.mjs","kind":"import-statement"},{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"@observablehq/plot","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react-resize-detector","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"@observablehq/plot","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react-resize-detector","kind":"import-statement","external":true},{"path":"topojson-client","kind":"import-statement","external":true},{"path":"d3","kind":"import-statement","external":true},{"path":"force-graph","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react-resize-detector","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@effect-atom/atom-react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/graph","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-graph","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"@dxos/react-ui-graph/styles/graph.css","kind":"import-statement","external":true},{"path":"d3","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-graph","kind":"import-statement","external":true},{"path":"@radix-ui/react-context","kind":"import-statement","external":true},{"path":"@radix-ui/react-slot","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-graph","kind":"import-statement","external":true},{"path":"d3","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-graph","kind":"import-statement","external":true}],"exports":["CanvasForceGraph","Chart","ForceGraph","Globe","Lattice","Tree","TreeNodeType","TreeType","VARIANTS","Visualization","getVariant","isVariant","treeTypeToTreeNode"],"entryPoint":"src/components/index.ts","inputs":{"src/components/Chart/Chart.tsx":{"bytesInOutput":1031},"src/util/node-color.ts":{"bytesInOutput":292},"src/util/index.ts":{"bytesInOutput":0},"src/util/plot.ts":{"bytesInOutput":133},"src/components/Chart/index.ts":{"bytesInOutput":0},"src/components/index.ts":{"bytesInOutput":0},"src/components/Globe/Globe.tsx":{"bytesInOutput":1707},"data/countries-110m.js":{"bytesInOutput":188376},"src/components/Globe/index.ts":{"bytesInOutput":0},"src/components/Graph/CanvasForceGraph.tsx":{"bytesInOutput":2568},"src/components/Graph/graph-adapter.ts":{"bytesInOutput":619},"src/components/Graph/index.ts":{"bytesInOutput":0},"src/components/Graph/ForceGraph.tsx":{"bytesInOutput":2797},"src/components/Lattice/Lattice.tsx":{"bytesInOutput":3708},"src/components/Lattice/index.ts":{"bytesInOutput":0},"src/components/Tree/index.ts":{"bytesInOutput":0},"src/components/Visualization/Visualization.tsx":{"bytesInOutput":3761},"src/components/Visualization/variants.ts":{"bytesInOutput":12501},"src/components/Visualization/index.ts":{"bytesInOutput":0}},"bytes":218421},"dist/lib/neutral/chunk-EZ52JY7X.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":14834},"dist/lib/neutral/chunk-EZ52JY7X.mjs":{"imports":[{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo/testing","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true}],"exports":["Tree","TreeNodeType","TreeType","treeTypeToTreeNode"],"inputs":{"src/components/Tree/types/tree.ts":{"bytesInOutput":6689},"src/components/Tree/types/types.ts":{"bytesInOutput":609},"src/components/Tree/types/index.ts":{"bytesInOutput":0}},"bytes":7488},"dist/lib/neutral/containers/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":583},"dist/lib/neutral/containers/index.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"dist/lib/neutral/ExplorerArticle-2WPXYTXV.mjs","kind":"dynamic-import"},{"path":"dist/lib/neutral/NeighborhoodCompanion-WC6E3YE6.mjs","kind":"dynamic-import"}],"exports":["ExplorerArticle","NeighborhoodCompanion"],"entryPoint":"src/containers/index.ts","inputs":{"src/containers/index.ts":{"bytesInOutput":196}},"bytes":346},"dist/lib/neutral/hooks/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":7217},"dist/lib/neutral/hooks/index.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-framework/ui","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true}],"exports":["DEFAULT_NEIGHBORHOOD_DEPTH","useGraphModel","useNeighborhoodModel"],"entryPoint":"src/hooks/index.ts","inputs":{"src/hooks/useGraphModel.ts":{"bytesInOutput":877},"src/hooks/index.ts":{"bytesInOutput":0},"src/hooks/useNeighborhoodModel.ts":{"bytesInOutput":1727}},"bytes":2822},"dist/lib/neutral/meta.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/neutral/meta.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-C56B464A.mjs","kind":"import-statement"},{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"}],"exports":["meta"],"entryPoint":"src/meta.ts","inputs":{},"bytes":131},"dist/lib/neutral/plugin.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":446},"dist/lib/neutral/plugin.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-C56B464A.mjs","kind":"import-statement"},{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"#plugin","kind":"dynamic-import","external":true}],"exports":["ExplorerPlugin"],"entryPoint":"src/plugin.ts","inputs":{"src/plugin.ts":{"bytesInOutput":111}},"bytes":272},"dist/lib/neutral/chunk-C56B464A.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2811},"dist/lib/neutral/chunk-C56B464A.mjs":{"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-framework/config","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"exports":["meta"],"inputs":{"src/meta.ts":{"bytesInOutput":102},"dx.config.ts":{"bytesInOutput":1957}},"bytes":2171},"dist/lib/neutral/chunk-J5LGTIGS.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/neutral/chunk-J5LGTIGS.mjs":{"imports":[],"exports":["__export"],"inputs":{},"bytes":235}}}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
meta
|
|
3
|
-
} from "./chunk-C56B464A.mjs";
|
|
4
|
-
import "./chunk-J5LGTIGS.mjs";
|
|
5
|
-
|
|
6
|
-
// src/plugin.ts
|
|
7
|
-
import { Plugin } from "@dxos/app-framework";
|
|
8
|
-
var ExplorerPlugin = Plugin.lazy(meta, () => import("#plugin"));
|
|
9
|
-
export {
|
|
10
|
-
ExplorerPlugin
|
|
11
|
-
};
|
|
12
|
-
//# sourceMappingURL=plugin.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/plugin.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Plugin } from '@dxos/app-framework';\n\nimport { meta } from './meta';\n\nexport const ExplorerPlugin = Plugin.lazy(meta, () => import('#plugin'));\n"],
|
|
5
|
-
"mappings": ";;;;;;AAIA,SAASA,cAAc;AAIhB,IAAMC,iBAAiBC,OAAOC,KAAKC,MAAM,MAAM,OAAO,SAAA,CAAA;",
|
|
6
|
-
"names": ["Plugin", "ExplorerPlugin", "Plugin", "lazy", "meta"]
|
|
7
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import "./chunk-J5LGTIGS.mjs";
|
|
2
|
-
|
|
3
|
-
// src/capabilities/react-surface.tsx
|
|
4
|
-
import * as Effect from "effect/Effect";
|
|
5
|
-
import React from "react";
|
|
6
|
-
import { Capabilities, Capability } from "@dxos/app-framework";
|
|
7
|
-
import { Surface } from "@dxos/app-framework/ui";
|
|
8
|
-
import { AppSurface } from "@dxos/app-toolkit/ui";
|
|
9
|
-
import { ExplorerArticle, NeighborhoodCompanion } from "#containers";
|
|
10
|
-
import { Graph } from "#types";
|
|
11
|
-
var react_surface_default = Capability.makeModule(() => Effect.succeed(Capability.contributes(Capabilities.ReactSurface, [
|
|
12
|
-
Surface.create({
|
|
13
|
-
id: "article",
|
|
14
|
-
// TODO(wittjosiah): Split into multiple surfaces if this filter proves too strict for non-article roles.
|
|
15
|
-
filter: AppSurface.oneOf(AppSurface.object(AppSurface.Article, Graph.Graph), AppSurface.object(AppSurface.Section, Graph.Graph)),
|
|
16
|
-
component: ({ data, role }) => {
|
|
17
|
-
return /* @__PURE__ */ React.createElement(ExplorerArticle, {
|
|
18
|
-
role,
|
|
19
|
-
subject: data.subject,
|
|
20
|
-
attendableId: data.attendableId
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
}),
|
|
24
|
-
// Neighborhood companion offered on any ECHO object; `companionTo` is the active node.
|
|
25
|
-
Surface.create({
|
|
26
|
-
id: "neighborhood",
|
|
27
|
-
filter: AppSurface.allOf(AppSurface.literal(AppSurface.Article, "neighborhood"), AppSurface.companion(AppSurface.Article)),
|
|
28
|
-
component: ({ data, role }) => {
|
|
29
|
-
return /* @__PURE__ */ React.createElement(NeighborhoodCompanion, {
|
|
30
|
-
role,
|
|
31
|
-
subject: data.companionTo
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
})
|
|
35
|
-
])));
|
|
36
|
-
export {
|
|
37
|
-
react_surface_default as default
|
|
38
|
-
};
|
|
39
|
-
//# sourceMappingURL=react-surface-EWPG5PUQ.mjs.map
|
|
@@ -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 * as Effect from 'effect/Effect';\nimport React from 'react';\n\nimport { Capabilities, Capability } from '@dxos/app-framework';\nimport { Surface } from '@dxos/app-framework/ui';\nimport { AppSurface } from '@dxos/app-toolkit/ui';\n\nimport { ExplorerArticle, NeighborhoodCompanion } from '#containers';\nimport { Graph } from '#types';\n\nexport default Capability.makeModule(() =>\n Effect.succeed(\n Capability.contributes(Capabilities.ReactSurface, [\n Surface.create({\n id: 'article',\n // TODO(wittjosiah): Split into multiple surfaces if this filter proves too strict for non-article roles.\n filter: AppSurface.oneOf(\n AppSurface.object(AppSurface.Article, Graph.Graph),\n AppSurface.object(AppSurface.Section, Graph.Graph),\n ),\n component: ({ data, role }) => {\n return <ExplorerArticle role={role} subject={data.subject} attendableId={data.attendableId} />;\n },\n }),\n // Neighborhood companion offered on any ECHO object; `companionTo` is the active node.\n Surface.create({\n id: 'neighborhood',\n filter: AppSurface.allOf(\n AppSurface.literal(AppSurface.Article, 'neighborhood'),\n AppSurface.companion(AppSurface.Article),\n ),\n component: ({ data, role }) => {\n return <NeighborhoodCompanion role={role} subject={data.companionTo} />;\n },\n }),\n ]),\n ),\n);\n"],
|
|
5
|
-
"mappings": ";;;AAIA,YAAYA,YAAY;AACxB,OAAOC,WAAW;AAElB,SAASC,cAAcC,kBAAkB;AACzC,SAASC,eAAe;AACxB,SAASC,kBAAkB;AAE3B,SAASC,iBAAiBC,6BAA6B;AACvD,SAASC,aAAa;AAEtB,IAAA,wBAAeL,WAAWM,WAAW,MAC5BC,eACLP,WAAWQ,YAAYT,aAAaU,cAAc;EAChDR,QAAQS,OAAO;IACbC,IAAI;;IAEJC,QAAQV,WAAWW,MACjBX,WAAWY,OAAOZ,WAAWa,SAASV,MAAMA,KAAK,GACjDH,WAAWY,OAAOZ,WAAWc,SAASX,MAAMA,KAAK,CAAA;IAEnDY,WAAW,CAAC,EAAEC,MAAMC,KAAI,MAAE;AACxB,aAAO,sBAAA,cAAChB,iBAAAA;QAAgBgB;QAAYC,SAASF,KAAKE;QAASC,cAAcH,KAAKG;;IAChF;EACF,CAAA;;EAEApB,QAAQS,OAAO;IACbC,IAAI;IACJC,QAAQV,WAAWoB,MACjBpB,WAAWqB,QAAQrB,WAAWa,SAAS,cAAA,GACvCb,WAAWsB,UAAUtB,WAAWa,OAAO,CAAA;IAEzCE,WAAW,CAAC,EAAEC,MAAMC,KAAI,MAAE;AACxB,aAAO,sBAAA,cAACf,uBAAAA;QAAsBe;QAAYC,SAASF,KAAKO;;IAC1D;EACF,CAAA;CACD,CAAA,CAAA;",
|
|
6
|
-
"names": ["Effect", "React", "Capabilities", "Capability", "Surface", "AppSurface", "ExplorerArticle", "NeighborhoodCompanion", "Graph", "makeModule", "succeed", "contributes", "ReactSurface", "create", "id", "filter", "oneOf", "object", "Article", "Section", "component", "data", "role", "subject", "attendableId", "allOf", "literal", "companion", "companionTo"]
|
|
7
|
-
}
|
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ExplorerPlugin
|
|
3
|
-
} from "../chunk-4F6AT7RA.mjs";
|
|
4
|
-
import {
|
|
5
|
-
Tree
|
|
6
|
-
} from "../chunk-EZ52JY7X.mjs";
|
|
7
|
-
import "../chunk-J5LGTIGS.mjs";
|
|
8
|
-
|
|
9
|
-
// src/testing/generator.ts
|
|
10
|
-
import { Key, Obj } from "@dxos/echo";
|
|
11
|
-
import { range } from "@dxos/util";
|
|
12
|
-
var random = (min, max) => Math.floor(Math.random() * (max - min + 1)) + min;
|
|
13
|
-
var createTree = (spec = [], createText) => {
|
|
14
|
-
const tree = new Tree();
|
|
15
|
-
Obj.update(tree.tree, () => {
|
|
16
|
-
tree.root.data = {
|
|
17
|
-
text: "root"
|
|
18
|
-
};
|
|
19
|
-
});
|
|
20
|
-
const createNodes = (parent, spec2 = 0) => {
|
|
21
|
-
const count = Array.isArray(spec2) ? random(spec2[0], spec2[1]) : spec2;
|
|
22
|
-
return range(count, (i) => ({
|
|
23
|
-
id: Key.EntityId.random(),
|
|
24
|
-
children: [],
|
|
25
|
-
data: {
|
|
26
|
-
text: createText?.() ?? [
|
|
27
|
-
parent.data.text,
|
|
28
|
-
i + 1
|
|
29
|
-
].join(".")
|
|
30
|
-
}
|
|
31
|
-
}));
|
|
32
|
-
};
|
|
33
|
-
const createChildNodes = (parent, [count = 0, ...rest]) => {
|
|
34
|
-
const nodes = createNodes(parent, count);
|
|
35
|
-
nodes.forEach((n) => tree.addNode(parent, n));
|
|
36
|
-
if (rest.length) {
|
|
37
|
-
for (const node of nodes) {
|
|
38
|
-
createChildNodes(node, rest);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
return parent;
|
|
42
|
-
};
|
|
43
|
-
createChildNodes(tree.root, spec);
|
|
44
|
-
return tree;
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
// src/testing/relations.ts
|
|
48
|
-
import { Query, Relation } from "@dxos/echo";
|
|
49
|
-
import { createObjectFactory, createRelationFactory } from "@dxos/schema/testing";
|
|
50
|
-
import { HasConnection, Organization, Person } from "@dxos/types";
|
|
51
|
-
var SECTORS = [
|
|
52
|
-
"Technology",
|
|
53
|
-
"Finance",
|
|
54
|
-
"Research",
|
|
55
|
-
"Media"
|
|
56
|
-
];
|
|
57
|
-
var CONNECTION_KINDS = [
|
|
58
|
-
"partner",
|
|
59
|
-
"investor",
|
|
60
|
-
"vendor",
|
|
61
|
-
"customer"
|
|
62
|
-
];
|
|
63
|
-
var generateConnectedOrgs = async (space, generator, { organizationCount = 12, personCount = 24, connectionCount = 18 } = {}) => {
|
|
64
|
-
const specs = [
|
|
65
|
-
{
|
|
66
|
-
type: Organization.Organization,
|
|
67
|
-
count: organizationCount
|
|
68
|
-
},
|
|
69
|
-
// Person has a Ref to Organization — generator fills it from objects already in db.
|
|
70
|
-
{
|
|
71
|
-
type: Person.Person,
|
|
72
|
-
count: personCount
|
|
73
|
-
}
|
|
74
|
-
];
|
|
75
|
-
await createObjectFactory(space.db, generator)(specs);
|
|
76
|
-
const relationSpecs = CONNECTION_KINDS.map((kind, index) => ({
|
|
77
|
-
type: HasConnection.HasConnection,
|
|
78
|
-
count: Math.floor(connectionCount / CONNECTION_KINDS.length) + (index < connectionCount % CONNECTION_KINDS.length ? 1 : 0),
|
|
79
|
-
data: {
|
|
80
|
-
kind
|
|
81
|
-
}
|
|
82
|
-
}));
|
|
83
|
-
const connections = await createRelationFactory(space.db, generator)(relationSpecs);
|
|
84
|
-
const organizations = await space.db.query(Query.type(Organization.Organization)).run();
|
|
85
|
-
const people = await space.db.query(Query.type(Person.Person)).run();
|
|
86
|
-
return {
|
|
87
|
-
organizations,
|
|
88
|
-
people,
|
|
89
|
-
connections
|
|
90
|
-
};
|
|
91
|
-
};
|
|
92
|
-
var buildOrgHierarchy = (organizations, sectors = SECTORS) => {
|
|
93
|
-
const activeSectors = sectors.length > 0 ? sectors : [
|
|
94
|
-
"Uncategorized"
|
|
95
|
-
];
|
|
96
|
-
const buckets = /* @__PURE__ */ new Map();
|
|
97
|
-
for (const sector of activeSectors) {
|
|
98
|
-
buckets.set(sector, []);
|
|
99
|
-
}
|
|
100
|
-
for (let i = 0; i < organizations.length; i++) {
|
|
101
|
-
const org = organizations[i];
|
|
102
|
-
const sector = activeSectors[i % activeSectors.length];
|
|
103
|
-
buckets.get(sector).push({
|
|
104
|
-
id: org.id,
|
|
105
|
-
label: org.name ?? org.id.slice(0, 6)
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
return {
|
|
109
|
-
id: "root",
|
|
110
|
-
label: "Organizations",
|
|
111
|
-
children: activeSectors.map((sector) => ({
|
|
112
|
-
id: `sector:${sector}`,
|
|
113
|
-
label: sector,
|
|
114
|
-
children: buckets.get(sector) ?? []
|
|
115
|
-
}))
|
|
116
|
-
};
|
|
117
|
-
};
|
|
118
|
-
var connectionsToEdges = (connections) => {
|
|
119
|
-
return connections.map((relation) => {
|
|
120
|
-
const source = Relation.getSource(relation);
|
|
121
|
-
const target = Relation.getTarget(relation);
|
|
122
|
-
if (!source?.id || !target?.id) {
|
|
123
|
-
return void 0;
|
|
124
|
-
}
|
|
125
|
-
return {
|
|
126
|
-
source: source.id,
|
|
127
|
-
target: target.id,
|
|
128
|
-
kind: relation.kind
|
|
129
|
-
};
|
|
130
|
-
}).filter((e) => Boolean(e));
|
|
131
|
-
};
|
|
132
|
-
export {
|
|
133
|
-
ExplorerPlugin,
|
|
134
|
-
buildOrgHierarchy,
|
|
135
|
-
connectionsToEdges,
|
|
136
|
-
createTree,
|
|
137
|
-
generateConnectedOrgs
|
|
138
|
-
};
|
|
139
|
-
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../src/testing/generator.ts", "../../../../src/testing/relations.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Key, Obj } from '@dxos/echo';\nimport { range } from '@dxos/util';\n\nimport { Tree, type TreeNodeType } from '../components/Tree/types';\n\ntype NumberOrNumberArray = number | number[];\n\nconst random = (min: number, max: number) => Math.floor(Math.random() * (max - min + 1)) + min;\n\n/**\n * Create hierarchical tree.\n */\nexport const createTree = (spec: NumberOrNumberArray[] = [], createText?: () => string): Tree => {\n const tree = new Tree();\n Obj.update(tree.tree, () => {\n tree.root.data = { text: 'root' };\n });\n\n const createNodes = (parent: TreeNodeType, spec: NumberOrNumberArray = 0): TreeNodeType[] => {\n const count = Array.isArray(spec) ? random(spec[0], spec[1]) : spec;\n return range(count, (i) => ({\n id: Key.EntityId.random(),\n children: [],\n data: {\n text: createText?.() ?? [parent.data.text, i + 1].join('.'),\n },\n }));\n };\n\n const createChildNodes = (parent: TreeNodeType, [count = 0, ...rest]: NumberOrNumberArray[]): TreeNodeType => {\n const nodes = createNodes(parent, count);\n nodes.forEach((n) => tree.addNode(parent, n));\n if (rest.length) {\n for (const node of nodes) {\n createChildNodes(node, rest);\n }\n }\n\n return parent;\n };\n\n createChildNodes(tree.root, spec);\n return tree;\n};\n", "//\n// Copyright 2026 DXOS.org\n//\n\nimport { type Space } from '@dxos/client/echo';\nimport { Obj, Query, Relation } from '@dxos/echo';\nimport { type BundleEdge, type TreeNode } from '@dxos/react-ui-graph';\nimport {\n type RelationSpec,\n type TypeSpec,\n type ValueGenerator,\n createObjectFactory,\n createRelationFactory,\n} from '@dxos/schema/testing';\nimport { HasConnection, Organization, Person } from '@dxos/types';\n\nconst SECTORS = ['Technology', 'Finance', 'Research', 'Media'];\nconst CONNECTION_KINDS = ['partner', 'investor', 'vendor', 'customer'];\n\nexport type ConnectedOrgsResult = {\n organizations: Obj.Any[];\n people: Obj.Any[];\n connections: Obj.Any[];\n};\n\nexport type ConnectedOrgsOptions = {\n organizationCount?: number;\n personCount?: number;\n connectionCount?: number;\n};\n\n/**\n * Populate a space with Organizations, People, and HasConnection relations between organizations.\n * Uses `createObjectFactory` to generate Org/Person properties from their `GeneratorAnnotation`s,\n * then `createRelationFactory` to wire HasConnection relations (Org→Org) between them, spreading\n * the connections across the available kinds.\n */\nexport const generateConnectedOrgs = async (\n space: Space,\n generator: ValueGenerator,\n { organizationCount = 12, personCount = 24, connectionCount = 18 }: ConnectedOrgsOptions = {},\n): Promise<ConnectedOrgsResult> => {\n const specs: TypeSpec[] = [\n { type: Organization.Organization, count: organizationCount },\n // Person has a Ref to Organization — generator fills it from objects already in db.\n { type: Person.Person, count: personCount },\n ];\n\n await createObjectFactory(space.db, generator)(specs);\n\n // Distribute the requested connections evenly across the connection kinds.\n const relationSpecs: RelationSpec[] = CONNECTION_KINDS.map((kind, index) => ({\n type: HasConnection.HasConnection,\n count:\n Math.floor(connectionCount / CONNECTION_KINDS.length) +\n (index < connectionCount % CONNECTION_KINDS.length ? 1 : 0),\n data: { kind },\n }));\n const connections = await createRelationFactory(space.db, generator)(relationSpecs);\n\n const organizations = await space.db.query(Query.type(Organization.Organization)).run();\n const people = await space.db.query(Query.type(Person.Person)).run();\n return { organizations, people, connections };\n};\n\n/**\n * Build a TreeNode hierarchy: Root → Sector → Organization (leaf).\n * Organizations are deterministically bucketed into `SECTORS` so the demo has visible groups.\n */\nexport const buildOrgHierarchy = (organizations: Obj.Any[], sectors: readonly string[] = SECTORS): TreeNode => {\n // Avoid modulo-by-zero / missing-bucket crashes when the caller passes an empty sectors list.\n const activeSectors = sectors.length > 0 ? sectors : ['Uncategorized'];\n const buckets = new Map<string, TreeNode[]>();\n for (const sector of activeSectors) {\n buckets.set(sector, []);\n }\n for (let i = 0; i < organizations.length; i++) {\n const org = organizations[i] as any;\n const sector = activeSectors[i % activeSectors.length];\n buckets.get(sector)!.push({\n id: org.id,\n label: org.name ?? org.id.slice(0, 6),\n });\n }\n\n return {\n id: 'root',\n label: 'Organizations',\n children: activeSectors.map((sector) => ({\n id: `sector:${sector}`,\n label: sector,\n children: buckets.get(sector) ?? [],\n })),\n };\n};\n\n/**\n * Convert HasConnection relations into bundle edges between organization ids.\n */\nexport const connectionsToEdges = (connections: Obj.Any[]): BundleEdge[] => {\n return connections\n .map((relation): BundleEdge | undefined => {\n const source = Relation.getSource(relation as any) as any;\n const target = Relation.getTarget(relation as any) as any;\n if (!source?.id || !target?.id) {\n return undefined;\n }\n return {\n source: source.id,\n target: target.id,\n kind: (relation as any).kind,\n };\n })\n .filter((e): e is BundleEdge => Boolean(e));\n};\n"],
|
|
5
|
-
"mappings": "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",
|
|
6
|
-
"names": ["Key", "Obj", "range", "random", "min", "max", "Math", "floor", "createTree", "spec", "createText", "tree", "Tree", "Obj", "update", "root", "data", "text", "createNodes", "parent", "count", "Array", "isArray", "range", "i", "id", "Key", "EntityId", "children", "join", "createChildNodes", "rest", "nodes", "forEach", "n", "addNode", "length", "node", "Query", "Relation", "createObjectFactory", "createRelationFactory", "HasConnection", "Organization", "Person", "SECTORS", "CONNECTION_KINDS", "generateConnectedOrgs", "space", "generator", "organizationCount", "personCount", "connectionCount", "specs", "type", "count", "db", "relationSpecs", "map", "kind", "index", "Math", "floor", "length", "data", "connections", "organizations", "query", "run", "people", "buildOrgHierarchy", "sectors", "activeSectors", "buckets", "Map", "sector", "set", "i", "org", "get", "push", "id", "label", "name", "slice", "children", "connectionsToEdges", "relation", "source", "getSource", "target", "getTarget", "undefined", "filter", "e", "Boolean"]
|
|
7
|
-
}
|