@dxos/plugin-explorer 0.8.3 → 0.8.4-main.1da679c
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-DXL34I3F.mjs → ExplorerContainer-7MTDS2TQ.mjs} +4 -4
- package/dist/lib/browser/{ExplorerContainer-DXL34I3F.mjs.map → ExplorerContainer-7MTDS2TQ.mjs.map} +2 -2
- package/dist/lib/browser/{chunk-SLB2F5AO.mjs → chunk-2MKBRIUT.mjs} +7 -6
- package/dist/lib/browser/chunk-2MKBRIUT.mjs.map +7 -0
- package/dist/lib/browser/{chunk-Z5BGAHLD.mjs → chunk-3YITRGGW.mjs} +27 -11
- package/dist/lib/browser/{chunk-Z5BGAHLD.mjs.map → chunk-3YITRGGW.mjs.map} +3 -3
- package/dist/lib/browser/{chunk-73YTQHOT.mjs → chunk-CZZ3DDR7.mjs} +4 -4
- package/dist/lib/browser/{chunk-73YTQHOT.mjs.map → chunk-CZZ3DDR7.mjs.map} +2 -2
- package/dist/lib/browser/{chunk-OBAFAA5V.mjs → chunk-UL5EDJPE.mjs} +2 -2
- package/dist/lib/browser/{chunk-JRKQNHS6.mjs → chunk-VNOGW2JS.mjs} +49 -37
- package/dist/lib/browser/{chunk-JRKQNHS6.mjs.map → chunk-VNOGW2JS.mjs.map} +3 -3
- package/dist/lib/browser/index.mjs +19 -18
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/intent-resolver-RGPYMKAU.mjs +24 -0
- package/dist/lib/browser/{intent-resolver-JZKYVFQJ.mjs.map → intent-resolver-RGPYMKAU.mjs.map} +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/meta.mjs +1 -1
- package/dist/lib/browser/{react-surface-IAEP2GBT.mjs → react-surface-6MSROCJS.mjs} +8 -8
- package/dist/lib/browser/{react-surface-IAEP2GBT.mjs.map → react-surface-6MSROCJS.mjs.map} +1 -1
- package/dist/lib/browser/types/index.mjs +2 -2
- package/dist/lib/node-esm/{ExplorerContainer-MFE7PXF4.mjs → ExplorerContainer-OBSRVHZZ.mjs} +4 -4
- package/dist/lib/node-esm/{ExplorerContainer-MFE7PXF4.mjs.map → ExplorerContainer-OBSRVHZZ.mjs.map} +2 -2
- package/dist/lib/node-esm/{chunk-VSORIAHH.mjs → chunk-3ODK27PU.mjs} +7 -6
- package/dist/lib/node-esm/chunk-3ODK27PU.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-N6VEANUZ.mjs → chunk-4GWDNZ4Z.mjs} +4 -4
- package/dist/lib/node-esm/{chunk-N6VEANUZ.mjs.map → chunk-4GWDNZ4Z.mjs.map} +2 -2
- package/dist/lib/node-esm/{chunk-AE7VHUJM.mjs → chunk-GFYXDQQV.mjs} +27 -11
- package/dist/lib/node-esm/{chunk-AE7VHUJM.mjs.map → chunk-GFYXDQQV.mjs.map} +3 -3
- package/dist/lib/node-esm/{chunk-IUFYOE44.mjs → chunk-ODMJ7DPA.mjs} +49 -37
- package/dist/lib/node-esm/{chunk-IUFYOE44.mjs.map → chunk-ODMJ7DPA.mjs.map} +3 -3
- package/dist/lib/node-esm/{chunk-3CMBLK6W.mjs → chunk-PIAXA43R.mjs} +2 -2
- package/dist/lib/node-esm/index.mjs +19 -18
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/{intent-resolver-7G6ZKM6E.mjs → intent-resolver-LTIB6F2Q.mjs} +7 -7
- package/dist/lib/node-esm/{intent-resolver-7G6ZKM6E.mjs.map → intent-resolver-LTIB6F2Q.mjs.map} +3 -3
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/meta.mjs +1 -1
- package/dist/lib/node-esm/{react-surface-XBH3WZDL.mjs → react-surface-ZEM4IXFU.mjs} +8 -8
- package/dist/lib/node-esm/{react-surface-XBH3WZDL.mjs.map → react-surface-ZEM4IXFU.mjs.map} +1 -1
- package/dist/lib/node-esm/types/index.mjs +2 -2
- package/dist/types/src/capabilities/index.d.ts +2 -2
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts +1 -1
- package/dist/types/src/components/Chart/Chart.d.ts.map +1 -1
- package/dist/types/src/components/Chart/Chart.stories.d.ts +5 -3
- package/dist/types/src/components/Chart/Chart.stories.d.ts.map +1 -1
- 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 +5 -3
- package/dist/types/src/components/Globe/Globe.stories.d.ts.map +1 -1
- package/dist/types/src/components/Graph/D3ForceGraph.stories.d.ts +17 -3
- package/dist/types/src/components/Graph/D3ForceGraph.stories.d.ts.map +1 -1
- package/dist/types/src/components/Graph/ForceGraph.stories.d.ts +10 -3
- package/dist/types/src/components/Graph/ForceGraph.stories.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.stories.d.ts +13 -15
- package/dist/types/src/components/Tree/Tree.stories.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/translations.d.ts +16 -23
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +41 -31
- package/src/ExplorerPlugin.tsx +3 -3
- package/src/capabilities/intent-resolver.ts +1 -1
- package/src/components/Chart/Chart.stories.tsx +5 -4
- package/src/components/Chart/Chart.tsx +1 -1
- package/src/components/ExplorerContainer.tsx +2 -1
- package/src/components/Globe/Globe.stories.tsx +10 -9
- package/src/components/Globe/Globe.tsx +1 -1
- package/src/components/Graph/D3ForceGraph.stories.tsx +10 -7
- package/src/components/Graph/D3ForceGraph.tsx +1 -1
- package/src/components/Graph/ForceGraph.stories.tsx +10 -7
- package/src/components/Graph/ForceGraph.tsx +2 -2
- package/src/components/Graph/testing.ts +2 -2
- package/src/components/Tree/Tree.stories.tsx +27 -19
- package/src/components/Tree/Tree.tsx +1 -1
- package/src/components/Tree/types/tree.test.ts +4 -3
- package/src/hooks/useGraphModel.ts +5 -4
- package/src/translations.ts +8 -6
- package/src/types/types.ts +2 -1
- package/dist/lib/browser/chunk-SLB2F5AO.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-JZKYVFQJ.mjs +0 -24
- 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/chunk-VSORIAHH.mjs.map +0 -7
- /package/dist/lib/browser/{chunk-OBAFAA5V.mjs.map → chunk-UL5EDJPE.mjs.map} +0 -0
- /package/dist/lib/node-esm/{chunk-3CMBLK6W.mjs.map → chunk-PIAXA43R.mjs.map} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-explorer",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.4-main.1da679c",
|
|
4
4
|
"description": "Braneframe data visualization plugin",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -10,11 +10,19 @@
|
|
|
10
10
|
"type": "module",
|
|
11
11
|
"exports": {
|
|
12
12
|
".": {
|
|
13
|
+
"source": "./src/index.ts",
|
|
13
14
|
"types": "./dist/types/src/index.d.ts",
|
|
14
15
|
"browser": "./dist/lib/browser/index.mjs",
|
|
15
16
|
"node": "./dist/lib/node-esm/index.mjs"
|
|
16
17
|
},
|
|
18
|
+
"./meta": {
|
|
19
|
+
"source": "./src/meta.ts",
|
|
20
|
+
"types": "./dist/types/src/meta.d.ts",
|
|
21
|
+
"browser": "./dist/lib/browser/meta.mjs",
|
|
22
|
+
"node": "./dist/lib/node-esm/meta.mjs"
|
|
23
|
+
},
|
|
17
24
|
"./types": {
|
|
25
|
+
"source": "./src/types/index.ts",
|
|
18
26
|
"types": "./dist/types/src/types/index.d.ts",
|
|
19
27
|
"browser": "./dist/lib/browser/types/index.mjs",
|
|
20
28
|
"node": "./dist/lib/node-esm/types/index.mjs"
|
|
@@ -23,6 +31,9 @@
|
|
|
23
31
|
"types": "dist/types/src/index.d.ts",
|
|
24
32
|
"typesVersions": {
|
|
25
33
|
"*": {
|
|
34
|
+
"meta": [
|
|
35
|
+
"dist/types/src/meta.d.ts"
|
|
36
|
+
],
|
|
26
37
|
"types": [
|
|
27
38
|
"dist/types/src/types/index.d.ts"
|
|
28
39
|
]
|
|
@@ -38,33 +49,33 @@
|
|
|
38
49
|
"@preact-signals/safe-react": "^0.9.0",
|
|
39
50
|
"@preact/signals-core": "^1.9.0",
|
|
40
51
|
"d3": "^7.9.0",
|
|
41
|
-
"effect": "
|
|
52
|
+
"effect": "3.17.7",
|
|
42
53
|
"force-graph": "^1.49.4",
|
|
43
54
|
"lodash.defaultsdeep": "^4.6.1",
|
|
44
55
|
"react-resize-detector": "^11.0.1",
|
|
56
|
+
"three": "^0.178.0",
|
|
45
57
|
"topojson-client": "^3.1.0",
|
|
46
|
-
"@dxos/async": "0.8.
|
|
47
|
-
"@dxos/app-framework": "0.8.
|
|
48
|
-
"@dxos/
|
|
49
|
-
"@dxos/
|
|
50
|
-
"@dxos/echo": "0.8.
|
|
51
|
-
"@dxos/graph": "0.8.
|
|
52
|
-
"@dxos/
|
|
53
|
-
"@dxos/
|
|
54
|
-
"@dxos/
|
|
55
|
-
"@dxos/
|
|
56
|
-
"@dxos/plugin-
|
|
57
|
-
"@dxos/plugin-
|
|
58
|
-
"@dxos/plugin-space": "0.8.
|
|
59
|
-
"@dxos/react-client": "0.8.
|
|
60
|
-
"@dxos/react-ui-attention": "0.8.
|
|
61
|
-
"@dxos/react-ui-graph": "0.8.
|
|
62
|
-
"@dxos/schema": "0.8.
|
|
63
|
-
"@dxos/
|
|
64
|
-
"@dxos/
|
|
58
|
+
"@dxos/async": "0.8.4-main.1da679c",
|
|
59
|
+
"@dxos/app-framework": "0.8.4-main.1da679c",
|
|
60
|
+
"@dxos/echo": "0.8.4-main.1da679c",
|
|
61
|
+
"@dxos/client": "0.8.4-main.1da679c",
|
|
62
|
+
"@dxos/echo-schema": "0.8.4-main.1da679c",
|
|
63
|
+
"@dxos/graph": "0.8.4-main.1da679c",
|
|
64
|
+
"@dxos/live-object": "0.8.4-main.1da679c",
|
|
65
|
+
"@dxos/log": "0.8.4-main.1da679c",
|
|
66
|
+
"@dxos/invariant": "0.8.4-main.1da679c",
|
|
67
|
+
"@dxos/plugin-client": "0.8.4-main.1da679c",
|
|
68
|
+
"@dxos/plugin-graph": "0.8.4-main.1da679c",
|
|
69
|
+
"@dxos/plugin-search": "0.8.4-main.1da679c",
|
|
70
|
+
"@dxos/plugin-space": "0.8.4-main.1da679c",
|
|
71
|
+
"@dxos/react-client": "0.8.4-main.1da679c",
|
|
72
|
+
"@dxos/react-ui-attention": "0.8.4-main.1da679c",
|
|
73
|
+
"@dxos/react-ui-graph": "0.8.4-main.1da679c",
|
|
74
|
+
"@dxos/schema": "0.8.4-main.1da679c",
|
|
75
|
+
"@dxos/react-ui-stack": "0.8.4-main.1da679c",
|
|
76
|
+
"@dxos/util": "0.8.4-main.1da679c"
|
|
65
77
|
},
|
|
66
78
|
"devDependencies": {
|
|
67
|
-
"@phosphor-icons/react": "^2.1.5",
|
|
68
79
|
"@types/d3": "^7.4.3",
|
|
69
80
|
"@types/d3-hierarchy": "^3.1.6",
|
|
70
81
|
"@types/lodash.defaultsdeep": "^4.6.6",
|
|
@@ -74,20 +85,19 @@
|
|
|
74
85
|
"@types/topojson-specification": "^1.0.5",
|
|
75
86
|
"react": "~18.2.0",
|
|
76
87
|
"react-dom": "~18.2.0",
|
|
77
|
-
"vite": "
|
|
78
|
-
"@dxos/
|
|
79
|
-
"@dxos/
|
|
80
|
-
"@dxos/
|
|
81
|
-
"@dxos/
|
|
82
|
-
"@dxos/
|
|
88
|
+
"vite": "7.1.1",
|
|
89
|
+
"@dxos/echo-generator": "0.8.4-main.1da679c",
|
|
90
|
+
"@dxos/random": "0.8.4-main.1da679c",
|
|
91
|
+
"@dxos/react-ui": "0.8.4-main.1da679c",
|
|
92
|
+
"@dxos/react-ui-theme": "0.8.4-main.1da679c",
|
|
93
|
+
"@dxos/storybook-utils": "0.8.4-main.1da679c"
|
|
83
94
|
},
|
|
84
95
|
"peerDependencies": {
|
|
85
|
-
"@phosphor-icons/react": "^2.1.5",
|
|
86
96
|
"effect": "^3.13.3",
|
|
87
97
|
"react": "~18.2.0",
|
|
88
98
|
"react-dom": "~18.2.0",
|
|
89
|
-
"@dxos/react-ui
|
|
90
|
-
"@dxos/react-ui": "0.8.
|
|
99
|
+
"@dxos/react-ui": "0.8.4-main.1da679c",
|
|
100
|
+
"@dxos/react-ui-theme": "0.8.4-main.1da679c"
|
|
91
101
|
},
|
|
92
102
|
"publishConfig": {
|
|
93
103
|
"access": "public"
|
package/src/ExplorerPlugin.tsx
CHANGED
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { Capabilities, contributes, createIntent, defineModule, definePlugin
|
|
5
|
+
import { Capabilities, Events, contributes, createIntent, defineModule, definePlugin } from '@dxos/app-framework';
|
|
6
6
|
import { ClientCapabilities, ClientEvents } from '@dxos/plugin-client';
|
|
7
7
|
import { SpaceCapabilities } from '@dxos/plugin-space';
|
|
8
8
|
import { defineObjectForm } from '@dxos/plugin-space/types';
|
|
9
9
|
|
|
10
10
|
import { IntentResolver, ReactSurface } from './capabilities';
|
|
11
11
|
import { meta } from './meta';
|
|
12
|
-
import translations from './translations';
|
|
13
|
-
import {
|
|
12
|
+
import { translations } from './translations';
|
|
13
|
+
import { ExplorerAction, ViewType } from './types';
|
|
14
14
|
|
|
15
15
|
export const ExplorerPlugin = () =>
|
|
16
16
|
definePlugin(meta, [
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { Capabilities, contributes, createResolver } from '@dxos/app-framework';
|
|
6
6
|
import { Obj } from '@dxos/echo';
|
|
7
7
|
|
|
8
8
|
import { ExplorerAction, ViewType } from '../types';
|
|
@@ -4,15 +4,16 @@
|
|
|
4
4
|
|
|
5
5
|
import '@dxos-theme';
|
|
6
6
|
|
|
7
|
-
import { type Meta } from '@storybook/react';
|
|
7
|
+
import { type Meta } from '@storybook/react-vite';
|
|
8
8
|
import React from 'react';
|
|
9
9
|
|
|
10
10
|
import { ClientRepeater } from '@dxos/react-client/testing';
|
|
11
11
|
import { withLayout, withTheme } from '@dxos/storybook-utils';
|
|
12
12
|
|
|
13
|
-
import { Chart } from './Chart';
|
|
14
13
|
import CitiesData from '../../../data/cities.js';
|
|
15
14
|
|
|
15
|
+
import { Chart } from './Chart';
|
|
16
|
+
|
|
16
17
|
// TODO(burdon): Generate data with geo lat/lng.
|
|
17
18
|
// TODO(burdon): How to provide geo service via agent?
|
|
18
19
|
|
|
@@ -32,10 +33,10 @@ const Story = () => {
|
|
|
32
33
|
// TODO(burdon): Change to decorator.
|
|
33
34
|
export const Default = () => <ClientRepeater component={Story} />;
|
|
34
35
|
|
|
35
|
-
const meta
|
|
36
|
+
const meta = {
|
|
36
37
|
title: 'plugins/plugin-explorer/Chart',
|
|
37
38
|
component: Chart,
|
|
38
39
|
decorators: [withTheme, withLayout({ fullscreen: true })],
|
|
39
|
-
}
|
|
40
|
+
} satisfies Meta<typeof Chart>;
|
|
40
41
|
|
|
41
42
|
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,
|
|
@@ -8,10 +8,11 @@ import { useGlobalSearch } from '@dxos/plugin-search';
|
|
|
8
8
|
import { getSpace } from '@dxos/react-client/echo';
|
|
9
9
|
import { StackItem } from '@dxos/react-ui-stack';
|
|
10
10
|
|
|
11
|
-
import { D3ForceGraph } from './Graph';
|
|
12
11
|
import { useGraphModel } from '../hooks';
|
|
13
12
|
import { type ViewType } from '../types';
|
|
14
13
|
|
|
14
|
+
import { D3ForceGraph } from './Graph';
|
|
15
|
+
|
|
15
16
|
type ExplorerContainerProps = {
|
|
16
17
|
role: string;
|
|
17
18
|
view: ViewType;
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
import '@dxos-theme';
|
|
6
6
|
|
|
7
|
-
import {
|
|
8
|
-
import { type Meta } from '@storybook/react';
|
|
7
|
+
import { dot, geo, graticule, plot, sphere } from '@observablehq/plot';
|
|
8
|
+
import { type Meta } from '@storybook/react-vite';
|
|
9
9
|
import { geoCircle } from 'd3';
|
|
10
10
|
import React, { useEffect } from 'react';
|
|
11
11
|
import { useResizeDetector } from 'react-resize-detector';
|
|
@@ -14,10 +14,11 @@ import { feature } from 'topojson-client';
|
|
|
14
14
|
import { ClientRepeater } from '@dxos/react-client/testing';
|
|
15
15
|
import { withLayout, withTheme } from '@dxos/storybook-utils';
|
|
16
16
|
|
|
17
|
-
import { Globe } from './Globe';
|
|
18
17
|
import CitiesData from '../../../data/cities.js';
|
|
19
18
|
import CountriesData from '../../../data/countries-110m.js';
|
|
20
19
|
|
|
20
|
+
import { Globe } from './Globe';
|
|
21
|
+
|
|
21
22
|
// TODO(burdon): Generate data with geo lat/lng.
|
|
22
23
|
// TODO(burdon): How to provide geo service via agent?
|
|
23
24
|
|
|
@@ -80,13 +81,13 @@ const ExtendedStory = () => {
|
|
|
80
81
|
return <div ref={containerRef} className='grow p-8' />;
|
|
81
82
|
};
|
|
82
83
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
export const Extended = () => <ClientRepeater component={ExtendedStory} createSpace />;
|
|
86
|
-
|
|
87
|
-
const meta: Meta = {
|
|
84
|
+
const meta = {
|
|
88
85
|
title: 'plugins/plugin-explorer/Globe',
|
|
89
86
|
decorators: [withTheme, withLayout({ fullscreen: true })],
|
|
90
|
-
};
|
|
87
|
+
} satisfies Meta;
|
|
91
88
|
|
|
92
89
|
export default meta;
|
|
90
|
+
|
|
91
|
+
export const Default = () => <ClientRepeater component={DefaultStory} createSpace />;
|
|
92
|
+
|
|
93
|
+
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,
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import '@dxos-theme';
|
|
6
6
|
|
|
7
|
-
import { type Meta } from '@storybook/react';
|
|
7
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
8
8
|
import React, { useEffect, useState } from 'react';
|
|
9
9
|
|
|
10
10
|
import { Obj } from '@dxos/echo';
|
|
@@ -14,13 +14,14 @@ import { type Space } from '@dxos/react-client/echo';
|
|
|
14
14
|
import { withClientProvider } from '@dxos/react-client/testing';
|
|
15
15
|
import { DataType } from '@dxos/schema';
|
|
16
16
|
import { type ValueGenerator } from '@dxos/schema/testing';
|
|
17
|
-
import { withLayout, withTheme
|
|
17
|
+
import { render, withLayout, withTheme } from '@dxos/storybook-utils';
|
|
18
18
|
|
|
19
|
-
import { D3ForceGraph } from './D3ForceGraph';
|
|
20
|
-
import { generate } from './testing';
|
|
21
19
|
import { useGraphModel } from '../../hooks';
|
|
22
20
|
import { ViewType } from '../../types';
|
|
23
21
|
|
|
22
|
+
import { D3ForceGraph } from './D3ForceGraph';
|
|
23
|
+
import { generate } from './testing';
|
|
24
|
+
|
|
24
25
|
const generator = faker as any as ValueGenerator;
|
|
25
26
|
|
|
26
27
|
faker.seed(1);
|
|
@@ -45,7 +46,7 @@ const DefaultStory = () => {
|
|
|
45
46
|
return <D3ForceGraph model={model} />;
|
|
46
47
|
};
|
|
47
48
|
|
|
48
|
-
const meta
|
|
49
|
+
const meta = {
|
|
49
50
|
title: 'plugins/plugin-explorer/D3ForceGraph',
|
|
50
51
|
component: D3ForceGraph,
|
|
51
52
|
render: render(DefaultStory),
|
|
@@ -57,8 +58,10 @@ const meta: Meta = {
|
|
|
57
58
|
withTheme,
|
|
58
59
|
withLayout({ fullscreen: true }),
|
|
59
60
|
],
|
|
60
|
-
}
|
|
61
|
+
} satisfies Meta<typeof D3ForceGraph>;
|
|
61
62
|
|
|
62
63
|
export default meta;
|
|
63
64
|
|
|
64
|
-
|
|
65
|
+
type Story = StoryObj<typeof meta>;
|
|
66
|
+
|
|
67
|
+
export const Default: Story = {};
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
type SVGContext,
|
|
17
17
|
} from '@dxos/react-ui-graph';
|
|
18
18
|
import { getHashColor } from '@dxos/react-ui-theme';
|
|
19
|
-
import { type
|
|
19
|
+
import { type SpaceGraphEdge, type SpaceGraphModel, type SpaceGraphNode } from '@dxos/schema';
|
|
20
20
|
|
|
21
21
|
import '@dxos/react-ui-graph/styles/graph.css';
|
|
22
22
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import '@dxos-theme';
|
|
6
6
|
|
|
7
|
-
import { type Meta } from '@storybook/react';
|
|
7
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
8
8
|
import React, { useEffect, useState } from 'react';
|
|
9
9
|
|
|
10
10
|
import { Obj } from '@dxos/echo';
|
|
@@ -14,13 +14,14 @@ import { type Space } from '@dxos/react-client/echo';
|
|
|
14
14
|
import { withClientProvider } from '@dxos/react-client/testing';
|
|
15
15
|
import { DataType } from '@dxos/schema';
|
|
16
16
|
import { type ValueGenerator } from '@dxos/schema/testing';
|
|
17
|
-
import { withLayout, withTheme
|
|
17
|
+
import { render, withLayout, withTheme } from '@dxos/storybook-utils';
|
|
18
18
|
|
|
19
|
-
import { ForceGraph } from './ForceGraph';
|
|
20
|
-
import { generate } from './testing';
|
|
21
19
|
import { useGraphModel } from '../../hooks';
|
|
22
20
|
import { ViewType } from '../../types';
|
|
23
21
|
|
|
22
|
+
import { ForceGraph } from './ForceGraph';
|
|
23
|
+
import { generate } from './testing';
|
|
24
|
+
|
|
24
25
|
const generator = faker as any as ValueGenerator;
|
|
25
26
|
|
|
26
27
|
faker.seed(1);
|
|
@@ -45,7 +46,7 @@ const DefaultStory = () => {
|
|
|
45
46
|
return <ForceGraph model={model} />;
|
|
46
47
|
};
|
|
47
48
|
|
|
48
|
-
const meta
|
|
49
|
+
const meta = {
|
|
49
50
|
title: 'plugins/plugin-explorer/ForceGraph',
|
|
50
51
|
component: ForceGraph,
|
|
51
52
|
render: render(DefaultStory),
|
|
@@ -57,8 +58,10 @@ const meta: Meta = {
|
|
|
57
58
|
withTheme,
|
|
58
59
|
withLayout({ fullscreen: true }),
|
|
59
60
|
],
|
|
60
|
-
}
|
|
61
|
+
} satisfies Meta<typeof ForceGraph>;
|
|
61
62
|
|
|
62
63
|
export default meta;
|
|
63
64
|
|
|
64
|
-
|
|
65
|
+
type Story = StoryObj<typeof meta>;
|
|
66
|
+
|
|
67
|
+
export const Default: Story = {};
|
|
@@ -7,7 +7,7 @@ import NativeForceGraph from 'force-graph';
|
|
|
7
7
|
import React, { type FC, useEffect, useRef, useState } from 'react';
|
|
8
8
|
import { useResizeDetector } from 'react-resize-detector';
|
|
9
9
|
|
|
10
|
-
import {
|
|
10
|
+
import { type SearchResult, filterObjectsSync } from '@dxos/plugin-search';
|
|
11
11
|
import { type SpaceGraphModel } from '@dxos/schema';
|
|
12
12
|
|
|
13
13
|
import { GraphAdapter } from './adapter';
|
|
@@ -39,7 +39,7 @@ export const ForceGraph: FC<ForceGraphProps> = ({ model, match }) => {
|
|
|
39
39
|
forceGraph.current = new NativeForceGraph(rootRef.current)
|
|
40
40
|
// https://github.com/vasturiano/force-graph?tab=readme-ov-file#node-styling
|
|
41
41
|
.nodeRelSize(6)
|
|
42
|
-
.nodeLabel((node: any) => (node.type === 'schema' ? node.data.typename : node.data.label ?? node.id))
|
|
42
|
+
.nodeLabel((node: any) => (node.type === 'schema' ? node.data.typename : (node.data.label ?? node.id)))
|
|
43
43
|
.nodeAutoColorBy((node: any) => (node.type === 'schema' ? 'schema' : node.data.typename))
|
|
44
44
|
|
|
45
45
|
// https://github.com/vasturiano/force-graph?tab=readme-ov-file#link-styling
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { type Space } from '@dxos/client/echo';
|
|
6
|
-
import { Query, Relation
|
|
6
|
+
import { type Obj, Query, Relation } from '@dxos/echo';
|
|
7
7
|
import { DataType } from '@dxos/schema';
|
|
8
|
-
import {
|
|
8
|
+
import { type TypeSpec, type ValueGenerator, createObjectFactory } from '@dxos/schema/testing';
|
|
9
9
|
import { range } from '@dxos/util';
|
|
10
10
|
|
|
11
11
|
const getObject = (objects: Obj.Any[]) => objects[Math.floor(Math.random() * objects.length)];
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
import '@dxos-theme';
|
|
6
6
|
|
|
7
|
-
import { type Meta } from '@storybook/react';
|
|
8
|
-
import React, {
|
|
7
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
8
|
+
import React, { useEffect, useState } from 'react';
|
|
9
9
|
|
|
10
10
|
import { faker } from '@dxos/random';
|
|
11
11
|
import { useClient } from '@dxos/react-client';
|
|
@@ -13,14 +13,16 @@ import { type ClientRepeatedComponentProps, ClientRepeater } from '@dxos/react-c
|
|
|
13
13
|
import { withLayout, withTheme } from '@dxos/storybook-utils';
|
|
14
14
|
|
|
15
15
|
import { Tree, type TreeComponentProps } from './Tree';
|
|
16
|
-
import {
|
|
16
|
+
import { Tree as TreeModel, TreeType } from './types';
|
|
17
17
|
|
|
18
18
|
// TODO(burdon): Storybook for Graph/Tree/Plot (generics); incl. GraphModel.
|
|
19
19
|
// TODO(burdon): Type for all Explorer components (Space, Object, Query, etc.) incl.
|
|
20
20
|
|
|
21
21
|
faker.seed(1);
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
type ComponentProps = ClientRepeatedComponentProps & { type?: TreeComponentProps<any>['variant'] };
|
|
24
|
+
|
|
25
|
+
const Component = ({ type }: ComponentProps) => {
|
|
24
26
|
const client = useClient();
|
|
25
27
|
const space = client.spaces.default;
|
|
26
28
|
const [object, setObject] = useState<TreeType>();
|
|
@@ -38,32 +40,38 @@ const Story: FC<ClientRepeatedComponentProps & { type?: TreeComponentProps<any>[
|
|
|
38
40
|
return <Tree space={space} selected={object?.id} variant={type} />;
|
|
39
41
|
};
|
|
40
42
|
|
|
41
|
-
|
|
43
|
+
const DefaultStory = () => {
|
|
44
|
+
return <ClientRepeater component={Component} types={[TreeType]} createSpace />;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
const meta = {
|
|
48
|
+
title: 'plugins/plugin-explorer/Tree',
|
|
49
|
+
component: Tree as any,
|
|
50
|
+
render: DefaultStory,
|
|
51
|
+
decorators: [withTheme, withLayout({ fullscreen: true })],
|
|
52
|
+
parameters: {
|
|
53
|
+
layout: 'fullscreen',
|
|
54
|
+
},
|
|
55
|
+
} satisfies Meta<typeof DefaultStory>;
|
|
56
|
+
|
|
57
|
+
export default meta;
|
|
58
|
+
|
|
59
|
+
type Story = StoryObj<typeof meta>;
|
|
60
|
+
|
|
61
|
+
export const Tidy: Story = {
|
|
42
62
|
args: {
|
|
43
63
|
type: 'tidy',
|
|
44
64
|
},
|
|
45
65
|
};
|
|
46
66
|
|
|
47
|
-
export const Radial = {
|
|
67
|
+
export const Radial: Story = {
|
|
48
68
|
args: {
|
|
49
69
|
type: 'radial',
|
|
50
70
|
},
|
|
51
71
|
};
|
|
52
72
|
|
|
53
|
-
export const Edge = {
|
|
73
|
+
export const Edge: Story = {
|
|
54
74
|
args: {
|
|
55
75
|
type: 'edge',
|
|
56
76
|
},
|
|
57
77
|
};
|
|
58
|
-
|
|
59
|
-
const meta: Meta = {
|
|
60
|
-
title: 'plugins/plugin-explorer/Tree',
|
|
61
|
-
component: Tree,
|
|
62
|
-
render: () => <ClientRepeater component={Story} types={[TreeType]} createSpace />,
|
|
63
|
-
decorators: [withTheme, withLayout({ fullscreen: true })],
|
|
64
|
-
parameters: {
|
|
65
|
-
layout: 'fullscreen',
|
|
66
|
-
},
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
export default meta;
|
|
@@ -10,7 +10,7 @@ import { SVG, type SVGContext } from '@dxos/react-ui-graph';
|
|
|
10
10
|
import { SpaceGraphModel } from '@dxos/schema';
|
|
11
11
|
|
|
12
12
|
import { HierarchicalEdgeBundling, RadialTree, TidyTree } from './layout';
|
|
13
|
-
import {
|
|
13
|
+
import { type TreeNode, mapGraphToTreeData } from './types';
|
|
14
14
|
|
|
15
15
|
// TODO(burdon): Create dge bundling graph using d3.hierarchy.
|
|
16
16
|
// https://observablehq.com/@d3/hierarchical-edge-bundling?intent=fork
|
|
@@ -8,9 +8,10 @@ import { Obj, Ref } from '@dxos/echo';
|
|
|
8
8
|
import { faker } from '@dxos/random';
|
|
9
9
|
import { DataType } from '@dxos/schema';
|
|
10
10
|
|
|
11
|
-
import { type Tree } from './tree';
|
|
12
11
|
import { createTree } from '../testing';
|
|
13
12
|
|
|
13
|
+
import { type Tree } from './tree';
|
|
14
|
+
|
|
14
15
|
faker.seed(0);
|
|
15
16
|
|
|
16
17
|
const print = (tree: Tree) => {
|
|
@@ -123,8 +124,8 @@ describe('tree', () => {
|
|
|
123
124
|
});
|
|
124
125
|
|
|
125
126
|
test('task', ({ expect }) => {
|
|
126
|
-
const task = Obj.make(DataType.Task, {
|
|
127
|
-
expect(task.
|
|
127
|
+
const task = Obj.make(DataType.Task, { title: 'Test task.' });
|
|
128
|
+
expect(task.title).to.eq('Test task.');
|
|
128
129
|
|
|
129
130
|
const tree = createTree();
|
|
130
131
|
const node = tree.addNode(tree.root);
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { useEffect, useState } from 'react';
|
|
6
6
|
|
|
7
|
-
import { type Filter, type Space } from '@dxos/client/echo';
|
|
7
|
+
import { type Filter, type Queue, type Space } from '@dxos/client/echo';
|
|
8
8
|
import { SpaceGraphModel, type SpaceGraphModelOptions } from '@dxos/schema';
|
|
9
9
|
|
|
10
10
|
// TODO(burdon): Factor out.
|
|
@@ -12,6 +12,7 @@ export const useGraphModel = (
|
|
|
12
12
|
space: Space | undefined,
|
|
13
13
|
filter?: Filter.Any | undefined,
|
|
14
14
|
options?: SpaceGraphModelOptions,
|
|
15
|
+
queue?: Queue,
|
|
15
16
|
): SpaceGraphModel | undefined => {
|
|
16
17
|
const [model, setModel] = useState<SpaceGraphModel | undefined>(undefined);
|
|
17
18
|
useEffect(() => {
|
|
@@ -22,14 +23,14 @@ export const useGraphModel = (
|
|
|
22
23
|
}
|
|
23
24
|
|
|
24
25
|
// TODO(burdon): Does this need to be a dependency?
|
|
25
|
-
if (!model) {
|
|
26
|
+
if (!model || model.queue !== queue) {
|
|
26
27
|
const model = new SpaceGraphModel().setFilter(filter).setOptions(options);
|
|
27
|
-
void model.open(space);
|
|
28
|
+
void model.open(space, queue);
|
|
28
29
|
setModel(model);
|
|
29
30
|
} else {
|
|
30
31
|
model.setFilter(filter).setOptions(options);
|
|
31
32
|
}
|
|
32
|
-
}, [space, filter, options]);
|
|
33
|
+
}, [space, filter, options, queue]);
|
|
33
34
|
|
|
34
35
|
return model;
|
|
35
36
|
};
|
package/src/translations.ts
CHANGED
|
@@ -2,25 +2,27 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { type Resource } from '@dxos/react-ui';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { meta } from './meta';
|
|
8
8
|
import { ViewType } from './types';
|
|
9
9
|
|
|
10
|
-
export
|
|
10
|
+
export const translations = [
|
|
11
11
|
{
|
|
12
12
|
'en-US': {
|
|
13
|
-
[
|
|
13
|
+
[ViewType.typename]: {
|
|
14
14
|
'typename label': 'Explorer',
|
|
15
15
|
'typename label_zero': 'Explorers',
|
|
16
16
|
'typename label_one': 'Explorer',
|
|
17
17
|
'typename label_other': 'Explorers',
|
|
18
18
|
'object name placeholder': 'New explorer',
|
|
19
|
+
'rename object label': 'Rename explorer',
|
|
20
|
+
'delete object label': 'Delete explorer',
|
|
19
21
|
},
|
|
20
|
-
[
|
|
22
|
+
[meta.id]: {
|
|
21
23
|
'plugin name': 'Explorer',
|
|
22
24
|
'object title label': 'Title',
|
|
23
25
|
},
|
|
24
26
|
},
|
|
25
27
|
},
|
|
26
|
-
];
|
|
28
|
+
] as const satisfies Resource[];
|
package/src/types/types.ts
CHANGED
|
@@ -4,9 +4,10 @@
|
|
|
4
4
|
|
|
5
5
|
import { Schema } from 'effect';
|
|
6
6
|
|
|
7
|
-
import { ViewType } from './schema';
|
|
8
7
|
import { EXPLORER_PLUGIN } from '../meta';
|
|
9
8
|
|
|
9
|
+
import { ViewType } from './schema';
|
|
10
|
+
|
|
10
11
|
export namespace ExplorerAction {
|
|
11
12
|
const EXPLORER_ACTION = `${EXPLORER_PLUGIN}/action`;
|
|
12
13
|
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/hooks/useGraphModel.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { useEffect, useState } from 'react';\n\nimport { type Filter, type Space } from '@dxos/client/echo';\nimport { SpaceGraphModel, type SpaceGraphModelOptions } from '@dxos/schema';\n\n// TODO(burdon): Factor out.\nexport const useGraphModel = (\n space: Space | undefined,\n filter?: Filter.Any | undefined,\n options?: SpaceGraphModelOptions,\n): SpaceGraphModel | undefined => {\n const [model, setModel] = useState<SpaceGraphModel | undefined>(undefined);\n useEffect(() => {\n if (!space) {\n void model?.close();\n setModel(undefined);\n return;\n }\n\n // TODO(burdon): Does this need to be a dependency?\n if (!model) {\n const model = new SpaceGraphModel().setFilter(filter).setOptions(options);\n void model.open(space);\n setModel(model);\n } else {\n model.setFilter(filter).setOptions(options);\n }\n }, [space, filter, options]);\n\n return model;\n};\n"],
|
|
5
|
-
"mappings": ";AAIA,SAASA,WAAWC,gBAAgB;AAGpC,SAASC,uBAAoD;AAGtD,IAAMC,gBAAgB,CAC3BC,OACAC,QACAC,YAAAA;AAEA,QAAM,CAACC,OAAOC,QAAAA,IAAYC,SAAsCC,MAAAA;AAChEC,YAAU,MAAA;AACR,QAAI,CAACP,OAAO;AACV,WAAKG,OAAOK,MAAAA;AACZJ,eAASE,MAAAA;AACT;IACF;AAGA,QAAI,CAACH,OAAO;AACV,YAAMA,SAAQ,IAAIM,gBAAAA,EAAkBC,UAAUT,MAAAA,EAAQU,WAAWT,OAAAA;AACjE,WAAKC,OAAMS,KAAKZ,KAAAA;AAChBI,eAASD,MAAAA;IACX,OAAO;AACLA,YAAMO,UAAUT,MAAAA,EAAQU,WAAWT,OAAAA;IACrC;EACF,GAAG;IAACF;IAAOC;IAAQC;GAAQ;AAE3B,SAAOC;AACT;",
|
|
6
|
-
"names": ["useEffect", "useState", "SpaceGraphModel", "useGraphModel", "space", "filter", "options", "model", "setModel", "useState", "undefined", "useEffect", "close", "SpaceGraphModel", "setFilter", "setOptions", "open"]
|
|
7
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ExplorerAction,
|
|
3
|
-
ViewType
|
|
4
|
-
} from "./chunk-73YTQHOT.mjs";
|
|
5
|
-
import "./chunk-OBAFAA5V.mjs";
|
|
6
|
-
|
|
7
|
-
// packages/plugins/plugin-explorer/src/capabilities/intent-resolver.ts
|
|
8
|
-
import { contributes, Capabilities, createResolver } from "@dxos/app-framework";
|
|
9
|
-
import { Obj } from "@dxos/echo";
|
|
10
|
-
var intent_resolver_default = () => contributes(Capabilities.IntentResolver, createResolver({
|
|
11
|
-
intent: ExplorerAction.Create,
|
|
12
|
-
resolve: ({ name }) => ({
|
|
13
|
-
data: {
|
|
14
|
-
object: Obj.make(ViewType, {
|
|
15
|
-
name,
|
|
16
|
-
type: ""
|
|
17
|
-
})
|
|
18
|
-
}
|
|
19
|
-
})
|
|
20
|
-
}));
|
|
21
|
-
export {
|
|
22
|
-
intent_resolver_default as default
|
|
23
|
-
};
|
|
24
|
-
//# sourceMappingURL=intent-resolver-JZKYVFQJ.mjs.map
|