@dxos/plugin-explorer 0.8.4-main.1da679c → 0.8.4-main.21d9917

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 (151) hide show
  1. package/dist/lib/browser/ExplorerContainer-BFAWRIAJ.mjs +45 -0
  2. package/dist/lib/browser/ExplorerContainer-BFAWRIAJ.mjs.map +7 -0
  3. package/dist/lib/browser/{chunk-VNOGW2JS.mjs → chunk-AGZAGILW.mjs} +138 -403
  4. package/dist/lib/browser/{chunk-VNOGW2JS.mjs.map → chunk-AGZAGILW.mjs.map} +3 -3
  5. package/dist/lib/browser/{chunk-2MKBRIUT.mjs → chunk-BZMTFAP3.mjs} +8 -5
  6. package/dist/lib/browser/chunk-BZMTFAP3.mjs.map +7 -0
  7. package/dist/lib/browser/chunk-DXORXPUJ.mjs +83 -0
  8. package/dist/lib/browser/chunk-DXORXPUJ.mjs.map +7 -0
  9. package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
  10. package/dist/lib/browser/chunk-J5LGTIGS.mjs.map +7 -0
  11. package/dist/lib/browser/chunk-MGBT2ZFU.mjs +177 -0
  12. package/dist/lib/browser/chunk-MGBT2ZFU.mjs.map +7 -0
  13. package/dist/lib/browser/chunk-YNQF4CPY.mjs +24 -0
  14. package/dist/lib/browser/chunk-YNQF4CPY.mjs.map +7 -0
  15. package/dist/lib/browser/index.mjs +53 -65
  16. package/dist/lib/browser/index.mjs.map +4 -4
  17. package/dist/lib/browser/meta.json +1 -1
  18. package/dist/lib/browser/meta.mjs +2 -3
  19. package/dist/lib/browser/react-surface-24INQLMB.mjs +35 -0
  20. package/dist/lib/browser/react-surface-24INQLMB.mjs.map +7 -0
  21. package/dist/lib/browser/types/index.mjs +6 -6
  22. package/dist/lib/node-esm/ExplorerContainer-YQ2KKBVS.mjs +46 -0
  23. package/dist/lib/node-esm/ExplorerContainer-YQ2KKBVS.mjs.map +7 -0
  24. package/dist/lib/node-esm/{chunk-PIAXA43R.mjs → chunk-DK77RB6M.mjs} +8 -5
  25. package/dist/lib/node-esm/chunk-DK77RB6M.mjs.map +7 -0
  26. package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +11 -0
  27. package/dist/lib/node-esm/chunk-HSLMI22Q.mjs.map +7 -0
  28. package/dist/lib/node-esm/{chunk-3ODK27PU.mjs → chunk-IPIGIQHX.mjs} +8 -5
  29. package/dist/lib/node-esm/chunk-IPIGIQHX.mjs.map +7 -0
  30. package/dist/lib/node-esm/{chunk-ODMJ7DPA.mjs → chunk-QLMTN2XI.mjs} +138 -403
  31. package/dist/lib/node-esm/{chunk-ODMJ7DPA.mjs.map → chunk-QLMTN2XI.mjs.map} +3 -3
  32. package/dist/lib/node-esm/chunk-UCH3WYRD.mjs +84 -0
  33. package/dist/lib/node-esm/chunk-UCH3WYRD.mjs.map +7 -0
  34. package/dist/lib/node-esm/chunk-YWJBDETV.mjs +179 -0
  35. package/dist/lib/node-esm/chunk-YWJBDETV.mjs.map +7 -0
  36. package/dist/lib/node-esm/index.mjs +53 -65
  37. package/dist/lib/node-esm/index.mjs.map +4 -4
  38. package/dist/lib/node-esm/meta.json +1 -1
  39. package/dist/lib/node-esm/meta.mjs +2 -3
  40. package/dist/lib/node-esm/react-surface-F465WXH7.mjs +36 -0
  41. package/dist/lib/node-esm/react-surface-F465WXH7.mjs.map +7 -0
  42. package/dist/lib/node-esm/types/index.mjs +6 -6
  43. package/dist/types/src/ExplorerPlugin.d.ts +2 -1
  44. package/dist/types/src/ExplorerPlugin.d.ts.map +1 -1
  45. package/dist/types/src/capabilities/index.d.ts +1 -2
  46. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  47. package/dist/types/src/capabilities/react-surface/index.d.ts +3 -0
  48. package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -0
  49. package/dist/types/src/capabilities/react-surface/react-surface.d.ts +5 -0
  50. package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -0
  51. package/dist/types/src/components/Chart/Chart.stories.d.ts +3 -1
  52. package/dist/types/src/components/Chart/Chart.stories.d.ts.map +1 -1
  53. package/dist/types/src/components/ExplorerContainer.d.ts +4 -6
  54. package/dist/types/src/components/ExplorerContainer.d.ts.map +1 -1
  55. package/dist/types/src/components/Globe/Globe.stories.d.ts +3 -1
  56. package/dist/types/src/components/Globe/Globe.stories.d.ts.map +1 -1
  57. package/dist/types/src/components/Graph/D3ForceGraph.d.ts +2 -2
  58. package/dist/types/src/components/Graph/D3ForceGraph.d.ts.map +1 -1
  59. package/dist/types/src/components/Graph/D3ForceGraph.stories.d.ts +5 -10
  60. package/dist/types/src/components/Graph/D3ForceGraph.stories.d.ts.map +1 -1
  61. package/dist/types/src/components/Graph/ForceGraph.stories.d.ts +4 -2
  62. package/dist/types/src/components/Graph/ForceGraph.stories.d.ts.map +1 -1
  63. package/dist/types/src/components/Graph/adapter.d.ts +1 -1
  64. package/dist/types/src/components/Graph/adapter.d.ts.map +1 -1
  65. package/dist/types/src/components/Graph/testing.d.ts.map +1 -1
  66. package/dist/types/src/components/Tree/Tree.d.ts.map +1 -1
  67. package/dist/types/src/components/Tree/Tree.stories.d.ts +0 -1
  68. package/dist/types/src/components/Tree/Tree.stories.d.ts.map +1 -1
  69. package/dist/types/src/components/Tree/testing/generator.d.ts.map +1 -1
  70. package/dist/types/src/components/Tree/types/tree.d.ts +18 -16
  71. package/dist/types/src/components/Tree/types/tree.d.ts.map +1 -1
  72. package/dist/types/src/components/Tree/types/types.d.ts +1 -1
  73. package/dist/types/src/components/Tree/types/types.d.ts.map +1 -1
  74. package/dist/types/src/components/index.d.ts +2 -4
  75. package/dist/types/src/components/index.d.ts.map +1 -1
  76. package/dist/types/src/hooks/useGraphModel.d.ts.map +1 -1
  77. package/dist/types/src/meta.d.ts +2 -3
  78. package/dist/types/src/meta.d.ts.map +1 -1
  79. package/dist/types/src/translations.d.ts +24 -5
  80. package/dist/types/src/translations.d.ts.map +1 -1
  81. package/dist/types/src/types/ExplorerAction.d.ts +6 -0
  82. package/dist/types/src/types/ExplorerAction.d.ts.map +1 -0
  83. package/dist/types/src/types/Graph.d.ts +30 -0
  84. package/dist/types/src/types/Graph.d.ts.map +1 -0
  85. package/dist/types/src/types/index.d.ts +2 -2
  86. package/dist/types/src/types/index.d.ts.map +1 -1
  87. package/dist/types/tsconfig.tsbuildinfo +1 -1
  88. package/package.json +53 -47
  89. package/src/ExplorerPlugin.tsx +29 -52
  90. package/src/capabilities/index.ts +1 -4
  91. package/src/capabilities/react-surface/index.ts +7 -0
  92. package/src/capabilities/react-surface/react-surface.tsx +30 -0
  93. package/src/components/Chart/Chart.stories.tsx +5 -4
  94. package/src/components/ExplorerContainer.tsx +26 -11
  95. package/src/components/Globe/Globe.stories.tsx +5 -4
  96. package/src/components/Graph/D3ForceGraph.stories.tsx +32 -16
  97. package/src/components/Graph/D3ForceGraph.tsx +5 -5
  98. package/src/components/Graph/ForceGraph.stories.tsx +32 -16
  99. package/src/components/Graph/ForceGraph.tsx +3 -3
  100. package/src/components/Graph/adapter.ts +14 -8
  101. package/src/components/Graph/testing.ts +11 -8
  102. package/src/components/Tree/Tree.stories.tsx +3 -4
  103. package/src/components/Tree/Tree.tsx +10 -5
  104. package/src/components/Tree/testing/generator.ts +4 -2
  105. package/src/components/Tree/types/tree.test.ts +5 -3
  106. package/src/components/Tree/types/tree.ts +40 -19
  107. package/src/components/Tree/types/types.ts +1 -1
  108. package/src/components/index.ts +3 -3
  109. package/src/hooks/useGraphModel.ts +6 -4
  110. package/src/meta.ts +9 -6
  111. package/src/translations.ts +6 -2
  112. package/src/types/ExplorerAction.ts +21 -0
  113. package/src/types/Graph.ts +62 -0
  114. package/src/types/index.ts +2 -2
  115. package/dist/lib/browser/ExplorerContainer-7MTDS2TQ.mjs +0 -37
  116. package/dist/lib/browser/ExplorerContainer-7MTDS2TQ.mjs.map +0 -7
  117. package/dist/lib/browser/chunk-2MKBRIUT.mjs.map +0 -7
  118. package/dist/lib/browser/chunk-3YITRGGW.mjs +0 -203
  119. package/dist/lib/browser/chunk-3YITRGGW.mjs.map +0 -7
  120. package/dist/lib/browser/chunk-CZZ3DDR7.mjs +0 -38
  121. package/dist/lib/browser/chunk-CZZ3DDR7.mjs.map +0 -7
  122. package/dist/lib/browser/chunk-UL5EDJPE.mjs +0 -21
  123. package/dist/lib/browser/chunk-UL5EDJPE.mjs.map +0 -7
  124. package/dist/lib/browser/intent-resolver-RGPYMKAU.mjs +0 -24
  125. package/dist/lib/browser/intent-resolver-RGPYMKAU.mjs.map +0 -7
  126. package/dist/lib/browser/react-surface-6MSROCJS.mjs +0 -31
  127. package/dist/lib/browser/react-surface-6MSROCJS.mjs.map +0 -7
  128. package/dist/lib/node-esm/ExplorerContainer-OBSRVHZZ.mjs +0 -38
  129. package/dist/lib/node-esm/ExplorerContainer-OBSRVHZZ.mjs.map +0 -7
  130. package/dist/lib/node-esm/chunk-3ODK27PU.mjs.map +0 -7
  131. package/dist/lib/node-esm/chunk-4GWDNZ4Z.mjs +0 -39
  132. package/dist/lib/node-esm/chunk-4GWDNZ4Z.mjs.map +0 -7
  133. package/dist/lib/node-esm/chunk-GFYXDQQV.mjs +0 -205
  134. package/dist/lib/node-esm/chunk-GFYXDQQV.mjs.map +0 -7
  135. package/dist/lib/node-esm/chunk-PIAXA43R.mjs.map +0 -7
  136. package/dist/lib/node-esm/intent-resolver-LTIB6F2Q.mjs +0 -25
  137. package/dist/lib/node-esm/intent-resolver-LTIB6F2Q.mjs.map +0 -7
  138. package/dist/lib/node-esm/react-surface-ZEM4IXFU.mjs +0 -32
  139. package/dist/lib/node-esm/react-surface-ZEM4IXFU.mjs.map +0 -7
  140. package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
  141. package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
  142. package/dist/types/src/capabilities/react-surface.d.ts +0 -4
  143. package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
  144. package/dist/types/src/types/schema.d.ts +0 -12
  145. package/dist/types/src/types/schema.d.ts.map +0 -1
  146. package/dist/types/src/types/types.d.ts +0 -18
  147. package/dist/types/src/types/types.d.ts.map +0 -1
  148. package/src/capabilities/intent-resolver.ts +0 -19
  149. package/src/capabilities/react-surface.tsx +0 -23
  150. package/src/types/schema.ts +0 -16
  151. package/src/types/types.ts +0 -22
