@dxos/plugin-explorer 0.8.4-main.1068cf700f → 0.8.4-main.1c7ec43d41

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 (146) hide show
  1. package/dist/lib/browser/{chunk-YNQF4CPY.mjs → chunk-HPIS2WXY.mjs} +2 -2
  2. package/dist/lib/browser/{chunk-YNQF4CPY.mjs.map → chunk-HPIS2WXY.mjs.map} +3 -3
  3. package/dist/lib/browser/{chunk-JZSBQYJQ.mjs → components/index.mjs} +217 -19
  4. package/dist/lib/{node-esm/chunk-K5BYG7BW.mjs.map → browser/components/index.mjs.map} +4 -4
  5. package/dist/lib/browser/{chunk-KIXHZZ2C.mjs → hooks/index.mjs} +18 -13
  6. package/dist/lib/browser/hooks/index.mjs.map +7 -0
  7. package/dist/lib/browser/index.mjs +4 -92
  8. package/dist/lib/browser/index.mjs.map +4 -4
  9. package/dist/lib/browser/meta.json +1 -1
  10. package/dist/lib/browser/meta.mjs +1 -1
  11. package/dist/lib/browser/types/index.mjs +66 -4
  12. package/dist/lib/browser/types/index.mjs.map +4 -4
  13. package/dist/lib/node-esm/{chunk-DK77RB6M.mjs → chunk-6EUBRHHX.mjs} +2 -2
  14. package/dist/lib/node-esm/{chunk-DK77RB6M.mjs.map → chunk-6EUBRHHX.mjs.map} +3 -3
  15. package/dist/lib/node-esm/{chunk-K5BYG7BW.mjs → components/index.mjs} +216 -19
  16. package/dist/lib/{browser/chunk-JZSBQYJQ.mjs.map → node-esm/components/index.mjs.map} +4 -4
  17. package/dist/lib/node-esm/{chunk-ASRWO2N5.mjs → hooks/index.mjs} +17 -13
  18. package/dist/lib/node-esm/hooks/index.mjs.map +7 -0
  19. package/dist/lib/node-esm/index.mjs +4 -92
  20. package/dist/lib/node-esm/index.mjs.map +4 -4
  21. package/dist/lib/node-esm/meta.json +1 -1
  22. package/dist/lib/node-esm/meta.mjs +1 -1
  23. package/dist/lib/node-esm/types/index.mjs +66 -4
  24. package/dist/lib/node-esm/types/index.mjs.map +4 -4
  25. package/dist/types/data/cities.d.ts +4 -4
  26. package/dist/types/data/cities.d.ts.map +1 -1
  27. package/dist/types/data/countries-110m.d.ts +19 -22
  28. package/dist/types/data/countries-110m.d.ts.map +1 -1
  29. package/dist/types/src/ExplorerPlugin.d.ts +1 -0
  30. package/dist/types/src/ExplorerPlugin.d.ts.map +1 -1
  31. package/dist/types/src/ExplorerPlugin.test.d.ts +2 -0
  32. package/dist/types/src/ExplorerPlugin.test.d.ts.map +1 -0
  33. package/dist/types/src/capabilities/create-object.d.ts +11 -0
  34. package/dist/types/src/capabilities/create-object.d.ts.map +1 -0
  35. package/dist/types/src/capabilities/index.d.ts +8 -1
  36. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  37. package/dist/types/src/capabilities/react-surface.d.ts +5 -0
  38. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
  39. package/dist/types/src/components/Chart/Chart.d.ts.map +1 -1
  40. package/dist/types/src/components/Chart/Chart.stories.d.ts +4 -1
  41. package/dist/types/src/components/Chart/Chart.stories.d.ts.map +1 -1
  42. package/dist/types/src/components/Globe/Globe.d.ts.map +1 -1
  43. package/dist/types/src/components/Globe/Globe.stories.d.ts +5 -2
  44. package/dist/types/src/components/Globe/Globe.stories.d.ts.map +1 -1
  45. package/dist/types/src/components/Graph/CanvasForceGraph.d.ts +13 -0
  46. package/dist/types/src/components/Graph/CanvasForceGraph.d.ts.map +1 -0
  47. package/dist/types/src/components/Graph/CanvasForceGraph.stories.d.ts +17 -0
  48. package/dist/types/src/components/Graph/CanvasForceGraph.stories.d.ts.map +1 -0
  49. package/dist/types/src/components/Graph/ForceGraph.d.ts +12 -5
  50. package/dist/types/src/components/Graph/ForceGraph.d.ts.map +1 -1
  51. package/dist/types/src/components/Graph/ForceGraph.stories.d.ts +4 -2
  52. package/dist/types/src/components/Graph/ForceGraph.stories.d.ts.map +1 -1
  53. package/dist/types/src/components/Graph/{adapter.d.ts → graph-adapter.d.ts} +1 -1
  54. package/dist/types/src/components/Graph/graph-adapter.d.ts.map +1 -0
  55. package/dist/types/src/components/Graph/index.d.ts +1 -1
  56. package/dist/types/src/components/Graph/index.d.ts.map +1 -1
  57. package/dist/types/src/components/Graph/testing.d.ts.map +1 -1
  58. package/dist/types/src/components/Tree/Tree.d.ts.map +1 -1
  59. package/dist/types/src/components/Tree/Tree.stories.d.ts +5 -1
  60. package/dist/types/src/components/Tree/Tree.stories.d.ts.map +1 -1
  61. package/dist/types/src/components/Tree/layout/HierarchicalEdgeBundling.d.ts.map +1 -1
  62. package/dist/types/src/components/Tree/layout/RadialTree.d.ts.map +1 -1
  63. package/dist/types/src/components/Tree/layout/TidyTree.d.ts.map +1 -1
  64. package/dist/types/src/components/Tree/testing/generator.d.ts.map +1 -1
  65. package/dist/types/src/components/Tree/types/tree.d.ts +7 -7
  66. package/dist/types/src/components/Tree/types/tree.d.ts.map +1 -1
  67. package/dist/types/src/components/Tree/types/types.d.ts.map +1 -1
  68. package/dist/types/src/components/index.d.ts +0 -2
  69. package/dist/types/src/components/index.d.ts.map +1 -1
  70. package/dist/types/src/components/plot.d.ts.map +1 -1
  71. package/dist/types/src/containers/ExplorerContainer/ExplorerContainer.d.ts +6 -0
  72. package/dist/types/src/containers/ExplorerContainer/ExplorerContainer.d.ts.map +1 -0
  73. package/dist/types/src/containers/ExplorerContainer/index.d.ts +2 -0
  74. package/dist/types/src/containers/ExplorerContainer/index.d.ts.map +1 -0
  75. package/dist/types/src/containers/index.d.ts +3 -0
  76. package/dist/types/src/containers/index.d.ts.map +1 -0
  77. package/dist/types/src/hooks/useGraphModel.d.ts.map +1 -1
  78. package/dist/types/src/index.d.ts +2 -3
  79. package/dist/types/src/index.d.ts.map +1 -1
  80. package/dist/types/src/translations.d.ts +28 -26
  81. package/dist/types/src/translations.d.ts.map +1 -1
  82. package/dist/types/src/types/ExplorerAction.d.ts.map +1 -1
  83. package/dist/types/src/types/Graph.d.ts +3 -10
  84. package/dist/types/src/types/Graph.d.ts.map +1 -1
  85. package/dist/types/tsconfig.tsbuildinfo +1 -1
  86. package/package.json +67 -47
  87. package/src/ExplorerPlugin.test.ts +26 -0
  88. package/src/ExplorerPlugin.tsx +7 -24
  89. package/src/capabilities/create-object.ts +36 -0
  90. package/src/capabilities/index.ts +4 -1
  91. package/src/capabilities/{react-surface/react-surface.tsx → react-surface.tsx} +10 -9
  92. package/src/components/Chart/Chart.stories.tsx +15 -22
  93. package/src/components/Globe/Globe.stories.tsx +18 -21
  94. package/src/components/Graph/CanvasForceGraph.stories.tsx +83 -0
  95. package/src/components/Graph/CanvasForceGraph.tsx +124 -0
  96. package/src/components/Graph/ForceGraph.stories.tsx +76 -44
  97. package/src/components/Graph/ForceGraph.tsx +104 -85
  98. package/src/components/Graph/index.ts +1 -1
  99. package/src/components/Tree/Tree.stories.tsx +44 -37
  100. package/src/components/Tree/testing/generator.ts +1 -1
  101. package/src/components/Tree/types/tree.test.ts +3 -4
  102. package/src/components/Tree/types/tree.ts +15 -15
  103. package/src/components/index.ts +0 -4
  104. package/src/{components → containers/ExplorerContainer}/ExplorerContainer.tsx +18 -19
  105. package/src/containers/ExplorerContainer/index.ts +5 -0
  106. package/src/containers/index.ts +7 -0
  107. package/src/hooks/useGraphModel.ts +14 -10
  108. package/src/index.ts +5 -3
  109. package/src/meta.ts +1 -1
  110. package/src/translations.ts +14 -13
  111. package/src/types/ExplorerAction.ts +0 -1
  112. package/src/types/Graph.ts +11 -24
  113. package/src/typings.d.ts +8 -0
  114. package/dist/lib/browser/ExplorerContainer-46BHUF6R.mjs +0 -45
  115. package/dist/lib/browser/ExplorerContainer-46BHUF6R.mjs.map +0 -7
  116. package/dist/lib/browser/chunk-HIFLWHXR.mjs +0 -83
  117. package/dist/lib/browser/chunk-HIFLWHXR.mjs.map +0 -7
  118. package/dist/lib/browser/chunk-KIXHZZ2C.mjs.map +0 -7
  119. package/dist/lib/browser/chunk-MGBT2ZFU.mjs +0 -177
  120. package/dist/lib/browser/chunk-MGBT2ZFU.mjs.map +0 -7
  121. package/dist/lib/browser/react-surface-TPQAT5EI.mjs +0 -36
  122. package/dist/lib/browser/react-surface-TPQAT5EI.mjs.map +0 -7
  123. package/dist/lib/node-esm/ExplorerContainer-OZNG47QB.mjs +0 -46
  124. package/dist/lib/node-esm/ExplorerContainer-OZNG47QB.mjs.map +0 -7
  125. package/dist/lib/node-esm/chunk-3OE6TBJI.mjs +0 -84
  126. package/dist/lib/node-esm/chunk-3OE6TBJI.mjs.map +0 -7
  127. package/dist/lib/node-esm/chunk-ASRWO2N5.mjs.map +0 -7
  128. package/dist/lib/node-esm/chunk-YWJBDETV.mjs +0 -179
  129. package/dist/lib/node-esm/chunk-YWJBDETV.mjs.map +0 -7
  130. package/dist/lib/node-esm/react-surface-CYHGJJDU.mjs +0 -37
  131. package/dist/lib/node-esm/react-surface-CYHGJJDU.mjs.map +0 -7
  132. package/dist/types/src/capabilities/react-surface/index.d.ts +0 -3
  133. package/dist/types/src/capabilities/react-surface/index.d.ts.map +0 -1
  134. package/dist/types/src/capabilities/react-surface/react-surface.d.ts +0 -5
  135. package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +0 -1
  136. package/dist/types/src/components/ExplorerContainer.d.ts +0 -7
  137. package/dist/types/src/components/ExplorerContainer.d.ts.map +0 -1
  138. package/dist/types/src/components/Graph/D3ForceGraph.d.ts +0 -14
  139. package/dist/types/src/components/Graph/D3ForceGraph.d.ts.map +0 -1
  140. package/dist/types/src/components/Graph/D3ForceGraph.stories.d.ts +0 -15
  141. package/dist/types/src/components/Graph/D3ForceGraph.stories.d.ts.map +0 -1
  142. package/dist/types/src/components/Graph/adapter.d.ts.map +0 -1
  143. package/src/capabilities/react-surface/index.ts +0 -7
  144. package/src/components/Graph/D3ForceGraph.stories.tsx +0 -83
  145. package/src/components/Graph/D3ForceGraph.tsx +0 -101
  146. /package/src/components/Graph/{adapter.ts → graph-adapter.ts} +0 -0
