@dxos/plugin-explorer 0.10.0 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. package/dist/lib/ExplorerPlugin.mjs +2 -0
  2. package/dist/lib/capabilities.mjs +9 -0
  3. package/dist/lib/capabilities.mjs.map +1 -0
  4. package/dist/lib/chunk-ExplorerArticle.mjs +90 -0
  5. package/dist/lib/chunk-ExplorerArticle.mjs.map +1 -0
  6. package/dist/lib/chunk-ExplorerPlugin.mjs +18 -0
  7. package/dist/lib/chunk-ExplorerPlugin.mjs.map +1 -0
  8. package/dist/lib/chunk-NeighborhoodCompanion.mjs +83 -0
  9. package/dist/lib/chunk-NeighborhoodCompanion.mjs.map +1 -0
  10. package/dist/lib/chunk-app-graph-builder.mjs +29 -0
  11. package/dist/lib/chunk-app-graph-builder.mjs.map +1 -0
  12. package/dist/lib/chunk-create-object.mjs +35 -0
  13. package/dist/lib/chunk-create-object.mjs.map +1 -0
  14. package/dist/lib/{neutral/chunk-C56B464A.mjs → chunk-meta.mjs} +20 -28
  15. package/dist/lib/chunk-meta.mjs.map +1 -0
  16. package/dist/lib/chunk-react-surface.mjs +29 -0
  17. package/dist/lib/chunk-react-surface.mjs.map +1 -0
  18. package/dist/lib/chunk-types.mjs +60 -0
  19. package/dist/lib/chunk-types.mjs.map +1 -0
  20. package/dist/lib/chunk-types2.mjs +231 -0
  21. package/dist/lib/chunk-types2.mjs.map +1 -0
  22. package/dist/lib/components.mjs +12314 -0
  23. package/dist/lib/components.mjs.map +1 -0
  24. package/dist/lib/containers.mjs +8 -0
  25. package/dist/lib/containers.mjs.map +1 -0
  26. package/dist/lib/hooks.mjs +101 -0
  27. package/dist/lib/hooks.mjs.map +1 -0
  28. package/dist/lib/index.mjs +3 -0
  29. package/dist/lib/meta.mjs +2 -0
  30. package/dist/lib/plugin.mjs +8 -0
  31. package/dist/lib/plugin.mjs.map +1 -0
  32. package/dist/lib/testing.mjs +118 -0
  33. package/dist/lib/testing.mjs.map +1 -0
  34. package/dist/lib/translations.mjs +29 -0
  35. package/dist/lib/translations.mjs.map +1 -0
  36. package/dist/lib/types.mjs +2 -0
  37. package/dist/types/src/capabilities/app-graph-builder.d.ts +1 -1
  38. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
  39. package/dist/types/src/capabilities/create-object.d.ts +1 -1
  40. package/dist/types/src/capabilities/react-surface.d.ts +1 -1
  41. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
  42. package/dist/types/src/components/Graph/CanvasForceGraph.d.ts +1 -1
  43. package/dist/types/src/components/Graph/CanvasForceGraph.d.ts.map +1 -1
  44. package/dist/types/src/components/Graph/CanvasForceGraph.stories.d.ts +1 -1
  45. package/dist/types/src/components/Graph/ForceGraph.d.ts +1 -1
  46. package/dist/types/src/components/Graph/ForceGraph.d.ts.map +1 -1
  47. package/dist/types/src/components/Graph/ForceGraph.stories.d.ts +1 -1
  48. package/dist/types/src/components/Visualization/Visualization.d.ts +1 -1
  49. package/dist/types/src/containers/ExplorerArticle/ExplorerArticle.d.ts +4 -1
  50. package/dist/types/src/containers/ExplorerArticle/ExplorerArticle.d.ts.map +1 -1
  51. package/dist/types/src/containers/ExplorerArticle/ExplorerArticle.stories.d.ts.map +1 -1
  52. package/dist/types/src/containers/NeighborhoodCompanion/NeighborhoodCompanion.d.ts +4 -5
  53. package/dist/types/src/containers/NeighborhoodCompanion/NeighborhoodCompanion.d.ts.map +1 -1
  54. package/dist/types/src/types/Graph.d.ts +1 -1
  55. package/dist/types/tsconfig.tsbuildinfo +1 -1
  56. package/dx.config.ts +1 -0
  57. package/package.json +49 -47
  58. package/src/capabilities/app-graph-builder.ts +1 -2
  59. package/src/capabilities/{react-surface.tsx → react-surface.ts} +4 -7
  60. package/src/components/Visualization/Visualization.stories.tsx +2 -2
  61. package/src/containers/ExplorerArticle/ExplorerArticle.stories.tsx +2 -1
  62. package/src/containers/ExplorerArticle/ExplorerArticle.tsx +5 -3
  63. package/src/containers/NeighborhoodCompanion/NeighborhoodCompanion.tsx +5 -3
  64. package/dist/lib/neutral/ExplorerArticle-2WPXYTXV.mjs +0 -101
  65. package/dist/lib/neutral/ExplorerArticle-2WPXYTXV.mjs.map +0 -7
  66. package/dist/lib/neutral/ExplorerPlugin.mjs +0 -10
  67. package/dist/lib/neutral/ExplorerPlugin.mjs.map +0 -7
  68. package/dist/lib/neutral/NeighborhoodCompanion-WC6E3YE6.mjs +0 -90
  69. package/dist/lib/neutral/NeighborhoodCompanion-WC6E3YE6.mjs.map +0 -7
  70. package/dist/lib/neutral/app-graph-builder-L2TJ6GNR.mjs +0 -37
  71. package/dist/lib/neutral/app-graph-builder-L2TJ6GNR.mjs.map +0 -7
  72. package/dist/lib/neutral/capabilities/index.mjs +0 -13
  73. package/dist/lib/neutral/capabilities/index.mjs.map +0 -7
  74. package/dist/lib/neutral/chunk-4F6AT7RA.mjs +0 -39
  75. package/dist/lib/neutral/chunk-4F6AT7RA.mjs.map +0 -7
  76. package/dist/lib/neutral/chunk-C56B464A.mjs.map +0 -7
  77. package/dist/lib/neutral/chunk-EZ52JY7X.mjs +0 -290
  78. package/dist/lib/neutral/chunk-EZ52JY7X.mjs.map +0 -7
  79. package/dist/lib/neutral/chunk-J5LGTIGS.mjs +0 -10
  80. package/dist/lib/neutral/chunk-J5LGTIGS.mjs.map +0 -7
  81. package/dist/lib/neutral/chunk-TTFPTHAQ.mjs +0 -69
  82. package/dist/lib/neutral/chunk-TTFPTHAQ.mjs.map +0 -7
  83. package/dist/lib/neutral/components/index.mjs +0 -11591
  84. package/dist/lib/neutral/components/index.mjs.map +0 -7
  85. package/dist/lib/neutral/containers/index.mjs +0 -11
  86. package/dist/lib/neutral/containers/index.mjs.map +0 -7
  87. package/dist/lib/neutral/create-object-WKIN3OB6.mjs +0 -38
  88. package/dist/lib/neutral/create-object-WKIN3OB6.mjs.map +0 -7
  89. package/dist/lib/neutral/hooks/index.mjs +0 -108
  90. package/dist/lib/neutral/hooks/index.mjs.map +0 -7
  91. package/dist/lib/neutral/index.mjs +0 -14
  92. package/dist/lib/neutral/index.mjs.map +0 -7
  93. package/dist/lib/neutral/meta.json +0 -1
  94. package/dist/lib/neutral/meta.mjs +0 -8
  95. package/dist/lib/neutral/meta.mjs.map +0 -7
  96. package/dist/lib/neutral/plugin.mjs +0 -12
  97. package/dist/lib/neutral/plugin.mjs.map +0 -7
  98. package/dist/lib/neutral/react-surface-EWPG5PUQ.mjs +0 -39
  99. package/dist/lib/neutral/react-surface-EWPG5PUQ.mjs.map +0 -7
  100. package/dist/lib/neutral/testing/index.mjs +0 -139
  101. package/dist/lib/neutral/testing/index.mjs.map +0 -7
  102. package/dist/lib/neutral/translations.mjs +0 -36
  103. package/dist/lib/neutral/translations.mjs.map +0 -7
  104. package/dist/lib/neutral/types/index.mjs +0 -10
  105. package/dist/lib/neutral/types/index.mjs.map +0 -7
