@dxos/plugin-explorer 0.8.1 → 0.8.2-main.10c050d

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 (170) 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-B2DMPSP5.mjs → chunk-73GQ46YO.mjs} +430 -170
  4. package/dist/lib/{node-esm/chunk-PZOORWFE.mjs.map → browser/chunk-73GQ46YO.mjs.map} +4 -4
  5. package/dist/lib/browser/{chunk-QLQLPZNI.mjs → chunk-73YTQHOT.mjs} +12 -11
  6. package/dist/lib/browser/chunk-73YTQHOT.mjs.map +7 -0
  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-NHHRWTOP.mjs → intent-resolver-FJDVBDE3.mjs} +5 -5
  16. package/dist/lib/browser/intent-resolver-FJDVBDE3.mjs.map +7 -0
  17. package/dist/lib/browser/meta.json +1 -1
  18. package/dist/lib/browser/meta.mjs +1 -1
  19. package/dist/lib/browser/{react-surface-N7TC6BMF.mjs → react-surface-H3YDMXAQ.mjs} +5 -5
  20. package/dist/lib/browser/types/index.mjs +2 -2
  21. package/dist/lib/node/{ExplorerContainer-73AHSBAG.cjs → ExplorerContainer-MVP2AM7R.cjs} +24 -16
  22. package/dist/lib/node/ExplorerContainer-MVP2AM7R.cjs.map +7 -0
  23. package/dist/lib/node/chunk-4T4LCT5R.cjs +52 -0
  24. package/dist/lib/node/chunk-4T4LCT5R.cjs.map +7 -0
  25. package/dist/lib/node/{chunk-HCDBN6NN.cjs → chunk-72H5HBTK.cjs} +429 -168
  26. package/dist/lib/node/chunk-72H5HBTK.cjs.map +7 -0
  27. package/dist/lib/node/{chunk-VB3QE6XY.cjs → chunk-BCDVG2CH.cjs} +6 -6
  28. package/dist/lib/node/{chunk-VB3QE6XY.cjs.map → chunk-BCDVG2CH.cjs.map} +1 -1
  29. package/dist/lib/node/{chunk-YLL7H7CZ.cjs → chunk-MLRYW4WQ.cjs} +15 -14
  30. package/dist/lib/node/chunk-MLRYW4WQ.cjs.map +7 -0
  31. package/dist/lib/node/chunk-NELWWGBU.cjs +204 -0
  32. package/dist/lib/node/chunk-NELWWGBU.cjs.map +7 -0
  33. package/dist/lib/node/index.cjs +34 -31
  34. package/dist/lib/node/index.cjs.map +1 -1
  35. package/dist/lib/node/{intent-resolver-EEOTX3OZ.cjs → intent-resolver-DRT67ZU4.cjs} +8 -8
  36. package/dist/lib/node/intent-resolver-DRT67ZU4.cjs.map +7 -0
  37. package/dist/lib/node/meta.cjs +3 -3
  38. package/dist/lib/node/meta.cjs.map +1 -1
  39. package/dist/lib/node/meta.json +1 -1
  40. package/dist/lib/node/{react-surface-WD4G2NRS.cjs → react-surface-6ESLSM33.cjs} +11 -11
  41. package/dist/lib/node/types/index.cjs +4 -4
  42. package/dist/lib/node/types/index.cjs.map +1 -1
  43. package/dist/lib/node-esm/ExplorerContainer-APGUQI4M.mjs +38 -0
  44. package/dist/lib/node-esm/ExplorerContainer-APGUQI4M.mjs.map +7 -0
  45. package/dist/lib/node-esm/{chunk-PZOORWFE.mjs → chunk-34X2VFQN.mjs} +430 -169
  46. package/dist/lib/{browser/chunk-B2DMPSP5.mjs.map → node-esm/chunk-34X2VFQN.mjs.map} +4 -4
  47. package/dist/lib/node-esm/{chunk-PUFSCMN4.mjs → chunk-3CMBLK6W.mjs} +3 -3
  48. package/dist/lib/node-esm/{chunk-PUFSCMN4.mjs.map → chunk-3CMBLK6W.mjs.map} +1 -1
  49. package/dist/lib/node-esm/{chunk-QZH2GDN5.mjs → chunk-N6VEANUZ.mjs} +12 -11
  50. package/dist/lib/node-esm/chunk-N6VEANUZ.mjs.map +7 -0
  51. package/dist/lib/node-esm/chunk-PVII2K2B.mjs +179 -0
  52. package/dist/lib/node-esm/chunk-PVII2K2B.mjs.map +7 -0
  53. package/dist/lib/node-esm/chunk-VSORIAHH.mjs +32 -0
  54. package/dist/lib/node-esm/chunk-VSORIAHH.mjs.map +7 -0
  55. package/dist/lib/node-esm/index.mjs +15 -11
  56. package/dist/lib/node-esm/index.mjs.map +1 -1
  57. package/dist/lib/node-esm/{intent-resolver-PTFKXAT4.mjs → intent-resolver-4RBV644N.mjs} +5 -5
  58. package/dist/lib/node-esm/intent-resolver-4RBV644N.mjs.map +7 -0
  59. package/dist/lib/node-esm/meta.json +1 -1
  60. package/dist/lib/node-esm/meta.mjs +1 -1
  61. package/dist/lib/node-esm/{react-surface-J5SW7VF2.mjs → react-surface-ZEVL3FXG.mjs} +5 -5
  62. package/dist/lib/node-esm/types/index.mjs +2 -2
  63. package/dist/types/src/components/Chart/Chart.d.ts.map +1 -1
  64. package/dist/types/src/components/ExplorerContainer.d.ts +4 -3
  65. package/dist/types/src/components/ExplorerContainer.d.ts.map +1 -1
  66. package/dist/types/src/components/Globe/Globe.d.ts.map +1 -1
  67. package/dist/types/src/components/Graph/D3ForceGraph.d.ts +14 -0
  68. package/dist/types/src/components/Graph/D3ForceGraph.d.ts.map +1 -0
  69. package/dist/types/src/components/Graph/D3ForceGraph.stories.d.ts +6 -0
  70. package/dist/types/src/components/Graph/D3ForceGraph.stories.d.ts.map +1 -0
  71. package/dist/types/src/components/Graph/ForceGraph.d.ts +8 -0
  72. package/dist/types/src/components/Graph/ForceGraph.d.ts.map +1 -0
  73. package/dist/types/src/components/Graph/{Graph.stories.d.ts → ForceGraph.stories.d.ts} +1 -1
  74. package/dist/types/src/components/Graph/ForceGraph.stories.d.ts.map +1 -0
  75. package/dist/types/src/components/Graph/adapter.d.ts +21 -0
  76. package/dist/types/src/components/Graph/adapter.d.ts.map +1 -0
  77. package/dist/types/src/components/Graph/index.d.ts +2 -2
  78. package/dist/types/src/components/Graph/index.d.ts.map +1 -1
  79. package/dist/types/src/components/Graph/testing.d.ts +14 -0
  80. package/dist/types/src/components/Graph/testing.d.ts.map +1 -0
  81. package/dist/types/src/components/Tree/Tree.d.ts.map +1 -1
  82. package/dist/types/src/components/Tree/layout/HierarchicalEdgeBundling.d.ts.map +1 -1
  83. package/dist/types/src/components/Tree/layout/RadialTree.d.ts.map +1 -1
  84. package/dist/types/src/components/Tree/layout/TidyTree.d.ts.map +1 -1
  85. package/dist/types/src/components/Tree/testing/generator.d.ts +8 -0
  86. package/dist/types/src/components/Tree/testing/generator.d.ts.map +1 -0
  87. package/dist/types/src/components/Tree/testing/index.d.ts +2 -0
  88. package/dist/types/src/components/Tree/testing/index.d.ts.map +1 -0
  89. package/dist/types/src/components/Tree/types/index.d.ts +3 -0
  90. package/dist/types/src/components/Tree/types/index.d.ts.map +1 -0
  91. package/dist/types/src/components/Tree/types/tree.d.ts +83 -0
  92. package/dist/types/src/components/Tree/types/tree.d.ts.map +1 -0
  93. package/dist/types/src/components/Tree/types/tree.test.d.ts +2 -0
  94. package/dist/types/src/components/Tree/types/tree.test.d.ts.map +1 -0
  95. package/dist/types/src/components/Tree/types/types.d.ts +8 -0
  96. package/dist/types/src/components/Tree/types/types.d.ts.map +1 -0
  97. package/dist/types/src/components/index.d.ts +2 -2
  98. package/dist/types/src/components/plot.d.ts.map +1 -1
  99. package/dist/types/src/hooks/index.d.ts +2 -0
  100. package/dist/types/src/hooks/index.d.ts.map +1 -0
  101. package/dist/types/src/hooks/useGraphModel.d.ts +4 -0
  102. package/dist/types/src/hooks/useGraphModel.d.ts.map +1 -0
  103. package/dist/types/src/index.d.ts +2 -1
  104. package/dist/types/src/index.d.ts.map +1 -1
  105. package/dist/types/src/translations.d.ts +2 -8
  106. package/dist/types/src/translations.d.ts.map +1 -1
  107. package/dist/types/src/types/schema.d.ts +6 -6
  108. package/dist/types/src/types/schema.d.ts.map +1 -1
  109. package/dist/types/src/types/types.d.ts +6 -6
  110. package/dist/types/src/types/types.d.ts.map +1 -1
  111. package/dist/types/tsconfig.tsbuildinfo +1 -1
  112. package/package.json +30 -27
  113. package/src/capabilities/intent-resolver.ts +2 -2
  114. package/src/components/ExplorerContainer.tsx +11 -4
  115. package/src/components/Globe/Globe.stories.tsx +13 -13
  116. package/src/components/Graph/D3ForceGraph.stories.tsx +64 -0
  117. package/src/components/Graph/D3ForceGraph.tsx +101 -0
  118. package/src/components/Graph/ForceGraph.stories.tsx +64 -0
  119. package/src/components/Graph/{Graph.tsx → ForceGraph.tsx} +19 -26
  120. package/src/components/Graph/adapter.ts +47 -0
  121. package/src/components/Graph/index.ts +2 -3
  122. package/src/components/Graph/testing.ts +57 -0
  123. package/src/components/Tree/Tree.stories.tsx +1 -1
  124. package/src/components/Tree/Tree.tsx +11 -18
  125. package/src/components/Tree/layout/HierarchicalEdgeBundling.ts +17 -19
  126. package/src/components/Tree/layout/RadialTree.ts +5 -7
  127. package/src/components/Tree/layout/TidyTree.ts +5 -6
  128. package/src/components/Tree/testing/generator.ts +46 -0
  129. package/src/components/Tree/testing/index.ts +5 -0
  130. package/src/components/Tree/types/index.ts +6 -0
  131. package/src/components/Tree/types/tree.test.ts +133 -0
  132. package/src/components/Tree/types/tree.ts +287 -0
  133. package/src/components/Tree/types/types.ts +41 -0
  134. package/src/hooks/index.ts +5 -0
  135. package/src/hooks/useGraphModel.ts +35 -0
  136. package/src/index.ts +2 -2
  137. package/src/meta.ts +2 -2
  138. package/src/types/schema.ts +5 -3
  139. package/src/types/types.ts +5 -5
  140. package/dist/lib/browser/ExplorerContainer-HL532ODG.mjs +0 -27
  141. package/dist/lib/browser/ExplorerContainer-HL532ODG.mjs.map +0 -7
  142. package/dist/lib/browser/chunk-QLQLPZNI.mjs.map +0 -7
  143. package/dist/lib/browser/chunk-SBLNE7FL.mjs +0 -205
  144. package/dist/lib/browser/chunk-SBLNE7FL.mjs.map +0 -7
  145. package/dist/lib/browser/intent-resolver-NHHRWTOP.mjs.map +0 -7
  146. package/dist/lib/node/ExplorerContainer-73AHSBAG.cjs.map +0 -7
  147. package/dist/lib/node/chunk-HCDBN6NN.cjs.map +0 -7
  148. package/dist/lib/node/chunk-OIHH6TVE.cjs +0 -236
  149. package/dist/lib/node/chunk-OIHH6TVE.cjs.map +0 -7
  150. package/dist/lib/node/chunk-YLL7H7CZ.cjs.map +0 -7
  151. package/dist/lib/node/intent-resolver-EEOTX3OZ.cjs.map +0 -7
  152. package/dist/lib/node-esm/ExplorerContainer-NMI55PYM.mjs +0 -28
  153. package/dist/lib/node-esm/ExplorerContainer-NMI55PYM.mjs.map +0 -7
  154. package/dist/lib/node-esm/chunk-QZH2GDN5.mjs.map +0 -7
  155. package/dist/lib/node-esm/chunk-SZRRNWYT.mjs +0 -207
  156. package/dist/lib/node-esm/chunk-SZRRNWYT.mjs.map +0 -7
  157. package/dist/lib/node-esm/intent-resolver-PTFKXAT4.mjs.map +0 -7
  158. package/dist/types/src/components/Graph/Graph.d.ts +0 -8
  159. package/dist/types/src/components/Graph/Graph.d.ts.map +0 -1
  160. package/dist/types/src/components/Graph/Graph.stories.d.ts.map +0 -1
  161. package/dist/types/src/components/Graph/graph-model.d.ts +0 -39
  162. package/dist/types/src/components/Graph/graph-model.d.ts.map +0 -1
  163. package/dist/types/src/components/Tree/types.d.ts +0 -8
  164. package/dist/types/src/components/Tree/types.d.ts.map +0 -1
  165. package/src/components/Graph/Graph.stories.tsx +0 -62
  166. package/src/components/Graph/graph-model.ts +0 -193
  167. package/src/components/Tree/types.ts +0 -40
  168. /package/dist/lib/browser/{react-surface-N7TC6BMF.mjs.map → react-surface-H3YDMXAQ.mjs.map} +0 -0
  169. /package/dist/lib/node/{react-surface-WD4G2NRS.cjs.map → react-surface-6ESLSM33.cjs.map} +0 -0
  170. /package/dist/lib/node-esm/{react-surface-J5SW7VF2.mjs.map → react-surface-ZEVL3FXG.mjs.map} +0 -0
