@dxos/plugin-explorer 0.8.4-main.ae835ea → 0.8.4-main.bc2380dfbc
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.
- package/LICENSE +102 -5
- package/dist/lib/neutral/ExplorerArticle-EW2MBCRK.mjs +141 -0
- package/dist/lib/neutral/ExplorerArticle-EW2MBCRK.mjs.map +7 -0
- package/dist/lib/neutral/ExplorerPlugin.mjs +10 -0
- package/dist/lib/neutral/capabilities/index.mjs +11 -0
- package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
- package/dist/lib/neutral/chunk-7SPMPHRS.mjs +72 -0
- package/dist/lib/neutral/chunk-7SPMPHRS.mjs.map +7 -0
- package/dist/lib/neutral/chunk-GRJXLL4Z.mjs +25 -0
- package/dist/lib/neutral/chunk-GRJXLL4Z.mjs.map +7 -0
- package/dist/lib/{browser/chunk-UBHZGWZQ.mjs → neutral/chunk-HPIS2WXY.mjs} +2 -2
- package/dist/lib/neutral/chunk-HPIS2WXY.mjs.map +7 -0
- package/dist/lib/{browser/chunk-CRN65FY3.mjs → neutral/components/index.mjs} +817 -288
- package/dist/lib/{node-esm/chunk-RSZFBKZM.mjs.map → neutral/components/index.mjs.map} +4 -4
- package/dist/lib/neutral/containers/index.mjs +9 -0
- package/dist/lib/neutral/containers/index.mjs.map +7 -0
- package/dist/lib/neutral/create-object-F6TKVAGV.mjs +39 -0
- package/dist/lib/neutral/create-object-F6TKVAGV.mjs.map +7 -0
- package/dist/lib/neutral/hooks/index.mjs +45 -0
- package/dist/lib/neutral/hooks/index.mjs.map +7 -0
- package/dist/lib/neutral/index.mjs +14 -0
- package/dist/lib/neutral/meta.json +1 -0
- package/dist/lib/{browser → neutral}/meta.mjs +1 -1
- package/dist/lib/neutral/plugin.mjs +12 -0
- package/dist/lib/neutral/plugin.mjs.map +7 -0
- package/dist/lib/neutral/react-surface-APBW2VQG.mjs +26 -0
- package/dist/lib/neutral/react-surface-APBW2VQG.mjs.map +7 -0
- package/dist/lib/neutral/testing.mjs +8 -0
- package/dist/lib/neutral/translations.mjs +33 -0
- package/dist/lib/neutral/translations.mjs.map +7 -0
- package/dist/lib/{browser → neutral}/types/index.mjs +1 -2
- package/dist/types/data/cities.d.ts +4 -4
- package/dist/types/data/cities.d.ts.map +1 -1
- package/dist/types/data/countries-110m.d.ts +19 -22
- package/dist/types/data/countries-110m.d.ts.map +1 -1
- package/dist/types/src/ExplorerPlugin.d.ts +3 -1
- package/dist/types/src/ExplorerPlugin.d.ts.map +1 -1
- package/dist/types/src/ExplorerPlugin.test.d.ts +2 -0
- package/dist/types/src/ExplorerPlugin.test.d.ts.map +1 -0
- package/dist/types/src/capabilities/create-object.d.ts +11 -0
- package/dist/types/src/capabilities/create-object.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +8 -2
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts +3 -2
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/components/Chart/Chart.d.ts.map +1 -1
- package/dist/types/src/components/Chart/Chart.stories.d.ts +4 -1
- package/dist/types/src/components/Chart/Chart.stories.d.ts.map +1 -1
- package/dist/types/src/components/Globe/Globe.d.ts.map +1 -1
- package/dist/types/src/components/Globe/Globe.stories.d.ts +5 -2
- package/dist/types/src/components/Globe/Globe.stories.d.ts.map +1 -1
- package/dist/types/src/components/Graph/CanvasForceGraph.d.ts +13 -0
- package/dist/types/src/components/Graph/CanvasForceGraph.d.ts.map +1 -0
- package/dist/types/src/components/Graph/CanvasForceGraph.stories.d.ts +17 -0
- package/dist/types/src/components/Graph/CanvasForceGraph.stories.d.ts.map +1 -0
- package/dist/types/src/components/Graph/ForceGraph.d.ts +12 -5
- package/dist/types/src/components/Graph/ForceGraph.d.ts.map +1 -1
- package/dist/types/src/components/Graph/ForceGraph.stories.d.ts +4 -2
- package/dist/types/src/components/Graph/ForceGraph.stories.d.ts.map +1 -1
- package/dist/types/src/components/Graph/{adapter.d.ts → graph-adapter.d.ts} +2 -2
- package/dist/types/src/components/Graph/graph-adapter.d.ts.map +1 -0
- package/dist/types/src/components/Graph/index.d.ts +1 -1
- package/dist/types/src/components/Graph/index.d.ts.map +1 -1
- package/dist/types/src/components/Tree/EdgeBundling.stories.d.ts +21 -0
- package/dist/types/src/components/Tree/EdgeBundling.stories.d.ts.map +1 -0
- package/dist/types/src/components/Tree/Tree.d.ts +20 -23
- package/dist/types/src/components/Tree/Tree.d.ts.map +1 -1
- package/dist/types/src/components/Tree/Tree.stories.d.ts +5 -12
- package/dist/types/src/components/Tree/Tree.stories.d.ts.map +1 -1
- package/dist/types/src/components/Tree/index.d.ts +3 -0
- package/dist/types/src/components/Tree/index.d.ts.map +1 -1
- package/dist/types/src/components/Tree/layout/HierarchicalEdgeBundling.d.ts +35 -2
- package/dist/types/src/components/Tree/layout/HierarchicalEdgeBundling.d.ts.map +1 -1
- package/dist/types/src/components/Tree/layout/RadialTree.d.ts +35 -2
- package/dist/types/src/components/Tree/layout/RadialTree.d.ts.map +1 -1
- package/dist/types/src/components/Tree/layout/TidyTree.d.ts +24 -2
- package/dist/types/src/components/Tree/layout/TidyTree.d.ts.map +1 -1
- package/dist/types/src/components/Tree/layout/hierarchy.d.ts +17 -0
- package/dist/types/src/components/Tree/layout/hierarchy.d.ts.map +1 -0
- package/dist/types/src/components/Tree/layout/index.d.ts +5 -4
- package/dist/types/src/components/Tree/layout/index.d.ts.map +1 -1
- package/dist/types/src/components/Tree/layout/slots.d.ts +7 -0
- package/dist/types/src/components/Tree/layout/slots.d.ts.map +1 -0
- package/dist/types/src/components/Tree/layout/useContainerSize.d.ts +15 -0
- package/dist/types/src/components/Tree/layout/useContainerSize.d.ts.map +1 -0
- package/dist/types/src/components/Tree/space-graph-adapter.d.ts +32 -0
- package/dist/types/src/components/Tree/space-graph-adapter.d.ts.map +1 -0
- package/dist/types/src/components/Tree/testing/generator.d.ts.map +1 -1
- package/dist/types/src/components/Tree/testing/index.d.ts +1 -0
- package/dist/types/src/components/Tree/testing/index.d.ts.map +1 -1
- package/dist/types/src/components/Tree/testing/relations.d.ts +47 -0
- package/dist/types/src/components/Tree/testing/relations.d.ts.map +1 -0
- package/dist/types/src/components/Tree/types/tree.d.ts +18 -16
- package/dist/types/src/components/Tree/types/tree.d.ts.map +1 -1
- package/dist/types/src/components/Tree/types/types.d.ts +14 -4
- package/dist/types/src/components/Tree/types/types.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +0 -4
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/components/plot.d.ts.map +1 -1
- package/dist/types/src/containers/ExplorerArticle/ExplorerArticle.d.ts +8 -0
- package/dist/types/src/containers/ExplorerArticle/ExplorerArticle.d.ts.map +1 -0
- package/dist/types/src/containers/ExplorerArticle/ExplorerArticle.stories.d.ts +24 -0
- package/dist/types/src/containers/ExplorerArticle/ExplorerArticle.stories.d.ts.map +1 -0
- package/dist/types/src/containers/ExplorerArticle/index.d.ts +2 -0
- package/dist/types/src/containers/ExplorerArticle/index.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +3 -0
- package/dist/types/src/containers/index.d.ts.map +1 -0
- package/dist/types/src/hooks/useGraphModel.d.ts +2 -2
- package/dist/types/src/hooks/useGraphModel.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -3
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +2 -2
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/plugin.d.ts +3 -0
- package/dist/types/src/plugin.d.ts.map +1 -0
- package/dist/types/src/testing.d.ts +2 -0
- package/dist/types/src/testing.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +31 -22
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/ExplorerAction.d.ts +1 -18
- package/dist/types/src/types/ExplorerAction.d.ts.map +1 -1
- package/dist/types/src/types/Graph.d.ts +14 -25
- package/dist/types/src/types/Graph.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +113 -61
- package/src/ExplorerPlugin.test.ts +26 -0
- package/src/ExplorerPlugin.tsx +15 -56
- package/src/capabilities/create-object.ts +36 -0
- package/src/capabilities/index.ts +3 -3
- package/src/capabilities/react-surface.tsx +24 -19
- package/src/components/Chart/Chart.stories.tsx +16 -23
- package/src/components/Globe/Globe.stories.tsx +19 -22
- package/src/components/Graph/CanvasForceGraph.stories.tsx +83 -0
- package/src/components/Graph/CanvasForceGraph.tsx +124 -0
- package/src/components/Graph/ForceGraph.stories.tsx +79 -41
- package/src/components/Graph/ForceGraph.tsx +104 -85
- package/src/components/Graph/{adapter.ts → graph-adapter.ts} +14 -8
- package/src/components/Graph/index.ts +1 -1
- package/src/components/Tree/EdgeBundling.stories.tsx +144 -0
- package/src/components/Tree/Tree.stories.tsx +20 -38
- package/src/components/Tree/Tree.tsx +69 -95
- package/src/components/Tree/index.ts +3 -0
- package/src/components/Tree/layout/HierarchicalEdgeBundling.tsx +277 -0
- package/src/components/Tree/layout/RadialTree.tsx +237 -0
- package/src/components/Tree/layout/TidyTree.tsx +246 -0
- package/src/components/Tree/layout/hierarchy.ts +32 -0
- package/src/components/Tree/layout/index.ts +5 -5
- package/src/components/Tree/layout/slots.ts +19 -0
- package/src/components/Tree/layout/useContainerSize.ts +43 -0
- package/src/components/Tree/space-graph-adapter.ts +96 -0
- package/src/components/Tree/testing/generator.ts +4 -2
- package/src/components/Tree/testing/index.ts +1 -0
- package/src/components/Tree/testing/relations.ts +182 -0
- package/src/components/Tree/types/tree.test.ts +7 -6
- package/src/components/Tree/types/tree.ts +41 -20
- package/src/components/Tree/types/types.ts +38 -29
- package/src/components/index.ts +0 -4
- package/src/containers/ExplorerArticle/ExplorerArticle.stories.tsx +119 -0
- package/src/containers/ExplorerArticle/ExplorerArticle.tsx +153 -0
- package/src/containers/ExplorerArticle/index.ts +5 -0
- package/src/containers/index.ts +7 -0
- package/src/hooks/useGraphModel.ts +25 -14
- package/src/index.ts +1 -4
- package/src/meta.ts +3 -3
- package/src/plugin.ts +9 -0
- package/src/testing.ts +7 -0
- package/src/translations.ts +16 -13
- package/src/types/ExplorerAction.ts +10 -19
- package/src/types/Graph.ts +25 -22
- package/src/typings.d.ts +8 -0
- package/dist/lib/browser/ExplorerContainer-L5RVUJRL.mjs +0 -50
- package/dist/lib/browser/ExplorerContainer-L5RVUJRL.mjs.map +0 -7
- package/dist/lib/browser/chunk-2MKBRIUT.mjs +0 -31
- package/dist/lib/browser/chunk-2MKBRIUT.mjs.map +0 -7
- package/dist/lib/browser/chunk-6BVXZQPP.mjs +0 -188
- package/dist/lib/browser/chunk-6BVXZQPP.mjs.map +0 -7
- package/dist/lib/browser/chunk-BGNRYZUN.mjs +0 -79
- package/dist/lib/browser/chunk-BGNRYZUN.mjs.map +0 -7
- package/dist/lib/browser/chunk-CRN65FY3.mjs.map +0 -7
- package/dist/lib/browser/chunk-UBHZGWZQ.mjs.map +0 -7
- package/dist/lib/browser/index.mjs +0 -119
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-FX5H52QN.mjs +0 -31
- package/dist/lib/browser/intent-resolver-FX5H52QN.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/react-surface-VS3ZFL2Y.mjs +0 -35
- package/dist/lib/browser/react-surface-VS3ZFL2Y.mjs.map +0 -7
- package/dist/lib/node-esm/ExplorerContainer-BBLPHH7K.mjs +0 -51
- package/dist/lib/node-esm/ExplorerContainer-BBLPHH7K.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-3ODK27PU.mjs +0 -33
- package/dist/lib/node-esm/chunk-3ODK27PU.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-CRSVAZNA.mjs +0 -190
- package/dist/lib/node-esm/chunk-CRSVAZNA.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +0 -11
- package/dist/lib/node-esm/chunk-RSZFBKZM.mjs +0 -11091
- package/dist/lib/node-esm/chunk-TQESRBUJ.mjs +0 -80
- package/dist/lib/node-esm/chunk-TQESRBUJ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-UXZM5VJB.mjs +0 -26
- package/dist/lib/node-esm/chunk-UXZM5VJB.mjs.map +0 -7
- package/dist/lib/node-esm/index.mjs +0 -120
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-RGBBXXYM.mjs +0 -32
- package/dist/lib/node-esm/intent-resolver-RGBBXXYM.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/lib/node-esm/meta.mjs +0 -9
- package/dist/lib/node-esm/react-surface-SXPT2T37.mjs +0 -36
- package/dist/lib/node-esm/react-surface-SXPT2T37.mjs.map +0 -7
- package/dist/lib/node-esm/types/index.mjs +0 -12
- package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
- package/dist/types/src/components/ExplorerContainer.d.ts +0 -9
- package/dist/types/src/components/ExplorerContainer.d.ts.map +0 -1
- package/dist/types/src/components/Graph/D3ForceGraph.d.ts +0 -14
- package/dist/types/src/components/Graph/D3ForceGraph.d.ts.map +0 -1
- package/dist/types/src/components/Graph/D3ForceGraph.stories.d.ts +0 -15
- package/dist/types/src/components/Graph/D3ForceGraph.stories.d.ts.map +0 -1
- package/dist/types/src/components/Graph/adapter.d.ts.map +0 -1
- package/dist/types/src/components/Graph/testing.d.ts +0 -14
- package/dist/types/src/components/Graph/testing.d.ts.map +0 -1
- package/src/capabilities/intent-resolver.ts +0 -21
- package/src/components/ExplorerContainer.tsx +0 -54
- package/src/components/Graph/D3ForceGraph.stories.tsx +0 -77
- package/src/components/Graph/D3ForceGraph.tsx +0 -101
- package/src/components/Graph/testing.ts +0 -55
- package/src/components/Tree/layout/HierarchicalEdgeBundling.ts +0 -162
- package/src/components/Tree/layout/RadialTree.ts +0 -94
- package/src/components/Tree/layout/TidyTree.ts +0 -101
- /package/dist/lib/{browser/chunk-J5LGTIGS.mjs.map → neutral/ExplorerPlugin.mjs.map} +0 -0
- /package/dist/lib/{browser → neutral}/chunk-J5LGTIGS.mjs +0 -0
- /package/dist/lib/{browser/meta.mjs.map → neutral/chunk-J5LGTIGS.mjs.map} +0 -0
- /package/dist/lib/{browser/types → neutral}/index.mjs.map +0 -0
- /package/dist/lib/{node-esm → neutral}/meta.mjs.map +0 -0
- /package/dist/lib/{node-esm/chunk-HSLMI22Q.mjs.map → neutral/testing.mjs.map} +0 -0
- /package/dist/lib/{node-esm → neutral}/types/index.mjs.map +0 -0
package/LICENSE
CHANGED
|
@@ -1,8 +1,105 @@
|
|
|
1
|
-
|
|
2
|
-
Copyright (c) 2022 DXOS
|
|
1
|
+
# Functional Source License, Version 1.1, ALv2 Future License
|
|
3
2
|
|
|
4
|
-
|
|
3
|
+
## Abbreviation
|
|
5
4
|
|
|
6
|
-
|
|
5
|
+
FSL-1.1-Apache-2.0
|
|
7
6
|
|
|
8
|
-
|
|
7
|
+
## Notice
|
|
8
|
+
|
|
9
|
+
Copyright 2026 DXOS
|
|
10
|
+
|
|
11
|
+
## Terms and Conditions
|
|
12
|
+
|
|
13
|
+
### Licensor ("We")
|
|
14
|
+
|
|
15
|
+
The party offering the Software under these Terms and Conditions.
|
|
16
|
+
|
|
17
|
+
### The Software
|
|
18
|
+
|
|
19
|
+
The "Software" is each version of the software that we make available under
|
|
20
|
+
these Terms and Conditions, as indicated by our inclusion of these Terms and
|
|
21
|
+
Conditions with the Software.
|
|
22
|
+
|
|
23
|
+
### License Grant
|
|
24
|
+
|
|
25
|
+
Subject to your compliance with this License Grant and the Patents,
|
|
26
|
+
Redistribution and Trademark clauses below, we hereby grant you the right to
|
|
27
|
+
use, copy, modify, create derivative works, publicly perform, publicly display
|
|
28
|
+
and redistribute the Software for any Permitted Purpose identified below.
|
|
29
|
+
|
|
30
|
+
### Permitted Purpose
|
|
31
|
+
|
|
32
|
+
A Permitted Purpose is any purpose other than a Competing Use. A Competing Use
|
|
33
|
+
means making the Software available to others in a commercial product or
|
|
34
|
+
service that:
|
|
35
|
+
|
|
36
|
+
1. substitutes for the Software;
|
|
37
|
+
|
|
38
|
+
2. substitutes for any other product or service we offer using the Software
|
|
39
|
+
that exists as of the date we make the Software available; or
|
|
40
|
+
|
|
41
|
+
3. offers the same or substantially similar functionality as the Software.
|
|
42
|
+
|
|
43
|
+
Permitted Purposes specifically include using the Software:
|
|
44
|
+
|
|
45
|
+
1. for your internal use and access;
|
|
46
|
+
|
|
47
|
+
2. for non-commercial education;
|
|
48
|
+
|
|
49
|
+
3. for non-commercial research; and
|
|
50
|
+
|
|
51
|
+
4. in connection with professional services that you provide to a licensee
|
|
52
|
+
using the Software in accordance with these Terms and Conditions.
|
|
53
|
+
|
|
54
|
+
### Patents
|
|
55
|
+
|
|
56
|
+
To the extent your use for a Permitted Purpose would necessarily infringe our
|
|
57
|
+
patents, the license grant above includes a license under our patents. If you
|
|
58
|
+
make a claim against any party that the Software infringes or contributes to
|
|
59
|
+
the infringement of any patent, then your patent license to the Software ends
|
|
60
|
+
immediately.
|
|
61
|
+
|
|
62
|
+
### Redistribution
|
|
63
|
+
|
|
64
|
+
The Terms and Conditions apply to all copies, modifications and derivatives of
|
|
65
|
+
the Software.
|
|
66
|
+
|
|
67
|
+
If you redistribute any copies, modifications or derivatives of the Software,
|
|
68
|
+
you must include a copy of or a link to these Terms and Conditions and not
|
|
69
|
+
remove any copyright notices provided in or with the Software.
|
|
70
|
+
|
|
71
|
+
### Disclaimer
|
|
72
|
+
|
|
73
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTIES OF ANY KIND, EXPRESS OR
|
|
74
|
+
IMPLIED, INCLUDING WITHOUT LIMITATION WARRANTIES OF FITNESS FOR A PARTICULAR
|
|
75
|
+
PURPOSE, MERCHANTABILITY, TITLE OR NON-INFRINGEMENT.
|
|
76
|
+
|
|
77
|
+
IN NO EVENT WILL WE HAVE ANY LIABILITY TO YOU ARISING OUT OF OR RELATED TO THE
|
|
78
|
+
SOFTWARE, INCLUDING INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES,
|
|
79
|
+
EVEN IF WE HAVE BEEN INFORMED OF THEIR POSSIBILITY IN ADVANCE.
|
|
80
|
+
|
|
81
|
+
### Trademarks
|
|
82
|
+
|
|
83
|
+
Except for displaying the License Details and identifying us as the origin of
|
|
84
|
+
the Software, you have no right under these Terms and Conditions to use our
|
|
85
|
+
trademarks, trade names, service marks or product names.
|
|
86
|
+
|
|
87
|
+
## Grant of Future License
|
|
88
|
+
|
|
89
|
+
We hereby irrevocably grant you an additional license to use the Software under
|
|
90
|
+
the Apache License, Version 2.0 that is effective on the second anniversary of
|
|
91
|
+
the date we make the Software available. On or after that date, you may use the
|
|
92
|
+
Software under the Apache License, Version 2.0, in which case the following
|
|
93
|
+
will apply:
|
|
94
|
+
|
|
95
|
+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
96
|
+
this file except in compliance with the License.
|
|
97
|
+
|
|
98
|
+
You may obtain a copy of the License at
|
|
99
|
+
|
|
100
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
101
|
+
|
|
102
|
+
Unless required by applicable law or agreed to in writing, software distributed
|
|
103
|
+
under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
|
104
|
+
CONDITIONS OF ANY KIND, either express or implied. See the License for the
|
|
105
|
+
specific language governing permissions and limitations under the License.
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import "./chunk-J5LGTIGS.mjs";
|
|
2
|
+
|
|
3
|
+
// src/containers/ExplorerArticle/ExplorerArticle.tsx
|
|
4
|
+
import { useAtomValue } from "@effect-atom/atom-react";
|
|
5
|
+
import React, { useCallback, useEffect, useMemo, useState } from "react";
|
|
6
|
+
import { Obj } from "@dxos/echo";
|
|
7
|
+
import { QueryBuilder } from "@dxos/echo-query";
|
|
8
|
+
import { useObject } from "@dxos/react-client/echo";
|
|
9
|
+
import { DxAnchorActivate, Icon, Panel, Toolbar } from "@dxos/react-ui";
|
|
10
|
+
import { QueryEditor } from "@dxos/react-ui-components";
|
|
11
|
+
import { ForceGraph } from "#components";
|
|
12
|
+
import { HierarchicalEdgeBundling, RadialTree, spaceGraphToHierarchy } from "#components";
|
|
13
|
+
import { useGraphModel } from "#hooks";
|
|
14
|
+
var VARIANTS = [
|
|
15
|
+
{
|
|
16
|
+
value: "force",
|
|
17
|
+
icon: "ph--graph--regular",
|
|
18
|
+
label: "Force-directed"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
value: "cluster",
|
|
22
|
+
icon: "ph--asterisk-simple--regular",
|
|
23
|
+
label: "Radial cluster"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
value: "bundle",
|
|
27
|
+
icon: "ph--circles-three-plus--regular",
|
|
28
|
+
label: "Edge bundling"
|
|
29
|
+
}
|
|
30
|
+
];
|
|
31
|
+
var ExplorerArticle = ({ role, subject, variant }) => {
|
|
32
|
+
const [view] = useObject(subject);
|
|
33
|
+
const db = view && Obj.getDatabase(view);
|
|
34
|
+
const [filter, setFilter] = useState();
|
|
35
|
+
const model = useGraphModel(db, filter);
|
|
36
|
+
const builder = useMemo(() => new QueryBuilder(), []);
|
|
37
|
+
const handleChange = useCallback((value) => {
|
|
38
|
+
setFilter(builder.build(value).filter);
|
|
39
|
+
}, []);
|
|
40
|
+
const [selected, setSelected] = useState(isVariant(variant) ? variant : "force");
|
|
41
|
+
useEffect(() => {
|
|
42
|
+
if (isVariant(variant)) {
|
|
43
|
+
setSelected(variant);
|
|
44
|
+
}
|
|
45
|
+
}, [
|
|
46
|
+
variant
|
|
47
|
+
]);
|
|
48
|
+
const handleVariantChange = useCallback((value) => {
|
|
49
|
+
if (isVariant(value)) {
|
|
50
|
+
setSelected(value);
|
|
51
|
+
}
|
|
52
|
+
}, []);
|
|
53
|
+
const handleHoverPreview = useCallback((node, event) => {
|
|
54
|
+
if (!node || !event) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
const obj = node.data;
|
|
58
|
+
if (!obj || !Obj.isObject(obj)) {
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
const dxn = Obj.getDXN(obj)?.toString();
|
|
62
|
+
if (!dxn) {
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
const target = event.target;
|
|
66
|
+
target.dispatchEvent(new DxAnchorActivate({
|
|
67
|
+
dxn,
|
|
68
|
+
label: Obj.getLabel(obj) ?? dxn,
|
|
69
|
+
trigger: target,
|
|
70
|
+
kind: "card"
|
|
71
|
+
}));
|
|
72
|
+
}, []);
|
|
73
|
+
const showToolbar = role === "article";
|
|
74
|
+
if (!db || !model) {
|
|
75
|
+
return null;
|
|
76
|
+
}
|
|
77
|
+
return /* @__PURE__ */ React.createElement(Panel.Root, {
|
|
78
|
+
role
|
|
79
|
+
}, showToolbar && /* @__PURE__ */ React.createElement(Panel.Toolbar, {
|
|
80
|
+
asChild: true
|
|
81
|
+
}, /* @__PURE__ */ React.createElement(Toolbar.Root, null, /* @__PURE__ */ React.createElement(QueryEditor, {
|
|
82
|
+
db,
|
|
83
|
+
onChange: handleChange
|
|
84
|
+
}), /* @__PURE__ */ React.createElement(Toolbar.ToggleGroup, {
|
|
85
|
+
type: "single",
|
|
86
|
+
value: selected,
|
|
87
|
+
onValueChange: handleVariantChange
|
|
88
|
+
}, VARIANTS.map(({ value, icon, label }) => /* @__PURE__ */ React.createElement(Toolbar.ToggleGroupItem, {
|
|
89
|
+
key: value,
|
|
90
|
+
value,
|
|
91
|
+
"aria-label": label,
|
|
92
|
+
title: label
|
|
93
|
+
}, /* @__PURE__ */ React.createElement(Icon, {
|
|
94
|
+
icon,
|
|
95
|
+
size: 4
|
|
96
|
+
})))))), /* @__PURE__ */ React.createElement(Panel.Content, null, /* @__PURE__ */ React.createElement(Visualization, {
|
|
97
|
+
variant: selected,
|
|
98
|
+
model,
|
|
99
|
+
onNodeHover: handleHoverPreview
|
|
100
|
+
})));
|
|
101
|
+
};
|
|
102
|
+
var isVariant = (value) => value === "force" || value === "cluster" || value === "bundle";
|
|
103
|
+
var Visualization = ({ variant, model, onNodeHover }) => {
|
|
104
|
+
if (variant === "force") {
|
|
105
|
+
return /* @__PURE__ */ React.createElement(ForceGraph, {
|
|
106
|
+
model,
|
|
107
|
+
onInspect: (node, event) => onNodeHover?.({
|
|
108
|
+
id: node.id,
|
|
109
|
+
data: node.data?.data?.object
|
|
110
|
+
}, event)
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
return /* @__PURE__ */ React.createElement(HierarchyVisualization, {
|
|
114
|
+
variant,
|
|
115
|
+
model,
|
|
116
|
+
onNodeHover
|
|
117
|
+
});
|
|
118
|
+
};
|
|
119
|
+
var HierarchyVisualization = ({ variant, model, onNodeHover }) => {
|
|
120
|
+
const graphSnapshot = useAtomValue(model.graphAtom);
|
|
121
|
+
const { tree, edges } = useMemo(() => spaceGraphToHierarchy(model), [
|
|
122
|
+
model,
|
|
123
|
+
graphSnapshot
|
|
124
|
+
]);
|
|
125
|
+
if (variant === "cluster") {
|
|
126
|
+
return /* @__PURE__ */ React.createElement(RadialTree, {
|
|
127
|
+
data: tree,
|
|
128
|
+
cluster: true,
|
|
129
|
+
onNodeHover
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
return /* @__PURE__ */ React.createElement(HierarchicalEdgeBundling, {
|
|
133
|
+
data: tree,
|
|
134
|
+
edges,
|
|
135
|
+
onNodeHover
|
|
136
|
+
});
|
|
137
|
+
};
|
|
138
|
+
export {
|
|
139
|
+
ExplorerArticle as default
|
|
140
|
+
};
|
|
141
|
+
//# sourceMappingURL=ExplorerArticle-EW2MBCRK.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/containers/ExplorerArticle/ExplorerArticle.tsx"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { useAtomValue } from '@effect-atom/atom-react';\nimport React, { useCallback, useEffect, useMemo, useState } from 'react';\n\nimport { type AppSurface } from '@dxos/app-toolkit/ui';\nimport { type Filter, Obj, type View } from '@dxos/echo';\nimport { QueryBuilder } from '@dxos/echo-query';\nimport { useObject } from '@dxos/react-client/echo';\nimport { DxAnchorActivate, Icon, Panel, Toolbar } from '@dxos/react-ui';\nimport { QueryEditor, type QueryEditorProps } from '@dxos/react-ui-components';\n\nimport { ForceGraph } from '#components';\nimport { HierarchicalEdgeBundling, RadialTree, spaceGraphToHierarchy, type TreeNode } from '#components';\nimport { useGraphModel } from '#hooks';\n\n/** Visualization variants exposed by `ExplorerArticle`. */\nexport type ExplorerArticleVariant = 'force' | 'cluster' | 'bundle';\n\nconst VARIANTS: { value: ExplorerArticleVariant; icon: string; label: string }[] = [\n {\n value: 'force',\n icon: 'ph--graph--regular',\n label: 'Force-directed',\n },\n {\n value: 'cluster',\n icon: 'ph--asterisk-simple--regular',\n label: 'Radial cluster',\n },\n {\n value: 'bundle',\n icon: 'ph--circles-three-plus--regular',\n label: 'Edge bundling',\n },\n];\n\nexport type ExplorerArticleProps = AppSurface.ObjectArticleProps<View.View>;\n\nexport const ExplorerArticle = ({ role, subject, variant }: ExplorerArticleProps) => {\n const [view] = useObject(subject);\n const db = view && Obj.getDatabase(view);\n const [filter, setFilter] = useState<Filter.Any>();\n const model = useGraphModel(db, filter);\n\n const builder = useMemo(() => new QueryBuilder(), []);\n const handleChange = useCallback<NonNullable<QueryEditorProps['onChange']>>((value) => {\n setFilter(builder.build(value).filter);\n }, []);\n\n // The `variant` prop is the initial value; user can toggle via the toolbar tabs.\n const [selected, setSelected] = useState<ExplorerArticleVariant>(isVariant(variant) ? variant : 'force');\n useEffect(() => {\n if (isVariant(variant)) {\n setSelected(variant);\n }\n }, [variant]);\n const handleVariantChange = useCallback((value: string) => {\n if (isVariant(value)) {\n setSelected(value);\n }\n }, []);\n\n const handleHoverPreview = useCallback((node: TreeNode | null, event?: MouseEvent) => {\n if (!node || !event) {\n return;\n }\n const obj = node.data;\n if (!obj || !Obj.isObject(obj)) {\n return;\n }\n const dxn = Obj.getDXN(obj)?.toString();\n if (!dxn) {\n return;\n }\n const target = event.target as HTMLElement;\n target.dispatchEvent(\n new DxAnchorActivate({\n dxn,\n label: Obj.getLabel(obj) ?? dxn,\n trigger: target,\n kind: 'card',\n }),\n );\n }, []);\n\n const showToolbar = role === 'article';\n\n if (!db || !model) {\n return null;\n }\n\n return (\n <Panel.Root role={role}>\n {showToolbar && (\n <Panel.Toolbar asChild>\n <Toolbar.Root>\n <QueryEditor db={db} onChange={handleChange} />\n <Toolbar.ToggleGroup type='single' value={selected} onValueChange={handleVariantChange}>\n {VARIANTS.map(({ value, icon, label }) => (\n <Toolbar.ToggleGroupItem key={value} value={value} aria-label={label} title={label}>\n <Icon icon={icon} size={4} />\n </Toolbar.ToggleGroupItem>\n ))}\n </Toolbar.ToggleGroup>\n </Toolbar.Root>\n </Panel.Toolbar>\n )}\n <Panel.Content>\n <Visualization variant={selected} model={model} onNodeHover={handleHoverPreview} />\n </Panel.Content>\n </Panel.Root>\n );\n};\n\nconst isVariant = (value: unknown): value is ExplorerArticleVariant =>\n value === 'force' || value === 'cluster' || value === 'bundle';\n\ntype VisualizationProps = {\n variant: ExplorerArticleVariant;\n model: NonNullable<ReturnType<typeof useGraphModel>>;\n onNodeHover?: (node: TreeNode | null, event?: MouseEvent) => void;\n};\n\nconst Visualization = ({ variant, model, onNodeHover }: VisualizationProps) => {\n if (variant === 'force') {\n // ForceGraph subscribes to model.graphAtom internally; don't re-render the wrapper on every tick.\n return (\n <ForceGraph\n model={model}\n onInspect={(node, event) => onNodeHover?.({ id: node.id, data: node.data?.data?.object }, event)}\n />\n );\n }\n\n return <HierarchyVisualization variant={variant} model={model} onNodeHover={onNodeHover} />;\n};\n\n/**\n * Read from the model's reactive graph atom so the hierarchy is rebuilt as objects/relations stream in.\n */\nconst HierarchyVisualization = ({ variant, model, onNodeHover }: VisualizationProps) => {\n // Capture the atom snapshot so the memo's dep list explicitly tracks each push from the atom.\n const graphSnapshot = useAtomValue(model.graphAtom);\n const { tree, edges } = useMemo(() => spaceGraphToHierarchy(model), [model, graphSnapshot]);\n if (variant === 'cluster') {\n return <RadialTree data={tree} cluster onNodeHover={onNodeHover} />;\n }\n\n return <HierarchicalEdgeBundling data={tree} edges={edges} onNodeHover={onNodeHover} />;\n};\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": ["useAtomValue", "React", "useCallback", "useEffect", "useMemo", "useState", "Obj", "QueryBuilder", "useObject", "DxAnchorActivate", "Icon", "Panel", "Toolbar", "QueryEditor", "ForceGraph", "HierarchicalEdgeBundling", "RadialTree", "spaceGraphToHierarchy", "useGraphModel", "VARIANTS", "value", "icon", "label", "ExplorerArticle", "role", "subject", "variant", "view", "db", "getDatabase", "filter", "setFilter", "model", "builder", "handleChange", "build", "selected", "setSelected", "isVariant", "handleVariantChange", "handleHoverPreview", "node", "event", "obj", "data", "isObject", "dxn", "getDXN", "toString", "target", "dispatchEvent", "getLabel", "trigger", "kind", "showToolbar", "Root", "asChild", "onChange", "ToggleGroup", "type", "onValueChange", "map", "ToggleGroupItem", "key", "aria-label", "title", "size", "Content", "Visualization", "onNodeHover", "onInspect", "id", "object", "HierarchyVisualization", "graphSnapshot", "graphAtom", "tree", "edges", "cluster"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import "../chunk-J5LGTIGS.mjs";
|
|
2
|
+
|
|
3
|
+
// src/capabilities/index.ts
|
|
4
|
+
import { Capability } from "@dxos/app-framework";
|
|
5
|
+
var CreateObject = Capability.lazy("CreateObject", () => import("../create-object-F6TKVAGV.mjs"));
|
|
6
|
+
var ReactSurface = Capability.lazy("ReactSurface", () => import("../react-surface-APBW2VQG.mjs"));
|
|
7
|
+
export {
|
|
8
|
+
CreateObject,
|
|
9
|
+
ReactSurface
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/capabilities/index.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capability } from '@dxos/app-framework';\n\nexport const CreateObject = Capability.lazy('CreateObject', () => import('./create-object'));\nexport const ReactSurface = Capability.lazy('ReactSurface', () => import('./react-surface'));\n"],
|
|
5
|
+
"mappings": ";;;AAIA,SAASA,kBAAkB;AAEpB,IAAMC,eAAeD,WAAWE,KAAK,gBAAgB,MAAM,OAAO,+BAAA,CAAA;AAClE,IAAMC,eAAeH,WAAWE,KAAK,gBAAgB,MAAM,OAAO,+BAAA,CAAA;",
|
|
6
|
+
"names": ["Capability", "CreateObject", "lazy", "ReactSurface"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__export
|
|
3
|
+
} from "./chunk-J5LGTIGS.mjs";
|
|
4
|
+
|
|
5
|
+
// src/types/ExplorerAction.ts
|
|
6
|
+
var ExplorerAction_exports = {};
|
|
7
|
+
__export(ExplorerAction_exports, {
|
|
8
|
+
GraphProps: () => GraphProps
|
|
9
|
+
});
|
|
10
|
+
import * as Schema from "effect/Schema";
|
|
11
|
+
import { TypeInputOptionsAnnotation } from "@dxos/plugin-space";
|
|
12
|
+
var GraphProps = Schema.Struct({
|
|
13
|
+
name: Schema.optional(Schema.String),
|
|
14
|
+
// TODO(wittjosiah): This should be a query input instead.
|
|
15
|
+
typename: Schema.String.pipe(Schema.annotations({
|
|
16
|
+
title: "Select type"
|
|
17
|
+
}), TypeInputOptionsAnnotation.set({
|
|
18
|
+
location: [
|
|
19
|
+
"database",
|
|
20
|
+
"runtime"
|
|
21
|
+
],
|
|
22
|
+
kind: [
|
|
23
|
+
"user"
|
|
24
|
+
]
|
|
25
|
+
}), Schema.optional)
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
// src/types/Graph.ts
|
|
29
|
+
var Graph_exports = {};
|
|
30
|
+
__export(Graph_exports, {
|
|
31
|
+
Graph: () => Graph,
|
|
32
|
+
make: () => make
|
|
33
|
+
});
|
|
34
|
+
import * as Schema2 from "effect/Schema";
|
|
35
|
+
import { Annotation, Filter, Obj, Query, QueryAST, Ref, Type, View } from "@dxos/echo";
|
|
36
|
+
import { FormInputAnnotation, LabelAnnotation } from "@dxos/echo/internal";
|
|
37
|
+
import { ViewAnnotation } from "@dxos/schema";
|
|
38
|
+
var GraphSchema = Schema2.Struct({
|
|
39
|
+
name: Schema2.optional(Schema2.String),
|
|
40
|
+
view: Ref.Ref(View.View).pipe(FormInputAnnotation.set(false)),
|
|
41
|
+
query: Schema2.Struct({
|
|
42
|
+
raw: Schema2.optional(Schema2.String),
|
|
43
|
+
ast: QueryAST.Query
|
|
44
|
+
}).pipe(FormInputAnnotation.set(false))
|
|
45
|
+
}).pipe(Type.object({
|
|
46
|
+
typename: "org.dxos.type.graph",
|
|
47
|
+
version: "0.1.0"
|
|
48
|
+
}), LabelAnnotation.set([
|
|
49
|
+
"name"
|
|
50
|
+
]), ViewAnnotation.set([
|
|
51
|
+
"view"
|
|
52
|
+
]), Annotation.IconAnnotation.set({
|
|
53
|
+
icon: "ph--graph--regular",
|
|
54
|
+
hue: "green"
|
|
55
|
+
}));
|
|
56
|
+
var Graph = GraphSchema;
|
|
57
|
+
var make = ({ name, query = {
|
|
58
|
+
raw: "",
|
|
59
|
+
ast: Query.select(Filter.nothing()).ast
|
|
60
|
+
}, view }) => {
|
|
61
|
+
return Obj.make(Graph, {
|
|
62
|
+
name,
|
|
63
|
+
view: Ref.make(view),
|
|
64
|
+
query
|
|
65
|
+
});
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export {
|
|
69
|
+
ExplorerAction_exports,
|
|
70
|
+
Graph_exports
|
|
71
|
+
};
|
|
72
|
+
//# sourceMappingURL=chunk-7SPMPHRS.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/types/ExplorerAction.ts", "../../../src/types/Graph.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { TypeInputOptionsAnnotation } from '@dxos/plugin-space';\n\nexport const GraphProps = Schema.Struct({\n name: Schema.optional(Schema.String),\n // TODO(wittjosiah): This should be a query input instead.\n typename: Schema.String.pipe(\n Schema.annotations({ title: 'Select type' }),\n TypeInputOptionsAnnotation.set({\n location: ['database', 'runtime'],\n kind: ['user'],\n }),\n Schema.optional,\n ),\n});\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { Annotation, Filter, Obj, Query, QueryAST, Ref, Type, View } from '@dxos/echo';\nimport { FormInputAnnotation, LabelAnnotation } from '@dxos/echo/internal';\nimport { ViewAnnotation } from '@dxos/schema';\n\nconst GraphSchema = Schema.Struct({\n name: Schema.optional(Schema.String),\n\n view: Ref.Ref(View.View).pipe(FormInputAnnotation.set(false)),\n\n query: Schema.Struct({\n raw: Schema.optional(Schema.String),\n ast: QueryAST.Query,\n }).pipe(FormInputAnnotation.set(false)),\n}).pipe(\n Type.object({\n typename: 'org.dxos.type.graph',\n version: '0.1.0',\n }),\n LabelAnnotation.set(['name']),\n ViewAnnotation.set(['view']),\n Annotation.IconAnnotation.set({\n icon: 'ph--graph--regular',\n hue: 'green',\n }),\n);\nexport interface Graph extends Schema.Schema.Type<typeof GraphSchema> {}\nexport const Graph: Type.Obj<Graph> = GraphSchema as any;\n\ntype MakeProps = Omit<Partial<Obj.MakeProps<typeof Graph>>, 'view'> & {\n view: View.View;\n};\n\n/**\n * Make a graph as a view of a data set.\n */\nexport const make = ({\n name,\n query = { raw: '', ast: Query.select(Filter.nothing()).ast },\n view,\n}: MakeProps): Graph => {\n return Obj.make(Graph, { name, view: Ref.make(view), query });\n};\n"],
|
|
5
|
+
"mappings": ";;;;;AAAA;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,kCAAkC;AAEpC,IAAMC,aAAoBC,cAAO;EACtCC,MAAaC,gBAAgBC,aAAM;;EAEnCC,UAAiBD,cAAOE,KACfC,mBAAY;IAAEC,OAAO;EAAc,CAAA,GAC1CT,2BAA2BU,IAAI;IAC7BC,UAAU;MAAC;MAAY;;IACvBC,MAAM;MAAC;;EACT,CAAA,GACOR,eAAQ;AAEnB,CAAA;;;ACnBA;;;;;AAIA,YAAYS,aAAY;AAExB,SAASC,YAAYC,QAAQC,KAAKC,OAAOC,UAAUC,KAAKC,MAAMC,YAAY;AAC1E,SAASC,qBAAqBC,uBAAuB;AACrD,SAASC,sBAAsB;AAE/B,IAAMC,cAAqBC,eAAO;EAChCC,MAAaC,iBAAgBC,cAAM;EAEnCC,MAAMX,IAAIA,IAAIE,KAAKA,IAAI,EAAEU,KAAKT,oBAAoBU,IAAI,KAAA,CAAA;EAEtDC,OAAcP,eAAO;IACnBQ,KAAYN,iBAAgBC,cAAM;IAClCM,KAAKjB,SAASD;EAChB,CAAA,EAAGc,KAAKT,oBAAoBU,IAAI,KAAA,CAAA;AAClC,CAAA,EAAGD,KACDX,KAAKgB,OAAO;EACVC,UAAU;EACVC,SAAS;AACX,CAAA,GACAf,gBAAgBS,IAAI;EAAC;CAAO,GAC5BR,eAAeQ,IAAI;EAAC;CAAO,GAC3BlB,WAAWyB,eAAeP,IAAI;EAC5BQ,MAAM;EACNC,KAAK;AACP,CAAA,CAAA;AAGK,IAAMC,QAAyBjB;AAS/B,IAAMkB,OAAO,CAAC,EACnBhB,MACAM,QAAQ;EAAEC,KAAK;EAAIC,KAAKlB,MAAM2B,OAAO7B,OAAO8B,QAAO,CAAA,EAAIV;AAAI,GAC3DL,KAAI,MACM;AACV,SAAOd,IAAI2B,KAAKD,OAAO;IAAEf;IAAMG,MAAMX,IAAIwB,KAAKb,IAAAA;IAAOG;EAAM,CAAA;AAC7D;",
|
|
6
|
+
"names": ["Schema", "TypeInputOptionsAnnotation", "GraphProps", "Struct", "name", "optional", "String", "typename", "pipe", "annotations", "title", "set", "location", "kind", "Schema", "Annotation", "Filter", "Obj", "Query", "QueryAST", "Ref", "Type", "View", "FormInputAnnotation", "LabelAnnotation", "ViewAnnotation", "GraphSchema", "Struct", "name", "optional", "String", "view", "pipe", "set", "query", "raw", "ast", "object", "typename", "version", "IconAnnotation", "icon", "hue", "Graph", "make", "select", "nothing"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// src/ExplorerPlugin.tsx
|
|
2
|
+
import { Plugin } from "@dxos/app-framework";
|
|
3
|
+
import { AppPlugin } from "@dxos/app-toolkit";
|
|
4
|
+
import { CreateObject, ReactSurface } from "#capabilities";
|
|
5
|
+
import { meta } from "#meta";
|
|
6
|
+
import { translations } from "#translations";
|
|
7
|
+
import { Graph } from "#types";
|
|
8
|
+
var ExplorerPlugin = Plugin.define(meta).pipe(AppPlugin.addCreateObjectModule({
|
|
9
|
+
activate: CreateObject
|
|
10
|
+
}), AppPlugin.addSchemaModule({
|
|
11
|
+
schema: [
|
|
12
|
+
Graph.Graph
|
|
13
|
+
]
|
|
14
|
+
}), AppPlugin.addSurfaceModule({
|
|
15
|
+
activate: ReactSurface
|
|
16
|
+
}), AppPlugin.addTranslationsModule({
|
|
17
|
+
translations
|
|
18
|
+
}), Plugin.make);
|
|
19
|
+
var ExplorerPlugin_default = ExplorerPlugin;
|
|
20
|
+
|
|
21
|
+
export {
|
|
22
|
+
ExplorerPlugin,
|
|
23
|
+
ExplorerPlugin_default
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=chunk-GRJXLL4Z.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/ExplorerPlugin.tsx"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Plugin } from '@dxos/app-framework';\nimport { AppPlugin } from '@dxos/app-toolkit';\n\nimport { CreateObject, ReactSurface } from '#capabilities';\nimport { meta } from '#meta';\nimport { translations } from '#translations';\nimport { Graph } from '#types';\n\nexport const ExplorerPlugin = Plugin.define(meta).pipe(\n AppPlugin.addCreateObjectModule({ activate: CreateObject }),\n AppPlugin.addSchemaModule({ schema: [Graph.Graph] }),\n AppPlugin.addSurfaceModule({ activate: ReactSurface }),\n AppPlugin.addTranslationsModule({ translations }),\n Plugin.make,\n);\n\nexport default ExplorerPlugin;\n"],
|
|
5
|
+
"mappings": ";AAIA,SAASA,cAAc;AACvB,SAASC,iBAAiB;AAE1B,SAASC,cAAcC,oBAAoB;AAC3C,SAASC,YAAY;AACrB,SAASC,oBAAoB;AAC7B,SAASC,aAAa;AAEf,IAAMC,iBAAiBP,OAAOQ,OAAOJ,IAAAA,EAAMK,KAChDR,UAAUS,sBAAsB;EAAEC,UAAUT;AAAa,CAAA,GACzDD,UAAUW,gBAAgB;EAAEC,QAAQ;IAACP,MAAMA;;AAAO,CAAA,GAClDL,UAAUa,iBAAiB;EAAEH,UAAUR;AAAa,CAAA,GACpDF,UAAUc,sBAAsB;EAAEV;AAAa,CAAA,GAC/CL,OAAOgB,IAAI;AAGb,IAAA,yBAAeT;",
|
|
6
|
+
"names": ["Plugin", "AppPlugin", "CreateObject", "ReactSurface", "meta", "translations", "Graph", "ExplorerPlugin", "define", "pipe", "addCreateObjectModule", "activate", "addSchemaModule", "schema", "addSurfaceModule", "addTranslationsModule", "make"]
|
|
7
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// src/meta.ts
|
|
2
2
|
import { trim } from "@dxos/util";
|
|
3
3
|
var meta = {
|
|
4
|
-
id: "dxos.
|
|
4
|
+
id: "org.dxos.plugin.explorer",
|
|
5
5
|
name: "Explorer",
|
|
6
6
|
description: trim`
|
|
7
7
|
Interactive hypergraph visualization that reveals relationships between objects in your workspace.
|
|
@@ -21,4 +21,4 @@ var meta = {
|
|
|
21
21
|
export {
|
|
22
22
|
meta
|
|
23
23
|
};
|
|
24
|
-
//# sourceMappingURL=chunk-
|
|
24
|
+
//# sourceMappingURL=chunk-HPIS2WXY.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/meta.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Plugin } from '@dxos/app-framework';\nimport { trim } from '@dxos/util';\n\nexport const meta: Plugin.Meta = {\n id: 'org.dxos.plugin.explorer',\n name: 'Explorer',\n description: trim`\n Interactive hypergraph visualization that reveals relationships between objects in your workspace.\n Navigate complex data structures and discover connections through a dynamic network view.\n `,\n icon: 'ph--graph--regular',\n iconHue: 'green',\n source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-explorer',\n tags: ['labs'],\n screenshots: ['https://dxos.network/plugin-details-explorer-dark.png'],\n};\n"],
|
|
5
|
+
"mappings": ";AAKA,SAASA,YAAY;AAEd,IAAMC,OAAoB;EAC/BC,IAAI;EACJC,MAAM;EACNC,aAAaJ;;;;EAIbK,MAAM;EACNC,SAAS;EACTC,QAAQ;EACRC,MAAM;IAAC;;EACPC,aAAa;IAAC;;AAChB;",
|
|
6
|
+
"names": ["trim", "meta", "id", "name", "description", "icon", "iconHue", "source", "tags", "screenshots"]
|
|
7
|
+
}
|