@@ -0,0 +1,8 @@
1
+ import { lazy } from "react";
2
+ //#region src/containers/index.ts
3
+ var ExplorerArticle = lazy(() => import("./chunk-ExplorerArticle.mjs"));
4
+ var NeighborhoodCompanion = lazy(() => import("./chunk-NeighborhoodCompanion.mjs"));
5
+ //#endregion
6
+ export { ExplorerArticle, NeighborhoodCompanion };
7
+
8
+ //# sourceMappingURL=containers.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"containers.mjs","names":[],"sources":["../../src/containers/index.ts"],"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"],"mappings":";;AAMA,IAAa,kBAAsC,WAAW,OAAO,8BAAoB;AACzF,IAAa,wBAA4C,WAAW,OAAO,oCAA0B"}
@@ -0,0 +1,101 @@
1
+ import { Capabilities } from "@dxos/app-framework";
2
+ import { Obj } from "@dxos/echo";
3
+ import { SpaceGraphModel } from "@dxos/schema";
4
+ import { useEffect, useState } from "react";
5
+ import { useCapability } from "@dxos/app-framework/ui";
6
+ //#region src/hooks/useGraphModel.ts
7
+ var useGraphModel = (db, filter, options, items) => {
8
+ const registry = useCapability(Capabilities.AtomRegistry);
9
+ const [model, setModel] = useState(void 0);
10
+ useEffect(() => {
11
+ if (!db) {
12
+ setModel(void 0);
13
+ return;
14
+ }
15
+ const newModel = new SpaceGraphModel(registry);
16
+ newModel.open(db);
17
+ setModel(newModel);
18
+ return () => {
19
+ setModel(void 0);
20
+ newModel.close();
21
+ };
22
+ }, [db, registry]);
23
+ useEffect(() => {
24
+ model?.setFilter(filter).setOptions(options);
25
+ }, [
26
+ model,
27
+ filter,
28
+ options
29
+ ]);
30
+ useEffect(() => {
31
+ model?.setItems(items);
32
+ }, [model, items]);
33
+ return model;
34
+ };
35
+ //#endregion
36
+ //#region src/hooks/useNeighborhoodModel.ts
37
+ /** Default traversal depth (hops) for the neighborhood graph. */
38
+ var DEFAULT_NEIGHBORHOOD_DEPTH = 2;
39
+ /**
40
+ * Builds an ego graph around `object`: the n-hop neighbourhood reached by following refs and
41
+ * relations from the active node. The full space graph is materialised (reactively) and then
42
+ * narrowed to the nodes within `depth` hops, keeping only edges whose endpoints both survive.
43
+ *
44
+ * NOTE: Derives the subgraph from the whole-space model — the same cost the main explorer pays.
45
+ * A direct ECHO traversal that loads only the reachable objects is a future optimisation.
46
+ */
47
+ var useNeighborhoodModel = (object, depth = 2) => {
48
+ const fullModel = useGraphModel(object ? Obj.getDatabase(object) : void 0);
49
+ const [model, setModel] = useState(void 0);
50
+ useEffect(() => {
51
+ if (!fullModel || !object) {
52
+ setModel(void 0);
53
+ return;
54
+ }
55
+ const recompute = () => setModel(buildNeighborhood(fullModel, object.id, depth));
56
+ recompute();
57
+ return fullModel.subscribe(recompute);
58
+ }, [
59
+ fullModel,
60
+ object?.id,
61
+ depth
62
+ ]);
63
+ return model;
64
+ };
65
+ /**
66
+ * Narrow the full graph to the BFS neighbourhood of `rootId` within `depth` hops (edges treated as
67
+ * undirected so the neighbourhood reads as graph distance regardless of ref/relation direction).
68
+ */
69
+ var buildNeighborhood = (fullModel, rootId, depth) => {
70
+ const { nodes, edges } = fullModel.graph;
71
+ const adjacency = /* @__PURE__ */ new Map();
72
+ const link = (from, to) => {
73
+ const list = adjacency.get(from) ?? [];
74
+ list.push(to);
75
+ adjacency.set(from, list);
76
+ };
77
+ for (const edge of edges) {
78
+ link(edge.source, edge.target);
79
+ link(edge.target, edge.source);
80
+ }
81
+ const included = /* @__PURE__ */ new Set([rootId]);
82
+ let frontier = [rootId];
83
+ for (let hop = 0; hop < depth && frontier.length; hop++) {
84
+ const next = [];
85
+ for (const id of frontier) for (const neighbour of adjacency.get(id) ?? []) if (!included.has(neighbour)) {
86
+ included.add(neighbour);
87
+ next.push(neighbour);
88
+ }
89
+ frontier = next;
90
+ }
91
+ const subNodes = nodes.filter((node) => included.has(node.id));
92
+ const subEdges = edges.filter((edge) => included.has(edge.source) && included.has(edge.target));
93
+ return fullModel.copy({
94
+ nodes: subNodes,
95
+ edges: subEdges
96
+ });
97
+ };
98
+ //#endregion
99
+ export { DEFAULT_NEIGHBORHOOD_DEPTH, useGraphModel, useNeighborhoodModel };
100
+
101
+ //# sourceMappingURL=hooks.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hooks.mjs","names":[],"sources":["../../src/hooks/useGraphModel.ts","../../src/hooks/useNeighborhoodModel.ts"],"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"],"mappings":";;;;;;AAYA,IAAa,iBACX,IACA,QACA,SACA,UACgC;CAChC,MAAM,WAAW,cAAc,aAAa,YAAY;CACxD,MAAM,CAAC,OAAO,YAAY,SAAsC,KAAA,CAAS;CAEzE,gBAAgB;EACd,IAAI,CAAC,IAAI;GACP,SAAS,KAAA,CAAS;GAClB;EACF;EAEA,MAAM,WAAW,IAAI,gBAAgB,QAAQ;EAC7C,SAAc,KAAK,EAAE;EACrB,SAAS,QAAQ;EAEjB,aAAa;GACX,SAAS,KAAA,CAAS;GAClB,SAAc,MAAM;EACtB;CACF,GAAG,CAAC,IAAI,QAAQ,CAAC;CAEjB,gBAAgB;EACd,OAAO,UAAU,MAAM,CAAC,CAAC,WAAW,OAAO;CAC7C,GAAG;EAAC;EAAO;EAAQ;CAAO,CAAC;CAE3B,gBAAgB;EACd,OAAO,SAAS,KAAK;CACvB,GAAG,CAAC,OAAO,KAAK,CAAC;CAEjB,OAAO;AACT;;;;AClCA,IAAa,6BAA6B;;;;;;;;;AAU1C,IAAa,wBACX,QACA,QAAA,MACgC;CAEhC,MAAM,YAAY,cADP,SAAS,IAAI,YAAY,MAAM,IAAI,KAAA,CACZ;CAClC,MAAM,CAAC,OAAO,YAAY,SAAsC,KAAA,CAAS;CAEzE,gBAAgB;EACd,IAAI,CAAC,aAAa,CAAC,QAAQ;GACzB,SAAS,KAAA,CAAS;GAClB;EACF;EAEA,MAAM,kBAAkB,SAAS,kBAAkB,WAAW,OAAO,IAAI,KAAK,CAAC;EAC/E,UAAU;EACV,OAAO,UAAU,UAAU,SAAS;CACtC,GAAG;EAAC;EAAW,QAAQ;EAAI;CAAK,CAAC;CAEjC,OAAO;AACT;;;;;AAMA,IAAM,qBAAqB,WAA4B,QAAgB,UAAmC;CACxG,MAAM,EAAE,OAAO,UAAU,UAAU;CAEnC,MAAM,4BAAY,IAAI,IAAsB;CAC5C,MAAM,QAAQ,MAAc,OAAe;EACzC,MAAM,OAAO,UAAU,IAAI,IAAI,KAAK,CAAC;EACrC,KAAK,KAAK,EAAE;EACZ,UAAU,IAAI,MAAM,IAAI;CAC1B;CACA,KAAK,MAAM,QAAQ,OAAO;EACxB,KAAK,KAAK,QAAQ,KAAK,MAAM;EAC7B,KAAK,KAAK,QAAQ,KAAK,MAAM;CAC/B;CAEA,MAAM,2BAAW,IAAI,IAAY,CAAC,MAAM,CAAC;CACzC,IAAI,WAAW,CAAC,MAAM;CACtB,KAAK,IAAI,MAAM,GAAG,MAAM,SAAS,SAAS,QAAQ,OAAO;EACvD,MAAM,OAAiB,CAAC;EACxB,KAAK,MAAM,MAAM,UACf,KAAK,MAAM,aAAa,UAAU,IAAI,EAAE,KAAK,CAAC,GAC5C,IAAI,CAAC,SAAS,IAAI,SAAS,GAAG;GAC5B,SAAS,IAAI,SAAS;GACtB,KAAK,KAAK,SAAS;EACrB;EAGJ,WAAW;CACb;CAEA,MAAM,WAAW,MAAM,QAAQ,SAAyB,SAAS,IAAI,KAAK,EAAE,CAAC;CAC7E,MAAM,WAAW,MAAM,QAAQ,SAAyB,SAAS,IAAI,KAAK,MAAM,KAAK,SAAS,IAAI,KAAK,MAAM,CAAC;CAC9G,OAAO,UAAU,KAAK;EAAE,OAAO;EAAU,OAAO;CAAS,CAAC;AAC5D"}
@@ -0,0 +1,3 @@
1
+ import { n as ExplorerAction_exports, t as Graph_exports } from "./chunk-types.mjs";
2
+ import { t as meta } from "./chunk-meta.mjs";
3
+ export { ExplorerAction_exports as ExplorerAction, Graph_exports as Graph, meta };
@@ -0,0 +1,2 @@
1
+ import { t as meta } from "./chunk-meta.mjs";
2
+ export { meta };
@@ -0,0 +1,8 @@
1
+ import { t as meta } from "./chunk-meta.mjs";
2
+ import { Plugin } from "@dxos/app-framework";
3
+ //#region src/plugin.ts
4
+ var ExplorerPlugin = Plugin.lazy(meta, () => import("#plugin"));
5
+ //#endregion
6
+ export { ExplorerPlugin };
7
+
8
+ //# sourceMappingURL=plugin.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.mjs","names":[],"sources":["../../src/plugin.ts"],"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"],"mappings":";;;AAQA,IAAa,iBAAiB,OAAO,KAAK,YAAY,OAAO,UAAU"}
@@ -0,0 +1,118 @@
1
+ import { t as ExplorerPlugin } from "./chunk-ExplorerPlugin.mjs";
2
+ import { t as Tree } from "./chunk-types2.mjs";
3
+ import { range } from "@dxos/util";
4
+ import { Key, Obj, Query, Relation } from "@dxos/echo";
5
+ import { createObjectFactory, createRelationFactory } from "@dxos/schema/testing";
6
+ import { HasConnection, Organization, Person } from "@dxos/types";
7
+ //#region src/testing/generator.ts
8
+ var random = (min, max) => Math.floor(Math.random() * (max - min + 1)) + min;
9
+ /**
10
+ * Create hierarchical tree.
11
+ */
12
+ var createTree = (spec = [], createText) => {
13
+ const tree = new Tree();
14
+ Obj.update(tree.tree, () => {
15
+ tree.root.data = { text: "root" };
16
+ });
17
+ const createNodes = (parent, spec = 0) => {
18
+ return range(Array.isArray(spec) ? random(spec[0], spec[1]) : spec, (i) => ({
19
+ id: Key.EntityId.random(),
20
+ children: [],
21
+ data: { text: createText?.() ?? [parent.data.text, i + 1].join(".") }
22
+ }));
23
+ };
24
+ const createChildNodes = (parent, [count = 0, ...rest]) => {
25
+ const nodes = createNodes(parent, count);
26
+ nodes.forEach((n) => tree.addNode(parent, n));
27
+ if (rest.length) for (const node of nodes) createChildNodes(node, rest);
28
+ return parent;
29
+ };
30
+ createChildNodes(tree.root, spec);
31
+ return tree;
32
+ };
33
+ //#endregion
34
+ //#region src/testing/relations.ts
35
+ var SECTORS = [
36
+ "Technology",
37
+ "Finance",
38
+ "Research",
39
+ "Media"
40
+ ];
41
+ var CONNECTION_KINDS = [
42
+ "partner",
43
+ "investor",
44
+ "vendor",
45
+ "customer"
46
+ ];
47
+ /**
48
+ * Populate a space with Organizations, People, and HasConnection relations between organizations.
49
+ * Uses `createObjectFactory` to generate Org/Person properties from their `GeneratorAnnotation`s,
50
+ * then `createRelationFactory` to wire HasConnection relations (Org→Org) between them, spreading
51
+ * the connections across the available kinds.
52
+ */
53
+ var generateConnectedOrgs = async (space, generator, { organizationCount = 12, personCount = 24, connectionCount = 18 } = {}) => {
54
+ const specs = [{
55
+ type: Organization.Organization,
56
+ count: organizationCount
57
+ }, {
58
+ type: Person.Person,
59
+ count: personCount
60
+ }];
61
+ await createObjectFactory(space.db, generator)(specs);
62
+ const relationSpecs = CONNECTION_KINDS.map((kind, index) => ({
63
+ type: HasConnection.HasConnection,
64
+ count: Math.floor(connectionCount / CONNECTION_KINDS.length) + (index < connectionCount % CONNECTION_KINDS.length ? 1 : 0),
65
+ data: { kind }
66
+ }));
67
+ const connections = await createRelationFactory(space.db, generator)(relationSpecs);
68
+ return {
69
+ organizations: await space.db.query(Query.type(Organization.Organization)).run(),
70
+ people: await space.db.query(Query.type(Person.Person)).run(),
71
+ connections
72
+ };
73
+ };
74
+ /**
75
+ * Build a TreeNode hierarchy: Root → Sector → Organization (leaf).
76
+ * Organizations are deterministically bucketed into `SECTORS` so the demo has visible groups.
77
+ */
78
+ var buildOrgHierarchy = (organizations, sectors = SECTORS) => {
79
+ const activeSectors = sectors.length > 0 ? sectors : ["Uncategorized"];
80
+ const buckets = /* @__PURE__ */ new Map();
81
+ for (const sector of activeSectors) buckets.set(sector, []);
82
+ for (let i = 0; i < organizations.length; i++) {
83
+ const org = organizations[i];
84
+ const sector = activeSectors[i % activeSectors.length];
85
+ buckets.get(sector).push({
86
+ id: org.id,
87
+ label: org.name ?? org.id.slice(0, 6)
88
+ });
89
+ }
90
+ return {
91
+ id: "root",
92
+ label: "Organizations",
93
+ children: activeSectors.map((sector) => ({
94
+ id: `sector:${sector}`,
95
+ label: sector,
96
+ children: buckets.get(sector) ?? []
97
+ }))
98
+ };
99
+ };
100
+ /**
101
+ * Convert HasConnection relations into bundle edges between organization ids.
102
+ */
103
+ var connectionsToEdges = (connections) => {
104
+ return connections.map((relation) => {
105
+ const source = Relation.getSource(relation);
106
+ const target = Relation.getTarget(relation);
107
+ if (!source?.id || !target?.id) return;
108
+ return {
109
+ source: source.id,
110
+ target: target.id,
111
+ kind: relation.kind
112
+ };
113
+ }).filter((e) => Boolean(e));
114
+ };
115
+ //#endregion
116
+ export { ExplorerPlugin, buildOrgHierarchy, connectionsToEdges, createTree, generateConnectedOrgs };
117
+
118
+ //# sourceMappingURL=testing.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"testing.mjs","names":[],"sources":["../../src/testing/generator.ts","../../src/testing/relations.ts"],"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"],"mappings":";;;;;;;AAWA,IAAM,UAAU,KAAa,QAAgB,KAAK,MAAM,KAAK,OAAO,KAAK,MAAM,MAAM,EAAE,IAAI;;;;AAK3F,IAAa,cAAc,OAA8B,CAAC,GAAG,eAAoC;CAC/F,MAAM,OAAO,IAAI,KAAK;CACtB,IAAI,OAAO,KAAK,YAAY;EAC1B,KAAK,KAAK,OAAO,EAAE,MAAM,OAAO;CAClC,CAAC;CAED,MAAM,eAAe,QAAsB,OAA4B,MAAsB;EAE3F,OAAO,MADO,MAAM,QAAQ,IAAI,IAAI,OAAO,KAAK,IAAI,KAAK,EAAE,IAAI,OAC1C,OAAO;GAC1B,IAAI,IAAI,SAAS,OAAO;GACxB,UAAU,CAAC;GACX,MAAM,EACJ,MAAM,aAAa,KAAK,CAAC,OAAO,KAAK,MAAM,IAAI,CAAC,CAAC,CAAC,KAAK,GAAG,EAC5D;EACF,EAAE;CACJ;CAEA,MAAM,oBAAoB,QAAsB,CAAC,QAAQ,GAAG,GAAG,UAA+C;EAC5G,MAAM,QAAQ,YAAY,QAAQ,KAAK;EACvC,MAAM,SAAS,MAAM,KAAK,QAAQ,QAAQ,CAAC,CAAC;EAC5C,IAAI,KAAK,QACP,KAAK,MAAM,QAAQ,OACjB,iBAAiB,MAAM,IAAI;EAI/B,OAAO;CACT;CAEA,iBAAiB,KAAK,MAAM,IAAI;CAChC,OAAO;AACT;;;AC/BA,IAAM,UAAU;CAAC;CAAc;CAAW;CAAY;AAAO;AAC7D,IAAM,mBAAmB;CAAC;CAAW;CAAY;CAAU;AAAU;;;;;;;AAoBrE,IAAa,wBAAwB,OACnC,OACA,WACA,EAAE,oBAAoB,IAAI,cAAc,IAAI,kBAAkB,OAA6B,CAAC,MAC3D;CACjC,MAAM,QAAoB,CACxB;EAAE,MAAM,aAAa;EAAc,OAAO;CAAkB,GAE5D;EAAE,MAAM,OAAO;EAAQ,OAAO;CAAY,CAC5C;CAEA,MAAM,oBAAoB,MAAM,IAAI,SAAS,CAAC,CAAC,KAAK;CAGpD,MAAM,gBAAgC,iBAAiB,KAAK,MAAM,WAAW;EAC3E,MAAM,cAAc;EACpB,OACE,KAAK,MAAM,kBAAkB,iBAAiB,MAAM,KACnD,QAAQ,kBAAkB,iBAAiB,SAAS,IAAI;EAC3D,MAAM,EAAE,KAAK;CACf,EAAE;CACF,MAAM,cAAc,MAAM,sBAAsB,MAAM,IAAI,SAAS,CAAC,CAAC,aAAa;CAIlF,OAAO;EAAE,eAAA,MAFmB,MAAM,GAAG,MAAM,MAAM,KAAK,aAAa,YAAY,CAAC,CAAC,CAAC,IAAI;EAE9D,QAAA,MADH,MAAM,GAAG,MAAM,MAAM,KAAK,OAAO,MAAM,CAAC,CAAC,CAAC,IAAI;EACnC;CAAY;AAC9C;;;;;AAMA,IAAa,qBAAqB,eAA0B,UAA6B,YAAsB;CAE7G,MAAM,gBAAgB,QAAQ,SAAS,IAAI,UAAU,CAAC,eAAe;CACrE,MAAM,0BAAU,IAAI,IAAwB;CAC5C,KAAK,MAAM,UAAU,eACnB,QAAQ,IAAI,QAAQ,CAAC,CAAC;CAExB,KAAK,IAAI,IAAI,GAAG,IAAI,cAAc,QAAQ,KAAK;EAC7C,MAAM,MAAM,cAAc;EAC1B,MAAM,SAAS,cAAc,IAAI,cAAc;EAC/C,QAAQ,IAAI,MAAM,CAAC,CAAE,KAAK;GACxB,IAAI,IAAI;GACR,OAAO,IAAI,QAAQ,IAAI,GAAG,MAAM,GAAG,CAAC;EACtC,CAAC;CACH;CAEA,OAAO;EACL,IAAI;EACJ,OAAO;EACP,UAAU,cAAc,KAAK,YAAY;GACvC,IAAI,UAAU;GACd,OAAO;GACP,UAAU,QAAQ,IAAI,MAAM,KAAK,CAAC;EACpC,EAAE;CACJ;AACF;;;;AAKA,IAAa,sBAAsB,gBAAyC;CAC1E,OAAO,YACJ,KAAK,aAAqC;EACzC,MAAM,SAAS,SAAS,UAAU,QAAe;EACjD,MAAM,SAAS,SAAS,UAAU,QAAe;EACjD,IAAI,CAAC,QAAQ,MAAM,CAAC,QAAQ,IAC1B;EAEF,OAAO;GACL,QAAQ,OAAO;GACf,QAAQ,OAAO;GACf,MAAO,SAAiB;EAC1B;CACF,CAAC,CAAA,CACA,QAAQ,MAAuB,QAAQ,CAAC,CAAC;AAC9C"}
@@ -0,0 +1,29 @@
1
+ import { Type } from "@dxos/echo";
2
+ import { meta } from "#meta";
3
+ import { Graph } from "#types";
4
+ import { translations as translations$1 } from "@dxos/react-ui-components/translations";
5
+ //#region src/translations.ts
6
+ var translations = [{ "en-US": {
7
+ [Type.getTypename(Graph.Graph)]: {
8
+ "typename.label": "Explorer",
9
+ "typename.label_zero": "Explorers",
10
+ "typename.label_one": "Explorer",
11
+ "typename.label_other": "Explorers",
12
+ "object-name.placeholder": "New explorer",
13
+ "add-object.label": "Add explorer",
14
+ "rename-object.label": "Rename explorer",
15
+ "delete-object.label": "Delete explorer",
16
+ "object-deleted.label": "Explorer deleted"
17
+ },
18
+ [meta.profile.key]: {
19
+ "plugin.name": "Explorer",
20
+ "object-title.label": "Title",
21
+ "neighborhood-companion.label": "Graph",
22
+ "depth.label_one": "{{count}} hop",
23
+ "depth.label_other": "{{count}} hops"
24
+ }
25
+ } }, ...translations$1];
26
+ //#endregion
27
+ export { translations };
28
+
29
+ //# sourceMappingURL=translations.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"translations.mjs","names":[],"sources":["../../src/translations.ts"],"sourcesContent":["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Type } from '@dxos/echo';\nimport { type Resource } from '@dxos/react-ui';\nimport { translations as componentsTranslations } from '@dxos/react-ui-components/translations';\n\nimport { meta } from '#meta';\nimport { Graph } from '#types';\n\nexport const translations = [\n {\n 'en-US': {\n [Type.getTypename(Graph.Graph)]: {\n 'typename.label': 'Explorer',\n 'typename.label_zero': 'Explorers',\n 'typename.label_one': 'Explorer',\n 'typename.label_other': 'Explorers',\n 'object-name.placeholder': 'New explorer',\n 'add-object.label': 'Add explorer',\n 'rename-object.label': 'Rename explorer',\n 'delete-object.label': 'Delete explorer',\n 'object-deleted.label': 'Explorer deleted',\n },\n [meta.profile.key]: {\n 'plugin.name': 'Explorer',\n 'object-title.label': 'Title',\n 'neighborhood-companion.label': 'Graph',\n 'depth.label_one': '{{count}} hop',\n 'depth.label_other': '{{count}} hops',\n },\n },\n },\n ...componentsTranslations,\n] as const satisfies Resource[];\n"],"mappings":";;;;;AAWA,IAAa,eAAe,CAC1B,EACE,SAAS;EACN,KAAK,YAAY,MAAM,KAAK,IAAI;EAC/B,kBAAkB;EAClB,uBAAuB;EACvB,sBAAsB;EACtB,wBAAwB;EACxB,2BAA2B;EAC3B,oBAAoB;EACpB,uBAAuB;EACvB,uBAAuB;EACvB,wBAAwB;CAC1B;EACC,KAAK,QAAQ,MAAM;EAClB,eAAe;EACf,sBAAsB;EACtB,gCAAgC;EAChC,mBAAmB;EACnB,qBAAqB;CACvB;AACF,EACF,GACA,GAAG,cACL"}
@@ -0,0 +1,2 @@
1
+ import { n as ExplorerAction_exports, t as Graph_exports } from "./chunk-types.mjs";
2
+ export { ExplorerAction_exports as ExplorerAction, Graph_exports as Graph };
@@ -4,6 +4,6 @@ import { Capability } from '@dxos/app-framework';
4
4
  * Offers a "Neighborhood" companion on any ECHO object. The matched node is passed through as the