@@ -1,205 +0,0 @@
1
- import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
-
3
- // src/components/Graph/D3ForceGraph.tsx
4
- import { useSignals as _useSignals } from "@preact-signals/safe-react/tracking";
5
- import React, { useCallback, useEffect, useMemo, useRef } from "react";
6
- import { Obj } from "@dxos/echo";
7
- import { SelectionModel } from "@dxos/graph";
8
- import { GraphForceProjector, SVG } from "@dxos/react-ui-graph";
9
- import { getHashColor } from "@dxos/react-ui-theme";
10
- import "@dxos/react-ui-graph/styles/graph.css";
11
- var D3ForceGraph = ({ classNames, model, selection: _selection, grid, ...props }) => {
12
- var _effect = _useSignals();
13
- try {
14
- const context = useRef(null);
15
- const projector = useMemo(() => {
16
- if (context.current) {
17
- return new GraphForceProjector(context.current, {
18
- attributes: {
19
- linkForce: (edge) => {
20
- return edge.data?.object?.active !== false;
21
- }
22
- },
23
- forces: {
24
- point: {
25
- strength: 0.01
26
- }
27
- }
28
- });
29
- }
30
- }, [
31
- context.current
32
- ]);
33
- const graph = useRef(null);
34
- const selection = useMemo(() => _selection ?? new SelectionModel(), [
35
- _selection
36
- ]);
37
- useEffect(() => graph.current?.repaint(), [
38
- selection.selected.value
39
- ]);
40
- const handleSelect = useCallback((node) => {
41
- if (selection.contains(node.id)) {
42
- selection.remove(node.id);
43
- } else {
44
- selection.add(node.id);
45
- }
46
- }, [
47
- selection
48
- ]);
49
- return /* @__PURE__ */ React.createElement(SVG.Root, {
50
- ref: context,
51
- classNames
52
- }, /* @__PURE__ */ React.createElement(SVG.Markers, null), grid && /* @__PURE__ */ React.createElement(SVG.Grid, {
53
- axis: true
54
- }), /* @__PURE__ */ React.createElement(SVG.Zoom, {
55
- extent: [
56
- 1 / 2,
57
- 2
58
- ]
59
- }, /* @__PURE__ */ React.createElement(SVG.Graph, {
60
- ...props,
61
- ref: graph,
62
- model,
63
- projector,
64
- labels: {
65
- text: (node) => {
66
- return node.data?.data.label ?? node.id;
67
- }
68
- },
69
- attributes: {
70
- node: (node) => {
71
- const obj = node.data?.data.object;
72
- return {
73
- data: {
74
- color: getHashColor(obj && Obj.getTypename(obj))?.color
75
- },
76
- classes: {
77
- "dx-selected": selection.contains(node.id)
78
- }
79
- };
80
- }
81
- },
82
- onSelect: handleSelect
83
- })));
84
- } finally {
85
- _effect.f();
86
- }
87
- };
88
-
89
- // src/components/Graph/ForceGraph.tsx
90
- import { useSignals as _useSignals2 } from "@preact-signals/safe-react/tracking";
91
- import { forceLink, forceManyBody } from "d3";
92
- import NativeForceGraph from "force-graph";
93
- import React2, { useEffect as useEffect2, useRef as useRef2, useState } from "react";
94
- import { useResizeDetector } from "react-resize-detector";
95
- import { filterObjectsSync } from "@dxos/plugin-search";
96
-
97
- // src/components/Graph/adapter.ts
98
- function _define_property(obj, key, value) {
99
- if (key in obj) {
100
- Object.defineProperty(obj, key, {
101
- value,
102
- enumerable: true,
103
- configurable: true,
104
- writable: true
105
- });
106
- } else {
107
- obj[key] = value;
108
- }
109
- return obj;
110
- }
111
- var GraphAdapter = class {
112
- get nodes() {
113
- return this._nodes;
114
- }
115
- get links() {
116
- return this._links;
117
- }
118
- constructor(graph) {
119
- _define_property(this, "graph", void 0);
120
- _define_property(this, "_nodes", void 0);
121
- _define_property(this, "_links", void 0);
122
- this.graph = graph;
123
- this._nodes = [];
124
- this._links = [];
125
- this._nodes = graph.nodes.map((node) => ({
126
- id: node.id,
127
- type: node.type,
128
- data: node.data
129
- }));
130
- this._links = graph.edges.map((edge) => ({
131
- type: edge.type,
132
- source: edge.source,
133
- target: edge.target,
134
- data: edge.data
135
- }));
136
- }
137
- };
138
-
139
- // src/components/Graph/ForceGraph.tsx
140
- var ForceGraph = ({ model, match }) => {
141
- var _effect = _useSignals2();
142
- try {
143
- const { ref, width, height } = useResizeDetector({
144
- refreshRate: 200
145
- });
146
- const rootRef = useRef2(null);
147
- const forceGraph = useRef2();
148
- const filteredRef = useRef2();
149
- filteredRef.current = filterObjectsSync(model?.objects ?? [], match);
150
- const [data, setData] = useState();
151
- useEffect2(() => {
152
- return model?.subscribe((model2) => {
153
- setData(new GraphAdapter(model2.graph));
154
- });
155
- }, [
156
- model
157
- ]);
158
- useEffect2(() => {
159
- if (rootRef.current) {
160
- 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((link) => link.type);
161
- }
162
- return () => {
163
- forceGraph.current?.pauseAnimation().graphData({
164
- nodes: [],
165
- links: []
166
- });
167
- forceGraph.current = void 0;
168
- };
169
- }, []);
170
- useEffect2(() => {
171
- if (!data || !width || !height || !forceGraph.current) {
172
- return;
173
- }
174
- forceGraph.current.pauseAnimation().width(width).height(height).onEngineStop(() => {
175
- handleZoomToFit();
176
- }).onNodeClick((node) => {
177
- forceGraph.current?.emitParticle(node);
178
- }).d3Force("link", forceLink().distance(160).strength(0.5)).d3Force("charge", forceManyBody().strength(-30)).graphData(data).warmupTicks(100).cooldownTime(1e3).resumeAnimation();
179
- }, [
180
- data,
181
- width,
182
- height,
183
- forceGraph.current
184
- ]);
185
- const handleZoomToFit = () => {
186
- forceGraph.current?.zoomToFit(400, 40);
187
- };
188
- return /* @__PURE__ */ React2.createElement("div", {
189
- ref,
190
- className: "relative grow",
191
- onClick: handleZoomToFit
192
- }, /* @__PURE__ */ React2.createElement("div", {
193
- ref: rootRef,
194
- className: "absolute inset-0"
195
- }));
196
- } finally {
197
- _effect.f();
198
- }
199
- };
200
-
201
- export {
202
- D3ForceGraph,
203
- ForceGraph
204
- };
205
- //# sourceMappingURL=chunk-GFYXDQQV.mjs.map
@@ -1,7 +0,0 @@
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 { Obj } from '@dxos/echo';\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 SpaceGraphEdge, type SpaceGraphModel, type SpaceGraphNode } 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 && 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, useState } from 'react';\nimport { useResizeDetector } from 'react-resize-detector';\n\nimport { type SearchResult, filterObjectsSync } 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 const [data, setData] = useState<GraphAdapter>();\n useEffect(() => {\n return model?.subscribe((model) => {\n setData(new GraphAdapter(model.graph));\n });\n }, [model]);\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 (!data || !width || !height || !forceGraph.current) {\n return;\n }\n\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(data)\n .warmupTicks(100)\n .cooldownTime(1_000)\n .resumeAnimation();\n }, [data, width, height, forceGraph.current]);\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\n/**\n * Map common graph to force-graph format.\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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EAICiB,QAAQ,QAAQC,UAAAA,EAAYC,SAAS,GAAA,EAAKC,SAAS,GAAA,CAAA,EACnDH,QAAQ,UAAUI,cAAAA,EAAgBD,SAAS,GAAC,CAAA,EAE5CX,UAAUnB,IAAAA,EACVgC,YAAY,GAAA,EACZC,aAAa,GAAA,EACbC,gBAAe;IACpB,GAAG;MAAClC;MAAMX;MAAOC;MAAQK,WAAWE;KAAQ;AAE5C,UAAM2B,kBAAkB,MAAA;AACtB7B,iBAAWE,SAASsC,UAAU,KAAK,EAAA;IACrC;AAEA,WACE,gBAAAC,OAAA,cAACC,OAAAA;MAAIjD;MAAUkD,WAAU;MAAgBC,SAASf;OAChD,gBAAAY,OAAA,cAACC,OAAAA;MAAIjD,KAAKK;MAAS6C,WAAU;;;;;AAGnC;",
6
- "names": ["React", "useCallback", "useEffect", "useMemo", "useRef", "Obj", "SelectionModel", "GraphForceProjector", "SVG", "getHashColor", "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", "SVG", "Root", "ref", "Markers", "Grid", "axis", "Zoom", "extent", "Graph", "labels", "text", "label", "obj", "color", "getHashColor", "Obj", "getTypename", "classes", "onSelect", "forceLink", "forceManyBody", "NativeForceGraph", "React", "useEffect", "useRef", "useState", "useResizeDetector", "filterObjectsSync", "GraphAdapter", "nodes", "_nodes", "links", "_links", "graph", "map", "node", "id", "type", "data", "edges", "edge", "source", "target", "ForceGraph", "model", "match", "ref", "width", "height", "useResizeDetector", "refreshRate", "rootRef", "useRef", "forceGraph", "filteredRef", "current", "filterObjectsSync", "objects", "data", "setData", "useState", "useEffect", "subscribe", "GraphAdapter", "graph", "NativeForceGraph", "nodeRelSize", "nodeLabel", "node", "type", "typename", "label", "id", "nodeAutoColorBy", "linkAutoColorBy", "link", "pauseAnimation", "graphData", "nodes", "links", "undefined", "onEngineStop", "handleZoomToFit", "onNodeClick", "emitParticle", "d3Force", "forceLink", "distance", "strength", "forceManyBody", "warmupTicks", "cooldownTime", "resumeAnimation", "zoomToFit", "React", "div", "className", "onClick"]
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 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/plugin-explorer',\n tags: ['labs'],\n screenshots: ['https://dxos.network/plugin-details-explorer-dark.png'],\n};\n"],
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
- "names": ["EXPLORER_PLUGIN", "meta", "id", "name", "description", "icon", "source", "tags", "screenshots"]
7
- }
@@ -1,25 +0,0 @@
1
- import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
- import {
3
- ExplorerAction,
4
- ViewType
5
- } from "./chunk-4GWDNZ4Z.mjs";
6
- import "./chunk-PIAXA43R.mjs";
7
-
8
- // src/capabilities/intent-resolver.ts
9
- import { Capabilities, contributes, createResolver } from "@dxos/app-framework";
10
- import { Obj } from "@dxos/echo";
11
- var intent_resolver_default = (() => contributes(Capabilities.IntentResolver, createResolver({
12
- intent: ExplorerAction.Create,
13
- resolve: ({ name }) => ({
14
- data: {
15
- object: Obj.make(ViewType, {
16
- name,
17
- type: ""
18
- })
19
- }
20
- })
21
- })));
22
- export {
23
- intent_resolver_default as default
24
- };
25
- //# sourceMappingURL=intent-resolver-LTIB6F2Q.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/capabilities/intent-resolver.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capabilities, contributes, createResolver } from '@dxos/app-framework';\nimport { Obj } from '@dxos/echo';\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: Obj.make(ViewType, { name, type: '' }) },\n }),\n }),\n );\n"],
5
- "mappings": ";;;;;;;;AAIA,SAASA,cAAcC,aAAaC,sBAAsB;AAC1D,SAASC,WAAW;AAIpB,IAAA,2BAAe,MACbC,YACEC,aAAaC,gBACbC,eAAe;EACbC,QAAQC,eAAeC;EACvBC,SAAS,CAAC,EAAEC,KAAI,OAAQ;IACtBC,MAAM;MAAEC,QAAQC,IAAIC,KAAKC,UAAU;QAAEL;QAAMM,MAAM;MAAG,CAAA;IAAG;EACzD;AACF,CAAA,CAAA;",
6
- "names": ["Capabilities", "contributes", "createResolver", "Obj", "contributes", "Capabilities", "IntentResolver", "createResolver", "intent", "ExplorerAction", "Create", "resolve", "name", "data", "object", "Obj", "make", "ViewType", "type"]
7
- }
@@ -1,32 +0,0 @@
1
- import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
- import {
3
- ExplorerContainer
4
- } from "./chunk-ODMJ7DPA.mjs";
5
- import "./chunk-GFYXDQQV.mjs";
6
- import {
7
- ViewType
8
- } from "./chunk-4GWDNZ4Z.mjs";
9
- import {
10
- EXPLORER_PLUGIN
11
- } from "./chunk-PIAXA43R.mjs";
12
-
13
- // src/capabilities/react-surface.tsx
14
- import React from "react";
15
- import { Capabilities, contributes, createSurface } from "@dxos/app-framework";
16
- import { Obj } from "@dxos/echo";
17
- var react_surface_default = (() => contributes(Capabilities.ReactSurface, createSurface({
18
- id: `${EXPLORER_PLUGIN}/article`,
19
- role: [
20
- "article",
21
- "section"
22
- ],
23
- filter: (data) => Obj.instanceOf(ViewType, data.subject),
24
- component: ({ data, role }) => /* @__PURE__ */ React.createElement(ExplorerContainer, {
25
- view: data.subject,
26
- role
27
- })
28
- })));
29
- export {
30
- react_surface_default as default
31
- };
32
- //# sourceMappingURL=react-surface-ZEM4IXFU.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/capabilities/react-surface.tsx"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport React from 'react';\n\nimport { Capabilities, contributes, createSurface } from '@dxos/app-framework';\nimport { Obj } from '@dxos/echo';\n\nimport { ExplorerContainer } from '../components';\nimport { EXPLORER_PLUGIN } from '../meta';\nimport { ViewType } from '../types';\n\nexport default () =>\n contributes(\n Capabilities.ReactSurface,\n createSurface({\n id: `${EXPLORER_PLUGIN}/article`,\n role: ['article', 'section'],\n filter: (data): data is { subject: ViewType } => Obj.instanceOf(ViewType, data.subject),\n component: ({ data, role }) => <ExplorerContainer view={data.subject} role={role} />,\n }),\n );\n"],
5
- "mappings": ";;;;;;;;;;;;;AAIA,OAAOA,WAAW;AAElB,SAASC,cAAcC,aAAaC,qBAAqB;AACzD,SAASC,WAAW;AAMpB,IAAA,yBAAe,MACbC,YACEC,aAAaC,cACbC,cAAc;EACZC,IAAI,GAAGC,eAAAA;EACPC,MAAM;IAAC;IAAW;;EAClBC,QAAQ,CAACC,SAAwCC,IAAIC,WAAWC,UAAUH,KAAKI,OAAO;EACtFC,WAAW,CAAC,EAAEL,MAAMF,KAAI,MAAO,sBAAA,cAACQ,mBAAAA;IAAkBC,MAAMP,KAAKI;IAASN;;AACxE,CAAA,CAAA;",
6
- "names": ["React", "Capabilities", "contributes", "createSurface", "Obj", "contributes", "Capabilities", "ReactSurface", "createSurface", "id", "EXPLORER_PLUGIN", "role", "filter", "data", "Obj", "instanceOf", "ViewType", "subject", "component", "ExplorerContainer", "view"]
7
- }
@@ -1,4 +0,0 @@
1
- import { Capabilities } from '@dxos/app-framework';
2
- declare const _default: () => import("@dxos/app-framework").Capability<import("@dxos/app-framework").InterfaceDef<Capabilities.IntentResolver>>;
3
- export default _default;
4
- //# sourceMappingURL=intent-resolver.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"intent-resolver.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/intent-resolver.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAA+B,MAAM,qBAAqB,CAAC;;AAKhF,wBASI"}
@@ -1,4 +0,0 @@
1
- import { Capabilities } from '@dxos/app-framework';
2
- declare const _default: () => import("@dxos/app-framework").Capability<import("@dxos/app-framework").InterfaceDef<Capabilities.ReactSurface>>;
3
- export default _default;
4
- //# sourceMappingURL=react-surface.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"react-surface.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/react-surface.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,YAAY,EAA8B,MAAM,qBAAqB,CAAC;;AAO/E,wBASI"}
@@ -1,12 +0,0 @@
1
- import { Schema } from 'effect';
2
- declare const ViewType_base: import("@dxos/echo-schema").TypedObjectPrototype<import("@dxos/echo-schema").TypedObjectFields<{
3
- name: Schema.optional<typeof Schema.String>;
4
- type: typeof Schema.String;
5
- }, import("@dxos/echo-schema").TypedObjectOptions>, Schema.Struct.Encoded<{
6
- name: Schema.optional<typeof Schema.String>;
7
- type: typeof Schema.String;
8
- }>>;
9
- export declare class ViewType extends ViewType_base {
10
- }
11
- export {};
12
- //# sourceMappingURL=schema.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/types/schema.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;;;;;;;;AAKhC,qBAAa,QAAS,SAAQ,aAM5B;CAAG"}
@@ -1,18 +0,0 @@
1
- import { Schema } from 'effect';
2
- import { ViewType } from './schema';
3
- export declare namespace ExplorerAction {
4
- const Create_base: Schema.TaggedClass<Create, "dxos.org/plugin/explorer/action/create", {
5
- readonly _tag: Schema.tag<"dxos.org/plugin/explorer/action/create">;
6
- } & {
7
- input: Schema.Struct<{
8
- name: Schema.optional<typeof Schema.String>;
9
- }>;
10
- output: Schema.Struct<{
11
- object: typeof ViewType;
12
- }>;
13
- }>;
14
- export class Create extends Create_base {
15
- }
16
- export {};
17
- }
18
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/types/types.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAIhC,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEpC,yBAAiB,cAAc,CAAC;;;;;;;;;;;IAG9B,MAAM,OAAO,MAAO,SAAQ,WAO1B;KAAG;;CACN"}
@@ -1,19 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import { Capabilities, contributes, createResolver } from '@dxos/app-framework';
6
- import { Obj } from '@dxos/echo';
7
-
8
- import { ExplorerAction, ViewType } from '../types';
9
-
10
- export default () =>
11
- contributes(
12
- Capabilities.IntentResolver,
13
- createResolver({
14
- intent: ExplorerAction.Create,
15
- resolve: ({ name }) => ({
16
- data: { object: Obj.make(ViewType, { name, type: '' }) },
17
- }),
18
- }),
19
- );
@@ -1,23 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import React from 'react';
6
-
7
- import { Capabilities, contributes, createSurface } from '@dxos/app-framework';
8
- import { Obj } from '@dxos/echo';
9
-
10
- import { ExplorerContainer } from '../components';
11
- import { EXPLORER_PLUGIN } from '../meta';
12
- import { ViewType } from '../types';
13
-
14
- export default () =>
15
- contributes(
16
- Capabilities.ReactSurface,
17
- createSurface({
18
- id: `${EXPLORER_PLUGIN}/article`,
19
- role: ['article', 'section'],
20
- filter: (data): data is { subject: ViewType } => Obj.instanceOf(ViewType, data.subject),
21
- component: ({ data, role }) => <ExplorerContainer view={data.subject} role={role} />,
22
- }),
23
- );
@@ -1,16 +0,0 @@
1
- //
2
- // Copyright 2024 DXOS.org
3
- //
4
-
5
- import { Schema } from 'effect';
6
-
7
- import { TypedObject } from '@dxos/echo-schema';
8
-
9
- // TODO(burdon): Clashes with sdk/view.
10
- export class ViewType extends TypedObject({
11
- typename: 'dxos.org/type/ExplorerView',
12
- version: '0.1.0',
13
- })({
14
- name: Schema.optional(Schema.String),
15
- type: Schema.String,
16
- }) {}
@@ -1,22 +0,0 @@
1
- //
2
- // Copyright 2023 DXOS.org
3
- //
4
-
5
- import { Schema } from 'effect';
6
-
7
- import { EXPLORER_PLUGIN } from '../meta';
8
-
9
- import { ViewType } from './schema';
10
-
11
- export namespace ExplorerAction {
12
- const EXPLORER_ACTION = `${EXPLORER_PLUGIN}/action`;
13
-
14
- export class Create extends Schema.TaggedClass<Create>()(`${EXPLORER_ACTION}/create`, {
15
- input: Schema.Struct({
16
- name: Schema.optional(Schema.String),
17
- }),
18
- output: Schema.Struct({
19
- object: ViewType,
20
- }),
21
- }) {}
22
- }