@dxos/plugin-explorer 0.8.3 → 0.8.4-main.1068cf700f
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/dist/lib/browser/ExplorerContainer-46BHUF6R.mjs +45 -0
- package/dist/lib/browser/ExplorerContainer-46BHUF6R.mjs.map +7 -0
- package/dist/lib/browser/chunk-HIFLWHXR.mjs +83 -0
- package/dist/lib/browser/chunk-HIFLWHXR.mjs.map +7 -0
- package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/browser/chunk-J5LGTIGS.mjs.map +7 -0
- package/dist/lib/browser/{chunk-JRKQNHS6.mjs → chunk-JZSBQYJQ.mjs} +152 -405
- package/dist/lib/{node-esm/chunk-IUFYOE44.mjs.map → browser/chunk-JZSBQYJQ.mjs.map} +3 -3
- package/dist/lib/browser/chunk-KIXHZZ2C.mjs +35 -0
- package/dist/lib/browser/chunk-KIXHZZ2C.mjs.map +7 -0
- package/dist/lib/browser/chunk-MGBT2ZFU.mjs +177 -0
- package/dist/lib/browser/chunk-MGBT2ZFU.mjs.map +7 -0
- package/dist/lib/browser/chunk-YNQF4CPY.mjs +24 -0
- package/dist/lib/browser/chunk-YNQF4CPY.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +60 -70
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/meta.mjs +2 -3
- package/dist/lib/browser/react-surface-TPQAT5EI.mjs +36 -0
- package/dist/lib/browser/react-surface-TPQAT5EI.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +6 -6
- package/dist/lib/node-esm/ExplorerContainer-OZNG47QB.mjs +46 -0
- package/dist/lib/node-esm/ExplorerContainer-OZNG47QB.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-3OE6TBJI.mjs +84 -0
- package/dist/lib/node-esm/chunk-3OE6TBJI.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-VSORIAHH.mjs → chunk-ASRWO2N5.mjs} +12 -7
- package/dist/lib/node-esm/chunk-ASRWO2N5.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-3CMBLK6W.mjs → chunk-DK77RB6M.mjs} +9 -6
- package/dist/lib/node-esm/chunk-DK77RB6M.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +11 -0
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-IUFYOE44.mjs → chunk-K5BYG7BW.mjs} +152 -405
- package/dist/lib/{browser/chunk-JRKQNHS6.mjs.map → node-esm/chunk-K5BYG7BW.mjs.map} +3 -3
- package/dist/lib/node-esm/chunk-YWJBDETV.mjs +179 -0
- package/dist/lib/node-esm/chunk-YWJBDETV.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +60 -70
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/meta.mjs +2 -3
- package/dist/lib/node-esm/react-surface-CYHGJJDU.mjs +37 -0
- package/dist/lib/node-esm/react-surface-CYHGJJDU.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +6 -6
- package/dist/types/src/ExplorerPlugin.d.ts +2 -1
- package/dist/types/src/ExplorerPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +1 -2
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface/index.d.ts +3 -0
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts +5 -0
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -0
- package/dist/types/src/components/Chart/Chart.d.ts.map +1 -1
- package/dist/types/src/components/Chart/Chart.stories.d.ts +8 -4
- package/dist/types/src/components/Chart/Chart.stories.d.ts.map +1 -1
- package/dist/types/src/components/ExplorerContainer.d.ts +4 -6
- package/dist/types/src/components/ExplorerContainer.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 +8 -4
- package/dist/types/src/components/Globe/Globe.stories.d.ts.map +1 -1
- package/dist/types/src/components/Graph/D3ForceGraph.d.ts +2 -2
- package/dist/types/src/components/Graph/D3ForceGraph.d.ts.map +1 -1
- package/dist/types/src/components/Graph/D3ForceGraph.stories.d.ts +13 -4
- package/dist/types/src/components/Graph/D3ForceGraph.stories.d.ts.map +1 -1
- package/dist/types/src/components/Graph/ForceGraph.stories.d.ts +13 -4
- package/dist/types/src/components/Graph/ForceGraph.stories.d.ts.map +1 -1
- package/dist/types/src/components/Graph/adapter.d.ts +1 -1
- package/dist/types/src/components/Graph/adapter.d.ts.map +1 -1
- package/dist/types/src/components/Graph/testing.d.ts +1 -1
- package/dist/types/src/components/Graph/testing.d.ts.map +1 -1
- package/dist/types/src/components/Tree/Tree.d.ts.map +1 -1
- package/dist/types/src/components/Tree/Tree.stories.d.ts +13 -16
- package/dist/types/src/components/Tree/Tree.stories.d.ts.map +1 -1
- package/dist/types/src/components/Tree/testing/generator.d.ts.map +1 -1
- 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 +1 -1
- package/dist/types/src/components/Tree/types/types.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +2 -4
- package/dist/types/src/components/index.d.ts.map +1 -1
- 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/meta.d.ts +2 -3
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +34 -22
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/ExplorerAction.d.ts +6 -0
- package/dist/types/src/types/ExplorerAction.d.ts.map +1 -0
- package/dist/types/src/types/Graph.d.ts +30 -0
- package/dist/types/src/types/Graph.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +2 -2
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +61 -44
- package/src/ExplorerPlugin.tsx +31 -53
- package/src/capabilities/index.ts +1 -4
- package/src/capabilities/react-surface/index.ts +7 -0
- package/src/capabilities/react-surface/react-surface.tsx +31 -0
- package/src/components/Chart/Chart.stories.tsx +10 -8
- package/src/components/Chart/Chart.tsx +1 -1
- package/src/components/ExplorerContainer.tsx +30 -14
- package/src/components/Globe/Globe.stories.tsx +15 -13
- package/src/components/Globe/Globe.tsx +1 -1
- package/src/components/Graph/D3ForceGraph.stories.tsx +40 -21
- package/src/components/Graph/D3ForceGraph.tsx +6 -6
- package/src/components/Graph/ForceGraph.stories.tsx +40 -21
- package/src/components/Graph/ForceGraph.tsx +5 -5
- package/src/components/Graph/adapter.ts +14 -8
- package/src/components/Graph/testing.ts +13 -10
- package/src/components/Tree/Tree.stories.tsx +29 -22
- package/src/components/Tree/Tree.tsx +11 -6
- package/src/components/Tree/testing/generator.ts +4 -2
- package/src/components/Tree/types/tree.test.ts +8 -5
- package/src/components/Tree/types/tree.ts +40 -19
- package/src/components/Tree/types/types.ts +1 -1
- package/src/components/index.ts +3 -3
- package/src/hooks/useGraphModel.ts +9 -5
- package/src/meta.ts +9 -6
- package/src/translations.ts +12 -6
- package/src/types/ExplorerAction.ts +21 -0
- package/src/types/Graph.ts +62 -0
- package/src/types/index.ts +2 -2
- package/dist/lib/browser/ExplorerContainer-DXL34I3F.mjs +0 -37
- package/dist/lib/browser/ExplorerContainer-DXL34I3F.mjs.map +0 -7
- package/dist/lib/browser/chunk-73YTQHOT.mjs +0 -38
- package/dist/lib/browser/chunk-73YTQHOT.mjs.map +0 -7
- package/dist/lib/browser/chunk-OBAFAA5V.mjs +0 -21
- package/dist/lib/browser/chunk-OBAFAA5V.mjs.map +0 -7
- package/dist/lib/browser/chunk-SLB2F5AO.mjs +0 -30
- package/dist/lib/browser/chunk-SLB2F5AO.mjs.map +0 -7
- package/dist/lib/browser/chunk-Z5BGAHLD.mjs +0 -187
- package/dist/lib/browser/chunk-Z5BGAHLD.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-JZKYVFQJ.mjs +0 -24
- package/dist/lib/browser/intent-resolver-JZKYVFQJ.mjs.map +0 -7
- package/dist/lib/browser/react-surface-IAEP2GBT.mjs +0 -31
- package/dist/lib/browser/react-surface-IAEP2GBT.mjs.map +0 -7
- package/dist/lib/node/ExplorerContainer-VUXH55VV.cjs +0 -61
- package/dist/lib/node/ExplorerContainer-VUXH55VV.cjs.map +0 -7
- package/dist/lib/node/chunk-4T4LCT5R.cjs +0 -52
- package/dist/lib/node/chunk-4T4LCT5R.cjs.map +0 -7
- package/dist/lib/node/chunk-BCDVG2CH.cjs +0 -44
- package/dist/lib/node/chunk-BCDVG2CH.cjs.map +0 -7
- package/dist/lib/node/chunk-MLRYW4WQ.cjs +0 -56
- package/dist/lib/node/chunk-MLRYW4WQ.cjs.map +0 -7
- package/dist/lib/node/chunk-SVU4VMYX.cjs +0 -11339
- package/dist/lib/node/chunk-SVU4VMYX.cjs.map +0 -7
- package/dist/lib/node/chunk-TY543HPV.cjs +0 -214
- package/dist/lib/node/chunk-TY543HPV.cjs.map +0 -7
- package/dist/lib/node/index.cjs +0 -130
- package/dist/lib/node/index.cjs.map +0 -7
- package/dist/lib/node/intent-resolver-G2MFNIXA.cjs +0 -39
- package/dist/lib/node/intent-resolver-G2MFNIXA.cjs.map +0 -7
- package/dist/lib/node/meta.cjs +0 -31
- package/dist/lib/node/meta.cjs.map +0 -7
- package/dist/lib/node/meta.json +0 -1
- package/dist/lib/node/react-surface-UJD5RGRZ.cjs +0 -53
- package/dist/lib/node/react-surface-UJD5RGRZ.cjs.map +0 -7
- package/dist/lib/node/types/index.cjs +0 -32
- package/dist/lib/node/types/index.cjs.map +0 -7
- package/dist/lib/node-esm/ExplorerContainer-MFE7PXF4.mjs +0 -38
- package/dist/lib/node-esm/ExplorerContainer-MFE7PXF4.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-3CMBLK6W.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-AE7VHUJM.mjs +0 -189
- package/dist/lib/node-esm/chunk-AE7VHUJM.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-N6VEANUZ.mjs +0 -39
- package/dist/lib/node-esm/chunk-N6VEANUZ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-VSORIAHH.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-7G6ZKM6E.mjs +0 -25
- package/dist/lib/node-esm/intent-resolver-7G6ZKM6E.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-XBH3WZDL.mjs +0 -32
- package/dist/lib/node-esm/react-surface-XBH3WZDL.mjs.map +0 -7
- 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/capabilities/react-surface.d.ts +0 -4
- package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
- package/dist/types/src/types/schema.d.ts +0 -12
- package/dist/types/src/types/schema.d.ts.map +0 -1
- package/dist/types/src/types/types.d.ts +0 -18
- package/dist/types/src/types/types.d.ts.map +0 -1
- package/src/capabilities/intent-resolver.ts +0 -19
- package/src/capabilities/react-surface.tsx +0 -23
- package/src/types/schema.ts +0 -16
- package/src/types/types.ts +0 -21
package/package.json
CHANGED
|
@@ -1,28 +1,43 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-explorer",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.4-main.1068cf700f",
|
|
4
4
|
"description": "Braneframe data visualization plugin",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/dxos/dxos"
|
|
10
|
+
},
|
|
7
11
|
"license": "MIT",
|
|
8
12
|
"author": "DXOS.org",
|
|
9
13
|
"sideEffects": true,
|
|
10
14
|
"type": "module",
|
|
11
15
|
"exports": {
|
|
12
16
|
".": {
|
|
13
|
-
"types": "./dist/types/src/index.d.ts",
|
|
14
17
|
"browser": "./dist/lib/browser/index.mjs",
|
|
15
|
-
"node": "./dist/lib/node-esm/index.mjs"
|
|
18
|
+
"node": "./dist/lib/node-esm/index.mjs",
|
|
19
|
+
"source": "./src/index.ts",
|
|
20
|
+
"types": "./dist/types/src/index.d.ts"
|
|
21
|
+
},
|
|
22
|
+
"./meta": {
|
|
23
|
+
"browser": "./dist/lib/browser/meta.mjs",
|
|
24
|
+
"node": "./dist/lib/node-esm/meta.mjs",
|
|
25
|
+
"source": "./src/meta.ts",
|
|
26
|
+
"types": "./dist/types/src/meta.d.ts"
|
|
16
27
|
},
|
|
17
28
|
"./types": {
|
|
18
|
-
"types": "./dist/types/src/types/index.d.ts",
|
|
19
29
|
"browser": "./dist/lib/browser/types/index.mjs",
|
|
20
|
-
"node": "./dist/lib/node-esm/types/index.mjs"
|
|
30
|
+
"node": "./dist/lib/node-esm/types/index.mjs",
|
|
31
|
+
"source": "./src/types/index.ts",
|
|
32
|
+
"types": "./dist/types/src/types/index.d.ts"
|
|
21
33
|
}
|
|
22
34
|
},
|
|
23
35
|
"types": "dist/types/src/index.d.ts",
|
|
24
36
|
"typesVersions": {
|
|
25
37
|
"*": {
|
|
38
|
+
"meta": [
|
|
39
|
+
"dist/types/src/meta.d.ts"
|
|
40
|
+
],
|
|
26
41
|
"types": [
|
|
27
42
|
"dist/types/src/types/index.d.ts"
|
|
28
43
|
]
|
|
@@ -34,60 +49,62 @@
|
|
|
34
49
|
],
|
|
35
50
|
"dependencies": {
|
|
36
51
|
"3d-force-graph": "^1.76.1",
|
|
52
|
+
"@effect-atom/atom-react": "^0.5.0",
|
|
37
53
|
"@observablehq/plot": "^0.6.11",
|
|
38
|
-
"@preact-signals/safe-react": "^0.9.0",
|
|
39
|
-
"@preact/signals-core": "^1.9.0",
|
|
40
54
|
"d3": "^7.9.0",
|
|
41
|
-
"effect": "
|
|
55
|
+
"effect": "3.19.16",
|
|
42
56
|
"force-graph": "^1.49.4",
|
|
43
57
|
"lodash.defaultsdeep": "^4.6.1",
|
|
44
58
|
"react-resize-detector": "^11.0.1",
|
|
59
|
+
"three": "^0.178.0",
|
|
45
60
|
"topojson-client": "^3.1.0",
|
|
46
|
-
"@dxos/
|
|
47
|
-
"@dxos/app-
|
|
48
|
-
"@dxos/
|
|
49
|
-
"@dxos/echo
|
|
50
|
-
"@dxos/
|
|
51
|
-
"@dxos/
|
|
52
|
-
"@dxos/
|
|
53
|
-
"@dxos/
|
|
54
|
-
"@dxos/
|
|
55
|
-
"@dxos/
|
|
56
|
-
"@dxos/
|
|
57
|
-
"@dxos/plugin-
|
|
58
|
-
"@dxos/plugin-space": "0.8.
|
|
59
|
-
"@dxos/
|
|
60
|
-
"@dxos/react-
|
|
61
|
-
"@dxos/react-ui-
|
|
62
|
-
"@dxos/
|
|
63
|
-
"@dxos/
|
|
64
|
-
"@dxos/react-ui-
|
|
61
|
+
"@dxos/app-framework": "0.8.4-main.1068cf700f",
|
|
62
|
+
"@dxos/app-toolkit": "0.8.4-main.1068cf700f",
|
|
63
|
+
"@dxos/async": "0.8.4-main.1068cf700f",
|
|
64
|
+
"@dxos/echo": "0.8.4-main.1068cf700f",
|
|
65
|
+
"@dxos/client": "0.8.4-main.1068cf700f",
|
|
66
|
+
"@dxos/echo-query": "0.8.4-main.1068cf700f",
|
|
67
|
+
"@dxos/log": "0.8.4-main.1068cf700f",
|
|
68
|
+
"@dxos/graph": "0.8.4-main.1068cf700f",
|
|
69
|
+
"@dxos/invariant": "0.8.4-main.1068cf700f",
|
|
70
|
+
"@dxos/plugin-client": "0.8.4-main.1068cf700f",
|
|
71
|
+
"@dxos/operation": "0.8.4-main.1068cf700f",
|
|
72
|
+
"@dxos/plugin-search": "0.8.4-main.1068cf700f",
|
|
73
|
+
"@dxos/plugin-space": "0.8.4-main.1068cf700f",
|
|
74
|
+
"@dxos/plugin-graph": "0.8.4-main.1068cf700f",
|
|
75
|
+
"@dxos/react-client": "0.8.4-main.1068cf700f",
|
|
76
|
+
"@dxos/react-ui-attention": "0.8.4-main.1068cf700f",
|
|
77
|
+
"@dxos/react-ui-components": "0.8.4-main.1068cf700f",
|
|
78
|
+
"@dxos/react-ui-mosaic": "0.8.4-main.1068cf700f",
|
|
79
|
+
"@dxos/react-ui-graph": "0.8.4-main.1068cf700f",
|
|
80
|
+
"@dxos/react-ui-stack": "0.8.4-main.1068cf700f",
|
|
81
|
+
"@dxos/schema": "0.8.4-main.1068cf700f",
|
|
82
|
+
"@dxos/types": "0.8.4-main.1068cf700f",
|
|
83
|
+
"@dxos/util": "0.8.4-main.1068cf700f"
|
|
65
84
|
},
|
|
66
85
|
"devDependencies": {
|
|
67
|
-
"@phosphor-icons/react": "^2.1.5",
|
|
68
86
|
"@types/d3": "^7.4.3",
|
|
69
87
|
"@types/d3-hierarchy": "^3.1.6",
|
|
70
88
|
"@types/lodash.defaultsdeep": "^4.6.6",
|
|
71
|
-
"@types/react": "~
|
|
72
|
-
"@types/react-dom": "~
|
|
89
|
+
"@types/react": "~19.2.7",
|
|
90
|
+
"@types/react-dom": "~19.2.3",
|
|
73
91
|
"@types/topojson-client": "^3.1.4",
|
|
74
92
|
"@types/topojson-specification": "^1.0.5",
|
|
75
|
-
"react": "~
|
|
76
|
-
"react-dom": "~
|
|
77
|
-
"vite": "
|
|
78
|
-
"@dxos/
|
|
79
|
-
"@dxos/
|
|
80
|
-
"@dxos/
|
|
81
|
-
"@dxos/storybook-utils": "0.8.
|
|
82
|
-
"@dxos/
|
|
93
|
+
"react": "~19.2.3",
|
|
94
|
+
"react-dom": "~19.2.3",
|
|
95
|
+
"vite": "7.1.9",
|
|
96
|
+
"@dxos/echo-generator": "0.8.4-main.1068cf700f",
|
|
97
|
+
"@dxos/random": "0.8.4-main.1068cf700f",
|
|
98
|
+
"@dxos/react-ui": "0.8.4-main.1068cf700f",
|
|
99
|
+
"@dxos/storybook-utils": "0.8.4-main.1068cf700f",
|
|
100
|
+
"@dxos/ui-theme": "0.8.4-main.1068cf700f"
|
|
83
101
|
},
|
|
84
102
|
"peerDependencies": {
|
|
85
|
-
"
|
|
86
|
-
"
|
|
87
|
-
"react": "~
|
|
88
|
-
"react-
|
|
89
|
-
"@dxos/
|
|
90
|
-
"@dxos/react-ui": "0.8.3"
|
|
103
|
+
"effect": "3.19.16",
|
|
104
|
+
"react": "~19.2.3",
|
|
105
|
+
"react-dom": "~19.2.3",
|
|
106
|
+
"@dxos/react-ui": "0.8.4-main.1068cf700f",
|
|
107
|
+
"@dxos/ui-theme": "0.8.4-main.1068cf700f"
|
|
91
108
|
},
|
|
92
109
|
"publishConfig": {
|
|
93
110
|
"access": "public"
|
package/src/ExplorerPlugin.tsx
CHANGED
|
@@ -2,59 +2,37 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import
|
|
6
|
-
import { ClientCapabilities, ClientEvents } from '@dxos/plugin-client';
|
|
7
|
-
import { SpaceCapabilities } from '@dxos/plugin-space';
|
|
8
|
-
import { defineObjectForm } from '@dxos/plugin-space/types';
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
9
6
|
|
|
10
|
-
import {
|
|
7
|
+
import { Plugin } from '@dxos/app-framework';
|
|
8
|
+
import { AppPlugin } from '@dxos/app-toolkit';
|
|
9
|
+
import { Type } from '@dxos/echo';
|
|
10
|
+
import { type CreateObject } from '@dxos/plugin-space/types';
|
|
11
|
+
import { View } from '@dxos/schema';
|
|
12
|
+
|
|
13
|
+
import { ReactSurface } from './capabilities';
|
|
11
14
|
import { meta } from './meta';
|
|
12
|
-
import translations from './translations';
|
|
13
|
-
import {
|
|
15
|
+
import { translations } from './translations';
|
|
16
|
+
import { ExplorerAction, Graph } from './types';
|
|
14
17
|
|
|
15
|
-
export const ExplorerPlugin = ()
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
id:
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
activate: () =>
|
|
37
|
-
contributes(
|
|
38
|
-
SpaceCapabilities.ObjectForm,
|
|
39
|
-
defineObjectForm({
|
|
40
|
-
objectSchema: ViewType,
|
|
41
|
-
getIntent: () => createIntent(ExplorerAction.Create),
|
|
42
|
-
}),
|
|
43
|
-
),
|
|
44
|
-
}),
|
|
45
|
-
defineModule({
|
|
46
|
-
id: `${meta.id}/module/schema`,
|
|
47
|
-
activatesOn: ClientEvents.SetupSchema,
|
|
48
|
-
activate: () => contributes(ClientCapabilities.Schema, [ViewType]),
|
|
49
|
-
}),
|
|
50
|
-
defineModule({
|
|
51
|
-
id: `${meta.id}/module/react-surface`,
|
|
52
|
-
activatesOn: Events.SetupReactSurface,
|
|
53
|
-
activate: ReactSurface,
|
|
54
|
-
}),
|
|
55
|
-
defineModule({
|
|
56
|
-
id: `${meta.id}/module/intent-resolver`,
|
|
57
|
-
activatesOn: Events.SetupIntentResolver,
|
|
58
|
-
activate: IntentResolver,
|
|
59
|
-
}),
|
|
60
|
-
]);
|
|
18
|
+
export const ExplorerPlugin = Plugin.define(meta).pipe(
|
|
19
|
+
AppPlugin.addMetadataModule({
|
|
20
|
+
metadata: {
|
|
21
|
+
id: Type.getTypename(Graph.Graph),
|
|
22
|
+
metadata: {
|
|
23
|
+
icon: 'ph--graph--regular',
|
|
24
|
+
iconHue: 'green',
|
|
25
|
+
inputSchema: ExplorerAction.GraphProps,
|
|
26
|
+
createObject: ((props, { db }) =>
|
|
27
|
+
Effect.promise(async () => {
|
|
28
|
+
const { view } = await View.makeFromDatabase({ db, typename: props.typename });
|
|
29
|
+
return Graph.make({ name: props.name, view });
|
|
30
|
+
})) satisfies CreateObject,
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
}),
|
|
34
|
+
AppPlugin.addSchemaModule({ schema: [Graph.Graph] }),
|
|
35
|
+
AppPlugin.addSurfaceModule({ activate: ReactSurface }),
|
|
36
|
+
AppPlugin.addTranslationsModule({ translations }),
|
|
37
|
+
Plugin.make,
|
|
38
|
+
);
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
import React from 'react';
|
|
7
|
+
|
|
8
|
+
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
9
|
+
import { Surface } from '@dxos/app-framework/ui';
|
|
10
|
+
import { Obj } from '@dxos/echo';
|
|
11
|
+
import { type View } from '@dxos/schema';
|
|
12
|
+
|
|
13
|
+
import { ExplorerContainer } from '../../components';
|
|
14
|
+
import { meta } from '../../meta';
|
|
15
|
+
import { Graph } from '../../types';
|
|
16
|
+
|
|
17
|
+
export default Capability.makeModule(() =>
|
|
18
|
+
Effect.succeed(
|
|
19
|
+
Capability.contributes(
|
|
20
|
+
Capabilities.ReactSurface,
|
|
21
|
+
Surface.create({
|
|
22
|
+
id: `${meta.id}/article`,
|
|
23
|
+
role: ['article', 'section'],
|
|
24
|
+
filter: (data): data is { subject: View.View } => Obj.instanceOf(Graph.Graph, data.subject),
|
|
25
|
+
component: ({ data, role }) => {
|
|
26
|
+
return <ExplorerContainer role={role} subject={data.subject} />;
|
|
27
|
+
},
|
|
28
|
+
}),
|
|
29
|
+
),
|
|
30
|
+
),
|
|
31
|
+
);
|
|
@@ -2,17 +2,16 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import '@
|
|
6
|
-
|
|
7
|
-
import { type Meta } from '@storybook/react';
|
|
5
|
+
import { type Meta } from '@storybook/react-vite';
|
|
8
6
|
import React from 'react';
|
|
9
7
|
|
|
10
8
|
import { ClientRepeater } from '@dxos/react-client/testing';
|
|
11
|
-
import { withLayout, withTheme } from '@dxos/
|
|
9
|
+
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
12
10
|
|
|
13
|
-
import { Chart } from './Chart';
|
|
14
11
|
import CitiesData from '../../../data/cities.js';
|
|
15
12
|
|
|
13
|
+
import { Chart } from './Chart';
|
|
14
|
+
|
|
16
15
|
// TODO(burdon): Generate data with geo lat/lng.
|
|
17
16
|
// TODO(burdon): How to provide geo service via agent?
|
|
18
17
|
|
|
@@ -32,10 +31,13 @@ const Story = () => {
|
|
|
32
31
|
// TODO(burdon): Change to decorator.
|
|
33
32
|
export const Default = () => <ClientRepeater component={Story} />;
|
|
34
33
|
|
|
35
|
-
const meta
|
|
34
|
+
const meta = {
|
|
36
35
|
title: 'plugins/plugin-explorer/Chart',
|
|
37
36
|
component: Chart,
|
|
38
|
-
decorators: [withTheme, withLayout(
|
|
39
|
-
|
|
37
|
+
decorators: [withTheme(), withLayout()],
|
|
38
|
+
parameters: {
|
|
39
|
+
layout: 'fullscreen',
|
|
40
|
+
},
|
|
41
|
+
} satisfies Meta<typeof Chart>;
|
|
40
42
|
|
|
41
43
|
export default meta;
|
|
@@ -7,7 +7,7 @@ import { type DotOptions } from '@observablehq/plot';
|
|
|
7
7
|
import React, { useEffect } from 'react';
|
|
8
8
|
import { useResizeDetector } from 'react-resize-detector';
|
|
9
9
|
|
|
10
|
-
import { type Accessor,
|
|
10
|
+
import { type Accessor, type Point, createAdapter } from '../plot';
|
|
11
11
|
|
|
12
12
|
const defaultOptions: DotOptions = {
|
|
13
13
|
r: 4,
|
|
@@ -2,34 +2,50 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import React from 'react';
|
|
5
|
+
import React, { useCallback, useMemo, useState } from 'react';
|
|
6
6
|
|
|
7
|
+
import { type SurfaceComponentProps } from '@dxos/app-toolkit/ui';
|
|
8
|
+
import { type Filter } from '@dxos/echo';
|
|
9
|
+
import { QueryBuilder } from '@dxos/echo-query';
|
|
7
10
|
import { useGlobalSearch } from '@dxos/plugin-search';
|
|
8
|
-
import { getSpace } from '@dxos/react-client/echo';
|
|
9
|
-
import {
|
|
11
|
+
import { getSpace, useObject } from '@dxos/react-client/echo';
|
|
12
|
+
import { Layout, Toolbar } from '@dxos/react-ui';
|
|
13
|
+
import { QueryEditor, type QueryEditorProps } from '@dxos/react-ui-components';
|
|
14
|
+
import { type View } from '@dxos/schema';
|
|
10
15
|
|
|
11
|
-
import { D3ForceGraph } from './Graph';
|
|
12
16
|
import { useGraphModel } from '../hooks';
|
|
13
|
-
import { type ViewType } from '../types';
|
|
14
17
|
|
|
15
|
-
|
|
16
|
-
role: string;
|
|
17
|
-
view: ViewType;
|
|
18
|
-
};
|
|
18
|
+
import { D3ForceGraph } from './Graph';
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
export type ExplorerContainerProps = SurfaceComponentProps<View.View>;
|
|
21
|
+
|
|
22
|
+
const ExplorerContainer = ({ role, subject: view }: ExplorerContainerProps) => {
|
|
23
|
+
useObject(view);
|
|
24
|
+
const space = view && getSpace(view);
|
|
25
|
+
const [filter, setFilter] = useState<Filter.Any>();
|
|
26
|
+
const model = useGraphModel(space, filter);
|
|
23
27
|
const { match } = useGlobalSearch();
|
|
24
28
|
|
|
29
|
+
const builder = useMemo(() => new QueryBuilder(), []);
|
|
30
|
+
const handleChange = useCallback<NonNullable<QueryEditorProps['onChange']>>((value) => {
|
|
31
|
+
setFilter(builder.build(value).filter);
|
|
32
|
+
}, []);
|
|
33
|
+
|
|
34
|
+
const showToolbar = role === 'article';
|
|
35
|
+
|
|
25
36
|
if (!space || !model) {
|
|
26
37
|
return null;
|
|
27
38
|
}
|
|
28
39
|
|
|
29
40
|
return (
|
|
30
|
-
<
|
|
41
|
+
<Layout.Main role={role} toolbar={showToolbar}>
|
|
42
|
+
{showToolbar && (
|
|
43
|
+
<Toolbar.Root>
|
|
44
|
+
<QueryEditor db={space.db} onChange={handleChange} />
|
|
45
|
+
</Toolbar.Root>
|
|
46
|
+
)}
|
|
31
47
|
<D3ForceGraph model={model} match={match} />
|
|
32
|
-
</
|
|
48
|
+
</Layout.Main>
|
|
33
49
|
);
|
|
34
50
|
};
|
|
35
51
|
|
|
@@ -2,22 +2,21 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import '@
|
|
6
|
-
|
|
7
|
-
import { plot, sphere, geo, graticule, dot } from '@observablehq/plot';
|
|
8
|
-
import { type Meta } from '@storybook/react';
|
|
5
|
+
import { dot, geo, graticule, plot, sphere } from '@observablehq/plot';
|
|
6
|
+
import { type Meta } from '@storybook/react-vite';
|
|
9
7
|
import { geoCircle } from 'd3';
|
|
10
8
|
import React, { useEffect } from 'react';
|
|
11
9
|
import { useResizeDetector } from 'react-resize-detector';
|
|
12
10
|
import { feature } from 'topojson-client';
|
|
13
11
|
|
|
14
12
|
import { ClientRepeater } from '@dxos/react-client/testing';
|
|
15
|
-
import { withLayout, withTheme } from '@dxos/
|
|
13
|
+
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
16
14
|
|
|
17
|
-
import { Globe } from './Globe';
|
|
18
15
|
import CitiesData from '../../../data/cities.js';
|
|
19
16
|
import CountriesData from '../../../data/countries-110m.js';
|
|
20
17
|
|
|
18
|
+
import { Globe } from './Globe';
|
|
19
|
+
|
|
21
20
|
// TODO(burdon): Generate data with geo lat/lng.
|
|
22
21
|
// TODO(burdon): How to provide geo service via agent?
|
|
23
22
|
|
|
@@ -80,13 +79,16 @@ const ExtendedStory = () => {
|
|
|
80
79
|
return <div ref={containerRef} className='grow p-8' />;
|
|
81
80
|
};
|
|
82
81
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
export const Extended = () => <ClientRepeater component={ExtendedStory} createSpace />;
|
|
86
|
-
|
|
87
|
-
const meta: Meta = {
|
|
82
|
+
const meta = {
|
|
88
83
|
title: 'plugins/plugin-explorer/Globe',
|
|
89
|
-
decorators: [withTheme, withLayout(
|
|
90
|
-
|
|
84
|
+
decorators: [withTheme(), withLayout()],
|
|
85
|
+
parameters: {
|
|
86
|
+
layout: 'fullscreen',
|
|
87
|
+
},
|
|
88
|
+
} satisfies Meta;
|
|
91
89
|
|
|
92
90
|
export default meta;
|
|
91
|
+
|
|
92
|
+
export const Default = () => <ClientRepeater component={DefaultStory} createSpace />;
|
|
93
|
+
|
|
94
|
+
export const Extended = () => <ClientRepeater component={ExtendedStory} createSpace />;
|
|
@@ -9,7 +9,7 @@ import { useResizeDetector } from 'react-resize-detector';
|
|
|
9
9
|
import * as topojson from 'topojson-client';
|
|
10
10
|
|
|
11
11
|
import CountriesData from '../../../data/countries-110m.js';
|
|
12
|
-
import { type Accessor,
|
|
12
|
+
import { type Accessor, type GeoLocation, createAdapter } from '../plot';
|
|
13
13
|
|
|
14
14
|
const defaultOptions: DotOptions = {
|
|
15
15
|
r: 4,
|
|
@@ -2,24 +2,27 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import '@
|
|
5
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
6
|
+
import React, { useState } from 'react';
|
|
6
7
|
|
|
7
|
-
import {
|
|
8
|
-
import React, { useEffect, useState } from 'react';
|
|
9
|
-
|
|
10
|
-
import { Obj } from '@dxos/echo';
|
|
8
|
+
import { Type } from '@dxos/echo';
|
|
11
9
|
import { faker } from '@dxos/random';
|
|
12
10
|
import { useClient } from '@dxos/react-client';
|
|
13
11
|
import { type Space } from '@dxos/react-client/echo';
|
|
14
12
|
import { withClientProvider } from '@dxos/react-client/testing';
|
|
15
|
-
import {
|
|
13
|
+
import { useAsyncEffect } from '@dxos/react-ui';
|
|
14
|
+
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
15
|
+
import { View } from '@dxos/schema';
|
|
16
16
|
import { type ValueGenerator } from '@dxos/schema/testing';
|
|
17
|
-
import {
|
|
17
|
+
import { withRegistry } from '@dxos/storybook-utils';
|
|
18
|
+
import { render } from '@dxos/storybook-utils';
|
|
19
|
+
import { HasRelationship, Organization, Person, Pipeline } from '@dxos/types';
|
|
20
|
+
|
|
21
|
+
import { useGraphModel } from '../../hooks';
|
|
22
|
+
import { Graph } from '../../types';
|
|
18
23
|
|
|
19
24
|
import { D3ForceGraph } from './D3ForceGraph';
|
|
20
25
|
import { generate } from './testing';
|
|
21
|
-
import { useGraphModel } from '../../hooks';
|
|
22
|
-
import { ViewType } from '../../types';
|
|
23
26
|
|
|
24
27
|
const generator = faker as any as ValueGenerator;
|
|
25
28
|
|
|
@@ -28,37 +31,53 @@ faker.seed(1);
|
|
|
28
31
|
const DefaultStory = () => {
|
|
29
32
|
const client = useClient();
|
|
30
33
|
const [space, setSpace] = useState<Space>();
|
|
31
|
-
const [
|
|
32
|
-
|
|
34
|
+
const [graph, setGraph] = useState<Graph.Graph>();
|
|
35
|
+
|
|
36
|
+
useAsyncEffect(async () => {
|
|
33
37
|
const space = client.spaces.default;
|
|
34
38
|
void generate(space, generator);
|
|
35
|
-
const view =
|
|
39
|
+
const { view } = await View.makeFromDatabase({ db: space.db, typename: Type.getTypename(Graph.Graph) });
|
|
40
|
+
const graph = Graph.make({ name: 'Test', view });
|
|
41
|
+
space.db.add(graph);
|
|
36
42
|
setSpace(space);
|
|
37
|
-
|
|
38
|
-
}, []);
|
|
43
|
+
setGraph(graph);
|
|
44
|
+
}, [client]);
|
|
39
45
|
|
|
40
46
|
const model = useGraphModel(space);
|
|
41
|
-
if (!model || !space || !
|
|
47
|
+
if (!model || !space || !graph) {
|
|
42
48
|
return null;
|
|
43
49
|
}
|
|
44
50
|
|
|
45
51
|
return <D3ForceGraph model={model} />;
|
|
46
52
|
};
|
|
47
53
|
|
|
48
|
-
const meta
|
|
54
|
+
const meta = {
|
|
49
55
|
title: 'plugins/plugin-explorer/D3ForceGraph',
|
|
50
56
|
component: D3ForceGraph,
|
|
51
57
|
render: render(DefaultStory),
|
|
52
58
|
decorators: [
|
|
59
|
+
withRegistry,
|
|
60
|
+
withTheme(),
|
|
61
|
+
withLayout(),
|
|
53
62
|
withClientProvider({
|
|
54
63
|
createSpace: true,
|
|
55
|
-
types: [
|
|
64
|
+
types: [
|
|
65
|
+
Graph.Graph,
|
|
66
|
+
View.View,
|
|
67
|
+
Organization.Organization,
|
|
68
|
+
Pipeline.Pipeline,
|
|
69
|
+
Person.Person,
|
|
70
|
+
HasRelationship.HasRelationship,
|
|
71
|
+
],
|
|
56
72
|
}),
|
|
57
|
-
withTheme,
|
|
58
|
-
withLayout({ fullscreen: true }),
|
|
59
73
|
],
|
|
60
|
-
|
|
74
|
+
parameters: {
|
|
75
|
+
layout: 'fullscreen',
|
|
76
|
+
},
|
|
77
|
+
} satisfies Meta<typeof D3ForceGraph>;
|
|
61
78
|
|
|
62
79
|
export default meta;
|
|
63
80
|
|
|
64
|
-
|
|
81
|
+
type Story = StoryObj<typeof meta>;
|
|
82
|
+
|
|
83
|
+
export const Default: Story = {};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import React, {
|
|
5
|
+
import React, { useCallback, useEffect, useMemo, useRef } from 'react';
|
|
6
6
|
|
|
7
7
|
import { Obj } from '@dxos/echo';
|
|
8
8
|
import { SelectionModel } from '@dxos/graph';
|
|
@@ -15,8 +15,8 @@ import {
|
|
|
15
15
|
SVG,
|
|
16
16
|
type SVGContext,
|
|
17
17
|
} from '@dxos/react-ui-graph';
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
18
|
+
import { type SpaceGraphEdge, type SpaceGraphModel, type SpaceGraphNode } from '@dxos/schema';
|
|
19
|
+
import { getHashStyles } from '@dxos/ui-theme';
|
|
20
20
|
|
|
21
21
|
import '@dxos/react-ui-graph/styles/graph.css';
|
|
22
22
|
|
|
@@ -29,7 +29,7 @@ export type D3ForceGraphProps = ThemedClassName<
|
|
|
29
29
|
} & Pick<GraphProps, 'drag'>
|
|
30
30
|
>;
|
|
31
31
|
|
|
32
|
-
export const D3ForceGraph
|
|
32
|
+
export const D3ForceGraph = ({ classNames, model, selection: _selection, grid, ...props }: D3ForceGraphProps) => {
|
|
33
33
|
const context = useRef<SVGContext>(null);
|
|
34
34
|
const projector = useMemo<GraphForceProjector | undefined>(() => {
|
|
35
35
|
if (context.current) {
|
|
@@ -52,7 +52,7 @@ export const D3ForceGraph: FC<D3ForceGraphProps> = ({ classNames, model, selecti
|
|
|
52
52
|
|
|
53
53
|
const graph = useRef<GraphController>(null);
|
|
54
54
|
const selection = useMemo(() => _selection ?? new SelectionModel(), [_selection]);
|
|
55
|
-
useEffect(() => graph.current?.repaint(), [selection
|
|
55
|
+
useEffect(() => selection.subscribe(() => graph.current?.repaint()), [selection]);
|
|
56
56
|
|
|
57
57
|
const handleSelect = useCallback<NonNullable<GraphProps['onSelect']>>(
|
|
58
58
|
(node) => {
|
|
@@ -85,7 +85,7 @@ export const D3ForceGraph: FC<D3ForceGraphProps> = ({ classNames, model, selecti
|
|
|
85
85
|
const obj = node.data?.data.object;
|
|
86
86
|
return {
|
|
87
87
|
data: {
|
|
88
|
-
color:
|
|
88
|
+
color: getHashStyles(obj && Obj.getTypename(obj))?.hue,
|
|
89
89
|
},
|
|
90
90
|
classes: {
|
|
91
91
|
'dx-selected': selection.contains(node.id),
|