5
5
  * companion's `companionTo` (the active node), which the surface renders as an ego-centric graph.
6
6
  */
7
- declare const _default: (props: void) => Effect.Effect<Capability.Any, never, never>;
7
+ declare const _default: (props: void) => Effect.Effect<Capability.Any, never, import("effect/Scope").Scope>;
8
8
  export default _default;
9
9
  //# sourceMappingURL=app-graph-builder.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"app-graph-builder.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/app-graph-builder.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAQjD;;;GAGG"}
1
+ {"version":3,"file":"app-graph-builder.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/app-graph-builder.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAOjD;;;GAGG"}
@@ -1,5 +1,5 @@
1
1
  import * as Effect from 'effect/Effect';
2
2
  import { Capability } from '@dxos/app-framework';
3
- declare const _default: (props: void) => Effect.Effect<Capability.Any, never, never>;
3
+ declare const _default: (props: void) => Effect.Effect<Capability.Any, never, import("effect/Scope").Scope>;
4
4
  export default _default;
5
5
  //# sourceMappingURL=create-object.d.ts.map
@@ -1,5 +1,5 @@
1
1
  import * as Effect from 'effect/Effect';
2
2
  import { Capability } from '@dxos/app-framework';
3
- declare const _default: (props: void) => Effect.Effect<Capability.Any, never, never>;
3
+ declare const _default: (props: void) => Effect.Effect<Capability.Any, never, import("effect/Scope").Scope>;
4
4
  export default _default;
