@dxos/plugin-explorer 0.8.4-main.fd6878d → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +102 -5
- package/PLUGIN.mdl +340 -0
- package/dist/lib/neutral/ExplorerArticle-4I7PNGDC.mjs +459 -0
- package/dist/lib/neutral/ExplorerArticle-4I7PNGDC.mjs.map +7 -0
- package/dist/lib/neutral/ExplorerPlugin.mjs +10 -0
- package/dist/lib/neutral/capabilities/index.mjs +11 -0
- package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
- package/dist/lib/neutral/chunk-3D7BYXOR.mjs +37 -0
- package/dist/lib/neutral/chunk-3D7BYXOR.mjs.map +7 -0
- package/dist/lib/neutral/chunk-42BYLQQA.mjs +42 -0
- package/dist/lib/neutral/chunk-42BYLQQA.mjs.map +7 -0
- package/dist/lib/neutral/chunk-7XUDLV6E.mjs +287 -0
- package/dist/lib/neutral/chunk-7XUDLV6E.mjs.map +7 -0
- package/dist/lib/neutral/chunk-IKHJV3Q4.mjs +20 -0
- package/dist/lib/neutral/chunk-IKHJV3Q4.mjs.map +7 -0
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/neutral/chunk-YBCHBVCJ.mjs +69 -0
- package/dist/lib/neutral/chunk-YBCHBVCJ.mjs.map +7 -0
- package/dist/lib/{node-esm/chunk-W4ZNCGOD.mjs → neutral/components/index.mjs} +890 -314
- package/dist/lib/neutral/components/index.mjs.map +7 -0
- package/dist/lib/neutral/containers/index.mjs +9 -0
- package/dist/lib/neutral/containers/index.mjs.map +7 -0
- package/dist/lib/neutral/create-object-F6TKVAGV.mjs +39 -0
- package/dist/lib/neutral/create-object-F6TKVAGV.mjs.map +7 -0
- package/dist/lib/neutral/hooks/index.mjs +45 -0
- package/dist/lib/neutral/hooks/index.mjs.map +7 -0
- package/dist/lib/neutral/index.mjs +14 -0
- package/dist/lib/neutral/meta.json +1 -0
- package/dist/lib/{browser → neutral}/meta.mjs +2 -3
- package/dist/lib/neutral/plugin.mjs +12 -0
- package/dist/lib/neutral/plugin.mjs.map +7 -0
- package/dist/lib/neutral/react-surface-APBW2VQG.mjs +26 -0
- package/dist/lib/neutral/react-surface-APBW2VQG.mjs.map +7 -0
- package/dist/lib/neutral/testing/index.mjs +139 -0
- package/dist/lib/neutral/testing/index.mjs.map +7 -0
- package/dist/lib/neutral/translations.mjs +33 -0
- package/dist/lib/neutral/translations.mjs.map +7 -0
- package/dist/lib/neutral/types/index.mjs +10 -0
- package/dist/lib/neutral/types/index.mjs.map +7 -0
- package/dist/types/data/cities.d.ts +4 -4
- package/dist/types/data/cities.d.ts.map +1 -1
- package/dist/types/data/countries-110m.d.ts +19 -22
- package/dist/types/data/countries-110m.d.ts.map +1 -1
- package/dist/types/src/ExplorerPlugin.d.ts +3 -1
- package/dist/types/src/ExplorerPlugin.d.ts.map +1 -1
- package/dist/types/src/ExplorerPlugin.test.d.ts +2 -0
- package/dist/types/src/ExplorerPlugin.test.d.ts.map +1 -0
- package/dist/types/src/capabilities/create-object.d.ts +11 -0
- package/dist/types/src/capabilities/create-object.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +8 -2
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts +3 -2
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/components/Chart/Chart.d.ts +1 -1
- package/dist/types/src/components/Chart/Chart.d.ts.map +1 -1
- package/dist/types/src/components/Chart/Chart.stories.d.ts +12 -5
- package/dist/types/src/components/Chart/Chart.stories.d.ts.map +1 -1
- package/dist/types/src/components/Globe/Globe.d.ts +1 -1
- package/dist/types/src/components/Globe/Globe.d.ts.map +1 -1
- package/dist/types/src/components/Globe/Globe.stories.d.ts +12 -5
- package/dist/types/src/components/Globe/Globe.stories.d.ts.map +1 -1
- package/dist/types/src/components/Graph/CanvasForceGraph.d.ts +13 -0
- package/dist/types/src/components/Graph/CanvasForceGraph.d.ts.map +1 -0
- package/dist/types/src/components/Graph/CanvasForceGraph.stories.d.ts +17 -0
- package/dist/types/src/components/Graph/CanvasForceGraph.stories.d.ts.map +1 -0
- package/dist/types/src/components/Graph/ForceGraph.d.ts +12 -5
- package/dist/types/src/components/Graph/ForceGraph.d.ts.map +1 -1
- package/dist/types/src/components/Graph/ForceGraph.stories.d.ts +15 -4
- package/dist/types/src/components/Graph/ForceGraph.stories.d.ts.map +1 -1
- package/dist/types/src/components/Graph/{adapter.d.ts → graph-adapter.d.ts} +2 -2
- package/dist/types/src/components/Graph/graph-adapter.d.ts.map +1 -0
- package/dist/types/src/components/Graph/index.d.ts +1 -1
- package/dist/types/src/components/Graph/index.d.ts.map +1 -1
- package/dist/types/src/components/Lattice/Lattice.d.ts +20 -0
- package/dist/types/src/components/Lattice/Lattice.d.ts.map +1 -0
- package/dist/types/src/components/Lattice/Lattice.stories.d.ts +8 -0
- package/dist/types/src/components/Lattice/Lattice.stories.d.ts.map +1 -0
- package/dist/types/src/components/Lattice/index.d.ts +2 -0
- package/dist/types/src/components/Lattice/index.d.ts.map +1 -0
- package/dist/types/src/components/Tree/EdgeBundling.stories.d.ts +21 -0
- package/dist/types/src/components/Tree/EdgeBundling.stories.d.ts.map +1 -0
- package/dist/types/src/components/Tree/Tree.d.ts +20 -23
- package/dist/types/src/components/Tree/Tree.d.ts.map +1 -1
- package/dist/types/src/components/Tree/Tree.stories.d.ts +8 -18
- package/dist/types/src/components/Tree/Tree.stories.d.ts.map +1 -1
- package/dist/types/src/components/Tree/index.d.ts +2 -0
- package/dist/types/src/components/Tree/index.d.ts.map +1 -1
- package/dist/types/src/components/Tree/layout/HierarchicalEdgeBundling.d.ts +37 -2
- package/dist/types/src/components/Tree/layout/HierarchicalEdgeBundling.d.ts.map +1 -1
- package/dist/types/src/components/Tree/layout/RadialTree.d.ts +35 -2
- package/dist/types/src/components/Tree/layout/RadialTree.d.ts.map +1 -1
- package/dist/types/src/components/Tree/layout/TidyTree.d.ts +24 -2
- package/dist/types/src/components/Tree/layout/TidyTree.d.ts.map +1 -1
- package/dist/types/src/components/Tree/layout/hierarchy.d.ts +17 -0
- package/dist/types/src/components/Tree/layout/hierarchy.d.ts.map +1 -0
- package/dist/types/src/components/Tree/layout/index.d.ts +5 -4
- package/dist/types/src/components/Tree/layout/index.d.ts.map +1 -1
- package/dist/types/src/components/Tree/layout/slots.d.ts +7 -0
- package/dist/types/src/components/Tree/layout/slots.d.ts.map +1 -0
- package/dist/types/src/components/Tree/layout/useContainerSize.d.ts +15 -0
- package/dist/types/src/components/Tree/layout/useContainerSize.d.ts.map +1 -0
- package/dist/types/src/components/Tree/types/tree.d.ts +51 -28
- package/dist/types/src/components/Tree/types/tree.d.ts.map +1 -1
- package/dist/types/src/components/Tree/types/types.d.ts +14 -4
- package/dist/types/src/components/Tree/types/types.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +1 -4
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/containers/ExplorerArticle/ExplorerArticle.d.ts +8 -0
- package/dist/types/src/containers/ExplorerArticle/ExplorerArticle.d.ts.map +1 -0
- package/dist/types/src/containers/ExplorerArticle/ExplorerArticle.stories.d.ts +15 -0
- package/dist/types/src/containers/ExplorerArticle/ExplorerArticle.stories.d.ts.map +1 -0
- package/dist/types/src/containers/ExplorerArticle/Visualization.d.ts +18 -0
- package/dist/types/src/containers/ExplorerArticle/Visualization.d.ts.map +1 -0
- package/dist/types/src/containers/ExplorerArticle/index.d.ts +2 -0
- package/dist/types/src/containers/ExplorerArticle/index.d.ts.map +1 -0
- package/dist/types/src/containers/ExplorerArticle/variants.d.ts +9 -0
- package/dist/types/src/containers/ExplorerArticle/variants.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +3 -0
- package/dist/types/src/containers/index.d.ts.map +1 -0
- package/dist/types/src/hooks/useGraphModel.d.ts +2 -2
- package/dist/types/src/hooks/useGraphModel.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -3
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +2 -3
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/plugin.d.ts +3 -0
- package/dist/types/src/plugin.d.ts.map +1 -0
- package/dist/types/src/{components/Tree/testing → testing}/generator.d.ts +1 -1
- package/dist/types/src/testing/generator.d.ts.map +1 -0
- package/dist/types/src/testing/index.d.ts +4 -0
- package/dist/types/src/testing/index.d.ts.map +1 -0
- package/dist/types/src/testing/relations.d.ts +32 -0
- package/dist/types/src/testing/relations.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +34 -13
- 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 +22 -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/src/util/index.d.ts +3 -0
- package/dist/types/src/util/index.d.ts.map +1 -0
- package/dist/types/src/util/node-color.d.ts +13 -0
- package/dist/types/src/util/node-color.d.ts.map +1 -0
- package/dist/types/src/{components → util}/plot.d.ts +1 -1
- package/dist/types/src/util/plot.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +113 -64
- package/src/ExplorerPlugin.test.ts +26 -0
- package/src/ExplorerPlugin.tsx +21 -54
- package/src/capabilities/create-object.ts +36 -0
- package/src/capabilities/index.ts +3 -3
- package/src/capabilities/react-surface.tsx +24 -15
- package/src/components/Chart/Chart.stories.tsx +21 -27
- package/src/components/Chart/Chart.tsx +1 -1
- package/src/components/Globe/Globe.stories.tsx +23 -25
- package/src/components/Globe/Globe.tsx +1 -1
- package/src/components/Graph/CanvasForceGraph.stories.tsx +97 -0
- package/src/components/Graph/CanvasForceGraph.tsx +124 -0
- package/src/components/Graph/ForceGraph.stories.tsx +109 -41
- package/src/components/Graph/ForceGraph.tsx +105 -85
- package/src/components/Graph/{adapter.ts → graph-adapter.ts} +14 -8
- package/src/components/Graph/index.ts +1 -1
- package/src/components/Lattice/Lattice.stories.tsx +104 -0
- package/src/components/Lattice/Lattice.tsx +182 -0
- package/src/components/Lattice/index.ts +5 -0
- package/src/components/Tree/EdgeBundling.stories.tsx +144 -0
- package/src/components/Tree/Tree.stories.tsx +30 -42
- package/src/components/Tree/Tree.tsx +69 -95
- package/src/components/Tree/index.ts +2 -0
- package/src/components/Tree/layout/HierarchicalEdgeBundling.tsx +335 -0
- package/src/components/Tree/layout/RadialTree.tsx +242 -0
- package/src/components/Tree/layout/TidyTree.tsx +246 -0
- package/src/components/Tree/layout/hierarchy.ts +32 -0
- package/src/components/Tree/layout/index.ts +5 -5
- package/src/components/Tree/layout/slots.ts +19 -0
- package/src/components/Tree/layout/useContainerSize.ts +43 -0
- package/src/components/Tree/types/tree.test.ts +8 -7
- package/src/components/Tree/types/tree.ts +52 -36
- package/src/components/Tree/types/types.ts +38 -29
- package/src/components/index.ts +1 -4
- package/src/containers/ExplorerArticle/ExplorerArticle.stories.tsx +152 -0
- package/src/containers/ExplorerArticle/ExplorerArticle.tsx +120 -0
- package/src/containers/ExplorerArticle/Visualization.tsx +523 -0
- package/src/containers/ExplorerArticle/index.ts +5 -0
- package/src/containers/ExplorerArticle/variants.ts +47 -0
- package/src/containers/index.ts +7 -0
- package/src/hooks/useGraphModel.ts +25 -14
- package/src/index.ts +1 -4
- package/src/meta.ts +30 -8
- package/src/plugin.ts +9 -0
- package/src/{components/Tree/testing → testing}/generator.ts +6 -4
- package/src/testing/index.ts +9 -0
- package/src/testing/relations.ts +117 -0
- package/src/translations.ts +17 -12
- package/src/types/ExplorerAction.ts +20 -0
- package/src/types/Graph.ts +41 -0
- package/src/types/index.ts +2 -2
- package/src/typings.d.ts +8 -0
- package/src/util/index.ts +6 -0
- package/src/util/node-color.ts +23 -0
- package/src/{components → util}/plot.ts +16 -4
- package/src/vite-env.d.ts +10 -0
- package/dist/lib/browser/ExplorerContainer-5QHLD2B2.mjs +0 -37
- package/dist/lib/browser/ExplorerContainer-5QHLD2B2.mjs.map +0 -7
- package/dist/lib/browser/chunk-2MKBRIUT.mjs +0 -31
- package/dist/lib/browser/chunk-2MKBRIUT.mjs.map +0 -7
- package/dist/lib/browser/chunk-CZZ3DDR7.mjs +0 -38
- package/dist/lib/browser/chunk-CZZ3DDR7.mjs.map +0 -7
- package/dist/lib/browser/chunk-L4U4MPSZ.mjs +0 -190
- package/dist/lib/browser/chunk-L4U4MPSZ.mjs.map +0 -7
- package/dist/lib/browser/chunk-LGK64HLU.mjs +0 -11089
- package/dist/lib/browser/chunk-LGK64HLU.mjs.map +0 -7
- package/dist/lib/browser/chunk-UL5EDJPE.mjs +0 -21
- package/dist/lib/browser/chunk-UL5EDJPE.mjs.map +0 -7
- package/dist/lib/browser/index.mjs +0 -112
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-7MVEYNX7.mjs +0 -24
- package/dist/lib/browser/intent-resolver-7MVEYNX7.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/react-surface-FABRDFTF.mjs +0 -31
- package/dist/lib/browser/react-surface-FABRDFTF.mjs.map +0 -7
- package/dist/lib/browser/types/index.mjs +0 -10
- package/dist/lib/node-esm/ExplorerContainer-AMYAVLO4.mjs +0 -38
- package/dist/lib/node-esm/ExplorerContainer-AMYAVLO4.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-3ODK27PU.mjs +0 -33
- package/dist/lib/node-esm/chunk-3ODK27PU.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-4GWDNZ4Z.mjs +0 -39
- package/dist/lib/node-esm/chunk-4GWDNZ4Z.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-MCOXQ3ML.mjs +0 -192
- package/dist/lib/node-esm/chunk-MCOXQ3ML.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-PIAXA43R.mjs +0 -23
- package/dist/lib/node-esm/chunk-PIAXA43R.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-W4ZNCGOD.mjs.map +0 -7
- package/dist/lib/node-esm/index.mjs +0 -113
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-NL3SR2XF.mjs +0 -25
- package/dist/lib/node-esm/intent-resolver-NL3SR2XF.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/lib/node-esm/meta.mjs +0 -10
- package/dist/lib/node-esm/react-surface-EYCZUAAI.mjs +0 -32
- package/dist/lib/node-esm/react-surface-EYCZUAAI.mjs.map +0 -7
- package/dist/lib/node-esm/types/index.mjs +0 -11
- package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
- package/dist/types/src/components/ExplorerContainer.d.ts +0 -9
- package/dist/types/src/components/ExplorerContainer.d.ts.map +0 -1
- package/dist/types/src/components/Graph/D3ForceGraph.d.ts +0 -14
- package/dist/types/src/components/Graph/D3ForceGraph.d.ts.map +0 -1
- package/dist/types/src/components/Graph/D3ForceGraph.stories.d.ts +0 -6
- package/dist/types/src/components/Graph/D3ForceGraph.stories.d.ts.map +0 -1
- package/dist/types/src/components/Graph/adapter.d.ts.map +0 -1
- package/dist/types/src/components/Graph/testing.d.ts +0 -14
- package/dist/types/src/components/Graph/testing.d.ts.map +0 -1
- package/dist/types/src/components/Tree/testing/generator.d.ts.map +0 -1
- package/dist/types/src/components/Tree/testing/index.d.ts +0 -2
- package/dist/types/src/components/Tree/testing/index.d.ts.map +0 -1
- package/dist/types/src/components/plot.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/components/ExplorerContainer.tsx +0 -37
- package/src/components/Graph/D3ForceGraph.stories.tsx +0 -65
- package/src/components/Graph/D3ForceGraph.tsx +0 -101
- package/src/components/Graph/testing.ts +0 -55
- package/src/components/Tree/layout/HierarchicalEdgeBundling.ts +0 -162
- package/src/components/Tree/layout/RadialTree.ts +0 -94
- package/src/components/Tree/layout/TidyTree.ts +0 -101
- package/src/components/Tree/testing/index.ts +0 -5
- package/src/types/schema.ts +0 -16
- package/src/types/types.ts +0 -22
- /package/dist/lib/{browser/meta.mjs.map → neutral/ExplorerPlugin.mjs.map} +0 -0
- /package/dist/lib/{browser/types/index.mjs.map → neutral/chunk-J5LGTIGS.mjs.map} +0 -0
- /package/dist/lib/{node-esm/types → neutral}/index.mjs.map +0 -0
- /package/dist/lib/{node-esm → neutral}/meta.mjs.map +0 -0
package/src/meta.ts
CHANGED
|
@@ -2,16 +2,38 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { Plugin } from '@dxos/app-framework';
|
|
6
|
+
import { DXN } from '@dxos/keys';
|
|
7
|
+
import { trim } from '@dxos/util';
|
|
6
8
|
|
|
7
|
-
export const
|
|
8
|
-
|
|
9
|
-
export const meta: PluginMeta = {
|
|
10
|
-
id: EXPLORER_PLUGIN,
|
|
9
|
+
export const meta = Plugin.makeMeta({
|
|
10
|
+
key: DXN.make('org.dxos.plugin.explorer'),
|
|
11
11
|
name: 'Explorer',
|
|
12
|
-
|
|
12
|
+
author: 'DXOS',
|
|
13
|
+
description: trim`
|
|
14
|
+
Explorer is an interactive hypergraph visualization plugin that reveals the relationships
|
|
15
|
+
between objects stored in your DXOS workspace. Each Graph document is backed by a live
|
|
16
|
+
ECHO query and a View that you configure — Explorer keeps the visualization synchronized
|
|
17
|
+
with the database in real time so every peer immediately sees changes made by collaborators.
|
|
18
|
+
|
|
19
|
+
The plugin offers four switchable layout algorithms for the same data set: a physics-based
|
|
20
|
+
force-directed graph for freeform exploration, a radial cluster layout that groups objects
|
|
21
|
+
by type around a central root, an edge-bundling layout that tames visual clutter on dense
|
|
22
|
+
graphs, and a lattice grid that arranges objects in a sorted matrix sorted by type and label.
|
|
23
|
+
Switching between layouts smoothly tweens node positions so spatial context is preserved.
|
|
24
|
+
|
|
25
|
+
Nodes are coloured by their ECHO object type, and hovering any node opens an anchor-card
|
|
26
|
+
preview panel with the object's details without leaving the graph view.
|
|
27
|
+
The toolbar's query editor lets you filter the visible node set on the fly using
|
|
28
|
+
the same query syntax available across Composer.
|
|
29
|
+
|
|
30
|
+
A new Graph document can be created from the object-creation dialog; Explorer automatically
|
|
31
|
+
derives an initial View from the chosen type and persists both to ECHO so the graph is
|
|
32
|
+
immediately shareable and replicable across the space.
|
|
33
|
+
`,
|
|
13
34
|
icon: 'ph--graph--regular',
|
|
35
|
+
iconHue: 'green',
|
|
14
36
|
source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-explorer',
|
|
15
|
-
|
|
37
|
+
spec: 'PLUGIN.mdl',
|
|
16
38
|
screenshots: ['https://dxos.network/plugin-details-explorer-dark.png'],
|
|
17
|
-
};
|
|
39
|
+
});
|
package/src/plugin.ts
ADDED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { Key } from '@dxos/echo';
|
|
5
|
+
import { Key, Obj } from '@dxos/echo';
|
|
6
6
|
import { range } from '@dxos/util';
|
|
7
7
|
|
|
8
|
-
import { Tree, type TreeNodeType } from '../types';
|
|
8
|
+
import { Tree, type TreeNodeType } from '../components/Tree/types';
|
|
9
9
|
|
|
10
10
|
type NumberOrNumberArray = number | number[];
|
|
11
11
|
|
|
@@ -16,12 +16,14 @@ const random = (min: number, max: number) => Math.floor(Math.random() * (max - m
|
|
|
16
16
|
*/
|
|
17
17
|
export const createTree = (spec: NumberOrNumberArray[] = [], createText?: () => string): Tree => {
|
|
18
18
|
const tree = new Tree();
|
|
19
|
-
tree.
|
|
19
|
+
Obj.update(tree.tree, () => {
|
|
20
|
+
tree.root.data = { text: 'root' };
|
|
21
|
+
});
|
|
20
22
|
|
|
21
23
|
const createNodes = (parent: TreeNodeType, spec: NumberOrNumberArray = 0): TreeNodeType[] => {
|
|
22
24
|
const count = Array.isArray(spec) ? random(spec[0], spec[1]) : spec;
|
|
23
25
|
return range(count, (i) => ({
|
|
24
|
-
id: Key.
|
|
26
|
+
id: Key.EntityId.random(),
|
|
25
27
|
children: [],
|
|
26
28
|
data: {
|
|
27
29
|
text: createText?.() ?? [parent.data.text, i + 1].join('.'),
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type Space } from '@dxos/client/echo';
|
|
6
|
+
import { Obj, Query, Relation } from '@dxos/echo';
|
|
7
|
+
import {
|
|
8
|
+
type RelationSpec,
|
|
9
|
+
type TypeSpec,
|
|
10
|
+
type ValueGenerator,
|
|
11
|
+
createObjectFactory,
|
|
12
|
+
createRelationFactory,
|
|
13
|
+
} from '@dxos/schema/testing';
|
|
14
|
+
import { HasConnection, Organization, Person } from '@dxos/types';
|
|
15
|
+
|
|
16
|
+
import { type BundleEdge } from '../components/Tree/layout';
|
|
17
|
+
import { type TreeNode } from '../components/Tree/types';
|
|
18
|
+
|
|
19
|
+
const SECTORS = ['Technology', 'Finance', 'Research', 'Media'];
|
|
20
|
+
const CONNECTION_KINDS = ['partner', 'investor', 'vendor', 'customer'];
|
|
21
|
+
|
|
22
|
+
export type ConnectedOrgsResult = {
|
|
23
|
+
organizations: Obj.Any[];
|
|
24
|
+
people: Obj.Any[];
|
|
25
|
+
connections: Obj.Any[];
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export type ConnectedOrgsOptions = {
|
|
29
|
+
organizationCount?: number;
|
|
30
|
+
personCount?: number;
|
|
31
|
+
connectionCount?: number;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Populate a space with Organizations, People, and HasConnection relations between organizations.
|
|
36
|
+
* Uses `createObjectFactory` to generate Org/Person properties from their `GeneratorAnnotation`s,
|
|
37
|
+
* then `createRelationFactory` to wire HasConnection relations (Org→Org) between them, spreading
|
|
38
|
+
* the connections across the available kinds.
|
|
39
|
+
*/
|
|
40
|
+
export const generateConnectedOrgs = async (
|
|
41
|
+
space: Space,
|
|
42
|
+
generator: ValueGenerator,
|
|
43
|
+
{ organizationCount = 12, personCount = 24, connectionCount = 18 }: ConnectedOrgsOptions = {},
|
|
44
|
+
): Promise<ConnectedOrgsResult> => {
|
|
45
|
+
const specs: TypeSpec[] = [
|
|
46
|
+
{ type: Organization.Organization, count: organizationCount },
|
|
47
|
+
// Person has a Ref to Organization — generator fills it from objects already in db.
|
|
48
|
+
{ type: Person.Person, count: personCount },
|
|
49
|
+
];
|
|
50
|
+
|
|
51
|
+
await createObjectFactory(space.db, generator)(specs);
|
|
52
|
+
|
|
53
|
+
// Distribute the requested connections evenly across the connection kinds.
|
|
54
|
+
const relationSpecs: RelationSpec[] = CONNECTION_KINDS.map((kind, index) => ({
|
|
55
|
+
type: HasConnection.HasConnection,
|
|
56
|
+
count:
|
|
57
|
+
Math.floor(connectionCount / CONNECTION_KINDS.length) +
|
|
58
|
+
(index < connectionCount % CONNECTION_KINDS.length ? 1 : 0),
|
|
59
|
+
data: { kind },
|
|
60
|
+
}));
|
|
61
|
+
const connections = await createRelationFactory(space.db, generator)(relationSpecs);
|
|
62
|
+
|
|
63
|
+
const organizations = await space.db.query(Query.type(Organization.Organization)).run();
|
|
64
|
+
const people = await space.db.query(Query.type(Person.Person)).run();
|
|
65
|
+
return { organizations, people, connections };
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Build a TreeNode hierarchy: Root → Sector → Organization (leaf).
|
|
70
|
+
* Organizations are deterministically bucketed into `SECTORS` so the demo has visible groups.
|
|
71
|
+
*/
|
|
72
|
+
export const buildOrgHierarchy = (organizations: Obj.Any[], sectors: readonly string[] = SECTORS): TreeNode => {
|
|
73
|
+
// Avoid modulo-by-zero / missing-bucket crashes when the caller passes an empty sectors list.
|
|
74
|
+
const activeSectors = sectors.length > 0 ? sectors : ['Uncategorized'];
|
|
75
|
+
const buckets = new Map<string, TreeNode[]>();
|
|
76
|
+
for (const sector of activeSectors) {
|
|
77
|
+
buckets.set(sector, []);
|
|
78
|
+
}
|
|
79
|
+
for (let i = 0; i < organizations.length; i++) {
|
|
80
|
+
const org = organizations[i] as any;
|
|
81
|
+
const sector = activeSectors[i % activeSectors.length];
|
|
82
|
+
buckets.get(sector)!.push({
|
|
83
|
+
id: org.id,
|
|
84
|
+
label: org.name ?? org.id.slice(0, 6),
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
return {
|
|
89
|
+
id: 'root',
|
|
90
|
+
label: 'Organizations',
|
|
91
|
+
children: activeSectors.map((sector) => ({
|
|
92
|
+
id: `sector:${sector}`,
|
|
93
|
+
label: sector,
|
|
94
|
+
children: buckets.get(sector) ?? [],
|
|
95
|
+
})),
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Convert HasConnection relations into bundle edges between organization ids.
|
|
101
|
+
*/
|
|
102
|
+
export const connectionsToEdges = (connections: Obj.Any[]): BundleEdge[] => {
|
|
103
|
+
return connections
|
|
104
|
+
.map((relation): BundleEdge | undefined => {
|
|
105
|
+
const source = Relation.getSource(relation as any) as any;
|
|
106
|
+
const target = Relation.getTarget(relation as any) as any;
|
|
107
|
+
if (!source?.id || !target?.id) {
|
|
108
|
+
return undefined;
|
|
109
|
+
}
|
|
110
|
+
return {
|
|
111
|
+
source: source.id,
|
|
112
|
+
target: target.id,
|
|
113
|
+
kind: (relation as any).kind,
|
|
114
|
+
};
|
|
115
|
+
})
|
|
116
|
+
.filter((e): e is BundleEdge => Boolean(e));
|
|
117
|
+
};
|
package/src/translations.ts
CHANGED
|
@@ -2,27 +2,32 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
import { Type } from '@dxos/echo';
|
|
5
6
|
import { type Resource } from '@dxos/react-ui';
|
|
7
|
+
import { translations as componentsTranslations } from '@dxos/react-ui-components/translations';
|
|
6
8
|
|
|
7
|
-
import { meta } from '
|
|
8
|
-
import {
|
|
9
|
+
import { meta } from '#meta';
|
|
10
|
+
import { Graph } from '#types';
|
|
9
11
|
|
|
10
12
|
export const translations = [
|
|
11
13
|
{
|
|
12
14
|
'en-US': {
|
|
13
|
-
[
|
|
14
|
-
'typename
|
|
15
|
-
'typename
|
|
16
|
-
'typename
|
|
17
|
-
'typename
|
|
18
|
-
'object
|
|
19
|
-
'
|
|
20
|
-
'
|
|
15
|
+
[Type.getTypename(Graph.Graph)]: {
|
|
16
|
+
'typename.label': 'Explorer',
|
|
17
|
+
'typename.label_zero': 'Explorers',
|
|
18
|
+
'typename.label_one': 'Explorer',
|
|
19
|
+
'typename.label_other': 'Explorers',
|
|
20
|
+
'object-name.placeholder': 'New explorer',
|
|
21
|
+
'add-object.label': 'Add explorer',
|
|
22
|
+
'rename-object.label': 'Rename explorer',
|
|
23
|
+
'delete-object.label': 'Delete explorer',
|
|
24
|
+
'object-deleted.label': 'Explorer deleted',
|
|
21
25
|
},
|
|
22
26
|
[meta.id]: {
|
|
23
|
-
'plugin
|
|
24
|
-
'object
|
|
27
|
+
'plugin.name': 'Explorer',
|
|
28
|
+
'object-title.label': 'Title',
|
|
25
29
|
},
|
|
26
30
|
},
|
|
27
31
|
},
|
|
32
|
+
...componentsTranslations,
|
|
28
33
|
] as const satisfies Resource[];
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Schema from 'effect/Schema';
|
|
6
|
+
|
|
7
|
+
import { TypeInputOptionsAnnotation } from '@dxos/plugin-space';
|
|
8
|
+
|
|
9
|
+
export const GraphProps = Schema.Struct({
|
|
10
|
+
name: Schema.optional(Schema.String),
|
|
11
|
+
// TODO(wittjosiah): This should be a query input instead.
|
|
12
|
+
typename: Schema.String.pipe(
|
|
13
|
+
Schema.annotations({ title: 'Select type' }),
|
|
14
|
+
TypeInputOptionsAnnotation.set({
|
|
15
|
+
location: ['database', 'runtime'],
|
|
16
|
+
kind: ['user'],
|
|
17
|
+
}),
|
|
18
|
+
Schema.optional,
|
|
19
|
+
),
|
|
20
|
+
});
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2024 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Schema from 'effect/Schema';
|
|
6
|
+
|
|
7
|
+
import { DXN, Annotation, Filter, Obj, Query, QueryAST, Ref, Type, View } from '@dxos/echo';
|
|
8
|
+
import { FormInputAnnotation, LabelAnnotation } from '@dxos/echo/Annotation';
|
|
9
|
+
import { ViewAnnotation } from '@dxos/schema';
|
|
10
|
+
|
|
11
|
+
const GraphSchema = Schema.Struct({
|
|
12
|
+
name: Schema.optional(Schema.String),
|
|
13
|
+
view: Ref.Ref(View.View).pipe(FormInputAnnotation.set(false)),
|
|
14
|
+
query: Schema.Struct({
|
|
15
|
+
raw: Schema.optional(Schema.String),
|
|
16
|
+
ast: QueryAST.Query,
|
|
17
|
+
}).pipe(FormInputAnnotation.set(false)),
|
|
18
|
+
}).pipe(
|
|
19
|
+
LabelAnnotation.set(['name']),
|
|
20
|
+
ViewAnnotation.set(['view']),
|
|
21
|
+
Annotation.IconAnnotation.set({ icon: 'ph--graph--regular', hue: 'green' }),
|
|
22
|
+
Type.makeObject(DXN.make('org.dxos.type.graph', '0.1.0')),
|
|
23
|
+
);
|
|
24
|
+
// TODO(wittjosiah): Try to clean up this type inference.
|
|
25
|
+
export interface Graph extends Type.InstanceType<typeof GraphSchema> {}
|
|
26
|
+
export const Graph: Type.Obj<Graph> = GraphSchema as any;
|
|
27
|
+
|
|
28
|
+
type MakeProps = Omit<Partial<Obj.MakeProps<typeof Graph>>, 'view'> & {
|
|
29
|
+
view: View.View;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Make a graph as a view of a data set.
|
|
34
|
+
*/
|
|
35
|
+
export const make = ({
|
|
36
|
+
name,
|
|
37
|
+
query = { raw: '', ast: Query.select(Filter.nothing()).ast },
|
|
38
|
+
view,
|
|
39
|
+
}: MakeProps): Graph => {
|
|
40
|
+
return Obj.make(Graph, { name, view: Ref.make(view), query });
|
|
41
|
+
};
|
package/src/types/index.ts
CHANGED
package/src/typings.d.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Obj } from '@dxos/echo';
|
|
6
|
+
import { getHashHue } from '@dxos/ui-theme';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Returns the SVG `fill` value for a node, derived from its typename via the
|
|
10
|
+
* same hue-hash used by the force-directed renderer. Resolves to a Tailwind
|
|
11
|
+
* color token CSS variable so the value reads consistently across themes.
|
|
12
|
+
*
|
|
13
|
+
* Used by every variant of `ExplorerArticle` so nodes are colored consistently
|
|
14
|
+
* regardless of which layout is rendering them.
|
|
15
|
+
*/
|
|
16
|
+
export const getNodeFillForTypename = (typename: string | undefined): string => {
|
|
17
|
+
return `var(--color-${getHashHue(typename)}-400)`;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
/** Convenience: derive the fill from an ECHO object's typename. */
|
|
21
|
+
export const getNodeFillForObject = (object: Obj.Unknown | undefined): string => {
|
|
22
|
+
return getNodeFillForTypename(object && Obj.getTypename(object));
|
|
23
|
+
};
|
|
@@ -4,12 +4,24 @@
|
|
|
4
4
|
|
|
5
5
|
import type { ChannelValueSpec } from '@observablehq/plot';
|
|
6
6
|
|
|
7
|
-
export type Point = { x: number; y: number };
|
|
8
|
-
export type GeoLocation = { lat: number; lng: number };
|
|
9
|
-
|
|
10
7
|
export type Accessor<T> = (object: any) => T;
|
|
11
8
|
|
|
9
|
+
export type Point = {
|
|
10
|
+
x: number;
|
|
11
|
+
y: number;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export type GeoLocation = {
|
|
15
|
+
lat: number;
|
|
16
|
+
lng: number;
|
|
17
|
+
};
|
|
18
|
+
|
|
12
19
|
export const createAdapter = <T extends Record<string, any>>(
|
|
13
20
|
prop: string,
|
|
14
21
|
accessor: Accessor<T> | undefined,
|
|
15
|
-
): ChannelValueSpec =>
|
|
22
|
+
): ChannelValueSpec =>
|
|
23
|
+
accessor
|
|
24
|
+
? {
|
|
25
|
+
transform: (values) => values.map((value) => accessor(value)[prop]),
|
|
26
|
+
}
|
|
27
|
+
: prop;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
useGraphModel
|
|
3
|
-
} from "./chunk-2MKBRIUT.mjs";
|
|
4
|
-
import {
|
|
5
|
-
D3ForceGraph
|
|
6
|
-
} from "./chunk-L4U4MPSZ.mjs";
|
|
7
|
-
|
|
8
|
-
// src/components/ExplorerContainer.tsx
|
|
9
|
-
import { useSignals as _useSignals } from "@preact-signals/safe-react/tracking";
|
|
10
|
-
import React from "react";
|
|
11
|
-
import { useGlobalSearch } from "@dxos/plugin-search";
|
|
12
|
-
import { getSpace } from "@dxos/react-client/echo";
|
|
13
|
-
import { StackItem } from "@dxos/react-ui-stack";
|
|
14
|
-
var ExplorerContainer = ({ role, view }) => {
|
|
15
|
-
var _effect = _useSignals();
|
|
16
|
-
try {
|
|
17
|
-
const space = getSpace(view);
|
|
18
|
-
const model = useGraphModel(space);
|
|
19
|
-
const { match } = useGlobalSearch();
|
|
20
|
-
if (!space || !model) {
|
|
21
|
-
return null;
|
|
22
|
-
}
|
|
23
|
-
return /* @__PURE__ */ React.createElement(StackItem.Content, {
|
|
24
|
-
size: role === "section" ? "square" : "intrinsic"
|
|
25
|
-
}, /* @__PURE__ */ React.createElement(D3ForceGraph, {
|
|
26
|
-
model,
|
|
27
|
-
match
|
|
28
|
-
}));
|
|
29
|
-
} finally {
|
|
30
|
-
_effect.f();
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
var ExplorerContainer_default = ExplorerContainer;
|
|
34
|
-
export {
|
|
35
|
-
ExplorerContainer_default as default
|
|
36
|
-
};
|
|
37
|
-
//# sourceMappingURL=ExplorerContainer-5QHLD2B2.mjs.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 { useGraphModel } from '../hooks';\nimport { type ViewType } from '../types';\n\nimport { D3ForceGraph } from './Graph';\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,OAAOA,WAAW;AAElB,SAASC,uBAAuB;AAChC,SAASC,gBAAgB;AACzB,SAASC,iBAAiB;AAY1B,IAAMC,oBAAoB,CAAC,EAAEC,MAAMC,KAAI,MAA0B;;;AAC/D,UAAMC,QAAQC,SAASF,IAAAA;AACvB,UAAMG,QAAQC,cAAcH,KAAAA;AAC5B,UAAM,EAAEI,MAAK,IAAKC,gBAAAA;AAElB,QAAI,CAACL,SAAS,CAACE,OAAO;AACpB,aAAO;IACT;AAEA,WACE,sBAAA,cAACI,UAAUC,SAAO;MAACC,MAAMV,SAAS,YAAY,WAAW;OACvD,sBAAA,cAACW,cAAAA;MAAaP;MAAcE;;;;;AAGlC;AAEA,IAAA,4BAAeP;",
|
|
6
|
-
"names": ["React", "useGlobalSearch", "getSpace", "StackItem", "ExplorerContainer", "role", "view", "space", "getSpace", "model", "useGraphModel", "match", "useGlobalSearch", "StackItem", "Content", "size", "D3ForceGraph"]
|
|
7
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
// src/hooks/useGraphModel.ts
|
|
2
|
-
import { useEffect, useState } from "react";
|
|
3
|
-
import { SpaceGraphModel } from "@dxos/schema";
|
|
4
|
-
var useGraphModel = (space, filter, options, queue) => {
|
|
5
|
-
const [model, setModel] = useState(void 0);
|
|
6
|
-
useEffect(() => {
|
|
7
|
-
if (!space) {
|
|
8
|
-
void model?.close();
|
|
9
|
-
setModel(void 0);
|
|
10
|
-
return;
|
|
11
|
-
}
|
|
12
|
-
if (!model || model.queue !== queue) {
|
|
13
|
-
const model2 = new SpaceGraphModel().setFilter(filter).setOptions(options);
|
|
14
|
-
void model2.open(space, queue);
|
|
15
|
-
setModel(model2);
|
|
16
|
-
} else {
|
|
17
|
-
model.setFilter(filter).setOptions(options);
|
|
18
|
-
}
|
|
19
|
-
}, [
|
|
20
|
-
space,
|
|
21
|
-
filter,
|
|
22
|
-
options,
|
|
23
|
-
queue
|
|
24
|
-
]);
|
|
25
|
-
return model;
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
export {
|
|
29
|
-
useGraphModel
|
|
30
|
-
};
|
|
31
|
-
//# sourceMappingURL=chunk-2MKBRIUT.mjs.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 Queue, 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 queue?: Queue,\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 || model.queue !== queue) {\n const model = new SpaceGraphModel().setFilter(filter).setOptions(options);\n void model.open(space, queue);\n setModel(model);\n } else {\n model.setFilter(filter).setOptions(options);\n }\n }, [space, filter, options, queue]);\n\n return model;\n};\n"],
|
|
5
|
-
"mappings": ";AAIA,SAASA,WAAWC,gBAAgB;AAGpC,SAASC,uBAAoD;AAGtD,IAAMC,gBAAgB,CAC3BC,OACAC,QACAC,SACAC,UAAAA;AAEA,QAAM,CAACC,OAAOC,QAAAA,IAAYC,SAAsCC,MAAAA;AAChEC,YAAU,MAAA;AACR,QAAI,CAACR,OAAO;AACV,WAAKI,OAAOK,MAAAA;AACZJ,eAASE,MAAAA;AACT;IACF;AAGA,QAAI,CAACH,SAASA,MAAMD,UAAUA,OAAO;AACnC,YAAMC,SAAQ,IAAIM,gBAAAA,EAAkBC,UAAUV,MAAAA,EAAQW,WAAWV,OAAAA;AACjE,WAAKE,OAAMS,KAAKb,OAAOG,KAAAA;AACvBE,eAASD,MAAAA;IACX,OAAO;AACLA,YAAMO,UAAUV,MAAAA,EAAQW,WAAWV,OAAAA;IACrC;EACF,GAAG;IAACF;IAAOC;IAAQC;IAASC;GAAM;AAElC,SAAOC;AACT;",
|
|
6
|
-
"names": ["useEffect", "useState", "SpaceGraphModel", "useGraphModel", "space", "filter", "options", "queue", "model", "setModel", "useState", "undefined", "useEffect", "close", "SpaceGraphModel", "setFilter", "setOptions", "open"]
|
|
7
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
EXPLORER_PLUGIN
|
|
3
|
-
} from "./chunk-UL5EDJPE.mjs";
|
|
4
|
-
|
|
5
|
-
// src/types/schema.ts
|
|
6
|
-
import { Schema } from "effect";
|
|
7
|
-
import { TypedObject } from "@dxos/echo-schema";
|
|
8
|
-
var ViewType = class extends TypedObject({
|
|
9
|
-
typename: "dxos.org/type/ExplorerView",
|
|
10
|
-
version: "0.1.0"
|
|
11
|
-
})({
|
|
12
|
-
name: Schema.optional(Schema.String),
|
|
13
|
-
type: Schema.String
|
|
14
|
-
}) {
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
// src/types/types.ts
|
|
18
|
-
import { Schema as Schema2 } from "effect";
|
|
19
|
-
(function(ExplorerAction2) {
|
|
20
|
-
const EXPLORER_ACTION = `${EXPLORER_PLUGIN}/action`;
|
|
21
|
-
class Create extends Schema2.TaggedClass()(`${EXPLORER_ACTION}/create`, {
|
|
22
|
-
input: Schema2.Struct({
|
|
23
|
-
name: Schema2.optional(Schema2.String)
|
|
24
|
-
}),
|
|
25
|
-
output: Schema2.Struct({
|
|
26
|
-
object: ViewType
|
|
27
|
-
})
|
|
28
|
-
}) {
|
|
29
|
-
}
|
|
30
|
-
ExplorerAction2.Create = Create;
|
|
31
|
-
})(ExplorerAction || (ExplorerAction = {}));
|
|
32
|
-
var ExplorerAction;
|
|
33
|
-
|
|
34
|
-
export {
|
|
35
|
-
ViewType,
|
|
36
|
-
ExplorerAction
|
|
37
|
-
};
|
|
38
|
-
//# sourceMappingURL=chunk-CZZ3DDR7.mjs.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 { EXPLORER_PLUGIN } from '../meta';\n\nimport { ViewType } from './schema';\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,SAASA,cAAc;AAEvB,SAASC,mBAAmB;AAGrB,IAAMC,WAAN,cAAuBC,YAAY;EACxCC,UAAU;EACVC,SAAS;AACX,CAAA,EAAG;EACDC,MAAMC,OAAOC,SAASD,OAAOE,MAAM;EACnCC,MAAMH,OAAOE;AACf,CAAA,EAAA;AAAI;;;ACXJ,SAASE,UAAAA,eAAc;UAMNC,iBAAAA;AACf,QAAMC,kBAAkB,GAAGC,eAAAA;EAEpB,MAAMC,eAAeC,QAAOC,YAAW,EAAW,GAAGJ,eAAAA,WAA0B;IACpFK,OAAOF,QAAOG,OAAO;MACnBC,MAAMJ,QAAOK,SAASL,QAAOM,MAAM;IACrC,CAAA;IACAC,QAAQP,QAAOG,OAAO;MACpBK,QAAQC;IACV,CAAA;EACF,CAAA,EAAA;EAAI;kBAPSV,SAAAA;AAQf,GAXiBH,mBAAAA,iBAAAA,CAAAA,EAAAA;;",
|
|
6
|
-
"names": ["Schema", "TypedObject", "ViewType", "TypedObject", "typename", "version", "name", "Schema", "optional", "String", "type", "Schema", "ExplorerAction", "EXPLORER_ACTION", "EXPLORER_PLUGIN", "Create", "Schema", "TaggedClass", "input", "Struct", "name", "optional", "String", "output", "object", "ViewType"]
|
|
7
|
-
}
|