@@ -16,21 +16,21 @@ var __copyProps = (to, from, except, desc) => {
16
16
  return to;
17
17
  };
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var chunk_VB3QE6XY_exports = {};
20
- __export(chunk_VB3QE6XY_exports, {
19
+ var chunk_BCDVG2CH_exports = {};
20
+ __export(chunk_BCDVG2CH_exports, {
21
21
  EXPLORER_PLUGIN: () => EXPLORER_PLUGIN,
22
22
  meta: () => meta
23
23
  });
24
- module.exports = __toCommonJS(chunk_VB3QE6XY_exports);
24
+ module.exports = __toCommonJS(chunk_BCDVG2CH_exports);
25
25
  var EXPLORER_PLUGIN = "dxos.org/plugin/explorer";
26
26
  var meta = {
27
27
  id: EXPLORER_PLUGIN,
28
28
  name: "Explorer",
29
29
  description: "Install this plugin to view a hypergraph of all objects inside of your Space.",
30
30
  icon: "ph--graph--regular",
31
- source: "https://github.com/dxos/dxos/tree/main/packages/plugins/experimental/plugin-explorer",
31
+ source: "https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-explorer",
32
32
  tags: [
33
- "experimental"
33
+ "labs"
34
34
  ],
35
35
  screenshots: [
36
36
  "https://dxos.network/plugin-details-explorer-dark.png"
@@ -41,4 +41,4 @@ var meta = {
41
41
  EXPLORER_PLUGIN,
42
42
  meta
43
43
  });
44
- //# sourceMappingURL=chunk-VB3QE6XY.cjs.map
44
+ //# sourceMappingURL=chunk-BCDVG2CH.cjs.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 PluginMeta } from '@dxos/app-framework';\n\nexport const EXPLORER_PLUGIN = 'dxos.org/plugin/explorer';\n\nexport const meta: PluginMeta = {\n id: EXPLORER_PLUGIN,\n name: 'Explorer',\n description: 'Install this plugin to view a hypergraph of all objects inside of your Space.',\n icon: 'ph--graph--regular',\n source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/experimental/plugin-explorer',\n tags: ['experimental'],\n screenshots: ['https://dxos.network/plugin-details-explorer-dark.png'],\n};\n"],
4
+ "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type PluginMeta } from '@dxos/app-framework';\n\nexport const EXPLORER_PLUGIN = 'dxos.org/plugin/explorer';\n\nexport const meta: PluginMeta = {\n id: EXPLORER_PLUGIN,\n name: 'Explorer',\n description: 'Install this plugin to view a hypergraph of all objects inside of your Space.',\n icon: 'ph--graph--regular',\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
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAMO,IAAMA,kBAAkB;AAExB,IAAMC,OAAmB;EAC9BC,IAAIF;EACJG,MAAM;EACNC,aAAa;EACbC,MAAM;EACNC,QAAQ;EACRC,MAAM;IAAC;;EACPC,aAAa;IAAC;;AAChB;",
6
6
  "names": ["EXPLORER_PLUGIN", "meta", "id", "name", "description", "icon", "source", "tags", "screenshots"]
7
7
  }
@@ -16,40 +16,41 @@ var __copyProps = (to, from, except, desc) => {
16
16
  return to;
17
17
  };
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var chunk_YLL7H7CZ_exports = {};
20
- __export(chunk_YLL7H7CZ_exports, {
19
+ var chunk_MLRYW4WQ_exports = {};
20
+ __export(chunk_MLRYW4WQ_exports, {
21
21
  ExplorerAction: () => ExplorerAction,
22
22
  ViewType: () => ViewType
23
23
  });
24
- module.exports = __toCommonJS(chunk_YLL7H7CZ_exports);
25
- var import_chunk_VB3QE6XY = require("./chunk-VB3QE6XY.cjs");
24
+ module.exports = __toCommonJS(chunk_MLRYW4WQ_exports);
25
+ var import_chunk_BCDVG2CH = require("./chunk-BCDVG2CH.cjs");
26
+ var import_effect = require("effect");
26
27
  var import_echo_schema = require("@dxos/echo-schema");
27
- var import_echo_schema2 = require("@dxos/echo-schema");
28
+ var import_effect2 = require("effect");
28
29
  var ViewType = class extends (0, import_echo_schema.TypedObject)({
29
30
  typename: "dxos.org/type/ExplorerView",
30
31
  version: "0.1.0"
31
32
  })({
32
- name: import_echo_schema.S.optional(import_echo_schema.S.String),
33
- type: import_echo_schema.S.String
33
+ name: import_effect.Schema.optional(import_effect.Schema.String),
34
+ type: import_effect.Schema.String
34
35
  }) {
35
36
  };
36
- var ExplorerAction;
37
37
  (function(ExplorerAction2) {
38
- const EXPLORER_ACTION = `${import_chunk_VB3QE6XY.EXPLORER_PLUGIN}/action`;
39
- class Create extends import_echo_schema2.S.TaggedClass()(`${EXPLORER_ACTION}/create`, {
40
- input: import_echo_schema2.S.Struct({
41
- name: import_echo_schema2.S.optional(import_echo_schema2.S.String)
38
+ const EXPLORER_ACTION = `${import_chunk_BCDVG2CH.EXPLORER_PLUGIN}/action`;
39
+ class Create extends import_effect2.Schema.TaggedClass()(`${EXPLORER_ACTION}/create`, {
40
+ input: import_effect2.Schema.Struct({
41
+ name: import_effect2.Schema.optional(import_effect2.Schema.String)
42
42
  }),
43
- output: import_echo_schema2.S.Struct({
43
+ output: import_effect2.Schema.Struct({
44
44
  object: ViewType
45
45
  })
46
46
  }) {
47
47
  }
48
48
  ExplorerAction2.Create = Create;
49
49
  })(ExplorerAction || (ExplorerAction = {}));
50
+ var ExplorerAction;
50
51
  // Annotate the CommonJS export names for ESM import in node:
51
52
  0 && (module.exports = {
52
53
  ExplorerAction,
53
54
  ViewType
54
55
  });
55
- //# sourceMappingURL=chunk-YLL7H7CZ.cjs.map
56
+ //# sourceMappingURL=chunk-MLRYW4WQ.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/types/schema.ts", "../../../src/types/types.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { Schema } from 'effect';\n\nimport { TypedObject } from '@dxos/echo-schema';\n\n// TODO(burdon): Clashes with sdk/view.\nexport class ViewType extends TypedObject({\n typename: 'dxos.org/type/ExplorerView',\n version: '0.1.0',\n})({\n name: Schema.optional(Schema.String),\n type: Schema.String,\n}) {}\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { Schema } from 'effect';\n\nimport { ViewType } from './schema';\nimport { EXPLORER_PLUGIN } from '../meta';\n\nexport namespace ExplorerAction {\n const EXPLORER_ACTION = `${EXPLORER_PLUGIN}/action`;\n\n export class Create extends Schema.TaggedClass<Create>()(`${EXPLORER_ACTION}/create`, {\n input: Schema.Struct({\n name: Schema.optional(Schema.String),\n }),\n output: Schema.Struct({\n object: ViewType,\n }),\n }) {}\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;AAIA,oBAAuB;AAEvB,yBAA4B;ACF5B,IAAAA,iBAAuB;ADKhB,IAAMC,WAAN,kBAAuBC,gCAAY;EACxCC,UAAU;EACVC,SAAS;AACX,CAAA,EAAG;EACDC,MAAMC,qBAAOC,SAASD,qBAAOE,MAAM;EACnCC,MAAMH,qBAAOE;AACf,CAAA,EAAA;AAAI;UCNaE,iBAAAA;AACf,QAAMC,kBAAkB,GAAGC,qCAAAA;EAEpB,MAAMC,eAAeP,eAAAA,OAAOQ,YAAW,EAAW,GAAGH,eAAAA,WAA0B;IACpFI,OAAOT,eAAAA,OAAOU,OAAO;MACnBX,MAAMC,eAAAA,OAAOC,SAASD,eAAAA,OAAOE,MAAM;IACrC,CAAA;IACAS,QAAQX,eAAAA,OAAOU,OAAO;MACpBE,QAAQjB;IACV,CAAA;EACF,CAAA,EAAA;EAAI;kBAPSY,SAAAA;AAQf,GAXiBH,mBAAAA,iBAAAA,CAAAA,EAAAA;;",
6
+ "names": ["import_effect", "ViewType", "TypedObject", "typename", "version", "name", "Schema", "optional", "String", "type", "ExplorerAction", "EXPLORER_ACTION", "EXPLORER_PLUGIN", "Create", "TaggedClass", "input", "Struct", "output", "object"]
7
+ }
@@ -0,0 +1,204 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var chunk_NELWWGBU_exports = {};
30
+ __export(chunk_NELWWGBU_exports, {
31
+ D3ForceGraph: () => D3ForceGraph,
32
+ ForceGraph: () => ForceGraph
33
+ });
34
+ module.exports = __toCommonJS(chunk_NELWWGBU_exports);
35
+ var import_tracking = require("@preact-signals/safe-react/tracking");
36
+ var import_react = __toESM(require("react"));
37
+ var import_echo_schema = require("@dxos/echo-schema");
38
+ var import_graph = require("@dxos/graph");
39
+ var import_react_ui_graph = require("@dxos/react-ui-graph");
40
+ var import_react_ui_theme = require("@dxos/react-ui-theme");
41
+ var import_graph2 = require("@dxos/react-ui-graph/styles/graph.css");
42
+ var import_tracking2 = require("@preact-signals/safe-react/tracking");
43
+ var import_d3 = require("d3");
44
+ var import_force_graph = __toESM(require("force-graph"));
45
+ var import_react2 = __toESM(require("react"));
46
+ var import_react_resize_detector = require("react-resize-detector");
47
+ var import_plugin_search = require("@dxos/plugin-search");
48
+ var D3ForceGraph = ({ classNames, model, selection: _selection, grid, ...props }) => {
49
+ var _effect = (0, import_tracking.useSignals)();
50
+ try {
51
+ const context = (0, import_react.useRef)(null);
52
+ const projector = (0, import_react.useMemo)(() => {
53
+ if (context.current) {
54
+ return new import_react_ui_graph.GraphForceProjector(context.current, {
55
+ attributes: {
56
+ linkForce: (edge) => {
57
+ return edge.data?.object?.active !== false;
58
+ }
59
+ },
60
+ forces: {
61
+ point: {
62
+ strength: 0.01
63
+ }
64
+ }
65
+ });
66
+ }
67
+ }, [
68
+ context.current
69
+ ]);
70
+ const graph = (0, import_react.useRef)(null);
71
+ const selection = (0, import_react.useMemo)(() => _selection ?? new import_graph.SelectionModel(), [
72
+ _selection
73
+ ]);
74
+ (0, import_react.useEffect)(() => graph.current?.repaint(), [
75
+ selection.selected.value
76
+ ]);
77
+ const handleSelect = (0, import_react.useCallback)((node) => {
78
+ if (selection.contains(node.id)) {
79
+ selection.remove(node.id);
80
+ } else {
81
+ selection.add(node.id);
82
+ }
83
+ }, [
84
+ selection
85
+ ]);
86
+ return /* @__PURE__ */ import_react.default.createElement(import_react_ui_graph.SVG.Root, {
87
+ ref: context,
88
+ classNames
89
+ }, /* @__PURE__ */ import_react.default.createElement(import_react_ui_graph.SVG.Markers, null), grid && /* @__PURE__ */ import_react.default.createElement(import_react_ui_graph.SVG.Grid, {
90
+ axis: true
91
+ }), /* @__PURE__ */ import_react.default.createElement(import_react_ui_graph.SVG.Zoom, {
92
+ extent: [
93
+ 1 / 2,
94
+ 2
95
+ ]
96
+ }, /* @__PURE__ */ import_react.default.createElement(import_react_ui_graph.SVG.Graph, {
97
+ ...props,
98
+ ref: graph,
99
+ model,
100
+ projector,
101
+ labels: {
102
+ text: (node) => {
103
+ return node.data?.data.label ?? node.id;
104
+ }
105
+ },
106
+ attributes: {
107
+ node: (node) => {
108
+ const obj = node.data?.data.object;
109
+ return {
110
+ data: {
111
+ color: (0, import_react_ui_theme.getHashColor)(obj && (0, import_echo_schema.getTypename)(obj))?.color
112
+ },
113
+ classes: {
114
+ "dx-selected": selection.contains(node.id)
115
+ }
116
+ };
117
+ }
118
+ },
119
+ onSelect: handleSelect
120
+ })));
121
+ } finally {
122
+ _effect.f();
123
+ }
124
+ };
125
+ var GraphAdapter = class {
126
+ constructor(graph) {
127
+ this.graph = graph;
128
+ this._nodes = [];
129
+ this._links = [];
130
+ this._nodes = graph.nodes.map((node) => ({
131
+ id: node.id,
132
+ type: node.type,
133
+ data: node.data
134
+ }));
135
+ this._links = graph.edges.map((edge) => ({
136
+ type: edge.type,
137
+ source: edge.source,
138
+ target: edge.target,
139
+ data: edge.data
140
+ }));
141
+ }
142
+ get nodes() {
143
+ return this._nodes;
144
+ }
145
+ get links() {
146
+ return this._links;
147
+ }
148
+ };
149
+ var ForceGraph = ({ model, match }) => {
150
+ var _effect = (0, import_tracking2.useSignals)();
151
+ try {
152
+ const { ref, width, height } = (0, import_react_resize_detector.useResizeDetector)({
153
+ refreshRate: 200
154
+ });
155
+ const rootRef = (0, import_react2.useRef)(null);
156
+ const forceGraph = (0, import_react2.useRef)();
157
+ const filteredRef = (0, import_react2.useRef)();
158
+ filteredRef.current = (0, import_plugin_search.filterObjectsSync)(model?.objects ?? [], match);
159
+ (0, import_react2.useEffect)(() => {
160
+ if (rootRef.current) {
161
+ forceGraph.current = new import_force_graph.default(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((link) => link.type);
162
+ }
163
+ return () => {
164
+ forceGraph.current?.pauseAnimation().graphData({
165
+ nodes: [],
166
+ links: []
167
+ });
168
+ forceGraph.current = void 0;
169
+ };
170
+ }, []);
171
+ (0, import_react2.useEffect)(() => {
172
+ if (forceGraph.current && width && height && model) {
173
+ forceGraph.current.pauseAnimation().width(width).height(height).onEngineStop(() => {
174
+ handleZoomToFit();
175
+ }).onNodeClick((node) => {
176
+ forceGraph.current?.emitParticle(node);
177
+ }).d3Force("link", (0, import_d3.forceLink)().distance(160).strength(0.5)).d3Force("charge", (0, import_d3.forceManyBody)().strength(-30)).graphData(new GraphAdapter(model)).warmupTicks(100).cooldownTime(1e3).resumeAnimation();
178
+ }
179
+ }, [
180
+ model,
181
+ width,
182
+ height
183
+ ]);
184
+ const handleZoomToFit = () => {
185
+ forceGraph.current?.zoomToFit(400, 40);
186
+ };
187
+ return /* @__PURE__ */ import_react2.default.createElement("div", {
188
+ ref,
189
+ className: "relative grow",
190
+ onClick: handleZoomToFit
191
+ }, /* @__PURE__ */ import_react2.default.createElement("div", {
192
+ ref: rootRef,
193
+ className: "absolute inset-0"
194
+ }));
195
+ } finally {
196
+ _effect.f();
197
+ }
198
+ };
199
+ // Annotate the CommonJS export names for ESM import in node:
200
+ 0 && (module.exports = {
201
+ D3ForceGraph,
202
+ ForceGraph
203
+ });
204
+ //# sourceMappingURL=chunk-NELWWGBU.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/components/Graph/D3ForceGraph.tsx", "../../../src/components/Graph/ForceGraph.tsx", "../../../src/components/Graph/adapter.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { type FC, useCallback, useEffect, useMemo, useRef } from 'react';\n\nimport { getTypename } from '@dxos/echo-schema';\nimport { SelectionModel } from '@dxos/graph';\nimport { type ThemedClassName } from '@dxos/react-ui';\nimport {\n type GraphController,\n GraphForceProjector,\n type GraphLayoutNode,\n type GraphProps,\n SVG,\n type SVGContext,\n} from '@dxos/react-ui-graph';\nimport { getHashColor } from '@dxos/react-ui-theme';\nimport { type SpaceGraphNode, type SpaceGraphModel, type SpaceGraphEdge } from '@dxos/schema';\n\nimport '@dxos/react-ui-graph/styles/graph.css';\n\nexport type D3ForceGraphProps = ThemedClassName<\n {\n model?: SpaceGraphModel;\n match?: RegExp;\n selection?: SelectionModel;\n grid?: boolean;\n } & Pick<GraphProps, 'drag'>\n>;\n\nexport const D3ForceGraph: FC<D3ForceGraphProps> = ({ classNames, model, selection: _selection, grid, ...props }) => {\n const context = useRef<SVGContext>(null);\n const projector = useMemo<GraphForceProjector | undefined>(() => {\n if (context.current) {\n return new GraphForceProjector(context.current, {\n attributes: {\n linkForce: (edge) => {\n // TODO(burdon): Check type (currently assumes Employee property).\n // Edge shouldn't contribute to force if it's not active.\n return edge.data?.object?.active !== false;\n },\n },\n forces: {\n point: {\n strength: 0.01,\n },\n },\n });\n }\n }, [context.current]);\n\n const graph = useRef<GraphController>(null);\n const selection = useMemo(() => _selection ?? new SelectionModel(), [_selection]);\n useEffect(() => graph.current?.repaint(), [selection.selected.value]);\n\n const handleSelect = useCallback<NonNullable<GraphProps['onSelect']>>(\n (node) => {\n if (selection.contains(node.id)) {\n selection.remove(node.id);\n } else {\n selection.add(node.id);\n }\n },\n [selection],\n );\n\n return (\n <SVG.Root ref={context} classNames={classNames}>\n <SVG.Markers />\n {grid && <SVG.Grid axis />}\n <SVG.Zoom extent={[1 / 2, 2]}>\n <SVG.Graph<SpaceGraphNode, SpaceGraphEdge>\n {...props}\n ref={graph}\n model={model}\n projector={projector}\n labels={{\n text: (node) => {\n return node.data?.data.label ?? node.id;\n },\n }}\n attributes={{\n node: (node: GraphLayoutNode<SpaceGraphNode>) => {\n const obj = node.data?.data.object;\n return {\n data: {\n color: getHashColor(obj && getTypename(obj))?.color,\n },\n classes: {\n 'dx-selected': selection.contains(node.id),\n },\n };\n },\n }}\n onSelect={handleSelect}\n />\n </SVG.Zoom>\n </SVG.Root>\n );\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { forceLink, forceManyBody } from 'd3';\nimport NativeForceGraph from 'force-graph';\nimport React, { type FC, useEffect, useRef } from 'react';\nimport { useResizeDetector } from 'react-resize-detector';\n\nimport { filterObjectsSync, type SearchResult } from '@dxos/plugin-search';\nimport { type SpaceGraphModel } from '@dxos/schema';\n\nimport { GraphAdapter } from './adapter';\n\nexport type ForceGraphProps = {\n model?: SpaceGraphModel;\n match?: RegExp;\n};\n\nexport const ForceGraph: FC<ForceGraphProps> = ({ model, match }) => {\n const { ref, width, height } = useResizeDetector({ refreshRate: 200 });\n const rootRef = useRef<HTMLDivElement>(null);\n const forceGraph = useRef<NativeForceGraph>();\n\n const filteredRef = useRef<SearchResult[]>();\n filteredRef.current = filterObjectsSync(model?.objects ?? [], match);\n\n useEffect(() => {\n if (rootRef.current) {\n // https://github.com/vasturiano/force-graph\n // https://github.com/vasturiano/3d-force-graph\n forceGraph.current = new NativeForceGraph(rootRef.current)\n // https://github.com/vasturiano/force-graph?tab=readme-ov-file#node-styling\n .nodeRelSize(6)\n .nodeLabel((node: any) => (node.type === 'schema' ? node.data.typename : node.data.label ?? node.id))\n .nodeAutoColorBy((node: any) => (node.type === 'schema' ? 'schema' : node.data.typename))\n\n // https://github.com/vasturiano/force-graph?tab=readme-ov-file#link-styling\n .linkAutoColorBy((link: any) => link.type);\n }\n\n return () => {\n forceGraph.current?.pauseAnimation().graphData({ nodes: [], links: [] });\n forceGraph.current = undefined;\n };\n }, []);\n\n useEffect(() => {\n if (forceGraph.current && width && height && model) {\n // https://github.com/vasturiano/force-graph?tab=readme-ov-file#container-layout\n forceGraph.current\n .pauseAnimation()\n .width(width)\n .height(height)\n .onEngineStop(() => {\n handleZoomToFit();\n })\n .onNodeClick((node: any) => {\n forceGraph.current?.emitParticle(node);\n })\n\n // https://github.com/vasturiano/force-graph?tab=readme-ov-file#force-engine-d3-force-configuration\n // .d3Force('center', forceCenter().strength(0.9))\n .d3Force('link', forceLink().distance(160).strength(0.5))\n .d3Force('charge', forceManyBody().strength(-30))\n\n .graphData(new GraphAdapter(model))\n .warmupTicks(100)\n .cooldownTime(1_000)\n .resumeAnimation();\n }\n }, [model, width, height]);\n\n const handleZoomToFit = () => {\n forceGraph.current?.zoomToFit(400, 40);\n };\n\n return (\n <div ref={ref} className='relative grow' onClick={handleZoomToFit}>\n <div ref={rootRef} className='absolute inset-0' />\n </div>\n );\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Graph } from '@dxos/graph';\n\nexport type GraphNode = {\n id?: string;\n};\n\nexport type GraphLink = {\n source?: string;\n target?: string;\n};\n\nexport type GraphData = {\n nodes: GraphNode[];\n links: GraphLink[];\n};\n\nexport class GraphAdapter implements GraphData {\n private readonly _nodes: GraphNode[] = [];\n private readonly _links: GraphLink[] = [];\n\n constructor(private readonly graph: Graph) {\n this._nodes = graph.nodes.map((node) => ({\n id: node.id,\n type: node.type,\n data: node.data,\n }));\n\n this._links = graph.edges.map((edge) => ({\n type: edge.type,\n source: edge.source,\n target: edge.target,\n data: edge.data,\n }));\n }\n\n get nodes() {\n return this._nodes;\n }\n\n get links() {\n return this._links;\n }\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,mBAAwE;AAExE,yBAA4B;AAC5B,mBAA+B;AAE/B,4BAOO;AACP,4BAA6B;AAG7B,IAAAA,gBAAO;;AChBP,gBAAyC;AACzC,yBAA6B;AAC7B,IAAAC,gBAAkD;AAClD,mCAAkC;AAElC,2BAAqD;ADsB9C,IAAMC,eAAsC,CAAC,EAAEC,YAAYC,OAAOC,WAAWC,YAAYC,MAAM,GAAGC,MAAAA,MAAO;;;AAC9G,UAAMC,cAAUC,qBAAmB,IAAA;AACnC,UAAMC,gBAAYC,sBAAyC,MAAA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KE,EAAE,EAClG+C,gBAAgB,CAACjD,SAAeA,KAAK6B,SAAS,WAAW,WAAW7B,KAAKd,KAAK8D,QAAQ,EAGtFE,gBAAgB,CAACC,SAAcA,KAAKtB,IAAI;MAC7C;AAEA,aAAO,MAAA;AACLY,mBAAW5D,SAASuE,eAAAA,EAAiBC,UAAU;UAAE1B,OAAO,CAAA;UAAIM,OAAO,CAAA;QAAG,CAAA;AACtEQ,mBAAW5D,UAAUyE;MACvB;IACF,GAAG,CAAA,CAAE;AAEL5D,sBAAAA,WAAU,MAAA;AACR,UAAI+C,WAAW5D,WAAWuD,SAASC,UAAUjE,OAAO;AAElDqE,mBAAW5D,QACRuE,eAAc,EACdhB,MAAMA,KAAAA,EACNC,OAAOA,MAAAA,EACPkB,aAAa,MAAA;AACZC,0BAAAA;QACF,CAAA,EACCC,YAAY,CAACzD,SAAAA;AACZyC,qBAAW5D,SAAS6E,aAAa1D,IAAAA;QACnC,CAAA,EAIC2D,QAAQ,YAAQC,qBAAAA,EAAYC,SAAS,GAAA,EAAKtE,SAAS,GAAA,CAAA,EACnDoE,QAAQ,cAAUG,yBAAAA,EAAgBvE,SAAS,GAAC,CAAA,EAE5C8D,UAAU,IAAI7B,aAAapD,KAAAA,CAAAA,EAC3B2F,YAAY,GAAA,EACZC,aAAa,GAAA,EACbC,gBAAe;MACpB;IACF,GAAG;MAAC7F;MAAOgE;MAAOC;KAAO;AAEzB,UAAMmB,kBAAkB,MAAA;AACtBf,iBAAW5D,SAASqF,UAAU,KAAK,EAAA;IACrC;AAEA,WACE7D,8BAAAA,QAAA,cAAC8D,OAAAA;MAAI3D;MAAU4D,WAAU;MAAgBC,SAASb;OAChDnD,8BAAAA,QAAA,cAAC8D,OAAAA;MAAI3D,KAAKgC;MAAS4B,WAAU;;;;;AAGnC;",
6
+ "names": ["import_graph", "import_react", "D3ForceGraph", "classNames", "model", "selection", "_selection", "grid", "props", "context", "useRef", "projector", "useMemo", "current", "GraphForceProjector", "attributes", "linkForce", "edge", "data", "object", "active", "forces", "point", "strength", "graph", "SelectionModel", "useEffect", "repaint", "selected", "value", "handleSelect", "useCallback", "node", "contains", "id", "remove", "add", "React", "SVG", "Root", "ref", "Markers", "Grid", "axis", "Zoom", "extent", "Graph", "labels", "text", "label", "obj", "color", "getHashColor", "getTypename", "classes", "onSelect", "GraphAdapter", "_nodes", "_links", "nodes", "map", "type", "edges", "source", "target", "links", "ForceGraph", "match", "width", "height", "useResizeDetector", "refreshRate", "rootRef", "forceGraph", "filteredRef", "filterObjectsSync", "objects", "NativeForceGraph", "nodeRelSize", "nodeLabel", "typename", "nodeAutoColorBy", "linkAutoColorBy", "link", "pauseAnimation", "graphData", "undefined", "onEngineStop", "handleZoomToFit", "onNodeClick", "emitParticle", "d3Force", "forceLink", "distance", "forceManyBody", "warmupTicks", "cooldownTime", "resumeAnimation", "zoomToFit", "div", "className", "onClick"]
7
+ }
@@ -28,81 +28,83 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
28
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
29
  var node_exports = {};
30
30
  __export(node_exports, {
31
- Chart: () => import_chunk_HCDBN6NN.Chart,
32
- EXPLORER_PLUGIN: () => import_chunk_VB3QE6XY.EXPLORER_PLUGIN,
33
- ExplorerContainer: () => import_chunk_HCDBN6NN.ExplorerContainer,
31
+ Chart: () => import_chunk_72H5HBTK.Chart,
32
+ D3ForceGraph: () => import_chunk_NELWWGBU.D3ForceGraph,
33
+ EXPLORER_PLUGIN: () => import_chunk_BCDVG2CH.EXPLORER_PLUGIN,
34
+ ExplorerContainer: () => import_chunk_72H5HBTK.ExplorerContainer,
34
35
  ExplorerPlugin: () => ExplorerPlugin,
35
- Globe: () => import_chunk_HCDBN6NN.Globe,
36
- Graph: () => import_chunk_OIHH6TVE.Graph,
37
- SpaceGraphModel: () => import_chunk_OIHH6TVE.SpaceGraphModel,
38
- Tree: () => import_chunk_HCDBN6NN.Tree,
39
- defaultTreeLayoutSlots: () => import_chunk_HCDBN6NN.defaultTreeLayoutSlots,
40
- meta: () => import_chunk_VB3QE6XY.meta
36
+ ForceGraph: () => import_chunk_NELWWGBU.ForceGraph,
37
+ Globe: () => import_chunk_72H5HBTK.Globe,
38
+ Tree: () => import_chunk_72H5HBTK.Tree,
39
+ defaultTreeLayoutSlots: () => import_chunk_72H5HBTK.defaultTreeLayoutSlots,
40
+ meta: () => import_chunk_BCDVG2CH.meta,
41
+ useGraphModel: () => import_chunk_4T4LCT5R.useGraphModel
41
42
  });
42
43
  module.exports = __toCommonJS(node_exports);
43
- var import_chunk_HCDBN6NN = require("./chunk-HCDBN6NN.cjs");
44
- var import_chunk_OIHH6TVE = require("./chunk-OIHH6TVE.cjs");
45
- var import_chunk_YLL7H7CZ = require("./chunk-YLL7H7CZ.cjs");
46
- var import_chunk_VB3QE6XY = require("./chunk-VB3QE6XY.cjs");
44
+ var import_chunk_4T4LCT5R = require("./chunk-4T4LCT5R.cjs");
45
+ var import_chunk_72H5HBTK = require("./chunk-72H5HBTK.cjs");
46
+ var import_chunk_NELWWGBU = require("./chunk-NELWWGBU.cjs");
47
+ var import_chunk_MLRYW4WQ = require("./chunk-MLRYW4WQ.cjs");
48
+ var import_chunk_BCDVG2CH = require("./chunk-BCDVG2CH.cjs");
47
49
  var import_app_framework = require("@dxos/app-framework");
48
50
  var import_plugin_client = require("@dxos/plugin-client");
49
51
  var import_plugin_space = require("@dxos/plugin-space");
50
52
  var import_types = require("@dxos/plugin-space/types");
51
53
  var import_app_framework2 = require("@dxos/app-framework");
52
- var IntentResolver = (0, import_app_framework2.lazy)(() => import("./intent-resolver-EEOTX3OZ.cjs"));
53
- var ReactSurface = (0, import_app_framework2.lazy)(() => import("./react-surface-WD4G2NRS.cjs"));
54
+ var IntentResolver = (0, import_app_framework2.lazy)(() => import("./intent-resolver-DRT67ZU4.cjs"));
55
+ var ReactSurface = (0, import_app_framework2.lazy)(() => import("./react-surface-6ESLSM33.cjs"));
54
56
  var translations_default = [
55
57
  {
56
58
  "en-US": {
57
- [import_chunk_YLL7H7CZ.ViewType.typename]: {
59
+ [import_chunk_MLRYW4WQ.ViewType.typename]: {
58
60
  "typename label": "Explorer",
59
61
  "object name placeholder": "New explorer"
60
62
  },
61
- [import_chunk_VB3QE6XY.EXPLORER_PLUGIN]: {
63
+ [import_chunk_BCDVG2CH.EXPLORER_PLUGIN]: {
62
64
  "plugin name": "Explorer",
63
65
  "object title label": "Title"
64
66
  }
65
67
  }
66
68
  }
67
69
  ];
68
- var ExplorerPlugin = () => (0, import_app_framework.definePlugin)(import_chunk_VB3QE6XY.meta, [
70
+ var ExplorerPlugin = () => (0, import_app_framework.definePlugin)(import_chunk_BCDVG2CH.meta, [
69
71
  (0, import_app_framework.defineModule)({
70
- id: `${import_chunk_VB3QE6XY.meta.id}/module/translations`,
72
+ id: `${import_chunk_BCDVG2CH.meta.id}/module/translations`,
71
73
  activatesOn: import_app_framework.Events.SetupTranslations,
72
74
  activate: () => (0, import_app_framework.contributes)(import_app_framework.Capabilities.Translations, translations_default)
73
75
  }),
74
76
  (0, import_app_framework.defineModule)({
75
- id: `${import_chunk_VB3QE6XY.meta.id}/module/metadata`,
77
+ id: `${import_chunk_BCDVG2CH.meta.id}/module/metadata`,
76
78
  activatesOn: import_app_framework.Events.SetupMetadata,
77
79
  activate: () => (0, import_app_framework.contributes)(import_app_framework.Capabilities.Metadata, {
78
- id: import_chunk_YLL7H7CZ.ViewType.typename,
80
+ id: import_chunk_MLRYW4WQ.ViewType.typename,
79
81
  metadata: {
80
82
  icon: "ph--graph--regular"
81
83
  }
82
84
  })
83
85
  }),
84
86
  (0, import_app_framework.defineModule)({
85
- id: `${import_chunk_VB3QE6XY.meta.id}/module/object-form`,
87
+ id: `${import_chunk_BCDVG2CH.meta.id}/module/object-form`,
86
88
  activatesOn: import_plugin_client.ClientEvents.SetupSchema,
87
89
  activate: () => (0, import_app_framework.contributes)(import_plugin_space.SpaceCapabilities.ObjectForm, (0, import_types.defineObjectForm)({
88
- objectSchema: import_chunk_YLL7H7CZ.ViewType,
89
- getIntent: () => (0, import_app_framework.createIntent)(import_chunk_YLL7H7CZ.ExplorerAction.Create)
90
+ objectSchema: import_chunk_MLRYW4WQ.ViewType,
91
+ getIntent: () => (0, import_app_framework.createIntent)(import_chunk_MLRYW4WQ.ExplorerAction.Create)
90
92
  }))
91
93
  }),
92
94
  (0, import_app_framework.defineModule)({
93
- id: `${import_chunk_VB3QE6XY.meta.id}/module/schema`,
95
+ id: `${import_chunk_BCDVG2CH.meta.id}/module/schema`,
94
96
  activatesOn: import_plugin_client.ClientEvents.SetupSchema,
95
97
  activate: () => (0, import_app_framework.contributes)(import_plugin_client.ClientCapabilities.Schema, [
96
- import_chunk_YLL7H7CZ.ViewType
98
+ import_chunk_MLRYW4WQ.ViewType
97
99
  ])
98
100
  }),
99
101
  (0, import_app_framework.defineModule)({
100
- id: `${import_chunk_VB3QE6XY.meta.id}/module/react-surface`,
102
+ id: `${import_chunk_BCDVG2CH.meta.id}/module/react-surface`,
101
103
  activatesOn: import_app_framework.Events.SetupReactSurface,
102
104
  activate: ReactSurface
103
105
  }),
104
106
  (0, import_app_framework.defineModule)({
105
- id: `${import_chunk_VB3QE6XY.meta.id}/module/intent-resolver`,
107
+ id: `${import_chunk_BCDVG2CH.meta.id}/module/intent-resolver`,
106
108
  activatesOn: import_app_framework.Events.SetupIntentResolver,
107
109
  activate: IntentResolver
108
110
  })
@@ -110,14 +112,15 @@ var ExplorerPlugin = () => (0, import_app_framework.definePlugin)(import_chunk_V
110
112
  // Annotate the CommonJS export names for ESM import in node:
111
113
  0 && (module.exports = {
112
114
  Chart,
115
+ D3ForceGraph,
113
116
  EXPLORER_PLUGIN,
114
117
  ExplorerContainer,
115
118
  ExplorerPlugin,
119
+ ForceGraph,
116
120
  Globe,
117
- Graph,
118
- SpaceGraphModel,
119
121
  Tree,
120
122
  defaultTreeLayoutSlots,
121
- meta
123
+ meta,
124
+ useGraphModel
122
125
  });
123
126
  //# sourceMappingURL=index.cjs.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../src/ExplorerPlugin.tsx", "../../../src/capabilities/index.ts", "../../../src/translations.ts"],
4
4
  "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Capabilities, contributes, createIntent, defineModule, definePlugin, Events } from '@dxos/app-framework';\nimport { ClientCapabilities, ClientEvents } from '@dxos/plugin-client';\nimport { SpaceCapabilities } from '@dxos/plugin-space';\nimport { defineObjectForm } from '@dxos/plugin-space/types';\n\nimport { IntentResolver, ReactSurface } from './capabilities';\nimport { meta } from './meta';\nimport translations from './translations';\nimport { ViewType, ExplorerAction } from './types';\n\nexport const ExplorerPlugin = () =>\n definePlugin(meta, [\n defineModule({\n id: `${meta.id}/module/translations`,\n activatesOn: Events.SetupTranslations,\n activate: () => contributes(Capabilities.Translations, translations),\n }),\n defineModule({\n id: `${meta.id}/module/metadata`,\n activatesOn: Events.SetupMetadata,\n activate: () =>\n contributes(Capabilities.Metadata, {\n id: ViewType.typename,\n metadata: {\n icon: 'ph--graph--regular',\n },\n }),\n }),\n defineModule({\n id: `${meta.id}/module/object-form`,\n activatesOn: ClientEvents.SetupSchema,\n activate: () =>\n contributes(\n SpaceCapabilities.ObjectForm,\n defineObjectForm({\n objectSchema: ViewType,\n getIntent: () => createIntent(ExplorerAction.Create),\n }),\n ),\n }),\n defineModule({\n id: `${meta.id}/module/schema`,\n activatesOn: ClientEvents.SetupSchema,\n activate: () => contributes(ClientCapabilities.Schema, [ViewType]),\n }),\n defineModule({\n id: `${meta.id}/module/react-surface`,\n activatesOn: Events.SetupReactSurface,\n activate: ReactSurface,\n }),\n defineModule({\n id: `${meta.id}/module/intent-resolver`,\n activatesOn: Events.SetupIntentResolver,\n activate: IntentResolver,\n }),\n ]);\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { lazy } from '@dxos/app-framework';\n\nexport const IntentResolver = lazy(() => import('./intent-resolver'));\nexport const ReactSurface = lazy(() => import('./react-surface'));\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { EXPLORER_PLUGIN } from './meta';\nimport { ViewType } from './types';\n\nexport default [\n {\n 'en-US': {\n [ViewType.typename]: {\n 'typename label': 'Explorer',\n 'object name placeholder': 'New explorer',\n },\n [EXPLORER_PLUGIN]: {\n 'plugin name': 'Explorer',\n 'object title label': 'Title',\n },\n },\n },\n];\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,2BAA4F;AAC5F,2BAAiD;AACjD,0BAAkC;AAClC,mBAAiC;ACHjC,IAAAA,wBAAqB;AAEd,IAAMC,qBAAiBC,4BAAK,MAAM,OAAO,gCAAA,CAAA;AACzC,IAAMC,mBAAeD,4BAAK,MAAM,OAAO,8BAAA,CAAA;ACA9C,IAAA,uBAAe;EACb;IACE,SAAS;MACP,CAACE,+BAASC,QAAQ,GAAG;QACnB,kBAAkB;QAClB,2BAA2B;MAC7B;MACA,CAACC,qCAAAA,GAAkB;QACjB,eAAe;QACf,sBAAsB;MACxB;IACF;EACF;;AFLK,IAAMC,iBAAiB,UAC5BC,mCAAaC,4BAAM;MACjBC,mCAAa;IACXC,IAAI,GAAGF,2BAAKE,EAAE;IACdC,aAAaC,4BAAOC;IACpBC,UAAU,UAAMC,kCAAYC,kCAAaC,cAAcC,oBAAAA;EACzD,CAAA;MACAT,mCAAa;IACXC,IAAI,GAAGF,2BAAKE,EAAE;IACdC,aAAaC,4BAAOO;IACpBL,UAAU,UACRC,kCAAYC,kCAAaI,UAAU;MACjCV,IAAIP,+BAASC;MACbiB,UAAU;QACRC,MAAM;MACR;IACF,CAAA;EACJ,CAAA;MACAb,mCAAa;IACXC,IAAI,GAAGF,2BAAKE,EAAE;IACdC,aAAaY,kCAAaC;IAC1BV,UAAU,UACRC,kCACEU,sCAAkBC,gBAClBC,+BAAiB;MACfC,cAAczB;MACd0B,WAAW,UAAMC,mCAAaC,qCAAe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IACdC,aAAaY,kCAAaC;IAC1BV,UAAU,UACRC,kCACEU,sCAAkBC,gBAClBC,+BAAiB;MACfC,cAAczB;MACd0B,WAAW,UAAMC,mCAAaC,qCAAeC,MAAM;IACrD,CAAA,CAAA;EAEN,CAAA;MACAvB,mCAAa;IACXC,IAAI,GAAGF,2BAAKE,EAAE;IACdC,aAAaY,kCAAaC;IAC1BV,UAAU,UAAMC,kCAAYkB,wCAAmBC,QAAQ;MAAC/B;KAAS;EACnE,CAAA;MACAM,mCAAa;IACXC,IAAI,GAAGF,2BAAKE,EAAE;IACdC,aAAaC,4BAAOuB;IACpBrB,UAAUZ;EACZ,CAAA;MACAO,mCAAa;IACXC,IAAI,GAAGF,2BAAKE,EAAE;IACdC,aAAaC,4BAAOwB;IACpBtB,UAAUd;EACZ,CAAA;CACD;",
6
6
  "names": ["import_app_framework", "IntentResolver", "lazy", "ReactSurface", "ViewType", "typename", "EXPLORER_PLUGIN", "ExplorerPlugin", "definePlugin", "meta", "defineModule", "id", "activatesOn", "Events", "SetupTranslations", "activate", "contributes", "Capabilities", "Translations", "translations", "SetupMetadata", "Metadata", "metadata", "icon", "ClientEvents", "SetupSchema", "SpaceCapabilities", "ObjectForm", "defineObjectForm", "objectSchema", "getIntent", "createIntent", "ExplorerAction", "Create", "ClientCapabilities", "Schema", "SetupReactSurface", "SetupIntentResolver"]
7
7
  }
@@ -16,24 +16,24 @@ var __copyProps = (to, from, except, desc) => {
16
16
  return to;
17
17
  };
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var intent_resolver_EEOTX3OZ_exports = {};
20
- __export(intent_resolver_EEOTX3OZ_exports, {
19
+ var intent_resolver_DRT67ZU4_exports = {};
20
+ __export(intent_resolver_DRT67ZU4_exports, {
21
21
  default: () => intent_resolver_default
22
22
  });
23
- module.exports = __toCommonJS(intent_resolver_EEOTX3OZ_exports);
24
- var import_chunk_YLL7H7CZ = require("./chunk-YLL7H7CZ.cjs");
25
- var import_chunk_VB3QE6XY = require("./chunk-VB3QE6XY.cjs");
23
+ module.exports = __toCommonJS(intent_resolver_DRT67ZU4_exports);
24
+ var import_chunk_MLRYW4WQ = require("./chunk-MLRYW4WQ.cjs");
25
+ var import_chunk_BCDVG2CH = require("./chunk-BCDVG2CH.cjs");
26
26
  var import_app_framework = require("@dxos/app-framework");
27
27
  var import_live_object = require("@dxos/live-object");
28
28
  var intent_resolver_default = () => (0, import_app_framework.contributes)(import_app_framework.Capabilities.IntentResolver, (0, import_app_framework.createResolver)({
29
- intent: import_chunk_YLL7H7CZ.ExplorerAction.Create,
29
+ intent: import_chunk_MLRYW4WQ.ExplorerAction.Create,
30
30
  resolve: ({ name }) => ({
31
31
  data: {
32
- object: (0, import_live_object.create)(import_chunk_YLL7H7CZ.ViewType, {
32
+ object: (0, import_live_object.live)(import_chunk_MLRYW4WQ.ViewType, {
33
33
  name,
34
34
  type: ""
35
35
  })
36
36
  }
37
37
  })
38
38
  }));
39
- //# sourceMappingURL=intent-resolver-EEOTX3OZ.cjs.map
39
+ //# sourceMappingURL=intent-resolver-DRT67ZU4.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/capabilities/intent-resolver.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { contributes, Capabilities, createResolver } from '@dxos/app-framework';\nimport { live } from '@dxos/live-object';\n\nimport { ExplorerAction, ViewType } from '../types';\n\nexport default () =>\n contributes(\n Capabilities.IntentResolver,\n createResolver({\n intent: ExplorerAction.Create,\n resolve: ({ name }) => ({\n data: { object: live(ViewType, { name, type: '' }) },\n }),\n }),\n );\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;AAIA,2BAA0D;AAC1D,yBAAqB;AAIrB,IAAA,0BAAe,UACbA,kCACEC,kCAAaC,oBACbC,qCAAe;EACbC,QAAQC,qCAAeC;EACvBC,SAAS,CAAC,EAAEC,KAAI,OAAQ;IACtBC,MAAM;MAAEC,YAAQC,yBAAKC,gCAAU;QAAEJ;QAAMK,MAAM;MAAG,CAAA;IAAG;EACrD;AACF,CAAA,CAAA;",
6
+ "names": ["contributes", "Capabilities", "IntentResolver", "createResolver", "intent", "ExplorerAction", "Create", "resolve", "name", "data", "object", "live", "ViewType", "type"]
7
+ }
@@ -18,11 +18,11 @@ var __copyProps = (to, from, except, desc) => {
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
  var meta_exports = {};
20
20
  __export(meta_exports, {
21
- EXPLORER_PLUGIN: () => import_chunk_VB3QE6XY.EXPLORER_PLUGIN,
22
- meta: () => import_chunk_VB3QE6XY.meta
21
+ EXPLORER_PLUGIN: () => import_chunk_BCDVG2CH.EXPLORER_PLUGIN,
22
+ meta: () => import_chunk_BCDVG2CH.meta
23
23
  });
24
24
  module.exports = __toCommonJS(meta_exports);
25
- var import_chunk_VB3QE6XY = require("./chunk-VB3QE6XY.cjs");
25
+ var import_chunk_BCDVG2CH = require("./chunk-BCDVG2CH.cjs");
26
26
  // Annotate the CommonJS export names for ESM import in node:
27
27
  0 && (module.exports = {
28
28
  EXPLORER_PLUGIN,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["meta.cjs"],
4
- "sourcesContent": ["import {\n EXPLORER_PLUGIN,\n meta\n} from \"./chunk-VB3QE6XY.cjs\";\nexport {\n EXPLORER_PLUGIN,\n meta\n};\n//# sourceMappingURL=meta.cjs.map\n"],
4
+ "sourcesContent": ["import {\n EXPLORER_PLUGIN,\n meta\n} from \"./chunk-BCDVG2CH.cjs\";\nexport {\n EXPLORER_PLUGIN,\n meta\n};\n//# sourceMappingURL=meta.cjs.map\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4BAGO;",
6
6
  "names": []
7
7
  }