5
5
  //# sourceMappingURL=react-surface.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"react-surface.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/react-surface.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAGxC,OAAO,EAAgB,UAAU,EAAE,MAAM,qBAAqB,CAAC"}
1
+ {"version":3,"file":"react-surface.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/react-surface.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAgB,UAAU,EAAE,MAAM,qBAAqB,CAAC"}
@@ -9,5 +9,5 @@ export type CanvasForceGraphProps = {
9
9
  */
10
10
  export declare const CanvasForceGraph: React.ForwardRefExoticComponent<Omit<CanvasForceGraphProps, "className"> & {
11
11
  classNames?: import("@dxos/ui-types").ClassNameValue;
12
- } & Pick<React.HTMLAttributes<Element>, "children" | "className" | "role" | "style"> & React.RefAttributes<HTMLDivElement>>;
12
+ } & Pick<React.HTMLAttributes<Element>, "children" | "role" | "style"> & React.RefAttributes<HTMLDivElement>>;
13
13
  //# sourceMappingURL=CanvasForceGraph.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CanvasForceGraph.d.ts","sourceRoot":"","sources":["../../../../../src/components/Graph/CanvasForceGraph.tsx"],"names":[],"mappings":"AAMA,OAAO,KAQN,MAAM,OAAO,CAAC;AAIf,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AAIpD,MAAM,MAAM,qBAAqB,GAAG;IAClC,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB;;2HAqF5B,CAAC"}
