@dxos/plugin-explorer 0.8.3 → 0.8.4-main.2e9d522
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-OGHSHZD5.mjs} +4 -4
- package/dist/lib/browser/{chunk-73YTQHOT.mjs → chunk-EF4BFHTI.mjs} +4 -4
- package/dist/lib/browser/{chunk-Z5BGAHLD.mjs → chunk-J2BBZOSF.mjs} +5 -5
- package/dist/lib/browser/{chunk-Z5BGAHLD.mjs.map → chunk-J2BBZOSF.mjs.map} +2 -2
- package/dist/lib/browser/{chunk-SLB2F5AO.mjs → chunk-OAOY7SHY.mjs} +2 -2
- package/dist/lib/browser/{chunk-JRKQNHS6.mjs → chunk-PVFZFKQ6.mjs} +17 -17
- package/dist/lib/browser/{chunk-OBAFAA5V.mjs → chunk-UL5EDJPE.mjs} +2 -2
- package/dist/lib/browser/index.mjs +18 -17
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-resolver-JZKYVFQJ.mjs → intent-resolver-XH2UO2FM.mjs} +4 -4
- 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-65VQ42HX.mjs} +6 -6
- package/dist/lib/browser/types/index.mjs +2 -2
- package/dist/lib/node-esm/{ExplorerContainer-MFE7PXF4.mjs → ExplorerContainer-6ON5NA2P.mjs} +4 -4
- package/dist/lib/node-esm/{chunk-AE7VHUJM.mjs → chunk-4VMSNXYL.mjs} +5 -5
- package/dist/lib/node-esm/{chunk-AE7VHUJM.mjs.map → chunk-4VMSNXYL.mjs.map} +2 -2
- package/dist/lib/node-esm/{chunk-3CMBLK6W.mjs → chunk-PIAXA43R.mjs} +2 -2
- package/dist/lib/node-esm/{chunk-VSORIAHH.mjs → chunk-PPBUWC7F.mjs} +2 -2
- package/dist/lib/node-esm/{chunk-IUFYOE44.mjs → chunk-S5A2EUSJ.mjs} +17 -17
- package/dist/lib/node-esm/{chunk-N6VEANUZ.mjs → chunk-VKCOKQRG.mjs} +4 -4
- package/dist/lib/node-esm/index.mjs +18 -17
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/{intent-resolver-7G6ZKM6E.mjs → intent-resolver-AGBBNA67.mjs} +4 -4
- 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-IJIMYAST.mjs} +6 -6
- package/dist/lib/node-esm/types/index.mjs +2 -2
- package/dist/types/src/components/Chart/Chart.stories.d.ts +1 -1
- package/dist/types/src/components/Chart/Chart.stories.d.ts.map +1 -1
- package/dist/types/src/components/Globe/Globe.stories.d.ts +1 -1
- package/dist/types/src/components/Globe/Globe.stories.d.ts.map +1 -1
- package/dist/types/src/components/Graph/D3ForceGraph.stories.d.ts +1 -1
- package/dist/types/src/components/Graph/D3ForceGraph.stories.d.ts.map +1 -1
- package/dist/types/src/components/Graph/ForceGraph.stories.d.ts +1 -1
- package/dist/types/src/components/Graph/ForceGraph.stories.d.ts.map +1 -1
- package/dist/types/src/components/Tree/Tree.stories.d.ts +1 -1
- package/dist/types/src/components/Tree/Tree.stories.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/tsconfig.tsbuildinfo +1 -1
- package/package.json +37 -30
- package/src/ExplorerPlugin.tsx +1 -1
- package/src/components/Chart/Chart.stories.tsx +1 -1
- package/src/components/Globe/Globe.stories.tsx +1 -1
- package/src/components/Graph/D3ForceGraph.stories.tsx +1 -1
- package/src/components/Graph/ForceGraph.stories.tsx +1 -1
- package/src/components/Graph/ForceGraph.tsx +1 -1
- package/src/components/Tree/Tree.stories.tsx +1 -1
- package/src/components/Tree/types/tree.test.ts +2 -2
- package/src/translations.ts +8 -6
- 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/browser/{ExplorerContainer-DXL34I3F.mjs.map → ExplorerContainer-OGHSHZD5.mjs.map} +0 -0
- /package/dist/lib/browser/{chunk-73YTQHOT.mjs.map → chunk-EF4BFHTI.mjs.map} +0 -0
- /package/dist/lib/browser/{chunk-SLB2F5AO.mjs.map → chunk-OAOY7SHY.mjs.map} +0 -0
- /package/dist/lib/browser/{chunk-JRKQNHS6.mjs.map → chunk-PVFZFKQ6.mjs.map} +0 -0
- /package/dist/lib/browser/{chunk-OBAFAA5V.mjs.map → chunk-UL5EDJPE.mjs.map} +0 -0
- /package/dist/lib/browser/{intent-resolver-JZKYVFQJ.mjs.map → intent-resolver-XH2UO2FM.mjs.map} +0 -0
- /package/dist/lib/browser/{react-surface-IAEP2GBT.mjs.map → react-surface-65VQ42HX.mjs.map} +0 -0
- /package/dist/lib/node-esm/{ExplorerContainer-MFE7PXF4.mjs.map → ExplorerContainer-6ON5NA2P.mjs.map} +0 -0
- /package/dist/lib/node-esm/{chunk-3CMBLK6W.mjs.map → chunk-PIAXA43R.mjs.map} +0 -0
- /package/dist/lib/node-esm/{chunk-VSORIAHH.mjs.map → chunk-PPBUWC7F.mjs.map} +0 -0
- /package/dist/lib/node-esm/{chunk-IUFYOE44.mjs.map → chunk-S5A2EUSJ.mjs.map} +0 -0
- /package/dist/lib/node-esm/{chunk-N6VEANUZ.mjs.map → chunk-VKCOKQRG.mjs.map} +0 -0
- /package/dist/lib/node-esm/{intent-resolver-7G6ZKM6E.mjs.map → intent-resolver-AGBBNA67.mjs.map} +0 -0
- /package/dist/lib/node-esm/{react-surface-XBH3WZDL.mjs.map → react-surface-IJIMYAST.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.2e9d522",
|
|
4
4
|
"description": "Braneframe data visualization plugin",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -14,6 +14,11 @@
|
|
|
14
14
|
"browser": "./dist/lib/browser/index.mjs",
|
|
15
15
|
"node": "./dist/lib/node-esm/index.mjs"
|
|
16
16
|
},
|
|
17
|
+
"./meta": {
|
|
18
|
+
"types": "./dist/types/src/meta.d.ts",
|
|
19
|
+
"browser": "./dist/lib/browser/meta.mjs",
|
|
20
|
+
"node": "./dist/lib/node-esm/meta.mjs"
|
|
21
|
+
},
|
|
17
22
|
"./types": {
|
|
18
23
|
"types": "./dist/types/src/types/index.d.ts",
|
|
19
24
|
"browser": "./dist/lib/browser/types/index.mjs",
|
|
@@ -23,6 +28,9 @@
|
|
|
23
28
|
"types": "dist/types/src/index.d.ts",
|
|
24
29
|
"typesVersions": {
|
|
25
30
|
"*": {
|
|
31
|
+
"meta": [
|
|
32
|
+
"dist/types/src/meta.d.ts"
|
|
33
|
+
],
|
|
26
34
|
"types": [
|
|
27
35
|
"dist/types/src/types/index.d.ts"
|
|
28
36
|
]
|
|
@@ -38,33 +46,33 @@
|
|
|
38
46
|
"@preact-signals/safe-react": "^0.9.0",
|
|
39
47
|
"@preact/signals-core": "^1.9.0",
|
|
40
48
|
"d3": "^7.9.0",
|
|
41
|
-
"effect": "
|
|
49
|
+
"effect": "3.17.0",
|
|
42
50
|
"force-graph": "^1.49.4",
|
|
43
51
|
"lodash.defaultsdeep": "^4.6.1",
|
|
44
52
|
"react-resize-detector": "^11.0.1",
|
|
53
|
+
"three": "^0.178.0",
|
|
45
54
|
"topojson-client": "^3.1.0",
|
|
46
|
-
"@dxos/
|
|
47
|
-
"@dxos/
|
|
48
|
-
"@dxos/
|
|
49
|
-
"@dxos/echo
|
|
50
|
-
"@dxos/echo": "0.8.
|
|
51
|
-
"@dxos/graph": "0.8.
|
|
52
|
-
"@dxos/invariant": "0.8.
|
|
53
|
-
"@dxos/live-object": "0.8.
|
|
54
|
-
"@dxos/
|
|
55
|
-
"@dxos/
|
|
56
|
-
"@dxos/plugin-search": "0.8.
|
|
57
|
-
"@dxos/plugin-
|
|
58
|
-
"@dxos/plugin-space": "0.8.
|
|
59
|
-
"@dxos/react-client": "0.8.
|
|
60
|
-
"@dxos/react-ui-
|
|
61
|
-
"@dxos/react-ui-graph": "0.8.
|
|
62
|
-
"@dxos/schema": "0.8.
|
|
63
|
-
"@dxos/
|
|
64
|
-
"@dxos/
|
|
55
|
+
"@dxos/app-framework": "0.8.4-main.2e9d522",
|
|
56
|
+
"@dxos/client": "0.8.4-main.2e9d522",
|
|
57
|
+
"@dxos/async": "0.8.4-main.2e9d522",
|
|
58
|
+
"@dxos/echo": "0.8.4-main.2e9d522",
|
|
59
|
+
"@dxos/echo-schema": "0.8.4-main.2e9d522",
|
|
60
|
+
"@dxos/graph": "0.8.4-main.2e9d522",
|
|
61
|
+
"@dxos/invariant": "0.8.4-main.2e9d522",
|
|
62
|
+
"@dxos/live-object": "0.8.4-main.2e9d522",
|
|
63
|
+
"@dxos/log": "0.8.4-main.2e9d522",
|
|
64
|
+
"@dxos/plugin-graph": "0.8.4-main.2e9d522",
|
|
65
|
+
"@dxos/plugin-search": "0.8.4-main.2e9d522",
|
|
66
|
+
"@dxos/plugin-client": "0.8.4-main.2e9d522",
|
|
67
|
+
"@dxos/plugin-space": "0.8.4-main.2e9d522",
|
|
68
|
+
"@dxos/react-client": "0.8.4-main.2e9d522",
|
|
69
|
+
"@dxos/react-ui-stack": "0.8.4-main.2e9d522",
|
|
70
|
+
"@dxos/react-ui-graph": "0.8.4-main.2e9d522",
|
|
71
|
+
"@dxos/schema": "0.8.4-main.2e9d522",
|
|
72
|
+
"@dxos/react-ui-attention": "0.8.4-main.2e9d522",
|
|
73
|
+
"@dxos/util": "0.8.4-main.2e9d522"
|
|
65
74
|
},
|
|
66
75
|
"devDependencies": {
|
|
67
|
-
"@phosphor-icons/react": "^2.1.5",
|
|
68
76
|
"@types/d3": "^7.4.3",
|
|
69
77
|
"@types/d3-hierarchy": "^3.1.6",
|
|
70
78
|
"@types/lodash.defaultsdeep": "^4.6.6",
|
|
@@ -75,19 +83,18 @@
|
|
|
75
83
|
"react": "~18.2.0",
|
|
76
84
|
"react-dom": "~18.2.0",
|
|
77
85
|
"vite": "5.4.7",
|
|
78
|
-
"@dxos/
|
|
79
|
-
"@dxos/react-ui": "0.8.
|
|
80
|
-
"@dxos/
|
|
81
|
-
"@dxos/
|
|
82
|
-
"@dxos/
|
|
86
|
+
"@dxos/echo-generator": "0.8.4-main.2e9d522",
|
|
87
|
+
"@dxos/react-ui": "0.8.4-main.2e9d522",
|
|
88
|
+
"@dxos/random": "0.8.4-main.2e9d522",
|
|
89
|
+
"@dxos/react-ui-theme": "0.8.4-main.2e9d522",
|
|
90
|
+
"@dxos/storybook-utils": "0.8.4-main.2e9d522"
|
|
83
91
|
},
|
|
84
92
|
"peerDependencies": {
|
|
85
|
-
"@phosphor-icons/react": "^2.1.5",
|
|
86
93
|
"effect": "^3.13.3",
|
|
87
94
|
"react": "~18.2.0",
|
|
88
95
|
"react-dom": "~18.2.0",
|
|
89
|
-
"@dxos/react-ui
|
|
90
|
-
"@dxos/react-ui": "0.8.
|
|
96
|
+
"@dxos/react-ui": "0.8.4-main.2e9d522",
|
|
97
|
+
"@dxos/react-ui-theme": "0.8.4-main.2e9d522"
|
|
91
98
|
},
|
|
92
99
|
"publishConfig": {
|
|
93
100
|
"access": "public"
|
package/src/ExplorerPlugin.tsx
CHANGED
|
@@ -9,7 +9,7 @@ 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';
|
|
12
|
+
import { translations } from './translations';
|
|
13
13
|
import { ViewType, ExplorerAction } from './types';
|
|
14
14
|
|
|
15
15
|
export const ExplorerPlugin = () =>
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import '@dxos-theme';
|
|
6
6
|
|
|
7
7
|
import { plot, sphere, geo, graticule, dot } from '@observablehq/plot';
|
|
8
|
-
import { type Meta } from '@storybook/react';
|
|
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';
|
|
@@ -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
|
|
@@ -123,8 +123,8 @@ describe('tree', () => {
|
|
|
123
123
|
});
|
|
124
124
|
|
|
125
125
|
test('task', ({ expect }) => {
|
|
126
|
-
const task = Obj.make(DataType.Task, {
|
|
127
|
-
expect(task.
|
|
126
|
+
const task = Obj.make(DataType.Task, { title: 'Test task.' });
|
|
127
|
+
expect(task.title).to.eq('Test task.');
|
|
128
128
|
|
|
129
129
|
const tree = createTree();
|
|
130
130
|
const node = tree.addNode(tree.root);
|
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[];
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var ExplorerContainer_VUXH55VV_exports = {};
|
|
30
|
-
__export(ExplorerContainer_VUXH55VV_exports, {
|
|
31
|
-
default: () => ExplorerContainer_default
|
|
32
|
-
});
|
|
33
|
-
module.exports = __toCommonJS(ExplorerContainer_VUXH55VV_exports);
|
|
34
|
-
var import_chunk_4T4LCT5R = require("./chunk-4T4LCT5R.cjs");
|
|
35
|
-
var import_chunk_TY543HPV = require("./chunk-TY543HPV.cjs");
|
|
36
|
-
var import_tracking = require("@preact-signals/safe-react/tracking");
|
|
37
|
-
var import_react = __toESM(require("react"));
|
|
38
|
-
var import_plugin_search = require("@dxos/plugin-search");
|
|
39
|
-
var import_echo = require("@dxos/react-client/echo");
|
|
40
|
-
var import_react_ui_stack = require("@dxos/react-ui-stack");
|
|
41
|
-
var ExplorerContainer = ({ role, view }) => {
|
|
42
|
-
var _effect = (0, import_tracking.useSignals)();
|
|
43
|
-
try {
|
|
44
|
-
const space = (0, import_echo.getSpace)(view);
|
|
45
|
-
const model = (0, import_chunk_4T4LCT5R.useGraphModel)(space);
|
|
46
|
-
const { match } = (0, import_plugin_search.useGlobalSearch)();
|
|
47
|
-
if (!space || !model) {
|
|
48
|
-
return null;
|
|
49
|
-
}
|
|
50
|
-
return /* @__PURE__ */ import_react.default.createElement(import_react_ui_stack.StackItem.Content, {
|
|
51
|
-
size: role === "section" ? "square" : "intrinsic"
|
|
52
|
-
}, /* @__PURE__ */ import_react.default.createElement(import_chunk_TY543HPV.D3ForceGraph, {
|
|
53
|
-
model,
|
|
54
|
-
match
|
|
55
|
-
}));
|
|
56
|
-
} finally {
|
|
57
|
-
_effect.f();
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
var ExplorerContainer_default = ExplorerContainer;
|
|
61
|
-
//# sourceMappingURL=ExplorerContainer-VUXH55VV.cjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/ExplorerContainer.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport React from 'react';\n\nimport { useGlobalSearch } from '@dxos/plugin-search';\nimport { getSpace } from '@dxos/react-client/echo';\nimport { StackItem } from '@dxos/react-ui-stack';\n\nimport { D3ForceGraph } from './Graph';\nimport { useGraphModel } from '../hooks';\nimport { type ViewType } from '../types';\n\ntype ExplorerContainerProps = {\n role: string;\n view: ViewType;\n};\n\nconst ExplorerContainer = ({ role, view }: ExplorerContainerProps) => {\n const space = getSpace(view);\n const model = useGraphModel(space);\n const { match } = useGlobalSearch();\n\n if (!space || !model) {\n return null;\n }\n\n return (\n <StackItem.Content size={role === 'section' ? 'square' : 'intrinsic'}>\n <D3ForceGraph model={model} match={match} />\n </StackItem.Content>\n );\n};\n\nexport default ExplorerContainer;\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,mBAAkB;AAElB,2BAAgC;AAChC,kBAAyB;AACzB,4BAA0B;AAW1B,IAAMA,oBAAoB,CAAC,EAAEC,MAAMC,KAAI,MAA0B;;;AAC/D,UAAMC,YAAQC,sBAASF,IAAAA;AACvB,UAAMG,YAAQC,qCAAcH,KAAAA;AAC5B,UAAM,EAAEI,MAAK,QAAKC,sCAAAA;AAElB,QAAI,CAACL,SAAS,CAACE,OAAO;AACpB,aAAO;IACT;AAEA,WACE,6BAAAI,QAAA,cAACC,gCAAUC,SAAO;MAACC,MAAMX,SAAS,YAAY,WAAW;OACvD,6BAAAQ,QAAA,cAACI,oCAAAA;MAAaR;MAAcE;;;;;AAGlC;AAEA,IAAA,4BAAeP;",
|
|
6
|
-
"names": ["ExplorerContainer", "role", "view", "space", "getSpace", "model", "useGraphModel", "match", "useGlobalSearch", "React", "StackItem", "Content", "size", "D3ForceGraph"]
|
|
7
|
-
}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var chunk_4T4LCT5R_exports = {};
|
|
20
|
-
__export(chunk_4T4LCT5R_exports, {
|
|
21
|
-
useGraphModel: () => useGraphModel
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(chunk_4T4LCT5R_exports);
|
|
24
|
-
var import_react = require("react");
|
|
25
|
-
var import_schema = require("@dxos/schema");
|
|
26
|
-
var useGraphModel = (space, filter, options) => {
|
|
27
|
-
const [model, setModel] = (0, import_react.useState)(void 0);
|
|
28
|
-
(0, import_react.useEffect)(() => {
|
|
29
|
-
if (!space) {
|
|
30
|
-
void model?.close();
|
|
31
|
-
setModel(void 0);
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
if (!model) {
|
|
35
|
-
const model2 = new import_schema.SpaceGraphModel().setFilter(filter).setOptions(options);
|
|
36
|
-
void model2.open(space);
|
|
37
|
-
setModel(model2);
|
|
38
|
-
} else {
|
|
39
|
-
model.setFilter(filter).setOptions(options);
|
|
40
|
-
}
|
|
41
|
-
}, [
|
|
42
|
-
space,
|
|
43
|
-
filter,
|
|
44
|
-
options
|
|
45
|
-
]);
|
|
46
|
-
return model;
|
|
47
|
-
};
|
|
48
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
49
|
-
0 && (module.exports = {
|
|
50
|
-
useGraphModel
|
|
51
|
-
});
|
|
52
|
-
//# sourceMappingURL=chunk-4T4LCT5R.cjs.map
|
|
@@ -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,mBAAoC;AAGpC,oBAA6D;AAGtD,IAAMA,gBAAgB,CAC3BC,OACAC,QACAC,YAAAA;AAEA,QAAM,CAACC,OAAOC,QAAAA,QAAYC,uBAAsCC,MAAAA;AAChEC,8BAAU,MAAA;AACR,QAAI,CAACP,OAAO;AACV,WAAKG,OAAOK,MAAAA;AACZJ,eAASE,MAAAA;AACT;IACF;AAGA,QAAI,CAACH,OAAO;AACV,YAAMA,SAAQ,IAAIM,8BAAAA,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": ["useGraphModel", "space", "filter", "options", "model", "setModel", "useState", "undefined", "useEffect", "close", "SpaceGraphModel", "setFilter", "setOptions", "open"]
|
|
7
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var chunk_BCDVG2CH_exports = {};
|
|
20
|
-
__export(chunk_BCDVG2CH_exports, {
|
|
21
|
-
EXPLORER_PLUGIN: () => EXPLORER_PLUGIN,
|
|
22
|
-
meta: () => meta
|
|
23
|
-
});
|
|
24
|
-
module.exports = __toCommonJS(chunk_BCDVG2CH_exports);
|
|
25
|
-
var EXPLORER_PLUGIN = "dxos.org/plugin/explorer";
|
|
26
|
-
var meta = {
|
|
27
|
-
id: EXPLORER_PLUGIN,
|
|
28
|
-
name: "Explorer",
|
|
29
|
-
description: "Install this plugin to view a hypergraph of all objects inside of your Space.",
|
|
30
|
-
icon: "ph--graph--regular",
|
|
31
|
-
source: "https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-explorer",
|
|
32
|
-
tags: [
|
|
33
|
-
"labs"
|
|
34
|
-
],
|
|
35
|
-
screenshots: [
|
|
36
|
-
"https://dxos.network/plugin-details-explorer-dark.png"
|
|
37
|
-
]
|
|
38
|
-
};
|
|
39
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
40
|
-
0 && (module.exports = {
|
|
41
|
-
EXPLORER_PLUGIN,
|
|
42
|
-
meta
|
|
43
|
-
});
|
|
44
|
-
//# sourceMappingURL=chunk-BCDVG2CH.cjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/meta.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type PluginMeta } from '@dxos/app-framework';\n\nexport const EXPLORER_PLUGIN = 'dxos.org/plugin/explorer';\n\nexport const meta: PluginMeta = {\n id: EXPLORER_PLUGIN,\n name: 'Explorer',\n description: 'Install this plugin to view a hypergraph of all objects inside of your Space.',\n icon: 'ph--graph--regular',\n source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-explorer',\n tags: ['labs'],\n screenshots: ['https://dxos.network/plugin-details-explorer-dark.png'],\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAMO,IAAMA,kBAAkB;AAExB,IAAMC,OAAmB;EAC9BC,IAAIF;EACJG,MAAM;EACNC,aAAa;EACbC,MAAM;EACNC,QAAQ;EACRC,MAAM;IAAC;;EACPC,aAAa;IAAC;;AAChB;",
|
|
6
|
-
"names": ["EXPLORER_PLUGIN", "meta", "id", "name", "description", "icon", "source", "tags", "screenshots"]
|
|
7
|
-
}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var chunk_MLRYW4WQ_exports = {};
|
|
20
|
-
__export(chunk_MLRYW4WQ_exports, {
|
|
21
|
-
ExplorerAction: () => ExplorerAction,
|
|
22
|
-
ViewType: () => ViewType
|
|
23
|
-
});
|
|
24
|
-
module.exports = __toCommonJS(chunk_MLRYW4WQ_exports);
|
|
25
|
-
var import_chunk_BCDVG2CH = require("./chunk-BCDVG2CH.cjs");
|
|
26
|
-
var import_effect = require("effect");
|
|
27
|
-
var import_echo_schema = require("@dxos/echo-schema");
|
|
28
|
-
var import_effect2 = require("effect");
|
|
29
|
-
var ViewType = class extends (0, import_echo_schema.TypedObject)({
|
|
30
|
-
typename: "dxos.org/type/ExplorerView",
|
|
31
|
-
version: "0.1.0"
|
|
32
|
-
})({
|
|
33
|
-
name: import_effect.Schema.optional(import_effect.Schema.String),
|
|
34
|
-
type: import_effect.Schema.String
|
|
35
|
-
}) {
|
|
36
|
-
};
|
|
37
|
-
(function(ExplorerAction2) {
|
|
38
|
-
const EXPLORER_ACTION = `${import_chunk_BCDVG2CH.EXPLORER_PLUGIN}/action`;
|
|
39
|
-
class Create extends import_effect2.Schema.TaggedClass()(`${EXPLORER_ACTION}/create`, {
|
|
40
|
-
input: import_effect2.Schema.Struct({
|
|
41
|
-
name: import_effect2.Schema.optional(import_effect2.Schema.String)
|
|
42
|
-
}),
|
|
43
|
-
output: import_effect2.Schema.Struct({
|
|
44
|
-
object: ViewType
|
|
45
|
-
})
|
|
46
|
-
}) {
|
|
47
|
-
}
|
|
48
|
-
ExplorerAction2.Create = Create;
|
|
49
|
-
})(ExplorerAction || (ExplorerAction = {}));
|
|
50
|
-
var ExplorerAction;
|
|
51
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
52
|
-
0 && (module.exports = {
|
|
53
|
-
ExplorerAction,
|
|
54
|
-
ViewType
|
|
55
|
-
});
|
|
56
|
-
//# sourceMappingURL=chunk-MLRYW4WQ.cjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/types/schema.ts", "../../../src/types/types.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { Schema } from 'effect';\n\nimport { TypedObject } from '@dxos/echo-schema';\n\n// TODO(burdon): Clashes with sdk/view.\nexport class ViewType extends TypedObject({\n typename: 'dxos.org/type/ExplorerView',\n version: '0.1.0',\n})({\n name: Schema.optional(Schema.String),\n type: Schema.String,\n}) {}\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { Schema } from 'effect';\n\nimport { ViewType } from './schema';\nimport { EXPLORER_PLUGIN } from '../meta';\n\nexport namespace ExplorerAction {\n const EXPLORER_ACTION = `${EXPLORER_PLUGIN}/action`;\n\n export class Create extends Schema.TaggedClass<Create>()(`${EXPLORER_ACTION}/create`, {\n input: Schema.Struct({\n name: Schema.optional(Schema.String),\n }),\n output: Schema.Struct({\n object: ViewType,\n }),\n }) {}\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;AAIA,oBAAuB;AAEvB,yBAA4B;ACF5B,IAAAA,iBAAuB;ADKhB,IAAMC,WAAN,kBAAuBC,gCAAY;EACxCC,UAAU;EACVC,SAAS;AACX,CAAA,EAAG;EACDC,MAAMC,qBAAOC,SAASD,qBAAOE,MAAM;EACnCC,MAAMH,qBAAOE;AACf,CAAA,EAAA;AAAI;UCNaE,iBAAAA;AACf,QAAMC,kBAAkB,GAAGC,qCAAAA;EAEpB,MAAMC,eAAeP,eAAAA,OAAOQ,YAAW,EAAW,GAAGH,eAAAA,WAA0B;IACpFI,OAAOT,eAAAA,OAAOU,OAAO;MACnBX,MAAMC,eAAAA,OAAOC,SAASD,eAAAA,OAAOE,MAAM;IACrC,CAAA;IACAS,QAAQX,eAAAA,OAAOU,OAAO;MACpBE,QAAQjB;IACV,CAAA;EACF,CAAA,EAAA;EAAI;kBAPSY,SAAAA;AAQf,GAXiBH,mBAAAA,iBAAAA,CAAAA,EAAAA;;",
|
|
6
|
-
"names": ["import_effect", "ViewType", "TypedObject", "typename", "version", "name", "Schema", "optional", "String", "type", "ExplorerAction", "EXPLORER_ACTION", "EXPLORER_PLUGIN", "Create", "TaggedClass", "input", "Struct", "output", "object"]
|
|
7
|
-
}
|