@@ -1,7 +1,7 @@
1
1
  // src/meta.ts
2
2
  import { trim } from "@dxos/util";
3
3
  var meta = {
4
- id: "dxos.org/plugin/explorer",
4
+ id: "org.dxos.plugin.explorer",
5
5
  name: "Explorer",
6
6
  description: trim`
7
7
  Interactive hypergraph visualization that reveals relationships between objects in your workspace.
@@ -21,4 +21,4 @@ var meta = {
21
21
  export {
22
22
  meta
23
23
  };
24
- //# sourceMappingURL=chunk-YNQF4CPY.mjs.map
24
+ //# sourceMappingURL=chunk-HPIS2WXY.mjs.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/meta.ts"],
4
- "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Plugin } from '@dxos/app-framework';\nimport { trim } from '@dxos/util';\n\nexport const meta: Plugin.Meta = {\n id: 'dxos.org/plugin/explorer',\n name: 'Explorer',\n description: trim`\n Interactive hypergraph visualization that reveals relationships between objects in your workspace.\n Navigate complex data structures and discover connections through a dynamic network view.\n `,\n icon: 'ph--graph--regular',\n iconHue: 'green',\n source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-explorer',\n tags: ['labs'],\n screenshots: ['https://dxos.network/plugin-details-explorer-dark.png'],\n};\n"],
5
- "mappings": ";AAKA,SAASA,YAAY;AAEd,IAAMC,OAAoB;EAC/BC,IAAI;EACJC,MAAM;EACNC,aAAaC;;;;EAIbC,MAAM;EACNC,SAAS;EACTC,QAAQ;EACRC,MAAM;IAAC;;EACPC,aAAa;IAAC;;AAChB;",
6
- "names": ["trim", "meta", "id", "name", "description", "trim", "icon", "iconHue", "source", "tags", "screenshots"]
4
+ "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Plugin } from '@dxos/app-framework';\nimport { trim } from '@dxos/util';\n\nexport const meta: Plugin.Meta = {\n id: 'org.dxos.plugin.explorer',\n name: 'Explorer',\n description: trim`\n Interactive hypergraph visualization that reveals relationships between objects in your workspace.\n Navigate complex data structures and discover connections through a dynamic network view.\n `,\n icon: 'ph--graph--regular',\n iconHue: 'green',\n source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-explorer',\n tags: ['labs'],\n screenshots: ['https://dxos.network/plugin-details-explorer-dark.png'],\n};\n"],
5
+ "mappings": ";AAKA,SAASA,YAAY;AAEd,IAAMC,OAAoB;EAC/BC,IAAI;EACJC,MAAM;EACNC,aAAaJ;;;;EAIbK,MAAM;EACNC,SAAS;EACTC,QAAQ;EACRC,MAAM;IAAC;;EACPC,aAAa;IAAC;;AAChB;",
6
+ "names": ["trim", "meta", "id", "name", "description", "icon", "iconHue", "source", "tags", "screenshots"]
7
7
  }
@@ -1,3 +1,5 @@
1
+ import "../chunk-J5LGTIGS.mjs";
2
+
1
3
  // src/components/Chart/Chart.tsx
2
4
  import * as Plot from "@observablehq/plot";
3
5
  import React, { useEffect } from "react";
@@ -10820,11 +10822,211 @@ var Globe = ({ items = [], accessor, projection = "orthographic", options = defa
10820
10822
  });
10821
10823
  };
10822
10824
 
10825
+ // src/components/Graph/CanvasForceGraph.tsx
10826
+ import { forceLink, forceManyBody } from "d3";
10827
+ import NativeForceGraph from "force-graph";
10828
+ import React3, { useCallback, useEffect as useEffect3, useRef, useState } from "react";
10829
+ import { useResizeDetector as useResizeDetector3 } from "react-resize-detector";
10830
+ import { composable, composableProps } from "@dxos/ui-theme";
10831
+
10832
+ // src/components/Graph/graph-adapter.ts
10833
+ var GraphAdapter = class {
10834
+ graph;
10835
+ _nodes = [];
10836
+ _links = [];
10837
+ constructor(graph) {
10838
+ this.graph = graph;
10839
+ this._nodes = graph.nodes.map((node) => ({
10840
+ id: node.id,
10841
+ type: node.type,
10842
+ data: node.data
10843
+ }));
10844
+ const nodeIds = new Set(this._nodes.map((node) => node.id));
10845
+ this._links = graph.edges.filter((edge) => nodeIds.has(edge.source) && nodeIds.has(edge.target)).map((edge) => ({
10846
+ type: edge.type,
10847
+ source: edge.source,
10848
+ target: edge.target,
10849
+ data: edge.data
10850
+ }));
10851
+ }
10852
+ get nodes() {
10853
+ return this._nodes;
10854
+ }
10855
+ get links() {
10856
+ return this._links;
10857
+ }
10858
+ };
10859
+
10860
+ // src/components/Graph/CanvasForceGraph.tsx
10861
+ var CanvasForceGraph = composable(({ model, match, onClick, ...props }, forwardedRef) => {
10862
+ const { ref: resizeRef, width, height } = useResizeDetector3({
10863
+ refreshRate: 200
10864
+ });
10865
+ const setRef = useCallback((node) => {
10866
+ resizeRef(node);
10867
+ assignRef(forwardedRef, node);
10868
+ }, [
10869
+ resizeRef,
10870
+ forwardedRef
10871
+ ]);
10872
+ const rootRef = useRef(null);
10873
+ const forceGraph = useRef(null);
10874
+ const [data, setData] = useState();
10875
+ useEffect3(() => {
10876
+ return model?.subscribe((model2) => setData(new GraphAdapter(model2.graph)));
10877
+ }, [
10878
+ model
10879
+ ]);
10880
+ useEffect3(() => {
10881
+ if (rootRef.current) {
10882
+ forceGraph.current = new NativeForceGraph(rootRef.current).nodeRelSize(6).nodeLabel((node) => node.type === "schema" ? node.data.typename : node.data.label ?? node.id).nodeAutoColorBy((node) => node.type === "schema" ? "schema" : node.data.typename).linkAutoColorBy((link2) => link2.type);
10883
+ }
10884
+ return () => {
10885
+ forceGraph.current?.pauseAnimation().graphData({
10886
+ nodes: [],
10887
+ links: []
10888
+ });
10889
+ forceGraph.current = null;
10890
+ };
10891
+ }, []);
10892
+ useEffect3(() => {
10893
+ if (!data || !width || !height || !forceGraph.current) {
10894
+ return;
10895
+ }
10896
+ forceGraph.current.pauseAnimation().width(width).height(height).onEngineStop(() => handleZoomToFit()).onNodeClick((node) => {
10897
+ forceGraph.current?.emitParticle(node);
10898
+ }).d3Force("link", forceLink().distance(160).strength(0.5)).d3Force("charge", forceManyBody().strength(-30)).graphData(data).warmupTicks(100).cooldownTime(1e3).resumeAnimation();
10899
+ }, [
10900
+ data,
10901
+ width,
10902
+ height
10903
+ ]);
10904
+ const handleZoomToFit = () => {
10905
+ forceGraph.current?.zoomToFit(400, 40);
10906
+ };
10907
+ const handleClick = useCallback((event) => {
10908
+ onClick?.(event);
10909
+ if (!event.defaultPrevented) {
10910
+ handleZoomToFit();
10911
+ }
10912
+ }, [
10913
+ onClick
10914
+ ]);
10915
+ return /* @__PURE__ */ React3.createElement("div", {
10916
+ ...composableProps(props, {
10917
+ classNames: "relative grow"
10918
+ }),
10919
+ onClick: handleClick,
10920
+ ref: setRef
10921
+ }, /* @__PURE__ */ React3.createElement("div", {
10922
+ ref: rootRef,
10923
+ className: "absolute inset-0"
10924
+ }));
10925
+ });
10926
+ var assignRef = (ref, value) => {
10927
+ if (typeof ref === "function") {
10928
+ ref(value);
10929
+ } else if (ref) {
10930
+ ref.current = value;
10931
+ }
10932
+ };
10933
+
10934
+ // src/components/Graph/ForceGraph.tsx
10935
+ import { Atom, useAtomValue } from "@effect-atom/atom-react";
10936
+ import React4, { useCallback as useCallback2, useEffect as useEffect4, useMemo, useRef as useRef2, useState as useState2 } from "react";
10937
+ import { Obj } from "@dxos/echo";
10938
+ import { SelectionModel } from "@dxos/graph";
10939
+ import { GraphForceProjector, SVG } from "@dxos/react-ui-graph";
10940
+ import { composable as composable2, composableProps as composableProps2, getHashStyles } from "@dxos/ui-theme";
10941
+ import "@dxos/react-ui-graph/styles/graph.css";
10942
+ var EMPTY_ATOM = Atom.make({
10943
+ nodes: [],
10944
+ edges: []
10945
+ });
10946
+ var ForceGraph = composable2(({ model, selection: selectionProp, grid, drag, onInspect, ...props }, forwardedRef) => {
10947
+ useAtomValue(model?.graphAtom ?? EMPTY_ATOM);
10948
+ const graph = useRef2(null);
10949
+ const selection = useMemo(() => selectionProp ?? new SelectionModel(), [
10950
+ selectionProp
10951
+ ]);
10952
+ useEffect4(() => {
10953
+ const unsubscribe = selection.subscribe(() => graph.current?.repaint());
10954
+ return unsubscribe;
10955
+ }, [
10956
+ selection
10957
+ ]);
10958
+ const svgRef = useRef2(null);
10959
+ const [projector, setProjector] = useState2();
10960
+ useEffect4(() => {
10961
+ if (svgRef.current) {
10962
+ setProjector(new GraphForceProjector(svgRef.current, {
10963
+ attributes: {
10964
+ // TODO(burdon): Check type (currently assumes Employee property).
10965
+ // Edge shouldn't contribute to force if it's not active.
10966
+ linkForce: (edge) => edge.data?.object?.active !== false
10967
+ },
10968
+ forces: {
10969
+ point: {
10970
+ strength: 0.01
10971
+ }
10972
+ }
10973
+ }));
10974
+ }
10975
+ }, []);
10976
+ const handleSelect = useCallback2((node) => {
10977
+ if (selection.contains(node.id)) {
10978
+ selection.remove(node.id);
10979
+ } else {
10980
+ selection.add(node.id);
10981
+ }
10982
+ }, [
10983
+ selection
10984
+ ]);
10985
+ return /* @__PURE__ */ React4.createElement("div", {
10986
+ ...composableProps2(props, {
10987
+ classNames: "dx-container"
10988
+ }),
10989
+ ref: forwardedRef
10990
+ }, /* @__PURE__ */ React4.createElement(SVG.Root, {
10991
+ ref: svgRef
10992
+ }, /* @__PURE__ */ React4.createElement(SVG.Markers, null), grid && /* @__PURE__ */ React4.createElement(SVG.Grid, {
10993
+ axis: true
10994
+ }), /* @__PURE__ */ React4.createElement(SVG.Zoom, {
10995
+ extent: [
10996
+ 1 / 2,
10997
+ 2
10998
+ ]
10999
+ }, /* @__PURE__ */ React4.createElement(SVG.Graph, {
11000
+ drag,
11001
+ ref: graph,
11002
+ model,
11003
+ projector,
11004
+ labels: {
11005
+ text: (node) => node.data?.data.label ?? node.id
11006
+ },
11007
+ attributes: {
11008
+ node: (node) => {
11009
+ const obj = node.data?.data.object;
11010
+ return {
11011
+ data: {
11012
+ color: getHashStyles(obj && Obj.getTypename(obj))?.hue
11013
+ },
11014
+ classes: {
11015
+ "dx-selected": selection.contains(node.id)
11016
+ }
11017
+ };
11018
+ }
11019
+ },
11020
+ onSelect: handleSelect,
11021
+ onInspect
11022
+ }))));
11023
+ });
11024
+
10823
11025
  // src/components/Tree/Tree.tsx
10824
11026
  import { RegistryContext } from "@effect-atom/atom-react";
10825
- import React3, { useContext, useEffect as useEffect3, useRef, useState } from "react";
11027
+ import React5, { useContext, useEffect as useEffect5, useRef as useRef3, useState as useState3 } from "react";
10826
11028
  import { useAsyncState } from "@dxos/react-ui";
10827
- import { SVG } from "@dxos/react-ui-graph";
11029
+ import { SVG as SVG2 } from "@dxos/react-ui-graph";
10828
11030
  import { SpaceGraphModel } from "@dxos/schema";
10829
11031
 
10830
11032
  // src/components/Tree/layout/HierarchicalEdgeBundling.ts
@@ -10962,7 +11164,7 @@ var TidyTree_default = TidyTree;
10962
11164
 
10963
11165
  // src/components/Tree/types/tree.ts
10964
11166
  import * as Schema from "effect/Schema";
10965
- import { Key, Obj, Type } from "@dxos/echo";
11167
+ import { Key, Obj as Obj2, Ref, Type } from "@dxos/echo";
10966
11168
  import { TestSchema } from "@dxos/echo/testing";
10967
11169
  import { invariant } from "@dxos/invariant";
10968
11170
  var TreeNodeType = Schema.Struct({
@@ -10972,7 +11174,7 @@ var TreeNodeType = Schema.Struct({
10972
11174
  key: Schema.String,
10973
11175
  value: Schema.Any
10974
11176
  })),
10975
- ref: Schema.optional(Type.Ref(TestSchema.Expando))
11177
+ ref: Schema.optional(Ref.Ref(TestSchema.Expando))
10976
11178
  }).pipe(Schema.mutable);
10977
11179
  var TreeType = Schema.Struct({
10978
11180
  root: Key.ObjectId,
@@ -10981,7 +11183,7 @@ var TreeType = Schema.Struct({
10981
11183
  value: TreeNodeType
10982
11184
  }))
10983
11185
  }).pipe(Type.object({
10984
- typename: "dxos.org/type/Tree",
11186
+ typename: "org.dxos.type.tree",
10985
11187
  version: "0.1.0"
10986
11188
  }));
10987
11189
 
@@ -11018,8 +11220,8 @@ var Tree = ({ space, selected, variant = "tidy", onNodeClick }) => {
11018
11220
  selected,
11019
11221
  registry
11020
11222
  ]);
11021
- const [tree3, setTree] = useState();
11022
- useEffect3(() => {
11223
+ const [tree3, setTree] = useState3();
11224
+ useEffect5(() => {
11023
11225
  return model?.subscribe(() => {
11024
11226
  const tree4 = mapGraphToTreeData(model);
11025
11227
  setTree(tree4);
@@ -11027,8 +11229,8 @@ var Tree = ({ space, selected, variant = "tidy", onNodeClick }) => {
11027
11229
  }, [
11028
11230
  model
11029
11231
  ]);
11030
- const context = useRef(null);
11031
- useEffect3(() => {
11232
+ const context = useRef3(null);
11233
+ useEffect5(() => {
11032
11234
  if (context.current?.size) {
11033
11235
  const { width, height } = context.current.size;
11034
11236
  const size = Math.min(width, height);
@@ -11054,23 +11256,19 @@ var Tree = ({ space, selected, variant = "tidy", onNodeClick }) => {
11054
11256
  context.current,
11055
11257
  tree3
11056
11258
  ]);
11057
- return /* @__PURE__ */ React3.createElement("div", {
11259
+ return /* @__PURE__ */ React5.createElement("div", {
11058
11260
  className: "grow",
11059
11261
  onClick: () => onNodeClick?.()
11060
- }, /* @__PURE__ */ React3.createElement(SVG.Root, {
11262
+ }, /* @__PURE__ */ React5.createElement(SVG2.Root, {
11061
11263
  ref: context
11062
11264
  }));
11063
11265
  };
11064
-
11065
- // src/components/index.ts
11066
- import { lazy } from "react";
11067
- var ExplorerContainer = lazy(() => import("./ExplorerContainer-46BHUF6R.mjs"));
11068
-
11069
11266
  export {
11267
+ CanvasForceGraph,
11070
11268
  Chart,
11269
+ ForceGraph,
11071
11270
  Globe,
11072
- defaultTreeLayoutSlots,
11073
11271
  Tree,
11074
- ExplorerContainer
11272
+ defaultTreeLayoutSlots
11075
11273
  };
11076
- //# sourceMappingURL=chunk-JZSBQYJQ.mjs.map
11274
+ //# sourceMappingURL=index.mjs.map