1
+ {"version":3,"file":"CanvasForceGraph.d.ts","sourceRoot":"","sources":["../../../../../src/components/Graph/CanvasForceGraph.tsx"],"names":[],"mappings":"AAMA,OAAO,KAQN,MAAM,OAAO,CAAC;AAIf,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AAIpD,MAAM,MAAM,qBAAqB,GAAG;IAClC,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB;;6GAqF5B,CAAC"}
@@ -4,7 +4,7 @@ declare const meta: {
4
4
  title: string;
5
5
  component: React.ForwardRefExoticComponent<Omit<import("./CanvasForceGraph").CanvasForceGraphProps, "className"> & {
6
6
  classNames?: import("@dxos/ui-types").ClassNameValue;
7
- } & Pick<React.HTMLAttributes<Element>, "children" | "className" | "role" | "style"> & React.RefAttributes<HTMLDivElement>>;
7
+ } & Pick<React.HTMLAttributes<Element>, "children" | "role" | "style"> & React.RefAttributes<HTMLDivElement>>;
8
8
  render: () => React.JSX.Element;
9
9
  decorators: import("@storybook/react").Decorator[];
10
10
  parameters: {
@@ -11,5 +11,5 @@ export type ForceGraphProps = {
11
11
  } & Pick<GraphProps, 'drag'>;
12
12
  export declare const ForceGraph: React.ForwardRefExoticComponent<Omit<ForceGraphProps, "className"> & {
13
13
  classNames?: import("@dxos/ui-types").ClassNameValue;
14
- } & Pick<React.HTMLAttributes<Element>, "children" | "className" | "role" | "style"> & React.RefAttributes<HTMLDivElement>>;
14
+ } & Pick<React.HTMLAttributes<Element>, "children" | "role" | "style"> & React.RefAttributes<HTMLDivElement>>;
15
15
  //# sourceMappingURL=ForceGraph.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ForceGraph.d.ts","sourceRoot":"","sources":["../../../../../src/components/Graph/ForceGraph.tsx"],"names":[],"mappings":"AAKA,OAAO,KAA4D,MAAM,OAAO,CAAC;AAGjF,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C,OAAO,EAIL,KAAK,UAAU,EAGhB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,eAAe,EAAE,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9F,OAAO,uCAAuC,CAAC;AAI/C,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,SAAS,CAAC,EAAE,cAAc,CAAC;IAC3B,SAAS,CAAC,EAAE,UAAU,CAAC,cAAc,EAAE,cAAc,CAAC,CAAC,WAAW,CAAC,CAAC;CACrE,GAAG,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;AAE7B,eAAO,MAAM,UAAU;;2HAgFtB,CAAC"}
