@dxos/plugin-explorer 0.8.2-main.fbd8ed0 → 0.8.2-staging.42af850

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 (143) hide show
  1. package/dist/lib/browser/ExplorerContainer-BBZ54DJS.mjs +37 -0
  2. package/dist/lib/browser/ExplorerContainer-BBZ54DJS.mjs.map +7 -0
  3. package/dist/lib/browser/{chunk-JL7ZGOFE.mjs → chunk-73GQ46YO.mjs} +415 -155
  4. package/dist/lib/{node-esm/chunk-MUHCE377.mjs.map → browser/chunk-73GQ46YO.mjs.map} +4 -4
  5. package/dist/lib/browser/{chunk-HKQSZX7S.mjs → chunk-73YTQHOT.mjs} +3 -3
  6. package/dist/lib/browser/{chunk-HKQSZX7S.mjs.map → chunk-73YTQHOT.mjs.map} +1 -1
  7. package/dist/lib/browser/chunk-M2BGAY6H.mjs +177 -0
  8. package/dist/lib/browser/chunk-M2BGAY6H.mjs.map +7 -0
  9. package/dist/lib/browser/{chunk-Z2SDLMQM.mjs → chunk-OBAFAA5V.mjs} +3 -3
  10. package/dist/lib/browser/{chunk-Z2SDLMQM.mjs.map → chunk-OBAFAA5V.mjs.map} +1 -1
  11. package/dist/lib/browser/chunk-SLB2F5AO.mjs +30 -0
  12. package/dist/lib/browser/chunk-SLB2F5AO.mjs.map +7 -0
  13. package/dist/lib/browser/index.mjs +15 -11
  14. package/dist/lib/browser/index.mjs.map +1 -1
  15. package/dist/lib/browser/{intent-resolver-7JF4DU2C.mjs → intent-resolver-FJDVBDE3.mjs} +3 -3
  16. package/dist/lib/browser/meta.json +1 -1
  17. package/dist/lib/browser/meta.mjs +1 -1
  18. package/dist/lib/browser/{react-surface-JLE6GLG6.mjs → react-surface-H3YDMXAQ.mjs} +5 -5
  19. package/dist/lib/browser/types/index.mjs +2 -2
  20. package/dist/lib/node/{ExplorerContainer-4RMWCWRX.cjs → ExplorerContainer-MVP2AM7R.cjs} +24 -16
  21. package/dist/lib/node/ExplorerContainer-MVP2AM7R.cjs.map +7 -0
  22. package/dist/lib/node/chunk-4T4LCT5R.cjs +52 -0
  23. package/dist/lib/node/chunk-4T4LCT5R.cjs.map +7 -0
  24. package/dist/lib/node/{chunk-R4TOGRPE.cjs → chunk-72H5HBTK.cjs} +414 -153
  25. package/dist/lib/node/{chunk-R4TOGRPE.cjs.map → chunk-72H5HBTK.cjs.map} +4 -4
  26. package/dist/lib/node/{chunk-VB3QE6XY.cjs → chunk-BCDVG2CH.cjs} +6 -6
  27. package/dist/lib/node/{chunk-VB3QE6XY.cjs.map → chunk-BCDVG2CH.cjs.map} +1 -1
  28. package/dist/lib/node/{chunk-6R5P3UVS.cjs → chunk-MLRYW4WQ.cjs} +7 -7
  29. package/dist/lib/node/{chunk-6R5P3UVS.cjs.map → chunk-MLRYW4WQ.cjs.map} +1 -1
  30. package/dist/lib/node/chunk-NELWWGBU.cjs +204 -0
  31. package/dist/lib/node/chunk-NELWWGBU.cjs.map +7 -0
  32. package/dist/lib/node/index.cjs +34 -31
  33. package/dist/lib/node/index.cjs.map +1 -1
  34. package/dist/lib/node/{intent-resolver-VDAHQEE7.cjs → intent-resolver-DRT67ZU4.cjs} +8 -8
  35. package/dist/lib/node/meta.cjs +3 -3
  36. package/dist/lib/node/meta.cjs.map +1 -1
  37. package/dist/lib/node/meta.json +1 -1
  38. package/dist/lib/node/{react-surface-F66QYWDR.cjs → react-surface-6ESLSM33.cjs} +11 -11
  39. package/dist/lib/node/types/index.cjs +4 -4
  40. package/dist/lib/node/types/index.cjs.map +1 -1
  41. package/dist/lib/node-esm/ExplorerContainer-APGUQI4M.mjs +38 -0
  42. package/dist/lib/node-esm/ExplorerContainer-APGUQI4M.mjs.map +7 -0
  43. package/dist/lib/node-esm/{chunk-MUHCE377.mjs → chunk-34X2VFQN.mjs} +415 -154
  44. package/dist/lib/{browser/chunk-JL7ZGOFE.mjs.map → node-esm/chunk-34X2VFQN.mjs.map} +4 -4
  45. package/dist/lib/node-esm/{chunk-PUFSCMN4.mjs → chunk-3CMBLK6W.mjs} +3 -3
  46. package/dist/lib/node-esm/{chunk-PUFSCMN4.mjs.map → chunk-3CMBLK6W.mjs.map} +1 -1
  47. package/dist/lib/node-esm/{chunk-QOJSLABX.mjs → chunk-N6VEANUZ.mjs} +3 -3
  48. package/dist/lib/node-esm/{chunk-QOJSLABX.mjs.map → chunk-N6VEANUZ.mjs.map} +1 -1
  49. package/dist/lib/node-esm/chunk-PVII2K2B.mjs +179 -0
  50. package/dist/lib/node-esm/chunk-PVII2K2B.mjs.map +7 -0
  51. package/dist/lib/node-esm/chunk-VSORIAHH.mjs +32 -0
  52. package/dist/lib/node-esm/chunk-VSORIAHH.mjs.map +7 -0
  53. package/dist/lib/node-esm/index.mjs +15 -11
  54. package/dist/lib/node-esm/index.mjs.map +1 -1
  55. package/dist/lib/node-esm/{intent-resolver-XWRVHP6H.mjs → intent-resolver-4RBV644N.mjs} +3 -3
  56. package/dist/lib/node-esm/meta.json +1 -1
  57. package/dist/lib/node-esm/meta.mjs +1 -1
  58. package/dist/lib/node-esm/{react-surface-4ZT5BQP6.mjs → react-surface-ZEVL3FXG.mjs} +5 -5
  59. package/dist/lib/node-esm/types/index.mjs +2 -2
  60. package/dist/types/src/components/ExplorerContainer.d.ts +4 -3
  61. package/dist/types/src/components/ExplorerContainer.d.ts.map +1 -1
  62. package/dist/types/src/components/Graph/D3ForceGraph.d.ts +14 -0
  63. package/dist/types/src/components/Graph/D3ForceGraph.d.ts.map +1 -0
  64. package/dist/types/src/components/Graph/D3ForceGraph.stories.d.ts +6 -0
  65. package/dist/types/src/components/Graph/D3ForceGraph.stories.d.ts.map +1 -0
  66. package/dist/types/src/components/Graph/ForceGraph.d.ts +8 -0
  67. package/dist/types/src/components/Graph/ForceGraph.d.ts.map +1 -0
  68. package/dist/types/src/components/Graph/{Graph.stories.d.ts → ForceGraph.stories.d.ts} +1 -1
  69. package/dist/types/src/components/Graph/ForceGraph.stories.d.ts.map +1 -0
  70. package/dist/types/src/components/Graph/adapter.d.ts +21 -0
  71. package/dist/types/src/components/Graph/adapter.d.ts.map +1 -0
  72. package/dist/types/src/components/Graph/index.d.ts +2 -2
  73. package/dist/types/src/components/Graph/index.d.ts.map +1 -1
  74. package/dist/types/src/components/Graph/testing.d.ts +14 -0
  75. package/dist/types/src/components/Graph/testing.d.ts.map +1 -0
  76. package/dist/types/src/components/Tree/Tree.d.ts.map +1 -1
  77. package/dist/types/src/components/Tree/testing/generator.d.ts +8 -0
  78. package/dist/types/src/components/Tree/testing/generator.d.ts.map +1 -0
  79. package/dist/types/src/components/Tree/testing/index.d.ts +2 -0
  80. package/dist/types/src/components/Tree/testing/index.d.ts.map +1 -0
  81. package/dist/types/src/components/Tree/types/index.d.ts +3 -0
  82. package/dist/types/src/components/Tree/types/index.d.ts.map +1 -0
  83. package/dist/types/src/components/Tree/types/tree.d.ts +83 -0
  84. package/dist/types/src/components/Tree/types/tree.d.ts.map +1 -0
  85. package/dist/types/src/components/Tree/types/tree.test.d.ts +2 -0
  86. package/dist/types/src/components/Tree/types/tree.test.d.ts.map +1 -0
  87. package/dist/types/src/components/Tree/types/types.d.ts +8 -0
  88. package/dist/types/src/components/Tree/types/types.d.ts.map +1 -0
  89. package/dist/types/src/components/index.d.ts +2 -2
  90. package/dist/types/src/hooks/index.d.ts +2 -0
  91. package/dist/types/src/hooks/index.d.ts.map +1 -0
  92. package/dist/types/src/hooks/useGraphModel.d.ts +4 -0
  93. package/dist/types/src/hooks/useGraphModel.d.ts.map +1 -0
  94. package/dist/types/src/index.d.ts +2 -1
  95. package/dist/types/src/index.d.ts.map +1 -1
  96. package/package.json +28 -28
  97. package/src/components/ExplorerContainer.tsx +11 -4
  98. package/src/components/Graph/D3ForceGraph.stories.tsx +64 -0
  99. package/src/components/Graph/D3ForceGraph.tsx +101 -0
  100. package/src/components/Graph/ForceGraph.stories.tsx +64 -0
  101. package/src/components/Graph/{Graph.tsx → ForceGraph.tsx} +19 -26
  102. package/src/components/Graph/adapter.ts +47 -0
  103. package/src/components/Graph/index.ts +2 -3
  104. package/src/components/Graph/testing.ts +57 -0
  105. package/src/components/Tree/Tree.stories.tsx +1 -1
  106. package/src/components/Tree/Tree.tsx +11 -18
  107. package/src/components/Tree/testing/generator.ts +46 -0
  108. package/src/components/Tree/testing/index.ts +5 -0
  109. package/src/components/Tree/types/index.ts +6 -0
  110. package/src/components/Tree/types/tree.test.ts +133 -0
  111. package/src/components/Tree/types/tree.ts +287 -0
  112. package/src/components/Tree/types/types.ts +41 -0
  113. package/src/hooks/index.ts +5 -0
  114. package/src/hooks/useGraphModel.ts +35 -0
  115. package/src/index.ts +2 -2
  116. package/src/meta.ts +2 -2
  117. package/dist/lib/browser/ExplorerContainer-6U4GS62Q.mjs +0 -27
  118. package/dist/lib/browser/ExplorerContainer-6U4GS62Q.mjs.map +0 -7
  119. package/dist/lib/browser/chunk-QRPUL5AH.mjs +0 -206
  120. package/dist/lib/browser/chunk-QRPUL5AH.mjs.map +0 -7
  121. package/dist/lib/node/ExplorerContainer-4RMWCWRX.cjs.map +0 -7
  122. package/dist/lib/node/chunk-4ZUNNUQD.cjs +0 -237
  123. package/dist/lib/node/chunk-4ZUNNUQD.cjs.map +0 -7
  124. package/dist/lib/node-esm/ExplorerContainer-3GOCCL7Q.mjs +0 -28
  125. package/dist/lib/node-esm/ExplorerContainer-3GOCCL7Q.mjs.map +0 -7
  126. package/dist/lib/node-esm/chunk-BJZBPCC3.mjs +0 -208
  127. package/dist/lib/node-esm/chunk-BJZBPCC3.mjs.map +0 -7
  128. package/dist/types/src/components/Graph/Graph.d.ts +0 -8
  129. package/dist/types/src/components/Graph/Graph.d.ts.map +0 -1
  130. package/dist/types/src/components/Graph/Graph.stories.d.ts.map +0 -1
  131. package/dist/types/src/components/Graph/graph-model.d.ts +0 -39
  132. package/dist/types/src/components/Graph/graph-model.d.ts.map +0 -1
  133. package/dist/types/src/components/Tree/types.d.ts +0 -8
  134. package/dist/types/src/components/Tree/types.d.ts.map +0 -1
  135. package/src/components/Graph/Graph.stories.tsx +0 -62
  136. package/src/components/Graph/graph-model.ts +0 -194
  137. package/src/components/Tree/types.ts +0 -40
  138. /package/dist/lib/browser/{intent-resolver-7JF4DU2C.mjs.map → intent-resolver-FJDVBDE3.mjs.map} +0 -0
  139. /package/dist/lib/browser/{react-surface-JLE6GLG6.mjs.map → react-surface-H3YDMXAQ.mjs.map} +0 -0
  140. /package/dist/lib/node/{intent-resolver-VDAHQEE7.cjs.map → intent-resolver-DRT67ZU4.cjs.map} +0 -0
  141. /package/dist/lib/node/{react-surface-F66QYWDR.cjs.map → react-surface-6ESLSM33.cjs.map} +0 -0
  142. /package/dist/lib/node-esm/{intent-resolver-XWRVHP6H.mjs.map → intent-resolver-4RBV644N.mjs.map} +0 -0
  143. /package/dist/lib/node-esm/{react-surface-4ZT5BQP6.mjs.map → react-surface-ZEVL3FXG.mjs.map} +0 -0