1
+ {"version":3,"file":"ForceGraph.d.ts","sourceRoot":"","sources":["../../../../../src/components/Graph/ForceGraph.tsx"],"names":[],"mappings":"AAKA,OAAO,KAA4D,MAAM,OAAO,CAAC;AAGjF,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C,OAAO,EAIL,KAAK,UAAU,EAGhB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,eAAe,EAAE,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9F,OAAO,uCAAuC,CAAC;AAI/C,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,SAAS,CAAC,EAAE,cAAc,CAAC;IAC3B,SAAS,CAAC,EAAE,UAAU,CAAC,cAAc,EAAE,cAAc,CAAC,CAAC,WAAW,CAAC,CAAC;CACrE,GAAG,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;AAE7B,eAAO,MAAM,UAAU;;6GAgFtB,CAAC"}
@@ -4,7 +4,7 @@ declare const meta: {
4
4
  title: string;
5
5
  component: React.ForwardRefExoticComponent<Omit<import("./ForceGraph").ForceGraphProps, "className"> & {
6
6
  classNames?: import("@dxos/ui-types").ClassNameValue;
7
- } & Pick<React.HTMLAttributes<Element>, "children" | "className" | "role" | "style"> & React.RefAttributes<HTMLDivElement>>;
7
+ } & Pick<React.HTMLAttributes<Element>, "children" | "role" | "style"> & React.RefAttributes<HTMLDivElement>>;
8
8
  render: () => React.JSX.Element;
9
9
  decorators: import("@storybook/react").Decorator[];
10
10
  parameters: {
@@ -29,7 +29,7 @@ export declare const Visualization: {
29
29
  asChild?: boolean;
30
30
  }, "className"> & {
31
31
  classNames?: import("@dxos/ui-types").ClassNameValue;
32
- } & Pick<React.HTMLAttributes<Element>, "children" | "className" | "role" | "style"> & React.RefAttributes<HTMLDivElement>>;
32
+ } & Pick<React.HTMLAttributes<Element>, "children" | "role" | "style"> & React.RefAttributes<HTMLDivElement>>;
33
33
  Graph: {
34
34
  ({ debug, onNodeHover }: VisualizationGraphProps): React.JSX.Element;
35
35
  displayName: string;
@@ -4,5 +4,8 @@ import { type View } from '@dxos/echo';
4
4
  import '@dxos/react-ui-graph/styles/graph.css';
5
5
  export type { ExplorerArticleVariant } from '#components';
6
6
  export type ExplorerArticleProps = AppSurface.ObjectArticleProps<View.View>;
7
- export declare const ExplorerArticle: ({ role, subject, variant }: ExplorerArticleProps) => React.JSX.Element | null;
7
+ export declare function ExplorerArticle({ role, subject, variant }: ExplorerArticleProps): React.JSX.Element | null;
8
+ export declare namespace ExplorerArticle {
9
+ var displayName: string;
10
+ }
8
11
  //# sourceMappingURL=ExplorerArticle.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ExplorerArticle.d.ts","sourceRoot":"","sources":["../../../../../src/containers/ExplorerArticle/ExplorerArticle.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAoD,MAAM,OAAO,CAAC;AAEzE,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAoB,KAAK,IAAI,EAAE,MAAM,YAAY,CAAC;AAMzD,OAAO,uCAAuC,CAAC;AAK/C,YAAY,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAE1D,MAAM,MAAM,oBAAoB,GAAG,UAAU,CAAC,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAE5E,eAAO,MAAM,eAAe,+BAAgC,oBAAoB,6BAgG/E,CAAC"}
1
+ {"version":3,"file":"ExplorerArticle.d.ts","sourceRoot":"","sources":["../../../../../src/containers/ExplorerArticle/ExplorerArticle.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAoD,MAAM,OAAO,CAAC;AAEzE,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAoB,KAAK,IAAI,EAAE,MAAM,YAAY,CAAC;AAMzD,OAAO,uCAAuC,CAAC;AAK/C,YAAY,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAE1D,MAAM,MAAM,oBAAoB,GAAG,UAAU,CAAC,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;wCAE5C,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,oBAAoB"}
@@ -1 +1 @@
1
- {"version":3,"file":"ExplorerArticle.stories.d.ts","sourceRoot":"","sources":["../../../../../src/containers/ExplorerArticle/ExplorerArticle.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,IAAI,EAAE,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAiBjE,OAAO,EAAmB,KAAK,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAMjF,KAAK,SAAS,GAAG;IAAE,OAAO,EAAE,sBAAsB,CAAA;CAAE,CAAC;AAYrD,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,SAAS,CAwEzB,CAAC;eAEa,IAAI;AAEnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,KAAK,EAAE,KAInB,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,KAIrB,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,KAIpB,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,KAIpB,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,KAIrB,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KAInB,CAAC"}
1
+ {"version":3,"file":"ExplorerArticle.stories.d.ts","sourceRoot":"","sources":["../../../../../src/containers/ExplorerArticle/ExplorerArticle.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,IAAI,EAAE,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAkBjE,OAAO,EAAmB,KAAK,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAMjF,KAAK,SAAS,GAAG;IAAE,OAAO,EAAE,sBAAsB,CAAA;CAAE,CAAC;AAYrD,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,SAAS,CAwEzB,CAAC;eAEa,IAAI;AAEnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,KAAK,EAAE,KAInB,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,KAIrB,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,KAIpB,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,KAIpB,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,KAIrB,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KAInB,CAAC"}
@@ -6,9 +6,8 @@ export type NeighborhoodCompanionProps = {
6
6
  /** The active node whose neighbourhood is rendered (passed as the companion subject). */
7
7
  subject: Obj.Any;
8
8
  };
9
- /**
10
- * Companion that renders the n-hop neighbourhood of the active node as an ego-centric radial graph,
11
- * with the active node at the centre. Depth (number of hops traversed) is adjustable in the toolbar.
12
- */
13
- export declare const NeighborhoodCompanion: ({ role, subject }: NeighborhoodCompanionProps) => React.JSX.Element | null;
9
+ export declare function NeighborhoodCompanion({ role, subject }: NeighborhoodCompanionProps): React.JSX.Element | null;
10
+ export declare namespace NeighborhoodCompanion {
11
+ var displayName: string;
12
+ }
14
13
  //# sourceMappingURL=NeighborhoodCompanion.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"NeighborhoodCompanion.d.ts","sourceRoot":"","sources":["../../../../../src/containers/NeighborhoodCompanion/NeighborhoodCompanion.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAgC,MAAM,OAAO,CAAC;AAErD,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAGjC,OAAO,uCAAuC,CAAC;AAS/C,MAAM,MAAM,0BAA0B,GAAG;IACvC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,yFAAyF;IACzF,OAAO,EAAE,GAAG,CAAC,GAAG,CAAC;CAClB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,qBAAqB,sBAAmC,0BAA0B,6BAyE9F,CAAC"}
1
+ {"version":3,"file":"NeighborhoodCompanion.d.ts","sourceRoot":"","sources":["../../../../../src/containers/NeighborhoodCompanion/NeighborhoodCompanion.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAgC,MAAM,OAAO,CAAC;AAErD,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAGjC,OAAO,uCAAuC,CAAC;AAS/C,MAAM,MAAM,0BAA0B,GAAG;IACvC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,yFAAyF;IACzF,OAAO,EAAE,GAAG,CAAC,GAAG,CAAC;CAClB,CAAC;8CAMoC,EAAE,IAAgB,EAAE,OAAO,EAAE,EAAE,0BAA0B"}
@@ -4,7 +4,7 @@ declare const Graph_base: Type.ObjClass<Graph, {
4
4
  readonly view?: import("@dxos/echo/internal").Ref<View.View & import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & Obj.Unknown> | undefined;
5
5
  readonly query: {
6
6
  readonly raw?: string | undefined;
7
- readonly ast: QueryAST.QueryFilterClause | QueryAST.QueryFromClause | QueryAST.QueryHierarchyTraversalClause | QueryAST.QueryIncomingReferencesClause | QueryAST.QueryLimitClause | QueryAST.QueryOptionsClause | QueryAST.QueryOrderClause | QueryAST.QueryReferenceTraversalClause | QueryAST.QueryRelationClause | QueryAST.QueryRelationTraversalClause | QueryAST.QuerySelectClause | QueryAST.QuerySetDifferenceClause | QueryAST.QueryUnionClause;
7
+ readonly ast: QueryAST.QueryAggregateClause | QueryAST.QueryFilterClause | QueryAST.QueryFromClause | QueryAST.QueryHierarchyTraversalClause | QueryAST.QueryIncomingReferencesClause | QueryAST.QueryLimitClause | QueryAST.QueryOptionsClause | QueryAST.QueryOrderClause | QueryAST.QueryReferenceTraversalClause | QueryAST.QueryRelationClause | QueryAST.QueryRelationTraversalClause | QueryAST.QuerySelectClause | QueryAST.QuerySetDifferenceClause | QueryAST.QuerySkipClause | QueryAST.QueryUnionClause;
8
8
  };
9
9
  }, {}>;
10
10
  export declare class Graph extends Graph_base {