@@ -1,14 +1,14 @@
1
1
  import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
2
  import {
3
3
  ExplorerContainer
4
- } from "./chunk-MUHCE377.mjs";
5
- import "./chunk-BJZBPCC3.mjs";
4
+ } from "./chunk-34X2VFQN.mjs";
5
+ import "./chunk-PVII2K2B.mjs";
6
6
  import {
7
7
  ViewType
8
- } from "./chunk-QOJSLABX.mjs";
8
+ } from "./chunk-N6VEANUZ.mjs";
9
9
  import {
10
10
  EXPLORER_PLUGIN
11
- } from "./chunk-PUFSCMN4.mjs";
11
+ } from "./chunk-3CMBLK6W.mjs";
12
12
 
13
13
  // packages/plugins/plugin-explorer/src/capabilities/react-surface.tsx
14
14
  import React from "react";
@@ -29,4 +29,4 @@ var react_surface_default = () => contributes(Capabilities.ReactSurface, createS
29
29
  export {
30
30
  react_surface_default as default
31
31
  };
32
- //# sourceMappingURL=react-surface-4ZT5BQP6.mjs.map
32
+ //# sourceMappingURL=react-surface-ZEVL3FXG.mjs.map
@@ -2,8 +2,8 @@ import { createRequire } from 'node:module';const require = createRequire(import
2
2
  import {
3
3
  ExplorerAction,
4
4
  ViewType
5
- } from "../chunk-QOJSLABX.mjs";
6
- import "../chunk-PUFSCMN4.mjs";
5
+ } from "../chunk-N6VEANUZ.mjs";
6
+ import "../chunk-3CMBLK6W.mjs";
7
7
  export {
8
8
  ExplorerAction,
9
9
  ViewType
@@ -1,8 +1,9 @@
1
1
  import React from 'react';
2
2
  import { type ViewType } from '../types';
3
- declare const ExplorerContainer: ({ view, role }: {
4
- view: ViewType;
3
+ type ExplorerContainerProps = {
5
4
  role: string;
6
- }) => React.JSX.Element | null;
5
+ view: ViewType;
6
+ };
7
+ declare const ExplorerContainer: ({ role, view }: ExplorerContainerProps) => React.JSX.Element | null;
7
8
  export default ExplorerContainer;
8
9
  //# sourceMappingURL=ExplorerContainer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ExplorerContainer.d.ts","sourceRoot":"","sources":["../../../../src/components/ExplorerContainer.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEzC,QAAA,MAAM,iBAAiB,GAAI,gBAAgB;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,6BAa1E,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
1
+ {"version":3,"file":"ExplorerContainer.d.ts","sourceRoot":"","sources":["../../../../src/components/ExplorerContainer.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEzC,KAAK,sBAAsB,GAAG;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,QAAQ,CAAC;CAChB,CAAC;AAEF,QAAA,MAAM,iBAAiB,GAAI,gBAAgB,sBAAsB,6BAchE,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { type FC } from 'react';
2
+ import { SelectionModel } from '@dxos/graph';
3
+ import { type ThemedClassName } from '@dxos/react-ui';
4
+ import { type GraphProps } from '@dxos/react-ui-graph';
5
+ import { type SpaceGraphModel } from '@dxos/schema';
6
+ import '@dxos/react-ui-graph/styles/graph.css';
7
+ export type D3ForceGraphProps = ThemedClassName<{
8
+ model?: SpaceGraphModel;
9
+ match?: RegExp;
10
+ selection?: SelectionModel;
11
+ grid?: boolean;
12
+ } & Pick<GraphProps, 'drag'>>;
13
+ export declare const D3ForceGraph: FC<D3ForceGraphProps>;
14
+ //# sourceMappingURL=D3ForceGraph.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"D3ForceGraph.d.ts","sourceRoot":"","sources":["../../../../../src/components/Graph/D3ForceGraph.tsx"],"names":[],"mappings":"AAIA,OAAc,EAAE,KAAK,EAAE,EAA2C,MAAM,OAAO,CAAC;AAGhF,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAIL,KAAK,UAAU,EAGhB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAuB,KAAK,eAAe,EAAuB,MAAM,cAAc,CAAC;AAE9F,OAAO,uCAAuC,CAAC;AAE/C,MAAM,MAAM,iBAAiB,GAAG,eAAe,CAC7C;IACE,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,cAAc,CAAC;IAC3B,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB,GAAG,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC,CAC7B,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,EAAE,CAAC,iBAAiB,CAqE9C,CAAC"}
@@ -0,0 +1,6 @@
1
+ import '@dxos-theme';
2
+ import { type Meta } from '@storybook/react';
3
+ declare const meta: Meta;
4
+ export default meta;
5
+ export declare const Default: {};
6
+ //# sourceMappingURL=D3ForceGraph.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"D3ForceGraph.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/Graph/D3ForceGraph.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAErB,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAyC7C,QAAA,MAAM,IAAI,EAAE,IAYX,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,eAAO,MAAM,OAAO,IAAK,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { type FC } from 'react';
2
+ import { type SpaceGraphModel } from '@dxos/schema';
3
+ export type ForceGraphProps = {
4
+ model?: SpaceGraphModel;
5
+ match?: RegExp;
6
+ };
7
+ export declare const ForceGraph: FC<ForceGraphProps>;
8
+ //# sourceMappingURL=ForceGraph.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ForceGraph.d.ts","sourceRoot":"","sources":["../../../../../src/components/Graph/ForceGraph.tsx"],"names":[],"mappings":"AAMA,OAAc,EAAE,KAAK,EAAE,EAAqB,MAAM,OAAO,CAAC;AAI1D,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AAIpD,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,EAAE,CAAC,eAAe,CA+D1C,CAAC"}
@@ -3,4 +3,4 @@ import { type Meta } from '@storybook/react';
3
3
  declare const meta: Meta;
4
4
  export default meta;
5
5
  export declare const Default: {};
6
- //# sourceMappingURL=Graph.stories.d.ts.map
6
+ //# sourceMappingURL=ForceGraph.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ForceGraph.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/Graph/ForceGraph.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAErB,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAyC7C,QAAA,MAAM,IAAI,EAAE,IAYX,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,eAAO,MAAM,OAAO,IAAK,CAAC"}
@@ -0,0 +1,21 @@
1
+ import { type Graph } from '@dxos/graph';
2
+ export type GraphNode = {
3
+ id?: string;
4
+ };
5
+ export type GraphLink = {
6
+ source?: string;
7
+ target?: string;
8
+ };
9
+ export type GraphData = {
10
+ nodes: GraphNode[];
11
+ links: GraphLink[];
12
+ };
13
+ export declare class GraphAdapter implements GraphData {
14
+ private readonly graph;
15
+ private readonly _nodes;
16
+ private readonly _links;
17
+ constructor(graph: Graph);
18
+ get nodes(): GraphNode[];
19
+ get links(): GraphLink[];
20
+ }
21
+ //# sourceMappingURL=adapter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../../../../src/components/Graph/adapter.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,aAAa,CAAC;AAEzC,MAAM,MAAM,SAAS,GAAG;IACtB,EAAE,CAAC,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG;IACtB,KAAK,EAAE,SAAS,EAAE,CAAC;IACnB,KAAK,EAAE,SAAS,EAAE,CAAC;CACpB,CAAC;AAEF,qBAAa,YAAa,YAAW,SAAS;IAIhC,OAAO,CAAC,QAAQ,CAAC,KAAK;IAHlC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAmB;IAC1C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAmB;gBAEb,KAAK,EAAE,KAAK;IAezC,IAAI,KAAK,gBAER;IAED,IAAI,KAAK,gBAER;CACF"}
@@ -1,3 +1,3 @@
1
- export * from './graph-model';
2
- export * from './Graph';
1
+ export * from './D3ForceGraph';
2
+ export * from './ForceGraph';
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/Graph/index.ts"],"names":[],"mappings":"AAIA,cAAc,eAAe,CAAC;AAE9B,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/Graph/index.ts"],"names":[],"mappings":"AAIA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { type Space } from '@dxos/client/echo';
2
+ import { type ValueGenerator, type TypeSpec } from '@dxos/schema/testing';
3
+ export type GenerateOptions = {
4
+ spec?: TypeSpec[];
5
+ relations?: {
6
+ count: number;
7
+ kind: string;
8
+ };
9
+ };
10
+ /**
11
+ * @deprecated Use @dxos/schema.
12
+ */
13
+ export declare const generate: (space: Space, generator: ValueGenerator, { spec, relations }?: GenerateOptions) => Promise<void>;
14
+ //# sourceMappingURL=testing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"testing.d.ts","sourceRoot":"","sources":["../../../../../src/components/Graph/testing.ts"],"names":[],"mappings":"AAIA,OAAO,EAA4B,KAAK,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAGzE,OAAO,EAAuB,KAAK,cAAc,EAAE,KAAK,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAW/F,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,CAAC,EAAE,QAAQ,EAAE,CAAC;IAClB,SAAS,CAAC,EAAE;QACV,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;CACH,CAAC;AAIF;;GAEG;AACH,eAAO,MAAM,QAAQ,GACnB,OAAO,KAAK,EACZ,WAAW,cAAc,EACzB,sBAAuD,eAAoB,kBAsB5E,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Tree.d.ts","sourceRoot":"","sources":["../../../../../src/components/Tree/Tree.tsx"],"names":[],"mappings":"AAIA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAGnD,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAa/C,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,CAAC;AAGvD,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,KAAK,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK,MAAM,CAAC;IAE1B,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,CAAC,CAAC,EAAE,MAAM,CAAC;CACZ,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,eAIpC,CAAC;AAQF,MAAM,MAAM,kBAAkB,CAAC,CAAC,GAAG,OAAO,IAAI;IAC5C,KAAK,EAAE,KAAK,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,WAAW,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,KAAK,IAAI,CAAC;CAClC,CAAC;AAGF,eAAO,MAAM,IAAI,GAAI,CAAC,EAAG,2CAAoD,kBAAkB,CAAC,CAAC,CAAC,sBAiDjG,CAAC"}
1
+ {"version":3,"file":"Tree.d.ts","sourceRoot":"","sources":["../../../../../src/components/Tree/Tree.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAE3D,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAa/C,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,CAAC;AAGvD,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,KAAK,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK,MAAM,CAAC;IAE1B,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,CAAC,CAAC,EAAE,MAAM,CAAC;CACZ,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,eAIpC,CAAC;AAQF,MAAM,MAAM,kBAAkB,CAAC,CAAC,GAAG,OAAO,IAAI;IAC5C,KAAK,EAAE,KAAK,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,WAAW,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,KAAK,IAAI,CAAC;CAClC,CAAC;AAGF,eAAO,MAAM,IAAI,GAAI,CAAC,EAAG,2CAAoD,kBAAkB,CAAC,CAAC,CAAC,sBA2CjG,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { Tree } from '../types';
2
+ type NumberOrNumberArray = number | number[];
3
+ /**
4
+ * Create hierarchical tree.
5
+ */
6
+ export declare const createTree: (spec?: NumberOrNumberArray[], createText?: () => string) => Tree;
7
+ export {};
8
+ //# sourceMappingURL=generator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generator.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Tree/testing/generator.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,IAAI,EAAqB,MAAM,UAAU,CAAC;AAEnD,KAAK,mBAAmB,GAAG,MAAM,GAAG,MAAM,EAAE,CAAC;AAI7C;;GAEG;AACH,eAAO,MAAM,UAAU,GAAI,OAAM,mBAAmB,EAAO,EAAE,aAAa,MAAM,MAAM,KAAG,IA6BxF,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './generator';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Tree/testing/index.ts"],"names":[],"mappings":"AAIA,cAAc,aAAa,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from './tree';
2
+ export * from './types';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Tree/types/index.ts"],"names":[],"mappings":"AAIA,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC"}
@@ -0,0 +1,83 @@
1
+ import { Schema } from 'effect';
2
+ import { Type } from '@dxos/echo';
3
+ import { ObjectId } from '@dxos/echo-schema';
4
+ export declare const TreeNodeType: Schema.mutable<Schema.Struct<{
5
+ id: import("@dxos/keys").ObjectIdClass;
6
+ children: Schema.mutable<Schema.Array$<import("@dxos/keys").ObjectIdClass>>;
7
+ data: Schema.mutable<Schema.Record$<typeof Schema.String, typeof Schema.Any>>;
8
+ ref: Schema.optional<import("@dxos/echo-schema").Ref$<Type.Expando>>;
9
+ }>>;
10
+ export interface TreeNodeType extends Schema.Schema.Type<typeof TreeNodeType> {
11
+ }
12
+ export declare const TreeType: import("@dxos/echo-schema").EchoTypeSchema<Schema.Struct<{
13
+ root: import("@dxos/keys").ObjectIdClass;
14
+ nodes: Schema.mutable<Schema.Record$<import("@dxos/keys").ObjectIdClass, Schema.mutable<Schema.Struct<{
15
+ id: import("@dxos/keys").ObjectIdClass;
16
+ children: Schema.mutable<Schema.Array$<import("@dxos/keys").ObjectIdClass>>;
17
+ data: Schema.mutable<Schema.Record$<typeof Schema.String, typeof Schema.Any>>;
18
+ ref: Schema.optional<import("@dxos/echo-schema").Ref$<Type.Expando>>;
19
+ }>>>>;
20
+ }>, {}>;
21
+ export interface TreeType extends Schema.Schema.Type<typeof TreeType> {
22
+ }
23
+ /**
24
+ * Wrapper object for tree.
25
+ */
26
+ export declare class Tree {
27
+ static create: () => TreeType;
28
+ private _tree;
29
+ constructor(tree?: TreeType);
30
+ get tree(): TreeType;
31
+ get size(): number;
32
+ get root(): TreeNodeType;
33
+ /**
34
+ * Recursively traverse the tree until the callback returns a value.
35
+ */
36
+ tranverse<T>(callback: (node: TreeNodeType, depth: number) => T | void, root?: ObjectId, depth?: number): T | void;
37
+ getNode(id: ObjectId): TreeNodeType;
38
+ /**
39
+ * Get the children of a node.
40
+ */
41
+ getChildNodes(node: TreeNodeType): Array<TreeNodeType>;
42
+ /**
43
+ * Get the parent of a node.
44
+ */
45
+ getParent(node: TreeNodeType): TreeNodeType | null;
46
+ /**
47
+ * Get the next node in the tree.
48
+ */
49
+ getNext(node: TreeNodeType, hierarchical?: boolean): TreeNodeType | undefined;
50
+ /**
51
+ * Get the previous node in the tree.
52
+ */
53
+ getPrevious(node: TreeNodeType, hierarchical?: boolean): TreeNodeType | undefined;
54
+ /**
55
+ * Get the last descendent of a node.
56
+ */
57
+ getLastDescendent(node: TreeNodeType): TreeNodeType | undefined;
58
+ /**
59
+ * Clear tree.
60
+ */
61
+ clear(): void;
62
+ /**
63
+ * Add node.
64
+ */
65
+ addNode(parent: TreeNodeType, node?: TreeNodeType, index?: number): TreeNodeType;
66
+ /**
67
+ * Delete node.
68
+ */
69
+ deleteNode(parent: TreeNodeType, id: ObjectId): TreeNodeType | undefined;
70
+ /**
71
+ * Move child node.
72
+ */
73
+ moveNode(node: TreeNodeType, from: number, to: number): TreeNodeType | null;
74
+ /**
75
+ * Indent node.
76
+ */
77
+ indentNode(node: TreeNodeType): void;
78
+ /**
79
+ * Unindent node.
80
+ */
81
+ unindentNode(node: TreeNodeType): void;
82
+ }
83
+ //# sourceMappingURL=tree.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tree.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Tree/types/tree.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAgB,MAAM,mBAAmB,CAAC;AAM3D,eAAO,MAAM,YAAY;;;;;GAKF,CAAC;AAExB,MAAM,WAAW,YAAa,SAAQ,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,YAAY,CAAC;CAAG;AAEhF,eAAO,MAAM,QAAQ;;;;;;;;OAQpB,CAAC;AAEF,MAAM,WAAW,QAAS,SAAQ,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,QAAQ,CAAC;CAAG;AAExE;;GAEG;AACH,qBAAa,IAAI;IACf,MAAM,CAAC,MAAM,QAAO,QAAQ,CAY1B;IAEF,OAAO,CAAC,KAAK,CAAW;gBAEZ,IAAI,CAAC,EAAE,QAAQ;IAI3B,IAAI,IAAI,aAEP;IAGD,IAAI,IAAI,WAEP;IAED,IAAI,IAAI,iBAEP;IAMD;;OAEG;IACH,SAAS,CAAC,CAAC,EACT,QAAQ,EAAE,CAAC,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,KAAK,CAAC,GAAG,IAAI,EACzD,IAAI,GAAE,QAA0B,EAChC,KAAK,SAAI,GACR,CAAC,GAAG,IAAI;IAeX,OAAO,CAAC,EAAE,EAAE,QAAQ,GAAG,YAAY;IAMnC;;OAEG;IACH,aAAa,CAAC,IAAI,EAAE,YAAY,GAAG,KAAK,CAAC,YAAY,CAAC;IAItD;;OAEG;IACH,SAAS,CAAC,IAAI,EAAE,YAAY,GAAG,YAAY,GAAG,IAAI;IAUlD;;OAEG;IACH,OAAO,CAAC,IAAI,EAAE,YAAY,EAAE,YAAY,UAAO,GAAG,YAAY,GAAG,SAAS;IAmB1E;;OAEG;IACH,WAAW,CAAC,IAAI,EAAE,YAAY,EAAE,YAAY,UAAO,GAAG,YAAY,GAAG,SAAS;IAiB9E;;OAEG;IACH,iBAAiB,CAAC,IAAI,EAAE,YAAY,GAAG,YAAY,GAAG,SAAS;IAc/D;;OAEG;IACH,KAAK,IAAI,IAAI;IAQb;;OAEG;IACH,OAAO,CAAC,MAAM,EAAE,YAAY,EAAE,IAAI,CAAC,EAAE,YAAY,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,YAAY;IAWhF;;OAEG;IACH,UAAU,CAAC,MAAM,EAAE,YAAY,EAAE,EAAE,EAAE,QAAQ,GAAG,YAAY,GAAG,SAAS;IAexE;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,YAAY,GAAG,IAAI;IAa3E;;OAEG;IACH,UAAU,CAAC,IAAI,EAAE,YAAY,GAAG,IAAI;IAgBpC;;OAEG;IACH,YAAY,CAAC,IAAI,EAAE,YAAY,GAAG,IAAI;CAuBvC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=tree.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tree.test.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Tree/types/tree.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,8 @@
1
+ import { type GraphModel } from '@dxos/graph';
2
+ export type TreeNode = {
3
+ id: string;
4
+ label?: string;
5
+ children?: TreeNode[];
6
+ };
7
+ export declare const mapGraphToTreeData: (model: GraphModel, maxDepth?: number) => TreeNode | undefined;
8
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Tree/types/types.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C,MAAM,MAAM,QAAQ,GAAG;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,QAAQ,EAAE,CAAC;CACvB,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,OAAO,UAAU,EAAE,iBAAY,KAAG,QAAQ,GAAG,SA4B/E,CAAC"}
@@ -1,6 +1,6 @@
1
- export declare const ExplorerContainer: import("react").LazyExoticComponent<({ view, role }: {
2
- view: import("../types").ViewType;
1
+ export declare const ExplorerContainer: import("react").LazyExoticComponent<({ role, view }: {
3
2
  role: string;
3
+ view: import("../types").ViewType;
4
4
  }) => import("react").JSX.Element | null>;
5
5
  export * from './Chart';
6
6
  export * from './Globe';
@@ -0,0 +1,2 @@
1
+ export * from './useGraphModel';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/hooks/index.ts"],"names":[],"mappings":"AAIA,cAAc,iBAAiB,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { type Filter, type Space } from '@dxos/client/echo';
2
+ import { SpaceGraphModel, type SpaceGraphModelOptions } from '@dxos/schema';
3
+ export declare const useGraphModel: (space: Space | undefined, filter?: Filter.Any | undefined, options?: SpaceGraphModelOptions) => SpaceGraphModel | undefined;
4
+ //# sourceMappingURL=useGraphModel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useGraphModel.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useGraphModel.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,KAAK,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAG5E,eAAO,MAAM,aAAa,GACxB,OAAO,KAAK,GAAG,SAAS,EACxB,SAAS,MAAM,CAAC,GAAG,GAAG,SAAS,EAC/B,UAAU,sBAAsB,KAC/B,eAAe,GAAG,SAoBpB,CAAC"}
@@ -1,4 +1,5 @@
1
1
  export * from './components';
2
- export * from './ExplorerPlugin';
2
+ export * from './hooks';
3
3
  export * from './meta';
4
+ export * from './ExplorerPlugin';
4
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAKA,cAAc,cAAc,CAAC;AAE7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,QAAQ,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAIA,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AAEvB,cAAc,kBAAkB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/plugin-explorer",
3
- "version": "0.8.2-main.fbd8ed0",
3
+ "version": "0.8.2-staging.42af850",
4
4
  "description": "Braneframe data visualization plugin",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
@@ -35,30 +35,32 @@
35
35
  "dependencies": {
36
36
  "3d-force-graph": "^1.76.1",
37
37
  "@observablehq/plot": "^0.6.11",
38
- "@preact/signals-core": "^1.6.0",
38
+ "@preact-signals/safe-react": "^0.9.0",
39
+ "@preact/signals-core": "^1.9.0",
39
40
  "d3": "^7.9.0",
40
41
  "effect": "^3.13.3",
41
42
  "force-graph": "^1.49.4",
42
43
  "lodash.defaultsdeep": "^4.6.1",
43
- "lodash.get": "^4.4.2",
44
44
  "react-resize-detector": "^11.0.1",
45
45
  "topojson-client": "^3.1.0",
46
- "@dxos/app-framework": "0.8.2-main.fbd8ed0",
47
- "@dxos/async": "0.8.2-main.fbd8ed0",
48
- "@dxos/client": "0.8.2-main.fbd8ed0",
49
- "@dxos/echo": "0.8.2-main.fbd8ed0",
50
- "@dxos/echo-schema": "0.8.2-main.fbd8ed0",
51
- "@dxos/gem-spore": "0.8.2-main.fbd8ed0",
52
- "@dxos/live-object": "0.8.2-main.fbd8ed0",
53
- "@dxos/gem-core": "0.8.2-main.fbd8ed0",
54
- "@dxos/log": "0.8.2-main.fbd8ed0",
55
- "@dxos/plugin-client": "0.8.2-main.fbd8ed0",
56
- "@dxos/plugin-search": "0.8.2-main.fbd8ed0",
57
- "@dxos/plugin-space": "0.8.2-main.fbd8ed0",
58
- "@dxos/plugin-graph": "0.8.2-main.fbd8ed0",
59
- "@dxos/react-client": "0.8.2-main.fbd8ed0",
60
- "@dxos/react-ui-stack": "0.8.2-main.fbd8ed0",
61
- "@dxos/util": "0.8.2-main.fbd8ed0"
46
+ "@dxos/app-framework": "0.8.2-staging.42af850",
47
+ "@dxos/async": "0.8.2-staging.42af850",
48
+ "@dxos/client": "0.8.2-staging.42af850",
49
+ "@dxos/echo": "0.8.2-staging.42af850",
50
+ "@dxos/echo-schema": "0.8.2-staging.42af850",
51
+ "@dxos/invariant": "0.8.2-staging.42af850",
52
+ "@dxos/graph": "0.8.2-staging.42af850",
53
+ "@dxos/log": "0.8.2-staging.42af850",
54
+ "@dxos/live-object": "0.8.2-staging.42af850",
55
+ "@dxos/plugin-client": "0.8.2-staging.42af850",
56
+ "@dxos/plugin-graph": "0.8.2-staging.42af850",
57
+ "@dxos/plugin-space": "0.8.2-staging.42af850",
58
+ "@dxos/plugin-search": "0.8.2-staging.42af850",
59
+ "@dxos/react-ui-graph": "0.8.2-staging.42af850",
60
+ "@dxos/react-client": "0.8.2-staging.42af850",
61
+ "@dxos/react-ui-stack": "0.8.2-staging.42af850",
62
+ "@dxos/schema": "0.8.2-staging.42af850",
63
+ "@dxos/util": "0.8.2-staging.42af850"
62
64
  },
63
65
  "devDependencies": {
64
66
  "@phosphor-icons/react": "^2.1.5",
@@ -69,24 +71,22 @@
69
71
  "@types/react-dom": "~18.2.0",
70
72
  "@types/topojson-client": "^3.1.4",
71
73
  "@types/topojson-specification": "^1.0.5",
72
- "lodash.get": "^4.4.2",
73
74
  "react": "~18.2.0",
74
75
  "react-dom": "~18.2.0",
75
76
  "vite": "5.4.7",
76
- "@dxos/plugin-outliner": "0.8.2-main.fbd8ed0",
77
- "@dxos/react-ui": "0.8.2-main.fbd8ed0",
78
- "@dxos/random": "0.8.2-main.fbd8ed0",
79
- "@dxos/echo-generator": "0.8.2-main.fbd8ed0",
80
- "@dxos/storybook-utils": "0.8.2-main.fbd8ed0",
81
- "@dxos/react-ui-theme": "0.8.2-main.fbd8ed0"
77
+ "@dxos/react-ui-theme": "0.8.2-staging.42af850",
78
+ "@dxos/random": "0.8.2-staging.42af850",
79
+ "@dxos/storybook-utils": "0.8.2-staging.42af850",
80
+ "@dxos/react-ui": "0.8.2-staging.42af850",
81
+ "@dxos/echo-generator": "0.8.2-staging.42af850"
82
82
  },
83
83
  "peerDependencies": {
84
84
  "@phosphor-icons/react": "^2.1.5",
85
85
  "effect": "^3.13.3",
86
86
  "react": "~18.2.0",
87
87
  "react-dom": "~18.2.0",
88
- "@dxos/react-ui-theme": "0.8.2-main.fbd8ed0",
89
- "@dxos/react-ui": "0.8.2-main.fbd8ed0"
88
+ "@dxos/react-ui": "0.8.2-staging.42af850",
89
+ "@dxos/react-ui-theme": "0.8.2-staging.42af850"
90
90
  },
91
91
  "publishConfig": {
92
92
  "access": "public"
@@ -8,20 +8,27 @@ import { useGlobalSearch } from '@dxos/plugin-search';
8
8
  import { getSpace } from '@dxos/react-client/echo';
9
9
  import { StackItem } from '@dxos/react-ui-stack';
10
10
 
11
- import { Graph } from './Graph';
11
+ import { ForceGraph } from './Graph';
12
+ import { useGraphModel } from '../hooks';
12
13
  import { type ViewType } from '../types';
13
14
 
14
- const ExplorerContainer = ({ view, role }: { view: ViewType; role: string }) => {
15
+ type ExplorerContainerProps = {
16
+ role: string;
17
+ view: ViewType;
18
+ };
19
+
20
+ const ExplorerContainer = ({ role, view }: ExplorerContainerProps) => {
15
21
  const space = getSpace(view);
16
22
  const { match } = useGlobalSearch();
23
+ const model = useGraphModel(space);
17
24
 
18
- if (!space) {
25
+ if (!model || !space) {
19
26
  return null;
20
27
  }
21
28
 
22
29
  return (
23
30
  <StackItem.Content size={role === 'section' ? 'square' : 'intrinsic'}>
24
- <Graph space={space} match={match} />
31
+ <ForceGraph model={model} match={match} />
25
32
  </StackItem.Content>
26
33
  );
27
34
  };
@@ -0,0 +1,64 @@
1
+ //
2
+ // Copyright 2023 DXOS.org
3
+ //
4
+
5
+ import '@dxos-theme';
6
+
7
+ import { type Meta } from '@storybook/react';
8
+ import React, { useEffect, useState } from 'react';
9
+
10
+ import { faker } from '@dxos/random';
11
+ import { useClient } from '@dxos/react-client';
12
+ import { live } from '@dxos/react-client/echo';
13
+ import { type Space } from '@dxos/react-client/echo';
14
+ import { withClientProvider } from '@dxos/react-client/testing';
15
+ import { DataType } from '@dxos/schema';
16
+ import { type ValueGenerator } from '@dxos/schema/testing';
17
+ import { withLayout, withTheme, render } from '@dxos/storybook-utils';
18
+
19
+ import { D3ForceGraph } from './D3ForceGraph';
20
+ import { generate } from './testing';
21
+ import { useGraphModel } from '../../hooks';
22
+ import { ViewType } from '../../types';
23
+
24
+ const generator = faker as any as ValueGenerator;
25
+
26
+ faker.seed(1);
27
+
28
+ const DefaultStory = () => {
29
+ const client = useClient();
30
+ const [space, setSpace] = useState<Space>();
31
+ const [view, setView] = useState<ViewType>();
32
+ useEffect(() => {
33
+ const space = client.spaces.default;
34
+ void generate(space, generator);
35
+ const view = space.db.add(live(ViewType, { name: '', type: '' }));
36
+ setSpace(space);
37
+ setView(view);
38
+ }, []);
39
+
40
+ const model = useGraphModel(space);
41
+ if (!model || !space || !view) {
42
+ return null;
43
+ }
44
+
45
+ return <D3ForceGraph model={model} />;
46
+ };
47
+
48
+ const meta: Meta = {
49
+ title: 'plugins/plugin-explorer/D3ForceGraph',
50
+ component: D3ForceGraph,
51
+ render: render(DefaultStory),
52
+ decorators: [
53
+ withClientProvider({
54
+ createSpace: true,
55
+ types: [ViewType, DataType.Organization, DataType.Project, DataType.Person, DataType.HasRelationship],
56
+ }),
57
+ withTheme,
58
+ withLayout({ fullscreen: true }),
59
+ ],
60
+ };
61
+
62
+ export default meta;
63
+
64
+ export const Default = {};